
/* Layout: a committee-paper workbench. Run sheet on the left, findings on the right; every number carries its test, rule and status. */
:root {
  --bg: #eef1f6; --surface: #ffffff; --sunk: #f6f8fb; --ink: #121a2c; --muted: #576179; --faint: #8a93a8; --line: #d8dee9; --line-strong: #b8c1d2;
  --accent: #1d47c9; --accent-ink: #ffffff; --accent-soft: #e4eafc;
  --champ: #1d47c9; --chall: #0b8580; --obs: #121a2c; --ref: #9aa3b5;
  --pass: #157346; --pass-soft: #e2f3ea; --warn: #9a5b00; --warn-soft: #fbefd9; --fail: #b8232b; --fail-soft: #fbe4e4; --na: #6b7387; --na-soft: #eceff4;
  --display: "Archivo", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Public Sans", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 6px;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #0c111c; --surface: #141b2a; --sunk: #10172a; --ink: #e5e9f2; --muted: #a0aac0; --faint: #707a91; --line: #263049; --line-strong: #37425f;
  --accent: #8aa6ff; --accent-ink: #0c111c; --accent-soft: #1d2a4d;
  --champ: #8aa6ff; --chall: #46cfc6; --obs: #e5e9f2; --ref: #5d6780;
  --pass: #55c98f; --pass-soft: #12301f; --warn: #f1b24a; --warn-soft: #33260e; --fail: #ff7a7a; --fail-soft: #3a1618; --na: #9aa3b8; --na-soft: #1f2637;
  color-scheme: dark } }
:root[data-theme="dark"] {
  --bg: #0c111c; --surface: #141b2a; --sunk: #10172a; --ink: #e5e9f2; --muted: #a0aac0; --faint: #707a91; --line: #263049; --line-strong: #37425f;
  --accent: #8aa6ff; --accent-ink: #0c111c; --accent-soft: #1d2a4d;
  --champ: #8aa6ff; --chall: #46cfc6; --obs: #e5e9f2; --ref: #5d6780;
  --pass: #55c98f; --pass-soft: #12301f; --warn: #f1b24a; --warn-soft: #33260e; --fail: #ff7a7a; --fail-soft: #3a1618; --na: #9aa3b8; --na-soft: #1f2637;
  color-scheme: dark }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3 { font-family: var(--display); font-stretch: 85%; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
h2 { font-size: 1.35rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 650; }
p { margin: 0; }
.num, td.n, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.eyebrow { font-family: var(--display); font-stretch: 80%; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 650; color: var(--muted); }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* first-use guide and global navigation */
.intro-banner { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:14px 28px; background:var(--accent-soft); border:1px solid var(--line); border-radius:var(--r); padding:14px 18px; }
.intro-banner strong { display:block; font-size:0.96rem; }
.intro-banner p { color:var(--muted); font-size:0.83rem; max-width:72ch; margin-top:3px; }
.intro-banner nav { display:flex; flex-wrap:wrap; gap:6px 14px; font-size:0.82rem; font-weight:600; }
.intro-banner a { white-space:nowrap; }
.startpaths { display:flex; flex-wrap:wrap; gap:8px; margin-top:10px; }
.pill.info { color: var(--accent); background: var(--accent-soft); }
.insight { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 18px; }
.insight dl { margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 20px; }
.insight dt { font-family: var(--display); font-stretch: 80%; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; font-weight: 650; color: var(--muted); margin-bottom: 3px; }
.insight dd { margin: 0; font-size: 0.88rem; line-height: 1.45; }
.insight div:nth-child(2) dd { font-weight: 600; }
.alert { border-radius: var(--r); padding: 12px 16px; font-size: 0.9rem; border: 1px solid; }
.alert.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--ink); }
.alert.fail { background: var(--fail-soft); border-color: var(--fail); color: var(--ink); }
@media (max-width: 1100px) { .insight dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .insight dl { grid-template-columns: minmax(0, 1fr); } }
.mini-label { display:block; font-size:0.75rem; color:var(--muted); margin-top:4px; }
/* top bar */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 20px; padding: 14px 20px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand h1 { font-size: 1.45rem; font-weight: 800; font-stretch: 78%; letter-spacing: -0.005em; }
.brand h1 span { color: var(--accent); }
.brand p { color: var(--muted); font-size: 0.88rem; }
.runchip { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); display: flex; gap: 14px; flex-wrap: wrap; }
.runchip b { color: var(--ink); font-weight: 500; }

/* shell */
.shell { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 0; min-height: calc(100vh - 60px); }
.panel { border-right: 1px solid var(--line); background: var(--surface); padding: 18px 18px 28px; display: flex; flex-direction: column; gap: 18px; }
.panel details { display: contents; }
.panel summary { display: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .legendlabel { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.group { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.group:first-of-type { border-top: 0; padding-top: 0; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; border: 1px solid var(--line-strong); border-radius: var(--r); overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { text-align: center; padding: 7px 6px; font-size: 0.82rem; cursor: pointer; border-left: 1px solid var(--line-strong); color: var(--muted); }
.seg label:first-of-type { border-left: 0; }
.seg input:checked + label { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: -3px; }
select, input[type=number], input[type=text] { font: inherit; font-size: 0.9rem; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r); padding: 6px 8px; width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.btn { font: inherit; font-size: 0.88rem; font-weight: 600; border-radius: var(--r); padding: 8px 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); cursor: pointer; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: 0.55; cursor: progress; }
.btn.link { border: 0; padding: 0; background: none; color: var(--accent); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.drop { border: 1.5px dashed var(--line-strong); border-radius: var(--r); padding: 14px; text-align: center; font-size: 0.85rem; color: var(--muted); cursor: pointer; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.checks { max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r); padding: 6px 8px; display: flex; flex-direction: column; gap: 3px; }
.checks label { display: flex; gap: 8px; align-items: center; font-size: 0.84rem; }
.checks .kind { margin-left: auto; font-family: var(--mono); font-size: 0.7rem; color: var(--faint); }
.progress { display: flex; flex-direction: column; gap: 6px; }
.bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width 0.2s; }
.note { font-size: 0.8rem; color: var(--muted); }
.err { color: var(--fail); font-size: 0.85rem; }

/* main */
main { min-width: 0; padding: 18px 24px 48px; display: flex; flex-direction: column; gap: 16px; }
.reviewbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.reviewbar .seg { min-width: 0; flex: 0 1 460px; }
.reviewbar .seg label { padding: 8px 10px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: thin; }
.tabs button { font: inherit; font-family: var(--display); font-stretch: 85%; font-weight: 600; font-size: 0.92rem; border: 0; background: none; color: var(--muted); padding: 9px 12px 10px; cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: 6px; vertical-align: 1px; }
.pane { display: flex; flex-direction: column; gap: 18px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.card header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.card .lede { color: var(--muted); font-size: 0.88rem; max-width: 70ch; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.chart { width: 100%; min-height: 200px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.78rem; color: var(--muted); }
.legend i { display: inline-block; width: 14px; height: 0; border-top: 2.5px solid; vertical-align: 3px; margin-right: 5px; }
.legend i.box { height: 9px; border: 0; vertical-align: -1px; }
.legend i.dash { border-top-style: dashed; }

/* verdict */
.verdict { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.stamp { font-family: var(--display); font-stretch: 75%; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; font-size: 1.05rem; line-height: 1.15; padding: 10px 14px; border: 2.5px solid currentColor; border-radius: 4px; max-width: 13ch; text-align: center; transform: rotate(-2deg); }
.stamp.pass { color: var(--pass); } .stamp.warn { color: var(--warn); } .stamp.fail { color: var(--fail); }
.verdict h2 { font-size: 1.5rem; }
.verdict .who { color: var(--muted); font-size: 0.88rem; margin-top: 2px; }
.verdict .sum { margin-top: 8px; max-width: 75ch; }
.figs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.fig { padding: 12px 16px; border-left: 1px solid var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fig:first-child { border-left: 0; }
.fig .v { font-family: var(--display); font-stretch: 80%; font-weight: 700; font-size: 1.7rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fig .s { font-size: 0.78rem; color: var(--muted); }

/* tables */
.tablewrap { overflow-x: auto; margin: 0 -2px; }
table { border-collapse: collapse; width: 100%; font-size: 0.86rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 6px 10px; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
td { padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.n, th.n { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td .rule { display: block; color: var(--faint); font-size: 0.76rem; margin-top: 2px; }
tr.sel td { background: var(--accent-soft); }
.pill { display: inline-block; font-family: var(--mono); font-size: 0.7rem; font-weight: 500; letter-spacing: 0.04em; padding: 2px 7px; border-radius: 3px; white-space: nowrap; }
.pill.pass { color: var(--pass); background: var(--pass-soft); } .pill.warn { color: var(--warn); background: var(--warn-soft); } .pill.fail { color: var(--fail); background: var(--fail-soft); } .pill.na { color: var(--na); background: var(--na-soft); }
.tag { font-size: 0.7rem; font-family: var(--mono); border: 1px solid var(--line-strong); border-radius: 3px; padding: 1px 5px; color: var(--muted); }
ul.findings { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: 6px; max-width: 80ch; }
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0; }
.cmp > div { padding: 4px 16px; border-left: 3px solid; display: flex; flex-direction: column; gap: 2px; }
.cmp dl { display: grid; grid-template-columns: auto auto; justify-content: start; gap: 2px 16px; margin: 6px 0 0; font-size: 0.86rem; }
.cmp dt { color: var(--muted); } .cmp dd { margin: 0; font-family: var(--mono); }

/* cut-off */
.slider { display: flex; flex-direction: column; gap: 6px; }
.slider input { width: 100%; accent-color: var(--accent); }
.cutval { font-family: var(--display); font-stretch: 80%; font-weight: 700; font-size: 2rem; line-height: 1; }
.confusion { display: grid; grid-template-columns: auto 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; font-size: 0.86rem; }
.confusion > div { background: var(--surface); padding: 8px 12px; }
.confusion .h { background: var(--sunk); color: var(--muted); font-size: 0.76rem; font-weight: 600; }
.confusion .c { font-family: var(--mono); font-size: 1.05rem; }
.confusion .c small { display: block; font-family: var(--body); font-size: 0.74rem; color: var(--muted); }
.confusion .good { box-shadow: inset 3px 0 0 var(--pass); } .confusion .bad { box-shadow: inset 3px 0 0 var(--fail); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.kpis div { display: flex; flex-direction: column; }
.kpis b { font-family: var(--mono); font-weight: 500; font-size: 1.05rem; }
.kpis span { font-size: 0.78rem; color: var(--muted); }

/* report */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px 28px; max-width: 920px; }
.report h1 { font-size: 1.5rem; margin-bottom: 6px; }
.report h2 { font-size: 1.1rem; margin: 22px 0 8px; }
.report p, .report li { max-width: 75ch; }
.report ul, .report ol { padding-left: 1.2rem; display: flex; flex-direction: column; gap: 4px; }
.report table { margin: 6px 0; }
.report code { font-family: var(--mono); font-size: 0.85em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toast { font-size: 0.82rem; color: var(--pass); min-height: 1.2em; }

.loading { display: flex; flex-direction: column; gap: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.loading ol { margin: 0; padding-left: 1.2rem; color: var(--muted); display: flex; flex-direction: column; gap: 4px; font-size: 0.9rem; }
.loading li.done { color: var(--ink); }
.loading li.now { color: var(--accent); font-weight: 600; }

/* svg chart classes */
.ax line, .ax path { stroke: var(--line-strong); }
.grid line { stroke: var(--line); }
.ax text, .lbl { fill: var(--muted); font-family: var(--mono); font-size: 11px; }
.axt { fill: var(--muted); font-family: var(--body); font-size: 11.5px; }
.s-champ { stroke: var(--champ); fill: none; } .f-champ { fill: var(--champ); }
.s-chall { stroke: var(--chall); fill: none; } .f-chall { fill: var(--chall); }
.s-obs { stroke: var(--obs); fill: none; } .f-obs { fill: var(--obs); }
.s-ref { stroke: var(--ref); fill: none; } .f-ref { fill: var(--ref); }
.s-warn { stroke: var(--warn); fill: none; } .s-fail { stroke: var(--fail); fill: none; }
.f-fail { fill: var(--fail); } .f-warn { fill: var(--warn); } .f-pass { fill: var(--pass); }
.f-band { fill: var(--accent-soft); }
.lbl.strong { fill: var(--ink); }

@media (max-width: 1100px) { .figs { grid-template-columns: repeat(3, minmax(0, 1fr)); } .fig:nth-child(4) { border-left: 0; } .fig:nth-child(n+4) { border-top: 1px solid var(--line); } }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .panel { border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; gap: 14px; }
  .panel details { display: block; }
  .panel details > div { display: flex; flex-direction: column; gap: 16px; margin-top: 12px; }
  .panel summary { display: list-item; cursor: pointer; font-weight: 600; font-family: var(--display); font-stretch: 85%; }
  main { padding: 14px 16px 40px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fig { border-left: 0 !important; border-top: 1px solid var(--line); } .fig:nth-child(-n+2) { border-top: 0; } .fig:nth-child(even) { border-left: 1px solid var(--line) !important; }
  .verdict { grid-template-columns: minmax(0, 1fr); }
  .stamp { justify-self: start; }
  .cmp { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .top { padding: 12px 16px; }
  .report { padding: 18px 16px; }
  .panel { padding:12px; }
  .reviewbar .seg { flex:1 1 100%; }
  .fig .v { font-size:1.3rem; }
  .intro-banner { padding:12px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
