/* ---------- tokens ---------- */
  :root {
    --ink:        #3F2A1E;
    --ink-soft:   #7A6052;
    --ink-faint:  #7B6453;   /* 4.89:1 on --ground, 5.54:1 on --card. The page does NOT set
                                data-theme by default, so THIS is the value that ships — an
                                earlier "fix" only touched :root[data-theme="light"] and
                                changed nothing on screen. */
    --ground:     #FBEFE1;
    --ground-2:   #F3E2CF;
    --card:       #FFFFFF;
    --line:       #EADCCB;
    --bear:       #BC8551;
    --bear-deep:  #8E5E33;
    --panda:      #FDFAF5;
    --panda-deep: #3F2A1E;
    --snout:      #E8CBA9;
    --blush:      #F4ABA4;
    --coin:       #F4B63D;
    --coin-deep:  #CE8D14;
    --mint:       #3F7F5B;   /* 4.57:1 under #FFF9F2 label */
    --clay:       #B8492F;   /* 4.98:1 under #FFF9F2 label */
    --clay-soft:  #FBE6DF;
    --on-action:  #FFF9F2;   /* label colour on the mint/clay buttons */
    --flag-fg:    #A63F27;   /* 5.20:1 on --clay-soft */
    --shadow:     rgba(63, 42, 30, .16);
    --r-md: 16px; --r-lg: 24px; --r-xl: 34px;
    --font: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI Variable Display",
            "Hiragino Maru Gothic ProN", "Varela Round", system-ui, sans-serif;
  }
  @media (prefers-color-scheme: dark) {
    :root {
      --ink: #F6E9DC; --ink-soft: #C3AC9B; --ink-faint: #A8907C; --mint: #5FB87F; --clay: #E2594F; --on-action: #1A120B;
      --ground: #241910; --ground-2: #19110A; --card: #33251B; --line: #4A382A;
      --panda: #F3EADF; --snout: #C9A47C; --flag-fg: #F3B5A8;
      --clay-soft: #402823; --shadow: rgba(0, 0, 0, .5);
    }
  }
  :root[data-theme="dark"] {
    --ink:#F6E9DC; --ink-soft:#C3AC9B; --ink-faint:#A8907C; --mint:#5FB87F; --clay:#E2594F; --on-action:#1A120B;
    --ground:#241910; --ground-2:#19110A; --card:#33251B; --line:#4A382A;
    --panda:#F3EADF; --snout:#C9A47C; --flag-fg:#F3B5A8; --clay-soft:#402823; --shadow:rgba(0,0,0,.5);
  }
  :root[data-theme="light"] {
    --ink:#3F2A1E; --ink-soft:#7A6052; --ink-faint:#7B6453;
    --ground:#FBEFE1; --ground-2:#F3E2CF; --card:#FFFFFF; --line:#EADCCB;
    --panda:#FDFAF5; --snout:#E8CBA9; --clay-soft:#FBE6DF; --shadow:rgba(63,42,30,.16);
  }

  /* ---------- Christmas season ----------
     A second palette layered on top of the light/dark tokens. The viewer's light/dark
     choice still applies: there is a snow-bright Christmas and a deep-pine one. */
  :root[data-season="xmas"] {
    --ground: #EAF3EC; --ground-2: #D7E7DB; --card: #FFFFFF; --line: #CFE0D4;
    --mint: #2E7D52; --clay: #CE3B34; --ink-faint: #556A5E; --ink-soft: #46584D;
    --shadow: rgba(30, 58, 40, .18);
  }
  @media (prefers-color-scheme: dark) {
    :root[data-season="xmas"]:not([data-theme="light"]) {
      --ground: #13241B; --ground-2: #0C1812; --card: #1D3025; --line: #30483A;
      --ink: #F2EEE2; --ink-soft: #AFC0B4; --ink-faint: #9DB3A5;
      --mint: #5FB87F; --clay: #E2594F; --on-action: #1A120B; --shadow: rgba(0, 0, 0, .55);
    }
  }
  :root[data-season="xmas"][data-theme="dark"] {
    --ground: #13241B; --ground-2: #0C1812; --card: #1D3025; --line: #30483A;
    --ink: #F2EEE2; --ink-soft: #AFC0B4; --ink-faint: #9DB3A5;
    --mint: #5FB87F; --clay: #E2594F; --on-action: #1A120B; --shadow: rgba(0, 0, 0, .55);
  }

  .snow { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 1; }
  .snow i {
    position: absolute; top: -12px; border-radius: 50%; background: #FFFFFF;
    opacity: .85; animation: fall linear infinite;
  }
  @media (prefers-color-scheme: dark) { .snow i { opacity: .55; } }
  @keyframes fall {
    0%   { transform: translateY(-14px) translateX(0); }
    100% { transform: translateY(820px) translateX(22px); }
  }

  /* season toggle in the app bar */
  .seasonBtn {
    width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center;
    border: 2.5px solid var(--ink); background: var(--card); box-shadow: 0 2.5px 0 var(--ink);
    font-size: 17px; line-height: 1; padding: 0;
  }
  .seasonBtn:active { transform: translateY(2.5px); box-shadow: 0 0 0 var(--ink); }
  .seasonBtn:focus-visible { outline: 3px solid var(--coin); outline-offset: 2px; }
  :root[data-season="xmas"] .seasonBtn { background: var(--clay); }

  * { box-sizing: border-box; }
  body {
    margin: 0; font-family: var(--font); color: var(--ink);
    background: radial-gradient(1100px 640px at 50% -14%, var(--ground) 0%, var(--ground-2) 70%);
    min-height: 100vh; -webkit-font-smoothing: antialiased;
  }
  .page { display: flex; flex-direction: column; align-items: center; gap: 20px; padding: 32px 16px 54px; }

  .masthead { text-align: center; display: flex; flex-direction: column; gap: 7px; align-items: center; }
  .masthead .pair { display: flex; align-items: flex-end; }
  .masthead .pair .face { width: 58px; height: 58px; }
  .masthead .pair .face:last-child { margin-left: -12px; }

  /* character portraits, cropped from the sticker set.
     .face is the sized box and stays overflow:visible so a santa hat can sit proud of
     the circle; .clip is the round window the portrait is cropped into. */
  .face { position: relative; display: inline-block; flex: none; line-height: 0; }
  .face .clip {
    position: absolute; inset: 0; border-radius: 50%; overflow: hidden;
    background: #FFFFFF; border: 2.5px solid var(--ink); box-shadow: 0 2px 0 var(--ink);
  }
  /* contain, not cover: a circular cover-crop lops the ears off the top of both characters */
  .face .clip img { width: 100%; height: 100%; object-fit: contain; display: block; }
  .face.noart .clip {
    display: grid; place-items: center; line-height: 1; font-size: .62em;
    background: var(--ground-2);
  }

  .masthead h1 { margin: 0; font-size: 31px; font-weight: 800; letter-spacing: -.6px; }
  .masthead p { margin: 0; color: var(--ink-soft); font-size: 13.5px; max-width: 38ch; line-height: 1.6; }
  .tag {
    font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase;
    color: var(--coin-deep); background: color-mix(in srgb, var(--coin) 24%, transparent);
    padding: 4px 11px; border-radius: 99px;
  }

  /* ---------- phone ---------- */
  .phone {
    position: relative; width: min(390px, calc(100vw - 32px));
    height: min(790px, calc(100vh - 36px)); min-height: 600px;
    background: var(--ground); border: 9px solid var(--ink); border-radius: var(--r-xl);
    box-shadow: 0 26px 60px var(--shadow); overflow: hidden; display: flex; flex-direction: column;
  }
  .notch {
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 116px; height: 23px; background: var(--ink); border-radius: 0 0 14px 14px; z-index: 40;
  }
  .appbar { flex: none; padding: 30px 17px 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .nameBtn {
    display: flex; align-items: center; gap: 9px; border: 0; background: none;
    padding: 2px; border-radius: 12px; color: inherit; text-align: left;
    min-width: 0; flex: 1 1 auto;      /* a long name must shrink, not shove the purse away */
  }
  .nameBtn > span:last-child { min-width: 0; }
  .nameBtn .face { width: 38px; height: 38px; }
  .nameBtn b { font-size: 15px; font-weight: 800; display: block; line-height: 1.15;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .nameBtn small { font-size: 11px; color: var(--ink-soft); }
  .purse {
    display: flex; align-items: center; gap: 6px; background: var(--card);
    border: 2.5px solid var(--ink); border-radius: 99px; padding: 5px 13px 5px 7px;
    box-shadow: 0 2.5px 0 var(--ink); font-weight: 800; font-size: 15px;
    font-variant-numeric: tabular-nums; flex: none;
  }
  .purse svg { width: 19px; height: 19px; }
  .purse.neg { color: var(--clay); }

  .screen { flex: 1 1 auto; overflow-y: auto; padding: 6px 17px 18px; }
  .screen::-webkit-scrollbar { width: 5px; }
  .screen::-webkit-scrollbar-thumb { background: var(--line); border-radius: 9px; }

  .view { display: none; flex-direction: column; gap: 13px; animation: fade .26s ease both; }
  .view.on { display: flex; }
  @keyframes fade { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }

  h2.sec {
    margin: 5px 0 -3px; font-size: 10.5px; font-weight: 800; letter-spacing: .14em;
    text-transform: uppercase; color: var(--ink-faint);
  }

  .card {
    background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--r-lg);
    box-shadow: 0 4px 0 var(--ink); padding: 15px; position: relative;
  }
  .card.empty { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 26px 16px; }

  .hero { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 18px 16px 16px; }
  .hero .face.avatar { width: 94px; height: 94px; }
  .hero .face.avatar .clip { box-shadow: 0 3px 0 var(--ink); }
  .hero .label { font-size: 11.5px; color: var(--ink-soft); font-weight: 700; margin-top: 2px; }
  .hero .bal {
    display: flex; align-items: center; gap: 8px; font-size: 44px; font-weight: 800;
    letter-spacing: -1.6px; font-variant-numeric: tabular-nums; line-height: 1.1;
  }
  .hero .bal svg { width: 30px; height: 30px; }
  .hero .bal.neg { color: var(--clay); }
  .hero .trend { font-size: 12px; color: var(--ink-soft); font-weight: 600; }
  .bump { animation: pop .55s cubic-bezier(.3,1.6,.5,1); }
  @keyframes pop { 0%{transform:scale(1)} 34%{transform:scale(1.17)} 100%{transform:scale(1)} }

  /* rises out of the top of the card, so it never sits on the character's face */
  .float {
    position: absolute; top: 4px; left: 50%; font-size: 26px; font-weight: 800;
    pointer-events: none; z-index: 5; animation: rise 1.1s ease-out forwards;
    text-shadow: 0 2px 0 var(--card), 0 -2px 0 var(--card), 2px 0 0 var(--card), -2px 0 0 var(--card);
  }
  @keyframes rise {
    0%   { opacity: 0; transform: translate(-50%, 16px) scale(.7); }
    24%  { opacity: 1; transform: translate(-50%, 0) scale(1.14); }
    100% { opacity: 0; transform: translate(-50%, -54px) scale(1); }
  }

  .partner { display: flex; align-items: center; gap: 12px; }
  .partner .face.avatar { width: 64px; height: 64px; }
  .partner .meta { flex: 1 1 auto; min-width: 0; }
  .partner .meta b { display: block; font-size: 15.5px; font-weight: 800;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .partner .meta .bal2 {
    font-size: 25px; font-weight: 800; font-variant-numeric: tabular-nums;
    letter-spacing: -.7px; display: flex; align-items: center; gap: 6px; line-height: 1.25;
  }
  .partner .meta .bal2 svg { width: 18px; height: 18px; }
  .partner .meta .bal2.neg { color: var(--clay); }
  .partner .meta small { color: var(--ink-soft); font-size: 11.5px; }
  .pair-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 13px; }

  button { font-family: inherit; cursor: pointer; }
  .btn {
    border: 2.5px solid var(--ink); border-radius: var(--r-md); background: var(--card);
    color: var(--ink); font-weight: 800; font-size: 14.5px; padding: 12px 14px;
    box-shadow: 0 3px 0 var(--ink); transition: transform .08s ease, box-shadow .08s ease;
    display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%;
  }
  .btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
  .btn:focus-visible { outline: 3px solid var(--coin); outline-offset: 3px; }
  .btn.good { background: var(--mint); color: var(--on-action); }
  .btn.bad  { background: var(--clay); color: var(--on-action); }
  .btn.coin { background: var(--coin); }
  .btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
  .btn.sm { font-size: 12.5px; padding: 8px 13px; box-shadow: 0 2.5px 0 var(--ink); border-width: 2px; width: auto; white-space: nowrap; }
  .btn.sm svg { width: 14px; height: 14px; flex: none; }
  .btn.ghost { background: transparent; box-shadow: none; border-style: dashed; color: var(--ink-soft); }

  .entry { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1.5px dashed var(--line); }
  .entry:first-child { padding-top: 2px; }
  .entry:last-child { border-bottom: 0; padding-bottom: 2px; }
  .entry .face.ava { width: 38px; height: 38px; }
  .entry .face.ava .clip { box-shadow: 0 1.5px 0 var(--ink); }
  .entry .body { flex: 1 1 auto; min-width: 0; }
  .entry .line1 { font-size: 13.5px; font-weight: 700; line-height: 1.4; }
  .entry .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
  .entry .amt.up { color: var(--mint); }
  .entry .amt.down { color: var(--clay); }
  .entry .line2 { font-size: 11.5px; color: var(--ink-soft); margin-top: 3px; }
  .entry .acts { margin-top: 7px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
  .flagged {
    font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    color: var(--flag-fg); background: var(--clay-soft); border-radius: 99px; padding: 4px 9px;
  }

  .chips { display: flex; flex-wrap: wrap; gap: 8px; }
  .chip {
    border: 2px solid var(--ink); border-radius: 99px; background: var(--card); color: var(--ink);
    padding: 8px 13px; font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px;
    box-shadow: 0 2.5px 0 var(--ink); transition: transform .08s ease, box-shadow .08s ease;
  }
  .chip:active { transform: translateY(2.5px); box-shadow: 0 0 0 var(--ink); }
  .chip:focus-visible { outline: 3px solid var(--coin); outline-offset: 2px; }
  .chip .v { font-variant-numeric: tabular-nums; font-weight: 800; }
  .chip.up .v { color: var(--mint); }
  .chip.down .v { color: var(--clay); }

  .row { display: flex; align-items: center; gap: 11px; padding: 11px 0; border-bottom: 1.5px dashed var(--line); }
  .row:first-child { padding-top: 2px; }
  .row:last-child { border-bottom: 0; padding-bottom: 2px; }
  .row .emo { font-size: 23px; width: 31px; text-align: center; flex: none; }
  .row .t { flex: 1 1 auto; min-width: 0; }
  .row .t b { display: block; font-size: 14px; font-weight: 700; }
  .row .t small { font-size: 11.5px; color: var(--ink-soft); display: flex; align-items: center; gap: 4px; }
  .row .t small svg { width: 13px; height: 13px; }

  .scrim {
    position: absolute; inset: 0; background: rgba(38, 25, 16, .5); z-index: 50;
    opacity: 0; pointer-events: none; transition: opacity .25s ease;
  }
  .scrim.on { opacity: 1; pointer-events: auto; }
  .sheet {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--ground);
    border-top: 3px solid var(--ink); border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 10px 17px 20px; transform: translateY(106%);
    transition: transform .33s cubic-bezier(.3,1.1,.4,1); max-height: 88%; overflow-y: auto;
  }
  .sheet.on { transform: translateY(0); }
  .grab { width: 44px; height: 5px; border-radius: 99px; background: var(--line); margin: 0 auto 13px; }
  .sheet h3 { margin: 0 0 3px; font-size: 19px; font-weight: 800; letter-spacing: -.3px;
    overflow-wrap: anywhere; }
  .sheet .sub { margin: 0 0 15px; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }

  .stepper { display: flex; align-items: center; gap: 13px; justify-content: center; margin: 2px 0; }
  .stepper .num {
    font-size: 40px; font-weight: 800; min-width: 96px; text-align: center;
    font-variant-numeric: tabular-nums; letter-spacing: -1.2px;
  }
  .stepper .num.up { color: var(--mint); }
  .stepper .num.down { color: var(--clay); }
  .round {
    width: 46px; height: 46px; border-radius: 50%; border: 2.5px solid var(--ink);
    background: var(--card); color: var(--ink); font-size: 24px; font-weight: 800;
    box-shadow: 0 3px 0 var(--ink); display: grid; place-items: center; line-height: 1; flex: none;
  }
  .round:active { transform: translateY(3px); box-shadow: 0 0 0 var(--ink); }
  .round:focus-visible { outline: 3px solid var(--coin); outline-offset: 2px; }
  .cap { text-align: center; font-size: 11px; color: var(--ink-faint); margin: 3px 0 13px; }

  .sheet input[type="text"] {
    width: 100%; font-family: inherit; font-size: 14.5px; color: var(--ink); background: var(--card);
    border: 2.5px solid var(--ink); border-radius: var(--r-md); padding: 11px 13px; margin-bottom: 11px;
  }
  .sheet input::placeholder { color: var(--ink-faint); }
  .sheet input:focus-visible { outline: 3px solid var(--coin); outline-offset: 2px; }
  .toggle2 { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 14px; }
  .toggle2 button {
    border: 2.5px solid var(--ink); border-radius: var(--r-md); background: var(--card);
    color: var(--ink); font-weight: 800; font-size: 13.5px; padding: 10px;
  }
  .toggle2 button[aria-pressed="true"].g { background: var(--mint); color: #FFF9F2; box-shadow: 0 3px 0 var(--ink); }
  .toggle2 button[aria-pressed="true"].b { background: var(--clay); color: #FFF9F2; box-shadow: 0 3px 0 var(--ink); }

  .tabbar {
    flex: none; display: grid; grid-template-columns: repeat(4, 1fr);
    border-top: 2.5px solid var(--ink); background: var(--card); padding: 7px 4px 9px;
  }
  .tab {
    border: 0; background: none; color: var(--ink-faint); padding: 5px 2px; border-radius: 10px;
    display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; font-weight: 800;
  }
  .tab svg { width: 23px; height: 23px; }
  .tab.on { color: var(--ink); }
  .tab:focus-visible { outline: 2px solid var(--coin); outline-offset: 1px; }

  /* top of the phone, not the bottom: a bottom toast lands inside an open sheet */
  .toast {
    position: absolute; left: 50%; bottom: 78px; transform: translate(-50%, 14px);
    background: var(--ink); color: var(--ground); font-size: 13px; font-weight: 700;
    padding: 10px 17px; border-radius: 99px; z-index: 70; opacity: 0;
    transition: opacity .22s ease, transform .22s ease; pointer-events: none;
    max-width: 82%; text-align: center;
  }
  .toast.on { opacity: 1; transform: translate(-50%, 0); }
  /* a sheet covers the lower half, so lift the toast above it while one is open */
  .sheet.on ~ .toast { bottom: auto; top: 84px; transform: translate(-50%, -14px); }
  .sheet.on ~ .toast.on { transform: translate(-50%, 0); }

  .switcher {
    display: flex; align-items: center; gap: 11px; flex-wrap: wrap; justify-content: center;
    background: var(--card); border: 2.5px solid var(--ink); border-radius: 99px;
    padding: 7px 8px 7px 17px; box-shadow: 0 4px 0 var(--ink);
  }
  .switcher > span { font-size: 12.5px; font-weight: 700; color: var(--ink-soft); }
  .seg { display: flex; gap: 6px; }
  .seg button {
    border: 2px solid var(--ink); background: var(--card); color: var(--ink); border-radius: 99px;
    padding: 4px 14px 4px 5px; font-size: 13px; font-weight: 800; display: flex; align-items: center; gap: 7px;
  }
  .seg button .face { width: 30px; height: 30px; }
  .seg button .face .clip { box-shadow: none; border-width: 2px; }
  .seg button[aria-pressed="true"] { background: var(--coin); box-shadow: 0 2.5px 0 var(--ink); }
  .seg button:focus-visible { outline: 3px solid var(--coin); outline-offset: 3px; }

  .note { max-width: 52ch; text-align: center; font-size: 12px; line-height: 1.7; color: var(--ink-soft); margin: 0; }
  .note b { color: var(--ink); }

  /* ---------- real phones ----------
     Two iOS problems the probe found:
       1. 100vh counts Safari's toolbars, so the bottom of the app was cut off.
          100dvh is the visible height; the 100vh line above stays as the fallback.
       2. nothing honoured env(safe-area-inset-*), so the tab bar sat under the
          home indicator on a notched iPhone.
     And one from the screenshot: the masthead ate ~700px before the app even
     started. On a phone the fake bezel is pointless — go full-bleed. */
  @supports (height: 100dvh) {
    .phone { height: min(790px, calc(100dvh - 36px)); }
  }

  @media (max-width: 480px) {
    .page { padding: 0; gap: 0; min-height: 100vh; }
    .masthead, .note { display: none; }

    .phone {
      width: 100vw; max-width: 100vw;
      height: calc(100vh - 56px); min-height: 0;
      border: 0; border-radius: 0; box-shadow: none;
    }
    .notch { display: none; }

    .appbar  { padding-top: calc(12px + env(safe-area-inset-top)); }
    .tabbar  { padding-bottom: calc(9px + env(safe-area-inset-bottom)); }
    .screen  {
      padding-left:  max(17px, env(safe-area-inset-left));
      padding-right: max(17px, env(safe-area-inset-right));
    }
    .sheet {
      border-radius: var(--r-xl) var(--r-xl) 0 0;
      padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    /* the viewer switch stays — it is how you try both sides on one phone */
    .switcher {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
      border-radius: 0; border: 0; border-top: 2.5px solid var(--ink);
      box-shadow: none; justify-content: center; padding: 7px 10px;
      padding-bottom: calc(7px + env(safe-area-inset-bottom));
      background: var(--ground-2);
    }
    .switcher > span { display: none; }
    .switcher::before { content: "viewing as"; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); }
  }

  @supports (height: 100dvh) {
    @media (max-width: 480px) {
      .page  { min-height: 100dvh; }
      .phone { height: calc(100dvh - 56px); }
    }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  }

/* ===================== app shell: gates + wrapper ===================== */
/* The prototype was one screen. The real app has sign-in, pairing and waiting
   states in front of it, each filling the phone. */
.gate { display: none; position: absolute; inset: 0; z-index: 30; overflow-y: auto;
        background: var(--ground); }
.gate.on { display: block; }
.gate-inner {
  min-height: 100%; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 11px; text-align: center;
  padding: calc(34px + env(safe-area-inset-top)) 24px calc(34px + env(safe-area-inset-bottom));
}
.gate-art { display: flex; align-items: flex-end; margin-bottom: 2px; }
.gate-art .face { width: 72px; height: 72px; }
.gate-art .face:last-child:not(:only-child) { margin-left: -14px; }
.gate-title { margin: 2px 0 0; font-size: 27px; font-weight: 800; letter-spacing: -.6px; }
.gate-sub { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink-soft); max-width: 30ch; }
.gate-note { margin: 2px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink-soft); max-width: 32ch; min-height: 1em; }
.gate-msg { font-size: 13px; color: var(--ink-soft); }
.gate input[type="text"], .gate input[type="email"] {
  width: 100%; max-width: 300px; font-family: inherit; font-size: 16px; /* 16px: iOS zooms below this */
  color: var(--ink); background: var(--card); border: 2.5px solid var(--ink);
  border-radius: var(--r-md); padding: 12px 14px; text-align: center;
}
.gate input:focus-visible { outline: 3px solid var(--coin); outline-offset: 2px; }
.gate .btn { max-width: 300px; }
.gate .sec { margin-bottom: 2px; }

.code {
  font-size: 34px; font-weight: 800; letter-spacing: .22em; padding: 12px 18px 12px 26px;
  background: var(--card); border: 2.5px solid var(--ink); border-radius: var(--r-md);
  box-shadow: 0 4px 0 var(--ink); font-variant-numeric: tabular-nums;
}
.pick2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 300px; }
.pick2 button {
  border: 2.5px solid var(--ink); background: var(--card); color: var(--ink);
  border-radius: var(--r-md); padding: 12px 8px; font-size: 12.5px; font-weight: 700;
  display: flex; flex-direction: column; align-items: center; gap: 7px;
}
.pick2 button[aria-pressed="true"] { background: var(--coin); box-shadow: 0 3px 0 var(--ink); }
.pick2 .face { width: 52px; height: 52px; }

.appwrap { display: none; flex-direction: column; flex: 1 1 auto; min-height: 0; }
.appwrap.on { display: flex; }

.offline {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 95; text-align: center;
  background: var(--clay); color: var(--on-action); font-size: 12px; font-weight: 700;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
}

/* the real app has no masthead or switcher to hide */
@media (max-width: 480px) { .page { background: var(--ground); } }
