/* The screens' faces ship inside the package and are served by the device itself
   (REQ-061: no network). Noto Sans TC is the report's own file, byte for byte. */
@font-face{font-family:"Inter";src:url("fonts/InterVariable.woff2") format("woff2");
  font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:"IBM Plex Mono";src:url("fonts/IBMPlexMono-Regular.woff2") format("woff2");
  font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"IBM Plex Mono";src:url("fonts/IBMPlexMono-SemiBold.woff2") format("woff2");
  font-weight:600;font-style:normal;font-display:swap}
@font-face{font-family:"Noto Sans TC";src:url("fonts/NotoSansTC-Regular.ttf") format("truetype");
  font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Noto Sans TC";src:url("fonts/NotoSansTC-Bold.ttf") format("truetype");
  font-weight:700;font-style:normal;font-display:swap}
/* Design tokens carried over from the visualisation page the project already
   validated, so the device and its reports look like one product. Both themes
   are defined; the toggle stamps data-theme on the root and must win over the
   media query in either direction.

   Colour roles (design 2026-11-08 D2, a proposal the owner has not yet ruled
   on): brand cyan only for the logo, the brand line, the selected-item
   indicator and large type on navy -- never a button fill, small text, or a
   good/bad meaning. Purple (--machine) marks content a machine produced. Pink
   appears only in the logo and the brand gradient. Buttons stay neutral
   graphite. --ok/--bad/--warn are fills, borders and marks; text in those
   meanings uses the -ink variants, which are measured to 4.5:1 on every
   surface in both themes. The ECG grid, the trace and the banner are not part
   of the palette change, and neither are the canvas's own marks: --ecg-pulse
   (the 1 mV pulse), --ecg-dim (an excluded lead's label, a comparison's earlier
   beat) and --ecg-rule (the R-peak marker, the column boundaries) hold the
   values those marks had before it. The first block holds what does not vary
   with the theme; the theme blocks hold only colours that do. */
:root{
  --brand:#0093C8;
  --brand-line:linear-gradient(90deg,#0093C8,#5F42DB,#FC95D2);
  --navy:#0a1424;
  --meas:var(--machine);
  --mono:"IBM Plex Mono","Noto Sans TC",ui-monospace,"SF Mono",SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;
  --ui:"Inter","Noto Sans TC",system-ui,-apple-system,"Segoe UI","PingFang TC","Microsoft JhengHei","Hiragino Sans",sans-serif;
  /* The banner's own rendered height (one line: 9px padding, a 17px name at 1.5
     line-height, 9px padding). Not measured -- CSS cannot ask an element that --
     but declared once so the workspace's evidence band can stick just beneath
     it instead of guessing the same number a second time. The band is sticky at
     every width; there is no narrow-screen variant of it (design 2026-09-03
     §2.1 deleted the 1100px degradation). */
  --banner-h:44px;
  /* The top bar's rendered height: 8px padding, the language segment (34px
     buttons inside a 1px border, so 36px), 8px padding, a 1px rule. The brand
     line (3px) is drawn over the last 3px of the bottom padding, so it adds
     nothing. Measured in the browser, not derived from the 34px button alone --
     that guess gave 51 and put the banner's first two pixels under the bar.
     Re-measured 2026-11-09 with the bundled fonts loaded and the brand line in
     place: 53 at --tx 1 (58.25 at --tx 1.5, where main.js publishes the live
     number); the line sits inside the padding, so the number did not change.
     Declared for the same reason as --banner-h: the bar is sticky since
     2026-09-04, so the sidebar and both of the workspace's sticky bands sit
     beneath it, and each would otherwise carry its own copy of the number. */
  --topbar-h:53px;
  /* The reader's text size (textsize.js): every font-size in this file is a
     pixel value multiplied by this token. 1 is today's type; the settings
     screen and the desktop shell's ⌘/Ctrl + − 0 step it through 1.15, 1.3 and
     1.5. The waveform canvases do not read it -- their scale is millimetres,
     stated beside the trace, and must not move with the type. */
  --tx:1;
  --page:#F7F6F3; --card:#FFFFFF; --sunk:#ECEAE5;
  --ink:#24272B; --ink2:#555B62; --muted:#62686F;
  --link:#006D94; --machine:#5F42DB;
  --ok-ink:#197327; --bad-ink:#B3261E; --warn-ink:#8A5300;
  --rule:#D5D2CC; --axis:#BDB9B2;
  --ok:#0ca30c; --bad:#d03b3b; --warn:#c07a1e; --chr:#747A82;
  --illus:#8C9097;
  --gmin:rgba(196,88,64,.11); --gmaj:rgba(196,88,64,.24);
  --trace:#0d0f0e; --ring:rgba(13,15,14,.10);
  --ecg-pulse:#c6c9c0; --ecg-dim:#8a8d84; --ecg-rule:#e0e2dc;
  --banner:#123b2c; --banner-ink:#eaf3ee;
  --evaluation:#2E3135; --evaluation-ink:#FFFFFF;
  /* The enlarged 12-lead view's paper (design 2026-11-19 D4): white paper, pink
     1 mm and red 5 mm squares, black trace, in either theme. Written here only
     and in no theme block, so the canvas is paper whatever the screens around
     it are; the view's frame follows the theme. */
  --paper-bg:#ffffff; --paper-gmin:rgba(236,120,120,.30); --paper-gmaj:rgba(214,52,52,.58);
  --paper-trace:#101010; --paper-ink:#1e1e1e; --paper-pulse:#101010; --paper-rule:rgba(0,0,0,.45);
}
@media (prefers-color-scheme:dark){:root{
  --page:#0E1115; --card:#171B20; --sunk:#22272D;
  --ink:#F4F3EF; --ink2:#BCC1C7; --muted:#A9AFB6;
  --link:#5CC8F0; --machine:#A898FF;
  --ok-ink:#5BCB5B; --bad-ink:#F08080; --warn-ink:#E8A84E;
  --rule:#343A41; --axis:#4A5058;
  --ok:#3cc23c; --bad:#e86a6a; --warn:#dda048; --chr:#C8CCD1;
  --illus:#6B7280;
  --gmin:rgba(255,146,116,.07); --gmaj:rgba(255,146,116,.16);
  --trace:#f4f5f1; --ring:rgba(255,255,255,.10);
  --ecg-pulse:#3a3e3b; --ecg-dim:#8a8d84; --ecg-rule:#2a2d2b;
  --banner:#0f2f24; --banner-ink:#dcebe3;
  --evaluation:#3A3E44; --evaluation-ink:#F1F3F5;
}}
:root[data-theme="dark"]{
  --page:#0E1115; --card:#171B20; --sunk:#22272D;
  --ink:#F4F3EF; --ink2:#BCC1C7; --muted:#A9AFB6;
  --link:#5CC8F0; --machine:#A898FF;
  --ok-ink:#5BCB5B; --bad-ink:#F08080; --warn-ink:#E8A84E;
  --rule:#343A41; --axis:#4A5058;
  --ok:#3cc23c; --bad:#e86a6a; --warn:#dda048; --chr:#C8CCD1;
  --illus:#6B7280;
  --gmin:rgba(255,146,116,.07); --gmaj:rgba(255,146,116,.16);
  --trace:#f4f5f1; --ring:rgba(255,255,255,.10);
  --ecg-pulse:#3a3e3b; --ecg-dim:#8a8d84; --ecg-rule:#2a2d2b;
  --banner:#0f2f24; --banner-ink:#dcebe3;
  --evaluation:#3A3E44; --evaluation-ink:#F1F3F5;
}
:root[data-theme="light"]{
  --page:#F7F6F3; --card:#FFFFFF; --sunk:#ECEAE5;
  --ink:#24272B; --ink2:#555B62; --muted:#62686F;
  --link:#006D94; --machine:#5F42DB;
  --ok-ink:#197327; --bad-ink:#B3261E; --warn-ink:#8A5300;
  --rule:#D5D2CC; --axis:#BDB9B2;
  --ok:#0ca30c; --bad:#d03b3b; --warn:#c07a1e; --chr:#747A82;
  --illus:#8C9097;
  --gmin:rgba(196,88,64,.11); --gmaj:rgba(196,88,64,.24);
  --trace:#0d0f0e; --ring:rgba(13,15,14,.10);
  --ecg-pulse:#c6c9c0; --ecg-dim:#8a8d84; --ecg-rule:#e0e2dc;
  --banner:#123b2c; --banner-ink:#eaf3ee;
  --evaluation:#2E3135; --evaluation-ink:#FFFFFF;
}

*{box-sizing:border-box}
html,body{margin:0}
body{background:var(--page);color:var(--ink);font-family:var(--ui);font-size:calc(14px*var(--tx));line-height:1.5;
  -webkit-font-smoothing:antialiased}
/* Form controls the browser draws itself -- the field background, the caret, the
   select arrow, the scrollbar -- follow this and nothing else. Without it the page
   was dark while every unstyled input kept the light UA background, and `color:
   inherit` put near-white text on it: somebody typing a reason into the engines
   screen saw an empty box and reported that they could not type. They could. */
:root{color-scheme:light dark}
button,input,textarea,select{font:inherit;color:inherit}

/* And a floor under every text field, so a new one cannot ship unstyled. Each
   screen that wanted a different look had its own rule; the screen that did not
   think about it got the UA default, which is the one case nobody tests. */
input[type="text"],input[type="password"],input[type="search"],input[type="number"],
input[type="date"],input[type="datetime-local"],textarea{
  background:var(--sunk);border:1px solid var(--rule);border-radius:6px;padding:7px 9px}
:focus-visible{outline:2px solid var(--chr);outline-offset:2px}
@media (prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}
.hidden{display:none!important}
.spacer{flex:1}
.num{font-family:var(--mono);font-variant-numeric:tabular-nums}
.dim{color:var(--ink2)}

/* topbar. Sticky, above everything the work area can put up (the import drawer
   is 30, the patient banner 20): scrolling a long list must not scroll the way
   to another screen out of reach (operator, 2026-09-04). */
#chrome{position:sticky;top:0;z-index:40}
/* One row, always: everything sticky beneath the bar is offset by its height,
   and a bar that wrapped to two rows would put the patient banner under it.
   The chips give way first (ellipsis) rather than the row breaking; main.js
   also measures the bar and publishes the real height into --topbar-h. */
.topbar{display:flex;align-items:center;gap:14px;padding:8px 16px;background:var(--sunk);
  border-bottom:1px solid var(--rule);flex-wrap:nowrap;min-width:0;position:relative}
/* The brand line: 3px along the bar's bottom edge, painted over the bar's own
   padding so it neither covers a control nor changes the bar's height. Static,
   never animated. */
.topbar::after{content:"";position:absolute;left:0;right:0;bottom:0;height:3px;
  background:var(--brand-line);pointer-events:none}
/* Inline text links: unclassed ones, and the two classed ones that read as prose
   (the import batch link, the worklist's clear-filter link). Not a:not(.tbtn):
   tiles and list lines are anchors too, and are not links in this sense. */
a:not([class]),a.batchlink,.batchfilter .clear{color:var(--link)}
.topbar .chip{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.topbar .wordmark,.topbar .seg,.topbar .tbtn{flex:none;white-space:nowrap}
.wordmark{font-weight:640}
.wordmark span{color:var(--muted);font-weight:400}
.chip{font-family:var(--mono);font-size:calc(11.5px*var(--tx));padding:2px 7px;border-radius:5px;
  border:1px solid var(--rule);background:var(--card);color:var(--ink2)}
/* Present for whoever reads by headings or by screen reader, and taking no
   room: the workspace's heading, which the operator asked off the screen. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0,0,0,0);white-space:nowrap;border:0}
.tbtn{background:var(--card);border:1px solid var(--rule);border-radius:6px;padding:5px 10px;
  cursor:pointer;font-size:calc(13px*var(--tx));min-height:34px}
.tbtn:hover{border-color:var(--axis)}
.tbtn[disabled]{opacity:.4;cursor:not-allowed}
/* A link wearing the button's clothes. An inline <a> ignores min-height and
   would sit shorter than every real button beside it. The intake list uses one
   rather than a button because opening a queued recording in another tab is
   worth keeping. */
a.tbtn{display:inline-flex;align-items:center;text-decoration:none;color:inherit}
.seg{display:inline-flex;border:1px solid var(--rule);border-radius:6px;overflow:hidden}
.seg button{background:var(--card);border:0;border-right:1px solid var(--rule);padding:4px 9px;
  cursor:pointer;font-family:var(--mono);font-size:calc(11.5px*var(--tx));min-height:34px}
.seg button:last-child{border-right:0}
.seg button[aria-pressed="true"]{background:var(--ink);color:var(--page)}

/* the wrong-patient control: always present, never subtle.
   Sticky, because a banner that scrolls away is a banner that is not there at the
   moment somebody signs -- and QMS-UE-001 U4 is exactly that moment. z-index above
   the waveform so a tall trace cannot pass over it. */
.banner{position:sticky;top:var(--topbar-h);z-index:20;
  display:flex;align-items:baseline;gap:18px;flex-wrap:wrap;background:var(--banner);
  color:var(--banner-ink);padding:9px 16px}
.banner .nm{font-size:calc(17px*var(--tx));font-weight:640}
.banner .kv{font-family:var(--mono);font-size:calc(12.5px*var(--tx));opacity:.86;font-variant-numeric:tabular-nums}
.banner .kv b{font-weight:600;opacity:1}
.banner .warn{margin-left:auto;font-size:calc(12.5px*var(--tx));background:rgba(255,255,255,.14);
  padding:3px 9px;border-radius:5px}
.banner .warn.attn{background:var(--warn);color:#1b1300;font-weight:600}

main{padding:16px;display:flex;flex-direction:column;gap:14px;max-width:1680px;margin:0 auto}
.review{display:flex;flex-direction:column;gap:14px}
.sec{border:1px solid var(--rule);border-radius:8px;background:var(--card)}
.sec>header{display:flex;align-items:center;gap:12px;flex-wrap:wrap;padding:8px 12px;
  border-bottom:1px solid var(--rule);background:var(--sunk);border-radius:8px 8px 0 0}
.sec>header h3{margin:0;font-size:calc(13.5px*var(--tx));font-weight:640}
.note{font-size:calc(12px*var(--tx));color:var(--muted)}
.pad{padding:12px}
.empty,.loading{padding:26px;text-align:center;color:var(--muted)}
/* Screen-level empty states carry a drawing above the sentence (2026-09-07): the
   asset kit's five, Lucide-derived, img/empty/ -- see img/PROVENANCE.md. Painted
   through a mask in currentColor -- that of its own token, --illus (2026-11-08,
   D4 item 5) -- so one file serves both themes; the file's own opacities
   survive as alpha. Which
   screens carry which drawing is decided where the sentence is (art-* beside
   `empty`); notes inside sections stay text. Both mask spellings, for WebKit and
   Chromium. The drawing follows the reader's text size, as the sentence does. */
.empty[class*="art-"]::before{content:"";display:block;color:var(--illus);width:calc(200px*var(--tx));aspect-ratio:4/3;
  margin:0 auto 4px;background-color:currentColor;
  -webkit-mask:var(--art) center/contain no-repeat;mask:var(--art) center/contain no-repeat}
.empty.art-no-study{--art:url("img/empty/no-study.svg")}
.empty.art-processing{--art:url("img/empty/processing.svg")}
.empty.art-no-analysis{--art:url("img/empty/no-analysis.svg")}
.empty.art-no-report{--art:url("img/empty/no-report.svg")}
.empty.art-offline{--art:url("img/empty/offline.svg")}
/* A decision the reader has to make before going on, sitting inside a form.
   Deliberately not `.banner`, which is the sticky patient strip -- reusing that
   would pin this to the top of the viewport, away from the choice it belongs to.
   And deliberately not `.decide` either, which was the first name tried and is
   already the QC verdict bar further down: same specificity, later rule wins on
   the properties both set, and the `flex-direction:column` from here leaked into
   that bar and stood it on end. Caught in the browser, not by a test. */
.gate{border:1px solid var(--warn);border-left-width:3px;border-radius:6px;
  padding:10px 12px;background:var(--sunk);display:flex;flex-direction:column;
  align-items:stretch;gap:8px}
.gate strong{font-size:calc(13.5px*var(--tx))}
.gate p{margin:0;font-size:calc(12.5px*var(--tx));color:var(--ink2)}
.gate label{display:flex;flex-direction:column;gap:3px;font-size:calc(12.5px*var(--tx));color:var(--ink2)}
.gate input{background:var(--card);border:1px solid var(--rule);border-radius:6px;padding:7px 9px}
.gate button{align-self:flex-start}
.bar{display:flex;gap:8px}

/* the workspace (study.js): the evidence band above, one stage tab below
   (design 2026-09-03 §2). The band is sticky under the patient banner so the
   waveform and the cart's numbers are on screen whichever tab is showing --
   an ECG reading is written while looking at the trace, and REQ-154 wants
   the measurements 「常顯」 on that screen. */
.ws{display:flex;flex-direction:column;gap:10px;min-width:0}
.band{position:sticky;top:calc(var(--topbar-h) + var(--banner-h));z-index:10;background:var(--page)}
/* One header row, then the trace with a side column beside it (operator,
   2026-09-04: more than half the window was pinned). The 30vh cap is on the
   trace's container, which scrolls, and the canvas may not shrink to fit it:
   a canvas narrower or shorter than it was drawn is a trace not at its stated
   millimetres, and a caliper dividing displayed pixels by drawn ones. The cap
   exists so the tab strip and the start of the pane are on screen in every
   mode (design 2026-09-03 §2.2, ledger Ruling 15). */
.bandbody{display:flex;flex-wrap:wrap;align-items:flex-start}
/* `--trace-w` is the drawn width, set by whoever drew the trace. The side
   column (flex-basis 260px) sits beside the trace while both fit and wraps
   beneath it otherwise -- so the trace is never squeezed to make room, and on a
   narrow window the numbers are a row under it as they used to be. */
.trace{flex:1 1 auto;min-width:min(100%,var(--trace-w,0px));max-height:30vh;overflow:auto}
.trace.pad{min-width:min(100%,calc(var(--trace-w,0px) + 24px))}
.band .leadpanel{max-width:none}
/* Tighter than other section headers, and no lead-in margins: twelve controls
   share one row, and at 1440 px wide they fit it with a few pixels to spare. */
.band header{gap:8px}
.band header .seg{margin-left:0}
/* The two zooms and the page (2026-09-04): a unit after each segment, and the
   page count between its two arrows. */
.band .unit{font-family:var(--mono);font-size:calc(11px*var(--tx));color:var(--muted);margin-left:3px}
.pager{display:inline-flex;align-items:center;gap:6px}
.pager .tbtn{padding:5px 8px}
/* Tighter leading than the page's 1.5: beside the trace the side must not be
   the taller of the two, or it -- not the 30vh cap -- would set the band's height. */
.bandside{flex:1 1 260px;min-width:0;padding:6px 12px;font-size:calc(12px*var(--tx));
  line-height:1.35;container-type:inline-size}
/* The side's contents, one level down: a container query reads an ancestor's
   width, never the element's own, so the element that changes shape with the
   side's width has to be inside it. Stacked while the side is beside the trace. */
.sidebody{display:flex;flex-direction:column;gap:4px}
.bandside .flabel{font-family:var(--mono);color:var(--ink)}
/* The numbers pack into as many columns as the side has room for -- two beside
   the trace -- as label-left, value-right pairs at the side's own type size,
   not the 18px facts-panel figures `.meas` is otherwise for. */
.bandside .cartmeas{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));
  gap:0 14px;padding:0;border-top:0;align-items:baseline}
.bandside .cartmeas>.flabel,.bandside .cartmeas>.note{grid-column:1/-1}
.bandside .cartmeas dl.meas>div{display:flex;justify-content:space-between;gap:8px;
  padding:0;background:transparent}
.bandside .cartmeas dt{font-size:calc(11.5px*var(--tx));text-transform:none;letter-spacing:0;margin:0}
.bandside .cartmeas dd{font-size:calc(13px*var(--tx));font-weight:600}
.bandside .filterline{flex-direction:column;gap:2px;padding:0;border-top:0}
.provenance{color:var(--warn-ink);font-weight:600}
.provenance p{margin:0 0 2px}
/* Beneath the trace -- when the band was too narrow to seat the side beside it,
   and when the trace is folded away -- the side is as wide as the band, and
   everything flows in rows as the old measurements line did, instead of one
   item per line down half the window. Its own width is the only thing that
   tells the two placements apart, so a container query reads it. */
@container (min-width:640px){
  .sidebody{flex-direction:row;flex-wrap:wrap;align-items:baseline;gap:6px 18px}
  .bandside .cartmeas{display:flex;flex-wrap:wrap;gap:4px 16px}
  .bandside .filterline{flex-direction:row;gap:14px}
}
/* Folded (the operator's "drawer"): the trace is hidden, and the side column
   -- the numbers REQ-154 keeps on screen, the scale, the filter line -- takes
   the whole row under the header. */
.band.folded .bandside{flex-basis:100%}
/* Gate ④'s overlay slot, empty until a baseline is chosen -- so the gap comes
   with the picture rather than sitting under the engine list all day. */
.overlay-slot:not(:empty){margin-top:10px}
.cartmeas{display:flex;flex-wrap:wrap;gap:4px 16px;align-items:baseline;padding:6px 12px;
  border-top:1px solid var(--rule);font-size:calc(12.5px*var(--tx))}
.cartmeas dl.meas{display:contents}
.cartmeas dl.meas>div{display:inline-flex;gap:6px;align-items:baseline}
.cartmeas dt{margin:0;color:var(--muted)}
.cartmeas dd{margin:0;font-family:var(--mono);font-variant-numeric:tabular-nums}
/* Content the machine produced (the cart's reading, an engine's suggestion), never a physician's words. */
.machine{border-inline-start:3px solid var(--machine)}
.machine>summary{color:var(--machine)}
/* On the patient page the marked content sits directly in its section with no
   padding of its own, so a fold's summary line (its marker first) and a signed
   study's engine heading would touch the rule. The reading page's folds sit in
   a padded column and keep their look. */
.machine>h4,.sec>details.machine>summary{padding-inline-start:12px}
/* A gate not yet reachable, dimmed rather than removed -- the order (§4.3, load-
   bearing per REQ-154) is still visible, which is the point of showing it at all. */
.stage.locked{opacity:.55}
.stages{display:flex;flex-direction:column;gap:10px;min-width:0}
/* Six tabs, six equal shares of the strip (operator, 2026-09-04): sized by the
   strip rather than by their own words, so the row reads the same in either
   language and whatever each gate's status line says. No wrapping -- a wrapped
   strip is six widths again -- and min-width:0 so a long status line shrinks
   the text rather than the share.
   Drawn as a progress line (design 2026-11-08 D3 item 4, cut 2 decisions 4-6):
   the strip's bottom rule is the line, and the five main-line gates stand on it
   as tiles, each with a marker for its state beside its name. Nothing fills
   between the markers and nothing marks a next step: the line says where each
   gate stands, not which one to open. It must not grow (the 2026-09-03 height
   budget): a tile is as tall as it was -- the pixel of bottom padding it gave
   up is the pixel it used to overlap the rule by -- and the words keep their
   width, so they wrap where they did. */
.tabs{display:flex;gap:2px;border-bottom:1px solid var(--rule);padding:0 4px}
.tab{display:inline-flex;flex:1 1 0;min-width:0;flex-direction:column;align-items:flex-start;gap:1px;
  position:relative;background:var(--card);
  border:1px solid var(--rule);border-bottom:0;border-radius:8px 8px 0 0;padding:6px 12px 4px;font:inherit;
  font-size:calc(13px*var(--tx));color:var(--ink2);cursor:pointer;text-align:left}
.tab .name{font-weight:640}
/* The marker sits out of the flow -- in the tab's column it would be a line of
   its own -- centred on the name's first line (the 6px top padding, then half
   the 1.5 line height), in room the right padding gives up so the words lose
   none. Told apart by shape as well as colour: a ring while open, a disc when
   done (the ring filled in), a fainter ring under the locked tile's dimming.
   It keeps its size at every text size: a marker that grew with --tx would take
   the room the words need at 1.5. */
.tab:not(#tab-engines){padding-left:18px;padding-right:6px}
.tab:not(#tab-engines)::before{content:"";position:absolute;left:5px;top:calc(2px + .75em);
  width:8px;height:8px;box-sizing:border-box;border:1.5px solid var(--ink2);border-radius:50%}
.tab.done:not(#tab-engines)::before{border-width:4px;border-color:var(--ok-ink)}
/* The marker repeats the words under the name, so it is filled whenever they say
   已完成 -- including ⑥, which `gateState` never calls done while `stageStatus`
   says done once the signed version has a render. A rule of its own, not joined
   to the one above: a browser that cannot parse :has() drops only this one. */
.tab:not(#tab-engines):has(> .status.done)::before{border-width:4px;border-color:var(--ok-ink)}
.tab.locked:not(#tab-engines)::before{border-color:var(--muted)}
/* ④, the machine's and the engines' opinion, stands beside the line: no marker,
   no fill, a dashed neutral outline that stops short of the rule, and no colour
   that means anything (violet is for what the machine says, not for the way to
   it). It is never done and never next, so it must never look like a step left
   to do: a strip that sent the reader to the machine before the trace would be
   the anchoring HAZ-059 controls. The 2px it stops short by come out of its
   bottom padding, so it is exactly as tall as a tile; the 2px of padding it
   keeps are where the inset focus ring's bottom edge falls, clear of the words.
   The dash is the only thing that draws ④ as an aside, so it is a mark and is
   held to 3:1: --muted, not the tiles' --rule (about 1.4:1). */
#tab-engines{background:transparent;border-style:dashed;border-color:var(--muted);
  padding-bottom:2px;margin-bottom:2px}
/* The line under the name (decision 2026-09-04): 已完成 / 進行中 / 尚不能開始 + why,
   or 可查看 for ④. A colour marks the two ends, and the word is always there --
   the readers QMS-US-001 §4 describes cannot be asked to tell green from amber. */
.tab .status{font-size:calc(11px*var(--tx));line-height:1.3;color:var(--muted)}
.tab .status.done{color:var(--ok-ink)}
.tab .status.blocked{color:var(--warn-ink)}
/* The gate on screen wears the sidebar's selected-item indicator (D2), along
   the tile's top edge where the old ink one was. */
.tab.on{color:var(--ink);box-shadow:inset 0 3px 0 var(--brand)}
.tab.locked{opacity:.55;cursor:not-allowed}
.tab:focus-visible{outline:2px solid var(--ink);outline-offset:-2px}

/* worklist */
.tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:1px;
  background:var(--rule)}
.tile{background:var(--card);padding:12px 14px}
.tile .n{font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:calc(26px*var(--tx));font-weight:600;
  color:var(--muted)}
.tile.live .n{color:var(--ink)}
.tile .lbl{font-size:calc(12.5px*var(--tx));color:var(--ink2)}
table{width:100%;border-collapse:collapse;font-size:calc(12.5px*var(--tx))}
th,td{text-align:left;padding:7px 10px;border-bottom:1px solid var(--rule)}
th{font-size:calc(11px*var(--tx));letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:600}
/* One set of column widths for every study table (see studyColgroup in worklist.js), so the
   groups, which are separate tables, line up under the one set of headings. Automatic
   layout: each column gets its <col>'s share while its widest word fits there (the
   shares are measured for that, VER-0023 §4), and is widened rather than overrun or
   broken mid-word where it does not. The side padding gives way as the type grows,
   10px at --tx 1 and 7px at 1.5, so English fits the smallest window at 1.5. */
table.wl.study th,table.wl.study td{padding-inline:calc(16px - 6px*var(--tx))}
/* A name breaks at its own spaces, never between two of its characters. */
table.wl.study td.name{word-break:keep-all}
.wl tbody tr{cursor:pointer}
.wl tbody tr:hover,.wl tbody tr:focus-visible{background:var(--sunk)}
.wl tbody tr.stat td:first-child{box-shadow:inset 3px 0 0 var(--bad)}
.pill{display:inline-block;font-size:calc(11px*var(--tx));font-family:var(--mono);padding:2px 7px;border-radius:99px;
  border:1px solid var(--rule);color:var(--ink2)}
.pill.stat{color:var(--bad-ink);border-color:var(--bad);font-weight:600}
.pill.wait{color:var(--warn-ink);border-color:var(--warn)}

/* import */
.dropzone{border:2px dashed var(--axis);border-radius:10px;padding:38px;text-align:center;
  cursor:pointer;background:var(--sunk)}
.dropzone.over{border-color:var(--chr);background:var(--card)}
.dropzone[aria-disabled="true"]{opacity:.5;cursor:not-allowed}
.dropzone .big{font-size:calc(16px*var(--tx));font-weight:600;margin-bottom:6px}
.droplog{margin-top:12px;max-height:340px;overflow:auto;font-size:calc(12.5px*var(--tx))}
.droplog .line{display:flex;gap:12px;padding:4px 8px;border-bottom:1px solid var(--rule)}
.droplog .fn{font-family:var(--mono);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.droplog .st{color:var(--ink2)}
.droplog .ok .st{color:var(--ok-ink)}
.droplog .failed .st,.droplog .quarantined .st{color:var(--bad-ink)}
.droplog .pending_identity .st{color:var(--warn-ink)}

/* waveform */
.scroll{overflow:auto;max-height:74vh}
canvas{display:block;max-width:none}
.legend{display:flex;gap:16px;flex-wrap:wrap;font-size:calc(12px*var(--tx));color:var(--ink2);padding:8px 12px;
  border-top:1px solid var(--rule)}

.filterline{display:flex;gap:14px;flex-wrap:wrap;align-items:baseline;padding:7px 12px;
  border-top:1px solid var(--rule);font-size:calc(12px*var(--tx))}
.filterline .flabel{font-family:var(--mono);color:var(--ink)}
.filterline .fadj{color:var(--warn-ink)}

/* median beat grid: as many cells across as the width allows (six on a 1920 px
   screen, four on 1366), because the beats are drawn at twice the paper scale
   (quality.js) and a fixed four left them small in wide cells. One rule, no
   narrow-screen copy of it. */
.grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(270px,1fr));gap:8px}
.cell{border:1px solid var(--rule);border-radius:6px;overflow:hidden;background:var(--card)}
.cell.fail{background:var(--sunk);border-style:dashed}
.cell .hd{display:flex;align-items:baseline;gap:8px;padding:4px 8px;border-bottom:1px solid var(--rule);
  background:var(--sunk)}
.cell .lead{font-family:var(--mono);font-weight:640;font-size:calc(12.5px*var(--tx))}
.cell .stat{margin-left:auto;font-family:var(--mono);font-size:calc(11px*var(--tx));color:var(--ink2);
  font-variant-numeric:tabular-nums}
.cell .why{padding:14px 10px;text-align:center;color:var(--muted);font-size:calc(12px*var(--tx))}
.cell .why b{display:block;color:var(--ink2);font-family:var(--mono);font-size:calc(11.5px*var(--tx));margin-bottom:5px}
.cell .why .hint{margin-top:6px;color:var(--ink2);text-align:left;line-height:1.5}
.kind{font-family:var(--mono);font-size:calc(9.5px*var(--tx));letter-spacing:.05em;text-transform:uppercase;
  padding:1px 5px;border-radius:3px;border:1px solid var(--rule);color:var(--muted)}
.kind.computed{color:var(--meas);border-color:var(--meas)}
.kind.reconstructed{color:var(--warn-ink);border-color:var(--warn)}
.kind.unrecognised{color:var(--warn-ink);border-color:var(--warn)}

/* measurements: facts, no verdict */
.meas{display:grid;grid-template-columns:repeat(auto-fit,minmax(168px,1fr));gap:1px;background:var(--rule)}
.meas>div{background:var(--card);padding:9px 12px}
.meas dt{font-size:calc(11px*var(--tx));letter-spacing:.05em;text-transform:uppercase;color:var(--muted);margin:0 0 3px}
/* Labels whose casing carries meaning opt out. "QTc (Bazett)" upper-cased becomes
   "QTC (BAZETT)": it loses the distinction between a rate-corrected QT and a bare
   acronym, and shouts a physician's name -- while naming the formula exactly is the
   entire purpose of that label. See domain/measurements.py. */
.meas dt.exact{text-transform:none;letter-spacing:0;font-size:calc(11.5px*var(--tx))}
.meas dd{margin:0;font-family:var(--mono);font-size:calc(18px*var(--tx));font-variant-numeric:tabular-nums}
.meas .ctx{font-size:calc(11.5px*var(--tx));color:var(--muted);margin-top:2px}

/* flags */
.flag{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border-bottom:1px solid var(--rule);
  position:relative}
.flag:last-child{border-bottom:0}
.flag::before{content:"";position:absolute;left:0;top:0;bottom:0;width:3px}
.flag.attn::before{background:var(--warn)}
.flag.info::before{background:var(--axis)}
.flag input{margin-top:3px;width:18px;height:18px;accent-color:var(--chr);flex:none}
.flag .t{font-weight:600;font-size:calc(13px*var(--tx))}
.flag .d{font-size:calc(12px*var(--tx));color:var(--ink2);font-family:var(--mono)}
.flag .sev{font-family:var(--mono);font-size:calc(10.5px*var(--tx));text-transform:uppercase;padding:2px 6px;
  border-radius:4px;border:1px solid var(--rule);color:var(--ink2);flex:none}
.flag.attn .sev{color:var(--warn-ink);border-color:var(--warn)}
.dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:6px}
.dot.y{background:var(--ok)}.dot.n{background:var(--bad)}
tr.no td{color:var(--ink2)}

/* runs and decision */
.runs{display:flex;gap:8px;flex-wrap:wrap;padding:10px 12px}
.run{border:1px solid var(--rule);border-radius:6px;padding:5px 9px;font-family:var(--mono);
  font-size:calc(11.5px*var(--tx));color:var(--ink2);background:var(--card)}
.run.cur{border-color:var(--ink);color:var(--ink);font-weight:600}
.run .d{color:var(--muted);font-weight:400}
.decide{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:12px;background:var(--sunk);
  border-radius:8px}
.decide .hint{flex:1;min-width:240px;font-size:calc(12.5px*var(--tx));color:var(--bad-ink)}
.decide .hint.ok{color:var(--ok-ink)}
.btn{border:1px solid var(--rule);background:var(--card);border-radius:6px;padding:10px 16px;
  cursor:pointer;font-size:calc(13.5px*var(--tx));min-height:44px}
.btn:hover{border-color:var(--axis)}
.btn.primary{background:var(--ink);color:var(--page);border-color:var(--ink);font-weight:600}
.btn.primary[disabled]{opacity:.42;cursor:not-allowed}
.btn.danger{color:var(--bad-ink);border-color:var(--bad)}

/* sign-in: the facade (design 2026-11-08 D4; the tagline and subline are the
   owner's, the layout is proposed). It replaces the 2026-09-07 panel-and-form
   layout in one respect only: the form no longer follows the theme. The whole
   page is --navy in both themes and every colour in a .signin* rule is a literal
   or a theme-independent token, so it looks the same under data-theme light,
   dark and either OS preference; a gate holds the theme blocks and the rules to
   it, and measures each text colour on navy. color-scheme:dark makes the
   browser draw its own controls dark. The heart (img/login-heart.svg) sits in
   the left 58% only, so the translucent card stays over plain navy. Nothing
   here moves; the heart keeps its own animation and reduced-motion rule. Below
   900px the picture goes and the brand row sits above the card. The work area
   drops its padding and reading width for this screen; the router puts them
   back (main.js, route). */
main.signin-mode{padding:0;max-width:none}
.signin-page{position:relative;overflow:hidden;background:var(--navy);color-scheme:dark;color:#F4F3EF;
  display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);grid-template-rows:1fr auto;
  min-height:100vh}
.signin-art{position:absolute;left:0;top:0;width:58%;height:100%;object-fit:cover;
  object-position:50% 58%;pointer-events:none;
  -webkit-mask-image:linear-gradient(90deg,#000 0,#000 70%,transparent 100%);
  mask-image:linear-gradient(90deg,#000 0,#000 70%,transparent 100%)}
/* The art's own background is darker than --navy; the mask fades its right edge
   into the page so no seam shows. Above the picture. */
.signin-copy,.signin-card,.signin-version{position:relative}
.signin-copy{grid-column:1;grid-row:1;align-self:center;padding:56px 48px;isolation:isolate}
/* A soft navy halo between the art and the words: it keeps the copy on
   (near-)navy, so the contrast gate's navy reference stays true over the art. */
.signin-copy::before{content:"";position:absolute;inset:-110px -40px;z-index:-1;pointer-events:none;
  background:radial-gradient(ellipse 52% 58% at 30% 50%,rgba(10,20,36,.94) 0%,rgba(10,20,36,.82) 45%,
  rgba(10,20,36,0) 100%)}
.signin-brand{display:flex;align-items:center;gap:14px}
.signin-brand img{width:44px;height:44px;flex:none}
.signin-brand .wordmark{font-size:calc(22px*var(--tx));color:#F4F3EF}
.signin-brand .wordmark span{color:#BCC1C7}
.signin-copy .signin-tagline{margin:28px 0 0;font-size:calc(34px*var(--tx));line-height:1.15;
  font-weight:600;letter-spacing:-.01em;color:#F4F3EF}
.signin-copy p{margin:10px 0 0;font-size:calc(15px*var(--tx));color:#BCC1C7}
/* At the foot, reserving its line before the service has answered. */
.signin-version{grid-column:1;grid-row:2;margin:0;padding:0 48px 28px;font-family:var(--mono);
  font-size:calc(11.5px*var(--tx));color:#9AA3AE;min-height:1.5em}
.signin-card{grid-column:2;grid-row:1;align-self:center;justify-self:center;width:calc(100% - 48px);
  max-width:360px;margin:0 24px;display:flex;flex-direction:column;gap:8px;padding:24px;
  border:1px solid rgba(255,255,255,.16);border-radius:10px;background:rgba(20,32,52,.72);
  -webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
.signin-card h1{margin:0 0 8px;font-size:calc(19px*var(--tx));color:#F4F3EF}
.signin-card label{font-size:calc(12px*var(--tx));color:#BCC1C7}
.signin-card input{border:1px solid #56606E;border-radius:6px;padding:10px;background:#0F1B2D;
  color:#F4F3EF;min-height:44px;font:inherit}
.signin-card input::placeholder{color:#9AA3AE}
.signin-card input:focus-visible,.signin-card .btn:focus-visible{outline:2px solid #5CC8F0;
  outline-offset:1px}
.signin-card input:-webkit-autofill{-webkit-text-fill-color:#F4F3EF;box-shadow:0 0 0 100px #0F1B2D inset}
.signin-error{color:#F08080;font-size:calc(12.5px*var(--tx));min-height:1.4em}
.signin-card .btn{margin-top:8px}
.signin-card .btn.primary{background:#E7E5DF;color:#0E1115;border-color:#E7E5DF}
.signin-card .btn.primary:hover{background:#F4F3EF;border-color:#F4F3EF}
@media (max-width:899px){
  .signin-page{grid-template-columns:minmax(0,1fr);grid-template-rows:auto auto 1fr;min-height:100vh}
  .signin-art{display:none}
  .signin-copy{grid-column:1;grid-row:1;padding:14px 20px}
  .signin-copy p{display:none}
  .signin-card{grid-column:1;grid-row:2;margin:24px auto}
  .signin-version{grid-column:1;grid-row:3;align-self:end;padding:0 20px 20px}
}

/* errors */
.errorbox{border:1px solid var(--bad);border-left-width:3px;border-radius:8px;padding:12px 14px;
  background:var(--card);display:flex;flex-direction:column;gap:8px}
.errorbox .msg{font-weight:600}
.errorbox code{font-family:var(--mono);font-size:calc(11.5px*var(--tx));color:var(--ink2);word-break:break-all}
.errorbox summary{font-size:calc(12px*var(--tx));color:var(--muted);cursor:pointer}

/* the idle warning has to be impossible to miss without being modal: a dialog
   would steal the keystroke somebody is in the middle of typing. It is the top
   bar's bottom 3px turning amber, and it recolours the brand line itself: the
   line is a positioned layer drawn above the bar's own box-shadow, so a shadow
   on .topbar (the warning before the line existed) is covered and never seen. */
body.idle-warn .topbar::after{background:var(--warn)}

/* An outdated page's notice (REQ-187): a row under the top bar, inside #chrome so
   the measured height moves the patient banner down instead of covering it. The
   warn pairing .banner .warn.attn already uses, readable in both themes. */
/* The evaluation site's band: the first row of #chrome on every screen, sign-in
   included, never closable. Its own colour pair (neutral charcoal, sharing no hue with the green banner, the red or orange statuses or the violet AI colour)
   so it cannot be read as the patient banner, a critical value or an AI result. */
.evaluation-band{padding:5px 16px;background:var(--evaluation);color:var(--evaluation-ink);
  font-size:calc(12.5px*var(--tx));font-weight:600;text-align:center;line-height:1.35}
/* The sign-in page fills the window below the chrome: with the evaluation band above
   it, a bare 100vh would add a scroll. Higher specificity than both widths' rules. */
.signin-mode .signin-page{min-height:calc(100vh - var(--chrome-h,0px))}
.signin-ended{margin:0 0 12px;padding:8px 10px;border-radius:6px;background:#2E3135;
  color:#FFFFFF;font-size:calc(13px*var(--tx));font-weight:600}
.screens-outdated{display:flex;align-items:center;gap:12px;padding:8px 16px;
  background:var(--warn);color:#1b1300;font-weight:600}

/* The AI connection (REQ-AGT-002, REQ-AGT-010). The chip sits in the top bar with the
   others and takes the link colour so it reads as a standing state, not a warning.
   The notice for a "look here" request is a card in the lower corner, fixed and outside
   #chrome: it takes no focus, blocks nothing and covers no part of the top bar or the
   patient banner, and the buttons in it are the only way it moves anything. */
.chip.ai{border-color:var(--link);color:var(--link);font-weight:600}
.ai-slot{position:fixed;right:16px;bottom:16px;z-index:30;max-width:min(420px,calc(100vw - 32px))}
.ai-slot:empty{display:none}
.ai-notice{display:flex;flex-wrap:wrap;align-items:center;gap:8px 10px;padding:10px 12px;
  background:var(--card);color:var(--ink);border:1px solid var(--link);border-radius:8px;
  box-shadow:0 2px 10px var(--ring)}
.ai-notice-text{flex:1 1 100%;font-weight:600}
.ai-connection .bar{margin-top:10px}
/* While a prompt is up the page gains room under its end, so the notice sits in
   empty space at the bottom of any screen and never over a control there. */
body:has(.ai-slot .ai-notice){padding-bottom:120px}
/* end ai connection */

/* Serial comparison. The caveats sit above the waveforms and are styled by
   severity, because "the earlier one came off a different cart" is the difference
   between a finding and an artefact and must not read as decoration. */
.caveats { list-style:none; padding:0; margin:0 0 1rem 0; display:grid; gap:2px; }
.caveat {
  padding:.35rem .6rem;
  border-left: 3px solid var(--rule);
  background: var(--sunk);
  font-size:calc(0.9rem*var(--tx));
}
.caveat.attention { border-left-color: var(--warn); }
.caveat.blocking { border-left-color: var(--bad); font-weight: 600; }
.caveat.note { color: var(--muted); }

/* ── the collapsible left sidebar ──────────────────────────────────────────
   Navigation moved off the top bar when account management arrived: a row of
   tabs is fine for two destinations and becomes a scan every time for six. The
   collapsed state is per-device rather than per-account, because it is about the
   screen in front of somebody -- an ECG cart on a trolley wants the width back,
   and the same person at a desk does not. */
.shell{display:flex;min-height:calc(100vh - var(--topbar-h))}
/* Sticky beneath the top bar and exactly one viewport tall, scrolling its own
   entries: only the work area moves when the page does (operator, 2026-09-04).
   align-self:flex-start is load-bearing -- a flex item stretched to the row's
   height has nowhere to stick. */
.side{flex:0 0 208px;background:var(--sunk);border-right:1px solid var(--rule);
  position:sticky;top:var(--topbar-h);height:calc(100vh - var(--topbar-h));overflow:auto;
  align-self:flex-start;
  padding:10px 8px;display:flex;flex-direction:column;gap:2px;transition:flex-basis .12s ease}
.side.narrow{flex-basis:52px}
.side .nav{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:7px;
  text-decoration:none;color:var(--ink2);font-size:calc(13.5px*var(--tx))}
.side .nav:hover{background:var(--card);color:var(--ink)}
.side .nav.on{background:var(--ink);color:var(--page);box-shadow:inset 3px 0 0 var(--brand)}
/* The icon scales with the text, as the label does; no colour of its own, so the
   active and hover rules above reach it through currentColor. */
.side .nav .icon{flex:none;width:calc(20px*var(--tx));height:calc(20px*var(--tx))}
/* A long label wraps instead of being clipped: English at --tx 1.5 in a 1100px window is
   wider than the 208px sidebar (ANOM-0042). */
.side .nav .label{min-width:0;overflow-wrap:anywhere}
.side.narrow .nav .label{display:none}
.side .grow{flex:1}
.side .fold{background:none;border:0;color:var(--muted);cursor:pointer;padding:8px 10px;
  border-radius:7px;text-align:left;font-size:calc(12.5px*var(--tx));white-space:nowrap;overflow:hidden}
.side .fold:hover{background:var(--card);color:var(--ink)}
/* position:relative so the import drawer (an absolutely positioned child of
   whichever view is current) overlays this screen rather than the viewport. */
.work{flex:1;min-width:0;position:relative}

/* ── account administration ─────────────────────────────────────────────── */
.users{max-width:1000px;margin:0 auto;padding:18px 16px;display:flex;flex-direction:column;gap:14px}
/* The report list (2026-09-04) reuses the administration column, its form
   (.uform) and its table, wider: nine columns of a name, a number and a date
   each. The search box gets the room a name or a chart number needs. */
.users.reports{max-width:1400px}
.reportfind input[type="search"]{min-width:280px}
.users h2{margin:0;font-size:calc(17px*var(--tx));font-weight:640}
.users .note{color:var(--ink2);font-size:calc(13px*var(--tx));margin:0}
.utable{width:100%;border-collapse:collapse;background:var(--card);border:1px solid var(--rule);
  border-radius:9px;overflow:hidden}
.utable th{text-align:left;font-weight:560;font-size:calc(12px*var(--tx));color:var(--muted);
  padding:9px 12px;border-bottom:1px solid var(--rule);white-space:nowrap}
.utable td{padding:10px 12px;border-bottom:1px solid var(--rule);vertical-align:top}
.utable tr:last-child td{border-bottom:0}
.utable tr.off td{opacity:.55}
/* An import profile's document, shown as the JSON it is published as. */
.utable pre{margin:0;font-family:var(--mono);font-size:calc(12px*var(--tx));white-space:pre-wrap}
.uform textarea.json{font-family:var(--mono);font-size:calc(12px*var(--tx))}
.pill{display:inline-block;font-size:calc(11.5px*var(--tx));padding:1px 7px;border-radius:999px;
  border:1px solid var(--rule);color:var(--ink2);margin-right:4px;white-space:nowrap}
/* --page text on the --ok-ink fill: contrast is symmetric, so this is the
   measured ink-on-page pair (--ok was 3.1:1 under 11px text). */
.pill.on{background:var(--ok-ink);border-color:var(--ok-ink);color:var(--page)}
.pill.off{background:var(--sunk)}
.pill.warn{border-color:var(--warn);color:var(--warn-ink)}
.uform{background:var(--card);border:1px solid var(--rule);border-radius:9px;padding:14px;
  display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:12px;align-items:end}
.uform label{display:flex;flex-direction:column;gap:4px;font-size:calc(12.5px*var(--tx));color:var(--ink2)}
.uform input{background:var(--sunk);border:1px solid var(--rule);border-radius:6px;padding:7px 9px}
/* `guard` prepends a failure into the form it guards, and inside a grid that made
   the box a column: it took the first cell and pushed every field one place right,
   so the report of a problem was itself a layout fault. */
.uform > .errorbox{grid-column:1/-1}
/* A row of tick-boxes is not a form field, and it does not fit in a field's
   column. Nine of them in one 190px cell gave each chip about 13px of text width,
   and Chinese has no spaces to break on -- so every label wrapped to one
   character per line and the box stacked on top of it. Three rules, because the
   grid, the row and the chip each contributed one. */
.uform > label.wide{grid-column:1/-1}
/* Read first's 「完成初讀」 (REQ-191) sits under the reading field, whose label spans
   the form: in one 190px cell the button and its sentence would sit beside the
   language select instead of beneath what they read. The refusal `guard` puts
   above the button stays on its own line. */
.uform > .firstread{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:6px 12px;align-items:baseline}
.firstread > .errorbox{flex-basis:100%}
.firstread > .note{margin:0}
.uform .bar{flex-wrap:wrap}
.uform .chip{flex-direction:row;align-items:center;gap:6px;color:var(--ink)}

.uform .roles{display:flex;flex-wrap:wrap;gap:10px}
.uform .roles label{flex-direction:row;align-items:center;gap:5px;color:var(--ink)}
.rowact{display:flex;gap:6px;flex-wrap:wrap}

/* the twelve-lead panel and its calipers */
.leadpanel{display:block;max-width:100%}
.leadpanel.measuring{cursor:crosshair}
.caliper-read{font-family:var(--mono);font-size:calc(12.5px*var(--tx));font-variant-numeric:tabular-nums}
.caliper-read.attn{color:var(--warn-ink)}

/* the enlarged 12-lead view (views/study/expanded.js; design 2026-11-19 D2):
   everything under the top bar, over the study page, the patient banner on top
   of it. Not the whole window: #chrome carries the idle warning (the bar's amber
   line) and the outdated-screens notice (REQ-187), and a layer over them would
   hide a session about to end and a page about to be stale; --topbar-h is
   #chrome's measured height, so the layer starts where the chrome ends. Its
   z-index is above the study page's sticky banner (20) and band (10) and below
   the AI slot and the import drawer (30) and #chrome (40), so the AI connection's
   notice and request stay visible and answerable while it is open. The frame
   follows the theme; only the canvas is paper, and ecg.js paints that from the
   --paper-* tokens, not from here. The banner inside is in the layer's own flow,
   not sticky at --topbar-h, which inside a fixed layer would push it down by a
   bar's height. The canvas area scrolls both ways and the canvas keeps the size
   it was drawn at -- a canvas scaled to fit is a trace not at its stated mm/s,
   and a caliper dividing displayed pixels by drawn ones. */
.xview{position:fixed;top:var(--topbar-h);left:0;right:0;bottom:0;z-index:25;
  display:flex;flex-direction:column;background:var(--page);color:var(--ink)}
.xview .banner{position:static}
.xview .xbar,.xview .xsub{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:8px 12px;
  border-bottom:1px solid var(--rule);background:var(--sunk)}
.xview .xsub{background:var(--card);padding:6px 12px}
.xview .xtitle{font-weight:640;margin-right:4px}
.xview .xstrip-title{font-weight:600}
.xview .unit{font-family:var(--mono);font-size:calc(11px*var(--tx));color:var(--muted);margin-left:3px}
.xview .xcanvas{flex:1 1 auto;min-height:0;overflow:auto;padding:10px 12px}
.xview .xpaper{display:block;max-width:none;cursor:pointer}
.xview .xpaper.measuring{cursor:crosshair}
.xview .xfoot{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 16px;padding:6px 12px;
  border-top:1px solid var(--rule);background:var(--card);font-size:calc(12px*var(--tx));line-height:1.35}
.xview .xfoot .flabel{font-family:var(--mono);color:var(--ink)}
.xview .xfoot .filterline{padding:0;border-top:0}
.xview .xfoot p{margin:0}

/* worklist groups: the workflow read top to bottom, each saying how many */
.grouphead{display:flex;align-items:baseline;gap:10px;padding:8px 12px;
  border-top:1px solid var(--rule);background:var(--sunk);font-size:calc(12.5px*var(--tx));font-weight:640}
.grouphead .num{margin-left:auto;color:var(--ink2)}
.grouphead::before{content:"";width:3px;align-self:stretch;background:var(--axis);border-radius:2px}
.grouphead.wait::before{background:var(--warn)}
.grouphead.ok::before{background:var(--ok)}
.grouphead.attn::before{background:var(--bad)}

/* ── the import drawer: an action over the worklist, not a screen of its own ──
   "I imported it, where did it go" was one of three reported sticking points.
   Overlaid on the worklist rather than routed to, so closing it always has a
   worklist already drawn behind it -- see .work's position:relative above. */
.import-drawer{position:absolute;top:0;right:0;bottom:0;width:min(440px,94vw);
  background:var(--card);border-left:1px solid var(--rule);
  box-shadow:-10px 0 28px rgba(0,0,0,.16);display:flex;flex-direction:column;z-index:30}
.import-drawer>header{display:flex;align-items:center;gap:10px;padding:10px 14px;
  border-bottom:1px solid var(--rule);flex:none}
.import-drawer>header h3{margin:0;font-size:calc(14px*var(--tx));font-weight:640}
.import-drawer .body{flex:1;overflow:auto;display:flex;flex-direction:column;gap:12px;padding:12px}
.import-drawer .foot{flex:none;border-top:1px solid var(--rule);padding:10px 14px;
  display:flex;flex-direction:column;gap:6px}
.iconbtn{background:none;border:0;color:var(--muted);font-size:calc(19px*var(--tx));line-height:1;
  cursor:pointer;padding:2px 6px;border-radius:6px}
.iconbtn:hover{background:var(--sunk);color:var(--ink)}
.batchlink{font-size:calc(12.5px*var(--tx))}

/* A row that answers "where did it go" is a link; one that cannot (a duplicate,
   a failure) is an `<a>` with no `href` -- inert by construction, so it is
   never in tab order and a click does nothing, rather than a class a stylesheet
   alone would have to keep matching the same rule. */
.droplog a.line{color:inherit;text-decoration:none}
.droplog a.line[href]{cursor:pointer}
.droplog a.line[href]:hover{background:var(--sunk)}

/* The identity backlog inside the drawer: the drop log's row shape, because
   the two lists sit one above the other and read as one kind of thing, but
   its own class -- every one of these rows is a door, none is a log line. */
.idlist{max-height:220px;overflow:auto;font-size:calc(12.5px*var(--tx))}
.idlist a.idrow{display:flex;gap:12px;padding:4px 8px;border-bottom:1px solid var(--rule);
  color:inherit;text-decoration:none;cursor:pointer}
.idlist a.idrow:hover{background:var(--sunk)}
.idlist .fn{font-family:var(--mono);flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.idlist .st{color:var(--warn-ink)}

/* The worklist's own reading of the batch filter the drawer sets. */
.batchfilter{display:flex;align-items:center;gap:10px;padding:8px 12px;margin-bottom:10px;
  background:var(--sunk);border:1px solid var(--rule);border-radius:8px;font-size:calc(12.5px*var(--tx))}
.batchfilter .clear{margin-left:auto}

/* ─────────────────────────────────────────── AI 結果卡(REQ-AIR-UI-001~007)

   狀態色的語意全系統一致,而模組只能在這五個值裡對應它的結果值域——所以顏色
   定義在這裡一次,不在任何與模組相關的地方。REQ-AIR-UI-004。 */
.card{--card-accent:var(--muted);--card-ink:var(--muted);border:1px solid var(--rule);border-left:3px solid var(--card-accent);
  border-radius:8px;background:var(--card);padding:14px 16px;display:flex;
  flex-direction:column;gap:12px}
.card--negative{--card-accent:var(--ok);--card-ink:var(--ok-ink)}
/* 琥珀。「無法排除」是弱證據、非診斷,染成紅色會讓它在畫面上長得像一個高
   特異度警示,而那正是這一層要防的誤讀。 */
.card--weak{--card-accent:var(--warn);--card-ink:var(--warn-ink)}
/* 紅只給呈現規格明訂的警示結果值——今天只有缺血差分的「偵測到變化」。 */
.card--alert{--card-accent:var(--bad);--card-ink:var(--bad-ink)}
/* 量測與呈現,不做判定。中性,不是一個結論色。 */
.card--measured{--card-accent:var(--ink2);--card-ink:var(--ink2)}
/* 提示型模組的「未提示」(2026-10-04)。判定了,判定是「沒有提示」,而這在
   870.2380 型的宣稱裡不具排除意義——綠會把它讀成排除,虛線會把它讀成沒有判定。
   與 measured 同一個中性、實線:兩者對讀者的意思相同,這裡沒有可以據以安心的發現。 */
.card--not_prompted{--card-accent:var(--ink2);--card-ink:var(--ink2)}

/* ST-012:與各結果色在色彩與框線形狀上**雙重**區隔。兩個屬性,不是一個——
   只改顏色的話,色覺差異的讀者看到的是四張一樣的卡。 */
.card--not_scored{--card-accent:var(--muted);border-style:dashed;background:var(--sunk)}

.card__row{display:flex;flex-direction:column;gap:3px;font-size:calc(12px*var(--tx));color:var(--muted)}
.card__module{font-weight:600;color:var(--ink2)}
.card__preconditions{display:flex;flex-wrap:wrap;gap:10px;list-style:none;padding:0;margin:4px 0 0}
.card__preconditions li::before{content:"✓ ";color:var(--ok-ink)}
.card__preconditions li.is-unmet{color:var(--bad-ink)}
.card__preconditions li.is-unmet::before{content:"✕ ";color:var(--bad-ink)}

.card__conclusion{display:flex;flex-direction:column;gap:6px}
.card__main{font-size:calc(17px*var(--tx));font-weight:600;line-height:1.5;color:var(--card-ink)}
.card__sub{line-height:1.6}
.card__extra{font-size:calc(13px*var(--tx));color:var(--ink2);line-height:1.6}
/* 這一句要攔住一個會讓病人白留下來的動作,所以它不是一行小字。 */
.card__retest{font-size:calc(13px*var(--tx));font-weight:600}
.card__retest--futile{color:var(--warn-ink)}

.card__quantity{display:flex;flex-direction:column;gap:8px}
.card__quantity-label{font-size:calc(12px*var(--tx));color:var(--muted)}
.card__scale{position:relative;height:10px;border-radius:5px;
  background:linear-gradient(90deg,var(--ok),var(--warn));margin:22px 0 10px}
.card__scale-mark{position:absolute;top:-22px;transform:translateX(-50%);
  font-size:calc(19px*var(--tx));font-weight:700;color:var(--ink)}
/* 固定刻度,不是可拖曳的把手:UI 不得提供執行期調整(REQ-AIR-UI-006)。 */
.card__scale-point{position:absolute;top:-4px;width:2px;height:18px;background:var(--ink);
  transform:translateX(-50%)}

.card__statistics{display:flex;flex-wrap:wrap;gap:8px 24px;padding:10px 12px;
  background:var(--sunk);border-radius:6px}
.card__statistic{font-size:calc(13px*var(--tx))}
.card__action{font-size:calc(13.5px*var(--tx));font-weight:600}
.card__limitations{font-size:calc(12px*var(--tx));color:var(--muted);line-height:1.6;
  border-top:1px solid var(--rule);padding-top:10px}

/* 沒有算繪器的元件。大聲,不是空白:一塊空白會被當成版面 bug 分流掉,而一塊
   寫著 `comparison_view` 的佔位區塊會在一分鐘內被修。 */
.card__unrendered{font-size:calc(12px*var(--tx));color:var(--muted);border:1px dashed var(--rule);
  border-radius:6px;padding:8px 10px}
.card__unrendered--unknown{color:var(--bad-ink);border-color:var(--bad);font-family:monospace}

/* ST-013:送出之前,在收案端說出這筆紀錄已經不符哪個模組的評分前提。畫在
   接受/退回那一列的正上方,因為那是病人還在現場的最後一刻。琥珀不是紅:
   這不是一次失敗,是一件現在補得起來的事。 */
.precheck{border:1px solid var(--warn);border-left-width:3px;border-radius:6px;
  background:var(--sunk);padding:10px 12px;margin-bottom:10px;
  display:flex;flex-direction:column;gap:4px}
.precheck__module{font-weight:600}
.precheck__next{font-size:calc(13px*var(--tx));color:var(--ink2);line-height:1.6}
.precheck__retest{font-size:calc(13px*var(--tx));font-weight:600}
.precheck__retest--futile{color:var(--warn-ink)}

/* The sign checklist at ⑤ (cut 2 task 6). A disc when met, a hollow ring when
   not: shape carries the state, and an unmet item is information, so it is
   --muted and never --warn or --bad. */
.checklist{display:flex;flex-direction:column;gap:6px}
.checklist ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.checklist li{position:relative;padding-left:18px;font-size:calc(13px*var(--tx))}
/* Centred on the first line box: its centre is 1lh / 2, the circle is 8px tall. The
   first `top` is the position before cut 3, kept for an engine without `lh`, which
   drops the second declaration whole. */
.checklist li::before{content:"";position:absolute;left:3px;top:calc(2px + .5em);top:calc((1lh - 8px) / 2);
  width:8px;height:8px;box-sizing:border-box;border-radius:50%}
.checklist li.met::before{background:var(--ok-ink);border:1.5px solid var(--ok-ink)}
.checklist li.unmet::before{border:1.5px solid var(--muted)}
.checklist li.unmet{color:var(--ink2)}
.checklist p{margin:0}

/* The concept tab, 3D heart imaging (heart3d concept branch). A fixed navy stage
   that deliberately does not follow the site theme, like the sign-in facade: the
   heart is drawn in WebGL on its own navy, and the cards float over it. Every
   colour here is a literal of the stage's own, so no theme token reaches it. The
   lit accent is the colour of a lit artery; nothing else on the stage is brighter. */
.h3d-stage{position:relative;display:grid;box-sizing:border-box;overflow:hidden;
  grid-template-columns:minmax(250px,310px) minmax(0,1fr) minmax(250px,310px);
  grid-template-rows:auto minmax(0,1fr) auto auto;
  grid-template-areas:"head head head" "left middle right" "controls controls controls" "footer footer footer";
  gap:12px;padding:14px 16px;border-radius:8px;
  min-height:620px;height:max(620px,calc(100vh - var(--topbar-h) - var(--banner-h) - 120px));
  background:#0a1629;color:#e6eef8;color-scheme:dark}
.h3d-stage.h3d-full{position:fixed;inset:0;z-index:60;height:auto;min-height:0;border-radius:0}
/* Full screen covers the top bar, and with it the idle warning's amber edge. While
   that warning is up the stage starts below the chrome, so the edge shows. */
body.idle-warn .h3d-stage.h3d-full{top:var(--topbar-h)}
.h3d-scene{position:absolute;inset:0;z-index:0}
/* The scene draws its own canvas, tags and leader lines in the host. Only the canvas
   takes the pointer (drag to turn); a tag never stands between the hand and the heart. */
.h3d-scene canvas{position:absolute;left:0;top:0;display:block;touch-action:none;cursor:grab}
.h3d-scene canvas:active{cursor:grabbing}
.h3d-leaders{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.h3d-leaders line{stroke:rgba(200, 215, 235, 0.55);stroke-width:1}
.h3d-vtag{position:absolute;left:0;top:0;pointer-events:none;white-space:nowrap;
  padding:2px 8px;border-radius:6px;background:rgba(6, 11, 22, 0.55);
  border:1px solid rgba(160, 190, 230, 0.25);color:#c9d6e8;line-height:1.35;transition:opacity .3s}
.h3d-vtag-head{display:block;font-size:calc(13px*var(--tx));font-weight:700;letter-spacing:.04em}
.h3d-vtag-name{display:block;font-size:calc(10.5px*var(--tx));color:#9fb6d3}
.h3d-vtag-top{border-color:#ff7a2e;color:#ffcaa6}
.h3d-head,.h3d-left,.h3d-right,.h3d-controls,.h3d-footer{position:relative;z-index:1}
.h3d-head{grid-area:head;display:flex;align-items:flex-start;gap:12px;flex-wrap:wrap}
.h3d-badge{font-size:calc(12px*var(--tx));font-weight:600;letter-spacing:.04em;padding:3px 10px;
  border:1px solid rgba(196, 226, 255, 0.35);border-radius:999px;color:#c4e2ff}
.h3d-lines{flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;gap:6px}
.h3d-state{margin:0;font-size:calc(13.5px*var(--tx));color:#e6eef8;text-align:center}
.h3d-reveal{display:flex;justify-content:flex-end}
/* The columns let a drag through to the heart between cards; only a card takes the pointer. */
.h3d-left,.h3d-right{display:flex;flex-direction:column;gap:12px;min-height:0;overflow:auto;pointer-events:none}
.h3d-left{grid-area:left}
.h3d-right{grid-area:right}
.h3d-left>*,.h3d-right>*{pointer-events:auto}
.h3d-card{background:rgba(10, 22, 41, 0.72);border:1px solid rgba(196, 226, 255, 0.18);border-radius:10px;
  padding:10px 12px;backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  display:flex;flex-direction:column;gap:6px}
.h3d-card-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px}
.h3d-card-title{margin:0;font-size:calc(13px*var(--tx));font-weight:600;color:#e6eef8}
.h3d-tag{font-size:calc(11px*var(--tx));color:#9fb6d3;white-space:nowrap}
.h3d-big{font-size:calc(34px*var(--tx));font-weight:700;line-height:1.1;color:#ffffff}
.h3d-line{margin:0;font-size:calc(12.5px*var(--tx));color:#d5e1f0}
.h3d-strong{font-weight:600;color:#ffffff}
.h3d-fine{margin:0;font-size:calc(11.5px*var(--tx));color:#9fb6d3;line-height:1.5}
.h3d-notes{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:2px;
  font-size:calc(12px*var(--tx));color:#c4e2ff}
.h3d-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px;
  font-size:calc(12.5px*var(--tx));padding:2px 0 2px 8px;border-left:2px solid transparent}
.h3d-row.h3d-top{border-left-color:#ff7a2e}
.h3d-abbr{font-weight:600}
.h3d-name{color:#d5e1f0;min-width:0}
.h3d-val{font-variant-numeric:tabular-nums;text-align:right}
.h3d-dim .h3d-row{opacity:.55}
.h3d-bar{display:block;height:6px;border-radius:3px;background:rgba(196, 226, 255, 0.12);overflow:hidden}
.h3d-fill{display:block;height:100%;background:#9fb6d3}
.h3d-sig .h3d-fill{background:#ff7a2e}
.h3d-leads{display:grid;grid-template-columns:repeat(12,minmax(0,1fr));gap:3px}
.h3d-lead{display:flex;flex-direction:column;align-items:center;gap:3px}
/* Zero is the track's middle: elevation grows up from it, depression down. */
.h3d-lead-track{position:relative;display:block;width:100%;height:56px}
.h3d-lead-track::before{content:"";position:absolute;left:0;right:0;top:50%;height:1px;background:rgba(196, 226, 255, 0.3)}
.h3d-lead-bar{position:absolute;left:20%;right:20%;display:block}
.h3d-lead-bar.h3d-up{bottom:50%;background:#ff7a2e}
.h3d-lead-bar.h3d-down{top:50%;background:#5f9df0}
.h3d-lead-name{font-size:calc(9.5px*var(--tx));color:#9fb6d3}
.h3d-controls{grid-area:controls;display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px}
.h3d-group{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.h3d-end{margin-left:auto}
.h3d-label{font-size:calc(12px*var(--tx));color:#9fb6d3}
.h3d-btn{font-size:calc(12.5px*var(--tx));padding:5px 10px;border-radius:6px;cursor:pointer;
  background:rgba(196, 226, 255, 0.08);color:#e6eef8;border:1px solid rgba(196, 226, 255, 0.25)}
.h3d-btn:hover{background:rgba(196, 226, 255, 0.16)}
.h3d-btn[aria-pressed="true"],.h3d-btn[aria-expanded="true"]{border-color:#ff7a2e;background:rgba(255, 122, 46, 0.16)}
.h3d-btn:focus-visible{outline:2px solid #c4e2ff;outline-offset:2px}
.h3d-legend{display:flex;align-items:center;gap:4px;font-size:calc(11.5px*var(--tx));color:#d5e1f0}
.h3d-swatch{display:inline-block;width:18px;height:10px;border-radius:2px}
.h3d-p1{background:#f29e38}
.h3d-p2{background:#f2611f}
.h3d-p3{background:#eb2b1f}
.h3d-c2{background:#296bf2}
.h3d-c1{background:#66a3f2}
.h3d-w1{background:#f29e38}
.h3d-w2{background:#eb2b1f}
.h3d-layer-note{flex-basis:100%;margin:0;font-size:calc(11.5px*var(--tx));color:#9fb6d3}
.h3d-layer-note .h3d-tag{margin-right:8px;color:#c4e2ff}
.h3d-footer{grid-area:footer;margin:0;display:flex;flex-wrap:wrap;gap:2px 0;
  font-size:calc(11px*var(--tx));color:#9fb6d3}
.h3d-footer span+span::before{content:"\00b7";margin:0 8px}
.h3d-catheter{border-color:rgba(255, 122, 46, 0.55)}
/* Narrower than the three columns need: the cards go under the heart instead of over it.
   Measured on the stage itself (heart3d.js sets h3d-narrow below 1100px of its own
   width), not the viewport, because the sidebar and the page padding take their share
   first. Not a container query: container-type on an ancestor would become the
   containing block of the fixed full-screen stage. */
.h3d-stage.h3d-narrow{display:flex;flex-direction:column;height:auto;min-height:0}
.h3d-stage.h3d-narrow .h3d-scene{position:relative;inset:auto;height:max(360px,55vh);flex:none}
.h3d-stage.h3d-narrow .h3d-left,.h3d-stage.h3d-narrow .h3d-right{overflow:visible}
.h3d-stage.h3d-narrow>*{flex:none}
.h3d-stage.h3d-narrow.h3d-full{overflow:auto}

/* Shell mode on the evaluation site (REQ-200): the install row on sign-in, the
   too-small notice, and the lost-service screen. Tokens only, so both themes follow. */
.install-row{position:relative;z-index:1;display:flex;flex-wrap:wrap;align-items:center;gap:10px;
  margin:12px 0 0;font-size:calc(13px*var(--tx));color:var(--ink2)}
.install-unsupported{color:var(--muted)}
.shell-too-small{position:fixed;left:0;right:0;bottom:0;z-index:50;padding:8px 16px;
  background:var(--warn);color:#1b1300;font-weight:600;font-size:calc(13px*var(--tx));text-align:center}
.shell-too-small[hidden]{display:none}
.shell-failed{position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:14px;padding:24px;text-align:center;
  background:var(--page);color:var(--ink)}
.shell-failed h1{margin:0;font-size:calc(22px*var(--tx))}
.shell-failed p{margin:0;max-width:34em;color:var(--ink2);font-size:calc(15px*var(--tx));line-height:1.5}
