/* PlateCheck. Tokens: bench ground, white sheet, green-black ink, one plate-teal accent.
   The microplate is the only expressive element; everything else stays quiet. */
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-400-italic.woff2) format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-500-normal.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url(fonts/ibm-plex-sans-latin-600-normal.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url(fonts/ibm-plex-mono-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }

:root {
  --ground: #EFF2F0; --sheet: #FFFFFF; --ink: #17201C; --muted: #5B6762; --rule: #D3DAD6; --rule-soft: #E6EBE8;
  --accent: #0B6B5C; --accent-ink: #FFFFFF; --accent-soft: #E3F0EC;
  --high: #B42318; --medium: #B25E09; --low: #7A6300; --info: #5B6762;
  --high-bg: #FCEBEA; --medium-bg: #FDF0E1; --low-bg: #F7F1D6; --ok-bg: #E5F2EA;
  --w-high: #D14B3F; --w-medium: #E09A3A; --w-low: #E3CB62; --w-ok: #BFC9C4; --well: #DCE2DF;
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif; --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --r: 6px; --step: 1.5rem;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 15px/1.55 var(--sans); font-variant-numeric: tabular-nums; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; line-height: 1.25; letter-spacing: -0.005em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .75rem; } ul, ol { margin: 0; }
.mono { font-family: var(--mono); font-size: .92em; }
.num { text-align: right; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: .82rem; margin: .5rem 0 0; }
.lede { color: var(--muted); max-width: 70ch; }

/* shell */
.app { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 20px 18px; display: flex; flex-direction: column; gap: 18px; }
#main { background: var(--sheet); border-left: 1px solid var(--rule); min-width: 0; }
/* Phones and narrow windows: the main page first, the sidebar (runs, name, links) after it */
@media (max-width: 900px) { .app { grid-template-columns: 1fr; } #main { border-left: 0; order: 1; } .side { order: 2; position: static; height: auto; border-top: 1px solid var(--rule); } }
.skip { position: absolute; left: 8px; top: -48px; z-index: 50; background: var(--sheet); padding: 6px 10px; border: 1px solid var(--rule); }
.skip:focus { top: 8px; }
#main:focus { outline: none; }
/* Touch screens: tap targets of about 40 px */
@media (pointer: coarse) {
  .btn, .sheet-pick .btn, .seg button { min-height: 40px; }
  .exp-del { width: 40px; height: 40px; }
  button.link { padding: 8px 2px; margin: -8px 0; } /* link-style buttons only; links inside sentences keep their spacing */
  .pgrid .ph { min-height: 24px; }
}
.plate-body.p384 { overflow-x: auto; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .plate-art { width: 34px; height: auto; }
.wordmark { font-size: 1.15rem; font-weight: 600; letter-spacing: -0.01em; }
/* beta label: a small outlined tag, in the accent colour, next to the name and in the home-page note */
.beta { display: inline-block; font-size: .62rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; line-height: 1;
  padding: 3px 5px 2px; border: 1px solid var(--accent); border-radius: 3px; color: var(--accent); vertical-align: middle; }
.brand .beta { align-self: center; }
.beta-note { font-size: .86rem; color: var(--muted); margin: .2rem 0 1rem; }
.beta-note .beta { margin-right: 6px; vertical-align: 1px; }
.side-actions { display: grid; gap: 8px; }
.side-h { font-size: .85rem; font-weight: 600; color: var(--muted); }
.explist { display: grid; gap: 2px; margin-top: -10px; }
.exprow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; border-radius: var(--r); }
.exprow:hover { background: rgba(23, 32, 28, .05); }
.exprow.on { background: rgba(23, 32, 28, .08); }
.exprow.on .exp-title { font-weight: 600; }
.expitem { display: grid; gap: 2px; text-align: left; border: 0; background: none; padding: 8px 4px 8px 10px; cursor: pointer; min-width: 0; color: inherit; }
.exp-del { border: 0; background: none; color: var(--muted); font-size: 1.1rem; line-height: 1; width: 28px; height: 28px; margin: 6px 4px 0 0; border-radius: var(--r); cursor: pointer; opacity: .45; }
.exprow:hover .exp-del, .exp-del:focus-visible { opacity: 1; }
.exp-del:hover { color: var(--high); background: var(--high-bg); }
@media (hover: none) { .exp-del { opacity: .8; } }
.exp-title { font-weight: 500; line-height: 1.3; }
.exp-meta { display: flex; align-items: center; gap: 10px; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.side-foot { margin-top: auto; display: grid; gap: 12px; }
.side-links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .85rem; }

/* controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 14px; border-radius: var(--r);
  border: 1px solid var(--rule); background: var(--sheet); color: var(--ink); font-weight: 500; font-size: .9rem; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #AEB9B4; background: #F7F9F8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #095A4D; }
.sheet-pick { align-items: center; gap: 6px; margin: 8px 0; }
.sheet-pick .btn { min-height: 28px; padding: 3px 10px; font-size: .85rem; }
.sheet-pick .btn.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.btn.danger { color: var(--high); border-color: #E7B8B3; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
/* File inputs stay in the tab order (keyboard users open files with Tab + Enter/Space); only the label shows. */
.btn input[type=file] { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
label.btn:focus-within, label.link:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn-row, .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn-row .btn { flex: 1 1 auto; }
.link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font-size: inherit; }
input[type=text], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; min-height: 34px; padding: 6px 10px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--sheet); }
input:hover, select:hover, textarea:hover { border-color: #AEB9B4; }
textarea { resize: vertical; line-height: 1.45; }
.field { display: grid; gap: 4px; font-size: .88rem; align-content: start; }
.field > span:first-child { font-weight: 500; }
.field small { color: var(--muted); font-size: .8rem; }
.req, .opt { margin-left: 8px; font-weight: 400; font-size: .78rem; color: var(--muted); }
.req { color: var(--accent); }
.check { display: inline-flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.form2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px 24px; max-width: 980px; }

/* status */
.status { font-size: .78rem; font-weight: 500; color: var(--muted); }
.status.review_needed { color: var(--high); }
.status.findings_present { color: var(--medium); }
.status.no_flags { color: #1D6B3A; }
.status.big { font-size: .95rem; font-weight: 600; padding-top: 6px; }

/* experiment header and steps */
.exp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 28px 40px 18px; flex-wrap: wrap; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 28px; margin: 8px 0 0; font-size: .85rem; }
.meta div { display: flex; gap: 6px; } .meta dt { color: var(--muted); } .meta dd { margin: 0; }
.steps { position: sticky; top: 0; z-index: 5; display: flex; gap: 4px; padding: 0 32px; background: var(--sheet); border-bottom: 1px solid var(--rule); overflow-x: auto; scrollbar-width: none; }
.steps::-webkit-scrollbar { display: none; }
.steps button { display: inline-flex; gap: 8px; align-items: baseline; padding: 12px 10px 10px; border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; white-space: nowrap; color: var(--muted); font-weight: 500; }
.steps button:hover { color: var(--ink); }
.steps button.on { color: var(--ink); border-bottom-color: var(--accent); }
.step-n { font-size: .78rem; color: var(--muted); }
.steps button.on .step-n { color: var(--accent); }

/* sections */
.sec { padding: 28px 40px; border-top: 1px solid var(--rule-soft); }
.steps + .sec, .flash + .sec, .error + .sec { border-top: 0; }
.sec > h2 { margin-bottom: 6px; }
.sec h3 { margin: 22px 0 8px; }
.sec.danger h2 { color: var(--high); }
.head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 14px; }
.head h2 + p { margin-top: 4px; }
.flash, #main > .error { margin: 16px 40px 0; }
.flash { padding: 10px 14px; border-radius: var(--r); background: var(--accent-soft); color: #0A4F44; border: 1px solid #BFDCD4; }
.flash.bad, .error { padding: 10px 14px; border-radius: var(--r); background: var(--high-bg); color: var(--high); border: 1px solid #EFC4BF; }
@media (max-width: 700px) { .sec, .exp-head { padding-left: 18px; padding-right: 18px; } .steps { padding: 0 10px; } .flash, #main > .error { margin: 12px 18px 0; } }

/* welcome */
.welcome { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: center; padding: 72px 56px; max-width: 1240px; }
.welcome h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); line-height: 1.12; letter-spacing: -0.02em; max-width: 16ch; margin-bottom: 18px; }
.welcome .lede { font-size: 1.05rem; color: var(--ink); max-width: 52ch; }
.how { padding-left: 1.3rem; margin: 22px 0 26px; display: grid; gap: 6px; max-width: 56ch; }
.how li::marker { color: var(--muted); }
.welcome .btn-row .btn { flex: 0 0 auto; min-width: 150px; }
.welcome-plate { margin: 0; }
.welcome-plate .plate-art { width: 100%; height: auto; display: block; }
@media (max-width: 1000px) { .welcome { grid-template-columns: 1fr; padding: 40px 24px; gap: 32px; } }

/* data import */
.drop { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 22px; border: 1.5px dashed #B9C4BF; border-radius: 10px; background: #FAFBFA; max-width: 760px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop strong { font-weight: 500; }
.filemeta { display: grid; gap: 10px; margin: 4px 0 14px; max-width: 900px; }
.filemeta .kv .mono { font-size: .78rem; color: var(--muted); word-break: break-all; }
.filemeta > b { font-weight: 600; }
.filemeta .mono { color: var(--muted); word-break: break-all; font-size: .8rem; }
.preview { display: grid; gap: 12px; padding: 18px 20px; border: 1px solid var(--rule); border-radius: var(--r); background: #FAFBFA; max-width: 980px; }
.preview.bad { border-color: #E7B8B3; background: #FFFBFA; }
.preview.bad > b { color: var(--high); }
.kv { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 4px 16px; margin: 0; font-size: .88rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: 6px; } }
.warn { padding: 8px 12px; border-radius: var(--r); background: var(--medium-bg); color: #6E3A05; font-size: .88rem; }

/* tables */
.tablewrap { overflow: auto; max-height: 560px; border: 1px solid var(--rule); border-radius: var(--r); }
.tbl { width: 100%; border-collapse: collapse; font-size: .86rem; }
.tbl th { position: sticky; top: 0; z-index: 1; background: #F4F6F5; text-align: left; font-weight: 500; color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tbl td { padding: 6px 10px; border-top: 1px solid var(--rule-soft); vertical-align: top; }
.tbl tr:first-child td { border-top: 0; }
.tbl td input, .tbl td select { min-height: 30px; padding: 3px 8px; min-width: 6.5rem; }
.tbl td small { display: block; margin-top: 2px; color: var(--medium); font-size: .76rem; }
.tbl tr.sel td { background: var(--accent-soft); }
.tbl tr.click { cursor: pointer; } .tbl tr.click:hover td { background: #F4F6F5; }
.tbl tr.diff td { background: #FFF8E8; }
.tbl tr.flag td:last-child { color: var(--medium); font-weight: 500; }

/* plate grids (2D). The plate body has the A1 corner cut, like a real microplate. */
.plate-body { display: block; width: min(600px, 100%); padding: 14px 20px 18px 12px; background: #E6EBE8; border-radius: 10px;
  clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%, 0 20px); }
.pgrid { display: grid; gap: 5px; width: 100%; }
.plate-body.p384 { width: min(860px, 100%); } .p384 .pgrid { gap: 3px; }
.pgrid .ph { border: 0; background: none; color: var(--muted); font-size: .72rem; cursor: pointer; padding: 0; border-radius: 3px; }
.pgrid .ph:hover { color: var(--ink); background: rgba(23, 32, 28, .06); }
.pc { aspect-ratio: 1; min-width: 12px; border-radius: 50%; border: 1.5px solid transparent; padding: 0; cursor: pointer; background: var(--fill, #fff); }
.pc.none { background: transparent; border-color: #C3CCC7; cursor: default; }
.pc.r-sample, .pc.r-standard { background: var(--fill, #AEB8B3); }
.pc.r-positive { background: var(--ink); }
.pc.r-ntc { background: #fff; border: 1.5px dashed var(--ink); }
.pc.r-nrt { background: #fff; border-color: var(--ink); }
.pc.r-empty { background: linear-gradient(135deg, transparent 45%, #9AA59F 45% 55%, transparent 55%), #fff; border-color: #C3CCC7; }
.pc.mixed { background: linear-gradient(90deg, var(--ink) 50%, #fff 50%); border-color: var(--ink); }
.pc.high { background: var(--w-high); } .pc.medium { background: var(--w-medium); } .pc.low { background: var(--w-low); } .pc.ok { background: var(--w-ok); }
.pc.sel { outline: 2px solid var(--accent); outline-offset: 2px; }
.pgrid .pc:not(.none):hover { outline: 2px solid #AEB8B3; outline-offset: 2px; }
.pgrid .pc.sel:hover { outline-color: var(--accent); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 0 0; font-size: .82rem; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; }
.sw { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; flex: none; }
.sw.pc { aspect-ratio: auto; min-width: 0; cursor: default; }
.sw-std { background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 22%, #fff), var(--accent)); width: 22px; border-radius: 6px; }
.bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 6px; padding: 10px 12px; background: #F4F6F5; border-radius: var(--r); }
.bulk select, .bulk input { width: auto; min-width: 10rem; }

/* findings */
.summary { display: grid; gap: 10px; }
.tally { font-size: 1.05rem; margin: 0; max-width: 70ch; }
.scope summary { cursor: pointer; color: var(--accent); font-size: .9rem; width: fit-content; }
.scope-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; font-size: .88rem; }
.scope-cols ul { padding-left: 1.1rem; } .scope-cols li { margin: 3px 0; }
@media (max-width: 800px) { .scope-cols { grid-template-columns: 1fr; } }
.split { display: grid; grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); gap: 0; padding: 0; }
.flist-col { padding: 20px 20px 28px 40px; border-right: 1px solid var(--rule-soft); min-width: 0; position: sticky; top: 46px; align-self: start; max-height: calc(100vh - 46px); overflow-y: auto; }
.detail-col { padding: 24px 40px 32px 32px; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-content: start; }
@media (max-width: 1100px) { .split { grid-template-columns: minmax(0, 1fr); } .flist-col { border-right: 0; padding: 20px 18px; position: static; max-height: none; } .detail-col { padding: 20px 18px; border-top: 1px solid var(--rule-soft); } }
.ftools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ftools input[type=search] { grid-column: 1 / -1; }
.ftools .check { grid-column: 1 / -1; }
.count { margin: 12px 0 6px; }
.flist { display: grid; gap: 1px; margin: 0 -8px; padding: 0 8px; }
.frow { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 10px; align-items: start; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: var(--r); cursor: pointer; }
.frow:hover { background: #F4F6F5; }
.frow.sel { background: var(--accent-soft); }
.frow.closed .frow-title { color: var(--muted); }
.frow-body { display: grid; gap: 1px; min-width: 0; }
.frow-title { font-weight: 500; line-height: 1.35; }
.frow-sub { font-size: .8rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow-disp { font-size: .75rem; color: #1D6B3A; padding-top: 2px; }
.sev { display: inline-block; font-size: .8rem; font-weight: 600; width: 64px; padding-top: 1px; }
.sev.high { color: var(--high); } .sev.medium { color: var(--medium); } .sev.low { color: var(--low); } .sev.info { color: var(--info); font-weight: 500; }
.pick { padding: 18px 0 0; }
.fdetail { max-width: 78ch; min-width: 0; }
.fd-head { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.fd-head h2 { font-size: 1.3rem; }
.fd-desc { font-size: 1.02rem; }
.qa { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 20px; margin: 16px 0; font-size: .92rem; }
.qa dt { color: var(--muted); } .qa dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) { .qa { grid-template-columns: 1fr; gap: 2px; } .qa dd { margin-bottom: 10px; } }
.fdetail p { max-width: 70ch; }
.fd-evidence { margin: 4px 0 16px; padding: 10px 12px; background: #F4F6F5; border-radius: var(--r); font: .84rem/1.5 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.fd-rule { font-size: .82rem; color: var(--muted); }
.review { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 12px 16px; padding: 14px 16px; background: #F7F9F8; border: 1px solid var(--rule-soft); border-radius: 8px; align-items: end; }
.review .fine { grid-column: 1 / -1; margin: 0; }
@media (max-width: 600px) { .review { grid-template-columns: minmax(0, 1fr); } }
.block h3 { margin: 0 0 10px; }
.plate3d { position: relative; width: 100%; max-width: 820px; aspect-ratio: 16 / 10; overflow: hidden; }
.plate3d canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.plate3d .pgrid { padding: 12px; }
.block .tablewrap { margin-top: 12px; max-width: 820px; }
figure { margin: 0 0 18px; max-width: 820px; }
figcaption { font-size: .82rem; color: var(--muted); margin-top: 6px; }
.chart { display: block; width: 100%; height: 230px; border: 1px solid var(--rule-soft); border-radius: var(--r); }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.seg button { border: 0; border-left: 1px solid var(--rule); background: var(--sheet); padding: 7px 18px; cursor: pointer; font-weight: 500; }
.seg button:first-child { border-left: 0; }
.seg button.on { background: var(--accent); color: #fff; }

/* report and export */
.exports { max-width: 980px; border-top: 1px solid var(--rule-soft); }
.exports .inner { display: grid; grid-template-columns: 210px minmax(0, 1fr) 190px; gap: 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.exports .inner b { font-weight: 500; } .exports .inner small { color: var(--muted); font-size: .86rem; }
.exports .inner .btn { justify-self: end; }
@media (max-width: 800px) { .exports .inner { grid-template-columns: 1fr; gap: 4px; } .exports .inner .btn { justify-self: start; } }
.report-frame { width: 100%; height: 78vh; border: 1px solid var(--rule); border-radius: 8px; background: #fff; }

/* dialogs */
dialog { border: 1px solid var(--rule); border-radius: 10px; max-width: 640px; padding: 24px 28px; color: var(--ink); box-shadow: 0 24px 60px rgba(23, 32, 28, .22); }
dialog::backdrop { background: rgba(23, 32, 28, .35); }
dialog h2 { margin-bottom: 12px; }
dialog ul { padding-left: 1.1rem; display: grid; gap: 8px; margin-bottom: 14px; }
.gloss dt { font-weight: 600; margin-top: 10px; } .gloss dd { margin: 2px 0 0; }
dialog form { margin-top: 16px; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

/* credit */
.credit p { margin: 0 0 4px; }
.credit .contributors { margin: 0 0 6px; }
.credit .contributors summary { cursor: pointer; color: var(--muted); width: fit-content; }
.credit .contributors summary:hover { color: inherit; }
.credit .contributors ul { margin: 4px 0 0; padding-left: 1.1em; }
.credit .contributors li { margin: 0 0 2px; }
.side-credit { font-size: .8rem; color: var(--muted); padding-top: 12px; border-top: 1px solid var(--rule); }
.welcome-credit { grid-column: 1 / -1; font-size: .75rem; line-height: 1.5; color: var(--muted); padding-top: 14px; border-top: 1px solid var(--rule-soft); }
.welcome-credit p { margin: 0 0 2px; }

/* label-left form rows */
.rows { display: grid; max-width: 820px; border-top: 1px solid var(--rule-soft); }
.line { display: grid; grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); gap: 6px 24px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); }
.line-l { padding-top: 6px; font-size: .9rem; }
.line-c { display: grid; gap: 4px; justify-items: start; }
.line-c > input[type=text], .line-c > input[type=date], .line-c > textarea { width: 100%; }
.line-c small { color: var(--muted); font-size: .8rem; }
.line-c .num-in { width: 7.5rem; }
.line .toggle { width: 18px; height: 18px; margin-top: 7px; accent-color: var(--accent); }
.rule-group h3 { margin: 22px 0 6px; }
/* thresholds workstream: evidence beside each setting (web/ui-variability.js) */
.why { display: grid; gap: 2px; max-width: 62ch; }
.why small { color: var(--muted); font-size: .8rem; }
.why summary { cursor: pointer; color: var(--accent); font-size: .8rem; width: max-content; }
.why details p, .why details li { font-size: .8rem; color: var(--ink); margin: 6px 0 0; }
.why details ul { margin: 4px 0 0; padding-left: 18px; }
.why details a { color: var(--accent); overflow-wrap: anywhere; }
@media (max-width: 700px) { .line { grid-template-columns: 1fr; } .line-l { padding-top: 0; } }

/* review: groups and decisions */
.fgroup { font-size: .9rem; margin: 16px 0 6px; }
.fminor { margin-top: 16px; }
.fminor > summary, .ftools-wrap > summary { cursor: pointer; color: var(--accent); font-size: .9rem; font-weight: 500; }
.fminor .flist { margin-top: 6px; }
.ftools-wrap .ftools { margin-top: 10px; }
.review { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
.rv-q { margin: 0; font-weight: 500; }
.seg.decide { flex-wrap: wrap; }
.seg.decide button { padding: 8px 16px; }
@media (max-width: 600px) { .seg.decide { display: grid; grid-template-columns: 1fr 1fr; } .seg.decide button { border-left: 0; border-top: 1px solid var(--rule); } }
.quick-note { padding: 10px 14px; border-radius: var(--r); background: var(--accent-soft); border: 1px solid #BFDCD4; color: #0A4F44; margin-bottom: 4px; }
.quick-note p { margin: 0 0 4px; }
.quick-note .row { gap: 16px; font-size: .88rem; }

/* plate: role bar */
.rolebar { margin-top: 18px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 8px; max-width: 760px; display: grid; gap: 12px; }
.rb-q { margin: 0; font-weight: 500; }
.rb-hint { margin-top: 16px; color: var(--muted); }
.seg.roles { flex-wrap: wrap; }
.rb-more input { width: 14rem; }
.map-more > summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.map-more .bulk { margin-top: 12px; }
.btn.small { min-height: 28px; padding: 3px 12px; font-size: .85rem; }
@media (max-width: 600px) { .seg.roles { display: grid; grid-template-columns: 1fr 1fr; } .seg.roles button { border-left: 0; border-top: 1px solid var(--rule); } }

.btn.big { min-height: 42px; padding: 8px 22px; font-size: 1rem; }
.other-formats { margin-top: 20px; } .other-formats > summary, .what-read > summary { cursor: pointer; color: var(--accent); font-weight: 500; }
.other-formats .exports { margin-top: 10px; }
.what-read { margin-top: 4px; } .what-read .kv { margin-top: 8px; }

/* home */
.brand { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; color: inherit; }
.home { max-width: 1180px; padding: 56px 56px 40px; }
.home-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center; }
.home h1 { font-size: clamp(1.9rem, 3.2vw, 2.6rem); line-height: 1.12; letter-spacing: -0.02em; max-width: 17ch; margin-bottom: 16px; }
.home .lede { font-size: 1.05rem; color: var(--ink); max-width: 56ch; }
.home-drop { margin: 26px 0 12px; padding: 26px 24px; border: 1.5px dashed #AEB9B4; border-radius: 10px; background: #FAFBFA; display: grid; gap: 6px; justify-items: start; max-width: 600px; }
.home-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.hd-title { margin: 0; font-size: 1.1rem; font-weight: 600; }
.hd-sub { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }
.home-drop .btn input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.home-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--rule-soft); }
.home-cols h2 { font-size: 1.05rem; margin-bottom: 10px; }
.home-cols ul, .home-cols ol { padding-left: 1.1rem; display: grid; gap: 6px; color: var(--ink); }
.home .welcome-credit { margin-top: 40px; }
@media (max-width: 1000px) { .home { padding: 32px 22px; } .home-hero { grid-template-columns: 1fr; gap: 28px; } .home-cols { grid-template-columns: 1fr; gap: 24px; } }

/* steps: More menu */
.steps { align-items: stretch; }
.tabs-main { display: flex; gap: 4px; }
.more { position: relative; margin-left: 8px; }
.more > summary { list-style: none; cursor: pointer; padding: 12px 10px 10px; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; white-space: nowrap; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: ""; display: inline-block; margin-left: 6px; border: 4px solid transparent; border-top-color: currentColor; transform: translateY(2px); }
.more.on > summary { color: var(--ink); border-bottom-color: var(--accent); }
.more-menu { position: absolute; right: 0; top: 100%; z-index: 10; min-width: 270px; background: var(--sheet); border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 12px 30px rgba(23, 32, 28, .14); padding: 6px; display: grid; }
.more-menu button { text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: var(--r); cursor: pointer; }
.more-menu button:hover, .more-menu button.on { background: #F4F6F5; }
.steps { overflow: visible; flex-wrap: wrap; } /* visible for the More menu; wrap so a long step list never runs off the page */
.tabs-main { flex-wrap: wrap; }
@media (max-width: 700px) { .more-menu { left: 0; right: auto; min-width: 0; width: max-content; max-width: calc(100vw - 28px); } .more { margin-left: 0; } }

/* what's next */
.nextbar { padding: 12px 40px; border-bottom: 1px solid var(--rule-soft); background: #F8FAF9; }
.nb-main { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.nb-label { font-weight: 600; color: var(--accent); }
.nb-text { font-weight: 500; }
.nb-all { margin-left: auto; font-size: .88rem; }
.nb-all > summary { cursor: pointer; color: var(--muted); }
.nb-all ul { list-style: none; padding: 8px 0 0; margin: 0; display: grid; gap: 4px; }
.nb-all li::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; border: 1.5px solid #AEB8B3; border-radius: 3px; vertical-align: -1px; }
.nb-all li.done::before { background: var(--accent); border-color: var(--accent); }
.nb-all li.done .link { color: var(--muted); text-decoration: none; }
@media (max-width: 700px) { .nextbar { padding: 10px 18px; } .nb-all { margin-left: 0; } }

#main > .flash:first-child { margin: 20px 56px 0; }
@media (max-width: 1000px) { #main > .flash:first-child { margin: 16px 22px 0; } }

/* home: time saved */
.home-time { display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px; margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--rule-soft); max-width: 980px; }
.ht-row h2 { font-size: 1.05rem; margin-bottom: 6px; }
.ht-row p { margin: 0 0 6px; max-width: 46ch; }
.ht-time { font-size: 1.35rem; font-weight: 600; color: var(--ink); }
.ht-row:last-of-type .ht-time { color: var(--accent); }
.ht-sum { grid-column: 1 / -1; margin: 18px 0 0; font-weight: 500; max-width: 80ch; }
@media (max-width: 760px) { .home-time { grid-template-columns: 1fr; gap: 20px; } }

/* a warning line inside a note */
.warn-line { color: #8A4B00; font-weight: 500; }

/* wells marked Omit in the instrument */
.pc.omit { border: 2px dashed #5B6762; }

/* Review-step plate map, like an instrument plate view: round wells tinted by target (--tbg/--tfg), the Ct written in,
   and a thick ring in the colour of the worst open flag. Flat: no shadows or gradients. */
.pmap, .pmap-legend { --f-high: #D92D20; --f-medium: #EE7A0C; --f-low: #D9B40B; }
.pmap { width: 100%; max-width: 760px; container-type: inline-size; }
.pmap-body .pgrid { gap: 4px; grid-template-columns: 1.4em repeat(12, minmax(0, 1fr)) !important; }
.pmap-body.p384 .pgrid { gap: 2px; grid-template-columns: 1.4em repeat(24, minmax(0, 1fr)) !important; }
.pmap .pgrid .ph { font: 500 .7rem/1 var(--mono); color: var(--muted); padding: 2px 0; }
.pmap .pc { aspect-ratio: 1; min-width: 0; border-radius: 50%; border: 1px solid transparent; padding: 0; background: var(--tbg, #ECEBE6); color: var(--tfg, var(--ink));
  display: flex; align-items: center; justify-content: center; overflow: hidden; }
.pmap .pc .pv { font: 500 .68rem/1 var(--mono); letter-spacing: -.02em; white-space: nowrap; }
.pmap .pc.none { background: transparent; border: 1px solid #CBD3CF; cursor: default; }
/* Severity by ring shape as well as colour (colour-blind users): thick solid, dashed, dotted */
.pmap .pc.high { box-shadow: inset 0 0 0 5px var(--f-high); }
.pmap .pc.medium { box-shadow: inset 0 0 0 2px var(--f-medium); border: 2px dashed var(--f-medium); }
.pmap .pc.low { border: 2px dotted var(--f-low); }
.pmap .pgrid .pc:not(.none):hover { outline: 2px solid #9AA59F; outline-offset: 2px; }
.pmap .pc.sel, .pmap .pgrid .pc.sel:hover { outline: 2px solid var(--ink); outline-offset: 2px; }
@container (max-width: 560px) { .pmap .pc .pv { font-size: .58rem; letter-spacing: -.04em; } .pmap .pc.high, .pmap .pc.medium, .pmap .pc.low { box-shadow: inset 0 0 0 3px var(--fc, transparent); }
  .pmap .pc.high { --fc: var(--f-high); } .pmap .pc.medium { --fc: var(--f-medium); } .pmap .pc.low { --fc: var(--f-low); } }
@container (max-width: 420px) { .pmap .pc .pv { display: none; } .pmap-body .pgrid { gap: 3px; } }
.pmap-legend .sq { display: inline-block; width: 12px; height: 12px; margin-right: 7px; border-radius: 50%; background: #fff; border: 1px solid #CBD3CF; }
.pmap-legend .sq.high { border: 3px solid var(--f-high); } .pmap-legend .sq.medium { border: 2px dashed var(--f-medium); } .pmap-legend .sq.low { border: 2px dotted var(--f-low); }
.pmap-legend .sq.none { background: transparent; }
.frow-disp.stale { color: var(--medium); font-weight: 500; }
.stale-note { grid-column: 1 / -1; }
/* MIQE 2.0 checklist (Report step) */
.miqe td { vertical-align: top; }
.miqe td:nth-child(2) { width: 32%; }
.miqe textarea { width: 100%; min-width: 220px; font: inherit; font-size: .88rem; }
.miqe small { display: block; margin-top: 2px; }
details.miqe-sec { margin: 10px 0; }
details.miqe-sec > summary { cursor: pointer; font-weight: 600; }

/* Home page: four closed dropdowns (By hand or with PlateCheck / What it does / What it doesn't do / How it goes) */
.home-more { margin-top: 36px; max-width: 760px; border-top: 1px solid var(--rule-soft); }
.home-more details { border-bottom: 1px solid var(--rule-soft); }
.home-more summary { cursor: pointer; padding: 14px 4px; font-size: 1.02rem; font-weight: 600; color: var(--ink); list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.home-more summary::-webkit-details-marker { display: none; }
.home-more summary::after { content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translateY(-2px); transition: transform .15s; }
.home-more details[open] > summary::after { transform: rotate(-135deg) translateY(-2px); }
.home-more summary:hover { color: var(--accent); }
.home-more .hm-body { margin: 0 0 16px; padding-left: 1.2rem; display: grid; gap: 6px; color: var(--ink); }
.home-more div.hm-body { padding-left: 4px; }
.home-more .ht-pair { grid-template-columns: 1fr 1fr; gap: 0 32px; }
.home-more .ht-row h3 { font-size: .98rem; margin: 0 0 6px; }
.home-more .ht-row p { margin: 0 0 6px; max-width: 46ch; }
.home-more .ht-time { font-size: 1.15rem; font-weight: 600; color: var(--ink); }
.home-more .ht-row:nth-of-type(2) .ht-time { color: var(--accent); }
.home-more .ht-sum { grid-column: 1 / -1; margin: 12px 0 0; font-weight: 500; max-width: 80ch; }
@media (max-width: 760px) { .home-more .ht-pair { grid-template-columns: 1fr; gap: 16px; } }
