@layer reset, tokens, base, components, screens, responsive;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { color-scheme: light dark; }
  body, h1, h2, h3, p { margin: 0; }
  button, input, select, textarea { font: inherit; }
  button { color: inherit; }
}

@layer tokens {
  :root {
    --ivory: #f6f1e8;
    --paper: #fffdf7;
    --navy: #10172f;
    --midnight: #080b18;
    --gold: #a97a2d;
    --bright-gold: #e5bd72;
    --wax: #7c1730;
    --dark-wax: #500b1f;
    --wax-light: #aa2d4b;
    --sage: #2e6d5c;
    --sky: #e8edf8;
    --serif: Iowan Old Style, Baskerville, Georgia, Times New Roman, serif;
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 13px;
    --ease: cubic-bezier(.22,.7,.25,1);
  }

  html[data-theme="dark"] {
    --bg: #070a14;
    --bg-soft: #0e1427;
    --text: #f8f2e8;
    --muted: #aeb5c9;
    --faint: #7f879d;
    --surface: rgba(19, 27, 50, .63);
    --surface-strong: rgba(16, 23, 47, .92);
    --surface-paper: rgba(252, 247, 237, .08);
    --line: rgba(236, 215, 173, .17);
    --line-strong: rgba(229, 189, 114, .42);
    --shadow: 0 30px 80px rgba(0, 0, 0, .38);
    --input: rgba(255, 255, 255, .055);
  }

  html[data-theme="light"] {
    --bg: #eee7da;
    --bg-soft: #f7f1e8;
    --text: #17192a;
    --muted: #626778;
    --faint: #868b96;
    --surface: rgba(255, 253, 247, .69);
    --surface-strong: rgba(255, 253, 247, .93);
    --surface-paper: rgba(255, 253, 247, .76);
    --line: rgba(119, 84, 34, .14);
    --line-strong: rgba(169, 122, 45, .38);
    --shadow: 0 28px 70px rgba(64, 42, 16, .13);
    --input: rgba(255, 255, 255, .72);
  }
}

@layer base {
  html { min-width: 320px; background: var(--bg); }
  body {
    min-height: 100dvh;
    overflow-x: hidden;
    background:
      radial-gradient(circle at 76% 0%, color-mix(in srgb, var(--bright-gold) 13%, transparent), transparent 31rem),
      radial-gradient(circle at 20% 90%, color-mix(in srgb, var(--wax) 12%, transparent), transparent 34rem),
      var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-weight: 400;
    letter-spacing: -.01em;
  }
  body::before {
    position: fixed; inset: 0; pointer-events: none; content: ""; opacity: .18;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
  }
  button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
  button { border: 0; cursor: pointer; }
  button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--bright-gold); outline-offset: 3px; }
  .skip-link { position: fixed; top: 8px; left: 8px; z-index: 100; translate: 0 -150%; padding: 10px 14px; border-radius: 10px; background: var(--paper); color: var(--navy); }
  .skip-link:focus { translate: 0; }
  h1, h2, h3, .serif { font-family: var(--serif); font-weight: 400; }
  h1 { max-width: 780px; font-size: clamp(2.7rem, 5.4vw, 5.7rem); line-height: .96; letter-spacing: -.045em; }
  h2 { font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.02; letter-spacing: -.035em; }
  h3 { font-size: 1.35rem; line-height: 1.13; }
  p { color: var(--muted); line-height: 1.65; }
  .eyebrow { color: var(--bright-gold); font-size: .72rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
  .ambient { position: fixed; width: 24rem; aspect-ratio: 1; pointer-events: none; filter: blur(90px); opacity: .12; }
  .ambient-one { top: -12rem; right: 10%; background: var(--bright-gold); }
  .ambient-two { bottom: -14rem; left: 20%; background: var(--wax); }
}

@layer components {
  .app-shell { display: grid; grid-template-columns: 172px minmax(0, 1fr); min-height: 100dvh; padding: 18px; gap: 18px; }
  .sidebar, .main-stage, .glass-card {
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08), var(--shadow);
    backdrop-filter: blur(22px) saturate(125%);
    -webkit-backdrop-filter: blur(22px) saturate(125%);
  }
  .sidebar { position: sticky; top: 18px; display: flex; flex-direction: column; width: 100%; height: calc(100dvh - 36px); padding: 24px 22px; border-radius: var(--radius-lg); }
  .seal {
    position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 58px; aspect-ratio: 1; margin: 0 auto;
    border-radius: 46% 54% 49% 51% / 52% 46% 54% 48%;
    background: radial-gradient(circle at 34% 27%, var(--wax-light), var(--wax) 39%, var(--dark-wax) 77%);
    box-shadow: inset 3px 3px 6px rgba(255,255,255,.16), inset -5px -6px 9px rgba(30,0,8,.38), 0 8px 18px rgba(36,0,10,.36);
  }
  .seal::before { position: absolute; inset: 9px; content: ""; border: 1px solid var(--bright-gold); border-radius: 50%; box-shadow: inset 0 0 5px rgba(229,189,114,.35); }
  .seal::after { position: absolute; top: 10px; left: 14px; width: 13px; height: 5px; border-radius: 50%; content: ""; background: rgba(255,255,255,.23); rotate: -28deg; filter: blur(1px); }
  .seal span { z-index: 1; color: var(--bright-gold); font-family: var(--serif); font-size: 1.6rem; text-shadow: 0 1px rgba(0,0,0,.5); }
  .seal-logo { background-color: transparent; }
  .side-nav { display: grid; gap: 8px; margin-top: 54px; }
  .nav-item { display: inline-flex; align-items: center; width: 100%; min-height: 44px; padding: 0 12px; gap: 10px; border: 1px solid transparent; border-radius: var(--radius-sm); background: transparent; color: var(--muted); font-size: .86rem; white-space: nowrap; }
  .nav-item:hover, .nav-item.is-active { border-color: var(--line); background: var(--surface-paper); color: var(--text); box-shadow: inset 0 1px rgba(255,255,255,.06); }
  .nav-item.is-active .nav-icon { color: var(--bright-gold); }
  [data-icon] { display: inline-grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; }
  [data-icon] svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .side-footer { margin-top: auto; padding: 15px 4px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .71rem; line-height: 1.45; }
  .side-footer small { display: block; margin-top: 4px; color: var(--faint); }
  .main-stage { min-width: 0; min-height: calc(100dvh - 36px); border-radius: var(--radius-lg); overflow: hidden; }
  .topbar { display: flex; align-items: center; justify-content: space-between; min-height: 78px; padding: 0 clamp(22px, 4vw, 64px); border-bottom: 1px solid var(--line); }
  .top-actions { display: flex; align-items: center; gap: 10px; }
  .key-chip, .status-chip { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; gap: 7px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-paper); color: var(--text); font-size: .78rem; white-space: nowrap; }
  .key-chip > span:first-child { color: var(--bright-gold); }
  .icon-button { display: inline-grid; place-items: center; width: 40px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 50%; background: var(--surface-paper); }
  #app { min-height: calc(100dvh - 115px); }
  .screen { width: min(1200px, 100%); margin: 0 auto; padding: clamp(38px, 6vw, 82px) clamp(22px, 5vw, 76px) 96px; animation: screen-in .5s var(--ease) both; }
  @keyframes screen-in { from { opacity: 0; translate: 0 12px; } }
  .lede { max-width: 640px; margin-top: 18px; font-size: clamp(.98rem, 1.5vw, 1.12rem); }
  .screen-header { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
  .screen-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
  .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px; gap: 7px; border-radius: 999px; font-weight: 500; white-space: nowrap; transition: transform .2s ease, box-shadow .2s ease, background .2s ease; }
  .button:hover { transform: translateY(-1px); }
  .button-gold { background: linear-gradient(180deg, #eccb8b, var(--bright-gold)); color: #211607; box-shadow: 0 9px 28px rgba(169,122,45,.24), inset 0 1px rgba(255,255,255,.5); }
  .button-dark { background: var(--navy); color: var(--ivory); box-shadow: inset 0 1px rgba(255,255,255,.1); }
  .button-glass { border: 1px solid var(--line); background: var(--surface-paper); color: var(--text); }
  .button-text { min-height: 40px; padding: 0 10px; background: transparent; color: var(--muted); }
  .button:disabled { cursor: not-allowed; filter: grayscale(.5); opacity: .55; transform: none; }
  .glass-card { border-radius: var(--radius-md); }
  .verified { color: #72bba6; }
  .gold { color: var(--bright-gold); }
  .muted { color: var(--muted); }
  .mobile-nav { display: none; }
  .toast-region { position: fixed; right: 24px; bottom: 24px; z-index: 80; display: grid; gap: 10px; }
  .toast { max-width: 360px; padding: 14px 18px; border: 1px solid var(--line-strong); border-radius: 14px; background: var(--surface-strong); color: var(--text); box-shadow: var(--shadow); animation: toast-in .35s var(--ease) both; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
  .empty-state { padding: 48px; text-align: center; }
  .empty-state p { margin: 10px auto 22px; max-width: 460px; }
}

@layer screens {
  .explore-title em { color: var(--bright-gold); font-style: italic; }
  .collection-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
  .wish-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: clamp(14px, 2.3vw, 28px); margin-top: 44px; }
  .wish-card { min-width: 0; padding: 18px; overflow: hidden; text-align: left; transition: transform .35s var(--ease), border-color .35s ease; }
  .wish-card:nth-child(2) { margin-top: 28px; }
  .wish-card:hover { transform: translateY(-5px); border-color: var(--line-strong); }
  .wish-card:nth-child(2):hover { transform: translateY(23px); }
  .wish-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; color: var(--muted); font-size: .73rem; }
  .wish-value { color: var(--text); font-family: var(--serif); font-size: clamp(2rem, 3.3vw, 3.5rem); }
  .share-label { display: inline-flex; align-items: center; min-height: 29px; padding: 0 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--bright-gold); white-space: nowrap; }
  .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: .74rem; }
  .envelope-wrap { display: grid; place-items: center; min-height: 180px; padding: 18px 10px; perspective: 800px; }
  .envelope {
    position: relative; width: min(100%, 260px); aspect-ratio: 1.55 / 1; border: 1px solid rgba(169,122,45,.6); border-radius: 8px; overflow: visible;
    background: linear-gradient(145deg, #fffdf8, #eadfcb); box-shadow: 0 22px 28px rgba(4,5,12,.22), inset 0 0 0 3px rgba(255,255,255,.32);
  }
  .envelope::before { position: absolute; inset: 0; z-index: 1; content: ""; clip-path: polygon(0 0, 50% 62%, 100% 0); background: linear-gradient(160deg, #fffdf7, #efe2cd); filter: drop-shadow(0 1px 0 rgba(169,122,45,.7)); }
  .envelope::after { position: absolute; inset: 0; z-index: 2; content: ""; clip-path: polygon(0 100%, 0 1%, 50% 62%, 100% 1%, 100% 100%); background: linear-gradient(155deg, #f0e3ce, #fffaf0); filter: drop-shadow(0 -1px 0 rgba(169,122,45,.55)); }
  .envelope .seal { position: absolute; z-index: 5; top: 62%; left: 50%; width: 58px; transform: translate(-50%, -50%); animation: seal-breathe 2.8s ease-in-out infinite; }
  .large-envelope { width: min(78vw, 520px); }
  .large-envelope .seal { width: 84px; }
  .floating { animation: float 2.8s var(--ease) infinite alternate; }
  @keyframes float { from { transform: translateY(12px) rotate(-1.2deg) scale(.99); filter: drop-shadow(0 12px 8px rgba(0,0,0,.22)); } to { transform: translateY(-12px) rotate(1.3deg) scale(1.015); filter: drop-shadow(0 30px 15px rgba(0,0,0,.12)); } }
  @keyframes seal-breathe { 50% { filter: drop-shadow(0 0 8px rgba(229,189,114,.45)); } }
  .open-screen { text-align: center; }
  .open-screen .lede { margin-left: auto; margin-right: auto; }
  .envelope-stage { display: grid; place-items: center; min-height: clamp(300px, 48vh, 520px); margin: 34px 0; padding: 48px; overflow: hidden; }
  .stage-note { max-width: 410px; margin: 14px auto 0; font-size: .83rem; }
  .reveal-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr); gap: 24px; margin-top: 40px; }
  .story-card, .summary-card, .payment-card, .form-card { padding: clamp(22px, 3.5vw, 40px); }
  .wish-number { display: flex; align-items: center; gap: 9px; margin-bottom: 20px; color: var(--bright-gold); font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; }
  .wish-story { margin-top: 24px; color: var(--text); font-family: var(--serif); font-size: clamp(1.2rem, 2.2vw, 1.7rem); line-height: 1.5; }
  .detail-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
  .detail-chips .status-chip { min-height: 34px; }
  .summary-list { display: grid; gap: 15px; margin-top: 25px; }
  .summary-row { display: flex; justify-content: space-between; align-items: baseline; gap: 18px; padding-bottom: 15px; border-bottom: 1px solid var(--line); color: var(--muted); }
  .summary-row strong { color: var(--text); font-family: var(--serif); font-size: 1.35rem; font-weight: 400; white-space: nowrap; }
  .summary-card .button { width: 100%; margin-top: 24px; }
  .share-progress { height: 5px; margin-top: 24px; border-radius: 99px; background: var(--line); overflow: hidden; }
  .share-progress span { display: block; height: 100%; border-radius: inherit; background: var(--bright-gold); }
  .share-progress .progress-0 { width: 0; }
  .share-progress .progress-20 { width: 20%; }
  .share-progress .progress-25 { width: 25%; }
  .share-progress .progress-33 { width: 33%; }
  .share-progress .progress-40 { width: 40%; }
  .share-progress .progress-50 { width: 50%; }
  .share-progress .progress-60 { width: 60%; }
  .share-progress .progress-67 { width: 67%; }
  .share-progress .progress-75 { width: 75%; }
  .share-progress .progress-80 { width: 80%; }
  .share-progress .progress-100 { width: 100%; }
  .reserve-intro { max-width: 590px; }
  .package-grid { display: grid; grid-template-columns: repeat(5, minmax(110px, 1fr)); gap: 12px; margin: 36px 0; }
  .package { position: relative; min-height: 145px; padding: 20px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-paper); text-align: left; }
  .package.is-complete { opacity: .55; }
  .package.is-selected { border-color: var(--bright-gold); background: color-mix(in srgb, var(--bright-gold) 10%, var(--surface-paper)); box-shadow: inset 0 0 0 1px rgba(229,189,114,.2); }
  .package-index { color: var(--bright-gold); font-size: .74rem; letter-spacing: .1em; }
  .package strong { display: block; margin-top: 28px; font-family: var(--serif); font-size: 1.4rem; font-weight: 400; }
  .package small { display: block; margin-top: 7px; color: var(--muted); }
  .notice { display: flex; align-items: flex-start; gap: 12px; padding: 17px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-paper); color: var(--muted); font-size: .82rem; line-height: 1.55; }
  .notice [data-icon] { color: var(--bright-gold); }
  .reserve-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; }
  .payment-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .7fr); gap: 24px; margin-top: 38px; }
  .bpay-mark { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; border: 2px solid var(--text); border-radius: 5px; color: var(--text); font-weight: 500; letter-spacing: .06em; }
  .payment-brand { display: inline-flex; align-items: center; min-height: 38px; padding: 0 12px; font-weight: 500; letter-spacing: .04em; }
  .post-billpay-mark { border-radius: 5px; background: #d71920; color: #fff; box-shadow: inset 0 0 0 2px rgba(255,255,255,.22); }
  .pay-amount { margin: 28px 0 10px; font-family: var(--serif); font-size: clamp(3rem, 6vw, 5rem); }
  .bpay-list { display: grid; gap: 0; margin-top: 25px; }
  .bpay-row { padding: 16px 0; border-top: 1px solid var(--line); }
  .bpay-row span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
  .bpay-row strong { display: block; margin-top: 6px; font-family: var(--serif); font-size: 1.45rem; font-weight: 400; letter-spacing: .04em; }
  .countdown { color: var(--bright-gold); }
  .payment-side { display: flex; flex-direction: column; gap: 14px; }
  .payment-side .button { width: 100%; }
  .form-wrap { max-width: 820px; margin: 38px auto 0; }
  .stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 28px; }
  .stepper span { height: 3px; border-radius: 9px; background: var(--line); }
  .stepper span.is-active { background: var(--bright-gold); }
  .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
  .field { display: grid; gap: 8px; }
  .field-wide { grid-column: 1 / -1; }
  .field label { color: var(--muted); font-size: .78rem; }
  .field input, .field select, .field textarea { width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--input); color: var(--text); }
  .field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
  .upload { position: relative; display: grid; place-items: center; min-height: 150px; padding: 22px; border: 1px dashed var(--line-strong); border-radius: 15px; background: color-mix(in srgb, var(--bright-gold) 5%, var(--surface-paper)); text-align: center; }
  .upload input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
  .upload [data-icon] { width: 28px; height: 28px; margin-bottom: 9px; color: var(--bright-gold); }
  .upload small { display: block; margin-top: 5px; color: var(--muted); }
  .form-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 26px; }
  .privacy-review { display: grid; gap: 14px; margin-top: 26px; }
  .privacy-item { display: flex; align-items: flex-start; gap: 13px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; }
  .privacy-item [data-icon] { color: #72bba6; }
  .split-selector { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 27px 0; }
  .split-option { min-height: 90px; padding: 12px 8px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-paper); }
  .split-option.is-selected { border-color: var(--bright-gold); color: var(--bright-gold); }
  .split-option span { display: block; font-size: .73rem; }
  .split-option strong { display: block; margin-top: 12px; font-family: var(--serif); font-size: 1.15rem; font-weight: 400; }
  .constellation-panel { position: relative; min-height: min(62vh, 620px); margin-top: 35px; overflow: hidden; background: linear-gradient(145deg, rgba(8,11,24,.98), rgba(16,23,47,.86)); color: var(--ivory); }
  .constellation-panel::before { position: absolute; inset: 0; content: ""; opacity: .6; background-image: radial-gradient(circle, rgba(255,255,255,.8) 0 1px, transparent 1.5px); background-size: 59px 71px; }
  .sky-copy { position: absolute; z-index: 3; top: clamp(28px, 6vw, 64px); left: clamp(25px, 6vw, 70px); max-width: 390px; }
  .sky-copy p { color: #aeb5c9; }
  .sky-stats { display: flex; gap: 22px; margin-top: 25px; color: var(--bright-gold); }
  .sky-stats strong { display: block; font-family: var(--serif); font-size: 2rem; font-weight: 400; }
  .sky-stats small { color: #9ea7c0; }
  .constellation-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
  .constellation-svg line, .constellation-svg path { stroke: rgba(229,189,114,.45); stroke-width: 1; fill: none; }
  .constellation-svg .future { stroke-dasharray: 5 7; opacity: .55; }
  .constellation-svg circle { fill: var(--bright-gold); filter: drop-shadow(0 0 8px rgba(229,189,114,.8)); }
  .constellation-svg .big-star { fill: var(--ivory); filter: drop-shadow(0 0 17px rgba(229,189,114,1)); }
  .sky-label { position: absolute; z-index: 4; color: #ccd1de; font-size: .68rem; white-space: nowrap; }
  .sky-label.one { left: 48%; top: 62%; }
  .sky-label.two { left: 68%; top: 39%; color: var(--bright-gold); }
  .sky-label.three { left: 79%; top: 71%; }
  .echo-card { position: absolute; z-index: 4; right: clamp(20px, 4vw, 48px); bottom: clamp(18px, 4vw, 42px); width: min(330px, calc(100% - 40px)); padding: 20px; border-color: rgba(229,189,114,.2); background: rgba(255,255,255,.07); }
  .echo-card small { color: var(--bright-gold); }
  .echo-card p { margin-top: 10px; color: #e6dfd3; font-family: var(--serif); font-size: 1.15rem; }
  .help-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin-top: 34px; }
  .history-card { padding: 24px; }
  .history-card small { color: var(--bright-gold); }
  .history-card h3 { margin: 12px 0 7px; }
  .history-amount { display: block; margin-top: 18px; color: var(--bright-gold); font-family: var(--serif); font-size: 1.6rem; font-weight: 400; }
  .history-date { display: block; margin-top: 15px; color: var(--faint); font-size: .72rem; }
  .submission-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .attachment-status { display: flex; align-items: center; gap: 8px; margin-top: 18px; color: var(--muted); font-size: .78rem; }
  .attachment-status [data-icon] { width: 17px; height: 17px; }
  .auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(330px, .72fr); align-items: center; gap: clamp(30px, 7vw, 90px); min-height: 64vh; }
  .auth-envelope { width: min(70%, 320px); margin: 65px auto 0; }
  .auth-card { display: grid; gap: 18px; padding: clamp(24px, 4vw, 40px); }
  .billing-section { margin-top: 58px; }
  .billing-section > p { margin-top: 10px; }
  .pricing-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 24px; }
  .membership-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
  .price-card { display: flex; flex-direction: column; min-height: 255px; padding: 22px 18px; }
  .price-card.is-current { border-color: var(--line-strong); }
  .price-card h3 { margin-top: 16px; }
  .price-card > strong { display: block; margin-top: 24px; font-family: var(--serif); font-size: 1.35rem; font-weight: 400; }
  .price-card > p { margin: 7px 0 22px; font-size: .78rem; }
  .price-card .button { width: 100%; margin-top: auto; padding-inline: 12px; font-size: .78rem; }
  .key-balance { display: grid; min-width: 150px; padding: 18px 22px; color: var(--bright-gold); font-family: var(--serif); font-size: 2.7rem; text-align: right; }
  .key-balance small { color: var(--muted); font-family: var(--sans); font-size: .68rem; }
  .account-card { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; max-width: 680px; margin-top: 36px; padding: 28px; }
  .account-card > div { padding: 16px; border: 1px solid var(--line); border-radius: 14px; }
  .account-card span { display: block; color: var(--muted); font-size: .75rem; }
  .account-card strong { display: block; margin-top: 8px; font-family: var(--serif); font-size: 1.5rem; font-weight: 400; }
  .review-list { display: grid; gap: 22px; margin-top: 34px; }
  .review-card { padding: clamp(22px, 4vw, 38px); }
  .review-summary { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
  .review-summary h3 { margin: 8px 0; }
  [hidden] { display: none !important; }
}

@layer responsive {
  @media (max-width: 960px) {
    .app-shell { grid-template-columns: 146px minmax(0, 1fr); gap: 12px; padding: 12px; }
    .sidebar { top: 12px; height: calc(100dvh - 24px); padding: 22px 20px; }
    .wish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wish-card:nth-child(3) { display: none; }
    .reveal-layout, .payment-layout { grid-template-columns: 1fr; }
    .package-grid { grid-template-columns: repeat(3, 1fr); }
    .pricing-grid, .membership-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  }

  @media (max-width: 660px) {
    body { padding-bottom: 92px; }
    .app-shell { display: block; min-height: auto; padding: 0; }
    .sidebar { display: none; }
    .main-stage { min-height: 100dvh; border: 0; border-radius: 0; box-shadow: none; }
    .topbar { min-height: 68px; padding: max(12px, env(safe-area-inset-top)) 20px 0; }
    .mobile-nav { position: fixed; z-index: 50; right: 12px; bottom: max(10px, env(safe-area-inset-bottom)); left: 12px; display: grid; grid-template-columns: repeat(5, 1fr); min-height: 66px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface-strong); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.08); backdrop-filter: blur(24px) saturate(140%); }
    .mobile-nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: transparent; color: var(--muted); font-size: .66rem; }
    .mobile-nav-item.is-active { color: var(--bright-gold); }
    .mobile-nav-item [data-icon] { width: 19px; height: 19px; }
    .mobile-create [data-icon] { width: 34px; height: 34px; margin-top: -23px; border-radius: 50%; background: var(--bright-gold); color: var(--navy); box-shadow: 0 6px 18px rgba(169,122,45,.32); }
    .screen { padding: 36px 18px 108px; }
    h1 { font-size: clamp(2.65rem, 14vw, 4.2rem); }
    .screen-header { display: block; }
    .screen-actions { margin-top: 24px; }
    .wish-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 30px; }
    .wish-card:nth-child(2) { margin-top: 0; }
    .wish-card:nth-child(2):hover { transform: translateY(-5px); }
    .wish-card:nth-child(3) { display: block; }
    .envelope-wrap { min-height: 170px; }
    .envelope-stage { min-height: 320px; margin: 25px 0; padding: 35px 20px; }
    .reveal-layout { margin-top: 28px; }
    .package-grid { grid-template-columns: repeat(2, 1fr); }
    .package { min-height: 125px; }
    .reserve-actions, .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .reserve-actions .button, .form-actions .button { width: 100%; }
    .form-grid { grid-template-columns: 1fr; }
    .field-wide { grid-column: auto; }
    .split-selector { grid-template-columns: repeat(3, 1fr); }
    .constellation-panel { min-height: 680px; }
    .sky-copy { right: 25px; }
    .constellation-svg { top: 130px; height: 65%; }
    .sky-label.one { left: 30%; top: 59%; }
    .sky-label.two { left: 62%; top: 49%; }
    .sky-label.three { left: 67%; top: 69%; }
    .help-grid { grid-template-columns: 1fr; }
    .auth-layout { grid-template-columns: 1fr; min-height: auto; }
    .auth-envelope { display: none; }
    .pricing-grid, .membership-grid { grid-template-columns: 1fr; }
    .price-card { min-height: 220px; }
    .key-balance { margin-top: 22px; text-align: left; }
    .account-card { grid-template-columns: 1fr; }
    .review-summary { flex-direction: column; }
    .toast-region { right: 12px; bottom: 92px; left: 12px; }
    .toast { max-width: none; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  }
}
