/* BioRadius PK — one stylesheet (started from the LIMS's via BioRadius Calls: same tokens and components, its own
   violet accent; Test / Reference series blue / orange, validated with the dataviz palette checker in light and dark).
   Rules: every colour is a token below (light in :root, dark twice: [data-theme="dark"] and the
   prefers-color-scheme block for data-theme="system" — keep those two identical). No frameworks,
   no CDN; fonts are bundled in /static/fonts (OFL). */

@font-face { font-family: "Instrument Sans"; src: url("fonts/instrument-sans.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/plex-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }

:root {
  --paper: #F6F5F1; --surface: #FFFFFF; --sunken: #F3F1EC; --hover: #EEECE6;
  --line: #E4E2DA; --line-soft: #EFEDE7; --line-strong: #CFCBC0; --control-line: #DAD7CE;
  --ink: #17181B; --ink-2: #3F4148; --muted: #5E6068; --faint: #8A8C93;
  --accent: #5B3FB8; --accent-hover: #47309A; --accent-ink: #FFFFFF; --accent-soft: #ECE7FA; --accent-soft-ink: #3F2A8C;
  --ok-bg: #E2F1E9; --ok: #17613F; --warn-bg: #FAEBCF; --warn: #7A4E00; --bad-bg: #FADFDB; --bad: #A1231B;
  --mute-bg: #EEEDE8; --mute: #4E5058; --signal: #D07A12; --focus: #B9A9EC;
  --shadow: 0 12px 40px rgba(23, 24, 27, .16);
  --series-1: #2a78d6; --series-t: #2a78d6; --series-r: #eb6834; --overlay: rgba(10, 11, 13, .42);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --paper: #111214; --surface: #1A1B1F; --sunken: #16171A; --hover: #222328;
  --line: #2C2E34; --line-soft: #24262B; --line-strong: #3C3F46; --control-line: #3A3C43;
  --ink: #EDECE7; --ink-2: #CFCED0; --muted: #9C9EA6; --faint: #7D8088;
  --accent: #A893F0; --accent-hover: #C2B4F5; --accent-ink: #1B1140; --accent-soft: #261F3F; --accent-soft-ink: #CEC3F7;
  --ok-bg: #16301F; --ok: #7FD1A0; --warn-bg: #33270F; --warn: #F2C26B; --bad-bg: #3A1A17; --bad: #F4A097;
  --mute-bg: #26272C; --mute: #B3B5BB; --signal: #E89A3C; --focus: #5A49A0;
  --shadow: 0 12px 40px rgba(0, 0, 0, .5);
  --series-1: #3987e5; --series-t: #3987e5; --series-r: #d95926; --overlay: rgba(0, 0, 0, .55);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --paper: #111214; --surface: #1A1B1F; --sunken: #16171A; --hover: #222328;
    --line: #2C2E34; --line-soft: #24262B; --line-strong: #3C3F46; --control-line: #3A3C43;
    --ink: #EDECE7; --ink-2: #CFCED0; --muted: #9C9EA6; --faint: #7D8088;
    --accent: #A893F0; --accent-hover: #C2B4F5; --accent-ink: #1B1140; --accent-soft: #261F3F; --accent-soft-ink: #CEC3F7;
    --ok-bg: #16301F; --ok: #7FD1A0; --warn-bg: #33270F; --warn: #F2C26B; --bad-bg: #3A1A17; --bad: #F4A097;
    --mute-bg: #26272C; --mute: #B3B5BB; --signal: #E89A3C; --focus: #5A49A0;
    --shadow: 0 12px 40px rgba(0, 0, 0, .5);
    --series-1: #3987e5; --series-t: #3987e5; --series-r: #d95926; --overlay: rgba(0, 0, 0, .55);
    color-scheme: dark;
  }
}

/* The BioRadius Assistant panel (/assistant/assistant.css) takes its colours from these; they follow the theme. */
:root {
  --as-bg: var(--paper); --as-surface: var(--surface); --as-surface-2: var(--sunken); --as-input: var(--surface);
  --as-ink: var(--ink); --as-ink-2: var(--ink-2); --as-muted: var(--muted); --as-line: var(--line);
  --as-line-soft: var(--line-soft); --as-line-strong: var(--line-strong); --as-accent: var(--accent);
  --as-accent-ink: var(--accent-ink); --as-accent-soft: var(--accent-soft); --as-accent-soft-ink: var(--accent-soft-ink);
  --as-ok: var(--ok); --as-danger: var(--bad); --as-warn-ink: var(--warn); --as-focus-ring: var(--accent-soft);
  --as-series: var(--series-1); --as-chart-grid: var(--line-soft); --as-chart-axis: var(--line-strong);
  --as-dim: var(--overlay); --as-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --as-font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.assistant-button, .app-switcher-button { width: 40px; padding: 0; }
.assistant-button svg.i { width: 19px; height: 19px; }

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 14px/1.5 "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { margin: 0; font-weight: 600; }
h1 { font-family: "Instrument Serif", Georgia, serif; font-weight: 400; font-size: 42px; line-height: 1.05; letter-spacing: -.01em; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0 0 12px; }
code, .mono { font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace; font-size: .93em; }
svg.i { width: 18px; height: 18px; flex-shrink: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
table.t td.criterion { min-width: 170px; white-space: normal; }
.eyebrow { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; }
.sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex-grow: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.grid-side { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }

/* ------------------------------------------------------------------ layout */
.shell { display: flex; min-height: 100vh; }
.side { width: 232px; flex-shrink: 0; padding: 20px 14px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 10px 26px; color: var(--ink); }
.brand-name { font-family: "Instrument Serif", Georgia, serif; font-size: 23px; line-height: 1; }
.brand .eyebrow { font-size: 10px; margin-top: 4px; }
.nav { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; }
.nav:hover { background: var(--hover); color: var(--ink); }
.nav.on { background: var(--surface); color: var(--ink); box-shadow: 0 0 0 1px var(--line); }
.nav .pill { margin-left: auto; height: 20px; padding: 0 7px; }
.side hr { border: 0; height: 1px; background: var(--line); margin: 12px 10px; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; position: relative; }
.me { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.me:hover { background: var(--hover); }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-soft-ink); display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.me-sub { font-size: 12px; color: var(--muted); line-height: 1.3; }
.menu { position: absolute; bottom: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; z-index: 20; }
.menu.open { display: block; }
.menu a, .menu button { display: flex; width: 100%; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu a:hover, .menu button:hover { background: var(--hover); }
.menu .seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px 4px; }
.menu .seg button { justify-content: center; font-size: 12px; padding: 6px 4px; border: 1px solid var(--line); }
.menu .seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-soft-ink); border-color: transparent; }

.main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); min-height: 100vh; }
.top { height: 64px; flex-shrink: 0; padding: 0 40px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid var(--line); }
.search { display: flex; align-items: center; gap: 10px; width: 440px; max-width: 100%; height: 40px; padding: 0 12px 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--muted); }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex-grow: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }
.kbd { font: 11px "IBM Plex Mono", monospace; padding: 1px 6px; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); }
.content { padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 24px; max-width: 1400px; width: 100%; }
.btn.menu-toggle { display: none; }

.head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.head .grow > .row { margin-top: 6px; }
.crumbs { font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--ink); }
.sub { margin-top: 8px; color: var(--muted); display: flex; gap: 6px 18px; flex-wrap: wrap; }

/* ------------------------------------------------------------------ surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px 24px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.card.flush .card-head { padding: 18px 20px 0; }
.card-head h2 { flex-grow: 1; }
.empty { padding: 28px 20px; text-align: center; color: var(--muted); }
.note { background: var(--sunken); border-radius: 10px; padding: 12px 14px; font-size: 13px; color: var(--ink-2); }
.note.warn { background: var(--warn-bg); color: var(--warn); }
.note.bad { background: var(--bad-bg); color: var(--bad); }
.note.ok { background: var(--ok-bg); color: var(--ok); }
.flash { padding: 12px 16px; border-radius: 12px; background: var(--ok-bg); color: var(--ok); display: flex; gap: 10px; align-items: center; }
.flash.bad { background: var(--bad-bg); color: var(--bad); }

.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ok { background: var(--ok-bg); color: var(--ok); }
.warn { background: var(--warn-bg); color: var(--warn); }
.bad { background: var(--bad-bg); color: var(--bad); }
.info { background: var(--accent-soft); color: var(--accent-soft-ink); }
.mute { background: var(--mute-bg); color: var(--mute); }
.tile-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; }

/* stats strip */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.stat { padding: 0 20px; border-left: 1px solid var(--line-soft); }
.stat:first-child { padding-left: 0; border-left: 0; }
.stat .v { font-size: 30px; font-weight: 500; margin-top: 8px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .s { font-size: 13px; color: var(--muted); }
.bar { display: flex; gap: 3px; height: 10px; margin-top: 24px; }
.bar > span { display: block; min-width: 4px; }
.bar > span:first-child { border-radius: 5px 0 0 5px; }
.bar > span:last-child { border-radius: 0 5px 5px 0; }
.legend { display: flex; gap: 8px 22px; margin-top: 12px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* lists & tables */
.list-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line-soft); color: var(--ink); }
a.list-row:hover { background: var(--sunken); color: var(--ink); }
.list-row .t { font-weight: 500; }
.list-row .d { font-size: 13px; color: var(--muted); margin-top: 1px; }
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 0 12px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.link { cursor: pointer; }
table.t tbody tr.link:hover td { background: var(--sunken); }
table.t td.wrap { white-space: normal; word-break: break-word; }
.card.flush table.t th:first-child, .card.flush table.t td:first-child { padding-left: 20px; }
.card.flush table.t th:last-child, .card.flush table.t td:last-child { padding-right: 20px; }
.card.flush .table-wrap { padding-top: 4px; }
dl.facts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
dl.facts dt { font-size: 12px; color: var(--muted); }
dl.facts dd { margin: 2px 0 0; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: 13px; color: var(--muted); }

/* timeline */
ol.timeline { list-style: none; margin: 0; padding: 0; }
ol.timeline li { display: flex; gap: 12px; }
ol.timeline .rail { display: flex; flex-direction: column; align-items: center; }
ol.timeline .rail b { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
ol.timeline .rail i { width: 1px; flex-grow: 1; background: var(--line); }
ol.timeline li:last-child .rail b { background: var(--surface); border: 2px solid var(--accent); }
ol.timeline li:last-child .rail i { display: none; }
ol.timeline .body { padding-bottom: 14px; font-size: 13px; min-width: 0; }
ol.timeline .body .t { font-weight: 500; font-size: 14px; }

/* ------------------------------------------------------------------ controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px; font: 500 14px "Instrument Sans", system-ui, sans-serif; cursor: pointer; border: 1px solid var(--control-line); background: var(--surface); color: var(--ink); white-space: nowrap; }
.btn:hover { background: var(--hover); color: var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }
.btn.danger { color: var(--bad); }
.btn.ghost { border-color: transparent; background: none; }
.btn.small { min-height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn svg.i { width: 16px; height: 16px; }
form.inline { display: inline; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.field .err { font-weight: 500; color: var(--bad); font-size: 12px; }
.input, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--control-line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font: 400 14px "Instrument Sans", system-ui, sans-serif; }
.field textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.field textarea.mono, .field input.mono { font-family: "IBM Plex Mono", monospace; font-size: 13px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.has-err input, .field.has-err select, .field.has-err textarea { border-color: var(--bad); }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; font-weight: 400; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .span { grid-column: 1 / -1; }
.actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.filters .field { min-width: 160px; }

/* dialog */
dialog { border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); width: min(440px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(10, 11, 13, .45); }
dialog form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
dialog h2 { font-size: 18px; }

/* ------------------------------------------------------------------ auth pages */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth .card { width: min(400px, 100%); padding: 32px; }
.auth h1 { font-size: 36px; margin: 18px 0 6px; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 1100px) {
  .grid-side, .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .side { position: fixed; z-index: 60; left: 0; top: 0; overflow-y: auto; background: var(--paper); transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .btn.menu-toggle { display: inline-flex; }
  .main { border-left: 0; }
  .top { padding: 0 16px; gap: 10px; }
  .search { min-width: 0; }                                   /* shrinks, so the assistant button stays on screen */
  .content { padding: 20px 16px 40px; }
  h1 { font-size: 32px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .stat, .stat:first-child { padding: 0; border-left: 0; }
  .stat .v { font-size: 24px; margin-top: 4px; }
  .hide-sm { display: none; }
}

@media print {
  body { background: #FFFFFF; }
  .no-print, .side, .top { display: none !important; }
  .content { padding: 0; max-width: none; }
}

/* Test copy (sign-in page Test mode; BIORADIUS_TEST_COPY): a strip on every page so nobody mistakes it for the real app. */
.test-copy-banner { position: relative; z-index: 50; padding: 7px 16px; background: var(--warn-bg); color: var(--warn);
  border-bottom: 1px solid var(--warn); font-size: 13px; line-height: 1.4; text-align: center; }
.test-copy-banner strong { letter-spacing: .08em; }
@media (max-width: 760px) { .test-copy-more { display: none; } }      /* phones: just "TEST COPY · made-up data" */

/* Phones and touch screens: text fields at 16px, or iPhones zoom the whole page in whenever one is tapped
   (and leave it zoomed). !important because some fields set a smaller size on purpose for desktop. */
@media (max-width: 760px), (pointer: coarse) {
  input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), select, textarea { font-size: 16px !important; }
}
/* Sample, study and box codes stay on one line (the table scrolls sideways on a phone instead of
   breaking BR01-P1-S01-T01-A across three lines). */
table.t td.mono, table.t td:first-child:not(.wrap) { white-space: nowrap; }

/* Idle sign-out warning (app.js): a strip at the top of the window */
.idle-bar { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 80;
  width: min(720px, calc(100vw - 32px)); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: var(--warn-bg); color: var(--warn); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--shadow); padding: 12px 16px; font-size: 14px; line-height: 1.45; }
.idle-bar[data-kind="expired"] { background: var(--bad-bg); color: var(--bad); }
.idle-bar a { color: inherit; font-weight: 600; }
.idle-bar .btn { margin-left: auto; min-height: 34px; }
@media print { .idle-bar { display: none; } }


/* ------------------------------------------------------------------ BioRadius PK */
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; flex-shrink: 0; }
.brand-mark svg.i { width: 17px; height: 17px; }
.bad-ink { color: var(--bad); } .ok-ink { color: var(--ok); } .warn-ink { color: var(--warn); }
.side-cta { margin: 4px 10px 12px; justify-content: center; }
dialog { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); padding: 0; box-shadow: var(--shadow); width: min(480px, calc(100vw - 32px)); }
dialog::backdrop { background: var(--overlay); }
dialog form { padding: 20px; display: flex; flex-direction: column; gap: 14px; max-height: calc(100vh - 64px); overflow-y: auto; }
dialog h2 { font-size: 17px; }
a.stat.link { color: inherit; border-radius: 10px; }
a.stat.link:hover .v { color: var(--accent-soft-ink); }
.project-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.project-card { display: flex; flex-direction: column; gap: 10px; color: var(--ink); padding: 18px 20px; transition: border-color .15s, box-shadow .15s; }
.project-card:hover { color: var(--ink); border-color: var(--accent); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 12%, transparent); }
.project-card .code { font-family: "IBM Plex Mono", ui-monospace, monospace; font-weight: 500; font-size: 15px; }
.project-card .meta { display: flex; flex-wrap: wrap; gap: 6px; }
.verdict { display: flex; align-items: center; gap: 14px; padding: 16px 20px; }
.verdict.pass { box-shadow: inset 4px 0 0 var(--ok); }
.verdict.fail { box-shadow: inset 4px 0 0 var(--bad); }
.formula { font-family: "Instrument Serif", Georgia, serif; font-size: 26px; line-height: 1.25; margin-top: 6px; color: var(--ink); overflow-wrap: anywhere; }
.formula sup { font: 500 .55em "Instrument Sans", system-ui, sans-serif; line-height: 0; margin-left: 1px; }
.verdict .big { font-family: "Instrument Serif", Georgia, serif; font-size: 30px; line-height: 1.1; }
.sig { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--sunken); }
.sig .tile-icon { background: var(--ok-bg); color: var(--ok); }
.hash { font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 11.5px; color: var(--muted); word-break: break-all; }
.seg-inline { display: inline-flex; border: 1px solid var(--control-line); border-radius: 9px; overflow: hidden; }
.seg-inline button { border: 0; background: var(--surface); color: var(--ink-2); font: 500 13px "Instrument Sans", system-ui, sans-serif; padding: 5px 12px; cursor: pointer; }
.seg-inline button + button { border-left: 1px solid var(--control-line); }
.seg-inline button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-soft-ink); }
[data-scale-pane][hidden] { display: none; }
table.t td.flagged, .flag-dot { color: var(--warn); }
tr.flagged td:first-child { box-shadow: inset 3px 0 0 var(--signal); }
tr.selected td { background: var(--hover); }
tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.param-table td, .param-table th { white-space: nowrap; }
.profiles-table .spark { display: block; }
.steps-nav { display: flex; gap: 8px; align-items: center; }
ul.flags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
ul.flags li { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px; }
ul.flags li svg { color: var(--warn); margin-top: 1px; }
ul.flags li.info svg { color: var(--muted); }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.kpi { padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--sunken); }
.kpi .k { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 18px; font-weight: 500; font-variant-numeric: tabular-nums; }
.kpi .u { font-size: 11.5px; color: var(--faint); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px; border: 1.5px dashed var(--line-strong); border-radius: 12px; background: var(--sunken); text-align: center; }
.drop input[type=file] { max-width: 100%; }
.planner-n { font-family: "Instrument Serif", Georgia, serif; font-size: 64px; line-height: 1; color: var(--accent); }
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 40px 20px; }
.empty-state .tile-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-soft-ink); }
.empty-state .tile-icon svg.i { width: 24px; height: 24px; }
.locked-strip { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--ok-bg); color: var(--ok); font-size: 13.5px; }
.locked-strip.draft { background: var(--warn-bg); color: var(--warn); }
.locked-strip.superseded { background: var(--mute-bg); color: var(--mute); }

/* charts (app/web/plots.py): marks thin, grid recessive, text in text tokens, identity by colour + shape + legend */
svg.plot { width: 100%; height: auto; display: block; font-family: "Instrument Sans", system-ui, sans-serif; overflow: visible; }
svg.plot .grid { stroke: var(--line-soft); stroke-width: 1; }
svg.plot .axis { stroke: var(--line-strong); stroke-width: 1; }
svg.plot .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
svg.plot .label { fill: var(--muted); font-size: 12px; }
svg.plot .row-label { fill: var(--ink-2); font-size: 13px; font-weight: 500; }
svg.plot .direct { fill: var(--ink-2); font-size: 12px; font-weight: 500; }
svg.plot .trace { fill: none; stroke: var(--line-strong); stroke-width: 1.5; }
svg.plot .model { fill: none; stroke: var(--series-r); stroke-width: 2; stroke-dasharray: 5 4; }
svg.plot .model.strong { stroke-width: 2.5; stroke-dasharray: none; }
svg.plot .loop { fill: none; stroke: var(--series-t); stroke-width: 1.4; opacity: .45; }
svg.plot .pt.faint circle:not(.hit) { opacity: .55; }
svg.plot .lz-line { fill: none; stroke: var(--accent); stroke-width: 2; }
svg.plot .hit { fill: transparent; stroke: none; }
svg.plot .pt { cursor: default; }
svg.plot.interactive .pt[data-time] { cursor: pointer; }
svg.plot .pt circle:not(.hit), svg.plot .pt rect:not(.hit), svg.plot .pt path:not(.x) { stroke: var(--surface); stroke-width: 2; }
svg.plot .pt-std circle:not(.hit) { fill: var(--ink-2); }
svg.plot .pt-lz circle:not(.hit) { fill: var(--accent); }
svg.plot .pt-out circle:not(.hit) { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
svg.plot .pt-out .x { stroke: var(--muted); stroke-width: 1.5; }
svg.plot .pt-blq path { fill: var(--faint); }
svg.plot .pt:focus-visible { outline: none; }
svg.plot .pt:focus-visible circle:not(.hit), svg.plot .pt:hover circle:not(.hit) { stroke: var(--focus); stroke-width: 3; }
svg.plot .mean { fill: none; stroke-width: 2; stroke-linejoin: round; }
svg.plot .indiv { fill: none; stroke-width: 1; opacity: .22; }
svg.plot .err { stroke-width: 1.2; opacity: .6; }
svg.plot .s-t { stroke: var(--series-t); }
svg.plot .s-r { stroke: var(--series-r); }
svg.plot .pt.s-t circle:not(.hit), svg.plot .pt.s-t rect:not(.hit) { fill: var(--series-t); }
svg.plot .pt.s-r circle:not(.hit), svg.plot .pt.s-r rect:not(.hit) { fill: var(--series-r); }
svg.plot .stem { stroke: var(--series-t); stroke-width: 1.5; opacity: .5; }
svg.plot .band { fill: var(--ok-bg); }
svg.plot .band.wide { fill: var(--accent-soft); opacity: .8; }
svg.plot .ref-line { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; }
svg.plot .target { stroke: var(--ok); stroke-width: 1; stroke-dasharray: 4 3; }
svg.plot .dose { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
svg.plot .ci line { stroke: var(--ink-2); stroke-width: 2; }
svg.plot .ci .gmr { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
svg.plot .ci.fail line { stroke: var(--bad); }
svg.plot .ci.fail .gmr { fill: var(--bad); }
svg.plot .pt.chosen circle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
svg.spark { width: 96px; height: 28px; }
svg.spark polyline { fill: none; stroke: var(--line-strong); stroke-width: 1.4; }
svg.spark .lz circle { fill: var(--accent); }
.legend i.s-t { background: var(--series-t); border-radius: 50%; }
.legend i.s-r { background: var(--series-r); border-radius: 2px; }
.legend i.k-lz { background: var(--accent); border-radius: 50%; }
.legend i.k-std { background: var(--ink-2); border-radius: 50%; }
.legend i.k-out { background: var(--surface); border: 1.5px solid var(--muted); border-radius: 50%; }
.legend i.k-blq { background: var(--faint); clip-path: polygon(50% 0, 100% 100%, 0 100%); border-radius: 0; }
.legend i.k-line { height: 2px; width: 16px; background: var(--accent); border-radius: 1px; }
.legend i.k-model { height: 0; width: 16px; border-top: 2px dashed var(--series-r); border-radius: 0; }
.legend i.k-band { background: var(--ok-bg); border: 1px solid var(--ok); }
.legend i.k-wide { background: var(--accent-soft); border: 1px solid var(--accent); }
.chart-tip { position: absolute; z-index: 90; display: none; pointer-events: none; max-width: 320px; padding: 6px 10px; border-radius: 8px;
  background: var(--ink); color: var(--paper); font-size: 12.5px; line-height: 1.4; box-shadow: var(--shadow); }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }

/* the printable report */
.report { max-width: 980px; }
.report h2 { margin: 22px 0 8px; font-size: 16px; }
.report .sig-block { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
@media print {
  .side, .top, .no-print, .assistant-button, .test-copy-banner { display: none !important; }
  .shell, .main { display: block; }
  .content { padding: 0; }
  body { background: #fff; color: #000; }
  .card { box-shadow: none; break-inside: avoid; }
  table.t { font-size: 11px; }
}
/* sidebar (base.html): the one main action on top, everyday pages, the rest under "More" */
.side-cta { width: 100%; margin: 0 0 16px; min-height: 42px; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 22%, transparent); }
.nav-more { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.nav-more > summary { list-style: none; cursor: pointer; color: var(--muted); font-size: 13px; }
.nav-more > summary::-webkit-details-marker { display: none; }
.nav-more > summary .caret { width: 14px; height: 14px; transition: transform .15s; }
.nav-more[open] > summary .caret { transform: rotate(90deg); }
.nav.sub { font-size: 13.5px; padding-left: 14px; }
.nav.sub svg.i { width: 16px; height: 16px; }
.top-crumbs { margin: 0; font-size: 13px; }
.actions-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.action-tile { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); transition: border-color .15s, box-shadow .15s, transform .15s; }
.action-tile:hover { color: var(--ink); border-color: var(--accent); box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 12%, transparent); }
.action-tile .t { font-weight: 600; }
.action-tile .d { font-size: 13px; color: var(--muted); margin-top: 2px; }
@media (prefers-reduced-motion: no-preference) { .action-tile:hover { transform: translateY(-1px); } }
details.guide > summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 10px; font-weight: 600; }
details.guide > summary::-webkit-details-marker { display: none; }
details.guide > summary .caret { transition: transform .15s; }
details.guide[open] > summary .caret { transform: rotate(90deg); }
ol.how { margin: 14px 0 0; padding: 0; list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; counter-reset: how; }
ol.how li { counter-increment: how; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
ol.how li::before { content: counter(how); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; margin-bottom: 8px;
  background: var(--accent-soft); color: var(--accent-soft-ink); font-weight: 600; font-size: 13px; }
ol.how b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.kpi .v.sm { font-size: 14px; line-height: 1.35; margin-top: 2px; }
