/* Dark-first theme: one true-neutral gray scale, one accent (a muted
   Radix-style green), semantic color used only for genuine status meaning.
   Spacing/radius scale from linear.app's DESIGN.md (vendor/engines/
   awesome-design-md). Revamped against PyML/vendor/engines/taste-skill's
   redesign-skill audit checklist — see the git log for specifics.

   Light mode follows the user's OS setting (prefers-color-scheme), not a
   manual toggle — every token below is redefined under the light media
   query further down, so nothing here should ever be a hardcoded hex/rgba
   outside of :root's own token definitions (that's what makes the light
   override a complete swap instead of a partial one).

   docs/DESIGN.md has the rules this file follows (one next step per
   screen in --pop, dim what's behind the focus, notices as feed items). */

@font-face {
  font-family: 'Geist';
  src: url('/static/fonts/Geist-Variable.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #0a0a0b;
  --bg-card: #131315;
  --bg-card-sub: #1a1a1d;
  --bg-hover: #202023;
  --line: rgba(255, 255, 255, 0.06);
  --border-color: #232326;

  --accent: #22a076;
  --accent-ink: #04140f;
  --border-accent: rgba(34, 160, 118, 0.35);

  /* The unexpected accent: violet against a green brand. Only ever on the
     one next step a screen is asking for (docs/DESIGN.md). */
  --pop: #b197fc;
  --pop-ink: #150a33;
  --pop-soft: rgba(177, 151, 252, 0.22);

  /* What's behind the focused thing drops to 40%: 2.5:1 against it. */
  --behind: 0.4;

  --fg: #ededef;
  --text-primary: #f7f7f8;
  --text-secondary: #9b9ba1;
  --dim: #85858c;
  /* form-field edges: 3:1 against the surface they sit on */
  --field-border: #6c6c72;
  --lit-edge: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --ease-out: cubic-bezier(0.2, 0.9, 0.3, 1);

  --warning-amber: #d99a3c;
  --warning-amber-border: rgba(217, 154, 60, 0.35);
  --danger-rose: #ec5a5f;
  --danger-rose-border: rgba(229, 72, 77, 0.35);
  --danger-rose-bg: rgba(229, 72, 77, 0.1);

  --font-sans: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* spacing: 4 / 8 / 12 / 16 / 24 / 32 / 48 */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.5rem;
  --sp-6: 2rem;
  --sp-7: 3rem;

  /* radius: 4 / 6 / 8 / 12 / pill */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-pill: 999px;

  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.4), 0 24px 48px -24px rgba(0, 0, 0, 0.6), var(--lit-edge);
  --z-toast: 1000;
  --z-overlay: 900;
}

/* Same roles, light values — a dark-first design swaps the palette here
   rather than the other way around. Deepened accent/amber/rose versus their
   dark-mode hues (not just the same hex on a light background) because a
   color tuned to read against near-black doesn't have enough contrast as
   text/icons against near-white. */
@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f7f7f8;
    --bg-card: #ffffff;
    --bg-card-sub: #f1f1f3;
    --bg-hover: #ececef;
    --line: rgba(0, 0, 0, 0.06);
    --border-color: #e3e3e7;

    --accent: #177352;
    --accent-ink: #ffffff;
    --border-accent: rgba(23, 115, 82, 0.3);

    --pop: #6741d9;
    --pop-ink: #ffffff;
    --pop-soft: rgba(103, 65, 217, 0.16);

    --fg: #1c1c1f;
    --text-primary: #09090b;
    --text-secondary: #57575f;
    --dim: #68686f;
    --field-border: #86868d;
    --lit-edge: inset 0 1px 0 rgba(255, 255, 255, 0.9);

    --warning-amber: #8f5a0a;
    --warning-amber-border: rgba(143, 90, 10, 0.3);
    --danger-rose: #c22a30;
    --danger-rose-border: rgba(194, 42, 48, 0.3);
    --danger-rose-bg: rgba(194, 42, 48, 0.08);

    --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 24px 48px -24px rgba(0, 0, 0, 0.14), var(--lit-edge);
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { text-wrap: pretty; }

.icon { width: 1em; height: 1em; display: inline-block; vertical-align: -0.125em; flex-shrink: 0; }

.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: -3rem;
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  font-size: 0.85rem;
  font-weight: 600;
  z-index: var(--z-toast);
  transition: top 0.12s;
}
.skip-link:focus { top: var(--sp-3); }

/* Buttons, chips, and tabs all get their own focus-visible ring (previously
   only inputs did — everything else fell back to the browser default
   outline, which doesn't match the accent and is barely visible on near-
   black backgrounds in some browsers). */
.btn:focus-visible, .chip:focus-visible, .agent-tab:focus-visible, .icon-btn:focus-visible,
#agent-panel-title:focus-visible, #connections-panel-title:focus-visible, #mcp-panel-title:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.side-link:focus-visible, .more-menu button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.app-shell { display: flex; align-items: stretch; min-height: 100vh; min-height: 100dvh; }

/* --- sidebar --- */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  border-right: 1px solid var(--line);
  padding: var(--sp-5) var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
}
.brand { position: relative; display: flex; align-items: center; gap: var(--sp-2); font-size: 1.15rem; font-weight: 650; letter-spacing: -0.02em; color: var(--text-primary); }
.brand .mark { color: var(--accent); width: 1.15em; height: 1.15em; }
.brand-tag { margin: 0; color: var(--dim); font-size: 0.78rem; line-height: 1.5; }

/* --- activity particles: a real arrow rises from the logo each time an
   agent actually does something (qualify/draft/send) — not decorative, one
   per real event, capped so a burst of automated activity never spams the
   screen (see MAX_ACTIVITY_PARTICLES in app.js). One-shot animation, not a
   loop — the element removes itself when it finishes. --- */
#activity-particles { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
.activity-arrow {
  position: absolute; left: var(--x, 0); top: 50%; width: 14px; height: 14px;
  color: var(--accent); opacity: 0;
  animation: activity-arrow-rise 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes activity-arrow-rise {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  15%  { opacity: 1; transform: translateY(-4px) scale(1); }
  75%  { opacity: 0.9; }
  100% { transform: translateY(-38px) scale(0.85); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .activity-arrow { display: none; }
}
.agent-list { display: flex; flex-direction: column; gap: var(--sp-1); overflow-y: auto; }
.agent-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  font: inherit;
  font-size: 0.88rem;
  text-align: left;
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--r-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s, transform 0.08s;
}
.agent-tab:hover { background: var(--bg-hover); color: var(--fg); }
.agent-tab:active { transform: scale(0.98); }
/* --bg-card (#131315) sits almost on top of the sidebar's own near-black
   background (#0a0a0b) — as a fill alone the old active state read as
   "maybe a 1px border," not a selected tab. --border-accent (the same
   token used for a focus ring elsewhere) is translucent green at 35%
   opacity, a real, legible fill against that same dark background, not
   just a hairline. */
.agent-tab.active { background: var(--border-accent); border-color: var(--accent); color: var(--text-primary); font-weight: 600; }
.agent-tab .platform-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dim); flex-shrink: 0; }
.agent-tab.plat-x .platform-dot { background: var(--accent); }
.all-platforms-tab { width: 100%; }
.all-platforms-tab .icon { width: 15px; height: 15px; color: var(--dim); flex-shrink: 0; }
.all-platforms-tab.active .icon { color: var(--accent); }
.agent-tab.plat-reddit .platform-dot { background: var(--warning-amber); }
.sidebar-foot { margin-top: auto; color: var(--dim); font-size: 0.7rem; letter-spacing: 0.02em; }

.archived-toggle {
  font: inherit;
  font-size: 0.76rem;
  color: var(--dim);
  background: transparent;
  border: none;
  text-align: left;
  padding: var(--sp-1) var(--sp-3);
  cursor: pointer;
  border-radius: var(--r-sm);
}
.archived-toggle:hover { color: var(--text-secondary); }
.archived-toggle.hidden, .agent-list.hidden { display: none; }
.archived-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm);
  font-size: 0.82rem; color: var(--text-secondary);
}
.archived-row:hover { background: var(--bg-hover); }
.archived-actions { display: flex; gap: var(--sp-1); }

/* --- main --- */
.app-shell > main { flex: 1; min-width: 0; max-width: 820px; margin: 0 auto; padding: var(--sp-5) var(--sp-5) var(--sp-7); width: 100%; }

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
}
.card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.card-head h2 { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; color: var(--text-primary); }
.card-head-actions { display: flex; align-items: center; gap: var(--sp-2); }
/* Stats/Agent settings toggle buttons, pulled out of #add-lead-card into
   their own small always-visible card — unlike the form below them, they
   must stay reachable even while another panel is open (that's the whole
   point: switching from one panel to another), so they can't live inside
   anything updateMainContentVisibility hides. No content below the
   heading within this element, so .card-head's own margin-bottom would
   just be dead space inside the card. */
.agent-toolbar.card-head { margin-bottom: 0; }
.card.hidden { display: none; }

.replies-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.replies-table.hidden { display: none; }
.replies-table th {
  text-align: left; font-weight: 600; color: var(--text-secondary);
  padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border-color);
}
.replies-table td {
  padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border-color);
  vertical-align: top; color: var(--text-primary);
}
.replies-table tr:hover td { background: var(--bg-hover); }
.replies-table td.reply-snippet { max-width: 320px; color: var(--text-secondary); }

/* Three charts nested inside #stats-panel (itself a .card) — a plain div,
   not a second .card, so there's no doubled border/background inside an
   already-bordered panel. Each gets a small heading + top spacing instead
   of its own card-head row. */
.stats-block + .stats-block { margin-top: var(--sp-5); }
.stats-block h3 { margin: 0 0 var(--sp-3); font-size: 0.875rem; font-weight: 600; color: var(--text-secondary); }
.stats-block.hidden { display: none; }

/* Same open/close animation as #agent-panel/#connections-panel above. */
#stats-panel {
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
#stats-panel.opening { opacity: 0; transform: translateY(-8px) scale(0.99); }
@media (prefers-reduced-motion: reduce) {
  #stats-panel { transition: none; }
}

/* Agent settings panel open/close — a plain .hidden toggle can't animate
   (display:none has no interpolatable state), so app.js drives this via an
   intermediate .opening class instead of removing/adding .hidden directly. */
#agent-panel {
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
#agent-panel.opening { opacity: 0; transform: translateY(-8px) scale(0.99); }
@media (prefers-reduced-motion: reduce) {
  #agent-panel { transition: none; }
}

label {
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: var(--sp-3);
  flex: 1;
  min-width: 200px;
}
label.hidden { display: none; }
form.hidden { display: none; }

.dm-conversation-list {
  display: flex; flex-direction: column; gap: var(--sp-2);
  margin-top: var(--sp-3); max-height: 320px; overflow-y: auto;
  padding: var(--sp-3); border: 1px solid var(--border-color); border-radius: var(--r-md);
}
.dm-conversation-list.hidden { display: none; }
.dm-message { max-width: 75%; padding: var(--sp-2) var(--sp-3); border-radius: var(--r-md); font-size: 0.82rem; }
.dm-message.outgoing { align-self: flex-end; background: var(--bg-card-sub); }
.dm-message.incoming { align-self: flex-start; background: var(--bg-hover); }
.dm-message .dm-message-meta { font-size: 0.72rem; color: var(--text-secondary); margin-bottom: 2px; }
.dm-message.is-new { outline: 2px solid var(--accent); outline-offset: -1px; }
input, textarea, select {
  font: inherit;
  font-size: 0.88rem;
  background: var(--bg-card-sub);
  color: var(--fg);
  border: 1px solid var(--field-border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-3);
  min-height: 2.75rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="number"] { font-variant-numeric: tabular-nums; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.row { display: flex; gap: var(--sp-4); flex-wrap: wrap; }
.row > label { min-width: 200px; }
.actions-row { align-items: center; margin-top: var(--sp-1); }
.field-hint { margin: calc(var(--sp-3) * -1) 0 var(--sp-3); color: var(--dim); font-size: 0.74rem; }

.platform-note {
  font-size: 0.76rem;
  color: var(--dim);
  background: var(--bg-card-sub);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: var(--sp-2) var(--sp-3);
  margin: calc(var(--sp-3) * -1) 0 var(--sp-3);
}
.platform-note.ok { color: var(--accent); border-color: var(--border-accent); }
.platform-note.hidden { display: none; }
.platform-note.warn { color: var(--warning-amber); border-color: var(--warning-amber-border); }

.agent-connect-block { margin: calc(var(--sp-3) * -1) 0 var(--sp-3); }
.agent-connect-block.hidden { display: none; }

/* --- platform connections --- */
.connections-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.1rem; height: 1.1rem; padding: 0 0.3em; margin-left: auto;
  border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink);
  font-size: 0.68rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.connections-badge.hidden { display: none; }

#connections-panel {
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1), transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
#connections-panel.opening { opacity: 0; transform: translateY(-8px) scale(0.99); }

.connect-row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-2); margin: 0 calc(var(--sp-2) * -1);
  border-top: 1px solid var(--line); border-radius: var(--r-sm);
  transition: background 0.12s;
}
.connect-row:first-child { border-top: none; }
.connect-row:hover { background: var(--bg-hover); }
.connect-row-icon {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 2.1rem; height: 2.1rem; border-radius: var(--r-md);
  background: var(--bg-card-sub); border: 1px solid var(--border-color); color: var(--fg);
}
.connect-row-icon .icon { width: 1.05rem; height: 1.05rem; }
.connect-row-main { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 0; }
.connect-row-name { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }
.connect-row-name em { color: var(--dim); font-style: normal; }
.connect-row-status { display: flex; align-items: center; gap: var(--sp-1); font-size: 0.76rem; color: var(--dim); }
.connect-row-status .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-color); flex-shrink: 0; }
.connect-row-status .dot.ok { background: var(--accent); }

a.btn { text-decoration: none; }
.btn {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--r-pill);
  min-height: 2.5rem;
  padding: var(--sp-2) var(--sp-5);
  justify-content: center;
  border: 1px solid var(--field-border);
  background: var(--bg-card-sub);
  color: var(--fg);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  transition: border-color 0.12s, color 0.12s, opacity 0.12s, background 0.12s, transform 0.08s;
}
.btn:hover { border-color: var(--border-accent); }
.btn:active { transform: translateY(1px) scale(0.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { opacity: 0.9; }
.btn.pop { background: var(--pop); border-color: var(--pop); color: var(--pop-ink); font-weight: 600; box-shadow: 0 0 0 4px var(--pop-soft); }
.btn.pop:hover { opacity: 0.92; border-color: var(--pop); }
/* secondary: quieter, but still an edge you can see. Bare text isn't a button. */
.btn.quiet { background: transparent; border-color: var(--border-color); color: var(--text-secondary); }
.btn.quiet:hover { color: var(--fg); background: var(--bg-hover); border-color: var(--field-border); }
.btn.danger { color: var(--danger-rose); border-color: var(--danger-rose-border); background: transparent; }
.btn.danger:hover { border-color: var(--danger-rose); }
.btn.ghost { background: transparent; color: var(--accent); border-color: var(--border-accent); }
.btn.small { font-size: 0.78rem; min-height: 2rem; padding: var(--sp-1) var(--sp-3); }
.btn.block { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn .spinner {
  width: 0.9em; height: 0.9em; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.6s linear infinite; flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .btn .spinner { animation-duration: 1.4s; }
}
.icon-btn {
  background: transparent; border: none; color: var(--dim);
  cursor: pointer; line-height: 1; padding: var(--sp-1) var(--sp-2); border-radius: var(--r-sm);
  display: inline-flex; align-items: center; justify-content: center;
  transition: color 0.12s, background 0.12s;
}
.icon-btn .icon { width: 1.15em; height: 1.15em; }
.icon-btn:hover { color: var(--fg); background: var(--bg-hover); }

.chips { display: flex; gap: var(--sp-2); flex-wrap: wrap; }

/* Status chips + the cinema-mode "Review" button share one row, button
   pinned to the far right — via absolute positioning, deliberately not a
   flex row. A flex wrapper's own height is the TALLER of its two
   children, so whenever the button was visible, the chips (vertically
   centered in that now-taller box) ended up shifted away from their own
   natural position — confirmed live: the chips' own Y moved depending on
   whether the button happened to be showing. Taking the button fully out
   of flow instead means #status-filter's own height/position is never
   affected by the button's presence or size at all; the button is
   positioned to match wherever the chips already are, not the other way
   around. #status-filter itself (app.js's renderStatusChips) reserves
   room on its own right edge only while the button is actually visible
   (the has-cinema-button class, toggled alongside #cinema-toggle-bar's
   own hidden class) so a long chip row never runs under it.
*/
.status-filter-row {
  position: relative;
  margin-bottom: var(--sp-4);
}
.chips.has-cinema-button { padding-right: 190px; }
/* Hidden while any panel is open (updateMainContentVisibility in app.js)
   — same "no generic .hidden rule exists" codebase convention as every
   other .hidden pairing; #leads has no class of its own to pair with, so
   it's paired by id directly. */
#status-filter.hidden, #leads.hidden { display: none; }
.chip {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  border: 1px solid var(--line);
  background: transparent;
  border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-3);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, transform 0.08s;
}
.chip:hover { color: var(--text-secondary); }
.chip:active { transform: scale(0.96); }
.chip.active { color: var(--accent); border-color: var(--border-accent); background: var(--bg-card); }
.chip .n { opacity: 0.7; margin-left: var(--sp-1); }

.lead-card {
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-card);
  padding: var(--sp-4) var(--sp-4);
  margin-bottom: var(--sp-3);
  background: var(--bg-card);
  transition: border-color 0.15s;
}
.lead-card:hover { border-color: var(--border-accent); }
.lead-card .meta { display: flex; gap: var(--sp-2); align-items: center; font-size: 0.75rem; color: var(--dim); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.lead-card .status {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--r-pill);
  padding: 0.1rem 0.55rem;
  border: 1px solid var(--line);
}
/* Status color carries real meaning, not decoration: gray = nothing decided
   yet, amber = waiting on your review/send, green = moved forward, rose =
   dead end. "qualified"/"sent"/"replied" share green on purpose — the label
   text (not the color alone) is what tells them apart, same as a checklist. */
.status.new { color: var(--text-secondary); }
.status.qualified { color: var(--accent); border-color: var(--border-accent); }
.status.rejected { color: var(--danger-rose); border-color: var(--danger-rose-border); }
.status.drafted { color: var(--warning-amber); border-color: var(--warning-amber-border); }
.status.sent { color: var(--accent); border-color: var(--border-accent); }
.status.replied,
.status.signup { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.lead-card .meta a { color: var(--text-secondary); }
.lead-card .meta a:hover { color: var(--fg); }
.lead-card .content { color: var(--fg); margin-bottom: var(--sp-3); white-space: pre-wrap; }
.lead-card .score { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.8rem; font-variant-numeric: tabular-nums; color: var(--text-secondary); margin-bottom: var(--sp-3); }
.lead-card .score-bar { flex: 1; max-width: 120px; height: 5px; border-radius: var(--r-pill); background: var(--bg-card-sub); overflow: hidden; }
.lead-card .score-bar span { display: block; height: 100%; background: var(--warning-amber); }
.lead-card .draft { background: var(--bg-card-sub); border-radius: var(--r-md); padding: var(--sp-3); margin-bottom: var(--sp-3); }
.lead-card .draft textarea { width: 100%; min-height: 4em; }
.lead-card .posted { font-size: 0.78rem; margin-bottom: var(--sp-3); }
.lead-card .posted a { color: var(--accent); }
.lead-card .send-error { font-size: 0.78rem; color: var(--danger-rose); margin-bottom: var(--sp-3); }
.lead-card .actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.empty { color: var(--dim); padding: var(--sp-7) 0; text-align: center; font-size: 0.9rem; }
.empty.hidden { display: none; }

/* --- toasts (replaces window.alert() for surfacing errors) --- */
.toast-stack {
  position: fixed;
  bottom: var(--sp-5);
  right: var(--sp-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: min(360px, calc(100vw - 3rem));
}
.toast {
  background: var(--bg-card);
  border: 1px solid var(--danger-rose-border);
  box-shadow: var(--shadow-card);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  font-size: 0.85rem;
  color: var(--fg);
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  animation: toast-in 0.15s ease-out;
}
.toast .icon { color: var(--danger-rose); margin-top: 0.15em; }
.toast.ok { border-color: var(--border-accent); }
.toast.ok .icon { color: var(--accent); }
.toast .dismiss { margin-left: auto; background: none; border: none; color: var(--dim); cursor: pointer; padding: 0; line-height: 1; }
.toast .dismiss:hover { color: var(--fg); }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* --- responsive: sidebar becomes a top bar below tablet width --- */
@media (max-width: 760px) {
  .app-shell { flex-direction: column; }
  .sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--line);
  }
  .agent-list, .archived-list { max-height: 40vh; }
  .app-shell > main { padding: var(--sp-4); }
  .toast-stack { left: var(--sp-4); right: var(--sp-4); max-width: none; bottom: var(--sp-4); }
}

/* --- account (sidebar footer, replacing the old owner-token flow) --- */
.account {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  margin-top: auto; padding-top: var(--sp-3); border-top: 1px solid var(--line);
}
.account .who { min-width: 0; }
.account .email { display: block; font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.account .workspace { display: block; font-size: 0.7rem; color: var(--dim); }

/* --- auth pages (login / register) --- */
.auth-body {
  display: flex; align-items: center; justify-content: center; min-height: 100vh; min-height: 100dvh;
  padding: var(--sp-4);
}
.auth-card {
  width: 100%; max-width: 380px;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: var(--sp-6) var(--sp-5);
}
.auth-brand { justify-content: center; margin-bottom: var(--sp-5); text-decoration: none; }
.auth-card h1 { font-size: 1.2rem; font-weight: 650; letter-spacing: -0.01em; text-align: center; margin: 0 0 var(--sp-5); color: var(--text-primary); }
.auth-switch { text-align: center; font-size: 0.85rem; color: var(--text-secondary); margin: var(--sp-4) 0 0; }
.auth-switch a { color: var(--accent); }
.form-error {
  background: var(--danger-rose-bg); border: 1px solid var(--danger-rose-border); color: var(--danger-rose);
  border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); font-size: 0.82rem; margin: 0 0 var(--sp-4);
}
.form-notice {
  background: var(--bg-card-sub); border: 1px solid var(--line); color: var(--text-secondary);
  border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); font-size: 0.82rem; margin: 0 0 var(--sp-4);
}

/* --- landing page --- */
.landing-nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; row-gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-5); max-width: 1100px; margin: 0 auto;
  backdrop-filter: blur(8px);
}
.landing-nav .links { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; justify-content: flex-end; row-gap: var(--sp-2); }
.landing-nav a.text-link { color: var(--text-secondary); font-size: 0.9rem; text-decoration: none; }
.landing-nav a.text-link:hover { color: var(--fg); }
.landing-nav .links .nav-sep { color: var(--line); font-size: 0.9rem; }

/* --- mobile nav menu: pure CSS checkbox toggle, no JS dependency so it
   works on every page that includes this nav (privacy/terms/404 included,
   not just the pages that load landing.js) --- */
.nav-toggle-checkbox { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.nav-toggle-btn {
  /* overriding the generic `label { flex:1; min-width:200px; ... }` rule
     (built for dashboard form fields) that would otherwise leak in here */
  display: none; flex: none; flex-direction: row; align-items: center; justify-content: center;
  width: 2.25rem; height: 2.25rem; min-width: 0; margin-bottom: 0; gap: 0;
  border-radius: var(--r-sm); cursor: pointer; color: var(--fg);
}
.nav-toggle-btn:hover { background: var(--bg-hover); }
.nav-toggle-checkbox:focus-visible ~ .nav-toggle-btn { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (max-width: 640px) {
  .nav-toggle-btn { display: inline-flex; }
  .landing-nav .links {
    display: none; width: 100%; flex-basis: 100%;
    flex-direction: column; align-items: stretch; gap: var(--sp-1);
    background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg);
    padding: var(--sp-3); margin-top: var(--sp-2); box-shadow: var(--shadow-card);
  }
  .landing-nav .links a.text-link { padding: var(--sp-2) var(--sp-2); }
  .landing-nav .links .btn { justify-content: center; margin-top: var(--sp-1); }
  .nav-toggle-checkbox:checked ~ .links { display: flex; }
}

.hero {
  position: relative;
  max-width: 720px; margin: 0 auto; padding: var(--sp-7) var(--sp-5) var(--sp-6);
  text-align: center;
}
.hero h1 {
  position: relative; z-index: 1;
  font-size: clamp(2rem, 5vw, 3rem); font-weight: 650; letter-spacing: -0.03em; line-height: 1.1;
  margin: 0 0 var(--sp-4); color: var(--text-primary);
}
.hero p.lede {
  position: relative; z-index: 1;
  font-size: 1.1rem; color: var(--text-secondary); max-width: 46ch; margin: 0 auto var(--sp-5); line-height: 1.5;
}
.hero .cta-row { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; gap: var(--sp-4); flex-wrap: wrap; }
.hero .cta-row .btn { padding: var(--sp-3) var(--sp-5); font-size: 0.95rem; }
.hero .cta-row a.text-link { color: var(--text-secondary); font-size: 0.9rem; }

/* --- hero "find customers" finder + inline signup reveal --- */
.finder { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; }
.finder-bar {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-pill);
  padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-4);
  box-shadow: var(--shadow-card);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.finder-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--border-accent); }
.finder-icon { width: 1.05em; height: 1.05em; color: var(--dim); flex-shrink: 0; }
.finder-bar input {
  flex: 1; border: none; background: transparent; padding: var(--sp-2) 0; font-size: 0.95rem;
  min-width: 0;
}
.finder-bar input:focus { outline: none; box-shadow: none; }
.finder-bar .btn { padding: var(--sp-2) var(--sp-4); font-size: 0.9rem; white-space: nowrap; }
.finder-status { min-height: 1.4em; margin: var(--sp-2) 0 0; font-size: 0.82rem; color: var(--dim); }
.finder-status.error { color: var(--danger-rose); }
.finder-status.ok { color: var(--accent); }

/* --- "what it found" reveal: a skeleton the instant the finder is
   submitted (not just the button's own small spinner — something with the
   real card's shape is already sitting there), swapped for the actual
   drafted fields once they land. --- */
.finder-result {
  position: relative; z-index: 1; max-width: 460px; margin: var(--sp-4) auto 0;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg);
  padding: var(--sp-4) var(--sp-5); text-align: left;
  box-shadow: var(--shadow-card);
  animation: hero-enter 0.25s var(--ease-out) both;
}
.finder-result[hidden] { display: none; }

.finder-result-skel { display: flex; flex-direction: column; gap: var(--sp-2); padding: var(--sp-1) 0; }
.finder-result-skel[hidden] { display: none; }
.skel-line {
  display: block; height: 0.7rem; border-radius: var(--r-xs);
  background: linear-gradient(90deg, var(--bg-card-sub) 25%, var(--bg-hover) 50%, var(--bg-card-sub) 75%);
  background-size: 200% 100%;
  animation: skel-shimmer 1.4s ease-in-out infinite;
}
.skel-line.w70 { width: 70%; }
.skel-line.w55 { width: 55%; }
.skel-line.w45 { width: 45%; }
@keyframes skel-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.finder-result-body[hidden] { display: none; }
.finder-result-label {
  margin: 0 0 var(--sp-1); font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--dim); text-transform: uppercase;
}
.finder-result-icp {
  margin: 0 0 var(--sp-3); font-size: 0.95rem; line-height: 1.45; color: var(--fg);
  opacity: 0; transform: translateY(8px);
  animation: finder-field-in 0.25s var(--ease-out) 0.05s both;
}
.finder-result-tags { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.finder-tag {
  display: inline-block; font-size: 0.78rem; color: var(--text-secondary);
  background: var(--bg-card-sub); border-radius: var(--r-sm); padding: 0.2rem 0.6rem;
  opacity: 0; transform: translateY(8px);
  animation: finder-field-in 0.25s var(--ease-out) both;
}
.finder-tag:nth-child(1) { animation-delay: 0.14s; }
.finder-tag:nth-child(2) { animation-delay: 0.22s; }
@keyframes finder-field-in { to { opacity: 1; transform: none; } }

.finder-signup {
  position: relative; z-index: 1; max-width: 360px; margin: var(--sp-5) auto 0;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg);
  padding: var(--sp-5); text-align: left;
  box-shadow: var(--shadow-card);
  animation: hero-enter 0.25s var(--ease-out) both;
}
.finder-signup[hidden] { display: none; }
.finder-signup-lede { margin: 0 0 var(--sp-4); font-size: 0.88rem; color: var(--text-secondary); }
.finder-signup-lede[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) {
  .finder-signup, .finder-result, .finder-result-icp, .finder-tag { animation: none; }
  .finder-result-icp, .finder-tag { opacity: 1; transform: none; }
  .skel-line { animation: none; background: var(--bg-card-sub); }
}

/* --- ambient floating particles (hero / final-cta backgrounds) --- */
.particles { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.particle {
  position: absolute; left: var(--x, 50%); bottom: -10px;
  width: var(--size, 4px); height: var(--size, 4px); border-radius: 50%;
  background: var(--accent); opacity: 0;
  animation: particle-float var(--dur, 9s) ease-in-out var(--delay, 0s) infinite;
}
/* the occasional particle drawn as the logo's own arrow mark instead of a
   plain dot — same float animation, just an SVG glyph instead of a div */
.particle.particle-arrow { background: none; border-radius: 0; color: var(--accent); }
@keyframes particle-float {
  0%   { transform: translateY(0) scale(0.7); opacity: 0; }
  15%  { opacity: var(--peak, 0.45); }
  50%  { transform: translateY(-160px) scale(1); opacity: var(--peak, 0.45); }
  85%  { opacity: 0; }
  100% { transform: translateY(-260px) scale(0.7); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .particle { animation: none; opacity: 0.12; bottom: 40%; }
}

/* --- scroll-reveal (IntersectionObserver in landing.js toggles .is-visible) --- */
[data-reveal] {
  opacity: 0; transform: translateY(12px);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
  transition-delay: calc(var(--i, 0) * 40ms);
}
[data-reveal].is-visible { opacity: 1; transform: none; }

/* --- hero on-load stagger --- */
.hero-enter {
  animation: hero-enter 0.25s var(--ease-out) both;
  animation-delay: var(--d, 0s);
}
@keyframes hero-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { transform: none; transition: opacity 0.2s linear; transition-delay: 0s; }
  .hero-enter { animation: none; }
}

.shot-frame {
  max-width: 900px; margin: 0 auto var(--sp-7); padding: 0 var(--sp-5);
}
.shot-frame img {
  /* the width/height *attributes* map to a fixed `height` in the UA
     stylesheet too, not just an aspect-ratio hint — without this explicit
     override, the browser squishes the image to a literal 720px tall
     regardless of its actual rendered width, distorting it. */
  width: 100%; height: auto; display: block; border-radius: var(--r-lg); border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}

.steps {
  position: relative;
  max-width: 640px; margin: 0 auto; padding: var(--sp-6) var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-6);
}
/* animated connector running behind the numbered circles — a stand-in for
   the "pipeline" flow diagrams a heavier stack would build with GSAP/Motion */
.flow-line {
  position: absolute; top: calc(var(--sp-6) + 1rem); bottom: calc(var(--sp-6) + 1rem);
  left: calc(var(--sp-5) + 1rem); width: 1px; background: var(--border-color);
}
.flow-dot {
  position: absolute; left: -2.5px; top: 0%; width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 8px var(--border-accent);
  animation: flow-travel 3.5s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes flow-travel {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .flow-line, .flow-dot { display: none; }
}
.step { position: relative; z-index: 1; display: flex; gap: var(--sp-4); align-items: flex-start; }
.step .n {
  flex-shrink: 0; width: 2rem; height: 2rem; border-radius: 50%; border: 1px solid var(--border-accent);
  background: var(--bg); color: var(--accent); font-weight: 600; font-size: 0.9rem;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.step h3 { margin: 0 0 var(--sp-1); font-size: 1.05rem; font-weight: 600; color: var(--text-primary); }
.step p { margin: 0; color: var(--text-secondary); line-height: 1.5; }

.final-cta { position: relative; text-align: center; padding: var(--sp-7) var(--sp-5); border-top: 1px solid var(--line); margin-top: var(--sp-6); overflow: hidden; }
.final-cta h2 { position: relative; z-index: 1; font-size: 1.6rem; letter-spacing: -0.02em; margin: 0 0 var(--sp-4); color: var(--text-primary); }
.final-cta .btn { position: relative; z-index: 1; }

/* --- landing: generic section scaffolding --- */
.section-block {
  max-width: 1000px; margin: 0 auto; padding: var(--sp-7) var(--sp-5);
  border-top: 1px solid var(--line);
}
.section-head { max-width: 520px; margin: 0 auto var(--sp-6); text-align: center; }
.section-head h2, .section-copy h2 { font-size: 1.7rem; letter-spacing: -0.02em; margin: 0 0 var(--sp-3); color: var(--text-primary); }
.section-head p, .section-copy p { color: var(--text-secondary); line-height: 1.55; margin: 0; }
.section-copy { max-width: 40ch; }

.section-block.split {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-6); align-items: center;
}
.section-block.split.reverse .section-copy { order: 2; }

/* --- mini illustrated UI previews (not screenshots — small representative
   mockups, same spirit as a real component preview) --- */
.mock-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-5); }
.mock-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pricing-grid { max-width: 760px; margin: 0 auto; }
.verify-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-4); flex-wrap: wrap; }
.admin { max-width: 1100px; margin: 0 auto; padding: var(--sp-5) var(--sp-4) var(--sp-7); }
.admin h2 { font-size: 1.1rem; margin: var(--sp-6) 0 var(--sp-3); }
.admin .dim { color: var(--text-secondary); font-size: 0.8rem; }
.admin-scroll { overflow-x: auto; }
.admin-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
.admin-table th, .admin-table td { text-align: left; padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--border-color); vertical-align: top; }
.admin-table.metrics { width: auto; }
.admin-since { display: flex; align-items: flex-end; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.admin-since input { width: auto; }
.admin a { color: var(--accent); }
.admin-table .btn { white-space: nowrap; }
.danger-zone { margin-top: var(--sp-5); padding-top: var(--sp-4); border-top: 1px solid var(--border-color); }
.price-card { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-5); }
.price-card { position: relative; transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out); }
.price-card.featured { border: 2px solid var(--accent); transform: translateY(-12px); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 48px -16px rgba(0, 0, 0, 0.55), var(--lit-edge); }
.price-card:hover { transform: translateY(-4px); }
.price-card.featured:hover { transform: translateY(-16px); }
.price-card h3 { font-size: 0.8rem !important; font-weight: 600 !important; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-secondary) !important; }
.price-badge {
  position: absolute; top: calc(var(--sp-3) * -1); left: var(--sp-5);
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  background: var(--accent); color: var(--accent-ink); border-radius: var(--r-pill); padding: 0.2rem 0.65rem;
}
@media (max-width: 760px) { .price-card.featured, .price-card.featured:hover { transform: none; } }
@media (prefers-reduced-motion: reduce) { .price-card, .price-card:hover { transition: none; } }
.price-card .price { font-size: 3.25rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; color: var(--text-primary); margin: 0; font-variant-numeric: tabular-nums; }
.price-card .price span { font-size: 0.9rem; font-weight: 400; color: var(--text-secondary); }
.price-list { margin: 0; padding: 0; list-style: none; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; flex: 1; display: flex; flex-direction: column; gap: var(--sp-2); }
.price-list li { position: relative; padding-left: 1.5em; }
.price-list li::before {
  content: ""; position: absolute; left: 0.1em; top: 0.35em; width: 0.8em; height: 0.45em;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}
.price-card .price-local { font-size: 0.85rem; color: var(--text-secondary); margin: calc(var(--sp-2) * -1) 0 0; }
.price-note { font-size: 0.8rem !important; color: var(--accent) !important; }
.mock-card {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg);
  padding: var(--sp-4); box-shadow: var(--shadow-card);
}
.mock-card h3 { font-size: 0.95rem; font-weight: 600; margin: 0 0 var(--sp-1); color: var(--text-primary); }
.mock-card p { font-size: 0.85rem; color: var(--text-secondary); margin: 0; line-height: 1.5; }

/* --- FAQ: a plain two-column list, not cards or an accordion — each
   answer is short enough to just read, no disclosure interaction needed,
   and card chrome around six lines of text adds nothing. --- */
.faq-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--sp-6) var(--sp-7); max-width: 980px; margin: 0 auto; }
.faq-item h3 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 var(--sp-2); color: var(--text-primary); }
.faq-item p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; margin: 0; }
.mini-mock {
  height: 128px; background: var(--bg-card-sub); border: 1px solid var(--line);
  border-radius: var(--r-md); margin-bottom: var(--sp-4); padding: var(--sp-3);
  display: flex; flex-direction: column; justify-content: center; gap: var(--sp-2); overflow: hidden;
  font-size: 0.76rem; line-height: 1.4;
}
.mini-mock p { margin: 0; font-size: 0.76rem; color: var(--fg); line-height: 1.4; }
.mini-field {
  display: flex; align-items: center; gap: var(--sp-2); color: var(--text-secondary);
  background: var(--bg-card); border: 1px solid var(--field-border); border-radius: var(--r-pill);
  padding: 4px 4px 4px var(--sp-3);
}
.mini-field > span:nth-child(2) { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.mini-go { flex-shrink: 0; font-size: 0.68rem; font-weight: 600; color: var(--pop-ink); background: var(--pop); border-radius: var(--r-pill); padding: 3px 9px; white-space: nowrap; }
.mini-found { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.mini-label { width: 100%; font-size: 0.64rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--dim); }
.mini-tag { font-size: 0.7rem; color: var(--text-secondary); background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-sm); padding: 1px 7px; }
.mini-post { display: flex; flex-direction: column; gap: 6px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); }
.mini-post-head { display: flex; align-items: center; gap: 6px; }
.mini-avatar { width: 16px; height: 16px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--pop)); flex-shrink: 0; }
.mini-handle { font-size: 0.7rem; color: var(--text-secondary); flex: 1; }
.mini-fit { white-space: nowrap; flex-shrink: 0; font-size: 0.66rem; font-weight: 700; color: var(--accent); border: 1px solid var(--border-accent); border-radius: var(--r-pill); padding: 0 7px; }
.mini-post p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-bar { display: block; height: 4px; border-radius: var(--r-pill); background: var(--bg-card-sub); overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--warning-amber); }
.mini-draft { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); }
.mini-draft p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mini-actions { display: flex; justify-content: flex-end; }
.mini-btn { font-size: 0.7rem; font-weight: 600; color: var(--accent-ink); background: var(--accent); border-radius: var(--r-pill); padding: 3px 10px; white-space: nowrap; }

/* --- "who we're looking for" watch panel --- */
.watch-panel {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: var(--sp-4);
}
.watch-head { font-size: 0.78rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--sp-3); }
.watch-row {
  display: flex; align-items: center; gap: var(--sp-2); font-size: 0.88rem; color: var(--fg);
  padding: var(--sp-2) var(--sp-2); margin: 0 calc(var(--sp-2) * -1); border-top: 1px solid var(--line);
  border-radius: var(--r-sm); transition: background 0.12s;
}
.watch-row:first-of-type { border-top: none; }
.watch-row:not(.muted):hover { background: var(--bg-hover); }
.watch-row.muted { color: var(--dim); }
.watch-row .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-color); flex-shrink: 0; }
.watch-row .dot.ok { background: var(--accent); }

/* --- good/bad reply comparison --- */
.compare-panel { display: flex; flex-direction: column; gap: var(--sp-3); }
.compare-row {
  display: flex; gap: var(--sp-3); align-items: flex-start; padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md); border: 1px solid var(--border-color); background: var(--bg-card);
  transition: border-color 0.12s, transform 0.12s;
}
.compare-row.good:hover { border-color: var(--border-accent); transform: translateY(-1px); }
.compare-row.bad { color: var(--danger-rose); }
.compare-row.bad svg { color: var(--danger-rose); flex-shrink: 0; margin-top: 0.2rem; }
.compare-row.good svg { color: var(--accent); flex-shrink: 0; margin-top: 0.2rem; }
.compare-row p { margin: 0 0 var(--sp-1); color: var(--fg); font-size: 0.9rem; line-height: 1.5; }
.compare-row.bad p.strike { text-decoration: line-through; color: var(--dim); }
.compare-row .tag { font-size: 0.7rem; color: var(--dim); }
.compare-row .tag.ok { color: var(--accent); }

/* --- "distribution" live feed: a fixed-size panel — a two-card ticker of
   fit-scored leads scrolling upward (oldest fades out at the top, a new one
   fades in at the bottom) above a fixed row of three status steps that
   spans the panel's full width and stay visible throughout, greying in as
   their turn comes rather than being added/removed. The panel's own
   footprint never changes size as content cycles through it. */
.moat-feed {
  max-width: 480px; margin: 0 auto var(--sp-6); text-align: left;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: var(--sp-4);
}
/* viewport is sized for 3 card-slots even though only 2 sit fully in view
   at rest — the extra room lets the entering/exiting card breathe during
   the transition instead of hitting a hard clip, and the mask fades it out
   at the edges instead of a sharp cut */
.moat-cards-viewport {
  height: 11.75rem; overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 1rem), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 1rem), transparent 100%);
}
.moat-cards-track { display: flex; flex-direction: column; gap: var(--sp-2); }
.moat-card {
  height: 5.5rem; flex-shrink: 0; padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--bg-card-sub);
  opacity: 1;
}
.moat-card-head { display: flex; align-items: center; gap: var(--sp-2); }
.moat-handle { flex: 1; font-size: 0.76rem; color: var(--text-secondary); }
.moat-card .fit { font-size: 0.68rem; font-weight: 700; color: var(--accent); border: 1px solid var(--border-accent); border-radius: var(--r-pill); padding: 0 7px; white-space: nowrap; }
.moat-feed-head { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.74rem; color: var(--text-secondary); margin-bottom: var(--sp-3); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--border-accent); }
.moat-card p {
  margin: var(--sp-1) 0 0; font-size: 0.82rem; color: var(--text-secondary); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.moat-log {
  margin-top: var(--sp-3); padding-top: var(--sp-3); border-top: 1px solid var(--line);
  display: flex; align-items: stretch; gap: var(--sp-2); height: 2.9rem;
}
.moat-log-line {
  flex: 1 1 0; min-width: 0;
  font-size: 0.76rem; color: var(--dim); display: inline-flex; align-items: center; justify-content: center;
  gap: 0.4em; text-align: center; border: 1px solid var(--line); border-radius: var(--r-pill);
  padding: 0.3rem 0.5rem; opacity: 0.4;
  transition: opacity 0.35s ease, color 0.35s ease, border-color 0.35s ease, background 0.35s ease;
}
.moat-log-line .glyph { color: var(--dim); flex-shrink: 0; transition: color 0.35s ease; }
.moat-log-line.active {
  opacity: 1; color: var(--fg); border-color: var(--border-accent); background: var(--bg-card-sub);
}
.moat-log-line.active .glyph { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .moat-log-line { transition: none; }
}

/* --- orbit / pipeline diagram: source platforms (left) and outcomes
   (right) stacked vertically, flanking a core — scales to more platforms
   without widening, unlike a row of side-by-side columns. --- */
.orbit {
  position: relative; display: flex; align-items: center; justify-content: space-between;
  max-width: 640px; margin: 0 auto; padding: var(--sp-6) var(--sp-4); gap: var(--sp-4);
}
.orbit-particles { position: absolute; inset: 0; overflow: visible; pointer-events: none; }
/* a line from every single icon straight to the core — a matching-game
   fan-out, not one flat line that only happens to touch one row */
.orbit-links { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; overflow: visible; }
.orbit-link-line { stroke: var(--line); stroke-width: 1; }
.orbit-side { display: flex; flex-direction: column; gap: var(--sp-2); z-index: 1; }
.orbit-side.right { align-items: flex-end; }
.orbit-row {
  display: flex; align-items: center; gap: var(--sp-2);
  text-decoration: none; color: inherit; border-radius: var(--r-pill);
  margin: calc(var(--sp-1) * -1); padding: var(--sp-1);
  transition: background 0.12s;
}
.orbit-row[href]:hover { background: var(--bg-hover); }
.orbit-row[href]:hover .orbit-node { border-color: var(--border-accent); transform: scale(1.05); }
.orbit-side.right .orbit-row { flex-direction: row-reverse; }
.orbit-row span { font-size: 0.76rem; color: var(--text-secondary); white-space: nowrap; }
.orbit-row span em { color: var(--dim); font-style: normal; }
.orbit-node {
  width: 42px; height: 42px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center; color: var(--accent); flex-shrink: 0;
  transition: border-color 0.12s, transform 0.12s;
}
.orbit-node .icon { width: 1.3rem; height: 1.3rem; }
.orbit-node.dim { color: var(--dim); }
.orbit-core {
  width: 64px; height: 64px; border-radius: 50%; background: var(--bg-card); border: 1px solid var(--border-accent);
  box-shadow: 0 0 32px var(--border-accent); display: flex; align-items: center; justify-content: center;
  color: var(--accent); flex-shrink: 0; z-index: 1;
}
.orbit-core .icon { width: 1.6rem; height: 1.6rem; }

@media (max-width: 760px) {
  .section-block.split { grid-template-columns: 1fr; }
  .section-block.split.reverse .section-copy { order: 0; }
  .mock-grid, .mock-grid.cols-2 { grid-template-columns: 1fr; }
  .faq-list { grid-template-columns: 1fr; gap: var(--sp-5); }
  .orbit { flex-direction: column; gap: var(--sp-5); }
  .orbit-side, .orbit-side.right { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; }
  .orbit-side.right .orbit-row { flex-direction: row; }
}

.landing-footer {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  max-width: 1100px; margin: 0 auto; padding: var(--sp-5); color: var(--dim); font-size: 0.8rem; flex-wrap: wrap;
}
.landing-footer a { color: var(--dim); }
.landing-footer a:hover { color: var(--text-secondary); }
.landing-footer .links { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

/* --- inline code block (agent-playbook setup instructions) --- */
.code-block {
  background: var(--bg-card-sub); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem; color: var(--fg); overflow-x: auto; white-space: pre-wrap; word-break: break-word;
  margin: 0 0 var(--sp-4);
}
.facts-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.facts-table th { text-align: left; color: var(--dim); font-weight: 500; padding: var(--sp-2) var(--sp-3) var(--sp-2) 0; vertical-align: top; white-space: nowrap; }
.facts-table td { padding: var(--sp-2) 0; color: var(--fg); border-top: 1px solid var(--line); }
.facts-table th { border-top: 1px solid var(--line); }
.facts-table tr:first-child th, .facts-table tr:first-child td { border-top: none; }
.tools-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.tools-list .tool-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); }
.tools-list .tool-card code { font-size: 0.85rem; color: var(--accent); font-weight: 600; }
.tools-list .tool-card p { margin: var(--sp-1) 0 0; color: var(--text-secondary); font-size: 0.85rem; line-height: 1.5; }

/* --- legal / plain prose pages (privacy, terms) --- */
.legal { max-width: 680px; margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-7); }
.legal h1 { font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 var(--sp-2); color: var(--text-primary); }
.legal .updated { color: var(--dim); font-size: 0.85rem; margin: 0 0 var(--sp-6); }
.legal h2 { font-size: 1.15rem; margin: var(--sp-6) 0 var(--sp-3); color: var(--text-primary); }
.legal p, .legal li { color: var(--text-secondary); line-height: 1.65; }
.legal ul { padding-left: 1.2em; }
.legal a { color: var(--accent); }

/* --- long-form guide articles: same prose measure as .legal, its own name
   since a privacy policy and a how-to guide aren't the same kind of page,
   plus the bits a guide needs that legal text doesn't (a subtitle, a
   closing callout). --- */
.guide { max-width: 680px; margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-7); }
.guide h1 { font-size: 1.9rem; letter-spacing: -0.02em; margin: 0 0 var(--sp-2); color: var(--text-primary); }
.guide .subtitle { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.55; margin: 0 0 var(--sp-6); }
.guide h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin: var(--sp-6) 0 var(--sp-3); color: var(--text-primary); }
.guide h3 { font-size: 1.02rem; margin: var(--sp-5) 0 var(--sp-2); color: var(--text-primary); }
.guide p, .guide li { color: var(--text-secondary); line-height: 1.7; }
.guide ul, .guide ol { padding-left: 1.3em; }
.guide li { margin-bottom: var(--sp-2); }
.guide a { color: var(--accent); }
.guide .callout {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg);
  padding: var(--sp-5); margin: var(--sp-7) 0 0;
}
.guide .callout h2 { margin-top: 0; }
.guide .callout .btn { margin-top: var(--sp-2); }

/* --- guides index: a plain link list, not cards-with-shadow — the hover
   lift is the only affordance a text link to an article needs. --- */
.guide-list { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 680px; margin: 0 auto; }
.guide-list-item {
  display: block; text-decoration: none;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg);
  padding: var(--sp-5); transition: border-color 0.15s, transform 0.15s;
}
.guide-list-item:hover { border-color: var(--border-accent); transform: translateY(-2px); }
.guide-list-item h2 { margin: 0 0 var(--sp-2); font-size: 1.1rem; color: var(--text-primary); }
.guide-list-item p { margin: 0; color: var(--text-secondary); font-size: 0.9rem; line-height: 1.55; }

@media (max-width: 640px) {
  .hero { padding: var(--sp-6) var(--sp-4) var(--sp-5); }
  .landing-nav { padding: var(--sp-3) var(--sp-4); }
}

/* --- Cinema mode: the "All platforms" rapid-review flow -----------------
   A real accessible overlay (not display:none toggled by JS alone — see
   .sr-only below), round-robin-fed by app.js across every connected
   platform's own drafted leads. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#cinema-toggle-bar {
  position: absolute;
  top: 0;
  right: 0;
}
#cinema-toggle-bar.hidden { display: none; }

.cinema-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: var(--sp-5);
}
.cinema-overlay.hidden { display: none; }
.cinema-overlay.opening { opacity: 0; }
.cinema-overlay {
  transition: opacity 0.18s ease;
}
@media (prefers-reduced-motion: reduce) {
  .cinema-overlay { transition: none; }
}

.cinema-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-bottom: var(--sp-5);
}
.cinema-progress {
  margin-right: auto;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.cinema-card {
  flex: 1;
  display: flex;
  align-items: center;
  overflow-y: auto;
}
.cinema-lead {
  position: relative;
  max-width: 640px;
  margin: 0 auto;
  width: 100%;
}

/* Tinder-style outcome stamp, added just before the swipe-out animation
   (app.js's cinemaAdvance) — "Queued" leans right/green, "Skipped" leans
   left/gray, matching the swipe direction so the two outcomes read as
   distinct at a glance, not just "the card changed." */
.cinema-stamp {
  position: absolute;
  top: var(--sp-4);
  padding: var(--sp-2) var(--sp-4);
  border: 3px solid;
  border-radius: var(--r-sm);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
}
.cinema-stamp-queue { right: 0; color: var(--accent); border-color: var(--accent); }
.cinema-stamp-skip { left: 0; color: var(--dim); border-color: var(--dim); }
.cinema-lead .meta {
  display: flex;
  gap: var(--sp-2);
  align-items: center;
  font-size: 0.8rem;
  color: var(--dim);
  margin-bottom: var(--sp-4);
  flex-wrap: wrap;
}
.cinema-lead .cinema-content {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--text-primary);
  margin-bottom: var(--sp-5);
}
.cinema-lead .cinema-draft {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre-wrap;
}
.cinema-lead .cinema-draft-label {
  font-size: 0.75rem;
  color: var(--dim);
  margin-bottom: var(--sp-2);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cinema-empty {
  text-align: center;
  color: var(--text-secondary);
  max-width: 420px;
  margin: 0 auto;
}
.cinema-empty .icon { width: 2.5em; height: 2.5em; color: var(--accent); margin-bottom: var(--sp-4); }

.cinema-actions {
  display: flex;
  justify-content: center;
  gap: var(--sp-3);
  padding-top: var(--sp-5);
}
.cinema-actions .btn { min-width: 160px; justify-content: center; }
.cinema-actions.hidden { display: none; }

@media (max-width: 640px) {
  /* The absolutely-positioned button reads fine on a wide row but gets
     cramped fighting the chips for space at this width (confirmed live)
     — reverts to plain stacked flow below the chips instead, same as
     before this file's cinema-mode work existed. */
  .status-filter-row { position: static; }
  #cinema-toggle-bar { position: static; margin-top: var(--sp-3); }
  .chips.has-cinema-button { padding-right: 0; }

  .cinema-overlay { padding: var(--sp-4); }
  .cinema-lead .cinema-content { font-size: 1.05rem; }
  .cinema-actions { flex-direction: column-reverse; }
  .cinema-actions .btn { width: 100%; }
}

/* --- dashboard: the next step ---------------------------------------
   One strip, top of the feed: where you are on the path from describing
   your customer to logging a reply (connected nodes, one line through
   them), and the single thing to do now in --pop with a time box on it.
   The ring is four separate arcs with gaps; the eye closes it, and it
   closes for real when every step is done. */
.next-step { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-4) var(--sp-5); }
.next-step.hidden { display: none; }
.closure-ring { width: 44px; height: 44px; flex-shrink: 0; position: relative; }
.closure-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.closure-ring circle { fill: none; stroke-width: 3.5; stroke: var(--border-color); stroke-linecap: round; transition: stroke 0.3s; }
.closure-ring circle.done { stroke: var(--accent); }
.closure-ring circle.current { stroke: var(--pop); }
.closure-ring span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 0.72rem; font-weight: 600; color: var(--text-secondary); font-variant-numeric: tabular-nums;
}
.next-step-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-3); }
.journey { list-style: none; display: flex; margin: 0; padding: 0; }
.journey li {
  flex: 1; position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--sp-1);
  font-size: 0.72rem; color: var(--dim); text-align: center; line-height: 1.3;
}
.journey li::before {
  content: ""; position: absolute; top: 6px; right: 50%; width: 100%; height: 2px;
  background: var(--border-color); z-index: 0;
}
.journey li:first-child::before { display: none; }
.journey li.done::before, .journey li.current::before { background: var(--accent); }
.journey .node {
  position: relative; z-index: 1; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border-color); background: var(--bg-card);
}
.journey li.done { color: var(--text-secondary); }
.journey li.done .node { background: var(--accent); border-color: var(--accent); }
.journey li.current { color: var(--text-primary); font-weight: 600; }
.journey li.current .node { border-color: var(--pop); background: var(--pop); box-shadow: 0 0 0 4px var(--pop-soft); }
.next-step-row { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; }
.next-step-row p { margin: 0; flex: 1 1 260px; font-size: 0.88rem; color: var(--text-secondary); }
.next-step-row p strong { color: var(--text-primary); font-weight: 600; }
.next-step-go { display: flex; align-items: center; gap: var(--sp-3); }
.timebox { font-size: 0.74rem; color: var(--dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .next-step { padding: var(--sp-4); gap: var(--sp-3); align-items: flex-start; }
  .journey li { font-size: 0.66rem; }
  .next-step-go { width: 100%; justify-content: space-between; }
}

/* --- notices live in the feed, shaped like the leads around them, not
   as a colored bar across the top (people skip anything that looks like
   a banner). Same card, same meta line, sealoutreach as the author. --- */
.lead-card.notice .meta .from { display: inline-flex; align-items: center; gap: var(--sp-1); color: var(--text-secondary); font-weight: 600; }
.lead-card.notice .meta .from .icon { color: var(--accent); }

/* --- a lead's other actions, behind ⋯ (one main action per card) --- */
.more { position: relative; }
.more > summary { list-style: none; font-size: 1.1rem; line-height: 1; letter-spacing: 0.05em; padding: var(--sp-2) var(--sp-3); }
.more > summary::-webkit-details-marker { display: none; }
.more-menu {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 180px;
  display: flex; flex-direction: column; padding: var(--sp-1);
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-md); box-shadow: var(--shadow-card);
}
.more-menu button {
  font: inherit; font-size: 0.84rem; text-align: left; background: transparent; border: none; color: var(--fg);
  padding: var(--sp-2) var(--sp-3); border-radius: var(--r-sm); cursor: pointer;
}
.more-menu button:hover, .more-menu button:focus-visible { background: var(--bg-hover); }
.more-menu button.danger { color: var(--danger-rose); }

/* --- figure and ground: whatever you're working in stays at full
   strength, the rest of the feed steps back to --behind. --- */
.lead-card { transition: border-color 0.15s, opacity 0.2s; }
/* !important because the feed's entrance animation (anime.js) leaves an
   inline opacity: 1 on every card. */
#leads:has(.lead-card:focus-within) .lead-card:not(:focus-within) { opacity: var(--behind) !important; }
/* the open ⋯ menu sits over the next card, not under it */
.lead-card:has(details.more[open]) { position: relative; z-index: 5; }
@media (prefers-reduced-motion: reduce) { .lead-card { transition: none; } }

/* --- sidebar: a quiet list, so the next step is the loudest thing --- */
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-link {
  display: flex; align-items: center; gap: var(--sp-2); width: 100%;
  font: inherit; font-size: 0.85rem; text-align: left; color: var(--text-secondary);
  background: transparent; border: none; border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.side-link:hover { background: var(--bg-hover); color: var(--fg); }
.side-link .icon { color: var(--dim); }
.side-group-label { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dim); padding: var(--sp-2) var(--sp-3) 0; }
.agent-toolbar h2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
@media (max-width: 760px) {
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .side-link { width: auto; }
  .side-group-label, .brand-tag, .sidebar-foot { display: none; }
}
.btn.hidden, .next-step .hidden { display: none; }

/* --- landing: the accent word, the focused finder, the connected steps,
   and the last ask as a post in a feed --- */
.pop-word {
  color: var(--pop);
  background: linear-gradient(transparent 82%, var(--pop-soft) 82%);
}
/* Typing your site in is the one thing the hero asks for: everything
   around it steps back while the field has focus. */
.landing-nav, .shot-frame { transition: opacity 0.25s; }
body:has(.finder-bar:focus-within) :is(.landing-nav, .shot-frame, .hero .particles) { opacity: var(--behind); }
.finder-bar:focus-within { border-color: var(--pop); box-shadow: 0 0 0 4px var(--pop-soft); }

.step-path { position: relative; counter-reset: none; }
.step-path::before {
  content: ""; position: absolute; left: 16%; right: 16%; top: calc(var(--sp-4) + 128px + var(--sp-4) + 13px);
  height: 2px; background: linear-gradient(90deg, var(--accent), var(--pop)); opacity: 0.6; z-index: 0;
}
.step-path .mock-card { position: relative; z-index: 1; }
.step-n {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; margin-bottom: var(--sp-2);
  border-radius: 50%; background: var(--bg-card); border: 2px solid var(--accent); color: var(--accent);
  font-size: 0.78rem; font-weight: 700; font-variant-numeric: tabular-nums; position: relative; z-index: 1;
}
.step-path .mock-card:last-child .step-n { border-color: var(--pop); color: var(--pop); }
.step-path-go { display: flex; align-items: center; justify-content: center; gap: var(--sp-3); margin: var(--sp-6) 0 0; flex-wrap: wrap; }
@media (max-width: 760px) { .step-path::before { display: none; } }

.feed-post {
  position: relative; z-index: 1; max-width: 520px; margin: 0 auto; text-align: left;
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--r-lg);
  box-shadow: var(--shadow-card); padding: var(--sp-4) var(--sp-5);
}
.feed-post-meta { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.8rem; color: var(--dim); margin-bottom: var(--sp-2); }
.feed-post-meta strong { color: var(--text-secondary); font-weight: 600; }
.feed-avatar { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--pop)); flex-shrink: 0; }
.feed-post > p { margin: 0 0 var(--sp-3); color: var(--fg); line-height: 1.5; }
.feed-post-reply { background: var(--bg-card-sub); border-radius: var(--r-md); padding: var(--sp-3); margin-bottom: var(--sp-4); }
.feed-post-reply p { margin: 0; color: var(--text-primary); font-size: 0.92rem; line-height: 1.5; }
.feed-post-label { display: block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dim); margin-bottom: var(--sp-1); }
.feed-post-actions { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.card-head-actions .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .agent-toolbar.card-head { flex-wrap: wrap; }
  .agent-toolbar h2 { flex-basis: 100%; }
  .agent-toolbar .card-head-actions { flex-wrap: wrap; }
}

/* --- touch: 44px targets on coarse pointers --- */
@media (pointer: coarse) {
  .btn { min-height: 2.75rem; }
  .btn.small, .chip, .agent-tab, .side-link, .icon-btn, .more-menu button { min-height: 2.75rem; }
  .chip { display: inline-flex; align-items: center; }
}

/* --- empty states: an icon, one line, one action --- */
.empty-state { text-align: center; padding: var(--sp-7) var(--sp-4); color: var(--text-secondary); }
.empty-state .icon { width: 2rem; height: 2rem; color: var(--dim); margin-bottom: var(--sp-3); }
.empty-state h3 { margin: 0 0 var(--sp-1); font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.empty-state p { margin: 0 auto var(--sp-4); max-width: 40ch; font-size: 0.88rem; }
.list-end { text-align: center; font-size: 0.78rem; color: var(--dim); padding: var(--sp-4) 0 var(--sp-2); }
.list-end button { font: inherit; color: var(--text-secondary); background: none; border: none; cursor: pointer; text-decoration: underline; padding: 0 var(--sp-1); }

/* --- loading: the shape of a lead card, not a spinner --- */
.lead-skel { pointer-events: none; }
.lead-skel .skel-line { margin-bottom: var(--sp-3); }
.lead-skel .skel-line.tall { height: 3.5rem; border-radius: var(--r-md); }

/* --- toast with an action (Undo) --- */
.toast .toast-action {
  font: inherit; font-size: 0.82rem; font-weight: 600; color: var(--accent); background: none;
  border: 1px solid var(--border-accent); border-radius: var(--r-pill); padding: 0.15rem 0.7rem; cursor: pointer; white-space: nowrap;
}
.toast .toast-action:hover { border-color: var(--accent); }
.toast.ok .dismiss { margin-left: var(--sp-1); }

/* --- sent replies: below 600px each row becomes a card --- */
@media (max-width: 600px) {
  .replies-table thead { display: none; }
  .replies-table, .replies-table tbody, .replies-table tr, .replies-table td { display: block; width: 100%; }
  .replies-table tr { border: 1px solid var(--border-color); border-radius: var(--r-md); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
  .replies-table td { border: none; padding: var(--sp-1) 0; max-width: none !important; }
  .replies-table td[data-label]::before { content: attr(data-label) " "; color: var(--dim); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; margin-right: var(--sp-1); }
  .replies-table tr:hover td { background: none; }
}
.auth-card h1 { font-size: 1.75rem; font-weight: 750; letter-spacing: -0.02em; }
.field-optional { color: var(--dim); font-size: 0.72rem; }
.field-hint.ok { color: var(--accent); }

/* --- short choices as a row of buttons (segmentSelect in app.js) --- */
.seg-source { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; }
.segmented {
  display: flex; flex-wrap: wrap; gap: 2px; padding: 3px;
  background: var(--bg-card-sub); border: 1px solid var(--field-border); border-radius: var(--r-md);
}
.segmented button {
  flex: 1 1 auto; font: inherit; font-size: 0.84rem; color: var(--text-secondary);
  background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  min-height: 2.25rem; padding: var(--sp-1) var(--sp-3); cursor: pointer; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1);
  transition: background 0.15s var(--ease-out), color 0.15s var(--ease-out);
}
.segmented button:hover { color: var(--fg); background: var(--bg-hover); }
.segmented button[aria-checked="true"] {
  background: var(--bg-card); color: var(--text-primary); font-weight: 600; border-color: var(--border-color);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25), var(--lit-edge);
}
.segmented button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented button.locked { color: var(--dim); }
.seg-lock {
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); border: 1px solid var(--border-accent); border-radius: var(--r-pill); padding: 0 0.4rem;
}
@media (pointer: coarse) { .segmented button { min-height: 2.75rem; } }

/* --- a button that just finished says so --- */
.btn.is-done { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn.primary.is-done, .btn.pop.is-done { background: var(--accent); color: var(--accent-ink); }

/* --- DMs: yours on the right in the accent, theirs neutral on the left --- */
.dm-conversation-list { gap: var(--sp-1); }
.dm-message { border-radius: 18px; }
.dm-message.outgoing { background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: var(--r-xs); }
.dm-message.outgoing .dm-message-meta { color: var(--accent-ink); opacity: 0.8; }
.dm-message.incoming { border-bottom-left-radius: var(--r-xs); }
.dm-message.outgoing + .dm-message.incoming, .dm-message.incoming + .dm-message.outgoing { margin-top: var(--sp-3); }

/* --- tables: the header stays, numbers line up on the right --- */
.replies-table thead th, .admin-table thead th { position: sticky; top: 0; background: var(--bg-card); z-index: 1; }
.admin-table thead th { background: var(--bg); }
.admin-table:not(.metrics) td:nth-child(4), .admin-table:not(.metrics) td:nth-child(5),
.admin-table:not(.metrics) td:nth-child(6), .admin-table:not(.metrics) td:nth-child(8),
.admin-table:not(.metrics) th:nth-child(4), .admin-table:not(.metrics) th:nth-child(5),
.admin-table:not(.metrics) th:nth-child(6), .admin-table:not(.metrics) th:nth-child(8),
.admin-table.metrics td:nth-child(2) { text-align: right; font-variant-numeric: tabular-nums; }
.admin-scroll { max-height: 75vh; overflow: auto; }
/* a label holding a button row needs room for the whole row */
.row > label:has(.segmented) { flex: 1 1 260px; }
.segmented { flex-wrap: nowrap; }
.btn.block + .field-hint { margin-top: var(--sp-2); }
.field-hint + .agent-connect-block, .field-hint + .platform-note { margin-top: 0; }
.agent-connect-block { margin-top: 0; }
/* information, not an error */
.toast.info { border-color: var(--border-color); }
.toast.info .icon { color: var(--text-secondary); }
.facts-table code { overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .facts-table, .facts-table tbody, .facts-table tr, .facts-table th, .facts-table td { display: block; width: 100%; }
  .facts-table th { border-top: 1px solid var(--line); padding-bottom: 0; }
  .facts-table td { border-top: none; padding-top: var(--sp-1); }
}

/* --- guides: where you are, how long it takes, what's tappable --- */
.breadcrumb { display: flex; align-items: center; gap: var(--sp-2); font-size: 0.82rem; color: var(--dim); margin-bottom: var(--sp-4); }
.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--fg); }
.breadcrumb [aria-current] { color: var(--text-secondary); }
.guide-meta { display: block; font-size: 0.78rem; color: var(--dim); letter-spacing: 0.01em; margin: 0 0 var(--sp-2); }
.guide .guide-meta { margin: calc(var(--sp-5) * -1) 0 var(--sp-6); }
.guide-go { display: inline-block; margin-top: var(--sp-3); font-size: 0.86rem; font-weight: 600; color: var(--accent); transition: transform 0.15s var(--ease-out); }
.guide-list-item:hover .guide-go { transform: translateX(3px); }
.callout-go { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-2); }
.guide .callout .callout-go .btn { margin-top: 0; }
.hero .cta-row .timebox { font-size: 0.82rem; }

/* --- connect page: the login browser, framed like the rest of the app --- */
.connect-body { height: 100vh; height: 100dvh; margin: 0; display: flex; flex-direction: column; overflow: hidden; }
.connect-bar {
  display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-3) var(--sp-5);
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.connect-brand { text-decoration: none; font-size: 1rem; white-space: nowrap; }
.connect-steps { flex: 1; max-width: 520px; margin: 0 auto; }
.connect-close { flex-shrink: 0; }
.connect-status {
  display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-3) var(--sp-5);
  font-size: 0.9rem; color: var(--fg); background: var(--bg-card); border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.connect-status #status-text { flex: 1; min-width: 0; }
.connect-status-icon { display: inline-flex; width: 1.1rem; justify-content: center; color: var(--text-secondary); flex-shrink: 0; }
.connect-status-icon .spinner {
  width: 0.95rem; height: 0.95rem; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
  animation: spin 0.6s linear infinite;
}
.connect-status.connected { color: var(--accent); }
.connect-status.connected .connect-status-icon { color: var(--accent); }
.connect-status.ended .connect-status-icon { color: var(--warning-amber); }
.connect-actions { display: flex; gap: var(--sp-2); flex-shrink: 0; }
.connect-actions .hidden { display: none; }
.connect-trust {
  display: flex; align-items: flex-start; gap: var(--sp-2); padding: var(--sp-2) var(--sp-5);
  font-size: 0.78rem; line-height: 1.5; color: var(--text-secondary); flex-shrink: 0;
}
.connect-trust .icon { color: var(--accent); margin-top: 0.2em; }
.connect-trust a { color: var(--text-secondary); }
#screen-wrap { display: flex; align-items: center; justify-content: center; flex: 1; min-height: 0; padding: var(--sp-2) var(--sp-4) var(--sp-4); }
#screen { position: relative; background: #000; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--border-color); box-shadow: var(--shadow-card); }
.connect-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: var(--sp-3);
  padding: 10%; background: var(--bg-card);
}
.connect-placeholder p { margin: var(--sp-2) 0 0; color: var(--text-secondary); font-size: 0.9rem; }
@media (max-width: 760px) {
  .connect-bar { flex-wrap: wrap; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); }
  .connect-steps { order: 3; flex-basis: 100%; }
  .connect-close { margin-left: auto; }
  .connect-status { flex-wrap: wrap; padding: var(--sp-3) var(--sp-4); }
  .connect-trust { padding: var(--sp-2) var(--sp-4); }
}
@media (prefers-reduced-motion: reduce) { .connect-status-icon .spinner { animation-duration: 1.4s; } }

/* --- the next step is one line, not a tracker --- */
.next-step { padding: var(--sp-3) var(--sp-4) var(--sp-3) var(--sp-5); }
.next-step .next-step-row { width: 100%; }

/* --- sidebar: the agent list gets the room; the sidebar scrolls if it
   runs out, not the list inside it --- */
.sidebar { overflow-y: auto; gap: var(--sp-3); }
.sidebar .agent-list { overflow: visible; flex-shrink: 0; }
.sidebar > *:not(.agent-list) { flex-shrink: 0; }
.agent-tab { font-size: 0.92rem; min-height: 2.5rem; }
.agent-tab > span:first-child, .agent-tab .agent-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-tag { display: none; }

/* --- sent replies: the reply gets room but not all of it --- */
.replies-table { table-layout: fixed; }
.replies-table th:nth-child(1) { width: 16%; }
.replies-table th:nth-child(2) { width: 9%; }
.replies-table th:nth-child(3) { width: 15%; }
.replies-table th:nth-child(5) { width: 11%; }
.replies-table th:nth-child(6) { width: 15%; }
.replies-table td { overflow-wrap: anywhere; }
.replies-table td.reply-snippet { max-width: none; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.replies-table td.replies-link, .replies-table td[data-label="Sent"] { white-space: nowrap; overflow-wrap: normal; }
@media (max-width: 600px) { .replies-table { table-layout: auto; } }
.replies-table a { color: var(--accent); }

/* --- how a draft ends, and what they said back --- */
.ending-tag { font-size: 0.7rem; color: var(--text-secondary); border: 1px dashed var(--border-color); border-radius: var(--r-pill); padding: 0 0.5rem; cursor: help; }
.their-reply { border-left: 3px solid var(--accent); background: var(--bg-card-sub); border-radius: 0 var(--r-md) var(--r-md) 0; padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-3); }
.their-reply-label { display: block; font-size: 0.72rem; font-weight: 600; color: var(--accent); margin-bottom: 2px; }
.their-reply p { margin: 0; color: var(--text-primary); white-space: pre-wrap; }
.others-replied { font-size: 0.78rem; color: var(--text-secondary); margin: 0 0 var(--sp-3); }
.connect-sublist { margin: 0 0 var(--sp-2) calc(2.1rem + var(--sp-3)); border-left: 2px solid var(--line); padding-left: var(--sp-3); }
.connect-subrow { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-1) 0; font-size: 0.86rem; }
.connect-subrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-color); flex-shrink: 0; }
.connect-subrow .dot.ok { background: var(--accent); }
.connect-subrow-name { flex: 1; min-width: 0; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.connect-subrow-status { color: var(--dim); font-size: 0.76rem; white-space: nowrap; }
.connect-row-actions { display: flex; gap: var(--sp-2); flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
