/* Public record: off-white, restrained green accents, compact tables.
   Chart series colours were validated (lightness band, chroma, CVD separation,
   contrast) for each surface: book = blue, benchmark = amber. Gains/losses use
   green/red text with a sign, never colour alone. */
:root {
  --c-book: #2f6fdf; --c-bench: #b5650a;
  --c-w1: #2f6fdf; --c-w2: #8a4fd1; --c-w3: #0f8a7e; --c-w4: #c2185b; --c-w5: #6b7280;
  --gain: #1a7f4e; --loss: #b42318;
  --chip: #eef2ef; --notice: #f2f6f3;
}
@media (prefers-color-scheme: dark) {
  :root { --c-book: #5b8def; --c-bench: #c07f22; --gain: #4cc497; --loss: #ff8a80;
    --c-w1: #5b8def; --c-w2: #b18cf0; --c-w3: #3cbfae; --c-w4: #f06292; --c-w5: #9aa3ad;
    --chip: #1f2629; --notice: #182022; }
}
body.public { font-size: 15px; line-height: 1.5; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .5rem; background: var(--panel); padding: .25rem .5rem; z-index: 10; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pub-header { display: flex; align-items: center; gap: 1.25rem; padding: .75rem 16px;
  max-width: 1120px; margin: 0 auto; border-bottom: 1px solid var(--line); }
.pub-header .brand { font-weight: 700; color: var(--fg); text-decoration: none; font-size: 17px; }
.pub-header nav { display: flex; gap: 1rem; flex: 1; flex-wrap: wrap; }
.pub-header nav a { color: var(--muted); text-decoration: none; padding: 2px 0; }
.pub-header nav a[aria-current] { color: var(--fg); border-bottom: 2px solid var(--accent); }
.pub-header .quiet { color: var(--muted); font-size: 13px; text-decoration: none; }
.pub-header .quiet:hover { color: var(--accent); }
.pub-main { max-width: 1120px; margin: 0 auto; padding: 1rem 16px 3rem; }
.pub-footer { max-width: 1120px; margin: 0 auto; padding: 1.5rem 16px 2.5rem; border-top: 1px solid var(--line);
  display: grid; gap: .5rem; justify-items: start; color: var(--muted); font-size: 14px; }
.pub-footer a { color: var(--muted); }
.feedback-btn { display: inline-block; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px;
  text-decoration: none; color: var(--fg) !important; background: var(--panel); }
.feedback-btn:hover { border-color: var(--accent); }
.disclaimer { margin: 0; color: var(--fg); }
h1 { font-size: 28px; line-height: 1.2; margin: .5rem 0 .5rem; letter-spacing: -0.01em; }
h2 { font-size: 19px; margin: 2.25rem 0 .75rem; }
h3 { font-size: 15px; margin: 1.5rem 0 .5rem; }
.intro p { max-width: 68ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.gain { color: var(--gain); } .loss { color: var(--loss); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.badges { margin: .25rem 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; background: var(--chip);
  color: var(--fg); white-space: nowrap; }
.badge.mode-live { background: var(--accent); color: #fff; }
.badge.status-paused, .badge.status-stopping { background: rgba(161, 92, 0, .15); }
.badge.status-stopped { background: rgba(120, 120, 120, .18); }
.mandate { color: var(--muted); max-width: 72ch; margin: .25rem 0; }
.notice { background: var(--notice); border-left: 3px solid var(--accent); padding: .6rem .8rem; max-width: 80ch; }
.empty { color: var(--muted); padding: 1rem; border: 1px dashed var(--line); border-radius: 8px; }
.book-section h2 { border-bottom: 1px solid var(--line); padding-bottom: .35rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 1rem;
  display: grid; gap: .6rem; align-content: start; }
.card h3 { margin: 0; font-size: 16px; }
.card h3 a { color: var(--fg); text-decoration: none; }
.card h3 a:hover { color: var(--accent); text-decoration: underline; }
.card table { font-size: 13px; }
.card td, .card th { padding: 3px 4px; }
.card .cash td { color: var(--muted); }
.spark-wrap { height: 48px; }
.spark { width: 100%; height: 48px; display: block; }
.spark .line, .chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .grid, .chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.zero { stroke: var(--muted); opacity: .6; }
.chart .area { opacity: .12; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 0; }
.stats.wide { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin: .75rem 0 1rem; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; }
.stats dt { font-size: 12px; color: var(--muted); }
.stats dd { margin: 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.stats.wide dd { font-size: 22px; }
.stats dd.small-dd { font-size: 14px; font-weight: 500; }
.book-head { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-end; }
.crumbs { margin: 0; font-size: 13px; color: var(--muted); }
.switcher { display: flex; gap: .4rem; align-items: center; font-size: 13px; flex-wrap: wrap; }
.switcher label { display: inline; }
select { font: inherit; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); color: var(--fg); max-width: 100%; }
.range-row { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; margin: .5rem 0; }
.chip { font-size: 13px; padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--fg); }
.chip[aria-current] { border-color: var(--accent); background: var(--chip); font-weight: 600; }
.chip.disabled { color: var(--muted); opacity: .6; }
/* Charts: lines stretch in an SVG; all text is HTML so it stays legible on phones. */
.chart { margin: .25rem 0 0; position: relative; }
.chart .plot { position: relative; }
.chart svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart .ytick { position: absolute; left: 0; transform: translateY(-100%); font-size: 11px; color: var(--muted);
  background: color-mix(in srgb, var(--bg) 80%, transparent); padding: 0 3px; line-height: 1.3; }
.chart .enddot { position: absolute; width: 10px; height: 10px; border-radius: 50%; background: var(--c);
  transform: translate(-50%, -50%); box-shadow: 0 0 0 2px var(--bg); }
.chart .xaxis { position: relative; height: 20px; font-size: 11px; color: var(--muted); }
.chart .xtick { position: absolute; top: 3px; transform: translateX(-50%); white-space: nowrap; }
.chart .xtick.first { transform: none; } .chart .xtick.last { transform: translateX(-100%); }
.chart .crosshair { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--muted); pointer-events: none; }
.chart .tip { position: absolute; top: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 8px; font-size: 12px; pointer-events: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); white-space: nowrap; z-index: 2; }
.chart .tip .row { display: flex; gap: .4rem; align-items: center; }
.chart .tip b { font-variant-numeric: tabular-nums; }
.chart .tip .k, .legend .key { display: inline-block; width: 14px; height: 0; border-top: 2px solid var(--c); }
.legend .key.dashed { border-top-style: dashed; }
.legend { list-style: none; display: flex; gap: 1rem; padding: 0; margin: .25rem 0; font-size: 13px; flex-wrap: wrap; }
.legend li { display: flex; align-items: center; gap: .4rem; }
details.data { margin: .5rem 0 1rem; font-size: 13px; }
details.data table { max-width: 520px; }
.breakdown { max-width: 560px; }
.breakdown th { color: var(--fg); font-weight: 400; white-space: normal; }
.breakdown .total th, .breakdown .total td { font-weight: 600; border-top: 2px solid var(--line); }
tr.cash td { color: var(--muted); }
.notes { padding-left: 1.1rem; } .notes li { margin: .3rem 0; } .notes time { color: var(--muted); font-size: 13px; }
.method { display: grid; grid-template-columns: minmax(120px, 180px) 1fr; gap: .4rem 1rem; max-width: 90ch; }
.method dt { color: var(--muted); } .method dd { margin: 0; }
@media (max-width: 560px) { .method { grid-template-columns: 1fr; } .method dd { margin-bottom: .5rem; } }
.prose { max-width: 72ch; } .prose li { margin: .25rem 0; }
.research-list { padding-left: 1.1rem; } .research-list li { margin: .5rem 0; }
.narrow-form { max-width: 560px; }
.narrow-form textarea, .narrow-form input[type=email] { width: 100%; font: inherit; padding: 8px; border-radius: 6px;
  border: 1px solid var(--line); background: var(--panel); color: var(--fg); }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: .5rem .75rem; display: flex; flex-wrap: wrap; gap: .25rem 1rem; }
legend { padding: 0 .3rem; font-size: 14px; }
label.radio { display: inline-flex; align-items: center; gap: .3rem; font-size: 15px; }
.context { background: var(--notice); padding: .5rem .75rem; border-radius: 6px; margin: 0; }
.form-error, .field-error { color: var(--error); }
.field-error { font-size: 13px; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); padding: 6px 16px; justify-self: start; }
.hp { position: absolute; left: -9999px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 560px) {
  .pub-header { flex-wrap: wrap; row-gap: .4rem; }
  .pub-header .brand { flex: 1; }
  .pub-header nav { order: 3; flex-basis: 100%; }
  h1 { font-size: 23px; }
  .cards { grid-template-columns: 1fr; }
  .stats.wide dd { font-size: 18px; }
}
@media (prefers-color-scheme: dark) { button.primary { color: #0f1214; } }
/* Agent decisions: one line each, the full reasoning on demand. */
ol.decisions { list-style: none; padding: 0; margin: .5rem 0 1rem; border-top: 1px solid var(--line, #e3e3dc); }
ol.decisions > li { border-bottom: 1px solid var(--line, #e3e3dc); padding: .45rem 0; font-size: 14px; }
ol.decisions summary { cursor: pointer; list-style-position: outside; }
ol.decisions time { display: inline-block; min-width: 7.5em; color: var(--muted, #6b6b63); font-variant-numeric: tabular-nums; }
ol.decisions .what { font-weight: 600; margin-right: .5em; }
ol.decisions .why { color: var(--muted, #6b6b63); }
ol.decisions li.missed .what { color: var(--warn, #9a6700); font-weight: 500; }
ol.decisions .body { padding: .5rem 0 .25rem 7.5em; max-width: 70ch; }
ol.decisions .body ul { margin: .25rem 0; padding-left: 1.2em; }
.pre { white-space: pre-wrap; }
@media (max-width: 640px) {
  ol.decisions time { display: block; min-width: 0; }
  ol.decisions .body { padding-left: 0; }
  ol.decisions .why { display: block; }
}

/* Weekly arena */
.weekly-board td, .weekly-board th, .weekly-grid td, .weekly-grid th { white-space: nowrap; }
.weekly-grid td.top { font-weight: 650; }
.weekly-grid th[scope=row] { position: sticky; left: 0; background: var(--bg); }
.weekly-grid td.top::after { content: " ★"; font-size: 11px; color: var(--muted); }
.week { border-top: 1px solid var(--line); padding: .5rem 0; }
.week > summary { cursor: pointer; }
.week-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; margin: .5rem 0; }
.week-book { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; }
.week-book h3 { margin: 0 0 .25rem; font-size: 14px; }
.week-book p { margin: .25rem 0; }
.week-book ul { margin: .25rem 0; padding-left: 1.1rem; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: .35rem; }
.week-book ul.decisions li { margin: .3rem 0; }
