/* smarter.report — design tokens, light + dark. Chart colors follow the
   validated reference palette (blue series, blue/red diverging pair). */
:root {
  color-scheme: light;
  --bg: #f9f9f7;
  --surface: #fcfcfb;
  --surface-2: #f3f2ee;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6d68;
  --hairline: #e1e0d9;
  --border: rgba(11, 11, 11, 0.1);
  --brand: #2a78d6;
  --brand-ink: #1c5cab;
  --brand-wash: #e8f1fc;
  --series-1: #2a78d6;
  --series-1-soft: #b7d3f6;
  --area: rgba(42, 120, 214, 0.1);
  --up: #2a78d6;
  --down: #e34948;
  --good: #006300;
  --bad: #b42323;
  --good-wash: #e7f4e7;
  --bad-wash: #fbeaea;
  --warn-wash: #fff4dc;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #9a988f;
    --hairline: #2c2c2a; --border: rgba(255, 255, 255, 0.1); --brand: #3987e5; --brand-ink: #86b6ef; --brand-wash: #15263b;
    --series-1: #3987e5; --series-1-soft: #2c4566; --area: rgba(57, 135, 229, 0.16); --up: #3987e5; --down: #e66767;
    --good: #0ca30c; --bad: #ff7b7b; --good-wash: #12291a; --bad-wash: #331616; --warn-wash: #2e2610;
    --grid: #2c2c2a; --axis: #383835; --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d0d0d; --surface: #1a1a19; --surface-2: #222220; --ink: #ffffff; --ink-2: #c3c2b7; --muted: #9a988f;
  --hairline: #2c2c2a; --border: rgba(255, 255, 255, 0.1); --brand: #3987e5; --brand-ink: #86b6ef; --brand-wash: #15263b;
  --series-1: #3987e5; --series-1-soft: #2c4566; --area: rgba(57, 135, 229, 0.16); --up: #3987e5; --down: #e66767;
  --good: #0ca30c; --bad: #ff7b7b; --good-wash: #12291a; --bad-wash: #331616; --warn-wash: #2e2610;
  --grid: #2c2c2a; --axis: #383835; --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0 0 0.5em; }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 860px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.tabular { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- nav */
.nav { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--hairline); }
.nav .wrap { display: flex; align-items: center; gap: 24px; height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; color: var(--ink); letter-spacing: -0.02em; font-size: 1.05rem; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: var(--ink); display: grid; place-items: center; }
.logo-mark svg { width: 16px; height: 16px; }
.logo span.dot { color: var(--brand); }
.nav-links { display: flex; gap: 20px; margin-left: 8px; }
.nav-links a { color: var(--ink-2); font-size: 0.94rem; }
.nav-links a.active { color: var(--ink); font-weight: 600; }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* ---------- buttons, pills */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); padding: 9px 16px; border-radius: 10px; font: 600 0.93rem var(--font); cursor: pointer; white-space: nowrap; }
.btn:hover { text-decoration: none; background: var(--surface-2); }
.btn-primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink); opacity: 0.88; }
.btn-brand { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-brand:hover { background: var(--brand); opacity: 0.9; }
.btn-lg { padding: 13px 22px; font-size: 1rem; border-radius: 12px; }
.btn-sm { padding: 6px 11px; font-size: 0.84rem; border-radius: 8px; }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.78rem; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); white-space: nowrap; }
.pill-good { background: var(--good-wash); color: var(--good); border-color: transparent; }
.pill-bad { background: var(--bad-wash); color: var(--bad); border-color: transparent; }
.pill-brand { background: var(--brand-wash); color: var(--brand-ink); border-color: transparent; }
.pill-warn { background: var(--warn-wash); color: var(--ink-2); border-color: transparent; }
.dot-status { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

/* ---------- cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } .wrap { padding: 0 16px; } .nav-links { display: none; } .hide-sm { display: none !important; } .nav .wrap { gap: 12px; } }

/* ---------- landing */
.hero { padding: 72px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.75rem; font-weight: 700; color: var(--brand-ink); margin-bottom: 14px; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.6rem); letter-spacing: -0.035em; line-height: 1.05; margin-bottom: 20px; }
.hero h1 em { font-style: normal; color: var(--brand); }
.lede { font-size: 1.18rem; color: var(--ink-2); max-width: 36em; }
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 28px 0 14px; }
.preview { position: relative; }
.preview .card { padding: 26px; }
.preview-h { font-size: 1.28rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin: 8px 0 14px; }
.preview-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; }
.preview-kpis .kpi { padding: 12px; }
.preview-kpis .kpi-value { font-size: 1.15rem; }
.section { padding: 64px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); }
.section h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -0.025em; }
.section-head { max-width: 680px; margin-bottom: 36px; }
.waitlist { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 36px; align-items: start; }
.waitlist h2 { margin-top: 0; }
.waitlist-form { display: grid; gap: 14px; }
.waitlist-form .field { display: grid; gap: 6px; font-size: 0.875rem; font-weight: 600; }
.waitlist-form .field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.waitlist-form input, .waitlist-form select { font: inherit; font-weight: 400; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--ink); width: 100%; box-sizing: border-box; }
.waitlist-form input:focus, .waitlist-form select:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.waitlist-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { margin: 0; min-height: 1.4em; font-size: 0.9rem; font-weight: 600; }
.form-msg-good { color: var(--good); }
.form-msg-bad { color: var(--bad); }
@media (max-width: 760px) { .waitlist { grid-template-columns: 1fr; padding: 24px; gap: 24px; } .waitlist-form .field-row { grid-template-columns: 1fr; } }
.step-n { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-wash); color: var(--brand-ink); display: grid; place-items: center; font-weight: 700; margin-bottom: 14px; }
.logos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.compare { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.compare th, .compare td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.compare th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.compare tr.us td { background: var(--brand-wash); font-weight: 600; }
.table-scroll { overflow-x: auto; }
.price { display: flex; flex-direction: column; }
.price h3 { font-size: 1.05rem; }
.price .amount { font-size: 2.2rem; font-weight: 750; letter-spacing: -0.03em; margin: 6px 0 2px; }
.price .amount small { font-size: 0.95rem; color: var(--muted); font-weight: 500; }
.price ul { list-style: none; padding: 0; margin: 18px 0 22px; flex: 1; }
.price li { padding: 5px 0 5px 24px; position: relative; color: var(--ink-2); font-size: 0.94rem; }
.price li::before { content: ""; position: absolute; left: 2px; top: 11px; width: 10px; height: 6px; border-left: 2px solid var(--brand); border-bottom: 2px solid var(--brand); transform: rotate(-45deg); }
.price.featured { border: 2px solid var(--brand); }
.footer { padding: 36px 0 48px; color: var(--muted); font-size: 0.88rem; border-top: 1px solid var(--hairline); }

/* ---------- app */
.page { padding: 32px 0 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 1.75rem; margin: 0; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi-label { font-size: 0.82rem; color: var(--ink-2); font-weight: 600; }
.kpi-value { font-size: 1.6rem; font-weight: 720; letter-spacing: -0.02em; }
.kpi-delta { font-size: 0.84rem; font-weight: 600; display: flex; align-items: center; gap: 4px; }
.kpi-delta .vs { color: var(--muted); font-weight: 500; }
.kpi-delta { flex-wrap: wrap; }
.delta-good { color: var(--good); }
.delta-bad { color: var(--bad); }
.delta-flat { color: var(--muted); }
.kpi .spark { margin-top: 8px; width: 100%; height: 32px; }
.spark-line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 12px 0; border-bottom: 1px solid var(--hairline); display: flex; gap: 12px; align-items: center; }
.list li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.conn { display: flex; flex-direction: column; gap: 12px; }
.conn-head { display: flex; align-items: center; gap: 12px; }
.conn-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 0.95rem; flex: none; }
.conn-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: auto; }
.conn-soon { opacity: 0.75; }
.upload-msg { font-size: 0.86rem; }
.upload-msg.err { color: var(--bad); white-space: pre-line; }
.upload-msg.ok { color: var(--good); }
.banner { border-radius: 12px; padding: 12px 16px; background: var(--brand-wash); color: var(--ink); font-size: 0.93rem; margin-bottom: 20px; }
.banner.warn { background: var(--warn-wash); }
input[type="text"] { font: inherit; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); min-width: 0; }
input[type="file"] { font-size: 0.84rem; max-width: 100%; color: var(--ink-2); }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- report */
.report-bar { border-bottom: 1px solid var(--hairline); background: var(--surface); }
.report-bar .wrap { display: flex; align-items: center; gap: 10px; height: 56px; flex-wrap: wrap; }
.report-bar .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.report { padding: 40px 0 72px; }
.report h1 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -0.03em; line-height: 1.12; margin: 6px 0 16px; }
.report .summary { font-size: 1.12rem; color: var(--ink-2); }
.report h2 { font-size: 1.3rem; margin: 44px 0 16px; padding-top: 8px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 26px 0 8px; }
.story { margin-bottom: 18px; break-inside: avoid; }
.story-head { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.story h3 { font-size: 1.12rem; margin: 6px 0 8px; }
.story .why { background: var(--surface-2); border-radius: 10px; padding: 14px 16px; margin-top: 14px; }
.story .why-label { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.07em; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.story-charts { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 12px; }
@media (max-width: 760px) { .story-charts { grid-template-columns: 1fr; } }
.chart-title { font-size: 0.82rem; font-weight: 600; color: var(--ink-2); margin: 4px 0 6px; }
.actions-list { counter-reset: act; list-style: none; padding: 0; margin: 0; }
.actions-list li { counter-increment: act; position: relative; padding: 14px 0 14px 46px; border-bottom: 1px solid var(--hairline); break-inside: avoid; }
.actions-list li::before { content: counter(act); position: absolute; left: 0; top: 14px; width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; }
.actions-list strong { display: block; margin-bottom: 2px; }
.fact { font-weight: 650; color: var(--ink); text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; white-space: nowrap; }
.report-foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--hairline); color: var(--muted); font-size: 0.86rem; }
details.data { margin-top: 12px; }
details.data summary { cursor: pointer; color: var(--ink-2); font-weight: 600; font-size: 0.92rem; }
table.data-table { border-collapse: collapse; width: 100%; font-size: 0.86rem; margin-top: 12px; font-variant-numeric: tabular-nums; }
table.data-table th, table.data-table td { padding: 7px 10px; border-bottom: 1px solid var(--hairline); text-align: right; white-space: nowrap; }
table.data-table th:first-child, table.data-table td:first-child { text-align: left; }

/* ---------- charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { font-family: var(--font); }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--series-1-soft); }
.chart .bar-latest { fill: var(--series-1); }
.chart .bar-up { fill: var(--up); }
.chart .bar-down { fill: var(--down); }
.chart .ref { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart .ref-label { fill: var(--ink-2); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; }
.chart .area { fill: var(--area); }
.chart .dot-latest { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .direct-label { fill: var(--ink); font-size: 12px; font-weight: 650; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.chart .seg-label { fill: var(--ink-2); font-size: 12px; }
.chart .value-label { fill: var(--ink); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .crosshair { stroke: var(--muted); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: crosshair; outline: none; }
.chart .hit:hover, .chart .hit:focus-visible { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.tooltip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(0,0,0,0.14); border-radius: 9px; padding: 8px 11px; font-size: 0.82rem; max-width: 280px; }
.tooltip .tt-value { font-weight: 700; font-variant-numeric: tabular-nums; }
.tooltip .tt-title { color: var(--muted); font-size: 0.76rem; }

/* ---------- print / PDF */
@media print {
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f4f4f2; --ink: #0b0b0b; --ink-2: #3d3c3a; --muted: #6f6d68; --hairline: #e1e0d9; --series-1: #2a78d6; --series-1-soft: #b7d3f6; --up: #2a78d6; --down: #e34948; --good: #006300; --bad: #b42323; --shadow: none; }
  body { background: #fff; font-size: 11pt; }
  .no-print, .report-bar, .nav, .tooltip { display: none !important; }
  .report { padding: 0; }
  .card { box-shadow: none; }
  .story, .kpi, .actions-list li { break-inside: avoid; }
  details.data { display: none; }
  .fact { text-decoration: none; }
  a { color: inherit; }
}
