/* QualiCore design tokens — from the customer-experience canvas. */
:root {
  --bg: #F6F7F5; --surface: #FFFFFF; --ink: #15201C; --ink-2: #2C3833; --muted: #4F5B56;
  --border: #D9DEDB; --border-2: #ECEFED; --field: #A9B8B2;
  --teal: #0B5E52; --teal-dark: #073F37; --teal-tint: #E3EFEC; --teal-tint-2: #F2F8F6; --teal-light: #7FE0CF;
  --alert: #A63D0B; --alert-ink: #8A3109; --alert-tint: #FBEDE5; --alert-border: #E8C2AD; --alert-row: #FDF6F2;
  --amber-ink: #6B4600; --amber-tint: #FAF1DC; --amber: #8A5A00;
  --nav: #15201C; --nav-active: #26352F; --nav-ink: #C9D3CF; --nav-muted: #9FB0A9; --nav-border: #33443D;
  --sans: 'IBM Plex Sans', system-ui, sans-serif; --mono: 'IBM Plex Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 15px; line-height: 1.45; }
a { color: var(--teal); } a:hover { color: var(--teal-dark); }
button, input, select, textarea { font-family: inherit; font-size: 14px; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.app { min-height: 100vh; display: flex; flex-wrap: wrap; }
nav.main { flex: 1 1 220px; max-width: 260px; background: var(--nav); color: #E9EEEC; padding: 28px 16px; display: flex; flex-direction: column; gap: 28px; }
.logo { display: inline-block; line-height: 1; font-weight: 600; letter-spacing: -0.01em; color: #0E5E5E; white-space: nowrap; }
.logo.light { color: #FFFFFF; }
/* The Q and the C are 1.3x the other letters. The Q's svg is one glyph box: 0.712em wide, 1.3em tall, bottom on the descender line. */
.logo-q-wrap { display: inline-block; }
.logo-q { display: inline-block; width: 0.712em; height: 1.3em; vertical-align: -0.275em; overflow: visible; }
.logo-word { font-weight: 600; }
.logo-cap { font-size: 1.3em; }
.logo-word b { font-weight: 600; color: #1FA090; }
.logo.light .logo-word b { color: #7FE0CF; }
nav.main .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; font-size: 19px; font-weight: 600; letter-spacing: -0.01em; }
nav.main .links { display: flex; flex-direction: column; gap: 2px; }
nav.main a { display: block; padding: 11px 12px; border-radius: 8px; color: var(--nav-ink); text-decoration: none; font-size: 15px; }
nav.main a.active { background: var(--nav-active); color: #fff; font-weight: 500; }
nav.main .group { font-size: 12px; color: var(--nav-muted); padding: 14px 12px 4px; text-transform: uppercase; letter-spacing: .06em; }
nav.main .lab { margin-top: auto; padding: 12px; border: 1px solid var(--nav-border); border-radius: 10px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
nav.main .lab span { font-size: 12px; color: var(--nav-muted); }
nav.main select { background: var(--nav-active); color: #fff; border: 1px solid var(--nav-border); border-radius: 6px; padding: 6px; }
main { flex: 999 1 560px; min-width: 0; padding: 32px 40px 48px; display: flex; flex-direction: column; gap: 24px; }
h1 { margin: 0; font-size: 32px; font-weight: 600; }
h2 { margin: 0; font-size: 20px; font-weight: 600; }
h3 { margin: 0; font-size: 17px; font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 22px; }
.card.alert { border: 2px solid var(--alert); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.stat b { font-size: 32px; font-weight: 600; }
.status { display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: center; padding: 18px 22px; border-radius: 12px; }
.status.bad { background: var(--alert-tint); border: 1px solid var(--alert-border); color: #5C2306; }
.status.bad b { color: var(--alert-ink); font-size: 17px; }
.status.ok { background: var(--teal-tint); border: 1px solid #BFD9D2; color: var(--teal-dark); }
.status.ok b { color: var(--teal); font-size: 17px; }
.tablewrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--muted); font-size: 13px; font-weight: 500; padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 14px; border-bottom: 1px solid var(--border-2); vertical-align: top; }
tr.fail { background: var(--alert-row); }
tr.fail td:first-child { border-left: 4px solid var(--alert); }
td.num, th.num { text-align: right; font-family: var(--mono); }
.pill { display: inline-block; font-size: 13px; font-weight: 500; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill.teal { background: var(--teal-tint); color: var(--teal); }
.pill.teal-outline { background: transparent; color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.pill.amber { background: var(--amber-tint); color: var(--amber-ink); }
.pill.alert { background: var(--alert-tint); color: var(--alert-ink); }
.pill.grey { background: #E9ECEA; color: var(--ink-2); }
.pill.dark { background: var(--ink); color: #fff; }
.pass { color: var(--teal); font-weight: 500; } .fail { color: var(--alert); font-weight: 600; } .warn { color: var(--amber); font-weight: 600; }
.btn { min-height: 44px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--teal); color: #fff; font-size: 15px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.btn:disabled { background: #C9D1CD; color: #3D4844; cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); border: 1px solid var(--field); }
.btn.danger { background: var(--surface); color: var(--alert-ink); border: 1px solid var(--alert-border); }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.steps li { padding: 8px 14px; border-radius: 999px; border: 1px solid #C5CDC9; color: var(--muted); font-size: 14px; }
.steps li.done { background: var(--teal-tint); color: var(--teal); border-color: transparent; font-weight: 500; }
.steps li.current { background: var(--ink); color: #fff; border-color: transparent; font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 500; }
.field input, .field select, .field textarea { padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; background: #fff; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; align-items: start; }
.dropzone { display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 24px 28px; border: 2px dashed var(--field); border-radius: 12px; background: var(--surface); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; color: var(--muted); }
.meta strong { color: var(--ink); font-weight: 500; }
.error { padding: 12px 16px; background: var(--alert-tint); border: 1px solid var(--alert-border); color: var(--alert-ink); border-radius: 8px; }
.notice { padding: 12px 16px; background: var(--amber-tint); color: var(--amber-ink); border-radius: 8px; }
.chart svg { width: 100%; height: auto; display: block; }
.small { font-size: 13px; }
details > summary { cursor: pointer; color: var(--teal); font-weight: 500; }
@media (max-width: 720px) { main { padding: 20px 16px 40px; } nav.main { max-width: none; } }
@media (max-width: 720px) {
  nav.main { padding: 16px; gap: 12px; flex: 1 1 100%; }
  nav.main a { padding: 9px 10px; font-size: 15px; }
  nav.main .lab { margin-top: 4px; }
}

/* Help mascot (Quali the owl), guides and tours (src/help). Calm by design: it moves only when idle or speaking,
   keeps still on signing screens, and not at all for people who ask for reduced motion. */
.help-fab { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 68px; height: 68px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); box-shadow: 0 4px 14px rgba(21,32,28,.18); cursor: pointer; display: grid; place-items: center; padding: 0; }
.help-fab:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }
.mascot .mascot-body, .mascot .mascot-wing-l, .mascot .mascot-wing-r, .mascot .mascot-head, .mascot .mascot-pupils, .mascot .mascot-eyes { transform-box: view-box; }
.mascot .mascot-body { transform-origin: 32px 60px; }
.mascot .mascot-head { transform-origin: 32px 32px; transition: transform .35s ease; }
.mascot .mascot-eyes { transform-origin: 32px 28px; }
.mascot .mascot-wing-l { transform-origin: 11px 32px; }
.mascot .mascot-wing-r { transform-origin: 53px 32px; }
/* Idle: a slow bob, a blink (sometimes two), a glance to each side now and then; a head tilt when the pointer is over her. */
.mascot.idle .mascot-body { animation: mascot-bob 4s ease-in-out infinite; }
.mascot.idle .mascot-eyes, .mascot.talk .mascot-eyes, .mascot.wave .mascot-eyes { animation: mascot-blink 7s infinite; }
.mascot.idle .mascot-pupils { animation: mascot-glance 13s ease-in-out infinite; }
.help-fab:hover .mascot.idle .mascot-head, .help-fab:focus-visible .mascot.idle .mascot-head { transform: rotate(-9deg); }
/* Talk: the beak moves for a few seconds. Point: she leans in. */
.mascot.talk .mascot-mouth { animation: mascot-talk .5s ease-in-out 6; transform-origin: 32px 35.5px; transform-box: view-box; }
.mascot.point .mascot-body { transform: rotate(-8deg); }
.mascot.point .mascot-wing-r { transform: rotate(-35deg); }
/* Wave: hello, three waves of her right wing, then she settles. */
.mascot.wave .mascot-wing-r { animation: mascot-wave 2.4s ease-in-out 1 both; }
.mascot.wave .mascot-head { transform: rotate(-6deg); }
/* Happy: two small hops with a flap. */
.mascot.happy .mascot-body { animation: mascot-hop .6s ease-out 2; }
.mascot.happy .mascot-wing-l { animation: mascot-flap-l .3s ease-in-out 4; }
.mascot.happy .mascot-wing-r { animation: mascot-flap-r .3s ease-in-out 4; }
/* Concerned: one small shake of the head. */
.mascot.concerned .mascot-head { animation: mascot-shake .7s ease-in-out 1; }
/* Thinking: head tilted, the two thought bubbles pulse in turn. */
.mascot.thinking .mascot-head { transform: rotate(6deg); }
.mascot.thinking .mascot-thought circle { animation: mascot-pulse 1.2s ease-in-out infinite; }
.mascot.thinking .mascot-thought circle:last-child { animation-delay: .3s; }
/* Resting: slow breathing and a drifting "z". */
.mascot.inspect .mascot-head { transform: rotate(5deg); }
.mascot.inspect .mascot-wing-r { transform: rotate(-28deg); }
.mascot .mascot-lens { transform-box: view-box; transform-origin: 58px 56px; }
.mascot.inspect .mascot-lens { animation: mascot-sweep 5s ease-in-out infinite; }
.mascot.inspect .mascot-eyes { animation: mascot-blink 7s infinite; }
@keyframes mascot-sweep { 0%, 100% { transform: rotate(0deg); } 30% { transform: rotate(-14deg) translateY(-1px); } 60% { transform: rotate(6deg); } }
.mascot.resting .mascot-body { animation: mascot-breathe 5s ease-in-out infinite; }
.mascot.impatient .mascot-head { transform: rotate(-3deg); }
.mascot.impatient .mascot-foot-r { animation: mascot-tap 3.2s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 100%; }
.mascot.impatient .mascot-pupils { animation: mascot-glance-back 9s ease-in-out infinite; }
@keyframes mascot-tap { 0%, 80%, 100% { transform: none; } 84% { transform: translateY(-1.6px) rotate(-10deg); } 88% { transform: none; } 92% { transform: translateY(-1.6px) rotate(-10deg); } 96% { transform: none; } }
@keyframes mascot-glance-back { 0%, 70%, 100% { transform: none; } 78%, 90% { transform: translateX(4px); } }
.mascot.resting .mascot-zz { animation: mascot-zz 4s ease-in-out infinite; }
@keyframes mascot-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes mascot-blink { 0%, 44%, 48%, 92%, 95%, 97%, 100% { transform: scaleY(1); } 46%, 93.5%, 98.5% { transform: scaleY(.1); } }
@keyframes mascot-glance { 0%, 30%, 46%, 70%, 86%, 100% { transform: translateX(0); } 34%, 42% { transform: translateX(-2.2px); } 74%, 82% { transform: translateX(1.6px); } }
@keyframes mascot-talk { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.4); } }
@keyframes mascot-wave { 0% { transform: rotate(0); } 18% { transform: rotate(-150deg); } 30% { transform: rotate(-125deg); } 42% { transform: rotate(-155deg); } 54% { transform: rotate(-125deg); } 66% { transform: rotate(-150deg); } 82%, 100% { transform: rotate(0); } }
@keyframes mascot-hop { 0%, 100% { transform: translateY(0) scaleY(1); } 15% { transform: translateY(0) scaleY(.94); } 45% { transform: translateY(-5px) scaleY(1.03); } 75% { transform: translateY(0) scaleY(.97); } }
@keyframes mascot-flap-l { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(18deg); } }
@keyframes mascot-flap-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-18deg); } }
@keyframes mascot-shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-1.6px) rotate(-3deg); } 45% { transform: translateX(1.6px) rotate(3deg); } 70% { transform: translateX(-1px) rotate(-1.5deg); } }
@keyframes mascot-pulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes mascot-breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.015, 1.03); } }
@keyframes mascot-zz { 0% { opacity: 0; transform: translate(0, 2px); } 30%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(2px, -3px); } }
@media (prefers-reduced-motion: reduce) { .mascot *, .help-fab:hover .mascot * { animation: none !important; transition: none !important; } }
.help-panel { position: fixed; right: 20px; bottom: 100px; z-index: 40; width: min(400px, calc(100vw - 32px)); max-height: min(620px, calc(100vh - 120px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: 0 10px 30px rgba(21,32,28,.2); }
.help-panel header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border-2); }
.help-panel header div { display: flex; flex-direction: column; flex: 1; }
.help-x { border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.help-tabs { display: flex; border-bottom: 1px solid var(--border-2); }
.help-tabs button { flex: 1; border: 0; background: none; padding: 10px 4px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; }
.help-tabs button.on { color: var(--teal); border-bottom-color: var(--teal); font-weight: 500; }
.help-body { padding: 14px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.help-body > * { flex-shrink: 0; }
.help-body textarea, .help-search { width: 100%; padding: 9px 11px; border: 1px solid var(--field); border-radius: 8px; }
.help-article { background: var(--teal-tint-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 12px 14px; }
.help-article ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.help-article p { margin: 8px 0 0; }
.help-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.help-link { border: 0; background: none; color: var(--teal); text-align: left; padding: 4px 0; cursor: pointer; font-size: 15px; }
.help-tour { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; }
.help-tour div { display: flex; flex-direction: column; }
.help-q { border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.help-answer { background: var(--teal-tint); border-radius: 8px; padding: 8px 10px; }
.quali-sources { margin-top: 10px; border-top: 1px solid var(--border-2); padding-top: 6px; display: flex; flex-direction: column; gap: 8px; }
.quali-sources p { margin: 0; }
.quali-source blockquote { margin: 4px 0 0; padding: 4px 10px; border-left: 3px solid var(--mint, #1FA090); background: var(--surface, #fff); border-radius: 0 6px 6px 0; }
.quali-note { background: var(--teal-tint); border-radius: 8px; padding: 8px 10px; }

.help-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.help-setup-bar { flex: none; height: 8px; border-radius: 99px; background: var(--border-2); overflow: hidden; }
.help-setup-bar span { display: block; height: 100%; background: var(--teal); }
.help-setup-step .help-link { display: flex; align-items: center; gap: 10px; width: 100%; }
.help-check { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--border-2); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.help-check.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.help-article ul { margin: 6px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; }
.help-nudge { position: fixed; right: 100px; bottom: 30px; z-index: 40; width: min(300px, calc(100vw - 130px)); background: var(--surface); border: 1px solid var(--teal-light); border-radius: 14px 14px 4px 14px; padding: 14px; box-shadow: 0 6px 18px rgba(21,32,28,.16); font-size: 14px; }
.help-toast { position: fixed; right: 20px; bottom: 100px; z-index: 41; background: var(--teal-dark); color: #fff; border-radius: 10px; padding: 12px 16px; max-width: 320px; }
.tour-layer { position: fixed; inset: 0; z-index: 50; }
.tour-spot { position: fixed; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(21,32,28,.45); outline: 3px solid var(--teal-light); pointer-events: none; transition: all .2s ease; }
.tour-layer:not(:has(.tour-spot)) { background: rgba(21,32,28,.45); }
.tour-bubble { position: fixed; max-width: calc(100vw - 24px); background: var(--surface); border-radius: 14px; padding: 14px 16px; box-shadow: 0 10px 30px rgba(21,32,28,.3); display: flex; flex-direction: column; gap: 6px; }
.tour-bubble p { margin: 0; }
.tour-head { display: flex; align-items: center; gap: 8px; }
button.linkish { background: none; border: 0; padding: 0; color: var(--teal); cursor: pointer; text-align: left; font: inherit; text-decoration: underline; }
/* Welcome (signed-out) screen */
.welcome { position: relative; overflow: hidden; min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px 16px;
  background: linear-gradient(120deg, #E3F3EF, #CFEDE4, #D8EEF0, #E6F4EA, #CDE9E3, #E3F3EF); background-size: 400% 400%; animation: welcome-shift 24s ease-in-out infinite; }
/* Soft green and teal glows that drift slowly behind the card. */
.welcome::before, .welcome::after { content: ""; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; z-index: 0; }
.welcome::before { background: radial-gradient(circle, #1FA090 0%, transparent 65%); top: -30vmax; left: -20vmax; animation: welcome-drift-a 28s ease-in-out infinite alternate; }
.welcome::after { background: radial-gradient(circle, #0E5E5E 0%, transparent 65%); bottom: -35vmax; right: -25vmax; opacity: .35; animation: welcome-drift-b 34s ease-in-out infinite alternate; }
.welcome > * { position: relative; z-index: 1; }
@keyframes welcome-shift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes welcome-drift-a { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(25vw, 15vh) scale(1.15); } 100% { transform: translate(10vw, 35vh) scale(.95); } }
@keyframes welcome-drift-b { 0% { transform: translate(0, 0) scale(1); } 50% { transform: translate(-30vw, -10vh) scale(1.1); } 100% { transform: translate(-10vw, -30vh) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .welcome, .welcome::before, .welcome::after { animation: none; } }
.welcome-card { width: 100%; max-width: 480px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(6px); border: 1px solid var(--border); border-radius: 16px; padding: 44px 36px;
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; box-shadow: 0 16px 40px rgba(11, 94, 82, .12); }
.welcome-card h1 { font-size: 24px; line-height: 1.25; margin-top: 8px; }
.welcome-card p { margin: 0; }
.welcome-signin { display: inline-flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 48px; font-size: 16px; text-decoration: none; margin-top: 8px; }
.welcome-signin:hover { color: #fff; }
.welcome-foot { margin: 0; text-align: center; }
/* Get the app (public page, #/get-app) */
.welcome-applink { display: inline-flex; align-items: center; gap: 6px; }
.getapp-card { gap: 14px; padding: 36px 28px; }
.getapp-how { width: 100%; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.getapp-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.getapp-steps li { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: #fff; font-size: 15px; line-height: 1.45;
  opacity: 0; animation: getapp-in .45s ease-out forwards; }
.getapp-steps li:nth-child(2) { animation-delay: .25s; }
.getapp-steps li:nth-child(3) { animation-delay: .5s; }
.getapp-num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: #0E5E5E; color: #fff; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.getapp-ico { vertical-align: -3px; color: #0B5E52; }
.getapp-done { width: 100%; margin: 0; padding: 12px 14px; border-radius: 12px; background: #E3F3EF; color: #073F37; }
.getapp-qr { display: flex; align-items: center; gap: 14px; text-align: left; width: 100%; padding-top: 4px; }
.getapp-qr-code { flex: none; width: 112px; height: 112px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 6px; }
.getapp-qr-code svg { width: 100%; height: 100%; display: block; }
.welcome-signin .getapp-ico { color: inherit; }
.getapp-pointer { display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 14px 4px; border-radius: 14px; background: rgba(255, 255, 255, .95); box-shadow: 0 6px 18px rgba(11, 94, 82, .18);
  color: #0E5E5E; font-size: 13px; font-weight: 600; animation: getapp-bob 1.4s ease-in-out infinite; }
@keyframes getapp-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes getapp-bob { 0%, 100% { transform: none; } 50% { transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .getapp-steps li { animation: none; opacity: 1; } .getapp-pointer { animation: none; } }
@media (max-width: 480px) { .getapp-card { padding: 24px 18px; gap: 12px; } .getapp-card h1 { font-size: 22px; margin-top: 0; } .getapp-steps li { padding: 10px 12px; } }
/* Documents folder tree */
.tree-folder td { background: var(--teal-tint-2); padding: 0; }
.tree-folder-btn { all: unset; box-sizing: border-box; width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; color: var(--teal-dark); font-size: 15px; }
.tree-folder-btn:focus-visible, .tree-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: -2px; border-radius: 6px; }
.tree-chevron { width: 14px; color: var(--muted); }
.tree-cell { display: inline-flex; align-items: center; gap: 6px; }
.tree-toggle { width: 22px; height: 22px; border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; font-size: 14px; }
.tree-spacer { display: inline-block; width: 22px; }
/* Settings */
.settings { display: flex; flex-direction: column; gap: 14px; }
.settings p { margin: 4px 0 0; }
.inline-form { display: flex; flex-wrap: wrap; gap: 14px 20px; align-items: flex-end; }
.chips { display: flex; flex-wrap: wrap; gap: 6px 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; background: var(--surface); cursor: pointer; }
.chip input { margin: 0; accent-color: var(--teal); }
.cell-input { padding: 7px 9px; border: 1px solid var(--field); border-radius: 6px; width: 100%; background: #fff; }
.icon-btn { width: 28px; height: 28px; border: 1px solid var(--border); background: var(--surface); border-radius: 6px; cursor: pointer; color: var(--ink-2); }
.icon-btn:disabled { opacity: .35; cursor: default; }

/* Lab-operations screens: list filters, attachments, search, calendar */
.filterbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0 10px; }
.filterbar input:not([type="checkbox"]), .filterbar select { padding: 8px 10px; border: 1px solid var(--field); border-radius: 8px; background: #fff; }
.filterbar input:not([type="checkbox"]) { min-width: 180px; flex: 1; max-width: 340px; }
.filterbar input[type="checkbox"] { accent-color: var(--teal); }
/* plain inputs used inline in tables and lists (decision notes, pick-list editing) */
td input:not([type]), .card li input:not([type]), .card form > input:not([type]) { padding: 7px 9px; border: 1px solid var(--field); border-radius: 6px; background: #fff; }
dl.small { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 10px; }
dl.small dd { margin: 0; }
.filterbar label { display: inline-flex; gap: 4px; align-items: center; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.linkish { background: none; border: 0; padding: 0; color: var(--teal); text-decoration: underline; cursor: pointer; font: inherit; }
ul.attachments { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.navsearch { padding: 6px 14px 10px; position: relative; }
.navsearch input { width: 100%; box-sizing: border-box; min-height: 34px; border-radius: 8px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: inherit; padding: 0 10px; }
.navsearch input::placeholder { color: rgba(255,255,255,.6); }
.searchresults { list-style: none; padding: 0; margin: 0; }
.searchresults li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal .dow { font-size: 12px; color: var(--ink-2); text-align: center; padding: 4px 0; }
.cal .day { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; min-height: 92px; padding: 6px; font-size: 12px; overflow: hidden; }
.cal .day.other { opacity: .45; }
.cal .day.today { border: 2px solid var(--teal); }
.cal .day .n { font-weight: 600; margin-bottom: 4px; }
.cal .day a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; text-decoration: none; }
.cal .day a.overdue { color: var(--alert-ink); }
@media (max-width: 700px) { .cal .day { min-height: 60px; } .cal .day a { font-size: 11px; } }

/* Site switcher (click the logo): web/sites.py */
nav.main .site-switch { position: relative; padding: 0; }
nav.main .site-button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; width: 100%; padding: 6px 8px; background: none; border: 1px solid transparent; border-radius: 8px; color: inherit; font: inherit; cursor: pointer; text-align: left; }
nav.main .site-button:hover, nav.main .site-button[aria-expanded="true"] { border-color: var(--nav-border); background: var(--nav-active); }
nav.main .site-button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
nav.main .site-name { font-size: 13px; font-weight: 500; color: var(--nav-ink); letter-spacing: 0; }
nav.main .site-menu { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; min-width: 260px; background: #fff; color: #1b2a2a; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.25); padding: 6px; display: flex; flex-direction: column; }
nav.main .site-menu-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: #5b6b6b; padding: 8px 10px 4px; }
nav.main .site-menu button { display: flex; gap: 8px; align-items: flex-start; background: none; border: 0; border-radius: 8px; padding: 10px; text-align: left; font: inherit; font-size: 14px; color: inherit; cursor: pointer; }
nav.main .site-menu button:hover, nav.main .site-menu button:focus-visible { background: #e8f4f2; }
nav.main .site-menu button.current { cursor: default; }
nav.main .site-menu .tick { width: 16px; color: #0E5E5E; font-weight: 700; }
nav.main .site-menu a { color: #0E5E5E; font-size: 14px; padding: 10px; border-top: 1px solid #e3eaea; border-radius: 0; margin-top: 4px; }

/* Each site has its own menu colour (Settings > Sites), so it is clear which site you are in. */
nav.main[data-shade="teal"] { --nav: #0C3634; --nav-active: #165150; --nav-ink: #CFE6E3; --nav-muted: #9CC4BF; --nav-border: #23615E; }
nav.main[data-shade="lake"] { --nav: #13253A; --nav-active: #213B55; --nav-ink: #CFDBE6; --nav-muted: #9FB4C8; --nav-border: #2E4A66; }
nav.main[data-shade="slate"] { --nav: #22272B; --nav-active: #353C42; --nav-ink: #D3D8DC; --nav-muted: #A6AEB5; --nav-border: #444C53; }
.shade-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none; margin-top: 4px; vertical-align: -1px; border: 1px solid rgba(0,0,0,.15); background: #15201C; }
.shade-dot[data-shade="teal"] { background: #0C3634; box-shadow: inset 0 0 0 3px #1FA090; }
.shade-dot[data-shade="pine"] { background: #15201C; box-shadow: inset 0 0 0 3px #3E6B57; }
.shade-dot[data-shade="lake"] { background: #13253A; box-shadow: inset 0 0 0 3px #3F7FB0; }
.shade-dot[data-shade="slate"] { background: #22272B; box-shadow: inset 0 0 0 3px #8A949C; }

/* Profiles and permission tiers */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; flex: none; background: var(--teal-tint); color: var(--teal); font-weight: 600; border: 1px solid var(--border); }
.avatar.initials { letter-spacing: 0.02em; }
.pill.tier1 { background: var(--teal); color: #fff; }
.pill.tier2 { background: var(--teal-tint); color: var(--teal-dark); border: 1px solid var(--teal-light); }
.me-link { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; padding: 0 !important; }
.me-link:hover strong { text-decoration: underline; }
.team { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.team .card { display: flex; gap: 14px; align-items: flex-start; }
.team .card .who { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.team .card .who a { overflow-wrap: anywhere; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.tiers .card { display: flex; flex-direction: column; gap: 6px; }
.tiers ul { margin: 0; padding-left: 18px; font-size: 14px; }
.photo-edit { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.gate { max-width: 640px; margin: 40px auto; display: flex; flex-direction: column; gap: 14px; }

/* Files on records (ui.tsx Attachments) */
.att h3 { margin-bottom: 10px; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 12px; }
.att-thumb { margin: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--surface); display: flex; flex-direction: column; }
.att-thumb-img { border: 0; padding: 0; background: var(--teal-tint-2); cursor: zoom-in; aspect-ratio: 4 / 3; display: block; width: 100%; }
.att-thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-thumb figcaption { padding: 8px 10px; display: flex; flex-direction: column; gap: 4px; }
.att-name { font-weight: 500; overflow-wrap: anywhere; }
.att-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.att-list li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border-2); border-radius: 10px; flex-wrap: wrap; }
.att-list li.att-failed { border-color: var(--alert-border); background: var(--alert-row); }
.att-icon { flex: 0 0 auto; width: 42px; height: 42px; border-radius: 8px; background: var(--teal-tint); color: var(--teal); font: 600 11px "IBM Plex Mono", monospace; display: grid; place-items: center; }
.att-body { flex: 1 1 200px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.att-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.att-actions a.btn { text-decoration: none; display: inline-flex; align-items: center; }
.att-progress { display: block; height: 6px; background: var(--border-2); border-radius: 3px; overflow: hidden; max-width: 360px; }
.att-progress span { display: block; height: 100%; background: var(--teal); transition: width .2s; }
.att-removed li { opacity: .7; }
.att-remove { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.att-remove input { flex: 1 1 160px; }
.att-drop { border: 2px dashed var(--field); border-radius: 12px; padding: 14px; background: var(--teal-tint-2); }
.att-drop.over { border-color: var(--teal); background: var(--teal-tint); }
.att-drop-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
/* Full-screen picture viewer (ImageViewer in src/ui.tsx): attached photos and scanned paper logs.
   Closes with the Close button (top right, clear of the notch), a tap around the picture, a swipe down, Back or Esc. */
.image-viewer { position: fixed; inset: 0; z-index: 2000; background: rgba(10, 20, 18, .97); display: flex; flex-direction: column; color: #fff;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); animation: iv-in .15s ease-out; }
@keyframes iv-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .image-viewer { animation: none; } }
.iv-bar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; flex: none; }
.iv-title { flex: 1 1 auto; min-width: 0; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; opacity: .9; }
.iv-btn { flex: none; color: #fff; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .28); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 14px; text-decoration: none; cursor: pointer; min-height: 40px; display: inline-flex; align-items: center; }
.iv-close { flex: none; color: var(--teal-dark); background: #fff; border: 0; border-radius: 999px; padding: 8px 16px; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.iv-close span { font-size: 18px; line-height: 1; }
.iv-btn:focus-visible, .iv-close:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }
.iv-stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 4px 12px; overflow: hidden; cursor: zoom-out; overscroll-behavior: contain; }
.iv-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; background: #fff; cursor: zoom-in; transition: transform .2s ease-out; user-select: none; -webkit-user-select: none; }
.image-viewer.zoomed .iv-stage { display: block; overflow: auto; -webkit-overflow-scrolling: touch; }
.image-viewer.zoomed .iv-stage img { max-width: none; max-height: none; width: 250%; cursor: zoom-out; }
.doc-viewer { background: #3b4542; }
.dv-stage { flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: #525c59; }
.dv-pages { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px; }
.dv-pages.zoomed { align-items: flex-start; width: max-content; }
.dv-pages canvas { background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); max-width: none; }
.dv-msg { color: #fff; text-align: center; padding: 24px 16px; margin: 0; }
.dv-msg a { color: var(--teal-light); }
.dv-frame { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.iv-hint { flex: none; margin: 0; padding: 8px 12px 12px; text-align: center; font-size: 13px; opacity: .75; }
@media (min-width: 721px) { .image-viewer.zoomed .iv-stage img { width: 180%; } }
@media (max-width: 420px) { .iv-btn { padding: 8px 10px; font-size: 13px; } .iv-title { font-size: 13px; } }

/* Side menu groups (src/Nav.tsx): a heading button per kind of work, folding its pages away. */
nav.main .navgroup { display: flex; flex-direction: column; margin-top: 6px; }
nav.main .navgroup-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 9px 12px; background: none; border: 0; border-radius: 8px;
  color: var(--nav-muted); font: inherit; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; cursor: pointer; text-align: left; }
nav.main .navgroup-head:hover:not(:disabled) { color: var(--nav-ink); background: rgba(255,255,255,.04); }
nav.main .navgroup-head:focus-visible, nav.main .menu-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
nav.main .navgroup-head:disabled { cursor: default; }
nav.main .navgroup-head .chev { font-size: 16px; line-height: 1; transition: transform .15s ease; }
nav.main .navgroup-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
nav.main .navgroup-head.has-active { color: #fff; }
nav.main .navgroup-head .here { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #7FE0CF; margin-left: 8px; vertical-align: middle; }
nav.main .navgroup-items { display: flex; flex-direction: column; gap: 2px; }
nav.main .navgroup-items[hidden] { display: none; }
nav.main .navgroup-items a { padding-left: 20px; }
nav.main .menu-toggle { display: none; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; background: var(--nav-active); color: #fff; border: 1px solid var(--nav-border);
  border-radius: 8px; font: inherit; font-size: 15px; cursor: pointer; }
.navsearch-hint { display: block; font-size: 12px; color: var(--nav-muted); padding: 6px 2px 0; }
@media (prefers-reduced-motion: reduce) { nav.main .navgroup-head .chev { transition: none; } }
/* Phones: the whole menu folds behind one Menu button; groups still open and close inside it. */
@media (max-width: 720px) {
  nav.main .menu-toggle { display: flex; }
  nav.main .links { display: none; }
  nav.main .links[data-open="true"] { display: flex; }
  nav.main .navgroup-items { flex-direction: row; flex-wrap: wrap; gap: 4px; padding-left: 8px; }
  nav.main .navgroup-items a { padding-left: 10px; }
}

/* Polish pass (review of every page, 2026-11-01) */
.nowrap { white-space: nowrap; }
/* Tables inside cards scroll sideways on their own instead of pushing the whole page wider. */
.scroll-x { overflow-x: auto; max-width: 100%; }
@media (max-width: 720px) { .scroll-x > table { min-width: 560px; } }
/* Page header: the title block takes the room, buttons stay top right instead of dropping under a long description. */
.row > div:first-child:not(:only-child) { flex: 1 1 420px; min-width: 0; }
.row > div:first-child > p { margin: 6px 0 0; }
/* Link styled as a button: no underline, keeps its own colours. */
a.btn { text-decoration: none; }
a.btn.secondary:hover { color: var(--ink); border-color: var(--teal); }
.btn.secondary:hover:not(:disabled), .btn.danger:hover:not(:disabled) { border-color: var(--teal); }
.btn.danger:hover:not(:disabled) { border-color: var(--alert); }
.btn:focus-visible, a:focus-visible, .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 1px; }
/* The next thing to do on a document: teal, because nothing is wrong (orange is kept for failures). */
.card.next { border: 2px solid var(--teal); }
/* Form fields never run wider than their space (long method names in drop-downs on phones). */
.field { min-width: 0; max-width: 100%; }
.dropzone > div { min-width: 0; max-width: 100%; }
.field input, .field select, .field textarea { max-width: 100%; min-width: 0; }
input[type="file"] { max-width: 100%; font-size: 14px; }
input[type="file"]::file-selector-button { font: inherit; font-weight: 500; margin-right: 10px; padding: 7px 12px; border-radius: 6px; border: 1px solid var(--field); background: var(--surface); color: var(--ink); cursor: pointer; }
input[type="file"]::file-selector-button:hover { border-color: var(--teal); }
/* Drop-downs and boxes inside tables match the ones in forms. */
td select, td input:not([type]), td input[type="text"], td input[type="number"] { padding: 6px 8px; border: 1px solid var(--field); border-radius: 6px; background: #fff; max-width: 100%; }
/* Check boxes and their labels outside the filter bar ("Show closed", "Critical") */
input[type="checkbox"], input[type="radio"] { accent-color: var(--teal); }
label.small:has(> input[type="checkbox"]) { display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 720px) {
  h1 { font-size: 26px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 14px 16px; }
  .stat b { font-size: 26px; }
  .dropzone { padding: 16px; gap: 12px; }
  .dropzone > svg { display: none; }
  .card { padding: 16px; }
  /* The person box (and the development user picker) folds into the Menu with the links. */
  nav.main .lab { display: none; }
  nav.main:has(.links[data-open="true"]) .lab { display: flex; }
}
@media (max-width: 720px) {
  /* Quali's button is smaller on phones so it covers less of the page. */
  .help-fab { width: 54px; height: 54px; right: 12px; bottom: 12px; }
  .help-fab svg { width: 44px; height: 44px; }
  .help-panel { right: 12px; bottom: 76px; }
}
/* Pages with tabs (pages/Tabbed.tsx): the page title sits above the tabs, so each tab's own title is not repeated. */
.page-tabs { margin-top: -8px; }
.tabbed { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.tabbed > .row:first-child h1, .tabbed > .gate > h1:first-child { display: none; }
@media (max-width: 720px) { .page-tabs { overflow-x: auto; } .page-tabs button { white-space: nowrap; padding: 10px 12px; } }

/* Training videos (People and training > Training > Training videos) */
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.video-card { display: flex; gap: 14px; align-items: flex-start; color: inherit; text-decoration: none; padding: 14px 16px; }
.video-card:hover, .video-card:focus-visible { border-color: var(--teal-light); background: var(--teal-tint-2); }
.video-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.video-num { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--teal-tint); color: var(--teal); display: grid; place-items: center; font-weight: 600; }
.video-date { display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; font-size: 18px; width: 48px; height: 48px; background: var(--teal); color: #fff; }
.video-date small { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; opacity: .85; margin-bottom: 2px; }
.video-card.whats-new { border-left: 4px solid var(--teal-light); }
.video-kicker { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); }
.video-version { color: var(--teal); font-weight: 600; }
.video-updated { margin: 0 0 12px; border-left: 4px solid var(--mint, #1FA090); }
.video-section { margin-top: 22px; }
.video-section-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.video-section-head h2 { margin: 0; }
.video-section > p.small { margin: 4px 0 12px; }
.video-section.is-due { padding: 14px 16px; border: 1px solid var(--border); border-left: 4px solid var(--teal); border-radius: 10px; background: var(--teal-tint-2); }
.video-player { width: 100%; max-height: 72vh; background: #000; border-radius: 12px; display: block; }
.notice-card { border: 2px solid var(--amber-ink); background: var(--amber-tint); }
/* "Confirm it's you" before a signature (ConfirmSignature.tsx) */
.modal-backdrop { position: fixed; inset: 0; background: rgba(16, 32, 30, 0.45); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 1000; }
.modal { max-width: 480px; width: 100%; display: flex; flex-direction: column; gap: 6px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }

/* Settings changes waiting for an admin's sign-off (SettingsChanges.tsx) */
.signoff { display: flex; flex-direction: column; gap: 10px; }
.signoff p { margin: 4px 0 0; }
.signoff-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.signoff-list li { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--border-2); }
.signoff-list li:first-child { border-top: 0; }
.signoff-what { display: flex; gap: 12px; align-items: flex-start; flex: 1 1 360px; min-width: 0; }
.signoff-what .pill { margin-top: 1px; }
.signoff-summary { font-weight: 500; overflow-wrap: anywhere; }
.signoff-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.signoff-return { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; flex: 1 1 100%; }
.signoff-return .field { flex: 1 1 280px; margin: 0; }
.signoff-note { margin-top: 4px; font-size: 14px; color: var(--ink-2); }
.signoff-note.returned { color: var(--alert-ink); }
.small-h { font-size: 14px; font-weight: 600; color: var(--muted); margin-top: 6px; }

/* Tables that become one card per row on phones (METRC access register): each cell shows its column name. */
@media (max-width: 720px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody { display: block; }
  table.stack tr { display: block; padding: 12px 14px; border-bottom: 1px solid var(--border-2); }
  table.stack td { display: flex; gap: 12px; border: 0; padding: 3px 0; white-space: normal; overflow-wrap: anywhere; }
  table.stack td[data-label]::before { content: attr(data-label); flex: 0 0 92px; color: var(--muted); font: 13px/1.5 var(--sans, "IBM Plex Sans", system-ui, sans-serif); }
  table.stack td.stack-head { font-size: 16px; justify-content: space-between; align-items: center; padding-bottom: 6px; }
}
/* A short heading inside a form, grouping its fields */
.form-group-title { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--teal); margin: 6px 0 -2px; }
.phone-only { display: none; }
@media (max-width: 720px) { .phone-only { display: inline; } table.stack td.desk-only { display: none; } }
.signoff-switch { margin-top: 8px; font-size: 13px; width: fit-content; }
/* Tablets, e.g. iPad Pro (2026-11-01). Computers wider than 1100px are not touched by anything below
   unless they have a touch screen. Nav.tsx wraps the menu links and the person box in .nav-drawer. */
nav.main .nav-drawer { display: contents; }
.btn.row-x { min-height: 32px; }   /* remove-row button in Manual entry */
.nav-scrim { display: none; }
/* Upright tablet (and narrow windows) 721-1100px: the dark menu becomes a slim bar along the top, so pages
   get the full width; the Menu button slides the menu in from the left. */
@media (min-width: 721px) and (max-width: 1100px) {
  .app { flex-direction: column; flex-wrap: nowrap; }
  nav.main { position: sticky; top: 0; z-index: 45; flex: none; max-width: none; height: 64px; flex-direction: row; align-items: center; gap: 16px; padding: 0 24px; }
  nav.main .menu-toggle { display: flex; order: -1; min-height: 44px; min-width: 128px; padding: 0 14px; white-space: nowrap; }
  nav.main .site-switch { flex: none; }
  nav.main .brand { padding: 0; font-size: 17px; }
  nav.main .site-button { flex-direction: row; align-items: center; gap: 12px; padding: 6px 10px; }
  nav.main .site-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
  nav.main .navsearch { flex: 1 1 220px; max-width: 360px; margin-left: auto; padding: 0; }
  nav.main .navsearch input { min-height: 40px; }
  nav.main .navsearch-hint { position: absolute; z-index: 3; top: calc(100% + 8px); left: 0; right: 0; padding: 8px 12px; border-radius: 8px; background: var(--nav-active); border: 1px solid var(--nav-border); color: var(--nav-ink); font-size: 13px; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); }
  /* Closed = display: none, so Quali's tours (which look for hidden targets) open the menu before pointing into it. */
  nav.main .nav-drawer { display: none; flex-direction: column; gap: 24px; position: fixed; z-index: 2; top: 64px; bottom: 0; left: 0; width: 320px;
    padding: 16px 16px 24px; background: var(--nav); border-top: 1px solid var(--nav-border); overflow-y: auto; overscroll-behavior: contain;
    box-shadow: 8px 0 24px rgba(0, 0, 0, .25); }
  nav.main .nav-drawer[data-open="true"] { display: flex; animation: drawer-in .15s ease-out; }
  nav.main .nav-drawer .links { display: flex; }
  nav.main .nav-drawer .lab { margin-top: auto; }
  .nav-scrim { display: block; position: fixed; z-index: 1; inset: 64px 0 0 0; background: rgba(16, 32, 30, .45); }
  main { padding: 28px 32px 112px; }
  .help-panel { max-height: min(620px, calc(100dvh - 180px)); }
}
@keyframes drawer-in { from { opacity: 0; } to { opacity: 1; } }   /* a fade, not a slide, so Quali's tour highlight lands in the right place */
@media (prefers-reduced-motion: reduce) { nav.main .nav-drawer[data-open="true"] { animation: none; } }

/* Touch screens wider than a phone (iPad, touch laptops): fingers need bigger targets, and text boxes
   use 16px type so Safari does not zoom the page when one is tapped. Sizes only; nothing moves. */
@media (min-width: 721px) and (any-pointer: coarse) {
  main { padding-bottom: 112px; }   /* room to scroll the last row above Quali's button */
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]), select, textarea { font-size: 16px; }
  .field input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .field select, .filterbar input:not([type="checkbox"]), .filterbar select,
  .navsearch input, .help-search { min-height: 44px; }
  .navsearch input::placeholder { font-size: 14px; }
  td input:not([type="checkbox"]):not([type="radio"]), td select, .cell-input, .card li input:not([type]), .card form > input:not([type]) { min-height: 40px; }
  input[type="date"], input[type="time"], input[type="datetime-local"] { min-height: 44px; }
  input[type="date"]::-webkit-date-and-time-value { text-align: left; }
  input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; flex: none; }
  .btn.small { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .icon-btn { width: 40px; height: 40px; }
  .btn.row-x { min-height: 40px; }
  td .linkish { padding: 10px 0; }
  .tree-toggle, .tree-spacer { width: 36px; }
  .tree-toggle { height: 36px; }
  .chip { padding: 8px 12px; font-size: 14px; }
  nav.main a { padding-top: 12px; padding-bottom: 12px; }
  nav.main .navgroup-head { min-height: 44px; }
  .help-x { min-width: 44px; min-height: 44px; }
  .help-tabs button { min-height: 44px; }
  .help-link { min-height: 36px; }
  .page-tabs button { min-height: 44px; }
  details > summary { padding: 6px 0; }
}
.help-alldone { display: flex; align-items: center; gap: 10px; background: var(--teal-tint); border-radius: 10px; padding: 8px 12px; }

/* Messages between staff (src/messages/Messages.tsx), inside Quali's panel and full screen at #/messages.
   Orange is kept for failures; unread counts use the alert colour only as a small badge. */
.help-panel.messages { width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 120px)); max-height: none; }
.help-full { font-size: 13px; color: var(--teal); text-decoration: none; padding: 4px 6px; border-radius: 6px; white-space: nowrap; }
.help-full:hover { background: var(--teal-tint-2); }
.help-modes { display: flex; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border-2); }
.help-modes button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--ink-2); font-size: 14px; }
.help-modes button.on { background: var(--teal-tint); border-color: var(--teal); color: var(--teal); font-weight: 500; }
.help-modes button:last-child { flex: 0 0 auto; padding: 0 14px; }
.help-modes .chev { font-size: 11px; }
.chat-count.calm { background: var(--teal); }
/* My tasks inside Quali (2026-11-08): one big row per task, easy to tap on a phone */
.quali-tasks { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.quali-tasks a { display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; column-gap: 10px; row-gap: 3px; align-items: center; min-height: 56px; padding: 10px 12px; border: 1px solid var(--border); border-left: 4px solid var(--teal); border-radius: 10px; background: var(--surface); color: var(--ink); text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.quali-tasks a:hover, .quali-tasks a:focus-visible { background: var(--teal-tint); border-color: var(--teal); }
.quali-tasks a.overdue { border-left-color: var(--alert); }
.quali-tasks .qt-title { grid-column: 1; font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.quali-tasks .qt-meta { grid-column: 1; color: var(--ink-2); }
.quali-tasks .qt-go { grid-column: 2; grid-row: 1 / span 2; color: var(--teal); font-size: 22px; line-height: 1; }
.chat-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--alert); color: #fff; font-size: 12px; font-weight: 600; line-height: 1; }
.help-fab { overflow: visible; }
.fab-count { position: absolute; top: -4px; right: -4px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--alert); color: #fff; font-size: 13px; font-weight: 600; display: grid; place-items: center; border: 2px solid var(--surface); }
.msg-bubble-note { display: flex; flex-direction: column; gap: 4px; text-align: left; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink); }
.msg-bubble-note:hover { border-color: var(--teal); }
.msg-bubble-text { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.messenger { display: grid; grid-template-columns: minmax(240px, 320px) 1fr; height: min(720px, calc(100vh - 220px)); min-height: 440px; }
.messenger.compact { display: flex; flex-direction: column; height: auto; min-height: 0; flex: 1; overflow: hidden; }
.messenger-card { padding: 0; overflow: hidden; }
.chat-list { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--border); }
.messenger.compact .chat-list { border-right: 0; flex: 1; }
.chat-list-top { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--border-2); }
.chat-find { width: 100%; padding: 9px 11px; border: 1px solid var(--field); border-radius: 8px; }
.chat-new { justify-content: center; min-height: 40px; }
.chat-about { margin: 0; background: var(--teal-tint-2); border: 1px solid var(--teal-light); border-radius: 8px; padding: 8px 10px; }
.chat-list-items { overflow-y: auto; flex: 1; padding-bottom: 8px; }
.chat-section { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 12px 16px 4px; }
.chat-row { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 14px; border: 0; background: none; text-align: left; cursor: pointer; font: inherit; color: inherit; }
.chat-row:hover { background: var(--teal-tint-2); }
.chat-row.on { background: var(--teal-tint); }
.chat-row-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.chat-row-title { font-weight: 500; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .chat-row-title { font-weight: 600; }
.chat-row-last { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row.unread .chat-row-last { color: var(--ink-2); }
.chat-icon { flex: none; display: inline-grid; place-items: center; border-radius: 10px; background: var(--teal-tint); color: var(--teal); font-weight: 600; font-size: 14px; }
.chat-site { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 500; padding: 1px 7px; border-radius: 999px; background: #E9ECEA; color: var(--ink-2); vertical-align: 1px; }
.chat-open { display: flex; flex-direction: column; min-width: 0; min-height: 0; flex: 1; }
.chat-blank { align-items: center; justify-content: center; text-align: center; gap: 4px; padding: 24px; color: var(--ink-2); }
.chat-blank p { margin: 6px 0 0; }
.chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); min-height: 56px; }
.chat-head-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.chat-head-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-back { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 6px 2px 0; cursor: pointer; color: var(--teal); }
.chat-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; background: var(--teal-tint-2); display: flex; flex-direction: column; gap: 4px; }
.chat-empty { text-align: center; margin-top: 30px; }
.chat-earlier { align-self: center; margin-bottom: 8px; }
.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 84%; margin-top: 2px; }
.msg.mine { align-self: flex-end; align-items: flex-end; }
.msg-who { font-size: 12px; color: var(--muted); margin: 8px 0 2px 4px; font-weight: 500; }
.msg-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 14px 14px 14px 4px; padding: 8px 12px; font-size: 14px; display: flex; flex-direction: column; gap: 6px; overflow-wrap: break-word; min-width: 0; max-width: 100%; }
.msg.mine .msg-bubble { background: var(--teal); color: #fff; border-color: var(--teal); border-radius: 14px 14px 4px 14px; }
.msg-text { white-space: pre-wrap; }
.msg-record { display: flex; gap: 8px; align-items: flex-start; background: var(--surface); color: var(--ink); border: 1px solid var(--border); border-radius: 10px; padding: 7px 10px; font-size: 13px; text-decoration: none; }
.msg-record:hover { border-color: var(--teal); }
.msg-record b { color: var(--teal); font-weight: 500; }
.msg-record-kind { display: block; color: var(--muted); font-size: 12px; }
.msg-meta { font-size: 11px; color: var(--muted); margin: 2px 4px 0; }
.msg-meta .linkish { font-size: 11px; color: var(--muted); }
.msg-history { background: var(--surface); border: 1px dashed var(--border); border-radius: 8px; padding: 6px 10px; margin-top: 4px; max-width: 100%; }
.msg-day { display: flex; justify-content: center; margin: 10px 0 4px; }
.msg-day span { font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--border-2); border-radius: 999px; padding: 2px 10px; }
.chat-compose { border-top: 1px solid var(--border); padding: 10px 12px 8px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); }
.chat-compose-row { display: flex; gap: 8px; align-items: flex-end; }
.chat-compose textarea, .chat-compose-row input { flex: 1; resize: none; padding: 10px 12px; border: 1px solid var(--field); border-radius: 10px; max-height: 140px; min-height: 44px; field-sizing: content; }
.chat-compose .btn { min-height: 44px; }
.chat-hint { font-size: 11px; }
.messenger.compact .chat-hint { display: none; }
.chat-editing { background: var(--amber-tint); color: var(--amber-ink); border-radius: 8px; padding: 6px 10px; }
.chat-info { padding: 14px 16px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.chat-rename { display: flex; flex-direction: column; gap: 4px; }
.chat-people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.chat-people li { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.picker { display: flex; flex-direction: column; gap: 10px; min-height: 0; flex: 1; }
.picker-to { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; border: 1px solid var(--teal); border-radius: 8px; padding: 6px 8px; cursor: text; }
.picker-to input { flex: 1; min-width: 120px; border: 0; outline: none; padding: 4px; }
.picker-chip { border: 0; cursor: pointer; font: inherit; font-size: 13px; }
.picker-list { border: 1px solid var(--border); border-radius: 8px; overflow-y: auto; max-height: 300px; padding-bottom: 6px; }
.picker-person { display: flex; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; }
.picker-person:hover { background: var(--teal-tint-2); }
.picker-person.on { background: var(--teal-tint); }
.picker-person > span { display: flex; flex-direction: column; font-size: 14px; }
.picker-person b { font-weight: 500; }
.record-messages { display: flex; flex-direction: column; gap: 10px; }
.record-msgs { display: flex; flex-direction: column; gap: 6px; }
.record-msg { display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; font-size: 14px; color: inherit; background: var(--teal-tint-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.record-msg:hover { border-color: var(--teal-light); }
@media (max-width: 720px) {
  .messenger { grid-template-columns: 1fr; height: auto; }
  .messenger:not(.compact) .chat-open:not(.chat-blank) { min-height: 480px; }
  .messenger:not(.compact) .chat-blank { display: none; }
  .help-panel.messages { height: calc(100vh - 100px); }
}

/* Control charts (pages/Charts.tsx, pages/ControlChart.tsx): Levey-Jennings chart, time slider, chart picker. */
.cc-layout { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.cc-list tr { cursor: pointer; } .cc-list tr.on td { background: var(--teal-tint-2); box-shadow: inset 3px 0 0 var(--teal); }
.cc-list tr:hover td { background: var(--teal-tint-2); }
.cc-pick { display: none; }
.cc-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.cc-card { display: flex; flex-direction: column; gap: 14px; padding: 20px 22px 18px; }
.cc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.cc-head h2 { margin: 0 0 2px; font-size: 20px; letter-spacing: -0.01em; }
.cc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cc-stats > div { background: var(--teal-tint-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cc-stats span { font-size: 12px; color: var(--muted); }
.cc-stats b { font-size: 17px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.3; }
.cc-stats em { font-style: normal; font-size: 12px; color: var(--muted); }
.cc-stats > div.bad { background: #FDF1EC; border-color: #F3D2C4; } .cc-stats > div.bad b { color: var(--alert-ink); }
.cc { position: relative; transition: opacity .18s ease; } .cc-loading { opacity: .6; }
.cc-plot { position: relative; }
.cc-plot svg { display: block; width: 100%; height: auto; touch-action: pan-y; outline: none; font-family: var(--sans); }
.cc-plot svg:focus-visible { box-shadow: 0 0 0 3px var(--teal-light); border-radius: 6px; }
.cc-tick { font-size: 11.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.cc-unit { font-size: 12px; fill: var(--muted); font-weight: 500; }
.cc-lim { font-size: 11.5px; fill: var(--ink-2); font-weight: 500; } .cc-lim-v { fill: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.cc-flag { font-size: 11px; fill: var(--ink-2); font-weight: 500; }
.cc-tip { position: absolute; pointer-events: none; z-index: 2; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; box-shadow: 0 8px 24px rgba(21,32,28,.14); display: flex; flex-direction: column; gap: 4px; }
.cc-tip-v { font-size: 20px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1; }
.cc-tip-v span { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 6px; }
.cc-tip-d { font-size: 12.5px; color: var(--muted); }
.cc-badge { align-self: flex-start; display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 500; padding: 2px 9px; border-radius: 999px; background: var(--teal-tint); color: var(--teal-dark); }
.cc-badge.warn { background: var(--amber-tint); color: var(--amber-ink); } .cc-badge.fail { background: #FBE4DA; color: #8A2A0A; }
.cc-badge.excluded, .cc-badge.none { background: #EEF1EF; color: var(--ink-2); }
.cc-key { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12.5px; color: var(--muted); margin-top: 6px; padding-left: 4px; }
.cc-key span { display: inline-flex; align-items: center; gap: 7px; }
.cc-key i { display: inline-block; flex: none; }
.k-dot { width: 9px; height: 9px; border-radius: 50%; background: #0E5E5E; }
.k-dia { width: 8px; height: 8px; background: #B7791F; transform: rotate(45deg); border-radius: 1px; }
.k-fail { width: 10px; height: 10px; border-radius: 50%; background: #D9481F; box-shadow: 0 0 0 4px rgba(217,72,31,.16); }
.k-exc { width: 9px; height: 9px; border-radius: 50%; border: 1.5px dashed #A9B8B2; }
.k-zone { width: 16px; height: 10px; border-radius: 3px; background: rgba(31,160,144,.18); }
.k-wzone { width: 16px; height: 10px; border-radius: 3px; background: rgba(222,170,40,.24); }
.cc-nav { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border-2); padding-top: 14px; }
.cc-nav-row { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; justify-content: space-between; }
.cc-btns { display: inline-flex; gap: 6px; }
.cc-b { min-height: 38px; padding: 0 12px; font-size: 14px; }
.cc-b:disabled { opacity: .45; cursor: default; }
.cc-where { display: flex; flex-direction: column; align-items: center; font-size: 13px; line-height: 1.3; text-align: center; }
.cc-where b { font-size: 14px; font-weight: 600; color: var(--ink); }
.cc-size { flex-direction: row !important; align-items: center; gap: 8px; } .cc-size label { margin: 0; } .cc-size select { min-height: 38px; }
.ts { display: flex; flex-direction: column; gap: 4px; user-select: none; }
.ts-track { position: relative; border-radius: 9px; background: #FAFBFA; border: 1px solid var(--border-2); cursor: grab; touch-action: none; overflow: hidden; }
.ts-track:active { cursor: grabbing; } .ts-track.all { cursor: default; }
.ts-track:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }
.ts-track svg { display: block; width: 100%; height: 100%; }
.ts-brush { fill: rgba(127,224,207,.18); stroke: #0E5E5E; stroke-width: 1.5; }
.ts-grip { fill: #0E5E5E; }
.ts-ends { display: flex; justify-content: space-between; }
@media (max-width: 1100px) {
  .cc-layout { grid-template-columns: minmax(0, 1fr); }
  .cc-list { display: none; } .cc-pick { display: flex; } .cc-pick select { width: 100%; }
}
@media (max-width: 720px) {
  .cc-card { padding: 14px 12px 14px; gap: 12px; }
  .cc-head h2 { font-size: 17px; }
  .cc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .cc-stats b { font-size: 15px; }
  .cc-nav-row { justify-content: center; }
  .cc-where { order: -1; width: 100%; }
  .cc-b { padding: 0 10px; }
  .cc-key { gap: 4px 12px; font-size: 12px; }
}
/* CAPA tracker (pages/Capa.tsx): stage counts on the list, dots per row, the steps of one record, the follow-up review */
.capa-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 4px 0 14px; }
.capa-strip button { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 10px 9px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); display: flex; flex-direction: column; gap: 2px; min-height: 64px; }
.capa-strip button:hover { border-color: var(--teal-light); }
.capa-strip button.on { border: 2px solid var(--teal); background: var(--teal-tint-2); padding: 9px 9px 8px; }
.capa-strip .n { font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--teal); }
.capa-strip .l { font-size: 12px; color: var(--ink-2); }
.capa-strip .x { font-size: 11px; color: var(--alert-ink); font-weight: 600; }
.capa-strip button.late { border-color: var(--alert-border); }
@media (max-width: 900px) { .capa-strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 520px) { .capa-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.capa-dots { display: inline-flex; gap: 3px; vertical-align: middle; }
.capa-dots i { width: 10px; height: 10px; box-sizing: border-box; border-radius: 50%; background: var(--border); display: inline-block; }
.capa-dots i.done { background: var(--teal); }
.capa-dots i.now { background: var(--teal-tint); border: 2px solid var(--teal); }
.capa-dots i.late { background: var(--alert-tint); border: 2px solid var(--alert); }
@media (min-width: 1100px) { .capa-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.capa-track { list-style: none; margin: 4px 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; }
.capa-track li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 0 3px; font-size: 12px; }
.capa-track li::before { content: ""; position: absolute; top: 13px; left: -50%; width: 100%; height: 2px; background: var(--border); z-index: 0; }
.capa-track li:first-child::before { display: none; }
.capa-track li.done::before, .capa-track li.current::before { background: var(--teal); }
.capa-track .dot { position: relative; z-index: 1; width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px;
  background: var(--surface); border: 2px solid var(--border); color: var(--muted); }
.capa-track li.done .dot { background: var(--teal); border-color: var(--teal); color: #fff; }
.capa-track li.current .dot { border-color: var(--teal); color: var(--teal); box-shadow: 0 0 0 4px var(--teal-tint); }
.capa-track li.late .dot { border-color: var(--alert); color: var(--alert); box-shadow: 0 0 0 4px var(--alert-tint); }
.capa-track .lbl { font-weight: 600; color: var(--ink); line-height: 1.2; margin-top: 2px; }
.capa-track li.upcoming .lbl { color: var(--muted); font-weight: 500; }
.capa-track .when { color: var(--muted); line-height: 1.25; }
.capa-track .when.ok { color: var(--teal); font-weight: 600; }
.capa-track .when.bad { color: var(--alert-ink); font-weight: 600; }
.capa-track .ev { color: var(--teal); font-size: 11px; }
/* the tracker lays itself out by the room it has (phone, iPad portrait beside the list, desktop), not the screen size */
.capa-tracker { container-type: inline-size; }
@container (max-width: 620px) {
  .capa-track { grid-template-columns: 1fr; gap: 8px; }
  .capa-track li { flex-direction: row; flex-wrap: wrap; text-align: left; align-items: center; gap: 4px 8px; }
  .capa-track li::before { display: none; }
}
.capa-plan { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; background: var(--teal-tint-2); margin: 0; }
.capa-plan legend { font-weight: 600; padding: 0 4px; }
.capa-plan .choice { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; padding: 4px 0; }
.capa-plan .choice input { margin-top: 4px; }
.notice.ok { background: var(--teal-tint); color: var(--teal-dark); }
/* CAPA investigation toolbox */
.toolbox { display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--border-2); padding-top: 10px; }
.toolbox-add { display: flex; flex-wrap: wrap; gap: 6px; }
.tool-chip { border: 1px dashed var(--teal); background: var(--surface); color: var(--teal); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; }
.tool-chip:hover { background: var(--teal-tint-2); }
.tool-card { border: 1px solid var(--border); border-left: 4px solid var(--teal-light); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.tool-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.tool-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tool-table th { text-align: left; font-weight: 600; color: var(--ink-2); padding: 4px 6px; font-size: 12px; }
.tool-table td { padding: 3px 4px; }
.tool-table input, .tool-table select { width: 100%; box-sizing: border-box; }
.pareto-bar { display: block; height: 10px; border-radius: 3px; background: var(--teal-light); min-width: 2px; }
.capa-tools-view .tv { margin: 6px 0 0 0; } .capa-tools-view ol, .capa-tools-view ul { margin: 2px 0; padding-left: 20px; }
.att .pill { white-space: normal; display: inline-block; max-width: 100%; }
.capa-inv-head { background: none; border: 0; padding: 0; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.capa-inv-head strong { color: var(--teal); }
/* CAPA power line (pages/Capa.tsx PowerLine): poles per stage, sagging lines, Quali side-stepping across the dip */
.powerline { position: relative; height: 88px; margin: 16px 0 -26px; container-type: inline-size; }
/* Quali is sized to the space: about a third of one span between poles, never tiny, never oversized */
.pl-quali .mascot { width: clamp(30px, 8.5cqw, 44px); height: clamp(30px, 8.5cqw, 44px); }
.powerline > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pl-wire { fill: none; stroke: #C9D2CE; stroke-width: 3.5; stroke-linecap: round; }
.pl-wire.lit { stroke: var(--teal); }
.pl-pole line { stroke: #8B6B4A; stroke-width: 3; stroke-linecap: round; }
.pl-pole.upcoming line { stroke: #C9B8A6; }
.pl-quali { position: absolute; display: flex; transform: translate(-50%, -88%); line-height: 0; z-index: 2; pointer-events: none; }
.pl-quali:not(.home) { animation: pl-walk 7s ease-in-out infinite alternate; }
.pl-quali:not(.home) .mascot { animation: pl-sidestep .45s steps(2, jump-none) infinite; transform-origin: 50% 95%; }
.pl-quali.home { transform: translate(-50%, -96%); }
@keyframes pl-walk { 0% { left: var(--a-x); top: var(--a-y); } 50% { left: var(--m-x); top: var(--m-y); } 100% { left: var(--b-x); top: var(--b-y); } }
@keyframes pl-sidestep { 0% { transform: rotate(-5deg) translateY(0); } 100% { transform: rotate(5deg) translateY(-1.5px); } }
.capa-track.powered li::before { display: none; }
.capa-track.powered .dot { width: 22px; height: 22px; font-size: 11px; }
@media (prefers-reduced-motion: reduce) { .pl-quali, .pl-quali .mascot { animation: none !important; } }
@media (max-width: 1100px) { .powerline { height: 76px; margin-bottom: -22px; } }
@container (max-width: 620px) { .powerline { height: 62px; margin: 10px 0 2px; } .pl-wire { stroke-width: 3; } }

/* Evidence drawn inside another card (complaints: Investigation and resolution) */
.att-inline { border-top: 1px solid var(--border-2); padding-top: 12px; margin-top: 4px; }
.att-inline h3 { font-size: 1rem; margin: 0 0 4px; }
.att-intro { margin: 0 0 10px; }
/* call recordings and other sound files play on the page */
.att-audio { flex: 1 1 100%; width: 100%; min-width: 0; height: 40px; }
/* SOP check (pages/SopCheck.tsx): one card per difference, "the document says" beside "QualiCore does now". */
.sop { display: flex; flex-direction: column; gap: 14px; }
.sop-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.sop-stats .stat b { font-size: 28px; }
.sop-stat-text { font-size: 17px; font-weight: 600; }
.sop-list { display: flex; flex-direction: column; gap: 12px; }
.sop-card { display: flex; flex-direction: column; gap: 10px; border-left: 4px solid var(--border); }
.sop-card.sev-high { border-left-color: var(--teal); }
.sop-card.sev-medium { border-left-color: var(--teal-light); }
.sop-card.sev-low { border-left-color: var(--border); }
.sop-stat-sub { display: block; margin-top: 2px; }
.sop-card-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: baseline; justify-content: space-between; }
.sop-card-title { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; min-width: 0; }
.sop-card-title h3 { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.sop-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sop-compare > div { background: var(--teal-tint-2); border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; }
.sop-compare > div:first-child { background: var(--surface); }
.sop-compare p { margin: 4px 0 0; overflow-wrap: anywhere; }
.sop-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.sop-passage { margin: 0; }
.sop-passage blockquote { margin: 0; padding: 8px 12px; border-left: 3px solid var(--teal-light); background: var(--bg); font-size: 14px; color: var(--ink-2); white-space: pre-wrap; overflow-wrap: anywhere; }
.sop-passage figcaption { margin-top: 4px; }
.sop-where, .sop-status { margin: 0; }
.sop-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sop-confirm { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.sop-confirm-actions { display: flex; gap: 8px; }
.sop-request pre { white-space: pre-wrap; font-family: var(--mono); font-size: 12.5px; background: var(--surface); border: 1px solid var(--border-2); border-radius: 8px; padding: 10px; margin: 8px 0; }
.sop-skipped ul { margin: 8px 0 0; padding-left: 20px; }
.sop-panel { display: flex; flex-direction: column; gap: 10px; }
.sop-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sop-mini li { display: flex; flex-direction: column; gap: 2px; padding: 8px 0 8px 10px; border-left: 3px solid var(--teal-light); margin-bottom: 6px; overflow-wrap: anywhere; }
/* Ready / Needs you / Conflicts (Jared, 2026-11-07). Orange stays for failures only: conflicts are amber. */
.sop-last { margin: -4px 0 0; }
.sop-stat-ready b { color: var(--teal); } .sop-stat-conflict b { color: var(--amber-ink); }
.sop-group { display: flex; flex-direction: column; gap: 10px; }
.sop-group h2 { margin: 0; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.sop-group > p { margin: 0; }
.sop-ready { border-left: 4px solid var(--teal); }
.sop-ready-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sop-ready-row { display: flex; flex-direction: column; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border-2); min-width: 0; }
.sop-ready-row.left { opacity: .6; }
.sop-ready-top { display: flex; justify-content: space-between; gap: 4px 12px; flex-wrap: wrap; align-items: baseline; }
.sop-ready-top b { overflow-wrap: anywhere; min-width: 0; }
.sop-change { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: baseline; }
.sop-old { color: var(--ink-2); }
.sop-new { font-weight: 600; color: var(--teal-dark); background: var(--teal-tint); border-radius: 6px; padding: 1px 8px; }
.sop-arrow { color: var(--muted); }
.sop-ready-quote { margin: 0; color: var(--ink-2); overflow-wrap: anywhere; }
.sop-ready-acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.sop-apply-bar { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; padding-top: 12px; border-top: 1px solid var(--border-2); }
.sop-why { border-radius: 10px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--border-2); }
.sop-why.conflict { background: var(--amber-tint); border-color: #E8D29A; color: var(--amber-ink); }
.sop-why p { margin: 4px 0 0; overflow-wrap: anywhere; }
.sop-edit { display: flex; flex-direction: column; gap: 8px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 10px; padding: 10px 12px; }
.sop-edit-fields { display: flex; flex-wrap: wrap; gap: 10px; }
.sop-edit-fields label { display: flex; flex-direction: column; gap: 4px; }
.sop-edit-fields input { width: 9em; min-height: 44px; font-size: 16px; }
.ms-bulk { display: flex; gap: 10px 14px; flex-wrap: wrap; align-items: center; }
.ms-wait { color: var(--amber-ink); }
@media (max-width: 720px) {
  .sop-apply-bar .btn { flex: 1 1 100%; justify-content: center; }
  .sop-edit-fields label { flex: 1 1 40%; } .sop-edit-fields input { width: 100%; }
  .sop-compare { grid-template-columns: 1fr; gap: 8px; }
  .sop-actions .btn { flex: 1 1 100%; justify-content: center; text-align: center; }
  .sop-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sop-stats .stat { padding: 12px 14px; }
  .sop-stats .stat b { font-size: 22px; }
  .sop-stat-text { font-size: 14px; }
}

/* Training video levels: Basic, then Intermediate (opens after every basic video is watched) */
.video-levels { display: flex; flex-direction: column; gap: 10px; margin-bottom: 4px; }
.video-level { display: grid; grid-template-columns: 110px minmax(120px, 260px) 1fr; align-items: center; gap: 12px; }
.video-level-name { font-weight: 600; }
.video-level > .pill { justify-self: start; }
.video-meter { display: block; height: 8px; border-radius: 999px; background: var(--teal-tint); overflow: hidden; }
.video-meter > span { display: block; height: 100%; background: var(--teal-light); border-radius: 999px; transition: width .4s ease; }
.video-level-tag { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--teal); background: var(--teal-tint); padding: 3px 9px; border-radius: 999px; }
.video-subhead { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 14px 0 8px; }
.video-subhead h3 { margin: 0; font-size: 16px; }
.video-card.locked { opacity: .72; }
.video-card.locked .video-num { background: var(--border-2); color: var(--muted); }
.video-locked { margin-top: 4px; }
.video-locked .video-meter { max-width: 360px; margin: 6px 0 14px; }
@media (max-width: 640px) { .video-level { grid-template-columns: 1fr; gap: 4px; } }
/* What's new comes first: a slim bar above every page while a what's-new video is waiting */
.whats-new-gate { display: flex; align-items: center; gap: 12px; padding: 10px 14px; margin: 0 0 14px; border-radius: 10px;
  border-left: 4px solid var(--teal); background: var(--teal-tint-2); }
.whats-new-gate .wng-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.whats-new-gate .btn { flex: none; }
@media (max-width: 640px) { .whats-new-gate { flex-direction: column; align-items: stretch; } .whats-new-gate .btn { text-align: center; } }

/* Confident LIMS link on COA corrections (pages/ConfidentLink.tsx) */
.lims-link { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.lims-address { display: flex; flex-direction: column; gap: 8px; background: var(--teal-tint-2); border: 1px solid var(--teal-light); border-radius: 10px; padding: 12px 14px; }
.coa-src { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.coa-changes { margin: 6px 0 0; padding-left: 18px; }
.coa-changes li { font-variant-numeric: tabular-nums; }
/* Accounting (pages/Accounting.tsx): on a phone each line of a report stacks, so nothing is squeezed */
@media (max-width: 560px) {
  .acct-table tr { display: grid; grid-template-columns: 28px 1fr; gap: 2px 8px; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .acct-table td { display: block; border: 0; padding: 0; }
  .acct-table td:nth-child(3) { grid-column: 2; }
  .acct-stats .stat b { font-size: 26px; }
}
.acct-fold > summary { cursor: pointer; list-style-position: outside; padding: 2px 0; }
.acct-fold[open] > summary { margin-bottom: 8px; }
.acct-cards { display: none; list-style: none; margin: 0; padding: 0; }
.acct-cards li { border-top: 1px solid var(--border); }
.acct-cards a { display: flex; flex-direction: column; gap: 4px; padding: 12px 2px; color: inherit; text-decoration: none; }
.acct-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
@media (max-width: 560px) { .acct-cards { display: block; } .acct-wide { display: none; } }

/* Clients: the communications log (a call, e-mail or meeting per row; whole row is the link) */
.comm-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.comm-row { display: grid; grid-template-columns: 9.5em 1fr auto; gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; color: inherit; text-decoration: none; background: var(--surface); }
.comm-row:hover, .comm-row:focus-visible { border-color: var(--teal); background: var(--teal-tint-2); }
.comm-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.comm-summary { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.comm-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.comm-tags:empty { display: none; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }
@media (max-width: 720px) { .comm-row { grid-template-columns: 1fr; gap: 4px; } }

/* ---- Scan a label (pages/Scan.tsx) and equipment QR labels (pages/EquipmentLabels.tsx) ---- */
.scan-page { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.scan-view { position: relative; width: 100%; max-width: 520px; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: #0B2A2B; display: grid; place-items: center; }
.scan-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-view .btn { position: relative; z-index: 2; }
.scan-frame { position: absolute; inset: 18% 24%; border: 3px solid var(--teal-light, #7FE0CF); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.28); pointer-events: none; }
.scan-other { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; max-width: 640px; }
.scan-other .card { display: flex; flex-direction: column; gap: 8px; }
.scan-other h3 { margin: 0; }
@media (max-width: 720px) { .scan-view { aspect-ratio: 3 / 4; max-width: none; } .scan-frame { inset: 22% 14%; } }

.label-card-body { display: flex; gap: 14px; align-items: flex-start; }
.label-card-qr { flex: 0 0 104px; width: 104px; }
.label-card-qr svg, .eq-label-qr svg { display: block; width: 100%; height: auto; }
.label-card { margin-top: 4px; }
.label-pick summary { cursor: pointer; font-weight: 600; }
.label-pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; max-height: 320px; overflow: auto; }
.label-pick-list .check { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.label-sheet { display: flex; flex-wrap: wrap; gap: 10px; }
.eq-label { width: 2in; height: 1in; box-sizing: border-box; padding: 0.06in; display: flex; gap: 0.06in; align-items: center; background: #fff; color: #111;
  border: 1px dashed #B9C4C0; border-radius: 4px; overflow: hidden; break-inside: avoid; }
.eq-label-qr { flex: 0 0 0.86in; width: 0.86in; }
.eq-label-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.eq-label-text b { font-size: 9pt; overflow-wrap: anywhere; line-height: 1.1; margin-bottom: 1pt; }
.eq-label-text span { font-size: 6.5pt; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.eq-label-text .eq-label-site { color: #0E5E5E; font-weight: 600; -webkit-line-clamp: 1; }
.eq-label-text .eq-label-hint { color: #555; font-size: 5.5pt; }
@media print {
  nav.main, .help-fab, .help-panel, .help-nudge, .whats-new-gate, .no-print { display: none !important; }
  body, main { background: #fff !important; padding: 0 !important; }
  .label-sheet { gap: 0.08in; }
  .eq-label { border-color: transparent; }
}

/* ---- Daily checks (pages/DailyChecks.tsx) ---- */
.k-band { width: 16px; height: 0; border-top: 2px solid #15201C; display: inline-block; vertical-align: middle; }
.daily-checks { display: flex; flex-direction: column; gap: 12px; }
.probe-card { display: flex; flex-direction: column; gap: 10px; }
.probe-card h3 .pill { margin-left: 6px; vertical-align: middle; font-size: 12px; }
.probe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.probe-form { display: flex; flex-direction: column; gap: 10px; background: var(--teal-tint-2, #F1F8F6); }
.reading-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.reading-form .field { min-width: 150px; }
.reading-form .field.grow { flex: 1 1 200px; }
.reading-form input[inputmode="decimal"] { font-size: 20px; width: 150px; }
.reading-preview { align-self: center; }
.chart-head { align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); padding: 6px 10px; font: inherit; font-size: 13px; cursor: pointer; color: inherit; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--teal, #0E5E5E); color: #fff; }
tr.voided td { color: #8A9691; text-decoration: line-through; }
tr.voided td:nth-child(5) { text-decoration: none; }
.void-form { display: inline-flex; gap: 6px; align-items: center; }
.void-form input { width: 190px; }
.checklist { display: flex; flex-direction: column; gap: 12px; border: 2px solid var(--teal-light, #7FE0CF); }
.checklist-items { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 10px; counter-reset: ci; }
.checklist-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.ci-input { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ci-input input[inputmode="decimal"] { width: 120px; font-size: 20px; text-align: right; }
.ci-unit { min-width: 26px; font-weight: 600; }
.ci-note { width: 180px; }
.checklist-results { margin: 0; padding-left: 18px; }
.checklist-results li.fail { font-weight: 600; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
ul.plain { margin: 0; padding-left: 18px; }
@media (max-width: 720px) {
  .checklist-items li { grid-template-columns: 1fr; }
  .ci-input { justify-content: flex-start; }
  .ci-input input[inputmode="decimal"] { flex: 1 1 120px; }
  .ci-note { flex: 1 1 100%; width: auto; }
  .reading-form input[inputmode="decimal"] { width: 100%; }
}
.ci-corr { flex-basis: 100%; text-align: right; }
.ci-input input[aria-invalid="true"] { border-color: #D9481F; }
.ci-sure { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: rgba(217,72,31,.07); margin-bottom: 10px; font-size: 14px; }
@media (max-width: 720px) { .ci-corr { text-align: left; } }
.setup-table input, .setup-table select { width: 100%; box-sizing: border-box; min-width: 0; }
.setup-table { table-layout: fixed; min-width: 640px; }

/* ---- barcode scanning in a field (Scanner.tsx) ---- */
.scan-input { display: flex; gap: 6px; align-items: stretch; }
.scan-input input { flex: 1 1 auto; min-width: 0; }
.scan-btn { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.scan-modal { position: fixed; inset: 0; z-index: 60; background: rgba(8,20,20,.62); display: grid; place-items: center; padding: 16px; }
.scan-modal-in { background: var(--surface, #fff); border-radius: 16px; padding: 18px; width: min(560px, 100%); display: flex; flex-direction: column; gap: 10px; }
.scan-view.bar { aspect-ratio: 4 / 3; max-width: none; }
.scan-frame.bar { inset: 34% 8%; }
@media (max-width: 720px) { .scan-view.bar { aspect-ratio: 3 / 4; } .scan-frame.bar { inset: 38% 6%; } }

/* ---- Reference material labels (pages/RefMaterialLabels.tsx) ---- */
.rm-label .eq-label-qr { flex-basis: 0.78in; width: 0.78in; }
.rm-label .eq-label-text { line-height: 1.12; }
.rm-label .eq-label-text span { font-size: 6pt; }
.rm-label .eq-label-text .rm-label-name { -webkit-line-clamp: 1; font-weight: 600; }
.rm-label .eq-label-text .rm-label-line { display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; }
.rm-label .eq-label-text .rm-label-line span, .rm-label .eq-label-text .rm-label-line b { display: inline; font-size: inherit; }
.rm-label .eq-label-text .rm-label-blank { color: #333; }
.rm-label .eq-label-text .eq-label-site { margin-top: 1pt; }
.rm-label-small { width: 1.5in; height: 0.75in; padding: 0.04in; gap: 0.04in; }
.rm-label-small .eq-label-qr { flex-basis: 0.6in; width: 0.6in; }
.rm-label-small .eq-label-text b { font-size: 7pt; }
.rm-label-small .eq-label-text span { font-size: 4.8pt; }
.rm-label-small .eq-label-text { line-height: 1.08; }
.label-size { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 10px; }
.label-size .check { display: flex; gap: 6px; align-items: center; font-size: 14px; }
.rm-open-card { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; border-color: var(--mint, #1FA090); background: var(--teal-tint-2, #F1F8F6); }
.rm-open-card > div { flex: 1 1 220px; }
.rm-open-card details { flex: 1 1 100%; }
.rm-open-card.done { border-color: var(--teal, #0E5E5E); }
.rm-open-card a.btn { color: #fff; text-decoration: none; }

/* ---- Audits on the floor (pages/Audits.tsx): one-tap result buttons, photos on each question ---- */
.field .field-label { font-size: 14px; font-weight: 500; }
.result-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line, #D5DDDA); border-radius: 8px; overflow: hidden; }
.result-seg button { border: 0; border-right: 1px solid var(--line, #D5DDDA); background: #fff; padding: 8px 12px; font: inherit; font-size: 14px; cursor: pointer; min-height: 38px; color: inherit; }
.result-seg button:last-child { border-right: 0; }
.result-seg button.on.result-pass { background: var(--teal, #0E5E5E); color: #fff; }
.result-seg button.on.result-fail { background: var(--alert, #D9481F); color: #fff; }
.result-seg button.on.result-observation { background: #B7791F; color: #fff; }
.result-seg button.on.result-not_applicable { background: #5F6B67; color: #fff; }
.result-seg button:focus-visible { outline: 2px solid var(--mint, #1FA090); outline-offset: -2px; }
@media (max-width: 720px) {
  .result-seg { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .result-seg button { padding: 10px 4px; font-size: 13px; }
}
.att-inline .att-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 180px)); }
@media (max-width: 720px) {
  .audit-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
  .audit-stats .stat { padding: 8px 6px; gap: 2px; align-items: center; text-align: center; border-radius: 10px; }
  .audit-stats .stat span { font-size: 11px; line-height: 1.2; }
  .audit-stats .stat b { font-size: 20px; }
  .att-inline .att-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}

/* ---- Voice notes (VoiceNote.tsx) ---- */
.voice-rec { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.voice-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--mint, #1FA090); animation: voice-pulse 1.2s ease-in-out infinite; }
@keyframes voice-pulse { 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .voice-dot { animation: none; } }

/* ---- Document scanning (DocScan.tsx) ---- */
.doc-scan-box { width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; }
.doc-scan-box h2 { margin: 0; font-size: 20px; }
.doc-pages { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.doc-pages li { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: 10px; padding: 8px; background: var(--teal-tint-2, #F1F8F6); }
.doc-pages img { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: #fff; border-radius: 4px; }
.doc-page-no { font-size: 13px; font-weight: 600; }
.doc-page-tools { display: flex; flex-wrap: wrap; gap: 4px; }
.doc-scan-actions, .doc-scan-finish { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
.doc-scan-finish .field { flex: 1 1 220px; }
@media (max-width: 720px) { .doc-pages { grid-template-columns: repeat(2, minmax(0, 1fr)); } .doc-scan-box { padding: 14px; } }

/* ---- Printed copy check (pages/CopyCheck.tsx) ---- */
.copy-check { max-width: 640px; }
.copy-check-card { display: flex; flex-direction: column; gap: 8px; border-width: 2px; }
.copy-check-card h2 { margin: 0; font-size: 22px; }
.copy-check-card p { margin: 0; }
.copy-check-doc { font-weight: 600; }
.copy-check-card.ok { border-color: var(--teal, #0E5E5E); background: var(--teal-tint-2, #F1F8F6); }
.copy-check-card.ok h2 { color: var(--teal, #0E5E5E); }
.copy-check-card.bad { border-color: var(--alert-border, #D9481F); background: var(--alert-tint, #FDF0EB); }
.copy-check-card.bad h2 { color: var(--alert, #D9481F); }
.copy-check-card.warn { border-color: var(--amber, #B7791F); background: #FFF8EC; }

/* ---- Quick approvals (pages/Approvals.tsx) ---- */
.approvals { display: flex; flex-direction: column; gap: 12px; max-width: 760px; }
.approval-card { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.approval-card h3 { margin: 0; }
.approval-card p { margin: 0; }
.approval-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.ok-text { color: var(--teal, #0E5E5E); font-weight: 600; }
@media (max-width: 720px) { .approval-actions { width: 100%; } .approval-actions .btn { flex: 1 1 auto; text-align: center; } }

/* Claude's review notes on a draft in review (pages/ReviewNotes.tsx) */
.rn-panel { display: flex; flex-direction: column; gap: 12px; border-top: 3px solid var(--teal-light); }
.rn-head { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; justify-content: space-between; }
.rn-head h2 { margin: 0; }
.rn-summary { margin: 0; padding: 10px 12px; background: var(--teal-tint-2); border-radius: 8px; color: var(--ink-2); }
.rn-waiting { display: flex; align-items: center; gap: 10px; margin: 0; color: var(--muted); }
.rn-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--teal-light); animation: rn-pulse 1.4s ease-in-out infinite; flex: none; }
@keyframes rn-pulse { 50% { opacity: .3; transform: scale(.8); } }
@media (prefers-reduced-motion: reduce) { .rn-dot { animation: none; } }
.rn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rn-chip { min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink-2); font: inherit; font-size: 13px; cursor: pointer; }
.rn-chip b { font-weight: 600; margin-left: 2px; }
.rn-chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }
.rn-chip:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.rn-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rn-note { padding: 10px 12px; border: 1px solid var(--border-2); border-left: 4px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.rn-note.sev-high { border-left-color: var(--alert); }
.rn-note.sev-medium { border-left-color: #D9A441; }
.rn-note-head { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.rn-sev { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--muted); }
.rn-sev.sev-high { color: var(--alert-ink); }
.rn-sev.sev-medium { color: var(--amber-ink); }
.rn-text, .rn-suggest { margin: 0; }
.rn-quote { margin: 0; padding: 6px 10px; border-left: 2px solid var(--border); background: var(--bg); font-size: 14px; color: var(--ink-2); overflow-wrap: anywhere; }
.rn-unfound { display: block; margin-top: 4px; font-size: 12px; color: var(--amber-ink); }
.rn-suggest { font-size: 14px; overflow-wrap: anywhere; }
.rn-foot { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; justify-content: space-between; }
@media (max-width: 720px) { .rn-note { padding: 9px 10px; } .rn-sev { margin-left: 0; } }

/* Regulatory watch (pages/Regulatory.tsx): rule changes and lab bulletins, collect only */
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--teal); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.linklike:hover { color: var(--teal-dark); }
.reg-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 16px 0 10px; }
.reg-run-rows .pill { white-space: nowrap; }
.reg-stats .stat b { font-size: 28px; }
.reg-stat-text { font-size: 17px; font-weight: 600; }
.reg-stat-sub { display: block; margin-top: 2px; font-weight: 400; }
.reg-ok { background: var(--teal-tint); color: var(--teal-dark); }
.reg-list, .reg-history { display: flex; flex-direction: column; gap: 12px; }
.reg-card { display: flex; flex-direction: column; gap: 8px; border-left: 4px solid var(--border); }
.reg-card.out-changed { border-left-color: var(--teal); }
.reg-card.out-failed { border-left-color: var(--amber); }
.reg-card-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.reg-title { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.reg-summary { margin: 0; overflow-wrap: anywhere; }
.reg-items { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.reg-items li { overflow-wrap: anywhere; }
.reg-item-meta { display: block; }
.reg-msg { margin: 0; }
.reg-links { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.reg-diff { margin: 0; max-height: 360px; overflow: auto; background: var(--bg); border: 1px solid var(--border-2); border-radius: 8px; padding: 10px 12px;
  font-family: var(--mono); font-size: 12.5px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.reg-diff .add { background: var(--teal-tint); color: var(--teal-dark); display: block; }
.reg-diff .del { color: var(--muted); text-decoration: line-through; display: block; }
.reg-diff .hunk { color: var(--muted); display: block; }
.reg-reviewed { margin: 0; color: var(--teal-dark); }
.reg-review { display: flex; flex-direction: column; gap: 4px; border-top: 1px solid var(--border-2); padding-top: 10px; }
.reg-review-row { display: flex; gap: 8px; }
.reg-review-row input { flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; font: inherit; background: var(--surface, #fff); }
.reg-run { padding: 0; overflow: hidden; }
.reg-run-head { width: 100%; display: flex; gap: 10px 16px; align-items: center; background: none; border: 0; padding: 14px 16px; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.reg-run-when { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.reg-run-counts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.reg-run-head .chev { color: var(--muted); transition: transform .15s ease; }
.reg-run-head[aria-expanded="true"] .chev { transform: rotate(90deg); }
.reg-run-rows { list-style: none; margin: 0; padding: 0 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.reg-run-rows li { display: flex; gap: 10px; align-items: baseline; border-top: 1px solid var(--border-2); padding-top: 8px; }
.reg-run-rows .pill { flex: 0 0 auto; min-width: 150px; text-align: center; }
.reg-run-src { overflow-wrap: anywhere; min-width: 0; }
.reg-source-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.reg-source-list li { display: flex; flex-direction: column; gap: 6px; }
.reg-source-list .reg-copy { align-self: flex-start; }
.reg-source-top { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.reg-source-top a { overflow-wrap: anywhere; min-width: 0; }
@media (max-width: 720px) {
  .reg-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .reg-stats .stat { padding: 12px 14px; }
  .reg-stats .stat b { font-size: 22px; }
  .reg-stat-text { font-size: 14px; }
  .reg-head .btn { width: 100%; justify-content: center; }
  .reg-head > div:last-child { flex: 1 1 100%; }
  .reg-review-row { flex-direction: column; }
  .reg-review-row .btn { justify-content: center; }
  .reg-run-head { flex-wrap: wrap; }
  .reg-run-counts { justify-content: flex-start; order: 3; flex-basis: 100%; }
  .reg-run-rows li { flex-direction: column; gap: 4px; }
  .reg-run-rows .pill { min-width: 0; }
  .reg-source-list { grid-template-columns: 1fr; }
}

/* Data package: sample IDs read from the uploaded file (PackageNotes.tsx SamplesFromFile) */
.file-samples { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 8px; background: var(--surface); }
.sample-list { list-style: none; margin: 0; padding: 0; max-height: 168px; overflow-y: auto; }
.sample-list .pill { font-size: 12.5px; padding: 3px 9px; }
@media (max-width: 600px) { .file-samples { padding: 8px 10px; } .sample-list { max-height: 132px; } }

/* IT > Backups: facts as label/value pairs and the history as a list, so both read well on a phone */
.bk-facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.bk-facts dt { color: var(--muted); font-size: 13px; }
.bk-facts dd { margin: 0; }
@media (max-width: 560px) { .bk-facts { grid-template-columns: 1fr; gap: 2px; } .bk-facts dd { margin-bottom: 8px; } }
.bk-list { list-style: none; margin: 0; padding: 0; }
.bk-list li { padding: 10px 0; border-top: 1px solid var(--border-2); }
.bk-list li:first-child { border-top: 0; }
.bk-head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.bk-head .muted { margin-left: auto; }

/* IT area: ten tabs scroll sideways rather than squeeze; filters; small switch; software list (pages/It.tsx) */
.it-tabs { overflow-x: auto; scrollbar-width: thin; }
.it-tabs button { flex: 0 0 auto; white-space: nowrap; padding: 10px 14px; }
.it-filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; margin-bottom: 12px; }
.it-filters input:not([type]), .it-filters select { padding: 8px 10px; border: 1px solid var(--field); border-radius: 8px; background: #fff; min-height: 38px; }
.it-filters input:not([type]) { flex: 1 1 220px; max-width: 360px; }
.it-switch { margin-bottom: 14px; }
.it-seg { display: inline-flex; width: auto; border: 1px solid var(--border-2); border-radius: 10px; overflow: hidden; background: var(--surface); }
.it-seg button { border: 0; background: transparent; padding: 8px 16px; cursor: pointer; color: var(--ink-2); font: inherit; min-height: 38px; white-space: nowrap; }
.it-seg button + button { border-left: 1px solid var(--border-2); }
.it-seg button.on { background: var(--teal); color: #fff; }
.sw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 16px; }
.sw { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--border-2); font-size: 14px; }
.sw span:first-child { overflow-wrap: anywhere; }
.sw .mono { color: var(--muted); }
.sw.hole { color: var(--alert-ink); font-weight: 600; }
@media (max-width: 720px) { .it-seg button { min-height: 44px; padding: 8px 12px; } .it-filters input:not([type]), .it-filters select { flex: 1 1 100%; max-width: none; } }
/* A draft sent back to its author, and the two steps to send it again (DocumentDetail.tsx) */
.notice.sent-back { display: flex; flex-direction: column; gap: 6px; border-left: 4px solid var(--amber-ink); }
.notice.sent-back.done { background: var(--teal-tint); color: var(--ink); border-left-color: var(--teal); }
.notice.sent-back blockquote { margin: 0; padding: 8px 12px; background: rgba(255, 255, 255, 0.6); border-radius: 6px; white-space: pre-wrap; color: var(--ink); }
.draft-step { display: flex; flex-direction: column; gap: 8px; padding-bottom: 12px; border-bottom: 1px solid var(--line, #E2E8E6); }
.draft-step:last-child { border-bottom: 0; padding-bottom: 0; }
.draft-step h3 { margin: 0; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.draft-step .num { display: inline-flex; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 13px; align-items: center; justify-content: center; flex: none; }
.draft-step input[type=file] { max-width: 100%; }

/* Site logo for Word headers (Settings > Sites, pages/Settings.tsx SiteLogo) */
.site-logo-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.site-logo-box { width: 180px; height: 110px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--border); border-radius: 10px; background: #fff; padding: 8px; }
.site-logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Upload feedback on a document draft (DocumentDetail UploadProgress) */
.pill .spinner { width: 10px; height: 10px; vertical-align: -1px; }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: qc-spin .8s linear infinite; }
@keyframes qc-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.upload-note { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-radius: 8px; background: var(--teal-tint); border: 1px solid #BFD9D2; color: var(--teal-dark); font-size: 14px; }
.upload-note.ok { font-weight: 500; }
/* On/off slider (a checkbox with role=switch), first used for the TM flowchart at upload */
.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; padding: 10px 12px; border: 1px solid var(--field); border-radius: 8px; background: var(--surface); }
.switch-row input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch { flex: none; position: relative; width: 44px; height: 26px; border-radius: 999px; background: #C9D1CD; transition: background .15s; margin-top: 1px; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.switch-row input:checked + .switch { background: var(--teal); }
.switch-row input:checked + .switch::after { transform: translateX(18px); }
.switch-row input:focus-visible + .switch { outline: 3px solid var(--teal-light); outline-offset: 2px; }
.switch-row input:disabled + .switch { opacity: .6; }

/* Methods and criteria: rule list with an edit panel (pages/Methods.tsx). Side by side on a computer and iPad,
   the panel covers the screen on a phone. */
.mc-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: -8px; }
.mc-search { padding: 9px 12px; border: 1px solid var(--field); border-radius: 8px; background: #fff; min-width: 200px; flex: 1 1 220px; max-width: 320px; }
.mc-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.mc-tab { border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 14px; font-size: 14px; cursor: pointer; display: inline-flex; gap: 8px; align-items: center; color: var(--ink); min-height: 40px; }
.mc-tab .mc-tab-t { color: var(--muted); }
.mc-tab.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.mc-tab.on .mc-tab-t { color: #D6EDE8; }
.mc-tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-light); flex: none; }
.mc-tab .dot.warn { background: var(--alert); }
.mc-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; }
.mc-split.open { grid-template-columns: minmax(0, 1fr) minmax(340px, 420px); }
.mc-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mc-head { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: flex-start; }
.mc-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin-top: 6px; }
.mc-facts b { color: var(--ink); font-weight: 500; }
.pill.mc-mini { font-size: 12px; padding: 2px 8px; }
.mc-group { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 10px 0 6px; font-weight: 500; }
.mc-rules { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.mc-rule { all: unset; box-sizing: border-box; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, .9fr) minmax(0, .8fr) minmax(0, 1.3fr) 16px; gap: 12px; align-items: center;
  padding: 12px 16px; border-top: 1px solid var(--border-2); cursor: pointer; font-family: var(--sans); color: var(--ink); min-height: 56px; }
.mc-rule:first-child { border-top: 0; }
.mc-rule:hover { background: var(--teal-tint-2); }
.mc-rule:focus-visible { outline: 3px solid var(--teal-light); outline-offset: -3px; }
.mc-rule.sel { background: var(--teal-tint-2); box-shadow: inset 4px 0 0 var(--teal); }
.mc-rule.unset { background: var(--alert-row); }
.mc-rule.na { opacity: .62; }
.mc-rule.na .mc-what b { text-decoration: line-through; }
.mc-what { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mc-what b { font-weight: 500; }
.mc-what .mono { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.mc-lim { font-size: 14px; }
.mc-src { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; min-width: 0; }
.mc-chev { color: var(--muted); font-size: 18px; }
.mc-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; display: flex; flex-direction: column; gap: 14px;
  box-shadow: 0 8px 30px rgba(21, 32, 28, .10); position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.mc-panel-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.mc-panel-head h2 { font-size: 18px; }
.mc-x { width: 36px; height: 36px; flex: none; }
.mc-form { display: flex; flex-direction: column; gap: 14px; }
.mc-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.mc-kind { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 14px; background: #fff; cursor: pointer; text-align: left; color: var(--ink); min-height: 44px; }
.mc-kind.on { border: 2px solid var(--teal); background: var(--teal-tint-2); }
.mc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.mc-chip { border: 1px solid var(--border); border-radius: 999px; padding: 7px 12px; font-size: 13px; background: #fff; cursor: pointer; color: var(--ink); min-height: 36px; }
.mc-chip.on { background: var(--teal); color: #fff; border-color: var(--teal); }
.mc-chip.add { border-style: dashed; color: var(--muted); }
.mc-chip-select { border: 1px solid var(--field); border-radius: 999px; padding: 6px 10px; font-size: 13px; }
.mc-fs { border: 0; padding: 0; margin: 0; min-width: 0; }
.mc-fs legend { font-size: 14px; font-weight: 500; padding: 0; margin-bottom: 6px; }
.mc-opts { display: flex; flex-direction: column; gap: 6px; }
.mc-opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 14px; cursor: pointer; }
.mc-opt.on { border-color: var(--teal); background: var(--teal-tint-2); }
.mc-opt small, .mc-na small { display: block; color: var(--muted); font-size: 12px; }
.mc-opt input, .mc-na input { margin-top: 3px; }
.mc-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mc-three { display: grid; grid-template-columns: 1.2fr .7fr 1.1fr; gap: 10px; }
.mc-na { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; border: 1px dashed var(--field); border-radius: 10px; padding: 10px 12px; cursor: pointer; }
.mc-na b { font-weight: 500; }
.mc-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mc-reset { margin-left: auto; }
.hint { font-size: 12px; color: var(--muted); }
.mc-hist summary { cursor: pointer; color: var(--teal); }
.mc-hist ol { list-style: none; margin: 8px 0 0; padding: 0 0 0 12px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.mc-hist b { font-weight: 500; }
.mc-empty { display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
@media (max-width: 1100px) {
  .mc-split.open { grid-template-columns: minmax(0, 1fr) 360px; }
  .mc-split.open .mc-rule { grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr) 16px; }
  .mc-split.open .mc-rule .mc-ap { display: none; }
  .mc-split.open .mc-rule .mc-src { grid-column: 1 / -1; grid-row: 2; }
}
/* tablets: the menu is a 64px bar stuck to the top, so the panel sticks just below it */
@media (min-width: 721px) and (max-width: 1100px) { .mc-panel { top: 80px; max-height: calc(100vh - 96px); } }
@media (max-width: 720px) {
  .mc-tabs { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .mc-tab { white-space: nowrap; }
  .mc-search { max-width: none; }
  .mc-split.open { grid-template-columns: minmax(0, 1fr); }
  .mc-rule, .mc-split.open .mc-rule { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .mc-rule .mc-ap, .mc-rule .mc-chev { display: none; }
  .mc-rule .mc-src { grid-column: 1 / -1; grid-row: 2; }
  .mc-panel { position: fixed; inset: 0; z-index: 900; border-radius: 0; border: 0; max-height: none; padding: 16px 16px 32px; box-shadow: none; }
  .mc-two, .mc-three { grid-template-columns: 1fr 1fr; }
  .mc-three .field:first-child { grid-column: 1 / -1; }
  .mc-reset { margin-left: 0; }
}

/* ---- Methods and criteria: Check against the SOP (pages/Methods.tsx SopSetup) ---- */
.ms-switch { display: inline-flex; border: 1px solid var(--field); border-radius: 10px; padding: 3px; gap: 3px; background: var(--surface); align-self: flex-start; max-width: 100%; }
.ms-switch button { border: 0; background: transparent; border-radius: 7px; padding: 8px 14px; font-size: 14px; color: var(--ink); cursor: pointer; min-height: 40px; }
.ms-switch button.on { background: var(--teal); color: #fff; }
.ms-wrap { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ms-head { display: flex; gap: 12px 20px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.ms-head h2 { margin: 0; font-size: 17px; }
.ms-note { padding: 12px 16px; font-size: 14px; }
.ms-note.warn { background: var(--amber-tint); border: 1px solid #E8D29A; color: var(--amber-ink); }
.ms-note.info { background: var(--teal-tint); border: 1px solid #BFD9D2; color: var(--teal-dark); }
.ms-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ms-stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.ms-stat b { font-size: 24px; }
.ms-stat b.amber { color: var(--amber-ink); } .ms-stat b.alert { color: var(--alert-ink); } .ms-stat b.teal { color: var(--teal); }
.ms-list { display: flex; flex-direction: column; gap: 10px; }
.ms-item { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--amber); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.ms-item.needs { border-left-color: var(--alert); }
.ms-item.confirmed { border-left-color: var(--teal); }
.ms-top { display: flex; justify-content: space-between; gap: 6px 16px; flex-wrap: wrap; align-items: baseline; }
.ms-top b { font-size: 15px; min-width: 0; overflow-wrap: anywhere; }
.ms-vals { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.ms-sop, .ms-ours { font-size: 13px; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.ms-sop { background: var(--teal-tint); color: var(--teal-dark); }
.ms-ours { background: var(--amber-tint); color: var(--amber-ink); }
.ms-q { background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.ms-q span { display: block; margin-top: 4px; font-size: 12px; color: var(--muted); }
.ms-q.nq { color: var(--alert-ink); background: var(--alert-tint); }
.ms-ok { color: var(--teal); }
.ms-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.ghost { background: transparent; color: var(--teal); border: 0; }
.ms-ask { display: flex; flex-direction: column; gap: 8px; }
.ms-ask label { display: flex; flex-direction: column; gap: 6px; }
.ms-ask input { min-height: 40px; border: 1px solid var(--field); border-radius: 8px; padding: 0 10px; font-size: 15px; }
@media (max-width: 720px) {
  .ms-stats { grid-template-columns: 1fr; }
  .ms-stat { flex-direction: row; justify-content: space-between; align-items: center; }
  .ms-stat b { font-size: 20px; }
  .ms-acts .btn { flex: 1 1 auto; justify-content: center; }
}

/* New folder panel (NewFolder.tsx, 2026-11-06): while filing, from the register, or when moving a document */
.new-folder { border: 2px solid var(--teal); border-radius: 12px; padding: 16px 18px; background: var(--teal-tint-2); display: flex; flex-direction: column; gap: 12px; }
.new-folder-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.new-folder-where { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px; min-width: 0; }
.new-folder-where legend { width: 100%; }
.new-folder-where legend { font-size: 14px; font-weight: 500; margin-bottom: 6px; padding: 0; }
.new-folder-where label { display: flex; gap: 8px; align-items: center; flex: 1 1 240px; border: 1px solid var(--field); border-radius: 8px; padding: 10px 12px; background: #fff; font-size: 14px; font-weight: 400; min-height: 44px; }
.new-folder-where label.on { border: 2px solid var(--teal); }
.new-folder-where select { margin-left: 4px; padding: 6px 8px; border: 1px solid var(--field); border-radius: 6px; background: #fff; }
.new-folder-sites { display: flex; gap: 8px; align-items: center; }
.new-folder-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.folder-why { font-size: 13px; color: var(--teal); }
.folder-nomatch { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.number-chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 13px; background: var(--teal-tint); color: var(--teal-dark); padding: 4px 4px 4px 10px; border-radius: 999px; margin: 2px 4px 2px 0; }
.number-chip button { all: unset; cursor: pointer; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; }
.number-chip button:hover, .number-chip button:focus-visible { background: #fff; outline: 2px solid var(--teal); }
.number-add { display: inline-block; margin-top: 4px; }

/* Documents: "Master document list (Word)" beside the page title; full width on a phone (Jared, 2026-11-06) */
.register-word { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
@media (max-width: 640px) { .register-word { width: 100%; align-items: stretch; } .register-word .btn { width: 100%; } }

/* Validations and verifications (pages/Validations.tsx) */
.vv-form { display: flex; flex-direction: column; gap: 14px; }
.vv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.vv-wide { grid-column: 1 / -1; }
.vv-check { display: flex; align-items: flex-start; gap: 8px; padding: 6px 0; font-size: 15px; }
.vv-check input { margin-top: 3px; width: 18px; height: 18px; }
fieldset.field { border: 0; padding: 0; margin: 0; }
fieldset.field legend { font-weight: 500; margin-bottom: 4px; }
.vv-exp-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.vv-exp-card { border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; background: var(--surface); }
.vv-exp-card.on { border-color: var(--teal); background: var(--teal-tint-2); }
.vv-exp-fields { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.vv-crit { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; }
.vv-yellow { background: #FFF6CC !important; border-color: #D8C46A !important; }
.vv-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--field); border-radius: 8px; overflow: hidden; }
.vv-seg button { min-height: 40px; padding: 0 14px; border: 0; background: var(--surface); color: var(--ink-2); cursor: pointer; font-size: 14px; }
.vv-seg button.on { background: var(--teal); color: #fff; font-weight: 500; }
.vv-switch { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--teal-tint-2); }
.vv-switch input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--teal); }
.vv-exp { border-top: 1px solid var(--border-2); padding: 12px 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.vv-exp:first-of-type { border-top: 0; }
.vv-exp-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; width: 100%; }
.vv-exp-head .linkish { margin-left: auto; }
.vv-why { margin: 0; padding-left: 18px; color: var(--alert-ink); }
.vv-edit { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.vv-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.vv-files li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.vv-sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.vv-dl { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.vv-dl dt { color: var(--muted); }
.vv-dl dd { margin: 0; white-space: pre-wrap; }
.vv-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; }
.vv-waiting { display: flex; flex-direction: column; gap: 8px; border-color: var(--amber); }
.vv-wait-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 0; border-top: 1px solid var(--border-2); text-decoration: none; color: var(--ink); }
.vv-wait-row .btn { margin-left: auto; }
.vv-sortbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 14px; position: sticky; top: 0; z-index: 2; }
.vv-sortbar input[type=search] { flex: 1 1 220px; min-height: 44px; }
.vv-sortbar select, .vv-sortbar input { min-height: 44px; }
.vv-sort td { vertical-align: middle; }
.vv-sort tr.vv-unsorted td { background: var(--alert-row); }
.vv-sort tr.vv-ignored td { color: var(--muted); }
.vv-sort .chip { display: inline-flex; gap: 6px; align-items: center; margin: 2px 4px 2px 0; }
.vv-mass { width: 100px; min-height: 40px; font-family: var(--mono); }
.vv-savebar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 -4px 14px rgba(0,0,0,.06); }
.vv-folder-link { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; border-color: var(--teal); }
.vv-packet { display: flex; flex-direction: column; gap: 10px; }
.vv-packet textarea { width: 100%; }
.vv-levels input { width: 110px; }
@media (max-width: 640px) {
  .vv-sort th:nth-child(4), .vv-sort td:nth-child(4) { display: none; }
  .vv-table th:nth-child(4), .vv-table td:nth-child(4), .vv-table th:nth-child(5), .vv-table td:nth-child(5) { display: none; }
  .vv-savebar .btn { width: 100%; justify-content: center; }
  .vv-seg { width: 100%; } .vv-seg button { flex: 1 1 100%; text-align: left; }
}
.vv-addto { margin-top: 6px; min-height: 40px; max-width: 220px; }
.vv-filemeta { flex-basis: 100%; }
@media (max-width: 640px) { .vv-sort th:nth-child(2), .vv-sort td:nth-child(2) { display: none; } }

/* Courses (pages/Courses.tsx): guided courses, one step at a time, with a module list beside the step. */
.course-card { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; }
a.course-card:hover { border-color: var(--teal); }
.course-card-kicker, .course-step-kicker { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--teal); }
.course-card-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.course-meter-wrap { display: flex; align-items: center; gap: 8px; }
.course-meter-wrap .video-meter { flex: 1 1 auto; }
.course-progress { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; }
.course-progress .course-meter-wrap { flex: 1 1 260px; max-width: 520px; }
.course-assign { display: grid; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border-2); }
.course-draft { padding: 12px 0; border-top: 1px solid var(--amber-ink); }
.course-draft:first-of-type { border-top: 0; }
.course-upload-list { columns: 2 220px; margin: 8px 0; padding-left: 18px; }
.course-finished { border: 2px solid var(--teal-light); background: var(--teal-tint-2); }
.course-layout { display: grid; grid-template-columns: minmax(220px, 280px) minmax(0, 1fr); gap: 16px; align-items: start; }
.course-modules { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow-y: auto; }
.course-modules ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.course-modules li button { width: 100%; display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px; border: 1px solid transparent; border-radius: 10px; background: transparent; cursor: pointer; color: var(--ink); }
.course-modules li button > span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.course-modules li button b { font-weight: 500; font-size: 14px; line-height: 1.3; }
.course-modules li button:hover { background: var(--surface); border-color: var(--border); }
.course-modules li.on button { background: var(--surface); border-color: var(--teal); box-shadow: 0 1px 0 var(--border); }
.course-modules li.locked button { opacity: .65; }
.course-mod-num { flex: 0 0 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; background: var(--teal-tint); color: var(--teal); }
.course-modules li.signed .course-mod-num { background: var(--teal); color: #fff; }
.course-modules-toggle { display: none; width: 100%; justify-content: space-between; }
.course-stage { display: flex; flex-direction: column; gap: 12px; min-height: 420px; }
.course-stage h2 { font-size: 24px; }
.course-steps { display: flex; flex-wrap: wrap; gap: 6px; }
.course-steps button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--field); background: var(--surface); cursor: pointer; font-size: 13px; color: var(--ink-2); }
.course-steps button.done { background: var(--teal-tint); border-color: var(--teal-tint); color: var(--teal); font-weight: 600; }
.course-steps button.on { border: 2px solid var(--teal); }
.course-steps button.waits { background: var(--surface); border: 2px dashed var(--mint, #1FA090); color: var(--teal); }
.course-steps button.waits.on { border-style: solid; }
.countersign-prompt { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: 10px 0 0;
  padding: 10px 12px; border-radius: 8px; background: var(--teal-tint); }
.countersign-list { margin: 14px 0 0; padding: 10px 12px; border-radius: 8px; background: var(--teal-tint); }
.countersign-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.countersign-list li { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.course-text p, .course-task p { margin: 0 0 10px; font-size: 16px; line-height: 1.6; max-width: 72ch; }
.course-task { background: var(--amber-tint); border-radius: 10px; padding: 14px 16px; }
.course-points { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.course-points li { position: relative; padding-left: 26px; font-size: 16px; line-height: 1.55; max-width: 76ch; }
.course-points li::before { content: ""; position: absolute; left: 4px; top: .55em; width: 10px; height: 10px; border-radius: 50%; background: #1FA090; }
.course-figure { margin: 0; }
.course-figure img { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--border); background: #fff; }
.course-figure figcaption { margin-top: 6px; }
.course-qc { background: #E3F4F1; border-left: 5px solid #0E5E5E; border-radius: 10px; padding: 14px 18px; }
.course-qc-head { font-weight: 600; color: #0E5E5E; margin-bottom: 8px; }
.course-qc dl { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.course-qc dl > div { display: grid; grid-template-columns: minmax(140px, 240px) 1fr; gap: 12px; }
.course-qc dt { font-weight: 600; color: #0E5E5E; }
.course-qc dd { margin: 0; }
.course-video-links { margin: 0; padding-left: 18px; columns: 2 240px; }
.course-quiz fieldset { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; margin: 0 0 10px; }
.course-quiz fieldset.right { border-color: var(--teal-light); background: var(--teal-tint-2); }
.course-quiz fieldset.wrong { border-color: var(--alert-border); background: var(--alert-row); }
.course-quiz legend { float: left; width: 100%; font-weight: 500; padding: 0; margin-bottom: 6px; }
.course-quiz legend + * { clear: both; }
.course-quiz label { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.course-quiz label input { margin-top: 3px; width: 18px; height: 18px; flex: 0 0 auto; }
.course-quiz label.is-answer { font-weight: 600; }
.course-confirm { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--teal-tint-2); border: 1px solid var(--teal-tint); cursor: pointer; }
.course-confirm input { width: 20px; height: 20px; margin-top: 1px; flex: 0 0 auto; }
.course-nav { display: flex; justify-content: space-between; gap: 10px; margin-top: auto; padding: 12px 84px 0 0; border-top: 1px solid var(--border-2); }  /* room for Quali in the corner */
.course-signoff-box { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 10px; background: var(--teal-tint-2); }
.course-signoff-box .btn { align-self: flex-start; }
.course-preview-mod summary { cursor: pointer; }
.course-preview-step { padding: 14px 0; border-top: 1px solid var(--border-2); display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) {
  .course-layout { grid-template-columns: minmax(0, 1fr); }
  .course-modules { position: static; max-height: none; overflow: visible; }
  .course-modules-toggle { display: inline-flex; }
  .course-modules ol { display: none; margin-top: 6px; }
  .course-modules.is-open ol { display: flex; }
  .course-qc dl > div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 720px) {
  .course-stage { padding: 14px; min-height: 0; }
  .course-stage h2 { font-size: 20px; }
  .course-nav { position: sticky; bottom: 0; background: var(--surface); padding-bottom: 6px; }
  .course-nav .btn { flex: 1 1 0; justify-content: center; }
}

/* Training > Training file */
.tf-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 12px 0; }
.tf-count { display: flex; flex-direction: column; align-items: flex-start; padding: 10px 14px; margin: 0; }
.tf-count b { font-size: 1.5rem; color: var(--teal, #0E5E5E); line-height: 1.1; }
.tf-files, .tf-videos { list-style: none; margin: 0; padding: 0; }
.tf-files li { margin: 2px 0; word-break: break-word; }
.tf-videos li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--line, #E3ECEA); }
.tf > section.card { margin-top: 12px; }
.course-workbook { display: inline-flex; gap: 8px; align-items: center; }
.course-add-missing { margin: 8px 0 4px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.course-add-missing > p, .course-add-missing > ul { flex-basis: 100%; margin: 4px 0; }

/* ---- Internal audits: dashboard, scenes and on-the-floor mode (2026-11-07) ------------------------------------ */
.pill.type-horizontal { background: #E6EEF6; color: #1F4766; }
.pill.type-vertical { background: var(--teal-tint); color: var(--teal-dark); }
.pill.type-witness { background: #F1E9F7; color: #55306E; }
.late-text { color: var(--alert); font-weight: 600; }
.audit-dash { display: flex; flex-direction: column; gap: 16px; }
.year-pick { display: inline-flex; align-items: center; gap: 8px; }
.year-pick b { font-size: 18px; min-width: 3.2em; text-align: center; }
.aw-hero { display: grid; grid-template-columns: minmax(240px, 340px) 1fr; gap: 20px; align-items: center; }
.aw-wheel { position: relative; width: 100%; max-width: 340px; margin: 0 auto; }
.aw-wheel svg { width: 100%; height: auto; display: block; overflow: visible; }
.aw-key { margin: 8px 4px 0; text-align: center; line-height: 1.35; }
.aw-year { font: 700 13px var(--sans); fill: #8E9C97; letter-spacing: .08em; }
.aw-count-t { font: 500 12.5px var(--sans); fill: #0E5E5E; }
.aw-arc { stroke-linecap: butt; }
.aw-arc.empty { stroke: #E3E8E6; } .aw-arc.busy { stroke: #7FE0CF; } .aw-arc.done { stroke: #0E5E5E; } .aw-arc.late { stroke: #F3C3B1; }
.aw-arc.now { filter: drop-shadow(0 0 3px rgba(14, 94, 94, .45)); }
.aw-mon { font: 600 10px var(--sans); fill: var(--muted); } .aw-mon.now { fill: var(--teal-dark); }
.aw-hand { stroke: #2C4A44; stroke-width: 3.2; stroke-linecap: round; }
.aw-pin { fill: #2C4A44; }
.aw-dot { fill: #C9D3CF; } i.aw-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #C9D3CF; margin-right: 5px; vertical-align: -1px; }
.aw-dot.closed { fill: #0E5E5E; } i.aw-dot.closed { background: #0E5E5E; }
.aw-dot.reported { fill: #1FA090; } i.aw-dot.reported { background: #1FA090; }
.aw-dot.in_progress { fill: #7FE0CF; stroke: #1FA090; stroke-width: 1; } i.aw-dot.in_progress { background: #7FE0CF; }
.aw-dot.late { fill: #D9481F; } i.aw-dot.late { background: #D9481F; }
.aw-perch { position: absolute; left: 20%; top: 26.2%; transform: translate(-50%, -100%); pointer-events: none; }
.aw-perch > svg { display: block; }
.aw-glow { fill: #F7B24A; opacity: .35; animation: aw-glow 2.4s ease-in-out infinite; }
.aw-lamp { fill: #2C4A44; } .aw-flame { fill: #FFC861; }
@keyframes aw-glow { 50% { opacity: .15; } }
.aw-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; }
.aw-stats .stat.warn b { color: var(--alert); }
.fieldnotes { position: relative; background: #FFFDF6; border: 1px solid #E6DCC6; border-radius: 4px 12px 12px 4px; padding: 14px 16px 14px 30px;
  background-image: repeating-linear-gradient(#FFFDF6 0 27px, #EDE6D4 27px 28px); box-shadow: 2px 3px 0 #EFE7D3; }
.fieldnotes::before { content: ""; position: absolute; left: 10px; top: 12px; bottom: 12px; width: 6px; background: radial-gradient(circle, #B8AC93 2.5px, transparent 3px) 0 0 / 6px 14px repeat-y; }
.fn-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.fieldnotes ol { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 10px; }
.fieldnotes li { line-height: 1.45; } .fieldnotes li > span { display: block; margin-bottom: 4px; }
.fieldnotes li.late::marker { color: var(--alert); font-weight: 700; } .fieldnotes li.ok::marker { color: var(--teal); }
.layers { display: flex; flex-direction: column; gap: 14px; }
.layer { display: flex; flex-direction: column; gap: 4px; }
.layer-bar { position: relative; height: 14px; border-radius: 7px; background: #EEF2F0; overflow: hidden; }
.layer-bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 7px; }
.layer-bar .planned { background: #7FE0CF; } .layer-bar .done { background: #0E5E5E; }
.layer-bar .gap { background: repeating-linear-gradient(45deg, #F3C3B1 0 6px, #FBEDE5 6px 12px); border-radius: 0 7px 7px 0; }
.library-wrap { display: flex; flex-direction: column; gap: 12px; }
.lib-key { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; }
.lib-q { margin: 0; font-size: 14px; line-height: 1.4; }
.lib-score { grid-row: span 2; display: flex; flex-direction: column; align-items: center; background: #E3F7F2; border-radius: 12px; padding: 8px 14px; color: #0E5E5E; text-align: center; }
.lib-score b { font-size: 30px; line-height: 1; } .lib-score span { font-size: 12px; max-width: 90px; }
.lib-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; }
.lib-legend li { display: flex; align-items: center; gap: 6px; }
.lib-swatch { display: inline-block; width: 12px; height: 20px; border-radius: 2px 2px 0 0; }
.lib-swatch.done { background: #0E5E5E; } .lib-swatch.planned { background: #3DBFA9; } .lib-swatch.gap { background: #FFFDF8; border: 2px dashed #E8A585; box-sizing: border-box; }
.library { position: relative; display: flex; flex-direction: column; gap: 0; padding: 14px 14px 0; border-radius: 8px 8px 4px 4px;
  background: linear-gradient(90deg, #B98552 0, #D3A26B 14px, #D3A26B calc(100% - 14px), #B98552 100%);
  box-shadow: 0 10px 18px -12px rgba(60,40,20,.55), inset 0 3px 0 #E2B884; }
.library::before { content: ""; position: absolute; left: -6px; right: -6px; top: -8px; height: 12px; border-radius: 4px; background: linear-gradient(#DDB27C, #B98552); box-shadow: 0 2px 3px rgba(60,40,20,.25); }
.shelf { position: relative; padding: 10px 10px 0; background: linear-gradient(180deg, #E7CFA6 0, #F2E1C2 22px, #F5E7CC 100%);
  box-shadow: inset 0 10px 10px -8px rgba(90,60,30,.45), inset 6px 0 8px -6px rgba(90,60,30,.25), inset -6px 0 8px -6px rgba(90,60,30,.25); }
.shelf::after { content: ""; display: block; height: 16px; margin: 0 -10px; background: linear-gradient(#DDB27C, #C08A55 70%, #A87444); box-shadow: 0 3px 4px -1px rgba(60,40,20,.35); }
.shelf + .shelf { margin-top: 10px; }
.shelf-tag { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13px; color: #6B4E33; margin-bottom: 8px; }
.shelf-tag b { font-weight: 700; } .shelf-tag span { font-weight: 600; font-size: 12px; } .shelf-tag .all { color: #0E5E5E; }
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); align-items: end; gap: 6px 5px; padding-bottom: 0; }
.book { position: relative; border: 0; cursor: pointer; width: 100%; max-width: 110px; height: 132px; border-radius: 5px 5px 2px 2px; display: flex; flex-direction: column; align-items: stretch;
  padding: 10px 6px 0; gap: 6px; font: inherit; color: inherit; text-align: center; transition: transform .15s, box-shadow .15s;
  box-shadow: inset 4px 0 0 rgba(255,255,255,.18), inset -5px 0 0 rgba(0,0,0,.14), 0 1px 0 rgba(0,0,0,.12); }
.book:nth-child(3n+2) { height: 126px; } .book:nth-child(3n) { height: 136px; }
.book-label { display: flex; flex-direction: column; gap: 2px; background: #FFFDF8; border-radius: 4px; padding: 6px 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); color: #15332E; }
.book-label b { font: 700 17px var(--mono, monospace); line-height: 1.1; }
.book-label span { font-size: 12px; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-state { font-size: 10.5px; font-weight: 700; letter-spacing: .2px; color: #fff; }
.book-ring { position: absolute; left: 50%; bottom: 12px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: rgba(0,0,0,.18); box-shadow: inset 0 2px 2px rgba(0,0,0,.25); }
.book.done { background-color: #0E5E5E; } .book:nth-child(4n+2).done { background-color: #126B6B; }
.book.planned { background-color: #3DBFA9; } .book.planned .book-state { color: #0B3F3F; } .book:nth-child(4n+3).planned { background-color: #34B39E; }
.book.gap { background: rgba(255,253,248,.55); box-shadow: none; outline: 2px dashed #D9946F; outline-offset: -2px; }
.book.gap .book-label { background: transparent; box-shadow: none; color: #8B5A3C; } .book.gap .book-state { color: #B4532E; } .book.gap .book-ring { display: none; }
.book:hover { transform: translateY(-5px); }
.book.open, .book:focus-visible { outline: 3px solid #F2C76B; outline-offset: 2px; transform: translateY(-5px); }
@media (prefers-reduced-motion: reduce) { .book { transition: none; } .book:hover, .book.open { transform: none; } }
.lib-card { background: #FFFDF6; border: 1px solid #E8DCC8; border-radius: 10px; padding: 10px 14px; margin: 0; color: var(--ink); font-size: 14px; }
.lib-card p { margin: 0; } .lib-card ul { margin: 6px 0 0; padding-left: 18px; } .lib-card.gap { border-color: #E8A585; }
@media (max-width: 720px) { .lib-key { grid-template-columns: 1fr; } .lib-score { grid-row: auto; flex-direction: row; gap: 8px; justify-content: flex-start; } .lib-score span { max-width: none; }
  .library { padding: 12px 10px 0; } .books { grid-template-columns: repeat(3, minmax(0, 1fr)); } .book { max-width: none; min-width: 0; } .book-label span { white-space: normal; overflow-wrap: anywhere; } }
.fill-form { display: flex; flex-direction: column; gap: 12px; }
.chip.on { border-color: var(--teal); background: var(--teal-tint); }
.grid-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.plan-audit { display: flex; flex-direction: column; gap: 14px; }
.type-cards { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.type-cards legend { font-weight: 600; margin-bottom: 8px; }
.type-card { position: relative; display: flex; flex-direction: column; gap: 4px; border: 2px solid var(--border); border-radius: 12px; padding: 14px 16px; cursor: pointer; background: var(--surface); min-height: 44px; }
.type-card input { position: absolute; opacity: 0; pointer-events: none; }
.type-card.on { border-color: var(--teal); background: var(--teal-tint-2); }
.type-card:focus-within { outline: 3px solid var(--teal-light); outline-offset: 2px; }
.audit-top { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.audit-side { display: flex; flex-direction: column; gap: 12px; }
.audit-side .stats { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
.audit-side .stat { padding: 10px 12px; } .audit-side .stat b { font-size: 22px; }
.scene-card { display: flex; flex-direction: column; gap: 12px; }
.btn.big-go { min-height: 52px; font-size: 16px; }
@media (max-width: 720px) { .scene-card .big-go { order: -1; } }
.found-box { display: flex; flex-direction: column; gap: 2px; font-size: 13px; padding: 8px 12px; border-radius: 8px; background: var(--teal-tint-2); border-left: 4px solid #1FA090; }
.found-box.problem { background: var(--alert-row); border-left-color: #D9481F; } .found-box.check { background: #F4F6F5; border-left-color: #A9B8B2; }
.aq { border-top: 1px solid var(--line, #E3E7E5); padding-top: 10px; display: flex; flex-direction: column; gap: 8px; scroll-margin-top: 80px; }
.trace-form { display: flex; flex-direction: column; gap: 12px; }
.trace-form fieldset { border: 0; padding: 0; margin: 0; } .trace-form legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; }

/* the scenes: tree (vertical), rafter (horizontal), post (witness) */
.scene { position: relative; border-radius: 14px; overflow: hidden; isolation: isolate; }
.scene .ground { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34px; z-index: -1; }
/* tree: sky to meadow, a canopy that fills out, buds that open into leaves */
.tree { background: linear-gradient(180deg, #E4F6F1 0%, #F4FBF8 55%, #EEF7E9 100%); padding: 8px 8px 34px; }
.tree-top { position: relative; display: flex; justify-content: center; margin: 0 auto -18px; width: min(320px, 92%); z-index: 1; }
.tree .crown { width: 100%; height: auto; display: block; }
.tree .crown .clump { transform-box: fill-box; transform-origin: center; animation: clump-in .5s ease-out both; }
@keyframes clump-in { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }
.crown-owl { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); }
.tree-done { text-align: center; margin: 22px 0 0; font-weight: 600; color: #0E5E5E; }
.tree ol { list-style: none; margin: 0; padding: 18px 0 0; position: relative; display: flex; flex-direction: column; gap: 4px; }
.tree ol::before { content: ""; position: absolute; left: 50%; top: 0; bottom: -34px; width: 18px; transform: translateX(-50%); border-radius: 9px 9px 0 0;
  background: repeating-linear-gradient(180deg, transparent 0 22px, rgba(0,0,0,.08) 22px 24px), linear-gradient(90deg, #6B4E33, #9C7A55 45%, #7A5B3E); }
.tree .br { position: relative; display: flex; width: 50%; }
.tree .br.l { justify-content: flex-end; padding-right: 16px; } .tree .br.r { margin-left: 50%; padding-left: 16px; }
.tree .br::before { content: ""; position: absolute; top: 50%; height: 5px; width: 26px; background: #8B6B4A; border-radius: 3px; }
.tree .br.l::before { right: 0; transform: rotate(-8deg); } .tree .br.r::before { left: 0; transform: rotate(8deg); }
.br-btn { display: flex; align-items: center; gap: 8px; background: rgba(255,255,255,.72); border: 0; padding: 4px 8px; cursor: pointer; text-align: left; border-radius: 12px; font: inherit; color: inherit; min-height: 44px; }
.tree .br.l .br-btn { flex-direction: row-reverse; text-align: right; }
.br-btn:hover, .br-btn:focus-visible { background: #fff; box-shadow: 0 1px 4px rgba(14,94,94,.18); }
.br-text { display: flex; flex-direction: column; line-height: 1.2; }
.leaf { flex: none; width: 34px; height: 34px; border-radius: 0 60% 0 60%; display: grid; place-items: center; font-weight: 700; font-size: 13px;
  background: #F1FAF6; color: #0E5E5E; border: 2px dashed #7FE0CF; transition: background .3s, transform .3s; }
.leaf > span { transform: none; }
.br.pass .leaf { background: linear-gradient(135deg, #3DBFA9, #1FA090); color: #fff; border: 0; transform: rotate(-6deg); }
.br.fail .leaf { background: #D9481F; color: #fff; border: 0; }
.br.observation .leaf { background: #F2C76B; color: #5A3D00; border: 0; } .br.not_applicable .leaf { background: #C9D3CF; color: #3E4A46; border: 0; }
.br.here .leaf { border: 2px solid #1FA090; box-shadow: 0 0 0 4px rgba(127,224,207,.55); }
.tree .perch { position: absolute; top: -24px; z-index: 2; animation: tree-hop .5s ease-out 1; }
.tree .br.l .perch { left: calc(100% - 36px); } .tree .br.r .perch { left: -12px; }
@keyframes tree-hop { 0% { transform: translateY(-26px); } 70% { transform: translateY(3px); } 100% { transform: none; } }
/* illustrated barn (horizontal) and meadow fence (witness) */
.rafter-art, .post-art { max-width: 640px; margin: 0 auto; width: 100%; }
.scene .tag, .scene .picket { cursor: pointer; outline: none; }
.scene .tag:hover rect:last-of-type, .scene .picket:hover path:first-of-type { filter: brightness(1.08); }
.scene .tag:focus-visible rect, .scene .picket:focus-visible path:first-of-type { stroke: #0E5E5E; stroke-width: 3; }
.scene .tag { transform-box: fill-box; transform-origin: 50% 0; }
.scene .tag:hover { animation: tag-swing .7s ease-in-out; }
@keyframes tag-swing { 30% { rotate: 7deg; } 70% { rotate: -5deg; } 100% { rotate: 0deg; } }
.scene .tag-t { font-size: 14px; font-weight: 700; }
.walker-art { position: absolute; transform: translate(-50%, -100%); pointer-events: none; transition: left .9s cubic-bezier(.4,0,.3,1), top .9s ease; }
.walker-art:not(.done) .mascot { animation: pl-sidestep 1.1s steps(2, jump-none) infinite; transform-origin: 50% 95%; }
.post-owl-art { position: absolute; transform: translate(-50%, -100%); pointer-events: none; }
.scene-foot { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.3;
  background: rgba(255,255,255,.9); border-radius: 10px; padding: 8px 12px; color: #15332E; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.scene-foot > span:first-child { flex: none; white-space: nowrap; color: #0E5E5E; }
.post-art .scene-foot { left: 24%; }
@media (max-width: 720px) { .scene-foot { flex-direction: column; gap: 2px; } .post-art .scene-foot { left: 10px; } }

/* on the floor: one question at a time */
.focus-mode { position: fixed; inset: 0; z-index: 60; background: rgba(21, 32, 28, .55); display: flex; align-items: stretch; justify-content: center; }
.fm-in { background: var(--surface); width: 100%; max-width: 640px; overflow-y: auto; padding: 16px 18px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.fm-top { display: flex; align-items: center; gap: 10px; position: sticky; top: -16px; background: var(--surface); padding: 6px 0; z-index: 1; }
.fm-progress { flex: 1; height: 8px; background: #EEF2F0; border-radius: 4px; overflow: hidden; } .fm-progress i { display: block; height: 100%; background: #1FA090; }
.fm-q { font-size: 20px; line-height: 1.3; margin: 0; }
.fm-results { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fm-results button { min-height: 56px; font-size: 16px; font-weight: 600; border-radius: 12px; border: 2px solid var(--border); background: #fff; cursor: pointer; color: inherit; }
.fm-results .result-pass.on { background: #0E5E5E; border-color: #0E5E5E; color: #fff; } .fm-results .result-fail.on { background: #D9481F; border-color: #D9481F; color: #fff; }
.fm-results .result-observation.on { background: #B7791F; border-color: #B7791F; color: #fff; } .fm-results .result-not_applicable.on { background: #5F6B67; border-color: #5F6B67; color: #fff; }
.fm-in textarea { width: 100%; font-size: 16px; }
.fm-nav { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; position: sticky; bottom: calc(-24px - env(safe-area-inset-bottom)); background: var(--surface); padding: 10px 0; }
.fm-nav .btn { min-height: 50px; }
@media (min-width: 721px) { .focus-mode { align-items: center; padding: 24px; } .fm-in { border-radius: 16px; max-height: 92vh; } }
@media (max-width: 900px) { .audit-top { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .aw-hero { grid-template-columns: 1fr; }
  .aw-wheel { max-width: 300px; }
  .tree ol::before { left: 46px; }
  .tree .br, .tree .br.l, .tree .br.r { width: auto; margin-left: 0; padding-left: 62px; padding-right: 0; justify-content: flex-start; }
  .tree .br.l::before, .tree .br.r::before { left: 48px; right: auto; width: 16px; transform: rotate(8deg); }
  .tree-top { margin-left: -26px; margin-right: auto; width: 160px; }
  .tree .ground .roots { display: none; }
  .tree .br.l .br-btn { flex-direction: row; text-align: left; }
  .tree .br.l .perch, .tree .br.r .perch { left: auto; right: 0; top: 0; }
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody, table.stack-sm tr, table.stack-sm td { display: block; width: 100%; }
  table.stack-sm tr { border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.stack-sm td { border: 0; padding: 3px 0; }
  table.stack-sm td[data-label]::before { content: attr(data-label) " · "; color: var(--muted); font-size: 12px; }
  .fm-open { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) { .scene .tag, .walker-art, .walker-art .mascot, .aw-glow { animation: none !important; transition: none !important; } }
.aw-stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
/* illustrated scenes (SVG): the trace tree */
.tree-art { max-width: 640px; margin: 0 auto; width: 100%; }
.scene .art { display: block; width: 100%; height: auto; }
.tree-art .clump { transform-box: fill-box; transform-origin: center; animation: clump-in .5s ease-out both; }
.tree-step { cursor: pointer; outline: none; }
.tree-step .step-hit { fill: transparent; }
.tree-step:hover .step-hit { fill: transparent; }
.tree-step:focus-visible .step-hit { fill: transparent; stroke: #0E5E5E; stroke-width: 2; }
.tree-art .step-name { font: 600 15px var(--font, inherit); fill: #15332E; }
.tree-step.pass .step-name { fill: #0E5E5E; }
.tree-art .step-state { font-size: 12.5px; fill: #5F6B67; }
.tree-art .step-flag { font-size: 12px; font-weight: 600; fill: #0E5E5E; }
.tree-art .leaf-t { font-size: 13px; font-weight: 700; }
.tree-art .leaf-glow { animation: leaf-glow 1.8s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes leaf-glow { 50% { transform: scale(1.15); opacity: .15; } }
.perch-art { position: absolute; transform: translate(-50%, -100%); pointer-events: none; z-index: 2; transform-origin: 50% 100%; }
.perch-art > svg, .walker-art > svg, .post-owl-art > svg { display: block; }
.perch-art, .walker-art, .post-owl-art { overflow: visible; }
.nest-front { position: absolute; left: 50%; bottom: -5px; transform: translateX(-50%); pointer-events: none; }
.next-card { margin-top: 10px; padding: 12px 14px; border-radius: 12px; background: #F1FAF6; border: 1px solid rgba(14,94,94,.14); display: flex; flex-direction: column; gap: 6px; }
.next-card.problem { background: #FFF6F2; border-color: rgba(217,72,31,.25); }
.next-card.done { background: #F1FAF6; }
.next-card p { margin: 0; font-size: 14px; line-height: 1.4; }
.next-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.next-kicker { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #1FA090; }
.next-head b { font-size: 17px; color: #15332E; }
.next-q { color: #15332E; } .next-q.big { font-size: 17px; font-weight: 600; }
@media (max-width: 720px) { .scene-card .next-card { order: -1; margin: 0 0 2px; } .next-foot { flex-direction: column; align-items: stretch; } .next-foot .btn { width: 100%; } }
.next-found { padding: 6px 10px; border-radius: 8px; background: #F4F6F5; border-left: 4px solid #A9B8B2; }
.next-found.ok { background: var(--teal-tint-2, #E3F4F1); border-left-color: #1FA090; } .next-found.problem { background: var(--alert-row, #FDECE6); border-left-color: #D9481F; }
.next-tip { color: #3E4F4A; } .next-tip b { color: #0E5E5E; }
.next-nest { color: #5F6B67; } .next-nest b { color: #0E5E5E; }
.next-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 2px; }
.next-foot .btn { min-height: 44px; }
.perch-art.sit { animation: tree-hop .5s ease-out 1; }
.perch-art.crouch .mascot { animation: owl-crouch .22s ease-in both; transform-origin: 50% 95%; }
@keyframes owl-crouch { to { transform: scaleY(.84) scaleX(1.08) translateY(2px); } }
.perch-art.land .mascot { animation: owl-land .42s cubic-bezier(.3,1.6,.5,1) both; transform-origin: 50% 95%; }
@keyframes owl-land { 0% { transform: scaleY(.8) scaleX(1.12); } 60% { transform: scaleY(1.06) scaleX(.96); } 100% { transform: none; } }
.quali-fly .wing { transform-box: fill-box; animation: wing-beat .16s ease-in-out infinite alternate; }
.quali-fly .wing-l { transform-origin: 100% 40%; } .quali-fly .wing-r { transform-origin: 0% 40%; }
@keyframes wing-beat { from { transform: rotate(-28deg); } to { transform: rotate(22deg); } }
.quali-fly .wing-r { animation-name: wing-beat-r; } @keyframes wing-beat-r { from { transform: rotate(28deg); } to { transform: rotate(-22deg); } }
.tree-step.landed { animation: branch-dip .45s ease-out 1; transform-box: fill-box; transform-origin: 0 50%; }
@keyframes branch-dip { 30% { transform: rotate(2.2deg); } 65% { transform: rotate(-1deg); } 100% { transform: none; } }
.perch-art.done { transform: translate(-50%, -60%); }
.medal-wrap { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); transform-origin: 50% 0; animation: medal-drop .9s cubic-bezier(.3,1.5,.5,1) .4s both; }
@keyframes medal-drop { 0% { transform: translateX(-50%) translateY(-30px) scale(.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: translateX(-50%); opacity: 1; } }
.medal .glint { animation: medal-glint 2.6s ease-in-out 1.4s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes medal-glint { 0%, 20%, 100% { opacity: .35; transform: scale(1); } 10% { opacity: 1; transform: scale(1.8); } }
.confetti ellipse { animation: confetti-fall 2.4s ease-in 1 both; transform-box: fill-box; transform-origin: center; }
@keyframes confetti-fall { 0% { transform: translate(0, 0) rotate(0); opacity: 0; } 8% { opacity: 1; } 100% { transform: translate(var(--dx), 420px) rotate(var(--spin)); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mascot.impatient .mascot-foot-r, .mascot.impatient .mascot-pupils, .tree-art .clump, .tree-art .leaf-glow, .perch-art, .perch-art .mascot, .tree-step, .medal-wrap, .medal .glint, .confetti ellipse { animation: none !important; transition: none !important; } }
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }
.tree-art .step-pill { fill: rgba(255,255,255,.82); stroke: rgba(14,94,94,.08); }
.tree-step:hover .step-pill, .tree-step:focus-visible .step-pill { fill: #fff; stroke: #1FA090; }
/* Validations: AOAC Appendix K / J criteria (Jared 2026-11-08) */
.vv-aoac { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; border: 1px solid var(--line, #E3ECEA); border-radius: 10px; background: #F4FAF8; }
.vv-aoac .field { max-width: 520px; }
.vv-src { display: block; color: #5D6B6B; line-height: 1.35; margin-top: 2px; }
.vv-src.changed { color: #8A5A00; }
.vv-design summary { cursor: pointer; color: var(--teal); }
.vv-design p { margin: 6px 0 2px; }
.vv-check .pill { margin-left: 6px; }
.vv-exp-card .vv-seg { display: flex; width: 100%; }
.vv-exp-card .vv-seg button { flex: 1 1 100%; text-align: left; }
.vv-exp-card .vv-seg button + button { border-top: 1px solid var(--field); }

/* ---- Signature pages in a course, and getting started (2026-11-08) ---------------------------------------------- */
.sign-page { display: flex; flex-direction: column; gap: 14px; }
.sign-sheet { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 22px 26px; box-shadow: 0 1px 0 var(--border-2), 0 6px 18px rgba(16, 32, 30, 0.06); }
.sign-page-text p { margin: 0 0 10px; line-height: 1.55; }
.sign-page-text h3 { color: var(--teal); font-size: 15px; margin: 14px 0 6px; }
.sign-page-text .sign-bullet { padding-left: 14px; margin-bottom: 4px; }
.sign-page-text .sign-sub { padding-left: 32px; margin-bottom: 4px; color: var(--ink-2); }
.sign-form { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 10px; background: var(--teal-tint-2); border: 1px solid var(--teal-tint); }
.sign-fields { display: flex; gap: 12px; flex-wrap: wrap; }
.sign-fields .field { flex: 1 1 220px; }
.sign-name { font-size: 17px !important; }
.sign-form .btn { align-self: flex-start; }
.sign-done { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 10px; background: #E3F4F1; border-left: 5px solid #1FA090; }
.sign-check { display: inline-flex; width: 22px; height: 22px; border-radius: 50%; background: #1FA090; color: #fff; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.sign-links { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 2px 0 0; }
.gate-home { max-width: 760px; display: flex; flex-direction: column; gap: 18px; padding: 26px 28px; }
.gate-hero { display: flex; gap: 18px; align-items: center; }
.gate-hero h1 { font-size: 28px; }
.gate-hero p { margin: 6px 0 0; color: var(--ink-2); }
.start-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.start-steps li { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color .2s ease, background-color .2s ease; }
.start-steps li.next { border-color: #1FA090; background: var(--teal-tint-2); }
.start-steps li.done { opacity: .75; }
.start-num { flex: none; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; background: var(--teal-tint); color: var(--teal); }
.start-steps li.next .start-num { background: #0E5E5E; color: #fff; }
.start-steps li.done .start-num { background: #1FA090; color: #fff; }
.start-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.start-steps .btn { flex: none; }
.start-steps.compact li { padding: 10px 12px; gap: 10px; }
.start-steps.compact .start-num { width: 24px; height: 24px; font-size: 13px; }
.gate-progress { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gate-progress .course-meter { flex: 1 1 160px; }
.quali-welcome { max-width: 560px; gap: 14px; padding: 22px; }
.quali-welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 600px) {
  .sign-sheet { padding: 16px; }
  .gate-home { padding: 18px 16px; }
  .gate-hero { flex-direction: column; text-align: center; gap: 10px; }
  .gate-hero h1 { font-size: 23px; }
  .start-steps li { flex-wrap: wrap; }
  .start-steps .btn { width: 100%; }
  .quali-welcome { max-height: 92vh; overflow: auto; }
}
@media (max-width: 600px) { .quali-welcome-actions .btn { flex: 1 1 100%; } .quali-welcome .gate-hero { text-align: center; } }
.quali-more { margin: 2px 0 0; color: var(--muted, #5b6b6b); }
.quali-more .help-link { display: inline; padding: 0; font-size: inherit; }
.quali-back { margin-bottom: 4px; font-size: 0.9em; }

/* ---- Lab records (electronic bench forms): phone first, big touch targets (Jared, 2026-11-08) ---- */
.lr-page { padding-bottom: 96px; }
.lr-head h1 { margin-bottom: 2px; }
.lr-form { display: flex; flex-direction: column; gap: 16px; }
.lr-section { padding: 16px 18px; }
.lr-section-title { margin: 0 0 12px; font-size: 15px; color: var(--teal); text-transform: uppercase; letter-spacing: .04em; }
.lr-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 20px; }
.lr-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lr-field.wide, .lr-field.lr-table, .lr-field.calc { grid-column: 1 / -1; }
.lr-label { font-size: 15px; font-weight: 500; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.lr-hint { font-size: 13px; font-weight: 400; color: var(--muted); }
.lr-req { color: var(--alert); }
.lr-help { font-size: 13px; color: var(--muted); }
.lr-note { margin: 0; grid-column: 1 / -1; padding: 10px 12px; background: var(--teal-tint-2); border-radius: 8px; font-size: 14px; }
.lr-inputwrap { position: relative; display: flex; }
.lr-field input, .lr-field select, .lr-field textarea { width: 100%; min-height: 52px; padding: 10px 14px; font-size: 18px; border: 1.5px solid var(--field); border-radius: 10px; background: #fff; }
.lr-field.number input { font-family: var(--mono); font-size: 22px; padding-right: 72px; }
.lr-field textarea { font-size: 16px; min-height: 80px; }
.lr-unit { font-size: 16px; color: var(--muted); margin-left: 8px; }
.lr-unit.in { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 17px; font-weight: 500; color: var(--ink-2); pointer-events: none; }
.lr-calc { min-height: 52px; display: flex; align-items: center; padding: 8px 14px; border-radius: 10px; background: var(--teal-tint-2); border: 1.5px dashed var(--teal-light); font-size: 22px; font-family: var(--mono); }
.lr-calc b { font-weight: 600; color: var(--teal-dark); }
.lr-ro { min-height: 40px; display: flex; align-items: center; font-size: 17px; }
.lr-field.flagged input, .lr-field.flagged .lr-calc, .lr-field.flagged .lr-pickbtn { border-color: var(--amber); background: var(--amber-tint); }
.lr-flag { font-size: 13px; color: var(--amber-ink); font-weight: 500; }
.lr-check { display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 8px 14px; border: 1.5px solid var(--field); border-radius: 10px; background: #fff; font-size: 16px; cursor: pointer; }
.lr-check input { width: 26px; height: 26px; min-height: 0; accent-color: var(--teal); flex: none; }
.lr-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.lr-choice { min-height: 52px; padding: 0 18px; border-radius: 10px; border: 1.5px solid var(--field); background: #fff; font-size: 16px; cursor: pointer; flex: 1 1 auto; }
.lr-choice.on { background: var(--teal); border-color: var(--teal); color: #fff; font-weight: 500; }
.lr-pickbtn { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 14px; border: 1.5px solid var(--field); border-radius: 10px; background: #fff; font-size: 16px; text-align: left; cursor: pointer; width: 100%; }
.lr-pickbtn.has { border-color: var(--teal); background: var(--teal-tint-2); }
.lr-pickbtn svg { flex: none; color: var(--teal); }
.lr-table .lr-rows { display: flex; flex-direction: column; gap: 10px; }
.lr-row { position: relative; padding: 12px 14px 12px 44px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg); }
.lr-rownum { position: absolute; left: 12px; top: 12px; width: 24px; height: 24px; border-radius: 50%; background: var(--teal); color: #fff; font-size: 13px; display: grid; place-items: center; }
.lr-row .lr-fields { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 16px; }
.lr-addrow { align-self: flex-start; }
.lr-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); box-shadow: 0 -4px 16px rgba(0,0,0,.06); }
@media (min-width: 900px) { .lr-bar { left: var(--nav-width, 240px); } }
.lr-bar .lr-saved { margin-right: auto; }
body.has-lr-bar .help-fab { bottom: 92px; } body.has-lr-bar .help-nudge { bottom: 102px; } body.has-lr-bar .help-panel, body.has-lr-bar .help-toast { bottom: 172px; }
.lr-sign { min-height: 52px; font-size: 17px; padding: 0 24px; }
.lr-bar.in-frame { position: static; box-shadow: none; padding: 10px 14px; margin-top: 8px; border-radius: 0 0 24px 24px; }
.lr-done { border: 2px solid var(--teal); background: var(--teal-tint-2); }
.lr-done-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.lr-correct textarea { width: 100%; min-height: 70px; font-size: 16px; padding: 10px 12px; border: 1.5px solid var(--field); border-radius: 10px; }
.lr-confirm { display: flex; flex-direction: column; gap: 10px; max-width: 480px; }
.lr-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.lr-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; }
.lr-tile b { font-size: 17px; }
.lr-tile.draft { border-color: var(--teal); background: var(--teal-tint-2); }
.lr-tile.gated { background: var(--bg); }
.lr-tile-kicker { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.lr-start { margin-top: 8px; min-height: 52px; font-size: 17px; justify-content: center; }
.lr-gate { margin-top: 8px; font-size: 14px; color: var(--amber-ink); background: var(--amber-tint); padding: 8px 10px; border-radius: 8px; }
.lr-drafts { border-color: var(--teal); }
.lr-filters { display: flex; gap: 8px; flex-wrap: wrap; }
.lr-filters select { min-height: 40px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--field); }
.lr-exlist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.lr-lots { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.lr-close { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.lr-close input { flex: 1 1 220px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--field); border-radius: 8px; }
.lr-picker { display: flex; flex-direction: column; gap: 10px; width: min(560px, 100%); max-height: 86vh; }
.lr-picker-search { display: flex; gap: 8px; }
.lr-picker-search input { flex: 1; min-height: 52px; font-size: 17px; padding: 8px 14px; border: 1.5px solid var(--field); border-radius: 10px; }
.lr-picker-list { display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.lr-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; text-align: left; padding: 12px 14px; min-height: 60px; border: 1px solid var(--border); border-radius: 10px; background: #fff; cursor: pointer; font: inherit; }
.lr-pick:hover { border-color: var(--teal); }
.lr-pick.expired { opacity: .7; }
.lr-pick-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lr-pick-main b { font-size: 16px; }
@media (max-width: 720px) {
  .lr-fields, .lr-row .lr-fields { grid-template-columns: 1fr; }
  .lr-field input, .lr-field select { min-height: 56px; font-size: 19px; }
  .lr-field.number input { font-size: 24px; }
  .lr-section { padding: 14px; }
  .lr-tiles { grid-template-columns: 1fr; }
  .lr-pick { flex-wrap: wrap; } .lr-pick .pill { margin-left: 0; }
  .lr-bar { justify-content: space-between; }
  .lr-bar .lr-sign { flex: 1 1 auto; justify-content: center; }
  .lr-bar .btn.danger.small { display: none; }
}
/* the form builder (Settings > Lab records) */
.lfb { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 440px); gap: 24px; align-items: start; }
.lfb-left { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.lfb-right { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 8px; }
.lfb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px 14px; }
.lfb-grid .field.wide { grid-column: 1 / -1; }
.lfb-grid .field label { font-size: 13px; }
.lfb-grid .field input, .lfb-grid .field select, .lfb-grid .field textarea { font-size: 14px; }
.lfb-check { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-top: 6px; }
.lfb-check input { width: 18px; height: 18px; accent-color: var(--teal); }
.lfb-lot { margin-top: 12px; padding: 10px 12px; background: var(--teal-tint-2); border-radius: 10px; }
.lfb-lot summary { cursor: pointer; }
.lfb-lot .lfb-grid { margin-top: 10px; }
.lfb-list { display: flex; flex-direction: column; gap: 8px; }
.lfb-item { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.lfb-item.open { border-color: var(--teal); }
.lfb-item.dragging { opacity: .5; }
.lfb-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 4px; }
.lfb-handle { cursor: grab; color: var(--field); font-size: 18px; padding: 0 6px; letter-spacing: -2px; user-select: none; }
.lfb-main { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; background: none; border: 0; text-align: left; padding: 6px 4px; font: inherit; cursor: pointer; min-height: 44px; }
.lfb-updown { display: flex; gap: 4px; }
.lfb-updown .btn.small { min-width: 36px; justify-content: center; padding: 0; }
.lfb-editor { padding: 10px 12px 12px; border-top: 1px solid var(--border-2); display: flex; flex-direction: column; gap: 8px; }
.lfb-source { margin: 0; padding: 8px 10px; background: var(--amber-tint); color: var(--amber-ink); border-radius: 8px; font-size: 13px; }
.lfb-cols { padding: 8px 10px; border: 1px dashed var(--field); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.lfb-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.lfb-kind { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; text-align: left; font: inherit; cursor: pointer; min-height: 56px; }
.lfb-kind:hover { border-color: var(--teal); }
.lfb-sechead { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.lfb-sectitle { flex: 1; font-size: 16px; font-weight: 600; border: 0; border-bottom: 1.5px dashed var(--field); padding: 6px 2px; background: transparent; min-width: 0; }
.lfb-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lfb-frames { display: flex; gap: 6px; flex-wrap: wrap; }
.lfb-frames .btn.on { border-color: var(--teal); background: var(--teal-tint); }
.lfb-frame { border: 10px solid var(--ink); border-radius: 34px; background: var(--bg); overflow: hidden; margin: 0 auto; width: 100%; }
.lfb-frame.phone { max-width: 390px; }
.lfb-frame.tablet { max-width: 440px; border-radius: 22px; }
.lfb-screen { max-height: 70vh; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
.lfb-screen .lr-fields { grid-template-columns: 1fr; }
.lfb-frame.tablet .lfb-screen .lr-fields { grid-template-columns: 1fr 1fr; }
.lfb-fakehead { padding: 4px 4px 0; font-size: 18px; }
.lr-form.compact .lr-section { padding: 12px; }
@media (max-width: 1000px) { .lfb { grid-template-columns: 1fr; } .lfb-right { position: static; } }

/* adding a lot from the bench form's lot picker */
.lr-addlot-btn { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 12px 14px; border: 1.5px dashed var(--mint, #1FA090); border-radius: 10px; background: #f3fbf9; color: var(--teal, #0E5E5E); cursor: pointer; font: inherit; }
.lr-addlot-btn.primary { border-style: solid; background: #e6f6f2; }
.lr-addlot { display: flex; flex-direction: column; gap: 10px; overflow: auto; padding-top: 4px; border-top: 1px solid var(--border); }
.lr-addlot .lr-field input, .lr-addlot .lr-field select { min-height: 52px; font-size: 17px; }
.lr-addlot-ok { margin: 0; padding: 10px 12px; border-radius: 10px; background: #e6f6f2; color: var(--teal, #0E5E5E); }

/* balance check weights (DailyChecks.tsx BalanceWeightsForm / WeightSetCard) */
.weights-list { display: flex; flex-direction: column; gap: 8px; }
.weight-row { display: grid; grid-template-columns: minmax(110px, .8fr) repeat(6, minmax(100px, 1fr)); gap: 10px; align-items: end; padding: 10px 12px;
  border: 1px solid var(--line, #DCE5E2); border-radius: 10px; background: #fff; opacity: .7; transition: opacity .15s ease, border-color .15s ease; }
.weight-row.on { opacity: 1; border-color: #7FE0CF; }
.weight-pick { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; align-self: center; font-size: 17px; }
.weight-pick input[type="checkbox"] { width: 20px; height: 20px; }
.weight-new input { width: 80px; }
.weight-mass { display: block; padding: 9px 0; font-variant-numeric: tabular-nums; font-weight: 600; }
.weight-hint { grid-column: 1 / -1; margin: 0; }
.field .label { font-size: 14px; font-weight: 600; display: block; margin-bottom: 4px; }
@media (max-width: 900px) { .weight-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } .weight-pick { grid-column: 1 / -1; } }
@media (max-width: 560px) { .weight-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.weight-set-pick { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 560px) { .weight-set-pick { grid-template-columns: 1fr; } }

/* Add equipment: a new balance's check weights or a new fridge/freezer/incubator's NIST probe (Jared, 2026-11-09) */
.new-eq-checks { display: flex; flex-direction: column; gap: 10px; margin: 0; background: var(--teal-tint-2, #F1F8F6); border: 1px solid #7FE0CF; }
.new-eq-checks legend { padding: 0 6px; }
.new-eq-checks .weight-row { grid-template-columns: minmax(110px, .8fr) repeat(5, minmax(100px, 1fr)); }
@media (max-width: 900px) { .new-eq-checks .weight-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .new-eq-checks .weight-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Paper logs (pages/PaperLogs.tsx): a scanned page of a temperature or balance log beside its rows, to check line by line */
.paper-start-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.paper-start.compact { padding: 12px 14px; }
.paper-open { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border-2); }
.paper-open ul { margin: 4px 0 0; }
.paper-layout { display: grid; grid-template-columns: minmax(280px, 36%) minmax(0, 1fr); gap: 18px; align-items: start; }
.paper-layout.no-page { grid-template-columns: minmax(0, 1fr); }
.paper-page { position: sticky; top: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px; max-height: calc(100vh - 24px); overflow: auto; }
.paper-page .row { margin-bottom: 8px; }
.paper-page-img { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }
.paper-page-img img { display: block; width: 100%; height: auto; border-radius: 6px; }
.paper-page-img.zoom { cursor: zoom-out; width: 200%; }
.paper-page iframe { width: 100%; height: 70vh; border: 0; }
.paper-page-toggle { display: none; }
.paper-head { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-start; }
.paper-head .field { display: flex; flex-direction: column; gap: 4px; max-width: 360px; }
.paper-head .field label { font-size: 13px; font-weight: 600; }
.paper-cols { display: flex; gap: 12px; flex-wrap: wrap; flex-basis: 100%; }
.paper-lines { list-style: none; margin: 12px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.paper-line { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 4px 10px; align-items: start; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.paper-line.look { border-color: #E2C27A; background: #FFFBF1; }
.paper-line.skipped { opacity: .55; }
.pl-n { font-family: var(--mono); color: var(--muted); font-size: 13px; padding-top: 22px; text-align: right; }
.pl-fields { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: flex-start; }
.pl-f { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); min-width: 0; flex-shrink: 0; }
.pl-f > .pl-l { font-weight: 500; white-space: nowrap; }
.pl-f input { width: 100%; min-width: 0; padding: 5px 7px; border: 1px solid var(--field); border-radius: 6px; font-size: 15px; color: var(--ink); background: var(--surface); }
.pl-f input[aria-invalid="true"] { border-color: var(--alert); background: var(--alert-row); }
.pl-f input:disabled { background: var(--border-2); }
.pl-f:first-child { width: 152px; }
.pl-time { width: 88px; } .pl-set { width: 110px; } .pl-val { width: 112px; } .pl-ini { width: 58px; } .pl-com { flex: 1 1 120px; min-width: 100px; }
/* the lines' column decides, not the screen: beside the page on an iPad it is narrow, so fields wrap rather than run off the edge */
.paper-rows { container-type: inline-size; min-width: 0; }
@container (min-width: 380px) and (max-width: 859.98px) {
  /* beside the page on an iPad: tighter fields, so a line takes one or two rows and nothing runs off the edge */
  .pl-f:first-child { width: 128px; } .pl-time { width: 60px; } .pl-val { width: 90px; } .pl-f > .pl-l { font-size: 11.5px; } .pl-set { width: 92px; } .pl-ini { width: 48px; }
  .pl-com { flex: 1 1 80px; min-width: 70px; }
  .pl-fields { gap: 6px 6px; } .paper-line { gap: 4px 6px; padding: 6px 8px; grid-template-columns: 22px minmax(0, 1fr) auto; }
  .pl-f input { padding: 5px 6px; }
}
@container (min-width: 690px) {
  /* one line of the page = one row on screen; the field names show once, on the first line */
  .pl-fields { flex-wrap: nowrap; }
  .paper-line + .paper-line .pl-f > .pl-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .paper-line + .paper-line .pl-n, .paper-line + .paper-line .pl-side { padding-top: 6px; }
}
.pl-side { padding-top: 22px; }
.pl-skip { display: flex; gap: 4px; align-items: center; white-space: nowrap; }
.pl-notes { grid-column: 2 / -1; display: flex; flex-direction: column; gap: 2px; }
.pl-notes .warn, .pl-notes .fail { font-weight: 500; }
.pl-notes .linkish { margin-left: 8px; }
.pl-sure { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 10px; background: var(--teal-tint); margin-bottom: 10px; font-size: 15px; font-weight: 500; }
@media (min-width: 901px) and (min-height: 1000px) { .paper-save { position: sticky; bottom: 0; z-index: 2; box-shadow: 0 -4px 16px rgba(21,32,28,.08); } }
.paper-blocker { border: 2px solid var(--amber-ink); background: var(--amber-tint); color: var(--amber-ink); }
.paper-blocker h3 { margin: 0 0 4px; color: var(--amber-ink); }
.paper-blocker .probe-form { color: var(--ink, inherit); margin-top: 10px; }
.paper-seen { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.paper-seen input { flex: 1 1 240px; padding: 6px 8px; }
@media (max-width: 900px) {
  .paper-layout { grid-template-columns: minmax(0, 1fr); }
  .paper-page { position: static; max-height: 50vh; }
  .paper-page.hidden { padding-bottom: 2px; }
  .paper-page-toggle { display: inline; }
}
@media (max-width: 520px) {
  .paper-line { grid-template-columns: 22px minmax(0, 1fr); }
  .pl-side { grid-column: 2; padding-top: 0; }
  .pl-n { padding-top: 20px; }
  .pl-f:first-child { width: calc(62% - 5px); } .pl-time { width: calc(38% - 5px); }
  .pl-val { width: calc(36% - 7px); } .pl-ini { width: calc(28% - 7px); } .pl-set { width: calc(50% - 5px); } .pl-com { flex-basis: 100%; }
}
.pl-res { white-space: nowrap; font-size: 12px; }
.paper-add { margin-bottom: 14px; }
/* Add Word files as drafts: on a phone each file is a small card (number and rev, then title, folder, note). */
.word-drafts-table input:not([type=checkbox]), .word-drafts-table select { padding: 6px 8px; }
@media (max-width: 700px) {
  .word-drafts-table thead { display: none; }
  .word-drafts-table tr { display: grid; grid-template-columns: 32px 1fr 64px; grid-template-areas: "c n r" "c t t" "c f f" "c x x"; gap: 6px; padding: 10px 8px; border-bottom: 1px solid var(--line, #e5e7eb); }
  .word-drafts-table td { border: 0; padding: 0; }
  .word-drafts-table .wd-check { grid-area: c; } .word-drafts-table .wd-num { grid-area: n; } .word-drafts-table .wd-rev { grid-area: r; }
  .word-drafts-table .wd-title { grid-area: t; } .word-drafts-table .wd-folder { grid-area: f; } .word-drafts-table .wd-note { grid-area: x; }
  .word-drafts-table .wd-num input, .word-drafts-table .wd-rev input, .word-drafts-table select { width: 100% !important; max-width: none !important; }
  .word-drafts-table .wd-title input { min-width: 0 !important; }
}

/* Lab records: forms grouped like Documents files the procedures (Jared, 2026-11-10) */
.lr-start-top { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.lr-start-top h3 { margin: 0; flex: 1; }
.lr-find { flex: 0 1 360px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.lr-label { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 4px 0 8px; }
.lr-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.lr-chip { border: 1px solid var(--border); background: var(--teal-tint-2); border-radius: 999px; padding: 8px 14px; min-height: 40px; cursor: pointer; color: var(--ink); text-align: left; }
.lr-chip:hover { border-color: var(--teal); }
.lr-group { border-top: 1px solid var(--border-2); }
.lr-group:last-child { border-bottom: 1px solid var(--border-2); }
.lr-group-head { width: 100%; display: flex; gap: 12px; align-items: center; padding: 14px 4px; min-height: 52px; background: none; border: 0; cursor: pointer; text-align: left; color: var(--ink); font-size: 15px; }
.lr-group-head:disabled { cursor: default; }
.lr-group-head b { flex: 1; font-weight: 600; }
.lr-chev { color: var(--muted); display: inline-block; width: 12px; transition: transform .15s ease; }
.lr-group.open .lr-chev { transform: rotate(90deg); }
.lr-code { font-family: var(--mono); font-size: 12.5px; background: var(--teal-tint); color: var(--teal); padding: 2px 8px; border-radius: 6px; }
.lr-count { color: var(--muted); font-size: 14px; white-space: nowrap; }
.lr-rows { list-style: none; margin: 0 0 12px; padding: 0 0 0 28px; }
.lr-frow { display: grid; grid-template-columns: 120px 1fr auto auto; gap: 14px; align-items: center; padding: 8px 6px; border-radius: 8px; }
.lr-frow:hover { background: var(--teal-tint-2); }
.lr-frow.gated { opacity: .85; }
.lr-num { font-size: 12.5px; color: var(--muted); }
.lr-frow-title { font-weight: 500; }
.lr-frow-doc { font-weight: 400; }
.lr-tags { display: flex; gap: 6px; }
.lr-tag { font-size: 12px; border: 1px solid var(--border); border-radius: 999px; padding: 1px 9px; color: var(--muted); white-space: nowrap; }
.lr-tag.lot { border-color: #B9D6CF; color: var(--teal); }
.lr-frow .lr-start { min-width: 88px; }
.lr-frow .lr-gate { max-width: 220px; }
@media (max-width: 760px) {
  .lr-find { flex: 1 1 100%; }
  .lr-rows { padding-left: 0; }
  .lr-frow { grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 4px; }
  .lr-frow > :not(.lr-start):not(.lr-gate) { grid-column: 1; }
  .lr-frow .lr-start, .lr-frow .lr-gate { grid-column: 2; grid-row: 1 / 4; min-height: 48px; }
  .lr-frow-doc { display: none; }
}
/* the SOP button on a record, and the SOP inside Quali's window */
.lr-sop-btn { display: inline-flex; gap: 6px; align-items: center; margin: 8px 0 2px; border: 1px solid #B9D6CF; background: var(--teal-tint); color: var(--teal); border-radius: 999px; padding: 6px 14px; min-height: 40px; font-weight: 500; cursor: pointer; }
.help-panel.sop { width: min(560px, calc(100vw - 32px)); top: 20px; height: auto; max-height: none; }
.help-min { border: 1px solid var(--border); background: var(--surface); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 18px; color: var(--ink-2); }
.help-sop { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.help-sop-bar { display: flex; flex-direction: column; padding: 8px 14px; border-bottom: 1px solid var(--border-2); }
.help-sop-pages { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; background: #E9ECEA; padding: 8px; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.help-sop-pages canvas { background: #fff; box-shadow: 0 1px 3px rgba(21,32,28,.18); }
.help-sop-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 8px 10px; border-top: 1px solid var(--border-2); }
body.has-lr-bar .help-panel.sop { bottom: 172px; }
@media (max-width: 1100px) { .help-panel.sop { top: 76px; } }   /* below the top bar on an iPad */
@media (max-width: 760px) {
  .help-panel.sop { left: 8px; right: 8px; width: auto; top: 72px; }
  body.has-lr-bar .help-panel.sop { bottom: 92px; }
  /* every line on a phone is for the SOP: the mode buttons and the title bar give way */
  .help-panel.sop header { padding: 6px 10px; } .help-panel.sop header .muted { display: none; }
  .help-panel.sop .help-modes { padding: 4px 8px; } .help-panel.sop .help-modes button { min-height: 32px; font-size: 13px; }
  .help-panel.sop .help-sop-bar { padding: 4px 12px; }
  .help-panel.sop .help-sop-actions { flex-wrap: nowrap; overflow-x: auto; }
  .help-panel.sop .help-sop-actions .btn { white-space: nowrap; }
  .help-panel.sop ~ .help-fab { display: none; }   /* the – button brings her back; her face would cover the buttons */
}
.help-sop-msg { padding: 10px 14px; margin: 0; }
/* fixing a certificate number on an equipment history line (pages/Equipment.tsx CertCell) */
.cert-fix { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }
.cert-fix input { width: 100%; }

/* ===== The menu since 11 November 2026 (Nav.tsx): light, short, Apple-style. ======================================
   Home, Calendar, the four areas and each person's pinned pages; an area opens its page of tiles (AreaPage.tsx).
   The site's menu colour (Settings > Sites) now colours the selected row and the dot by the site name, so
   Minnesota and South Dakota still look different at a glance. iPads: a slim strip of icons that opens to the
   full menu. Phones: a bar along the bottom (Home, Lab, Scan, Quality, More). */
nav.main { background: #EEF1EF; color: var(--ink); border-right: 1px solid #DDE3E0; gap: 14px; padding: 20px 12px 16px; }
nav.main .icon { flex: none; }
nav.main a.nav-row { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 9px; color: var(--ink); font-size: 15px; font-weight: 500; }
nav.main a.nav-row .icon { color: var(--teal); }
nav.main a.nav-row:hover { background: rgba(11, 94, 82, .07); }
nav.main { --nav-accent: #0B5E52; }
nav.main[data-shade="teal"] { --nav-accent: #0F7A72; }
nav.main[data-shade="lake"] { --nav-accent: #2C5F8A; }
nav.main[data-shade="slate"] { --nav-accent: #4A5560; }
nav.main a.nav-row.active { background: var(--nav-accent); color: #fff; font-weight: 500; }
nav.main a.nav-row.area.within { background: rgba(11, 94, 82, .09); }
nav.main a.nav-row.active .icon { color: #fff; }
nav.main a.nav-row:focus-visible, nav.main .menu-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
nav.main .nav-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav.main .nav-h { font-size: 11.5px; font-weight: 600; color: #6B7773; letter-spacing: .06em; text-transform: uppercase; margin: 12px 10px 3px; }
nav.main .links { gap: 1px; }
nav.main .nav-admin { display: flex; flex-direction: column; gap: 1px; margin-top: auto; padding-top: 8px; border-top: 1px solid #DDE3E0; }
nav.main .nav-admin a.nav-row { font-size: 14px; font-weight: 400; padding: 6px 10px; color: var(--ink-2); }
nav.main .nav-admin + .lab { margin-top: 0; }
nav.main .lab { border: 0; border-top: 1px solid #DDE3E0; border-radius: 0; padding: 12px 6px 0; }
nav.main .lab span { color: var(--muted); }
nav.main .lab .btn.secondary { align-self: flex-start; }
nav.main .me-link { display: flex; align-items: center; gap: 10px; padding: 4px; color: var(--ink); }
nav.main .me-link strong { color: var(--ink); }
nav.main select { background: #fff; color: var(--ink); border: 1px solid #DDE3E0; }
/* the site name and logo at the top */
nav.main .site-button { color: var(--ink); }
nav.main .site-button:hover, nav.main .site-button[aria-expanded="true"] { border-color: #DDE3E0; background: #fff; }
nav.main .site-name { color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
nav.main .site-name::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--nav-accent); box-shadow: 0 0 0 2px #fff; flex: none; }
nav.main .site-button:focus-visible { outline: 2px solid var(--teal); }
/* search */
nav.main .navsearch { position: relative; padding: 0; display: flex; align-items: center; }
nav.main .navsearch input { min-height: 36px; border-radius: 10px; border: 0; background: #fff; color: var(--ink); padding: 0 40px 0 32px; box-shadow: 0 0 0 1px #DDE3E0; }
nav.main .navsearch input::placeholder { color: #7A8681; }
nav.main .navsearch input:focus { outline: 2px solid var(--teal); outline-offset: 0; }
nav.main .navsearch-icon { position: absolute; left: 10px; color: #7A8681; pointer-events: none; }
nav.main .navsearch-kbd { position: absolute; right: 10px; font: inherit; font-size: 12px; color: #9AA5A1; pointer-events: none; }
nav.main .navsearch-hint { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 3; color: var(--muted); background: #fff; border-radius: 8px; padding: 6px 10px; box-shadow: 0 6px 18px rgba(21, 32, 28, .12); }
nav.main .menu-toggle { background: none; color: var(--teal); border: 0; }
nav.main .menu-toggle .nav-label { color: var(--ink); }
.tabbar { display: none; }

/* iPads (721-1100 px): a slim strip of icons down the left; Menu opens the whole menu over the page. */
@media (min-width: 721px) and (max-width: 1100px) {
  .app { flex-direction: row; flex-wrap: nowrap; }
  nav.main { position: sticky; top: 0; height: 100vh; width: 76px; flex: none; max-width: none; flex-direction: column; align-items: stretch; gap: 10px; padding: 16px 10px; overflow: hidden; z-index: 45; }
  nav.main .brand .logo-word, nav.main .site-name, nav.main .navsearch, nav.main .nav-label, nav.main .nav-h, nav.main .lab { display: none; }
  nav.main .brand { justify-content: center; }
  nav.main .site-button { justify-content: center; padding: 6px 0; }
  nav.main .menu-toggle { display: flex; order: 0; min-width: 0; min-height: 44px; justify-content: center; padding: 0; background: none; border: 0; }
  nav.main .nav-drawer { display: flex; flex-direction: column; flex: 1; gap: 10px; position: static; width: auto; padding: 0; background: none; border: 0; box-shadow: none; overflow-y: auto; animation: none; }
  nav.main .nav-drawer .links { display: flex; }
  nav.main a.nav-row { justify-content: center; padding: 10px 0; }
  nav.main .nav-admin { border-top: 1px solid #DDE3E0; }
  .nav-scrim { inset: 0; z-index: -1; background: transparent; }
  /* open: the full menu, with words, over the page */
  nav.main:has(.nav-drawer[data-open="true"]) { position: fixed; left: 0; top: 0; bottom: 0; width: 300px; box-shadow: 0 0 40px rgba(21, 32, 28, .2), 0 0 0 100vmax rgba(16, 32, 30, .35); overflow-y: auto; display: block; }
  nav.main:has(.nav-drawer[data-open="true"]) > * { margin-bottom: 10px; }
  nav.main:has(.nav-drawer[data-open="true"]) .nav-drawer { min-height: calc(100% - 150px); }
  nav.main:has(.nav-drawer[data-open="true"]) :is(.site-name, .navsearch, .nav-label, .nav-h) { display: revert; }
  nav.main:has(.nav-drawer[data-open="true"]) .navsearch { display: flex; }
  nav.main:has(.nav-drawer[data-open="true"]) .brand .logo-word { display: inline; }
  nav.main:has(.nav-drawer[data-open="true"]) .lab { display: flex; }
  nav.main:has(.nav-drawer[data-open="true"]) :is(a.nav-row, .menu-toggle) { justify-content: flex-start; padding: 8px 10px; }
  nav.main:has(.nav-drawer[data-open="true"]) .site-button { justify-content: flex-start; padding: 6px 8px; }
  nav.main:has(.nav-drawer[data-open="true"]) + main { margin-left: 76px; }
  nav.main .navsearch-hint { position: static; box-shadow: none; padding: 6px 2px 0; background: none; }
}

/* Phones (up to 720 px): the logo and search on top, the bar along the bottom; More opens the whole menu. */
@media (max-width: 720px) {
  nav.main { padding: 12px 16px; gap: 10px; border-right: 0; border-bottom: 1px solid #DDE3E0; flex-direction: column; flex: none; width: 100%; }   /* flex: none: on a short page the top bar must not stretch and leave a gap; width: 100%: the top panel spans the whole phone, not just as wide as the search box */
  nav.main .menu-toggle { display: none; }
  nav.main .nav-drawer { display: none; }
  nav.main .nav-drawer[data-open="true"] { display: flex; flex-direction: column; gap: 12px; position: fixed; z-index: 60; left: 0; right: 0; top: 0; bottom: 0;
    padding: 20px 16px 110px; background: #EEF1EF; overflow-y: auto; overscroll-behavior: contain; animation: sheet-up .2s ease-out; }
  nav.main .nav-drawer[data-open="true"] .links { display: flex; }
  nav.main .nav-drawer .lab { display: flex; }
  nav.main a.nav-row { padding: 11px 12px; font-size: 16px; }
  .nav-scrim { display: none; }
  main { padding-bottom: 110px; }
  .help-fab { bottom: 92px; }
  .help-panel, .help-toast { bottom: 156px; }
  /* Quali's panel always fits between the top of the screen and the owl, so its Close button can be reached */
  .help-panel { max-height: calc(100dvh - 168px); }
  body.has-lr-bar .help-panel { max-height: calc(100dvh - 184px); }
  .help-panel.messages { top: 12px; height: auto; max-height: none; }
  .help-nudge { bottom: 102px; right: 76px; }
  .tabbar { display: flex; position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; justify-content: space-around; align-items: flex-end;
    padding: 6px 4px calc(10px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border-top: 1px solid #DDE3E0; }
  .tabbar .tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center; font-size: 11px; font-weight: 500;
    color: #7A8681; text-decoration: none; background: none; border: 0; font-family: inherit; cursor: pointer; }
  .tabbar .tab.on { color: var(--teal); }
  .tabbar .tab:not(.scan) { height: 58px; min-height: 0; padding: 0; justify-content: center; }   /* the More button lines up with the links */
  .tabbar .tab.scan { flex: none; width: 56px; height: 56px; min-height: 0; border-radius: 50%; background: var(--teal); color: #fff; margin: -22px 8px 0; box-shadow: 0 4px 14px rgba(11, 94, 82, .35); }
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { nav.main .nav-drawer[data-open="true"] { animation: none; } }
@media print { .tabbar { display: none !important; } }

/* ===== Area pages (AreaPage.tsx): centred tiles, the icon on a glowing teal square like an app icon. ============== */
.area-page { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.area-head { text-align: center; }
.area-head h1 { margin: 0 0 4px; font-size: 32px; letter-spacing: -.01em; }
.area-head p { margin: 0; }
.area-tiles { width: 100%; max-width: 1040px; display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.area-tile { position: relative; flex: 0 0 calc(25% - 11px); min-width: 0; background: #fff; border-radius: 18px;
  box-shadow: 0 1px 2px rgba(21, 32, 28, .05), 0 6px 20px rgba(21, 32, 28, .06); transition: transform .15s ease, box-shadow .15s ease; }
.area-tile:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(21, 32, 28, .06), 0 12px 28px rgba(21, 32, 28, .1); }
.area-link { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 22px 16px 20px; color: var(--ink); text-decoration: none; border-radius: 18px; height: 100%; box-sizing: border-box; }
.area-link:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.area-icon { width: 54px; height: 54px; border-radius: 15px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; color: #fff;
  background: radial-gradient(circle at 75% 15%, #7FE0CF 0%, rgba(127, 224, 207, 0) 60%), linear-gradient(160deg, #1FA090, #0B5E52); box-shadow: 0 4px 10px rgba(11, 94, 82, .25); }
.area-link strong { font-size: 16px; }
.area-status { font-size: 13px; color: var(--muted); }
.area-status.bad { color: var(--alert-ink); font-weight: 500; }
.area-pin { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 50%; border: 0; background: none; color: #A9B4B0; cursor: pointer;
  display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s ease; }
.area-tile:hover .area-pin, .area-pin:focus-visible, .area-pin.on { opacity: 1; }
.area-pin.on { color: var(--teal); }
.area-pin:hover { background: var(--teal-tint-2); color: var(--teal); }
@media (any-pointer: coarse) { .area-pin { opacity: 1; } }
@media (max-width: 1100px) { .area-tile { flex-basis: calc(33.333% - 10px); } }
@media (max-width: 720px) { .area-tiles { gap: 10px; } .area-tile { flex-basis: calc(50% - 5px); border-radius: 16px; } .area-link { padding: 18px 10px 16px; } .area-head h1 { font-size: 28px; } }
@media (prefers-reduced-motion: reduce) { .area-tile, .area-tile:hover { transition: none; transform: none; } }

/* ===== Equipment dashboard (EquipmentDashboard.tsx) ======================================================== */
.equipment-home { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.eq-head h1 { margin: 0; }
.eq-head .btn { display: inline-flex; align-items: center; gap: 6px; }
.eq-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; margin-top: 0; scrollbar-width: none; }
.eq-tabs a { padding: 10px 14px; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.eq-tabs a.active { color: var(--teal); border-bottom-color: var(--teal); }
.tab-flag { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--alert); margin-left: 6px; vertical-align: 2px; }
.deck-wrap { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.deck-stage { display: flex; align-items: center; gap: 12px; min-width: 0; }
.deck { flex: 1; min-width: 0; display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 6px 2px 18px; overscroll-behavior-x: contain; }
.deck::-webkit-scrollbar, .eq-tabs::-webkit-scrollbar { display: none; }
.deck-arrow { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: #fff; color: var(--teal); display: flex; align-items: center; justify-content: center; cursor: pointer; }
.deck-arrow:disabled { opacity: .35; cursor: default; }
.unit-card { flex: 0 0 100%; scroll-snap-align: center; box-sizing: border-box; background: #fff; border-radius: 20px; padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(21, 32, 28, .05), 0 8px 28px rgba(21, 32, 28, .08); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.uc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.uc-eyebrow { font-size: 12.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-eyebrow .mono { letter-spacing: 0; }
.uc-pill { flex: none; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.uc-pill.bad { background: var(--alert-tint); color: var(--alert-ink); }
.uc-pill.grey { background: #E9ECEA; color: var(--ink-2); }
.uc-big { font-size: 46px; font-weight: 600; letter-spacing: -.02em; line-height: 1.05; margin-top: 2px; }
.uc-big small { font-size: 18px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.uc-big.bad { color: var(--alert-ink); }
.uc-sub { font-size: 14px; color: var(--muted); }
.seg-ios { display: flex; background: #ECEFED; border-radius: 9px; padding: 2px; margin: 10px 0 2px; }
.seg-ios button { flex: 1; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 500; padding: 6px 4px; border-radius: 7px; color: var(--ink); cursor: pointer; white-space: nowrap; }
.seg-ios button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.seg-ios button:focus-visible { outline: 2px solid var(--teal); }
.seg-ios.small { margin: 6px 0 0; max-width: 100%; overflow-x: auto; }
.soft-chart { position: relative; width: 100%; touch-action: pan-x pan-y; user-select: none; margin-top: 4px; }
.soft-chart svg { display: block; overflow: visible; }
.soft-chart.empty { display: flex; align-items: center; justify-content: center; background: var(--teal-tint-2); border-radius: 12px; }
.sc-band { fill: #7FE0CF; opacity: .14; }
.sc-guide { stroke: #E4E8E6; stroke-width: 1; }
.sc-axis { font-size: 11px; fill: #7A8681; font-family: var(--sans); }
.sc-line { fill: none; stroke: var(--teal); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.sc-bad { fill: var(--alert); stroke: #fff; stroke-width: 1.5; }
.sc-cursor { stroke: var(--ink); stroke-opacity: .25; }
.sc-hover { fill: #fff; stroke: var(--teal); stroke-width: 2.5; }
.sc-hover.bad { stroke: var(--alert); }
.sc-halo { fill: var(--teal); opacity: .16; }
.sc-halo.bad { fill: var(--alert); opacity: .2; }
.sc-last { fill: var(--teal); stroke: #fff; stroke-width: 2; }
.sc-last.bad { fill: var(--alert); }
.sc-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 8px; white-space: nowrap; pointer-events: none; }
.uc-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border-2); }
.uc-stats span { display: block; font-size: 12px; color: var(--muted); }
.uc-stats b { font-size: 17px; font-weight: 600; }
.uc-read { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--border-2); }
.uc-read .field { margin: 0; }
.uc-read input { width: 160px; border-radius: 12px; background: var(--bg); }
.uc-read .btn { border-radius: 12px; }
.uc-msg { flex-basis: 100%; margin: 0; }
.uc-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.uc-actions .btn { border-radius: 12px; }
.uc-empty { padding: 26px 0; text-align: center; }
.deck-dots { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.deck-dots .dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 4px; background: #C9D3CF; cursor: pointer; transition: width .2s ease; }
.deck-dots .dot.on { width: 22px; background: var(--teal); }
.deck-dots .dot.bad { background: var(--alert); }
.deck-hint { text-align: center; font-size: 13px; color: var(--muted); margin: 0; }
.deck-hint-touch { display: none; }
@media (any-pointer: coarse) { .deck-hint-touch { display: inline; } }
@media (max-width: 1100px) { .deck-arrow { display: none; } .unit-card { flex-basis: 88%; } .deck { padding-left: 0; } }
@media (max-width: 720px) { .unit-card { flex-basis: 90%; padding: 16px; border-radius: 18px; } .uc-big { font-size: 40px; } .deck { gap: 12px; } .uc-stats { gap: 18px; } }
@media (prefers-reduced-motion: reduce) { .deck-dots .dot { transition: none; } }
.unit-stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--teal-tint-2); border: 1px solid var(--border); border-radius: 12px; padding: 8px 14px; font-size: 14px; }
.unit-stepper a { text-decoration: none; color: var(--teal); font-weight: 500; }
.unit-stepper .us-side { min-width: 90px; }
.unit-stepper .us-side.right { text-align: right; }
.unit-stepper .us-mid { color: var(--muted); font-weight: 400; }
.cc-stats b, .cc-stats em { overflow-wrap: anywhere; }

/* Phones: day boxes are too narrow for titles, so each shows how many things are due; tap a day to list them underneath */
.cal-dots, .cal-daylist { display: none; }
@media (max-width: 700px) {
  .cal .day { min-height: 52px; cursor: pointer; }
  .cal .day a, .cal .day > .muted { display: none; }
  .cal .day.picked { background: var(--teal-tint-2); border-color: var(--teal); }
  .cal-dots { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--teal); color: #fff; font-size: 11px; font-weight: 600; }
  .cal-dots.overdue { background: var(--alert-ink, #D9481F); }
  .cal-daylist { display: block; margin-top: 12px; }
  .cal-daylist ul { padding-left: 18px; margin: 0; } .cal-daylist li { margin: 8px 0; }
}
/* Phones: a row of tabs wider than the screen shows a soft shadow at the edge that still has tabs past it */
@media (max-width: 720px) {
  .page-tabs, .it-tabs {
    background: linear-gradient(to right, var(--bg) 30%, rgba(246, 247, 245, 0)) left / 32px 100% no-repeat local,
      linear-gradient(to left, var(--bg) 30%, rgba(246, 247, 245, 0)) right / 32px 100% no-repeat local,
      linear-gradient(to right, rgba(21, 32, 28, .18), transparent) left / 12px 100% no-repeat scroll,
      linear-gradient(to left, rgba(21, 32, 28, .18), transparent) right / 12px 100% no-repeat scroll;
  }
}
/* Phones: a table wider than the screen shows a soft shadow at the edge you can scroll toward */
@media (max-width: 720px) {
  .tablewrap {
    background: linear-gradient(to right, var(--surface) 30%, rgba(255, 255, 255, 0)) left / 32px 100% no-repeat local,
      linear-gradient(to left, var(--surface) 30%, rgba(255, 255, 255, 0)) right / 32px 100% no-repeat local,
      linear-gradient(to right, rgba(21, 32, 28, .18), transparent) left / 14px 100% no-repeat scroll,
      linear-gradient(to left, rgba(21, 32, 28, .18), transparent) right / 14px 100% no-repeat scroll,
      var(--surface);
  }
  main { padding-bottom: 170px; }   /* the last thing on a page can scroll clear of Quali and the bar */
}
@media (max-width: 720px) { .tabbar .tab span { line-height: 16px; } }

/* ---- Daily checks (Jared, 11 November 2026): today's ring, the checks grouped by room, the reading in the row ---- */
.dc-page { max-width: 880px; margin: 0 auto; }
.dc-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.dc-top h1 { margin: 0; letter-spacing: -.015em; }
.dc-top-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.dc-hero { background: var(--surface); border-radius: 22px; padding: 22px 26px; display: flex; align-items: center; gap: 26px; margin-bottom: 22px;
  box-shadow: 0 1px 2px rgba(21,32,28,.05), 0 8px 26px rgba(21,32,28,.07); }
.dc-hero h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: -.01em; }
.dc-ring { position: relative; width: 112px; height: 112px; flex-shrink: 0; }
.dc-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.dc-ring-track { fill: none; stroke: #E7EEEC; stroke-width: 12; }
.dc-ring-fill { fill: none; stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .5s ease; }
.dc-ring-n { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.dc-ring-n b { font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.dc-ring-n span { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.dc-hl { display: flex; align-items: baseline; gap: 8px; font-size: 14.5px; margin: 5px 0; }
.dc-hl .dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; transform: translateY(-1px); }
.dc-hl .dot.bad { background: var(--orange, #D9481F); } .dc-hl .dot.todo { background: #C9D2CE; } .dc-hl .dot.ok { background: var(--mint, #1FA090); }
.dc-hl a { color: inherit; font-weight: 600; }
.dc-hl.bad { color: #8A3109; }
.dc-arrange-link { text-align: right; margin: -8px 4px 4px; }
.dc-room { margin: 0 0 22px; }
.dc-room h3 { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 6px 8px; letter-spacing: .03em; text-transform: uppercase; display: flex; justify-content: space-between; gap: 10px; }
.dc-room h3 span { text-transform: none; letter-spacing: 0; font-weight: 500; }
.dc-list { background: var(--surface); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(21,32,28,.05), 0 6px 20px rgba(21,32,28,.05); }
.dc-line { display: flex; align-items: center; gap: 14px; padding: 13px 18px; border-top: 1px solid #E6EAE8; color: inherit; text-decoration: none; flex-wrap: wrap; }
.dc-list > .dc-line:first-child { border-top: 0; }
a.dc-line:hover { background: #F7FAF9; }
.dc-line.todo { background: linear-gradient(90deg, #F4FAF8, var(--surface) 60%); }
.dc-ic { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--teal);
  background: radial-gradient(circle at 30% 25%, #fff 0, #E4F6F1 45%, #C9EDE4 100%); box-shadow: 0 0 0 1px rgba(31,160,144,.18), 0 4px 14px rgba(31,160,144,.22); }
.dc-who { flex: 1; min-width: 180px; }
.dc-who b { font-weight: 600; font-size: 15px; }
.dc-who b .mono { font-weight: 500; color: var(--muted); font-size: 13px; margin-right: 4px; }
.dc-who small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.dc-val { text-align: right; min-width: 92px; }
.dc-val b { font-size: 19px; font-weight: 600; letter-spacing: -.01em; display: block; }
.dc-val small { display: block; color: var(--muted); font-size: 12px; }
.dc-val.bad b { color: var(--orange, #D9481F); } .dc-val.bad small { color: #8A3109; font-weight: 500; }
.dc-chev { color: #B5BFBB; font-size: 20px; }
.dc-entry { display: flex; align-items: center; gap: 8px; }
.dc-in { display: flex; align-items: center; border: 1.5px solid var(--mint, #1FA090); border-radius: 11px; background: var(--surface); padding: 0 10px; }
.dc-in input { border: 0; outline: 0; width: 96px; padding: 8px 0; font: inherit; font-size: 16px; background: transparent; box-shadow: none; }
.dc-in i { font-style: normal; color: var(--muted); font-size: 13px; margin-left: 6px; }
.dc-line.ask .dc-in { border-color: var(--orange, #D9481F); }
.dc-msg { flex-basis: 100%; margin: 2px 0 0 52px; font-size: 13px; }
.dc-msg.fail { color: #8A3109; }
.dc-more { margin-top: 34px; display: flex; flex-direction: column; gap: 14px; }
.dc-arrange ol { list-style: none; padding: 0; margin: 10px 0 14px; display: flex; flex-direction: column; gap: 6px; }
.dc-arrange li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: #F4F7F6; cursor: grab; }
.dc-arrange li.dragging { opacity: .6; box-shadow: 0 6px 18px rgba(21,32,28,.14); }
.dc-grip { color: #9AA5A1; letter-spacing: -2px; }
.dc-room-name { flex: 1; font-weight: 500; }
.sc-move line { stroke: #9AA5A1; stroke-width: 1; stroke-dasharray: 3 3; }
.sc-move text { font-size: 11px; fill: #5F6B66; }
@media (max-width: 720px) {
  .dc-hero { padding: 18px; gap: 16px; }
  .dc-ring { width: 88px; height: 88px; } .dc-ring-n b { font-size: 25px; }
  .dc-hero h2 { font-size: 18px; } .dc-hl { font-size: 13.5px; }
  .dc-line { padding: 12px 14px; gap: 11px; }
  .dc-ic { width: 34px; height: 34px; }
  .dc-who { min-width: 0; }
  .dc-line.todo .dc-entry { width: 100%; padding-left: 45px; }
  .dc-line.todo .dc-in { flex: 1; } .dc-line.todo .dc-in input { width: 100%; }
  .dc-msg { margin-left: 45px; }
  .dc-val { min-width: 0; }
}
.dc-arrange { margin-bottom: 22px; }

/* Optional date box with a Clear button beside it */
.date-clear { display: flex; align-items: center; gap: 6px; }
.date-clear input { flex: 1; min-width: 0; }
.date-clear .btn { flex: none; min-height: 40px; padding: 0 10px; }
