/* The look parted from the Trainersight coach hub on 26 October 2026, on
   Dan's instruction: rounded corners, calmer colours, a quieter header.
   Oswald for headings and figures, JetBrains Mono for labels, Barlow for
   reading. Colour still carries meaning: red only ever means outside range
   or destructive, gold is the benchmark, green is in range; actions are
   teal so a button never looks like an alarm. Fonts are served from this
   site (OFL), so no page calls Google. */
@font-face { font-family: "Bricolage Grotesque"; font-weight: 500; font-style: normal; font-display: swap; src: url("/fonts/bricolage-grotesque-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/bricolage-grotesque-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Bricolage Grotesque"; font-weight: 700; font-style: normal; font-display: swap; src: url("/fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-style: normal; font-display: swap; src: url("/fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("/fonts/jetbrains-mono-latin-400-normal.woff2") format("woff2"); }
/* Dark is the coach hub's default. Light follows the phone's setting unless
   the person picks one in Settings (data-theme on <html>, set by theme.js
   before the page paints). Brand colours darken in light so text clears AA. */
:root {
  --ink: #111412; --coal: #1A1E1B; --coal2: #232825; --coal3: #2E3430;
  --bone: #EDE9E3; --body: #C8C4BE; --grey: #8A8A90; --faint: #86868E;
  --line: rgba(255,255,255,.07); --line-2: rgba(255,255,255,.14); --tint: rgba(255,255,255,.02);
  --red: #B64434; --red-hot: #E06552; --gold: #EFC94C; --gold-fill: #EFC94C; --green: #63B983; --orange: #E67E22;
  --s1: #63B983; --s2: #7E9BD6; --s3: #E06552;
  --band: rgba(99,185,131,.30); --out: #E06552; --out-bg: rgba(224,101,82,.12);
  --ok-bg: rgba(95,179,122,.12); --warn-bg: rgba(255,210,31,.10); --track: rgba(255,255,255,.10);
  --act: #4FAE9B; --act-ink: #0F1613; --act-hot: #65C3B0;
  --r: 14px; --rs: 10px;
  --head: "Bricolage Grotesque", "Arial", sans-serif; --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ink: #F4F2EE; --coal: #FFFFFF; --coal2: #F1EEE9; --coal3: #E5E1DA;
    --bone: #16161A; --body: #2E2E33; --grey: #5A5A60; --faint: #66666D;
    --line: rgba(0,0,0,.09); --line-2: rgba(0,0,0,.16); --tint: rgba(0,0,0,.015);
    --red: #A32E22; --red-hot: #B3311F; --gold: #826600; --gold-fill: #E0B416; --green: #2F7A48;
    --s1: #2F7A48; --s2: #3D63B0; --s3: #B3311F;
    --band: rgba(47,122,72,.20); --out: #B3311F; --out-bg: rgba(179,49,31,.08);
    --ok-bg: rgba(47,122,72,.09); --warn-bg: rgba(224,180,22,.14); --track: rgba(0,0,0,.08);
    --act: #2E7466; --act-ink: #FFFFFF; --act-hot: #27655A;
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --ink: #F4F2EE; --coal: #FFFFFF; --coal2: #F1EEE9; --coal3: #E5E1DA;
  --bone: #16161A; --body: #2E2E33; --grey: #5A5A60; --faint: #66666D;
  --line: rgba(0,0,0,.09); --line-2: rgba(0,0,0,.16); --tint: rgba(0,0,0,.015);
  --red: #A32E22; --red-hot: #B3311F; --gold: #826600; --gold-fill: #E0B416; --green: #2F7A48;
  --s1: #2F7A48; --s2: #3D63B0; --s3: #B3311F;
  --band: rgba(47,122,72,.20); --out: #B3311F; --out-bg: rgba(179,49,31,.08);
  --ok-bg: rgba(47,122,72,.09); --warn-bg: rgba(224,180,22,.14); --track: rgba(0,0,0,.08);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--ink); color: var(--body); font: 16px/1.5 "Barlow", system-ui, sans-serif; }
a { color: var(--bone); }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 16px 56px; }
[hidden] { display: none !important; }

/* top bar */
header.top { border-bottom: 1px solid var(--line); background: var(--coal); }
header.top .in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; max-width: 1100px; margin: 0 auto; flex-wrap: wrap; }
.brand { font-family: var(--head); font-weight: 700; font-size: 18px; letter-spacing: 0; color: var(--bone); text-decoration: none; }
nav.main { display: flex; gap: 2px; flex-wrap: wrap; }
nav.main a { font: 600 13.5px "Barlow", system-ui, sans-serif; color: var(--grey); text-decoration: none; padding: 0 10px; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; }
nav.main a:hover { color: var(--bone); }
nav.main a[aria-current="page"] { color: var(--bone); border-bottom-color: var(--act); }

/* type */
h1 { font-family: var(--head); font-weight: 700; font-size: 30px; letter-spacing: -.01em; color: var(--bone); margin: 22px 0 2px; line-height: 1.12; }
h2 { font-family: var(--head); font-weight: 600; font-size: 18px; letter-spacing: 0; color: var(--bone); margin: 0 0 12px; }
.k { font-family: var(--mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.sub { color: var(--grey); margin: 0 0 18px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.muted { color: var(--grey); font-size: 14px; }

/* panels */
.card { background: var(--coal); border: 1px solid var(--line); padding: 18px; margin-bottom: 14px; }
.two { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 860px) { .two { grid-template-columns: 1fr 1fr; } }

/* section tabs, as on an athlete page in the hub */
.tabs { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 16px 0 18px; scrollbar-width: none; }
.tabs button { flex: none; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--grey); font: 600 14px "Barlow", system-ui, sans-serif; padding: 0 11px; min-height: 44px; cursor: pointer; }
.tabs button:hover { background: none; color: var(--bone); }
.tabs button[aria-selected="true"] { color: var(--bone); border-bottom-color: var(--act); }
.tabs button .n { color: var(--red-hot); margin-left: 6px; }

/* hero figures */
.hero { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); grid-template-columns: repeat(2, 1fr); margin-bottom: 18px; }
@media (min-width: 760px) { .hero { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--coal); padding: 16px; min-height: 124px; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; }
.stat .v { font-family: var(--head); font-weight: 600; font-size: 34px; line-height: 1; color: var(--bone); font-variant-numeric: tabular-nums; }
.stat .v small { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--grey); margin-left: 4px; letter-spacing: .04em; }
.stat .d { font-family: var(--mono); font-size: 12px; color: var(--grey); }
.stat .d.up { color: var(--green); } .stat .d.down { color: var(--red-hot); }
.stat.none .v { color: var(--faint); font-size: 22px; }
.ringwrap { display: flex; align-items: center; gap: 12px; }
.ring { width: 64px; height: 64px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring .tr { stroke: var(--line-2); }
.ring .fg { stroke: var(--grey); }
.ring.green .fg { stroke: var(--green); } .ring.gold .fg { stroke: var(--gold-fill); } .ring.red .fg { stroke: var(--red-hot); }

/* the ranked list: a word in the gutter, so tone is never colour alone */
.trow { display: grid; grid-template-columns: 76px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: left; min-height: 52px; padding: 10px 14px; margin: 0 0 6px; cursor: pointer; background: var(--tint); border: 1px solid var(--line); border-left: 3px solid var(--line-2); color: var(--body); font: 15px/1.4 "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; text-decoration: none; }
.trow:hover { background: var(--coal2); }
.trow .tg { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.trow .tb b { font-family: var(--head); font-weight: 600; font-size: 16px; letter-spacing: 0; color: var(--bone); margin-right: 8px; }
.trow .tb .fig { font-family: var(--mono); font-size: 13px; color: var(--grey); }
.trow .tb .fig em { font-style: normal; color: var(--bone); }
.trow .ta { color: var(--faint); font-size: 20px; line-height: 1; }
.trow.bad { border-left-color: var(--red-hot); } .trow.bad .tg { color: var(--red-hot); }
.trow.warn { border-left-color: var(--gold); } .trow.warn .tg { color: var(--gold); }
.trow.ok { border-left-color: var(--green); cursor: default; } .trow.ok .tg { color: var(--green); }
.trow.ok:hover { background: var(--tint); }
@media (max-width: 560px) { .trow { grid-template-columns: 64px 1fr auto; gap: 10px; padding: 9px 12px; } }

/* charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { fill: var(--faint); font-size: 17px; font-family: var(--mono); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-family: var(--mono); font-size: 12px; letter-spacing: .04em; color: var(--grey); margin-top: 8px; text-transform: uppercase; }
.legend i { display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: middle; }

/* blood tables */
.labs { width: 100%; border-collapse: collapse; }
.labs td, .labs th { padding: 11px 6px; border-top: 1px solid var(--line); vertical-align: middle; text-align: left; }
.labs th { font-family: var(--mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); font-weight: 400; border-top: 0; }
.labs .name { color: var(--bone); }
.labs .note { display: block; font-size: 13px; color: var(--grey); margin-top: 3px; font-weight: 400; }
.labs .val { font-family: var(--mono); font-size: 14px; color: var(--bone); white-space: nowrap; }
.labs .val .u { color: var(--grey); font-size: 12px; }
.labs .rng { width: 36%; min-width: 130px; }
.labs tr.out .val { color: var(--red-hot); }
.labs td.muted { font-family: var(--mono); font-size: 12px; }
@media (max-width: 640px) { .labs .hide-sm { display: none; } .labs .rng { width: 42%; } }
.flag { font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--red-hot); margin-left: 8px; }
button.link { background: none; border: 0; color: var(--bone); padding: 0; min-height: 0; font: 600 16px "Barlow", system-ui, sans-serif; letter-spacing: 0; text-transform: none; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
button.link:hover { background: none; }
button.link[aria-expanded="true"] { text-decoration-color: var(--act); }
.labs tr.trend td { background: var(--ink); border-top: 0; }
.labs tr.trend .chart, .labs tr.trend p { max-width: calc(100vw - 88px); }
@media (min-width: 1132px) { .labs tr.trend .chart, .labs tr.trend p { max-width: 1030px; } }
details.fold { border-top: 1px solid var(--line); }
details.fold summary { cursor: pointer; min-height: 48px; display: flex; align-items: center; font-family: var(--mono); font-size: 12px; letter-spacing: .07em; text-transform: uppercase; color: var(--grey); list-style: none; }
details.fold summary::-webkit-details-marker { display: none; }
details.fold summary::before { content: "+"; width: 20px; color: var(--faint); }
details.fold[open] summary::before { content: "-"; }
details.fold[open] summary { color: var(--bone); }
.meets td, .meets th { text-align: right; }
.meets td:first-child, .meets th:first-child, .meets td:nth-child(2), .meets th:nth-child(2) { text-align: left; }
.meets td { font-family: var(--mono); font-size: 14px; color: var(--bone); }
.meets td.meet { font-family: "Barlow", system-ui, sans-serif; font-size: 15px; }
.meets td.total { font-family: var(--head); font-size: 18px; font-weight: 600; }
.scroll { overflow-x: auto; }

/* states */
.empty { padding: 28px 18px; }
.banner { background: var(--out-bg); border-left: 3px solid var(--red-hot); color: var(--bone); padding: 12px 16px; margin: 16px 0; }

/* forms */
form.f { display: grid; gap: 14px; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
label { display: grid; gap: 6px; font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
input, select, textarea { font: 16px "Barlow", system-ui, sans-serif; color: var(--bone); background: var(--ink); border: 1px solid var(--line-2); border-radius: 0; padding: 10px 12px; min-height: 46px; width: 100%; text-transform: none; letter-spacing: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--bone); outline-offset: 2px; }
button, .btn { font-family: var(--head); font-weight: 600; font-size: 15px; letter-spacing: 0; border: 0; border-radius: 999px; padding: 0 22px; min-height: 46px; cursor: pointer; background: var(--act); color: var(--act-ink); text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:hover, .btn:hover { background: var(--act-hot); }
button.ghost, .btn.ghost { background: transparent; color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); }
button.ghost:hover, .btn.ghost:hover { background: var(--coal2); }
button.danger { background: transparent; color: var(--red-hot); box-shadow: inset 0 0 0 1px var(--red); }
button:disabled { opacity: .6; cursor: wait; }
.check { display: flex; gap: 10px; align-items: center; color: var(--bone); font: 15px "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
.check input { width: 22px; height: 22px; min-height: 0; flex: none; accent-color: var(--act); }
.msg { font-family: var(--mono); font-size: 13px; min-height: 1.5em; color: var(--grey); }
.msg.err { color: var(--red-hot); }
.msg.good { color: var(--green); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.auth { max-width: 400px; margin: 12vh auto 0; }

/* The GP summary prints light. */
@media print {
  :root { --ink: #fff; --coal: #fff; --coal2: #fff; --bone: #000; --body: #111; --grey: #444; --faint: #444; --line: #bbb; --line-2: #999; --red-hot: #a32e22; }
  body { font-size: 12px; }
  header.top, .no-print { display: none !important; }
  .card { break-inside: avoid; }
  .wrap { padding: 0; max-width: none; }
}

@media (max-width: 420px) { header.top .in { padding: 6px 8px; } .brand { font-size: 16px; } nav.main a { padding: 0 8px; } }
.labs tr.trend p.note { color: var(--bone); border-left: 2px solid var(--gold); padding-left: 10px; font-size: 14px; }

/* ---------------------------------------------------------- visual layer */
.ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ico.hi { fill: currentColor; stroke: none; }
.ico.hi path { fill: currentColor; }

.sec { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; }
.sec h2 { margin: 0; }
.sec .k { white-space: nowrap; }
/* On a phone a long label squeezed the heading to one word a line: let the
   label wrap under the heading instead. */
@media (max-width: 480px) {
  .sec { flex-wrap: wrap; row-gap: 2px; }
  .sec h2 { flex: 1 1 auto; }
  .sec .k { white-space: normal; }
}

/* issue cards: what it is, where it sits, in one look */
.issues { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .issues { grid-template-columns: 1fr 1fr; } }
.issue { display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 14px; align-items: start; background: var(--coal); border: 1px solid var(--line); border-top: 3px solid var(--red-hot); padding: 14px 16px 12px; text-decoration: none; color: var(--body); }
.issue:hover { background: var(--coal2); }
.issue .badge { grid-row: span 2; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--out-bg); color: var(--red-hot); }
.issue .sys { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.issue .nm { font-family: var(--head); font-weight: 600; font-size: 19px; letter-spacing: 0; color: var(--bone); line-height: 1.18; }
.issue .plain { grid-column: 2; font-size: 14px; color: var(--grey); margin-top: -2px; }
.issue .val { grid-row: 1 / 3; grid-column: 3; text-align: right; }
.issue .val b { display: block; font-family: var(--head); font-weight: 600; font-size: 28px; line-height: 1; color: var(--red-hot); font-variant-numeric: tabular-nums; }
.issue .val small { font-family: var(--mono); font-size: 11px; color: var(--grey); }
.issue .gauge { grid-column: 1 / 4; margin-top: 6px; }
.pill { display: inline-block; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; padding: 3px 8px; margin-top: 6px; }
.pill.hi, .pill.lo { background: var(--out-bg); color: var(--red-hot); }
.pill.ok { background: var(--ok-bg); color: var(--green); }
.gauge svg { width: 100%; height: auto; display: block; overflow: visible; }
.gauge text { font-family: var(--mono); font-size: 11px; fill: var(--faint); }

/* quick actions */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; background: var(--coal); border: 1px solid var(--line-2); color: var(--bone); text-decoration: none; font-family: var(--head); font-weight: 600; font-size: 14px; letter-spacing: 0; }
.chip:hover { background: var(--coal2); }
.chip.warn { border-color: var(--gold-fill); background: var(--warn-bg); }
.chip .ico { width: 18px; height: 18px; }
.chip small { font-family: var(--mono); font-size: 11px; color: var(--grey); text-transform: none; letter-spacing: 0; }

/* vitals with a sparkline each */
.vitals { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .vitals { grid-template-columns: repeat(4, 1fr); } }
.vital { background: var(--coal); border: 1px solid var(--line); padding: 14px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--body); min-height: 150px; }
.vital:hover { background: var(--coal2); }
.vital .top { display: flex; align-items: center; gap: 8px; color: var(--faint); }
.vital .v { font-family: var(--head); font-weight: 600; font-size: 32px; line-height: 1; color: var(--bone); font-variant-numeric: tabular-nums; }
.vital .v small { font-family: var(--mono); font-size: 12px; font-weight: 400; color: var(--grey); margin-left: 4px; }
.vital .d { font-family: var(--mono); font-size: 11px; color: var(--grey); }
.vital .spark { margin-top: auto; height: 34px; }
.vital .spark svg { width: 100%; height: 34px; display: block; }
.vital.none .v { font-size: 18px; color: var(--faint); }
.vital .ringrow { display: flex; align-items: center; gap: 12px; }

/* body systems */
.systems { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .systems { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 960px) { .systems { grid-template-columns: repeat(5, 1fr); } }
.sys-t { display: flex; flex-direction: column; gap: 8px; padding: 14px; background: var(--coal); border: 1px solid var(--line); border-bottom: 3px solid var(--green); text-decoration: none; color: var(--body); min-height: 112px; }
.sys-t:hover { background: var(--coal2); }
.sys-t.bad { border-bottom-color: var(--red-hot); }
.sys-t .ib { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--ok-bg); color: var(--green); }
.sys-t.bad .ib { background: var(--out-bg); color: var(--red-hot); }
.sys-t .nm { font-family: var(--head); font-weight: 600; font-size: 15px; letter-spacing: 0; color: var(--bone); line-height: 1.25; }
.sys-t .st { font-family: var(--mono); font-size: 11px; color: var(--green); margin-top: auto; }
.sys-t.bad .st { color: var(--red-hot); }
.dots { display: flex; gap: 3px; flex-wrap: wrap; }
.dots i { width: 8px; height: 8px; background: var(--green); display: block; }
.dots i.o { background: var(--red-hot); }

/* bloods tab: one block per body system */
.group { background: var(--coal); border: 1px solid var(--line); margin-bottom: 12px; scroll-margin-top: 12px; }
.group > summary { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 14px 16px; cursor: pointer; list-style: none; }
.group > summary::-webkit-details-marker { display: none; }
.group .ib { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--ok-bg); color: var(--green); }
.group.bad .ib { background: var(--out-bg); color: var(--red-hot); }
.group .gn { font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: 0; color: var(--bone); line-height: 1.2; }
.group .gw { font-size: 14px; color: var(--grey); }
.group .gs { font-family: var(--mono); font-size: 12px; color: var(--green); text-align: right; }
.group.bad .gs { color: var(--red-hot); }
.group[open] > summary { border-bottom: 1px solid var(--line); }
.trs { padding: 4px 16px 8px; }
.tr { display: grid; grid-template-columns: 1fr minmax(120px, 42%) auto; gap: 14px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.tr:first-child { border-top: 0; }
.tr .tn button.link { font-size: 15px; }
.tr .tp { display: block; font-size: 13px; color: var(--grey); }
.tr .tv { font-family: var(--mono); font-size: 14px; color: var(--bone); text-align: right; white-space: nowrap; }
.tr .tv .u { display: block; font-size: 11px; color: var(--grey); }
.tr.o .tv { color: var(--red-hot); }
.tr.hist { display: block; background: var(--ink); padding: 12px; border-top: 0; }
.tr.hist p.note { color: var(--bone); border-left: 2px solid var(--gold-fill); padding-left: 10px; font-size: 14px; }
.key { display: flex; gap: 16px; align-items: center; font-family: var(--mono); font-size: 11px; color: var(--grey); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 12px; flex-wrap: wrap; }
.key i { display: inline-block; vertical-align: middle; margin-right: 6px; }
.key .kb { width: 22px; height: 10px; background: var(--band); }
.key .kd { width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.key .kr { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--grey); }
.seg { display: inline-flex; border: 1px solid var(--line-2); }
.seg button, button.segb { background: transparent; color: var(--grey); box-shadow: none; font: 600 13px "Barlow", system-ui, sans-serif; letter-spacing: 0; min-height: 44px; padding: 0 16px; }
.seg button[aria-pressed="true"] { background: var(--coal2); color: var(--bone); }

/* performance chips: what a result touches */
.pchips { display: flex; gap: 6px; flex-wrap: wrap; }
.pchip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; padding: 4px 8px; border: 1px solid var(--line-2); color: var(--faint); transition: background .15s, color .15s; }
.pchip .ico { width: 14px; height: 14px; }
.pchip.on { color: var(--bone); border-color: var(--gold-fill); background: var(--warn-bg); }
.pill.warn { background: var(--warn-bg); color: var(--gold); }

/* body figure */
.bodywrap { display: grid; gap: 16px; grid-template-columns: 1fr; background: var(--coal); border: 1px solid var(--line); padding: 16px; }
@media (min-width: 700px) { .bodywrap { grid-template-columns: 220px 1fr; align-items: start; } }
.figbox { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-items: start; }
.figure { width: 100%; height: auto; display: block; }
.bm path { stroke: var(--coal); stroke-width: 2; transition: fill .2s, opacity .2s; }
.bm-m path { fill: var(--coal3); }
.bm-j path, .bm-x path { fill: var(--coal2); }
.figbox.allm .bm-m path { fill: var(--green); opacity: .55; }
.figbox.allm.bad .bm-m path { fill: var(--red-hot); }
.figbox.whole .bm path { fill: var(--green); opacity: .35; }
.figbox.whole.bad .bm path { fill: var(--red-hot); }
.org { color: var(--faint); cursor: pointer; transition: filter .15s, opacity .15s; }
.org.ok { color: var(--green); } .org.bad { color: var(--red-hot); }
.org .halo { fill: var(--coal); opacity: .82; }
.org path { fill: currentColor; }
.org.on .halo { fill: var(--bone); opacity: .18; }
.org.on { filter: drop-shadow(0 0 10px currentColor); }
@media (min-width: 700px) { .bodywrap { grid-template-columns: 440px 1fr; } }
.syslist { display: grid; gap: 4px; margin-top: 12px; }
.sysrow { display: grid; grid-template-columns: 32px 1fr auto 44px; gap: 10px; align-items: center; min-height: 44px; padding: 4px 8px; text-decoration: none; color: var(--body); border-left: 3px solid var(--green); background: var(--tint); }
.sysrow:hover, .sysrow:focus-visible { background: var(--coal2); }
.sysrow.bad { border-left-color: var(--red-hot); }
.sysrow .ib { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--green); }
.sysrow.bad .ib { color: var(--red-hot); }
.sysrow .nm { font-family: var(--head); font-weight: 500; font-size: 15px; letter-spacing: 0; color: var(--bone); }
.sysrow .st { font-family: var(--mono); font-size: 11px; text-transform: uppercase; color: var(--green); text-align: right; }
.sysrow.bad .st { color: var(--red-hot); }

/* performance tab */
.pareas { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .pareas { grid-template-columns: repeat(4, 1fr); } }
.parea { background: var(--coal); border: 1px solid var(--line); border-top: 3px solid var(--green); padding: 14px; display: grid; gap: 6px; }
.parea.warn { border-top-color: var(--gold-fill); }
.parea .pi { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--ok-bg); color: var(--green); }
.parea.warn .pi { background: var(--warn-bg); color: var(--gold); }
.parea .nm { font-family: var(--head); font-weight: 600; font-size: 18px; letter-spacing: 0; color: var(--bone); }
.pcards { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) { .pcards { grid-template-columns: 1fr 1fr; } }
.pcard { display: grid; gap: 8px; background: var(--coal); border: 1px solid var(--line); border-left: 3px solid var(--green); padding: 14px 16px; text-decoration: none; color: var(--body); }
.pcard:hover { background: var(--coal2); }
.pcard.warn { border-left-color: var(--gold-fill); } .pcard.bad { border-left-color: var(--red-hot); }
.pcard.none { border-left-color: var(--line-2); border-style: dashed; }
.pcard .top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pcard .nm { font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: 0; color: var(--bone); }
.pcard .val b { font-family: var(--head); font-weight: 600; font-size: 24px; color: var(--bone); }
.pcard.bad .val b { color: var(--red-hot); }
.pcard .val small { font-family: var(--mono); font-size: 11px; color: var(--grey); margin-left: 4px; }

/* the result sheet */
body.noscroll { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(0,0,0,.55); display: flex; align-items: flex-end; justify-content: center; }
.sheet-in { position: relative; background: var(--coal); width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; overscroll-behavior: contain; padding: 22px 18px 28px; border-top: 3px solid var(--act); }
@media (min-width: 700px) { .sheet { align-items: center; } .sheet-in { border: 1px solid var(--line-2); border-top: 3px solid var(--act); } }
.sh-x { position: absolute; top: 10px; right: 10px; background: transparent; color: var(--grey); min-height: 44px; min-width: 44px; padding: 0; }
.sh-x:hover { background: var(--coal2); color: var(--bone); }
.sh-head { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: start; padding-right: 44px; }
.sh-head .badge { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--ok-bg); color: var(--green); }
.sh-head .badge.bad { background: var(--out-bg); color: var(--red-hot); }
.sh-head .sys { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.sh-head .nm { font-family: var(--head); font-weight: 600; font-size: 22px; letter-spacing: 0; color: var(--bone); }
.sh-head .plain { font-size: 14px; color: var(--grey); }
.sh-head .val { text-align: right; }
.sh-head .val b { display: block; font-family: var(--head); font-weight: 600; font-size: 32px; line-height: 1; color: var(--bone); }
.sh-head .val b.o { color: var(--red-hot); }
.sh-head .val small { font-family: var(--mono); font-size: 11px; color: var(--grey); }
.sh-pills { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0 4px; }
.sh-pills .pill { margin-top: 0; }
.sheet h3 { font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--faint); margin: 20px 0 8px; }
.sheet .why { color: var(--body); font-size: 15px; margin: 8px 0 0; }
.levers { display: grid; gap: 8px; }
.lever { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: start; background: var(--tint); border: 1px solid var(--line); padding: 10px 12px; font-size: 15px; color: var(--body); }
.lever .li { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: var(--ok-bg); color: var(--green); }
.lever b, .gpline b { display: block; font-family: var(--head); font-weight: 500; font-size: 14px; letter-spacing: 0; color: var(--bone); }
.gpline { display: grid; grid-template-columns: 36px 1fr; gap: 12px; align-items: center; margin-top: 8px; padding: 10px 12px; border-left: 3px solid var(--gold-fill); background: var(--warn-bg); font-size: 15px; color: var(--body); }
.gpline .ico { justify-self: center; color: var(--gold); }
.sheet .note { color: var(--bone); border-left: 2px solid var(--gold-fill); padding-left: 10px; font-size: 14px; }
.sheet .srcs { font-size: 13px; color: var(--grey); }
.sheet .srcs a { color: var(--body); }
.sheet .disc { font-family: var(--mono); font-size: 11px; color: var(--faint); margin-top: 16px; }
.key .kg { width: 22px; height: 3px; background: var(--gold-fill); }
#systems { display: block; }

/* record tab: the rest of the GP record, as written */
.rtiles { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-top: 6px; }
@media (min-width: 760px) { .rtiles { grid-template-columns: repeat(4, 1fr); } }
.rtile { background: var(--coal); border: 1px solid var(--line); border-top: 3px solid var(--line-2); padding: 14px; display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto auto; gap: 2px 12px; text-decoration: none; color: var(--body); }
.rtile:hover { background: var(--coal2); }
.rtile.bad { border-top-color: var(--red-hot); }
.rtile .ri { grid-row: span 3; }
.rtile .rn { font-family: var(--head); font-weight: 600; font-size: 30px; line-height: 1; color: var(--bone); font-variant-numeric: tabular-nums; }
.rtile .k { font-size: 11px; }
.rtile .rl { font-family: var(--head); font-weight: 500; font-size: 14px; letter-spacing: 0; color: var(--bone); }
.ri { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: var(--coal2); color: var(--grey); }
.ri .ico { width: 24px; height: 24px; }
.rtile.bad .ri, .ritem.bad .ri { background: var(--out-bg); color: var(--red-hot); }
.rlist { display: grid; gap: 8px; }
@media (min-width: 760px) { .rlist { grid-template-columns: repeat(2, 1fr); } }
.ritem { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; background: var(--coal); border: 1px solid var(--line); border-left: 3px solid var(--line-2); padding: 10px 14px 10px 12px; }
.ritem.bad { border-left-color: var(--red-hot); }
.ritem .nm { font-family: var(--head); font-weight: 500; font-size: 16px; letter-spacing: 0; color: var(--bone); line-height: 1.2; }
.ritem .pill { margin-top: 0; }
.ritem .rd { text-align: right; white-space: nowrap; }
.ritem .rd b { display: block; font-family: var(--head); font-weight: 600; font-size: 16px; color: var(--bone); }
.ritem .rd small { font-family: var(--mono); font-size: 11px; color: var(--grey); }
details.fold .rlist { padding-bottom: 12px; }
.tls { display: grid; gap: 0; padding-bottom: 8px; }
.tl { display: grid; grid-template-columns: 96px 1fr; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tl .ty { font-family: var(--head); font-weight: 600; font-size: 16px; letter-spacing: 0; color: var(--bone); }
.tl .tc { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 14px; padding: 3px 9px; background: var(--coal2); border: 1px solid var(--line); color: var(--body); }
.vgrid { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .vgrid { grid-template-columns: repeat(4, 1fr); } }
.vcard { background: var(--coal); border: 1px solid var(--line); padding: 14px; display: grid; gap: 4px; }
.vcard .ri { color: var(--green); background: var(--ok-bg); margin-bottom: 4px; }
.vcard .nm { font-family: var(--head); font-weight: 600; font-size: 16px; letter-spacing: 0; color: var(--bone); }
.vcard .vd { font-family: var(--head); font-weight: 500; font-size: 20px; color: var(--bone); }
.mbars { display: flex; align-items: flex-end; gap: 3px; height: 110px; border-bottom: 1px solid var(--line-2); }
.mbars .mb { flex: 1; height: 100%; display: flex; align-items: flex-end; }
.mbars .mb i { display: block; width: 100%; background: var(--s2); }
.mlabels { display: flex; gap: 3px; margin-top: 6px; }
.mlabels span { flex: 1; font-family: var(--mono); font-size: 10px; color: var(--grey); white-space: nowrap; overflow: visible; }
.rsrc { margin-top: 18px; }

/* ---- body explorer
   One system at a time. The muscle model is a dim silhouette; the chosen
   system lights up and everything else steps back. Motion is slow and
   carries meaning: the heart beats at your resting rate, the lungs at your
   breathing rate, blood flows along the arteries. All of it stops for
   anyone who asks the system for reduced motion. */
.explorer { display: grid; gap: 16px; grid-template-columns: 1fr; margin-top: 6px; }
@media (min-width: 900px) { .explorer { grid-template-columns: 360px 220px 1fr; align-items: start; } }
.stage { background: radial-gradient(ellipse at 50% 40%, var(--coal2), var(--coal) 70%); border: 1px solid var(--line); padding: 16px 12px 12px; display: grid; gap: 12px; justify-items: center; }
@media (min-width: 900px) { .stage { position: sticky; top: 12px; } }
.xfig { --sel: var(--bone); width: 100%; max-width: 290px; perspective: 1400px; }
@media (max-width: 899px) { .xfig { max-width: 270px; } }
.xfig.st-ok { --sel: var(--green); } .xfig.st-bad { --sel: var(--red-hot); } .xfig.st-info { --sel: var(--s2); }
/* Three stacked views: Inside (anatomy), Muscles, Back. A crossfade,
   because a 3D flip between three faces reads as a trick, not a turn. */
.xfig .frame { position: relative; aspect-ratio: 724 / 1400; }
.xfig .face { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity .45s; }
.xfig[data-face="inside"] .face.inside, .xfig[data-face="front"] .face.front, .xfig[data-face="back"] .face.back { opacity: 1; pointer-events: auto; }
.xfig svg.figure { width: 100%; height: 100%; display: block; overflow: visible; }
.xfig .bm path { fill: var(--coal3); stroke: var(--line-2); stroke-width: 1.5; transition: fill .5s, opacity .5s; }
.xfig .bm-j path, .xfig .bm-x path { fill: var(--coal2); }
.xfig.sel .bm path { opacity: .55; }
/* organs: dim at rest, the chosen one grows and glows */
.xfig .org { color: var(--faint); cursor: pointer; outline: none; transform-box: fill-box; transform-origin: center; transition: opacity .45s, transform .55s cubic-bezier(.2,.9,.25,1.2), filter .45s; }
.xfig .org.ok { color: var(--green); } .xfig .org.bad { color: var(--red-hot); } .xfig .org.info { color: var(--s2); }
.xfig .org path { fill: currentColor; }
.xfig .org .ring { fill: none; stroke: currentColor; stroke-width: 3; opacity: 0; transform-box: fill-box; transform-origin: center; }
.xfig .org .pulse { transform-box: fill-box; transform-origin: center; }
.xfig.sel .org { opacity: .14; }
.xfig.sel .org.on { opacity: 1; transform: scale(1.14); filter: drop-shadow(0 0 14px currentColor); }
.xfig .org:hover, .xfig .org:focus-visible { opacity: 1; filter: drop-shadow(0 0 8px currentColor); }
.xfig .org.on .ring { animation: ping 2.2s ease-out infinite; }
.xfig .org[data-org="heart"] .pulse { animation: beat var(--beat, 1s) ease-in-out infinite; }
.xfig .org[data-org="lungs"] .pulse { animation: breathe var(--breath, 4s) ease-in-out infinite; }
@keyframes beat { 0%, 100% { transform: scale(1); } 12% { transform: scale(1.09); } 24% { transform: scale(1); } 36% { transform: scale(1.05); } 50% { transform: scale(1); } }
@keyframes breathe { 0%, 100% { transform: scale(.97, .96); } 45% { transform: scale(1.03, 1.05); } }
@keyframes ping { 0% { opacity: .7; transform: scale(.9); } 100% { opacity: 0; transform: scale(1.7); } }
/* blood: the arterial tree draws in, then flows */
.xfig .vessels path { fill: none; stroke: var(--sel); stroke-width: 6; stroke-linecap: round; opacity: 0; stroke-dasharray: 2 18; transition: opacity .6s; }
.xfig.v-on .vessels path { opacity: .85; animation: flow 1.1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
/* muscle: a wave that runs down the body */
.xfig.m-on .bm-m path { fill: var(--sel); opacity: .35; animation: wave 2.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
@keyframes wave { 0%, 100% { opacity: .22; } 40% { opacity: .8; } }
/* whole body: a slow tide of colour */
.xfig.w-on .bm path { fill: var(--sel); animation: tide 3.2s ease-in-out infinite; }
@keyframes tide { 0%, 100% { opacity: .18; } 50% { opacity: .5; } }
/* what is lit, under the figure */
.readout { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; justify-content: center; min-height: 28px; }
.readout i { width: 10px; height: 10px; background: var(--faint); align-self: center; }
.readout.ok i { background: var(--green); } .readout.bad i { background: var(--red-hot); } .readout.info i { background: var(--s2); }
.readout b { font: 600 18px var(--head); letter-spacing: 0; color: var(--bone); }
.readout span { font: 11px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--grey); }
.readout.bad span { color: var(--red-hot); } .readout.ok span { color: var(--green); }
.readout.in { animation: rise .4s cubic-bezier(.2,.8,.2,1) both; }
.seg { display: inline-flex; border: 1px solid var(--line-2); }
.seg button, button.segb { min-height: 36px; padding: 0 16px; background: transparent; border: 0; color: var(--grey); font: 600 13px "Barlow", system-ui, sans-serif; letter-spacing: 0; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--coal3); color: var(--bone); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; font: 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--grey); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.lg { width: 10px; height: 10px; display: inline-block; }
.lg.ok { background: var(--green); } .lg.bad { background: var(--red-hot); } .lg.info { background: var(--s2); }
/* system list: a column on desktop, a swipeable row on phones */
.sysnav { display: flex; flex-wrap: wrap; gap: 6px; }
@media (max-width: 899px) { .sysnav button.sysbtn { min-height: 40px; padding: 0 10px; gap: 8px; } .sysnav .sysbtn .nm { font-size: 13px; } }
@media (min-width: 900px) { .sysnav { flex-direction: column; flex-wrap: nowrap; } }
.sysbtn, button.sysbtn { flex: 0 0 auto; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; justify-content: stretch; min-height: 44px; padding: 0 12px; background: var(--coal); border: 1px solid var(--line); border-left: 3px solid var(--line-2); color: var(--body); cursor: pointer; text-align: left; transition: background .2s, border-color .2s, transform .2s; }
.sysbtn .ico { width: 20px; height: 20px; color: var(--faint); }
.sysbtn .nm { font: 600 14px/1.15 var(--head); letter-spacing: 0; color: var(--bone); }
.sysbtn, button.sysbtn { grid-template-columns: 22px minmax(0, 1fr) auto auto; }
.sysbtn .st { font: 600 13px var(--head); color: var(--red-hot); }
.sysbtn .pl { font: 500 11px var(--mono); color: var(--ink); background: var(--gold-fill); min-width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.sysbtn .pl[hidden] { display: none; }
.sysbtn.ok { border-left-color: var(--green); } .sysbtn.bad { border-left-color: var(--red-hot); } .sysbtn.info { border-left-color: var(--s2); }
.sysbtn.none .nm { color: var(--faint); }
button.sysbtn:hover { background: var(--coal2); }
button.sysbtn[aria-pressed="true"] { background: var(--coal3); transform: translateX(3px); }
.sysbtn[aria-pressed="true"] .ico { color: var(--bone); }
@media (max-width: 899px) { .sysbtn[aria-pressed="true"] { transform: none; } }
/* the detail panel */
.sysdetail { background: var(--coal); border: 1px solid var(--line); padding: 18px; min-height: 300px; }
.sysdetail.enter > * { animation: rise .45s cubic-bezier(.2,.8,.2,1) both; }
.sysdetail.enter > *:nth-child(2) { animation-delay: .05s; } .sysdetail.enter > *:nth-child(3) { animation-delay: .1s; }
.sysdetail.enter > *:nth-child(4) { animation-delay: .15s; } .sysdetail.enter > *:nth-child(n+5) { animation-delay: .2s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.sd-head { display: grid; grid-template-columns: 64px 1fr; gap: 6px 16px; align-items: start; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.sd-head .pill { grid-column: 2; justify-self: start; margin-top: 0; }
.sd-head h2 { margin: 2px 0 4px; font-size: 24px; }
.sd-head p { margin: 0; color: var(--grey); font-size: 15px; }
.sd-ic { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: var(--coal2); color: var(--faint); grid-row: span 2; }
.sd-ic svg { width: 44px; height: 44px; fill: currentColor; }
.sd-ic svg path { fill: currentColor; }
.sd-head.ok .sd-ic { color: var(--green); background: var(--ok-bg); } .sd-head.bad .sd-ic { color: var(--red-hot); background: var(--out-bg); } .sd-head.info .sd-ic { color: var(--s2); }
.sd-sec { padding-top: 14px; }
.sd-sec h3 { margin: 0 0 10px; font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--grey); }
.sd-sec .trs { padding: 0; }
.sd-sec .tc { display: flex; flex-wrap: wrap; gap: 6px; }
.sd-sec .tag { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.sd-sec .tag small { font: 11px var(--mono); color: var(--grey); }
.sd-sec .tag .ico { width: 16px; height: 16px; }
.sd-stats { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.sd-stats div { background: var(--coal2); padding: 10px 12px; display: grid; gap: 2px; }
.sd-stats b { font: 600 24px var(--head); color: var(--bone); font-variant-numeric: tabular-nums; }
.sd-stats b small { font: 11px var(--mono); color: var(--grey); margin-left: 4px; }
.sd-stats span { font: 11px var(--mono); color: var(--grey); }
.sd-sup { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 10px 12px; margin-bottom: 6px; background: var(--coal2); text-decoration: none; color: var(--body); font-size: 14px; border-left: 3px solid var(--gold-fill); }
.sd-sup b { font: 500 14px var(--head); letter-spacing: 0; color: var(--bone); }
.sd-sup:hover { background: var(--coal3); }
/* today's chips into the explorer */
.syschips { display: flex; flex-wrap: wrap; gap: 8px; }
.syschip { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; background: var(--coal); border: 1px solid var(--line); border-left: 3px solid var(--green); color: var(--bone); text-decoration: none; font: 500 14px var(--head); letter-spacing: 0; transition: background .2s; }
.syschip:hover { background: var(--coal2); }
.syschip .ico { width: 20px; height: 20px; color: var(--green); }
.syschip small { font: 11px var(--mono); color: var(--grey); }
.syschip.bad { border-left-color: var(--red-hot); } .syschip.bad .ico, .syschip.bad small { color: var(--red-hot); }
.syschip.info { border-left-color: var(--s2); } .syschip.info .ico { color: var(--s2); }
/* the small figure on supplement cards */
.xfig.mini { max-width: 140px; perspective: none; }
.xfig.mini svg.figure { height: auto; }
@media (prefers-reduced-motion: reduce) {
  .xfig *, .xfig .face, .sysdetail.enter > *, .sysbtn { animation: none !important; transition: none !important; }
}

/* ---- supplements */
.xfig.st-supp { --sel: var(--gold-fill); }
.xfig.mini .org.on { color: var(--gold-fill); }
.supp { display: grid; grid-template-columns: 1fr; gap: 16px; background: var(--coal); border: 1px solid var(--line); border-top: 3px solid var(--gold-fill); padding: 18px; margin-bottom: 14px; scroll-margin-top: 12px; }
@media (min-width: 760px) { .supp { grid-template-columns: 150px 1fr; } }
.supp.fresh { animation: rise .5s cubic-bezier(.2,.8,.2,1) both; }
.supp-fig { display: flex; justify-content: center; align-items: flex-start; }
@media (max-width: 759px) { .supp-fig { display: none; } }
.supp-h { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; }
.supp-h .nm { font: 600 20px var(--head); letter-spacing: 0; color: var(--bone); }
.supp-act { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
button.small { min-height: 36px; padding: 0 12px; font-size: 12px; }
.supp .what { margin: 12px 0 4px; font-size: 16px; color: var(--body); }
.supp h3 { margin: 16px 0 8px; font: 12px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--grey); }
.acts { display: grid; gap: 6px; }
@media (min-width: 1000px) { .acts { grid-template-columns: 1fr 1fr; } }
.act { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding: 10px 12px; background: var(--coal2); text-decoration: none; color: var(--body); font-size: 14px; transition: background .2s; }
.act:hover { background: var(--coal3); }
.act .ico { color: var(--gold); width: 22px; height: 22px; }
.act b { font: 500 14px var(--head); letter-spacing: 0; color: var(--bone); }
.moves { display: grid; gap: 6px; }
.move { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--tint); border: 1px solid var(--line); }
.mv-dir { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; font: 600 20px var(--head); background: var(--coal2); color: var(--bone); }
.move.test .mv-dir { background: var(--warn-bg); color: var(--gold); }
.move b { font: 500 15px var(--head); letter-spacing: 0; color: var(--bone); }
.mv-k { font: 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--grey); margin-left: 6px; }
.mv-t { font-size: 14px; color: var(--grey); }
.yv, button.yv { text-align: right; font: 600 18px var(--head); color: var(--bone); white-space: nowrap; display: grid; justify-items: end; gap: 2px; background: none; border: 0; padding: 0; cursor: pointer; }
.yv small { font: 11px var(--mono); color: var(--grey); margin-left: 4px; font-weight: 400; }
.yv .pill { margin-top: 0; }
.yv.none { font: 11px var(--mono); color: var(--faint); cursor: default; }
@media (max-width: 560px) { .move { grid-template-columns: 34px 1fr; } .yv { grid-column: 2; justify-items: start; text-align: left; } }
.note { margin: 14px 0 0; padding: 10px 12px; border-left: 3px solid var(--gold-fill); background: var(--warn-bg); color: var(--body); font-size: 14px; }
.srcs { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 0; font: 11px var(--mono); }
.srcs a { color: var(--grey); }
.srcs a::before { content: "Source: "; color: var(--faint); }
.scat { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.scard, button.scard { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--coal); border: 1px solid var(--line); color: var(--body); text-align: left; cursor: pointer; font: inherit; text-transform: none; letter-spacing: 0; min-height: 60px; transition: background .2s, border-color .2s; }
button.scard:hover { background: var(--coal2); border-color: var(--gold-fill); }
.scard .nm { font: 500 15px var(--head); letter-spacing: 0; color: var(--bone); }
.scard .k { font-size: 11px; }
.scard .plus { font: 600 22px var(--head); color: var(--gold); }
form.inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-top: 14px; }
form.inline label { display: grid; gap: 4px; font: 12px var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--grey); }
form.inline .msg { flex-basis: 100%; margin: 0; }
@media (prefers-reduced-motion: reduce) { .supp.fresh { animation: none; } }
.seg button:hover { background: var(--coal2); color: var(--bone); }
.seg button[aria-pressed="true"]:hover { background: var(--coal3); }
button.yv:hover { background: none; }
button.yv.link { text-decoration: none; }
.pill.info { background: rgba(126,155,214,.14); color: var(--s2); }
@media (max-width: 560px) {
  .supp-h { grid-template-columns: 40px 1fr; }
  .supp-act { grid-column: 1 / -1; justify-content: flex-start; }
  button.yv, .yv { justify-content: start; justify-items: start; text-align: left; }
}

/* since the last draw */
.moved { display: grid; gap: 6px; }
@media (min-width: 760px) { .moved { grid-template-columns: 1fr 1fr; } .moved > p { grid-column: 1 / -1; } }
.mv { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; background: var(--coal); border: 1px solid var(--line); border-left: 3px solid var(--line-2); text-decoration: none; color: var(--body); transition: background .2s; }
.mv:hover { background: var(--coal2); }
.mv .arr { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font: 600 20px var(--head); background: var(--coal2); color: var(--bone); }
.mv.left { border-left-color: var(--red-hot); } .mv.left .arr { background: var(--out-bg); color: var(--red-hot); }
.mv.back { border-left-color: var(--green); } .mv.back .arr { background: var(--ok-bg); color: var(--green); }
.mv.moved { border-left-color: var(--gold-fill); } .mv.moved .arr { background: var(--warn-bg); color: var(--gold); }
.mv .nm { font: 500 15px var(--head); letter-spacing: 0; color: var(--bone); }
.mv .nums { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mv .was { font: 14px var(--mono); color: var(--grey); text-decoration: line-through; margin-right: 8px; }
.mv .now { font: 600 20px var(--head); color: var(--bone); }
.mv.left .now { color: var(--red-hot); } .mv.back .now { color: var(--green); }
.mv small { font: 11px var(--mono); color: var(--grey); margin-left: 4px; }

/* timeline */
.tlfilters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
button.tlf { min-height: 36px; padding: 0 12px; font: 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; background: var(--coal); color: var(--bone); border: 1px solid var(--line-2); gap: 6px; }
button.tlf small { color: var(--grey); font-size: 11px; }
button.tlf[aria-pressed="false"] { color: var(--faint); border-color: var(--line); text-decoration: line-through; }
button.tlf:hover { background: var(--coal2); }
.tly h3 { position: sticky; top: 0; z-index: 1; margin: 0 0 8px; padding: 8px 0 6px; background: var(--ink); font: 600 22px var(--head); color: var(--bone); border-bottom: 1px solid var(--line-2); }
.tly h3 small { margin-left: 10px; font: 11px var(--mono); color: var(--grey); }
.tlrail { margin: 0 0 22px; }
.tle { display: grid; grid-template-columns: 58px 32px 1fr; gap: 10px; align-items: center; padding: 8px 10px; margin-bottom: 4px; background: var(--coal); border: 1px solid var(--line); border-left: 3px solid var(--line-2); text-decoration: none; color: var(--body); transition: background .2s; }
.tle.ok { border-left-color: var(--green); } .tle.bad { border-left-color: var(--red-hot); } .tle.info { border-left-color: var(--s2); }
.tle:hover { background: var(--coal2); }
.tld { font: 11px var(--mono); color: var(--grey); white-space: nowrap; }
.tli { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--coal2); color: var(--faint); }
.tli .ico { width: 20px; height: 20px; }
.tle.ok .tli { color: var(--green); } .tle.bad .tli { color: var(--red-hot); background: var(--out-bg); } .tle.info .tli { color: var(--s2); }
.tle .nm { font: 500 15px var(--head); letter-spacing: 0; color: var(--bone); }
@media (min-width: 760px) { .tlrail { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; } .tle { margin: 0; } }

/* pressure */
.bpstats { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; margin-bottom: 14px; }
@media (min-width: 760px) { .bpstats { grid-template-columns: 2fr 1fr 1fr; } }
.bpstat { background: var(--coal); border: 1px solid var(--line); border-top: 3px solid var(--line-2); padding: 14px; display: grid; gap: 4px; }
.bpstat.big { grid-column: 1 / -1; }
@media (min-width: 760px) { .bpstat.big { grid-column: auto; } }
.bpstat b { font: 600 34px var(--head); line-height: 1; color: var(--bone); font-variant-numeric: tabular-nums; }
.bpstat.big b { font-size: 48px; }
.bpstat span { font: 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--grey); }
.bpstat small { font: 12px var(--mono); color: var(--bone); }
.bpstat.ok { border-top-color: var(--green); } .bpstat.ok small { color: var(--green); }
.bpstat.warn { border-top-color: var(--gold-fill); } .bpstat.warn small { color: var(--gold); }
.bpstat.bad { border-top-color: var(--red-hot); } .bpstat.bad small { color: var(--red-hot); }
.bpstat.none b { font-size: 20px; color: var(--faint); }
.t-ok { color: var(--green); } .t-warn { color: var(--gold); } .t-bad { color: var(--red-hot); }
.protodays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.pd { display: grid; gap: 3px; justify-items: center; padding: 8px 2px; background: var(--coal2); border-top: 3px solid var(--line-2); }
.pd.half { border-top-color: var(--gold-fill); } .pd.done { border-top-color: var(--green); }
.pdl { font: 11px var(--mono); text-transform: uppercase; color: var(--grey); }
.pdm { font: 10px var(--mono); padding: 2px 5px; color: var(--faint); border: 1px solid var(--line); }
.pdm.on { color: var(--bone); background: var(--coal3); border-color: var(--line-2); }

/* meets */
.mtiles { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); margin-bottom: 14px; }
@media (min-width: 760px) { .mtiles { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .mtiles { grid-template-columns: repeat(6, 1fr); } }
.mtile { background: var(--coal); border: 1px solid var(--line); border-top: 3px solid var(--gold-fill); padding: 12px 14px; display: grid; gap: 3px; }
.mtile b { font: 600 28px var(--head); line-height: 1; color: var(--bone); font-variant-numeric: tabular-nums; }
.mtile b small { font: 11px var(--mono); color: var(--grey); margin-left: 3px; }
.mtile span { font: 11px var(--mono); letter-spacing: .05em; text-transform: uppercase; color: var(--grey); }
.mtile > small { font-size: 12px; color: var(--faint); }
/* recovery */
.rtop { display: grid; gap: 10px; grid-template-columns: 1fr; margin-bottom: 14px; }
@media (min-width: 900px) { .rtop { grid-template-columns: 1fr 1fr 1fr; } }
.rtop .card { margin: 0; }
.rtop .sec { margin-top: 0; }
.recbar { display: flex; height: 14px; background: var(--track); overflow: hidden; }
.recbar i { display: block; height: 100%; transition: width .6s; }
.recbar .g { background: var(--green); } .recbar .y { background: var(--gold-fill); } .recbar .r { background: var(--red-hot); }
.wdbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; height: 110px; align-items: end; }
.wdb { display: grid; grid-template-rows: 1fr auto auto; height: 100%; justify-items: center; gap: 2px; }
.wdb i { display: block; width: 70%; align-self: end; background: var(--s1); opacity: .8; transition: height .6s; }
.wdb b { font: 600 13px var(--head); color: var(--bone); }
.wdb span { font: 10px var(--mono); text-transform: uppercase; color: var(--grey); }

/* share links */
.sharenew { margin: 12px 0; padding: 12px; background: var(--coal2); border: 1px solid var(--gold-fill); display: grid; gap: 8px; }
.sharenew code { font: 13px var(--mono); color: var(--bone); word-break: break-all; }
form.inline select { width: auto; min-width: 120px; }
header.top .in > .k { font-size: 11px; }
.nowrap { white-space: nowrap; }
.labs.wk .val { white-space: normal; }

/* bloods grid */
.viewbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.gridt th.gd { font-size: 11px; text-align: right; line-height: 1.3; }
.gridt td.gc { text-align: right; font: 14px var(--mono); color: var(--bone); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gridt td.gc.o { color: var(--red-hot); background: var(--out-bg); }
.gridt td.gc.none { color: var(--faint); }
.gridt tr.gh td { padding: 14px 6px 4px; font: 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--grey); border-top: 0; }
.gridt td.name { position: sticky; left: 0; background: var(--coal); z-index: 1; }
.gridt th:first-child { position: sticky; left: 0; background: var(--coal); z-index: 1; }

/* ---- plan tab */
.planhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.planhead h2 { margin: 2px 0 0; font-size: 22px; }
.plist { display: grid; gap: 6px; margin-bottom: 16px; }
.pitem { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; background: var(--coal); border: 1px solid var(--line); padding: 10px 12px; }
.pitem.done { opacity: .55; } .pitem.late { border-left: 3px solid var(--red-hot); }
.pitem button.tick { width: 26px; height: 26px; min-height: 26px; padding: 0; border: 1px solid var(--line-2); background: var(--coal2); color: var(--green); font-size: 15px; cursor: pointer; }
.pitem button.tick:hover { background: var(--coal); }
.pitem .nm { color: var(--bone); } .pitem .pn { font-size: 13px; color: var(--grey); }
.pitem .pdue { display: flex; gap: 6px; align-items: center; }
.pitem .pdue input { font: inherit; font-size: 13px; padding: 4px 6px; background: var(--coal2); color: var(--body); border: 1px solid var(--line); max-width: 140px; }
.pitem button.x { background: none; border: 0; color: var(--grey); font-size: 20px; cursor: pointer; padding: 0 4px; min-height: 26px; }
.pitem button.x:hover { background: none; color: var(--red-hot); }
.psec { border: 1px solid var(--line); background: var(--coal); margin-bottom: 8px; }
.psec > summary { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 14px; cursor: pointer; list-style: none; }
.psec > summary::-webkit-details-marker { display: none; }
.psec > summary .nm { font-family: var(--head); font-weight: 600; letter-spacing: 0; color: var(--bone); }
.psec > summary::after { content: "+"; color: var(--grey); margin-left: auto; font-size: 18px; }
.psec[open] > summary::after { content: "\2212"; }
.psec .pbody { padding: 0 14px 12px; display: grid; gap: 6px; }
.prow { display: grid; grid-template-columns: 24px 1fr auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.prow:first-child { border-top: 0; }
.prow .pi { color: var(--grey); display: flex; } .prow .pi .ico { width: 20px; height: 20px; }
.prow .nm { color: var(--bone); } .prow .k { font-size: 13px; }
.inplan { font-size: 12px; color: var(--green); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.inplan .ico { width: 14px; height: 14px; }
button.small, .btn.small { font-size: 12px; padding: 0 10px; min-height: 32px; white-space: nowrap; }
.psec a.ghost.small { background: transparent; color: var(--bone); box-shadow: inset 0 0 0 1px var(--line-2); }
.fold summary { cursor: pointer; color: var(--grey); font-size: 13px; padding: 6px 0; }
.rsrc { margin-top: 10px; }
@media (max-width: 600px) { .prow { grid-template-columns: 24px 1fr; } .prow > :last-child { grid-column: 2; justify-self: start; } .pitem { grid-template-columns: 28px 1fr; } .pitem .pdue { grid-column: 2; } }
.prow .k, .pitem .pn, .pitem .k { font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--grey); }
.pitem .k { font-family: var(--mono); text-transform: uppercase; letter-spacing: .08em; font-size: 11px; }

/* ---- basic and pro. Pro is everything; basic hides what is marked .pro */
html[data-mode="basic"] .pro { display: none !important; }
nav.main .cog { align-self: center; position: relative; }
.tr .tstat { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--green); display: inline-flex; align-items: center; gap: 8px; }
.tr .tstat::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.tr .tstat.o { color: var(--red-hot); } .tr .tstat.o::before { background: var(--red-hot); }
html[data-mode="basic"] .tr { grid-template-columns: 1fr auto auto; }
.bodyline { margin: 0 0 12px; font-size: 15px; color: var(--body); }
.bodyline a { color: var(--gold-fill); text-decoration: none; }
.bodyline a:hover { text-decoration: underline; }

/* ---- first visit */
.start { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 760px) { .start { grid-template-columns: 240px 1fr; gap: 32px; } }
.start .xfig { max-width: 200px; margin: 0 auto; }
.start .xfig.still * { animation: none !important; }
.start h2 { margin: 2px 0 8px; }
.start p.k { font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 14px; }
/* Big doors on the start screen: an icon, two or three words, nothing else. */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 14px 0; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: grid; gap: 7px; justify-items: start; align-content: start; padding: 14px; background: var(--coal); border: 1px solid var(--line); color: var(--body); text-decoration: none; }
.tile:hover { background: var(--coal2); border-color: var(--line-2); }
.tile .ico { width: 26px; height: 26px; color: var(--gold-fill); }
.tile.done .ico { color: var(--green); }
.tile .nm { color: var(--bone); font-family: var(--head); font-weight: 600; letter-spacing: 0; font-size: 16px; line-height: 1.15; }
.tile .k { text-transform: none; letter-spacing: 0; }

/* ---- the intro: four cards, swiped or stepped, shown once (hp-onb) */
body.ob-open { overflow: hidden; }
.ob { position: fixed; inset: 0; z-index: 70; background: var(--ink); display: flex; flex-direction: column; }
.obtop { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px 0; }
.obtrack { flex: 1; display: flex; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scrollbar-width: none; outline: none; }
.obtrack::-webkit-scrollbar { display: none; }
.obcard { flex: 0 0 100%; min-width: 0; scroll-snap-align: center; scroll-snap-stop: always; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; padding: 10px 26px 20px; overflow-y: auto; }
.obcard h2 { margin: 4px 0 0; font-size: 26px; }
.obcard p { margin: 0; max-width: 360px; color: var(--body); }
.obcard .obfig { max-width: 130px; margin: 0; }
.obcard .obfig svg.figure { height: auto; }
.obcard .xfig.still * { animation: none !important; }
.oblegend .dot { display: inline-block; width: 10px; height: 10px; vertical-align: -1px; }
.oblegend .dot.ok { background: var(--green); } .oblegend .dot.bad { background: var(--red-hot); }
.obletter { width: 180px; background: var(--coal); border: 1px solid var(--line-2); padding: 16px 14px; display: grid; gap: 9px; position: relative; margin-bottom: 10px; }
.obletter span { height: 8px; background: var(--coal3); }
.obletter .hl { height: auto; background: var(--warn-bg); border: 1px solid var(--gold-fill); color: var(--bone); font-family: var(--mono); font-size: 12px; padding: 4px 6px; text-align: left; }
.obletter .ico { position: absolute; right: -13px; bottom: -13px; width: 34px; height: 34px; background: var(--gold-fill); color: var(--ink); padding: 7px; box-sizing: border-box; }
.obmodes { display: flex; gap: 12px; width: 100%; max-width: 440px; }
.obmode { flex: 1; min-width: 0; display: grid; gap: 8px; justify-items: center; padding: 14px 10px 12px; background: var(--coal); border: 1px solid var(--line-2); color: var(--body); cursor: pointer; font: 400 13px "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; min-height: 0; }
.obmode:hover { background: var(--coal2); }
.obmode[aria-pressed="true"] { border-color: var(--gold-fill); box-shadow: inset 0 0 0 1px var(--gold-fill); }
.obmode .nm { font-family: var(--head); font-weight: 600; font-size: 17px; color: var(--bone); letter-spacing: 0; }
.obmode .k { font-family: inherit; text-transform: none; letter-spacing: 0; font-size: 13px; }
.obcard p.k { font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 14px; max-width: 360px; }
.obrow { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--bone); background: var(--coal2); border: 1px solid var(--line); padding: 8px 10px; width: 100%; box-sizing: border-box; }
.obrow .pill { margin-top: 0; }
.gmini { position: relative; width: 72px; height: 8px; background: var(--track); display: inline-block; flex: none; }
.gmini::before { content: ""; position: absolute; left: 28%; right: 24%; top: 0; bottom: 0; background: var(--band); }
.gmini i { position: absolute; left: 58%; top: -3px; width: 2px; height: 14px; background: var(--bone); }
.gmini b { position: absolute; left: 80%; top: -1px; width: 2px; height: 10px; background: var(--gold-fill); }
.obok .ico { width: 44px; height: 44px; color: var(--green); }
.obconsent { max-width: 440px; max-height: 32vh; overflow: auto; text-align: left; font-size: 13px; line-height: 1.5; color: var(--body); border: 1px solid var(--line); padding: 10px 12px; background: var(--coal); }
.obbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px calc(16px + env(safe-area-inset-bottom)); }
.obdots { display: flex; gap: 8px; } .obdots i { width: 8px; height: 8px; background: var(--line-2); } .obdots i.on { background: var(--gold-fill); }
.obbar button[hidden] { display: none; }
.asklist { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.asklist .nm { color: var(--bone); } .asklist .k { font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 14px; }
.pitem .cal { color: var(--grey); display: inline-flex; padding: 4px; } .pitem .cal:hover { color: var(--bone); } .pitem .cal .ico { width: 18px; height: 18px; }
@media (max-width: 600px) {
  html[data-mode="basic"] .tr { grid-template-columns: 1fr auto; row-gap: 6px; }
  html[data-mode="basic"] .tr .tn { grid-column: 1 / -1; }
  html[data-mode="basic"] .tr .tv { text-align: left; }
  html[data-mode="basic"] .tr .tv .u { display: inline; margin-left: 4px; }
}

/* ---- find in the record */
.segrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.segrow .seg.wide { margin-bottom: 0; }
#rec-q { flex: 1 1 220px; min-height: 40px; padding: 0 12px; background: var(--coal); color: var(--bone); border: 1px solid var(--line); font: 15px "Barlow", system-ui, sans-serif; }
#rec-q::placeholder { color: var(--grey); }
.hits { display: grid; gap: 6px; }
.hit { display: grid; grid-template-columns: 80px 1fr auto; gap: 12px; align-items: center; text-align: left; padding: 10px 12px; background: var(--coal); border: 1px solid var(--line); color: var(--body); text-decoration: none; font: inherit; min-height: 0; text-transform: none; letter-spacing: 0; }
.hit:hover { background: var(--coal2); }
.hit .hk { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--grey); }
.hit .nm { color: var(--bone); } .hit .k { font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--grey); }
.hit .hv { font-family: var(--mono); font-size: 13px; color: var(--bone); text-align: right; } .hit .hv small { color: var(--grey); }
@media (max-width: 600px) { .hit { grid-template-columns: 1fr auto; } .hit .hk { grid-column: 1 / -1; } }
.strainnote { display: flex; gap: 8px; align-items: flex-start; font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--body); border-left: 2px solid var(--gold-fill); padding-left: 10px; }
.strainnote .ico { width: 18px; height: 18px; flex: none; color: var(--gold-fill); }

/* ---- results read off a letter */
#letter-review { margin-top: 12px; }
.ldate { display: inline-flex; gap: 10px; align-items: center; margin: 8px 0 12px; }
.lrows { display: grid; gap: 6px; }
.lrow { display: grid; grid-template-columns: 28px minmax(140px, 1.6fr) 90px 90px 70px 70px; gap: 6px; align-items: center; padding: 8px; background: var(--coal); border: 1px solid var(--line); }
.lrow.unk { border-left: 3px solid var(--gold-fill); }
.lrow input:not([type=checkbox]) { min-height: 36px; padding: 0 8px; font-size: 14px; }
.lrow .check { justify-content: center; }
.lrow .lraw { grid-column: 2 / -1; font-family: var(--mono); font-size: 11px; color: var(--grey); white-space: pre-wrap; }
@media (max-width: 700px) { .lrow { grid-template-columns: 28px 1fr 1fr; } .lrow .lt { grid-column: 2 / -1; } .lrow .lv, .lrow .ll { grid-column: 2 / 3; } .lrow .lu, .lrow .lh { grid-column: 3 / 4; } }
.lrow input[type=checkbox] { width: 20px; height: 20px; min-height: 0; padding: 0; }
#letter-review p.k { font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; font-size: 14px; }
#letter-review .ldate { font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; }

/* ---- file pickers, on brand: one dashed zone, the native control hidden */
.drop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 26px 16px; border: 1px dashed var(--line-2); background: var(--coal); color: var(--body); cursor: pointer; text-align: center; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--bone); background: var(--coal2); }
.drop:focus-within { outline: 2px solid var(--bone); outline-offset: 2px; }
.drop input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
.drop .di { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); color: var(--grey); margin-bottom: 6px; }
.drop .di .ico { width: 22px; height: 22px; }
.drop .dt { font-family: var(--head); font-weight: 600; font-size: 17px; letter-spacing: 0; color: var(--bone); }
.drop .ds { font-size: 14px; color: var(--grey); }
.drop .dn { display: none; margin-top: 8px; font-family: var(--mono); font-size: 12px; color: var(--green); text-transform: none; letter-spacing: 0; }
.drop.has { border-style: solid; border-color: var(--green); }
.drop.has .dn { display: block; } .drop.has .ds { display: none; }
.drop.busy { border-color: var(--gold-fill); }
.drop.busy .di { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
label.btn.camera { gap: 8px; cursor: pointer; } label.btn.camera .ico { width: 18px; height: 18px; }
.camera, .camrow { display: none; } @media (max-width: 700px), (hover: none) and (pointer: coarse) { .camera { display: inline-flex; } .camrow { display: flex; } .drop .ds { display: none; } }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .drop.busy .di { animation: none; } }
h2.grouphead { font-family: var(--mono); font-weight: 400; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--grey); margin: 26px 0 8px; }
h2.grouphead { border: 0; padding: 0; }
.drop .ds { font-family: "Barlow", system-ui, sans-serif; text-transform: none; letter-spacing: 0; }
p.hint { margin: -4px 0 12px; font-size: 14px; color: var(--grey); }

/* The trained-day mark in a chart legend: a small gold triangle, matching the
   baseline ticks, not a line swatch. */
.legend i.tri { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--gold, #a07c1f); background: none; }

/* Each reading, inside a result sheet: date, source and a way to take a
   mistyped or misread row off the record. */
.shl { margin-top: 10px; }
.shrow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.shrow > span:first-child { min-width: 90px; }
.shrow .k { flex: 1; }

/* ---- the Inside view: a live 3D body (anat3d/anatomy3d.js). The canvas
   fills the frame; the page around it keeps its own tones and buttons. */
.an3d { position: absolute; inset: 0; touch-action: none; cursor: grab; border-radius: var(--r); }
.an3d:active { cursor: grabbing; }
.an3d canvas { display: block; width: 100%; height: 100%; outline: none; }
.an3d-msg { position: absolute; inset: 40% 8px auto; margin: 0; text-align: center; font: 13px "Barlow", system-ui, sans-serif; color: var(--grey); }
.an3dsex button { min-height: 32px; padding: 6px 14px; }
/* the backlight: a soft pool behind the figure that takes the chosen tone */
.xfig .frame::before { content: ""; position: absolute; inset: -4% -14%; background: radial-gradient(closest-side at 50% 36%, color-mix(in srgb, var(--sel, #8A8A90) 13%, transparent), transparent 72%); transition: opacity .6s; opacity: .7; pointer-events: none; }
.xfig.sel .frame::before { opacity: 1; }
.flowline { margin: 0; min-height: 1.2em; max-width: 330px; text-align: center; font: 13px "Barlow", system-ui, sans-serif; color: var(--grey); }

/* ---- the cogwheel: view and theme in one quiet menu */
.cogbtn { background: transparent; color: var(--grey); border: 1px solid var(--line-2); min-height: 0; width: 38px; height: 38px; padding: 0; border-radius: 999px; box-shadow: none; }
.cogbtn:hover, .cogbtn[aria-expanded="true"] { background: var(--coal2); color: var(--bone); }
.cogbtn .ico { width: 19px; height: 19px; }
.cogpop { position: absolute; right: 0; top: 46px; z-index: 50; background: var(--coal); border: 1px solid var(--line-2); border-radius: var(--r); padding: 14px; display: grid; gap: 7px; min-width: 230px; box-shadow: 0 12px 32px rgba(0, 0, 0, .3); }
.cogpop .seg { display: flex; }
.cogpop .seg button { flex: 1; }
.cogpop a { color: var(--bone); font: 14px "Barlow", system-ui, sans-serif; margin-top: 4px; }

/* ---- rounded corners, the sweep. Red stayed for danger; square stayed nowhere. */
.card, .stage, .sysdetail, .sheet-in, .tile, .obmode, .obletter, .obconsent, .sharenew, .banner, .start li a { border-radius: var(--r); }
input, select, textarea, .drop, .seg, .sysbtn, .obrow, .hint, .gpline, .prow, .pitem, .trow { border-radius: var(--rs); }
.seg { overflow: hidden; }
.seg button { border-radius: 0; }
.pill, .pchip, .obdots i, .oblegend .dot, .readout i, .lg, .chip { border-radius: 999px; }
.gmini, .gmini::before { border-radius: 999px; }
