/* HS Evaluator · visual identity from the approved mock-ups (Inter + Space Grotesk, teal accent). */
@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../fonts/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../fonts/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../fonts/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../fonts/inter-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-display: swap; src: url("../fonts/space-grotesk-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-display: swap; src: url("../fonts/space-grotesk-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Space Grotesk"; font-weight: 700; font-display: swap; src: url("../fonts/space-grotesk-latin-700-normal.woff2") format("woff2"); }

:root {
  --ink: #14212B; --ink2: #2B3B47; --muted: #4A5A66; --line: #D9E0E4; --line2: #EEF2F4; --bg: #F4F6F7; --card: #FFFFFF;
  --accent: #0F766E; --accent-ink: #0B5A54; --accent-soft: #E6F4F2; --accent-soft2: #F2FAF9;
  --warn: #92400E; --warn-soft: #FEF3C7; --warn-line: #B45309;
  --bad: #912018; --bad-soft: #FDECEA; --bad-line: #B42318;
  --radius: 14px; --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; --display: "Space Grotesk", var(--font);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #5EB8AE; outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
h1 { font-family: var(--display); font-size: 26px; line-height: 1.2; }
h2 { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }

/* Shell */
.topbar { position: sticky; top: 0; z-index: 20; background: #FFFFFF; border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1340px; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--display); font-weight: 700; font-size: 20px; }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; }
.mainnav a { padding: 8px 12px; border-radius: 9px; text-decoration: none; color: var(--ink2); font-weight: 500; }
.mainnav a.active { background: var(--accent-soft); color: var(--accent-ink); font-weight: 600; }
.labname { margin-left: auto; font-size: 14px; color: var(--muted); }
.page { max-width: 1340px; margin: 0 auto; padding: 20px 24px 48px; display: flex; flex-direction: column; gap: 16px; }
.page.narrow { max-width: 980px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--accent); letter-spacing: .04em; text-transform: uppercase; }
.pagehead { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.pagehead .titles { display: flex; flex-direction: column; gap: 4px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.grow { flex: 1 1 520px; min-width: 0; }
.side { flex: 0 1 320px; min-width: 260px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.gridauto { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
@media (max-width: 720px) { .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); } .labname { display: none; } .topbar-inner { padding: 8px 14px; } .page { padding: 14px 14px 40px; } }

/* Cards and controls */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.card.dashed { border: 2px dashed #B9C4CB; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 14px; border: 1px solid #B9C4CB; background: #FFFFFF; border-radius: 9px; font: 600 14px var(--font); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--bg); }
.btn.primary { background: var(--accent); color: #FFFFFF; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-ink); }
.btn.danger { color: var(--bad); border-color: #E7B4AE; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btnrow.end { justify-content: flex-end; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; min-width: 0; }
.input, select.input, textarea.input { width: 100%; padding: 10px 12px; border: 1px solid #B9C4CB; border-radius: 8px; font: 400 15px var(--font); background: #FFFFFF; color: var(--ink); }
.input.cell { width: 74px; padding: 6px; font-size: 14px; text-align: right; }
.input.invalid { border-color: var(--bad-line); background: var(--bad-soft); }
.hint { font-weight: 400; font-size: 12px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 2px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.choice.on { border: 2px solid var(--accent); background: var(--accent-soft2); }
.choice input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); }
.choice b { display: block; }
.note { font-size: 13px; color: var(--ink2); background: var(--bg); padding: 10px 12px; border-radius: 9px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.tabs { display: inline-flex; border: 1px solid #B9C4CB; border-radius: 9px; overflow: hidden; }
.tabs button { min-height: 40px; padding: 0 16px; border: 0; background: #FFFFFF; font: 600 14px var(--font); color: var(--ink); cursor: pointer; }
.tabs button.on { background: var(--accent); color: #FFFFFF; }

/* Status */
.chip { display: inline-block; padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 13px; white-space: nowrap; border: 1px solid transparent; }
.chip.ok { background: var(--accent-soft); color: var(--accent-ink); border-color: #0B5A5433; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: #92400E33; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: #91201833; }
.chip.grey { background: var(--line2); color: var(--ink2); border-color: #2B3B4733; }
.chip.none { background: #FFFFFF; color: var(--muted); border-color: #4A5A6633; }
.banner { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; border-radius: var(--radius); padding: 14px 18px; border: 2px solid; }
.banner .big { font-family: var(--display); font-size: 22px; font-weight: 700; }
.banner .text { font-size: 13px; flex: 1 1 300px; }
.banner.ok { background: var(--accent-soft); border-color: var(--accent); } .banner.ok .big { color: var(--accent-ink); }
.banner.warn { background: var(--warn-soft); border-color: var(--warn-line); } .banner.warn .big { color: var(--warn); }
.banner.bad { background: var(--bad-soft); border-color: var(--bad-line); } .banner.bad .big { color: var(--bad); }
.banner.grey { background: #FFFFFF; border-color: var(--line); } .banner.grey .big { color: var(--ink2); }
.section-label { font-size: 14px; font-weight: 600; margin: 0; }

/* Tables */
.tablewrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; color: var(--muted); font-size: 12px; font-weight: 600; background: var(--bg); padding: 8px 10px; text-transform: uppercase; letter-spacing: .02em; }
table.t td, table.t tbody th { padding: 8px 10px; border-top: 1px solid var(--line2); vertical-align: middle; }
table.t tbody th { text-align: left; font-weight: 600; color: var(--ink); background: none; text-transform: none; font-size: 14px; letter-spacing: 0; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tr.flag td { background: var(--warn-soft); }
table.t tr.out td { background: var(--bad-soft); }
.dl { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line2); font-size: 14px; }
.dl span:first-child { color: var(--ink2); }
.dl span:last-child { text-align: right; font-weight: 600; }
.dl small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
dl.dl { display: grid; grid-template-columns: minmax(120px, auto) 1fr; gap: 0 14px; padding: 0; border-top: 0; margin: 0; }
dl.dl dt, dl.dl dd { padding: 8px 0; border-top: 1px solid var(--line2); }
dl.dl dt { color: var(--ink2); }
dl.dl dd { margin: 0; font-weight: 600; text-align: right; }

/* Stat tiles */
.tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.tile { flex: 1 1 150px; background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .n { font-family: var(--display); font-size: 26px; font-weight: 700; }
.tile .l { font-size: 13px; color: var(--ink2); }

/* Charts */
.chart { display: block; width: 100%; height: auto; max-width: 760px; }
.chart text { font-family: var(--font); }

/* Boot and error */
.boot { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.boot-title { font-family: var(--display); font-size: 24px; font-weight: 700; margin: 6px 0 0; }
.boot-text { color: var(--muted); margin: 0; }
#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 1000; padding: 12px 20px; background: var(--warn-soft); color: var(--warn); box-shadow: 0 -2px 8px rgba(0,0,0,.1); }
#blazor-error-ui .dismiss { float: right; background: none; border: 0; font-size: 20px; cursor: pointer; }

/* Print: reports */
.print-only, .print-date { display: none; }
@media print {
  @page { size: A4; margin: 14mm 12mm 18mm 12mm; }
  body { background: #FFFFFF; font-size: 10.5px; color: #000; }
  .topbar, .no-print, #blazor-error-ui, .btn, .btnrow, textarea { display: none !important; }
  .print-only { display: block; }
  .page { padding: 0; max-width: none; gap: 8px; }
  .card { border: 0; padding: 0; box-shadow: none; break-inside: auto; }
  .card h2 { font-size: 13px; break-after: avoid; margin: 6px 0 4px; }
  .chart, .banner, dl.dl, .rh-grid { break-inside: avoid; }
  .grid2 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .banner { padding: 6px 10px; border-width: 1.5px; }
  .banner .big { font-size: 15px; }
  table.t { font-size: 10px; }
  table.t th, table.t td { padding: 3px 5px; }
  .input, .cell { border: 0 !important; background: none !important; padding: 0 !important; box-shadow: none !important; width: auto !important; min-width: 0 !important; font-size: 10px; color: #000; }
  select.input { appearance: none; -webkit-appearance: none; }
  .tablewrap { max-height: none !important; overflow: visible !important; }
  .chip { border: 1px solid #999; }
  .report-page { break-after: page; box-shadow: none; padding: 0; max-width: none; }
  .report-head-print { margin-bottom: 6px; }
  label.tiny:has(> input[type=checkbox]:not(:checked)) { display: none !important; }
  input[type=date] { display: none !important; }
  .print-date { display: inline !important; }
  /* Report pass (28 Nov 2026): compact entry grids, readable charts, no checkboxes, guide at the end. */
  html { background: #FFFFFF !important; }
  table.t th, table.t td { font-size: 9.5px !important; line-height: 1.35; }
  table.t th[scope=row] { font-weight: 600; }
  .hint, .small, .tiny { font-size: 9px !important; }
  .note { font-size: 9.5px !important; padding: 5px 8px !important; }
  .chip { font-size: 9px !important; padding: 1px 6px !important; }
  table.t tr { break-inside: avoid; }
  section.card:not(:has(tbody tr:nth-child(14))):not(:has(.chart)) { break-inside: avoid; }
  input.input, input.cell { margin-right: 6px; }
  .guide-card.print-guide .guide-body p, .guide-card.print-guide .guide-body li { font-size: 9.5px !important; }
  input.input, input.cell, select.input { font-size: 9.5px !important; }
  dl.dl { font-size: 10px !important; }
  .ptable-card { break-inside: auto; }
  .ptable-card h2 { font-size: 13px; margin: 6px 0 4px; }
  .ptable { display: grid; gap: 4mm; align-items: start; }
  .ptab { width: 100%; border-collapse: collapse; font-size: 8.5px; }
  .ptab th { text-align: left; font-weight: 600; border-bottom: 1px solid #999; padding: 1px 3px; }
  .ptab td { padding: 1px 3px; border-bottom: 1px solid #E4E9EC; white-space: nowrap; }
  .ptab tr.x td { color: #912018; }
  .ptab tr { break-inside: avoid; }
  input.input, input.cell, select.input { field-sizing: content; }
  input[type=checkbox], input[type=radio] { display: none !important; }
  input.input:placeholder-shown { display: none !important; }
  .grid2:has(.chart) { grid-template-columns: 1fr; }
  .chart { max-width: 150mm; margin: 0 auto; display: block; }
  .eval-card, .signoff, .rh-lots, .rh-settings { break-inside: avoid; }
  .guide-card.print-guide { order: 100; break-before: page; border: 0; padding: 0; }
  .guide-card.print-guide::details-content { content-visibility: visible; display: block; }
  .guide-card.print-guide summary { list-style: none; font-size: 13px; }
  .guide-card.print-guide .guide-body { font-size: 9.5px; columns: 2; column-gap: 8mm; }
  .guide-card.print-guide .guide-body h3 { font-size: 10.5px; margin: 6px 0 2px; break-after: avoid; }
  .guide-card.print-guide .guide-body p, .guide-card.print-guide .guide-body ul { margin: 0 0 4px; }
  .draft-mark { position: fixed; top: 40%; left: 0; right: 0; text-align: center; font-size: 110px; font-weight: 800; color: rgba(180, 35, 24, .09); transform: rotate(-28deg); pointer-events: none; }
}
.rh-top { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--accent); padding-bottom: 6px; }
.rh-lab { font-family: var(--display); font-size: 17px; font-weight: 700; }
.rh-dept { font-size: 11px; color: var(--ink2); }
.rh-title { text-align: right; font-weight: 600; font-size: 13px; }
.rh-no { font-family: var(--display); font-size: 15px; color: var(--accent-ink); }
.rh-grid { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 10.5px; }
.rh-grid th { text-align: left; font-weight: 600; color: var(--ink2); padding: 2px 6px 2px 0; width: 16%; vertical-align: top; }
.rh-grid td { padding: 2px 10px 2px 0; vertical-align: top; }
.rh-status { margin-top: 6px; padding: 4px 8px; border-radius: 4px; font-size: 11px; }
.rh-status.final { background: var(--accent-soft); border: 1px solid var(--accent); }
.rh-status.draft { background: var(--bad-soft); border: 1px solid var(--bad-line); color: var(--bad); }
.report-page { background: #FFFFFF; max-width: 820px; margin: 0 auto; padding: 32px 36px; box-shadow: 0 2px 10px rgba(20,33,43,.14); display: flex; flex-direction: column; gap: 12px; font-size: 12px; }
.report-head { display: flex; justify-content: space-between; gap: 10px; border-bottom: 2px solid var(--accent); padding-bottom: 8px; }
.report-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 10px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 6px; }
table.t tr.hl td { background: var(--accent-soft); font-weight: 600; }

/* Report traceability, evaluation and sign-off */
.rh-sub { font-weight: 600; font-size: 10.5px; color: var(--ink2); margin-top: 6px; }
.rh-none { font-size: 10px; color: var(--muted); }
.rh-lots { width: 100%; border-collapse: collapse; font-size: 10px; margin-top: 2px; }
.rh-lots th { text-align: left; font-weight: 600; color: var(--ink2); border-bottom: 1px solid var(--line); padding: 1px 6px 1px 0; }
.rh-lots td { padding: 1px 6px 1px 0; vertical-align: top; }
.rh-warn { color: var(--bad); font-weight: 600; }
.rh-settings { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 9.5px; margin-top: 2px; }
.eval-status { padding: 6px 10px; border-radius: 8px; font-size: 13px; }
.eval-status.prelim { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); }
.eval-status.pending { background: var(--warn-soft); border: 1px solid var(--warn-line); color: var(--warn); font-size: 12.5px; }
.signoff { margin-top: 10px; }
.signoff-row { display: flex; align-items: flex-end; gap: 8px; font-size: 11px; margin: 14px 0 6px; }
.sigline { flex: 1; border-bottom: 1px solid #000; height: 16px; }
.sigline.short { flex: .5; }
.record-card summary, .guide-card summary { cursor: pointer; }
.guide-body h3 { font-size: 14px; margin: 10px 0 4px; }
.guide-body p, .guide-body ul { margin: 0 0 6px; font-size: 13.5px; }

/* Lot ↔ run links (StudyHeader) */
.runpick{display:flex;flex-wrap:wrap;gap:4px;margin-bottom:4px}
.runchip{display:inline-flex;align-items:center;gap:3px;border:1px solid var(--line,#cbd5e1);border-radius:999px;padding:1px 8px;font-size:12px;cursor:pointer;background:#fff}
.runchip.on{background:#e0ecff;border-color:#7aa2e3}
.runchip input{margin:0}
