/* Color and type values match the AI dashboard (site/src/styles/tokens.css). */
:root {
  color-scheme: light;
  --canvas: #f3f6fb; --surface: #ffffff; --surface-sunk: #f6f8fc;
  --ink: #0f172a; --ink-2: #334155; --muted: #5d6b80;
  --line: #e3e9f2; --line-strong: #cfd8e5;
  --accent-a: #4f46e5; --accent-b: #0ea5e9; --accent-ink: #4338ca;
  --up: #047857; --down: #b91c1c; --warn: #b45309; --stale: #64748b;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .05);
  --radius-l: 14px; --radius-s: 8px;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --canvas: #0b1120; --surface: #111a2e; --surface-sunk: #0d1526;
    --ink: #e8edf6; --ink-2: #c3cddd; --muted: #93a1b7;
    --line: #1f2a40; --line-strong: #2c3a55;
    --accent-a: #7c74f0; --accent-b: #38bdf8; --accent-ink: #a5b4fc;
    --up: #34d399; --down: #f87171; --warn: #fbbf24; --stale: #93a1b7;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 16px/1.5 var(--font); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
a { color: var(--accent-ink); }

.top { background: var(--surface); border-bottom: 1px solid var(--line); padding: 24px 0 0; }
.eyebrow { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
h1 { margin: 4px 0; font-size: clamp(26px, 5vw, 36px); line-height: 1.15; text-wrap: balance; }
.meta { margin: 0 0 16px; color: var(--muted); font-size: 14px; }
nav { display: flex; gap: 4px; }
nav a { padding: 10px 16px; border-radius: var(--radius-s) var(--radius-s) 0 0; color: var(--ink-2);
        text-decoration: none; font-weight: 600; border-bottom: 3px solid transparent; }
nav a[aria-current="page"] { color: var(--accent-ink); border-bottom-color: var(--accent-a); }

section { margin: 32px 0; }
h2 { margin: 0 0 12px; font-size: 20px; }
h3 { margin: 0 0 8px; font-size: 15px; color: var(--ink-2); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
p { margin: 0 0 8px; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-l);
        box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card.small { padding: 12px 14px; box-shadow: none; margin-bottom: 8px; }
.num { font-size: clamp(36px, 8vw, 52px); font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sub { color: var(--muted); font-size: 14px; }
.weight { font-size: 12px; font-weight: 600; color: var(--accent-ink); border: 1px solid var(--line-strong);
          border-radius: 999px; padding: 1px 8px; }
.note { color: var(--warn); font-size: 14px; }
.na { background: var(--surface-sunk); border: 1px dashed var(--line-strong); border-radius: var(--radius-s);
      padding: 12px 14px; color: var(--ink-2); }

.pairs { margin: 12px 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px 16px; }
.pairs div { border-top: 1px solid var(--line); padding-top: 6px; }
dt { color: var(--muted); font-size: 13px; }
dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 12px; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: 13px; }
th, td { padding: 8px 16px 8px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
th:last-child, td:last-child { padding-right: 0; }
.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.path { word-break: break-all; }
.scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line);
          border-radius: var(--radius-l); padding: 4px 16px 8px; }
.scroll table { min-width: 520px; margin-top: 0; }

.sources { margin-top: 4px; border-top: 1px solid var(--line); }
details { border-bottom: 1px solid var(--line); }
summary { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer;
          font-size: 14px; list-style-position: inside; }
summary::marker { color: var(--muted); }
summary span:first-child { flex: 1; }
summary:hover span:first-child, summary:focus-visible span:first-child { color: var(--accent-ink); }
details[open] > summary { font-weight: 600; }
.leads { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.leads li { background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius-s);
            padding: 10px 12px; font-size: 14px; overflow-wrap: anywhere; }
.leads p { margin: 0 0 4px; }
.when { color: var(--muted); font-size: 13px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.who { font-weight: 600; font-size: 15px; }
.said { color: var(--ink-2); border-left: 3px solid var(--line-strong); padding-left: 8px; }
.hint { margin: 12px 0 4px; }

.targets { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.q { font-weight: 600; font-size: 17px; line-height: 1.35; }
.card.small .q { font-size: 15px; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-radius: 999px;
       padding: 2px 10px; background: var(--surface-sunk); color: var(--ink-2); border: 1px solid var(--line-strong); }
.tag.machine { color: var(--accent-ink); }
.tag.parts { color: var(--up); }
.tag.plain { text-transform: none; letter-spacing: 0; font-weight: 500; }
.links { font-size: 14px; margin: 0; }

.result, .status { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px;
                   border: 1px solid var(--line-strong); white-space: nowrap; }
.result.moved, .result.won, .status.ok { color: var(--up); }
.result.lost-ground, .status.failed { color: var(--down); }
.status.blocked { color: var(--warn); }
.result.no-change, .result.not-tracked { color: var(--stale); }

.flags { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.flags li { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--warn);
            border-radius: var(--radius-s); padding: 10px 14px; }

.board { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.col { background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius-l);
       padding: 12px; min-width: 0; }
.count { font-size: 12px; color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px;
         padding: 0 8px; }
.empty { color: var(--muted); font-size: 14px; margin: 0; }
.member p { overflow-wrap: anywhere; }
@media (max-width: 860px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .board { grid-template-columns: 1fr; } }

.role { font-weight: 500; color: var(--muted); font-size: 13px; }
.member h3 { font-size: 17px; color: var(--ink); }
.sample { margin: 20px 0 0; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent-a);
          border-radius: var(--radius-s); padding: 10px 14px; font-size: 14px; }

.draft-q { font-size: 24px; line-height: 1.25; margin: 8px 0; }
.draft { overflow-wrap: anywhere; }
.draft h2 { margin: 28px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.draft h2:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.draft h3 { font-size: 18px; color: var(--ink); margin: 18px 0 6px; display: block; }
.draft h4 { margin: 14px 0 4px; }
.draft ul { margin: 0 0 10px; padding-left: 20px; }
.draft pre { background: var(--surface-sunk); border: 1px solid var(--line); border-radius: var(--radius-s);
             padding: 12px; overflow-x: auto; font-size: 13px; }

.proposals { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.proposals li { border-top: 1px solid var(--line); padding-top: 10px; }
.proposals .q { font-size: 15px; margin-bottom: 6px; }

.graphics { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
.graphics figure { margin: 0; }
.graphics img { width: 100%; height: auto; display: block; border: 1px solid var(--line-strong); border-radius: var(--radius-s); }

.grid.three { grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.post { font-size: 15px; overflow-wrap: anywhere; }
.post h3 { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }

.foot { color: var(--muted); font-size: 13px; padding-top: 8px; padding-bottom: 40px; }
