/* ============================================================
   SACRED COMMAND v3 — core.css (the only stylesheet)
   "Dark cockpit, calm": near-black layered surfaces, warm-gray
   text, ONE accent (Sacred crimson #c8102e) used only for the
   primary action per row, urgent chips, and the active tab.
   Max 5 blocks per screen is enforced by the views, not CSS.
   ============================================================ */

:root {
  /* v3 palette */
  --bg-0: #0b0b0d;
  --bg-1: #131316;
  --bg-2: #18181c;
  --hairline: #232328;
  --hairline-hi: #2e2e35;
  --text-1: #e8e6e3;
  --text-2: #8a8886;
  --text-3: #5c5a58;
  --accent: #c8102e;
  --accent-dim: rgba(200, 16, 46, 0.14);

  --font-serif: 'Playfair Display', Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --r: 12px;
  --r-sm: 9px;

  /* ---- v2 compat aliases (the Front Desk Demo view uses these verbatim) ---- */
  --bg0: var(--bg-0);
  --bg1: var(--bg-1);
  --bg2: var(--bg-2);
  --bg3: #1e1e23;
  --line: var(--hairline);
  --line-hi: var(--hairline-hi);
  --text: var(--text-1);
  --text2: var(--text-2);
  --text3: var(--text-3);
  --red: var(--accent);
  --red-dim: var(--accent-dim);
  --crimson: #c8102e;
  --crimson-dim: rgba(200, 16, 46, 0.16);
  --good: #22c55e;            /* demo view only — the cockpit itself stays grayscale */
  --good-dim: rgba(34, 197, 94, 0.14);
  --warn: #eab308;
  --warn-dim: rgba(234, 179, 8, 0.14);
  --gold: #C8A158;
  --gold-dim: rgba(200, 161, 88, 0.15);
  --cream: #ede7da;
  --font-display: var(--font-serif);
  --font-ui: var(--font-sans);
  --font-mono: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, monospace;
  --radius: var(--r);
  --radius-sm: var(--r-sm);
  --radius-xs: 7px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
  --speed: 120ms;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, svg { max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
ul, ol { list-style: none; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-2); border-radius: 8px; border: 2px solid var(--bg-0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3 { font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; color: var(--text-1); }
h1 { font-family: var(--font-serif); font-size: 22px; }
h2 { font-size: 15px; }
h3 { font-size: 13.5px; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.num, .mono { font-variant-numeric: tabular-nums lining-nums; }
.section-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-3);
}

/* ---------- shell ---------- */
#topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 18px;
  height: 56px; padding: 0 20px;
  background: rgba(11, 11, 13, 0.94);
  border-bottom: 1px solid var(--hairline);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.wordmark { display: flex; align-items: baseline; gap: 7px; flex: 0 0 auto; }
.wordmark .wm-1 { font-family: var(--font-serif); font-weight: 800; font-size: 15px; letter-spacing: 0.16em; color: var(--text-1); }
.wordmark .wm-2 { font-size: 10px; font-weight: 700; letter-spacing: 0.3em; color: var(--text-3); }

#tabs { display: flex; align-items: stretch; gap: 2px; height: 100%; }
.tab {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 0 14px; font-size: 13.5px; font-weight: 600; color: var(--text-2);
  border-bottom: 2px solid transparent;
  transition: color var(--speed) ease;
}
.tab:hover { color: var(--text-1); }
.tab.active { color: var(--text-1); border-bottom-color: var(--accent); }
.tab .badge { position: static; }

.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 12px; border-radius: var(--r-sm);
  border: 1px solid var(--hairline); background: var(--bg-1);
  color: var(--text-2); font-size: 12.5px; font-weight: 600;
  transition: color var(--speed) ease, border-color var(--speed) ease;
}
.top-btn:hover { color: var(--text-1); border-color: var(--hairline-hi); }
.demo-btn { color: var(--text-1); border-color: rgba(200, 16, 46, 0.5); }
.icon-btn { position: relative; padding: 7px 9px; }

#view { max-width: 1180px; margin: 0 auto; padding: 26px 20px 90px; }
.view-in { animation: viewIn 120ms ease; }
@keyframes viewIn { from { opacity: 0; transform: translateY(4px); } }

/* mobile bottom tabs */
#mobileTabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: none;
  background: rgba(11, 11, 13, 0.96);
  border-top: 1px solid var(--hairline);
  padding-bottom: env(safe-area-inset-bottom);
}
.mtab {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 52px; font-size: 10.5px; font-weight: 600; color: var(--text-3); position: relative;
}
.mtab.active { color: var(--text-1); }
.mtab.active::after { content: ""; position: absolute; top: 0; left: 25%; right: 25%; height: 2px; background: var(--accent); }
.mtab .badge { position: absolute; top: 6px; right: calc(50% - 22px); }

@media (max-width: 760px) {
  #tabs { display: none; }
  #mobileTabs { display: flex; }
  #topbar { gap: 10px; }
  .demo-btn { font-size: 11.5px; padding: 7px 9px; }
  #view { padding: 18px 14px 110px; }
}

/* ---------- blocks (Today template) ---------- */
.block { margin-bottom: 24px; }
.block-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.block-head h2 { font-family: var(--font-serif); font-size: 16px; font-weight: 700; }
.block-head .right { margin-left: auto; }
.clear-line { color: var(--text-3); font-size: 13px; padding: 10px 2px; }

/* ---------- card + rows ---------- */
.card {
  background: var(--bg-1);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
}
.card.pad { padding: 16px; }
.qrow {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--hairline);
  min-height: 44px;
}
.qrow:last-child { border-bottom: none; }
.qrow .grow { flex: 1; min-width: 0; }
.qrow-title { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.qrow-sub { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.qrow-actions { display: flex; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; }
.qrow.breach { border-left: 3px solid var(--accent); }

/* count-rows (Approvals block) */
.count-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--hairline);
  color: var(--text-1); font-size: 13.5px; font-weight: 600;
  transition: background var(--speed) ease;
}
.count-row:hover { background: var(--bg-2); }
.count-row:last-child { border-bottom: none; }
.count-row .n { margin-left: auto; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.count-row .go { color: var(--text-3); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 6px 13px;
  border-radius: var(--r-sm);
  background: var(--bg-2); border: 1px solid var(--hairline);
  color: var(--text-1); font-size: 12.5px; font-weight: 600; line-height: 1.2;
  white-space: nowrap;
  transition: border-color var(--speed) ease, background var(--speed) ease;
}
.btn:hover { border-color: var(--hairline-hi); background: #1c1c21; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-red { background: var(--accent); border-color: transparent; color: #fff; }
.btn-red:hover { background: #a90d27; border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--bg-2); color: var(--text-1); border-color: transparent; }
.btn-sm { min-height: 28px; padding: 4px 10px; font-size: 12px; border-radius: 7px; }
@media (max-width: 760px) { .btn, .btn-sm { min-height: 44px; } }

/* ---------- chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--bg-2);
  color: var(--text-2); font-size: 11px; font-weight: 600; white-space: nowrap;
}
.chip-red { color: #ff8296; background: var(--accent-dim); border-color: transparent; }
.chip-dim { color: var(--text-3); }
.chip-quiet { color: var(--text-2); }
/* v2 compat chip kinds (used by ported demo/meeting surfaces) */
.chip-good { color: var(--text-2); background: var(--bg-2); }
.chip-warn { color: var(--text-2); background: var(--bg-2); }
.chip-gold { color: var(--gold); background: var(--gold-dim); border-color: transparent; }
.chip-crimson { color: #ff8296; background: var(--crimson-dim); border-color: transparent; }

/* freshness dot — grayscale-quiet, red only when stale */
.fdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: 0 0 auto; }
.fdot.ok { background: var(--text-2); }
.fdot.stale { background: var(--accent); }

/* ---------- badge ---------- */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.badge[hidden] { display: none; }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 8px 12px;
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-3); border-bottom: 1px solid var(--hairline);
}
.table td { padding: 10px 12px; border-bottom: 1px solid var(--hairline); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--bg-2); }

/* ---------- inputs ---------- */
.input, .textarea, .select {
  width: 100%; padding: 9px 12px;
  background: var(--bg-2); border: 1px solid var(--hairline); border-radius: var(--r-sm);
  color: var(--text-1); font-size: 13px;
  transition: border-color var(--speed) ease;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); outline: none; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.textarea { resize: vertical; min-height: 80px; line-height: 1.5; }

/* ---------- drawer / scrim / modal / toast ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 100vw;
  background: var(--bg-1); border-left: 1px solid var(--hairline);
  box-shadow: var(--shadow);
  transform: translateX(105%); transition: transform 200ms cubic-bezier(0.32, 0.72, 0.28, 1);
  z-index: 60; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--hairline); }
.drawer-head h2 { flex: 1; font-size: 15px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); }

.scrim {
  position: fixed; inset: 0; background: rgba(6, 6, 8, 0.6);
  opacity: 0; pointer-events: none; transition: opacity 180ms ease; z-index: 55;
}
.scrim.show { opacity: 1; pointer-events: auto; }

.modal-scrim {
  position: fixed; inset: 0; background: rgba(6, 6, 8, 0.65);
  display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 70;
  animation: fadeIn 120ms ease;
}
.modal {
  width: 500px; max-width: 100%; max-height: 84vh;
  display: flex; flex-direction: column;
  background: var(--bg-1); border: 1px solid var(--hairline); border-radius: var(--r);
  box-shadow: var(--shadow);
  animation: modalIn 140ms cubic-bezier(0.32, 0.72, 0.28, 1);
}
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--hairline); }
.modal-head h2 { flex: 1; font-size: 15px; }
.modal-body { padding: 16px 18px; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--hairline); }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(0.99); } }
@keyframes fadeIn { from { opacity: 0; } }

#toasts {
  position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; z-index: 90; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 8px; max-width: 340px;
  padding: 10px 14px; background: var(--bg-2);
  border: 1px solid var(--hairline-hi); border-left: 3px solid var(--text-2);
  border-radius: var(--r-sm); box-shadow: var(--shadow-sm);
  font-size: 13px; font-weight: 500;
  animation: toastIn 180ms cubic-bezier(0.32, 0.72, 0.28, 1);
}
.toast-warn, .toast-err { border-left-color: var(--accent); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 220ms ease, transform 220ms ease; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- login gate ---------- */
#loginGate[hidden] { display: none !important; }
#loginGate {
  position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 620px at 22% -8%, rgba(200, 16, 46, 0.13), transparent 60%), var(--bg-0);
  font-family: var(--font-sans);
}
#loginGate .lg-card {
  width: min(400px, 92vw);
  background: linear-gradient(180deg, #17171b, #101013);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 18px;
  padding: 40px 34px; text-align: center;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
}
#loginGate .lg-mark { font-family: var(--font-serif); font-weight: 800; font-size: 13px; letter-spacing: 0.34em; text-transform: uppercase; color: #fff; }
#loginGate .lg-rule { width: 40px; height: 3px; background: var(--accent); border-radius: 2px; margin: 14px auto 22px; }
#loginGate h1 { font-family: var(--font-serif); font-size: 26px; font-weight: 700; color: #fff; margin: 0 0 6px; }
#loginGate p { font-size: 13.5px; color: var(--text-2); margin: 0 0 24px; line-height: 1.5; }
#loginGate input {
  width: 100%; background: var(--bg-0); border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 11px;
  padding: 13px 15px; color: #fff; font-size: 15px; margin-bottom: 12px;
}
#loginGate input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
#loginGate button {
  width: 100%; background: var(--accent); color: #fff; font-weight: 700; font-size: 15px;
  border: none; border-radius: 11px; padding: 14px; margin-top: 6px;
}
#loginGate button:disabled { opacity: 0.6; cursor: default; }
#loginGate .lg-err { color: #ff6b7d; font-size: 13px; min-height: 18px; margin-top: 10px; }
#loginGate .lg-foot { margin-top: 20px; font-size: 11.5px; color: var(--text-3); letter-spacing: 0.04em; }

/* ---------- no-access / arena hand-off cards ---------- */
.fullcard-wrap {
  position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1100px 620px at 78% -8%, rgba(200, 16, 46, 0.12), transparent 60%), var(--bg-0);
}
.fullcard {
  width: min(440px, 94vw); text-align: center;
  background: linear-gradient(180deg, #17171b, #101013);
  border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 18px; padding: 44px 36px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
}
.fullcard h1 { font-family: var(--font-serif); font-size: 24px; margin: 14px 0 8px; }
.fullcard p { color: var(--text-2); font-size: 13.5px; line-height: 1.55; margin-bottom: 22px; }
.fullcard .btn-red { width: 100%; min-height: 46px; font-size: 14.5px; }

/* ---------- present mode ---------- */
body.present #topbar, body.present #mobileTabs { display: none; }
body.present #view { max-width: none; padding: 20px 28px; }
#presentExit {
  position: fixed; top: 14px; right: 14px; z-index: 120;
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--bg-2); border: 1px solid var(--hairline-hi); color: var(--text-1); font-size: 15px;
}

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(180px, 1fr)); gap: 10px; overflow-x: auto; }
.kcol { background: var(--bg-1); border: 1px solid var(--hairline); border-radius: var(--r); min-height: 120px; }
.kcol-head { padding: 10px 12px; border-bottom: 1px solid var(--hairline); font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); display: flex; gap: 8px; align-items: center; }
.kcard { margin: 8px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--hairline); border-radius: var(--r-sm); }
.kcard-t { font-size: 13px; font-weight: 600; }
.kcard-m { font-size: 11.5px; color: var(--text-2); margin: 3px 0 8px; }
@media (max-width: 900px) { .kanban { display: flex; flex-direction: column; } }

/* ---------- misc utility ---------- */
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.right { margin-left: auto; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 900px) { .grid4 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .grid4, .grid2 { grid-template-columns: 1fr; } }
.hidden { display: none !important; }

/* pulse row (Today block 5) */
.pulse-row { display: flex; flex-wrap: wrap; gap: 26px; padding: 16px; align-items: baseline; }
.pulse-item { display: flex; flex-direction: column; gap: 2px; }
.pulse-n { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text-1); }
.pulse-l { font-size: 11px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); }

/* client health strip */
.health-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 980px) { .health-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .health-grid { grid-template-columns: 1fr; } }
.hcard {
  display: block; background: var(--bg-1); border: 1px solid var(--hairline); border-radius: var(--r);
  padding: 14px 16px; transition: border-color var(--speed) ease;
}
.hcard:hover { border-color: var(--hairline-hi); }
.hcard.breach { border-left: 3px solid var(--accent); }
.hcard-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.hcard-stats { margin-top: 8px; display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--text-2); }
.hcard-stats .bad { color: #ff8296; }

/* retry chip for failed writes */
.retry-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-dim); color: #ff8296; border: 1px solid rgba(200, 16, 46, 0.4);
  font-size: 11px; font-weight: 700; cursor: pointer;
}

/* ============================================================
   v3.1 — Inbox channel tabs, triage, SMS threads,
   Portal Control (switches + client-view), freshness strips
   ============================================================ */

/* channel tabs — real tabs with real badges, not tiny corner tags */
.chan-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.chan-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--r-sm);
  background: var(--bg-1); border: 1px solid var(--hairline);
  color: var(--text-2); font-size: 13.5px; font-weight: 600;
  transition: color var(--speed) ease, border-color var(--speed) ease;
}
.chan-tab:hover { color: var(--text-1); border-color: var(--hairline-hi); }
.chan-tab.active { color: var(--text-1); border-color: var(--accent); background: var(--bg-2); }
.chan-tab .badge { position: static; }

/* bulk-selection bar */
.bulk-bar {
  position: sticky; top: 60px; z-index: 30;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 12px;
  background: var(--bg-2); border: 1px solid var(--hairline-hi); border-radius: var(--r-sm);
  box-shadow: var(--shadow-sm);
}
.ckb { width: 15px; height: 15px; accent-color: var(--accent); flex: 0 0 auto; cursor: pointer; }

/* expandable email rows */
.qrow-click { cursor: pointer; }
.qrow-click:hover { background: var(--bg-2); }
.email-detail { padding: 12px 16px 14px; border-bottom: 1px solid var(--hairline); background: var(--bg-0); }
.email-detail:last-child { border-bottom: none; }
.email-body { font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

/* sms thread */
.sms-thread { padding: 10px 16px; display: flex; flex-direction: column; gap: 6px; }
.sms-line { display: flex; gap: 10px; font-size: 12.5px; align-items: baseline; }
.sms-line .sms-who { flex: 0 0 44px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); text-align: right; }
.sms-line.mine .sms-who { color: var(--text-2); }
.sms-line .sms-text { color: var(--text-2); min-width: 0; }
.sms-line.mine .sms-text { color: var(--text-1); }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; inset: 0; border-radius: 999px; cursor: pointer;
  background: var(--bg-2); border: 1px solid var(--hairline-hi);
  transition: background var(--speed) ease, border-color var(--speed) ease;
}
.switch .slider::before {
  content: ""; position: absolute; left: 2px; top: 2px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-3); transition: transform 140ms ease, background var(--speed) ease;
}
.switch input:checked + .slider { background: var(--accent-dim); border-color: rgba(200, 16, 46, 0.55); }
.switch input:checked + .slider::before { transform: translateX(18px); background: var(--accent); }
.switch input:disabled + .slider { opacity: 0.4; cursor: not-allowed; }
.switch input:focus-visible + .slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* "view as client" preview — deliberately light, reads as THEIR surface */
.portal-prev {
  background: #f4f5f7; color: #1a1d24;
  border: 1px solid var(--hairline-hi); border-radius: var(--r);
  padding: 18px; position: relative; overflow: hidden;
}
.pv-ribbon {
  margin: -18px -18px 14px; padding: 8px 18px;
  background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
}
.pv-head { margin-bottom: 12px; }
.pv-name { font-family: var(--font-serif); font-size: 19px; font-weight: 700; color: #14161b; }
.pv-sub { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #8a909c; margin-top: 2px; }
.pv-card { background: #fff; border: 1px solid #e6e8ee; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.pv-k { font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: #c8102e; margin-bottom: 4px; }
.pv-t { font-size: 13px; line-height: 1.5; color: #333a45; }
.pv-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.pv-stat { flex: 1 1 100px; background: #fff; border: 1px solid #e6e8ee; border-radius: 12px; padding: 12px 14px; }
.pv-n { font-size: 20px; font-weight: 800; color: #14161b; font-variant-numeric: tabular-nums; }
.pv-l { font-size: 11px; color: #8a909c; margin-top: 2px; }
.pv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; flex-wrap: wrap; }

/* roster freshness strip */
.fresh-strip { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding-top: 9px; border-top: 1px solid var(--hairline); }
.fresh-mini { display: inline-flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-3); }
.fresh-mini .fdot { width: 6px; height: 6px; }
