/* Portal and legal pages. Light and dark from the same tokens. */
:root {
  --pink: #e91e63;
  --violet: #9c27b0;
  --purple: #7c4dff;
  --gradient: linear-gradient(135deg, #e91e63 0%, #9c27b0 50%, #7c4dff 100%);
  --bg: #f6f6fa;
  --surface: #ffffff;
  --text: #22263a;
  --muted: #5d6275;
  --border: #dcdde6;
  --focus: #7c4dff;
  --error-bg: #fdecef;
  --error-text: #a3123f;
  --ok-bg: #e9f7ef;
  --ok-text: #1d6b3a;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12131c;
    --surface: #1c1e2b;
    --text: #ecebf4;
    --muted: #a7a9bb;
    --border: #33364a;
    --focus: #b39dff;
    --error-bg: #3a1622;
    --error-text: #ff9fbd;
    --ok-bg: #12301f;
    --ok-text: #8fe0ad;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}
a { color: var(--purple); }
@media (prefers-color-scheme: dark) { a { color: #b39dff; } }

.topbar { background: var(--gradient); }
.topbar-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.brand img { display: block; height: 36px; width: auto; }
.topnav { display: flex; align-items: center; gap: 18px; }
.topnav a, .topnav .link-button { color: #fff; text-decoration: none; font-weight: 600; }
.topnav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

.page { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 16px 48px; }
.narrow { max-width: 460px; margin: 0 auto; }
.wide { max-width: 760px; margin: 0 auto; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 6px 24px rgba(20, 20, 50, 0.06);
}
.card + .card { margin-top: 24px; }
h1 { font-size: 1.6rem; line-height: 1.25; margin: 0 0 12px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
.lead { color: var(--muted); margin: 0 0 20px; }

form .field { margin-bottom: 16px; }
label { display: block; font-weight: 600; margin-bottom: 6px; }
.hint { display: block; color: var(--muted); font-size: 0.875rem; font-weight: 400; margin-top: 4px; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], select, textarea {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
input.code { font-size: 1.6rem; letter-spacing: 0.4em; text-align: center; font-variant-numeric: tabular-nums; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; margin-bottom: 10px; }
.check input { margin-top: 5px; width: 18px; height: 18px; flex: none; }

.button {
  display: inline-block;
  border: 0;
  border-radius: 999px;
  padding: 12px 26px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: var(--gradient);
  cursor: pointer;
  text-decoration: none;
}
.button:hover { filter: brightness(1.06); }
.button[disabled] { opacity: 0.55; cursor: not-allowed; }
.button.block { width: 100%; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--purple); cursor: pointer; text-decoration: underline; }
form.inline { display: inline; margin: 0; }
.actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.below { margin-top: 18px; color: var(--muted); font-size: 0.95rem; }

.alert { border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; }
.alert-error { background: var(--error-bg); color: var(--error-text); }
.alert-ok { background: var(--ok-bg); color: var(--ok-text); }

.empty { color: var(--muted); padding: 20px 0 4px; }
table.history { width: 100%; border-collapse: collapse; }
table.history th, table.history td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }

.legal h2 { margin-top: 24px; }
.legal .updated { color: var(--muted); }
.legal-box {
  max-height: 220px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}
.legal-box h3 { font-size: 0.95rem; margin: 12px 0 4px; }

.sitefoot { text-align: center; color: var(--muted); font-size: 0.875rem; padding: 24px 16px 32px; }
.sitefoot p { margin: 4px 0; }
.sitefoot a { color: inherit; }

/* ---- Runs (Phase 2) ---- */
.page .card.wide { max-width: 980px; }
.autocomplete { position: relative; }
.suggestions {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 10;
  margin: 4px 0 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12); max-height: 260px; overflow-y: auto;
}
.suggestions li { padding: 8px 12px; cursor: pointer; }
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: var(--bg); }
table.runs, table.factors { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
table.runs th, table.runs td, table.factors th, table.factors td {
  text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--border); vertical-align: top;
}
table.runs th, table.factors th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.status { font-size: 0.85rem; padding: 2px 8px; border-radius: 999px; background: var(--bg); white-space: nowrap; }
.status-completed { background: var(--ok-bg); color: var(--ok-text); }
.status-failed { background: var(--error-bg); color: var(--error-text); }
.steps { padding-left: 1.2em; }
.steps > li { margin: 10px 0; color: var(--muted); }
.steps > li.active { color: var(--text); font-weight: 600; }
.steps > li.done { color: var(--ok-text); }
.steps > li.done::after { content: " \2713"; }
.competitors { font-weight: 400; margin-top: 6px; }
.competitors .c-completed { color: var(--ok-text); }
.competitors .c-failed { color: var(--error-text); }
.competitor .meta { color: var(--muted); margin: 4px 0; }
.competitor .summary { margin: 14px 0; }
.insights { padding-left: 1.1em; }
.insights li { margin-bottom: 12px; }
.insights p { margin: 2px 0; }
.support { color: var(--muted); font-size: 0.88rem; }
.evidence { font-size: 0.9rem; font-style: italic; }
table.factors tr.state-good td:nth-child(2) { color: var(--ok-text); font-weight: 600; }
table.factors tr.state-poor td:nth-child(2) { color: var(--error-text); font-weight: 600; }
.legal-foot p { color: var(--muted); font-size: 0.85rem; }
@media (max-width: 640px) {
  table.runs th:nth-child(3), table.runs td:nth-child(3) { display: none; }
  table.factors th:nth-child(4), table.factors td:nth-child(4) { display: block; border: 0; padding-top: 0; }
}

/* ---- Results viewer (Phase 4) ---- */
:root { --s1: #d64545; --s2: #e8833a; --s3: #d9b43a; --s4: #6cb26a; --s5: #2e8b57; --hm-good: #d8f0df; --hm-avg: #f6efd2; --hm-poor: #f8d9dd; }
@media (prefers-color-scheme: dark) { :root { --hm-good: #1f3d2a; --hm-avg: #3d3820; --hm-poor: #452028; } }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.run-head { max-width: 980px; margin: 0 auto 8px; }
.run-head h1 { margin: 4px 0; font-size: 1.5rem; }
.run-head .crumb, .run-head .asof { color: var(--muted); margin: 0; font-size: 0.9rem; }
.run-page { max-width: 980px; margin: 0 auto; }
.run-page .card { margin-top: 18px; }
.num { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 4px; border-radius: 11px; background: var(--gradient); color: #fff; font-size: 0.78rem; font-weight: 700; }
.run-tabs { max-width: 980px; margin: 12px auto 0; display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--border); }
.run-tabs > a, .run-tabs .more > summary { padding: 9px 12px; border-radius: 10px 10px 0 0; text-decoration: none; color: var(--text); white-space: nowrap; cursor: pointer; list-style: none; }
.run-tabs > a[aria-current="page"], .run-tabs .more > summary[aria-current="page"] { background: var(--surface); border: 1px solid var(--border); border-bottom-color: var(--surface); margin-bottom: -1px; font-weight: 600; }
.run-tabs .tab-c { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.run-tabs .more { position: relative; }
.more-list { position: absolute; right: 0; z-index: 20; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px; min-width: 240px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); }
.more-list a { display: block; padding: 8px; text-decoration: none; color: var(--text); }
.run-bar { display: none; }
.comp-head h2 { margin: 18px 0 2px; display: flex; gap: 8px; align-items: center; }
.comp-head .meta { color: var(--muted); margin: 0 0 8px; }
.sub-tabs { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.sub-tabs a { flex: 0 0 auto; padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px; text-decoration: none; color: var(--text); background: var(--surface); }
.sub-tabs a[aria-current="page"] { background: var(--purple); border-color: var(--purple); color: #fff; }
.map { height: 380px; border-radius: 12px; overflow: hidden; background: var(--bg); }
.map-key { color: var(--muted); font-size: 0.88rem; }
.pin-key.you, .pin-you span { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #22263a; color: #fff; font-size: 0.78rem; font-weight: 700; }
.pin-c span { display: flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center; background: var(--violet); color: #fff; font-weight: 700; border: 2px solid #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4); cursor: pointer; }
.leaflet-div-icon.pin-c, .leaflet-div-icon.pin-you { background: none; border: 0; }
.table-wrap { overflow-x: auto; }
table.sortable th[data-sort] { cursor: pointer; }
table.sortable th[aria-sort="ascending"]::after { content: " \25B2"; }
table.sortable th[aria-sort="descending"]::after { content: " \25BC"; }
.trend.up { color: var(--ok-text); }
.trend.down { color: var(--error-text); }
.chart { width: 100%; height: auto; display: block; margin: 8px 0; }
.chart .lbl { fill: var(--muted); font-size: 12px; font-family: inherit; }
.chart .grid { stroke: var(--border); stroke-width: 1; }
.chart .track { fill: var(--bg); }
.chart .s1 { fill: var(--s1); }
.chart .s2 { fill: var(--s2); }
.chart .s3 { fill: var(--s3); }
.chart .s4 { fill: var(--s4); }
.chart .s5 { fill: var(--s5); }
.chart .pin { fill: var(--violet); fill-opacity: 0.85; stroke: #fff; stroke-width: 2; }
.chart .pin-n { fill: #fff; font-size: 12px; font-weight: 700; }
.chart .trend { stroke: var(--text); stroke-width: 2; stroke-dasharray: 6 4; }
.chart .monthly { fill: none; stroke: var(--purple); stroke-width: 2.5; }
.chart-hist { max-width: 360px; }
table.hours-grid { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
table.hours-grid th, table.hours-grid td { padding: 6px; border-bottom: 1px solid var(--border); text-align: center; }
table.hours-grid td:first-child, table.hours-grid th:first-child { text-align: left; white-space: nowrap; }
table.hours-grid td.open { background: var(--ok-bg); color: var(--ok-text); }
table.hours-grid td.closed { color: var(--muted); }
table.hours-grid tfoot td { font-weight: 600; }
table.hours th { text-align: left; font-weight: 500; padding: 3px 16px 3px 0; color: var(--muted); }
.gap-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gap { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.gap h3 { margin: 0 0 6px; font-size: 1.02rem; }
.gap p { margin: 6px 0; }
.gap-links { font-size: 0.88rem; color: var(--muted); }
.factor-picker { display: none; }
table.heatmap { border-collapse: collapse; font-size: 0.82rem; }
table.heatmap th, table.heatmap td { border: 1px solid var(--border); padding: 5px 6px; text-align: center; }
table.heatmap thead th { vertical-align: bottom; height: 120px; }
table.heatmap thead th span { writing-mode: vertical-rl; transform: rotate(180deg); white-space: nowrap; font-weight: 500; }
table.heatmap tbody th { text-align: left; white-space: nowrap; font-weight: 500; }
td.hm-good { background: var(--hm-good); }
td.hm-average { background: var(--hm-avg); }
td.hm-poor { background: var(--hm-poor); }
td.hm-not_available { color: var(--muted); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.big-rating { font-size: 2rem; font-weight: 700; margin: 0; }
.big-rating span { font-size: 0.9rem; font-weight: 400; color: var(--muted); }
.chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips li { padding: 4px 10px; border-radius: 999px; background: var(--bg); border: 1px solid var(--border); font-size: 0.9rem; }
.factor-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.factor-grid li { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.factor-grid li.fg-good { background: var(--hm-good); }
.factor-grid li.fg-average { background: var(--hm-avg); }
.factor-grid li.fg-poor { background: var(--hm-poor); }
.factor-grid li.fg-not_available { color: var(--muted); }
.factor-grid p { margin: 3px 0; }
.fg-name { font-weight: 600; }
.fg-state { font-size: 0.95rem; }
.fg-trend { color: var(--muted); font-size: 0.85rem; }
.fg-why { font-size: 0.88rem; }
.terms { line-height: 2.1; }
.terms span { margin-right: 10px; white-space: nowrap; }
.terms .t1 { font-size: 0.85rem; color: var(--muted); }
.terms .t2 { font-size: 1rem; }
.terms .t3 { font-size: 1.2rem; }
.terms .t4 { font-size: 1.45rem; font-weight: 600; }
.terms .t5 { font-size: 1.75rem; font-weight: 700; color: var(--violet); }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.photo-grid figcaption { font-size: 0.82rem; color: var(--muted); }
.prev-next { display: flex; justify-content: space-between; gap: 12px; margin: 18px 0; }
.prev-next a { text-decoration: none; }
.button.secondary { background: var(--surface); color: var(--purple); border: 1px solid var(--purple); }
.prose p, .prose li { max-width: 70ch; }
.watermark { font-weight: 600; }
.legal-foot { max-width: 980px; margin: 24px auto 0; }

@media (max-width: 767px) {
  .run-tabs { display: none; }
  body:has(.run-bar) { padding-bottom: 64px; }
  .run-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--border); padding: 6px 4px; }
  .run-bar > a, .run-bar .sheet > summary { padding: 8px 12px; text-decoration: none; color: var(--text); list-style: none; cursor: pointer; border-radius: 8px; }
  .run-bar > a[aria-current="page"], .run-bar .sheet > summary[aria-current="page"] { background: var(--bg); font-weight: 600; }
  .sheet[open] .sheet-body { position: fixed; left: 0; right: 0; bottom: 52px; max-height: 70vh; overflow-y: auto; background: var(--surface); border-top: 1px solid var(--border); border-radius: 16px 16px 0 0; box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.2); padding: 12px 16px; }
  .sheet-title { font-weight: 700; margin: 0 0 6px; }
  .sheet-body a { display: flex; align-items: center; gap: 8px; padding: 10px 4px; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
  .sheet-rating { margin-left: auto; color: var(--muted); }
  .sub-tabs { position: sticky; top: 0; z-index: 10; background: var(--bg); }
  .two-col { grid-template-columns: 1fr; }
  .map { height: 300px; }
  #compare thead { display: none; }
  #compare tr { display: block; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 6px 10px; }
  #compare td { display: flex; justify-content: space-between; border: 0; padding: 4px 0; }
  #compare td { gap: 12px; text-align: right; }
  #compare td::before { content: attr(data-label); color: var(--muted); text-align: left; flex: 0 0 auto; }
  /* Charts keep a readable size and scroll sideways. */
  .chart-scroll { overflow-x: auto; }
  .chart-scroll .chart { min-width: 560px; }
  .sheet[open] .sheet-body { bottom: 56px; }
  .factor-picker { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
  table.heatmap[data-pick] [data-f] { display: none; }
  table.heatmap[data-pick] [data-f].picked { display: table-cell; }
  table.heatmap thead th { height: auto; }
  table.heatmap thead th span { writing-mode: horizontal-tb; transform: none; }
}

/* ---- Admin and receipts (Phase 5) ---- */
.admin { max-width: 980px; margin: 0 auto; }
.admin .card { margin-top: 16px; }
.admin-nav { margin: 8px 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.stat { border: 1px solid var(--border); border-radius: 12px; padding: 12px; }
.stat p { margin: 0; color: var(--muted); }
.stat .stat-n { font-size: 1.6rem; font-weight: 700; color: var(--text); }
ul.plain { list-style: none; padding: 0; }
ul.plain li { padding: 5px 0; border-bottom: 1px solid var(--border); }
.search { display: flex; gap: 8px; margin-bottom: 12px; }
.search input { flex: 1; }
.filters { display: flex; gap: 12px; margin-bottom: 8px; }
.filters a[aria-current="page"] { font-weight: 700; text-decoration: none; }
table.events td { font-size: 0.85rem; }
tr.ev-retry td, tr.ev-failed td { color: var(--error-text); }
.crumb { margin: 0 0 4px; font-size: 0.9rem; }
.receipt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.receipt-head h1 { margin: 0; text-align: right; }
.receipt-head p { margin: 4px 0 0; color: var(--muted); text-align: right; }
.receipt h2 { font-size: 0.95rem; color: var(--muted); margin-bottom: 4px; }
table.receipt-lines td:last-child, table.receipt-lines th:last-child { text-align: right; }
table.receipt-lines tfoot th { border-top: 2px solid var(--text); }
@media print { .topbar, .sitefoot, .crumb { display: none; } .receipt { box-shadow: none; border: 0; } }

/* ---- Design pass (2026-11-15): Sora for display text, quieter surfaces ---- */
@font-face { font-family: "Sora"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/sora-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/sora-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/sora-latin-700-normal.woff2") format("woff2"); }
:root {
  --display: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --bg: #fbfaff;
  --text: #1e1438;
  --shadow: 0 1px 2px rgba(30, 20, 56, 0.05), 0 10px 30px rgba(30, 20, 56, 0.06);
}
@media (prefers-color-scheme: dark) { :root { --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.25); } }
h1, h2, .big-rating, .stat-n, .run-tabs, .sub-tabs, .run-bar, .num, .gap h3, .fg-name, .button { font-family: var(--display); letter-spacing: -0.01em; }
h1 { font-weight: 700; }
h2 { font-weight: 600; }
.card { box-shadow: var(--shadow); border-color: transparent; border-radius: 18px; }
table.runs, table.hours-grid, table.heatmap, table.hours, .stat-n, .big-rating { font-variant-numeric: tabular-nums; }
table.runs th { text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.72rem; }
table.runs tbody tr:hover td { background: color-mix(in srgb, var(--purple) 4%, transparent); }

/* Results header and tabs */
.run-head { padding-top: 8px; }
.run-head h1 { font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.2; margin: 6px 0 8px; }
.run-head .asof { display: inline-block; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--purple) 9%, transparent); color: var(--text); font-size: 0.82rem; }
.run-tabs { gap: 2px; border-bottom-color: color-mix(in srgb, var(--text) 10%, transparent); }
.run-tabs > a, .run-tabs .more > summary { border: 0; border-radius: 0; padding: 12px 14px; color: var(--muted); font-weight: 500; position: relative; }
.run-tabs > a:hover, .run-tabs .more > summary:hover { color: var(--text); }
.run-tabs > a[aria-current="page"], .run-tabs .more > summary[aria-current="page"] { background: none; border: 0; margin: 0; color: var(--text); font-weight: 600; }
.run-tabs > a[aria-current="page"]::after, .run-tabs .more > summary[aria-current="page"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--gradient); }
.sub-tabs a { font-weight: 500; transition: background 0.15s, color 0.15s; }
.sub-tabs a:hover { border-color: var(--purple); }
.sub-tabs a[aria-current="page"] { background: var(--gradient); border-color: transparent; }
.comp-head h2 { font-size: 1.35rem; }

/* Section labels inside result cards: small caps, like the brand guide */
.run-page .card h3, .snapshot h3 { font-family: var(--display); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 26px 0 8px; }
.run-page .card h3:first-child, .snapshot .two-col > div > h3:first-child { margin-top: 0; }
.run-page .gap h3 { font-size: 1rem; letter-spacing: -0.01em; text-transform: none; color: var(--text); margin: 0 0 6px; }
.run-page .card h2 { font-size: 1.15rem; margin-top: 0; }
.lead-summary { font-size: 1.08rem; line-height: 1.65; margin: 0 0 22px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.positioning { font-style: italic; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.big-rating { font-size: 2.6rem; line-height: 1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.big-rating span { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0; }
table.hours tr.closed td { color: var(--muted); }
table.hours th, table.hours td { padding: 4px 18px 4px 0; }
.chips li { background: color-mix(in srgb, var(--purple) 7%, transparent); border-color: transparent; }
.insights { list-style: none; padding: 0; }
.insights li { padding: 12px 14px; border-left: 3px solid color-mix(in srgb, var(--purple) 45%, transparent); background: color-mix(in srgb, var(--purple) 3%, transparent); border-radius: 0 10px 10px 0; }
.evidence { color: var(--muted); }
.gap { border: 0; background: color-mix(in srgb, var(--purple) 5%, transparent); }
.factor-grid li { border: 0; }
.factor-grid li.fg-not_available { background: color-mix(in srgb, var(--text) 3%, transparent); }
.legal-foot { border-top: 1px solid var(--border); padding-top: 14px; }
.prev-next a { font-family: var(--display); font-weight: 500; }

/* Dashboard */
.page > .card:first-child h1 { font-size: 1.6rem; }
table.runs .status { font-family: var(--display); font-size: 0.78rem; }

/* ---- Dark mode fix (2026-11-15): the design pass set light colours in :root
   after the dark block, so dark mode got dark text on dark cards. ---- */
@media (prefers-color-scheme: dark) {
  :root { --bg: #12131c; --text: #ecebf4; }
}

/* ---- Sign-in pages: brand panel beside the form ---- */
.auth { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); max-width: 1000px; margin: 28px auto; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
.auth-narrow { max-width: 900px; }
.auth .auth-card { margin: 0; border-radius: 0; box-shadow: none; border: 0; padding: 40px 44px; background: var(--surface); }
.auth .auth-card h1 { font-size: 1.7rem; margin-top: 0; }
.auth-brand { position: relative; background: var(--gradient); color: #fff; padding: 44px 40px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.auth-brand::after { content: ""; position: absolute; width: 340px; height: 340px; right: -120px; bottom: -140px; border-radius: 50%; background: rgba(255, 255, 255, 0.08); }
.auth-brand::before { content: ""; position: absolute; width: 200px; height: 200px; left: -70px; top: -70px; border-radius: 50%; background: rgba(255, 255, 255, 0.06); }
.auth-logo { width: 140px; height: auto; margin-bottom: 14px; position: relative; z-index: 1; }
.auth-tag { font-family: var(--display); font-size: 0.72rem; letter-spacing: 0.24em; text-transform: uppercase; opacity: 0.85; margin: 0 0 22px; position: relative; z-index: 1; }
.auth-pitch { font-family: var(--display); font-size: 1.35rem; line-height: 1.35; font-weight: 600; margin: 0 0 18px; position: relative; z-index: 1; }
.auth-points { list-style: none; padding: 0; margin: 0; position: relative; z-index: 1; }
.auth-points li { padding: 7px 0 7px 26px; position: relative; opacity: 0.95; }
.auth-points li::before { content: ""; position: absolute; left: 2px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.18); }
.auth-card label { color: var(--text); }
.auth-card .below { color: var(--muted); }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; margin: 12px auto; border-radius: 18px; }
  .auth-brand { padding: 22px 24px; flex-direction: row; align-items: center; gap: 14px; }
  .auth-logo { width: 54px; margin: 0; }
  .auth-tag, .auth-points { display: none; }
  .auth-pitch { font-size: 1rem; margin: 0; }
  .auth .auth-card { padding: 26px 22px; }
}

/* Checkbox labels: text wraps as one line of prose, not flex columns. */
label.check { display: block; position: relative; padding-left: 30px; font-weight: 400; line-height: 1.5; }
label.check input[type="checkbox"] { position: absolute; left: 0; top: 2px; margin: 0; width: 18px; height: 18px; }
