/* ==========================================================================
   Outfitter — dashboard (production copy, ported verbatim from
   demo/public/styles.css; the one addition is .app-footer.solo below).
   Register: TOOL (~/tools/design/languages/dankmire-tool.md) — a review
   queue Michael lives in for a working session, not a 40-second landing
   page. Tokens below are the tool register's, copied verbatim, plus ONE
   project-identity color (--gold) added per the registry recipe
   (~/tools/design/languages/README.md step 3): a precedented brand gold
   (see JUSTIN-CREATIVE-TASTE-PROFILE.md "gold-on-dark register" from the
   stankydanko-ident build), used ONLY in the header brand lockup — never
   as a state color. Every other color in this file is a token with a
   stated meaning; see the "color semantics" comment block below.
   ========================================================================== */

:root {
  /* Layers — near-black navy family (brand constant, dark-native only) */
  --bg:        #0a0a0f;
  --surface:   #12121a;
  --surface-2: #1a1a25;
  --surface-3: #232330;   /* inputs, pressed */
  --border:    #2a2a3a;
  --border-hi: #3a3a4e;

  /* Text — three tiers, never more */
  --text:       #e6e9f0;
  --text-dim:   #8888a0;
  --text-faint: #55556a;

  /* THE brand pair */
  --green:      #4ade80;  --green-dim:  #2d7a4a;
  --purple:     #a78bfa;  --purple-dim: #4c3d78;

  /* Fixed state/data set — never invented per-feature */
  --blue:   #60a5fa;   /* info */
  --teal:   #5eead4;   /* done / delivered */
  --amber:  #fbbf24;   /* caution / no consent yet */
  --danger: #f87171;   /* blocked / destructive */

  /* Glow = live state ONLY (D5) */
  --glow-green: 0 0 12px #4ade8055, 0 0 32px #4ade8022;

  /* ONE project-identity color — Travel First Horizons brand lockup only.
     Meaning: "this is TFH's brand," never a state. Kept out of the
     interactive/semantic set entirely (C2: accent stays ≤10% of screen). */
  --gold: #d4a437;

  --radius-s: 6px; --radius-m: 8px; --radius-l: 12px; --radius-pill: 999px;
  --fast: 0.15s ease;  /* ALL hover/state color */
  --slow: 0.3s ease;   /* sheet/crossfade/progress ONLY */

  /* JetBrains Mono = the brand texture: chrome, labels, data, buttons.
     Message BODY copy (the actual marketing SMS text Michael is judging)
     uses a system sans instead — a deliberate T8 exception: mono is for
     data/labels, sans is for reading prose, and legibility is the taste
     profile's non-negotiable ("style never outranks read"). */
  --font:      'JetBrains Mono','Fira Code',ui-monospace,monospace;
  --font-read: -apple-system, 'Segoe UI', system-ui, Roboto, sans-serif;
}

/* Color semantics (every color below traces to one of these rows — C1/C3)
   green   — interactive / approve / opted-in consent / live-sending
   purple  — message class (content classification)
   blue    — info / invited-not-yet-consented
   teal    — delivered / done
   amber   — caution / no-consent-yet
   danger  — blocked / opted-out / destructive, always with a confirm
   gold    — TFH brand lockup ONLY, never state
*/

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  height: 100%;
}
body { min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) var(--bg); }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--bg); }
*::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: var(--radius-pill); }
::selection { background: #4ade8033; }
button, input, textarea { font-family: inherit; }
button { cursor: pointer; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ============ banner ============ */
.banner {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px; font-size: 12px;
  border-bottom: 1px solid var(--border);
}
.banner-danger { background: #f8717122; color: var(--danger); }
.banner-msg { flex: 1; }
.banner-action {
  background: none; border: 1px solid var(--danger); color: var(--danger);
  border-radius: var(--radius-s); padding: 6px 10px; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em; min-height: 32px;
  transition: background var(--fast);
}
.banner-action:hover { background: #f8717122; }
.banner-action:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--danger); }

/* ============ shell / header ============ */
.app-shell { max-width: 720px; margin: 0 auto; padding: 16px 16px 12px; }
.app-header { margin-bottom: 4px; }
.brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.brand-mark {
  font-weight: 700; font-size: 13px; letter-spacing: 0.04em;
  color: var(--gold); border: 1px solid #d4a43755; background: #d4a43714;
  border-radius: var(--radius-s); padding: 6px 8px; line-height: 1;
}
.brand-name { font-size: 14px; font-weight: 600; }
.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 500; margin-top: 2px;
}

/* campaign switcher: horizontal chip row, scrolls on mobile */
.campaign-switcher {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px;
  scrollbar-width: none;
  /* AUD-01 P2-11 — the hidden scrollbar left zero affordance that there's
     more to scroll; a fade mask on both edges reads as "swipe for more"
     instead of a clipping bug (MB4). */
  mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
.campaign-switcher::-webkit-scrollbar { display: none; }
.campaign-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 8px 12px; min-height: 44px; justify-content: center;
  color: var(--text-dim); transition: border-color var(--fast), color var(--fast), background var(--fast);
  white-space: nowrap;
}
.campaign-chip:hover { border-color: var(--border-hi); color: var(--text); }
.campaign-chip:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.campaign-chip.active { border-color: var(--green); color: var(--text); background: #4ade8014; }
/* QA-SWEEP-01 P0-2 — a server-caps-name-at-80 fix (server.mjs) closes the
   real hole, but the chip itself must stay defensively bounded regardless
   (a pre-existing/legacy row, or any future writer that skips the API). */
.campaign-chip { max-width: 220px; }
.campaign-chip .cc-name {
  font-size: 12px; font-weight: 600; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block;
}
.campaign-chip .cc-sub { font-size: 10px; color: var(--text-faint); letter-spacing: 0.04em; }
.campaign-chip.active .cc-sub { color: var(--green); }

/* stats strip */
.stats-strip { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 10px 12px; display: flex; flex-direction: column; gap: 2px;
}
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.1; }
.stat-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 500;
}

/* ============ tabs ============ */
.tab-bar {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  overflow-x: auto; scrollbar-width: none; margin-bottom: 12px;
  position: sticky; top: 0; background: var(--bg); z-index: 20;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab {
  font-family: var(--font); font-size: 12px; background: none; border: none;
  border-bottom: 2px solid transparent; color: var(--text-dim);
  padding: 10px 12px; min-height: 44px; white-space: nowrap;
  transition: color var(--fast), border-color var(--fast);
}
.tab:hover { color: var(--text); }
.tab:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--green); }
.tab.active { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.tab .tab-count { color: var(--text-faint); margin-left: 4px; }
.tab.active .tab-count { color: var(--green); }

/* ============ batch bar ============ */
.batch-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--surface-2); border: 1px solid var(--border-hi); border-radius: var(--radius-m);
  padding: 10px 12px; margin-bottom: 12px;
}
.batch-select-all { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-dim); min-height: 32px; }
.batch-select-all input { width: 16px; height: 16px; accent-color: var(--green); }
.batch-count { font-size: 11px; color: var(--text-faint); }
.batch-actions { display: flex; gap: 8px; margin-left: auto; }

/* ============ buttons (idiom copied verbatim from component-standards) ============ */
.btn {
  font-family: var(--font); font-size: 12px; line-height: 1.2;
  padding: 10px 16px; min-height: 44px; border-radius: var(--radius-s);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); white-space: nowrap;
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
/* .btn also styles the Export-evidence <a> — anchors don't get the native
   <button> UA centering, so give them it explicitly (native buttons are
   untouched by this, scoped to the `a` tag only). */
a.btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
.btn:hover { border-color: var(--border-hi); color: var(--text); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.btn:active { background: var(--surface-3); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--green-dim); border-color: var(--green-dim); color: #eafff2; font-weight: 600; }
.btn-primary:hover:not(:disabled) { background: var(--green); border-color: var(--green); color: #06140b; }
.btn-danger { color: var(--danger); }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); color: var(--danger); background: #f8717111; }
.btn-ghost { background: none; border-color: transparent; }
.btn-ghost:hover { border-color: var(--border); color: var(--text); }
.btn-sm { padding: 8px 12px; font-size: 11px; min-height: 40px; }
.btn-block { width: 100%; }

/* ============ chips ============ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 4px 8px; border-radius: 4px; font-weight: 600; line-height: 1;
  white-space: nowrap;
}
.chip .cdot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.chip.green  { background: #4ade8026; color: var(--green); }
.chip.green .cdot { background: var(--green); }
.chip.purple { background: #a78bfa22; color: var(--purple); }
.chip.purple .cdot { background: var(--purple); }
.chip.blue   { background: #60a5fa22; color: var(--blue); }
.chip.blue .cdot { background: var(--blue); }
.chip.teal   { background: #5eead422; color: var(--teal); }
.chip.teal .cdot { background: var(--teal); }
.chip.amber  { background: #fbbf2422; color: var(--amber); }
.chip.amber .cdot { background: var(--amber); }
.chip.danger { background: #f8717122; color: var(--danger); }
.chip.danger .cdot { background: var(--danger); }
.chip.idle   { background: #8888a022; color: var(--text-dim); }
.chip.idle .cdot { background: var(--text-faint); }
/* live-sending: the ONE earned glow in this app — an in-flight delivery */
.chip.sending .cdot { background: var(--green); box-shadow: var(--glow-green); animation: pulse 2s ease-in-out infinite; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ============ queue main / cards ============ */
.queue-main { min-height: 240px; margin-bottom: 16px; }
.card-list { display: flex; flex-direction: column; gap: 12px; }

.msg-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: border-color var(--fast), opacity var(--fast);
}
.msg-card:hover { border-color: var(--border-hi); }
.msg-card.busy { opacity: 0.55; pointer-events: none; }

.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-select { display: flex; align-items: center; padding: 6px; margin: -6px; }
.card-select input { width: 18px; height: 18px; accent-color: var(--green); }
.card-id-block { flex: 1; min-width: 0; }
.card-name { font-size: 15px; font-weight: 600; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.card-top .chip.class-chip { margin-left: auto; flex: none; }

.card-trip { font-size: 11px; color: var(--text-faint); letter-spacing: 0.02em; }
.card-trip b { color: var(--text-dim); font-weight: 500; }

/* the compliance-story banner — must be impossible to miss */
.block-reason {
  display: flex; align-items: flex-start; gap: 8px;
  background: #f8717118; border: 1px solid #f8717144; border-radius: var(--radius-s);
  padding: 10px 12px; color: var(--danger); font-size: 12px; line-height: 1.4;
}
.block-reason .br-glyph { font-weight: 700; flex: none; }

/* message body — sans, reading-optimized (T8 exception, see header comment) */
.card-body {
  font-family: var(--font-read); font-size: 15px; line-height: 1.55; color: var(--text);
  background: var(--surface-2); border-radius: var(--radius-s); padding: 12px 14px;
  max-width: 68ch;
}

.card-edit textarea {
  font-family: var(--font-read); font-size: 15px; line-height: 1.5; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 12px 14px; width: 100%; min-height: 120px; resize: vertical;
  caret-color: var(--green);
}
.card-edit textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.card-edit-actions { display: flex; gap: 8px; margin-top: 8px; }

.card-actions { display: flex; gap: 8px; }
.card-actions .btn { flex: 1; }

.card-meta-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card-meta-row .dim { color: var(--text-faint); font-size: 11px; }

/* ============ empty / loading / error states ============ */
.state-panel {
  min-height: 220px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 32px 20px; text-align: center;
}
.state-panel .glyph { font-size: 22px; color: var(--text-faint); letter-spacing: 0.1em; }
.state-panel .msg { font-size: 13px; color: var(--text-dim); max-width: 34ch; }
.state-panel .msg b { color: var(--text); font-weight: 600; }
.state-panel.state-error .glyph { color: var(--danger); }

.skel-cards { display: flex; flex-direction: column; gap: 12px; }
.skel-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.skel-card i, .skel-row i {
  display: block; height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.skel-card i:nth-child(1) { width: 45%; height: 16px; }
.skel-card i:nth-child(2) { width: 80%; }
.skel-card i:nth-child(3) { width: 60%; height: 40px; }
.skel-row { display: flex; gap: 8px; }
.skel-row i { width: 90px; height: 44px; border-radius: var(--radius-m); flex: none; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ============ consent ledger table ============ */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-m); }
table { width: 100%; border-collapse: collapse; font-size: 12px; }
thead th {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 500; text-align: left;
  padding: 10px 12px; border-bottom: 1px solid var(--border);
  background: var(--surface); position: sticky; top: 0;
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr { background: var(--surface); transition: background var(--fast); }
tbody tr:hover { background: var(--surface-2); }
td .dim { color: var(--text-faint); }
.row-action {
  color: var(--text-dim); font-size: 11px; font-weight: 500;
  text-decoration: none; border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 4px 9px; white-space: nowrap; display: inline-flex; align-items: center;
}
.row-action:hover { color: var(--text); border-color: var(--border-hi); background: var(--surface-2); }

/* ============ send bar (sticky bottom, thumb zone) ============ */
.send-bar {
  position: sticky; bottom: 0; z-index: 25;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 16px; margin: 0 -16px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.send-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.send-campaign { font-size: 12px; font-weight: 600; color: var(--text); }
.send-sub { font-size: 10px; color: var(--text-faint); }
.btn-send { flex: none; }

.app-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0 8px; flex-wrap: wrap;
}
/* PRODUCTION ADDITION: production has no /api/reset, so the footer carries
   only the carrier-mode note — center it instead of space-between's
   single-item left-drift. */
.app-footer.solo { justify-content: center; }
.footer-link {
  background: none; border: none; color: var(--text-faint); font-size: 11px;
  text-decoration: underline; text-underline-offset: 2px; min-height: 32px;
}
.footer-link:hover { color: var(--text-dim); }
.footer-link:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-radius: var(--radius-s); }
.footer-note { font-size: 10px; color: var(--text-faint); }

/* ============ modal / scrim ============ */
.scrim {
  position: fixed; inset: 0; background: rgba(10,10,15,0.6); backdrop-filter: blur(12px);
  z-index: 90;
}
.modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 380px; max-width: calc(100vw - 32px);
  background: var(--surface); border: 1px solid var(--border-hi);
  border-radius: var(--radius-l); padding: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  z-index: 100; max-height: calc(100vh - 32px); overflow-y: auto;
}
.modal.modal-wide { width: 480px; }
.modal h3 { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.modal p { color: var(--text-dim); font-size: 12px; margin-bottom: 16px; line-height: 1.5; }
.modal p b { color: var(--text); font-weight: 600; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }

.results-summary { display: flex; gap: 16px; margin-bottom: 14px; }
.results-summary .rs-num { font-size: 22px; font-weight: 700; }
.results-summary .rs-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); }
.results-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; max-height: 220px; overflow-y: auto; }
.results-row { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: var(--radius-s); font-size: 12px; }
.results-row.blocked { background: #f8717114; }
.results-row.sent { background: #4ade8014; }
.results-row .rr-name { font-weight: 600; }
.results-row.blocked .rr-name { color: var(--danger); }
.results-row.sent .rr-name { color: var(--green); }
.results-row .rr-reason { color: var(--text-dim); font-size: 11px; }
.results-heading { font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 8px; }

/* ============ toasts ============ */
.toast-stack {
  position: fixed; bottom: calc(80px + env(safe-area-inset-bottom)); left: 16px; right: 16px;
  display: flex; flex-direction: column; gap: 8px; z-index: 120; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: var(--radius-s); padding: 10px 14px; font-size: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  animation: toast-in var(--slow);
}
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* ============ mobile-first sizing already the default above; desktop bonus ============ */
@media (min-width: 640px) {
  .app-shell { padding: 32px 24px 24px; }
  .stats-strip { grid-template-columns: repeat(4, 1fr); }
  .card-actions .btn { flex: initial; min-width: 120px; }
  .card-actions { justify-content: flex-end; }
  .send-bar { margin: 0; border-radius: var(--radius-m) var(--radius-m) 0 0; }
  /* AUD-01 P2-8 — a fixed 16px margin spans ~1068px at this width, unusually
     heavy for a quiet confirmation (every other floating layer is width-capped). */
  .toast-stack { left: auto; right: 24px; width: 100%; max-width: 420px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .chip.sending .cdot { box-shadow: none; outline: 1px solid var(--green); animation: none; }
  .toast { animation: none; }
}

/* ==========================================================================
   REDESIGN v2 (UX-SPEC.md) — additive components. Zero new tokens: every
   value below traces to the :root block above. Sections:
   A. app frame + bottom nav        E. wizard (§4)
   B. screen header idioms          F. results (§7)
   C. home (§3)                     G. inbox (§8)
   D. queue deltas (§5)             H. arrival (§6) + help sheet
   ========================================================================== */

/* ---- A. app frame + bottom nav (§0 — 5 slots, phone-first MB2/MB3) ---- */
/* app-shell already centers at max-width 720px; add room for the fixed nav. */
.app-shell { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
#screen { min-height: 60vh; }

.nav-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  display: flex; background: var(--surface); border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1 1 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; min-height: 56px; background: none; border: none; color: var(--text-dim);
  font-family: var(--font); transition: color var(--fast);
}
.nav-item .ni-glyph { display: flex; }
/* icon-family sizing (S6 optical nudge: 20px reads at the same visual
   weight the 17px emoji glyphs did — emoji glyphs render ~15-20% larger
   than their font-size on most platforms, so 20px is the honest match,
   not a rounding of 17). color inherits via stroke:currentColor above. */
.nav-item .ni-glyph svg { width: 20px; height: 20px; display: block; }
.nav-item .ni-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; } /* AUD-01 P2-9: house micro-label floor is 10-11px */
.nav-item:hover { color: var(--text); }
.nav-item:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--green); }
.nav-item.active { color: var(--green); }

/* ---- B. screen header idioms (brand row / back arrow / job statement) --- */
.screen-head { margin-bottom: 16px; }
.screen-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.screen-brand .brand-mark {
  font-weight: 700; font-size: 13px; letter-spacing: 0.04em; color: var(--gold);
  border: 1px solid #d4a43755; background: #d4a43714; border-radius: var(--radius-s);
  padding: 6px 8px; line-height: 1; display: flex;
}
.screen-brand .brand-mark svg { width: 18px; height: 18px; display: block; }
.screen-brand .brand-title { font-size: 15px; font-weight: 600; flex: 1; }
.screen-job { font-size: 12px; color: var(--text-dim); line-height: 1.45; max-width: 44ch; }
.icon-btn {
  flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-m);
  color: var(--text); font-size: 20px; line-height: 1; transition: border-color var(--fast), color var(--fast);
}
.icon-btn:hover { border-color: var(--border-hi); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.back-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.back-btn {
  flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; color: var(--text-dim); font-size: 22px; line-height: 1;
  border-radius: var(--radius-s); transition: color var(--fast);
}
.back-btn:hover { color: var(--text); }
.back-btn:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); }
.section-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 500;
  color: var(--text-dim); margin: 20px 0 10px;
}
.section-label:first-child { margin-top: 0; }

/* ---- C. home (§3) ------------------------------------------------------- */
.consent-health {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 12px 14px; min-height: 44px; color: var(--text-dim); font-size: 12px; line-height: 1.4;
  transition: border-color var(--fast); margin-bottom: 4px;
}
.consent-health:hover { border-color: var(--border-hi); }
.consent-health:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.consent-health .ch-text { flex: 1; }
.consent-health .ch-text b { color: var(--text); font-weight: 600; }
.consent-health .ch-chevron { flex: none; color: var(--text-faint); font-size: 15px; }

.card-list-home { display: flex; flex-direction: column; gap: 12px; }
.campaign-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color var(--fast); width: 100%; text-align: left; color: var(--text);
}
.campaign-card:hover { border-color: var(--border-hi); }
.campaign-card:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); }
.campaign-card .cc-head { display: flex; align-items: flex-start; gap: 10px; }
/* QA-SWEEP-01 P0-2 / AUD-01 #3 fix follow-up — the name+goal block is the
   ACTUAL flex item here (cc-name is a grandchild), so it needs its own
   flex:1/min-width:0 for cc-name's ellipsis truncation to ever engage;
   without it a wide chip (e.g. "Ready to send") pushes the card past the
   viewport width instead of the name shrinking first. */
.campaign-card .cc-head-text { flex: 1; min-width: 0; }
/* QA-SWEEP-01 P0-2 — same defensive cap as .campaign-chip .cc-name above. */
.campaign-card .cc-name {
  font-size: 15px; font-weight: 600; flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.campaign-card .cc-goal { font-size: 11px; color: var(--text-dim); letter-spacing: 0.02em; }
.campaign-card .cc-hero {
  font-size: 32px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums;
  text-align: center; margin: 8px 0 0; line-height: 1.05;
}
.campaign-card .cc-hero-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); text-align: center;
}
.campaign-card .cc-sub { font-size: 11px; color: var(--text-dim); font-variant-numeric: tabular-nums; }
.campaign-card .cc-action { display: flex; justify-content: flex-end; margin-top: 4px; }

.activity-feed { display: flex; flex-direction: column; gap: 8px; }
.activity-row { display: flex; gap: 8px; font-size: 12px; color: var(--text-dim); line-height: 1.45; }
.activity-row .ar-dot { flex: none; color: var(--text-faint); }
.activity-row .ar-time { color: var(--text-faint); font-size: 11px; }

/* ---- D. queue deltas (§5) ---------------------------------------------- */
/* 5.1 evidence line */
.card-evidence { font-size: 11px; color: var(--text-faint); display: flex; gap: 6px; align-items: flex-start; }
.card-evidence .ce-glyph { flex: none; }
/* 5.2 class-group header */
.class-group-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 4px; margin-top: 4px;
}
.class-group-header .cgh-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); font-weight: 500;
}
.class-group-header .cgh-count { color: var(--text-faint); font-weight: 400; }
.class-group-header .cgh-btn {
  background: none; border: 1px solid transparent; color: var(--text-dim); font-family: var(--font);
  font-size: 11px; padding: 8px 10px; min-height: 40px; border-radius: var(--radius-s);
  transition: color var(--fast), border-color var(--fast);
}
.class-group-header .cgh-btn:hover { color: var(--green); border-color: var(--green); }
.class-group-header .cgh-btn:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); }
/* 5.3 progress-to-zero strip */
.progress-strip { font-size: 12px; color: var(--text-dim); padding: 0 2px 12px; }
/* 5.4 roving focus ring on cards */
.msg-card:focus-visible, .msg-card.kfocus { outline: none; box-shadow: 0 0 0 1px var(--green); }
/* the "?" help button lives in the tab row */
.tab-row { display: flex; align-items: center; }
.tab-row .tab-bar { flex: 1; margin-bottom: 0; }
.help-btn {
  flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; border-bottom: 1px solid var(--border); color: var(--text-dim);
  font-size: 15px; transition: color var(--fast);
}
.help-btn:hover { color: var(--text); }
.help-btn:focus-visible { outline: none; box-shadow: inset 0 0 0 1px var(--green); }

/* ---- E. wizard (§4) ----------------------------------------------------- */
.wizard-progress {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--text-dim);
  font-weight: 500; flex: 1; text-align: center; padding-right: 44px;
}
.wizard-step { animation: step-fade var(--slow); }
@keyframes step-fade { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: none; } }
.field-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim);
  font-weight: 500; margin: 18px 0 8px;
}
.field-input {
  width: 100%; font-family: var(--font-read); font-size: 15px; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 12px 14px; caret-color: var(--green);
}
.field-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.field-row { display: flex; align-items: center; gap: 10px; }
.field-row .field-input { width: auto; flex: 1; min-width: 0; }
.field-row .field-mini {
  width: 88px; text-align: center; font-family: var(--font); font-variant-numeric: tabular-nums;
}
.field-inline-label { font-size: 12px; color: var(--text-dim); min-width: 64px; }

.radio-group { display: flex; flex-direction: column; gap: 8px; }
.radio-option {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; min-height: 44px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  cursor: pointer; transition: border-color var(--fast);
}
.radio-option:hover { border-color: var(--border-hi); }
.radio-option:focus-within { border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.radio-option input { margin-top: 2px; accent-color: var(--green); width: 16px; height: 16px; flex: none; }
.radio-option.checked { border-color: var(--green); background: #4ade8010; }
.radio-option.disabled { opacity: 0.5; cursor: not-allowed; }
.radio-option .ro-body { flex: 1; min-width: 0; }
.radio-option .ro-title { font-size: 13px; font-weight: 600; color: var(--text); }
.radio-option .ro-help { font-size: 11px; color: var(--text-dim); line-height: 1.4; margin-top: 3px; }
.radio-option .ro-inline-hint { font-size: 11px; color: var(--amber); margin-top: 4px; }

.audience-preview { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin: 12px 0; }
.audience-preview.warn { color: var(--amber); }
.warn-icon { display: inline-flex; vertical-align: -2px; margin-right: 5px; }
.warn-icon svg { width: 13px; height: 13px; display: block; }
.audience-preview .ap-toggle {
  background: none; border: none; color: var(--text-faint); font-family: var(--font); font-size: 11px;
  text-decoration: underline; text-underline-offset: 2px; padding: 4px 0; min-height: 32px;
}
.audience-preview .ap-toggle:hover { color: var(--text-dim); }
.wizard-count-hero { text-align: center; font-size: 15px; color: var(--text-dim); margin: 24px 0; }
.wizard-count-hero b { color: var(--text); font-weight: 600; font-size: 22px; display: block; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.wizard-tiles { display: flex; gap: 12px; margin: 20px 0; }
.wizard-tile {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 16px; text-align: center;
}
.wizard-tile.drafted { border-color: var(--green-dim); background: #4ade8010; }
.wizard-tile .wt-num { font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1; }
.wizard-tile.drafted .wt-num { color: var(--green); }
.wizard-tile .wt-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-top: 6px; }
.wizard-tile.tappable { cursor: pointer; transition: border-color var(--fast); }
.wizard-tile.tappable:hover { border-color: var(--border-hi); }
.wizard-skip-detail { font-size: 12px; color: var(--text-dim); line-height: 1.5; margin: 8px 0 0; }

.compose-loading { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 0; }
.spinner {
  width: 28px; height: 28px; border: 2px solid var(--surface-3); border-top-color: var(--green);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.compose-loading .cl-text { font-size: 13px; color: var(--text-dim); }

/* AUD-01 #2 — fixed, not sticky: position:sticky only pins an element once
   its container has scrolled past it, so any wizard step shorter than the
   viewport (worst case: Step 3, one button) left the button floating
   wherever the form happened to end, over a dead void, instead of anchored
   to the visual bottom. Switched to the SAME idiom .nav-bar already uses
   successfully (position:fixed, viewport-anchored regardless of content
   length). bottom:0 (not "above the nav", like the old 56px offset) because
   the wizard is exactly the screen AUD-01 #1 hides #nav-bar on — there is
   never a nav bar underneath this bar to clear. */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: env(safe-area-inset-bottom); z-index: 25;
  display: flex; gap: 12px; background: var(--surface); border-top: 1px solid var(--border);
  padding: 12px 16px;
}
.action-bar .btn { flex: 1; }
.action-bar.stack { flex-direction: column; }
/* room for the fixed bar so it never overlaps the step's own last field */
.wizard-step { padding-bottom: 96px; }

/* ---- F. results (§7) ---------------------------------------------------- */
.stat-hero { text-align: center; margin: 8px 0 20px; }
.stat-hero .sh-num {
  font-size: 32px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; line-height: 1.05;
}
.stat-hero .sh-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-top: 4px; }

.funnel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px;
}
.funnel-row { display: grid; grid-template-columns: 76px 40px 1fr; align-items: center; gap: 10px; }
.funnel-row .fr-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-dim); }
.funnel-row .fr-count { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.funnel-row .fr-track { height: 10px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.funnel-row .fr-fill { height: 100%; border-radius: var(--radius-pill); transition: width var(--slow); }
.funnel-row.sent .fr-fill { background: var(--border-hi); }
.funnel-row.delivered .fr-fill { background: var(--teal); }
.funnel-row.replied .fr-fill { background: var(--green); }

.guardrail-row { display: flex; gap: 12px; margin-bottom: 16px; }
.guardrail-box {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 14px; text-align: center;
}
.guardrail-box .gb-num { font-size: 22px; font-weight: 600; color: var(--danger); font-variant-numeric: tabular-nums; line-height: 1; }
.guardrail-box .gb-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-top: 6px; }

.secondary-stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 12px 14px; font-size: 12px; color: var(--text-dim); line-height: 1.45; margin-bottom: 16px;
}
.secondary-stat b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

.outcome-list { display: flex; flex-direction: column; }
.outcome-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid var(--border); font-size: 12px;
}
.outcome-row:last-child { border-bottom: none; }
.outcome-row .or-name { color: var(--text); }
.outcome-row .or-status { color: var(--text-dim); text-align: right; }
.outcome-row .or-status .replied { color: var(--green); }
.outcome-row .or-status.blocked { color: var(--danger); }

.skel-funnel { display: flex; flex-direction: column; gap: 12px; }
.skel-funnel i {
  display: block; height: 10px; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.skel-funnel i:nth-child(1) { width: 90%; } .skel-funnel i:nth-child(2) { width: 80%; } .skel-funnel i:nth-child(3) { width: 40%; }

/* ---- G. inbox (§8) ------------------------------------------------------ */
.thread-list { display: flex; flex-direction: column; }
.thread-row {
  display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: baseline; width: 100%; text-align: left;
  padding: 12px 2px; border-bottom: 1px solid var(--border); background: none; border-left: none; border-right: none; border-top: none;
  transition: background var(--fast);
}
.thread-row:hover { background: var(--surface); }
.thread-row:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-radius: var(--radius-s); }
.thread-row .tr-name { font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.thread-row.unread .tr-name { font-weight: 600; }
.thread-row .tr-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); flex: none; }
.thread-row .tr-time { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.thread-row .tr-preview { grid-column: 1 / 2; font-size: 12px; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-row .tr-preview.system { color: var(--danger); }
.sys-icon { display: inline-flex; vertical-align: -2px; margin-right: 4px; }
.sys-icon svg { width: 13px; height: 13px; display: block; }

.thread-view { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 12px; }
.thread-bubble {
  max-width: 75%; padding: 10px 12px; border-radius: var(--radius-m); font-size: 14px;
  font-family: var(--font-read); line-height: 1.5;
  /* QA-SWEEP-01 P1-7 — an unbroken run (URL, code, adversarial input, or
     just a long word) had no break opportunity and blew out the WHOLE page
     width at 390px, not just the bubble. overflow-wrap:anywhere breaks even
     inside an unbroken run once max-width is hit; word-break is the older
     fallback for engines that don't honor overflow-wrap. */
  overflow-wrap: anywhere; word-break: break-word;
}
.thread-bubble .tb-time { display: block; font-size: 10px; color: var(--text-faint); margin-top: 4px; font-family: var(--font); }
.thread-bubble.out { align-self: flex-end; background: var(--surface-2); color: var(--text); }
.thread-bubble.in  { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
/* the reply-in-flight tick — literally the queue's chip.sending idiom (D5's
   one glow), reused verbatim at bubble scale; never a second glow invented */
.thread-bubble .tb-tick { margin-top: 5px; }
.thread-system { align-self: center; font-size: 11px; color: var(--danger); text-align: center; padding: 4px 0; }
.thread-system .ts-time { color: var(--text-faint); display: block; }

/* ---- composer (§8.2, enabled — was disabled-only) ---- */
.thread-composer {
  position: sticky; bottom: calc(56px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 6px; background: var(--surface); border-top: 1px solid var(--border);
  padding: 10px 16px 12px; margin: 0 -16px;
}
.thread-composer.suppressed { flex-direction: row; align-items: center; opacity: 0.7; }
.thread-composer .tc-note { flex: 1; font-size: 12px; color: var(--text-dim); line-height: 1.4; cursor: not-allowed; }
.tc-mode-note { font-size: 11px; color: var(--text-faint); text-align: center; line-height: 1.4; }
.tc-row { display: flex; align-items: flex-end; gap: 8px; }
.tc-input-wrap { position: relative; flex: 1; min-width: 0; }
.thread-composer textarea {
  display: block; width: 100%; resize: none; overflow: hidden; max-height: 140px; min-height: 40px;
  font-family: var(--font-read); font-size: 14px; line-height: 1.4; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 10px 12px; caret-color: var(--green);
}
.thread-composer textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.thread-composer textarea::placeholder { color: var(--text-faint); }
.thread-composer textarea:disabled { color: transparent; cursor: not-allowed; }
.tc-skel {
  position: absolute; inset: 0; display: none; flex-direction: column; justify-content: center; gap: 6px;
  padding: 0 12px; border-radius: var(--radius-s); pointer-events: none;
}
.tc-input-wrap.drafting .tc-skel { display: flex; }
.tc-skel i {
  display: block; height: 9px; border-radius: 3px; width: 55%;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.tc-skel i:last-child { width: 32%; }
.tc-draft { flex: none; }
.thread-composer .tc-send {
  flex: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: var(--radius-s); color: var(--text); background: none;
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
.thread-composer .tc-send:hover:not(:disabled) { border-color: var(--green); color: var(--green); }
.thread-composer .tc-send:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); }
.thread-composer .tc-send:disabled { color: var(--text-faint); cursor: not-allowed; }
.tc-foot { display: flex; justify-content: flex-end; min-height: 12px; }
.tc-counter { font-size: 10px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.tc-counter.over { color: var(--danger); }
.tc-hint { font-size: 11px; color: var(--text-faint); text-align: center; padding: 4px 0 0; }
.skel-thread { display: flex; flex-direction: column; gap: 12px; }
.skel-thread i {
  display: block; height: 40px; border-radius: var(--radius-m); width: 65%;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%; animation: shimmer 1.4s linear infinite;
}
.skel-thread i:nth-child(even) { align-self: flex-end; width: 55%; }

/* ---- H. arrival (§6) + help sheet -------------------------------------- */
.arrival {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  justify-content: flex-end; padding: 40px 28px calc(48px + env(safe-area-inset-bottom));
  background: #0a0a0f;
}
.arrival::before {
  content: ''; position: absolute; inset: 0;
  background: url('assets/patagonia-dawn.jpg') center/cover no-repeat;
  z-index: 0;
}
.arrival::after {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(10,10,15,0.15) 0%, rgba(10,10,15,0.55) 55%, rgba(10,10,15,0.92) 100%);
}
.arrival > * { position: relative; z-index: 2; }
.arrival .arr-lockup { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.arrival .arr-mark { width: 40px; height: 40px; color: var(--gold); }
.arrival .arr-mark svg { width: 100%; height: 100%; display: block; }
.arrival .arr-word { font-size: 16px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
.arrival .arr-line { font-size: 15px; color: var(--text); line-height: 1.6; max-width: 30ch; margin-bottom: 28px; font-family: var(--font-read); }
.arrival .btn { align-self: flex-start; min-width: 160px; justify-content: center; }
.arrival.auth { justify-content: center; align-items: center; text-align: center; }
.arrival.auth::before { background-position: center; opacity: 0.5; }

/* login screen (public/screen-login.js, #/login) — the form sits inside .arrival.auth;
   .arr-line above already centers/constrains itself, the form below reads
   left-aligned (label above field) at the same max-width so the two don't
   visually fight. One field, one button, one calm error line (H1). */
.arrival.auth .login-form {
  width: 100%; max-width: 300px; text-align: left; display: flex; flex-direction: column;
}
.arrival.auth .login-form .field-label { margin-top: 0; }
.arrival.auth .login-form .btn {
  align-self: stretch; justify-content: center; min-width: 0; margin-top: 16px;
}
.login-error { font-size: 12px; color: var(--danger); margin-top: 12px; line-height: 1.5; }

/* help sheet — bottom sheet on mobile, reuses .modal/.scrim elevation */
.help-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: var(--surface); border-top: 1px solid var(--border-hi);
  border-radius: var(--radius-l) var(--radius-l) 0 0; padding: 12px 20px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0,0,0,0.5); animation: sheet-up var(--slow);
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.help-sheet .hs-grab { width: 36px; height: 4px; border-radius: var(--radius-pill); background: var(--border-hi); margin: 0 auto 14px; }
.help-sheet h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.help-sheet .hs-row { display: flex; align-items: center; gap: 14px; padding: 6px 0; font-size: 13px; }
.help-sheet .hs-key {
  flex: none; min-width: 40px; text-align: center; font-family: var(--font); font-size: 12px;
  background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 4px 8px; color: var(--text);
}
.help-sheet .hs-desc { color: var(--text-dim); }
.help-sheet .hs-close { margin-top: 16px; width: 100%; justify-content: center; }

/* undo affordance inside a toast — the toast stack is pointer-events:none,
   so the actionable button must re-enable pointer events on itself. */
.toast .toast-undo {
  background: none; border: none; color: var(--green); font-family: var(--font); font-size: 12px;
  font-weight: 600; text-decoration: underline; text-underline-offset: 2px; pointer-events: auto;
  padding: 2px 4px; min-height: 28px;
}
.toast .toast-undo:hover { color: var(--text); }
.toast { pointer-events: auto; }

/* more screen */
.info-panel {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 14px 16px; margin-bottom: 12px;
}
.info-panel .ip-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 12px; }
.info-panel .ip-row .ip-k { color: var(--text-dim); }
.info-panel .ip-row .ip-v { color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.more-action {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 14px 16px; min-height: 44px; color: var(--text); font-size: 13px; font-family: var(--font);
  transition: border-color var(--fast); margin-bottom: 12px;
}
.more-action:hover { border-color: var(--border-hi); }
.more-action:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.version-line { font-size: 11px; color: var(--text-faint); text-align: center; padding: 8px 0; }

/* ---- desktop bonus (≥640px): nav moves inline (top of app), one component -
   Phone-first is primary (§0); desktop is a minor bonus surface. Each screen
   owns its own brand header, so the inline nav sits at the top of the app
   (above the screen header) rather than mid-screen — same 5 items, one
   component, no left rail. body becomes a flex column purely to order the
   static nav above the scrolling screen. */
@media (min-width: 640px) {
  body { display: flex; flex-direction: column; }
  #banner-offline { order: 1; }
  .nav-bar { order: 2; }
  .app-shell { order: 3; }
  .nav-bar {
    position: static; border-top: none; border-bottom: 1px solid var(--border);
    /* width must be explicit: auto cross-axis margins on a flex item cancel
       align-items:stretch, which shrink-wrapped the bar to its content */
    width: min(720px, calc(100% - 48px));
    max-width: 720px; margin: 16px auto; border-radius: var(--radius-m);
    border: 1px solid var(--border);
  }
  .nav-item { justify-content: center; }
  .nav-item { min-height: 48px; flex-direction: row; gap: 7px; }
  .nav-item .ni-label { font-size: 11px; }
  .app-shell { padding-bottom: 24px; }
  .action-bar, .thread-composer { bottom: 0; }
  /* action-bar is position:fixed at every width (AUD-01 #2) — at desktop,
     constrain it to the same centered column as .nav-bar/.app-shell above
     instead of spanning the full viewport edge-to-edge. */
  .action-bar {
    left: 50%; right: auto; transform: translateX(-50%);
    width: min(720px, calc(100% - 48px)); border-radius: var(--radius-m) var(--radius-m) 0 0;
  }
  .help-sheet {
    left: 50%; right: auto; bottom: auto; top: 50%; transform: translate(-50%, -50%);
    width: 360px; max-width: calc(100vw - 32px); border-radius: var(--radius-l); border: 1px solid var(--border-hi);
    animation: none;
  }
  .help-sheet .hs-grab { display: none; }
  .guardrail-box .gb-num, .wizard-tile .wt-num { }
}

/* ==========================================================================
   Z. Import clients (client-import mission, app/PATCHES-importui.md) —
   screen-import.js, routed from More → "Import clients" (screen-more.js).
   Every rule below reuses the existing token set and the wizard/results
   visual grammar (.wizard-progress/.back-row/.field-*/.action-bar/.chip/
   .table-wrap/.compose-loading/.secondary-stat/.block-reason/.audience-
   preview.warn are all reused verbatim, not restated) — the additions here
   are exactly the pieces that don't already exist: a file-picker affordance,
   a keyboard-accessible way to visually hide its native input, a textarea
   variant of .field-input, the 5-tile verdict/3-tile result strip, and a
   height-capped variant of the existing table idiom.
   ========================================================================== */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.file-picker-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.file-picker-row label.btn { display: inline-flex; align-items: center; justify-content: center; }
.file-picker-row .file-name { font-size: 12px; color: var(--text-dim); word-break: break-all; }

textarea.field-input { font-family: var(--font-read); line-height: 1.5; min-height: 140px; resize: vertical; }

.import-tiles { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.import-tile {
  flex: 1 1 92px; min-width: 88px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 14px 8px; text-align: center;
}
.import-tile .it-num { font-size: 22px; font-weight: 600; line-height: 1; }
.import-tile .it-label { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-top: 6px; }
.import-tile.new .it-num { color: var(--green); }
.import-tile.invalid .it-num { color: var(--amber); } /* calm caution, not alarm — see the row-invalid tint below */
.import-tile.consent .it-num { color: var(--blue); }

.table-wrap.capped { max-height: 320px; overflow-y: auto; }
tbody tr.row-invalid { background: #fbbf2412; }
tbody tr.row-invalid:hover { background: #fbbf241c; }
.imp-issues-cell { color: var(--text-dim); font-size: 11px; }
