/* ============================================================
   PORCHLIGHT · Morning Porch — TOOL register (dankmire-tool.md)
   Tokens verbatim from ~/tools/design/languages/dankmire-tool.md
   Justin lives here every morning: calm, dense, glow only on
   what is actually running (D5) — nothing here runs, so nothing
   glows. Register: TOOL (R1) — private daily operator cockpit.
   ============================================================ */
:root {
  --bg:        #0a0a0f;
  --surface:   #12121a;
  --surface-2: #1a1a25;
  --surface-3: #232330;
  --border:    #2a2a3a;
  --border-hi: #3a3a4e;

  --text:      #e6e9f0;
  --text-dim:  #8888a0;
  --text-faint:#55556a;

  --green:     #4ade80;
  --green-dim: #2d7a4a;
  --purple:    #a78bfa;
  --purple-dim:#4c3d78;

  --blue:      #60a5fa;
  --teal:      #5eead4;
  --amber:     #fbbf24;
  --danger:    #f87171;

  --glow-green: 0 0 12px #4ade8055, 0 0 32px #4ade8022;

  --radius-s: 6px;  --radius-m: 8px;  --radius-l: 12px;  --radius-pill: 999px;
  --fast: 0.15s ease;
  --slow: 0.3s ease;
  --font: 'JetBrains Mono','Fira Code',ui-monospace,monospace;
}

/* ============================================================
   LIGHT THEME (2026-08-02, deliberate register exception)
   dankmire-tool.md says TOOL surfaces are "dark-native, no light
   mode ever" — this cockpit breaks that rule on Justin's explicit
   instruction, because it gets used standing in a driveway in
   August sun, where a near-black screen is the harder read. Every
   OTHER register property (density, spacing scale, mono font,
   tracked-uppercase labels, motion, no lifts) is unchanged — only
   the color layer swaps. C4 still applies in the light direction:
   background is a cool near-white, never pure #fff on the page
   canvas (the CARD surfaces are #fff; the page behind them isn't).
   All accents re-picked to clear 4.5:1 on this bg (measured, see
   git history for the contrast-ratio script). Toggled via the
   header button; persisted in localStorage; defaults to the OS's
   prefers-color-scheme on first visit.
   ============================================================ */
:root[data-theme="light"] {
  --bg:        #f4f5f8;
  --surface:   #ffffff;
  --surface-2: #eceef3;
  --surface-3: #dfe2ea;
  --border:    #d5d8e0;
  --border-hi: #b8bcc8;

  --text:      #14141c;
  --text-dim:  #55566a;
  --text-faint:#6b6c80;

  --green:     #15803d;
  --green-dim: #bbf7d0;
  --purple:    #7c3aed;
  --purple-dim:#ddd6fe;

  --blue:      #2563eb;
  --teal:      #0f766e;
  --amber:     #b45309;
  --danger:    #b91c1c;

  --glow-green: 0 0 12px #15803d33, 0 0 32px #15803d1a;
}
/* Solid CTA fills need their OWN pair (not --green/--green-dim) because the dark-mode idiom
   pairs a near-white "on-fill" text color with a resting fill dark enough to carry it — in
   light mode the resting fill has to be the darker element instead, so text stays white in
   both states rather than flipping to near-black (C1: reusing --green-dim here would silently
   change what that token means across the app). */
:root[data-theme="light"] .btn-primary,
:root[data-theme="light"] .btn-interested {
  background: #15803d; border-color: #15803d; color: #ffffff;
}
:root[data-theme="light"] .btn-primary:hover,
:root[data-theme="light"] .btn-interested:hover {
  background: #14532d; border-color: #14532d; color: #ffffff;
}
:root[data-theme="light"] .cm-dial { background: #15803d; color: #ffffff; }
:root[data-theme="light"] .cm-dial:hover { background: #14532d; }

* { 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;
  min-height: 100vh;
}
body { padding-bottom: 64px; }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) var(--bg); } /* P2 */
*::-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; } /* P3 */
a { color: var(--blue); }
button { font: inherit; }
.num { font-variant-numeric: tabular-nums; } /* T7 */
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* ============================================================
   TOP BAR
   ============================================================ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 16px 20px 0;
}
.topbar-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.eyebrow {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; /* T5 */
  color: var(--text-dim); font-weight: 500; margin-bottom: 6px;
}
h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
h1 .accent { color: var(--green); }
.topbar-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar-date { font-size: 11px; color: var(--text-faint); }
.icon-btn {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: var(--radius-s); padding: 7px 10px; cursor: pointer;
  font-family: var(--font); font-size: 11px;
  transition: border-color var(--fast), color var(--fast);
}
.icon-btn:hover { border-color: var(--border-hi); color: var(--text); }
.icon-btn:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.icon-btn:active { background: var(--surface-3); }
.icon-btn.spinning { color: var(--green); }

/* Tabs — C9 active is always green */
.tabs { display: flex; gap: 4px; margin-top: 14px; }
.tab {
  font-family: var(--font); font-size: 12px; background: none; border: none;
  border-bottom: 2px solid transparent; color: var(--text-dim);
  padding: 9px 4px; margin-right: 20px; cursor: pointer;
  transition: color var(--fast), border-color var(--fast);
}
.tab:hover { color: var(--text); }
.tab:focus-visible { outline: none; color: var(--green); box-shadow: inset 0 0 0 1px var(--green); border-radius: 4px; }
.tab.active { color: var(--green); border-bottom-color: var(--green); }
.tab .n { color: var(--text-faint); font-variant-numeric: tabular-nums; margin-left: 4px; }
.tab.active .n { color: var(--green); opacity: 0.8; }

/* ============================================================
   PAGE / VIEWS
   ============================================================ */
.page { max-width: 1200px; margin: 0 auto; padding: 20px; }
.view { display: none; }
.view.active { display: block; }
.view-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.view-head h2 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 500;
}
.view-head .sub { font-size: 11px; color: var(--text-faint); }

/* ============================================================
   CHIPS / TAGS
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 7px; border-radius: 4px; font-weight: 600; line-height: 1.3;
  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.amber  { background: #fbbf2422; color: var(--amber); }
.chip.amber .cdot { background: var(--amber); }
.chip.blue   { background: #60a5fa22; color: var(--blue); }
.chip.blue .cdot { background: var(--blue); }
.chip.purple { background: #a78bfa22; color: var(--purple); }
.chip.purple .cdot { background: var(--purple); }
.chip.danger { background: #f8717122; color: var(--danger); }
.chip.danger .cdot { background: var(--danger); }
.chip.idle   { background: #8888a01a; color: var(--text-dim); }
.chip.idle .cdot { background: var(--text-faint); }

/* Static informational tag — descriptive metadata, not a state (site status, vertical) */
.tag {
  display: inline-block; font-size: 10px; letter-spacing: 0.02em;
  color: var(--text-dim); border: 1px solid var(--border);
  border-radius: 4px; padding: 3px 7px; white-space: nowrap;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--font); font-size: 12px; line-height: 1.2;
  padding: 7px 14px; border-radius: var(--radius-s);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-dim); cursor: pointer; white-space: nowrap;
  transition: border-color var(--fast), color var(--fast), background var(--fast);
}
.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 { background: var(--green); border-color: var(--green); color: #06140b; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { 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: 5px 10px; font-size: 11px; }
.btn.copied { color: var(--green); border-color: var(--green-dim); }

/* ============================================================
   TODAY — lead cards
   ============================================================ */
.lead-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.lead-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-m); padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color var(--fast);
  cursor: pointer;
}
.lead-card:hover { border-color: var(--border-hi); }
.lead-card:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.lc-top { display: flex; align-items: flex-start; gap: 10px; }
.lc-score {
  flex: none; width: 28px; height: 28px; border-radius: var(--radius-s);
  background: var(--surface-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text-dim);
}
.lc-name { font-size: 13px; font-weight: 600; }
.lc-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.lc-top .chip { margin-left: auto; flex: none; }
.lc-facts { display: flex; align-items: center; gap: 10px; font-size: 11px; color: var(--text-dim); flex-wrap: wrap; }
.lc-facts .v { color: var(--text); font-weight: 600; }
.lc-phone { font-size: 12px; color: var(--text); }
.lc-hook {
  background: var(--surface-2); border-left: 2px solid var(--purple-dim);
  border-radius: 0 4px 4px 0; padding: 8px 10px;
  font-size: 12px; color: var(--text-dim); line-height: 1.5;
}
.lc-hook.missing { border-left-color: var(--border); color: var(--text-faint); font-style: normal; }
.lc-hook b { color: var(--text); font-weight: 500; }
.lc-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.lc-actions .btn { flex: none; }
.lc-actions .spacer { flex: 1; }

/* Inline "log" form, collapsed by default */
.log-form {
  display: none; flex-direction: column; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-s); padding: 10px; margin-top: 4px;
}
.log-form.open { display: flex; }
.log-form-row { display: flex; gap: 8px; }
.log-form select, .log-form input {
  font-family: var(--font); font-size: 12px; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-s); padding: 6px 8px; flex: 1;
  min-width: 0;
}
.log-form select:focus, .log-form input:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green);
}
.log-form-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ============================================================
   PIPELINE — kanban board
   ============================================================ */
/* Horizontal scroll lives INSIDE this container only — the page itself never overflows (IN2).
   Affordance = the themed scrollbar (P2); a permanent edge-fade would lie once fully scrolled. */
.board-wrap { overflow-x: auto; padding-bottom: 8px; }
.board { display: flex; gap: 10px; min-width: max-content; }
.col {
  width: 216px; flex: none;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-m); padding: 10px;
  display: flex; flex-direction: column; gap: 8px;
}
.col.has-leads { border-color: var(--border-hi); }
.col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 6px; border-bottom: 1px solid var(--border); }
.col-head .stage-name { font-size: 10px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-dim); font-weight: 600; }
.col-head .count { font-size: 12px; font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; }
.col-empty { font-size: 11px; color: var(--text-faint); padding: 6px 2px; }
.col-lead {
  background: var(--surface-2); border: 1px solid transparent;
  border-radius: var(--radius-s); padding: 8px 9px; cursor: pointer;
  transition: border-color var(--fast), background var(--fast);
}
.col-lead:hover { border-color: var(--border-hi); background: var(--surface-3); }
.col-lead:focus-visible { outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.col-lead .cl-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* IN5 */
.col-lead .cl-meta { font-size: 10px; color: var(--text-faint); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   AWAITING — reply rows
   ============================================================ */
.wait-list { display: flex; flex-direction: column; gap: 8px; }
.wait-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-m); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 8px;
}
.wait-row-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.wait-name { font-size: 13px; font-weight: 600; cursor: pointer; border-radius: 4px; }
.wait-name:hover { color: var(--green); }
.wait-name:focus-visible { outline: none; color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.wait-town { font-size: 11px; color: var(--text-faint); }
.wait-days { margin-left: auto; font-size: 11px; color: var(--amber); font-variant-numeric: tabular-nums; }
.wait-days.stale { color: var(--danger); }
.wait-summary { font-size: 12px; color: var(--text-dim); }
.wait-actions { display: flex; gap: 6px; }

/* ============================================================
   STATE PANELS — empty / loading / error (ST2/ST3/ST4/ST5)
   ============================================================ */
.state-panel {
  min-height: 160px; 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: 10px; padding: 24px; text-align: center;
}
.state-panel .glyph { font-size: 22px; color: var(--text-faint); letter-spacing: 0.1em; }
.state-panel .glyph.err { color: var(--danger); }
.state-panel .glyph.ok { color: var(--green); }
.state-panel .msg { font-size: 13px; color: var(--text-dim); max-width: 42ch; }
.state-panel .msg b { color: var(--text); font-weight: 600; }
.skel { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; }
.skel 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;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.skel i:nth-child(1) { width: 55%; } .skel i:nth-child(2) { width: 85%; } .skel i:nth-child(3) { width: 70%; }

/* ============================================================
   DRAWER — lead detail (D3/D4/D6 floating rung, glass on scrim only)
   ============================================================ */
.scrim {
  position: fixed; inset: 0; background: rgba(10,10,15,0.6); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity var(--slow); z-index: 40;
}
.scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 92vw;
  background: var(--surface); border-left: 1px solid var(--border-hi);
  box-shadow: -20px 0 60px rgba(0,0,0,0.5);
  transform: translateX(100%); transition: transform var(--slow);
  z-index: 41; display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  padding: 18px 18px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 10px;
}
.drawer-head .dh-title { flex: 1; min-width: 0; }
.drawer-head h3 { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drawer-head .dh-sub { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.drawer-close {
  flex: none; background: none; border: 1px solid var(--border); color: var(--text-dim);
  border-radius: var(--radius-s); width: 28px; height: 28px; cursor: pointer;
  font-size: 13px; line-height: 1;
}
.drawer-close:hover { border-color: var(--border-hi); color: var(--text); }
.drawer-close:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); }
.drawer-body { flex: 1; overflow-y: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 22px; }
.drawer-section h4 {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 500; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.kv-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 12px; }
.kv-grid dt { color: var(--text-faint); }
.kv-grid dd { color: var(--text); word-break: break-word; }
.mini-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
.mini-table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-faint); font-weight: 500; padding: 5px 6px; border-bottom: 1px solid var(--border);
}
.mini-table td { padding: 6px 6px; border-bottom: 1px solid var(--border); color: var(--text-dim); vertical-align: top; overflow-wrap: break-word; }
.mini-table tr:last-child td { border-bottom: none; }
.mini-table .val { color: var(--text); overflow-wrap: break-word; }
/* Field/Observed are short tokens; Source is a URL — truncate it (IN5), full value in title. */
.mini-table th:nth-child(1), .mini-table td:nth-child(1) { width: 78px; overflow-wrap: break-word; }
.mini-table th:nth-child(3), .mini-table td:nth-child(3) {
  width: 22%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: help;
}
.mini-table th:nth-child(4), .mini-table td:nth-child(4) { width: 64px; }
.timeline { display: flex; flex-direction: column; gap: 10px; }
.timeline-row { display: flex; gap: 8px; font-size: 11px; }
.timeline-row .t-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--border-hi); margin-top: 5px; }
.timeline-row .t-body { flex: 1; color: var(--text-dim); }
.timeline-row .t-body b { color: var(--text); font-weight: 600; }
.timeline-row .t-when { color: var(--text-faint); }
.stage-form { display: flex; flex-direction: column; gap: 8px; }
.stage-form select, .stage-form textarea {
  font-family: var(--font); font-size: 12px; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-s); padding: 8px 10px; width: 100%;
}
.stage-form textarea { resize: vertical; min-height: 52px; }
.stage-form select:focus, .stage-form textarea:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green);
}
.field-label {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-dim); font-weight: 500;
}

/* ============================================================
   TOASTS (ST6 — success is quiet)
   ============================================================ */
.toast-stack {
  position: fixed; bottom: 16px; right: 16px; z-index: 200;
  display: flex; flex-direction: column-reverse; gap: 8px;
  max-width: min(90vw, 360px);
}
.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;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4); font-size: 12px;
  animation: toast-in var(--slow);
}
.toast.err { border-left-color: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============================================================
   CALL COCKPIT — Justin's dial screen (2026-08-02)
   CALL LIST reuses the lead-card idiom (S3 — one spacing scale).
   CALL MODE is the one place in this app that deliberately bumps
   type size (T2 — one extra step, 16px, added for the opener block
   only) because it is read ALOUD under mild adrenaline, not
   scanned like everything else here.
   ============================================================ */
.call-list { display: flex; flex-direction: column; gap: 10px; }
.call-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-m); padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 12px; text-align: left; width: 100%;
  font-family: var(--font); transition: border-color var(--fast);
}
.call-card:hover { border-color: var(--border-hi); }
.call-card:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.call-card.pinned { border-color: var(--green-dim); }
.cc-rank {
  flex: none; width: 26px; height: 26px; border-radius: var(--radius-s);
  background: var(--surface-3); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-dim);
}
.call-card.pinned .cc-rank { background: #4ade8026; border-color: var(--green-dim); color: var(--green); }
.cc-main { flex: 1; min-width: 0; }
.cc-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.cc-meta .v { color: var(--text-dim); }
.cc-arrow { flex: none; color: var(--text-faint); font-size: 16px; }

.call-done-toggle {
  display: flex; align-items: center; gap: 6px; background: none; border: none;
  color: var(--text-faint); font-family: var(--font); font-size: 11px; cursor: pointer;
  padding: 10px 2px; width: 100%; text-align: left;
}
.call-done-toggle:hover { color: var(--text-dim); }
.call-done-toggle:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-radius: 4px; }
.call-done-list { display: none; flex-direction: column; gap: 6px; margin-top: 4px; }
.call-done-list.open { display: flex; }
.call-done-row {
  display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-faint);
  padding: 8px 10px; background: var(--surface-2); border-radius: var(--radius-s);
}
.call-done-row .name { color: var(--text-dim); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Timing rule banner — an ST5-style tint panel. Never blocking; always says what to do instead. */
.timing-banner {
  display: flex; align-items: flex-start; gap: 10px;
  border: 1px solid var(--border); border-left: 3px solid var(--border-hi);
  border-radius: var(--radius-m); background: var(--surface);
  padding: 10px 14px; margin-bottom: 14px; font-size: 12px; color: var(--text-dim);
}
.timing-banner .ti-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; margin-top: 5px; background: var(--text-faint); }
.timing-banner.good { border-left-color: var(--green); }
.timing-banner.good .ti-dot { background: var(--green); }
.timing-banner.off, .timing-banner.sunday { border-left-color: var(--amber); }
.timing-banner.off .ti-dot, .timing-banner.sunday .ti-dot { background: var(--amber); }
.timing-banner b { color: var(--text); font-weight: 600; }

/* ============================================================
   CALL MODE — full-screen focused takeover (D4 floating rung)
   ============================================================ */
.cm-scrim {
  position: fixed; inset: 0; background: rgba(10,10,15,0.6); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; transition: opacity var(--slow); z-index: 45;
}
.cm-scrim.open { opacity: 1; pointer-events: auto; }
.callmode {
  position: fixed; inset: 0; background: var(--bg); z-index: 46;
  display: flex; flex-direction: column;
  transform: translateY(100%); transition: transform var(--slow);
}
.callmode.open { transform: translateY(0); }
.cm-head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--border); background: var(--bg);
}
.cm-back {
  flex: none; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-dim);
  border-radius: var(--radius-s); padding: 8px 12px; font-family: var(--font); font-size: 12px;
  cursor: pointer; transition: border-color var(--fast), color var(--fast); min-height: 44px;
}
.cm-back:hover { border-color: var(--border-hi); color: var(--text); }
.cm-back:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.cm-head-name { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-body {
  flex: 1; overflow-y: auto; padding: 18px 18px calc(32px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 20px; max-width: 560px; margin: 0 auto; width: 100%;
}

.cm-identity h3 { font-size: 20px; font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }
.cm-identity .cc-meta { font-size: 12px; margin-top: 4px; }
.cm-facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.cm-dial {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--green-dim); color: #eafff2; border: 1px solid var(--green-dim);
  border-radius: var(--radius-m); padding: 16px; min-height: 56px;
  font-family: var(--font); font-size: 20px; font-weight: 700; letter-spacing: 0.01em;
  text-decoration: none; transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.cm-dial:hover { background: var(--green); border-color: var(--green); color: #06140b; }
.cm-dial:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--green); }
.cm-dial .icon { font-size: 18px; }
.cm-dial .num { font-variant-numeric: tabular-nums; }

.cm-opener {
  background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--purple-dim);
  border-radius: 0 var(--radius-m) var(--radius-m) 0; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 12px;
}
.cm-opener .cm-o-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--purple); font-weight: 600;
}
.cm-opener p { font-size: 16px; line-height: 1.6; color: var(--text); }
.cm-opener p.ask { color: var(--text-dim); }

.cm-valuemath { display: flex; flex-direction: column; gap: 4px; }
.cm-valuemath p { font-size: 13px; color: var(--text-dim); line-height: 1.5; }

.cm-objections-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text);
  border-radius: var(--radius-s); padding: 10px 14px; font-family: var(--font); font-size: 12px;
  font-weight: 600; cursor: pointer; transition: border-color var(--fast); min-height: 44px;
}
.cm-objections-toggle:hover { border-color: var(--border-hi); }
.cm-objections-toggle:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.cm-objections-toggle .chev { color: var(--text-faint); transition: transform var(--fast); display: inline-block; }
.cm-objections-toggle.open .chev { transform: rotate(180deg); }
.cm-objections-list { display: none; flex-direction: column; gap: 10px; margin-top: 10px; }
.cm-objections-list.open { display: flex; }
.cm-obj { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 10px 12px; }
.cm-obj .q { font-size: 12px; font-weight: 600; color: var(--text); }
.cm-obj .a { font-size: 12px; color: var(--text-dim); margin-top: 4px; line-height: 1.5; }

.cm-notes label.field-label { display: block; margin-bottom: 6px; }
.cm-notes textarea {
  width: 100%; min-height: 76px; resize: vertical;
  font-family: var(--font); font-size: 13px; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-s); padding: 10px 12px;
}
.cm-notes textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green); }
.cm-notes .save-state { font-size: 10px; color: var(--text-faint); margin-top: 4px; height: 14px; }

.cm-outcomes-today { display: flex; flex-direction: column; gap: 6px; }
.cm-outcome-logged {
  display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-dim);
  background: var(--surface-2); border-radius: var(--radius-s); padding: 8px 10px;
}
.cm-outcome-logged .t-when { color: var(--text-faint); margin-left: auto; }

.cm-outcomes { display: flex; flex-direction: column; gap: 10px; }
.cm-outcome-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cm-outcome-btn {
  font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--text-dim);
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-s);
  padding: 12px 10px; cursor: pointer; min-height: 44px;
  transition: border-color var(--fast), color var(--fast);
}
.cm-outcome-btn:hover { border-color: var(--border-hi); color: var(--text); }
.cm-outcome-btn:focus-visible { outline: none; box-shadow: 0 0 0 1px var(--green); border-color: var(--green); }
.cm-outcome-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: #f8717111; }

.cm-inline-form {
  display: none; flex-direction: column; gap: 8px; grid-column: 1 / -1;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-s); padding: 10px;
}
.cm-inline-form.open { display: flex; }
.cm-inline-form input, .cm-inline-form select {
  font-family: var(--font); font-size: 12px; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--radius-s); padding: 8px 10px; width: 100%;
}
.cm-inline-form input:focus, .cm-inline-form select:focus {
  outline: none; border-color: var(--green); box-shadow: 0 0 0 1px var(--green);
}
.cm-inline-form-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* INTERESTED — H4/D5: the one loud thing on the screen. Size + a fill that's SOLID at rest
   (every other button here only fills on hover) are the two knobs; everything around it stays
   quiet so this reads unmistakably as the moment the whole engine exists for. */
.btn-interested {
  width: 100%; font-family: var(--font); font-size: 16px; font-weight: 700;
  background: var(--green-dim); color: #eafff2; border: 1px solid var(--green-dim);
  border-radius: var(--radius-m); padding: 18px; cursor: pointer; min-height: 60px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--fast), border-color var(--fast), color var(--fast);
}
.btn-interested:hover { background: var(--green); border-color: var(--green); color: #06140b; }
.btn-interested:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--green); }

.cm-email { display: flex; flex-direction: column; gap: 6px; }
.cm-email .note { font-size: 11px; color: var(--text-faint); }

/* ============================================================
   MOBILE — 375px first-class (MB1–MB7)
   ============================================================ */
@media (max-width: 640px) {
  .page { padding: 14px; }
  .topbar { padding: 12px 14px 0; }
  .lead-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; max-width: 100%; top: auto; height: 88vh; border-left: none;
    border-top: 1px solid var(--border-hi); border-radius: var(--radius-l) var(--radius-l) 0 0;
    transform: translateY(100%); box-shadow: 0 -20px 60px rgba(0,0,0,0.5); }
  .drawer.open { transform: translateY(0); }
  .drawer::before { /* grab handle — MB4 gesture affordance */
    content: ''; display: block; width: 36px; height: 4px; border-radius: 2px;
    background: var(--border-hi); margin: 8px auto 0;
  }
  .wait-days { margin-left: 0; }
  /* MB1 — visual size may stay compact, but the hit area must reach 44px on touch */
  .btn, .icon-btn { min-height: 44px; }
  .drawer-close { width: 44px; height: 44px; }
  .col-lead { min-height: 44px; display: flex; flex-direction: column; justify-content: center; }
  .wait-name { display: inline-flex; align-items: center; min-height: 44px; }
  .tab { min-height: 44px; display: inline-flex; align-items: center; }

  /* CALL COCKPIT — MB1/MB3: everything already sized 44px+ above; this is layout only. */
  .cm-body { padding: 16px 16px calc(28px + env(safe-area-inset-bottom)); gap: 18px; }
  .cm-outcome-grid { gap: 6px; }
  .cm-outcome-btn { font-size: 11px; padding: 12px 6px; }
  .cm-opener p { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ============================================================
   PORCH PORTAL additions (2026-08-02)
   Same TOOL register and same tokens as the desk cockpit above —
   this file is that stylesheet, extended, not a second design.
   New surfaces: the login gate, the sync banner (this app is a
   MIRROR of Zeus, so it must always say how fresh it is), and the
   Done-for-today control.
   Every rule here is width-safe at 375px: no fixed widths, no
   nowrap on wrapping content, and every flex row may wrap.
   ============================================================ */

.login-wrap {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-l); padding: 26px 22px 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.login-card h1 { font-size: 26px; margin: 2px 0 0; letter-spacing: -0.5px; }
.login-sub { color: var(--text-dim); font-size: 12px; margin: 0 0 6px; line-height: 1.5; }
.login-card input[type="password"] {
  width: 100%; box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: 16px; /* 16px: iOS zooms below it */
  padding: 13px 12px; border-radius: var(--radius-m);
}
.login-card input[type="password"]:focus { outline: none; border-color: var(--purple); }
.login-card .btn { width: 100%; justify-content: center; padding: 14px; font-size: 14px; margin-top: 4px; }
.login-error { color: var(--danger); font-size: 12px; min-height: 16px; line-height: 1.4; }

/* The portal is a MIRROR, never the source of truth — it says so, always. */
.sync-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-left: 2px solid var(--purple-dim);
  border-radius: var(--radius-m); padding: 9px 12px; margin-bottom: 12px;
  font-size: 11px; color: var(--text-dim); line-height: 1.5;
}
.sync-banner.stale { border-left-color: var(--amber); }
.sync-banner b { color: var(--text); font-weight: 500; }

.done-wrap { margin: 22px 0 40px; }
.btn-done {
  width: 100%; box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--border-hi); color: var(--text);
  font-family: var(--font); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  padding: 16px; border-radius: var(--radius-m); cursor: pointer; transition: border-color var(--fast);
}
.btn-done:hover { border-color: var(--green-dim); }
.btn-done:disabled { opacity: 0.55; cursor: default; }
.done-note {
  margin-top: 8px; font-size: 11px; color: var(--text-faint); text-align: center; line-height: 1.5;
}

/* Long numbers/URLs must never widen the page on a phone. */
.cm-dial .num, .cc-meta, .cm-facts, .lead-note { overflow-wrap: anywhere; }
.cm-prior { margin: 14px 0 0; }
.cm-prior .prior-line {
  font-size: 11px; color: var(--text-dim); line-height: 1.6;
  padding: 6px 0; border-bottom: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.cm-prior .prior-line:last-child { border-bottom: none; }

/* The `hidden` attribute is a UA `display:none` rule — any author `display:` declaration beats
   it. `.login-wrap { display:flex }` did exactly that, and the login card rendered stacked on top
   of the signed-in list (caught in the 375px visual gate, not by any assertion). Author-level
   [hidden] restores the intent for every element in this app, permanently. */
[hidden] { display: none !important; }

/* A CLOSED call-mode overlay is translated off-screen but still rendered and still focusable —
   so tabbing from the list could land inside a screen that is not on screen. Hide it outright
   until it opens; the transform still animates because visibility is not interpolated. */
.callmode { visibility: hidden; }
.callmode.open { visibility: visible; }
