/* SO-Check house-style layer · STYLE.md / so_check_style.py v1.0 (2026-10-07).
   Loaded after styles.css. Look only: palette, type, header, buttons, chips, charts, tables, footer.
   Behaviour, layout mechanics and accessibility rules in styles.css are left intact. */
@font-face { font-family: "DejaVu Sans"; src: local("DejaVu Sans"), url("fonts/DejaVuSans.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "DejaVu Sans"; src: local("DejaVu Sans Bold"), local("DejaVuSans-Bold"), url("fonts/DejaVuSans-Bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --fx-ink:#1c2833; --fx-muted:#5d6d7e; --fx-grid:#e5e7e9; --fx-axis:#bfc5cb;
  --fx-legacy:#1b4f72; --fx-weighted:#b85c38; --fx-small-n:#a04000; --fx-zone-ideal:#2e7d4f;
  --fx-zone-correct:#d4a017; --fx-zone-bad:#b03a2e; --fx-table-head:#f4f6f7; --fx-zebra:#fafbfc;
  --fx-footer:#7f8c8d; --fx-navy-strong:#143b56; --fx-navy-tint:rgba(27,79,114,.07);
  --page: #ffffff; --card: #ffffff;
  --ink: var(--fx-ink); --secondary: var(--fx-muted); --muted: var(--fx-muted);
  --line: var(--fx-grid); --line-strong: var(--fx-axis); --grid: var(--fx-grid);
  --hover: rgba(27,79,114,.06); --control-line: var(--fx-axis);
  --fill: var(--fx-legacy); --fill-hover: var(--fx-navy-strong); --fill-line: var(--fx-legacy);
  --amber-ink: var(--fx-small-n); --amber-tint: #fbf3ec; --amber-line: #ecd5c3;
  --r-ctl: 3px; --r-card: 4px; --r-chip: 3px; --r-pill: 3px;
  --font: "DejaVu Sans", Inter, system-ui, sans-serif;
  font-family: var(--font); font-size: 13px; background: #fff; color: var(--fx-ink);
  accent-color: var(--fx-legacy); caret-color: var(--fx-legacy);
}
body { background: #fff; }
::selection { background: rgba(27,79,114,.16); }
:focus-visible, input:focus-visible, select:focus-visible, button:focus-visible, .wordmark:focus-visible, summary:focus-visible { outline-color: var(--fx-legacy); }
h1, h2, h3 { font-weight: 700; color: var(--fx-ink); letter-spacing: 0; }
h2 { font-size: 15px; } h3 { font-size: 13px; }
.helper, .field-label { color: var(--fx-muted); }
.helper { font-size: 11px; }
button:hover { background-color: var(--fx-table-head); border-color: var(--fx-muted); }
.text-button { color: var(--fx-legacy); font-weight: 700; font-size: 12px; }
.small-n { color: var(--fx-small-n); font-weight: 700; }

/* Caution bar: amber stays for caution semantics */
.caution { color: var(--fx-small-n); font-size: 11px; padding-inline: 32px; }
.caution strong { font-weight: 700; letter-spacing: .02em; }
.caution > span { color: var(--fx-muted); }
.caution .text-button { color: var(--fx-small-n); font-size: 11px; }

/* Masthead = plate header */
.page { max-width: 1440px; padding: 0 40px; }
.masthead { display: block; text-align: center; padding: 34px 0 26px; }
.brand { display: block; margin: 0; }
.wordmark { font-size: 24px; font-weight: 700; color: var(--fx-ink); line-height: 1.25; }
.wordmark:hover { color: var(--fx-legacy); text-decoration: none; }
.plate-sub { color: var(--fx-muted); margin: 4px 0 0; }
.plate-sub.s1 { font-size: 13px; margin-top: 6px; } .plate-sub.s2 { font-size: 12px; } .plate-sub.s3 { font-size: 11px; }
.preview, .badge { border-color: var(--fx-axis); border-radius: 3px; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--fx-muted); background: var(--fx-table-head); }
.masthead .preview { display: inline-block; margin-top: 10px; padding: 2px 7px; }
.badge { color: var(--fx-legacy); }

/* Buttons + chips: navy primary, white text */
.primary { background: var(--fx-legacy); color: #fff; border-color: var(--fx-legacy); font-weight: 700; }
.primary:hover { background: var(--fx-navy-strong); border-color: var(--fx-navy-strong); }
.suggestions button { color: var(--fx-legacy); background: #fff; border-color: var(--fx-axis); font-size: 11px; }
.suggestions button:hover { background: var(--hover); border-color: var(--fx-legacy); }
.chip { color: var(--fx-ink); font-size: 11px; }
.chip:hover:not(:disabled) { border-color: var(--fx-muted); }
.chip[aria-pressed=true] { background: var(--fx-legacy); color: #fff; border-color: var(--fx-legacy); font-weight: 700; }
.chip[aria-pressed=true]:hover { background: var(--fx-navy-strong); }
.chip[aria-pressed=true] .dot { border-color: #fff; background: var(--series); }
.group-label { color: var(--fx-muted); font-size: 11px; }
.skip-link { background: var(--fx-legacy); color: #fff; }
.dot { background: #fff; border: 2px solid var(--series); width: 9px; height: 9px; }

/* Roster */
.roster-caption { background: var(--fx-table-head); color: var(--fx-ink); font-weight: 700; }
.person { font-size: 12px; }
.person:nth-child(even) { background: var(--fx-zebra); }
.person:hover { background: var(--hover); }
.person.selected { background: var(--fx-navy-tint); box-shadow: inset 3px 0 0 var(--fx-legacy); }
.person-name { font-weight: 700; }
.person-token, .person-dates, .visit-count { color: var(--fx-muted); }

/* Scope + legend */
.scope h2 { font-size: 17px; }
.legend { color: var(--fx-ink); font-size: 11px; align-items: center; gap: 18px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 26px; height: 14px; flex-shrink: 0; overflow: visible; }
.chart-caption { align-items: center; flex-wrap: wrap; gap: 8px 16px; color: var(--fx-muted); }
#chart-rule { display: inline-flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; color: var(--fx-ink); border: 1px solid var(--fx-grid); padding: 5px 10px; background: rgba(255,255,255,.97); }
#chart-rule > span { display: inline-flex; align-items: center; gap: 6px; }

/* Panels = mini plates */
.panel { height: auto; padding: 14px 16px 10px; }
.panel-heading { display: block; text-align: left; }
.panel-heading h3 { display: flex; align-items: center; gap: 7px; font-size: 13.5px; }
.panel-heading .panel-sub { font-size: 10.5px; color: var(--fx-muted); margin: 2px 0 0; padding-left: 16px; }
.panel svg { display: block; width: 100%; height: auto; aspect-ratio: 480 / 200; margin-top: 6px; }
.chart-text, .chart-axis-label { fill: var(--fx-muted); font-family: var(--font); font-size: 10px; }
.chart-ref { fill: var(--fx-zone-ideal); font-family: var(--font); font-size: 9px; }
.chart-grid { stroke: var(--fx-grid); stroke-width: 1; }
.chart-spine, .chart-tick { stroke: var(--fx-axis); stroke-width: 1; }
.zero { stroke: var(--fx-zone-ideal); stroke-width: 1.1; stroke-dasharray: 2 2; opacity: .9; }
.data-dot { fill: #fff; fill-opacity: 1; stroke: var(--dot, var(--fx-legacy)); stroke-width: var(--dot-w, 2.2); }
.data-dot:hover, .data-dot:focus { fill: var(--fx-navy-tint); stroke-width: calc(var(--dot-w, 2.2) + .6); }
.data-dot:focus-visible { stroke-width: calc(var(--dot-w, 2.2) + 1); }
.series-line { stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.median-line { fill: none; stroke: var(--fx-legacy); stroke-width: 2.6; stroke-linejoin: round; stroke-linecap: round; }
.median-fill { fill: var(--fx-legacy); fill-opacity: .07; stroke: none; }
.median-dot { fill: #fff; stroke: var(--fx-legacy); stroke-width: 2.3; }
.end-label { font-family: var(--font); font-size: 10px; font-weight: 700; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
#units-note { margin: 0 0 20px; font-size: 11px; }

/* Tables: light header, zebra, hairline rules, centred cells */
.table-scroll { border: 1px solid var(--fx-grid); }
table { font-size: 11.5px; text-align: center; color: var(--fx-ink); }
th { background: var(--fx-table-head); color: var(--fx-ink); font-weight: 700; font-size: 11px; }
th, td { border-bottom: 1px solid var(--fx-grid); border-right: 1px solid var(--fx-grid); height: 30px; padding: 5px 10px; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:nth-child(even) td { background: var(--fx-zebra); }
td.numeric, th.numeric { text-align: center; }
td.col-navy { color: var(--fx-legacy); }
td.small-n { color: var(--fx-small-n); font-weight: 700; }
.companion summary, .quarantine summary { font-weight: 700; }
.quarantine summary { color: var(--fx-small-n); }
.quarantine p { color: var(--fx-ink); font-size: 11px; }
.quarantine .table-scroll { border-color: var(--amber-line); background: #fff; }
.quarantine th { background: #f6ecd2; }

/* Ask result */
.result h2 { text-align: center; }
.query { font-family: "DejaVu Sans Mono", ui-monospace, Menlo, monospace; font-size: 11px; background: var(--fx-table-head); color: var(--fx-ink); }
.notice { font-size: 11px; color: var(--fx-ink); }
.ask-error { color: var(--fx-small-n); font-size: 12px; }
.answer-lead { font-size: 14px; }
.answer-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px; align-items: start; margin: 16px 0; }
.answer-grid .bars { margin: 0; }
.bar-label { color: var(--fx-muted); font-size: 11px; } .bar-label strong { color: var(--fx-ink); }
.bar-track { background: var(--fx-grid); height: 6px; border-radius: 1px; }
.bar-fill { background: var(--fx-legacy); }
.answer-table { border: 1px solid var(--fx-grid); }
.answer-table th, .answer-table td { height: 26px; padding: 4px 8px; font-size: 11px; }
.tooltip { background: #fff; color: var(--fx-ink); border: 1px solid var(--fx-grid); font-size: 11px; }
dialog::backdrop { background: rgba(28,40,51,.32); }

/* Footer = plate footer: one small grey centred line */
footer { display: block; text-align: center; margin-top: 36px; padding: 18px 0 26px; font-size: 10px; color: var(--fx-footer); letter-spacing: .02em; border-top: 0; }
footer .text-button { color: var(--fx-footer); font-size: 10px; font-weight: 400; padding: 0; min-height: 0; text-decoration: underline; }

@media (max-width: 1279px) { .page { padding: 0 24px; } }
@media (max-width: 900px) { .answer-grid { grid-template-columns: 1fr; } }
@media (max-width: 767px) {
  .page { padding: 0 14px; }
  .caution { padding-inline: 14px; }
  .masthead { padding: 22px 0 18px; }
  .wordmark { font-size: 19px; }
  .plate-sub.s1 { font-size: 12px; } .plate-sub.s2 { font-size: 11px; } .plate-sub.s3 { font-size: 10.5px; }
  .panel { height: auto; padding: 12px 10px 8px; }
  .panel svg { height: auto; }
  .chart-text, .chart-axis-label { font-size: 12.5px; }
  .chart-ref { font-size: 11.5px; } .end-label { font-size: 12px; }
}

/* ── Controls & buttons (house-style-controls) ─────────────────────────────
   One control system: 32px tall (40px on touch layouts), 1px border, 3px radius,
   DejaVu Sans 12px. Variants: primary = navy fill · secondary = white + navy outline ·
   quiet = greys. Selected/pressed = navy fill + white text. Labels never wrap or clip;
   their containers wrap instead. Rust is not used on buttons (nothing here is a highlight). */
:root {
  --ctl-h: 32px; --ctl-fs: 12px; --ctl-pad: 12px; --ctl-r: 3px;
  --ctl-line: var(--fx-axis); --ctl-dis-bg: var(--fx-table-head); --ctl-dis-ink: #95a0aa;
  --ctl-chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25 10.5 1.75' stroke='%231b4f72' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --ctl-chev-dis: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1.5 1.75 6 6.25 10.5 1.75' stroke='%2395a0aa' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* Base = secondary (white, navy outline) */
button {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--ctl-h); height: var(--ctl-h); padding: 0 var(--ctl-pad);
  font-family: var(--font); font-size: var(--ctl-fs); font-weight: 700; line-height: 1; letter-spacing: 0;
  white-space: nowrap; flex-shrink: 0;
  color: var(--fx-legacy); background: #fff; border: 1px solid var(--fx-legacy); border-radius: var(--ctl-r);
  transition: background-color .12s, border-color .12s, color .12s;
}
button:hover:not(:disabled) { background: var(--fx-navy-tint); border-color: var(--fx-navy-strong); color: var(--fx-navy-strong); }
button:active:not(:disabled) { background: rgba(27,79,114,.15); }
button[aria-pressed=true], button[aria-expanded=true] { background: var(--fx-legacy); border-color: var(--fx-legacy); color: #fff; }
button[aria-pressed=true]:hover:not(:disabled), button[aria-expanded=true]:hover:not(:disabled) { background: var(--fx-navy-strong); border-color: var(--fx-navy-strong); color: #fff; }
button:disabled, button[aria-disabled=true]:not(.chip) { opacity: 1; cursor: not-allowed; background: var(--ctl-dis-bg); border-color: var(--fx-grid); color: var(--ctl-dis-ink); }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--fx-legacy); outline-offset: 2px; }

/* Primary (navy fill) */
.primary { background: var(--fx-legacy); border-color: var(--fx-legacy); color: #fff; padding: 0 16px; }
.primary:hover:not(:disabled) { background: var(--fx-navy-strong); border-color: var(--fx-navy-strong); color: #fff; }
.primary:active:not(:disabled) { background: #0f2d42; border-color: #0f2d42; }

/* Quiet (greys): Clear, Undo, Show all, Close, Print, inline scope actions */
.text-button {
  min-height: var(--ctl-h); height: var(--ctl-h); padding: 0 10px;
  font-size: var(--ctl-fs); font-weight: 700; text-decoration: none;
  color: var(--fx-muted); background: #fff; border: 1px solid var(--fx-axis);
}
.text-button:hover:not(:disabled) { color: var(--fx-ink); background: var(--fx-table-head); border-color: var(--fx-muted); text-decoration: none; }
.text-button:active:not(:disabled) { background: var(--fx-grid); }
#scope-extra .text-button { min-height: 26px; height: 26px; padding: 0 8px; font-size: 11px; } /* sits inside a line of 12px scope text */
.result > .text-button { margin-top: 12px; }
footer .text-button { min-height: 24px; height: 24px; padding: 0 8px; font-size: 10px; font-weight: 700; color: var(--fx-footer); text-decoration: none; vertical-align: middle; margin-left: 4px; }
footer .text-button:hover:not(:disabled) { color: var(--fx-ink); }
/* The caution-bar jump link is a text link inside an 11px banner sentence, not a button. */
.caution .text-button { height: auto; min-height: 0; padding: 0; border: 0; background: none; color: var(--fx-small-n); font-size: 11px; text-decoration: underline; }
.caution .text-button:hover { background: none; color: var(--fx-ink); }

/* Secondary actions that were styled as links: open/act buttons, white + navy outline */
#relate, #download { color: var(--fx-legacy); border-color: var(--fx-legacy); background: #fff; }
#relate:hover:not(:disabled), #download:hover:not(:disabled) { background: var(--fx-navy-tint); color: var(--fx-navy-strong); border-color: var(--fx-navy-strong); }
#table-toggle { min-width: 7.5rem; }

/* Canned questions: secondary, compact type, same height */
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; }
.suggestions button { font-size: 11px; font-weight: 400; color: var(--fx-legacy); border-color: var(--fx-legacy); background: #fff; padding: 0 10px; }
.suggestions button:hover:not(:disabled) { background: var(--fx-navy-tint); }

/* Analyte chips: unselected = white + navy outline; selected = navy fill, white text */
.chip { height: var(--ctl-h); min-height: var(--ctl-h); padding: 0 10px; font-size: 11px; font-weight: 700; color: var(--fx-legacy); background: #fff; border-color: var(--fx-legacy); }
.chip:hover:not(:disabled) { background: var(--fx-navy-tint); border-color: var(--fx-navy-strong); }
.chip[aria-pressed=true] { background: var(--fx-legacy); color: #fff; border-color: var(--fx-legacy); font-weight: 700; }
.chip[aria-pressed=true]:hover:not(:disabled) { background: var(--fx-navy-strong); border-color: var(--fx-navy-strong); color: #fff; }
.chip[aria-pressed=true]::before { font-size: 11px; }
.chip[aria-disabled=true] { cursor: not-allowed; opacity: 1; }
.chip[aria-pressed=true][aria-disabled=true] { background: var(--fx-legacy); } /* last selected chip: stays selected-looking; title explains */

/* Inputs + selects */
input:where(:not([type=checkbox]):not([type=radio])), select {
  box-sizing: border-box; min-height: var(--ctl-h); height: var(--ctl-h);
  font-family: var(--font); font-size: var(--ctl-fs); font-weight: 400; line-height: 1.2; color: var(--fx-ink);
  background-color: #fff; border: 1px solid var(--ctl-line); border-radius: var(--ctl-r); padding: 0 10px;
}
select { padding-right: 30px; background-image: var(--ctl-chev); background-position: right 10px center; background-size: 12px 8px; background-repeat: no-repeat; text-overflow: ellipsis; white-space: nowrap; }
input:where(:not([type=checkbox])):hover:not(:disabled), select:hover:not(:disabled) { border-color: var(--fx-legacy); }
input:where(:not([type=checkbox])):focus, select:focus { border-color: var(--fx-legacy); }
input::placeholder { color: var(--fx-footer); opacity: 1; }
input:disabled, select:disabled { opacity: 1; background-color: var(--ctl-dis-bg); border-color: var(--fx-grid); color: var(--ctl-dis-ink); cursor: not-allowed; }
select:disabled { background-image: var(--ctl-chev-dis); }
select option { color: var(--fx-ink); background: #fff; font-family: var(--font); font-size: 13px; }
select option:checked { color: #fff; background: var(--fx-legacy); }
.sort-field select { font-size: var(--ctl-fs); }
#question { flex: 1 1 auto; height: var(--ctl-h); min-height: var(--ctl-h); }
input[type=search]::-webkit-search-cancel-button { cursor: pointer; }

/* Checkboxes: navy accent */
input[type=checkbox] { accent-color: var(--fx-legacy); width: 16px; height: 16px; margin: 0; cursor: pointer; }
input[type=checkbox]:disabled { cursor: not-allowed; }

/* Containers wrap so labels never have to */
.section-heading { flex-wrap: wrap; row-gap: 8px; }
.analyte-controls { row-gap: 10px; }
.secondary-controls { gap: 8px; flex-wrap: wrap; }
.table-actions { flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.relate-row { flex-wrap: wrap; gap: 8px 14px; }
#ask-form { gap: 8px; align-items: stretch; }

@media (max-width: 767px) {
  :root { --ctl-h: 40px; } /* touch layouts keep a 40px target */
  .text-button { min-height: var(--ctl-h); }
  #scope-extra .text-button { min-height: 32px; height: 32px; }
  footer .text-button { min-height: 32px; height: 32px; }
  .caution .text-button { min-height: 0; height: auto; }
  #ask-form { flex-direction: row; }
  #ask-form .primary { flex: 0 0 auto; }
  .suggestions { flex-wrap: wrap; overflow: visible; }
  #analyte-chips, .chip-group { flex-wrap: wrap; overflow: visible; row-gap: 6px; }
  #analyte-chips { gap: 8px 12px; }
}
