/* ChimeChat — minimal, calm, low-residue. Black / white / lime palette. */

/* ============================================================================
   ⛔ DO NOT CHANGE WHAT IS CONFIRMED WORKING — founder, 08-02-2026
   ============================================================================
   A rule that works is evidence. Do not move it, merge it, simplify it or
   "clean it up" because it looks redundant.

   What happened, in this very file: `#chat.vv-bound { height: var(--vvh) }`
   worked. It was GENERALISED to `.screen.vv-bound` so the landing and invite
   screens were covered too — a good intention that dropped specificity from
   (1,1,0) to (0,2,0). The surviving `#chat` id rule then won, the chat fell
   back to the LAYOUT viewport, and with a keyboard open the conversation
   would not scroll. Measured: --vvh 300px, #chat computed 812px. Nobody
   re-tested the case that already worked, because the change was about the
   other screens.

   ⚠ IN CSS THIS FAILS SILENTLY AND SPECIFICALLY: broadening a selector almost
   always LOWERS specificity. If an id rule for the same property still exists
   anywhere in this file, your new class rule loses and nothing warns you.

     - Widening a fix? ADD alongside the working selector, do not MOVE it.
     - Re-test the ORIGINAL case after any generalisation.
     - Deleting a rule that looks dead? Show the job is still done — grep for
       every selector that sets the same property on the same element first.

   ============================================================================
   ⚠ READ THIS BEFORE ADDING ANY SURFACE THAT HOLDS AN INPUT
   ============================================================================
   Standing founder instruction: the software keyboard is not something to
   test for afterwards, it is something to BUILD for. The same defect has been
   reported from a real phone five times across 07-27, 08-01 and 08-02-2026 —
   the ack/confirm dialogs, the Terms gate, the whole .leave-modal family, the
   Schedule dialog, and then .leave-card one level inside the surface fixed the
   day before. Every one was a surface somebody thought was finished.

   THE CONTRACT — all four, at the moment you write the rule:

     1. Bind the CONTAINER to var(--vvh). Never 100dvh, never 100%.
        100dvh is the LAYOUT viewport and does not shrink for a keyboard, so
        the surface extends behind it with nothing able to scroll into view.
     2. overflow-y: auto on that container.
     3. overscroll-behavior in the SAME rule as the overflow.
        `none` for an overlay card, sheet or menu — `contain` only stops the
        gesture chaining OUT and leaves the element's own bounce, and that
        bounce is what slides a card under its own sticky action row and
        shows the background through it (founder, 08-02-2026, light mode:
        "a large white space opens up below it").
        ⚠ This point is ENFORCED — check-scroll.js, in npm run check and in
        .githooks/pre-commit. The other three are not checkable without false
        positives (.screen.vv-bound and .ack-card both look wrong and are
        correct), so they rely on you reading this.
     4. Pin the action row (position: sticky) when there is ONE required
        action. NOT when every element is a choice — then the card scrolls
        whole, because no button may be privileged. Compare #scheduleModal
        (pinned, one action) with .leave-card (scrolls whole, all choices).

   THEN TEST WITH A KEYBOARD OPEN, phone-sized, at --vvh 320 / 260 / 200.
   ⚠ Adding a FIELD to a dialog that was fine yesterday is the classic
   trigger — that is exactly what broke the Schedule dialog.

   Full history and every rejected approach: docs/MESSAGE_LAYOUT_AND_KEYBOARD.md
   ========================================================================== */

:root {
  /* lime is constant across themes (buttons, own bubbles: black text on lime) */
  --lime: #C6FF00;
  --lime-deep: #AEE000;
  --on-lime: #0a0a0a;
  /* dark theme (default): black background, white text */
  --bg: #0a0a0a;
  --ink: #f5f5f5;
  --ink-soft: #a3a3a3;
  --ink-faint: #6f6f6f;
  --accent: #C6FF00;      /* lime as a TEXT/border color — readable on black */
  --accent-deep: #AEE000;
  --accent-soft: rgba(198, 255, 0, 0.12);
  --card: #161616;
  --line: #2a2a2a;
  /* Bubbles are theme-invariant (founder's picks by Color Studio number,
     07-31-2026, final pass): WHITE for your own (no. 1), light lime for
     theirs (no. 6), near-black ink (no. 17) on both. The GROUND differs per
     theme: dark rooms sit on #141416 (no. 16, below), light on the pale
     lime (body.light). Bubbles are BORDERLESS (founder decision
     2026-07-20); separation comes from the ground. There is deliberately NO
     speech tail (removed 07-31-2026) — see docs/BUBBLE_AND_TAIL.md before
     adding one, and NEVER paint --chat-bg over the conversation ground: the
     ground is not flat (Chimefield + gradients). */
  --bubble-mine: #ffffff;
  --bubble-theirs: #D9E8A3;
  --bubble-ink: #0a0a0a;
  --chat-bg: #141416;     /* the ground behind the conversation */
  --alert: #ffffff;       /* export notices: bright white on black */
  --radius: 18px;
  --fade-ms: 747ms; /* dissolve-to-sparks at 0.75x */
  --msg-scale: 1;   /* user-adjustable message text size */
  font-size: 16px;
}

/* light theme: white background, black text (toggle in the chat header) */
body.light {
  --bg: #ffffff;
  --ink: #111111;
  --ink-soft: #52525b;
  --ink-faint: #6b6b74;   /* darkened from #8f8f97 for AA on white cards (~4.9:1); still the faintest tier */
  --accent: #647C0F;      /* darker lime so text/borders stay readable on white */
  --accent-deep: #506212;
  --accent-soft: rgba(129, 163, 13, 0.10);
  --card: #fafafa;
  --line: #e4e4e7;
  /* Bubbles deliberately match the dark theme (see :root) — white sent,
     light-lime received, near-black ink. The pale-lime ground is what makes
     the white sent bubble read here. */
  --bubble-mine: #ffffff;
  --bubble-theirs: #D9E8A3;
  --bubble-ink: #0a0a0a;
  --chat-bg: #eef7dc;     /* pale lime ground behind the conversation */
  --alert: #0a0a0a;       /* export notices: black on white */
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  /* ⚠ LOAD-BEARING. A downward drag in iOS Safari was firing pull-to-refresh
     and RELOADING A LIVE ROOM (founder's iPhone, 07-30-2026). That is not a
     lost draft: the conversation exists only in the DOM — the relay forgets
     each message on acknowledgement — so a reload destroys every received
     message on the device WITHOUT the user having replied, which is the one
     thing the mechanic promises cannot happen except on send.
     `none`, not `contain`: contain still leaves the overscroll affordance that
     triggers the refresh. Measured on-device: it also stops the visible area
     sliding over the keyboard-height strip (321px -> 0), which was a second
     report and is fixed by the same line. Costs the document-level rubber-band
     bounce, accepted. See docs/MESSAGE_LAYOUT_AND_KEYBOARD.md. */
  overscroll-behavior-y: none;
}

/* Background animations removed (founder decision, 2026-07-19): the ambient
   mote canvas, the static radial glow, the room-entry veil field and the
   empty-room pulse are all gone. The ground is flat in both themes.
   Deletion sparks, the typing ✦ and the wordmark ✦ are deliberately kept. */
.ether { display: none !important; }

/* Content sits on a flat ground. */
.screen { height: 100%; position: relative; z-index: 1; }

/* Mobile browsers: track the real visible viewport (iOS Safari's toolbar
   collapses/expands), not the static 100%. */
@supports (height: 100dvh) {
  .screen { height: 100dvh; }
}

/* On-screen-keyboard inset. JS sets --kb to the height a software keyboard
   takes from the bottom (0 whenever no keyboard is up — including every
   desktop/laptop and any device with a hardware keyboard, so this is a no-op
   there). The chat shrinks by that much so its composer sits just above the
   keyboard and the messages fill the space above it, instead of the keyboard
   overlaying the bottom third. */
/* --kb is the NO-JAVASCRIPT FALLBACK ONLY and is never written any more; it
   stays 0 so these two rules resolve to a plain full-height chat on a browser
   with no visualViewport. Everything else uses --vvh below. */
:root { --kb: 0px; --vvh: 100dvh; }
/* Peer photo size, derived from the visible viewport. See .peer-avatar-btn for
   the measurements and for why this is a clamp rather than a fixed 45px. */
:root { --pav: clamp(30px, calc(var(--vvh) * 0.075), 45px); }
/* ⚠ THE #chat HEIGHT RULES WERE DELETED 08-02-2026, and must not come back as
   an id selector. They said `height: calc(100dvh - var(--kb))`, and on
   07-31-2026 the real rule moved from `#chat.vv-bound` to `.screen.vv-bound`
   so that the landing and invite screens were covered too. That is a class
   selector — specificity (0,2,0) — and it LOSES to `#chat` at (1,0,0). So the
   chat silently stopped tracking --vvh and fell back to the layout viewport,
   which is the exact fault that change was written to fix everywhere else.
   Measured 08-02-2026: with --vvh at 300px, #chat computed to 812px.
   Symptom on a phone: with the keyboard open the conversation would not
   scroll, because #chat was sized to a viewport a third of it could not see.
   The no-JS fallback is `.screen { height: 100dvh }` a few lines below — it
   does not need an id, and --kb has not been written by app.js for weeks. */

/* THE REAL RULE. app.js adds .vv-bound as soon as it sees a visualViewport,
   and keeps --vvh equal to visualViewport.height. That is BY DEFINITION the
   area the user can see — after the software keyboard, a hardware keyboard's
   shortcut bar, the URL bar, or anything a browser ships next. One source of
   truth, so there is no threshold to tune and nothing per-browser to
   enumerate.

   ⚠ Do NOT "simplify" this back to calc(100dvh - var(--kb)). That combined
   TWO sources: 100dvh already tracks the dynamic toolbar, while --kb was
   inferred from innerHeight − vv.height — which on iOS is roughly the toolbar
   height even with no keyboard. Both then apply and the chat collapses by
   double. The 100px threshold existed only to guess which cause was which,
   and it cannot work: a URL bar and a shortcut bar are both ~45–60px, so any
   threshold that catches one catches the other.

   --vvh defaults to 100dvh so the height is right for the frame before
   app.js runs, and on a browser lacking dvh the class is never added. */
/* ⚠ .screen, not #chat. This was bound to the chat alone, so the LANDING and
   INVITE screens kept height:100dvh — the LAYOUT viewport — and with a keyboard
   up their card extended behind it with nothing able to scroll. #landing
   already has overflow-y:auto; it had nothing to scroll BECAUSE the container
   was full height. Exactly the fault fixed for .leave-modal on 08-01-2026, one
   level up, and it is why the scheduled-invite card ("Joe has invited you…")
   would not scroll with the keyboard open (founder, 08-02-2026). */
.screen.vv-bound { height: var(--vvh); }

/* In a room, the DOCUMENT is pinned to the visible viewport and cannot scroll.
   Companion to the overscroll guard on html/body: that stops pull-to-refresh
   (over-scrolling past the end), this stops the app being scrolled up off the
   screen into the gap iOS leaves below it when the keyboard is open — which is
   legitimate scrolling into real page area, so nothing else prevents it.
   `.in-room` is added by enterChat() and cleared by the page load that follows
   leaving; it must NEVER be global, or a landing card taller than the screen
   becomes unreachable. See docs/MESSAGE_LAYOUT_AND_KEYBOARD.md. */
html.in-room, html.in-room body {
  height: var(--vvh, 100%);
  overflow: hidden;
}

/* ------------------------------------------------------- COMPACT MODE
   Below 240px of VISIBLE height, `html.tight` is set from app.js (the same
   --vvh signal that sizes #chat). In practice that is one situation: a phone
   in LANDSCAPE with the keyboard up. It never fires on an iPad, in portrait,
   or on a desktop — measured, not assumed.

   Why it exists: measured at 150px visible, the room had 133px of furniture
   and 28px of conversation — 6px once the list's own padding came off, which
   is not one message, it is a sliver of one. Four things give way, in the
   order of how little they cost:

     1. the identity bar      -29   you know who you are writing to
     2. the list's padding    -18   pure whitespace, the cheapest pixels here
     3. the composer          -8    tighter, and 36px buttons
     4. the typing band       -17   kept, but at the smaller size

   ⚠ The band is REDUCED, never removed. The typing indicator is the
   real-time signal this product is built around (founder, 07-30-2026), and
   the state where you can see least is the state where knowing someone is
   mid-reply matters most. Hiding it here was measured (+20px) and DECLINED.

   ⚠ VERIFY ANY CHANGE HERE AT ALL FOUR TEXT SIZES. Bubbles scale with
   --msg-scale: 35 / 41 / 49 / 57px for S / M / L / XL. An earlier version of
   this fix left 40px of usable space and was called done — it fails at M,
   the DEFAULT, by one pixel, and fails L and XL outright. This version
   leaves 63px, which fits XL with room. */
html.tight .peer-topbar { display: none; }

html.tight .messages { padding: 4px 12px; }

html.tight .typing-area { min-height: calc(0.7em + 9px); padding: 0 12px; }
html.tight .typing-pill { padding: 4px 10px; border-radius: 10px; border-bottom-left-radius: 4px; }
html.tight .tstars { gap: 5px; }
html.tight .tstars span { font-size: 0.7em; text-shadow: 0 0 5px rgba(198, 255, 0, 0.55); }

/* ⚠ 36px drops under the ≥44px touch target the (pointer: coarse) block sets,
   accepted deliberately and ONLY here: a smaller button you can reach beats a
   larger one with no conversation above it. Do not copy this size elsewhere. */
html.tight .composer { padding: 4px 10px calc(4px + env(safe-area-inset-bottom, 0px)); }
html.tight .composer textarea { padding: 7px 12px; }
html.tight .send-btn, html.tight .plus-btn { width: 36px; height: 36px; }

/* display rules below would otherwise override the hidden attribute */
[hidden] { display: none !important; }

/* ------------------------------------------------------------ landing */
#landing {
  display: flex;
  /* `safe center` centers the card when it fits, but falls back to top-
     alignment when the card is TALLER than the viewport (small phones) —
     otherwise flex centering clips the top (logo included) out of view and
     it can't be scrolled to. Paired with overflow-y:auto so a tall card
     scrolls instead of spilling off-screen. */
  align-items: center;
  align-items: safe center;
  justify-content: center;
  overflow-y: auto;
  /* scroll-guard-ok: NO overscroll property here, deliberately. One was added
     08-02-2026 and REVERTED the same night: on a phone, focusing the name
     field with the keyboard open left a white strip above the keyboard that
     only went away after scrolling. #landing worked without it for weeks.
     ⚠ Do not "fix" this omission — see the ⛔ block at the top of this file. */
  padding: 24px;
}

.landing-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px 32px 28px;
  box-shadow: 0 24px 60px -30px rgba(198, 255, 0, 0.18);
  text-align: center;
}

.logo {
  font-family: 'Fraunces', serif;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  /* The tier tag belongs ON the wordmark's line, never below it. It began
     wrapping on phones once "beta" (4 characters) became "preview" (7) on the
     paid edition and the ™ was added: measured at 375px the lockup needed
     297px against 281px available. See the narrow-screen block below, which
     buys the room back. */
  white-space: nowrap;
}

.logo-mark { color: var(--accent); }

.beta-tag {
  display: inline-block;
  vertical-align: super;
  margin-left: 2px;
  padding: 2px 8px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Narrow screens: keep ✦ + wordmark + ™ + tier on ONE line, at every width.
   The tier tag started wrapping once "beta" (4 characters) became "preview"
   (7) on the paid edition and the ™ was added — measured at 375px, the lockup
   needed 297 against 281 available.
   ⚠ `white-space: nowrap` alone is NOT the fix: at 320px it stops the wrap and
   overflows the card by 47px instead, which is worse. The lockup has to SCALE,
   so the tag is sized in `em` — it is a child of .logo, so one clamp on the
   wordmark drives the whole unit and the proportions never drift.
   Measured after: 320px needs 216 of 226 available, 375px needs 252 of 281.
   ⚠ This block must stay AFTER the .beta-tag base rule above. It first sat
   before it, and at equal specificity the later rule won — the logo shrank,
   the tag did not, and it still overflowed. */
@media (max-width: 420px) {
  .logo { font-size: clamp(1.4rem, 7.5vw, 1.9rem); }
  .beta-tag { font-size: 0.28em; padding: 2px 6px; letter-spacing: 0.05em; }
}

.tagline {
  margin: 6px 0 4px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.95rem;
}

.support-line {
  margin: 0 0 14px;
  color: var(--ink); /* was #fff — invisible on the white light-mode card */
  font-size: 0.85rem;
  font-style: italic;
}

/* Offered after leaving, only while the old room is verifiably occupied */
.rejoin-bar {
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px dashed var(--accent);
  border-radius: 14px;
  background: var(--accent-soft);
}

/* Return-to-your-room list (accidental close / multi-window). A calm, solid
   card so a less-technical person sees it instantly. */
.resume-list {
  margin: 0 0 16px;
  padding: 14px 16px;
  border: 1px solid var(--accent);
  border-radius: 16px;
  background: var(--accent-soft);
}
.resume-header { margin: 0 0 10px; font-weight: 700; color: var(--accent); font-size: 0.9rem; }
.resume-rows { display: flex; flex-direction: column; gap: 8px; }
.resume-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 11px; background: var(--card);
  border: 1px solid var(--line);
}
.resume-label { font-size: 0.85rem; color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.resume-row .btn { flex: none; }
/* The two choices stay together on one line — they wrap below the label as a
   group, never split from each other (fixes cross-browser button splitting). */
.resume-actions { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: nowrap; }
.resume-sub { margin: 10px 0 0; font-size: 0.72rem; color: var(--ink-faint); line-height: 1.5; }
/* The quieter, final choice on each row — calm outline, no alarm color. */
.resume-vanish { background: transparent; color: var(--ink-faint); border-color: var(--line); white-space: nowrap; }
.resume-vanish:hover { color: var(--accent); border-color: var(--accent); }
.resume-row { flex-wrap: wrap; }
/* One room: the header carries the message; the row is just the two clear
   choices (kindest for a less-technical person). */
.resume-list.solo .resume-label { display: none; }
.resume-list.solo .resume-row { padding: 0; background: none; border: none; }
.resume-list.solo .resume-actions { flex: 1 1 auto; width: 100%; }
.resume-list.solo .resume-row .btn { flex: 1 1 auto; }
/* Theme-mode toast — the only way "system" is discoverable on a phone, where
   the button's rollover never appears. Transient, centred under the header,
   and pointer-transparent so it is never a thing to dismiss. */
.theme-toast {
  position: fixed; left: 50%; top: 76px; transform: translate(-50%, -6px); /* top is set in JS from the header's real height */
  z-index: 60; pointer-events: none;
  max-width: min(88vw, 340px); text-align: center;
  padding: 8px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line); color: var(--ink);
  font-size: 0.78rem; line-height: 1.35;
  opacity: 0; transition: opacity 180ms ease, transform 180ms ease;
}
.theme-toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .theme-toast { transition: none; } }

/* An ENDED room: the browser was closed on a room someone else is still in.
   The ending leads, but it is offered — never performed on page load. The
   ordinary .resume-vanish rule below would otherwise keep the quiet outline
   even with .primary on it, so state it explicitly here. */
/* An ENDED room carries no buttons — the room is already gone, so there is
   nothing to offer. The label IS the content, which means it must survive
   the .solo rule below that hides labels when only one room is listed.
   With ONE room listed the header and sub-line already say all of it, so the
   row collapses to nothing (the .solo rules below strip its label, padding
   and border); with several, the per-row label is what names this one. */
.resume-row-ended { justify-content: flex-start; }
.resume-row-ended .resume-label { white-space: normal; }
.resume-list.solo .resume-row-ended { display: none; }
/* ⭐ 08-12-2026 — THE DISMISS X HAD TO SURVIVE THE RULE ABOVE.
   The X was added to this row on 08-12 (970ae2a) and shipped INVISIBLE in the
   one-room case, which is the common one: the rule above hides the whole row,
   and the X lives inside it. Founder found it on a phone. The rule above was
   correct while the row held nothing but a label the header repeats; it
   stopped being correct the moment the row gained a control.
   ⚠ ADDED BESIDE that rule rather than replacing it, because it is still
   right for `_stale` rows, which carry no X at all and must go on collapsing
   to nothing. Equal specificity (0,3,0), so ORDER decides and this must stay
   BELOW — the same trap the dialog-padding note records.
   ⚠ `solo-ended` is set in JS only when the sole record is a STORED ending,
   i.e. exactly the case that has an X to show.
   The row collapses to its X alone; the label stays hidden by the .solo rule
   above, so nothing is said twice. Top right of the card, the same place and
   the same glyph as the account sheet's X. */
.resume-list { position: relative; }
.resume-list.solo-ended .resume-row-ended {
  display: flex; position: absolute; top: 2px; right: 4px;
  margin: 0; padding: 0; background: none; border: none;
}
/* The header wraps under an absolutely-placed X without this. 44px is the X's
   own min-width (.row-x), not a guessed number. */
.resume-list.solo-ended .resume-header { padding-right: 44px; }
/* ⭐ 08-12-2026 (founder screenshot) — A ROW WITH "Open it again" MUST NOT
   RIDE INTO THE CORNER. The absolute rule above was written when the row
   held only the ✕; once the reclaim button joined it, the whole row was
   carried to the card's top-right and the button drew OVER the header text.
   ADDED beside the working rule, not merged into it: ✕-only rows (chosen,
   quiet, unknown…) keep the corner exactly as tested. Higher specificity
   (the extra class) is what wins here, not order. The row stays in flow,
   the button centred beneath the text (founder: "the button was also
   centered which is good"), and only the ✕ goes to the corner. */
.resume-list.solo-ended .resume-row-ended.has-again {
  position: static; justify-content: center;
  margin: 6px 0 0; padding: 0; background: none; border: none;
}
.resume-list.solo-ended .resume-row-ended.has-again .row-x {
  position: absolute; top: 2px; right: 4px; margin: 0;
}
/* ⭐ Same founder pass: the ended card's text reads as a statement, so it is
   left-justified, not centred. Scoped to the solo-ended card only — the
   ordinary resume card's centring is untouched (confirmed working). */
.resume-list.solo-ended .resume-header,
.resume-list.solo-ended .resume-sub { text-align: left; }
/* ⭐ Findings batch #4, 08-14-2026 — the MULTI-room list's ended rows get the
   solo card's treatment: ✕ in the row's own top-right corner, statement text
   left-aligned and wrapping under it, instead of the ✕ riding mid-row at the
   end of the sentence. ADDED beside the solo-ended rules above, which are
   untouched — :not(.solo-ended) keeps the two families from ever fighting.
   The 40px clearance is the ✕'s 44px hit area minus the row's own 10px side
   padding overlap, and the reclaim button (has-again) stays in flow exactly
   as the solo rule already established. */
.resume-list:not(.solo-ended) .resume-row-ended { position: relative; padding-right: 40px; }
.resume-list:not(.solo-ended) .resume-row-ended .row-x {
  position: absolute; top: 0; right: 0; margin: 0;
}
.resume-list:not(.solo-ended) .resume-row-ended .resume-label { text-align: left; }
body.light .resume-header { color: var(--accent-deep); }
body.light .resume-vanish { color: var(--ink-soft); }
body.light .resume-vanish:hover { color: var(--accent-deep); border-color: var(--accent-deep); }

.rejoin-text {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
}

.rejoin-actions { display: flex; gap: 8px; justify-content: center; }
/* ⭐ A rejoin-bar in its INFORMATIONAL state (08-12-2026): it states something
   and asks nothing, so its buttons are hidden — and with them the only way to
   dismiss it. `pitch-note` is set in JS for exactly that state, so the shared
   .rejoin-bar rule is left alone (the standing note about widening a working
   rule). #goneBar is untouched: it keeps its own action. */
.rejoin-bar.pitch-note { position: relative; }
.rejoin-bar.pitch-note .rejoin-text { padding-right: 40px; }
.rejoin-bar.pitch-note .row-x { position: absolute; top: 2px; right: 4px; margin: 0; }
#goneMembershipLink { display: block; margin: 10px auto 0; }

.explain {
  margin: 0 0 24px;
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.55;
}

.explain-home {
  margin-bottom: 6px;
  text-align: center;
}

.learn-more-link {
  display: inline-block;
  margin: 0 0 20px;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.learn-more-link:hover { color: var(--ink); }

.field {
  display: block;
  text-align: left;
  margin-bottom: 14px;
}

.field span {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

input[type="text"], input[type="date"], input[type="time"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  outline: none;
  transition: border-color 120ms;
}

input[type="text"]::placeholder { color: var(--ink-faint); }

input[type="text"]:focus, input[type="date"]:focus, input[type="time"]:focus { border-color: var(--accent); }

/* Safari/Chrome render the native calendar/clock glyph in the input's own
   text color by default, which reads as invisible on a dark background. */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}
body.light input[type="date"]::-webkit-calendar-picker-indicator,
body.light input[type="time"]::-webkit-calendar-picker-indicator {
  filter: none;
}

.btn {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 100ms, background 120ms, border-color 120ms;
}

.btn:hover { border-color: var(--accent); }
.btn:active { transform: scale(0.98); }

.btn.primary {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
}

.btn.primary:hover { background: var(--lime-deep); border-color: var(--lime-deep); }
/* A disabled primary button must not look tappable — the terms gate keeps it
   disabled until BOTH the birth date and the consent box are satisfied, and a
   bright lime button that does nothing reads as broken. */
.btn:disabled, .btn.primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  filter: saturate(0.6);
}
.btn.primary:disabled:hover { background: var(--lime); border-color: var(--lime); }

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--ink-faint);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.join-row {
  display: flex;
  gap: 10px;
}

.join-row input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
}

.join-row .btn { width: auto; padding-inline: 22px; }

.landing-error {
  margin: 14px 0 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
}
/* ⭐ A refusal that belongs to ONE field, sitting directly under it
   (decision 2, 08-16-2026 — #nameError). ADDED beside .landing-error rather
   than changing it: same voice, same colour and weight, so the two read as
   one app speaking; only the spacing and the alignment differ, because this
   one has a label above it and answers the box it is under.
   ⚠ .field carries margin-bottom:14px, so the negative top margin pulls the
   sentence back up against the input it is about instead of floating in the
   gap below it. */
.field-error {
  margin: -10px 0 14px;
  text-align: left;
}

.joining-status {
  margin: 6px 0 0;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ⚠ .present-line is now UNUSED on the landing — "BE IN THE PRESENT." was
   retired 08-03-2026 in favour of .lead-line below. The rule is kept, not
   deleted: it is a working treatment and the phrase may return elsewhere.
   See the ⛔ block at the top of this file. */
.present-line {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
}

/* The landing paragraph's opening sentence. Deliberately NOT .present-line's
   lime-with-letterspacing: that treatment shouts a slogan, and this line is a
   plain statement of what the product is. Ink-coloured and bold, so it leads
   the paragraph without competing with the lime tagline directly above it. */
.lead-line {
  color: var(--ink);
  font-weight: 700;
}

.about-link {
  margin: 26px 0 0;
  padding: 6px 10px;
  border: none;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: color 0.15s;
}
.about-link:hover { color: #ffffff; }
/* Stacked account/about links (landing + invite footer). */
.account-links { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 26px; }
.account-links .about-link { margin: 0; }
.account-links + .legal-links { margin-top: 8px; }
.invite-footer .about-link { margin: 0; }

/* ---------------------------------------------------- Terms gate (paid) */
.tos-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.tos-card {
  width: 100%;
  max-width: 520px;
  /* NOT 94% — a percentage here resolves against .tos-gate, which is
     `fixed; inset: 0` and therefore measures the LAYOUT viewport. On iOS that
     is taller than what you can actually see, so 94% of it still ran past the
     bottom of the screen and took the age field and the button with it
     (reported 07-27-2026 on a small phone). --vvh is visualViewport.height,
     kept current by app.js — the same honest measure the chat uses. */
  max-height: calc(var(--vvh, 100dvh) - 32px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;   /* see check-scroll.js */
  background: var(--card);
  border: 2px solid var(--accent);
  border-radius: 22px;
  padding: 22px 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  animation: tos-sheet-up 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.tos-decline {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-faint);
}
.tos-decline:hover { border-color: var(--ink-faint); color: var(--ink-soft); }
@keyframes tos-sheet-up { from { transform: translateY(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .tos-card { animation: none; } }
.tos-card h3 {
  font-family: var(--font-display, inherit);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  gap: 8px;
  align-items: center;
}
.tos-star { color: var(--accent); }
.tos-plain { display: flex; flex-direction: column; gap: 9px; }
.tos-pl {
  display: flex;
  gap: 9px;
  font-size: 0.82rem;
  color: var(--ink-soft, var(--ink-faint));
  line-height: 1.45;
}
.tos-pl > span:first-child { color: var(--accent); flex: none; font-size: 0.72rem; margin-top: 2px; }
.tos-pl strong { color: var(--ink); }
.tos-dob { display: flex; gap: 8px; }
.tos-dob .field { flex: 1; }
.tos-dob select {
  width: 100%;
  background: var(--bg-input, var(--card));
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
  padding: 11px 10px;
}
.tos-dob select:focus { border-color: var(--accent); outline: none; }
.tos-denied {
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
  padding: 9px 6px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.tos-consent {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 0.78rem; line-height: 1.5; color: var(--ink-soft);
  cursor: pointer; margin: 4px 0 14px; text-align: left;
}
.tos-consent input { margin-top: 2px; accent-color: var(--lime); flex: none; width: 16px; height: 16px; }
.tos-consent a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ---- membership screen (reuses .tos-gate / .tos-card) ---- */
.member-lead { font-size: 0.9rem; color: var(--ink-soft, var(--ink-faint)); line-height: 1.5; }
.member-lead strong { color: var(--ink); }
.member-msg {
  font-size: 0.82rem; color: var(--ink-soft, var(--ink-faint)); line-height: 1.5;
  border: 1px dashed var(--line); border-radius: 10px; padding: 11px 13px;
}
.member-msg a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.member-msg.ok { border-color: var(--accent); }
.member-plan {
  border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px; text-align: center;
}
.member-price {
  font-family: var(--font-display, inherit); font-size: 1.9rem; font-weight: 700; color: var(--ink);
}
.member-price span { font-size: 0.95rem; font-weight: 400; color: var(--ink-faint); }
.member-plan-note { font-size: 0.78rem; color: var(--ink-faint); }
.member-fine { font-size: 0.7rem; color: var(--ink-faint); text-align: center; line-height: 1.5; }
.member-fine a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
/* ⭐ The "why we ask" line under BOTH Mobile number fields (08-16-2026). Its
   whole job is to be READ, at the moment someone hesitates over a required
   field they were not expecting. Measured before this rule existed: the global
   .member-fine above rendered it at 11.2px in the Complete your account card
   and 13.1px in the Profile tab, because `#accountSheet .member-fine` (1,1,0)
   wins only inside the sheet. So the two twins disagreed AND the smaller one
   was too small to do its job.
   ⚠ MUST STAY AFTER .member-fine. Both selectors are (0,1,0), so this is a
   specificity TIE and source order is the only thing that decides it. Moving
   this line above .member-fine silently reverts the gate to 11.2px, and
   nothing would fail. Same trap as the dialog fixes of 08-03.
   ⚠ ADDITIVE ON PURPOSE: scoped to this one line so no other .member-fine
   moves. 0.82rem matches what the account sheet already gives its own fine
   print, so the two fields now read identically. */
.pg-phone-why { font-size: 0.82rem; }

/* Membership + account modals (About-style card) */
.member-card { display: flex; flex-direction: column; gap: 10px; max-height: 86vh; max-height: 86dvh; overflow-y: auto; overscroll-behavior-y: none; }
/* ⚠ KEYBOARD CAP — ADDED alongside, deliberately not merged into the rules
   above or into .leave-card.about-card (which the About dialog also uses;
   do not touch a working surface). Measured 08-03-2026 on the paid edition:
   .leave-card.about-card's min(640px, 88vh) outranks .leave-card's --vvh cap,
   so with a keyboard up (--vvh 320) the card computed to 640px and the close
   button sat 317px below the fold — and overscroll-behavior-y: none on the
   card stops the gesture ever reaching the .leave-modal scroller that could
   have rescued it. Capping the card to the VISIBLE viewport means its own
   internal scroll reaches every control with no chaining needed. Same -24px
   convention as .leave-card. Three classes so it outranks (0,2,0) rules. */
/* ⚠ 40px, matching .leave-modal's 20px top + 20px bottom padding — see the
   note on .leave-card. This selector OUTRANKS that one, so fixing the base
   rule alone left the account sheet unchanged: the founder's 16px of dark
   backdrop was still scrollable here after the first fix. Measured, not
   assumed. If the modal's padding changes, both numbers change. */
.leave-card.about-card.member-card { max-height: min(640px, calc(var(--vvh, 100dvh) - 40px)); }
.member-benefits { display: flex; flex-direction: column; gap: 8px; text-align: left; margin: 2px 0 4px; }
.member-benefits p { font-size: 0.84rem; color: var(--ink-soft); line-height: 1.45; position: relative; padding-left: 20px; margin: 0; }
.member-benefits p span { color: var(--accent); position: absolute; left: 0; }
.member-benefits strong, .member-benefits em { color: var(--ink); font-style: normal; }
.member-promo-row { display: flex; gap: 8px; }
.member-promo-row input {
  flex: 1;
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  font: inherit;
  font-size: 0.82rem;
  padding: 10px 12px;
  text-transform: uppercase;
}
.member-promo-row input:focus { border-color: var(--accent); outline: none; }
/* ⚠ iOS ZOOM ON FOCUS — 08-03-2026, found by the founder on a real phone:
   tapping the email field with the keyboard already up ZOOMED the page, with
   pinch the only way back. iOS Safari zooms whenever an input renders below
   16px and never restores the scale. The viewport meta is already correct;
   this is purely font-size.
   ⚠ SCOPED TO THIS DIALOG BY ID, on founder instruction: "only change for
   this dialog and don't touch others that we have previously tested."
   The other inputs under 16px are DELIBERATELY left alone — memberEmail
   (13.3, later fixed in its own block below), inviteLink/scheduledLink/
   schedKeepLink (12.8, readonly — a tap selects, no keyboard rises).
   ⚠ tosMonth/tosYear LEFT this list on 08-14-2026 (findings batch #5):
   founder decision, the age gate's two selects join the ≥16px set — iOS
   zooms on a focused select under 16px exactly as on an input. The rule
   is ADDED below, beside this one, never merged.
   ⚠ profNameInput LEFT this list on 08-07-2026: its
   surface was rebuilt that day and got its device pass the same evening.
   The remaining surfaces are device-tested and working; raising their size
   shifts heights and wrapping, so each needs its own device pass first.
   ⚠ ADDED alongside the rule above, never merged into it — see CLAUDE.md
   "do not touch what is confirmed working". */
#modalPromoInput, #modalEmailInput { font-size: 16px; }
/* Findings batch #5, 08-14-2026 — the age gate's selects (see the note
   above). Check the Terms card at --vvh 320/300/260/200 after any change
   here: the two selects sit mid-card and a size change moves the row. */
#tosMonth, #tosYear { font-size: 16px; }

/* The account Profile's two fields are raised above the iOS zoom
   threshold at the END of this file — they are declared later than here,
   and an ID rule loses to a later ID rule. See that block. */


/* ── #memberEmail: the sign-in field — FOUND ON A PHONE 08-04-2026 ──────
   Founder, testing over a tunnel: "when go to account to sign in, with
   keyboard up, screen zooms and doesn't scroll properly."

   ⚠ TWO faults, and the second is caused by the first.

   1. The field matched NO CSS RULE AT ALL. The base input selector is
      `input[type="text"], input[type="date"], input[type="time"]` — and
      this is `type="email"`, so it fell through to the browser default:
      MEASURED at 13.3333px, padding 1px 2px, border-radius 0. Under 16px
      is the iOS zoom threshold, so focusing it zoomed the page.
   2. iOS does not restore the scale on blur, and a zoomed page no longer
      scrolls the way --vvh assumes — so "doesn't scroll properly" was the
      ZOOM, not a second bug in the card. The card's own contract was
      already met (max-height on --vvh, overflow-y, overscroll-behavior).

   It was listed at 13.3 in the note above as one of the eight inputs
   DELIBERATELY left alone pending "its own device pass first". This is
   that device pass, so it moves — the others stay untouched.

   Styled to match .member-field input rather than only resizing it: at
   1px padding and no border it also read as a broken box, visibly unlike
   every other field in the app. */
#memberEmail {
  width: 100%;
  background: var(--bg);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  font: inherit;
  font-size: 16px;                 /* 16px: iOS zoom threshold */
  padding: 12px 14px;
  outline: none;
  transition: border-color 120ms;
}
#memberEmail:focus { border-color: var(--accent); }
#memberEmail::placeholder { color: var(--ink-faint); }

/* The action row is pinned, for the same reason #scheduleModal's is: this
   dialog exists to make ONE button be pressed, and at --vvh 300px it sat
   MEASURED 160px below the visible bottom of the card. Reachable only by
   scrolling — which is exactly what the zoom had broken.
   ⚠ Scoped to #memberGate. #tosGate shares .tos-card and is device-tested
   and working; this is ADDED beside it, never merged into it. */
#memberGate #memberSendLink {
  position: sticky;
  bottom: calc(-18px - env(safe-area-inset-bottom));
  z-index: 1;
  padding-bottom: 13px;
  margin-bottom: calc(-18px - env(safe-area-inset-bottom));
  box-shadow: 0 10px 0 0 var(--card), 0 -6px 10px -6px rgba(0,0,0,.35);
}

/* ── Membership dialog layout, reorganised 08-03-2026 ──────────────────
   Founder, from a phone: "too much crammed together and the email field,
   which is where the main input comes from, is hard to notice." So the
   email became a LABELLED FIELD with its own hint and spacing, the promo
   moved BELOW the primary button into a quieter aside, and Full details
   sits under the price at a readable size.
   ⚠ These are ADDITIVE classes on new wrappers — the shared .member-plan,
   .member-promo-row, .about-link and .member-fine rules are untouched, so
   the account sheet and every other surface using them is unaffected. */
.member-card { gap: 13px; }                       /* was 10 — breathing room */

/* The one input that matters. */
.member-field { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.member-field-label {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-soft, var(--ink-faint));
}
.member-field input {
  width: 100%; background: var(--card); color: var(--ink);
  border: 1.5px solid var(--line-strong, var(--line)); border-radius: 12px;
  font: inherit; font-size: 16px;                 /* 16px: iOS zoom threshold */
  padding: 13px 14px;
}
.member-field input:focus { border-color: var(--accent); outline: none; }
.member-field-hint { margin: 0; font-size: 0.74rem; line-height: 1.45; color: var(--ink-faint); }

/* Full details — below the price, and actually readable. */
.member-details-link {
  margin: 0 auto; font-size: 0.92rem; font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px;
}

/* Promo: demoted below the primary button so it stops competing with it. */
.member-aside {
  display: flex; flex-direction: column; gap: 7px;
  padding-top: 12px; border-top: 1px solid var(--line);
}
.member-aside-label { font-size: 0.76rem; color: var(--ink-faint); text-align: left; }
.member-promo-row button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 10px 18px;
  cursor: pointer;
}
.member-card .about-link { margin: 0 auto; }

/* Member mark (paid): the membership badge after a member's name in the chat
   header. Positive marking only — guests carry no mark, decided 08-11-2026
   and the reasons are in docs/MEMBERSHIP_BADGE.md (a guest has no account
   screen, and the badge is the PEER'S, so a guest would never see their own).

   ⭐ THE BADGE FORM, chosen 08-11-2026 from the word-pills board: a SOFT
   TINTED pill on --accent-soft with no border, the SHORT word in UPPERCASE,
   glyph AND word together, and all three rungs alike — Pro is not emphasised
   over the other two.

   ⚠ The word is VISIBLE again. It was briefly hidden with the tier left to a
   hover `title`; that is desktop-only and so invisible to most people, the
   same fault as the LEAVE chip's hover label (08-05-2026). The glyph carries
   recognition, the word carries the meaning, and the sentence form
   ("Pro member") survives as the accessible name in app.js.

   ⚠ SIZES SUPERSEDED 08-20-2026 — see .member-mark svg below for the current
   numbers and the ceiling that fixes them. This paragraph used to read "the
   glyph is 13px here", citing a 390px phone preview measuring 77 / 99 / 64px
   for the three rungs at bar overflow 0.
   ⚠ That measurement was real but it was never the binding constraint, and
   re-measuring on 08-20-2026 showed why: .peer-name carries
   `overflow: hidden; text-overflow: ellipsis`, so the bar CANNOT overflow at
   any glyph size up to 26px — it absorbs the pressure by shortening the name.
   13px was protecting something that was never at risk. */
.member-mark {
  display: inline-flex; align-items: center; gap: 5px; flex: 0 0 auto;
  color: var(--accent); line-height: 1; margin-left: 4px;
  white-space: nowrap;
  background: var(--accent-soft);
  border: 1px solid transparent;   /* holds the pill's height against the outlined variants */
  border-radius: 999px;
  padding: 4px 13px;
}
/* ⭐ 13px -> 20px, and the pill grew with it (founder, 08-20-2026, option B
   from a measured table). The badge sits beside the peer photo, which is now
   45px, and at 13px it read as an afterthought next to it.

   Measured at 390px with the photo at 45px:
     glyph 13px  pill 103x19   glyph 18px  pill 120x26   glyph 20px  pill 128x30

   ⚠ 30px IS THE CEILING, and it is not arbitrary. The pane's height is its
   TALLEST child. With the keyboard up the photo clamps back to 30px (see
   --pav), so a pill taller than 30px would become the tallest thing and hold
   the pane open — undoing exactly the saving the clamp was added for.
   Measured: at 30px pill the keyboard-open pane is 39px, identical to before
   any of this. At a 40px pill it would be 49px.
   ⛔ So do not raise this to 26px "to match the account sheet". 20px is the
   glyph; the 4px padding and 1px border are what make the pill 30. */
.member-mark svg { width: 20px; height: 20px; display: block; }

/* ⭐ GUEST: the WORD ONLY (founder, 08-11-2026, reversing the no-guest-label
   decision made earlier the same day). "(GUEST)" sits to the right of the name
   in the same colour, size, weight and letter-spacing as a member's word, and
   carries NONE of what marks a member: no pill, no tinted ground, no border,
   no glyph.
   ⚠ The ground is REMOVED, not restyled to something fainter. A pale pill
   would still be a pill, and the whole instruction was that nothing here may
   visually identify the person as a member. Anything added to .member-mark
   later that reads as decoration must be undone here too. */
.member-mark.guest {
  background: none;
  border-color: transparent;
  padding: 2px 0;   /* keeps the vertical rhythm; drops the pill's side inset */
}
.member-mark.guest svg { display: none; }

/* The same badge on the ACCOUNT sheet, where it is your own rather than the
   other person's. Block-level with room beneath it, because here it is a
   heading for the sentence that follows rather than something tucked in
   beside a name. Everything else — ground, glyph size, word — is inherited,
   so the two can never drift into different-looking badges for one tier. */
/* ⚠ `align-self` is load-bearing, not tidying. `.acct-panel` is a COLUMN flex
   container, so its default `align-items: stretch` pulled the pill the full
   width of the sheet and it read as a banner rather than a badge. inline-flex
   does not save you inside a flex parent — the parent decides the cross-axis. */
#acctTierBadge { display: inline-flex; align-self: flex-start; margin: 0 0 10px; }
/* ⭐ Founder, 08-13-2026, from a phone: the account sheet's badge should be
   "centered, one line lower and double its current size". ADDED after the
   rule above so the same-specificity tie breaks this way (order decides
   id-vs-id — the 08-07 lesson). Scoped to the ACCOUNT badge only: the
   header badges keep the shared .member-mark metrics untouched. */
#acctTierBadge { align-self: center; margin: 16px 0 10px; padding: 4px 20px; gap: 10px; }
/* 26px -> 40px, following the tier cards. This badge is your own on the
   account sheet, and 26px was chosen to hold a ratio with those cards
   (08-13-2026); they moved, so it moves with them. No --pav constraint
   here: the sheet is not the header pane. */
#acctTierBadge svg { width: 40px; height: 40px; }
#acctTierBadge .member-label { font-size: 1.36rem; }

/* ⭐ The two X controls added 08-12-2026 — an ADDITIONAL way to close the
   account sheet, and the dismissal on an informational start-page row.
   One drawing of an X in the app, sized twice.

   ⚠ Both carry a 44px minimum touch target while drawing a 14px glyph. An X
   is the smallest thing anyone is asked to hit on a phone, and a 14px hit box
   is the classic "it did not respond" report. The padding does the work; the
   svg stays small. */
.sheet-x, .row-x {
  border: 0; background: none; color: var(--ink-soft); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 44px; min-height: 44px; padding: 0; flex: 0 0 auto;
  border-radius: 999px; line-height: 1;
}
.sheet-x svg, .row-x svg { width: 14px; height: 14px; display: block; }
.sheet-x:hover, .row-x:hover { color: var(--ink); background: var(--accent-soft); }
.sheet-x:focus-visible, .row-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* The sheet's X sits over the card's own padding, top right, and must clear
   the ✦ mark and title beneath it rather than push them down. */
.sheet-x { position: absolute; top: 6px; right: 8px; z-index: 2; }
/* ⚠ The card needs a positioning context for that, and it did not have one.
   Added HERE rather than on .leave-card, which is shared by every dialog —
   see the standing rule about widening a working rule. */
.member-card { position: relative; }
/* On a row the X is the last item, pushed to the right by the row's flex. */
.row-x { margin-left: auto; }

/* ⭐ THE SAME ✕ ON A SCROLLING .leave-card (founder, 08-17-2026) — six
   notice dialogs: about, etiquette, room-full, permission help, presence
   detail, invite.

   ⚠ ADDED alongside .sheet-x, deliberately NOT a widening of it. That rule
   is doing its job today on #accountSheet and #convenienceModal and is not
   touched here (the standing rule about widening a working rule).

   THE PROBLEM: .leave-card is itself the scroller — max-height plus
   overflow-y: auto — so a position: absolute ✕ inside it scrolls away with
   the content. Measured on a long card at a 760px viewport before this:
   at the top the ✕ was visible and the exit button was not; scrolled to the
   end the ✕ sat 2530px above the visible area.

   THE FIX: a zero-height sticky rail as the card's first child, with the ✕
   absolutely positioned inside it. Height 0 means the rail takes no layout
   space, so nothing below it moves; and .leave-card's text-align: center
   cannot reach an absolutely positioned child, so the centred titles are
   untouched too.
   ⚠ MEASURED, because sticky behaviour here is not obvious: a sticky box
   cannot be pushed outside its containing block, which is the card's CONTENT
   box, so the rail does not travel up into the 26px padding. The ✕ therefore
   rests at a CONSTANT 32px (26 padding + 6) below the card's top edge — at
   scrollTop 0 and at the end of a 1431px scroll alike. Verified on all six
   dialogs at 390px and at 320px, and the negative control (position: static)
   sent it to −1381px, which is the bug this replaces.

   ⚠ right: -16px, not 0. The rail is the card's CONTENT box and .leave-card
   has padding: 26px 24px, so 0 would leave the ✕ 24px in from the card's
   edge. -16px lands it 8px from the edge, matching .sheet-x on the account
   sheet. It stays inside the card's padding box, so it adds no horizontal
   overflow. ⚠ If .leave-card's horizontal padding changes, change this.

   ⚠ The opaque background is load-bearing: the card's own text scrolls
   BEHIND the pinned ✕, and .sheet-x is transparent. :hover is restated at
   higher specificity so this does not silently cancel it. */
.card-x-rail { position: sticky; top: 0; height: 0; z-index: 4; }
.sheet-x.card-x { top: 6px; right: -16px; background: var(--card); }
.sheet-x.card-x:hover { background: var(--accent-soft); }

/* ⭐ THE SAME PINNED ✕ INSIDE THE .member-card FAMILY (08-18-2026) —
   #accountSheet and #convenienceModal, the two surfaces the original
   .sheet-x rule was serving.

   THE DEFECT, measured at 390x844 before this, card scrolled to its end:

     #accountSheet      --vvh 260  ✕ at −6px    (just off the top)
     #accountSheet      --vvh 200  ✕ at −64px
     #convenienceModal  --vvh 320  ✕ at −301px
     #convenienceModal  --vvh 200  ✕ at −417px

   Same cause as the six notice dialogs above: .member-card is itself the
   scroller (overflow-y: auto + a max-height cap), so a position: absolute
   ✕ scrolls away with the content. The rail fixes it identically.

   ⚠ TWO THINGS DIFFER HERE, and both are why this is a SEPARATE rule
   rather than a widening of .card-x-rail / .sheet-x.card-x above:

   1. .member-card is a FLEX COLUMN with `gap: 13px` (set at :833, raised
      from 10px at :961). A zero-height rail is still a flex item, so the
      gap lands after it and everything below drops 13px. The negative
      margin cancels exactly that gap and nothing else.
      ⚠ IF .member-card's gap CHANGES, CHANGE THIS WITH IT. Measured
      proof it is neutral: #accountSheet's .about-head sits 26px below the
      card's top edge before and after, #convenienceModal's title 36px.

   2. The ✕ ALREADY HAD A RESTING PLACE and it is not the rail's.
      .sheet-x is absolute against the card's padding box, which puts it
      7px below the card's top edge. The rail cannot rise into the card's
      26px top padding, so an un-overridden .sheet-x.card-x rests at 32px
      — where #aboutModal's correctly sits, but 25px lower than where
      these two have always sat. `top: -20px` puts it back exactly.
      ⚠ MEASURED, NOT DERIVED, and the arithmetic would have been wrong:
      the obvious 6 − 25 = −19 lands it at 8px, one pixel low, because
      the rail's own resting line differs by 1px between a block
      .leave-card and a flex .member-card. −20px measures 7px before and
      7px after, at every height, and 9px in from the card's right edge
      in both. Do not "correct" this back to the arithmetic value.
      ⚠ This is a DELIBERATE preservation, not a coincidence. If the ✕ is
      ever meant to line up with #aboutModal's at 32px, delete this one
      declaration — do not chase the number. */
.member-card > .card-x-rail { margin-bottom: -13px; }
.member-card > .card-x-rail > .sheet-x.card-x { top: -20px; }

/* A long title must not run under the ✕ — the same guard as
   .ack-card.has-x h3, but padding on BOTH sides rather than one.
   ⚠ MEASURED, not assumed: every one of these titles computes to
   text-align: center, INCLUDING .invite-title, which sits in a card whose
   own rule is text-align: left. A one-sided padding-right therefore shifts
   the text off centre: the first draft of this rule gave .invite-title
   padding-right alone and moved its text 15px left (129 → 114). Symmetric
   padding clears the ✕ and moves no title at all — verified by diffing the
   text Range rect of every dialog title, in this file and in the untouched
   ones, against HEAD. */
.leave-card.has-x > h2,
.leave-card.has-x > h3,
.leave-card.has-x > .about-head,
.leave-card.has-x > .invite-title { padding-inline: 30px; }
.member-label {
  /* 0.68rem -> 0.82rem with the glyph (08-20-2026). The word and the glyph
     scale together; a 20px glyph beside a 0.68rem word read as two different
     sizes inside one small pill. */
  font-size: 0.82rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
}

/* Account chip (paid): top-right of the landing — ghost person glyph when
   signed out, lime ring + initial/photo when signed in. */
.acct-chip {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  /* Track the centered start-card column (420px) on wide screens instead
     of drifting to the viewport edge; 16px inset on small screens. */
  right: max(16px, calc((100% - 420px) / 2));
  z-index: 30;
  /* ⭐ 34px -> 51px, 1.5x (founder, 08-20-2026), matching the peer photo in
     the room header the same day.
     ⚠ IT DID NOT COME FOR FREE WITH THAT CHANGE, and the founder asked: the
     two are separate rules on separate elements (.peer-avatar-btn) with no
     shared value, so growing one never touched the other.
     ⚠ NO --pav CLAMP HERE, deliberately. This chip is position:absolute, so
     it is out of flow and cannot push anything below the fold however tall it
     gets — the whole reason the peer photo needed a clamp does not apply.
     Adding one would make it shrink for no benefit. */
  width: 51px;
  height: 51px;
  border-radius: 50%;
  /* 1.5px read as a hairline once the ring was half again as wide */
  border: 2px solid var(--accent);
  background: var(--card);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 0 14px rgba(198, 255, 0, 0.18);
}
.acct-chip:hover { background: rgba(198, 255, 0, 0.12); }
.acct-chip.in { border-color: var(--accent); color: var(--accent); }
.acct-chip img { width: 100%; height: 100%; object-fit: cover; }
/* Both scaled with the chip, 08-20-2026: the initial 0.95rem -> 1.42rem and
   the signed-out person glyph 19px -> 28px. A 1.5x ring around unchanged
   contents reads as an empty ring, not a bigger chip. */
.acct-chip span { font-weight: 800; font-size: 1.42rem; line-height: 1; }
.acct-chip svg { width: 28px; height: 28px; }

/* Device-local profile section in the account sheet */
.prof-head { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-faint); margin-top: 6px; text-align: left; }
.prof-note { text-align: left; }
/* ⭐ NO BLANK LINE BETWEEN THE HEADING AND ITS NOTE (founder, 08-19-2026,
   option A: "remove the line break between header and optional"). The note
   is a <p>, so it carried its own ~13px top margin and sat a clear line
   below "FOR YOUR CONVENIENCE", reading as two separate things rather than a
   heading with its subtitle.
   ⛔ Scoped to a .prof-note that DIRECTLY FOLLOWS a .prof-head, and it only
   removes the top margin. .prof-note is used elsewhere with its spacing
   intact, and the note's own bottom margin still separates it from the
   checkboxes underneath. */
.prof-head + .prof-note { margin-top: 0; }
/* The account email row (Profile tab, above the device profile): the
   address wraps rather than clips — an email has no spaces to break on,
   so anywhere-wrap is what keeps long ones inside the sheet. */
.prof-email-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 2px; }
.prof-email { font-size: 0.92rem; color: var(--ink); overflow-wrap: anywhere; min-width: 0; text-align: left; }
.prof-tog { display: flex; gap: 8px; align-items: center; font-size: 0.8rem; color: var(--ink-soft); cursor: pointer; text-align: left; }
.prof-tog input { accent-color: var(--accent); }
#profNameInput {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 9px 12px;
}
#profNameInput:focus { border-color: var(--accent); outline: none; }
#profPhotoHint { text-align: left; }

/* Membership Account sheet: comfortable reading sizes and contrast —
   the sheet is an operating surface, not fine print. */
#accountSheet .member-msg { font-size: 0.95rem; color: var(--ink); }
#accountSheet .member-fine { font-size: 0.82rem; color: var(--ink-soft); }
#accountSheet .prof-tog { font-size: 0.9rem; color: var(--ink); }
#accountSheet .prof-head { font-size: 0.78rem; color: var(--ink-soft); }
#accountSheet .gp-row { font-size: 0.85rem; }
#accountSheet .gp-row strong { font-size: 0.88rem; }

/* ⭐ The persistent "your account still needs…" row (decision 3, 08-16-2026).
   It sits at the TOP of the signed-in sheet, above the tabs, and stays for as
   long as the profile is incomplete. Visually distinct from every other row
   in the sheet — accent border and a tinted ground — because it is the one
   thing here that is asking rather than reporting. It carries no dismiss ✕
   on purpose: it is a fact about the account, not a notice about an event.
   ⚠ The whole row is the button, so a thumb anywhere on it opens the gate.
   Wraps rather than squeezing "Add them" off a narrow phone. */
.acct-incomplete {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 6px 12px; width: 100%;
  margin: 0 0 12px; padding: 11px 13px;
  border: 1.5px solid var(--accent); border-radius: 12px;
  background: rgba(198, 255, 0, 0.10);
  font: inherit; text-align: left; cursor: pointer;
}
.acct-incomplete .acct-incomplete-text {
  flex: 1 1 auto; min-width: 0;
  font-size: 0.86rem; line-height: 1.45; color: var(--ink);
}
.acct-incomplete .acct-incomplete-do {
  flex: 0 0 auto;
  font-size: 0.82rem; font-weight: 700; color: var(--accent);
  text-decoration: underline; text-underline-offset: 2px;
}

/* Sign-in "where are you" choice: personal device vs shared computer */
.signin-where { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 12px; text-align: left; }
.where-opt { display: flex; gap: 9px; align-items: flex-start; font-size: 0.85rem; color: var(--ink); line-height: 1.4; cursor: pointer; }
.where-opt input { accent-color: var(--accent); margin-top: 3px; flex: 0 0 auto; }
.where-opt .where-sub { color: var(--ink-faint); font-size: 0.76rem; font-weight: 400; }
/* Passkey sign-in area (ADDED 08-28-2026, nothing above modified): the
   alternative door under the email button. Spacing only — the divider, the
   button and the message reuse .gp-divider / .btn / .member-msg as they are.
   Same look in both themes by construction: every colour comes from the
   reused classes' own tokens. */
#passkeySignInArea { margin-top: 12px; }
#passkeySignInArea .gp-divider { margin-bottom: 12px; }
#passkeySignInArea .member-msg { margin-top: 8px; }

/* "What lives where" transparency block in the account sheet */
.lives-where { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.lives-where p { font-size: 0.8rem; color: var(--ink-soft); line-height: 1.5; margin: 0; }
.lives-where .lw-k { display: block; color: var(--ink); font-weight: 700; margin-bottom: 2px; }

/* Quiet one-tap profile prompts on the landing (paid, ignorable) */
.save-hint { display: block; margin: 4px auto 0; font-size: 0.76rem; }

/* Guest-pass list rows in the account sheet */
.gp-divider { border-top: 1px solid var(--line); margin: 4px 0 2px; }
.gp-cancel {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-faint);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font: inherit;
  font-size: 0.7rem;
  line-height: 1;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
}
.gp-cancel:hover { border-color: #fb7185; color: #fb7185; }
.gp-list { display: flex; flex-direction: column; gap: 5px; margin-top: 6px; }
.gp-row { display: flex; justify-content: space-between; gap: 10px; font-size: 0.74rem; color: var(--ink-soft); }
.gp-row strong { color: var(--ink); letter-spacing: 0.04em; }
.gp-row.dead { opacity: 0.55; }
.gp-row.dim { opacity: 0.7; }
.gp-row.dead strong { text-decoration: line-through; }

/* Invite-card wordmark links home (the conventional front door). */
.logo-link { color: inherit; text-decoration: none; }
.logo-link:hover { color: var(--accent); }

/* Landing CTA in non-member state: the free-to-join promise under the
   honest button, and the sign-in path for members on a new device. */
.member-cta-note { font-size: 0.76rem; color: var(--accent); text-align: center; line-height: 1.45; margin: 8px auto 0; max-width: 34ch; }
.member-signin { display: block; margin: 6px auto 0; font-size: 0.76rem; }

/* "How it works" strip in the membership modal — the 2-step process,
   stated before anything is asked for. */
.member-steps { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.member-step { display: flex; gap: 10px; align-items: flex-start; font-size: 0.8rem; color: var(--ink-soft); line-height: 1.45; }
.member-step strong { color: var(--ink); }
.step-n {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}
.member-email-row input { text-transform: none; }

/* Post-leave conversion wording (paid, non-members only): the question
   reads as quiet body text; only the action carries the accent. Used by
   the rejoin-bar link and the post-leave pitch card. */
.aside-q { color: var(--ink-faint); font-weight: 400; }
#leavePitchBar .rejoin-text .aside-q { display: block; margin-bottom: 2px; color: var(--ink); font-weight: 600; }

.legal-links {
  text-align: center;
  font-size: 0.68rem;
  color: var(--ink-faint);
  margin-top: 2px;
}
.legal-links a {
  color: var(--ink-faint);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.legal-links a:hover { color: var(--accent); }

/* Invite-page footer: About + legal (+ membership on paid), stacked. */
.invite-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ------------------------------------------------------------- about */
.leave-card.about-card {
  text-align: left;
  max-width: min(440px, 100%);
  display: flex;
  flex-direction: column;
  max-height: min(640px, 88vh);
}
/* ⚠ KEYBOARD CAP FOR #aboutModal — ADDED alongside the rule above, which is
   left exactly as it is (the standing rule about widening a working rule,
   and the ⛔ block at the top of CLAUDE.md).

   THE DEFECT: `min(640px, 88vh)` reads the LAYOUT viewport, which a software
   keyboard does not shrink. So with a keyboard up the About card stood 640px
   tall inside a .leave-modal only --vvh high, and the MODAL scrolled — and
   what is behind the card is the dark backdrop. That is the founder's
   "scrolls with dark blank below it" from the 08-07-2026 tunnel pass, in the
   one dialog that never got the fix. Measured at 390x844, modal
   scrollHeight − clientHeight:

     --vvh 320 → 360px      --vvh 300 → 380px
     --vvh 260 → 420px      --vvh 200 → 480px

   ⚠ THE SUBTRACTION IS 40px, NOT 24px — .leave-modal has `padding: 20px`,
   top AND bottom. Same arithmetic and same reason as .leave-card's own cap;
   if the modal's padding ever changes, all three numbers change together.

   ⚠ WHY AN ID: .leave-card.about-card is (0,2,0) and OUTRANKS .leave-card's
   correct --vvh cap, which is why fixing the base rule alone changed nothing
   here — the identical trap that made .leave-card.about-card.member-card
   necessary for the account sheet on 08-03-2026. #aboutModal is the ONLY
   dialog wearing .about-card without .member-card (the other four carry
   both and are already capped), so an id keeps the blast radius at one
   dialog rather than adding a class that would silently re-cap the others.
   Proved after the change by walking the CSSOM: for #aboutModal's card the
   matching max-height rules are .leave-card, .leave-card.about-card and
   this one, and this one wins at (1,2,0). */
#aboutModal .leave-card.about-card { max-height: min(640px, calc(var(--vvh, 100dvh) - 40px)); }

.about-head { text-align: center; margin-bottom: 14px; }
.about-mark { font-size: 1.5rem; color: var(--accent); }
.about-title { font-weight: 700; font-size: 1.05rem; margin-top: 2px; }
.about-sub { color: var(--ink-faint); font-size: 0.72rem; margin-top: 2px; }

.about-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  padding: 3px;
  background: rgba(127, 127, 127, 0.1);
  border-radius: 10px;
}
.about-tabs-row2 { grid-template-columns: repeat(2, 1fr); margin-top: 3px; }

.about-tab {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 7px 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.about-tab.active { background: var(--lime); color: var(--on-lime); }

.about-body {
  margin-top: 14px;
  overflow-y: auto;
  overscroll-behavior-y: none;   /* see check-scroll.js */
  min-height: 0;
  flex: 1;
  font-size: 0.82rem;
  line-height: 1.6;
  color: var(--ink-soft);
}

.about-p { margin: 0 0 12px; }
.about-p-soft { color: var(--ink-faint); }
.about-pull {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-left: 3px solid var(--lime);
  background: rgba(198, 255, 0, 0.08);
  border-radius: 0 10px 10px 0;
  color: var(--ink);
  font-weight: 600;
}
.about-byline {
  margin: 16px 0 0;
  color: var(--ink-faint);
  font-size: 0.7rem;
  text-align: center;
  line-height: 1.5;
}
.about-byline span { color: var(--accent); font-weight: 600; }

.about-feat, .about-step {
  display: flex;
  gap: 10px;
  margin: 0 0 12px;
  align-items: flex-start;
}
.about-feat strong, .about-step strong { color: var(--ink); }
.about-feat-icon { font-size: 1.05rem; line-height: 1.4; color: var(--accent); flex: none; }
.about-feat-icon .ci { width: 24px; height: 24px; }
.about-chip .ci { width: 26px; height: 26px; color: var(--accent); }
.invite-title .ci { width: 22px; height: 22px; vertical-align: -0.32em; color: var(--accent); }
.inline-ico { display: inline-flex; vertical-align: -0.28em; color: var(--accent); }
.inline-ico .ci { width: 18px; height: 18px; }
.about-step-num {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--lime);
  color: var(--on-lime);
  font-weight: 700;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.about-lime { color: var(--accent); font-style: normal; font-weight: 600; }
.about-red { color: #f87171; font-style: normal; font-weight: 600; }
body.light .about-red { color: #b91c1c; }

.about-chip-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 0 0 14px;
  text-align: center;
}
.about-chip {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 2px;
  font-size: 0.68rem;
  color: var(--ink-faint);
  line-height: 1.7;
}
.about-note { margin: 0 0 12px; }
.about-note strong { color: var(--ink); }

.about-beta-badge {
  margin: 0 0 14px;
  padding: 8px 12px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
  border-radius: 10px;
  color: #d97706;
  font-weight: 600;
  font-size: 0.76rem;
  text-align: center;
}
.about-beta-badge .ci { width: 1.05em; height: 1.05em; vertical-align: -0.16em; margin-right: 4px; }
.about-legal-h {
  margin: 14px 0 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink);
}
.about-legal-h:first-of-type { margin-top: 0; }
.about-legal-p { margin: 0 0 4px; font-size: 0.78rem; }
.about-legal-p strong { color: var(--ink); }
.about-agree {
  margin: 16px 0 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(127, 127, 127, 0.06);
  font-size: 0.76rem;
}
.about-agree span { color: var(--accent); font-weight: 700; }
.about-legal-footer {
  margin: 14px 0 0;
  color: var(--ink-faint);
  font-size: 0.68rem;
  text-align: center;
}

/* -------------------------------------------------------------- chat */
#chat {
  display: flex;
  flex-direction: column;
  max-width: 760px;
  margin: 0 auto;
  border-inline: 1px solid var(--line);
  /* Translucent so the ether glows faintly behind the conversation, while
     header/composer keep their own solid --card for crisp controls. */
  background: color-mix(in srgb, var(--card) 82%, transparent);
  backdrop-filter: blur(2px);
}

.peer-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  /* Trimmed 07-30-2026 (was 10/16/6). With the keyboard up on a phone the two
     header bars were 96px of a 406px screen — more than the composer. The
     founder DECLINED merging them into one, so the space comes out of padding
     instead. Chip padding is deliberately untouched: touch targets are a
     separate, recorded decision. */
  padding: 5px 16px 3px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.peer-name {
  font-weight: 700;
  color: var(--ink);
  max-width: 60vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

/* End-to-end encryption badge: the native lock-with-star icon, sitting
   right beside the peer's name where the security applies. */
.peer-e2e {
  flex: none;
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}
.peer-e2e .ci { width: 1.15rem; height: 1.15rem; }

.peer-status-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.peer-status-dot.online {
  background: #22c55e;
  animation: dot-blink 1.4s ease-in-out infinite;
}

.peer-status-dot.offline { background: #ef4444; }
/* Third presence state: announced step-away with the tab still open —
   "present in spirit". A hollow lime dot: neither the solid green of
   presence nor the red of a dropped connection. */
.peer-status-dot.away {
  background: transparent;
  border: 2px solid var(--lime);
  box-shadow: none;
  animation: none;
}

/* ---------------- presence line (admin-toggleable) ----------------
   Lives in the existing inline #peerStatus slot on the SAME topbar row —
   header height never changes. Copy comes in three lengths; breakpoints
   pick the longest that fits, and on the tightest screens the text yields
   entirely (the dot alone carries the state, as before). Tap the topbar
   for the full story. */
.peer-status .pv-m, .peer-status .pv-s { display: none; }
@media (max-width: 620px) {
  .peer-status .pv-l { display: none; }
  .peer-status .pv-m { display: inline; }
}
@media (max-width: 460px) {
  .peer-status .pv-m { display: none; }
  .peer-status .pv-s { display: inline; }
}
@media (max-width: 350px) {
  .peer-status .pv-s { display: none; }
}
/* One-time slide-in when the state CHANGES — motion as punctuation, not
   wallpaper. Static thereafter. */
.peer-status.pv-in { animation: pvIn 240ms ease; }
@keyframes pvIn {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .peer-status.pv-in { animation: none; }
}
.peer-topbar.pv-tappable { cursor: pointer; }

@keyframes dot-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

@media (prefers-reduced-motion: reduce) {
  .peer-status-dot.online { animation: none; }
}

.chat-header {
  display: flex;
  align-items: center;
  flex-wrap: nowrap; /* the action row must NEVER break onto a second line */
  gap: 12px;
  padding: 8px 18px; /* was 14px — see .peer-topbar for why */
  border-bottom: 1px solid var(--line);
  background: var(--card);
}

/* One-line header, always: when JS detects the row would overflow (narrow
   screen × large system font), the text chips drop to icon-only. Titles and
   aria-labels keep the words for accessibility. */
/* ⚠ THE CHIPS BAR COLLAPSES WHILE THE KEYBOARD IS UP (07-30-2026).
   With the keyboard open in portrait there are ~406px to work with, and the
   two header bars were taking 80 of them. The founder DECLINED merging the two
   into one (see docs/MESSAGE_LAYOUT_AND_KEYBOARD.md) and chose this instead:
   the IDENTITY bar stays — you want to see who you are writing to — and the
   ACTION bar goes, because none of its chips are needed mid-sentence.
   `display: none`, deliberately, not height:0 — it also takes the chips out of
   the tab order while they are unreachable.
   ⚠ REVERSED 07-31-2026, late evening (founder, 2nd feedback wave): the
   action bar is now VISIBLE with the keyboard open. Two things changed the
   trade: the empty-send clear was removed the same evening, making ✦ CLEAR
   the ONLY clear — a panic control must not hide behind a keyboard dismiss —
   and the pinned-notice band was removed, handing back the vertical space
   this collapse had bought. The kb-up class itself STAYS: the Enter-follows-
   the-keyboard logic reads it. Do not re-hide the header without re-reading
   this paragraph's history — it has now gone both ways in one day. */

.chat-header.header-tight { gap: 6px; }
.chat-header.header-tight .header-actions { gap: 8px; }
.chat-header.header-tight .chip-label { display: none; }
.chat-header.header-tight .chip { padding: 6px 8px; }

.peer-info {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.peer-texts { flex: 1; min-width: 0; }

/* ⭐ THE PHOTO IS 1.5x, AND IT GIVES THE HEIGHT BACK WHEN THE KEYBOARD IS UP
   (founder, 08-20-2026: "the profile photo is quite small and i'd want it
   larger by around 1.5x"). 30px -> 45px.

   ⚠ THE PHOTO IS THE TALLEST THING IN .peer-topbar, so it alone sets that
   pane's height: 39px today, 54px at 45px. That is the exact cost the pane's
   padding was ALREADY trimmed to avoid on 07-30-2026 — see .peer-topbar,
   where the note records the two header bars reaching 96px of a 406px screen
   with the keyboard up, "more than the composer". Paying 15px back would put
   them at 102px, worse than the state that trim was made to fix.

   ⭐ SO IT IS SIZED FROM THE SPACE THAT ACTUALLY EXISTS. --vvh is
   visualViewport.height in px (app.js, setProperty(`--vvh`)), so the keyboard
   IS the signal — no JS, no class, no resize listener.

   Measured in a headless browser at the sizes rule 9b names:
     --vvh 100dvh (no visualViewport)  photo 45px    pane 54px
     --vvh 844 / 745 / 600px            photo 45px    pane 54px
     --vvh 500px                        photo 37.5px  pane 46.5px
     --vvh 420px                        photo 31.5px  pane 40.5px
     --vvh 320 / 260 / 200px            photo 30px    pane 39px  <- today's
   So the enlargement is free precisely when space is scarce, and the 100dvh
   fallback still gives the full 45px on a browser with no visualViewport.
   ⚠ Do NOT replace the clamp with a fixed 45px "for simplicity". The clamp IS
   the reason this change does not reopen a keyboard fault. */
.peer-avatar-btn {
  flex: none;
  width: var(--pav);
  height: var(--pav);
  padding: 0;
  border: none;
  background: none;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.peer-avatar {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.peer-status {
  font-size: 0.75rem;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-actions { display: flex; flex-wrap: nowrap; gap: 16px; margin-left: auto; } /* roomier — sound/theme/size are easy to mis-tap */

.chip {
  border: 1px solid var(--line);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  padding: 6px 12px;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.chip.subtle { background: transparent; color: var(--ink-faint); }
/* Now that these chips carry drawn icons (sound / text-size / theme),
   use the stronger --ink-soft so the line-art reads clearly in both
   themes — comfortably above the 3:1 graphical-object contrast floor. */
.chip.subtle:has(svg.ci) { color: var(--ink-soft); }

/* ⚠ #themeBtn and #sizeBtn NO LONGER EXIST — they were merged into the one
   Display chip on 07-29-2026 (header consolidation, docs/OFFERING_LESS.md).
   Their names were left behind in FOUR selector lists, which is why the bell
   alone kept full-strength ink and the 44px circular tap target while
   #displayBtn and #stepAwayBtn quietly lost both (founder, 08-01-2026:
   "the bell is one color and the clock and preferences is different").
   ⚠ The colour was the visible half; the SIZING was the costly half —
   measured 32x38 against a 44px accessibility floor. When a control is
   renamed, grep the stylesheet for the old id. */
#displayBtn, #stepAwayBtn, #navBtn { display: inline-flex; align-items: center; justify-content: center; }

/* Leaving is a real action — it vacates your seat — so it reads like one. */
.chip.danger {
  background: transparent;
  border-color: rgba(248, 113, 113, 0.55);
  color: #f87171;
  font-weight: 700;
}

/* ⚠ HOVER ONLY WHERE HOVER EXISTS. iOS keeps :hover after a tap until you
   touch something else, so on a phone ✦ CLEAR stayed SOLID RED after being
   pressed (founder, 08-01-2026) — it read as a stuck armed state. There is
   nothing to reset in JS; the fix is to stop claiming hover on touch. */
@media (hover: hover) {
  .chip.danger:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #ffffff;
  }
}

body.light .chip.danger { color: #b91c1c; border-color: rgba(185, 28, 28, 0.5); }
@media (hover: hover) { body.light .chip.danger:hover { background: #dc2626; border-color: #dc2626; color: #ffffff; } }

/* ------------------------------------------------------ invite bar */
/* One slim line while you're alone — the full options live in a dialog
   so they never crowd the conversation. */
.invite-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 10px 18px 0;
  padding: 8px 10px 8px 14px;
  border: 1px dashed var(--accent);
  border-radius: 999px;
  background: var(--accent-soft);
}

.invite-bar-text {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.invite-bar .btn.small { flex: 0 0 auto; }

.invite-card { text-align: left; }

.invite-card .invite-row { margin-top: 12px; }

.invite-done { margin-top: 16px; }

.invite-title {
  font-weight: 700;
  color: var(--accent);
  font-size: 0.9rem;
}

.invite-sub {
  margin: 4px 0 10px;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.invite-row {
  display: flex;
  gap: 8px;
}

.invite-row input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.btn.small {
  width: auto;
  padding: 9px 14px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.share-label {
  margin: 16px 0 8px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  text-align: left;
}

.share-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 8px;
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 11px 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--accent-soft);
  color: var(--ink);
  font: inherit;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.share-btn:hover { border-color: var(--accent); }
.share-btn:active { transform: scale(0.94); }

.share-ic { display: inline-flex; align-items: center; justify-content: center; font-size: 1.35rem; line-height: 1; }
.share-lb { font-size: 0.72rem; color: var(--ink-faint); }

@media (prefers-reduced-motion: reduce) {
  .share-btn { transition: none; }
  .share-btn:active { transform: none; }
}

.invite-qr-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 16px;
}

.invite-qr {
  flex: 0 0 auto;
  width: 116px;
  height: 116px;
  padding: 6px;
  background: #ffffff; /* QR needs a light quiet zone in both themes */
  border-radius: 12px;
  border: 1px solid var(--line);
}

.invite-qr svg { display: block; width: 100%; height: 100%; }

.invite-qr-hint {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.5;
  max-width: 220px;
}

/* ⭐ THE CLIPBOARD LINE (founder option A, 08-19-2026, beta approved;
   docs/INVITE_COPY.md). Tapping any send channel silently writes the link to
   the clipboard first (app.js copyQuietly, called from wireShareGrid) — a
   real fallback for an app that does not pre-fill, PROVED on a phone across
   both handoffs, and until now completely unannounced. The link carries the
   room key in its # fragment, so the product knew something the person did
   not. This says it. */
.share-clip {
  margin: 8px 0 0;
  font-size: 0.74rem;
  line-height: 1.45;
  color: var(--ink-faint);
  text-align: left;
}

/* ⭐ iOS ZOOM (08-19-2026). These three read-only link fields render at
   0.8rem = 12.8px via `.invite-row input` above, and every one of them is
   focusable — #inviteLink even selects its own text on focus. Below 16px iOS
   Safari zooms the page on focus and never restores the scale, after which
   nothing scrolls the way --vvh assumes.
   ⛔ ADDED, never merged into `.invite-row input`: that rule sizes the row
   for narrow cards and is doing a job. Scoped by ID, which outranks it on
   specificity, and placed after it so order can never matter either. */
#inviteLink,
#scheduledLink,
#schedKeepLink { font-size: 16px; }

@media (max-width: 480px) {
  .invite-row { flex-wrap: wrap; }
  .invite-row input { flex-basis: 100%; }
  .invite-qr { width: 96px; height: 96px; }
}

/* ----------------------------------------------------------- messages */
/* The conversation region: the scrolling list PLUS the pinned band beneath it.
   The Chimefield ground is painted here (see below) rather than on .messages,
   so the typing band and the crossed note are on the same continuous surface.
   Before this, the band carried its own flat --chat-bg while .messages carried
   the gradients on top of it, and the difference read as a grey slab. */
.convo {
  flex: 1;
  min-height: 0; /* load-bearing: without it a flex child refuses to shrink */
  display: flex;
  flex-direction: column;
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  background: transparent; /* .convo paints the ground now */
  /* The other half of the pull-to-refresh guard above. This is the scroller
     the finger actually drags; when it is already at the top, the scroll
     CHAINS out to the document, and the document's overscroll is what Safari
     reads as a refresh gesture. `contain` stops the chain at the list while
     keeping this pane's own scrolling normal. */
  overscroll-behavior-y: contain;
}

/* ---------------------------------------------- Chimefield (option Y1)
   Messages are bottom-anchored, so on a desktop window most of the room is
   empty most of the time — rooms here usually hold one to three messages,
   because replying clears. That emptiness IS the product's argument, so it
   is composed rather than filled: no dividers, no timestamps ladder, nothing
   the next send would have to clear away.

   Three layers, all BACKGROUND IMAGES on the scroll container. Backgrounds
   are painted against the element's own box, not its content, so they stay
   put while messages scroll over them — which is why this is not an overlay
   element.

     1. a field of ✦ chimes at varied sizes — the same star-stuff messages
        dissolve into, so the void reads as where they went
     2. light rising from the composer, pooling where you read and type
     3. the void falling away above it

   Deliberately NOT a lime border: the accent already means "your message"
   and "send". Spending it on a continuous frame makes it ambient, and an
   ambient accent stops signalling. The room keeps its existing neutral
   hairline (#chat border-inline) to stay a column on a wide screen. */
:root {
  /* One tile holding nine stars at varied sizes; repeated. Sparser = larger
     tile, which is how the field thins as a conversation fills up. */
  --chime-field: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 420'%3E%3Cg fill='%23C6FF00'%3E%3Cpath opacity='.15' transform='translate(70 58) scale(1.5)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.11' transform='translate(330 40)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.09' transform='translate(430 128) scale(1.1)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.13' transform='translate(188 96) scale(.7)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.07' transform='translate(120 176) scale(2)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.10' transform='translate(376 208) scale(.8)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.07' transform='translate(258 156) scale(1.2)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.09' transform='translate(470 288) scale(.65)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.06' transform='translate(48 300) scale(1.4)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3C/g%3E%3C/svg%3E");
  --chime-rise: rgba(198, 255, 0, 0.07);   /* light off the composer */
  --chime-void: rgba(0, 0, 0, 0.42);        /* the fade above */
  /* Tile size = a per-breakpoint BASE times a step app.js raises as the
     conversation fills. Splitting it this way is what lets phones be
     genuinely sparser rather than merely scaled — an inline --chime-tile
     set from JS would override any media query. */
  --chime-base-w: 820px;
  --chime-base-h: 660px;
  --chime-step: 1;
}
/* Light values hang off body.light — this app switches theme with a CLASS,
   not prefers-color-scheme, so a media query here would never fire. */
body.light {
    --chime-field: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 520 420'%3E%3Cg fill='%23647C0F'%3E%3Cpath opacity='.13' transform='translate(70 58) scale(1.5)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.09' transform='translate(330 40)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.07' transform='translate(430 128) scale(1.1)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.11' transform='translate(188 96) scale(.7)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.06' transform='translate(120 176) scale(2)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.08' transform='translate(376 208) scale(.8)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.06' transform='translate(258 156) scale(1.2)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.08' transform='translate(470 288) scale(.65)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3Cpath opacity='.05' transform='translate(48 300) scale(1.4)' d='M0-7 2-2 7 0 2 2 0 7-2 2-7 0-2-2Z'/%3E%3C/g%3E%3C/svg%3E");
    --chime-rise: rgba(100, 124, 15, 0.055);
    --chime-void: rgba(25, 30, 20, 0.055);
}

.convo {
  background-color: var(--chat-bg);
  background-image:
    var(--chime-field),
    linear-gradient(to top, var(--chime-rise), transparent 58%),
    linear-gradient(to bottom, var(--chime-void), transparent 68%);
  background-repeat: repeat, no-repeat, no-repeat;
  background-size:
    calc(var(--chime-base-w) * var(--chime-step)) calc(var(--chime-base-h) * var(--chime-step)),
    100% 62%, 100% 74%;
  background-position: 0 0, bottom, top;
}

/* The field drifts upward, the way dissolved messages do. One transform on
   one layer — not a per-particle loop. It idles behind an empty room for
   long stretches, so it is deliberately slow and cheap, and stops entirely
   when the system asks for less motion. */
@media (prefers-reduced-motion: no-preference) {
  .convo { animation: chime-drift 90s linear infinite; }
}
@keyframes chime-drift {
  from { background-position: 0 0, bottom, top; }
  to   { background-position: 0 calc(var(--chime-base-h) * var(--chime-step) * -1), bottom, top; }
}

/* Bottom-anchored conversation (all devices — see
   docs/MESSAGE_LAYOUT_AND_KEYBOARD.md). A zero-height spacer as the first
   flex item soaks up the free space, so a short conversation sits just above
   the composer and each new message appears there and pushes the older ones
   up. Rooms here usually hold one to three messages, because replying
   clears; top-down left those few stranded at the top of a tall empty
   screen, far from where you are typing and looking.

   A spacer, deliberately, and not the two obvious alternatives:
     justify-content: flex-end      breaks scrolling once content overflows —
                                    the top of the list becomes unreachable
     flex-direction: column-reverse inverts DOM order, which the append and
                                    fade-clear animations depend on
   Once content overflows there is no free space, the spacer collapses to
   zero, and long conversations behave exactly as before.

   Gated on .has-msgs so the empty state keeps its centering below. */
.messages.has-msgs::before { content: ""; flex: 1 1 auto; }

/* Centred while the room is empty: this is instructional, not conversation,
   and centring fills the void deliberately. The spacer above is inactive
   until a real bubble exists, so the two never fight over the free space
   (flex-grow resolves before auto margins, and would win). */
.empty-state {
  margin: auto;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* Static ✦ — the empty-room pulse was removed with the other background
   animations. The mark stays; it just no longer breathes. */
.empty-mark {
  font-size: 1.9rem;
  color: var(--accent);
  opacity: 0.6;
}

.empty-line {
  transition: opacity 0.6s ease;
  min-height: 2.8em;
}
.empty-line.swapping { opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .empty-line { transition: none; }
}

/* Bubbles are BORDERLESS: the tinted chat ground (--chat-bg) provides the
   separation. Padding and radius are in EM so the whole balloon — body, tail,
   corners — scales as one piece with the user's text-size setting. */
.msg {
  max-width: 78%;
  padding: 0.66em 0.9em;
  border-radius: var(--radius);
  line-height: 1.45;
  font-size: calc(0.95rem * var(--msg-scale));
  overflow-wrap: anywhere;
  white-space: pre-wrap; /* preserve Shift+Enter line breaks */
  animation: pop-in 220ms ease;
}

@keyframes pop-in {
  from { opacity: 0; transform: translateY(6px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.msg.mine {
  align-self: flex-end;
  /* Full lime with dark ink — 12.2:1, AAA. */
  background: var(--bubble-mine);
  color: var(--bubble-ink);
  border-bottom-right-radius: 0.4em;
}

/* Your own messages simply appear — no launch, no pop-in (founder decision,
   2026-07-19). Guarded with :not(.fading) so a vanishing bubble still runs
   its dissolve/scatter animation. */
.msg.mine:not(.fading) {
  animation: none;
}

.msg.theirs {
  align-self: flex-start;
  background: var(--bubble-theirs);
  color: var(--bubble-ink);
  border-bottom-left-radius: 0.4em;
}

/* ⚠ NO SPEECH-BALLOON TAIL — removed by founder decision 07-31-2026.
   Text bubbles are the plain rounded shape above: var(--radius) with the
   0.4em directional corner. Two tail architectures were built and both were
   retired the same day — the full history, the measured seam defects (the
   underside notch, the side-edge ripple), and the requirement that killed
   the approach are in docs/BUBBLE_AND_TAIL.md. READ IT before drawing a new
   tail. The short version: bubble-plus-tail must be ONE silhouette — a small
   border must be able to wrap the whole balloon as one continuous outline,
   and any tail that OVERLAPS the bubble (pseudo-element or child, painted or
   masked) outlines its seam instead. app.js still applies `text-bubble` to
   text messages; it currently styles nothing. */


/* ==========================================================================
   THE SPEECH TAIL — one silhouette, via border-image. Rebuilt 08-22-2026.

   ⛔ READ docs/BUBBLE_AND_TAIL.md FIRST. Two earlier tails were built and
   retired in a single day (07-31-2026), both because they worked by OVERLAP —
   a pseudo-element or child lying beside the bubble — and an overlap cannot
   take a border: the outline traces each part and draws the seam INSIDE the
   balloon. The founder's requirement is that a small border wrap bubble AND
   tail as ONE continuous outline.

   ⭐ This re-shapes the bubble ELEMENT ITSELF with a 9-slice `border-image`,
   so the balloon is one silhouette by construction. Verified: a stroke on the
   same path wraps the whole balloon with no internal seam.

   ⭐ WHY THE MODE-SWITCH DEFECT CANNOT RETURN. The original tail carved its
   taper by painting `--chat-bg` ON TOP — a token that CHANGES with the theme,
   over a ground that is NOT flat (the Chimefield drifts across it). That is
   exactly what "pasted on" looked like. Nothing here paints the ground.

   ⚠ WHY border-image AND NOT mask-border. mask-border was tried first and is
   better in principle, because the colour would stay in the CSS token instead
   of being duplicated into the SVG below. It was ABANDONED 08-22-2026 after
   two failed rounds on a real iPhone: Safari implements only the old
   -webkit-mask-box-image form, its sub-properties behave differently from
   Chrome's, and the result CLIPPED THE TEXT of any bubble that wrapped onto a
   second line — while looking perfect in headless Chrome. border-image is
   mature and universally supported. ⛔ Do not "improve" this back to
   mask-border without testing on a real iOS device.

   ⚠ THE COST OF THAT CHOICE, so it is not discovered later: the bubble fill
   colour is DUPLICATED into the two data URIs below. It is safe only because
   `--bubble-mine` (#ffffff) and `--bubble-theirs` (#D9E8A3) are IDENTICAL in
   both themes (see docs/BUBBLE_AND_TAIL.md). ⛔ IF EITHER BUBBLE COLOUR EVER
   CHANGES, IT MUST BE CHANGED HERE TOO — the tokens alone will not do it.

   ⚠ 9-slice geometry: 10 units = 1em, viewBox 36×36, slice 12 (= 1.2em). The
   tail lives in the bottom OUTER corner slice, which is never stretched; only
   the flat edges stretch, so the tail is identical at every bubble size. It
   fits because the tail-side corner was ALREADY nearly square (0.4em) in the
   shipped design; a large radius there would force a slice taller than a
   one-line bubble (~2.77em) and the browser would shrink it.
   ⛔ The SVG declares width AND height, not just a viewBox — without an
   intrinsic size a replaced image falls back to 300x150 and every slice is
   measured against the wrong dimensions.
   ========================================================================== */
.msg.text-bubble {
  border-style: solid;
  border-color: transparent;
  border-width: 0;
  border-radius: 0;                  /* the shape comes from the image */
  background: transparent;           /* the image's fill IS the bubble */
  /* ⚠ THE TAIL HANGS BELOW THE BODY (founder, 08-22-2026: "shaped and extend
     lower, like iMessage"). The element's box must OWN that space, so the
     bottom padding grows by the hang. Without it the browser scales the
     slices down to fit and the whole balloon squashes. */
  padding-bottom: 1.56em;            /* 0.66em of real padding + 0.9em of hang */
}
.msg.text-bubble.theirs {
  padding-left: 1.5em;               /* content clears the tail zone */
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='46' viewBox='0 0 36 46'%3E%3Cg%3E%3Cpath d='M 18 0 L 24 0 A 12 12 0 0 1 36 12 L 36 24 A 12 12 0 0 1 24 36 L 13 36 C 11 42 6 44 0 44 C 5 41 7 36 6 30 L 6 12 A 12 12 0 0 1 18 0 Z' fill='%23D9E8A3'/%3E%3C/g%3E%3C/svg%3E") 12 12 22 14 fill / 1.2em 1.2em 2.2em 1.4em / 0 stretch;
}
.msg.text-bubble.mine {
  padding-right: 1.5em;
  /* ⭐ NO JUMP WHEN "Waiting" LANDS (founder, 08-22-2026). Two seconds after
     a send, armWaiting() writes "Waiting" into the meta row (app.js,
     WAITING_AFTER_MS), and .meta-recv's margin-left:auto pushes it to the far
     right — so the row's natural width becomes time + 12px + receipt, and any
     bubble whose TEXT is narrower than that widens two seconds in. Measured
     08-22-2026 at --msg-scale 1: "Hi" went 77px → 131px, which is 8.62em of
     its own font. Starting at that width removes the jump at zero visual
     cost — the settled state is unchanged. Scoped to .mine, because only the
     sender's bubble ever receives a delivery receipt (RECEIPT_RANK). */
  min-width: 8.7em;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='46' viewBox='0 0 36 46'%3E%3Cg transform='translate(36,0) scale(-1,1)'%3E%3Cpath d='M 18 0 L 24 0 A 12 12 0 0 1 36 12 L 36 24 A 12 12 0 0 1 24 36 L 13 36 C 11 42 6 44 0 44 C 5 41 7 36 6 30 L 6 12 A 12 12 0 0 1 18 0 Z' fill='%23ffffff'/%3E%3C/g%3E%3C/svg%3E") 12 12 22 14 fill / 1.2em 1.2em 2.2em 1.4em / 0 stretch;
}

/* The crossed halo (rule 7) is a box-shadow on the border box, which no longer
   matches the balloon. A filter follows the painted silhouette — tail
   included — so the glow hugs the shape rather than a rectangle. */
.msg.text-bubble.crossed { box-shadow: none; filter: drop-shadow(0 0 0.5em rgba(198, 255, 0, 0.45)); }
body.light .msg.text-bubble.crossed { box-shadow: none; filter: drop-shadow(0 0 0.5em rgba(129, 163, 13, 0.38)); }

/* ⛔ The ✦ vanish sparks are `.fading::after` / `.fading.scatter::before`, and
   text bubbles only GAINED that spark when the old tail was removed. Drop the
   balloon for the dissolve — and give the padding back, or the bubble keeps a
   hole where the tail used to hang. */
.msg.text-bubble.fading {
  border-image: none;
  border-radius: var(--radius);
  padding-bottom: 0.66em;
}
.msg.text-bubble.fading.theirs { background: var(--bubble-theirs); border-bottom-left-radius: 0.4em; }
.msg.text-bubble.fading.mine { background: var(--bubble-mine); border-bottom-right-radius: 0.4em; }

/* No-key / undecryptable placeholder: native lock icon inline before the note. */
.msg.locked-msg { font-style: italic; opacity: 0.9; }
.locked-ico { display: inline-block; }
.locked-ico .ci { width: 1.05em; height: 1.05em; vertical-align: -0.2em; }

.msg .meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-size: calc(0.65rem * var(--msg-scale));
  opacity: 0.75;
}
/* Delivery receipt — lower-RIGHT of the sender's bubble, quieter than the
   sent time so the row reads "sent … / received …" at a glance. */
.msg .meta .meta-recv {
  margin-left: auto;
  padding-left: 12px;
  opacity: 0.85;
}

.msg .tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(100, 124, 15, 0.14);
  color: #506212;
  font-weight: 600;
}

.msg.mine .tag.answered-tag { animation: pop-in 220ms ease; }

/* Rule 7 — a crossed message that this device's next send will spare.
   Bubbles are BORDERLESS (founder decision 2026-07-20); a soft lime halo
   wraps the bubble shape instead. Static — nothing to quiet under
   prefers-reduced-motion. If a tail ever returns it must carry this halo
   over its whole silhouette too — see docs/BUBBLE_AND_TAIL.md. */
.msg.crossed { box-shadow: 0 0 0.8em rgba(198, 255, 0, 0.35); }
body.light .msg.crossed { box-shadow: 0 0 0.8em rgba(129, 163, 13, 0.28); }

.sysnote {
  align-self: center;
  text-align: center;
  /* --ink-soft (not -faint): these notes explain what just happened —
     they must be comfortably readable on both themes */
  color: var(--ink-soft);
  /* scales with the header's text-size (Tt) control, like bubbles do */
  font-size: calc(0.78rem * var(--msg-scale));
  padding: 2px 10px;
  animation: pop-in 220ms ease;
}

.sysnote.wipe { color: var(--accent); }

/* informational notices (why a send was blocked, encryption failures,
   saved-file confirmations…): a quiet bordered card in full-strength ink —
   these explain something the user needs to actually read, in either theme,
   at whatever text size they chose */
.sysnote.notice {
  color: var(--ink);
  font-size: calc(0.84rem * var(--msg-scale));
  font-weight: 500;
  line-height: 1.45;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  max-width: min(520px, 92%);
}
/* ⭐ THE BENEFITS INSIDE A NOTICE (founder, 08-12-2026: "bold the benefits …
   so the benefits standout when reading", then, on a phone: "the bold is not
   really noticeable").
   ⚠ HE WAS RIGHT, AND MEASURED: this notice is already font-weight 500, so a
   plain <strong> is a 200-unit jump at 13.44px in the SAME colour. That is
   nothing on a phone. Colour is what carries it.
   ⭐ TWO SIGNALS, never colour alone — weight AND colour — so the emphasis
   still reads for someone who cannot see the difference in hue.
   ⛔ --accent, NOT --lime. Lime (#C6FF00) is the brand fill and is unreadable
   as text on white; --accent is the themed text form, lime on black and olive
   on white. Checked at 375px in both themes. */
.sysnote.notice strong {
  color: var(--accent);
  font-weight: 700;
}

.sysnote.export {
  color: var(--alert);
  font-weight: 600;
}

/* presence: who's here and who's gone — meant to be noticed */
.sysnote.presence {
  color: var(--accent);
  font-weight: 700;
  font-size: calc(0.82rem * var(--msg-scale));
}

.sysnote.presence.out { color: var(--ink-soft); }

/* ------------------------------------------------------- attachments */
.attach-img {
  display: block;
  max-width: min(260px, 100%);
  border-radius: 12px;
  margin-bottom: 6px;
  /* keep previews legible even when the image matches the bubble color */
  border: 2px solid rgba(0, 0, 0, 0.3);
}

.msg.theirs .attach-img { border-color: rgba(0, 0, 0, 0.25); }

.file-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.07);
  border: 1px solid rgba(0, 0, 0, 0.16);
}

.file-icon { font-size: 1.4rem; }

.file-name {
  font-weight: 600;
  font-size: calc(0.85rem * var(--msg-scale));
  overflow-wrap: anywhere;
}

.file-size {
  font-size: 0.7rem;
  opacity: 0.75;
}

.save-btn {
  display: block;
  margin-top: 8px;
  /* fixed dark-olive on the white bubbles, same in both themes */
  border: 1px solid #647C0F;
  border-radius: 9px;
  background: rgba(198, 255, 0, 0.18);
  color: #506212;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
}

.save-btn:hover:not(:disabled) { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }

.save-btn:disabled {
  border-color: rgba(0, 0, 0, 0.18);
  background: transparent;
  color: #6f6f6f;
  cursor: default;
}

/* View + Save side by side under a file bubble */
.file-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.file-actions .save-btn { margin-top: 8px; }
.save-btn .ci { width: 1.3em; height: 1.3em; vertical-align: -0.3em; margin-right: 2px; }

.attach-img { cursor: zoom-in; }

/* Tapping the capsule body opens it, so it must look pressable. */
.att-row.att-open { cursor: pointer; }
.att-row.att-open:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 10px; }

/* ⚠ iOS LONG-PRESS. The viewer already blocks `contextmenu` and dragging,
   but iOS Safari does NOT fire contextmenu on a long press — it raises its
   own native callout, which offers "Save to Photos" / "Copy". Only
   -webkit-touch-callout suppresses that, and it was absent, so a SHOWN
   image could be saved by holding it (founder, 08-01-2026, on an iPhone).
   ⚠ THIS IS A CLOSED DOOR, NOT A GUARANTEE. A screenshot still works and
   always will — the Terms and the attachment intro say so in as many words
   ("deletion has honest limits… screenshot or a second camera"). Do NOT
   strengthen any promise on the back of this rule. */
.viewer.shown-only img,
.viewer.shown-only video {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.attach-audio {
  display: block;
  width: min(250px, 100%);
  margin-bottom: 6px;
}

/* The "deletion preview" dimming (messages a send would clear dimmed while
   a draft existed) was removed 2026-07-20 — it made the room hard to read
   at exactly the moment people re-read it: while composing a reply. */

/* ⭐ REQUIRED-FIELD MARKING (founder, option B, 08-21-2026): a star on each
   required label, a one-line legend, and a live "Still needed" line above the
   gated button. --accent, never red: red is the error voice and an untouched
   empty form is not an error. Never --lime bare: invisible weight on white. */
.req { color: var(--accent); font-weight: 700; }
.req-legend {
  font-size: 0.75rem;
  color: var(--ink-faint);
  margin: 0 0 10px;
}
.req-missing { color: var(--ink-soft); }

/* ⭐ HANDLE LIFECYCLE, dashboard side (DOOR_DESIGN §9i, 08-21-2026). The
   banner is the founder's "noticeable on entry" rule: accent-tinted, top of
   the Door section, never a buried row. The pause pane is INLINE by design —
   a modal would join the dialog-close ledger for no gain. */
.door-banner {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 8px 0 12px;
  font-size: 0.9rem;
}
.door-banner .dr-actions { margin-top: 8px; justify-content: flex-start; }
.door-pausepane {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.door-pausepane .btn.sel { border-color: var(--lime); color: var(--accent); }
.door-oe { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; color: var(--ink-soft); }
.door-notes { margin-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.door-known-note { font-size: 0.95rem; color: var(--ink); margin: 10px 0 2px; }

/* -------------------------------------------------------- profile photo */
.avatar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 14px;
}

/* ⭐ 08-21-2026 — THE PICKER WAS BEING MISSED, and it was measurable.
   It drew its outline in --line, which is the HAIRLINE DIVIDER token:
   1.38:1 on dark, 1.27:1 on light. Its label was --ink-faint. And it sat
   directly above the lime primary at 13.13:1. What a person saw was a grey
   sentence between a field and a big lime button, with nothing saying it
   could be tapped — and the sentence ended "— optional", which is an
   instruction to skip it.

   Option D (founder, 08-21-2026): a WELL, not a pill. The circle is the
   shape of the thing you get, at the size you get it, so it reads before
   any word does. The accent ring and tint make it visibly tappable without
   putting a second full-width coloured bar beside "Start a new room" —
   ONE lime primary per screen stays true.
   ⛔ Do not move the tint onto the whole button. That was option C, and it
   competes with the primary directly below it. */
.avatar-pick {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  text-align: left;
  cursor: pointer;
}
.avatar-pick:hover .avatar-pick-lbl { color: var(--accent); }

/* ⚠ The well takes --pav, the SAME clamp as the thumbnail it becomes, so
   the empty and filled states are one size and the software-keyboard
   shrink (rule 9b) applies to both. Hardcoding 45px here would make the
   empty picker 15px taller than the filled one with a keyboard up. */
.avatar-well {
  flex: none;
  width: var(--pav);
  height: var(--pav);
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  transition: border-color 0.15s, background 0.15s;
}
.avatar-well .ci {
  width: calc(var(--pav) * 0.45);
  height: calc(var(--pav) * 0.45);
}
/* Once a photo fills it there is nothing left to invite — the photo is its
   own affordance, and the ring would only draw a dashed line around a face. */
.avatar-pick.has-photo .avatar-well {
  border: 0;
  background: transparent;
}
.avatar-pick.has-photo .avatar-well .ci { display: none; }

.avatar-pick-lbl {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  transition: color 0.15s;
}
.avatar-pick-lbl em {
  font-style: normal;
  font-size: 0.72rem;
  color: var(--ink-faint);
}

/* ⭐ 30px -> --pav (45px, 08-20-2026). This is the thumbnail inside all THREE
   pickers — start page, invite screen and the account sheet — because they
   share one class.
   ⚠ IT TAKES THE CLAMP, unlike .acct-chip, and the difference is flow. These
   sit inside scrolling surfaces that DO get a software keyboard (the start
   page's room code, the invite screen's name, the account sheet's fields), so
   15px more of always-on height is 15px less of a card that already has to
   fit. --pav gives it back at exactly the sizes rule 9b tests. */
.avatar-thumb {
  width: var(--pav);
  height: var(--pav);
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.avatar-clear {
  flex: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  cursor: pointer;
}
.avatar-clear:hover { color: #f87171; border-color: #f87171; }

.photo-card {
  max-width: min(440px, 92vw);
  text-align: center;
  /* ⚠ ADDED 08-18-2026 for the corner ✕, and added HERE rather than by
     widening anything. .sheet-x is position: absolute and needs a containing
     block; .member-card supplies its own at :1091 and .leave-card is a
     scroller with a sticky rail. This card is neither, so it gets its own
     one-line context. ⛔ Still no max-height and no overflow: this card must
     not become a scroller (docs/DIALOG_CLOSE_AFFORDANCE.md §5). */
  position: relative;
}

.photo-card img {
  width: 100%;
  border-radius: 20px;
  border: 1px solid var(--line);
  display: block;
}

.photo-caption {
  margin-top: 10px;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ⭐ THE ✕ ON THE PHOTO LIGHTBOX (founder, option A, 08-18-2026, both
   editions). ADDED alongside .sheet-x at :1076, never a widening of it —
   .sheet-x is serving #accountSheet and #convenienceModal today and is not
   touched here (the ⛔ block at the top of CLAUDE.md).

   ⚠ THIS ONE SITS OVER A PHOTOGRAPH, WHICH IS THE WHOLE DIFFICULTY. Every
   other ✕ in the app stands on a known surface — var(--card) — so it can use
   the theme's ink and no backing at all. Here the pixel behind the glyph is
   whatever the peer uploaded, and it can be white sky at the top right of one
   photo and black at the top right of the next. A themed colour cannot be
   correct for both.

   THE CHOICE, and it is the same one .photo-caption already made at :2417 by
   hardcoding #fff: this surface is a FIXED dark context in both themes,
   because the overlay behind it is rgba(0,0,0,0.72) in both (:2568). So the
   control is drawn once, in fixed values, and does not follow the theme:

     - a translucent BLACK disc, so a light photo has something to separate
       the glyph from,
     - a WHITE glyph, so a dark photo has the same,
     - a hairline white ring, which is what actually carries it on a dark
       photo where the disc itself disappears.

   Between them the disc and the ring mean at least one of the three is always
   the opposite of whatever is underneath, and MEASURED that is exactly what
   happens. Measured on the real page at 390x844, sampling the rendered
   pixels, and IDENTICAL in light and dark because none of these values is
   themed:

                    edge against the photo      glyph against the disc
     white photo    disc  9.29:1, ring 1.00:1   6.15:1
     black photo    disc  1.00:1, ring 5.61:1   11.67:1
     1px checker    disc  4.43:1, ring 2.79:1   9.49:1

   ⚠ READ THE TWO 1.00:1 CELLS. On a white photo the ring does nothing; on a
   black photo the disc does nothing. Each is carrying the case the other
   cannot, so removing either one loses a whole class of photograph, and the
   measurement that would catch it is the one flat fill nobody tests.

   ⚠ NO .card-x AND NO .card-x-rail. Those two exist because .leave-card and
   .member-card are scrollers and an absolute ✕ scrolls away inside them
   (:1131, :1176). .photo-card sets no max-height and no overflow, so nothing
   scrolls and the rail has no job. .card-x would additionally paint
   var(--card) behind the glyph, which is the themed backing this rule exists
   to avoid.

   ⚠ 10px, not .sheet-x's 6/8. The photo has border-radius: 20px (:2410), so
   at 6/8 the disc's corner would hang off the rounded edge onto the backdrop.
   At 10/10 the disc lies entirely on the image.

   ⚠ :hover and :focus-visible are RESTATED. .sheet-x:hover (:1083) sets
   var(--accent-soft) and .sheet-x:focus-visible (:1084) an olive outline in
   light mode; both are theme colours over an unknown photo, and the same
   equal-specificity/later-wins trap as .sheet-x.card-x:hover at :1132.

   ⚠ The 44px minimum touch target comes from .sheet-x (:1079) and is NOT
   overridden. The disc IS the 44px box. */
.sheet-x.photo-x {
  top: 10px;
  right: 10px;
  color: #fff;
  /* ⚠ 0.72 IS THE OVERLAY'S OWN ALPHA (:2568), not a taste value, and it was
     RAISED to it from 0.55 after measuring. At 0.55 the disc composites to
     #737373 over a white photo and the glyph read 3.49:1 against it — over
     the 3:1 floor, but only just, and this glyph is a 0.76px hairline
     (stroke-width 2.6 in a 48 viewBox drawn at 14px, .sheet-x svg :1082), so
     antialiasing spends most of what it has. At 0.72 the disc composites to
     #474747 and the same glyph reads 6.15:1. Nothing about the dark case
     changes: a black disc over a black photo is invisible at either alpha,
     and the ring is what carries it there. */
  background: rgba(0, 0, 0, 0.72);
  /* ⚠ THE RING IS THE WHOLE DARK-PHOTO CASE. Over black the disc vanishes
     into the photo (measured 1.00:1) and this hairline is the only edge:
     it composites to #848484 and reads 5.61:1 against black. Delete it and
     the control disappears on any dark photograph. */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
  /* Softens a BUSY photo behind the disc, which a flat test image cannot
     show. It is a help, not the mechanism: the disc and ring above carry it
     on their own where backdrop-filter is unsupported. */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.sheet-x.photo-x:hover { color: #fff; background: rgba(0, 0, 0, 0.78); }
.sheet-x.photo-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* ----------------------------------------------------------- QR scanner */
/* Full-width secondary action. Named .scan-btn until 08-02-2026, when the QR
   scan control it was written for became a text link and the name started
   describing a button that no longer wore it. */
.wide-btn {
  width: 100%;
  margin-top: 10px;
  font-size: 0.85rem;
}

.day-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0;
}

.day-chips button {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 8px 13px;
  font: inherit;
  font-size: 0.78rem;
  cursor: pointer;
}

.day-chips button.selected {
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
  font-weight: 700;
}

.schedule-summary {
  margin: 10px 0 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  min-height: 1.3em;
}

.schedule-summary.invalid { color: #f87171; }

body.light .schedule-summary.invalid { color: #b91c1c; }

.schedule-hint {
  margin: 10px 0 0;
  /* This is the one thing a scheduler must not miss: the link is the only
     way back in. Bold lime, sized up — impossible to skim past. */
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.5;
  text-align: left;
}

#scheduledInfo .invite-row { margin-top: 4px; }

.scanner {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.92);
}

.scanner-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
}

.scanner-title { color: #f5f5f5; font-size: 0.85rem; font-weight: 600; }

.scanner .chip { background: #1f1f1f; color: #f5f5f5; border-color: #333; }

.scanner-stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.scanner-stage video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(240px, 70vw);
  height: min(240px, 70vw);
  border: 3px solid var(--lime, #C6FF00);
  border-radius: 22px;
  pointer-events: none;
}

.scan-status {
  margin: 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  text-align: center;
  color: #a3a3a3;
  font-size: 0.85rem;
}

.scan-status .btn { width: auto; margin-top: 8px; display: inline-block; }

/* ---------------------------------------------------- leave/burn dialog */
.leave-modal {
  position: fixed;
  /* ⚠ BOUND TO THE VISIBLE VIEWPORT, not the layout one. `inset: 0` spans the
     whole screen, so with a software keyboard up the card was centred in the
     FULL height — i.e. its middle sat behind the keyboard, with no way to
     scroll to it (founder, 08-01-2026, on the step-away dialog's Other…
     fields). .leave-card already capped its own height to --vvh; the height
     was never the problem, the CONTAINER was.
     ⚠ bottom: auto matters — top + bottom + height is over-constrained, and
     leaving it to the browser to drop one is not a decision worth gambling. */
  top: 0; left: 0; right: 0; bottom: auto;
  height: var(--vvh, 100%);
  z-index: 60;
  display: flex;
  /* ⚠ flex-start + margin:auto on the card, NOT align-items:center. Centring
     a flex child that OVERFLOWS clips its top and makes it unreachable by
     scrolling — the exact symptom being fixed. Auto margins centre without
     that failure mode. */
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  /* ⚠ Stop the gesture chaining to the page underneath. Without this, scrolling
     inside an open dialog ran past its end and scrolled #landing behind it, so
     the start page slid into view under the keyboard while a dialog was open
     (founder, 08-02-2026). body already sets overscroll-behavior:none for
     pull-to-refresh, but #landing is its own scroll container and that rule
     does not reach it. */
  overscroll-behavior: contain;
  padding: 20px;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.leave-card {
  width: min(380px, 100%);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 26px 24px calc(22px + env(safe-area-inset-bottom));
  text-align: center;
  margin: auto; /* centres inside .leave-modal without clipping when tall */
  animation: pop-in 220ms ease;
  /* Same cap as .ack-card. This one grew on 07-27-2026 when the
     unopened-attachment warning was added above the choices, so on a short
     phone the last choice could sit below the fold. The whole card scrolls
     here rather than pinning a footer: every element in it is a CHOICE, so
     there is no one button that must stay reachable — they all must.

     ⚠ 40px, NOT 24px, and the number is arithmetic rather than taste:
     .leave-modal has `padding: 20px`, top AND bottom. A card capped at
     --vvh - 24px can therefore stand 16px taller than the space it sits
     in, which makes the MODAL scroll — and what is behind the card is the
     dark backdrop. Founder, tunnel pass 08-07-2026, typing in the
     change-email field with a keyboard up: "scrolls with dark blank below
     it". Measured before: modal scrollHeight 316 against clientHeight 300.
     If the modal's padding ever changes, change this with it. */
  max-height: calc(var(--vvh, 100dvh) - 40px);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;   /* see check-scroll.js */
}

/* Sparks of the ✦ mark rise and dissolve — the room vanishing into the
   ether, not going up in flames. */
.leave-ether {
  position: relative;
  height: 64px;
}

.leave-ether span {
  position: absolute;
  left: 50%;
  bottom: 4px;
  color: var(--accent);
  animation: ether-rise 2.6s ease-in infinite;
  opacity: 0;
}

.leave-ether .e1 { font-size: 1.9rem; margin-left: -14px; }
.leave-ether .e2 { font-size: 1.1rem; margin-left: 16px; animation-delay: 0.9s; }
.leave-ether .e3 { font-size: 0.8rem; margin-left: -34px; animation-delay: 1.7s; }

@keyframes ether-rise {
  0% { transform: translateY(0) scale(1); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: translateY(-44px) scale(0.55); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .leave-ether span { animation: none; opacity: 1; }
  .leave-ether .e2, .leave-ether .e3 { opacity: 0.5; }
}

.vanish-note {
  margin: 0 0 16px;
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-style: italic;
  animation: pop-in 400ms ease;
}

.leave-title {
  margin: 10px 0 8px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.35rem;
  color: var(--ink);
}

/* --------------------- leave dialog: two ways out --------------------- */
.leave-choices { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.leave-choice {
  width: 100%;
  text-align: left;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  font: inherit;
  transition: border-color .12s, background .12s;
}
.leave-choice:hover { background: rgba(255, 255, 255, 0.05); }
.leave-choice .lc-label { display: block; font-weight: 700; font-size: 0.95rem; margin-bottom: 3px; }
.leave-choice .lc-desc { display: block; color: var(--ink-soft); font-size: 0.8rem; line-height: 1.5; }
.leave-choice.keep { border-color: rgba(198, 255, 0, 0.32); }
.leave-choice.keep .lc-label { color: var(--accent); }
.leave-choice.keep .lc-label::before { content: "→ "; opacity: 0.7; }
/* The final choice is the weightier one, but calm — not an alarm. It reads
   as more deliberate through a soft lime ✦ and a subtly deeper card, in the
   ChimeChat white/black/lime family (founder direction 2026-07-21). */
/* ⚠ VANISH IS THE DEFAULT (founder call, 08-02-2026). It used to be the quiet
   bordered card while "Not yet, go back" carried .btn.primary; the emphasis is
   now the other way round. The ORDER is untouched — step-out first, vanish
   second — which was restored 08-01-2026 and is not up for revisiting; this
   changes only which choice reads as the expected one. */
.leave-choice.vanish {
  border-color: var(--lime);
  background: var(--lime);
}
.leave-choice.vanish .lc-label { color: var(--on-lime); }
.leave-choice.vanish .lc-desc { color: var(--on-lime); opacity: 0.78; }
.leave-choice.vanish:hover { background: var(--lime-deep); border-color: var(--lime-deep); }
.leave-choice.vanish .lc-label::before { content: "✦ "; color: var(--on-lime); opacity: 0.9; }
.leave-notyet { margin: 6px 0 4px; } /* the quiet way out; the default is the vanish choice below */

/* Closing countdown banner (the staying person, mid-farewell) — calm and
   kind: a soft lime-to-card gradient, lime accent on the count, no alarm.
   Non-blocking so they can still read and save while it winds down. */
.closing-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 12px 0;
  padding: 12px 14px;
  border: 1px solid rgba(198, 255, 0, 0.3);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(198, 255, 0, 0.1), rgba(255, 255, 255, 0.02));
}
.closing-banner .cb-text { margin: 0; flex: 1; font-size: 0.82rem; line-height: 1.5; color: var(--ink); }
.closing-banner .cb-count { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent); }
/* Names what is about to be lost, appended to whatever the admin copy says.
   Weighted like the countdown — this is the actionable part of the sentence,
   not a footnote — but not coloured, so it never competes with the clock. */
.closing-banner .cb-unopened { font-weight: 650; }
/* The live stage of a lifecycle countdown: same lime, slightly larger, with a
   slow 2s breath. Deliberately NOT an alarm colour — a room returning to the
   ether is the product working, not a failure. */
.closing-banner .cb-live {
  font-size: 1.08em;
  letter-spacing: 0.01em;
  animation: cbBreath 2s ease-in-out infinite;
}
@keyframes cbBreath { 0%, 100% { opacity: 1; } 50% { opacity: 0.72; } }
@media (prefers-reduced-motion: reduce) { .closing-banner .cb-live { animation: none; } }
/* Filled lime: letting a room go is an affirmative act here, not a warning. */
.closing-banner #closeNowBtn {
  flex: none;
  background: var(--lime);
  border-color: var(--lime);
  color: var(--on-lime);
  font-weight: 600;
}
.closing-banner #closeNowBtn:hover { background: var(--lime-deep); border-color: var(--lime-deep); }

/* Whole-screen dissolve as a room vanishes (the Clear effect, everywhere):
   the ether sparks fly (canvas) while the room itself fades and lifts away,
   then we return to the start page. */
.screen.screen-vanishing { animation: screenDissolve 900ms ease forwards; pointer-events: none; }
@keyframes screenDissolve {
  0%   { opacity: 1; filter: none; transform: none; }
  100% { opacity: 0; filter: blur(3px); transform: translateY(-14px) scale(0.985); }
}
@media (prefers-reduced-motion: reduce) {
  .screen.screen-vanishing { animation: none; opacity: 0; }
}

/* ============ light-mode readability (founder QA 2026-07-21) ============
   Lime-family text (--accent) on the pale-lime chat ground and lime-tinted
   surfaces (--accent-soft) loses contrast on white. Darken these foregrounds
   and firm up the leave-dialog cards for the LIGHT theme only — the dark
   theme keeps its brighter lime, which reads fine on near-black. Backgrounds
   are left as-is per founder direction (adjust foreground, not the ground). */
body.light .empty-state { color: var(--ink-soft); }
body.light .empty-mark { color: var(--accent-deep); opacity: 0.9; }
body.light .invite-bar-text { color: var(--accent-deep); }
body.light .staged-hint { color: var(--accent-deep); }
body.light .about-link:hover { color: var(--accent-deep); } /* was #fff — vanished on white */
body.light .leave-ether span { color: var(--accent-deep); } /* decorative ✦ flourish, readable on white */
body.light .chip:not(.subtle):not(.danger) { color: var(--accent-deep); } /* INVITE chip: crisp lime on white */

/* Leave dialog: the two choices must read as tappable cards on the white
   sheet (the dark theme's white-tint fill is invisible here). */
body.light .leave-choice { background: rgba(0, 0, 0, 0.035); border-color: var(--line); }
body.light .leave-choice:hover { background: rgba(0, 0, 0, 0.06); }
body.light .leave-choice.keep { border-color: rgba(129, 163, 13, 0.55); }
body.light .leave-choice.keep .lc-label { color: var(--accent-deep); }
body.light .leave-choice.vanish { border-color: var(--lime); background: var(--lime); }
body.light .leave-choice.vanish .lc-label,
body.light .leave-choice.vanish .lc-desc,
body.light .leave-choice.vanish .lc-label::before { color: var(--on-lime); }
/* Closing banner reads on white too */
body.light .closing-banner { border-color: rgba(129, 163, 13, 0.5); background: linear-gradient(180deg, rgba(129, 163, 13, 0.14), rgba(0, 0, 0, 0.015)); }
body.light .closing-banner .cb-count { color: var(--accent-deep); }
body.light .closing-banner #closeNowBtn { border-color: rgba(129, 163, 13, 0.55); color: var(--accent-deep); }

/* ---------------------- etiquette & step-away ------------------------- */
.leave-text.tleft { text-align: left; }

/* ---------------------------------------------- etiquette dialog layout
   The dialog carries five separate ideas and `.leave-text` is margin:0 inside
   a block card, so they used to butt together with no gap at all — one wall of
   prose where the eye had nothing to hold on to. The wrapper supplies the
   rhythm (the paragraphs keep their own margin:0, so nothing else in the card
   shifts), the two house rules read as ✦ bullets, and a hairline separates
   each remaining topic. Formatting only — no wording changed. */
.etiq-body { display: flex; flex-direction: column; gap: 13px; }
.etiq-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.etiq-list li {
  position: relative;
  padding-left: 21px;
  text-align: left;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.6;
}
/* The ✦ is the app's own mark, not a generic disc — the same star used for
   sends, sparks and the wordmark. */
.etiq-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  line-height: 1.6;
}
.etiq-list strong { color: var(--ink); }

/* Shared hairline between topics in a long dialog. ⚠ Must be usable as a
   <span>: showAckDialog injects its body as `<p>${body}</p>`, and a <div>
   inside a <p> is closed early by the parser, which would break the dialog's
   structure. `display: block` on a span is valid there and renders the same.
   The margin is for that flow context; inside .etiq-body the flex gap already
   provides the spacing, so it is zeroed there. */
.dlg-sep {
  display: block;
  height: 1px;
  background: var(--line);
  margin: 13px 0;
}
.etiq-body .dlg-sep { margin: 0; }
.leave-etiq, .invite-etiq {
  font-size: 0.8rem;
  color: var(--ink-faint);
  margin: 2px 0 10px;
}
.about-etiq {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: var(--ink-soft);
}
.about-etiq p { margin: 0 0 8px; }
.about-etiq-title { font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.about-etiq .ci { width: 1rem; height: 1rem; vertical-align: -0.2em; }

/* ⚠ THREE TIERS BY ROLE, not one uniform button (founder, 08-01-2026).
   The complaint was that every choice looked identical, so nothing read as
   the main path. Chips = choose a time (the primary path, all one touch).
   .sa-notsure = the no-time path, a full-width outlined button. .sa-cancel =
   quiet text, because a cancel should never compete with a choice. */
.sa-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 10px 0 4px; }
.sa-quick .sa-opt {
  flex: 1 1 28%;
  min-width: 84px;
  padding: 12px 6px;
  font-weight: 650;
  border-color: color-mix(in srgb, var(--accent) 34%, var(--line));
  color: var(--accent);
}
.sa-quick .sa-opt:disabled { color: var(--ink-faint); border-color: var(--line); }
@media (hover: hover) {
  .sa-quick .sa-opt:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); color: var(--on-lime); }
}
/* Typing is a rarity now — the presets span everything the room permits —
   so it hides behind a disclosure instead of sitting in the primary path
   with a "Go" that reads as an afterthought. */
/* ⚠ A REAL TAP TARGET. This was 0.82rem with 4px padding — roughly 20px
   tall, well under the 44px minimum — and the founder reported it "sometimes
   doesn't open even when clicked a few times", which is what an undersized
   target feels like rather than a broken handler. Full width and 44px tall;
   the underline still says "link", the size says "you can hit this". */
.sa-other {
  display: block; width: 100%; margin: 14px auto 8px;
  min-height: 48px; padding: 12px;
  background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 4px;
}
@media (hover: hover) { .sa-other:hover { color: var(--accent); } }
.sa-other[aria-expanded="true"] { color: var(--accent); }
.sa-cancel {
  background: none; border: 0; cursor: pointer; font: inherit;
  font-size: 0.86rem; color: var(--ink-faint); padding: 8px;
}
@media (hover: hover) { .sa-cancel:hover { color: var(--ink-soft); } }
.sa-custom[hidden] { display: none; }
.sa-custom { display: flex; gap: 6px; align-items: center; justify-content: center; margin-bottom: 10px; }
.sa-custom input {
  width: 58px;
  padding: 9px 8px;
  font: inherit;
  text-align: center;
  color: var(--ink);
  background: var(--card-2, rgba(255,255,255,0.04));
  border: 1px solid var(--line);
  border-radius: 10px;
}
.sa-unit { color: var(--ink-faint); font-size: 0.8rem; }
.sa-go { padding: 10px 16px; white-space: nowrap; }
.sa-err { color: #ef4444; font-size: 0.8rem; margin: 0 0 8px; }
.sa-actions { flex-direction: column; gap: 8px; }
/* ⚠ .sa-backbtn / #saBackBtn was REMOVED 08-01-2026. "✦ I'm back" was the
   only way to mark yourself present WITHOUT evidence, nothing taught it, and
   after the Presence Drop Down started waiting for typing it no longer even
   closed the other person's pane — its whole remaining effect was turning a
   dot green early. Typing or sending is the route, and the dialog says so. */
/* Chip state while I'm the one away — hollow, like the dot */
#stepAwayBtn.away-active { color: var(--accent); border-color: var(--accent); background: transparent; }

/* Room-full dialog: "Chat Room {code}" sits on its own line under the
   title — larger, bold, ChimeChat lime, per founder spec (2026-07-20).
   Explicitly centered (the card centers too — this guards against any
   future card-level change). */
.room-full-title { text-align: center; }
.room-full-code {
  display: block;
  margin-top: 4px;
  font-size: 1.25em;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent); /* lime-as-text: #C6FF00 on dark, darker lime on white */
}

.leave-text {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.85rem;
  line-height: 1.6;
}

.leave-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.btn.burn {
  background: #dc2626;
  border-color: #dc2626;
  color: #ffffff;
  font-weight: 700;
}

.btn.burn:hover { background: #b91c1c; border-color: #b91c1c; }

/* --------------------------------------------------------- file viewer */
.viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
/* Follows the room's light/dark choice (not always-dark). */
body.light .viewer { background: rgba(248, 248, 246, 0.94); }

.viewer-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
}

.viewer-name {
  color: #f5f5f5;
  font-size: 0.92rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
body.light .viewer-name { color: #18181b; }

.viewer-actions { display: flex; gap: 9px; flex: 0 0 auto; }

/* Bigger, higher-contrast action buttons that read on either theme's
   backdrop — the "keep / close" chips were too small and too faint. */
.viewer .chip {
  background: rgba(255, 255, 255, 0.14); color: #f5f5f5; border-color: rgba(255, 255, 255, 0.3);
  font-size: 0.9rem; padding: 10px 16px;
}
.viewer .chip:hover { background: rgba(255, 255, 255, 0.24); }
.viewer .chip.subtle { background: rgba(255, 255, 255, 0.08); color: #eaeaea; border-color: rgba(255, 255, 255, 0.22); }
body.light .viewer .chip { background: rgba(0, 0, 0, 0.06); color: #18181b; border-color: rgba(0, 0, 0, 0.22); }
body.light .viewer .chip:hover { background: rgba(0, 0, 0, 0.12); }
body.light .viewer .chip.subtle { background: rgba(0, 0, 0, 0.04); color: #33333a; border-color: rgba(0, 0, 0, 0.16); }

.viewer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px calc(12px + env(safe-area-inset-bottom));
}

.viewer-body img,
.viewer-body video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  object-fit: contain;
}

.viewer-body iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 10px;
  background: #fff;
}

/* The document sheet layers ABOVE every modal/gate (60–80): it opens
   from inside them ("Full details", "Billing policy"), slides over, and
   closing reveals the surface you came from — context preserved. */
.doc-viewer { z-index: 90; }

/* Document viewer frame matches the legal pages' own ground so opening
   in dark mode doesn't flash white before the page paints. */
#docViewerFrame { background: #faf9f5; }
@media (prefers-color-scheme: dark) {
  #docViewerFrame { background: #0a0a0a; }
}

.viewer-body audio { width: min(420px, 90%); }

.viewer-body pre {
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
  overscroll-behavior-y: none;   /* see check-scroll.js */
  margin: 0;
  padding: 18px;
  border-radius: 10px;
  background: #161616;
  color: #e5e5e5;
  font-size: 0.8rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.viewer-fallback {
  color: #cfcfcf;
  font-size: 0.9rem;
  text-align: center;
  padding: 24px;
}
body.light .viewer-fallback { color: #52525b; }
body.light .viewer-body pre { background: #f4f3ee; color: #26262b; }

/* HTML viewer: a Page ⇄ Source toggle + a safety banner, above a stage that
   holds either the sandboxed page or its source. */
.viewer-body:has(.viewer-htmlbar) { flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 8px; padding-top: 8px; }
.viewer-htmlbar { flex: none; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.viewer-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.viewer-seg button { border: 0; background: transparent; color: var(--ink-soft); font: inherit; font-size: 0.78rem; font-weight: 600; padding: 6px 14px; cursor: pointer; }
.viewer-seg button.on { background: var(--lime); color: var(--on-lime); }
.viewer-safety { font-size: 0.7rem; color: var(--ink-faint); flex: 1; min-width: 160px; }
.viewer-safety .s { color: var(--accent); }
.viewer-htmlstage { flex: 1; min-height: 0; display: flex; }
.viewer-htmlframe { width: 100%; height: 100%; border: 0; border-radius: 10px; background: #fff; }
.viewer-htmlstage .viewer-src { flex: 1; }
.viewer-src { max-width: 100%; max-height: 100%; overflow: auto; margin: 0; padding: 16px; border-radius: 10px; background: #161616; color: #e5e5e5; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.76rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; overscroll-behavior-y: none; }
.viewer-mapframe { width: 100%; height: 100%; border: 0; border-radius: 10px; background: #e9e9e9; }

/* ----------------------------------------------------- voice recording */
.staged-bar.recording { border-color: #f87171; }

.rec-dot {
  color: #f87171;
  display: inline-flex; align-items: center;
  animation: rec-pulse 1.1s ease-in-out infinite;
}
.rec-dot .ci { width: 18px; height: 18px; }

.rec-dot.paused { animation: none; opacity: 0.4; }

@keyframes rec-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}

/* --------------------------------------------------------- attach menu */
.attach-menu {
  position: absolute;
  bottom: 100%;
  left: 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  z-index: 20;
  /* It opens UPWARD from the composer (bottom: 100%), so on a short screen —
     or any screen with the keyboard up — its top can run off the top of the
     viewport, taking the first entries with it. Cap it against the visible
     height and let it scroll. */
  max-height: calc(var(--vvh, 100dvh) * 0.6);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;   /* see check-scroll.js */
}

.attach-menu button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
}

.attach-menu button:hover { background: var(--accent-soft); color: var(--accent); }
.attach-menu .menu-sep { height: 1px; background: var(--line); margin: 4px 6px; }
.attach-menu .menu-about { color: var(--ink-soft); }
/* The More… fold (tester #13): the three folded entries sit indented so the
   hierarchy is visible; the group is display:contents-free on purpose — its
   children stay ordinary menu buttons, full-width and hoverable. */
/* ⚠ The group is a flex ITEM of the column menu, so it must be a column
   ITSELF — without this its buttons are inline-block and flow HORIZONTALLY
   (founder caught this on device, 07-31-2026). And because declaring display
   here beats the UA stylesheet's [hidden] rule, the hidden case must be
   restated explicitly or the fold never closes. */
.attach-menu .menu-more-group { display: flex; flex-direction: column; gap: 2px; }
.attach-menu .menu-more-group[hidden] { display: none; }
/* Indented, with a hairline rail so the three read as belonging to More… */
.attach-menu .menu-more-group button { padding-left: 30px; font-size: 0.8rem; position: relative; }
.attach-menu .menu-more-group button::before {
  content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px;
  width: 1px; background: var(--line);
}
/* The More… chevron is a DISCLOSURE indicator, not a feature icon (founder,
   07-31-2026 — the ··· glyph doubled the ellipsis in "More…"). It turns to
   point up while the fold is open. */
#attachMoreBtn svg.ci { transition: transform 160ms ease; }
#attachMoreBtn[aria-expanded="true"] svg.ci { transform: rotate(180deg); }

/* --------------------------------------------------- staged attachment */
.staged-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 14px;
  padding: 8px 12px;
  border: 1px dashed var(--accent);
  border-radius: 12px;
  background: var(--accent-soft);
  font-size: 0.8rem;
}

/* Full-width second row inside a staged bar (audio preview, map preview) */
.staged-wide { flex-basis: 100%; min-width: 0; }

/* ---------------------------- Show / Listen ⇄ Give — how it travels.
   The one decision an attachment asks for, made inline on the staged bar:
   a two-state segmented choice with a plain-words hint underneath. */
.staged-share { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.share-seg {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}
.share-seg button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  background: none;
  border: 0;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}
.share-seg button + button { border-left: 1px solid var(--line); }
.share-seg button .ci { width: 16px; height: 16px; }
.share-seg button .ci-hands { width: 26px; height: 17px; }
.share-seg button.on {
  background: rgba(198, 255, 0, 0.16);
  color: var(--accent);
}
.share-seg button:disabled { cursor: default; }
body.light .share-seg button.on { color: var(--accent-deep); }
.share-hint { flex-basis: 100%; font-size: 0.72rem; color: var(--ink-soft); line-height: 1.4; }
/* The chooser's canonical hints hold ONE line (tester #9, 07-31-2026); the
   give-only explanation may still wrap — it is a sentence, not a tag. */
.share-hint.one { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The bubble says how its attachment travels. Bubbles are light-tinted in
   both themes, so these use the bubble's own dark inks (like .att-sub). */
.att-share-line {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: calc(0.62rem * var(--msg-scale));
  font-weight: 600;
  color: #5b5b52;
}
.att-share-line .s { color: #647C0F; font-size: 0.85em; }
.att-share-line.give { color: #506212; }

/* ------------------------------------------------- custom audio player */
.audio-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 220px;
  padding: 6px 0;
}

.ap-btn {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.ap-btn.play { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.ap-btn:hover { border-color: var(--accent); }
.ap-btn:active { transform: scale(0.94); }
.ap-btn .ci { width: 20px; height: 20px; }

/* Voice note · waveform — stylized bars that light up on playback. Bars use
   currentColor so they read on any surround (dark composer or light bubble). */
.wave {
  flex: 1 1 auto; min-width: 60px; height: 30px; cursor: pointer;
  display: flex; align-items: center; gap: 2px;
}
.wave i {
  flex: 1 1 0; min-width: 2px; max-width: 4px; border-radius: 2px;
  background: currentColor; opacity: 0.24; transition: opacity 90ms;
}
.wave i.on { opacity: 0.95; }

.ap-time {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: currentColor; opacity: 0.65;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* In a message bubble the player inherits the dark bubble ink, so its
   transport is a dark circle and its bars are dark on the light bubble. It is
   also constrained so the waveform + time + Options button always stay INSIDE
   the fixed-width capsule (no overflow to the right at long durations). */
.att-voice { color: var(--bubble-ink); }
.att-voice .audio-player { min-width: 0; width: 100%; max-width: 100%; gap: 6px; overflow: hidden; }
.att-voice .ap-btn { flex: 0 0 auto; width: 30px; height: 30px; background: rgba(0,0,0,0.06); border-color: rgba(0,0,0,0.18); color: var(--bubble-ink); }
.att-voice .ap-btn .ci { width: 17px; height: 17px; }
.att-voice .ap-btn.play { background: var(--bubble-ink); border-color: var(--bubble-ink); color: var(--bubble-mine); }
.att-voice .ap-btn.play .ci path[fill] { fill: var(--bubble-mine); }
.att-voice .wave { flex: 1 1 0; min-width: 18px; }              /* shrinks first */
.att-voice .ap-time { flex: 0 0 auto; font-size: 0.66rem; }
.att-voice .att-dots { flex: 0 0 auto; }

/* ---- acknowledgement dialog (save-safety notice, etc.) ---- */
.ack-veil { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,0.5); opacity: 0; transition: opacity 180ms ease; }
.ack-veil.show { opacity: 1; }
.ack-card {
  position: fixed; left: 50%; top: 50%; z-index: 71;
  width: min(380px, calc(100% - 32px)); transform: translate(-50%, -46%) scale(0.98);
  opacity: 0; transition: opacity 200ms ease, transform 200ms cubic-bezier(0.22,1,0.36,1);
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 18px 16px;
  /* NEVER taller than the visible area. --vvh is visualViewport.height, kept
     current by app.js on every viewport change — the same honest measure the
     chat uses, and right on iOS where dvh alone is not. It falls back to
     100dvh before any JS runs. Buttons are pinned; the TEXT scrolls. */
  max-height: calc(var(--vvh, 100dvh) - 24px);
  display: flex; flex-direction: column;
}
/* min-height:0 is load-bearing — without it a flex child refuses to shrink
   below its content and the card overflows exactly as before. */
.ack-card .ack-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior-y: none; }
/* A hairline only when the body actually scrolls would need JS; showing it
   always is one faint line on a short dialog and an honest "there is more
   above" on a tall one. The clipped text meeting the button with no divider
   reads as a rendering fault. */
.ack-card .ack-btns { flex: none; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 2px; }
.ack-card.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* A dialog stacked on top of another ack-card (e.g. the safety note over
   Attachment Settings): a touch narrower so the underlying card frames it
   and the two read as nested, not as one card resized. */
.ack-card.ack-narrow { width: min(332px, calc(100% - 60px)); }
.ack-card h3 { margin: 0 0 8px; font-size: 1rem; color: var(--ink); }
.ack-card h3 .s { color: var(--accent); }
/* The attachment intro is long enough that its title has to work as a real
   header: centred, with a rule separating it from the body. Scoped to this
   dialog so the shorter ack cards keep their compact left-aligned title. */
.intro-dialog h3 {
  text-align: center;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.ack-card p { margin: 0 0 12px; font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5; }
.ack-card p strong { color: var(--ink); }
/* Inline icons in the "How attachments travel" card (Show/Listen/Give). */
.ack-card p .ci { width: 1.1em; height: 1.1em; vertical-align: -0.2em; margin-right: 1px; color: var(--ink); }
.ack-card p .ci-hands { width: 1.75em; height: 1.1em; color: var(--accent); }
.ack-optout { display: flex; align-items: flex-start; gap: 8px; font-size: 0.78rem; color: var(--ink-soft); cursor: pointer; margin-bottom: 14px; }
.ack-optout input { margin-top: 2px; accent-color: var(--lime); flex: none; }
.ack-btns { display: flex; gap: 8px; justify-content: flex-end; }

/* ---- The + dialog in an unlit room (decision 5, 08-16-2026) -------------
   The two pass buttons, the line that explains the first of them, and the
   membership link. Layout only — every word is founder-approved verbatim and
   lives in app.js showAttachUnlitDialog.
   ⚠ Full-width stacked, and NEITHER is .primary: they are two equal choices
   and at most one lime primary belongs on a screen (founder hierarchy rule).
   .btn.small sets width:auto, so the width is restored here.
   ⚠ No overflow of its own — this sits inside .ack-body, which already
   scrolls and already carries its own overscroll-behavior beside it. */
.unlit-acts { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.unlit-acts .btn.small { width: 100%; white-space: normal; }
/* Quiet, centred, and deliberately NOT .ack-fine: that class draws a divider
   above itself, which would cut this line away from the button it explains. */
.unlit-hint { margin: 9px 0 0; font-size: 0.75rem; color: var(--ink-faint); text-align: center; line-height: 1.5; }
.unlit-links { margin: 16px 0 0; padding-top: 14px; border-top: 1px solid var(--line); }
@media (prefers-reduced-motion: reduce) { .ack-veil, .ack-card { transition: none; } }
/* ⭐ THE NOTE BLOCK — the house pattern for "important, read this, but not a
   stop sign" (founder, 08-13-2026: "We should use the note block more often,
   like the way it presents important information"). Lime left bar + faint
   lime tint; the lead sentence bold in THEME INK, never lime text — lime
   #C6FF00 as text computes ~1.5:1 on the light card and was rejected for
   exactly that. Born in the leave dialog's unlit disclosure; also carried by
   the pass explainer and entry dialogs. */
.note-block { display: block; margin-top: 8px; padding: 8px 10px; border-left: 3px solid var(--lime); border-radius: 6px; background: rgba(198, 255, 0, 0.10); }
.note-block strong, .note-block b { color: var(--ink); }
/* Links inside a note block or a pass dialog: var(--accent) underlined (lime
   in dark, the darker olive in light — readable on both cards). ⚠ Plain gray
   sysnotes stay NEVER tappable; only these visually distinct surfaces may
   carry a link. A deliberate convention boundary, not an erosion. */
.note-block a, .pass-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; font-weight: 600; }
/* The Perks tab's "Learn about:" list (founder, 08-14-2026, revised the
   same night): a BOLD heading, then each linked line directly on the NEXT
   line — no blank line between — the whole section left justified and
   tidily spaced ("make this section look nice and well formatted"). */
.perks-links { text-align: left; margin-top: 10px; }
.perks-links .member-fine { text-align: left; margin: 0 0 0.4em; line-height: 1.55; }
.perks-links .perks-learn-head { margin-bottom: 0.5em; }
.perks-links .perks-learn-head strong { color: var(--ink); font-weight: 700; }
.perks-links .member-fine:last-child { margin-bottom: 0; }
/* ⭐ Notice dialogs (pass entry announcements, benefits, explainer) close
   with a corner ✕, not a button row — the founder chose the ✕ dialog over
   in-stream and pinned placements 08-13-2026. Sits inside the card's own
   padding; the body text keeps clear of it via .has-x h3 padding. */
.ack-card .ack-x { position: absolute; top: 8px; right: 10px; z-index: 1; background: none; border: 0; cursor: pointer; color: var(--ink-faint); padding: 6px; border-radius: 8px; line-height: 0; }
.ack-card .ack-x:hover, .ack-card .ack-x:focus-visible { color: var(--ink); }
.ack-card .ack-x .ci { width: 18px; height: 18px; }
.ack-card.has-x h3 { padding-right: 30px; }
/* The benefits dialog's "additional benefits" divider: room-scoped rows
   first, the rest under a quiet label (founder ordering, 08-13-2026). */
.ack-divider { border-top: 1px solid var(--line); margin: 12px 0 10px; padding-top: 8px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-faint); text-transform: uppercase; }
/* ⭐ Benefit rows inside the PREMIUM / PRO dialogs (polish sweep,
   08-14-2026): the membership page's own ✦-marked stacked shape, re-cut
   for the dialog — marker, then title on its own line, description under
   it. ADDED alongside the .ack-card p rules; nothing existing moved. The
   marker is var(--accent), not var(--lime): a small glyph on the light
   card needs contrast (the note-block comment above records lime-as-text
   at ~1.5:1), and --accent is exactly the token for that (THEME_MODES.md). */
.ben-row { display: flex; gap: 10px; margin: 0 0 12px; text-align: left; }
.ben-row:last-child { margin-bottom: 0; }
.ben-row .ben-s { color: var(--accent); flex: none; margin-top: 1px; font-size: 0.9rem; }
.ben-row .ben-t { min-width: 0; }
.ben-row .ben-t b { display: block; color: var(--ink); font-size: 0.87rem; margin: 0 0 2px; }
.ben-row .ben-t p { margin: 0; font-size: 0.84rem; color: var(--ink-soft); line-height: 1.5; }

/* ── Benefits dialog as a TABLE (founder decision B, 08-16-2026) ────────
   openBenefitsDialog now renders the membership page's three-column
   comparison inside the dialog: title + one cell per tier on the first
   grid row, the description under them spanning the width — the page's
   own narrow-phone shape. ADDED alongside .ben-row above, which stays.
   No scroller here: the table lives in .ack-body, whose one rule already
   pairs overflow-y with overscroll-behavior (see above). ✓ marks use
   --accent, not --lime — lime ✓s vanish on white (the rule-14 trap). */
.ben-tbl { --bencw: 44px; text-align: left; }
.ben-thr, .ben-trow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, var(--bencw));
  column-gap: 4px; align-items: center;
}
.ben-thr { margin-top: 2px; }
.ben-th {
  font-size: 0.52rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--ink-faint); text-align: center;
}
/* ⭐ The membership glyph above each column name in the benefits dialog
   (08-21-2026), matching pages/membership.html's .tier-head.
   ⚠ 18px inside a 44px column (--bencw). The page's own header uses 22px in a
   56px cell; this table's columns are narrower, so the glyph follows.
   ⚠ color: var(--accent) is SET here rather than inherited — .ben-th's word
   is --ink-faint, and the glyph's secondary artwork is --ink-faint too, so
   inheriting would flatten the two together. Accent matches this table's own
   ✓ marks (.ben-c). */
.ben-th-ico { display: block; color: var(--accent); line-height: 0; margin-bottom: 3px; }
/* ⭐ 18px -> 32px (founder, 08-23-2026). This table IS the compare page's
   three columns shown in-app, so it is the third place the glyphs are seen
   together — and at 18px the four tiers were indistinguishable, which made
   the one surface built for comparing them the worst at it. */
.ben-th-ico svg.ci { width: 32px; height: 32px; display: block; margin: 0 auto; }
.ben-trow { row-gap: 2px; padding: 7px 0; }
.ben-trow + .ben-trow { border-top: 1px solid var(--line); }
.ben-trow b { grid-row: 1; grid-column: 1; color: var(--ink); font-size: 0.84rem; line-height: 1.3; overflow-wrap: break-word; }
.ben-trow p { grid-row: 2; grid-column: 1 / -1; margin: 0; font-size: 0.76rem; color: var(--ink-soft); line-height: 1.45; }
.ben-c { grid-row: 1; text-align: center; font-size: 0.9rem; font-weight: 600; color: var(--accent); }
.ben-c.no { font-weight: 400; color: var(--ink-faint); }
.ben-c.val { font-size: 0.66rem; font-weight: 600; color: var(--ink-soft); line-height: 1.25; }
/* Fine print at the foot of a notice dialog (the explainer's
   promotional-terms sentence): quieter and set off by a hairline, so the
   dialog's message ends before the housekeeping begins. */
.ack-card p.ack-fine { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 0.74rem; color: var(--ink-faint); line-height: 1.5; }
/* The nav Join dialog's code field. ⚠ 1rem (16px) is load-bearing — iOS
   zooms the whole page on any focused input below 16px and never zooms
   back (three separate phone finds; see the dialog-arithmetic memory). */
.nav-join-input { width: 100%; font: inherit; font-size: 1rem; padding: 11px 12px; margin: 2px 0 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); text-transform: uppercase; letter-spacing: 0.08em; outline: none; }
.nav-join-input:focus { border-color: var(--accent); }
/* A dialog that OWNS a text field centers in the VISIBLE viewport, not the
   layout one — with a keyboard up, top:50% of the layout height puts the
   card's middle behind the keys (the leave-modal lesson). ADDED as a
   scoped class; the plain ack-card keeps its tested geometry. */
.ack-card.nav-input-card { top: calc(var(--vvh, 100dvh) * 0.5); }

/* Attachment Settings — per-room choices as named two-option segments, so
   the current state reads plainly (not an abstract on/off). */
.aset-card { text-align: left; }
.aset-row { display: flex; flex-direction: column; align-items: stretch; gap: 9px; padding: 14px 0; }
.aset-row + .aset-row { border-top: 1px solid var(--line); }
/* Alerts row (08-17-2026). The other setting rows carry a segmented control,
   which stretches; this one carries at most ONE button, and a full-width
   button in a row of segments reads as a fourth segment. ADDED as its own
   class rather than by touching .aset-row, which is doing its job for the
   three rows above it. */
.aset-act { display: flex; justify-content: flex-start; }
/* The "how to switch them back on" steps, revealed inside the row. Borrows
   .perm-steps for its numbering and spacing, then steps the type down to the
   row's own scale so it reads as part of the row and not as a dialog that
   opened inside one. */
.aset-steps { margin: 0; font-size: 0.78rem; line-height: 1.55; color: var(--ink-soft); }
.aset-steps li { margin-bottom: 4px; }
/* ---- "Sending an attachment" intro: the how-it-travels block --------------
   This is the one part of that dialog asking for a DECISION rather than
   stating a fact, so it is lifted out of the prose entirely: its own rule,
   two option CARDS (icon + name + one consequence each, never a paragraph),
   then the default control on its own line with real air before "Got it". */
.intro-share {
  margin: 16px 0 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.intro-head { margin-bottom: 12px; }
.intro-title {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--lime); margin-bottom: 5px;
}
/* Findings batch #3, 08-14-2026 — ADDED beside the rule above, dark
   untouched: pale lime text on the white card was near-invisible.
   --accent-deep is the token that exists for exactly this (text needing
   contrast on white); same pattern as body.light .resume-header. */
body.light .intro-title { color: var(--accent-deep); }
.intro-sub { font-size: 0.86rem; color: var(--ink-soft); line-height: 1.5; }

.intro-opts { display: flex; flex-direction: column; gap: 8px; }
.intro-opt {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line); border-radius: 11px;
  /* Derived from --ink so the tint inverts correctly with the theme; there
     is no surface token between --card and --bg in this sheet. */
  background: color-mix(in srgb, var(--ink) 4%, transparent);
}
/* The cards ARE the control (07-30-2026) — they replaced a separate segmented
   Show / Give pair that sat below them saying the same thing. `.intro-opt` is
   now a <button>, so it needs the usual resets; the selected wash borrows the
   segmented control's lime so the two read as one idea wherever both appear. */
button.intro-opt {
  width: 100%;
  font: inherit;
  text-align: left;
  color: inherit;
  cursor: pointer;
}
button.intro-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.intro-opt.on {
  border-color: var(--accent);
  background: rgba(198, 255, 0, 0.16);
}
body.light .intro-opt.on { border-color: var(--accent-deep); }

.intro-opt-ico {
  display: flex; gap: 3px; flex: none; color: var(--lime); padding-top: 1px;
}
/* Findings batch #3, 08-14-2026 — same additive light-mode contrast fix as
   .intro-title above; the option glyphs washed out on the white card. */
body.light .intro-opt-ico { color: var(--accent-deep); }
.intro-opt-ico .ci { width: 19px; height: 19px; }
.intro-opt-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.intro-opt-name { font-size: 0.92rem; font-weight: 700; color: var(--ink); }
.intro-opt-desc { font-size: 0.83rem; color: var(--ink-soft); line-height: 1.45; }

.intro-default { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.intro-default-lab {
  font-size: 0.88rem; font-weight: 700; color: var(--ink); margin-bottom: 9px;
}
.intro-lab-sub { display: block; margin-top: 3px; font-size: 0.8rem;
  font-weight: 400; color: var(--ink-soft); line-height: 1.45; }
.intro-foot {
  font-size: 0.79rem; color: var(--ink-faint); line-height: 1.5; margin-top: 10px;
}
.intro-foot strong { color: var(--ink-soft); }
/* Air between the decision block and the dismiss button — they were touching. */
.intro-share + .ack-btns { margin-top: 20px; }
.aset-txt { min-width: 0; }
.aset-label { font-size: 0.9rem; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: 8px; }
/* The chosen mark beside each setting's header (founder, 08-07-2026).
   --accent, not --lime: these are glyphs that need contrast on both
   grounds, the exact case rule 14 reserves the accent for. */
.aset-ico { width: 18px; height: 18px; flex: none; color: var(--accent); }
.aset-sub { margin-top: 4px; font-size: 0.74rem; color: var(--ink-soft); line-height: 1.45; }
.aset-sub strong { color: var(--ink); }
.aset-seg { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--card-2, var(--card)); }
.aset-seg button {
  flex: 1 1 0; min-width: 0; padding: 10px 12px; background: none; border: 0;
  color: var(--ink-soft); font: inherit; font-size: 0.84rem; font-weight: 650; cursor: pointer;
}
.aset-seg button + button { border-left: 1px solid var(--line); }
.aset-seg button.on { background: rgba(198, 255, 0, 0.16); color: var(--accent); }
body.light .aset-seg button.on { color: var(--accent-deep); }
/* Live text-size sample (account surface only, founder 08-07-2026).
   ⚠ The bubbles take the MESSAGE rule verbatim — `calc(0.95rem *
   var(--msg-scale))`, 0.66em/0.9em padding, the 0.4em directional corner —
   so what is shown is the real thing at the real size, and tapping S/M/L/XL
   moves it immediately because applySize() writes --msg-scale on the
   document element. Do not give these a fixed font-size "to make the
   preview fit": that would make it a picture of the setting instead of the
   setting. It sits on --chat-bg, the conversation's own ground, for the
   same reason. */
.aset-preview {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  background: var(--chat-bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  margin-top: 2px;
  overflow: hidden;
}
.aset-pv-bubble {
  max-width: 88%;
  padding: 0.66em 0.9em;
  border-radius: var(--radius);
  line-height: 1.45;
  font-size: calc(0.95rem * var(--msg-scale));
  color: var(--bubble-ink);
  overflow-wrap: anywhere;
}
.aset-pv-bubble.theirs { background: var(--bubble-theirs); border-bottom-left-radius: 0.4em; }
.aset-pv-bubble.mine { background: var(--bubble-mine); border-bottom-right-radius: 0.4em; align-self: flex-end; }

.aset-link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
body.light .aset-link { color: var(--accent-deep); }
.aset-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ------------------------------------------------ invite dialog code */
.invite-code-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 12px 0 6px;
}

.invite-code-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.invite-code {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  margin-right: -0.35em; /* balance the trailing letter-space */
  color: var(--lime);
  font-variant-numeric: tabular-nums;
}
/* Findings batch #3, 08-14-2026 — ADDED beside the rule above, dark
   untouched: the room code is the one thing the invite card exists to show,
   and pale lime on white left it the faintest thing on the page. */
body.light .invite-code { color: var(--accent-deep); }

/* -------------------------------------------------- permission dialog */
.perm-steps {
  margin: 0 0 6px;
  padding-left: 20px;
  text-align: left;
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.6;
}

.perm-steps li { margin-bottom: 6px; }
.perm-steps li strong { color: var(--accent); }

.staged-name {
  font-weight: 600;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.staged-size { color: var(--ink-faint); font-size: 0.72rem; }

.staged-hint {
  margin-left: auto;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

.staged-remove {
  border: none;
  background: transparent;
  color: var(--ink-faint);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 6px;
}

.staged-remove:hover { color: var(--alert); }

/* ------------------------------------------------------------ typing */
/* In-thread typing bubble — the admin option `typing-placement: in-thread`.
   The stars arrive in the conversation like a message instead of living in
   the reserved band. Not a screen node: it's presence, not content, so the
   deletion rule never touches it (screenNodes() and the has-msgs count both
   exclude .typing-bubble).
   Zero padding: the class now sits on the .msg ROW, and the pill inside
   carries its own. The old 12/16 was for when this class was the bubble. */
.typing-bubble {
  padding: 0;
  min-width: 0;
}
/* In-thread placement means the band must not sit there empty. */
html.typing-inthread .typing-area { display: none; }

.typing-bubble .dots { display: inline-flex; align-items: center; gap: 4px; }

.dots i {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45); /* on the white typing bubble */
  animation: dot-bounce 1.2s ease-in-out infinite;
}

.dots i:nth-child(2) { animation-delay: 0.15s; }
.dots i:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.35; }
  30% { transform: translateY(-4px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dots i { animation: dot-fade 1.2s ease-in-out infinite; }
  @keyframes dot-fade { 0%, 60%, 100% { opacity: 0.35; } 30% { opacity: 1; } }
}

/* The vanishing — reply-triggered removal, made visible. Content blurs,
   lifts, and dissolves into the ether (a ✦ spark rises off each bubble),
   then the node is removed from the DOM. Nothing is retained after. */
.fading {
  animation: dissolve var(--fade-ms) cubic-bezier(0.4, 0, 0.9, 0.4) forwards;
  pointer-events: none;
  position: relative;
}

@keyframes dissolve {
  0% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
  35% { opacity: 0.85; filter: blur(1px); }
  100% { opacity: 0; transform: translateY(-18px) scale(0.9); filter: blur(7px); }
}

.fading::after {
  content: "✦";
  position: absolute;
  top: -6px;
  right: 12px;
  color: var(--accent);
  font-size: 0.85rem;
  opacity: 0;
  animation: spark-rise var(--fade-ms) ease-out forwards;
}

@keyframes spark-rise {
  0% { opacity: 0; transform: translateY(2px); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-26px) scale(0.6); }
}

/* Signature vanish for the Clear action: instead of the quiet dissolve, the
   whole screen's content scatters — bubbles swell, spin off, and throw two
   ✦ sparks in opposite directions before disappearing. */
.fading.scatter {
  animation: scatter var(--fade-ms) cubic-bezier(0.3, 0, 0.2, 1) forwards;
}

@keyframes scatter {
  0% { opacity: 1; transform: translate(0, 0) scale(1) rotate(0); filter: blur(0); }
  30% { opacity: 0.9; transform: scale(1.06) rotate(-1.5deg); filter: blur(1px); }
  100% { opacity: 0; transform: translate(10px, -26px) scale(1.14) rotate(4deg); filter: blur(9px); }
}

.fading.scatter::after {
  content: "✦";
  position: absolute;
  top: -4px;
  right: 14px;
  color: var(--accent);
  font-size: 0.9rem;
  opacity: 0;
  animation: spark-fly-right var(--fade-ms) ease-out forwards;
}
.fading.scatter::before {
  content: "✦";
  position: absolute;
  top: -4px;
  left: 14px;
  color: var(--accent);
  font-size: 0.75rem;
  opacity: 0;
  animation: spark-fly-left var(--fade-ms) ease-out forwards;
}

@keyframes spark-fly-right {
  0% { opacity: 0; transform: translate(0, 2px); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(22px, -30px) scale(0.5) rotate(40deg); }
}
@keyframes spark-fly-left {
  0% { opacity: 0; transform: translate(0, 2px); }
  30% { opacity: 1; }
  100% { opacity: 0; transform: translate(-22px, -34px) scale(0.5) rotate(-40deg); }
}

/* A one-time caption the first time a send clears the screen — teaches the
   whole idea instead of letting the vanish startle a newcomer. */
.sysnote.onboard {
  color: var(--accent);
  font-weight: 600;
  font-size: calc(0.9rem * var(--msg-scale));
  padding: 8px 14px;
  animation: pop-in 320ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .fading { animation: simple-fade 220ms ease forwards; }
  .fading::after, .fading::before { content: none; }
  .fading.scatter { animation: simple-fade 220ms ease forwards; }
  @keyframes simple-fade { to { opacity: 0; } }
}

/* ---------------------------------------------------------- composer */
.composer {
  position: relative; /* anchors the attach menu */
  display: flex;
  align-items: flex-end; /* buttons hug the bottom as the field grows */
  gap: 8px;
  /* ⚠ The composer is now the LAST element in #chat (the footer that used to
     sit below it was removed 07-30-2026), so it carries the home-indicator
     clearance for the whole column. Measured on an iPhone 12 Pro Max: the
     inset is 0 in a Safari tab (Safari's own tab bar already covers the swipe
     bar) and 34 when installed to the home screen, which is the case this
     protects. It must be the FULL inset here and in the phone block below —
     the phone block used to take half because the footer supplied the rest. */
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom, 0px)); /* was 12px */
  border-top: 1px solid var(--line);
  background: var(--card);
}

.composer textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  /* max(16px, …) prevents iOS Safari's zoom-on-focus at small text sizes */
  font-size: max(16px, calc(1rem * var(--msg-scale)));
  line-height: 1.4;
  padding: 13px 16px;
  min-height: 50px;
  max-height: 140px;
  outline: none;
  transition: border-color 120ms;
  overflow-y: auto;
  /* scroll-guard-ok: no overscroll property, deliberately. One was added
     08-02-2026 alongside #landing and reverted with it the same night —
     neither surface was part of the report, both had worked for weeks, and
     the pair produced a white strip above the keyboard on the start page.
     ⚠ See the ⛔ block at the top of this file before "fixing" this. */
}

.composer textarea::placeholder { color: var(--ink-faint); }

.composer textarea:focus { border-color: var(--accent); }

.send-btn {
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 50px;
  height: 50px;
  padding: 0;
  cursor: pointer;
  transition: transform 0.12s cubic-bezier(0.2, 0.8, 0.2, 1), background 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.send-btn:hover { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 3px 16px rgba(198, 255, 0, 0.32); }
.send-btn:active { transform: scale(0.92); }
.send-btn.sent-pulse { animation: sent-pulse 360ms ease-out; }
/* Empty-send ARMED state (tester #4): the button is unmistakably no longer
   a send — CLEAR SCREEN's red family, both themes. */

@keyframes sent-pulse {
  0% { box-shadow: 0 0 0 0 rgba(198, 255, 0, 0.5); }
  100% { box-shadow: 0 0 0 16px rgba(198, 255, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .send-btn { transition: background 0.15s; }
  .send-btn:active { transform: none; }
  .send-btn.sent-pulse { animation: none; }
}

.plus-btn {
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 50px;
  height: 50px;
  padding: 0;
  font-size: 1.4rem;
  font-weight: 400;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.plus-btn:hover { color: var(--accent); border-color: var(--accent); }

/* .chat-footer was REMOVED 07-30-2026 — the markup is gone from index.html and
   the rule with it. It carried the home-indicator clearance for the whole
   column, which now lives on .composer (below and in the phone block). Do not
   reinstate the footer without moving that padding back. */

/* --------------------------------------------- per-device optimization */

/* Touch devices (phones/tablets): comfortable ≥44px tap targets */
@media (pointer: coarse) {
  .chip { padding: 10px 14px; font-size: 0.8rem; }
  .save-btn { padding: 11px 16px; font-size: 0.8rem; }
  .staged-remove { padding: 8px 12px; font-size: 1.05rem; }
  .join-row .btn, .btn.small { min-height: 46px; }
}

/* Phones */
@media (max-width: 660px) {
  #chat { border-inline: none; }
  /* Sparser on a phone, not just smaller: the visible void is short and the
     keyboard eats half of it, so the same density reads as confetti. */
  /* ⚠ On .convo, NOT .messages — the field paints on .convo now, and custom
     properties inherit downward only, so setting these on the child would
     silently leave phones on the desktop tile size. */
  .convo { --chime-base-w: 1180px; --chime-base-h: 980px; }
  .msg { max-width: 86%; }
  .messages { padding: 14px 12px 8px; }
  .chat-header { padding: 6px 12px; gap: 6px; } /* was 10px — see .peer-topbar */
  .header-actions { gap: 10px; }
  .chip-extra { display: none; } /* " someone" label collapses to ✦ invite */
  /* FULL inset, not half — the footer that used to supply the other half is gone. */
  .composer { padding: 7px 10px calc(7px + env(safe-area-inset-bottom, 0px)); gap: 6px; }
  .send-btn, .plus-btn { width: 46px; height: 46px; }
  .composer textarea { padding: 13px 12px; }
  .invite-bar { margin: 10px 12px 0; }
  .landing-card { padding: 28px 22px 22px; }
}

/* Phone-width screens: every header chip must fit on one line — shrink
   instead of wrapping or spilling off the edge. */
@media (max-width: 480px) {
  .chat-header { gap: 6px; }
  .header-actions { gap: 8px; }
  .peer-status { font-size: 0.66rem; }
  /* text chips (CLEAR / INVITE / LEAVE) stay compact; icon chips keep
     their thumb-sized circles from the earlier rule */
  .chip { padding: 6px 8px; font-size: 0.66rem; }
}

/* Large desktop monitors: let the conversation breathe */
@media (min-width: 1200px) {
  #chat { max-width: 880px; }
  .msg { max-width: 70%; }
}

/* ================================================================== */
/* The ether — approved motion set (dissolve 0.75x, crystallize 0.75x,
   veil 1.0x, wordmark 1.0x, three-star typing 0.75x) + icon family.   */

/* icon family sizing: inline SVGs inherit the button's text color */
.ci { width: 1.15em; height: 1.15em; vertical-align: -0.24em; flex: none; }
.plus-btn .ci { width: 1.5em; height: 1.5em; vertical-align: middle; }
.send-btn .ci { width: 2.9em; height: 2.9em; vertical-align: middle; } /* 2x per request */
.attach-menu .ci { margin-right: 6px; }

/* Chime-ripple arrival (0.75x): a received bubble lands and a single ring
   rings outward from it — the app's namesake at the moment of arrival.
   Replaces the old crystallize/glass-sweep. Own sent messages get NO effect. */
.msg.chime-in { animation: chime-land var(--cd, 320ms) cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes chime-land {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.chime-ring {
  position: fixed; /* viewport space — matches the dissolve-spark canvas */
  border: 2px solid var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 61; /* just above the fx canvas (z-index 60) */
  animation: chime-ring var(--rd, 1013ms) ease-out forwards;
}
@keyframes chime-ring {
  from { transform: scale(1); opacity: 0.55; }
  to   { transform: scale(9); opacity: 0; }
}

#chat { position: relative; }
@keyframes settle {
  from { opacity: 0; transform: translateY(16px) scale(0.97); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}

/* Typing indicator — three lime stars, PINNED just above the input area
   (not in the scrolling message list). Stars ~1.5x their former size. */
/* ⚠ RESERVED BAND — the height is ALWAYS here, occupied or not (07-30-2026).
   It used to be `flex: none` with padding and a `hidden` attribute, so showing
   the pill added ~47px of layout height, shrank the (flex:1) message list, and
   — because the conversation is bottom-anchored — shoved the whole thing up and
   back down every time the peer paused. The sender re-emits `typing` on every
   keystroke with a 2.5s off-timer, so on a phone that cycled constantly.
   Reserving the space is what makes it stop: nothing resizes, so nothing moves.
   min-height is the pill's own height (stars 1.4em = 22.4 + 7px padding each
   side ≈ 37px). ⚠ Keep the two in step: if the pill grows, this must grow with
   it or the pill is clipped; if this grows alone, the band is dead space. The
   wrapper padding that used to add another 11px is gone — padding is not the
   indicator. The pill fades in and out INSIDE the band via .is-typing — do not
   go back to toggling `hidden`, which the global [hidden] rule collapses. */
.typing-area {
  flex: none;
  /* Derived, not a magic 37px: 1.4em is the star size and 15px covers the
     pill's 7px padding top and bottom plus a pixel of slack. Written this way
     so the band tracks the pill if the ROOT font size differs — a browser or
     OS default larger than 16px would otherwise grow the pill past a hard
     37px and the band would jump the first time the peer typed.
     (The app's own S/M/L/XL control is safe either way: --msg-scale is applied
     to bubbles and notes, never to this pill.) */
  min-height: calc(1.4em + 15px);
  padding: 0 14px;
  display: flex;
  align-items: center;
  background: transparent; /* .convo paints the ground — see .convo */
}
.typing-area > * { opacity: 0; transition: opacity 160ms ease; }
.typing-area.is-typing > * { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .typing-area > * { transition: none; }
}
/* Halved on 07-30-2026, then RESTORED to full size the same evening once the
   collapsing chips bar (html.kb-up) freed enough room to afford it. The half
   size was legible but the space it bought was better won elsewhere. Keep
   .typing-area's min-height in step with the pill's height — 37px here. */
.typing-pill {
  display: inline-flex; align-items: center;
  background: var(--bubble-theirs); color: var(--bubble-ink);
  border-radius: 18px; border-bottom-left-radius: 6px;
  padding: 7px 15px;
}
.tstars { display: inline-flex; align-items: center; gap: 9px; }
.tstars span {
  color: var(--lime-deep);
  font-size: 1.4em;   /* ~1.5x the previous 0.95em */
  line-height: 1;
  animation: starpulse 2000ms ease-in-out infinite; /* 0.75x pace */
  text-shadow: 0 0 8px rgba(198, 255, 0, 0.55);
}
.tstars span:nth-child(2) { animation-delay: 400ms; }
.tstars span:nth-child(3) { animation-delay: 800ms; }
@keyframes starpulse {
  0%, 100% { opacity: 0.25; transform: scale(0.7) rotate(0deg); }
  50%      { opacity: 1; transform: scale(1.15) rotate(45deg); }
}

/* ⚠ `.crossed-note` / `#crossedNote` was DELETED 08-01-2026. It was an
   in-flow `flex: none` strip between the pane and the typing band, and it
   said — word for word — what the held bubble's own `.meta` tag already
   says. It cost ~25–40px of the message pane permanently, and dropping the
   whole bottom-anchored conversation every time it retired is the bug that
   ended it. Do not reintroduce ANY in-flow element in this zone; the pill
   below is the replacement and commits no layout at all.
   Full reasoning: docs/MESSAGE_LAYOUT_AND_KEYBOARD.md. */

/* The float note: ZERO committed height — the pill overlays the boundary
   between the message pane and the typing band, so raising or dropping it can
   never move a bubble (the "drop" the founder saw twice: once when notes
   lived in the stream, once when the marker strip retired). */
.float-note { position: relative; height: 0; overflow: visible; flex: none; pointer-events: none; z-index: 5; }
.float-note[hidden] { display: none; }
.float-note .fn-pill {
  /* Sits in the typing band — already-reserved, usually-empty space, the one
     strip the layout pays for whether or not anything is in it.
     ⚠ ANCHORED BY ITS BOTTOM, from a wrapper placed AFTER #typingArea. A
     one-line pill lands inside the band; a wrapped one grows UPWARD over the
     conversation instead of downward over the composer. Measured 08-01-2026
     at 387px: top-anchored, a three-line pill overhung the composer by 31px
     and covered the send button.
     This is not the 07-31 `bottom` bug — that wrapper sat at the PANE's edge,
     where `bottom` pushed the pill up over the bubbles immediately. Here the
     resting position is unchanged and only over-long copy reaches up. */
  /* ⚠ CENTRED WITH auto MARGINS, NOT `left: 50%` — and that is a bug fix,
     not a style preference (measured 08-01-2026). An absolutely-positioned
     box shrink-to-fits into the space between its offsets and the containing
     block's edge, so `left: 50%` capped this pill at HALF the pane — 195px of
     390px — and `max-width: 92%` (359px) never once applied. Copy that fits
     easily on one line was wrapping to two or three purely because of it.
     Inherited from the vanish toast, where the copy was short enough to hide
     it. `left: 0; right: 0` gives the full width, and auto margins do the
     centring the transform used to fake.
     Effect, same strings: every ordinary note 2 lines → 1 (33px, inside the
     band, veiling nothing); the stalled singular 50px → 33px; the stalled
     plural 67px → 50px. */
  position: absolute; bottom: 2px; left: 0; right: 0;
  width: fit-content; margin-left: auto; margin-right: auto;
  max-width: min(92%, 480px); text-align: center;
  background: var(--card); color: var(--accent);
  border: 1px solid var(--lime-soft2, var(--line)); border-radius: 14px;
  padding: 7px 14px; font-size: 0.78rem; line-height: 1.35;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  opacity: 0; transition: opacity 500ms ease;
}
.float-note.showing .fn-pill { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .float-note .fn-pill { transition: none; } }
/* The pill leaves with a fade, never a cut (founder, 07-31-2026) — a pop-out
   yanks the eye to the empty reserved band below it. */

/* The wrapper is pointer-events: none so the pane keeps its own taps. The
   pill takes them back only when there is somewhere to go — an off-screen
   held message it can scroll to. The click handler sits on the wrapper and
   catches the bubbled event. */
.float-note.actionable .fn-pill { pointer-events: auto; cursor: pointer; }
.float-note.actionable .fn-pill:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Step 2 of the stall ladder: the note becomes tappable once a held message
   looks stuck (2 blocked sends, or 5 minutes since arrival). Deliberately a
   cursor and an underline rather than a button — the pinned zone sits directly
   above the composer on a phone with the keyboard up, so it must not grow
   taller, and nothing here is urgent enough to shout. NO COUNTDOWN is ever
   rendered: this offers help, it does not announce an expiry. */
/* The leave dialog's unopened-attachment warning. Sits above the choices, so
   it is read before the decision rather than after it. Warm amber rather than
   the accent: the accent means "your message / send" everywhere else, and this
   is a caution, not an action. */
/* ⚠ This app switches theme with a CLASS (body.light), NOT
   prefers-color-scheme — a whole light treatment was once written under the
   media query and was dead on arrival. Follow the class. */
.leave-unopened {
  margin: 0 0 14px; padding: 10px 14px;
  border: 1px solid rgba(242, 177, 60, 0.45);
  border-radius: 10px;
  background: rgba(242, 177, 60, 0.10);
  color: #f2b13c; font-size: 0.86rem; line-height: 1.5; text-align: left;
}
body.light .leave-unopened {
  border-color: rgba(183, 121, 31, 0.45);
  background: rgba(183, 121, 31, 0.09);
  color: #8a5a10; /* darkened for contrast on the light card */
}
.leave-unopened[hidden] { display: none; }

/* Where the tap lands. Long enough to find with your eye after a smooth
   scroll, quiet enough not to read as an alert. */
@keyframes held-flash {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
  100% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.msg.held-flash { animation: held-flash 1200ms ease-out; }
@media (prefers-reduced-motion: reduce) {
  .msg.held-flash { animation: none; outline: 2px solid var(--accent); outline-offset: 2px; }
}

/* The trademark mark. Superscript and quiet — it asserts the claim without
   competing with the wordmark it sits on. Sized in `em` so it tracks the logo
   at every breakpoint, and it rides the same entrance as the letters (its
   delay is set alongside theirs in app.js) so it settles in just after the
   final "t" and before the ✦. */
.wm-tm {
  display: inline-block;
  font-size: 0.42em;
  font-weight: 600;
  vertical-align: super;
  margin-left: 0.06em;
  letter-spacing: 0;
  opacity: 0.75;
}

/* wordmark entrance: letters settle in, the star crystallizes last */
.logo .wm-l, .logo.wm-play .logo-mark { display: inline-block; }
.logo.wm-play .wm-l, .logo.wm-play .wm-tm { opacity: 0; animation: wm-in 770ms ease both; }
.logo.wm-play .wm-tm { animation-fill-mode: both; }
.logo.wm-play .logo-mark {
  opacity: 0;
  animation: wm-star 1100ms cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: 1210ms;
}
@keyframes wm-in {
  from { opacity: 0; transform: translateY(8px); filter: blur(4px); }
  to   { opacity: 1; transform: none; filter: none; }
}
@keyframes wm-star {
  0%   { opacity: 0; transform: scale(0.2) rotate(-90deg); filter: blur(4px) brightness(3); }
  60%  { opacity: 1; transform: scale(1.35) rotate(10deg); filter: blur(0) brightness(1.8); }
  100% { opacity: 1; transform: scale(1) rotate(0); filter: none; }
}

/* ==============================================================
   THE CHIMECHAT ANIMATION LOGO — the start page, the front gate and
   the admin sign-in all use this one block.

   ⭐ FOUNDER'S SETTINGS, 08-23-2026, chosen on the design board and
   pasted back verbatim:
       logo speed 0.50x · wordmark 1.00x · delay +2000ms
       logo size 1.90em · gap 0.40em · original 1.00x
   The 0.50x is BAKED IN as doubled durations and delays rather than a
   playbackRate, so nothing depends on script to run at the right pace.
   The wordmark starts at 3860ms, which is 1860 + his 2000, and at that
   moment the logo has been finished for 140ms.

   ⛔ THIS DOES NOT REPLACE THE ORIGINAL. `.logo.wm-play` with wm-in and
   wm-star is untouched and still defined; the founder asked to KEEP it
   for another place. Both class sets exist side by side.

   ⚠ THE MARK IS SIZED ON THE SVG ITSELF, in em. An earlier cut put the
   em on the parent with the svg at 100% and it collapsed to 0x0 wherever
   a stylesheet carried svg{height:auto}. Give the svg real dimensions.

   ⚠ THE GAP CONTROL IS THE OPTICAL GAP. The mark's ink ends at x 43.1 of
   a 48 viewBox, so 10.21% of its box is empty on the right; the margin
   subtracts that back out so the space the eye sees stays constant at
   any --markem. Without it, enlarging the logo silently widened the gap.
   ============================================================== */
.logo.v2 { --markem: 1.9; --gapem: 0.4; display: inline-flex; align-items: center; }
.cc-mark { display: inline-block; flex: none; vertical-align: middle;
  margin-right: calc((var(--gapem) - var(--markem) * 0.1021) * 1em); }
.cc-logo { width: calc(var(--markem) * 1em); height: calc(var(--markem) * 1em);
  display: block; overflow: visible; }

/* ⭐ THE TWO BUBBLE COLOURS SWAP WITH THE THEME (founder feedback via the
   board, 08-23-2026: "for the white mode, the left bubble should be black at
   the start and then switch to white").
   He is right, and the first cut had it backwards. The story is that the
   bubble EMPTIES, and emptying means becoming the colour of the page:
       dark  ground: starts WHITE (contrast) -> ends #0a0a0a (the page)
       light ground: starts BLACK (contrast) -> ends #ffffff (the page)
   Held the old way round, light mode read as the bubble FILLING, which is the
   opposite of what the animation is saying.
   ⚠ The class names are historical: -black is the EMPTIED role and -white is
   the FULL role. Read the variables, not the class names. */
.logo.v2 { --bub-full: #ffffff; --bub-empty: #0a0a0a; --bub-line: #C6FF00; }
body.light .logo.v2 { --bub-full: #0a0a0a; --bub-empty: #ffffff; --bub-line: #647C0F; }
.cc-rear-black { fill: var(--bub-empty); }
/* ⚠ REVERTED 08-25-2026, hours after it was tried. This layer was briefly
   "fill: none", reasoning that six of seven logo instances sit on --card or a
   tinted ground and a --bg fill would paint a visible blob. That was over-reach.
   The blob it was really chasing was the admin sign-in card, where the page had
   never set a light palette AT ALL, and that is fixed properly in 259abff.
   With "none" the bubble stopped ending at the page colour and ended at whatever
   surface it happened to sit on. Measured on the gate card: #fafafa in light and
   #161616 in dark, where the story says #ffffff and #0a0a0a.
   ⛔ Do not set this to "none" again. The bubble EMPTIES TO THE PAGE COLOUR;
   that is the whole animation. */
.cc-rear-white { fill: var(--bub-full); opacity: 0; }
.cc-rear-edge  { fill: none; stroke: var(--bub-line, #C6FF00); stroke-width: 1.4566651;
                 stroke-linejoin: round; opacity: 0; }
.cc-rear-line  { fill: none; stroke: var(--bub-line, #C6FF00); stroke-width: 1.4566651;
                 stroke-dasharray: 1.74799797 1.16533198; stroke-linejoin: round; }
.cc-front      { fill: var(--lime, #C6FF00); }
.cc-spark      { fill: #0a0a0a; stroke: var(--lime, #C6FF00); stroke-width: .33211962;
                 stroke-linejoin: round; }

/* ⭐ The RESTING state above is the FINISHED logo. Nothing here needs a
   script to become visible — .play only animates something already drawn. */
.logo.v2.play .cc-rear-white, .logo.v2.play .cc-rear-edge { opacity: 1; }
/* ⭐ THE TWO FILL LAYERS ARRIVE AT FULL COLOUR (founder, 08-25-2026, option C:
   "the left bubble should end with a white fill and it still shows a grey fill
   towards the start for a brief time"). They used to share cc-bub, which ramps
   OPACITY from 0 — and a black fill ramping up over a white page passes through
   grey. Measured on the live gate: #dbdbdb at 150ms, #9c9c9c at 300ms, #656563
   at 450ms. So the bubble resolved THROUGH grey before it was ever black, and
   the "starts full, then empties" beat had to happen twice.
   cc-bub-solid keeps the blur and the scale, which are what make it an arrival,
   and drops ONLY the opacity ramp.
   ⚠ This fault is OLDER than the fill revert above and was not caused by it:
   with the old fill restored, the 200ms frame is still a grey blob. Verified by
   filming both through CDP with the animations paused, not by reading rules.
   ⛔ .cc-rear-edge deliberately KEEPS cc-bub. It is a lime stroke, so its fade
   never muddies, and it arriving a beat late is what draws the eye to the fill. */
.logo.v2.play .cc-rear-black { animation: cc-bub-solid 1240ms ease both; }
.logo.v2.play .cc-rear-white { animation: cc-bub-solid 1240ms ease both, cc-fade-out 760ms ease both 2960ms; }
.logo.v2.play .cc-rear-edge  { animation: cc-bub 1240ms ease both, cc-fade-out 760ms ease both 2960ms; }
.logo.v2.play .cc-rear-line  { animation: cc-fade-in 760ms ease both 2960ms; }
.logo.v2.play .cc-front      { animation: cc-bub 1240ms ease both 240ms; }
.logo.v2.play .cc-spark {
  transform-origin: 28.9px 23.6px;
  animation: cc-rise 1800ms cubic-bezier(.22,1,.36,1) both 1280ms;
}
.logo.v2.play .wm-l, .logo.v2.play .wm-tm { opacity: 0; animation: wm-in 770ms ease both; }

@keyframes cc-bub {
  from { opacity: 0; transform: translateY(2.5px) scale(.94); filter: blur(2px); }
  to   { opacity: 1; transform: none; filter: none; }
}
/* ⚠ cc-bub-solid IS cc-bub WITHOUT THE OPACITY RAMP. Added alongside, never
   merged: cc-bub is still what .cc-front and .cc-rear-edge use, and widening one
   of them into the other is how a working rule gets moved. Keep them in step. */
@keyframes cc-bub-solid {
  from { transform: translateY(2.5px) scale(.94); filter: blur(2px); }
  to   { transform: none; filter: none; }
}
/* the spark flies in from the LOWER RIGHT of the right bubble and travels
   up and to the left, rotating INTO the movement */
@keyframes cc-rise {
  0%   { opacity: 0; transform: translate(12.5px, 11px) scale(.3) rotate(70deg); filter: blur(2.5px) brightness(2.6); }
  55%  { opacity: 1; transform: translate(0,0) scale(1.3) rotate(-8deg);         filter: blur(0) brightness(1.7); }
  100% { opacity: 1; transform: none;                                           filter: none; }
}
@keyframes cc-fade-out { to { opacity: 0; } }
@keyframes cc-fade-in  { from { opacity: 0; } to { opacity: 1; } }


/* ⛔ A SHORTER CUT WAS TRIED AND REJECTED (founder, 08-23-2026). Asked
   whether the gate and admin sign-in should run a quicker version, since his
   settings put the finished name at ~5.5s and both screens are places someone
   has arrived to type a password, he first said yes and then reversed it:
   "please don't shorten and use the provided setting (same as start page)
   everywhere." One banner, one pace, every surface.
   ⛔ Do not reintroduce a brisk variant without asking him again. */


@media (prefers-reduced-motion: reduce) {
  .logo.v2.play * { animation: none !important; transform: none; filter: none; }
  .logo.v2.play .cc-rear-white, .logo.v2.play .cc-rear-edge { opacity: 0; }
  .logo.v2.play .wm-l, .logo.v2.play .wm-tm { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .msg.chime-in, .chime-ring,
  .tstars span,
  /* ⚠ .wm-tm belongs in BOTH lines. It is opacity:0 until its animation runs,
     so omitting it here would leave the trademark invisible for anyone with
     reduced motion on, if wm-play were ever applied. */
  .logo.wm-play .wm-l, .logo.wm-play .wm-tm, .logo.wm-play .logo-mark { animation: none !important; }
  .logo.wm-play .wm-l, .logo.wm-play .wm-tm, .logo.wm-play .logo-mark { opacity: 1; }
  .chime-ring { display: none; }
}

/* ============================================================== */
/* Header chip legibility: the drawn icons need beefier strokes at
   chip size, and the icon-only chips (sound / theme / text-size)
   need real thumb-sized targets on phones.                        */

.chip svg.ci {
  width: 1.5em;
  height: 1.5em;
}
/* CSS stroke-width beats the SVG attribute: thicken the line-art at
   chip scale so it never renders hairline. Fill-only star paths have
   stroke:none and are unaffected. */
.chip svg.ci * { stroke-width: 3.4; }

@media (max-width: 660px) {
  /* Icon-only chips become fixed circular targets at the 44px
     accessibility minimum, with full-strength ink. */
  #soundBtn, #displayBtn, #stepAwayBtn, #navBtn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
  }
  #soundBtn .chip-extra { display: none; }
  #soundBtn svg.ci, #displayBtn svg.ci, #stepAwayBtn svg.ci, #navBtn svg.ci {
    width: 22px;
    height: 22px;
  }
}
@media (max-width: 480px) {
  #soundBtn, #displayBtn, #stepAwayBtn, #navBtn { width: 40px; height: 40px; min-width: 40px; }
  #soundBtn svg.ci, #displayBtn svg.ci, #stepAwayBtn svg.ci, #navBtn svg.ci { width: 20px; height: 20px; }
}
/* Narrow phones (375–410px): tighten the action row just enough to keep a
   comfortable margin from the screen edge — circles to 38px, snug gaps. */
@media (max-width: 410px) {
  .chat-header { padding-inline: 10px; gap: 5px; }
  .header-actions { gap: 6px; }
  #soundBtn, #displayBtn, #stepAwayBtn, #navBtn { width: 38px; height: 38px; min-width: 38px; }
  .chip { padding: 6px 7px; }
}
/* Very narrow phones (<=360px — the MOST COMMON Android width, so this is
   no edge case): never wrap. The text chips drop their labels (icon-only)
   so the row always fits one line; titles/aria-labels keep the words. The
   JS overflow watcher does the same at ANY width when system font scaling
   inflates the chips past what these breakpoints assume. */
@media (max-width: 360px) {
  .chat-header { gap: 6px; }
  .header-actions { gap: 8px; }
  .chip-label { display: none; }
  .chip { padding: 6px 8px; }
}

/* ---------------------------------------------------- link preview */
/* A URL in a message becomes a preview card built purely from the URL
   itself — no fetching, no tracking; nothing leaves the device until
   the user chooses to click. Opens in a new tab. */
.msg a.msg-link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-all;
}
.link-card {
  display: block;
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(198, 255, 0, 0.45);
  border-radius: 12px;
  background: rgba(198, 255, 0, 0.08);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  max-width: 100%;
}
.link-card:hover { border-color: var(--lime-deep); background: rgba(198, 255, 0, 0.14); }
.link-card .lc-domain {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: calc(0.88rem * var(--msg-scale));
  color: #506212;
}
.link-card .lc-domain .lc-star { color: #647C0F; font-size: 0.8em; }
.link-card .lc-url {
  margin-top: 2px;
  font-size: calc(0.72rem * var(--msg-scale));
  color: rgba(20, 20, 22, 0.6);
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.link-card .lc-hint {
  margin-top: 6px;
  font-size: calc(0.68rem * var(--msg-scale));
  font-weight: 600;
  color: #647C0F;
}

/* ------------------------------------------------- server notice bar */
/* The countdown/broadcast banner: the invite-bar slot, two moods.
   Update countdown = amber, sticky. Broadcast = lime, dismissible. */
.notice-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 16px 0;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
.notice-bar.update {
  border: 1px dashed #d97706;
  background: rgba(217, 119, 6, 0.12);
  color: #f59e0b;
}
body.light .notice-bar.update {
  border-color: #b45309;
  background: rgba(180, 83, 9, 0.08);
  color: #92400e;
}
.notice-bar.update.danger {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
}
body.light .notice-bar.update.danger {
  border-color: #b91c1c;
  background: rgba(185, 28, 28, 0.07);
  color: #b91c1c;
}
.notice-bar.info {
  border: 1px dashed var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.notice-bar span:first-child { flex: 1; }
.notice-dismiss {
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 2px 6px;
  flex: none;
}

/* ==================================================================== */
/* UNIFORM ATTACHMENTS — "one bubble size for everything" (2026-07-19/20).
   Every attachment EXCEPT a voice note is a fixed-height "capsule row": a
   native TYPE icon (never an image preview), the name, a kind+size line, and
   a ··· options button. The picture only appears in the full-screen viewer.
   Voice notes are the sole exception — an inline waveform player. */

.msg .att-uni { width: 236px; max-width: 100%; }

/* -- the capsule row -- */
.att-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.att-cap { height: 52px; }
.att-thumb {
  width: 44px; height: 44px; border-radius: 10px; flex: none;
  display: grid; place-items: center; overflow: hidden; position: relative;
  background: rgba(0, 0, 0, 0.10); color: var(--bubble-ink);
  border: 0; padding: 0; font-family: inherit;
}
.att-thumb .ci { width: 26px; height: 26px; }
.att-info { flex: 1; min-width: 0; }
.att-name {
  font-size: calc(0.82rem * var(--msg-scale)); font-weight: 600; color: var(--bubble-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.att-sub {
  font-size: calc(0.68rem * var(--msg-scale)); color: #5b5b52;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.att-kind {
  display: inline-block; font-size: 0.54rem; font-weight: 800; letter-spacing: 0.07em;
  text-transform: uppercase; border-radius: 5px; padding: 1px 5px; margin-right: 5px;
  background: rgba(0, 0, 0, 0.12); color: #3f4030; vertical-align: 1px;
}
.att-dots {
  flex: none; border: 0; background: rgba(0, 0, 0, 0.08); color: var(--bubble-ink);
  width: 32px; height: 28px; border-radius: 8px; cursor: pointer;
  display: grid; place-items: center; font-family: inherit;
}
.att-dots .ci { width: 22px; height: 22px; }
.att-voice .att-dots { align-self: center; margin-left: 2px; }
.att-dots:focus-visible, button.att-thumb:focus-visible {
  outline: 2px solid var(--accent-deep); outline-offset: 2px;
}
.att-locked .att-thumb { background: rgba(0, 0, 0, 0.18); }

/* -- attachment action sheet: copy / save / view -- */
.att-veil {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, 0.45);
  opacity: 0; transition: opacity 180ms ease;
}
.att-veil.show { opacity: 1; }
/* Centered modal, capped to the viewport with its own scroll — so a tall
   options list (View · Copy · Keep · Cancel + note) can never hang off the
   bottom of the screen. */
.att-sheet {
  position: fixed; left: 50%; top: 50%; z-index: 61;
  width: min(420px, calc(100% - 24px)); max-height: min(88vh, 640px); overflow-y: auto;
  overscroll-behavior-y: none;   /* see check-scroll.js */
  transform: translate(-50%, -48%) scale(0.97); opacity: 0;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.42);
  transition: transform 200ms cubic-bezier(0.22, 1, 0.36, 1), opacity 170ms ease;
}
.att-sheet.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }
.att-sheet .as-head { display: flex; align-items: center; gap: 10px; padding: 2px 4px 11px; border-bottom: 1px solid var(--line); }
.att-sheet .as-head .att-thumb { width: 40px; height: 40px; }
.att-sheet .as-head .att-thumb .ci { width: 24px; height: 24px; }
/* .att-thumb is shared with the message capsule, where it paints
   var(--bubble-ink) (#0a0a0a) — deliberately theme-invariant, because
   bubbles are white or light lime in BOTH themes and near-black on them is
   correct there, and AAA. The sheet header reuses the class but sits on
   var(--card), which is #161616 in dark: near-black on #161616 is about
   1:1, i.e. invisible. Light theme was fine (--card is near-white),
   which is why it went unnoticed.

   Scoped to the sheet on purpose. Changing --bubble-ink or .att-thumb
   outright would fix this and break the icon inside every capsule. */
.att-sheet .as-head .att-thumb { color: var(--ink); background: rgba(255, 255, 255, 0.07); }
body.light .att-sheet .as-head .att-thumb { background: rgba(0, 0, 0, 0.06); }
.att-sheet .as-name { font-size: 0.85rem; font-weight: 700; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.att-sheet .as-sub { font-size: 0.7rem; color: var(--ink-faint); }
.att-sheet .as-btns { display: flex; flex-direction: column; gap: 7px; margin-top: 11px; }
.att-sheet button {
  width: 100%; border: 1px solid var(--line); background: transparent; color: var(--ink);
  font: inherit; font-size: 0.9rem; font-weight: 600; padding: 11px 14px; border-radius: 12px; cursor: pointer;
  display: flex; align-items: center; gap: 11px; text-align: left;
}
.att-sheet button .ci { width: 22px; height: 22px; flex: none; }
.att-sheet button.as-primary { background: var(--lime); border-color: var(--lime); color: var(--on-lime); }
.att-sheet button:disabled { opacity: 0.55; cursor: default; }
.att-sheet .as-note { font-size: 0.66rem; color: var(--ink-faint); text-align: center; margin-top: 10px; }
.att-sheet .as-note .s { color: var(--accent); }

/* Viewer bar action chips: icon + label */
.viewer .chip .vb-ico { display: inline-flex; vertical-align: -0.28em; }
.viewer .chip .vb-ico .ci { width: 19px; height: 19px; }
.viewer .chip[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .att-veil, .att-sheet { transition: none !important; }
}

/* ---------------------------------------------- Presence Drop Down (08-01-2026)
   Presence used to stream: "X has gone offline" sat in the conversation as a
   record, and stayed there after X came back — a stale claim scrolling
   upward, which is how the founder reported it. Presence is a LIVE STATE, so
   it now drops down from under the header and retracts itself, beside the
   status dot that already carries the same fact.

   ⚠ ZERO COMMITTED HEIGHT. The wrapper is a 0px line; the panel is absolute.
   Showing or hiding it can never move a bubble — the rule this whole file
   was rewritten around today. Do NOT make this an in-flow bar. */
/* ⚠ THE HEADER MUST OUTRANK THE PANE, or "tucked behind the header" below is
   a comment describing something that never happens (founder, phone,
   08-08-2026: "the drop bar is suppose to be extending from the bottom of
   the 2nd pane of the header but it seems to be dropping from higher up").

   The panel rests at translateY(-100%) and slides down. Both header panes
   were `position: static`, and z-index applies ONLY to positioned elements —
   so the pane's z-index 6 painted the sliding panel OVER them for the whole
   320ms. Measured: panel top -8.1 against a header bottom of 79.5.

   ⚠ The RESTING edge was always correct, flush with pane 2's bottom. Only
   the entrance was wrong, which is exactly why every static measurement
   passed and only watching it on a device caught it. It reproduces with the
   keyboard up too, so nothing here is --vvh dependent.

   ⛔ Safe to position these: neither pane has a single absolutely-positioned
   descendant (checked in the live page, both editions share this markup), so
   introducing a containing block changes nothing else. */
.peer-topbar, .chat-header { position: relative; z-index: 7; }

/* ⭐ ITEM 14, the other half. The pane now sits BELOW the banners in the DOM
   (index.html), so it drops into the space under them instead of onto them.
   But it still ENTERS by sliding up from translateY(-100%), which takes it
   back across whatever is above — so the banners need the same treatment the
   header just got, or the entrance re-creates the overlap it just fixed.
   ⚠ Same check as the header: none of these three has an absolutely
   positioned descendant, so a new containing block changes nothing else. */
.notice-bar, .invite-bar, .closing-banner { position: relative; z-index: 7; }

.presence-drop { position: relative; height: 0; overflow: visible; z-index: 6; pointer-events: none; }
.presence-drop[hidden] { display: none; }
.presence-drop .pd-text {
  position: absolute; top: 0; left: 0; right: 0;
  width: fit-content; margin-inline: auto;
  max-width: min(92%, 520px);
  text-align: center;
  /* ⚠ BIGGER, because presence is the one thing every conversation needs
     (founder, 08-01-2026: "should drop down much more … to be more
     noticeable"). It GROWS DOWNWARD and stays welded to the header rather
     than floating free — detaching it would make it a banner over the
     conversation instead of something the header extends. min-height is what
     gives a one-line message the same presence as a three-line one. */
  display: flex; align-items: center; justify-content: center;
  /* ⚠ 2x the one-line height it had (33px), not 3x. Founder calibrated it
     down after seeing ~92px: "it can also be 2x current size". Big enough to
     read as a banner the header extends, small enough that it is not a lid
     on the conversation. It still GROWS beyond this for longer copy —
     min-height only guarantees a short message the same presence. */
  min-height: 66px;
  padding: 12px 20px;
  font-size: 0.9rem;
  /* ⚠ OPAQUE. Translucency + a backdrop blur was built and REMOVED the same
     hour (founder, 08-01-2026: "consistency is important, please remove any
     transparency and keep the drop down pane universal"). It looked good over
     the Chimefield and it obeyed the 07-31 opaque rule only by a workaround —
     two grounds for one surface family is the inconsistency. Every floated
     thing in this app paints an opaque ground; this is not the exception.
     ⚠ Do not reintroduce alpha here, with or without a blur. */
  background: var(--card);
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 18px 18px;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
  /* Drops DOWN: it starts tucked behind the header and slides into view. */
  transform: translateY(-100%);
  opacity: 0;
  transition: transform 320ms cubic-bezier(0.22, 1, 0.36, 1), opacity 260ms ease;
}
.presence-drop.showing .pd-text { transform: translateY(0); opacity: 1; }
/* ⚠ The wrapper is pointer-events: none so the conversation keeps its taps.
   The panel takes them back ONLY while it is dismissible — an IN state and
   my own away note must not be tappable. Without this the tap silently never
   fires; found by measuring, not by reading. Same shape as
   .float-note.actionable .fn-pill. */
.presence-drop.dismissible .pd-text { pointer-events: auto; cursor: pointer; }
/* ⭐ The ✕ on a FINAL note (founder, 08-08-2026). ⚠ A deliberate exception
   to the pinned-zone rule — see the note in app.js where it is created. It
   appears ONLY on .pd-final, which is the one notice that never retires by
   itself, and it must not spread to any notice that does.
   ⚠ Not a button and not focusable: the WHOLE pane is already the tap
   target, and a second target inside it would give two ways to do one thing
   with different hit areas. This is a mark that says the pane can be
   dismissed, not a control of its own. */
.presence-drop .pd-x {
  margin-left: 10px;
  opacity: 0.55;
  font-weight: 700;
  font-size: 0.92em;
  vertical-align: baseline;
}
@media (hover: hover) { .presence-drop.dismissible .pd-text:hover .pd-x { opacity: 0.9; } }
@media (hover: hover) {
  .presence-drop.dismissible .pd-text:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
}
/* ---- A CROSS-ROOM PRESENCE NOTE ----------------------------------------
   The pane announces a change in ANOTHER of your rooms, then retires; the
   tab carries the standing state (docs/planning/PRESENCE_ACROSS_TABBED_ROOMS.md).

   ⚠ The TEXT is NOT coloured, and that is a measured decision rather than a
   taste: a coloured 0.9rem line would have to clear contrast for all six
   room colours in both themes, which a border and a dot do not. The room's
   colour lives in the border and the leading dot instead.
   ⚠ It never wears the amber/lime of a LOCAL absence — that difference is
   itself the signal: amber or lime means this room, a room colour means
   another one. */
.presence-drop.pd-rh-blue   { --prh: var(--room-blue); }
.presence-drop.pd-rh-coral  { --prh: var(--room-coral); }
.presence-drop.pd-rh-violet { --prh: var(--room-violet); }
.presence-drop.pd-rh-rose   { --prh: var(--room-rose); }
.presence-drop.pd-rh-teal   { --prh: var(--room-teal); }
.presence-drop.pd-rh-orchid { --prh: var(--room-orchid); }
.presence-drop.cross .pd-text {
  color: var(--ink-soft);
  border-color: var(--prh, var(--line));
}
/* The leading dot, tying the sentence to the tab it came from. A flex item
   on .pd-text, which is already a centred flex row. */
.presence-drop.cross .pd-text::before {
  content: "";
  width: 9px; height: 9px; border-radius: 50%; flex: none;
  background: var(--prh, var(--ink-soft));
  margin-right: 9px;
}

/* An "out" state (away, dropped, stepped out) reads in the same amber as the
   other things that are true-until-they-are-not. "In" states are lime. */
.presence-drop.out .pd-text { color: var(--warn, #f2b13c); border-color: rgba(242, 177, 60, 0.4); }
.presence-drop.in .pd-text { color: var(--accent); border-color: var(--lime-soft2, var(--line)); }
@media (prefers-reduced-motion: reduce) {
  .presence-drop .pd-text { transition: opacity 200ms ease; transform: none; }
}

/* ---- Schedule dialog: the sender's name ---------------------------------
   A member's name is read only here because it has one home, the Account
   profile, and a per-schedule name must not diverge from it. A greyed input
   with no explanation reads as broken, so it is always paired with the
   "Change in Account" link. */
.field-hint { display: block; margin-top: 5px; font-size: 0.74rem; color: var(--ink-faint); line-height: 1.45; }
.linkish {
  background: none; border: 0; padding: 0; font: inherit; font-size: inherit;
  color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
}
#scheduleNameInput[readonly] { opacity: 0.72; cursor: default; }

/* ---- Schedule dialog: the action row is PINNED --------------------------
   ⚠ Deliberately unlike .leave-modal, and the difference is the point. The
   leave card scrolls in full because every element in it is a CHOICE and none
   may be privileged. The Schedule dialog has exactly ONE button that must stay
   reachable, and with a keyboard up it was not: focusing the name field makes
   the browser scroll the input into view, which left "Create the scheduled
   room" 15px BELOW the fold at --vvh 300px (founder, 08-02-2026, on a real
   phone). The card was already scrollable and the button was already reachable
   by scrolling further — but nobody scrolls a dialog that looks finished.
   Same treatment the ack/confirm dialogs got on 07-27-2026: pin the buttons,
   let the text scroll. The negative bottom pulls the row over the card's own
   bottom padding, so scrolled content cannot show beneath it.

   #schedKeepModal is here for the same reason and was caught the same day by
   the new keyboard rule rather than by a founder report: its acknowledgement
   button was invisible at EVERY keyboard height, and Copy vanished below
   220px. That dialog exists to make one button be pressed, so an unreachable
   one is the whole feature failing. */
#scheduleModal .leave-actions,
#schedKeepModal .leave-actions {
  position: sticky;
  bottom: calc(-22px - env(safe-area-inset-bottom));
  background: var(--card);
  padding-top: 10px;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
  margin-bottom: calc(-22px - env(safe-area-inset-bottom));
}

/* ---- A scheduled invite says so before it asks for anything --------------
   Styled as a quiet marker rather than a status line: this is not an error,
   nothing has gone wrong, and the room is exactly as it should be. The house
   voice for a door that is not open yet is the same one the schedule dialog
   uses ("Nobody can enter before then, not even you"), so it reads as part of
   the product rather than a validation message. Founder, 08-02-2026. */
.invite-when {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  padding: 16px 18px 15px;
  margin: 4px 0 18px;
  text-align: center;
}
.invite-when .iw-mark { color: var(--accent); font-size: 1.05rem; line-height: 1; margin-bottom: 7px; }
.invite-when .iw-line {
  font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 600; margin: 0 0 4px;
}
.invite-when .iw-when {
  font-family: 'Fraunces', Georgia, serif; font-size: 1.18rem; font-weight: 600;
  color: var(--ink); margin: 0 0 8px; line-height: 1.25;
}
.invite-when .iw-sub { font-size: 0.78rem; color: var(--ink-soft); margin: 0; line-height: 1.5; }

/* The same voice once they have asked to be let in and are waiting. */
.joining-status.waiting {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--accent-soft), transparent);
  padding: 16px 18px;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.55;
}
.joining-status.waiting b { color: var(--ink); }
.joining-status.waiting .jw-when {
  display: block;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.12rem; font-weight: 600; color: var(--ink);
  margin: 6px 0 8px;
}

/* ---- The button tiers on the start page ---------------------------------
   Founder, 08-02-2026: "we chose the filled button for 'start room' because it
   is the main way to start a room and want an outlined button for 'Join' and
   'Schedule a room for later' since they are secondary but also are about entry
   into rooms."

   So there are THREE tiers here, not two:
     .btn.primary  filled lime   the one main action (Start a new room)
     .btn.entry    lime OUTLINE  secondary, but still about getting into a room
     .btn          plain         everything else

   ⚠ .entry is a named tier rather than an id rule on purpose. It was written
   first as #scheduleToggle, which said nothing about WHY, so the next button of
   the same kind would not have found it.
   ✔ That paid off on 08-03-2026: #leaveStayBtn ("Not yet, go back" in the leave
   dialog) was reported invisible in BOTH themes on its plain 1px var(--line)
   border, and the fix was to ADD .entry to it rather than restyle one button.
   The tier now reads "about being in a room" rather than strictly entering one:
   staying is the same decision as arriving. It also puts the leave dialog in the
   start page's exact hierarchy — a lime OUTLINE beside a lime FILL, the same
   pairing as "Schedule a room for later" beside "Start a new room", since
   .leave-choice.vanish is already lime-filled.

   ⚠ CONSIDERED AND DECLINED, same day: giving #scanBtn the tier too. It is
   arguably about entry as well, and it now sits plain between two outlined
   buttons. Payman chose to leave it plain, so the odd one out is DELIBERATE.
   Do not "fix" it. If the lime ever needs rebalancing, change the tier's
   treatment rather than adding an exception for one button. */
.btn.entry {
  /* ⚠ var(--lime), NOT var(--accent). --accent is themed and resolves to a dark
     olive (#647C0F) in light mode, so these outlines stopped looking lime at
     all: on the narrow Join button a 1px olive hairline simply reads grey,
     while the full-width Schedule button showed enough of it to read olive.
     Two buttons of the same tier appeared to be different colours (founder,
     08-02-2026). --lime is #C6FF00 in BOTH themes, which is exactly why the
     filled .btn.primary above stays lime on white — the outline tier now
     matches the fill tier by using the same value. 1.5px because a pale
     hairline on white is easy to miss; on the dark ground 1px was plenty. */
  border-color: var(--lime);
  border-width: 1.5px;
  color: var(--ink);
  background: var(--card);
}
.btn.entry .ci { color: var(--lime); }
.btn.entry:hover { border-color: var(--lime-deep); background: var(--accent-soft); }
body.light .btn.entry .ci { color: var(--accent-deep); } /* the glyph is small; keep it legible */

/* ---- The last minute before a scheduled room opens ----------------------
   Deliberately the SAME language as the farewell countdown (.cb-count /
   .cb-live): lime, tabular figures, and a slow 2s breath. Both are a room's
   lifecycle turning over, one closing and one opening, and they should feel
   like the same product rather than two unrelated timers. Not an alarm colour
   for the same reason: a door about to open is the product working.
   Founder, 08-02-2026. Only the final minute — above that a live clock adds
   nothing but pressure, and the static time is kinder. */
.invite-when .iw-when.live,
.joining-status.waiting .jw-when.live {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  animation: cbBreath 2s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
  .invite-when .iw-when.live,
  .joining-status.waiting .jw-when.live { animation: none; }
}

/* ---- "Scan an invite QR code instead" -----------------------------------
   A quiet text link under the code row, not a button. It was a full-width
   button and was opened TWICE in thirty days, so it was taking the page's most
   valuable space for its least-used action, and it sat plain between two
   outlined buttons with no way to explain itself. Kept rather than removed:
   rare is not the same as useless, and it is the only camera route in.
   Founder call 08-02-2026, on the numbers. */
.scan-link {
  display: inline-flex; align-items: center; gap: 6px;
  margin: 10px auto 0;
  background: none; border: 0; padding: 6px 4px;
  font: inherit; font-size: 0.78rem; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 3px;
  cursor: pointer;
}
.scan-link .ci { width: 17px; height: 17px; color: var(--accent); }
.scan-link:hover { color: var(--ink); }
/* The join row and this link read as one group, so centre the link under it. */
.join-row + .scan-link { display: flex; justify-content: center; width: 100%; }

/* ── Upgrade block in the Account sheet (founder, 08-04-2026) ───────────
   "account should also give option to 'upgrade to premium' with description
   below it 'Upgrade to experience ChimeChat fully' and link to page showing
   benefits/comparison."

   The sub-line is deliberately quiet: the button carries the offer, and a
   second loud element beside it would read as two competing calls. The
   comparison link sits INSIDE that line rather than as its own button, so
   the sheet gains one action, not three. */
#upgradeArea { display: flex; flex-direction: column; gap: 6px; }
#upgradeArea .upgrade-sub { text-align: center; margin: 0; }
#upgradeArea .linkish { white-space: nowrap; }

/* ── Account sheet: four tabs (founder, 08-05-2026) ────────────────────
   "very cluttered, please better organize or make into sections and tabs."
   The sheet was ten stacked blocks in one scroll; it is now Membership ·
   Profile · Devices · Billing, each answering one question.

   Reuses .about-tabs for the strip so there is ONE tab mechanism in the app,
   and adds only what differs: four columns instead of three, and panels that
   are plain blocks rather than the About dialog's scroller (.member-card is
   already the scroll container here, and nesting a second one is what
   check-scroll.js exists to catch). */
/* Five tabs since the Perks tab (08-13-2026): two rows, so "Settings &
   Devices" keeps a readable width — five equal columns would crush it
   below its own label. */
#acctSignedIn .about-tabs { grid-template-columns: repeat(3, 1fr); }
/* ⭐ Rearranged 08-16-2026 (founder): row 1 = Profile · Settings & Devices
   (two buttons, half the strip each), row 2 = Membership · Perks · Billing
   (three buttons, a third each), BOTH rows filling the same total width.
   This SUPERSEDES the 08-14 layout (3 over 2 centered at row-1 widths).
   Row 1's rule is ADDED beside the shared #acctSignedIn .about-tabs rule
   above, which other markup still relies on — never folded into it. */
#acctSignedIn .about-tabs.acct-tabs-row1 { grid-template-columns: repeat(2, 1fr); }
#acctSignedIn .about-tabs.acct-tabs-row2 {
  grid-template-columns: repeat(3, 1fr);
  margin-top: 3px;
}
.acct-tab {
  border: none; background: transparent; color: var(--ink-faint);
  font: inherit; font-size: 0.72rem; font-weight: 600;
  padding: 7px 3px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.acct-tab.active { background: var(--lime); color: var(--on-lime); }
.acct-panel { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
#acctSignedOut, #acctSignOutRooms { display: flex; flex-direction: column; gap: 10px; }
/* The room rows in the sign-out step read as the start page's do. */
#acctSignOutList .resume-row { margin-bottom: 6px; }

/* -------------------------------------------------- account sections
   Founder, 08-07-2026: the account tabs "are shoved together and the
   fields don't show well". Each answer the tab gives now sits in its own
   bounded card, so a heading, its controls and its fine print read as one
   group and cannot be misattached to the group below.

   Surface: `--bg` on a `--card` sheet. That is a real step in BOTH themes
   without a third token — the sheet is #161616 on #0a0a0a in dark, and
   #fafafa on #ffffff in light, so the card reads inset on one and raised
   on the other, which is what each theme expects. The shadow is nearly
   nothing on purpose; the border does the work.

   ⚠ `display: flex` here BEATS the UA's `[hidden] { display: none }`, and
   three of these cards are revealed by script (profEmailWrap, profileArea,
   profTabsWrap). The global `[hidden] { display: none !important }` at the
   top of this file is what keeps that safe — do not weaken it. */
.acct-sec {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px 14px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
body.light .acct-sec { box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
/* The card supplies the air; the heading no longer needs a top margin, and
   the hand-placed `style="margin-top:10px"` spacers are gone with it. */
.acct-sec > .prof-head { margin-top: 0; }
.acct-sec > .member-fine,
.acct-sec > .prof-note,
.acct-sec > p { text-align: left; }
/* A heading's own subtitle: sits under the heading, above the controls. */
.acct-sec-sub { margin: -2px 0 2px; text-align: left; }
/* One setting inside a card: field, control, and the toggle that decides
   whether it is remembered — kept tight so the toggle is visibly attached
   to the control above it and not to the next block. */
.acct-block { display: flex; flex-direction: column; gap: 7px; }
.acct-block .field { margin-bottom: 0; }
.acct-block .avatar-row { margin: 0; }
/* Between blocks inside one card. Full-bleed to the card's padding, so it
   reads as a division of the card rather than a line floating in it. */
.acct-rule {
  height: 1px;
  background: var(--line);
  margin: 4px -14px;
}
/* A caption for a control that has no <input> to label (the photo picker). */
.field-cap {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
}
/* A step revealed inside a card (the change-email form): tinted back to the
   sheet's own surface so it reads as a panel that opened, not as more of
   the card it sits in. */
.acct-inset {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  margin-top: 2px;
}
.acct-inset .field { margin-bottom: 0; }
.acct-inset .btn { align-self: flex-start; }
/* Send and "Not now" side by side, wrapping rather than stretching. */
.acct-inset-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.acct-inset-row .btn { align-self: auto; }
.acct-inset .member-fine { text-align: left; }
/* The email input matches the name input rather than the landing screen's
   fields — they sit two cards apart and were visibly different weights. */
#profEmailInput {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 9px 12px;
}
#profEmailInput:focus { border-color: var(--accent); outline: none; }
/* Inside a card the name field's surface must differ from the card, or the
   input disappears into it. The card is --bg, so the input takes --card. */
.acct-sec #profNameInput { background: var(--card); }

/* Signed-in browsers: a bounded, scrollable list (founder, 08-05-2026).
   Someone signed in on many browsers pushed the rest of the Devices tab off
   the card. ⚠ overscroll-behavior in the SAME rule as the overflow — the
   card behind must not scroll when this reaches its end, and check-scroll.js
   enforces exactly this pairing. */
#sessionList { max-height: 40vh; overflow-y: auto; overscroll-behavior-y: none; }

/* "What device means here" — the one paragraph in the sheet that has to be
   understood by someone who has never thought about browsers as separate
   places. Given its own block and a little air, because it is a definition
   people would otherwise skim past. */
.lives-where .lw-device { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); line-height: 1.55; }

/* The word "device" itself is the link (founder, 08-05-2026: link the word in
   the sentence, not a separate line). Styled as underlined body text so it
   reads as a word first and a control second — a button that must not look
   like a button. Inherits everything so it sits inside <strong> and <label>
   without disturbing the line. */
.devword {
  font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0;
  text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 2px;
  cursor: pointer;
}
.devword:hover, .devword:focus-visible { text-decoration-style: solid; color: var(--accent); }

/* Separated the Profile tab's opening explanation from the first field.
   ⚠ No longer used in markup (08-07-2026): the account tabs became cards
   and `.acct-rule` divides blocks INSIDE one, full-bleed to its padding.
   The rule is kept because it is a generic separator other surfaces may
   still reach for, and deleting it is not what this change is about. */
.prof-sep { height: 1px; background: var(--line); margin: 12px 0 4px; }

/* The two doors from the start button: stacked, not side by side. They are
   full sentences ("Already a member? Sign in"), and side-by-side buttons
   would wrap into an unreadable pair on a phone. */
.ack-btns.entry-doors { flex-direction: column; }
.ack-btns.entry-doors .btn { width: 100%; }

/* The start button carries two lines: the action, then how to get there.
   The second is quieter so the eye lands on "Start a room" first — the sign-in
   half is the route, not the offer. Centred, and the button drops its single-
   line height rules to fit both. */
#newChatBtn .cta-main,
#newChatBtn .cta-sub { display: block; text-align: center; line-height: 1.25; }
#newChatBtn .cta-sub { font-size: 0.82em; font-weight: 600; opacity: 0.85; margin-top: 2px; }
#newChatBtn:has(.cta-sub) { padding-top: 11px; padding-bottom: 11px; }

/* ⚠ `.divider` sets `display: flex`, which BEATS the browser's own
   `[hidden] { display: none }` — so setting .hidden on a divider silently
   does nothing. Found hiding "or schedule one" alongside the Premium-only
   schedule button (08-05-2026); without this the heading stayed on screen
   over empty space and the JS looked correct. Any element with a display
   rule needs this if it is ever hidden by attribute. */
.divider[hidden] { display: none; }

/* ---- Tabbed Rooms & Indicators (paid, Premium only) — decided 08-06-2026.
   The tabs hang from the composer's underside, the Presence Drop Down's own
   orientation inverted: opaque card ground, hairline border, NO border on
   the welded edge, rounded only on the free corners. Comfortable density,
   peer names only in BOLD, and a calm dot that settles once — never a
   flash, never a pulse. The ACTIVE room is the lime-filled tab (fill means
   where you are; it never means unread). Absent on beta and for Guest and
   Basic: app.js gates on isPaid + a premium entitlement, and the strip is
   simply never created. Full spec: FREE_PAID_SPLIT.md → room-switching. */
#roomTabs {
  flex: none;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 5px;
  padding: 0 12px 8px;
}
.rt-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  /* EQUAL WIDTHS (founder, 08-06-2026): every room tab takes the same
     share, long names ellipsize, and a tab's position never shifts with
     its neighbour's name length. The start control keeps its own size. */
  flex: 1 1 0; min-width: 0; max-width: 130px;
  font-size: 0.74rem; line-height: 1;
  padding: 7px 10px 8px;
  border: 1px solid var(--line); border-top-width: 0;
  border-radius: 0 0 11px 11px;
  background: var(--card); color: var(--ink-soft);
  cursor: pointer; margin-top: -1px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
  font: inherit; font-size: 0.74rem;
}
.rt-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.rt-tab.active { background: var(--lime); border-color: var(--lime); color: var(--on-lime); cursor: default; }
@media (hover: hover) {
  .rt-tab:not(.active):hover { color: var(--ink); border-color: var(--accent-deep); }
}
/* ---- ROOM COLOURS -------------------------------------------------------
   The colour belongs to the ROOM (docs/planning/PRESENCE_ACROSS_TABBED_ROOMS.md).
   Fill goes on meaning WHERE YOU ARE; the hue says WHICH ROOM. Six hues,
   lime and amber deliberately excluded — lime is the brand fill and the
   light-mode conversation ground, amber means "away" in the presence pane.

   ⚠ ADDED ALONGSIDE `.rt-tab.active` above, never replacing it. A tab with
   no `.rt-hue` class is painted by the original rules exactly as before,
   which is the case that must keep working: a member holding ONE room sees
   the lime fill they have today, because the client only adds these classes
   once a second room is held.

   ⚠ Every value is a literal per theme, NOT derived from --accent, which
   resolves to olive #647C0F in light mode. Same trap that made the Join and
   Schedule buttons read as different tiers. */
/* ⭐ THE PALETTE, DEFINED ONCE. Every surface that wears a room's colour —
   the tab here, the identity name, the two rules inside the room — resolves
   through these tokens, so a hue is one edit and never drifts between
   surfaces. Theming happens ONLY here.
   ⚠ Literals, deliberately. Not derived from --accent, which resolves to
   olive #647C0F in light mode; that is the trap that made the Join and
   Schedule buttons read as different tiers. */
:root {
  --room-blue: #5aa9f0;   --room-blue-on: #08131f;
  --room-violet: #8f8cf2; --room-violet-on: #12103a;
  --room-orchid: #c286ee; --room-orchid-on: #2c0d3d;
  --room-rose: #e8788f;   --room-rose-on: #3d0d1a;
  --room-coral: #f2907a;  --room-coral-on: #3d1409;
  --room-teal: #4fc9b5;   --room-teal-on: #03302a;
}
/* Light mode: the dark-ground values are too pale on white, so each hue
   darkens and its on-fill text flips to white. */
body.light {
  --room-blue: #1d6fb8;   --room-blue-on: #ffffff;
  --room-violet: #5450c9; --room-violet-on: #ffffff;
  --room-orchid: #8b3fbe; --room-orchid-on: #ffffff;
  --room-rose: #a83552;   --room-rose-on: #ffffff;
  --room-coral: #b8492c;  --room-coral-on: #ffffff;
  --room-teal: #0f7f70;   --room-teal-on: #ffffff;
}
.rt-tab.rt-hue-blue   { --rt: var(--room-blue);   --rt-on: var(--room-blue-on); }
.rt-tab.rt-hue-violet { --rt: var(--room-violet); --rt-on: var(--room-violet-on); }
.rt-tab.rt-hue-orchid { --rt: var(--room-orchid); --rt-on: var(--room-orchid-on); }
.rt-tab.rt-hue-rose   { --rt: var(--room-rose);   --rt-on: var(--room-rose-on); }
.rt-tab.rt-hue-coral  { --rt: var(--room-coral);  --rt-on: var(--room-coral-on); }
.rt-tab.rt-hue-teal   { --rt: var(--room-teal);   --rt-on: var(--room-teal-on); }
/* Elsewhere: outlined. (0,2,0), so it beats `.rt-tab` and ties with
   `.rt-tab.active` — which is why the filled rule below is (0,3,0). */
.rt-tab.rt-hue { border-color: var(--rt); color: var(--rt); }
/* ⚠ A SOLID BAR ALONG THE BOTTOM OF AN UNFILLED TAB (founder, phone test
   08-08-2026: "the alternating tab colors are still close to one another,
   especially when unfilled").

   The problem is colour AREA, not colour separation — the pool's closest
   consecutive pair is already 96° apart, and two colours that far apart read
   alike as a 1px line and a few letters while reading as obviously different
   as a block. Widening the palette cannot fix that.

   ⛔ A TINTED BACKGROUND WAS TRIED FIRST AND FAILS. Measured: at 16% the
   light-mode label drops to 3.79:1, under AA, because light mode's card is
   near-white and washing it with a dark hue darkens the ground beneath dark
   text. Stronger washes separate better and read worse — 24% gives 3.39,
   32% gives 3.04. There is no strength that does both.

   A bar is pure area at FULL saturation, and it never touches the label's
   background, so contrast is exactly what it was. It also reads as a tab.
   ⚠ The base .rt-tab shadow must be restated here, or adding an inset one
   would silently drop it. */
.rt-tab.rt-hue:not(.active) {
  box-shadow: inset 0 -4px 0 var(--rt), 0 6px 16px rgba(0, 0, 0, 0.22);
}
/* Where you are: filled. */
.rt-tab.active.rt-hue { background: var(--rt); border-color: var(--rt); color: var(--rt-on); }
@media (hover: hover) {
  /* (0,4,0) so the hue survives hover; the affordance moves to the label. */
  .rt-tab.rt-hue:not(.active):hover { color: var(--ink); border-color: var(--rt); }
}

/* ---- THE ROOM'S COLOUR, INSIDE THE ROOM ---------------------------------
   Three marks, and they are not redundant (founder, 08-08-2026): the
   identity name and the rule under the header cover normal reading; the low
   rule covers the KEYBOARD-UP state, where the conversation collapses to a
   sliver and the top of the screen is effectively gone. His words: "with
   keyboard up, this would be easily visible."

   ⚠ ALL THREE ARE GATED ON `#chat.room-hued`, which the client adds only
   once a SECOND room is held. With one room there is no wrong room to type
   into, so a colour there distinguishes nothing. A room without the class is
   painted exactly as it is today — that is the case this must not break. */
#chat.rh-blue   { --rh: var(--room-blue); }
#chat.rh-violet { --rh: var(--room-violet); }
#chat.rh-orchid { --rh: var(--room-orchid); }
#chat.rh-rose   { --rh: var(--room-rose); }
#chat.rh-coral  { --rh: var(--room-coral); }
#chat.rh-teal   { --rh: var(--room-teal); }

/* (a) The identity name. It is the thing you already read to know where you
   are, so colouring it costs no space at all.
   ⚠ It is inside .peer-topbar, which `html.tight` HIDES at under ~240px of
   visible height (style.css → html.tight .peer-topbar). So in landscape with
   the keyboard up this mark is simply absent, and the low rule below is the
   only colour left. That is deliberate, not an oversight: see the design doc. */
#chat.room-hued .peer-name { color: var(--rh); }

/* (b) The rule under the header. The action bar already draws a 1px bottom
   border; this RECOLOURS it rather than adding anything, so no height moves. */
#chat.room-hued .chat-header { border-bottom-color: var(--rh); }

/* (c) The low rule: below the typing band, directly above the composer.
   ⚠ 1px, AND IT MUST STAY 1px. The band is `min-height: calc(1.4em + 15px)`,
   where the 15px is the pill's 7px top and bottom padding PLUS ONE PIXEL OF
   SLACK (see .typing-area). With border-box, a 1px border eats exactly that
   slack and the band does not grow. A 2px rule makes the content box one
   pixel shorter than the pill, the band grows, and the whole bottom-anchored
   conversation shifts. The same 1px holds in compact mode, where the band is
   `calc(0.7em + 9px)` against a 0.7em pill with 8px of padding.
   ⚠ A BORDER ON AN ELEMENT THAT ALREADY EXISTS, never a new element: there
   is deliberately nothing in flow between .messages and #typingArea, because
   an element there moves the conversation when it appears (index.html). */
#chat.room-hued .typing-area { border-bottom: 1px solid var(--rh); }

/* (d) THE SIDES — what closes the rectangle. Measured 08-08-2026: the
   header's bottom edge and `.convo`'s top edge are the SAME line (0.0px
   apart), and the typing band's bottom edge is `.convo`'s bottom edge (also
   0.0px). So (b) and (c) above are already `.convo`'s top and bottom; these
   two borders complete a closed frame with corners that meet.

   ⚠ Left and right borders cost NO VERTICAL SPACE, which is the whole reason
   this shape was chosen over an outline on `.messages`. That would have
   added its own top and bottom borders — 2px out of a conversation that is
   about 22px tall at --vvh 200 — put a coloured line hard against the
   header's grey one, and moved the bottom mark 37.4px away from the composer,
   losing the keyboard-up visibility the low rule exists for.

   They cost 2px of WIDTH each. `.messages` carries 18px of side padding, so
   the text does not come near them.

   ⚠ 2px, NOT 1px, and deliberately thicker than the horizontal edges
   (founder, phone test 08-08-2026: "on the phone, the side lines don't show
   much but on desktop does"). The page sets `viewport-fit=cover` and nothing
   pads the left/right safe area, so on a phone these sit hard against the
   bezel with the rounded display corners cutting across them — a hairline
   there is genuinely hard to see, where on a desktop it has window chrome
   around it.
   ⛔ NOT 3px. The frame's horizontal edges CANNOT follow: the low rule is
   locked at 1px by the typing band's one pixel of slack. 2px against 1px
   still reads as a frame; 3px against 1px reads as a mistake. */
#chat.room-hued .convo { border-left: 2px solid var(--rh); border-right: 2px solid var(--rh); }
@keyframes rtSettle { from { opacity: 0; transform: scale(0.4); } }
.rt-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lime); flex: none;
  animation: rtSettle 450ms ease-out;
}
/* ⚠ HOLLOW MEANS AWAY, FILLED MEANS UNREAD (founder, 08-08-2026). It borrows
   the app's own vocabulary — the in-room status dot already uses hollow for
   a state that is not "here" — rather than spending a second colour, which
   this design has none of left: colour is fully committed to WHICH ROOM.
   ⚠ Both can be true at once, so these are two elements side by side and
   never one that switches. The ring takes the room's colour where the tab
   has one, and falls back to the muted ink where it does not. */
.rt-dot.rt-away {
  width: 7px; height: 7px;
  background: transparent;
  border: 1.5px solid var(--ink-soft);
}
.rt-tab.rt-hue .rt-dot.rt-away { border-color: var(--rt); }
.rt-start {
  flex: 0 0 auto; /* the door is an affordance, not a room — its own width */
  border-style: dashed; border-top-width: 0;
  background: transparent; box-shadow: none;
  color: var(--ink-soft); opacity: 0.75; font-size: 0.64rem; font-weight: 600;
}
.rt-start svg { flex: none; }
.rt-start:hover { opacity: 1; color: var(--lime); border-color: var(--lime); }
@media (prefers-reduced-motion: reduce) { .rt-dot { animation: none; } }
.rt-full { font-size: 0.62rem; color: var(--ink-soft); opacity: 0.7; align-self: center; padding: 0 6px; }

/* -- replay placeholders (in-page switching, paid) --------------------
   A queued frame's stand-in while its bytes travel on the reconnect:
   the real name and size, an honest "arriving…", sized to the true
   capsule footprint (236px row) so the fill-in moves nothing. NOT a
   .msg on purpose — the deletion rule must never sweep a promise of
   content — and no animation: the calm dot's philosophy, nothing
   flashes while it waits. */
.msg-placeholder {
  align-self: flex-start;
  width: 236px; max-width: 78%;
  border: 1px dashed var(--line);
  border-radius: 14px;
  padding: 9px 13px;
  margin: 2px 0;
  color: var(--ink-soft);
  font-size: 0.8rem;
  line-height: 1.35;
}
.msg-placeholder .mp-name { display: block; font-weight: 600; overflow-wrap: anywhere; }
.msg-placeholder .mp-state { display: block; font-size: 0.72rem; opacity: 0.75; }
.msg-placeholder.mp-text { width: auto; min-width: 64px; }
/* the Tabbed Rooms switch (Account → Profile, Premium only) */
/* ⚠ The rule that used to live here gave this block a border-top and top
   padding, because it was the LAST thing appended inside the Profile tab
   and needed separating from the keep-signed-in row above it. It moved to
   its own card on the Settings & Devices tab (founder, 08-07-2026), where
   the card supplies both — keeping the old rule drew a second line one
   pixel under the card's own top border. Measured in the pane before and
   after: same block, one border instead of two. */
#profTabsWrap .prof-tabs-desc { font-size: 0.74rem; color: var(--ink-soft); margin: 4px 0 0 26px; line-height: 1.5; }
#profTabsWrap .prof-tabs-note { font-size: 0.68rem; color: var(--ink-soft); opacity: 0.75; margin: 3px 0 0 26px; }
/* THE VEIL — founder pick V1 at 450ms, 08-06-2026 ("the ground, and the
   name"): switching tabs covers the screen in the app's own themed ground
   with "✦ {name}…", and lifts once the destination room is actually seated.
   Its whole job is that the machinery of a switch (landing flash, joining
   card) is never seen. Timing lives in app.js as TAB_VEIL_MS. */
.tab-veil {
  position: fixed; inset: 0; z-index: 12000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  font-size: 1.05rem; color: var(--ink);
  opacity: 0; transition: opacity 140ms ease;
}
.tab-veil.show { opacity: 1; }
.tab-veil .s { color: var(--lime); margin-right: 8px; }
@media (prefers-reduced-motion: reduce) { .tab-veil { transition: none; } }
/* "Let ALL rooms go" — sits below every resume row, same quiet danger
   styling as the per-room vanish, full row so it reads as a footer. */
/* Centred, not full-width (founder, 08-06-2026) — on the start page and on
   the room-cap dialog alike. align-self covers the dialog's flex column;
   margin auto covers the start page's block flow. */
.resume-all { display: block; width: auto; margin: 8px auto 0; align-self: center; }

/* The room-cap dialog wears the resume list's frame — the same situation as
   the start page's return-to-your-room card, so the same accent outline and
   soft ground (founder, 08-06-2026).
   ⚠ --accent-soft is TRANSLUCENT — right for the start page's list, which
   sits on the page, wrong alone on a floating dialog (the page bled through,
   seen 08-06-2026). The gradient stacks it over the opaque card ground. */
.room-cap-card {
  border-color: var(--accent);
  background: linear-gradient(var(--accent-soft), var(--accent-soft)), var(--card);
}
/* The member button on the invite card (founder, 08-06-2026): FIRST, before
   the guest flow, a real full-width button — the old 0.78rem underlined line
   below Join went unseen on a phone. Two lines like the landing CTA: the
   action, then the why in a quieter voice. The gap below separates the two
   ways in so member-sign-in and guest-join read as distinct doors. */
.invite-member-btn {
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  width: 100%; margin: 0 0 18px;
  border-color: var(--accent);
}
/* Same size AND weight as the Join button's label (founder, 08-06-2026:
   "same text size as join button") — both inherit .btn's font untouched. */
.invite-member-btn .imb-main { font-weight: 600; }
.invite-member-btn .imb-sub { font-size: 0.72rem; font-weight: 400; color: var(--ink-soft); }

/* -- the Navigation menu (members; founder icons 08-07-2026) ---------- */
.nav-opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  border: 1px solid var(--line); background: var(--card-2, var(--card));
  border-radius: 12px; padding: 12px 14px; margin-top: 10px;
  color: var(--ink); font: inherit; cursor: pointer; text-align: left;
}
.nav-opt:hover { border-color: var(--accent); }
.nav-opt .no-ico { width: 22px; height: 22px; flex: none; color: var(--accent); }
/* ⚠ Column, not inline: the first rows with SUB-LABELS arrived 08-13-2026
   (Join room, Leave) and rendered "Join roomWith a room code" — the spans
   sat inline because nothing stacked them. Home/Account never showed it
   (no sub). Measured on the rig the same night. */
.nav-opt .no-txt { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; text-align: left; }
.nav-opt .no-label { font-weight: 700; font-size: 0.92rem; }
.nav-opt .no-sub { font-size: 0.72rem; color: var(--ink-soft); margin-top: 1px; }
/* The pin beside "keep me signed in" (board pick, 08-07-2026).
   ⚠ UNUSED since 08-16-2026 — founder: "lets not use this icons for now",
   and the glyph was removed from the label markup. The rule stays on
   purpose so the icon can return by re-adding the SVG alone. */
.tog-ico { width: 15px; height: 15px; flex: none; color: var(--accent); }

/* ── The account Profile's two fields — FOUND ON A PHONE 08-07-2026 ──────
   Founder, with the keyboard up in the rebuilt Profile tab: "now screen
   zooms with keyboard up. another trap we have already pointed out several
   times before." He is right, and it was self-inflicted: #profEmailInput was
   added THAT AFTERNOON at 0.85rem — 13.6px, under iOS Safari's 16px zoom
   threshold — in a block modelled on #profNameInput, which had the same
   size for the same reason.

   Both are raised here, and ONLY these two. #profNameInput was on the
   "leave alone until its surface gets a device pass" list above; that pass
   is what this evening was, and the surface around it (the account cards)
   was rebuilt the same day, so its heights were being re-checked anyway.
   Every other small input in that list is untouched — their surfaces are
   still device-tested and working (founder, 08-03: "only change for this
   dialog and don't touch others that we have previously tested").

   ⚠ ADDED alongside, never merged — see CLAUDE.md "do not touch what is
   confirmed working". */
#profEmailInput, #profNameInput { font-size: 16px; }
/* ⚠ PLACED AT THE END DELIBERATELY. Both fields have their own ID rules
   earlier in this file (the .acct-sec profile block), and ID-vs-ID is
   settled by ORDER, not weight — the first attempt sat beside the
   #modalEmailInput fix and measured no change at all: still 13.6px.
   Same shape as the .leave-card cap fixed an hour earlier tonight: a
   correct rule, in a place where something else already won.
   Measure, never assume: getComputedStyle(el).fontSize must read 16px. */

/* ---- Session passes (08-13-2026): the quiet opt-in line -------------
   Under "Start a new room" and under the invite card's join button.
   Chips, never a dialog: one tap arms, one disarms. The armed chip takes
   the brand lime with the on-lime ink — the same pairing as the primary
   button it sits beneath, in both themes (see the lime rule). The line
   is invisible whenever the balance is zero, so most people never meet
   it until a pass exists to spend. */
/* ⭐ Breathing room above the chooser (founder, §5, 08-13-2026): the line
   sat too close under the Start button. ADDED margin, nothing moved. */
.pass-offer { margin: 14px 0 2px; text-align: center; }
.pass-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; }
.pass-lead { font-size: 0.86rem; color: var(--ink-soft); }
.pass-seg {
  font: inherit; font-size: 0.82rem; letter-spacing: 0.04em;
  padding: 5px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  cursor: pointer;
}
.pass-seg.armed { background: var(--lime); border-color: var(--lime); color: var(--on-lime); font-weight: 600; }
.pass-hint { margin: 6px 0 0; font-size: 0.82rem; color: var(--ink-soft); }

/* ---- Complete your account (tester expansion Q3, 08-14-2026) ----------
   The one step between a verified sign-in and the account sheet. It lives
   in the .leave-modal family, so the keyboard contract is inherited:
   container bound to --vvh with its own scroll + overscroll-behavior, card
   capped at --vvh - 40px (the container's 20px padding ×2). */
.pg-phone-note { text-align: left; margin: -6px 0 14px; }
.pg-news { margin: 0 0 16px; }
#profileGate .field input { width: 100%; }
/* ⚠ iOS zoom: BOTH fields at 16px computed — the same rule class as
   #modalEmailInput above. type="text" + inputmode="tel" for the phone
   field, deliberately: type="tel" matches no base input rule (the exact
   fault #memberEmail shipped with) while type="text" inherits the shared
   styling, and inputmode still raises the phone keypad. */
#profileGateName, #profileGatePhone { font-size: 16px; }

/* ---- The 08-15-2026 profile round -------------------------------------
   First/last on one row, the stated display-name line, and the country +
   number pair. Used by BOTH the gate and the Profile tab's "Your details",
   so the two surfaces cannot drift apart visually.
   ⚠ EVERY new field carries font-size:16px explicitly. Below 16px iOS
   Safari zooms the page on focus and never restores the scale, which then
   reads as a second, phantom layout bug. Three fields have shipped with
   this fault already (08-03, 08-04, 08-07). */
.pg-namerow { display: flex; gap: 10px; }
.pg-namerow .field { flex: 1 1 0; min-width: 0; margin-bottom: 12px; }
.pg-namerow .field input { width: 100%; }
/* The stated outcome, with its way out beside it. Wraps on a narrow phone
   rather than squeezing the button off the edge. */
.pg-shown {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 12px;
  /* ⚠ --card, not an invented token. `--bg-soft` and `--lime-soft` were
     written here first and neither exists in this stylesheet; an undefined
     custom property with no fallback renders as nothing, so the panel would
     have been a transparent box in both themes. Checked, not assumed. */
  background: var(--card);
}
.pg-shown-line { margin: 0; flex: 1 1 auto; font-size: 0.86rem; color: var(--ink); text-align: left; line-height: 1.45; }
.pg-shown-line strong { color: var(--ink); font-weight: 700; }
.pg-phonerow { display: flex; gap: 8px; }
.pg-phonerow input { flex: 1 1 auto; min-width: 0; }
/* The country select is deliberately narrow: it shows "United States (+1)"
   but only needs to READ as a picker, and the number is what people check. */
.pg-cc {
  flex: 0 0 38%; max-width: 38%; min-width: 0;
  font-size: 16px;
  padding: 10px 8px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
}
#profileGateFirst, #profileGateLast, #profileGateDisplay, #profileGatePhone,
#profFirstInput, #profLastInput, #profDisplayInput, #profPhoneInput { font-size: 16px; }
/* The convenience explainer's two blocks. */
.conv-item { text-align: left; margin: 0 0 14px; }
.conv-head { font-weight: 700; font-size: 0.9rem; color: var(--ink); margin-bottom: 4px; }
/* 08-16-2026 (founder): the two item paragraphs read LEFT-justified. The
   global .member-fine centering beat the .conv-item inheritance because it
   sits on the <p> itself; this ADDS a more specific rule beside it rather
   than touching the shared one. */
.conv-item .member-fine { text-align: left; }
/* ── Save details: the success checkmark (founder, 08-16-2026) ──────────
   A tick beside the button instead of the word "Saved." — failures stay
   text in #profDetailsMsg. */
/* ⭐ THE BUTTON IS CENTRED, AND STAYS PUT WHEN THE TICK APPEARS (founder,
   08-18-2026). A flex row with justify-content: center would have centred
   button+tick TOGETHER, so the button would jump ~14px left the moment a
   save succeeded — the control moving under the thumb that just pressed it.
   A three-column grid, 1fr auto 1fr, centres the MIDDLE column by
   arithmetic: the two fr tracks always take an equal share of what is left,
   so the button's centre is the row's centre whatever column 3 holds, and
   whether or not it holds anything. Measured both ways, hidden and shown:
   identical to the pixel.
   ⚠ The 8px that used to be `gap` is still `gap`, and it stays symmetric,
   which is why the arithmetic survives it. */
.pg-saverow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.save-tick { color: var(--accent); line-height: 0; }
.save-tick .ci { width: 20px; height: 20px; }
#profDetails .acct-block { gap: 10px; }
#profDetailsSaveBtn { grid-column: 2; align-self: center; margin-top: 2px; }
#profDetailsSavedTick { grid-column: 3; justify-self: start; }

/* ── Displayed Name: the hint reads on the LABEL line (founder, 08-18-2026) ──
   ADDED beside `.field span` (:541) and `.field-hint` (:4669), never in
   place of either — both are shared by every field in the app, and the four
   other Displayed Name labels (index.html:765, :960, :1088, :1613) are
   deliberately untouched. Everything here is scoped to #profDisplayWrap.
   Inline, not flex: ordinary text flow is what lets "DISPLAYED NAME (How
   others will see you in rooms.)" break mid-sentence on a 375px phone
   instead of standing as two rigid columns. */
#profDisplayWrap .pg-labelrow { margin-bottom: 6px; }
#profDisplayWrap .pg-labelrow > span { display: inline; margin-bottom: 0; }
#profDisplayWrap .pg-labelrow > .field-hint { display: inline; margin-top: 0; }

/* ── The dashboard button on the Account panel (founder, 08-18-2026) ──────
   It now MATCHES the start page's own dashboard button — same lime outline
   tier (.btn.entry) and the same calendar glyph — so the two read as one
   control in two places rather than two different things.
   ⚠ It is NOT .wide-btn. The founder asked for about three quarters of the
   width, not the full-bleed the start page uses: on the start page that
   button is the primary act of the screen, inside the Account panel it is
   one row among several, and full width would outrank the rows around it.
   display:block is what makes `margin: auto` centre it — a <button> is
   inline-block by default, where auto side margins do nothing. */
#acctDashRow {
  display: block;
  width: 75%;
  margin: 10px auto 0;
  font-size: 0.85rem;
}

/* ---- Change membership (tester expansion Q2, 08-14-2026) --------------
   The three tiers as quiet rows under the Change membership button; the
   current one is marked and inert, the other two carry a small action.
   Confirm + result copy is app.js's; this is only the dress. */
#changeTierArea { margin-top: 14px; }
.tier-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.tier-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--card);
}
.tier-row-name { font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; color: var(--ink); }
.tier-row-now { font-size: 0.72rem; color: var(--ink-faint); }
.tier-row.current { border-color: var(--accent); }
.tier-row .btn { flex: none; }

/* ---- Tier cards (08-15-2026) -------------------------------------------
   The shared component behind the sign-up chooser (#memberTierCards in the
   member gate), the upgrade dialog and the account sheet's change-membership
   list — renderTierCards() in app.js. ADDED alongside the .tier-row rules
   above, which stay untouched (the widening rule: add, never move); the
   cards reuse .tier-row-name / .tier-row-now for the name and the current
   marker so the two dress alike. No scrolling here — the cards stack inside
   containers that already scroll (.tos-card, .member-card), each of which
   carries its own overscroll-behavior beside its overflow-y.
   ⚠ Buttons are .btn.small (outline), never .primary: three equal choices
   means NO lime primary among them (founder hierarchy rule — at most one
   lime primary per screen). */
.tier-cards { display: flex; flex-direction: column; gap: 8px; margin-top: 2px; }
.tier-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); text-align: left;
}
.tier-card.current { border-color: var(--accent); }
/* ⭐ THE MEMBERSHIP GLYPH ON A CARD (founder, 08-21-2026): above the name,
   left-aligned with it, because .tier-card is a column flex with
   align-items: flex-start and the icon is simply its first child.
   ⚠ 26px, matching #acctTierBadge rather than the header badge's 20px. These
   cards are a chooser — the glyph is being READ here, not glanced at beside a
   name — and 26px against .tier-row-name's 0.85rem is the same ratio the
   account sheet already uses.
   ⚠ colour: var(--accent) supplies `currentColor` for the glyph's primary
   artwork; the secondary artwork carries var(--ink-faint) on its own.
   ⛔ It does NOT match .tier-row-name, which is var(--ink) (:5631) — an
   earlier version of this comment claimed it did, and that was wrong. The
   pairing is deliberate: an accent glyph over an ink name, the same way this
   screen's ✓ marks and .member-benefits bullets already sit in accent beside
   ink text. Do not "fix" it by moving the glyph to --ink; that would remove
   the card's only colour. */
.tier-card-ico { display: block; color: var(--accent); line-height: 0; }
/* ⭐ 26px -> 40px (founder, 08-23-2026). The tier chooser is one of three
   surfaces where all three glyphs sit together, and the new family tells the
   tier by WHERE THE SPARK SITS relative to the bubble — inside low, inside
   centred, on the horizon. Measured: that ladder is legible from 32px and
   not below; these cards are full-width and stacked, so they carry 40.
   ⛔ Size carries NO meaning here: every tier is drawn the same size, on the
   founder's instruction. Position is the signal, never scale. */
.tier-card-ico svg.ci { width: 40px; height: 40px; display: block; }
.tier-card .tier-card-line { margin: 0; font-size: 0.8rem; color: var(--ink-soft); line-height: 1.5; }
.tier-card .btn { flex: none; }
/* ⏳⏳ TEMPORARY — THE MEMBERSHIP PRICE ON A CARD (founder, 08-18-2026).
   ⛔ REMOVE THESE TWO RULES when billing/payment is set up. Full removal
   list: docs/MEMBERSHIP_PRICE_DISPLAY.md.

   ⚠ ADDED ALONGSIDE .member-price (:809), never a change to it. That rule
   was kept "for its return" when the $9.99/mo display was removed on
   08-14-2026 and is still untouched and still free for its original use —
   a single large price on a pitch card. This only says what the same
   element should look like INSIDE a tier card, where a 1.9rem number would
   be more than twice the size of the membership name above it (.tier-row-name
   is 0.85rem, :5476) and would read as the loudest thing on the screen.
   The ⛔ block at the top of CLAUDE.md: add beside the working rule, do not
   move it.

   ⚠ Both selectors are (0,2,0) against .member-price's (0,1,0), so they win
   on specificity and do NOT depend on source order.
   ⚠ Colour and weight are deliberately inherited from .member-price, so the
   price keeps one appearance everywhere and only its scale changes. */
.tier-card .member-price { font-size: 1.15rem; line-height: 1.2; }
.tier-card .member-price span { font-size: 0.72rem; }

/* ═══════════════ THE DASHBOARD + THE DOOR (08-18-2026) ═══════════════
   docs/planning/DASHBOARD_DESIGN_2026-08-18.md · DOOR_DESIGN.md §13.
   Paid-only surfaces (shown only by the isPaid-gated schedDash module).
   Everything below is ADDED — no existing rule is widened or moved.
   ⚠ Keyboard contract (rule 9): these overlays hold text inputs, so the
   wrap binds to var(--vvh) — never inset:0, never 100dvh — and every
   scroll container carries overscroll-behavior IN THE SAME block. */

.dash-wrap {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--vvh, 100dvh);
  z-index: 55; /* over .viewer (50), under .leave-modal dialogs (60) */
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
}
.dash-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px calc(10px);
  padding-top: calc(10px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.dash-title {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dash-title .ci { color: var(--accent); flex: none; }
.dash-bar-spacer { min-width: 44px; } /* balances the back chip so the title centres */
/* Tap targets in this bar. The shared .chip lands at 32-34px tall, under
   the 44px floor this project has already measured against once (the
   #displayBtn note in the header block). ⛔ ADDED here, scoped to the
   dashboard bar — the shared rule is not touched. A button centres its
   own content box, so min-height alone keeps icon and label centred. */
.dash-bar .chip { min-height: 44px; min-width: 44px; }
.dash-bar #dashDisplayBtn { width: 44px; padding: 0; }

.dash-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain; /* page-level container → contain (check-scroll.js) */
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

/* ---- the lead line and the two tabs (08-18-2026) ---------------------
   ⛔ The tab bar organises; it never hides anything imminent. "Opening
   soon" and "At your door" live on the first pane by construction. */
.dash-lead {
  margin: 0 0 14px;
  font-size: 0.86rem;
  line-height: 1.6;
  color: var(--ink-soft);
}
.dash-tabs {
  display: flex;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 2;
  /* the body's own padding-top is 16px: reclaim it so nothing shows above
     the sticky bar as it pins, then give the bar its own breathing room */
  margin: -16px -2px 14px;
  padding: 12px 2px 10px;
  background: var(--bg);
}
.dash-tab {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
}
.dash-tab .ci { width: 16px; height: 16px; flex: none; }
.dash-tab.on {
  border-color: var(--lime);      /* the brand colour, never --accent (rule 14) */
  border-width: 1.5px;
  background: var(--accent-soft);
  color: var(--ink);
}
.dash-tab.on .ci { color: var(--lime); }
body.light .dash-tab.on .ci { color: var(--accent-deep); }

/* The display-mode panel: one row, built by the SAME code as the Settings
   dialog (appendDisplayModeRow), so the two can never disagree. */
.dash-display-panel {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--line);
  padding: 2px 16px 10px;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

/* ---- section cards: one visual family for every dashboard block ------ */
.dash-sect {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  padding: 14px 16px;
  margin: 0 0 14px;
}
.dash-sect > h3 {
  margin: 0 0 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 8px;
}
/* ⚠ NOT 1em. The heading is 0.72rem, so 1em drew these at ~11px, where a
   2.6-weight 48-box glyph turns to mush. Sized in px and measured at 15. */
.dash-sect > h3 .ci { color: var(--accent); width: 15px; height: 15px; flex: none; }
.dash-empty {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.9rem;
  line-height: 1.55;
  padding: 26px 18px;
}

/* ---- the week ahead: a drawn strip, not a table ---------------------- */
.dash-week { margin: 2px 0 16px; }
.dash-week svg { display: block; width: 100%; height: auto; }

/* ---- rows (requests, upcoming, kept) --------------------------------- */
.dash-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-top: 1px solid var(--line);
  min-height: 48px; /* tap-target floor, prefer 48 over 44 */
}
.dash-row:first-of-type { border-top: 0; }
.dash-row .dr-main { flex: 1 1 auto; min-width: 0; }
.dash-row .dr-who {
  font-weight: 650;
  font-size: 0.92rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-row .dr-who .member-mark { margin-left: 6px; }
.dash-row .dr-when {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.dash-row .dr-when b { color: var(--accent); font-weight: 700; }
.dash-row.cancelled .dr-who { text-decoration: line-through; color: var(--ink-faint); }
.dash-row.cancelled .dr-when { color: var(--ink-faint); }
.dr-note { font-size: 0.78rem; color: var(--ink-soft); line-height: 1.5; margin: 6px 0 0; }
.dr-actions { display: flex; gap: 6px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }

/* The row's way into its room. Entry tier: lime OUTLINE (var(--lime),
   never var(--accent) — rule 14), like Join/Schedule.
   ⚠ SIZE IS DELIBERATE, not inherited: this is the one control on a row
   a person is actually trying to hit, often one-handed and often in a
   hurry, so it carries a 44px target of its own rather than relying on
   the row's 48px min-height, which the button does not fill. */
.btn.doorway {
  width: auto;
  padding: 11px 18px;
  min-height: 44px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
  border-color: var(--lime);
  border-width: 1.5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.btn.doorway .ci { color: var(--lime); }
body.light .btn.doorway .ci { color: var(--accent-deep); }
.btn.doorway[disabled] { opacity: 0.55; border-color: var(--line); }
.btn.doorway[disabled] .ci { color: var(--ink-faint); }

/* Quiet secondary actions on a row (decline, another time, cancel…).
   One step down from the way in, and deliberately the SAME size as each
   other so no second action looks more urgent than another. */
.btn.dr-quiet {
  width: auto;
  padding: 9px 14px;
  min-height: 38px;
  font-size: 0.78rem;
  white-space: nowrap;
  border-radius: 999px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn.dr-quiet .ci { width: 14px; height: 14px; flex: none; color: var(--ink-soft); }
/* The chosen one in a group of quiet buttons (the sort row). Brand colour,
   the same mark the tabs use, so "chosen" looks the same everywhere. */
.btn.dr-quiet.on { border-color: var(--lime); border-width: 1.5px; color: var(--ink); }

/* Inline reveal for picking a time (counter / rebook) — appears inside
   the row's card; the input must render ≥16px or iOS zooms (rule 9a). */
.dash-pick { display: flex; gap: 8px; align-items: center; margin: 8px 0 2px; flex-wrap: wrap; }
.dash-pick input[type="datetime-local"] {
  flex: 1 1 200px;
  min-width: 0;
  font-size: 16px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
}

/* ---- the settings block ---------------------------------------------- */
.dash-set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 2px;
  border-top: 1px solid var(--line);
  min-height: 48px;
}
.dash-set-row:first-of-type { border-top: 0; }
.dash-set-label { font-size: 0.88rem; font-weight: 600; }
.dash-set-sub { font-size: 0.74rem; color: var(--ink-soft); margin-top: 2px; line-height: 1.45; }
.dash-choice { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 2px; }
.dash-choice label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px 13px;
  cursor: pointer;
  font-size: 0.84rem;
  line-height: 1.5;
}
.dash-choice label:has(input:checked) { border-color: var(--accent); }
.dash-choice input { margin-top: 3px; flex: none; }
.dash-choice b { display: block; font-size: 0.88rem; }
.dash-choice .dc-fine { color: var(--ink-soft); font-size: 0.78rem; }
.dash-link {
  background: none; border: 0; padding: 0;
  color: var(--accent);
  font: inherit; font-size: 0.8rem;
  text-decoration: underline;
  cursor: pointer;
}

/* ---- the lock gate ---------------------------------------------------- */
.dash-lock {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 100%;               /* the wrap is already vvh-bound */
  background: var(--bg);
  z-index: 3;
  display: flex;
  align-items: flex-start;    /* never center an overflowing flex child */
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 24px 20px;
}
.dash-lock-card {
  margin: auto;
  width: min(320px, 100%);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-lock-card h3 { margin: 0; font-size: 1.05rem; }
.dash-lock-glyph { width: 34px; height: 34px; margin: 0 auto; color: var(--accent); }
.dash-lock-card input {
  font-size: 16px;            /* iOS zoom floor */
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.2em;
  font-family: inherit;
}
.dash-lock-err { color: #f87171; font-size: 0.8rem; margin: 0; }
.dash-lock-fine { color: var(--ink-faint); font-size: 0.74rem; line-height: 1.5; margin: 0; }
.dash-bio-row { display: flex; gap: 8px; align-items: center; font-size: 0.82rem; text-align: left; }

/* ---- dialogs' shared bits --------------------------------------------- */
.dash-p { font-size: 0.86rem; line-height: 1.6; color: var(--ink-soft); text-align: left; margin: 10px 0; }
.dash-p b { color: var(--ink); }
.leave-keeplog {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  cursor: pointer;
}
.leave-keeplog input { margin-top: 2px; flex: none; }
.device-art { margin: 4px 0 2px; }
.device-art svg { display: block; width: 100%; height: auto; }

/* ---- the door page ---------------------------------------------------- */
.door-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  padding: 18px;
  margin: 0 0 14px;
}
.door-card h2 { margin: 0 0 6px; font-size: 1.1rem; }
.door-lead { font-size: 0.88rem; color: var(--ink-soft); line-height: 1.55; margin: 0 0 8px; }
.door-form { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.door-form input[type="text"] {
  font-size: 16px;            /* iOS zoom floor */
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
}
.door-form input[type="datetime-local"] {
  font-size: 16px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
}
.door-share-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.door-share-row .btn { width: auto; flex: 1 1 40%; font-size: 0.82rem; padding: 10px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.door-fine { font-size: 0.76rem; color: var(--ink-faint); line-height: 1.55; margin: 8px 0 0; }
.door-state {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--ink-soft);
}
.door-state .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); flex: none; }
.door-state.open .dot { background: var(--lime); }

/* ---- the tidy card (§10: in the flow, dismissible, never a modal) ----- */
.dash-tidy-card { border-color: var(--accent-soft); }

/* ---- the one card that is about RIGHT NOW. It wears the brand colour
   (var(--lime), rule 14 — never var(--accent), which is olive on white)
   because it is the only thing on the screen with a clock running. ---- */
.dash-soon-card {
  border-color: var(--lime);
  border-width: 1.5px;
}

/* ---- guide typography -------------------------------------------------- */
.guide-sect { margin: 0 0 22px; }
.guide-sect h3 { font-size: 0.95rem; margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.guide-sect h3 .ci { color: var(--accent); }
.guide-sect p, .guide-sect li { font-size: 0.86rem; line-height: 1.65; color: var(--ink-soft); }
.guide-sect ol, .guide-sect ul { padding-left: 20px; margin: 6px 0; }
.guide-sect b { color: var(--ink); }
.guide-note { font-size: 0.76rem; color: var(--ink-faint); border-left: 3px solid var(--line); padding-left: 10px; }

/* Hovers only where hover exists — iOS keeps :hover after a tap. */
@media (hover: hover) {
  .btn.doorway:hover { border-color: var(--lime-deep); }
  .btn.dr-quiet:hover { border-color: var(--accent); }
  .dash-link:hover { color: var(--accent-deep); }
  .dash-tab:hover { border-color: var(--accent); color: var(--ink); }
}

/* ---- print: the kept list as a clean sheet (the codebase's FIRST
   @media print — greenfield, verified absent 08-18-2026). The browser's
   own "Save as PDF" is the PDF path (§11): no library, themed by us. --- */
@media print {
  body > *:not(#dashPrint) { display: none !important; }
  #dashPrint { display: block !important; }
}
#dashPrint { display: none; }
#dashPrint .pr-head { font-family: 'Fraunces', Georgia, serif; font-size: 22px; margin: 0 0 2px; }
#dashPrint .pr-sub { color: #555; font-size: 12px; margin: 0 0 18px; }
#dashPrint table { width: 100%; border-collapse: collapse; font-size: 13px; }
#dashPrint th { text-align: left; font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #777; padding: 6px 8px; border-bottom: 1.5px solid #222; }
#dashPrint td { padding: 7px 8px; border-bottom: 1px solid #ddd; }
#dashPrint .pr-foot { margin-top: 16px; font-size: 10px; color: #999; }

/* Native controls in the dashboard wear the brand accent, not the OS blue. */
.dash-choice input, .dash-row input[type="checkbox"], .leave-keeplog input, .dash-bio-row input { accent-color: var(--lime); }

/* The lock-setup dialog's fields — 16px is the iOS zoom floor (rule 9a).
   Scoped by ID and ADDED, never merged into the gate's rule. */
#dashLockSetup input[type="password"] {
  font-size: 16px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.2em;
  font-family: inherit;
  width: 100%;
  margin-top: 8px;
}

/* ── Show / hide password reveal (docs/SHOW_PASSWORD_AFFORDANCE.md) ────────
   The dashboard code fields (#dashLockInput, #dashLockNew, #dashLockNew2)
   each carry a control that reads the WORD "Show" and flips to "Hide" while
   the value is visible — never an icon. Reveal flips the field to type=text
   and is a rendering state ONLY (never logged, sent or stored). The one
   shared helper wirePwReveal() in public/app.js drives these three and the
   front gate, so the behaviour cannot drift.
   ⚠ The wrapper only anchors the absolute control; it adds NO flow height, so
   the #dashLockSetup .leave-card scroll cap (rule 9a) is unaffected. */
.pw-wrap { position: relative; display: block; }
.pw-wrap > input { width: 100%; }
.pw-reveal {
  position: absolute;
  top: 0; right: 6px; height: 100%;
  display: flex; align-items: center;
  background: none; border: 0; margin: 0; padding: 0 8px;
  font: inherit; font-size: 0.8rem; font-weight: 600;
  color: var(--ink-soft); cursor: pointer; border-radius: 6px;
  -webkit-appearance: none; appearance: none;
}
.pw-reveal:hover { color: var(--ink); }
.pw-reveal:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* Reserve room for the control on the RIGHT only. Symmetric padding kept the
   short typed code dead-centre but ate the long "Choose a code (4+ digits)"
   placeholder, hiding the length hint the field exists to give — which works
   against the whole point of the reveal. Right-only keeps that hint readable;
   a short typed code sits a hair left of centre, which is cosmetic only. */
.dash-lock-card .pw-wrap > input,
#dashLockSetup .pw-wrap > input { padding-right: 54px; }

/* Space the two setup fields via the WRAPPER, not the input, so the control
   (anchored to the wrapper) lines up with the input regardless of margins. */
#dashLockSetup .pw-wrap { margin-top: 8px; }
#dashLockSetup .pw-wrap > input { margin-top: 0; }

/* The revealed (type=text) twin of the setup fields. #dashLockSetup styles its
   fields via input[type="password"], which stops matching once revealed, so
   the SAME box is restated here (ADD alongside, never a merge). #dashLockInput
   is styled by .dash-lock-card input (a class, matches either type), so it
   needs no twin. */
#dashLockSetup .pw-wrap > input[type="text"] {
  font-size: 16px;
  padding: 11px 54px 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.2em;
  font-family: inherit;
  width: 100%;
}

/* Narrow screens: the action cluster drops BELOW the row's text instead of
   crushing the timestamp into one word per line. */
@media (max-width: 480px) {
  .dash-row { flex-wrap: wrap; }
  .dash-row .dr-main { flex: 1 1 100%; }
  .dash-row .dr-actions { width: 100%; justify-content: flex-start; }
  /* …EXCEPT the select box on a kept row, which belongs BESIDE the name it
     selects. Left to wrap it took a line of its own and read as a control
     for the whole list rather than for that one meeting. */
  /* ⚠ margin, not margin-top: the UA gives a checkbox 3-4px of side margin,
     which pushed 20+10 past the 32px reserved below and wrapped it anyway. */
  .dash-row > input[type="checkbox"] { align-self: flex-start; margin: 13px 0 0; width: 20px; height: 20px; }
  .dash-row > input[type="checkbox"] + .dr-main { flex: 1 1 calc(100% - 32px); }
}

/* One-line dashboard notice (08-18-2026). Scoped to the dashboard; nothing
   shared is touched. */
.dash-notice {
  margin: 0 0 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  color: var(--fg);
  font-size: 0.9rem;
  line-height: 1.45;
}


/* The two-photo chooser (08-19-2026). Side by side so the choice is made by
   looking; stacks on a narrow phone rather than shrinking the faces to
   thumbnails. ⛔ `overscroll-behavior: none` because the card is the scroller
   and its own bounce would slide it under the buttons (check-scroll.js). */
.photo-choice-pair {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 12px 0 16px;
  flex-wrap: wrap;
}
/* Each picture owns its own button, so the choice is made by pointing at a
   face rather than by decoding which of "account" and "device" is which. */
.photo-choice-one { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.photo-choice-one .btn { padding: 6px 14px; font-size: 0.8rem; }
.photo-choice-cap { font-size: 0.72rem; color: var(--ink-faint); }
.photo-choice-img {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--bg);
}

/* ── The Door: visit reasons (DOOR_DESIGN #30/#31, 08-20-2026) ──────────────
   Jane's own list on her dashboard, and what a visitor sees at her door.
   ⚠ ONE ROW PER REASON. The first cut gave every reason three full-width
   blocks — field, tick, Remove — so four reasons read as twelve stacked
   things. The field and its remove now share a line, and the tick hangs under
   them as a property OF that reason. */
.door-reasons { margin-top: 16px; }
.door-reason-rows { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 4px; }
.door-reason-row {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px 12px;
}
.drr-top { display: flex; align-items: center; gap: 8px; }
/* 16px or iOS zooms the page on focus and never restores the scale. */
.drr-top input[type="text"] { flex: 1 1 auto; min-width: 0; font-size: 16px; }
/* The remove is a glyph, not a full-width button competing with Save. */
/* ⚠ TRANSPARENT, NOT THEMED-DARK. .btn carries a fixed dark fill, so in light
   mode this drew a near-black circle with a near-black glyph on a white row:
   measured background rgb(22,22,22) against colour rgb(17,17,17), i.e. an
   invisible control. It inherits the row instead, in both themes. */
.drr-x {
  flex: 0 0 auto; width: 38px; height: 38px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; opacity: 0.6;
  background: transparent; border-color: transparent; color: inherit;
}
.drr-x:focus-visible { border-color: var(--accent); }
.drr-x:hover { opacity: 1; background: transparent; color: var(--danger, #f87171); }
.drr-x .ci { width: 18px; height: 18px; }
.drr-tog { display: flex; align-items: flex-start; gap: 8px; padding-left: 2px; font-size: 0.88rem; opacity: 0.9; }
.drr-tog .ci { width: 16px; height: 16px; vertical-align: -2px; margin-right: 6px; }
.drr-acts { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.drr-add .ci { width: 16px; height: 16px; margin-right: 6px; vertical-align: -3px; }
.drr-msg { margin-top: 8px; }
.drr-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.door-starters { margin-top: 16px; }
/* The two notices #30 required, and the guidance under a starter set. Marked
   with a rule and the door glyph rather than shouted. */
.door-warn, .door-guide {
  display: flex; gap: 10px; align-items: flex-start;
  border-left: 3px solid var(--accent); border-radius: 0;
  padding: 2px 0 2px 12px; margin: 10px 0;
  font-size: 0.88rem; opacity: 0.9; text-align: left;
}
.door-guide { border-left-color: var(--line); }
.door-warn .ci, .door-guide .ci { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; opacity: 0.8; }
/* #31, on every door: a request may not be seen quickly. */
.door-urgent { border-left: 3px solid var(--accent); padding-left: 12px; border-radius: 0; }
.door-fam { margin-top: 8px; }
.door-fam input, .door-reason-text input { font-size: 16px; width: 100%; }
.door-reason-text { margin-top: 8px; }

/* ⭐ THE DOOR'S REASON CHIPS (08-30-2026) — the design board's Door, built.
   ⛔ What they replace was a bare <select>: `appearance: auto`, so it rendered
   as a WHITE slab on the dark card, and MEASURED 22px tall against this
   project's 44px minimum tap target. Both faults were invisible at desktop
   width and unmissable on a phone — which is why the rule is to look at it at
   phone size, not to reason about it in source.
   One tap here replaces a tap plus an OS picker sheet. */
.door-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.door-chip {
  min-height: 44px;              /* the floor, not a suggestion */
  padding: 10px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  transition: border-color .12s, background .12s, color .12s;
}
.door-chip:hover { border-color: var(--lime); }
.door-chip:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
/* Chosen: the house lime, with dark ink on it so it reads in both themes. */
.door-chip[aria-checked="true"] {
  background: var(--lime);
  border-color: var(--lime);
  color: #111111;
}
@media (prefers-reduced-motion: reduce) { .door-chip { transition: none; } }
.dr-reason { font-size: 0.92rem; opacity: 0.85; margin-top: 2px; }
/* ⚠ iOS zooms any focused control under 16px and never restores the scale,
   which reads afterwards as a second, phantom layout bug. The picker is a
   select, and selects were not covered by the sweep that fixed text fields. */
.door-form select { font-size: 16px; width: 100%; }

/* ── "In rooms, others will see you as X" (08-20-2026, all four name boxes) ──
   A statement of outcome under the box. The label above is a noun phrase and
   the placeholder is invisible whenever the box is filled, so this is the only
   thing that actually says what the other person will see. */
.name-shown { font-size: 0.88rem; opacity: 0.8; margin: 6px 0 0; text-align: left; }
.name-shown b { opacity: 1; font-weight: 600; }
.prof-door-note { margin-top: 4px; }

/* ========================= PROFILE PHOTO — CROP ==========================
   ⭐ Added 08-20-2026. The crop screen every photo passes through, taken or
   chosen. Markup and the reasoning for "always, not on demand" are in
   index.html at #cropModal.

   It reuses .leave-modal and .leave-card, which is not laziness: those two
   already carry the whole keyboard and overscroll contract, and the cap
   arithmetic (--vvh minus the modal's 20px padding TWICE) is recorded on
   .leave-card. A hand-rolled overlay would have re-earned every one of those
   bugs.
   ⚠ No text field lives here, so a software keyboard cannot open ON this
   dialog. --vvh still matters, because a short desktop window is the same
   arithmetic, which is why the stage is sized from it below. */

/* The stage is bound to the VISIBLE viewport, so the card fits without the
   action row falling below the fold. Measured at --vvh 320 the stage is
   160px and the whole card still resolves; at a normal phone height it is
   the full 294px. */
.crop-card {
  --crop-stage: clamp(160px, calc(var(--vvh, 100dvh) - 300px), 294px);
  text-align: left;
  padding-bottom: 0;             /* the sticky action row supplies the bottom */
}
.crop-card > h2 { margin: 0 0 4px; font-size: 1.02rem; text-align: left; }
.crop-sub { margin: 0 0 14px; font-size: 0.8rem; color: var(--ink-soft); line-height: 1.45; }

.crop-stage {
  position: relative;
  width: var(--crop-stage);
  height: var(--crop-stage);
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #0d0d0d;           /* deliberately theme-invariant: it is the
                                    letterbox behind a photo, not a surface */
  cursor: grab;
}
.crop-stage:active { cursor: grabbing; }
#cropCanvas {
  display: block;
  width: 100%;
  height: 100%;
  /* ⛔ LOAD-BEARING, BOTH OF THESE.
     touch-action: none — without it the browser claims the drag to scroll the
     page and claims the pinch to zoom the whole page, and neither gesture ever
     reaches us.
     -webkit-user-drag / user-select — on DESKTOP a click-drag otherwise starts
     the browser's native image drag and the photo tears away from the cursor
     instead of panning. app.js also cancels dragstart; belt and braces. */
  touch-action: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  outline: none;
}
#cropCanvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* The circle is the whole point of the screen: it says what will be kept.
   Drawn as an overlay rather than a canvas clip so the person can see the
   parts they are about to lose. */
.crop-mask { position: absolute; inset: 0; pointer-events: none; }
.crop-mask::before {
  content: ""; position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  -webkit-mask: radial-gradient(circle at 50% 50%, transparent 0 calc(50% - 8px), #000 calc(50% - 7px));
  mask: radial-gradient(circle at 50% 50%, transparent 0 calc(50% - 8px), #000 calc(50% - 7px));
}
.crop-mask::after {
  content: ""; position: absolute; inset: 8px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
}

.crop-zoom { display: flex; align-items: center; gap: 10px; margin: 16px 0 2px; }
.crop-step {
  flex: none; width: 32px; height: 32px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%;
  background: none; color: var(--ink-soft);
  font: inherit; font-size: 1.05rem; line-height: 1; cursor: pointer;
}
.crop-step:hover { color: var(--ink); border-color: var(--ink-faint); }

/* ⭐ THE APP'S FIRST <input type="range">, so it is styled from scratch rather
   than inheriting anything — and it is styled from TOKENS, so light and dark
   both come out of the same rules. The track is --line in both themes and the
   thumb is --lime, which is the same value in both by design (see :root).
   ⚠ The input is 24px tall while the TRACK is 4px. That gap is the touch
   target: a 4px-tall control is the classic "it did not respond" report on a
   phone. Keep the height even though the track looks thin. */
.crop-zoom input[type="range"] {
  flex: 1; min-width: 0; height: 24px; margin: 0; padding: 0;
  background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
.crop-zoom input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px; background: var(--line);
}
.crop-zoom input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 20px; height: 20px; margin-top: -8px;
  border: none; border-radius: 50%; background: var(--lime);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.crop-zoom input[type="range"]::-moz-range-track {
  height: 4px; border-radius: 2px; background: var(--line);
}
.crop-zoom input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px;
  border: none; border-radius: 50%; background: var(--lime);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.crop-zoom input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

.crop-hint {
  margin: 8px 0 14px; font-size: 0.74rem; color: var(--ink-faint);
  text-align: center; line-height: 1.45;
}

/* ⭐ PINNED, per the software-keyboard contract's point 4. "Use photo" is the
   one action this screen exists to reach, and on a short window the stage plus
   the slider can push it below the fold. Sticky keeps it reachable without
   taking it out of the card's flow. */
.crop-actions {
  position: sticky; bottom: 0;
  display: flex; gap: 10px;
  padding: 12px 0 calc(16px + env(safe-area-inset-bottom));
  background: var(--card);
}
.crop-actions .btn { flex: 1; }

/* ⭐ The held-message note, docked in the stream (founder, option E,
   08-22-2026 — docs/HELD_NOTE_AND_STREAM_NOTES.md). It is an ordinary
   .sysnote.notice so it inherits the card; these lines only make the tap
   affordance visible. It retires with the next send, like every note. */
.sysnote.held-note.actionable {
  cursor: pointer;
  border-color: var(--lime-soft2, var(--line));
  color: var(--accent);
}
.sysnote.held-note.actionable:hover { text-decoration: underline; text-underline-offset: 2px; }
.sysnote.held-note.actionable:active { transform: scale(0.985); }

/* ⭐ ROOM HAND-OFF (docs/SEATS_HANDOFF_AND_REFUSAL.md): the code card inside
   the nav dialog, and the two start-page bars. The QR sits on white on
   purpose — a scanner wants contrast, not a theme. */
.handoff-code { font: 700 1.7rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.2em; text-align: center; margin: 10px 0 6px; color: var(--accent); user-select: all; }
.handoff-qr { width: 168px; height: 168px; margin: 12px auto 0; background: #fff; border-radius: 10px; padding: 6px; box-sizing: border-box; }
.handoff-qr svg { width: 100%; height: 100%; display: block; }
.handoff-steps p { margin: 0 0 4px; }
.handoff-fine { font-size: 0.78rem; color: var(--ink-soft); margin-top: 6px; }
.handoff-offer { display: flex; flex-direction: column; gap: 8px; }
.handoff-offer-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.handoff-offer-row .rejoin-text { margin: 0; flex: 1 1 200px; }


/* ======================== voice & video calls =========================== */
/* Client of the ephemeral call feature (paid module in app.js). Three
   surfaces, each borrowed from a proven family rather than invented:
     .call-menu   — the attach-menu pattern, anchored to the header
     .call-ring   — the presence-drop pattern: zero-height wrapper, absolute
                    card, so the conversation NEVER moves (the #floatNote rule
                    in MESSAGE_LAYOUT_AND_KEYBOARD.md)
     .call-stage  — the .scanner family: full-bleed camera-dark mode surface,
                    deliberately the same ground in both themes (a camera
                    surface wants black, like the scanner and the viewer)
   None of these is a .leave-modal, deliberately — the ring never blocks the
   room and the stage's one exit is a labelled End; see the markup comments
   and check-dialog-close.js's scope. */

/* --- the chooser menu (video / voice) --- */
.call-menu {
  position: absolute;
  top: 100%;
  right: 12px;
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  z-index: 21;
  /* Same guard pair as .attach-menu: cap against the VISIBLE viewport and
     keep the gesture from chaining out (check-scroll.js). */
  max-height: calc(var(--vvh, 100dvh) * 0.6);
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;   /* see check-scroll.js */
}
.call-menu[hidden] { display: none; }
.call-menu button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  padding: 10px 14px;
  border-radius: 9px;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}
.call-menu button:hover { background: var(--accent-soft); color: var(--accent); }
.call-menu .ci { margin-right: 6px; }

/* --- the incoming-call card (the ring) --- */
/* Zero-height wrapper: presence-drop's construction. z-index 8 stands above
   the header (7) and the presence pane (6) ON PURPOSE — a ring is actionable
   and lives ~45s; the presence pane persists underneath and is intact the
   moment the ring retires. The card FADES/pops rather than sliding from
   behind the header, so standing above the header's stacking level is not a
   broken illusion. Wrapper takes no taps; the card takes them back
   (the presence pane's pointer-events lesson, measured not read). */
.call-ring { position: relative; height: 0; overflow: visible; z-index: 8; pointer-events: none; }
.call-ring[hidden] { display: none; }
.call-ring .cr-card {
  position: absolute; top: 10px; left: 0; right: 0;
  width: fit-content; margin-inline: auto;   /* NEVER left:50% — the fn-pill width-cap trap */
  max-width: min(94%, 440px);
  display: flex; flex-direction: column; gap: 10px;
  padding: 12px 16px;
  background: var(--card);            /* OPAQUE — the 07-31 floated-surface rule */
  color: var(--ink);
  border: 1px solid var(--accent);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(-6px);
  transition: transform 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 200ms ease;
}
.call-ring.showing .cr-card { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) { .call-ring .cr-card { transition: none; } }
.call-ring .cr-line { font-size: 0.92rem; font-weight: 600; text-align: center; }
.call-ring .cr-name { color: var(--accent); }
.call-ring .cr-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.call-ring .cr-btns .btn.small { flex: 0 0 auto; }
.call-ring .cr-decline { color: var(--ink-soft); }

/* --- the live call stage --- */
/* Bound to the VISIBLE viewport (--vvh), never inset:0 / 100dvh — the
   keyboard contract's container rule, so the controls row can never sit
   behind browser chrome or a keyboard. No scroll container here at all:
   the video scales, the bars are fixed rows, nothing overflows by design
   (overflow hidden + overscroll none keep a stray gesture from reaching the
   room behind it). Camera-dark in BOTH themes, like .scanner. z-index 75:
   over the viewer (50) and the scanner (70); any dialog the module raises
   (permission help) is raised only AFTER the stage is torn down. */
.call-stage {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: auto;
  height: var(--vvh, 100%);
  z-index: 75;
  display: flex;
  flex-direction: column;
  background: #0a0a0a;
  color: #f5f5f5;
  overflow: hidden;
  overscroll-behavior: none;
}
.call-stage[hidden] { display: none; }
.cs-bar {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top));
  min-height: 44px;
}
.cs-peer { font-weight: 700; font-size: 0.95rem; }
.cs-status { color: #a3a3a3; font-size: 0.85rem; }
.cs-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cs-remote { width: 100%; height: 100%; object-fit: cover; background: #000; }
.cs-remote[hidden] { display: none; }
/* Voice-only: the house ✦ and the name, centred where video would be. */
.cs-voice { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.cs-voice[hidden] { display: none; }
.cs-mark { font-size: 3rem; color: var(--lime, #C6FF00); }
.cs-voice-name { font-size: 1.1rem; font-weight: 700; color: #f5f5f5; }
/* Local preview: small corner card, mirrored like every self-view. It sits
   INSIDE .cs-body, so the controls row below is never covered. */
.cs-local {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: clamp(84px, 26%, 160px);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid #333;
  background: #000;
  transform: scaleX(-1);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}
.cs-local[hidden] { display: none; }
.cs-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
}
/* Chips on the dark ground — the .scanner .chip treatment, plus a visible
   label under each glyph (a call control must read without hover). */
.call-stage .chip {
  background: #1f1f1f;
  color: #f5f5f5;
  border-color: #333;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 64px;
  min-height: 52px;
  padding: 8px 12px;
  border-radius: 14px;
}
.cs-chip-label { font-size: 0.62rem; letter-spacing: 0.04em; color: #a3a3a3; }
/* An OFF toggle (muted mic / camera off) reads as pressed-out: dim chip,
   lime label naming the state that is IN FORCE. */
.call-stage .chip.cs-off { background: #2c2c2c; border-color: var(--lime, #C6FF00); }
.call-stage .chip.cs-off .cs-chip-label { color: var(--lime, #C6FF00); }
.call-stage .chip.cs-end { background: #dc2626; border-color: #dc2626; color: #ffffff; }
.call-stage .chip.cs-end .cs-chip-label { color: #ffffff; }

/* ⭐ THE DEMOTED VANISH BUTTON (08-30-2026, §9n). In a scheduled room whose
   other person has not arrived, "End the room and let it vanish" must not read
   as the thing to do — it destroys the room the owner is about to walk into.
   ⛔ Not hidden: ending it is still legitimate and must stay reachable. Just
   not dressed as the recommendation. */
.leave-choice.vanish.demoted {
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--ink);
}
.leave-choice.vanish.demoted .lc-label { color: var(--ink); }
/* ⛔ AND THE DESCRIPTION, which is the one I missed on the first pass. It is
   near-black BECAUSE it normally sits on the lime button; on the demoted dark
   card it measured a contrast ratio of 1.09 against 4.5 required — invisible,
   not merely dim. Caught by measuring, not by looking. */
.leave-choice.vanish.demoted .lc-desc,
.leave-choice.vanish.demoted #leaveVanishDesc { color: var(--ink-soft); }
.leave-choice.vanish.demoted:hover { border-color: var(--line-strong, var(--line)); }

/* ============================================================================
   THE ARRIVAL AT A DOOR (founder, 09-04-2026). public/door-arrival.js builds
   #doorArrival — a copy of the start page as a wall, a seam of light, and for
   the corridor a small 3D world — ABOVE the door page (z 56 over .dash-wrap's
   55), and puts .arr-play plus one style class on both. Every beat lives here
   so the concept board (design/door-to-room-desktop.html in the vaultcast-
   package repo) and the app read the same sheet. The admin sliders arrive as
   custom properties: --doorms --travelms --depth (corridor), --turnms --lean
   --over (turn). t = 0 is the moment .arr-play lands, which is AFTER the server
   has answered the resolve — never a keystroke (DOOR_DESIGN.md #27).
   ⛔ Nothing here may vary by what the door answered. One sheet, three styles.
   ⛔ Beta never gets the config, so none of this ever runs there (rule 13).
   ============================================================================ */
#doorArrival {
  position: fixed; top: 0; left: 0; right: 0; height: var(--vvh, 100dvh); z-index: 56; pointer-events: none; overflow: hidden;
  --arr-corr: var(--accent);
  --arr-a: rgba(198,255,0,.22); --arr-glow: rgba(198,255,0,.18); --arr-far: rgba(198,255,0,.42);
  --arr-seam-glow: rgba(198,255,0,.55); --arr-vig: rgba(0,0,0,.42); --arr-wash: rgba(198,255,0,.32);
  --arr-ease-door: cubic-bezier(.77,0,.18,1); --arr-ease-travel: cubic-bezier(.22,1,.36,1);
}
#doorPage.arr-play {
  --arr-corr: var(--accent); --arr-far: rgba(198,255,0,.42); --arr-seam-glow: rgba(198,255,0,.55);
  --arr-wash: rgba(198,255,0,.32); --arr-ease-travel: cubic-bezier(.22,1,.36,1);
}
/* on white: olive carries the corridor and the edge; the seam stays lime in both
   themes because it is a light source, like the primary button's fill */
body.light #doorArrival, body.light #doorPage.arr-play {
  --arr-a: rgba(100,124,15,.45); --arr-glow: rgba(100,124,15,.14); --arr-far: rgba(100,124,15,.20);
  --arr-vig: rgba(25,30,20,.14); --arr-wash: rgba(100,124,15,.20);
}
/* a 2px lime line on white does not exist (looked at 09-04-2026): on white the seam's CORE is olive
   and its glow stays lime, so the light source reads on both grounds */
body.light #doorArrival .arr-seam { background: var(--accent); }
#doorPage.arr-hold { visibility: hidden; }

/* ---- the wall: copies of the start page, ids and all (see door-arrival.js) */
#doorArrival .arr-wall { position: absolute; top: 0; bottom: 0; overflow: hidden; background: var(--bg); z-index: 6; pointer-events: auto; }
#doorArrival .arr-wall-one { left: 0; right: 0; }
#doorArrival .arr-wall-l { left: 0; width: 50%; }
#doorArrival .arr-wall-r { right: 0; width: 50%; }
#doorArrival .arr-inner { position: absolute; top: 0; bottom: 0; left: 0; width: 100vw; }
#doorArrival .arr-wall-r .arr-inner { left: auto; right: 0; }
#doorArrival .arr-inner > .screen { height: 100%; }
#doorArrival .arr-seam { position: absolute; top: 8%; bottom: 8%; left: 50%; width: 2px; margin-left: -1px; background: var(--lime); border-radius: 2px; z-index: 7; opacity: 0; box-shadow: 0 0 22px 3px var(--arr-seam-glow); transform-origin: 50% 0; }
#doorArrival .arr-glow { position: absolute; inset: -10%; z-index: 1; opacity: 0; background: radial-gradient(closest-side at 50% 50%, var(--arr-a), transparent 68%); }

/* ---- Option A · parts: seam → the halves slide into the wings → the face takes its seats */
#doorArrival.arr-play.arr-parts .arr-seam { animation: arrSeam 2000ms ease both; }
/* the board's radial glow is left out here: in the app the overlay sits ABOVE the door page, so a glow
   would tint the real page (seen 09-04-2026); the seam's own glow carries the light */
#doorArrival.arr-play.arr-parts .arr-wall-l { animation: arrPartL 1100ms var(--arr-ease-door) both 390ms; }
#doorArrival.arr-play.arr-parts .arr-wall-r { animation: arrPartR 1100ms var(--arr-ease-door) both 390ms; }
#doorPage.arr-play.arr-parts { --arr-t0: 1180ms; animation: arrShow 1ms linear both 390ms; }

/* ---- Option B · corridor: seam → the doors swing (--doorms) → a wind-up → travel (--travelms) → the landing */
#doorArrival .arr-world { position: absolute; inset: 0; overflow: hidden; perspective: 900px; perspective-origin: 50% 50%; background: var(--bg); z-index: 2; }
#doorArrival .arr-scene { position: absolute; inset: 0; transform-style: preserve-3d; transform: translateZ(0); }
#doorArrival .arr-ring { position: absolute; inset: 12% 10%; border: 1.5px solid var(--arr-corr); border-radius: 22px; box-shadow: 0 0 18px var(--arr-glow), inset 0 0 18px var(--arr-glow); opacity: 0; }
#doorArrival .arr-floorwedge { position: absolute; left: 50%; top: 50%; width: 56vw; height: var(--depth); margin-left: -28vw; transform-origin: 50% 0; transform: translateY(36vh) rotateX(90deg); background: linear-gradient(to bottom, transparent, var(--arr-glow) 55%, transparent); opacity: .8; }
#doorArrival .arr-floorline { position: absolute; left: 50%; top: 50%; width: 2px; height: var(--depth); margin-left: -1px; transform-origin: 50% 0; transform: translateY(36vh) rotateX(90deg); background: linear-gradient(to bottom, var(--arr-corr), transparent); opacity: .5; }
#doorArrival .arr-dest { position: absolute; inset: 0; transform: translateZ(calc(-1 * var(--depth))); background: var(--bg); border: 1px solid var(--line); box-shadow: 0 0 40px var(--arr-glow); display: flex; align-items: center; justify-content: center; }
#doorArrival .arr-dest::before { content: ""; position: absolute; inset: -20%; opacity: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 28%, var(--arr-far), transparent 62%); }
#doorArrival .arr-dest-spark { position: relative; color: var(--arr-corr); font-size: 34px; line-height: 1; }
#doorArrival .arr-farlight { position: absolute; inset: 0; opacity: 0; pointer-events: none; background: radial-gradient(closest-side at 50% 50%, var(--arr-far), transparent 62%); }
#doorArrival .arr-field { position: absolute; left: 50%; top: 50%; width: 2400px; height: 1800px; margin: -900px 0 0 -1200px; background-image: var(--chime-field); background-repeat: repeat; opacity: 0; transform-style: preserve-3d; }
#doorArrival .arr-f1 { background-size: 520px 420px; transform: translateZ(calc(-1 * var(--depth) * .28)); }
#doorArrival .arr-f2 { background-size: 780px 630px; transform: translateZ(calc(-1 * var(--depth) * .58)); }
#doorArrival .arr-f3 { background-size: 1100px 890px; transform: translateZ(calc(-1 * var(--depth) * .88)); }
#doorArrival .arr-hinge { position: absolute; inset: 0; perspective: 1400px; z-index: 6; }
#doorArrival .arr-leaf { transform-style: preserve-3d; backface-visibility: hidden; }
#doorArrival .arr-leaf.arr-wall-l { transform-origin: 0 50%; }
#doorArrival .arr-leaf.arr-wall-r { transform-origin: 100% 50%; }
#doorArrival .arr-leaf::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to right, rgba(0,0,0,0), rgba(0,0,0,.35)); opacity: 0; pointer-events: none; z-index: 3; }
#doorArrival .arr-leaf.arr-wall-r::after { background: linear-gradient(to left, rgba(0,0,0,0), rgba(0,0,0,.35)); }
#doorArrival .arr-leaf::before { content: ""; position: absolute; top: 0; bottom: 0; width: 3px; background: var(--arr-corr); box-shadow: 0 0 14px 2px var(--arr-far); opacity: 0; z-index: 4; }
#doorArrival .arr-leaf.arr-wall-l::before { right: 0; }
#doorArrival .arr-leaf.arr-wall-r::before { left: 0; }
#doorArrival .arr-rush { position: absolute; inset: 0; opacity: 0; z-index: 8; }
#doorArrival .arr-sp { position: absolute; left: 50%; top: 50%; width: 2px; height: 2px; transform: rotate(var(--ang)) translateY(calc(-1 * var(--r))); transform-origin: 50% 50%; }
#doorArrival .arr-sp::before { content: "✦"; position: absolute; left: -7px; top: -9px; font-size: 12px; line-height: 1; color: var(--arr-corr); opacity: .9; }
#doorArrival .arr-sp::after { content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 26px; transform-origin: 50% 0; transform: scaleY(0); background: linear-gradient(to bottom, var(--arr-corr), transparent); opacity: .6; }
#doorArrival .arr-vignette { position: absolute; inset: 0; opacity: 0; z-index: 8; background: radial-gradient(closest-side at 50% 50%, transparent 58%, var(--arr-vig) 100%); }
#doorArrival .arr-landring { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border: 2px solid var(--arr-corr); border-radius: 50%; opacity: 0; z-index: 9; }
#doorArrival.arr-play.arr-corridor .arr-seam { animation: arrSeam 1500ms ease both; }
#doorArrival.arr-play.arr-corridor .arr-leaf .screen { animation: arrDim 700ms ease both 60ms; }
#doorArrival.arr-play.arr-corridor .arr-leaf.arr-wall-l { animation: arrSwingL var(--doorms) var(--arr-ease-door) both 500ms, arrGone calc(var(--travelms) * .45) ease forwards calc(500ms + var(--doorms)); }
#doorArrival.arr-play.arr-corridor .arr-leaf.arr-wall-r { animation: arrSwingR var(--doorms) var(--arr-ease-door) both 500ms, arrGone calc(var(--travelms) * .45) ease forwards calc(500ms + var(--doorms)); }
#doorArrival.arr-play.arr-corridor .arr-leaf::before { animation: arrRim var(--doorms) ease both 500ms; }
#doorArrival.arr-play.arr-corridor .arr-leaf::after { animation: arrLeafShade var(--doorms) ease both 500ms; }
#doorArrival.arr-play.arr-corridor .arr-farlight { animation: arrFarlight calc(var(--doorms) + var(--travelms) + 220ms) ease both 500ms; }
#doorArrival.arr-play.arr-corridor .arr-ring { animation: arrRingIn 600ms ease both calc(500ms + var(--doorms) * .4), arrRingOut 500ms ease forwards calc(100ms + var(--doorms) + var(--travelms)); }
#doorArrival.arr-play.arr-corridor .arr-scene { animation: arrWindup 220ms ease-out both calc(500ms + var(--doorms)), arrTravel var(--travelms) cubic-bezier(.55,0,.15,1) forwards calc(720ms + var(--doorms)); }
#doorArrival.arr-play.arr-corridor .arr-f1 { animation: arrFieldIn 600ms ease both calc(500ms + var(--doorms) * .4), arrFieldOut calc(var(--travelms) * .12) ease forwards calc(720ms + var(--doorms) + var(--travelms) * .18); }
#doorArrival.arr-play.arr-corridor .arr-f2 { animation: arrFieldIn 600ms ease both calc(500ms + var(--doorms) * .4), arrFieldOut calc(var(--travelms) * .12) ease forwards calc(720ms + var(--doorms) + var(--travelms) * .48); }
#doorArrival.arr-play.arr-corridor .arr-f3 { animation: arrFieldIn 600ms ease both calc(500ms + var(--doorms) * .4), arrFieldOut calc(var(--travelms) * .12) ease forwards calc(720ms + var(--doorms) + var(--travelms) * .78); }
#doorArrival.arr-play.arr-corridor .arr-rush { animation: arrRushIn var(--travelms) ease-in-out both calc(720ms + var(--doorms)); }
#doorArrival.arr-play.arr-corridor .arr-sp::after { animation: arrStreak var(--travelms) cubic-bezier(.55,0,.15,1) both calc(720ms + var(--doorms)); }
#doorArrival.arr-play.arr-corridor .arr-sp::before { animation: arrSparkDim var(--travelms) cubic-bezier(.55,0,.15,1) both calc(720ms + var(--doorms)); }
#doorArrival.arr-play.arr-corridor .arr-vignette { animation: arrVig var(--travelms) ease-in-out both calc(720ms + var(--doorms)); }
#doorArrival.arr-play.arr-corridor .arr-dest::before { animation: arrWithin 900ms ease both calc(420ms + var(--doorms) + var(--travelms)); }
#doorArrival.arr-play.arr-corridor .arr-dest-spark { animation: arrSparkFlare 700ms ease-out both calc(620ms + var(--doorms) + var(--travelms)); }
#doorArrival.arr-play.arr-corridor .arr-world { animation: arrWorldOut 360ms ease forwards calc(900ms + var(--doorms) + var(--travelms)); }
#doorArrival.arr-play.arr-corridor .arr-landring { animation: chime-ring 1013ms ease-out forwards calc(870ms + var(--doorms) + var(--travelms)); }
#doorPage.arr-play.arr-corridor { --arr-t0: calc(1320ms + var(--doorms) + var(--travelms)); animation: arrShow 1ms linear both calc(860ms + var(--doorms) + var(--travelms)), arrLand 420ms var(--arr-ease-travel) both calc(940ms + var(--doorms) + var(--travelms)); }
#doorPage.arr-play.arr-corridor::before { content: ""; position: absolute; inset: -20%; pointer-events: none; opacity: 0; z-index: 3; background: radial-gradient(ellipse at 50% 28%, var(--arr-far), transparent 62%); animation: arrWithin 1400ms ease both calc(1020ms + var(--doorms) + var(--travelms)); }

/* ---- Option C · turn: the wall falls away, the seam is the door edge-on, and it turns to face you
   (lean --lean, strike, --over past flat, settle; --turnms for the whole move) */
#doorArrival.arr-play.arr-turn .arr-seam { animation: arrSeamC 900ms ease both; }
#doorArrival.arr-play.arr-turn .arr-wall-one { animation: arrDim 400ms ease both 140ms, arrFade 320ms ease forwards 440ms; }
#doorPage.arr-play.arr-turn { --arr-t0: calc(730ms + var(--turnms)); transform-origin: 50% 50%; backface-visibility: hidden; box-shadow: inset 0 0 0 1px var(--line); animation: arrShow 1ms linear both 590ms, arrTurn var(--turnms) both 590ms; }
#doorPage.arr-play.arr-turn::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--arr-corr); box-shadow: 0 0 22px 4px var(--arr-seam-glow); opacity: 0; z-index: 3; pointer-events: none; animation: arrEdge var(--turnms) ease-out both 590ms; }
#doorPage.arr-play.arr-turn::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; background: linear-gradient(100deg, var(--arr-wash) 0%, transparent 40%); animation: arrWash var(--turnms) ease-out both 770ms; }

/* ---- the face takes its seats (all three): the bar and the card, then each line of the card.
   Only elements door-arrival.js marked .arr-seat at go() take part: content rendered later
   (Continue without one, a withdraw) must appear at once, not wait out a delay of its own */
#doorPage.arr-play .dash-bar.arr-seat, #doorPage.arr-play .door-card.arr-seat { animation: arrArrive 700ms ease both calc(var(--arr-t0) - 140ms); }
#doorPage.arr-play .door-card > .arr-seat { animation: arrArrive 600ms ease both var(--arr-t0); }
#doorPage.arr-play .door-card > .arr-seat:nth-child(2) { animation-delay: calc(var(--arr-t0) + 120ms); }
#doorPage.arr-play .door-card > .arr-seat:nth-child(3) { animation-delay: calc(var(--arr-t0) + 240ms); }
#doorPage.arr-play .door-card > .arr-seat:nth-child(4) { animation-delay: calc(var(--arr-t0) + 340ms); }
#doorPage.arr-play .door-card > .arr-seat:nth-child(5) { animation-delay: calc(var(--arr-t0) + 440ms); }
#doorPage.arr-play .door-card > .arr-seat:nth-child(6) { animation-delay: calc(var(--arr-t0) + 540ms); }
#doorPage.arr-play .door-card > .arr-seat:nth-child(7) { animation-delay: calc(var(--arr-t0) + 640ms); }
#doorPage.arr-play .door-card > .arr-seat:nth-child(8) { animation-delay: calc(var(--arr-t0) + 740ms); }
#doorPage.arr-play .door-card > .arr-seat:nth-child(n+9) { animation-delay: calc(var(--arr-t0) + 840ms); }

@keyframes arrShow { from { visibility: hidden; } to { visibility: visible; } }
@keyframes arrSeam { 0% { opacity: 0; transform: scaleY(0); } 22% { opacity: 1; transform: scaleY(1); } 70% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); } }
@keyframes arrSeamC { 0% { opacity: 0; transform: scaleY(0); } 30% { opacity: 1; transform: scaleY(1); } 72% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); } }
@keyframes arrGlow { 0% { opacity: 0; } 40% { opacity: .6; } 100% { opacity: 0; } }
@keyframes arrPartL { to { transform: translateX(calc(-100% - 40px)); } }
@keyframes arrPartR { to { transform: translateX(calc(100% + 40px)); } }
@keyframes arrArrive { from { opacity: 0; transform: translateY(7px) scale(.97); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes arrDim { to { filter: brightness(.72); } }
@keyframes arrFade { to { opacity: 0; } }
@keyframes arrGone { to { opacity: 0; } }
@keyframes arrSwingL { 0% { transform: rotateY(0); } 78% { transform: rotateY(112deg); } 100% { transform: rotateY(104deg); } }
@keyframes arrSwingR { 0% { transform: rotateY(0); } 78% { transform: rotateY(-112deg); } 100% { transform: rotateY(-104deg); } }
@keyframes arrRim { 0% { opacity: 0; } 25% { opacity: 1; } 100% { opacity: 0; } }
@keyframes arrLeafShade { 0% { opacity: 0; } 60% { opacity: 1; } 100% { opacity: 1; } }
@keyframes arrFarlight { 0% { opacity: 0; transform: scale(.6); } 30% { opacity: .35; transform: scale(.8); } 85% { opacity: 1; transform: scale(1.15); } 100% { opacity: .5; transform: scale(1.3); } }
@keyframes arrRingIn { from { opacity: 0; } to { opacity: var(--ring-o, .22); } }
@keyframes arrRingOut { to { opacity: 0; } }
@keyframes arrWindup { from { transform: translateZ(0); } to { transform: translateZ(-90px); } }
@keyframes arrTravel { 0% { transform: translateZ(-90px); } 100% { transform: translateZ(var(--depth)); } }
@keyframes arrFieldIn { from { opacity: 0; } to { opacity: .9; } }
@keyframes arrFieldOut { to { opacity: 0; } }
@keyframes arrRushIn { 0% { opacity: 0; } 20% { opacity: 1; } 85% { opacity: 1; } 100% { opacity: 0; } }
@keyframes arrStreak { 0% { transform: scaleY(0); } 50% { transform: scaleY(var(--len)); } 100% { transform: scaleY(0); } }
@keyframes arrSparkDim { 0% { opacity: .9; } 50% { opacity: .15; } 100% { opacity: .9; } }
@keyframes arrVig { 0% { opacity: 0; } 50% { opacity: 1; } 100% { opacity: .25; } }
@keyframes arrWithin { 0% { opacity: 0; } 40% { opacity: .55; } 100% { opacity: 0; } }
@keyframes arrSparkFlare { 0% { transform: scale(1); filter: brightness(1); } 35% { transform: scale(1.6); filter: brightness(2.2); } 100% { transform: scale(1); filter: brightness(1); } }
@keyframes arrWorldOut { to { opacity: 0; } }
@keyframes arrLand { from { transform: scale(1.018); } to { transform: scale(1); } }
@keyframes arrEdge { 0% { opacity: 1; } 55% { opacity: .9; } 100% { opacity: 0; } }
@keyframes arrWash { 0% { opacity: 1; } 100% { opacity: 0; } }
/* a heavy object turning: a small lean away, the strike, a few degrees past flat, and the settle */
@keyframes arrTurn {
  /* the eye sits 2.8 page-widths back — the board's 640px column at 1800px, kept in
     proportion on a full-width page, so the near edge swings past without blowing up */
  0%   { transform: perspective(280vw) rotateY(90deg); animation-timing-function: ease-out; }
  14%  { transform: perspective(280vw) rotateY(calc(90deg + var(--lean))); animation-timing-function: cubic-bezier(.77,0,.18,1); }
  78%  { transform: perspective(280vw) rotateY(calc(-1 * var(--over))); animation-timing-function: cubic-bezier(.22,1,.36,1); }
  100% { transform: perspective(280vw) rotateY(0deg); }
}
/* reduced motion: door-arrival.js already refuses to build the overlay; this is the belt to that brace */
@media (prefers-reduced-motion: reduce) {
  #doorArrival { display: none; }
  #doorPage.arr-play, #doorPage.arr-play *, #doorPage.arr-play::before, #doorPage.arr-play::after { animation: none !important; }
  #doorPage.arr-hold { visibility: visible; }
}
/* an @name typed where the room code goes: the field drops its room-code look
   (app.js toggles the class on the paid edition only; the rule above is untouched) */
.join-row input.is-handle { text-transform: none; letter-spacing: 0.04em; }
/* while an arrival plays, the real start page steps behind its copy (door-arrival.js) */
#landing.arr-behind { visibility: hidden; }
