/* The DIS panel's one stylesheet — T-20 (RG-1275), from the developer
   handoff v2 part 1 (the component sheet: exact colours, type and sizes)
   and wireframe R7 (the dark theme, ruling 227).

   Colours live ONLY in the three property blocks below: light (:root, the
   handoff's part 1), dark (wireframe R7's table) and "Match my computer"
   (the dark list again, under prefers-color-scheme). Every other rule, and
   every page, names a role (var(--...)), never a colour
   (tests/panel/test_no_named_colour.py). The theme is the user's choice,
   stored on the user record: <html data-theme="light|dark|system">.
   Inter 4.0 is served by the panel itself (/static/fonts/, OFL); nothing is
   loaded from another host. */

:root {
  --ground: #F4F5F7; --surface: #FFFFFF; --border: #D9DDE3; --divider: #ECEEF1;
  --input: #C3C9D1; --text: #1A1D21; --muted: #5B6470;
  --action: #1F5FBF; --action-hover: #174A96; --on-action: #FFFFFF;
  --tint: #E4ECF9; --tint-text: #174A96;
  --tab-here: #174A96;   /* T-26: the phone tab bar's current page */
  --working-bg: #E2F3EA; --working-text: #14603A;
  --attn-bg: #FFF1D6; --attn-text: #7A4700;
  --stopped-bg: #FBE4E1; --stopped-text: #8E1C15;
  --off-bg: #ECEEF1; --off-text: #4A525C;
  --locked-bg: #E0E7FF; --locked-text: #312E81;
  --danger: #8E1C15; --on-danger: #FFFFFF;
  --needs-bg: #FFF9EA; --needs-border: #E0B45A;
  --problem-bg: #FBE4E1; --problem-border: #8E1C15;
  --inset: #F4F5F7;
  --bar-track: #ECEEF1; --bar-fill: #1F5FBF; --bar-done: #1E7B4B; --bar-failed: #8E1C15;
  --bar-not-yet: #C3C9D1;
  --secondary-border: #9AA3AE; --secondary-text: #1A1D21;
  --chip-sel: #1A1D21; --on-chip-sel: #FFFFFF;
  --overlay: rgba(26, 29, 33, .40); --shadow: rgba(26, 29, 33, .18);
  --bar-target: #9AA3AE;
  --cov-rich: #14613A; --cov-adequate: #4E9E73; --cov-thin: #D9A441;   /* T-35 4e bar, as drawn */
  --keep-row: var(--working-bg); --drop-row: var(--stopped-bg);   /* T-36 dev page rows (main, relay 109) */
  --keep-on: #047857; --drop-on: #B91C1C; --on-mark: #FFFFFF;   /* #290 review: 4.5:1 or better */
  --stuck-bg: #FDF3F1; --dashed: #B6BDC7;   /* T-39 D: a stopped step's row and cell; a step not measured */
  color-scheme: light;
}
[data-theme="dark"] {
  --ground: #111418; --surface: #1A1E24; --border: #2E353F; --divider: #2E353F;
  --input: #2E353F; --text: #E6E9EE; --muted: #A3ACB8;
  --action: #6EA8FF; --action-hover: #8DBBFF; --on-action: #0B1220;
  --tint: #1E2B45; --tint-text: #E6E9EE;
  --tab-here: #6EA8FF;
  --working-bg: #123524; --working-text: #7BD3A0;
  --attn-bg: #3A2A08; --attn-text: #F0C36A;
  --stopped-bg: #3D1512; --stopped-text: #F2A19A;
  --off-bg: #262B33; --off-text: #B5BDC8;
  --locked-bg: #23264A; --locked-text: #B4B9FF;
  --danger: #F2A19A; --on-danger: #0B1220;
  --needs-bg: #2B2410; --needs-border: #8A6A1E;
  --problem-bg: #3D1512; --problem-border: #B4534B;
  --inset: #111418;
  --bar-track: #3A424D; --bar-fill: #6EA8FF; --bar-done: #4CC38A; --bar-failed: #F2A19A;
  --bar-not-yet: #3A424D;
  --secondary-border: #6EA8FF; --secondary-text: #6EA8FF;
  --chip-sel: #E6E9EE; --on-chip-sel: #111418;
  --overlay: rgba(0, 0, 0, .60); --shadow: rgba(0, 0, 0, .50);
  --bar-target: #A3ACB8;
  --cov-rich: #2E9E66; --cov-adequate: #7FCFA4; --cov-thin: #E0B050;   /* T-35 4e bar, as drawn */
  --keep-row: rgba(16, 185, 129, .14); --drop-row: rgba(239, 68, 68, .14);   /* T-36 dev page rows */
  --keep-on: #047857; --drop-on: #B91C1C; --on-mark: #FFFFFF;
  --stuck-bg: #2B1614; --dashed: #4A525C;   /* T-39 D */
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --ground: #111418; --surface: #1A1E24; --border: #2E353F; --divider: #2E353F;
    --input: #2E353F; --text: #E6E9EE; --muted: #A3ACB8;
    --action: #6EA8FF; --action-hover: #8DBBFF; --on-action: #0B1220;
    --tint: #1E2B45; --tint-text: #E6E9EE;
    --tab-here: #6EA8FF;
    --working-bg: #123524; --working-text: #7BD3A0;
    --attn-bg: #3A2A08; --attn-text: #F0C36A;
    --stopped-bg: #3D1512; --stopped-text: #F2A19A;
    --off-bg: #262B33; --off-text: #B5BDC8;
    --locked-bg: #23264A; --locked-text: #B4B9FF;
    --danger: #F2A19A; --on-danger: #0B1220;
    --needs-bg: #2B2410; --needs-border: #8A6A1E;
    --problem-bg: #3D1512; --problem-border: #B4534B;
    --inset: #111418;
    --bar-track: #3A424D; --bar-fill: #6EA8FF; --bar-done: #4CC38A; --bar-failed: #F2A19A;
    --bar-not-yet: #3A424D;
    --secondary-border: #6EA8FF; --secondary-text: #6EA8FF;
    --chip-sel: #E6E9EE; --on-chip-sel: #111418;
    --overlay: rgba(0, 0, 0, .60); --shadow: rgba(0, 0, 0, .50);
    --bar-target: #A3ACB8;
    --cov-rich: #2E9E66; --cov-adequate: #7FCFA4; --cov-thin: #E0B050;   /* T-35 4e bar, as drawn */
    --keep-row: rgba(16, 185, 129, .14); --drop-row: rgba(239, 68, 68, .14);   /* T-36 dev page rows */
    --keep-on: #047857; --drop-on: #B91C1C; --on-mark: #FFFFFF;
    --stuck-bg: #2B1614; --dashed: #4A525C;   /* T-39 D */
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------ type ---- */
@font-face { font-family: Inter; font-style: normal; font-weight: 400; font-display: swap;
             src: url(/static/fonts/Inter-Regular.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 500; font-display: swap;
             src: url(/static/fonts/Inter-Medium.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 600; font-display: swap;
             src: url(/static/fonts/Inter-SemiBold.woff2) format("woff2"); }
@font-face { font-family: Inter; font-style: normal; font-weight: 700; font-display: swap;
             src: url(/static/fonts/Inter-Bold.woff2) format("woff2"); }

* { box-sizing: border-box; }
html, body { margin: 0; }
/* geometricPrecision: lay text out on the font's own metrics. Without it
   Chromium on Linux snaps each glyph's advance to whole pixels (FreeType
   hinting) and every word tracks wider than the drawing (fix round 1). */
body { background: var(--ground); color: var(--text);
       font-family: Inter, system-ui, sans-serif; font-size: 14px; line-height: 1.45;
       text-rendering: geometricPrecision; font-synthesis: none; }
a { color: var(--action); }
a:hover { color: var(--action-hover); }
:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
h1 { font-size: 22px; font-weight: 700; line-height: 1.3; margin: 0; }
h1.question { font-size: 26px; }
h2 { font-size: 15px; font-weight: 700; margin: 0 0 10px; }
h3, .label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
             color: var(--muted); margin: 0 0 8px; }
.small, small { font-size: 12.5px; }
.figure { font-size: 22px; font-weight: 700; line-height: 1.2; }
.muted, .mute, .lbl { color: var(--muted); }
p { margin: 0 0 8px; }
code { font-size: 12.5px; }

/* ------------------------------------------------- the frame (1, 7d) ---- */
.shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); min-height: 100vh; }
/* The menu is a grid item: it stretches to the page's full height (the
   shell is at least the viewport tall, so on a short page its foot sits at
   the viewport's foot). */
.menu { background: var(--surface); border-right: 1px solid var(--border); padding: 21px 14px 19px;
        display: flex; flex-direction: column; }
.brand { display: block; padding: 0 0 20px; color: var(--text); text-decoration: none; }
.brand b { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; }  /* 1.png */
.brand span { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.menu .items { display: flex; flex-direction: column; gap: 2px; }   /* 46px pitch, 1.png */
.menu .items a { display: flex; align-items: center; min-height: 44px; padding: 0 12px;
                 border-radius: 8px; color: var(--text); text-decoration: none; font-weight: 500; }
.menu .items a:hover { background: var(--inset); }
.menu .items a.here { background: var(--tint); color: var(--tint-text); font-weight: 600; }
.content { padding: 20px 32px 40px; min-width: 0; }
.shell.bare { display: block; max-width: 560px; margin: 0 auto; }
.shell.bare .brand { padding: 0; }
details.adv .adv-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
details.adv .adv-links a.here { font-weight: 600; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px;
       margin: 0 0 17px; }
.search { flex: 0 1 560px; margin: 0; }
.search input { width: 100%; }
.top .now { color: var(--muted); white-space: nowrap; margin-left: auto; }
.top .phone { display: none; }
/* Ruling 530: the one-click theme switch beside the account menu, one line */
.top > form.inline { flex: none; }
.top > form.inline button { white-space: nowrap; }
/* Ruling 308 part B (RG-1420): the fleet's account menu, top right */
.top .account { position: relative; flex: none; }
.account summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center;
                   min-height: 44px; padding: 0 14px; border: 1px solid var(--border);
                   border-radius: 8px; background: var(--surface); color: var(--text);
                   font-weight: 600; white-space: nowrap; }
.account summary::-webkit-details-marker { display: none; }
.account summary::after { content: "▾"; margin-left: 8px; color: var(--muted); font-size: 12px; }
.account .panel { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
                  min-width: 240px; display: flex; flex-direction: column; gap: 12px;
                  padding: 14px; background: var(--surface); border: 1px solid var(--border);
                  border-radius: 10px; box-shadow: 0 8px 24px var(--shadow); }
.account .panel form { margin: 0; }
.account .label { margin: 0 0 6px; color: var(--muted); font-size: 12.5px; }
.account .themes { display: flex; flex-direction: column; gap: 4px; }
.account .themes button { justify-content: flex-start; width: 100%; background: transparent;
                          color: var(--text); border: 1px solid transparent; font-weight: 400; }
.account .themes button:hover { background: var(--tint); border-color: transparent; }
.account .themes button[aria-pressed=true] { background: var(--chip-sel); color: var(--on-chip-sel);
                                             font-weight: 600; }
.account .panel > a { font-weight: 600; }
.account .panel > form > button.ghost { width: 100%; }
main { display: flex; flex-direction: column; gap: 16px; }
main > * { margin-top: 0; margin-bottom: 0; }

/* the opening sentence (every page), and its status pill */
.opening h3 { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12.5px;
              color: var(--text); margin: 0 0 5px; }
.opening { margin-bottom: -1px; }       /* the first card 18.5px under the lead line (5k, 7d) */
.opening .line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.opening .sub { margin: 6px 0 0; }
.opening:not([data-verdict]) .sub { color: var(--muted); }    /* T-25: 5, 5c */
.opening .purpose { color: var(--muted); margin: 6px 0 0; }

/* -------------------------------------------------------- blocks ---- */
.card, .box, .block { background: var(--surface); border: 1px solid var(--border);
                      border-radius: 10px; padding: 16px 20px; }
/* spacing inside a card, measured on 7d and 5k at 2x: label to body 20px,
   a block to the footnote under it 14px, the empty text to its footnote 16px */
.card > h3 { margin: 0 0 12px; }
.card > .attention, .card > .problem, .card > .inset { margin-bottom: 11px; }
.card > h3 + .attention, .card > h3 + .problem, .card > h3 + .inset { margin-top: -1px; }
.card > p + p { margin-top: 10px; }
.card .empty { margin: 0 0 9px; }
.card .inset { padding: 9px 14px 10px; }
.card .inset p { margin: 0 0 3px; }
.card .inset .btn { margin-top: 4px; }
.card > :last-child, .box > :last-child, .block > :last-child { margin-bottom: 0; }
.card .open { display: inline-block; margin-top: 10px; }
.needs { background: var(--needs-bg); border: 1px solid var(--needs-border); border-radius: 10px;
         padding: 16px 20px; }
/* T-26 set review H1: nothing needs Bruce, so the frame's neutral card, no amber */
.needs.calm { background: var(--surface); border-color: var(--border); }
/* the whole page failed (7d, state 3): the fill only, no border */
.problem { background: var(--problem-bg); border-radius: 10px; padding: 12px 16px 10px;
           color: var(--text); }
.problem p, .attention p { margin: 0; }
.problem p + p, .attention p + p { margin-top: 2px; }
/* part of a page could not be read (7d, state 2): the attention fill
   (#FFF1D6 on the drawing), no border */
.attention { background: var(--attn-bg); border-radius: 10px; padding: 12px 16px 9px;
             color: var(--text); }
.attention .btn { margin-left: 8px; vertical-align: middle; }
/* two columns of cards (1, 5k, 7d); one column on a phone */
.grid2 { display: grid; gap: 16px 18px; grid-template-columns: repeat(2, minmax(0, 1fr));
         align-items: stretch; }                 /* a row's cards end at one y (7d) */
/* the handoff's label and value row: label left, value right, divider above */
/* rows every 45px with the divider 12.5px above the text (7d "Also on every page") */
.lv { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
      padding: 8px 0 15px; }
.lv:last-child { padding-bottom: 6px; }
.lv > :last-child { text-align: right; }
.lv + .lv { border-top: 1px solid var(--divider); }
.inset { background: var(--inset); border-radius: 8px; padding: 10px 14px; }
.card .inset { background: var(--inset); }
/* an empty list (7d, state 5): plain muted text */
.empty { color: var(--muted); margin: 0; }
/* a part still being read (7d, state 1): a grey bar in its place */
.loading { display: block; height: 14px; width: 100%; max-width: 312px; border-radius: 7px;
           background: var(--bar-track); margin: 3px 0 11px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.grid.wide { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
div.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
div.cards .card { position: relative; }
div.cards .card .open { position: absolute; top: 16px; right: 20px; margin: 0; }
div.cards .card .big { font-size: 22px; font-weight: 700; margin: 2px 0 4px; }
div.cards .card.needs { background: var(--needs-bg); border-color: var(--needs-border); }
.block.needs { background: var(--needs-bg); border-color: var(--needs-border); }
.block .item { padding: 8px 0; border-top: 1px solid var(--divider); }
.block .item:first-of-type { border-top: 0; }
.block .item p { margin: 2px 0; }
.stat { text-align: center; }
.stat .v { display: block; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat .l { color: var(--muted); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }
.row { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0;
       border-top: 1px solid var(--divider); }
.row:first-child { border-top: 0; }
.status-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
              padding: 12px 0; border-top: 1px solid var(--divider); }
.status-row:first-child { border-top: 0; }
.status-row b { display: block; font-size: 15px; }
.status-row p { margin: 2px 0 0; color: var(--muted); }
.action { margin: 0; }
.action p { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.two-choice .why { background: var(--inset); border-radius: 8px; padding: 10px 14px; }
.two-choice .choices { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.choice { background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
          padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; }
.choice p { color: var(--muted); }
details.adv, details.advanced, details.fold { border: 1px solid var(--border); border-radius: 10px;
                                              background: var(--surface); padding: 10px 16px; }
details.adv > summary, details.advanced > summary, details.fold > summary {
  cursor: pointer; color: var(--text); font-weight: 600; }   /* T-25: 5, 5g, 5h, 5j draw it dark */
details.advanced td { overflow-wrap: anywhere; }
/* T-35 rule 2: "For engineers", the closed fold of engineering detail (muted, small) */
details.engineers { margin: 10px 0 0; font-size: 13px; color: var(--muted); }
details.engineers > summary { cursor: pointer; color: var(--muted); font-weight: 600; }
details.engineers td, details.engineers li { overflow-wrap: anywhere; }
.key { overflow-wrap: anywhere; min-width: 0; }   /* a long unbroken id wraps, nothing else (T-26 set) */
/* ruling 799 (4), PR 335 review 1 M4: a long unbroken title or source wraps in its cell */
.no-topic-rows td, .no-topic-rows td > * { overflow-wrap: anywhere; min-width: 0; }
.no-topic-rows td::before { overflow-wrap: normal; flex: 0 0 auto; }   /* the cell's label stays whole */

/* status pills (handoff part 1: status words only, always with a word) */
.pill, .badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px;
                font-weight: 600; white-space: nowrap; background: var(--off-bg); color: var(--off-text); }
.st-working, .badge.ok { background: var(--working-bg); color: var(--working-text); }
.st-attn, .badge.warn { background: var(--attn-bg); color: var(--attn-text); }
.st-stopped, .badge.bad { background: var(--stopped-bg); color: var(--stopped-text); }
.st-off, .badge.off { background: var(--off-bg); color: var(--off-text); }
.st-locked, .locked { background: var(--locked-bg); color: var(--locked-text); }
.st-info { background: var(--tint); color: var(--tint-text); }
/* status words in running text */
.ok { color: var(--working-text); } .warn { color: var(--attn-text); } .bad { color: var(--stopped-text); }
p.ok, p.warn, p.bad { font-weight: 600; }

/* ------------------------------------------------- Home (T-21: 1, 1a, R5) ---- */
/* two columns under the banner, measured on 1.png at 2x: 487px and 646px
   with an 18px gap (3fr 4fr); the blocks the 60 s script replaces (#needs,
   #status) are display: contents, so their cards sit in this grid */
.home { display: grid; gap: 18px; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr);
        align-items: start; }
.home-needs { display: contents; }
.home .needs, .home .asks { grid-column: 1 / -1; }
.home .needs h1 { margin: 0; }
.home .needs p { margin: 6px 0 0; color: var(--muted); }
.home-left { grid-column: 1; display: flex; flex-direction: column; gap: 18px; }
.home-right { grid-column: 2; display: flex; flex-direction: column; gap: 18px; }
.home .card > h2 { margin: 0 0 6px; }
.need { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
        padding: 12px 0; border-top: 1px solid var(--divider); }
.card > h2 + .need, .need:first-child { border-top: 0; }
.need .go, .need b { font-size: 14px; font-weight: 500; }
.step-head a { font-size: 15px; font-weight: 500; }
.need p { margin: 2px 0 0; color: var(--muted); }
.need .side { flex: none; }
.need .review { min-height: 44px; }
.phone-only { display: none; }
.event { padding: 10px 0 12px; border-top: 1px solid var(--divider); }
.card > h2 + .event { border-top: 0; }
.event b { display: block; font-size: 15px; font-weight: 600; }
.event p { margin: 2px 0 0; color: var(--muted); }
/* row names 14px as measured on 1.png (System's status rows stay 15px) */
.home .status-row b { font-weight: 600; font-size: 14px; }
.card > h2 + .status-row { border-top: 0; }
.home-foot { margin: 0; }
#updated:empty { display: none; }
#updated { margin: -8px 0 0; }
/* 1a: the label, the question box (the action colour's 2px border), the
   other rows full width, the answered fold */
.asks { display: flex; flex-direction: column; gap: 16px; }
.asks > h3 { margin: 0; }
.card.ask { border: 2px solid var(--action); }
.ask-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px;
            flex-wrap: wrap; }
.ask-head h2 { margin: 0; }
.ask .q { font-size: 17px; margin: 12px 0 14px; }
.answer label { display: block; font-weight: 600; font-size: 15px; margin: 0 0 6px; }
.answer textarea { width: 100%; min-height: 88px; resize: vertical; }
.answer .send { display: flex; align-items: center; gap: 16px; margin-top: 16px; }
.answer .send p { margin: 0; color: var(--muted); }
details.answered > summary { color: var(--text); font-size: 15px; }
/* R5: the steps block */
.steps-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.steps-head h2 { margin: 0 0 6px; }
.step { padding: 12px 0 14px; border-top: 1px solid var(--divider); }
.steps-head + .step { border-top: 0; }
.step-head { display: flex; justify-content: space-between; align-items: center; gap: 16px;
             margin: 0 0 4px; }
.step p { margin: 6px 0 0; color: var(--muted); }

/* filter chips and tabs */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px;
        border-radius: 999px; border: 1px solid var(--input); background: var(--surface);
        color: var(--text); text-decoration: none; }
.chip.sel { background: var(--chip-sel); border-color: var(--chip-sel); color: var(--on-chip-sel); }
.tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--border); }
.tabs a { padding: 10px 0; color: var(--muted); text-decoration: none;
          border-bottom: 3px solid transparent; margin-bottom: -1px; }
/* relay 187 (ruling 737 f): the open tab blue as drawn, its text and its underline */
.tabs a.here { color: var(--tint-text); font-weight: 600; border-bottom-color: var(--action); }

/* --------------------------------------------------- forms, buttons ---- */
/* the browser sets text-rendering: auto on form controls; they follow the body */
button, input, select, textarea { text-rendering: inherit; }
input, select, textarea { font: inherit; color: var(--text); background: var(--surface);
                          border: 1px solid var(--input); border-radius: 8px; padding: 10px 12px;
                          max-width: 100%; }
input, select { min-height: 44px; }
input[type=checkbox], input[type=radio] { min-height: 0; accent-color: var(--action); }
input::placeholder, textarea::placeholder { color: var(--muted); }
label { display: block; margin: 8px 0; }
fieldset { border: 1px solid var(--border); border-radius: 8px; margin: 12px 0; padding: 10px 14px; }
button, .btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
               padding: 10px 18px; border-radius: 8px; font: inherit; font-weight: 600;
               cursor: pointer; text-decoration: none; border: 1px solid var(--action);
               background: var(--action); color: var(--on-action); }
button:hover, .btn:hover { background: var(--action-hover); border-color: var(--action-hover);
                           color: var(--on-action); }
.btn.secondary, button.secondary, .ghost button, button.ghost, .btn.ghost {
  background: var(--surface); color: var(--secondary-text); border-color: var(--secondary-border); }
.btn.secondary:hover, button.secondary:hover, .ghost button:hover, button.ghost:hover,
.btn.ghost:hover { background: var(--inset); color: var(--secondary-text); }
.btn.danger, button.danger { background: var(--danger); border-color: var(--danger);
                             color: var(--on-danger); }
button:disabled, .btn.disabled { opacity: .5; cursor: not-allowed; }
form.inline { display: inline; }
form.inline button { min-height: 36px; padding: 6px 12px; }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
/* managing 122: the label page's note, Keep and Leave out buttons, spaced as .buttons */
form.inline.choices { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 4px 0 8px; }
.copy code { background: var(--inset); border: 1px solid var(--border); border-radius: 4px;
             padding: 1px 6px; }
button.copy, button.cp { min-height: 0; padding: 1px 8px; font-size: 12px; margin-left: 4px; }
code.ref { color: var(--muted); }

/* the confirmation step (5k) */
/* 5k, measured at 2x: question to inset 14px, inset rows every 35.5px, inset
   to the next line 14px (ruling 1242 removed the ruling field and its note) */
.confirm h2 { font-size: 18px; margin: 4px 0 8px; }
.confirm .inset { padding: 10px 14px; margin: 0 0 12px; }
.confirm .inset .lv { padding: 7px 0; }
.confirm .buttons { margin-top: 8px; }

/* ----------------------------------------------------------- tables ---- */
table { border-collapse: collapse; width: 100%; background: var(--surface); }
th, td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--divider); }
th { font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 12px; }
td { padding: 10px 12px; }
tr:last-child td { border-bottom: 0; }
td.n, td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.sortable th { cursor: pointer; }
table.sortable th[aria-sort="ascending"]::after { content: " \2191"; }
table.sortable th[aria-sort="descending"]::after { content: " \2193"; }
td.more { display: none; }
.scroll { overflow-x: auto; }
pre.scroll { max-height: 70vh; overflow: auto; }

/* progress bars */
.bar { height: 10px; border-radius: 5px; background: var(--bar-track); overflow: hidden;
       margin: 6px 0 4px; }
.bar > span { display: block; height: 100%; background: var(--bar-fill); }
.bar.ok > span, .bar.done > span { background: var(--bar-done); }
.bar.failed > span { background: var(--bar-failed); }
.bar > span.not-yet { background: var(--bar-not-yet); }   /* R7: a step not reached */

/* FRS's own panel (/frs) takes the panel's roles through the properties
   its stylesheet offers (the component itself is unchanged, R7 item 7) */
[data-theme] .frs-monitor { --frs-bg: var(--surface); --frs-fg: var(--text); --frs-muted: var(--muted);
               --frs-border: var(--border); --frs-ok: var(--working-text); --frs-warn: var(--attn-text);
               --frs-bad: var(--stopped-text); --frs-accent: var(--action); }

/* ------------------------- Titles & taxonomy (T-22: 3, 3a, 3b, 3d-3g, 3j, 3k) ---- */
/* widths measured on the wireframes at 2x (1440px wide): the funnel's label
   column 204px and figure column 160px; the kept bar 232px; 3b's two cards
   2:3; 3a's verdict panel 392px beside the title cards */
.t-open .crumb { margin: 0 0 6px; font-size: 14px; }
.t-open h1 { margin: 0; }
.t-open .purpose { margin: 6px 0 0; }
.t-tabs { margin: 2px 0 0; }
.t-tabs a { padding: 12px 20px; font-size: 15px; }
.t-tabs a.here { color: var(--tint-text); }
.t-tabs .soon { padding: 12px 20px; font-size: 15px; color: var(--muted); margin-bottom: -1px;
                border-bottom: 3px solid transparent; }
.card > h2 { margin: 0 0 6px; }
.card > .sub { color: var(--muted); margin: 0 0 12px; }
.tfoot { color: var(--muted); margin: 12px 0 0; padding: 0 12px; }
.t-foot { color: var(--muted); margin: 0; }
/* Ruling 576 (b), 588 (c): the line of labelling links under the first card
   of each Titles & taxonomy tab. At phone width each link is a 44 px tap
   target (#312 reviews L3: 19 px before); at 1440 it stays plain text. */
@media (max-width: 599.98px) {
  .t-label-links a { display: inline-flex; align-items: center; min-height: 44px; }
}
.t-propose .tfoot { padding: 0; }
th.n { text-align: right; }
.funnel .fhead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.funnel .asof { color: var(--muted); font-size: 12.5px; }
.as-of { color: var(--muted); white-space: nowrap; }       /* T-35 5d: "as of <date>" on one line */
.funnel .frow { display: grid; grid-template-columns: 204px minmax(0, 1fr) 160px; gap: 0 16px;
                align-items: center; margin: 14px 0 0; }
.funnel .frow b { font-weight: 600; }
.funnel .frow .bar { margin: 0; }
.funnel .fig { text-align: right; font-variant-numeric: tabular-nums; font-size: 15px; }
.funnel .fnote { color: var(--muted); margin: 6px 0 0; }
/* 3: the "Title target" bar, grey as drawn; in dark, R7's muted grey (#A3ACB8) */
.bar.whole > span { background: var(--bar-target); }
.t-table { padding: 8px 8px 16px; }
.t-table table td { vertical-align: middle; }
.t-table .kept .bar { width: 232px; max-width: 100%; margin: 2px 0 2px; }
.of { display: block; color: var(--muted); font-size: 12.5px; }
td.act { text-align: right; white-space: nowrap; }
.chead { display: flex; justify-content: space-between; align-items: center; gap: 16px;
         padding: 8px 12px 10px; }
.chead h2 { margin: 0; }
.t-releases table td, .t-releases table th { padding-left: 16px; }
/* T-23 (3c, 3l, 3h, 3i): a wide table scrolls inside its card, never the page;
   3h's bars use the funnel rows (label, bar, figure) */
.t-wrap { overflow-x: auto; max-width: 100%; }
.t-why .frow { grid-template-columns: minmax(0, 340px) minmax(0, 1fr) 96px; }
.t-why .fig b { font-weight: 700; }
.t-next .lv, .t-held .lv { padding: 12px 0; }
.on-phone { display: none; }
.ph { display: none; }                 /* a phone drawing's own words (3-phone, 3a-phone) */
.t-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.t-stats .v { display: block; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.t-stats .l { display: block; color: var(--muted); margin-top: 4px; }
.t-notes { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: center; }
.t-notes > span { display: inline-flex; align-items: center; gap: 8px; }
.t-pair { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 18px;
          align-items: start; }
.t-three { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 8px; }
.t-three .btn { align-self: flex-start; }
.t-proposal { display: flex; justify-content: space-between; align-items: center; gap: 16px;
              padding: 8px 0; border-bottom: 1px solid var(--divider); }
body:has(.t-overlay) { position: relative; }
.t-overlay { position: absolute; inset: 0; min-height: 100vh; z-index: 20; display: flex; align-items: flex-start;
             justify-content: center; padding: 10vh 16px 16px; background: var(--overlay); }
.t-form { width: 100%; max-width: 460px; box-shadow: 0 8px 28px var(--shadow); }
.t-form label { font-weight: 600; }
.t-form h2 { font-size: 20px; margin: 0 0 6px; }
.t-form input { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
.t-form .buttons { margin: 14px 0 10px; }
.result table { margin-top: 4px; }
.t-search input { width: 100%; max-width: 560px; }
/* 3d, 3k */
.t-empty { background: var(--inset); }
.t-source { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px;
            padding: 12px 0; border-top: 1px solid var(--divider); }
.t-source b { display: block; }
.t-source p { margin: 2px 0 0; color: var(--muted); }
.t-source .side { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.t-aisle .ahead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.t-aisle .ahead h2 { margin: 0; }
.t-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 12px; }
.t-cols h3 { margin: 0 0 6px; }
.t-cols p { margin: 0; }
.t-cols .action { margin-top: 14px; }
.t-cols .action p { font-size: 14px; }
.t-cols form { display: block; }
.t-cols form.inline button { min-height: 44px; padding: 10px 18px; }
.t-changes td:nth-child(3), .t-changes td:nth-child(4) { white-space: nowrap; }
.t-cols .inline-why { display: block; width: 100%; margin: 8px 0 0; }
.t-changes td form.inline + form.inline { margin-left: 6px; }
.t-changes td.act { white-space: nowrap; }
.t-changes .decide { display: inline-flex; gap: 6px; align-items: flex-start; flex-wrap: wrap;
                     justify-content: flex-end; }
.t-changes .decide input { min-height: 36px; padding: 6px 10px; width: 10.5em; }
.t-detail { display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: 18px; align-items: start; }
.t-decide { border: 2px solid var(--action); }
.t-decide button, .t-decide .btn { width: 100%; }
.t-decide p { color: var(--muted); margin: 8px 0 16px; }
.t-decide input { width: 100%; margin: 0 0 8px; }
/* T-35 C9 (relay 84 B2, B5): Approve full width as drawn; a button that asks for
   a reason or a number after the click opens its field under it */
.t-decide form.wide { display: block; }
.t-decide details.ask, .t-decide details.ask > summary { display: block; text-align: center; }
details.ask { display: inline-block; vertical-align: top; }
details.ask > summary { list-style: none; cursor: pointer; }
details.ask > summary::-webkit-details-marker { display: none; }
details.ask[open] > form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
details.ask label { display: block; text-align: left; }
details.ask label input { display: block; width: 100%; margin-top: 4px; }
.t-edit td { vertical-align: middle; }
.t-detail label { font-weight: 600; }
.t-detail label input { display: block; width: 100%; margin-top: 6px; font-weight: 400; }
.t-edit form.inline button { min-height: 44px; padding: 10px 18px; }
.t-edit input[name=to] { width: 100%; }
.t-edit .rowact { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.t-edit details.move { display: inline-block; }
.t-edit details.move > summary { list-style: none; }
.t-edit details.move > summary::-webkit-details-marker { display: none; }
.t-edit details.move form { margin-top: 6px; display: flex; gap: 6px; }
/* 3a */
.t-sample { display: grid; grid-template-columns: minmax(0, 1fr) 392px; gap: 18px; align-items: start; }
.t-titles { display: flex; flex-direction: column; gap: 18px; }
.t-title .thead { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.t-title .thead h2 { font-size: 18px; margin: 0; }
.t-title .thead span { color: var(--muted); }
.t-title .facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
                  margin: 14px 0 0; }
.t-title h3 { margin: 0 0 4px; }
.t-title .facts p, .t-title .evidence p { margin: 0; }
.t-title .evidence { margin: 16px 0 0; }
.t-title .answer { display: flex; gap: 12px; align-items: stretch; margin: 12px 0 0; }
.t-title .answer form { display: contents; }
/* 3a: the chosen answer, filled and ticked; unanswered, both are outlines
   (D4, Group D 2f1d9707 N15, as ruling 443) */
.t-title b.chosen { background: var(--action); color: var(--on-action); border-radius: 8px;
                    padding: 2px 10px; }
.t-title .answer select { flex: 1 1 auto; min-height: 44px; }
.t-title .answered { margin: 12px 0 0; }
.t-verdict h2 { margin: 0 0 10px; }
.t-verdict .tally { font-weight: 600; font-size: 15px; margin: 0 0 10px; }
.t-verdict button, .t-verdict .btn { width: 100%; }
.t-verdict form { display: block; }
.t-verdict p { color: var(--muted); margin: 8px 0 16px; }
.t-verdict p:last-child { margin-bottom: 0; }
.t-open .bar.progress { display: none; }
@media (max-width: 800px) {
  .on-desk { display: none; }
  .dk { display: none; }
  .ph { display: revert; }
  .t-title .thead { flex-direction: column-reverse; gap: 4px; }   /* 3a-phone: "1 of 10" first */
  .on-phone { display: flex; flex-direction: column; gap: 16px; }
  .shelf .shead { display: flex; justify-content: space-between; align-items: center; gap: 12px;
                  flex-wrap: wrap; }
  .shelf p { margin: 4px 0 12px; }
  .funnel .frow { grid-template-columns: minmax(0, 1fr) auto; }
  .funnel .frow .bar { grid-column: 1 / -1; grid-row: 2; margin-top: 6px; }
  .funnel .frow .fig { grid-row: 1; grid-column: 2; font-weight: 700; }
  .funnel .frow b { font-weight: 400; }
  .t-tabs { overflow-x: auto; }
  .t-tabs a, .t-tabs .soon { white-space: nowrap; padding: 10px 12px; }
  .funnel .asof, .funnel .rule, .t-releases { display: none; }   /* 3-phone draws neither */
  .t-stats, .t-pair, .t-three, .t-cols, .t-detail, .t-sample,
  .t-title .facts { grid-template-columns: 1fr; }
  .t-overlay { padding: 0; }
  .t-form { max-width: none; min-height: 100%; border-radius: 0; }
  .t-title .answer { flex-wrap: wrap; }
  .t-title .answer button { flex: 1 1 40%; }
  .t-title .answer select { flex-basis: 100%; }
  .t-open .bar.progress { display: block; }
  .t-sample .t-verdict { order: 2; }
  .t-sample .t-verdict { border: 2px solid var(--action); }     /* 3a-phone */
  .t-open .purpose { display: none; }                           /* 3-phone, 3a-phone */
}

/* ------------------------------------------- phone (under 800 px) ---- */
@media (max-width: 800px) {
  body { font-size: 15px; }
  h1 { font-size: 19px; }
  .shell { display: block; padding-bottom: 64px; }
  .menu { position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: auto; z-index: 10;
          padding: 0; border-right: 0; border-top: 1px solid var(--border); flex-direction: row; }
  .menu .brand { display: none; }
  .menu .items { flex-direction: row; width: 100%; gap: 0; }
  .menu .items a { flex: 1 1 0; justify-content: center; border-radius: 0; padding: 0 4px;
                   font-size: 13px; }
  .menu .items a.here { background: transparent; color: var(--tab-here); }
  .menu .items .wide { display: none; }
  .content { padding: 0 16px 24px; }
  .top { background: var(--surface); border-bottom: 1px solid var(--border);
         margin: 0 -16px 16px; padding: 14px 16px; flex-wrap: wrap; gap: 10px 12px; }
  .top .search, .top .now { display: none; }
  .top .phone { display: flex; justify-content: space-between; align-items: center;
                flex: 1 0 100%; min-width: 0; }
  .top .phone b { font-size: 15px; white-space: nowrap; }
  .top > form.inline { margin-left: auto; }   /* ruling 530: switch and menu, second row, right */
  .top .phone a { display: inline-flex; align-items: center; justify-content: center;
                  min-width: 44px; min-height: 44px; }
  .grid, .grid.wide, .grid2, div.cards, .two-choice .choices { grid-template-columns: 1fr; }
  button, .btn { width: 100%; }
  form.inline button, button.copy, button.cp { width: auto; }
  table.cards, table.cards tbody, table.cards tr { display: block; width: 100%; }
  table.cards thead, table.cards tr:first-child:has(th) { display: none; }
  table.cards tr { background: var(--surface); border: 1px solid var(--border);
                   border-radius: 10px; padding: 10px 14px; margin: 0 0 10px;
                   display: flex; flex-direction: column; }   /* T-35: More's cells below it */
  table.cards td { display: none; border: 0; padding: 2px 0; }
  table.cards td:first-child { display: block; font-weight: 600; }
  table.cards td[data-keep] { display: flex; justify-content: space-between; gap: 12px; }
  table.cards td[data-keep]:not(:first-child)::before { content: attr(data-label); color: var(--muted); }
  /* a heading keeps its one-line width beside a long value, up to 45% of the
     card; a longer one wraps between its words (R4's "Log file": D4, Group D
     2f1d9707 N16) */
  table.cards td[data-keep]:not(:first-child)::before { flex: 0 0 auto; max-width: 45%; }
  table.cards td[data-keep] > * { min-width: 0; }   /* the value may shrink beside its label */
  table.cards td[data-keep] .pill { flex: none; align-self: flex-start; }   /* T-35: never stretched */
  table.cards td.more { display: block; order: 1; }
  /* T-35 item 10: an open "More" shows the cells the card hides, below it */
  table.cards tr:has(> td.more > details[open]) > td:not([data-keep]):not(.more):not(:first-child) {
    display: flex; justify-content: space-between; gap: 12px; order: 2; }
  table.cards tr:has(> td.more > details[open]) > td:not([data-keep]):not(.more):not(:first-child)::before {
    content: attr(data-label); color: var(--muted); }
  table.cards tr:has(> td.more > details[open]) > td:not([data-keep]):not(.more):not(:first-child) > * {
    min-width: 0; overflow-wrap: anywhere; }   /* a long value wraps inside 390 */
  /* ruling 480 (2): one More per card; inside an open card a cell's own fold
     is open (MORE_JS) and shows no second toggle */
  table.cards tr:has(> td.more > details[open]) details.row-more > summary { display: none; }
  .scroll { overflow-x: visible; }
  .home { grid-template-columns: 1fr; gap: 16px; }
  .home-left, .home-right { display: contents; }
  .home .needs { order: 0; } .home .asks { order: 1; } .home .wnu { order: 2; }
  .home .answered { order: 2; } .home .working { order: 3; } .home .steps { order: 4; } .home .coming { order: 5; }
  .home .needs, .home .asks, .home .card { grid-column: 1; }
  .need .go, .need b, .home .status-row b { font-size: 16px; }   /* 1-phone */
  .need .review { display: none; }
  .phone-only { display: inline-block; }
  .answer .send { flex-direction: column; align-items: stretch; }
}

/* ------------------------------------------- T-25 System (5 to 5j, 7a-7c) ---- */
/* 5: three cards a row, each heading with its pill, its link at the foot */
.sys-cards { display: grid; gap: 18px; grid-template-columns: repeat(3, minmax(0, 1fr));
             align-items: stretch; }
.card.sys { display: flex; flex-direction: column; margin: 0; }
.card.sys .card-head h2 { font-size: 17px; }
.card.sys .sys-full { flex: 1 1 auto; }
.card.sys .sys-full > .figure { font-size: 15px; font-weight: 400; margin: 0 0 8px; }
.card.sys .sys-full > .figure b { font-weight: 700; }
.card.sys .lv { padding: 10px 0 12px; }
.card.sys .links { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.card.sys .links .open { margin: 0; font-weight: 600; }
.card.sys .sys-sum, .card.phone-card { display: none; }
.problems-card .side { display: flex; align-items: center; gap: 16px; }
.problems-card .side .open { margin: 0; font-weight: 600; }
.problems-card .sys-sum { display: none; }
details.adv > summary { color: var(--text); font-size: 15px; }
/* 5c, 5g, 5j: the card that lists what needs a look first */
.card.needs-look { border-color: var(--needs-border); }
.card.needs-look .inset { margin-top: 8px; }
.card .figure { font-size: 15px; font-weight: 400; margin: 4px 0 10px; }
.card .figure b { font-size: 22px; font-weight: 700; }
.card .bar { margin: 0 0 10px; }
.bar.warn > span { background: var(--attn-text); }
/* 5e: the choice, its two buttons with their sentences */
.radios { display: flex; flex-direction: column; gap: 10px; margin: 6px 0 10px; }
.radios label { display: flex; align-items: center; flex-wrap: nowrap; gap: 6px;
                white-space: nowrap; }
.radios input[type=radio] { min-height: 0; width: auto; margin: 0; }
.radios select { min-height: 30px; padding: 2px 6px; width: auto; font-size: 13px; }
.start-actions { display: grid; gap: 16px 32px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
                 align-items: start; }
.start-actions form.start { grid-column: 1 / -1; display: contents; }
.start-actions form.start > p, .start-actions form.start > .radios { grid-column: 1 / -1; }
.start-actions .action button, .row-actions button, .row-actions summary.btn { width: auto; }
/* 5f, 5g, 5i: a row's buttons; a closed box opens under its button */
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start;
               justify-content: flex-end; }
.row-actions > span.muted { align-self: center; }
form.inline { display: inline-block; margin: 0; }
details.replace, details.act { display: inline-block; }
details.replace > summary, details.act > summary, details.add-job > summary { list-style: none; }
details.replace > summary::-webkit-details-marker, details.act > summary::-webkit-details-marker,
details.add-job > summary::-webkit-details-marker { display: none; }
details.replace[open] form, details.act[open] form { margin-top: 8px; }
details.act form.box { display: flex; flex-direction: column; gap: 10px; min-width: 280px; }
.set-head { flex-wrap: wrap; align-items: flex-start; }
details.add-job { margin-left: auto; }
details.add-job > summary { display: block; width: max-content; margin-left: auto; }
form.add-job select[name=job] { max-width: 560px; }
.grid2.top { align-items: start; }
.grid2.t-top { align-items: start; }                       /* 3c: next release beside the limit */
.t-limit-fig { margin: 4px 0 10px; }
.t-limit-fig b { font-size: 28px; font-weight: 600; margin-right: 4px; }
.t-limit .bar { margin-bottom: 10px; }
/* 4d Pictures (T-35 item 2) */
.p-turn-on .lv { align-items: center; }
.p-once { margin: 18px 0 8px; color: var(--muted); }
.p-brief-top { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: start; }
.p-pic { width: 132px; height: 96px; object-fit: cover; border: 2px dashed var(--border);
         border-radius: 10px; color: var(--muted); font-size: 13px; display: block; }
.p-cap { margin: 0 0 2px; }                               /* with .label: the drawn small caps */
.p-turn-on .lv .tag { white-space: nowrap; }
.p-brief-top p:not(.p-cap) { margin: 0 0 10px; }
.p-receives { margin-top: 12px; padding: 10px 14px; border-radius: 8px; background: var(--off-bg); }
.p-receives p:not(.p-cap) { margin: 0; }
.p-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 10px; }
.p-choices form, .p-choices .p-choice { margin: 0 0 6px; }
.p-choices label { display: block; margin-bottom: 6px; }
.p-choices input[name=note] { width: 100%; }
@media (max-width: 800px) { .p-brief-top, .p-choices { grid-template-columns: 1fr; } }
summary.btn, .row-actions button, .card .buttons > * { min-height: 44px; display: inline-flex;
  align-items: center; white-space: nowrap; }
section.handled td:first-child { min-width: 220px; }
section.handled th:nth-child(2) { white-space: nowrap; }   /* T-35 5j: "Who acts" on one line */
.card.sys .sys-full > .figure b { font-size: 17px; }
details.add-job > summary.btn { background: var(--action); color: var(--on-action);
                                border-color: var(--action); }
details.add-job[open] { flex-basis: 100%; }
form.add-job { border: 2px solid var(--action); border-radius: 10px; padding: 16px 20px;
               margin-top: 12px; display: flex; flex-direction: column; gap: 10px;
               max-width: 960px; }
form.add-job label.pick { display: flex; align-items: center; gap: 8px; }
form.add-job .buttons, .card .buttons { display: flex; gap: 12px; }
/* 5i: Add a user, three columns */
form.add-user { display: grid; gap: 16px 24px; align-items: start;
                grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr); }
form.add-user input, form.add-user select { display: block; width: 100%; margin: 6px 0; }
form.add-user > div:last-child { padding-top: 22px; }
form.add-user label.field { font-weight: 600; }
/* 7a and 7b by itself: the brand over one card, centred, no menu */
.login { max-width: 560px; margin: 48px auto 0; text-align: center; }
.login .login-brand { font-size: 22px; font-weight: 700; margin: 0 0 22px; }
.login > .muted { margin: 0 0 14px; }
.login .card, .login .grid2 { text-align: left; }
.login h2 { font-size: 22px; }
.login .foot-note { margin-top: 18px; padding: 0 20px; }
.login .grid2 { grid-template-columns: 1fr; }
form.stack { display: flex; flex-direction: column; gap: 6px; }
form.stack label { font-weight: 600; margin-top: 8px; }
form.stack button { margin-top: 12px; }
.refusal { background: var(--stopped-bg); border-radius: 8px; padding: 12px 16px; margin-top: 14px; }
.card .attention { margin: 0 0 12px; }
/* 7c: the settings cards, half the width */
.narrow { display: flex; flex-direction: column; gap: 16px; max-width: 720px; }
@media (max-width: 800px) {
  .sys-cards, .start-actions, form.add-user { grid-template-columns: 1fr; }
  .card.sys { position: relative; }
  .card.sys .sys-full, .card.wide-card { display: none; }
  .card.phone-card { display: block; margin: 0; }
  .card.sys .sys-sum { display: block; margin: 0; color: var(--muted); }
  .card.sys .sys-sum b { color: var(--text); }
  .card.sys .links { margin: 0; }
  .card.sys .links a.open:first-child { position: absolute; inset: 0; font-size: 0; }
  .card.sys .links a.open + a.open { display: none; }
  .problems-card .side .open { position: absolute; inset: 0; font-size: 0; }
  .problems-card .sys-full { display: none; }
  .problems-card .sys-sum { display: block; }
  form.inline button, .row-actions button { width: auto; }
}

/* ------------------------------------------- T-24 Documents (4, 4g-4n) ---- */
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-head h2 { margin: 0 0 8px; }
/* T-35 4e: the backing bar, five segments as drawn (dark green, green, amber, red, grey) */
.cov-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden;
           background: var(--bar-track); margin: 6px 0 14px; }
.cov-bar > span { display: block; height: 100%; }
.cov-bar .lv-rich { background: var(--cov-rich); }
.cov-bar .lv-adequate { background: var(--cov-adequate); }
.cov-bar .lv-thin { background: var(--cov-thin); }
.cov-bar .lv-none { background: var(--bar-failed); }
.cov-bar .lv-unmeasured { background: var(--bar-target); }
.cov-levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.cov-levels .cov-n { display: block; font-size: 20px; font-variant-numeric: tabular-nums;
                     margin: 0 0 4px; }
.cov-levels p { margin: 4px 0 0; }
@media (max-width: 720px) { .cov-levels { grid-template-columns: 1fr 1fr; } }
/* T-39 change round (ruling 799 item 3): a near copy group, one column per document; the
   kept one stays in view while the others scroll beside it; on a phone they stack */
.nc-nav { display: flex; }
.nc-pages { margin: 0 0 12px; }
.nc-docs { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 1fr);
           gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.nc-doc { background: var(--inset); border: 1px solid var(--border); border-radius: 10px;
          padding: 12px 14px; min-width: 0; overflow-wrap: anywhere; }
.nc-doc.kept { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.nc-role { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.nc-role.chosen { color: var(--text); }
.nc-title { margin: 0 0 8px; font-size: 15px; text-transform: none; letter-spacing: 0; }
/* fix round 2 of PR 336 (L1): a title as stored, not the global h3's capitals */
.nc-facts { margin: 0; }
.nc-facts div { margin: 0 0 6px; }
.nc-facts dt { color: var(--muted); font-size: 12.5px; }
.nc-facts dd { margin: 0; }
.nc-why, .nc-replaced { margin: 6px 0 0; font-size: 12.5px; }
.nc-acts { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.nc-acts form, .nc-choices li form { margin: 0; }
.nc-acts button { width: 100%; }
.nc-choices ul { margin: 0 0 8px; padding-left: 18px; }
.nc-choices li { margin: 0 0 6px; }
.nc-choices li form { display: inline-block; margin-left: 8px; }
.nc-foot { margin: 12px 0 0; font-size: 12.5px; }
/* fix round 1 of PR 336 (L4): a long unbroken title on the Near copies list wraps inside 390 */
.review-neardup td { overflow-wrap: anywhere; }
@media (max-width: 599.98px) {
  .nc-docs { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr;
             overflow-x: visible; }
  .nc-doc.kept { position: static; }
  .nc-acts button { min-height: 44px; }
}
main { position: relative; }
.btn.page-act { position: absolute; top: 0; right: 0; width: auto; }
main:has(> .page-act) > .opening { padding-right: 200px; }
.back-link { display: none; }
main > .tabs { margin: 0 0 16px; }
.step-lines .step-line { display: grid; align-items: start; gap: 6px 16px;
  grid-template-columns: minmax(180px, 2.2fr) minmax(120px, 1.2fr) 80px 110px minmax(200px, 4fr); }
.step-line.head { color: var(--muted); font-size: 12px; font-weight: 600; padding: 8px 0;
                  border-bottom: 1px solid var(--divider); }
.step-line .n { text-align: right; font-variant-numeric: tabular-nums; }
.step-line .next { margin: 0; color: var(--text); }
.step-line.stopped { background: var(--stopped-bg); margin: 0 -12px; padding-left: 12px;
                     padding-right: 12px; }
.stepbar { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; margin: 6px 0 4px; }
.stepbar i { display: block; height: 10px; border-radius: 5px; background: var(--bar-not-yet); }
.stepbar i.s-done { background: var(--bar-done); }
.stepbar i.s-stopped { background: var(--bar-failed); }
.steplabels { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; text-align: center;
              font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack > .card { margin: 0; }
.controls { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 8px 0; }
.secondary-form button, form.status-set button { background: var(--surface);
  color: var(--secondary-text); border-color: var(--secondary-border); }
.secondary-form button:hover, form.status-set button:hover { background: var(--inset);
  color: var(--secondary-text); }
form.status-set { display: flex; gap: 8px; align-items: center; }
.choice-card .two-choice .question { font-size: 26px; margin: 0 0 12px; }
.choice-card .why { background: var(--needs-bg); border: 1px solid var(--needs-border); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px;
       font-weight: 600; }
.tag.st-working { background: var(--working-bg); color: var(--working-text); }
.tag.st-stopped { background: var(--stopped-bg); color: var(--stopped-text); }
.tag.st-off { background: var(--off-bg); color: var(--off-text); }
.grid3 { display: grid; gap: 16px 18px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid3 .card { margin: 0; }
.more-rows > summary { color: var(--action); cursor: pointer; padding: 8px 0; }
form.find input, form.filters select { width: 100%; }
form.find { margin: 0 0 16px; }
form.filters { display: grid; gap: 8px; grid-template-columns: repeat(7, minmax(0, 1fr)) auto;
               margin-bottom: 12px; }
.add-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
            align-items: start; }
.drop-box { border: 2px dashed var(--input); border-radius: 10px; padding: 16px; text-align: center; }
.drop-box > b { display: block; }
.btn-file input { display: block; margin: 8px auto 0; }
label.radio { display: flex; gap: 10px; align-items: flex-start; }
label.radio > span > span, label.radio .muted { display: block; }
label.field { font-weight: 600; }
label.field input, label.field select { display: block; width: 100%; margin-top: 6px;
                                         font-weight: 400; }
fieldset.plain, fieldset.folders { border: 0; padding: 0; margin: 12px 0; }
fieldset.plain legend, fieldset.folders legend { font-weight: 600; padding: 0; }
.aim-box { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; background: var(--inset);
           border-radius: 8px; padding: 8px; }
.aim-box input { flex: 1 1 240px; }
span.aim { display: inline-flex; align-items: center; gap: 4px; background: var(--tint);
           color: var(--tint-text); border-radius: 999px; padding: 2px 4px 2px 10px; font-weight: 600; }
span.aim button { min-height: 0; padding: 0 6px; background: transparent; border: 0;
                  color: var(--tint-text); }
.aimed h3.field { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text); }
button.wide { width: 100%; }
.done-box { background: var(--working-bg); color: var(--working-text); border-radius: 8px;
            padding: 10px 14px; margin-bottom: 12px; }
.bar-row { display: flex; justify-content: space-between; align-items: center; gap: 12px;
           margin: 0 0 16px; flex-wrap: wrap; }
.inset-card { background: var(--inset); }
ul.history, ul.refused { margin: 4px 0; padding-left: 18px; }
.tag.st-attn { background: var(--attn-bg); color: var(--attn-text); }
.check-row .tag, form.filters button { white-space: nowrap; }
.check-row { align-items: center; }
label.file-btn { position: relative; overflow: hidden; margin: 10px 0 6px; }
label.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
label.reason { font-weight: 600; margin-top: 8px; }
label.reason input { display: block; width: 100%; font-weight: 400; margin-top: 4px; }
.batch-list .phone-line { display: none; }
/* ------------------------------ T-24 B Fact quality, Coverage (4a, 4l, 4j, 4k, 4e) ---- */
.review-body { display: flex; flex-direction: column; gap: 16px; }
.review-body > * { margin-top: 0; margin-bottom: 0; }
.pair-head { display: flex; justify-content: space-between; align-items: center; gap: 12px;
             margin-bottom: 16px; }
.pair-topic { font-size: 15px; }
.pair-pos { display: flex; align-items: center; gap: 12px; }
.pair-docs { display: grid; gap: 16px 18px; grid-template-columns: repeat(2, minmax(0, 1fr));
             margin-bottom: 16px; }
.says { background: var(--inset); border: 1px solid var(--border); border-radius: 10px;
        padding: 16px 20px; }
.says h3 { margin: 0 0 8px; }
.says .fact { font-size: 19px; margin: 0 0 8px; }
.says .meta, .says .around { margin: 0 0 8px; }
.card .check { margin-bottom: 16px; }
.check h3 { margin: 0 0 4px; }
/* T-39 C, one pair: the row above the card, the title, the two boxes, the tick, the foot */
.pair-nav { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
            gap: 12px; }
.pair-nav .pair-pos { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pair-nav .btn, .pair-nav button, .pair-foot .btn, .pair-foot button { min-height: 36px;
            padding: 6px 12px; width: auto; }
.pair-phone-pos { display: none; }
/* C with no pair shown: its way back to the list, kept at 390 (fix round 3 of PR 337, L2) */
.pair-back { margin: 0 0 12px; }
.pair-back .btn { min-height: 36px; padding: 6px 12px; width: auto; }
.says .doc-title { margin: 0 0 4px; }
.card .outcome-box { margin-bottom: 16px; }
.outcome-box h3 { margin: 0 0 4px; }
.outcome-box p { margin: 0; }
/* ruling 800: each document's card holds its button; Keep both and Leave open in one row
   under the two cards; a kept card says so, with the time and Undo */
.pair-docs .says { display: flex; flex-direction: column; }
.says > p:last-of-type { margin-bottom: 12px; }
.says .card-keep { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center;
                   gap: 8px 12px; }
.says .card-keep button { width: auto; min-height: 40px; padding: 8px 18px; }
.says.kept { border-color: var(--action); box-shadow: inset 0 0 0 1px var(--action); }
.kept-by { margin: 0; font-weight: 600; }
.rules-mark { margin: 0 0 8px; font-size: 13px; }
.rules-tag { display: inline-block; background: var(--tint); color: var(--tint-text);
             border-radius: 999px; padding: 2px 10px; font-size: 12.5px; font-weight: 600; }
.pair-both { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 0 0 16px; }
.pair-both .held { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pair-both button { width: auto; min-height: 40px; padding: 8px 18px; }
button.rules-choice { box-shadow: 0 0 0 2px var(--tint-text); }
.row-keeps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.row-keeps button { width: auto; min-height: 32px; padding: 4px 10px; font-size: 13px; }
form.pair-judge, div.pair-judge { margin: 0; }
.same-docs { display: flex; align-items: center; gap: 10px; margin: 4px 0 12px; font-weight: 400; }
.same-docs input { width: 18px; height: 18px; margin: 0; }
.same-locked { margin: -6px 0 12px; font-size: 13px; }
.pair-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px;
             margin-top: 12px; }
.pair-foot p { margin: 0; font-size: 13px; }
.list-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
             gap: 12px; }
.view-chips { display: flex; align-items: center; gap: 8px; }
/* T-39 B, the list: Fact quality's chips, the filters card, the ticked bar, the topic groups */
.review-list > .tabs { margin: 0 0 16px; }
.review-list > .fact-chips, .review-list > .list-head { margin: 0 0 16px; }
.review-list > .state-chips { margin: 0 0 16px; }   /* ruling 809: See its pairs' states */
form.list-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
form.list-filters label.field { flex: 1 1 210px; margin: 0; }
form.list-filters label.field:first-of-type { flex: 2 1 240px; }
form.list-filters input[type=search] { display: block; width: 100%; margin-top: 6px;
                                       font-weight: 400; }
form.list-filters .download, form.list-filters button { width: auto; white-space: nowrap; }
.pair-list { padding: 12px 8px 8px; }
.pair-list > .card-head, .pair-list .list-pages, .pair-list .group-head,
.pair-list .ticked-bar { margin-left: 12px; margin-right: 12px; }
.pair-list .card-head h2 { font-size: 15px; }
.ticked-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--tint);
              border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.ticked-bar[hidden] { display: none; }
.ticked-bar button { min-height: 36px; padding: 6px 12px; width: auto; }
.ticked-bar .needs-outcome { font-size: 13px; }
.group-head { font-size: 14px; font-weight: 600; text-transform: none; letter-spacing: 0;
              color: var(--text); margin: 8px 0 0; }
.linkish { background: none; border: 0; min-height: 0; padding: 0; font: inherit; width: auto;
           font-size: 13px; font-weight: 400; color: var(--action); text-decoration: underline;
           cursor: pointer; margin-left: 8px; }
table.pair-rows { margin-top: 6px; }
table.pair-rows td { vertical-align: top; }
table.pair-rows td.tick input { width: 18px; height: 18px; margin: 2px 0 0; }
table.pair-rows .doc-line { margin: 2px 0 0; font-size: 12.5px; }
table.pair-rows td .pill { margin-bottom: 2px; }
table.pair-rows td.go .btn { min-height: 36px; padding: 6px 12px; white-space: nowrap; }
.pair-list .list-pages { margin-top: 8px; font-size: 13px; }
.confirm .judge-note { font-size: 13px; color: var(--muted); }
.confirm .lv > :last-child > .judge-pairs { text-align: left; }   /* drawing B's list of pairs */
.judge-pairs { margin: 0; padding-left: 18px; }
.why-not h2 { margin: 0 0 8px; }
.why-not p { margin: 0 0 6px; }
@media (max-width: 800px) {
  main:has(.review-conflicts) .opening .purpose, .review-conflicts .review-chips,
  .review-conflicts .topic-label { display: none; }
  /* T-39 C at 390: 4a-phone with part 3's words and the two boxes, nothing else (NOTE part 9) */
  .review-conflicts .pair-nav, .review-conflicts .same-docs, .review-conflicts .same-locked,
  .review-conflicts input[name=others] { display: none; }
  .review-conflicts .pair-phone-pos { display: inline; }
  .pair-foot { flex-direction: column; align-items: stretch; }
  .pair-foot .btn, .pair-foot button { min-height: 44px; width: 100%; }
  .pair-back .btn { min-height: 44px; }
  .pair-docs { grid-template-columns: 1fr; }
  .says .card-keep button, .pair-both .held, .pair-both button { width: 100%; min-height: 44px; }
  .row-keeps button { min-height: 40px; }
  .review-conflicts > .not-for-you { display: none; }
  form.list-filters label.field, form.list-filters label.field:first-of-type { flex: 1 1 100%; }
  form.list-filters .download { width: 100%; }
  .ticked-bar button { width: 100%; }
  .says { border: 0; padding: 12px 16px; }
  .says .fact { font-size: 17px; }
  .says .around { display: none; }
}

/* T-25 PR B: the model server (5a), Models (5d), Limits (5b), Logs download (R6) */
.block.inset { background: var(--inset); }
#openings h2 { font-size: 12px; text-transform: uppercase; color: var(--muted); }
#openings .says { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; }
#openings .says .say .pill { margin-right: 4px; }   /* T-26: scoped; .says is also 4a's box */
#asks { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
#asks p { margin: 0; }
.frs-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px;
  align-items: start; }
.frs-own { border: 2px solid var(--action); }
.frs-own .tag { background: var(--tint); color: var(--tint-text); }
.frs-head { display: flex; justify-content: space-between; margin: 0 0 12px; }
table.limits td.side { text-align: right; vertical-align: top; }
table.limits tr.group th { background: var(--inset); text-align: left; }
.kinds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kinds p { margin: 4px 0 0; color: var(--muted); }
#download .two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
#download summary { display: inline-block; list-style: none; cursor: pointer; }

/* T-35 4i: one document as drawn ("Page [1] of [n]", the page beside the
   text read from it, Copies and History as bold subheadings) */
.original .page-top { display: flex; justify-content: space-between; align-items: center;
                      gap: 8px 16px; flex-wrap: wrap; margin-bottom: 12px; }
.original .page-pick { display: flex; align-items: center; gap: 8px; margin: 0; }
.original .page-pick label { font-size: 15px; font-weight: 700; }
.original .page-side { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
                       gap: 16px; margin-bottom: 12px; }
.original .page-box { border: 2px dashed var(--border); border-radius: 10px; min-height: 320px;
                      display: flex; align-items: center; justify-content: center;
                      padding: 16px; text-align: center; color: var(--muted); }
.original .page-box p { margin: 0; }
.original .page-img { max-width: 100%; height: auto; border: 1px solid var(--border);
                      border-radius: 6px; }
.original .page-text { background: var(--inset); border-radius: 8px; padding: 14px 16px;
                       min-height: 320px; min-width: 0; }
.original .page-text pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0;
                           font-family: inherit; font-size: 14px; }
.original .page-foot { margin: 0; }
.card h3.sub, h3.sub { text-transform: none; font-size: 17px; font-weight: 700; color: var(--text);
         margin: 20px 0 8px; }
p.history { margin: 0; }
/* T-35 item 4: screen 4f as drawn: the choices label, the bullets, the
   chosen-first card's blue border, the buttons at each card's foot and full
   width on the phone */
.choice-card .two-choice { display: flex; flex-direction: column; gap: 16px; }
.choice-card .two-choice > .label { margin: 8px 0 0; color: var(--muted); }
.choice-card .why { border-radius: 10px; padding: 14px 18px; }
.choice-card .choice h2 { margin: 0; font-size: 20px; }
.choice ul { margin: 0; padding-left: 20px; }
.choice ul li { margin: 6px 0; }
.choice.primary { border: 2px solid var(--action); }
.choice form.choice-form { margin-top: auto; padding-top: 12px; }
.choice-wait p { margin: 0; }
@media (max-width: 800px) {
  .choice-card .choice form.choice-form button { width: 100%; }
}

/* T-35 item 6: screen 5a as drawn: the wrapper's right-hand words and its
   "Full FRS panel" link, and the side card's term list (term left, meaning
   right, a rule between rows) */
.frs-head { align-items: baseline; gap: 12px; flex-wrap: wrap; }
.frs-head .muted { font-size: 14px; }
.frs-head a#full-panel:not([href]) { color: inherit; text-decoration: none; }
dl.terms { margin: 12px 0 0; }
dl.terms > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0;
  border-top: 1px solid var(--divider); }
dl.terms dt { font-weight: 600; flex: 0 0 auto; max-width: 40%; }
dl.terms dd { margin: 0; text-align: right; }
/* T-35 6b: the cut-off for accepting facts (wireframe 6b) */
.cut-block .card-head { align-items: center; }
.cut-state { margin: 0 0 12px; }
.cut-figs { width: 100%; }
.cut-figs tr.measured td { font-weight: 700; }
.cut-block h2.cut-sub { margin: 20px 0 8px; font-size: 17px; }
.cut-acts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px;
            margin-top: 14px; align-items: start; }
.cut-act p { margin: 6px 0 0; }
.cut-act details.replace form { margin-top: 8px; }
.cut-act details.replace > summary { margin: 0; }
@media (max-width: 800px) {
  .cut-acts { grid-template-columns: 1fr; }
  .cut-figs th, .cut-figs td { padding-left: 4px; padding-right: 4px; font-size: 13px; }
}

@media (max-width: 800px) {
  main > .btn.page-act { position: static; display: flex; margin: 0 0 16px; }
  main:has(> .page-act) > .opening { padding-right: 0; }
  /* every tab row, not only one straight under main (4j, 4k: D4, N4) */
  .tabs { flex-wrap: nowrap; }
  .tabs a { white-space: nowrap; flex: 0 0 auto; }
  .step-line > div > p { display: none; }
  .batch-list table, .batch-list tbody, .batch-list tr, .batch-list td { display: block; }
  .batch-list tr:first-child, .batch-list td:nth-child(2), .batch-list td:nth-child(3),
  .batch-list td:nth-child(4), .batch-list .wide-only { display: none; }
  .batch-list .phone-line { display: block; }
  .batch-list td { padding: 4px 0; border: 0; }
  .batch-list tr { border-bottom: 1px solid var(--divider); padding: 8px 0; }
  .opening:has(.back-link) > h3 { display: none; }
  .back-link { display: inline-block; margin-bottom: 8px; }
  .step-lines .step-line { grid-template-columns: 1fr auto; }
  .step-line.head, .step-line .wide { display: none; }
  .step-line .next { grid-column: 1 / -1; color: var(--muted); }
  /* T-39 D: the nine cells wrap; a stuck row's button under it (more specific
     than the base rules further down) */
  .card.nine .step-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* relay 169 1: "Not measured" fits a third of a phone on one line, in a dashed cell too
     (T-39 D round 2: inside the cell's padding; a longer pill wraps at its space) */
  .card.nine .step-cell { padding: 8px 5px; }
  .card.nine .step-cell .pill { font-size: 11px; padding: 2px 4px; }
  .card.stuck .stuck-row { flex-direction: column; align-items: stretch; }
  .card.stuck .btn.small { width: 100%; min-height: 44px; }
  /* the note wrapped under a card heading keeps the heading's 8 px gap
     (ruling 582 fix 3: it touched the red row) */
  .card.stuck .card-head > .muted, .card.nine .card-head > .muted { margin-bottom: 8px; }
  .steplabels { display: none; }
  .grid3, .add-grid, form.filters { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
  /* ruling 480 (1), the stage-strip rule: a clipped side fades (TABS_JS sets data-fade); a mask reads only opacity, so the opaque ground token stands for "shown" (no colour named here) */
  /* relay 169 (ruling 635 b) 3: 64 px, clear over the last 16 px, so a cut tab name fades out
     and reads as more to scroll, not as cut mid-word */
  .tabs[data-fade="right"] {
    -webkit-mask-image: linear-gradient(to right, var(--ground) calc(100% - 64px), transparent calc(100% - 16px));
    mask-image: linear-gradient(to right, var(--ground) calc(100% - 64px), transparent calc(100% - 16px)); }
  .tabs[data-fade="left"] {
    -webkit-mask-image: linear-gradient(to left, var(--ground) calc(100% - 64px), transparent calc(100% - 16px));
    mask-image: linear-gradient(to left, var(--ground) calc(100% - 64px), transparent calc(100% - 16px)); }
  .tabs[data-fade="left right"] {
    -webkit-mask-image: linear-gradient(to right, transparent 16px, var(--ground) 64px, var(--ground) calc(100% - 64px), transparent calc(100% - 16px));
    mask-image: linear-gradient(to right, transparent 16px, var(--ground) 64px, var(--ground) calc(100% - 64px), transparent calc(100% - 16px)); }
  .frs-wrap, .kinds, #download .two { grid-template-columns: 1fr; }
  #asks { flex-direction: column; }
  .original .page-side { grid-template-columns: 1fr; }
  .original .page-box, .original .page-text { min-height: 160px; }
  /* T-39 A: the overview's phone rules (more specific than its base rules further down;
     a plain max-width block, review 1 of PR 333, L2: an older phone browser drops a range) */
  .review-overview .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-overview .tiles > .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .review-overview .overview-cards > .card, .review-overview .overview-pair > .where,
  .review-overview .overview-pair > .settled-how { flex-basis: 100%; }
  .review-overview table.topic-rows td.go .btn { width: 100%; }
  /* the figure and its Open under the words, on a line of their own (phone reads test) */
  .review-overview .other-row { flex-direction: column; gap: 4px; }
  .review-overview .other-n { text-align: left; white-space: normal; }
}

/* ------------------------------------------------ T-35 Group D part 1 ---- */
/* 6d: the three drawn filters (who, done or refused, containing) */
form.filters[action="/audit"] { grid-template-columns: minmax(0, 220px) minmax(0, 220px)
                                                       minmax(0, 320px) auto; }
form.filters[action="/audit"] input { width: 100%; }
/* 4a, 4l: the safety pill beside the topic */
.pair-topic .pill { margin-right: 6px; }
/* 5b: "Change this limit" beside the table, the row being changed tinted */
.limits-change { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px;
                 align-items: start; }
.change-limit { border: 2px solid var(--action); position: sticky; top: 16px; }
.change-limit .now-row { display: flex; justify-content: space-between; gap: 12px;
                         border-top: 1px solid var(--divider); padding-top: 8px; }
.change-limit .new-value { display: block; margin: 12px 0; }
.change-limit .field { display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
                       margin-top: 6px; }
.change-limit .inset .label { margin: 0 0 4px; }
.change-limit .inset p { margin: 0; }
.change-limit form.change > button { width: 100%; margin-top: 12px; }
tr.changing td { background: var(--tint); }
@media (max-width: 900px) {
  form.filters[action="/audit"] { grid-template-columns: 1fr; }
  .limits-change { grid-template-columns: 1fr; }
  .change-limit { position: static; }
}

/* T-35 D2: phone (390) */
/* Item 18 and ruling 381 (RG-1503): on a phone nothing passes the right
   edge, and below 600 px every table shows each row as a block, each cell
   on its own line under its column's heading (the cell's data-label,
   written by ui.table, titles_ui.grid and the hand-built tables). A tab row
   stays on one row and scrolls inside itself (the 800 px rules above). */
@media (max-width: 599.98px) {
  /* a long value (an id, a hash, a path) wraps inside its row; a pill never
     shrinks or stretches; a form control is never wider than its column */
  .lv > * { min-width: 0; overflow-wrap: break-word; }
  .lv > .tag, .lv > .pill { min-width: auto; flex: none; }
  code, .ref, pre { overflow-wrap: anywhere; }
  pre { white-space: pre-wrap; }
  form.inline { max-width: 100%; }
  select, input, textarea { max-width: 100%; }
  /* 5e: the scheduled choice wraps onto a second line; Save and Send now
     stack */
  .radios label { flex-wrap: wrap; white-space: normal; }
  .start-actions { grid-template-columns: minmax(0, 1fr); }
  /* Tables. A card table (table.cards, 3c and the like) keeps its label-left
     cards and its "More" fold, its first cell headed too; any other table
     stacks each heading above its value. The heading row is hidden; a
     row-wide cell (a group heading, a "none" note) stays as it is; an
     empty cell is not shown. */
  td[data-label]::before { content: attr(data-label); color: var(--muted); }
  td[data-label=""]::before { content: none; }
  table.cards td:first-child { display: flex; justify-content: space-between; gap: 12px; }
  table.cards td:first-child > * { min-width: 0; }
  table.cards td:first-child::before { font-weight: 400; }
  table:not(.cards), table:not(.cards) > thead, table:not(.cards) > tbody,
  table:not(.cards) tr { display: block; width: auto; max-width: 100%; }
  table:not(.cards) > thead,
  table:not(.cards) tr:first-child:has(> th):not(:has(> td)) { display: none; }
  table:not(.cards) tr { padding: 8px 0; border-bottom: 1px solid var(--divider); }
  table:not(.cards) tr:last-child { border-bottom: 0; }
  table:not(.cards) td, table:not(.cards) tr > th {
    display: block; width: auto; padding: 3px 0; border: 0; text-align: left;
    white-space: normal; overflow-wrap: break-word; }
  table:not(.cards) td[data-label]::before { display: block; font-size: 13px; }
  table td:empty, table.cards td[data-keep]:empty,
  table.cards tr:has(> td.more > details[open]) > td:not([data-keep]):not(.more):not(:first-child):empty {
    display: none; }
  /* 3d: the changes table's dates and action cell wrap like any other */
  table.t-changes td, table.t-changes td.act { white-space: normal; }
  .t-changes .decide { flex-wrap: wrap; }
}

/* T-35 D3: the Group D follow-up (ruling 416 (b)) */
/* 5b (item 36): the limits are one card; the pictures are its last group,
   under the same columns, the drawn five shown until "Show all" opens the
   rest (a checkbox and its label: no script) */
.limits-card > .block { border: 0; border-radius: 0; padding: 0; margin: 0; background: none; }
.limits-card > .block + .block { margin-top: 0; }
.limits-card table.limits { table-layout: fixed; width: 100%; }
.limits-card col.c-now { width: 120px; }
.limits-card col.c-who { width: 230px; }
.limits-card col.c-side { width: 150px; }
.show-more { position: relative; margin: 12px 0 0; }
.show-all { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
table.joined tr.more, table.joined .every, .show-more .to-five { display: none; }
.pictures:has(#pics-all:checked) table.joined tr.more { display: table-row; }
.pictures:has(#pics-all:checked) table.joined .every,
.pictures:has(#pics-all:checked) .show-more .to-five { display: inline; }
.pictures:has(#pics-all:checked) table.joined .some,
.pictures:has(#pics-all:checked) .show-more .to-all { display: none; }
#pics-all:focus-visible + label { outline: 2px solid var(--action); outline-offset: 2px; }
/* 5c (item 11): a name and its note are one value */
.what > .block-line { display: block; }
/* 5c on a phone: a name and its note end at the cell's right edge, as every
   other card value does, with or without a note (D4, Group D 2f1d9707 N13) */
@media (max-width: 599.98px) { table.cards td .what { text-align: right; } }
@media (max-width: 599.98px) {
  .pictures:has(#pics-all:checked) table.joined tr.more { display: block; }
  /* the pictures' group heading is its table's first row, which the D2 rule
     hides as a heading row: it is the drawn "Pictures · 5 of 25 shown" */
  table.limits.joined tr.group { display: block; }
  /* 3e (item 14): no heading row to click on a phone, so no sentence about it */
  .heads-only { display: none; }
  /* items 11 and 12: a label and its value. The label keeps its width and
     wraps only between words; the value takes the rest of the line, or the
     next line when it does not fit beside the label (as a stacked cell) */
  .lv { flex-wrap: wrap; row-gap: 2px; }
  .lv > :first-child:not(:last-child) { flex: 0 0 auto; max-width: 100%; overflow-wrap: normal; }
  .lv > :last-child:not(:first-child) { flex: 1 1 auto; }
  /* a button's words never split: an open "More" lets a card's values wrap
     anywhere (item 10), which reached 6a's Set and Default (full browser
     lane at 71796a07); a button still wraps between its words */
  button { overflow-wrap: normal; word-break: normal; }
  /* 6a: an open "More" cell holding several things (Set, Default and
     Automatic for this run) wraps them onto the next line, never squeezed
     side by side over each other (full browser lane at 71796a07) */
  table.cards tr:has(> td.more > details[open]) > td:not([data-keep]):not(.more):not(:first-child):has(> * + *) {
    flex-wrap: wrap; row-gap: 4px; }
  /* items 11 to 13: a card cell holding more than one thing (a name and the
     line under it, a list and its Set button, two rulings, "Every day at"
     with its list and the next run) keeps its heading on its own line and
     starts the things on the next line, one under another, each at its own
     width, never squeezed side by side over each other. One row each and no
     margins: no empty lines (D4, Group D 2f1d9707 N3; managing relay 116,
     ruling 455: "a stacked cell starts its value on the next line") */
  table.cards td:first-child:has(> * + *), table.cards td[data-keep]:has(> * + *) {
    display: grid; grid-template-columns: minmax(0, 1fr);
    row-gap: 2px; align-items: start; text-align: right; }
  table.cards td:first-child:has(> * + *)::before,
  table.cards td[data-keep]:has(> * + *)::before {
    grid-column: 1; grid-row: 1; text-align: left; max-width: none; }
  table.cards td:first-child:has(> * + *) > *,
  table.cards td[data-keep]:has(> * + *) > * {
    grid-column: 1; justify-self: end; max-width: 100%; margin-block: 0; }
  /* 3l (item 13): a card's heading keeps its line; the search goes under it */
  .chead, .card-head { flex-wrap: wrap; }
  .chead > h2, .card-head > h2 { flex: 0 1 auto; max-width: 100%; }
  /* R6 (item 13): an action's open box inside a card uses the card's width,
     so a long choice fits its list */
  table.cards details.act > form.box { padding: 10px; }
  table.cards details.act select { font-size: 14px; padding-left: 8px; padding-right: 8px; }
}

/* T-36 development labelling page (main: relays 91, 97, 107, 109; #290 review), in the redesign's roles */
details.why { display: inline-block; margin-left: 10px; vertical-align: middle; }
details.why > summary { display: inline; font-size: .85em; color: var(--muted); cursor: pointer;
  text-decoration: underline; }
details.why[open] { display: block; margin: 6px 0 0; }
form.dev button { margin-right: 8px; }
.done-count { font-weight: 600; margin: 0 0 8px; }
form.dev > button[name=choice]:not(.on) { background: transparent; border: 1px solid var(--border); color: var(--text); }
form.dev button.on.keep { background: var(--keep-on); border-color: var(--keep-on); color: var(--on-mark); font-weight: 600; }
form.dev button.on.drop { background: var(--drop-on); border-color: var(--drop-on); color: var(--on-mark); font-weight: 600; }
li.dropped { background: var(--drop-row); border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; }
li.kept { background: var(--keep-row); border-radius: 6px; padding: 4px 8px; margin-bottom: 4px; }
li.dropped > p b { text-decoration: line-through; }
form.topic-nav { display: inline-block; margin-right: 8px; }

/* ------------------------------------------- T-39 D Processing (drawing D) ---- */
#steps { display: flex; flex-direction: column; gap: 16px; }   /* the two cards, main's gap */
/* What is stuck or failing: one row per step, its button at the right */
.stuck .stuck-row { display: flex; justify-content: space-between; align-items: flex-start;
                    gap: 12px; padding: 11px 0; border-top: 1px solid var(--divider); }
.stuck .card-head + .stuck-row, .stuck .stuck-row.stopped,
.stuck .stuck-row.stopped + .stuck-row { border-top: 0; }
.stuck .stuck-row.stopped { background: var(--stuck-bg); margin: 0 -8px; padding: 11px 8px;
                            border-radius: 8px; }
.stuck .stuck-row b { font-size: 15px; font-weight: 600; }
.stuck .stuck-row .fact { margin: 4px 0 0; }
.stuck .stuck-row .muted { margin: 0; font-size: 12.5px; }
.stuck .all-working { margin: 0; }
/* review 4 M1: the steps not read yet or not reported, named after the rows */
.stuck p.unread { margin: 0; padding: 11px 0; border-top: 1px solid var(--divider); }
.stuck .card-head + p.unread, .stuck .stuck-row.stopped + p.unread { border-top: 0; }
.btn.small { min-height: 36px; padding: 6px 12px; white-space: nowrap; width: auto; flex: none; }
/* The nine steps: one line of nine cells; a coloured top edge by state,
   dashed when the step is not measured */
.step-cells { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 8px; }
.step-cell { min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
             gap: 4px; text-decoration: none; color: var(--text); background: var(--surface);
             border: 1px solid var(--border); border-top: 4px solid var(--bar-not-yet);
             border-radius: 8px; padding: 8px 6px; }
.step-cell:hover { color: var(--text); }
.step-cell:hover b { text-decoration: underline; }
.step-cell .num, .step-cell .figure { color: var(--muted); font-size: 12.5px; }
.step-cell b { font-size: 13px; font-weight: 600; }
/* relay 169 (ruling 635 b) 1, T-39 D round 2: a cell's pill is read in full at every width.
   The nine cells keep one line where every pill fits it (1432 px and wider: "Needs attention",
   the longest word, and six-digit counts); below that they fold, five and then three to a row,
   so each pill stays on one line; a pill that still cannot fit (a phone's "Needs attention",
   a seven-digit count) wraps at its space, never cut mid-word */
.step-cell .pill { white-space: normal; max-width: 100%; box-sizing: border-box;
                   padding: 2px 5px; }
@media (min-width: 800.02px) and (max-width: 1431.98px) {
  .card.nine .step-cells { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 800.02px) and (max-width: 939.98px) {
  .card.nine .step-cells { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.step-cell.edge-ok { border-top-color: var(--bar-done); }
.step-cell.edge-attn { border-top-color: var(--cov-thin); }
.step-cell.edge-stopped { border-top-color: var(--bar-failed); background: var(--stuck-bg); }
.step-cell.edge-info { border-top-color: var(--action); }
.step-cell.unmeasured { border: 2px dashed var(--dashed); border-top: 4px solid var(--bar-not-yet); }
/* today's table, folded under the line (a plain disclosure, as drawn) */
.nine details.fold { border: 0; padding: 0; margin: 12px 0 0; background: none; }
.nine details.fold > summary { min-height: 28px; }
.nine .step-lines { margin-top: 8px; }
/* its phone rules: in the last phone block above (T-39 D) */

/* ------------------------------------------ T-39 A Fact quality: overview (drawing A) ---- */
.review-overview { display: flex; flex-direction: column; gap: 16px; }
.review-overview > .tabs, .review-overview > .fact-chips { margin: 0; }
/* the two cards side by side (each at least 380 px, as drawn); one column on a phone */
.overview-cards { display: flex; flex-wrap: wrap; gap: 16px; }
.overview-cards > .card { flex: 1 1 380px; min-width: 0; display: flex; flex-direction: column;
                          gap: 10px; }
.overview-cards > .card > * { margin: 0; }
.overview-cards h2 { color: var(--text); }
.overview-cards ul { padding-left: 18px; }
.overview-cards .buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* five tiles on one line; two to a row on a phone, the fifth across */
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
a.card.tile { display: flex; flex-direction: column; gap: 2px; text-decoration: none;
              color: var(--text); min-width: 0; }
a.card.tile b { font-size: 26px; font-weight: 700; line-height: 1.25;
                font-variant-numeric: tabular-nums; }
a.card.tile span { color: var(--muted); font-size: 12.5px; }
a.card.tile:hover { border-color: var(--action); }
a.card.tile:hover b { text-decoration: underline; }
/* Where they are (3) beside How they were settled (2), as drawn */
.overview-pair { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.overview-pair > .where { flex: 3 1 520px; min-width: 0; }
.overview-pair > .settled-how { flex: 2 1 340px; min-width: 0; }
table.topic-rows { margin-top: 6px; }
/* the column heads on one line at 1440, as drawn (review 1 of PR 333, L3) */
table.topic-rows th { white-space: nowrap; }
table.topic-rows td { vertical-align: top; }
table.topic-rows td .path { margin: 2px 0 0; font-size: 12.5px; font-weight: 400; }
table.topic-rows td.go { text-align: right; }
table.topic-rows td.go .btn { min-height: 36px; padding: 6px 12px; white-space: nowrap; width: auto; }
.where-foot { margin: 10px 0 0; font-size: 12.5px; }
/* How they were settled, Other checks: a row's words left, its figure right */
.settle-row, .other-row { display: flex; justify-content: space-between; align-items: flex-start;
                          gap: 12px; padding: 11px 0; border-top: 1px solid var(--divider); }
.settled-how > h2 + .settle-row, .other-checks > h2 + .other-row { border-top: 0; }
.settle-row p, .other-row p { margin: 2px 0 0; }
.settle-n { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.settle-n a { font-size: 12.5px; white-space: nowrap; }
.other-n { text-align: right; white-space: nowrap; }
.how-foot { margin: 6px 0 0; }
/* its phone rules: in the last phone block above (T-39 A) */
