/* Hallmark · shape: app screen · genre: modern-minimal · theme: brand · redesign: full
 * paper: oklch(98.2% 0.041 128) · accent: oklch(22.8% 0.083 285) · display: Segoe UI Variable Display · body: Segoe UI Variable Text
 * nav: navy top bar with tabs, navy bottom tab bar under 60rem, lime marks the current tab · signature: the reading in its band (value, limit band, marker) · states: loading, empty, error, full
 * axes: light/grotesk-sans/chromatic-navy · posture: committed (navy carries the chrome; lime is the one signal on it) · modes: light+dark · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H5 E4 S5 R4 V4 · weakest: P, an instrument panel is the expected answer; the band gauge on every row argues that a reading means nothing without its limit */
/* Hallmark · waive 16 · one toast per save, naming the room or balance and its result · the technician leaves the LEEMS form on save and the board row is often below the fold on a phone */
/* Hallmark · dropped onclick="if(event.target===this)modal('')" · the #modal backdrop handler closed edit forms when a text selection ended outside the box; replaced by pointer-tracked outside clicks, and forms close only by Cancel, Save or a confirmed Esc */
/* Hallmark · dismissed 41 · .gauge .band and .panel carry no text of their own; .panel inherits --color-ink, which flips with the mode */
/* Hallmark · answered F4 · one filled primary per screen; .btn and the keypad digits are surface secondaries, the keypad's Sign in is the login screen's only primary */
/* Hallmark · answered F7 · every LEEMS field shares one recipe on purpose so a technician reads any input as an input */
@import url("./tokens.css");
@import url("./base.css");

/* ---------- document */
html { scroll-padding-top: calc(var(--bar-h) + var(--space-md)); }
body { background: var(--color-paper); color: var(--color-ink); line-height: 1.5; padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
@media (min-width: 60rem) { body { padding-bottom: 0; } }
.mono, .num { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; }
.quiet { color: var(--color-muted); }
.small { font-size: var(--text-sm); }
.container { max-width: var(--container); padding-inline: var(--gutter); }
@media (max-width: 60rem) { :root { --gutter: 24px; } }
@media (max-width: 40rem) { :root { --gutter: 16px; } }
.icon { width: 18px; height: 18px; flex-shrink: 0; }
.icon-sm { width: 16px; height: 16px; flex-shrink: 0; }

/* ---------- top bar: brand left, a floating pill of tabs in the centre, round tools and a light call to action right */
.bar { position: sticky; top: 0; z-index: var(--z-sticky-nav); color: var(--color-bar-ink); padding-top: env(safe-area-inset-top);
  background: radial-gradient(120% 140% at 50% -40%, var(--color-bar-glow), transparent 60%), linear-gradient(180deg, var(--color-bar-top), var(--color-bar));
  border-bottom: 1px solid var(--bar-rule); }
.bar-inner { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-md); min-height: var(--bar-h); padding-block: var(--space-xs); }
.brand { display: flex; align-items: center; gap: var(--space-sm); text-decoration: none; color: var(--color-bar-ink); min-width: 0; border-radius: var(--radius-control); }
.brand:focus-visible { outline: 2px solid var(--color-highlight); outline-offset: 4px; }
/* the SRDC logo sits on its own white tile, so its white background reads as intended, not as a cut-out */
.brand-logo { display: inline-flex; align-items: center; background: var(--logo-tile); border-radius: 10px; padding: var(--space-2xs) var(--space-xs); flex-shrink: 0; line-height: 0; }
.brand-logo img { height: 28px; width: auto; display: block; mix-blend-mode: multiply; }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; gap: var(--space-3xs); }
.brand-name { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-lg); white-space: nowrap; letter-spacing: 0.01em; }
/* SaLEEMS wordmark: LEEM (Lab Environment & Equipment Monitoring) lit in lime inside the name */
.wm-leem { color: var(--color-highlight); font-weight: 750; letter-spacing: 0.02em; }
/* the subtitle is never cut: it wraps on a narrow bar, and on phones it gets its own line below */
.brand-sub { font-size: var(--text-xs); color: var(--color-bar-muted); white-space: normal; text-wrap: balance; max-width: 30ch; }
@media (min-width: 75rem) { .brand-sub { white-space: nowrap; max-width: none; } }
.bar-sub-row { display: none; }
@media (max-width: 40rem) {
  .brand-text .brand-sub { display: none; }
  .bar-sub-row { display: block; font-size: var(--text-xs); color: var(--color-bar-muted); padding-bottom: var(--space-xs); margin-top: calc(-1 * var(--space-2xs)); line-height: 1.35; }
  .brand-logo img { height: 24px; } .brand-logo { padding: var(--space-2xs) var(--space-xs); border-radius: 8px; }
  .brand-name { font-size: var(--text-md); }
  .bar-inner { gap: var(--space-xs); }
}
.who { font-size: var(--text-sm); min-width: 0; }
.bar-end { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-sm); grid-column: -2; }
/* wide screens: brand | tabs | tools, with the tab pill exactly in the middle of the bar */
@media (min-width: 60rem) { .bar-inner { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); } .bar-inner > .tabs { grid-column: 2; } .bar-end { grid-column: 3; } }
.who-name { display: block; max-width: 14ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-link { display: flex; align-items: center; gap: var(--space-xs); color: inherit; text-decoration: none; border-radius: var(--radius-pill); padding: var(--space-2xs) var(--space-xs) var(--space-2xs) var(--space-2xs); min-height: 44px; transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out); }
.who-link:active { background: var(--bar-pill-active); }
@media (hover: hover) { .who-link:hover { background: var(--bar-pill-bg); border-color: var(--bar-pill-rule); } }
.who-text { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
@media (max-width: 75rem) { .who-text { display: none; } }
button.who-link { background: transparent; border: 1px solid transparent; font: inherit; cursor: pointer; }
button.who-link[aria-expanded="true"] { background: var(--bar-pill-active); border-color: var(--bar-pill-active-rule); }
.who-link:focus-visible { outline: 2px solid var(--color-highlight); outline-offset: 2px; }
.who-caret { color: var(--color-bar-muted); transition: transform var(--dur-micro) var(--ease-out); }
.who-link[aria-expanded="true"] .who-caret { transform: rotate(180deg); }

/* ---------- account menu: change PIN and log out from any page */
.who-menu { position: absolute; right: var(--gutter); top: calc(100% - var(--space-xs)); z-index: var(--z-dropdown); width: min(17rem, calc(100% - 2 * var(--gutter))); background: var(--color-surface); color: var(--color-ink); border: 1px solid var(--color-rule-strong); border-radius: var(--radius-card); box-shadow: var(--shadow-pop); padding: var(--space-2xs); display: flex; flex-direction: column; }
.who-menu[hidden] { display: none; }
.who-menu-head { display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm); border-bottom: 1px solid var(--color-rule); margin-bottom: var(--space-2xs); min-width: 0; }
.who-menu-head > div { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.who-menu-head strong { overflow-wrap: anywhere; }
.who-menu-head span:not(.avatar) { color: var(--color-muted); font-size: var(--text-xs); }
.who-menu [role="menuitem"] { display: flex; align-items: center; gap: var(--space-sm); min-height: 44px; padding: 0 var(--space-sm); border: 0; border-radius: var(--radius-control); background: transparent; color: var(--color-ink); font: inherit; font-size: var(--text-sm); text-align: left; text-decoration: none; cursor: pointer; }
.who-menu [role="menuitem"].danger { color: var(--color-error); border-top: 1px solid var(--color-rule); border-radius: 0 0 var(--radius-control) var(--radius-control); margin-top: var(--space-2xs); }
.who-menu [role="menuitem"]:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
.who-menu [role="menuitem"]:active { background: var(--color-paper-3); }
@media (hover: hover) { .who-menu [role="menuitem"]:hover { background: var(--color-paper-2); } .who-menu [role="menuitem"].danger:hover { background: var(--color-error-soft); } }

/* ---------- profile photos */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; display: inline-block; background: var(--color-paper-3); }
.avatar.sm { width: 24px; height: 24px; } .avatar.md { width: 32px; height: 32px; } .avatar.lg { width: 88px; height: 88px; }
.avatar.initials { display: inline-grid; place-items: center; background: var(--color-accent-soft); color: var(--color-accent); font-weight: 600; line-height: 1; }
.avatar.sm.initials { font-size: 10px; } .avatar.md.initials { font-size: var(--text-xs); } .avatar.lg.initials { font-size: var(--text-xl); }
.profile { display: flex; gap: var(--space-md); align-items: flex-start; margin-bottom: var(--space-lg); }
.profile > span, .login-who > span { flex-shrink: 0; display: block; line-height: 0; }
.profile-text { display: flex; flex-direction: column; gap: var(--space-2xs); min-width: 0; }
.profile-text .btnrow { margin-top: var(--space-xs); }
label.btn[aria-busy="true"] { opacity: 0.55; cursor: progress; }
input[type=file].visually-hidden:focus-visible + label, .btnrow label.btn:focus-within { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.login-who { display: flex; gap: var(--space-md); align-items: flex-end; }
.login-who .field { flex: 1; }
.login-who .avatar.lg { width: 64px; height: 64px; margin-bottom: var(--space-md); }

/* ---------- who checked it, who reviewed it */
.signoff { display: grid; grid-template-columns: 4rem auto minmax(0, 1fr); align-items: center; gap: var(--space-xs); font-size: var(--text-sm); }
.signoff + .signoff { margin-top: var(--space-2xs); }
.signoff-k { color: var(--color-muted); font-size: var(--text-xs); }
.signoff-v { color: var(--color-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.signoff .status { grid-column: 2 / -1; justify-self: start; }
.who-name { font-weight: 600; color: var(--color-bar-ink); }
.who-time { color: var(--color-bar-muted); font-size: var(--text-xs); }
.bar .avatar.initials { background: var(--color-highlight); color: var(--color-highlight-ink); }

/* ---------- live status strip: lime, above the bar; today's progress and the next deadline */
.strip { background: var(--strip-bg); color: var(--strip-ink); }
.strip-inner { display: flex; align-items: center; justify-content: center; gap: var(--space-sm) var(--space-lg); min-height: 48px; padding-block: var(--space-2xs); font-size: var(--text-sm); font-weight: 600; }
.strip-pill { display: inline-flex; align-items: center; gap: var(--space-2xs); background: var(--strip-chip); color: var(--strip-chip-ink); border-radius: var(--radius-pill); padding: var(--space-2xs) var(--space-sm); white-space: nowrap; font-size: var(--text-xs); font-weight: 700; }
.strip-pill.bad { background: var(--strip-bad); }
.strip-text { color: var(--strip-ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; border-radius: var(--space-2xs); }
.strip-chip { display: inline-flex; align-items: center; gap: var(--space-xs); background: var(--strip-chip); color: var(--strip-chip-ink); border-radius: var(--radius-control); padding: var(--space-2xs) var(--space-sm); text-decoration: none; white-space: nowrap; min-height: 32px; transition: background-color var(--dur-micro) var(--ease-out); }
.strip-chip.due { background: var(--strip-due); }
.strip-chip .num { font-weight: 700; font-size: var(--text-md); letter-spacing: 0.01em; }
@media (hover: hover) { .strip-text:hover { text-decoration: underline; } .strip-chip:hover { background: var(--color-bar-hover); } .strip-chip.due:hover { background: var(--strip-due); text-decoration: underline; } }
.strip-text:focus-visible, .strip-chip:focus-visible { outline: 2px solid var(--strip-ink); outline-offset: 2px; }
@media (max-width: 52rem) { .strip-text { display: none; } .strip-inner { justify-content: space-between; } }
.strip-chip .lbl-short { display: none; }
@media (max-width: 30rem) { .strip-chip .lbl-long { display: none; } .strip-chip .lbl-short { display: inline; } .strip-chip .icon-sm { display: none; } .strip-chip .num { font-size: var(--text-sm); } }

/* ---------- bar tools: a round outlined icon button and a light pill call to action */
.bar-actions { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-sm); }
.bar-actions:empty { display: none; }
.bar-round { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; color: var(--color-bar-ink); background: var(--bar-pill-bg); border: 1px solid var(--bar-pill-rule); text-decoration: none; transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out); }
.bar-cta { display: inline-flex; align-items: center; min-height: 44px; padding-inline: var(--space-lg); border-radius: var(--radius-pill); background: var(--bar-cta-bg); color: var(--bar-cta-ink); font-weight: 600; font-size: var(--text-sm); text-decoration: none; white-space: nowrap; transition: background-color var(--dur-micro) var(--ease-out); }
.bar-cta .cta-short { display: none; }
.bar-round:focus-visible, .bar-cta:focus-visible { outline: 2px solid var(--color-highlight); outline-offset: 2px; }
.bar-round:active { background: var(--bar-pill-active); } .bar-cta:active { background: var(--mint); }
@media (hover: hover) { .bar-round:hover { background: var(--bar-pill-active); border-color: var(--bar-pill-active-rule); } .bar-cta:hover { background: var(--bar-cta-hover); } }
@media (max-width: 60rem) { .bar-round { display: none; } }
@media (max-width: 75rem) { .bar-cta .cta-long { display: none; } .bar-cta .cta-short { display: inline; } .bar-cta { padding-inline: var(--space-md); } }
@media (max-width: 40rem) { .bar-cta { min-height: 40px; } }

/* ---------- navigation: a centred glass pill of tabs at 60rem and up, a bottom tab bar below */
.tabs { display: flex; gap: var(--space-2xs); }
.tabs a { display: flex; align-items: center; gap: var(--space-xs); min-height: var(--control-h); padding-inline: var(--space-sm); border-radius: var(--radius-control); color: var(--color-bar-muted); text-decoration: none; font-size: var(--text-sm); font-weight: 600; white-space: nowrap; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.tabs a:focus-visible { outline: 2px solid var(--color-highlight); outline-offset: 2px; }
@media (min-width: 60rem) {
  .tabs { justify-self: center; gap: var(--space-2xs); padding: var(--space-2xs); border-radius: var(--radius-pill); background: var(--bar-pill-bg); border: 1px solid var(--bar-pill-rule); }
  .tabs .icon { display: none; }
  .tabs a { color: var(--color-bar-ink); font-size: var(--text-sm); font-weight: 500; padding-inline: var(--space-md); min-height: 40px; border-radius: var(--radius-pill); border: 1px solid transparent; }
  .tabs a[aria-current="page"] { background: var(--bar-pill-active); border-color: var(--bar-pill-active-rule); font-weight: 650; }
  .tabs a:active { background: var(--bar-pill-active); }
}
@media (min-width: 60rem) and (hover: hover) { .tabs a:hover { background: var(--bar-pill-bg); color: var(--color-highlight); } .tabs a[aria-current="page"]:hover { background: var(--bar-pill-active); color: var(--color-bar-ink); } }
@media (max-width: 60rem) {
  .tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky-nav); background: var(--color-bar); justify-content: space-around; gap: 0; padding: var(--space-2xs) var(--space-2xs) calc(var(--space-2xs) + env(safe-area-inset-bottom)); }
  .tabs a { flex: 1; max-width: 140px; flex-direction: column; justify-content: center; gap: var(--space-3xs); min-height: 52px; font-size: var(--text-xs); }
  .tabs .icon { width: 22px; height: 22px; }
  .tabs a[aria-current="page"] { color: var(--color-highlight); background: var(--color-bar-active); box-shadow: inset 0 -2px 0 var(--color-highlight); }
  .tabs a:active { background: var(--color-bar-active); }
}
@media (max-width: 60rem) and (hover: hover) { .tabs a:hover { background: var(--color-bar-hover); color: var(--color-bar-ink); } }

/* ---------- page frame */
main.container { padding-top: var(--space-lg); padding-bottom: var(--space-2xl); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-sm) var(--space-lg); margin-bottom: var(--space-lg); }
.page-head h1 { font-size: var(--text-display); }
.page-head p { color: var(--color-muted); font-size: var(--text-sm); margin-top: var(--space-2xs); }
.section { margin-top: var(--space-xl); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-2xs) var(--space-md); padding-bottom: var(--space-xs); border-bottom: var(--rule-hair) solid var(--color-rule-strong); }
.section-head h2 { font-size: var(--text-section); }
.section-head p { color: var(--color-muted); font-size: var(--text-sm); }
.back { display: inline-flex; align-items: center; gap: var(--space-2xs); min-height: var(--control-h); color: var(--color-ink-2); text-decoration: none; font-size: var(--text-sm); font-weight: 600; margin-bottom: var(--space-xs); border-radius: var(--radius-control); }
@media (hover: hover) { .back:hover { color: var(--color-accent); } }

/* ---------- today: progress and counts */
.tally { display: flex; flex-direction: column; gap: var(--space-xs); min-width: min(100%, 360px); }
.tally-line { display: flex; justify-content: space-between; gap: var(--space-md); font-size: var(--text-sm); color: var(--color-ink-2); }
.tally-line strong { color: var(--color-ink); font-size: var(--text-lg); font-family: var(--font-outlier); font-variant-numeric: tabular-nums; }
.segments { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: var(--space-3xs); }
.segments span { height: 8px; border-radius: var(--space-3xs); background: var(--color-paper-3); }
.segments .ok { background: var(--color-ok); }
.segments .alert { background: var(--color-error); }
.segments .due { background: var(--color-error-soft); box-shadow: inset 0 0 0 1px var(--color-error); }
.counts { display: flex; flex-wrap: wrap; margin: 0; }
.counts div { padding-inline: var(--space-md); border-left: var(--rule-hair) solid var(--color-rule); }
.counts div:first-child { padding-left: 0; border-left: 0; }
.counts dt { font-size: var(--text-xs); color: var(--color-muted); }
.counts dd { margin: 0; font-family: var(--font-outlier); font-variant-numeric: tabular-nums; font-size: var(--text-lg); font-weight: 600; }
.counts .is-alert dd, .counts .is-due dd { color: var(--color-error); }
.counts .is-ok dd { color: var(--color-ok); }

/* ---------- notices */
.notice { display: flex; gap: var(--space-sm); align-items: flex-start; padding: var(--space-sm) var(--space-md); border-radius: var(--radius-control); font-size: var(--text-sm); margin-bottom: var(--space-sm); color: var(--color-ink); text-decoration: none; }
.notice .icon { margin-top: var(--space-3xs); }
.notice.warn { background: var(--color-warn-soft); } .notice.warn .icon { color: var(--color-warn); }
.notice.bad { background: var(--color-error-soft); } .notice.bad .icon { color: var(--color-error); }
.notice.info { background: var(--color-accent-soft); } .notice.info .icon { color: var(--color-accent); }
.notice.ok { background: var(--color-ok-soft); } .notice.ok .icon { color: var(--color-ok); }
a.notice { transition: background-color var(--dur-micro) var(--ease-out); }
@media (hover: hover) { a.notice:hover { background: var(--color-paper-3); } }

/* ---------- status */
.status { display: inline-flex; align-items: center; gap: var(--space-2xs); padding: var(--space-3xs) var(--space-xs); border-radius: var(--radius-pill); font-size: var(--text-sm); font-weight: 600; white-space: nowrap; line-height: 1.4; }
.status .icon-sm { width: 15px; height: 15px; }
/* lab colour rule: done or pass is green, due is red, out of limit or fail is solid red; each keeps its icon and word */
.status.ok { background: var(--color-ok-soft); color: var(--color-ok); }
.status.bad { background: var(--color-error-soft); color: var(--color-error); }
.status.due { background: var(--color-error-soft); color: var(--color-error); box-shadow: inset 0 0 0 1px var(--color-error); }
.status.alert { background: var(--color-error); color: var(--color-paper); }
.status.upcoming, .status.muted { background: var(--color-paper-2); color: var(--color-ink-2); }
.status.warn { background: var(--color-warn-soft); color: var(--color-warn); }

/* ---------- the board: one row per room or balance, its reading set in its band */
.board { list-style: none; margin: 0; padding: 0; }
.board li { border-bottom: var(--rule-hair) solid var(--color-rule); }
.row { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 1fr) 140px minmax(210px, 1.2fr); align-items: center; gap: var(--space-md) var(--space-lg); padding: var(--space-md) var(--space-xs); color: inherit; text-decoration: none; border-radius: var(--radius-control); transition: background-color var(--dur-micro) var(--ease-out); }
.row.bal { grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) 140px minmax(210px, 1.2fr); }
.row:active { background: var(--color-paper-3); }
@media (hover: hover) { .row:hover { background: var(--color-paper-2); } }
.row-name { display: flex; flex-direction: column; min-width: 0; }
.row-name strong { font-weight: 600; }
.row-name span { font-size: var(--text-sm); color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ident { display: flex; flex-wrap: wrap; gap: var(--space-3xs) var(--space-sm); margin-top: var(--space-2xs); font-size: var(--text-xs); color: var(--color-muted); white-space: normal !important; overflow: visible !important; }
.ident b { color: var(--color-ink-2); font-family: var(--font-outlier); font-weight: 600; font-variant-numeric: tabular-nums; }
.ident-box { background: var(--color-accent-soft); border-radius: var(--radius-control); padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-lg); color: var(--color-ink); }
.ident-box h2 { font-size: var(--text-md); max-width: none; }
.ident-box > p { font-size: var(--text-sm); color: var(--color-ink-2); margin: var(--space-3xs) 0 var(--space-sm); }
.ident-box .limits { margin: 0; padding: 0; border: 0; }
.sop-bals { list-style: none; margin: var(--space-xs) 0 0; padding: 0; font-size: var(--text-sm); }
.sop-bals li { display: flex; flex-wrap: wrap; gap: var(--space-3xs) var(--space-sm); padding: var(--space-3xs) 0; }
.sop-bals a { color: var(--sop-ink); font-weight: 700; }
.row-meta { font-size: var(--text-sm); color: var(--color-muted); display: flex; flex-direction: column; line-height: 1.35; }
.row-meta .status { align-self: flex-start; margin-top: var(--space-2xs); }
.row-act.due { color: var(--color-error); }
.row-act { font-size: var(--text-sm); font-weight: 600; color: var(--color-accent); display: inline-flex; align-items: center; gap: var(--space-2xs); }
@media (max-width: 52rem) {
  .row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-areas: "name state" "t h" "meta meta"; gap: var(--space-sm) var(--space-md); padding: var(--space-md) var(--space-2xs); }
  .row.bal { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name state" "r r" "meta meta"; }
  .row .row-name { grid-area: name; }
  .row .row-state { grid-area: state; justify-self: end; align-self: start; }
  .row .reading.t { grid-area: t; } .row .reading.h { grid-area: h; } .row.bal .reading { grid-area: r; }
  .row-meta { grid-area: meta; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--space-2xs) var(--space-sm); }
  .row-meta .status { margin-top: 0; }
}

.reading { display: flex; flex-direction: column; gap: var(--space-2xs); min-width: 0; }
.reading-value { display: flex; align-items: baseline; gap: var(--space-2xs); }
.reading-value b { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; font-size: var(--text-xl); font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.reading-value span { font-size: var(--text-sm); color: var(--color-muted); }
.reading.out .reading-value b { color: var(--color-error); }
.reading-limit { font-size: var(--text-xs); color: var(--color-muted); font-family: var(--font-outlier); font-variant-numeric: tabular-nums; }
.reading.no-rh { justify-content: center; }
.no-rh-text { font-size: var(--text-sm); color: var(--color-muted); font-weight: 600; }
.reading.blank .reading-value b { color: var(--color-rule-strong); }

.gauge { position: relative; height: 14px; max-width: 220px; }
.gauge::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 4px; border-radius: var(--radius-pill); background: var(--color-paper-3); }
.gauge .band { position: absolute; top: 5px; height: 4px; left: calc(var(--lo) * 1%); width: calc((var(--hi) - var(--lo)) * 1%); background: var(--color-band); border-radius: var(--radius-pill); }
.gauge .mark { position: absolute; top: 0; width: 3px; height: 14px; translate: -1px 0; left: calc(var(--pos) * 1%); background: var(--color-ink); border-radius: var(--space-3xs); }
.gauge .mark.out { background: var(--color-error); }
.gauge.wide { max-width: none; height: 18px; }
.gauge.wide::before, .gauge.wide .band { top: 7px; }
.gauge.wide .mark { height: 18px; }

/* ---------- forms */
.form-wrap { max-width: 720px; }
.form-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--space-md); margin-bottom: var(--space-md); }
.form-head h1 { font-size: var(--text-display); }
.form-head p { color: var(--color-muted); font-size: var(--text-sm); margin-top: var(--space-2xs); }
.panel { background: var(--color-surface); color: var(--color-ink); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); padding: var(--space-lg); }
@media (max-width: 40rem) { .panel { padding: var(--space-md); } }
.limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-sm) var(--space-lg); margin: 0 0 var(--space-lg); padding-bottom: var(--space-md); border-bottom: var(--rule-hair) solid var(--color-rule); }
.limits > div { min-width: 0; }
.limits dt { font-size: var(--text-xs); color: var(--color-muted); }
.limits dd { margin: 0; font-family: var(--font-outlier); font-variant-numeric: tabular-nums; font-weight: 600; overflow-wrap: anywhere; }
fieldset { border: 0; margin: 0 0 var(--space-lg); padding: 0; min-width: 0; }
legend { font-family: var(--font-display); font-weight: var(--display-weight); font-size: var(--text-section); padding: 0; margin-bottom: var(--space-xs); }
legend + .hint { margin: 0 0 var(--space-sm); }
.field { display: flex; flex-direction: column; gap: var(--space-2xs); margin-bottom: var(--space-md); min-width: 0; }
.field > label, .label { font-size: var(--text-sm); font-weight: 600; color: var(--color-ink-2); }
.hint { font-size: var(--text-sm); color: var(--color-muted); min-height: 1lh; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--space-md); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--space-md); }
@media (max-width: 34rem) { .grid-3 { grid-template-columns: minmax(0, 1fr); } }

input[type=text], input[type=number], input[type=password], input[type=date], input[type=month], input[type=time], select, textarea {
  width: 100%; min-height: var(--control-h); padding: var(--space-xs) var(--space-sm); border: var(--rule-hair) solid var(--color-muted); border-radius: var(--radius-control);
  background: var(--color-surface); color: var(--color-ink); font-size: var(--text-md); outline: 2px solid transparent; outline-offset: -3px;
  transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out);
}
textarea { min-height: 6rem; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--color-muted); }
@media (hover: hover) { input:hover, select:hover, textarea:hover { background: var(--color-paper-2); } }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline-color: var(--color-focus); border-color: var(--color-ink-2); }
input:disabled, select:disabled, textarea:disabled { opacity: 0.55; cursor: not-allowed; }
input[aria-invalid="true"] { border-color: var(--color-error); }
.big input { min-height: 64px; font-family: var(--font-outlier); font-variant-numeric: tabular-nums; font-size: var(--text-2xl); font-weight: 600; text-align: center; }
.dev { font-size: var(--text-sm); font-family: var(--font-outlier); font-variant-numeric: tabular-nums; min-height: 1lh; display: flex; align-items: center; gap: var(--space-2xs); }
.dev.ok { color: var(--color-ok); } .dev.bad { color: var(--color-error); }

.checks { display: flex; flex-direction: column; border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-control); }
.check { display: flex; gap: var(--space-sm); align-items: center; padding: var(--space-sm) var(--space-md); min-height: 48px; cursor: pointer; border-bottom: var(--rule-hair) solid var(--color-rule); transition: background-color var(--dur-micro) var(--ease-out); }
.check:last-child { border-bottom: 0; }
@media (hover: hover) { .check:hover { background: var(--color-paper-2); } }
.check input { width: 20px; height: 20px; accent-color: var(--color-accent); flex-shrink: 0; margin: 0; }
.check span { font-size: var(--text-md); }
.check small { color: var(--color-muted); }
.check.inline { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-control); min-height: var(--control-h); padding-block: var(--space-xs); }

.verdict { display: flex; gap: var(--space-sm); align-items: flex-start; border-radius: var(--radius-control); padding: var(--space-md); margin: var(--space-xs) 0 var(--space-lg); background: var(--color-paper-2); color: var(--color-ink-2); }
.verdict.ok { background: var(--color-ok-soft); color: var(--color-ink); } .verdict.ok .icon { color: var(--color-ok); }
.verdict.bad { background: var(--color-error-soft); color: var(--color-ink); } .verdict.bad .icon { color: var(--color-error); }
.verdict strong { font-size: var(--text-lg); }
.verdict .figs { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; font-size: var(--text-sm); }
.action-field > label { color: var(--color-error); }
.fine { font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-sm); }

/* ---------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: var(--control-h); padding: 0 var(--space-md); border-radius: var(--radius-control); border: var(--rule-hair) solid var(--color-rule-strong); background: var(--color-surface); color: var(--color-ink); font-weight: 600; font-size: var(--text-sm); text-decoration: none; cursor: pointer; white-space: nowrap; position: relative; transition: background-color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.btn::before { content: ""; position: absolute; inset: -2px; }
.btn.primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn.danger { color: var(--color-error); }
.btn.quiet { border-color: transparent; background: transparent; color: var(--color-ink-2); }
.btn.block { width: 100%; min-height: 52px; font-size: var(--text-md); }
.btn.sm { min-height: 32px; padding: 0 var(--space-sm); }
.btn.sm::before { inset: -6px; }
@media (hover: hover) {
  .btn:hover { background: var(--color-paper-2); border-color: var(--color-muted); }
  .btn.primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
  .btn.quiet:hover { background: var(--color-paper-2); border-color: transparent; color: var(--color-ink); }
}
.btn:active { background: var(--color-paper-3); }
.btn.primary:active { background: var(--color-accent); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; }
.btn[aria-busy="true"] { cursor: progress; }
.btnrow { display: flex; gap: var(--space-xs); flex-wrap: wrap; align-items: center; }
.btnrow .push { margin-left: auto; }

/* ---------- tabs within a screen */
.seg { display: inline-flex; gap: var(--space-2xs); border-bottom: var(--rule-hair) solid var(--color-rule-strong); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { appearance: none; border: 0; background: none; padding: 0 var(--space-sm); min-height: var(--control-h); font-weight: 600; font-size: var(--text-sm); color: var(--color-ink-2); cursor: pointer; white-space: nowrap; border-radius: var(--radius-control) var(--radius-control) 0 0; box-shadow: inset 0 -2px 0 transparent; transition: color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.seg button[aria-selected="true"] { color: var(--color-accent); box-shadow: inset 0 -2px 0 var(--color-accent); }
.seg button:active { background: var(--color-paper-3); }
@media (hover: hover) { .seg button:hover { color: var(--color-ink); background: var(--color-paper-2); } }
.toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-md); }

.filters { display: flex; flex-wrap: wrap; gap: var(--space-sm); align-items: flex-end; margin: var(--space-md) 0; }
.filters .field { margin: 0; flex: 1 1 150px; }
.filters .check.inline { flex: 0 0 auto; }
.bulk { display: flex; flex-wrap: wrap; gap: var(--space-xs); align-items: center; padding: var(--space-xs) 0 var(--space-sm); }

/* ---------- tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: var(--text-sm); }
table.data th, table.data td { text-align: left; padding: var(--space-sm) var(--space-sm); border-bottom: var(--rule-hair) solid var(--color-rule); vertical-align: top; white-space: nowrap; }
table.data th { font-weight: 600; color: var(--color-ink-2); border-bottom-color: var(--color-rule-strong); font-size: var(--text-sm); }
table.data td.num, table.data td .num { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; }
table.data td.wrap { white-space: normal; min-width: 180px; }
table.data tr.click { cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
@media (hover: hover) { table.data tr.click:hover td { background: var(--color-paper-2); } }
table.data tr.click:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; }
table.data input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--color-accent); margin: 0; }
.tag { display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-xs); color: var(--color-muted); }
@media (max-width: 44rem) {
  table.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: var(--space-sm) 0; border-bottom: var(--rule-hair) solid var(--color-rule); position: relative; }
  table.stack td { border: 0; padding: var(--space-3xs) 0; display: flex; justify-content: space-between; gap: var(--space-md); white-space: normal; }
  table.stack td::before { content: attr(data-label); color: var(--color-muted); font-family: var(--font-body); }
  table.stack td.pick { justify-content: flex-start; flex-direction: row-reverse; align-items: center; padding-bottom: var(--space-2xs); }
  table.stack td.pick:empty { display: none; }
}
.empty { padding: var(--space-xl) var(--space-md); text-align: center; color: var(--color-muted); }
.empty strong { display: block; color: var(--color-ink); font-weight: 600; margin-bottom: var(--space-2xs); }
.skeleton { height: 56px; border-radius: var(--radius-control); background: var(--color-paper-2); margin-bottom: var(--space-xs); }

/* ---------- dialog */
dialog.sheet { border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); padding: 0; width: min(640px, calc(100% - var(--space-lg))); max-height: min(88dvh, 52rem); background: var(--color-surface); color: var(--color-ink); box-shadow: var(--shadow-pop); position: fixed; inset: 0; margin: auto; height: fit-content; }
dialog.sheet::backdrop { background: var(--color-scrim); }
dialog.sheet[open] { animation: sheet-in var(--dur-short) var(--ease-out); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sheet-body { padding: var(--space-lg); overflow: auto; max-height: min(88dvh, 52rem); }
.sheet-body h2 { font-size: var(--text-section); margin-bottom: var(--space-md); }
.sheet-body h3 { margin: var(--space-lg) 0 var(--space-xs); font-size: var(--text-md); }
.kv { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr); gap: var(--space-xs) var(--space-md); font-size: var(--text-sm); margin: 0; }
.kv dt { color: var(--color-muted); } .kv dd { margin: 0; }
@media (max-width: 30rem) { .kv { grid-template-columns: minmax(0, 1fr); gap: 0; } .kv dd { margin-bottom: var(--space-xs); } }
.trail { list-style: none; margin: 0; padding: 0 0 0 var(--space-md); border-left: 2px solid var(--color-rule); font-size: var(--text-sm); }
.trail li { margin-bottom: var(--space-sm); }
.trail .what { font-weight: 600; }
.sheet-actions { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: var(--space-lg); padding-top: var(--space-md); border-top: var(--rule-hair) solid var(--color-rule); }
.sheet-actions .push { margin-left: auto; }

/* ---------- toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--space-md) + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: var(--z-toast); display: flex; gap: var(--space-xs); align-items: center; background: var(--color-ink); color: var(--color-paper); padding: var(--space-sm) var(--space-md); border-radius: var(--radius-control); font-weight: 600; font-size: var(--text-sm); max-width: calc(100% - var(--space-xl)); box-shadow: var(--shadow-pop); }
.toast.bad { background: var(--color-error); color: var(--color-paper); }
@media (min-width: 60rem) { .toast { bottom: var(--space-lg); } }

/* ---------- sign in */
.auth { max-width: 380px; margin: var(--space-xl) auto 0; }
.auth h1 { font-size: var(--text-display); }
.auth > p { color: var(--color-muted); margin: var(--space-2xs) 0 var(--space-lg); font-size: var(--text-sm); }
.pins { display: flex; justify-content: center; gap: var(--space-sm); margin: var(--space-lg) 0; }
.pins i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--color-muted); }
.pins i.f { background: var(--color-accent); border-color: var(--color-accent); }
.keypad { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
.keypad button { min-height: 56px; border-radius: var(--radius-control); border: var(--rule-hair) solid var(--color-rule); background: var(--color-surface); color: var(--color-ink); font-family: var(--font-outlier); font-variant-numeric: tabular-nums; font-size: var(--text-xl); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out); }
.keypad button.word { font-family: var(--font-body); font-size: var(--text-sm); font-weight: 600; }
.keypad button.go { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.keypad button:active { background: var(--color-paper-3); }
.keypad button.go:active { background: var(--color-accent-hover); }
@media (hover: hover) { .keypad button:hover { background: var(--color-paper-2); } .keypad button.go:hover { background: var(--color-accent-hover); } }

/* ---------- admin */
.admin-grid { display: grid; gap: var(--space-xl); grid-template-columns: minmax(0, 1fr); }
.settings { max-width: 640px; }
.settings h2 { font-size: var(--text-section); margin-bottom: var(--space-sm); }
.divider { border: 0; border-top: var(--rule-hair) solid var(--color-rule); margin: var(--space-xl) 0; }

/* ---------- trend charts: one measure per chart, the limit as a shaded band, values in a tooltip and a table */
.chart-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); margin-top: var(--space-md); }
@media (max-width: 52rem) { .chart-pair { grid-template-columns: minmax(0, 1fr); } }
.chart-card { margin: 0; background: var(--color-surface); border: var(--rule-hair) solid var(--color-rule); border-radius: var(--radius-card); padding: var(--space-md); min-width: 0; color: var(--color-ink); }
.chart-card figcaption { display: flex; flex-direction: column; gap: var(--space-3xs); margin-bottom: var(--space-xs); }
.chart-card figcaption strong { font-size: var(--text-md); }
.chart-card figcaption span { font-size: var(--text-xs); color: var(--color-muted); }
.no-rh-card { display: flex; align-items: center; background: var(--color-paper-2); border-style: dashed; }
.chart { position: relative; height: var(--chart-h); border-radius: var(--radius-control); }
.chart:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.chart-svg { display: block; overflow: visible; touch-action: pan-y; }
.chart-svg .grid { stroke: var(--color-rule); stroke-width: 1; }
.chart-svg .tick { fill: var(--color-muted); font-family: var(--font-outlier); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-svg .band { fill: var(--color-band); opacity: 0.55; }
.chart-svg .line { fill: none; stroke: var(--color-accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-svg .whisker { stroke: var(--color-muted); stroke-width: 2; stroke-linecap: round; }
.chart-svg .dot { fill: var(--color-accent); stroke: var(--color-surface); stroke-width: 2; }
.chart-svg .dot.out { fill: var(--color-error); }
.chart-svg .cross { stroke: var(--color-ink-2); stroke-width: 1; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; color: var(--color-muted); font-size: var(--text-sm); pointer-events: none; }
.chart-tip { position: absolute; top: var(--space-2xs); z-index: var(--z-tooltip); background: var(--color-surface); color: var(--color-ink); border: var(--rule-hair) solid var(--color-rule-strong); border-radius: var(--radius-control); padding: var(--space-xs) var(--space-sm); box-shadow: var(--shadow-pop); pointer-events: none; white-space: nowrap; font-size: var(--text-sm); }
.chart-tip .tip-k { color: var(--color-muted); font-size: var(--text-xs); }
.chart-tip .tip-v { font-weight: 650; font-family: var(--font-outlier); font-variant-numeric: tabular-nums; }
.chart-tip .tip-out { color: var(--color-error); font-weight: 600; font-size: var(--text-xs); }
.seg-sm button { min-height: 36px; }
.seg-sep { width: 1px; align-self: stretch; margin: var(--space-xs) var(--space-2xs); background: var(--color-rule-strong); flex-shrink: 0; }
.chart-pair.one { grid-template-columns: minmax(0, 1fr); }
.chart-svg .zero { stroke: var(--color-ink-2); stroke-width: 1; opacity: 0.5; }
.week-rooms { margin-top: var(--space-sm); }
.trend-counts { margin: var(--space-sm) 0 0; row-gap: var(--space-sm); }
.export-bar { margin-top: var(--space-lg); align-items: center; }
details.data-table { margin-top: var(--space-md); }
details.data-table summary { cursor: pointer; font-weight: 600; font-size: var(--text-sm); color: var(--color-ink-2); min-height: var(--control-h); display: flex; align-items: center; border-radius: var(--radius-control); }
details.data-table summary:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }

/* ---------- calibration SOP: bright, large and light in every mode so it reads at the bench */
.sop { --color-ink: var(--sop-ink); --color-ink-2: var(--sop-ink); --color-muted: var(--sop-muted); --color-rule: var(--mint);
  --color-surface: var(--sop-key); --color-paper-2: var(--mint); --color-paper-3: var(--mint); --color-rule-strong: var(--sop-ink);
  --color-accent: var(--navy); --color-accent-hover: var(--sop-accent-hover); --color-accent-ink: var(--pale); --color-focus: var(--blue);
  background: var(--sop-paper); color: var(--sop-ink); border-radius: var(--radius-card); padding: var(--space-lg); max-width: 860px; font-size: 1.0625rem; line-height: 1.55; }
@media (max-width: 40rem) { .sop { padding: var(--space-md); margin-inline: calc(-1 * var(--space-xs)); } }
.sop .back { color: var(--sop-ink); }
.sop-head { display: flex; justify-content: space-between; gap: var(--space-md); align-items: flex-start; margin-bottom: var(--space-md); }
.sop-head h1 { font-size: var(--text-2xl); max-width: none; color: var(--sop-ink); }
@media (max-width: 40rem) { .sop-head { flex-direction: column; } .sop-head .btn { align-self: flex-start; } }
.sop-head p { color: var(--color-muted); }
.sop-brand { font-weight: 700; color: var(--sop-ink) !important; }
.sop-bals a { color: var(--sop-ink); font-weight: 700; }
.sop-glove { display: flex; gap: var(--space-sm); align-items: flex-start; background: var(--sop-glove); color: var(--sop-ink); border: 3px solid var(--sop-ink); border-radius: var(--radius-card); padding: var(--space-md); margin: var(--space-md) 0; font-size: 1.125rem; }
.sop-glove .icon { width: 28px; height: 28px; margin-top: var(--space-3xs); }
.sop-glove strong { display: block; font-size: var(--text-xl); line-height: 1.2; margin-bottom: var(--space-2xs); }
.sop-warn { display: flex; gap: var(--space-sm); align-items: flex-start; background: var(--sop-warn); color: var(--sop-ink); border-radius: var(--radius-card); padding: var(--space-md); margin: var(--space-md) 0; font-weight: 600; }
.sop-warn .icon { width: 24px; height: 24px; }
.sop-sec { margin-top: var(--space-lg); }
.sop-sec h2 { font-size: var(--text-xl); max-width: none; color: var(--sop-ink); padding-bottom: var(--space-xs); border-bottom: 3px solid var(--sop-glove); margin-bottom: var(--space-sm); }
.sop-warm { font-size: 1.125rem; }
.sop-steps { list-style: none; counter-reset: step calc(var(--start, 1) - 1); margin: 0; padding: 0; }
.sop-steps li { counter-increment: step; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--space-sm); padding: var(--space-sm) 0; border-bottom: var(--rule-hair) solid var(--color-rule); }
.sop-steps li > * { grid-column: 2; }
.sop-steps li::before { grid-column: 1; grid-row: 1 / span 2; content: counter(step); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--sop-step); color: var(--sop-step-ink); font-weight: 800; font-size: var(--text-lg); }
.sop-steps h3 { font-size: 1.125rem; max-width: none; margin-bottom: var(--space-3xs); color: var(--sop-ink); }
.sop-steps p { max-width: none; }
.key { display: inline-block; font-family: var(--font-outlier); font-size: 0.95em; font-weight: 700; padding: 0 var(--space-xs); border: 2px solid var(--sop-ink); border-bottom-width: 4px; border-radius: var(--radius-control); background: var(--sop-key); color: var(--sop-ink); white-space: nowrap; }
.lcd { display: inline-block; font-family: var(--font-outlier); font-size: 0.95em; font-weight: 700; padding: 0 var(--space-xs); border-radius: var(--space-2xs); background: var(--sop-lcd); color: var(--sop-lcd-ink); white-space: nowrap; }
.sop-note, .sop-source { font-size: var(--text-sm); color: var(--color-muted); margin-top: var(--space-md); max-width: none; }
.sop-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-sm); max-width: 720px; }
.sop-list a { display: flex; flex-direction: column; gap: var(--space-3xs); padding: var(--space-md); border-radius: var(--radius-card); background: var(--sop-glove); color: var(--sop-ink); text-decoration: none; border: 2px solid var(--sop-ink); }
.sop-list a span { font-size: var(--text-sm); }
.sop-link { display: flex; gap: var(--space-sm); align-items: flex-start; padding: var(--space-sm) var(--space-md); margin-bottom: var(--space-sm); border-radius: var(--radius-card); background: var(--sop-glove); color: var(--sop-ink); border: 2px solid var(--sop-ink); text-decoration: none; font-size: var(--text-sm); }
.sop-link .icon { width: 22px; height: 22px; margin-top: var(--space-3xs); }
@media (hover: hover) { .sop-list a:hover, .sop-link:hover { background: var(--mint); } }
@media print { .sop { padding: 0; max-width: none; } .sop-steps li { break-inside: avoid; } }

/* ---------- monthly report: the printed log sheet keeps its own light paper */
.report-sheet { background: var(--print-paper); color: var(--print-ink); padding: var(--space-lg); border-radius: var(--radius-card); border: var(--rule-hair) solid var(--color-rule); }
.report-sheet table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); }
.report-sheet th { background: var(--print-head); color: var(--print-ink); font-weight: 600; text-align: left; }
.report-sheet td, .report-sheet th { border: var(--rule-hair) solid var(--print-rule); padding: var(--space-2xs) var(--space-xs); vertical-align: top; }
.report-sheet td.n { font-family: var(--font-outlier); font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-sheet .missing td { background: var(--print-miss); }
.report-sheet .weekend td { color: var(--print-quiet); }
.report-head { display: flex; justify-content: space-between; gap: var(--space-md); align-items: flex-start; border-bottom: 2px solid var(--print-ink); padding-bottom: var(--space-xs); margin-bottom: var(--space-sm); }
.report-head img { height: 40px; width: auto; }
.report-head h2 { font-size: var(--text-lg); max-width: none; }
.report-head .meta { text-align: right; font-size: var(--text-sm); }
.report-foot { font-size: var(--text-xs); margin-top: var(--space-xs); }
/* trend charts on the printed sheet use the sheet's own print colours in every mode */
.report-trend { margin-top: var(--space-lg); break-inside: avoid;
  --color-surface: var(--print-paper); --color-ink: var(--print-ink); --color-ink-2: var(--print-ink); --color-muted: var(--print-quiet);
  --color-rule: var(--print-rule); --color-rule-strong: var(--print-rule); --color-accent: var(--navy); --color-band: var(--mint);
  --color-error: var(--print-bad); --color-paper-2: var(--print-head); }
.report-trend h3 { font-size: var(--text-md); margin-bottom: var(--space-2xs); max-width: none; }
.report-trend .chart-pair { margin-top: var(--space-xs); gap: var(--space-sm); }
.report-trend .chart-card { padding: var(--space-xs) var(--space-sm); border-color: var(--print-rule); break-inside: avoid; }
@media print { .report-trend .chart-pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } .report-trend .chart-pair.one { grid-template-columns: minmax(0, 1fr); } .chart-tip { display: none; } }
.sign { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-xl); margin-top: var(--space-xl); font-size: var(--text-xs); }
.sign div { border-top: var(--rule-hair) solid var(--print-ink); padding-top: var(--space-2xs); }
.printed { font-size: var(--text-xs); color: var(--print-quiet); margin-top: var(--space-md); }

@media print {
  body { background: var(--print-paper); padding: 0; }
  .bar, .tabs, .noprint, .toast { display: none !important; }
  main.container { padding: 0; max-width: none; }
  .report-sheet { border: 0; padding: 0; }
  @page { size: A4 landscape; margin: 12mm; }
}
@media (prefers-reduced-motion: reduce) {
  dialog.sheet[open] { animation: none; }
  .row, .btn, .tabs a, .check, .keypad button, a.notice, input, select, textarea, .seg button, table.data tr.click { transition: none; }
}

/* ---------- about: the name, who made it, the version */
.about { max-width: 46rem; padding-bottom: var(--space-2xl); }
.about-hero { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-lg); margin-block: var(--space-sm) var(--space-lg); border-radius: var(--radius-card); color: var(--color-bar-ink);
  background: radial-gradient(120% 140% at 50% -40%, var(--color-bar-glow), transparent 60%), linear-gradient(180deg, var(--color-bar-top), var(--color-bar)); }
.about-hero .brand-logo img { height: 40px; }
.about-name { font-size: var(--text-3xl); line-height: 1.1; letter-spacing: 0.01em; color: var(--color-bar-ink); }
.about-sub { color: var(--color-bar-muted); margin-top: var(--space-2xs); }
.about-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-sm); margin-bottom: var(--space-xl); }
.about-facts > div { background: var(--color-surface); border: 1px solid var(--color-rule); border-radius: var(--radius-card); padding: var(--space-md); }
.about-facts dt { font-size: var(--text-xs); color: var(--color-muted); }
.about-facts dd { margin: 0; font-size: var(--text-lg); font-weight: 650; color: var(--color-ink); }
.about h2 { font-size: var(--text-section); margin-bottom: var(--space-sm); }
.about-list { padding-left: 1.2em; display: grid; gap: var(--space-xs); color: var(--color-ink-2); }
.auth-about { margin-top: var(--space-lg); text-align: center; font-size: var(--text-sm); }
.auth-about a { color: var(--color-muted); }
@media (max-width: 40rem) { .about-hero { flex-direction: column; align-items: flex-start; padding: var(--space-md); } .about-facts { grid-template-columns: minmax(0, 1fr); } .about-name { font-size: var(--text-2xl); } }
