/* Insurance Bounty Hunter — one stylesheet, no framework. Mobile first. */

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #0d1322;
  --surface: #151d31;
  --surface-2: #1c2640;
  --surface-3: #25304e;
  --border: #2b3656;
  --text: #e8ecf5;
  --muted: #9ca7c2;
  --faint: #6f7a98;
  --accent: #f5a524;
  --accent-ink: #1b1203;
  --accent-text: #f7b84a;
  --accent-soft: rgba(245, 165, 36, 0.15);
  --good: #34d399;
  --good-soft: rgba(52, 211, 153, 0.15);
  --warn: #fbbf24;
  --warn-soft: rgba(251, 191, 36, 0.14);
  --bad: #f87171;
  --bad-soft: rgba(248, 113, 113, 0.15);
  --info: #7cb3ff;
  --info-soft: rgba(96, 165, 250, 0.15);
  --hud: #5fd4e6;
  --hud-soft: rgba(95, 212, 230, 0.14);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 30px rgba(0, 0, 0, 0.3);
  --radius: 14px;
  --radius-sm: 10px;
  --nav-h: 64px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f0f2f7; --surface-3: #e5e9f2; --border: #dde2ec;
    --text: #111827; --muted: #546074; --faint: #8b94a7;
    --accent: #f0a01c; --accent-ink: #1b1203; --accent-text: #a85a05; --accent-soft: rgba(240, 160, 28, 0.16);
    --good: #047857; --good-soft: rgba(16, 185, 129, 0.13); --warn: #a16207; --warn-soft: rgba(234, 179, 8, 0.16);
    --bad: #c81e1e; --bad-soft: rgba(239, 68, 68, 0.11); --info: #1d4ed8; --info-soft: rgba(59, 130, 246, 0.11);
    --hud: #0e7490; --hud-soft: rgba(14, 116, 144, 0.1);
    --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.08);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f5f6fa; --surface: #ffffff; --surface-2: #f0f2f7; --surface-3: #e5e9f2; --border: #dde2ec;
  --text: #111827; --muted: #546074; --faint: #8b94a7;
  --accent: #f0a01c; --accent-ink: #1b1203; --accent-text: #a85a05; --accent-soft: rgba(240, 160, 28, 0.16);
  --good: #047857; --good-soft: rgba(16, 185, 129, 0.13); --warn: #a16207; --warn-soft: rgba(234, 179, 8, 0.16);
  --bad: #c81e1e; --bad-soft: rgba(239, 68, 68, 0.11); --info: #1d4ed8; --info-soft: rgba(59, 130, 246, 0.11);
    --hud: #0e7490; --hud-soft: rgba(14, 116, 144, 0.1);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.08);
  color-scheme: light;
}

/* ── Base ───────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased; overflow-x: hidden;
}
body.has-overlay { overflow: hidden; }
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; }
h1 { font-size: 1.45rem; letter-spacing: -0.01em; }
h2 { font-size: 1.02rem; }
p { margin: 0.5em 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
.muted { color: var(--muted); }
.small { font-size: 0.87rem; }
.tiny { font-size: 0.75rem; }
.center { text-align: center; }
.right { text-align: right; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.spacer { flex: 1; }
.tone-text-good { color: var(--good); }
.tone-text-warn { color: var(--warn); }
.tone-text-bad { color: var(--bad); }
.tone-text-muted { color: var(--muted); }
.boot { padding: 40vh 0; text-align: center; color: var(--muted); }

/* ── Layout ─────────────────────────────────────────────────────────────── */
.app { min-height: 100vh; }
.view {
  width: 100%; max-width: 860px; margin: 0 auto; min-width: 0;
  padding: max(12px, env(safe-area-inset-top)) 16px calc(var(--nav-h) + 28px + env(safe-area-inset-bottom));
  outline: none;
}
.view > * + * { margin-top: 14px; }

.nav {
  position: fixed; z-index: 20; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
}
.nav .brand, .nav .desktop-only { display: none; }
.nav-item {
  position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 0.7rem; font-weight: 600; text-decoration: none !important;
}
.nav-item .icon { width: 22px; height: 22px; }
.nav-item.on { color: var(--accent-text); }
.badge {
  position: absolute; top: 7px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--bad); color: #fff; font-size: 0.68rem; line-height: 18px; text-align: center;
}
.badge.calm { background: var(--surface-3); color: var(--text); }

@media (min-width: 960px) {
  .app { display: grid; grid-template-columns: 220px 1fr; }
  .nav {
    position: sticky; top: 0; height: 100vh; flex-direction: column; justify-content: flex-start; gap: 2px;
    padding: 18px 12px; border-top: 0; border-right: 1px solid var(--border); background: var(--surface);
  }
  .nav .brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 18px; color: var(--text); font-weight: 700; text-decoration: none; }
  .nav .brand .icon { color: var(--accent); width: 24px; height: 24px; }
  .nav .desktop-only { display: flex; }
  .nav-item { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 0.92rem; }
  .nav-item:hover { background: var(--surface-2); color: var(--text); }
  .nav-item.on { background: var(--accent-soft); }
  .badge { position: static; margin-left: auto; }
  .view { padding: 28px 32px 60px; }
  .hide-desktop { display: none !important; }
  .chips.scroll { flex-wrap: wrap; margin: 0; padding: 0; }
}

/* ── Page header ────────────────────────────────────────────────────────── */
.page-head { display: flex; align-items: flex-start; gap: 10px; padding-top: 6px; }
.page-title { flex: 1; min-width: 0; }
.page-sub { color: var(--muted); font-size: 0.87rem; margin-top: 2px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer; flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.icon-btn.small { width: 28px; height: 28px; }
.icon-btn.small .icon { width: 14px; height: 14px; }
.back { margin-left: -8px; }

/* ── Cards ──────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.card.flush { padding: 4px 0; }
.card.center { text-align: center; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.count {
  display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--surface-3);
  color: var(--muted); font-size: 0.75rem; line-height: 20px; text-align: center; font-weight: 600;
}
.sub-h { font-size: 0.9rem; margin: 16px 0 8px; color: var(--muted); }
.hero { text-align: center; padding: 24px 18px; background: linear-gradient(160deg, var(--accent-soft), var(--surface) 60%); }
.hero h2 { font-size: 1.25rem; }
.hero p { color: var(--muted); max-width: 520px; margin: 8px auto 0; }
.hero-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 10px; }
.hero-icon .icon { width: 28px; height: 28px; }
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 16px; }

.banner {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius);
  border: 1px solid var(--border); background: var(--surface); font-size: 0.9rem;
}
.banner.warn { background: var(--warn-soft); border-color: transparent; }
.banner > div { flex: 1; }
.banner .icon { color: var(--warn); }
.banner.bad { background: var(--bad-soft); border-color: transparent; }
.banner.bad .icon { color: var(--bad); }

.tip { color: var(--muted); font-size: 0.86rem; }
.tip .icon { color: var(--accent-text); width: 15px; height: 15px; }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty-title { color: var(--text); font-weight: 650; font-size: 1.02rem; }
.empty p { max-width: 460px; margin: 6px auto 0; font-size: 0.9rem; }

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 14px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 0.9rem; cursor: pointer; text-decoration: none !important; white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, transform 0.05s;
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #fff); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--bad); }
.btn-sm { min-height: 34px; padding: 5px 11px; font-size: 0.84rem; }
.btn-block { width: 100%; margin-top: 12px; min-height: 48px; }
.tone-good-btn { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; }
.btn-row.end { justify-content: flex-end; }
.btn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; margin-top: 10px; }
.btn-col { display: flex; flex-direction: column; gap: 6px; }
.link-sm { font-size: 0.85rem; font-weight: 600; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent-text); font-weight: 600; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; }
.link-btn:hover { text-decoration: underline; }
.more-link { display: block; text-align: center; padding: 10px 0 0; font-size: 0.86rem; font-weight: 600; }
.footer-links { display: flex; justify-content: center; gap: 20px; padding: 6px 0; font-size: 0.87rem; }

/* ── Pills & chips ──────────────────────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 0.76rem; font-weight: 600; line-height: 1.6; white-space: nowrap; border: 0;
  background: var(--surface-3); color: var(--muted); text-decoration: none !important;
}
.pill .icon { width: 13px; height: 13px; vertical-align: -2px; }
button.pill { cursor: pointer; }
.pill.tiny { font-size: 0.68rem; padding: 0 7px; }
.tone-good { background: var(--good-soft); color: var(--good); }
.tone-warn { background: var(--warn-soft); color: var(--warn); }
.tone-bad { background: var(--bad-soft); color: var(--bad); }
.tone-info { background: var(--info-soft); color: var(--info); }
.tone-accent { background: var(--accent-soft); color: var(--accent-text); }
.tone-muted { background: var(--surface-3); color: var(--muted); }

.stage-prospect { --st: #94a3b8; }
.stage-contacted { --st: #38bdf8; }
.stage-meeting { --st: #a78bfa; }
.stage-gathering { --st: #818cf8; }
.stage-submitted { --st: #fbbf24; }
.stage-proposal { --st: #fb923c; }
.stage-won { --st: #34d399; }
.stage-lost { --st: #f87171; }
.stage-nurture { --st: #2dd4bf; }
.pill[class*="stage-"] { background: color-mix(in srgb, var(--st) 17%, transparent); color: color-mix(in srgb, var(--st) 75%, var(--text)); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chips.small .chip { padding: 3px 10px; font-size: 0.78rem; min-height: 30px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 0.85rem; font-weight: 600;
  cursor: pointer; white-space: nowrap; flex: none;
}
/* In a wrapping row, a long chip wraps too instead of widening the page. */
.chips:not(.scroll) .chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.chip span { font-size: 0.75rem; opacity: 0.75; }
.chip.on { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); }
.chip-check, .chip-radio { position: relative; display: inline-flex; cursor: pointer; }
.chip-check input, .chip-radio input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span, .chip-radio span {
  display: inline-flex; align-items: center; min-height: 34px; padding: 5px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 0.85rem; font-weight: 600;
}
.chip-check input:checked + span, .chip-radio input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.chip-check input:focus-visible + span, .chip-radio input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.strip { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.strip + .tip { margin-top: 6px; }

/* ── Rows (lists) ───────────────────────────────────────────────────────── */
.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.rows > .row:first-child { border-top: 0; }
.card.flush .row { padding-left: 16px; padding-right: 16px; }
.row-link { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: inherit; text-decoration: none !important; }
a.row.row-link { padding: 10px 0; }
.row-btn { width: 100%; background: none; border: 0; border-top: 1px solid var(--border); text-align: left; cursor: pointer; color: inherit; }
.row-link:hover .row-title, .row-btn:hover .row-title { color: var(--accent-text); }
.row-main { flex: 1; min-width: 0; }
.row-title { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.row-sub { color: var(--muted); font-size: 0.85rem; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; }
.row-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.row-side { text-align: right; flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.row-meta { color: var(--faint); font-size: 0.75rem; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rows.compact .row { padding: 8px 0; }
@media (max-width: 520px) {
  .row-meta { display: none; }
  .row-title { flex-wrap: wrap; row-gap: 2px; }
  .row-title .truncate { white-space: normal; }
  .quick-log .btn:not(:last-child) .icon { display: none; }
}
.money { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 0.9rem; }

/* ── This week scorecard ────────────────────────────────────────────────── */
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 10px 6px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 0.8rem; font-weight: 600; color: var(--muted);
}
.quick-btn strong { color: var(--accent-text); font-size: 1rem; }
.quick-btn span { color: var(--text); font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.quick-btn:active { transform: scale(0.98); background: var(--accent-soft); }
.score-grid { display: grid; gap: 8px; margin-top: 12px; }
.score-row { display: grid; grid-template-columns: 112px 1fr 64px; align-items: center; gap: 10px; font-size: 0.86rem; }
.score-label { color: var(--muted); }
.score-val { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.score-val span { color: var(--faint); font-weight: 500; }

.bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); overflow: visible; }
.bar > span { position: absolute; inset: 0 auto 0 0; border-radius: 4px; background: var(--accent); }
.bar.good > span { background: var(--good); }
.bar.warn > span { background: var(--warn); }
.bar.bad > span { background: var(--bad); }
.bar.muted > span { background: var(--faint); }
.bar > i { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text); opacity: 0.45; border-radius: 1px; }

/* ── Tiles ──────────────────────────────────────────────────────────────── */
.learn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }
.tile {
  display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); color: inherit; text-decoration: none !important;
}
.tile:hover { border-color: var(--accent); }
.tile .icon { width: 26px; height: 26px; color: var(--accent-text); }
.tile strong { display: block; }
.tile span { color: var(--muted); font-size: 0.84rem; }
.tile.tile-lg { background: var(--surface); box-shadow: var(--shadow); padding: 18px 16px; }

/* ── Toolbar ────────────────────────────────────────────────────────────── */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toolbar-right { display: flex; gap: 8px; align-items: center; }
.search {
  flex: 1 1 240px; display: flex; align-items: center; gap: 8px; padding: 0 12px; min-height: 40px;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
}
.toolbar .search input[type="search"] { flex: 1; border: 0; background: transparent; outline: none; min-width: 0; min-height: 38px; padding: 0; color: var(--text); box-shadow: none; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar select, .seg { min-height: 40px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button, .seg label span {
  display: inline-grid; place-items: center; min-width: 40px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; min-height: 38px;
}
.seg button.on { background: var(--accent-soft); color: var(--accent-text); }
.seg.wide { display: flex; }
.seg.wide label { flex: 1; position: relative; }
.seg.wide label input { position: absolute; opacity: 0; }
.seg.wide label span { width: 100%; font-weight: 600; }
.seg.wide input:checked + span { background: var(--accent-soft); color: var(--accent-text); }

/* ── Board ──────────────────────────────────────────────────────────────── */
.board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-snap-type: x mandatory; }
.col { flex: 0 0 240px; scroll-snap-align: start; background: var(--surface-2); border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.col-head { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.col-head .money { margin-left: auto; color: var(--text); }
.col-empty { color: var(--faint); text-align: center; padding: 12px; }
.board-card { display: block; padding: 10px 12px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none !important; }
.board-card:hover { border-color: var(--accent); }
.board-foot { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: 6px; }

/* ── Prospect ───────────────────────────────────────────────────────────── */
.top-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.contact-name { font-weight: 600; flex: 1 1 100%; }
.contact-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.next-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-left: 4px solid var(--accent); }
.next-card.tone-bad { border-left-color: var(--bad); background: var(--surface); color: inherit; }
.next-card.tone-warn { border-left-color: var(--warn); background: var(--surface); color: inherit; }
.next-card .btn-row { margin: 0; }
.next-label { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.quick-log { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 6px; }
.quick-log .btn { padding: 8px 4px; gap: 5px; min-width: 0; }
.quick-log .btn:last-child { min-width: 42px; }
.stepper { display: flex; flex-wrap: wrap; gap: 4px; }
.step {
  flex: 1 0 auto; min-height: 38px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 0.8rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.step.done { background: var(--surface-2); color: var(--text); }
.step.current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.coach summary { cursor: pointer; list-style: none; }
.coach summary::-webkit-details-marker { display: none; }
.coach-title { font-weight: 650; display: flex; gap: 8px; align-items: flex-start; }
.coach-title .icon { color: var(--accent-text); margin-top: 2px; }
.coach details[open] summary { margin-bottom: 8px; }
.moves { margin: 6px 0; padding-left: 20px; }
.moves li { margin: 4px 0; }
.moves.small { font-size: 0.87rem; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs button {
  padding: 10px 14px; border: 0; background: transparent; color: var(--muted); font-weight: 600; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.tab-body > * + * { margin-top: 14px; }
.tab-body { margin-top: 14px !important; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.timeline li:first-child { border-top: 0; }
.tl-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--muted); flex: none; }
.tl-body { flex: 1; min-width: 0; }
.tl-title { font-weight: 600; font-size: 0.92rem; }
.tl-note { font-size: 0.9rem; margin-top: 2px; white-space: pre-wrap; }
.tl-meta { color: var(--faint); font-size: 0.76rem; margin-top: 2px; }
.card .timeline, .tab-body > .timeline { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 4px 14px; }
.card .timeline { border: 0; padding: 0; }

.dl { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 8px 14px; margin: 0; font-size: 0.9rem; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

.checklist { list-style: none; padding: 0; margin: 8px 0; }
.checklist li { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.checklist li:first-child { border-top: 0; }
.checklist.compact li { padding: 6px 0; }
.check-icon { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; flex: none; margin-top: 1px; }
.check-icon .icon { width: 14px; height: 14px; }
.checklist .pass .check-icon { background: var(--good-soft); color: var(--good); }
.checklist .fail .check-icon { background: var(--bad-soft); color: var(--bad); }
.score { padding: 10px 12px; border-radius: 10px; font-weight: 600; font-size: 0.9rem; margin: 10px 0; }
.score.good { background: var(--good-soft); color: var(--good); }
.score.warn { background: var(--warn-soft); color: var(--warn); }

.doc-list { display: grid; gap: 4px; margin: 8px 0 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; font-size: 0.92rem; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check.small { font-size: 0.85rem; padding: 4px 0 0; }
.check.move { background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; }

.script {
  white-space: pre-wrap; word-wrap: break-word; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; font: 0.92rem/1.55 var(--font); margin: 10px 0 0; max-height: 420px; overflow: auto;
}
.ai-out { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }

.rounding { display: grid; gap: 2px; margin: 8px 0; }
.round-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 0.92rem; }
.round-row:first-child { border-top: 0; }
.round-row select { max-width: 52%; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.field-hint { font-size: 0.78rem; color: var(--faint); }
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  width: 100%; min-height: 42px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--bg); color: var(--text); outline: none;
}
textarea { resize: vertical; min-height: 64px; line-height: 1.45; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.small { min-height: 34px; padding: 4px 8px; font-size: 0.85rem; margin-top: 6px; }
.toolbar select { width: auto; background: var(--surface); }
.grid-2, .grid-3 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
}
.form-section { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); margin-top: 6px; }
.next-box { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 12px; background: var(--surface-2); }
.next-box .grid-2 { grid-template-columns: 1.4fr 1fr; }
details.more summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
details.more[open] summary { margin-bottom: 8px; }
.radio-list { display: grid; gap: 2px; }
.radio { display: flex; gap: 10px; align-items: center; padding: 8px 0; cursor: pointer; }
.radio input { width: 18px; height: 18px; accent-color: var(--accent); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
th { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
table.small { font-size: 0.83rem; }
td.right { text-align: right; }

/* ── Sheets ─────────────────────────────────────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.overlay-backdrop { position: absolute; inset: 0; background: rgba(5, 8, 18, 0.55); opacity: 0; transition: opacity 0.16s; }
.sheet {
  position: relative; width: 100%; max-height: 92vh; display: flex; flex-direction: column;
  background: var(--surface); border-radius: 18px 18px 0 0; box-shadow: var(--shadow);
  transform: translateY(24px); opacity: 0; transition: transform 0.18s ease, opacity 0.18s ease;
  padding-bottom: env(safe-area-inset-bottom);
}
.overlay.open .overlay-backdrop { opacity: 1; }
.overlay.open .sheet { transform: none; opacity: 1; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px 8px; }
.sheet-head h2 { font-size: 1.05rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-body { padding: 4px 16px 18px; overflow-y: auto; overscroll-behavior: contain; }
.sheet-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 6px; }
@media (min-width: 720px) {
  .overlay { align-items: center; padding: 24px; }
  .sheet { max-width: 560px; border-radius: 18px; max-height: 88vh; }
  .sheet-wide { max-width: 780px; }
}

/* ── Toasts ─────────────────────────────────────────────────────────────── */
.toasts {
  position: fixed; z-index: 60; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 32px)); pointer-events: none;
}
@media (min-width: 960px) { .toasts { bottom: 24px; left: calc(50% + 110px); } }
.toast {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; pointer-events: auto;
  background: var(--text); color: var(--bg); box-shadow: var(--shadow); font-size: 0.9rem; font-weight: 500;
  opacity: 0; transform: translateY(8px); transition: opacity 0.18s, transform 0.18s;
}
.toast.show { opacity: 1; transform: none; }
.toast span { flex: 1; }
.toast.good { background: var(--good); color: #04110b; }
.toast.bad { background: var(--bad); color: #fff; }
.toast-btn { background: transparent; border: 0; color: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; }

/* ── Insights ───────────────────────────────────────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.stat { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.stat-v { font-size: 1.3rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.goal-head { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 10px; }
.big { font-size: 1.7rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }

.finding { padding: 12px 14px; border-radius: 12px; color: var(--text); }
.finding.tone-bad { background: var(--bad-soft); }
.finding.tone-warn { background: var(--warn-soft); }
.finding.tone-good { background: var(--good-soft); }
.finding.tone-info { background: var(--info-soft); }
.finding-title { font-weight: 700; }
.finding p { margin: 4px 0 6px; font-size: 0.92rem; }
.finding-more { padding: 8px 0; border-top: 1px solid var(--border); }
.finding-more summary { cursor: pointer; font-weight: 600; font-size: 0.92rem; display: flex; align-items: center; gap: 8px; }
.finding-more:first-of-type { margin-top: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot.tone-bad { background: var(--bad); }
.dot.tone-warn { background: var(--warn); }
.dot.tone-good { background: var(--good); }
.dot.tone-info { background: var(--info); }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.chart { margin: 0; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .baseline { stroke: var(--border); stroke-width: 1; }
.chart .target { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .bar-mark { fill: var(--accent); opacity: 0.55; }
.chart .bar-mark.current { opacity: 1; }
.chart .bar-g:hover .bar-mark { opacity: 1; }
.chart .hit { fill: transparent; }
.chart .axis-l { fill: var(--faint); font-size: 10px; font-family: var(--font); }
.chart .val-l { fill: var(--text); font-size: 11px; font-weight: 700; font-family: var(--font); }

.funnel { display: grid; gap: 2px; }
.funnel-row { display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); }
.funnel-row:first-child { border-top: 0; }
.funnel-n { font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; grid-row: span 2; }
.funnel-label { font-weight: 600; font-size: 0.9rem; }
.funnel-rate { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.hbars { display: grid; gap: 8px; }
.hbar-row { display: grid; grid-template-columns: minmax(110px, 30%) 1fr auto; gap: 10px; align-items: center; color: inherit; text-decoration: none !important; }
.hbar-val { font-size: 0.84rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare { padding: 10px 0; border-top: 1px solid var(--border); }
.compare-label { font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.compare-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare-cells > div { background: var(--surface-2); padding: 10px; border-radius: 10px; }
.plan { display: grid; gap: 2px; margin-top: 8px; }
.plan-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--border); align-items: baseline; }
.plan-row:first-child { border-top: 0; }
.plan-row strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; text-align: right; }
.plan-row .muted { grid-column: 1 / -1; font-size: 0.78rem; }

/* ── Learn ──────────────────────────────────────────────────────────────── */
.lesson { font-size: 1rem; line-height: 1.65; }
.lesson .lede { font-size: 1.06rem; color: var(--muted); margin-top: 0; }
.lesson h3 { font-size: 1.08rem; margin: 22px 0 6px; }
.lesson h4 { font-size: 0.98rem; margin: 16px 0 4px; }
.lesson ul, .lesson ol { padding-left: 22px; }
.lesson li { margin: 4px 0; }
.lesson table { margin: 10px 0; }
.lesson code { font-family: var(--mono); font-size: 0.9em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
blockquote { margin: 10px 0; padding: 10px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; font-style: italic; }
.callout { margin: 14px 0; padding: 12px 14px; border-radius: 12px; background: var(--accent-soft); font-weight: 500; }
.lesson-check { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); flex: none; }
.lesson-check.done { background: var(--good); border-color: var(--good); color: #04110b; }
.lesson-check .icon { width: 14px; height: 14px; }
.quiz { padding: 12px 0; border-top: 1px solid var(--border); }
.quiz:first-of-type { border-top: 0; }
.quiz-q { font-weight: 600; margin-bottom: 8px; }
.quiz-opts { display: grid; gap: 6px; }
.quiz-opt {
  text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2);
  cursor: pointer; font-size: 0.92rem; line-height: 1.4;
}
.quiz-opt:hover:not(:disabled) { border-color: var(--accent); }
.quiz-opt:disabled { cursor: default; }
.quiz-opt.right { background: var(--good-soft); border-color: var(--good); color: var(--text); }
.quiz-opt.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--text); }
.quiz-opt.dim { opacity: 0.55; }
.quiz-why { font-size: 0.88rem; margin: 8px 0 0; }
.lesson-nav { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.lesson-nav .btn { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: normal; text-align: left; }

.session-progress { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.flashcard { min-height: 220px; display: flex; flex-direction: column; justify-content: center; padding: 26px 20px; }
.fc-deck { font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--faint); margin-bottom: 10px; }
.fc-front { font-size: 1.2rem; font-weight: 650; line-height: 1.4; }
.fc-back { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--border); font-size: 1rem; line-height: 1.55; }
.rate-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rate { flex-direction: column; min-height: 58px; gap: 0; }
.rate span { font-size: 0.74rem; font-weight: 500; color: var(--muted); }
.rate.again strong { color: var(--bad); }
.rate.good strong { color: var(--info); }
.rate.easy strong { color: var(--good); }
@media (hover: none) { .hide-touch { display: none; } }

details.objection { padding: 0; }
details.objection summary { padding: 14px 16px; cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
details.objection .fc-back { margin: 0 16px 16px; padding-top: 12px; }

.chat { display: flex; flex-direction: column; gap: 8px; min-height: 40vh; max-height: calc(100vh - 290px); overflow-y: auto; padding: 4px 0; }
.bubble { max-width: 85%; padding: 10px 13px; border-radius: 16px; white-space: pre-wrap; line-height: 1.45; font-size: 0.95rem; }
.bubble.assistant { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 5px; }
.bubble.user { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.bubble.typing { color: var(--muted); }
.chat-input { display: flex; gap: 8px; align-items: stretch; position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); background: var(--bg); padding-top: 8px; }
@media (min-width: 960px) { .chat-input { bottom: 12px; } }
.chat-input textarea { flex: 1; }

.niche-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.niche-tile { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: inherit; text-decoration: none !important; }
.niche-tile:hover, .niche-tile.mine { border-color: var(--accent); }
.niche-tile span { font-size: 0.78rem; color: var(--muted); }
.guide-stage { border-top: 1px solid var(--border); padding: 10px 0; }
.guide-stage:first-of-type { border-top: 0; }
.guide-stage summary { cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 600; font-size: 0.92rem; }
.glossary { border-top: 1px solid var(--border); padding: 10px 0; }
.glossary summary { cursor: pointer; font-weight: 600; }
.glossary .dl { margin-top: 10px; grid-template-columns: minmax(140px, 40%) 1fr; }

details > summary { list-style-position: outside; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ── Bounty hunter mode (the fun layer) ─────────────────────────────────── */
.kicker {
  font: 600 0.66rem/1.3 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--hud); margin-bottom: 3px;
}
.kicker::before { content: "▸ "; opacity: 0.7; }
.card-head > div { min-width: 0; }
.tone-hud { background: var(--hud-soft); color: var(--hud); font-family: var(--mono); letter-spacing: 0.02em; }
.tip.wisdom strong { color: var(--hud); }
.flavor-toggle { margin-top: 12px; }
.nav .brand-rank { display: none; }

:root[data-flavor="hunter"] body {
  background-image:
    radial-gradient(1px 1px at 24px 36px, rgba(255, 255, 255, 0.55), transparent),
    radial-gradient(1px 1px at 142px 92px, rgba(255, 255, 255, 0.32), transparent),
    radial-gradient(1.5px 1.5px at 214px 168px, rgba(170, 225, 255, 0.5), transparent),
    radial-gradient(1px 1px at 88px 214px, rgba(255, 255, 255, 0.28), transparent),
    radial-gradient(1px 1px at 262px 44px, rgba(255, 228, 180, 0.42), transparent),
    radial-gradient(1200px 600px at 85% -10%, rgba(245, 165, 36, 0.07), transparent 60%);
  background-size: 300px 260px, 300px 260px, 300px 260px, 300px 260px, 300px 260px, 100% 100%;
  background-repeat: repeat, repeat, repeat, repeat, repeat, no-repeat;
  background-attachment: fixed;
}
@media (prefers-color-scheme: light) {
  :root[data-flavor="hunter"]:not([data-theme="dark"]) body {
    background-image: linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
    background-size: 32px 32px; background-repeat: repeat;
  }
}
:root[data-flavor="hunter"][data-theme="light"] body {
  background-image: linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px);
  background-size: 32px 32px; background-repeat: repeat;
}

/* HUD corner brackets framing key panels */
:root[data-flavor="hunter"] .hud { position: relative; }
:root[data-flavor="hunter"] .hud::before {
  content: ""; position: absolute; inset: -5px; pointer-events: none; opacity: 0.75;
  --c: var(--hud); --l: 16px; --w: 2px;
  background:
    linear-gradient(var(--c) 0 0) top left / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) top left / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) top right / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) top right / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) bottom left / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) bottom left / var(--w) var(--l),
    linear-gradient(var(--c) 0 0) bottom right / var(--l) var(--w),
    linear-gradient(var(--c) 0 0) bottom right / var(--w) var(--l);
  background-repeat: no-repeat;
}

/* Readout numbers */
:root[data-flavor="hunter"] :is(.stat-v, .big, .money, .score-val, .funnel-n, .quick-btn span, .plan-row strong) {
  font-family: var(--mono); letter-spacing: -0.02em;
}

@media (min-width: 960px) {
  .nav .brand-rank {
    display: block; margin: -14px 10px 14px 46px; font: 600 0.68rem/1.3 var(--mono);
    letter-spacing: 0.06em; color: var(--hud); text-decoration: none;
  }
}

/* Celebration */
.celebrate {
  position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 24px;
  background: rgba(5, 8, 18, 0.55); opacity: 0; transition: opacity 0.2s; cursor: pointer;
}
.celebrate.show { opacity: 1; }
.celebrate-card {
  text-align: center; padding: 28px 32px; border-radius: 20px; max-width: 360px; width: 100%;
  background: var(--surface); border: 1px solid var(--hud); box-shadow: 0 0 0 4px var(--hud-soft), var(--shadow);
  transform: scale(0.92); transition: transform 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.celebrate.show .celebrate-card { transform: none; }
.celebrate-ring {
  width: 64px; height: 64px; margin: 0 auto 12px; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-text); animation: ping 1.1s ease-out 1;
}
.celebrate-ring .icon { width: 36px; height: 36px; }
.celebrate-title { font: 800 2rem/1.15 var(--mono); color: var(--accent-text); margin: 4px 0 6px; }
.celebrate-sub { font-weight: 650; }
.celebrate-note { color: var(--muted); font-size: 0.86rem; margin-top: 8px; }
@keyframes ping { from { box-shadow: 0 0 0 0 var(--accent-soft); } to { box-shadow: 0 0 0 30px transparent; } }

/* Hunter profile */
.rank-top { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.rank-emblem {
  width: 66px; height: 74px; flex: none; display: grid; place-items: center; background: var(--accent);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}
.rank-emblem span { font: 800 1.6rem var(--mono); color: var(--accent-ink); }
.rank-title { font-size: 1.45rem; font-weight: 750; letter-spacing: -0.01em; }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.trophy { display: flex; gap: 12px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.trophy.earned { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); }
.trophy-icon { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--surface-3); color: var(--faint); }
.trophy.earned .trophy-icon { background: var(--accent-soft); color: var(--accent-text); }
.trophy-title { font-weight: 700; }
.trophy.locked .trophy-title { color: var(--muted); }
.trophy-desc { font-size: 0.82rem; color: var(--muted); }
.trophy-meta { display: block; font-size: 0.76rem; margin-top: 4px; color: var(--faint); }
a.trophy-meta { color: var(--accent-text); }
.ladder { list-style: none; margin: 0; padding: 0; }
.ladder li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border); color: var(--muted); }
.ladder li:first-child { border-top: 0; }
.ladder-n { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-3); font: 700 0.75rem var(--mono); }
.ladder li.done { color: var(--text); }
.ladder li.done .ladder-n { background: var(--good-soft); color: var(--good); }
.ladder li.current { color: var(--text); font-weight: 700; }
.ladder li.current .ladder-n { background: var(--accent); color: var(--accent-ink); }
.ladder-min { font: 0.8rem var(--mono); }

/* ── Prospect research ──────────────────────────────────────────────────── */
.toggle-head { display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; font-weight: 650; font-size: 1.02rem; }
.toggle-head::-webkit-details-marker { display: none; }
.toggle-head .chev { margin-left: auto; color: var(--muted); transition: transform 0.15s; }
details[open] > .toggle-head { margin-bottom: 10px; }
details[open] > .toggle-head .chev { transform: rotate(180deg); }
.prefs-row { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 560px) { .prefs-row { grid-template-columns: 2fr 1fr; } }
.range-inputs { display: flex; align-items: center; gap: 8px; }
.range-inputs input { max-width: 120px; }
.range-inputs span { color: var(--muted); font-size: 0.85rem; }
.research-prefs .check { padding: 2px 0; }
.targets { list-style: none; margin: 10px 0 0; padding: 0; }
.target { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border); align-items: start; }
.targets > .target:first-child { border-top: 0; }
.target.compact { padding: 10px 0; }
.target-score { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 52px; height: 52px; border-radius: 12px; font-variant-numeric: tabular-nums; }
.target-score b { font-size: 1.15rem; line-height: 1; }
.target-score span { font-size: 0.7rem; opacity: 0.8; margin-top: 3px; }
.target.compact .target-score { width: 44px; height: 44px; }
.target-main { min-width: 0; }
.target-actions { display: flex; flex-direction: column; gap: 6px; }
.target-contact { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; color: var(--muted); }
.target-contact a { display: inline-flex; gap: 4px; align-items: center; }
.target-contact .icon { width: 15px; height: 15px; }
.why { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: 0.84rem; }
.why li { display: flex; gap: 6px; align-items: flex-start; }
.why li > span { color: var(--text); }
.why li.tone-text-muted > span { color: var(--muted); }
.why .icon { width: 14px; height: 14px; margin-top: 3px; }
.brief { margin-top: 10px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; background: var(--surface-2); }
.brief summary { cursor: pointer; font-weight: 600; font-size: 0.9rem; }
.brief-body { font-size: 0.92rem; line-height: 1.55; margin-top: 6px; overflow-wrap: anywhere; }
.brief-body p { margin: 0.45em 0; }
.link-btn.danger { color: var(--bad); }
@media (max-width: 520px) {
  .target { grid-template-columns: 44px minmax(0, 1fr); }
  .target-score { width: 44px; height: 44px; }
  .target-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
}

/* ── Account profile ───────────────────────────────────────────────── */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: 10px 0; }
.fact { display: grid; gap: 3px; align-content: start; text-align: left; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; min-width: 0; }
.fact:hover { border-color: var(--accent); }
.fact-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; min-width: 0; }
.fact-label { font-size: 0.78rem; color: var(--muted); }
.fact-value { font-weight: 600; overflow-wrap: anywhere; white-space: pre-line; }
.fact-newer { font-size: 0.78rem; color: var(--warn); }
.src { flex: none; font-size: 0.7rem; padding: 1px 7px; border-radius: 999px; background: var(--surface-3); color: var(--muted); white-space: nowrap; }
.src-client { background: var(--good-soft); color: var(--good); }
.src-doc { background: var(--info-soft); color: var(--info); }
.src-web, .src-list { background: var(--hud-soft); color: var(--hud); }
.src.unverified { border: 1px dashed currentColor; background: transparent; }
.ask-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 0.9rem; }
.ask-list .link-btn { display: inline; }
.form-sep { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.chips.missing { margin: 8px 0 4px; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.check.disabled { opacity: 0.55; cursor: default; }
.ai-log { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.ai-log select { display: inline-block; width: auto; min-height: 0; padding: 2px 6px; margin: 0 4px; font-size: 0.8rem; }
.saved-brief { margin-top: 10px; }
.saved-brief summary { cursor: pointer; font-size: 0.9rem; }

/* ── Suggested updates (AI proposes, you decide) ───────────────────── */
.proposals { display: grid; gap: 10px; margin-top: 10px; }
.proposal { display: grid; gap: 6px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); min-width: 0; }
.evidence { margin: 0; padding-left: 10px; border-left: 3px solid var(--hud); font-size: 0.88rem; color: var(--text); overflow-wrap: anywhere; }
.evidence a { white-space: nowrap; font-size: 0.82rem; }
.proposal-row { display: flex; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.proposal-row input, .proposal-row textarea { flex: 1 1 180px; min-width: 0; }
.proposal-row .btn-row { flex: none; margin: 0; }

/* Open items (commitments) */
.btn-row.tight { margin: 0; gap: 6px; }
.row.commit { align-items: flex-start; }
.commit-check { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; cursor: pointer; }
.row-edit { flex: 1; min-width: 0; display: flex; background: none; border: 0; padding: 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.row-edit:hover .row-title { color: var(--accent-text); }
.row.commit .row-title { font-weight: 500; overflow-wrap: anywhere; }
.row.commit.done .row-title { text-decoration: line-through; color: var(--muted); }
.done-items summary { font-size: 0.85rem; color: var(--muted); cursor: pointer; margin-top: 8px; }

/* Last time (account card) */
.last-touch { padding: 2px 0 4px; }
.learned { margin-top: 10px; display: grid; gap: 6px; }
.card-subhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 14px 0 2px; padding-top: 12px; border-top: 1px solid var(--border); }
.card-subhead h3 { margin: 0; font-size: 0.95rem; display: flex; align-items: center; gap: 8px; }

/* Suggested-update editors: short controls stay short, so a row fits on one line on desktop */
.proposal-row select { flex: 0 1 150px; width: auto; }
.proposal-row input[type="date"] { flex: 0 1 165px; width: auto; }
.proposal-row .chips { flex: 1 1 180px; }

/* Prep brief */
.brief-h { font-size: 0.95rem; margin: 16px 0 6px; }
summary.brief-h { cursor: pointer; display: list-item; }
.brief-snap { margin-top: 6px; }
.brief-qs { margin: 0; padding-left: 22px; display: grid; gap: 8px; font-size: 0.92rem; }
.brief-ai { margin-top: 18px; padding-top: 6px; border-top: 1px solid var(--border); }

/* Submission readiness */
.checklist .st-have .check-icon { background: var(--good-soft); color: var(--good); }
.checklist .st-owed .check-icon { background: var(--warn-soft); color: var(--warn); }
.checklist .st-missing .check-icon { background: var(--bad-soft); color: var(--bad); }
.field-hint.block { display: block; }
.doc-list.readiness .check.st-have > span { color: var(--muted); }

/* Do-not-call list */
.dnc-pill { white-space: nowrap; }
.link-btn.quiet { color: var(--muted); font-weight: 500; }
.dnc-list { list-style: none; margin: 10px 0; padding: 0; max-height: 55vh; overflow: auto; }
.dnc-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.dnc-list li:first-child { border-top: 0; }
.dnc-main { flex: 1; min-width: 0; overflow-wrap: anywhere; }

/* Next build phase: exit criteria */
.checklist.gate li { padding: 12px 0; }
.checklist .pending .check-icon { background: var(--surface-3); color: var(--muted); }
.gate-body { flex: 1; min-width: 0; display: grid; gap: 6px; }
.gate-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }

/* Narrative number guard */
.banner.guard { align-items: flex-start; margin-top: 8px; }
.banner.guard mark { background: var(--warn-soft); color: inherit; font-weight: 700; padding: 0 3px; border-radius: 4px; }
#narrative-text { font-size: 0.92rem; line-height: 1.5; }
.hbars.fixed-val .hbar-row { grid-template-columns: minmax(60px, 18%) 1fr 92px; }
.hbars.fixed-val .hbar-val { text-align: right; }
