/* Natto Explorer. Tokens follow the data-viz reference palette; dark mode is a selected set, not a flip. */
:root {
  color-scheme: light;
  --page: #f9f9f7; --surface: #fcfcfb; --ink: #0b0b0b; --ink-2: #52514e; --muted: #898781;
  --grid: #e1e0d9; --axis: #c3c2b7; --border: rgba(11, 11, 11, 0.10);
  --series-1: #2a78d6; --series-1-soft: #9ec5f4; --series-1-deep: #1c5cab;
  --series-2: #eb6834; --series-2-wash: rgba(235, 104, 52, 0.08);
  --good: #0ca30c; --good-text: #006300; --critical: #d03b3b; --synth: #6f3fc4; --synth-wash: rgba(111, 63, 196, 0.08);
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
    --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10);
    --series-1: #3987e5; --series-1-soft: #256abf; --series-1-deep: #86b6ef;
    --series-2: #d95926; --series-2-wash: rgba(217, 89, 38, 0.12);
    --good-text: #0ca30c; --synth: #b59cf0; --synth-wash: rgba(181, 156, 240, 0.12);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #898781;
  --grid: #2c2c2a; --axis: #383835; --border: rgba(255, 255, 255, 0.10);
  --series-1: #3987e5; --series-1-soft: #256abf; --series-1-deep: #86b6ef;
  --series-2: #d95926; --series-2-wash: rgba(217, 89, 38, 0.12);
  --good-text: #0ca30c; --synth: #b59cf0; --synth-wash: rgba(181, 156, 240, 0.12);
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0; padding: 0 16px 48px; background: var(--page); color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--series-1-deep); }
code { font: 12.5px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
pre { font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; word-break: break-word; margin: 0; max-height: 420px; overflow: auto; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-size: clamp(22px, 3vw, 30px); line-height: 1.2; }
h2 { font-size: 20px; }
h3 { font-size: 15px; }
h4 { font-size: 13px; color: var(--ink-2); margin: 10px 0 2px; text-transform: uppercase; letter-spacing: 0.04em; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); padding: 6px 12px; }
button.primary { background: var(--series-1); border-color: transparent; color: #fff; font-weight: 600; }
button.ghost { background: transparent; }
button:disabled { opacity: 0.5; cursor: default; }
input, select { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 6px 10px; min-width: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 8px; background: var(--surface); padding: 8px; z-index: 10; }

.top { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-start; justify-content: space-between; max-width: 1400px; margin: 24px auto 16px; }
.brand { max-width: 820px; }
.kicker { font-size: 13px; font-weight: 650; color: var(--series-1-deep); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.tagline { color: var(--ink-2); margin-top: 10px; max-width: 70ch; }
.top-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.cta { display: inline-block; background: var(--ink); color: var(--page); text-decoration: none; padding: 9px 16px; border-radius: 999px; font-weight: 600; white-space: nowrap; }

.nolook, .synth { max-width: 1400px; margin: 0 auto 12px; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--series-1); border-left-width: 6px; background: var(--surface); }
.nolook h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--series-1-deep); margin-bottom: 6px; }
.nolook .statement { font-size: clamp(17px, 2vw, 21px); font-weight: 600; line-height: 1.35; max-width: 60ch; }
.nolook .evidence { margin-top: 8px; color: var(--ink-2); max-width: 80ch; }
.nolook .evidence:empty { display: none; }
.nolook .source { margin-top: 6px; font-size: 12px; color: var(--muted); }
.bar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; max-width: 1400px; margin: 0 auto 12px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.field.grow { flex: 1 1 260px; }
.field.inline { flex-direction: row; align-items: center; gap: 8px; }
.field select, .field input { color: var(--ink); font-size: 14px; }
.status, .facts { font-size: 13px; color: var(--ink-2); flex-basis: 100%; }
.status.err, .error { color: var(--critical); }
.warn { flex-basis: 100%; margin: 2px 0 0; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--critical); color: var(--ink); background: var(--page); font-size: 13.5px; }
.error:empty { display: none; }

.scrub { max-width: 1400px; margin: 0 auto 16px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.scrub-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.scrub-row.meta { margin-top: 8px; gap: 8px 20px; font-size: 14px; color: var(--ink-2); }
.scrub-row .at strong { color: var(--ink); font-variant-numeric: tabular-nums; font-size: 18px; }
#scrubber { flex: 1 1 320px; accent-color: var(--series-1); height: 28px; }
.ticks { position: relative; height: 16px; margin: 2px 0 0; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ticks span { position: absolute; transform: translateX(-50%); top: 0; }

.panels { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; max-width: 1400px; margin: 0 auto; align-items: start; }
@media (max-width: 1000px) { .panels { grid-template-columns: minmax(0, 1fr); } }
.panel { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); padding: 14px; transition: opacity 0.15s; }
.panel[aria-busy="true"] { opacity: 0.55; }
.panel.pit { border-top: 4px solid var(--series-1); }
.panel.hindsight { border-top: 4px solid var(--series-2); background: linear-gradient(var(--series-2-wash), var(--series-2-wash)), var(--surface); }
.panel-head { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.panel-title { max-width: 60ch; }
.panel-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; max-width: 100%; }
.clockbox { font-size: 12.5px; border: 1px solid var(--series-1); border-radius: 8px; padding: 8px 10px; background: var(--surface); }
.clockbox h4 { margin: 0 0 4px; }
.clockbox .row { font-size: 12.5px; padding: 2px 0; }
.lead { color: var(--ink-2); font-size: 14px; margin-top: 4px; }
.asof { font-size: 13px; color: var(--ink-2); margin-top: 6px; font-variant-numeric: tabular-nums; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; }
.card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--surface); min-width: 0; }
.card.wide { grid-column: 1 / -1; }
.hindsight .card { margin-top: 12px; }
.card h3 .sub { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 6px; }
.body { margin-top: 8px; }
.empty, .note { color: var(--muted); font-size: 13.5px; margin: 6px 0; }

.row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid var(--grid); font-size: 13.5px; }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--ink-2); min-width: 0; }
.row .k code { color: var(--muted); font-size: 11px; margin-left: 4px; }
.row .v { color: var(--ink); text-align: right; white-space: nowrap; }
.row .v.num { font-variant-numeric: tabular-nums; }
.row .v.null { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 3px 10px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--page); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.chip.good { color: var(--good-text); border-color: var(--good); }
.chiprow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }

.prov { font-size: 12px; color: var(--ink-2); }
.prov-box { display: flex; flex-direction: column; gap: 4px; min-width: 0; max-width: 100%; }
.hindsight .card .prov { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--grid); }
.field.check { font-size: 13px; margin: 0 0 8px; }
.field.check input { accent-color: var(--series-1); }
.lc { display: inline-block; align-self: flex-start; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border); }
.lc-point_in_time { color: var(--series-1-deep); border-color: var(--series-1); }
.lc-hindsight { color: var(--series-2); border-color: var(--series-2); }
.hash { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.hash .hl { color: var(--muted); white-space: nowrap; min-width: 92px; }
.hash code { color: var(--ink); }
.copy { font-size: 11px; padding: 1px 7px; border-radius: 6px; }
.served { color: var(--muted); }

.chart { position: relative; margin: 6px 0 4px; outline: none; }
.chart:focus-visible { box-shadow: 0 0 0 2px var(--series-1); border-radius: 6px; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .axis { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 10.5px; font-variant-numeric: tabular-nums; }
.chart .tick.end { text-anchor: end; }
.chart .tick.middle { text-anchor: middle; }
.chart .tick.start { text-anchor: start; }
.chart .vol { fill: var(--series-1-soft); }
.chart .range { stroke: var(--series-1); stroke-opacity: 0.45; stroke-width: 1.5; }
.chart .close { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .end { fill: var(--series-1); stroke: var(--surface); stroke-width: 2; }
.chart .endlabel { fill: var(--ink); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .cross { stroke: var(--ink-2); stroke-width: 1; }
.chart .leg { fill: var(--muted); fill-opacity: 0.55; }
.chart .leg.cap { fill: var(--series-1); fill-opacity: 1; }
.chart .leg:hover, .chart .leg.hot { fill-opacity: 0.85; stroke: var(--ink); stroke-width: 1; }
.chart .leg.cap:hover, .chart .leg.cap.hot { fill-opacity: 0.75; }
.chart .win { fill: var(--series-1-deep); }
.chart .at { stroke: var(--series-2); stroke-width: 2; }
.chart .atlabel { fill: var(--ink); font-weight: 600; }
.tip { position: absolute; z-index: 5; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); pointer-events: none; min-width: 150px; }
.tip-t { color: var(--ink-2); margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.tip-r b { font-variant-numeric: tabular-nums; }
.tip-r span { color: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); margin: 2px 0 8px; }
.legend .sw { display: inline-block; width: 14px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.sw.cap { background: var(--series-1); }
.sw.other { background: var(--muted); opacity: 0.55; }
.sw.win { background: var(--series-1-deep); }
.sw.at { background: var(--series-2); width: 3px; }

.tablewrap { max-height: 320px; overflow: auto; border: 1px solid var(--grid); border-radius: 6px; margin-top: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: 4px 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
th { position: sticky; top: 0; background: var(--surface); color: var(--ink-2); font-weight: 600; }
th:first-child, td:first-child { text-align: left; }
tr.hot td { background: var(--series-2-wash); }
tr.live td { font-weight: 600; }
details.raw { margin-top: 10px; }
details summary { cursor: pointer; color: var(--ink-2); font-size: 13px; }
details.raw pre { margin-top: 6px; padding: 10px; background: var(--page); border-radius: 6px; border: 1px solid var(--grid); }

.defs { max-width: 1400px; margin: 16px auto 0; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 13.5px; }
.defs dl { margin: 4px 0 10px; display: grid; grid-template-columns: minmax(140px, 240px) 1fr; gap: 3px 12px; }
.defs dt { color: var(--ink-2); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.defs dd { margin: 0; }
.foot { max-width: 1400px; margin: 24px auto 0; color: var(--muted); font-size: 12.5px; display: flex; flex-direction: column; gap: 4px; }

.synth { border-color: var(--synth); background: linear-gradient(var(--synth-wash), var(--synth-wash)), var(--surface); }
.synth h2 { font-size: 15px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--synth); margin-bottom: 6px; }
.synth .statement { font-size: clamp(16px, 1.8vw, 19px); font-weight: 600; line-height: 1.35; max-width: 70ch; }
.synth .evidence { margin-top: 8px; color: var(--ink-2); max-width: 90ch; }
.chip.synth-chip { color: var(--synth); border-color: var(--synth); background: var(--synth-wash); vertical-align: middle; margin-left: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
option.synthetic { font-weight: 600; }
