/* Tokens — palette values from the data-viz reference instance (validated adjacent-pair CVD-safe). */
:root {
  color-scheme: light;
  --font: "Segoe UI", system-ui, -apple-system, Helvetica, Arial, sans-serif;
  --bg: #f6f5f2; --surface: #ffffff; --surface-2: #f0efec;
  --ink: #151515; --ink-2: #52514e; --ink-3: #8a8985; --line: #e6e4df;
  --brand: #0e2038; --brand-2: #0a1729; --brand-ink: #ffffff; --accent: #c99a5b; --link: #1f3a5f;
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --good: #0ca30c; --warn: #fab219; --serious: #ec835a; --crit: #d03b3b;
  --radius: 8px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 8px rgba(0,0,0,.04);
}
/* Dark: chosen with the toggle (data-theme="dark"), or Auto + OS dark. Light stamp always wins. */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #131312; --surface: #1a1a19; --surface-2: #232322;
    --ink: #ffffff; --ink-2: #c3c2b7; --ink-3: #8f8e86; --line: #2f2f2c;
    --brand: #0e2038; --brand-2: #0a1729; --accent: #d1a468; --link: #86b6ef;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #131312; --surface: #1a1a19; --surface-2: #232322;
    --ink: #ffffff; --ink-2: #c3c2b7; --ink-3: #8f8e86; --line: #2f2f2c;
    --brand: #0e2038; --brand-2: #0a1729; --accent: #d1a468; --link: #86b6ef;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  }
}
* { box-sizing: border-box; }
html { font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
body { margin: 0; }
a { color: var(--link); text-decoration: none; } a:hover { text-decoration: underline; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
h1 { font-size: 1.7rem; margin: .2em 0 .3em; letter-spacing: -.01em; } h2.h2 { font-size: 1.25rem; margin: 2rem 0 .8rem; }
h3 { font-size: 1rem; margin: 0 0 .6rem; } h4 { margin: 1rem 0 .4rem; font-size: .95rem; }
.muted { color: var(--ink-3); } .lede { color: var(--ink-2); font-size: 1.05rem; max-width: 62ch; } .meta { color: var(--ink-2); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; color: var(--accent); font-weight: 600; margin: 0; }
.crumbs { font-size: .85rem; color: var(--ink-3); margin: 1.2rem 0 .2rem; }
code { background: var(--surface-2); padding: 0 .3em; border-radius: 3px; }

/* header / footer */
header.site { background: var(--brand); color: var(--brand-ink); }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .7rem; color: var(--brand-ink); font-size: .95rem; }
.brand .mark { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 6px; background: var(--accent); color: #1a1a19; font-weight: 800; font-size: .8rem; letter-spacing: .02em; }
.brand b { font-weight: 700; }
.nav { display: flex; align-items: center; gap: 1.2rem; }
.nav > a, .nav .menu > a { color: rgba(255,255,255,.85); padding: .4rem 0; border-bottom: 2px solid transparent; }
.nav > a.on, .nav .menu > a.on { color: #fff; border-bottom-color: var(--accent); }
.nav .signin { background: rgba(255,255,255,.12); padding: .35rem .8rem; border-radius: 6px; border: 0; }
.menu { position: relative; } .menu .dropdown { display: none; position: absolute; right: 0; top: 100%; background: var(--surface); box-shadow: var(--shadow); border: 1px solid var(--line); border-radius: var(--radius); min-width: 300px; padding: .4rem 0; z-index: 10; }
.menu:hover .dropdown { display: block; } .dropdown a { display: block; padding: .4rem 1rem; color: var(--ink); } .dropdown a:hover { background: var(--surface-2); text-decoration: none; }
.roman { display: inline-block; min-width: 2.4em; color: var(--accent); font-weight: 700; font-variant-numeric: tabular-nums; }
footer.site { margin-top: 3rem; padding: 1.5rem 0 2.5rem; border-top: 1px solid var(--line); color: var(--ink-2); font-size: .85rem; }
form.inline { display: inline; } button.link { background: none; border: 0; color: rgba(255,255,255,.85); cursor: pointer; font: inherit; padding: 0; }

/* hero / tiles */
.hero { padding: 2.2rem 0 1rem; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 1rem 0 1.5rem; }
.kpis.four { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.tile { display: flex; flex-direction: column; gap: .15rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; color: var(--ink); box-shadow: var(--shadow); }
.tile:hover { text-decoration: none; border-color: var(--accent); }
.tile .label { font-size: .8rem; color: var(--ink-2); } .tile .value { font-size: 1.7rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile .value small { font-size: .9rem; font-weight: 500; color: var(--ink-3); } .tile .sub { font-size: .78rem; color: var(--ink-3); }
.tile.warn { border-left: 4px solid var(--warn); } .tile.crit { border-left: 4px solid var(--crit); }

/* cards, grids, charts */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); margin: 0 0 14px; }
.card.def { font-size: .9rem; color: var(--ink-2); border-left: 4px solid var(--accent); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; } .grid-2.wide-left { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 860px) { .grid-2, .grid-2.wide-left { grid-template-columns: 1fr; } }
figure { margin: 0; } figure.card figcaption, .table-card figure figcaption { font-size: .9rem; font-weight: 600; color: var(--ink-2); margin-bottom: .4rem; }
.plot { position: relative; height: 240px; } .plot.tall { height: 320px; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.table-card header { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.table-card h3 { margin: 0; } .src { font-size: .8rem; color: var(--ink-3); }
.tnum { display: inline-block; background: var(--surface-2); color: var(--ink-2); font-size: .75rem; font-weight: 600; padding: .1rem .45rem; border-radius: 4px; margin-right: .3rem; vertical-align: middle; }
.tnum.big { font-size: .85rem; }
.more { font-size: .85rem; } .narr ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.sec { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .6rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; color: var(--ink); box-shadow: var(--shadow); }
.sec:hover { text-decoration: none; border-color: var(--accent); } .sec .roman { grid-row: 1 / 3; font-size: 1.1rem; }
.sec .t { font-weight: 600; } .sec .d { font-size: .82rem; color: var(--ink-2); } .sec .n { grid-column: 2; font-size: .75rem; color: var(--ink-3); margin-top: .3rem; }
.pager { display: flex; justify-content: space-between; gap: 1rem; margin: 1.5rem 0; font-size: .9rem; }
details.tableview { margin-top: .6rem; } details.tableview summary { cursor: pointer; font-size: .85rem; color: var(--ink-2); }
.scroll { overflow-x: auto; }

/* tables */
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); font-weight: 600; }
table.data tbody th { font-weight: 500; color: var(--ink-2); } table.data td.w { width: 34%; }
table.data.small { font-size: .82rem; margin-top: 1rem; }
table.entry td, table.entry th { text-align: right; } table.entry tbody th { text-align: left; }
table.entry .new { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
table.entry input { width: 7.5em; text-align: right; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--ink); font: inherit; }
tr.overdue td:first-child { border-left: 3px solid var(--crit); }

/* chips, progress, buttons, forms */
.chip { display: inline-block; font-size: .74rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.chip.big { font-size: .9rem; padding: .25rem .8rem; }
.chip.st-requested { background: var(--surface-2); color: var(--ink-2); }
.chip.st-submitted { background: color-mix(in srgb, var(--s1) 16%, var(--surface)); color: var(--ink); }
.chip.st-reviewed { background: color-mix(in srgb, var(--s7) 16%, var(--surface)); color: var(--ink); }
.chip.st-board_aligned { background: color-mix(in srgb, var(--s3) 18%, var(--surface)); color: var(--ink); }
.chip.st-approved, .chip.good { background: color-mix(in srgb, var(--good) 18%, var(--surface)); color: var(--ink); }
.chip.crit { background: color-mix(in srgb, var(--crit) 16%, var(--surface)); color: var(--ink); }
.chip.info { background: color-mix(in srgb, var(--s1) 12%, var(--surface)); color: var(--ink-2); font-weight: 500; }
.chip.ed-published { background: color-mix(in srgb, var(--good) 18%, var(--surface)); } .chip.ed-collecting { background: color-mix(in srgb, var(--warn) 25%, var(--surface)); } .chip.ed-planned { background: var(--surface-2); }
.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; display: inline-block; width: 70%; vertical-align: middle; }
.progress > div { height: 100%; background: var(--s1); border-radius: 99px; } .progress.big { display: block; width: 100%; height: 12px; margin: .4rem 0 .6rem; }
.btn { display: inline-block; padding: .4rem .8rem; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 6px; font: inherit; cursor: pointer; font-size: .9rem; }
.btn:hover { border-color: var(--ink-3); text-decoration: none; } .btn.small { padding: .2rem .55rem; font-size: .8rem; }
.btn.primary, button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.titlebar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; } .actions { display: flex; gap: .4rem; }
form label { display: block; margin: .6rem 0; font-size: .9rem; color: var(--ink-2); }
form input:not([type=file]), form select, form textarea { display: block; width: 100%; margin-top: .25rem; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; }
form.filters { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; margin: .5rem 0 1rem; } form.filters label { margin: 0; } form.filters select { width: auto; min-width: 12em; }
form.stack { margin-top: .8rem; }
.login { max-width: 640px; margin: 2rem auto; } .error { color: var(--crit); }
ul.events { list-style: none; padding: 0; margin: 0; font-size: .88rem; } ul.events li { padding: .35rem 0; border-bottom: 1px solid var(--line); }
ul.events .when { color: var(--ink-3); font-variant-numeric: tabular-nums; margin-right: .5rem; }
ul.editions { list-style: none; padding: 0; margin: 0; font-size: .88rem; } ul.editions li { padding: .25rem 0; }

/* theme toggle */
.theme { display: inline-flex; border: 1px solid rgba(255,255,255,.25); border-radius: 6px; overflow: hidden; }
.theme button { background: transparent; border: 0; color: rgba(255,255,255,.75); padding: .3rem .55rem; cursor: pointer; font: inherit; font-size: .8rem; line-height: 1; }
.theme button + button { border-left: 1px solid rgba(255,255,255,.2); }
.theme button.on { background: var(--accent); color: #1a1a19; font-weight: 600; }

/* parsed table bodies */
table.body td { white-space: nowrap; } table.body td:first-child { white-space: normal; min-width: 10em; }
table.body tr.group td { font-weight: 600; color: var(--ink); background: var(--surface-2); }
table.body tr.sub td:first-child { color: var(--ink-3); }
table.body tr.sub td:nth-child(2) { padding-left: 1.2rem; }
.scroll.boxed { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }

/* campaigns */
ol.timeline { list-style: none; padding: 0; margin: 0; display: flex; gap: 0; flex-wrap: wrap; }
ol.timeline li { flex: 1 1 150px; padding: .5rem .7rem; border-top: 3px solid var(--line); font-size: .85rem; }
ol.timeline li .when { display: block; color: var(--ink-3); font-variant-numeric: tabular-nums; }
ol.timeline li.past { border-top-color: var(--s1); }
ol.timeline li.due { border-top-color: var(--warn); } ol.timeline li.escalation { border-top-color: var(--crit); }
.chip.cs-queued { background: var(--surface-2); } .chip.cs-sent { background: color-mix(in srgb, var(--s1) 16%, var(--surface)); }
.chip.cs-reminded { background: color-mix(in srgb, var(--warn) 25%, var(--surface)); } .chip.cs-escalated { background: color-mix(in srgb, var(--crit) 18%, var(--surface)); }
.chip.cs-received { background: color-mix(in srgb, var(--good) 18%, var(--surface)); }
pre.mail { white-space: pre-wrap; font: .82rem/1.45 var(--font); background: var(--surface-2); padding: .7rem; border-radius: 6px; max-height: 320px; overflow: auto; }
ul.events.tight li { padding: .15rem 0; border: 0; font-size: .8rem; }

/* header logo */
.brand .logo { height: 44px; width: auto; display: block; }
.brand .name { line-height: 1.15; }
