/* system.css — how this system looks and moves: text, links, buttons, fields, tables, status and
   notices, the page frame, and this system's own components.
   Written in the Design stage and approved by Yarik; loaded after base.css and theme.css by every page
   and mockup. Every colour comes from a token in theme.css (var(--…), color-mix() of tokens, or a
   relative colour from a token); no colour is written here directly. The reasons are in
   design/direction.md, and every component here is shown in every state in design/sheet.html.

   Direction A «Бланк»: the page is one sheet of paper on the desk; a form is a бланк of ruled boxes with
   the label inside; sections part on a double rule; the гриф and the виза are set as on office paper.
   The class names are the classic ones the drawing modules (tsfo/pages/) already write, so a page moves to
   this look by its drawing module alone; a class new here is listed in design/direction.md → Components.
   `.is-hover`, `.is-active`, `.is-focus` stand for a pointer's or the keyboard's state on the sheet only. */

/* ======================================================================= text */
html { background: var(--canvas); }
/* focus never lands under what stays in view (ui/rules.md 10): the page scrolls a focused control clear of the sticky
   top bar, of a group line or a request head stuck under it, and of the sticky actionbar. Each is the tokens that draw
   it, rounded up: the bar one row of --bar-h (two under 1280 px, its tabs under the name); a group line one line in
   its padding (two under 900 px); a waiting request's head (sticky at 1280 px and wider) two lines and its facts; the
   actionbar a button in its padding, its summary on two lines (more under 900 px). --bar-bottom is where whatever
   sticks under the top bar stands: --bar-h on one row; under 1280 px the two-row bar is set to a height of its own,
   --bar-h and --space-5, so a stuck line stands flush under it */
:root { --bar-bottom: var(--bar-h); --sticky-top: calc(var(--bar-bottom) + 1px); --sticky-line: 0px; --sticky-foot: 0px; }
@media (max-width: 1279.98px) {
  :root { --bar-bottom: calc(var(--bar-h) + var(--space-5)); }
  .appbar > .appbar__inner { min-height: calc(var(--bar-bottom) - 1px); }  /* the bar's own edge is the last pixel */
}
:root:has(.group > legend > .check:first-child) { --sticky-line: calc(var(--control-h) + var(--space-2)); }
@media (min-width: 1280px) {
  :root:has(.request:not(.request--done) > .request__head) { --sticky-line: calc(var(--space-8) * 2); }
  /* … three when its form wraps onto a second line (the typed name and its role shown) or a problem stands under it */
  :root:has(.request:not(.request--done) > .request__head > .request__actions :is(select[data-manual] + :not([hidden]), .field__error)) {
    --sticky-line: calc(var(--space-8) * 3);
  }
}
:root:has(.actionbar) { --sticky-foot: calc(var(--space-8) + var(--space-5)); }
@media (max-width: 899.98px) {
  :root:has(.group > legend > .check:first-child) { --sticky-line: calc(var(--control-h) * 2); }
  :root:has(.actionbar) { --sticky-foot: calc(var(--space-8) * 2 + var(--space-3)); }
}
html { scroll-padding: calc(var(--sticky-top) + var(--sticky-line) + var(--space-2)) 0 calc(var(--sticky-foot) + var(--space-2)); }
/* … and of a table's head stuck under the top bar (at 1024 px and wider, see «tables»): a control in a table's rows
   keeps a margin of a head's height above it, three lines of heads in their padding at most, so focus coming back up a
   table (Shift+Tab) never lands under its own head (slice 29's Show 2, N-1) */
@media (min-width: 1024px) {
  .table-wrap > table > tbody :is(a[href], button, input, select, textarea, summary, [tabindex]) { scroll-margin-top: var(--space-8); }
}
body { line-height: var(--leading-normal); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: var(--leading-tight); }
h1 { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-bold); letter-spacing: -0.01em; }
h2 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-bold); }
h3 { font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-bold); }
h4 { font-size: var(--text-sm); font-weight: var(--weight-bold); }
p { margin: 0 0 var(--space-3); max-width: 78ch; }
p:last-child { margin-bottom: 0; }
small { font-size: var(--text-sm); }
strong, b { font-weight: var(--weight-bold); }
.muted { color: var(--ink-2); }
code {
  font-family: var(--font-mono); font-size: 0.82em; color: var(--ink-2);
  overflow-wrap: anywhere; word-break: break-all;           /* a sha256 wraps, never widens the sheet (R-62) */
}
hr { border: 0; border-top: var(--rule-double); margin: var(--space-5) 0; }
::selection { background: var(--accent-soft); color: var(--ink); }

/* links: ink blue, underlined — a link is an «act here» too */
/* in :where(), so a link drawn as a button (.btn) takes the button's look */
:where(a) { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.18em;
  transition: color var(--dur-fast) var(--ease), text-decoration-color var(--dur-fast) var(--ease); }
:where(a):hover, :where(a.is-hover) { color: var(--accent-press); text-decoration-thickness: 2px; }
:where(a):active { color: var(--ink); }

/* focus: the kit's ring, in this system's focus blue; a boxed cell carries it on its own edge (below) */
:focus-visible, .is-focus { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ======================================================================= buttons */
/* secondary is the default: a ruled box on the sheet. Primary is the one ink-blue block of a page. */
:where(button, .btn) {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: 0 var(--space-4);
  font: inherit; font-size: var(--text-sm); font-weight: var(--weight-bold); line-height: 1.1; white-space: nowrap;
  color: var(--ink); background: var(--surface);
  border: var(--rule); border-radius: var(--radius-control);
  text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
:where(button, .btn):hover, :where(button, .btn).is-hover { color: var(--ink); background: var(--band); border-color: var(--ink-2); }
:where(button, .btn):active, :where(button, .btn).is-active { background: var(--line); border-color: var(--ink); }
/* a button's type, outside :where(): base.css's `button { font: inherit }` beat it for a <button>, which read 15 px
   regular beside a link drawn as a button (a.btn) at 13.5 px bold; now one kind reads alike whatever its element (wave
   1's Show, W-1). The kinds below (.btn--primary, .btn--sm, .btn--quiet) still set their own size or weight */
button, .btn { font-size: var(--text-sm); font-weight: var(--weight-bold); line-height: 1.1; }

.btn--primary {
  min-height: calc(var(--control-h) + 8px); padding: 0 var(--space-5);
  font-size: var(--text-md); letter-spacing: 0.01em;
  color: var(--accent-ink); background: var(--accent); border-color: var(--accent);
}
.btn--primary:hover, .btn--primary.is-hover { color: var(--accent-ink); background: color-mix(in oklch, var(--accent) 82%, var(--ink)); border-color: color-mix(in oklch, var(--accent) 82%, var(--ink)); }
.btn--primary:active, .btn--primary.is-active { color: var(--accent-ink); background: var(--accent-press); border-color: var(--accent-press); }

.btn--danger { color: var(--bad); background: var(--surface); border-color: var(--bad); }
.btn--danger:hover, .btn--danger.is-hover { color: var(--surface); background: var(--bad); border-color: var(--bad); }
.btn--danger:active, .btn--danger.is-active { color: var(--surface); background: color-mix(in oklch, var(--bad) 80%, var(--ink)); }

.btn--quiet {
  min-height: 0; padding: var(--space-1) var(--space-1); font-weight: var(--weight-regular);
  color: var(--ink-2); background: transparent; border-color: transparent;
  text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px;
}
.btn--quiet:hover, .btn--quiet.is-hover { color: var(--ink); background: transparent; border-color: transparent; text-decoration-color: var(--ink); }
.btn--quiet:active, .btn--quiet.is-active { background: transparent; border-color: transparent; }

.btn--sm { min-height: 28px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn--quiet.btn--sm { min-height: 0; padding: var(--space-1); }

/* one primary a page: on an empty list its own button is the step, so the page head's primary is drawn plain */
main:has(> .empty) .page-head__actions .btn--primary {
  min-height: var(--control-h); padding: 0 var(--space-4); font-size: var(--text-sm); letter-spacing: normal;
  color: var(--ink); background: var(--surface); border-color: var(--line-strong);
}
main:has(> .empty) .page-head__actions .btn--primary:hover { color: var(--ink); background: var(--band); border-color: var(--ink-2); }
main:has(> .empty) .page-head__actions .btn--primary:active { background: var(--line); border-color: var(--ink); }

/* disabled: the box stays, the ink goes grey; a disabled link-button in the pager too */
button:disabled, button:disabled:hover, .btn[disabled], .btn[aria-disabled="true"] {
  color: var(--ink-3); background: var(--none-soft); border-color: var(--line-strong); cursor: not-allowed;
}
.btn--quiet:disabled { background: transparent; border-color: transparent; }

/* busy: the label stays; the box turns to the soft accent with a still bar along its foot — nothing spins
   (still paper); the words of what is happening stand beside it in .actionbar__busy.
   One look for three hooks the pages already carry: aria-busy; a form the one-press script has sent
   (form[data-sent], S-2: every submit button disables on its first press — it reads as busy, not as unavailable);
   and a button beside a busy line («Читаю файл…»). */
button[aria-busy="true"], .btn[aria-busy="true"],
form[data-sent] button:disabled, form[data-sent] button:disabled:hover,
.actionbar__busy:not(:empty) + button:disabled {
  position: relative; color: var(--accent); background: var(--accent-soft); border-color: var(--accent); cursor: progress;
}
button[aria-busy="true"]::after, .btn[aria-busy="true"]::after,
form[data-sent] button:disabled::after,
.actionbar__busy:not(:empty) + button:disabled::after {
  content: ""; position: absolute; left: -1px; right: -1px; bottom: -1px; height: 3px; background: var(--accent);
}
form[data-sent] .btn--quiet:disabled { background: transparent; border-color: transparent; }
form[data-sent] .btn--quiet:disabled::after { display: none; }

/* ======================================================================= the frame */
/* the top bar sits on the desk above the sheet, sticky; one row at 1280 px and wider */
.appbar {
  position: sticky; top: 0; z-index: var(--z-bar);
  background: var(--canvas); border-bottom: 1px solid var(--sheet-edge);
}
.appbar__inner {
  display: grid; grid-template-columns: auto auto 1fr auto; grid-template-areas: "name nav master user";
  align-items: stretch; column-gap: var(--space-5);
  width: min(100% - 2 * var(--page-gutter), var(--page-max)); min-height: var(--bar-h); margin: 0 auto;
}
@media (max-width: 1279.98px) {
  .appbar__inner { grid-template-columns: auto 1fr auto; grid-template-areas: "name master user" "nav nav nav"; column-gap: var(--space-4); }
  .appbar__nav { margin-left: calc(-1 * var(--space-3)); }
}
.appbar__name {
  grid-area: name; align-self: center; white-space: nowrap; text-decoration: none;
  font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-md); color: var(--ink-2);
}
.appbar__name:hover { color: var(--ink); }
.appbar__nav { grid-area: nav; display: flex; flex-wrap: wrap; align-items: stretch; }
.appbar__nav a {
  display: flex; align-items: center; padding: var(--space-2) var(--space-3); white-space: nowrap;
  font-size: var(--text-md); color: var(--ink-2); text-decoration: none;
  border-top: 3px solid transparent; border-bottom: 3px solid transparent;
  transition: color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.appbar__nav a:hover, .appbar__nav a.is-hover { color: var(--ink); border-bottom-color: var(--line-strong); }
.appbar__nav a[aria-current="page"] { color: var(--ink); font-weight: var(--weight-bold); border-bottom-color: var(--ink); }
/* R-116 (slice 51): a closed part's tab stays in its place, greyed, no address; a link's box, so opening it shifts nothing.
   W-0212b-1: a lot lighter than an open tab, still slightly visible — the quiet ink mixed into the bar's own desk,
   about 1.8 : 1 against it (open tabs keep --ink-2, 6.7 : 1) */
.appbar__nav span[aria-disabled="true"] {
  display: flex; align-items: center; padding: var(--space-2) var(--space-3); white-space: nowrap;
  font-size: var(--text-md); color: color-mix(in oklch, var(--ink-3) 40%, var(--canvas)); cursor: not-allowed;
  border-top: 3px solid transparent; border-bottom: 3px solid transparent;
}
/* «ЦФО от …»: second after the tabs — a small ruled cell, the master the whole system reads */
.appbar__master {
  grid-area: master; justify-self: end; align-self: center; white-space: nowrap;
  font-size: var(--text-sm); color: var(--ink);
  padding: 3px var(--space-2); background: var(--surface); border: var(--rule);
}
/* R-63: the stale mark beside «ЦФО от …» at 1280 px and wider, so the bar keeps one row; stacked under it below */
.appbar__stale { display: inline-flex; flex-wrap: wrap; align-items: baseline; justify-content: flex-end; column-gap: var(--space-2); line-height: 1.12; }
/* with the mark, its link and the calendar note stacked inside the cell (Азиля's queue at 1280 px), the cell is set
   tighter so three lines keep the bar at its one row of --bar-h */
.appbar__master:has(.appbar__stale) { padding-top: 1px; padding-bottom: 1px; }
.appbar__stale .status { font-size: var(--text-sm); }
/* D-139 (a): the calendar's note under the mark, as wide as what stands above it, widening nothing */
.appbar__stale .appbar__note { flex-basis: 100%; width: 0; min-width: 100%; white-space: normal; text-align: right; font-size: var(--text-xs); color: var(--ink-2); }
.appbar__stale a { font-size: var(--text-sm); }
@media (max-width: 1279.98px) {
  .appbar__stale { flex-direction: column; align-items: flex-end; }
}
.appbar__user {
  grid-area: user; align-self: center; display: flex; align-items: center; gap: var(--space-3);
  font-size: var(--text-sm); color: var(--ink-2); white-space: nowrap;
}
.appbar__user form { margin: 0; }
/* a long typed name (Show 1 of slice 28, S-2): the user's cell wraps inside itself, the whole name kept, before the
   tabs would wrap; at 1280 px and wider the tabs never wrap, so the bar keeps its one row (design-feedback 27.10.2026) */
.appbar__who { min-width: 0; white-space: normal; text-wrap: balance; text-align: right; line-height: 1.25; }
@media (min-width: 1280px) { .appbar__nav { flex-wrap: nowrap; } }

/* ======================================================================= the sheet */
/* every working page is one sheet of paper on the desk */
.page {
  width: min(100% - 2 * var(--page-gutter), var(--page-max)); margin: var(--space-5) auto var(--space-8);
  padding: 36px var(--page-pad) var(--space-7);
  background: var(--surface); border: 1px solid var(--sheet-edge); border-radius: var(--radius-sheet);
  box-shadow: var(--sheet-shadow);
}
@media (max-width: 1179.98px) { .page { padding-left: var(--page-pad-narrow); padding-right: var(--page-pad-narrow); } }
/* a page of one form: a narrow бланк centred on the desk («Изменение статуса», the list) */
.page--centred { width: min(100% - 2 * var(--page-gutter), calc(var(--space-8) * 9 + var(--page-pad) * 2)); }
.page--centred .page-head { justify-content: flex-start; }
.print-master { display: none; }

.stack > * + * { margin-top: var(--space-4); }

/* the document's head: the title at left, the гриф or the actions at right, a double rule under it */
.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3) var(--space-6);
  padding-bottom: var(--space-5); margin-bottom: var(--space-5); border-bottom: var(--rule-double);
}
.page-head h1 { flex: 1 1 auto; min-width: 0; }
.page-head__meta { align-self: flex-end; font-size: var(--text-sm); color: var(--ink-2); }
.page-head__actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--space-2); align-self: flex-end; }
/* with a гриф or a visa: the title, then its meta line and its actions, at left; the гриф or the visa across those
   rows at right («Изменение статуса», «Заявка №n», «ДМЦ №n» — one head) */
.page-head:has(> .grif, > .visa) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; row-gap: var(--space-2); }
.page-head:has(> .grif, > .visa) > h1 { grid-column: 1; grid-row: 1; }
.page-head:has(> .grif, > .visa) > .grif, .page-head:has(> .grif, > .visa) > .visa { grid-column: 2; grid-row: 1 / span 2; }
.page-head:has(> .grif, > .visa) > .page-head__meta,
.page-head:has(> .grif, > .visa) > .page-head__actions { grid-column: 1; margin-left: 0; align-self: start; }
/* under 1000 px the head cannot hold the title beside its гриф or visa (a typed name of 40 characters ran the found
   page's title under the гриф at 640 px and covered «Изменить список»; «Заявка №n»'s title spilled beside the visa at
   560; at 900 the title broke onto two lines beside a гриф of 420 px, which leaves it room from about 940): it stacks,
   the title, its meta line, the гриф or the visa at its own width, then the actions (wave 1's Show, W-2; the
   whole-system Show, W-6). On the screen only: the printed page (about 718 px) keeps the office document's head, the
   гриф or the visa at the title's right (the whole-system Show, W-1) */
@media screen and (max-width: 999.98px) {
  .page-head:has(> .grif, > .visa) { display: flex; flex-direction: column; align-items: flex-start; }
  .page-head:has(> .grif, > .visa) > h1 { align-self: stretch; }
  .page-head:has(> .grif, > .visa) > .page-head__meta { order: 1; align-self: start; }
  .page-head:has(> .grif, > .visa) > .grif, .page-head:has(> .grif, > .visa) > .visa { order: 2; margin-left: 0; max-width: 100%; }
  .page-head:has(> .grif, > .visa) > .page-head__actions { order: 3; }
}
.page-head + .facts { border-top: 0; padding-top: 0; margin-bottom: var(--space-5); }

/* sections inside the sheet */
.section-title { display: flex; align-items: baseline; gap: var(--space-3); margin: var(--space-6) 0 var(--space-3); }
.section-title h2 { font-size: var(--text-xl); }
.section-title .muted { font-size: var(--text-md); font-variant-numeric: tabular-nums; }
.section-title--rule { padding-top: var(--space-5); border-top: var(--rule-double); }

/* a ruled block inside the sheet (a form box, an upload): rules, never a card */
.panel { padding: var(--space-4) var(--space-5); border: var(--rule); background: var(--surface); }
.panel > :last-child { margin-bottom: 0; }
/* the narrow sheet's own form (the list, «Изменение статуса») is the sheet's content, not a card inside it: it keeps
   the class panel, which a reader of the page finds it by, without its rule, padding or ground */
.page--centred > form.panel { padding: 0; border: 0; background: none; }
/* a panel's form on one line («Отозвать ДМЦ»: «Кто отзывает», its «Фамилия Имя», the button): its controls side by
   side, wrapping, each as wide as its words (a list its longest name, the typed box 40 characters: see «fields»);
   they were an inline flex and inline widths, a 256 px list that cut a long name (the whole-system Show, W-5) */
.panel__form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
/* a page's fallback forms as one block («ДМЦ №n»'s two panels): the section's gap between it and the facts line
   after it (a form refused at its fields, drawn first) or the lines before it (W-5: they were inline margins) */
.panels { margin-bottom: var(--space-5); }
.table-wrap + .panels { margin: var(--space-5) 0 0; }
/* a quiet note: a panel's «Только если …», a table's «Внизу второго листа …» — the quiet size; under a table, close
   to it (W-5: they were inline sizes and a margin) */
.note { font-size: var(--text-sm); }
.table-wrap + .note { margin-top: var(--space-2); }
/* «Заявка №n · Договор»'s line right under its places («внесено: …», «ещё не внесено в ЦФО»): a fact of the request, so
   the gap a note under a table has, not flush on the table's last rule; on screen and on paper (the re-check Show, F-3) */
.table-wrap:has(> table.dogovor-places) + p { margin-top: var(--space-2); }

/* ======================================================================= the гриф and the виза */
/* the гриф: the corner block of a document's head, as «СОГЛАСОВАНО» sits on office paper */
.grif { margin: 0 0 0 auto; min-width: var(--grif-min); max-width: 420px; border: var(--rule); display: grid; }
.grif > * { padding: var(--space-2) 14px; }
.grif > * + * { border-top: var(--rule); }
.grif__label { display: block; font-size: var(--text-xs); color: var(--ink-2); }
.grif__name {
  display: block; padding-bottom: 6px; border-bottom: var(--rule-ink);
  font-family: var(--font-display); font-size: var(--text-name); font-weight: var(--weight-bold); color: var(--ink); line-height: 1.2;
}
.grif__line { font-size: var(--text-sm); color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* the виза: who signs (waiting) or who signed (given) — a ruled box with a name on a signature line */
.visa { margin: 0 0 0 auto; min-width: var(--visa-min); max-width: 440px; border: 1px solid var(--ink-2); background: var(--surface); }
.visa > div { padding: var(--space-2) 14px 10px; display: grid; gap: 1px; }
.visa > div + div { border-top: var(--rule); }
.visa dt { font-size: var(--text-xs); color: var(--ink-2); }
.visa dt::after { content: ":"; }
.visa dd { margin: 0; font-size: var(--text-md); color: var(--ink); }
.visa__sign dd, .visa__name {
  font-family: var(--font-display); font-size: var(--text-visa); font-weight: var(--weight-bold); line-height: 1.15; color: var(--ink);
}
.visa__sign dd { padding-bottom: 6px; border-bottom: var(--rule-ink); }
/* waiting: the line under the role is empty and long — the place a name will go */
.visa--waiting .visa__sign dd { padding-bottom: 22px; }
/* given: the name signs the line, the role and the date stand after it, smaller */
.visa--given { border-color: var(--ok); }
.visa--given .visa__sign dt { color: var(--ok); font-weight: var(--weight-bold); }
.visa__role, .visa__date { font-family: var(--font-body); font-size: var(--text-md); font-weight: var(--weight-regular); color: var(--ink-2); }
/* the words before the name on a given visa («согласовано:», «принято в работу:»), small above the name as a
   signature's label; the visa's own «состояние» is then visually hidden (slice 28, pile II-6: the words stay today's) */
.visa__label { display: block; font-family: var(--font-body); font-size: var(--text-xs); font-weight: var(--weight-regular); line-height: 1.25; color: var(--ink-2); }
.visa--given .visa__label { color: var(--ok); font-weight: var(--weight-bold); }
.visa .status { font-family: var(--font-body); display: flex; margin-top: var(--space-1); font-size: var(--text-sm); }
/* a visa whose line carries words before and after the name («принято в работу:» … «(руководитель ТО), 21.10.2026 ·
   по письму, отметил …», «ДМЦ №n»): the words above the line and below it, the name alone on it */
.visa__sign dd > .visa__role:first-child, .visa__sign dd > .visa__role:last-child { display: block; }
/* the compact visa beside a request's h3 in a list («согласует: ЗамОД» as a chip, R-48) */
.visa--chip { display: inline-flex; min-width: 0; margin: 0; border-color: var(--line-strong); vertical-align: middle; }
.visa--chip > div { display: flex; gap: var(--space-1); align-items: baseline; padding: 2px var(--space-2); }
.visa--chip dd { font-family: var(--font-display); font-weight: var(--weight-bold); font-size: var(--text-md); padding: 0; border: 0; }
/* the one orchestrated moment: on the confirmation that gives it, the visa settles onto the sheet, once. Every
   confirmation stands above the page head, so the giving one is marked (.notice--gives-visa: «Заявка №n» right after
   «Отправить заявку») and no other confirmation lands a visa (Show 2 of slice 28). Where the confirmation is drawn
   outside the page function that draws the visa («ДМЦ №n» after «принято в работу»), the mark sits on the visa itself
   (.visa--land). base.css stills it with motion off */
.notice--gives-visa ~ .page-head > .visa--waiting, .notice--gives-visa ~ .page-head > .visa--given, .visa--land { animation: visa-land var(--dur-visa) var(--ease) 1 both; transform-origin: 70% 30%; }
@keyframes visa-land { from { transform: scale(var(--visa-from)); opacity: 0.4; } to { transform: scale(1); opacity: 1; } }

/* ======================================================================= facts */
/* one ruled line of facts: label, then value; the key fact larger, a quiet one regular */
.facts {
  display: flex; flex-wrap: wrap; align-items: baseline; margin: 0;
  border-top: var(--rule); border-bottom: var(--rule); padding: var(--space-2) 0;
  font-size: var(--text-sm);
}
/* the parts' hairline: every part carries it on its start edge and the parts sit shifted back by its width and
   padding, so the line clips (overflow-x: clip, at its padding edge) the hairline of whichever part opens a line, the
   first or one a wrap brought down: no line starts with a divider or an indent (Show 2 of slice 28, N-1). The block
   line (.asked__head) parts its parts the same way. */
.facts, .asked__head { --part-pad: var(--space-4); --part-back: calc(-1 * (var(--part-pad) + 1px)); overflow-x: clip; }
.facts > div { display: flex; align-items: baseline; gap: var(--space-1); padding: 2px var(--part-pad); border-left: var(--rule-hair); position: relative; inset-inline-start: var(--part-back); }
/* a fact's label never wraps beside a long value; the value wraps */
.facts dt { color: var(--ink-2); white-space: nowrap; flex: none; }
.facts dt::after { content: ":"; }
.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--ink); font-size: var(--text-md); font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.facts .fact--key dd { font-size: var(--text-figure); line-height: 1; }
.facts .fact--key dt { color: var(--ink); }
.facts .fact--quiet dd { font-weight: var(--weight-regular); color: var(--ink-2); }
.facts .status { font-size: var(--text-sm); }
/* a facts line that leads a sheet's body before its lines («ДМЦ прочитан»'s header, «ДМЦ №n»'s facts): the section's
   gap under it wherever it stands, as under the page head (W-5: an inline margin) */
.facts--lead { margin-bottom: var(--space-5); }
/* facts inside a head band (a request in a list): no rules of their own, the band is the line */
.request__head .facts, .page-head .facts { border: 0; padding: 0; }
/* a fact's note: the hint that explains one fact stands under its value, small and quiet («шапка ЦФО», D-103) */
.fact__note { display: block; max-width: 40ch; margin-top: 2px; font-size: var(--text-xs); line-height: 1.35; font-weight: var(--weight-regular); color: var(--ink-2); }
/* … drawn right after the facts line, outside the dd, which holds its one value (slice 28, pile II-20) */
p.fact__note { max-width: 78ch; margin: var(--space-2) 0 var(--space-3); font-size: var(--text-sm); }
/* the status line: the one fact a page is about («История»: the current status), on its own line above the other
   facts, set as a section title */
.facts--status { border-bottom: 0; padding-bottom: var(--space-1); }
.facts--status + .facts { border-top: var(--rule-hair); }
.facts--status .fact--key dd { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.2; }

/* ======================================================================= status */
/* the shape: the word, its symbol before it, set in bold; inside a table cell, a ruled chip.
   Colour and symbol per data-state come from base.css. A family is a class from the text already in the cell. */
.status { display: inline-flex; align-items: baseline; gap: 0; font-weight: var(--weight-bold); white-space: nowrap; }
td .status, .status--chip {
  max-width: 100%; white-space: normal;      /* a long status wraps in its cell, never widening the table */
  padding: 1px 7px 1px 6px; font-size: var(--text-sm); line-height: 1.35;
  border: 1px solid currentColor; border-radius: var(--radius-control); background: var(--surface);
}
td .status[data-state="warn"], .status--chip[data-state="warn"] { background: var(--warn-soft); }
td .status[data-state="ok"], .status--chip[data-state="ok"] { background: var(--ok-soft); }
td .status[data-state="bad"], .status--chip[data-state="bad"] { background: var(--bad-soft); }
/* the four families of a request's or a ДМЦ's «состояние» (designer brief, «Across all pages»). A family is a known
   state, never «no data» (ui/rules.md 7: base.css's dash is a status with no data-state): each has its own mark, word
   and colour together — waits an empty circle (the step not yet taken), with менеджер ЦФО an arrow (handed on), done
   the tick, withdrawn a struck circle (slice 32's Show).
   One chip for every family wherever it is drawn — a table's cell, a facts line, the visa, a block's head: a ruled
   1 px square box, its mark and words at the quiet size and regular, so none weighs more than another (the
   whole-system Show, W-3: waits was a dashed chip in tables and plain ○ text in facts and the visa, done bold with no
   box, → boxed and bold with an ink edge, the heaviest thing in «Журнал заявок»). A family keeps its mark whatever
   data-state it carries: «ждёт принятия» (waits, warn) reads ○ in the amber the direction gives it (Colour), on the
   amber soft, its box amber */
.status:is(.status--waits, .status--cfo, .status--done, .status--off) {
  display: inline-flex; max-width: 100%; white-space: normal;
  padding: 1px 7px 1px 6px; font-size: var(--text-sm); font-weight: var(--weight-regular); line-height: 1.35;
  border: var(--rule); border-radius: var(--radius-control); background: var(--surface); box-shadow: none;
}
.status:is(.status--waits, .status--cfo, .status--done, .status--off)[data-state="warn"] { border-color: var(--warn); background: var(--warn-soft); }
.status--waits { color: var(--ink-2); }
.status.status--waits::before { content: "○"; }
.status--cfo { color: var(--ink); }
.status--cfo::before { content: "→"; color: var(--ink-2); }
.status--done { color: var(--ok); }
.status--done::before { content: "✓"; }
.status--off { color: var(--none); }
.status--off::before { content: "⊘"; }
.status::before { margin-inline-end: 0.35em; }
/* a status standing for a number («нет даты» in «Дней», D-99 (a)): grey words in place of the figure, no chip, on one
   line as a figure is, however short of room its table (slice 34's ask: it broke into «нет / даты») */
td.num .status { padding: 0; border: 0; background: transparent; font-weight: var(--weight-regular); white-space: nowrap; }

/* ======================================================================= marks */
/* a guard's note in its own cell: amber, with a small «!» square; wraps, unlike .status */
.mark { display: block; color: var(--warn); font-weight: var(--weight-bold); font-size: var(--text-sm); line-height: 1.35; }
.mark::before {
  content: "!"; display: inline-block; width: 1.15em; margin-right: 5px; text-align: center;
  color: var(--surface); background: var(--warn); border-radius: var(--radius-mark); font-size: var(--text-xs); line-height: 1.4;
}
.mark + .mark { margin-top: 3px; }
.mark--none { color: var(--ink-2); font-weight: var(--weight-regular); }
.mark--none::before { content: ""; display: none; }
/* «Отметка о заявке» with many lines: three shown, the rest folded in the cell (D-160 (a) keeps every line) */
.mark-fold > summary { list-style: none; cursor: pointer; margin-top: 3px; }
.mark-fold > summary::-webkit-details-marker { display: none; }
.mark-fold > summary .mark { display: inline; }
.mark-fold > summary::after { content: " ▸"; color: var(--ink-2); }
.mark-fold[open] > summary::after { content: " ▾"; }
.mark-fold > .mark { margin-top: 3px; }
/* the ДМЦ's lines: the row's amber tint and edge already flag it, so its «Отметка» reads in quiet ink (the «!» stays) */
.dmc-lines td.cell-mark .mark { color: var(--ink-2); font-weight: var(--weight-regular); }

/* an action list: things to do, not a refusal («ДМЦ на демонтаж: гиперссылки уже нет в ЦФО», D-152) — each line ruled,
   with an amber edge (needs a look), the hyperlink strong and what to do after it */
.action-list { list-style: none; margin: 0 0 var(--space-3); padding: 0; border-top: var(--rule-hair); }
.action-list li { padding: 7px var(--space-3) var(--space-2); border-bottom: var(--rule-hair); box-shadow: inset 3px 0 0 var(--warn); font-size: var(--text-row); color: var(--ink); }
.action-list li strong { font-variant-numeric: tabular-nums; }

/* ======================================================================= notices */
/* a notice says what happened: a ruled box, a 3px rule of its state along the top; a refusal's or a warning's lead
   in bold */
.notice {
  margin: 0 0 var(--space-5); padding: var(--space-3) var(--space-4) 13px;
  font-size: var(--text-md); color: var(--ink);
  background: var(--none-soft); border: 1px solid var(--none); box-shadow: inset 0 3px 0 var(--none);
  border-radius: 0;
  overflow-wrap: anywhere;   /* a refusal repeats what was typed: a long unbroken string breaks inside the box */
}
/* the state's symbol leads the notice, in the state's colour; a refusal's or a warning's lead (its first <strong>)
   takes the colour too */
.notice::before { content: "–"; margin-right: var(--space-2); font-weight: var(--weight-bold); color: var(--none); }
.notice[data-state="ok"] { background: var(--ok-soft); border-color: var(--ok); box-shadow: inset 0 3px 0 var(--ok); }
.notice[data-state="ok"]::before { content: "✓"; color: var(--ok); }
/* a confirmation reads as one plain statement, its ✓ and its green rule saying it is done: a lead its markup carries
   («Заявка №n отправлена на согласование.», the «Отказ» one whole) reads as its text, as the six plain ones do (wave
   1's Show, W-4) */
.notice[data-state="ok"] > strong:first-child { font-weight: inherit; color: inherit; }
.notice[data-state="warn"] { background: var(--warn-soft); border-color: var(--warn); box-shadow: inset 0 3px 0 var(--warn); }
.notice[data-state="warn"]::before { content: "!"; color: var(--warn); }
.notice[data-state="warn"] > strong:first-child { color: var(--warn); }
.notice[data-state="bad"] { background: var(--bad-soft); border-color: var(--bad); box-shadow: inset 0 3px 0 var(--bad); }
.notice[data-state="bad"]::before { content: "✕"; color: var(--bad); }
.notice[data-state="bad"] > strong:first-child { color: var(--bad); }
/* a notice arrives: opacity only, once */
main .notice { animation: notice-in var(--dur-base) var(--ease) 1 both; }
@keyframes notice-in { from { opacity: 0; } to { opacity: 1; } }
/* the restored draft (inserted by the page's script with data-draft; restyled by selector, never in the script):
   a quiet pencil line, not an event */
.notice[data-draft] {
  display: inline-block; padding: var(--space-1) var(--space-3); font-size: var(--text-sm); color: var(--ok);
  background: var(--surface); border: 1px dashed var(--ok); box-shadow: none; animation: none;
}
.notice[data-draft]::before { margin-right: var(--space-2); }

/* the refusal: lead in bold, then one problem per line, the «kept» line last */
.errors { list-style: none; margin: var(--space-2) 0 0; padding: 0; border-top: 1px solid color-mix(in oklch, var(--bad) 35%, var(--bad-soft)); }
.errors li { padding: 7px 0 var(--space-2); border-bottom: 1px solid color-mix(in oklch, var(--bad) 18%, var(--bad-soft)); font-size: var(--text-row); }
.errors__field { font-weight: var(--weight-bold); }
.errors__links { color: var(--ink-2); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.notice__kept { margin: var(--space-2) 0 0; font-size: var(--text-sm); color: var(--ink-2); }
/* a refusal with no lead (every problem one per line, «ДМЦ» unread): the ✕ stands beside the list */
.notice:has(> .errors:first-child) { display: flex; gap: var(--space-2); align-items: baseline; }
.notice:has(> .errors:first-child) > .errors { flex: 1; margin-top: 0; border-top: 0; }
.notice:has(> .errors:first-child) > .errors li:first-child { padding-top: 0; }
.notice:has(> .errors:first-child) > .errors li:last-child { border-bottom: 0; padding-bottom: 0; }

/* ======================================================================= fields: the бланк */
/* a field is a ruled box: the label set small inside its top, the control borderless under it */
label { color: var(--ink-2); }
.field {
  position: relative; display: flex; flex-direction: column; min-width: 0; margin: 0 0 var(--space-4);
  background: var(--surface); border: var(--rule);
  transition: background-color var(--dur-fast) var(--ease);
}
.field > label, .field__label {
  display: block; padding: var(--cell-pad-top) var(--cell-pad-x) 0;
  font-size: var(--text-xs); line-height: 1.25; font-weight: var(--weight-regular); color: var(--ink-2);
}
.field:hover, .field.is-hover { background: var(--hover); }
/* a list box's label is the page's one question («Гиперссылки или номера мониторов …»): read at the quiet size in ink,
   its example part (.label-aside, the label's own words split by a span) in quiet ink */
.field:has(> textarea) > label { font-size: var(--text-sm); color: var(--ink); }
.label-aside { color: var(--ink-2); }
/* a box filled from ЦФО («Адрес», «Описание места монтажа»): quiet on the band, so the boxes still to type stand out
   white; under the pointer or in focus an ordinary box again. Once its value is changed it carries «было в ДМЦ: …»
   (.field__was: the server draws it on a refused form, the page's script adds it live) and is an ordinary box, the
   change in ink on the sheet: every held rule holds only while the box has no such line (:where keeps the weights) */
.field--held:where(:not(:has(> .field__was))) { background: var(--band); }
.field--held:where(:not(:has(> .field__was))) > input { color: var(--ink-2); }
.field--held:where(:not(:has(> .field__was))):is(:hover, .is-hover, :focus-within, .is-focus) { background: var(--surface); }
.field--held:where(:not(:has(> .field__was))):is(:focus-within, .is-focus) > input { color: var(--ink); }
/* a box standing alone above a table («Кто подаёт», D-132 (a)): as wide as its names need, the longest whole, never
   wider than its row; not a grid row */
.field--alone { inline-size: max-content; max-inline-size: 100%; }
.field:has(> input:focus-visible, > select:focus-visible, > textarea:focus-visible, > .period :focus-visible), .field.is-focus {
  outline: 2px solid var(--focus); outline-offset: -2px; z-index: 1;
}
.req { color: var(--ink-3); font-weight: var(--weight-regular); margin-left: 2px; text-decoration: none; }

/* the controls inside a box: no box of their own */
input:where(:not([type]), [type="text"], [type="password"], [type="search"], [type="number"], [type="email"], [type="tel"], [type="url"], [type="date"]),
select, textarea {
  width: 100%; min-height: var(--cell-control-h); padding: 3px var(--cell-pad-x) 9px;
  font: inherit; font-size: var(--text-md); color: var(--ink);
  background: transparent; border: 0; border-radius: 0;
}
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: none; }
textarea { min-height: 260px; resize: vertical; line-height: var(--leading-normal); font-variant-numeric: tabular-nums; }
textarea[rows] { min-height: auto; } /* a box that states its rows keeps them (critique C1-1 of slice 41: «Замечания», rows="3") */
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 1; }
input.date { min-width: 11ch; font-variant-numeric: tabular-nums; }
/* a select: square, with its chevron drawn by two token-coloured strokes */
select {
  appearance: none; cursor: pointer; padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
/* a list's whole box opens it (W-0212-1, the owner's walk of 02.12.2026: «the user can't click near the edge of the
   box and get the dropdown»): on screen the select reaches up under its label to the box's top edge, by the label
   strip's height (--field-strip: its top padding and one line of the small label), taken back as top padding so the
   chosen value, the chevron and the box stay where they were; the label lets the pointer through to it and stays drawn
   above it (positioned, with no z-index of its own: a stacking context of its own would redraw its text's edge pixels). The label's «for» still names the select, and the focus ring is the box's own, as before. A disabled list
   opens nothing and keeps its old box (the browser draws it at 0.7 opacity, a layer whose origin is the select's top:
   moved, its chevron's edge pixels would differ). Print keeps its own paddings (@media print below) */
@media screen {
  .field:has(> select) { --field-strip: calc(var(--cell-pad-top) + var(--text-xs) * 1.25); }
  .field:has(> select) > label { position: relative; pointer-events: none; }  /* positioned: painted after the list */
  .field > label + select:enabled {
    --chevron-y: calc(var(--field-strip) + (3px + 9px + 1lh - 5px) / 2);  /* where 50% put it: the middle of one line */
    margin-top: calc(-1 * var(--field-strip)); padding-top: calc(3px + var(--field-strip));
    min-height: calc(var(--cell-control-h) + var(--field-strip)); align-items: flex-start;
    background-position: calc(100% - 17px) var(--chevron-y), calc(100% - 12px) var(--chevron-y);
  }
  /* … and down to the box's bottom edge when a neighbour in its row makes the box taller and no line stands under it */
  .field > label + select:enabled:last-child { flex-grow: 1; }
  .fields--aligned > .field > label + select:enabled:last-child { grid-row: span 3; }  /* «Установлено»'s rows */
}
/* a control standing alone (a filter's «Показать» row, a request's «кто согласует»): its own ruled box */
:not(.field) > select,
:not(.field) > input:where(:not([type]), [type="text"], [type="password"], [type="search"], [type="number"], [type="email"], [type="tel"], [type="url"], [type="date"]),
:not(.field) > textarea {
  width: auto; min-height: var(--control-h); padding-top: 0; padding-bottom: 0;
  background-color: var(--surface); border: var(--rule); border-radius: var(--radius-control);
}
:not(.field) > select:hover, :not(.field) > input:hover, :not(.field) > textarea:hover { border-color: var(--ink-2); }
/* the typed «Фамилия Имя» a «Кто …» list opens (select[data-manual]), standing alone beside it («Согласование
   статусов», «Отозвать ДМЦ»): room for a name of 40 characters (R-32 allows any length; 40ch, the figure's width, holds
   a Cyrillic name of 40), never wider than its row, where it may take the row. min- so a width a page still writes
   inline gives way (slice 32's ask 3: it stood about 20 characters wide and a long name scrolled inside it) */
:not(.field) > select[data-manual] + * > input:where(:not([type]), [type="text"]) {
  min-inline-size: min(100%, calc(40ch + 2 * var(--cell-pad-x) + 2px));
}
/* refused, a control standing alone gets the refused frame a box gets: red, tinted, 2px */
:not(.field) > select[aria-invalid="true"], :not(.field) > input[aria-invalid="true"], :not(.field) > textarea[aria-invalid="true"],
:not(.field) > select.is-refused, :not(.field) > input.is-refused {
  border-color: var(--bad); background-color: var(--bad-soft); box-shadow: inset 0 0 0 1px var(--bad);
}
/* disabled: the box goes grey, the value stays readable */
.field:has(:disabled), .field.is-disabled { background: var(--none-soft); }
input:disabled, select:disabled, textarea:disabled { color: var(--ink-2); cursor: not-allowed; }
.field:has(:disabled) > label { color: var(--ink-3); }
/* a hint, «было в ДМЦ: …», an error: inside the box, under the control */
.field__hint { margin: 0; padding: 0 var(--cell-pad-x) var(--space-2); font-size: var(--text-sm); color: var(--ink-2); max-width: none; }
.field__was { margin: 0; padding: 0 var(--cell-pad-x) 6px; font-size: var(--text-sm); color: var(--ink-2); }
.field__was::before { content: "было в ДМЦ: "; color: var(--ink-3); }
.field__error { margin: 0; padding: 0 var(--cell-pad-x) var(--space-2); font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--bad); max-width: none; }
.field__error::before { content: "✕"; margin-right: 6px; font-weight: var(--weight-regular); }
/* refused: the box framed in red, tinted, the problem alone under the control */
.field:has(> [aria-invalid="true"], > .period [aria-invalid="true"]), .field.is-refused {
  background: var(--bad-soft); outline: 2px solid var(--bad); outline-offset: -2px; z-index: 1;
}
.period .field:has([aria-invalid="true"]) { outline: 0; background: transparent; }

/* checkbox and radio: the system's ink blue */
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); vertical-align: -3px; cursor: pointer; }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { cursor: not-allowed; }
.check { display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--text-md); color: var(--ink); cursor: pointer; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; }

/* ---------- the grids of boxes: adjacent boxes share their rules ---------- */
.fields {
  display: grid; gap: 1px; margin: 0 0 var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--space-8) * 3), 1fr));
  background: var(--line-strong); border: var(--rule);
}
.fields > * { background: var(--surface); }
.fields > .field { margin: 0; border: 0; }
/* a grid set off by the section's gap from the table above it in one form («Договор»'s paste box under its places;
   W-5: an inline margin) */
.fields--apart { margin-top: var(--space-5); }
/* a box filled from ЦФО keeps its band inside a grid too (the white above would cover it), and is an ordinary box
   again under the pointer or in focus, or once changed */
.fields > .field--held:where(:not(:has(> .field__was))) { background: var(--band); }
.fields > .field--held:where(:not(:has(> .field__was))):is(:hover, .is-hover, :focus-within, .is-focus) { background: var(--surface); }
/* D-57 (a), D-62 (a): four columns, each row filling the box —
   1 status · reason (two) · comment; 2 «с» · «по» (two) · where (two); 3 what to do, across */
.fields--grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fields .field--wide { grid-column: span 2; }
.fields .field--full { grid-column: 1 / -1; }
/* a note across the grid, after its first row: the «Stop-лист» hint (R-10, D-84 (a)), the «Отказ» note (R-58) */
.fields__note { grid-column: 1 / -1; margin: 0; padding: var(--space-2) var(--cell-pad-x); font-size: var(--text-sm); color: var(--ink); max-width: none; }
.fields__note[data-hint="stop"] { background: var(--band); box-shadow: inset 3px 0 0 var(--ink-2); }
.fields__note[data-note="otkaz"] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); color: var(--ink); font-size: var(--text-md); padding-top: var(--space-3); padding-bottom: var(--space-3); }
/* «Отказ» (R-58): only the target and its free reason are asked; the reason takes the rest of the row, by the hook
   the page already carries, so the hidden boxes leave no empty cell */
.fields--grid > [data-otkaz-only]:not([hidden]) { grid-column: span 3; }
/* a box that takes the place of the hidden box before it (the typed name, shown only for «Нет в списке — ввести
   вручную»), so the ruled row never shows an empty cell */
.fields > [hidden] + .field--fills { grid-column: span 2; }
/* «Установлено»: each box spans four rows shared across its row — label, control, «было в ДМЦ», hint or error —
   so a row's controls stay on one line when a label wraps (Show of slice 17) */
.fields--aligned > .field { display: grid; grid-template-rows: subgrid; grid-row: span 4; row-gap: 0; }
.fields--aligned > .field > label { align-self: end; }
/* boxes whose hints sit under them: each row starts at the top */
.fields--top { align-items: start; }
.fields--top > .field { align-self: stretch; }
/* the typed name a wide list opens («Кто загружает» on «ДМЦ»), once shown: room for a name of 40 characters beside the
   box that took its place while hidden (.field--fills, «Согласован ОД»), the two side by side at one height, hints
   level (Show of slice 15, tests/test_dmc.py), each half the row; the list above them takes its row whole. No cell is
   left empty (slice 32's ask 3: a quarter of the grid, a long name scrolled inside it). Under 900 px every box takes
   the row */
@media (min-width: 900px) {
  .fields--grid > .field--wide:has(> select[data-manual]):has(+ .field:not([hidden])) { grid-column: 1 / -1; }
  .fields--grid > .field--wide:has(> select[data-manual]) + .field:not([hidden]),
  .fields--grid > .field--wide:has(> select[data-manual]) + .field:not([hidden]) + .field--fills { grid-column: span 2; }
}
/* three boxes and a typed name shown on demand («Принято в работу по письму» on «ДМЦ №n»: a list, its «Фамилия Имя»,
   a list, a date): at 900 px and wider the three share one row in thirds, each wide enough for its longest name, and
   once the typed box shows (it is served shown, so without script too) the four stand two a row, no cell empty, no
   box wider than half; under 900 px one a row, as every grid (below) (slice 31's Show 3, S-6) */
@media (min-width: 900px) {
  .fields--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fields--thirds:has(> :not([hidden]) ~ :not([hidden]) ~ :not([hidden]) ~ :not([hidden])) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
/* under 900 px (200 % zoom) a grid of boxes lays them one a row, as a group's line does: a half-width box would cut
   its chosen name; a wide or full box, a box in the place of a hidden one and «Отказ»'s reason take the one column
   too. At 900 px and wider a page keeps its columns (slice 31's Show 3, S-6). «Установлено»'s aligned grid keeps its
   rows at every width: a row's controls stay on one line even where a label wraps (Show of slice 17) */
@media (max-width: 899.98px) {
  .fields:not(.fields--aligned) { grid-template-columns: minmax(0, 1fr); }
  .fields:not(.fields--aligned) > :is(*, .field--wide, .field--full, .field--fills, [data-otkaz-only]) { grid-column: 1 / -1; }
}

/* «с … по …»: two date boxes inside the period's box, side by side */
.period { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 6px; border-top: var(--rule-hair); flex: 1; }
.period > .field { flex-direction: row; align-items: center; margin: 0; border: 0; background: transparent; }
.period > .field + .field { border-left: var(--rule-hair); }
.period > .field:hover { background: transparent; }
.period__note { padding-left: var(--cell-pad-x); font-size: var(--text-sm); color: var(--ink-2); }
.period input.date { padding: 7px var(--cell-pad-x) var(--space-2) var(--space-2); }

/* ======================================================================= tables */
table { width: 100%; border-collapse: collapse; font-size: var(--text-row); }
th, td { padding: var(--row-py) var(--row-px); text-align: left; vertical-align: top; border-bottom: var(--rule-hair); }
thead th {
  vertical-align: bottom; white-space: normal; font-size: var(--text-xs); font-weight: var(--weight-regular); line-height: 1.25;
  color: var(--ink-2); background: var(--surface); border-bottom: var(--rule);
}
.table-wrap thead th { top: 0; }
/* a long table's head stays in view while the page scrolls (ui/rules.md): at 1024 px and wider no table needs to
   scroll sideways, so its wrap is no scroll box of its own (one would hold the head inside it) and the head sticks
   under the top bar, to the table's end; narrower, the wrap scrolls sideways and the head stays with its table */
@media (min-width: 1024px) {
  .table-wrap { overflow: visible; }
  /* its rule drawn inside the cell, so it travels with the stuck head (a collapsed border stays behind) */
  .table-wrap thead th, .req-table thead tr.req-head > th { top: var(--bar-bottom); border-bottom: 0; box-shadow: inset 0 -1px 0 var(--line-strong); }
}
tbody tr { transition: background-color var(--dur-fast) var(--ease); }
tbody tr:hover > td, tbody tr.is-hover > td { background: var(--hover); }
tfoot td { font-weight: var(--weight-bold); border-top: var(--rule); border-bottom: 0; }
th.num, td.num { text-align: right; }
td.nowrap { white-space: nowrap; }
/* a request's «Вид» in a list («Журнал заявок», «Все заявки») is a name of a few words that never wraps; a long name in
   «Подал» beside it wraps instead (at 1024 «Изменение статуса» wrapped while «Подал» had room: the whole-system Show,
   W-7) */
tr[data-request] > td[data-col="kind"] { white-space: nowrap; }
/* a status in a cell wraps: the current status in a found group's rows and in «Заявка №n»'s table keeps the class
   nowrap its readers take with the row's class list, and wraps all the same */
.group td.current, .req-table td.current { white-space: normal; }
/* a marked row: amber tint and a 4px amber edge (R-9) */
tr[data-state="warn"] > td { background: var(--warn-soft); }
tr[data-state="warn"] > td:first-child { box-shadow: inset 4px 0 0 var(--warn); }
tr[data-state="warn"]:hover > td, tr[data-state="warn"].is-hover > td { background: color-mix(in oklch, var(--warn-soft) 82%, var(--warn)); }
tr[data-state="bad"] > td { background: var(--bad-soft); }
tr[data-state="bad"] > td:first-child { box-shadow: inset 4px 0 0 var(--bad); }
/* a mark column: narrow while empty, wide only where it carries a mark */
td.cell-mark:empty { padding-left: 0; padding-right: 0; }
td.cell-mark { min-width: 0; }
/* the monitor number: the strong cell of a row; repeats of a group's values quiet */
td.unique { font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* the manager's name wraps when its table is short of room, a one-word surname wider than its column broken inside
   (slice 29's Show 2, N-2); the phone never breaks (slice 29's Show, S-1) */
td.manager { color: var(--ink); overflow-wrap: break-word; }
.phone { color: var(--ink-3); white-space: nowrap; }
.req-table tbody + tbody tr:first-child:not(.asked) td { border-top: 0; }
.req-table td.manager .phone { white-space: nowrap; }
/* a heading row grouping the rows under it («Ждут монтажа» by manager, «Монтаж» by ДМЦ) */
tr.table-group > td { padding-top: var(--space-3); background: var(--band); border-top: var(--rule); border-bottom: var(--rule); font-weight: var(--weight-bold); color: var(--ink); }
tr.table-group--sub > td { padding-top: var(--row-py); background: var(--surface); border-top: var(--rule-hair); font-weight: var(--weight-bold); color: var(--ink-2); }
tr.table-group:hover > td { background: var(--band); }

/* ---------- the asked line of «Заявка №n»: what is asked for a hyperlink, set as a structured header ---------- */
.req-table tr.asked > td {
  padding: var(--space-2) var(--row-px) var(--space-3); background: var(--band);
  border-top: var(--rule-ink); border-bottom: var(--rule); font-size: var(--text-sm); line-height: 1.55;
}
.req-table tr.asked:hover > td { background: var(--band); }
.req-table tr.asked > td > strong:first-child { font-size: var(--text-md); }
.asked__item { display: inline; }
.asked__label { color: var(--ink-2); white-space: nowrap; }       /* a label stays on one line (Show of slice 13) */
.asked__value { overflow-wrap: anywhere; color: var(--ink); }     /* a value wraps, never widening the table */
.asked__item[data-asked="target"] .asked__value, .asked__item[data-asked="period"] .asked__value { font-size: var(--text-md); font-weight: var(--weight-bold); }
.asked__item[data-asked="location"], .asked__item[data-asked="action"] { font-size: var(--text-xs); }
/* the period («с дд.мм.гггг по дд.мм.гггг», 25 characters at most) never breaks inside: the line breaks before it
   (Show 1 of slice 28, S-5) */
.asked__item[data-asked="period"] .asked__value { white-space: nowrap; }
/* the case as a small ruled tag, set off from the item before it (its « · » is hidden) */
.asked__item[data-asked="case"] { margin-inline-start: var(--space-2); }
.asked__item[data-asked="case"]:first-child { margin-inline-start: 0; }
.asked__item[data-asked="case"] .asked__value {
  display: inline-block; min-width: 1.6em; padding: 0 6px; text-align: center; font-weight: var(--weight-bold);
  border: var(--rule); border-radius: var(--radius-control); background: var(--surface); line-height: 1.4;
}
.asked__item[data-asked="case"] .asked__value:has(.mark) { border-color: var(--warn); background: var(--warn-soft); }
/* the регламент lines: on their own lines, in the warning look, never muted or folded (R-44, R-46, R-47) */
tr.asked .mark[data-line] { display: inline-block; margin-top: 2px; }
/* D-165 (a), D-171 (a): one column head per request (tr.req-head in the thead) over every block whose rows agree; each
   block a tbody led by its line (tr.asked). When the block's rows hold one УЗ, one city and one manager
   (.req-table--agree), those stand once on the line, as on the found page, and the rows keep four columns: the monitor
   number (under the «Гиперссылка» cell), «Текущий статус» and the two marks. A block whose rows differ stands in a table
   of its own with all eight columns on every row; the agreeing blocks after it start a new table. */
.table-wrap:has(> .req-table) + .table-wrap:has(> .req-table) { margin-top: var(--space-4); }
.req-table tr.asked > td { vertical-align: top; }
/* the block line is one line of facts about the hyperlink, not cells of the table's columns (Show 1 of slice 28, C-1):
   its parts follow one another, parted by the facts line's hairline, and wrap as a facts line wraps (the hairline of a
   part that opens a line falls left of the line's padding edge, clipped, while --row-px stays below --part-pad) */
.asked__head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  margin: 0 calc(-1 * var(--row-px)) var(--space-1); padding: 0 var(--row-px) var(--space-1);
  border-bottom: var(--rule-hair); line-height: 1.35;
}
.asked__head > * { min-width: 0; padding: 2px var(--part-pad); border-left: var(--rule-hair); position: relative; inset-inline-start: var(--part-back); }
.asked__head > :empty { display: none; }
.req-table:not(.req-table--agree) .asked__head { display: block; border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.asked__key { font-size: var(--text-sm); color: var(--ink-2); }
.asked__key strong { font-size: var(--text-md); color: var(--ink); font-variant-numeric: tabular-nums; }
.asked__uz { font-size: var(--text-sm); font-weight: var(--weight-bold); color: var(--ink); }
.asked__city, .asked__manager { font-size: var(--text-sm); color: var(--ink); }
.asked__head + br { display: none; }
.req-table thead tr.req-head > th { border-bottom: var(--rule); }
.req-table--agree { table-layout: fixed; }
.req-table--agree tr.req-head > th:first-child, .req-table--agree td.unique { width: var(--group-key); }
.req-table--agree tr.req-head > th:nth-child(2) { width: 30%; }
/* a table whose rows differ — a found group's with no УЗ, city and manager on its line, and «Заявка №n»'s block's
   (D-165 (a)) — keeps every column on every row (slice 29's Show, S-1). At 1280 px and wider each column takes its
   share, so the worst lengths (a 262-character УЗ, the 66-character status and its mark, a 37-character manager with
   the phone) wrap inside the sheet: «Гиперссылка» as wide as its figures, the monitor's number as its head on two
   lines (a static construction's words wrap there), the manager as «Ответственный менеджер» on one line and an
   ordinary name and phone on two (slice 29's Show 2, N-3), the УЗ the rest, each other column a share; counted from the end, so the found
   page's tick leads. Narrower, its table takes the width its words need, and its wrap alone scrolls sideways when
   that is more than the sheet has, its head staying on its table; every other table keeps its head in view under the
   top bar (at 1024 px and wider) */
@media (min-width: 1280px) {
  :is(.group:not(:has(> .group__facts)) > .table-wrap > table, table.req-table:not(.req-table--agree):has(> thead > tr.req-head)) { table-layout: fixed; }
  :is(.group:not(:has(> .group__facts)) > .table-wrap > table, table.req-table:not(.req-table--agree):has(> thead > tr.req-head)) > thead > tr > th:nth-last-child(8) { width: 96px; }
  :is(.group:not(:has(> .group__facts)) > .table-wrap > table, table.req-table:not(.req-table--agree):has(> thead > tr.req-head)) > thead > tr > th:nth-last-child(7) { width: 150px; }
  :is(.group:not(:has(> .group__facts)) > .table-wrap > table, table.req-table:not(.req-table--agree):has(> thead > tr.req-head)) > tbody td.unique { white-space: normal; }
  :is(.group:not(:has(> .group__facts)) > .table-wrap > table, table.req-table:not(.req-table--agree):has(> thead > tr.req-head)) > thead > tr > th:nth-last-child(5) { width: 9.5%; }
  :is(.group:not(:has(> .group__facts)) > .table-wrap > table, table.req-table:not(.req-table--agree):has(> thead > tr.req-head)) > thead > tr > th:nth-last-child(4) { width: 10%; }
  :is(.group:not(:has(> .group__facts)) > .table-wrap > table, table.req-table:not(.req-table--agree):has(> thead > tr.req-head)) > thead > tr > th:nth-last-child(3) { width: 12.5%; }
  :is(.group:not(:has(> .group__facts)) > .table-wrap > table, table.req-table:not(.req-table--agree):has(> thead > tr.req-head)) > thead > tr > th:nth-last-child(2) { width: 160px; }
  :is(.group:not(:has(> .group__facts)) > .table-wrap > table, table.req-table:not(.req-table--agree):has(> thead > tr.req-head)) > thead > tr > th:last-child { width: 10%; }
}
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .group:not(:has(> .group__facts)) > .table-wrap, .table-wrap:has(> table.req-table:not(.req-table--agree) > thead > tr.req-head) { overflow-x: auto; }
  :is(.group:not(:has(> .group__facts)) > .table-wrap, .table-wrap:has(> table.req-table:not(.req-table--agree) > thead > tr.req-head)) thead th { top: 0; }
}
/* D-163: when every hyperlink asks the same, said once above the table */
.asked--all { max-width: none; margin: 0 0 var(--space-2); padding: var(--space-2) var(--row-px) var(--space-3); background: var(--band); border-top: var(--rule-ink); border-bottom: var(--rule); font-size: var(--text-sm); line-height: 1.55; }
.asked--all > strong:first-child { font-size: var(--text-md); }

/* ======================================================================= the found page */
/* the check band: the document's preamble — one ruled facts line, then «Не распознаны» beside the attention items */
.preamble { display: grid; gap: var(--space-4); padding: 0 0 var(--space-6); }
.preamble__cols { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--space-6); align-items: start; }
.preamble .section-title { margin: 0 0 var(--space-2); }
.preamble .section-title h2 { font-size: var(--text-lg); }
@media (max-width: 899.98px) { .preamble__cols { grid-template-columns: 1fr; } }
/* a preamble with nothing in its columns — a clean list (nothing unrecognised, nothing to look at), or an attention
   list the page's script emptied — ends at its facts line: no columns, no band, no bottom rule; the double rule of
   «Для всех строк» follows it (slice 29's Show, C-1) */
.preamble:not(:has(> .preamble__cols > div, > .preamble__cols > .attention > li:not([hidden]))) { padding-bottom: 0; }
.preamble:not(:has(> .preamble__cols > div, > .preamble__cols > .attention > li:not([hidden]))) > .facts { border-bottom: 0; }
.preamble:not(:has(> .preamble__cols > div, > .preamble__cols > .attention > li:not([hidden]))) > .preamble__cols { display: none; }
.unresolved td:first-child { width: 1%; white-space: nowrap; font-weight: var(--weight-bold); font-variant-numeric: tabular-nums; }
.unresolved tr[data-state="warn"] > td { background: transparent; }
.unresolved tr[data-state="warn"] > td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* what needs the user's eye, named, with its rows */
.attention { list-style: none; margin: 0; padding: 0; border-top: var(--rule); }
/* a list whose every item the page's script hid («Отказ» hides the line on status marks) draws no empty ruled line,
   on screen or on paper */
.attention:not(:has(> li:not([hidden]))) { display: none; }
.attention li { display: grid; gap: 2px; padding: var(--space-2) 0 10px; border-bottom: var(--rule-hair); font-size: var(--text-sm); }
.attention .status { font-size: var(--text-md); }
/* «Требуют внимания: n мест из m» as a ruled block of its own («ДМЦ прочитан», «ДМЦ №n»): an amber edge, its h2 at the
   section size, each item's «строка N» bold in a column of its own */
.attention-panel { margin-bottom: var(--space-5); box-shadow: inset 4px 0 0 var(--warn); }
.attention-panel > h2 { margin: 0 0 var(--space-3); }
.attention-panel .attention li { grid-template-columns: 6em minmax(0, 1fr); column-gap: var(--space-3); padding: 6px 0 7px; }
.attention li > strong { font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }

/* ---------- the request form: «Для всех строк», the main block ---------- */
.request-form { margin: 0; }
.group { position: relative; min-width: 0; }
.group--all { padding: var(--space-5) 0 var(--space-6); border-top: var(--rule-double); border-bottom: var(--rule-double); margin-bottom: var(--space-2); }
.group--all > legend {
  float: left; width: 100%; margin: 0 0 var(--space-3);
  font-family: var(--font-display); font-size: var(--text-xl); font-weight: var(--weight-bold); color: var(--ink); line-height: 1.2;
}
.group--all > legend + * { clear: both; }
.group--all > .fields { border: var(--rule-heavy); }

/* ---------- a group: one hyperlink — its line, its rows, its own fields folded ---------- */
/* the line: «Гиперссылка 888816481», «строк: k» in its cell over the tick and the monitor numbers, then (D-165) the
   УЗ strong, the city, the manager with the phone quiet */
.group:not(.group--all) {
  display: grid; grid-template-columns: var(--group-key) minmax(0, 1fr);
  margin-top: var(--space-3); border-top: var(--rule-ink);
}
.group:not(.group--all) > legend {
  float: left; grid-column: 1; display: flex; flex-wrap: wrap; align-items: baseline; align-content: start; gap: 0 var(--space-3);
  padding: 6px var(--space-3); background: var(--band); border-bottom: var(--rule); font-size: var(--text-sm); color: var(--ink-2);
}
/* «Гиперссылка 888…» reads as «Заявка №n»'s block line's key (.asked__key strong) on every page: the word and its
   number alike, 15 px bold ink, the count quiet beside it (the found page set the word quiet and the number bold:
   wave 1's Show, W-3) */
.group__link, .group > legend > span:has(> .group__link) { font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--ink); font-variant-numeric: tabular-nums; }
.group__rows { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.group__writes { font-weight: var(--weight-bold); color: var(--ink); }
/* … the УЗ, the city and the manager are one flowing facts line about the hyperlink, as «Заявка №n»'s block line is
   (Show 1 of slice 28, C-1): they follow one another from where «Текущий статус» starts, parted by the facts line's
   hairline, and wrap as it wraps, never laid on the table's columns below, where a city would stand as a mark
   (slice 29's Show 2, N-4) */
.group__facts {
  grid-column: 2 / -1; display: flex; flex-wrap: wrap; align-items: baseline; align-content: start; min-width: 0;
  padding: 6px var(--space-3); background: var(--band); border-bottom: var(--rule); font-size: var(--text-sm); line-height: 1.35;
  --part-pad: var(--space-4); --part-back: calc(-1 * (var(--part-pad) + 1px)); overflow-x: clip;
}
.group__facts > * { min-width: 0; padding: 0 var(--part-pad); border-left: var(--rule-hair); position: relative; inset-inline-start: var(--part-back); }
.group__uz { font-weight: var(--weight-bold); color: var(--ink); }
.group__city, .group__manager { color: var(--ink); }
@media (max-width: 1179.98px) { :root { --group-key: 230px; } }
/* under 900 px (200 % zoom) the line's fixed cells would stick out of the sheet: each cell takes the line's width, one
   under the other, as the preamble's columns do */
@media (max-width: 899.98px) { .group:not(.group--all) { grid-template-columns: minmax(0, 1fr); } .group__facts { grid-column: 1 / -1; } }
.group > .table-wrap, .group > details, .group > .fields, .group > .field__error { grid-column: 1 / -1; }
/* a group holding a marked row: an amber edge on its line (from its rows, by :has — no new hook) */
.group:has(tr[data-state="warn"]) > legend { box-shadow: inset 4px 0 0 var(--warn); }
/* a refused group: a red edge on its line */
.group:not(.group--all):has([aria-invalid="true"]) > legend { box-shadow: inset 4px 0 0 var(--bad); }
/* its rows: a compact table; the tick and the monitor number under the «Гиперссылка» cell */
.group table thead th { padding-top: 3px; padding-bottom: 2px; white-space: nowrap; }
.group table td { padding-top: 4px; padding-bottom: 4px; }
.group table td:first-child, .group table th:first-child { width: 40px; padding-left: var(--space-3); padding-right: 0; }
.group:has(> .group__facts) td.unique { width: calc(var(--group-key) - 40px); }
.group:has(> .group__facts) td.current { width: 30%; }
/* the groups whose rows agree are one table's columns down the page, as «Заявка №n»'s are (slice 29's Show, C-2): at
   1024 px and wider each column has its fixed share — the tick and the number under the line's «Гиперссылка» cell,
   «Текущий статус» a third or so, the two marks the rest alike — so a column stands at one x in every group, whatever
   its words; a long value wraps in its column */
@media (min-width: 1024px) {
  .group:has(> .group__facts) > .table-wrap > table { table-layout: fixed; }
  .group:has(> .group__facts) > .table-wrap > table > thead > tr > th { white-space: normal; }
  .group:has(> .group__facts) > .table-wrap > table > thead > tr > th:nth-child(2) { width: calc(var(--group-key) - 40px); }
  .group:has(> .group__facts) > .table-wrap > table > thead > tr > th:nth-child(3) { width: 30%; }
}
/* a group whose rows differ (D-165 (a)) keeps its nine heads, each wrapping in its column (see «a table whose rows
   differ» above) */
.group:not(:has(> .group__facts)) table thead th { white-space: normal; }
/* an unticked row stays, struck through: it will not be sent */
.group tr:has(input[name="pick"]:not(:checked)) > td:not(:first-child) { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
/* … and every row of a static construction whose one tick, «вся конструкция», stands in its legend (pile II-15) */
.group:has(> legend input[name="pick"]:not(:checked)) tbody td:not(:first-child) { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
/* the own fields: folded while empty; the line says what the group will send */
.group__own > summary {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-4); padding: 4px var(--space-3) 5px;
  font-size: var(--text-sm); list-style: none; cursor: pointer; transition: background-color var(--dur-fast) var(--ease);
}
.group__own > summary::-webkit-details-marker { display: none; }
.group__own > summary::before { content: "▸"; width: 10px; color: var(--ink-2); }
.group__own[open] > summary::before { content: "▾"; }
.group__own > summary:hover, .group__own > summary.is-hover { background: var(--hover); }
.group__own > summary strong { font-weight: var(--weight-regular); color: var(--ink-2); }
.group__sends { color: var(--ink-2); }
/* a ruled tag on a line: what the group sends of its own («свои: …»), and the status it will write in «Отказ»
   (D-134, shown by the page's script) — ink, never the accent: it is not «act here» */
.group__sends--own, .group__writes:not([hidden]) { padding: 0 7px; color: var(--ink); font-weight: var(--weight-bold); border: 1px solid var(--ink-2); background: var(--surface); }
.group__own[open] { padding-bottom: var(--space-2); }
.group__own > .fields { margin: 0; }
/* a group left unticked on «Установлено»: collapsed to its line, faded; it sends nothing */
/* with scripts off, a group drawn unticked and ticked again by hand opens again: the fold holds only while its tick is
   off (the server reads the tick) */
.group--off:not(:has(> legend input[name="pick"]:checked)) > :not(legend) { display: none; }
.group--off:not(:has(> legend input[name="pick"]:checked)) > legend { opacity: 0.62; }
.group--off:not(:has(> legend input[name="pick"]:checked)) { grid-template-columns: 1fr !important; }
/* … and the bar's summary, drawn by the server for the group left out («… останется в «Ждут «Установлено»»»), would
   then say the opposite of what is sent: it is hidden (its signature line kept) while a group drawn unticked holds a
   checked tick; with scripts on, the page's script keeps .group--off to unticked groups and rewrites the summary
   (slice 30's Show 2, N-2) */
form:has(.group--off > legend input[name="pick"]:checked) .actionbar__summary { visibility: hidden; }
form:has(.group--off > legend input[name="pick"]:checked) .actionbar__summary::after { visibility: visible; }
/* «Установлено»'s line holds the tick and the words in one legend across the sheet, and stays in view under the top bar
   while its group's boxes scroll under it (its tick leads the legend; a static construction's «вся конструкция» on the
   found page stands after «Гиперссылка …» and keeps the four-cell line) */
.group:not(.group--all) > legend:has(> .check:first-child) { grid-column: 1 / -1; position: sticky; top: var(--bar-bottom); z-index: 2; }
/* a line with nothing beside its key — no УЗ, city or manager cells: «Установлено»'s form for one hyperlink (which has
   no tick), a found group whose rows differ (D-165 (a): they stand in its rows) — is one band across the group too, its
   words beside the key; a group with those cells keeps the four-cell line */
.group:not(.group--all):not(:has(> .group__facts)) > legend { grid-column: 1 / -1; }
/* a form's main block right under the head: the head's double rule is its top rule (no second one) */
.page-head + form > .group--all:first-child { border-top: 0; padding-top: var(--space-2); }

/* ======================================================================= a request in a list */
/* a ruled block of the sheet: a head band with its h3, its visa chip, its facts and its actions; then its table */
.request { margin: 0 0 var(--space-6); border-top: var(--rule-ink); }
.table-wrap + .request, .pager + .request { margin-top: var(--space-6); }
/* one head for every request and ДМЦ in a list (designer brief: the role chip, «Заявка №n» and the form read as one
   unit): the h3, the visa chip and the actions at the right on the first line; the facts across the second.
   A head with no actions (a request done) keeps its facts beside the h3. */
.request__head {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3);
  padding: var(--space-3) var(--space-3); background: var(--band); border-bottom: var(--rule);
}
.request__head h3 { margin: 0; }
.request__head h3 a { color: var(--ink); text-decoration-color: var(--line-strong); }
.request__head h3 a:hover { text-decoration-color: var(--ink); }
.request__head > .request__actions { order: 1; }
.request__head > .facts { order: 2; flex: 1 0 100%; }
.request__head:not(:has(> .request__actions)) > .facts { order: 0; flex: 1 1 auto; margin-left: var(--space-2); }
/* a fact's note in a head («Письма»: where a missing address is added, D-349 (a), slice 49) stands under its facts */
.request__head > .facts + .fact__note { order: 3; flex: 1 0 100%; margin: 0; }
/* … and a head with no title («Заявка №n · Установлено» on Азиля's page: the h1 names the request) leads with its
   facts at the left, its actions at the right on the same line, the facts wrapping as they need (slice 33's Show,
   C-1: the actions alone on the first line read as a title that failed to draw) */
.request__head:not(:has(> h3)) > .facts { order: 0; flex: 1 1 0; min-width: min(100%, calc(var(--space-8) * 4)); }
/* … under 1000 px, where its facts would run to four lines beside the file and «Внесено в ЦФО» (900 px), on the
   screen it stacks: the facts across the head, the actions under them at its right (the whole-system Show, W-6) */
@media screen and (max-width: 999.98px) {
  .request__head:not(:has(> h3)) > .facts { flex-basis: 100%; }
}
.request__actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; }
/* a form that wraps (the typed name and its role shown, or a refusal) keeps its controls at the right, the primary
   button at the head's right edge on its last line, as in every other block (slice 32's Show 2, N-1) */
.request__actions form { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-2); align-items: center; margin: 0; }
/* the problem under a head's form: it stands under the control that failed, not beside the button */
.request__actions:has(> .field__error) { flex-direction: column; align-items: stretch; gap: var(--space-1); }
.request__actions > .field__error { padding: 0; }
/* a waiting request's head stays in view while its rows scroll, under the one-row top bar. Its tables' heads then stay
   with their tables (over their first rows), not stuck under the bar: stuck there they stood behind the block's head
   and vanished (the wave Show, slice 32's ask 1). Two things stuck at once can stack only at a known height, and the
   head's is not one (a key figure, a problem under its control, the typed name and its role wrapping the form onto a
   second line): the head with «Согласовано» is the action the user needs while reading a long request, its asked
   lines name each hyperlink's rows. Under 1280 px, where the head does not stick, a table's head sticks as anywhere. */
@media (min-width: 1280px) {
  .request:not(.request--done) > .request__head { position: sticky; top: calc(var(--bar-bottom) + 1px); z-index: var(--z-sticky); }
  .request:not(.request--done):has(> .request__head) .table-wrap > table > thead > tr > th { position: static; }
}
/* D-182 (c): a ДМЦ waiting on «ДМЦ: приём в работу» (.request--split) has a head of its first line alone, its title and
   its «Принято в работу» form, and its facts line straight after it in the same band (.request__facts). Under 1280 px
   the two read as the one head of every other block. From 1280 px on the screen that line is of a known height (a
   control and the band's padding; with the problem under «Кто принимает», a line of it more) and sticks under the top
   bar, the column heads of its lines stick right under it, and the facts line scrolls away: reading line 30 the user
   keeps «Принято в работу» and what each column holds. «Согласование статусов» keeps its whole head stuck, as above */
.request--split > .request__head { padding-bottom: var(--space-1); border-bottom: 0; }
.request--split > .request__facts { padding: 0 var(--space-3) var(--space-3); border-top: 0; border-bottom: var(--rule); background: var(--band); }
@media screen and (min-width: 1280px) {
  .request--split { --split-error: calc(var(--space-4) + var(--space-1)); --split-line: calc(var(--control-h) + var(--space-3) * 2); }
  .request--split:has(> .request__head > .request__actions > .field__error) {
    --split-line: calc(var(--control-h) + var(--space-1) + var(--split-error) + var(--space-3) * 2);
  }
  .request--split > .request__head {
    flex-wrap: nowrap; height: var(--split-line); padding-bottom: var(--space-3); box-shadow: inset 0 -1px 0 var(--line);
  }
  .request--split > .request__head > .request__actions > .field__error { line-height: var(--split-error); white-space: nowrap; }
  .request--split > .request__facts { padding-top: var(--space-1); }
  .request.request--split:not(.request--done):has(> .request__head) .table-wrap > table > thead > tr > th {
    position: sticky; top: calc(var(--bar-bottom) + 1px + var(--split-line));
  }
}
.request__foot { padding: var(--space-3); border-top: var(--rule-hair); }
.request > .notice { margin: var(--space-3) var(--space-3) 0; }
/* a request already done: the quietest block of the page */
.request--done { border-top-color: var(--line-strong); }
.request--done .request__head { background: var(--surface); }
.request--done .request__head h3 { font-size: var(--text-md); }
/* a count with its rows directly under it (Азиля's queue): zero as quiet zero */
.count-block { padding: var(--space-3) var(--space-3) 0; }
.count-block + .count-block { border-top: var(--rule-hair); }
.count-block h4 { margin: 0 0 var(--space-2); font-size: var(--text-md); font-weight: var(--weight-bold); color: var(--ink); }
.count-block--zero h4 { font-weight: var(--weight-regular); color: var(--ink-2); font-size: var(--text-sm); }
.count-block .table-wrap { margin-bottom: var(--space-3); }
/* its rows' «Отметка о заявке» keeps about 24 characters (each «строка уже в заявке №n (…)» on two lines at most),
   where an auto table gave it a sixth beside a long «Отметка о статусе» and each of six lines took three (slice 33's
   Show, C-2; D-173 (a) keeps every line open); the status mark wraps instead */
.count-block td.cell-mark[data-mark="request"]:not(:empty) { min-inline-size: 24ch; }
/* what is already done («Внесённые», «Согласованные»): the quietest section of a page — a smaller head under its
   double rule, its rows in quiet ink */
.done-block .section-title h2 { font-size: var(--text-lg); }
.done-block table { color: var(--ink-2); }

/* ======================================================================= folds */
/* one fold for the system: a block closed to its own head — a request done (its head band is the summary) or a
   fallback form under its h2 («Принято в работу по письму», «Отозвать ДМЦ»). A ▸ / ▾ before the head, no new words. */
.fold > summary { list-style: none; cursor: pointer; transition: background-color var(--dur-fast) var(--ease); }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::before { content: "▸"; flex: none; width: 10px; color: var(--ink-2); }
.fold[open] > summary::before { content: "▾"; }
.fold > summary:hover, .fold > summary.is-hover { background: var(--hover); }
.fold > summary:focus-visible { outline-offset: -2px; }
/* a fold that is a ruled panel: its summary is the panel's head */
.panel.fold { padding: 0; }
.panel.fold > summary { display: flex; align-items: baseline; gap: var(--space-2); padding: var(--space-3) var(--space-5); }
.panel.fold > summary h2, .panel > h2.panel__title { margin: 0; font-family: var(--font-body); font-size: var(--text-md); }
.panel.fold > :not(summary) { margin-left: var(--space-5); margin-right: var(--space-5); }
.panel.fold[open] { padding-bottom: var(--space-4); }
.panel + .panel { margin-top: var(--space-3); }

/* ======================================================================= lists: filter, pager, empty */
/* the filter line: one quiet ruled line of small boxes and «Показать» */
.filters { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; margin: 0 0 var(--space-3); }
.filters .field { margin: 0; min-width: 180px; }
.filters .field:has(> #q) { min-width: 27rem; } /* «Поиск»: its whole hint shows (slice 43, critique C1-1; W-0212c-3: with hyperlinks and monitors) */
.filters .field + .field { border-left: 0; }
.filters > button { margin-left: var(--space-3); align-self: center; }
.filters .field:has(> button) { margin-left: var(--space-3); align-self: center; border: 0; background: transparent; min-width: 0; }
.filters + .muted, .filters ~ p.muted { font-size: var(--text-sm); }

.pager { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin: var(--space-3) 0; font-size: var(--text-sm); }
.pager__info { color: var(--ink-2); margin-right: auto; font-variant-numeric: tabular-nums; }
.pager .btn { min-width: 32px; }
.pager__gap { color: var(--ink-2); padding: 0 var(--space-1); }  /* W-0212c-3: a run of pages left out of a long list's pager */
.pager a[aria-current="page"] { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }

/* an empty list says so, and what to do next: a dashed ruled box, the first line in PT Serif */
/* … and repeats what the user typed («История»: «не найдена»): a long unbroken string breaks inside the card, never
   running out of it and the page sideways (slice 34's Show) */
.empty { padding: var(--space-7) var(--space-5); text-align: center; border: 1px dashed var(--line-strong); overflow-wrap: anywhere; }
.empty p { margin-left: auto; margin-right: auto; color: var(--ink-2); }
/* its lead wraps balanced, never one word alone on its second line, as the top bar's name does (slice 34's Show 2, N-2) */
.empty > p:first-child { text-wrap: balance; }
.empty p:first-child strong { font-family: var(--font-display); font-size: var(--text-lg); color: var(--ink); }

/* ======================================================================= the actionbar: the sheet's signature line */
.actionbar {
  position: sticky; bottom: 0; z-index: var(--z-sticky);
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-4);
  margin: var(--space-6) calc(-1 * var(--page-pad)) 0; padding: var(--space-3) var(--page-pad) var(--space-4);
  background: var(--surface); border-top: var(--rule-double-ink);
}
@media (max-width: 1179.98px) { .actionbar { margin-left: calc(-1 * var(--page-pad-narrow)); margin-right: calc(-1 * var(--page-pad-narrow)); padding-left: var(--page-pad-narrow); padding-right: var(--page-pad-narrow); } }
/* the counts, then a signature line running to the button */
.actionbar__summary {
  flex: 1 1 auto; display: flex; align-items: baseline; gap: var(--space-4); padding-bottom: 10px;
  font-size: var(--text-md); color: var(--ink); font-variant-numeric: tabular-nums;
}
.actionbar__summary::after { content: ""; flex: 1 1 var(--space-8); align-self: flex-end; border-bottom: var(--rule-ink); min-width: var(--space-6); }
.actionbar .btn--primary, .actionbar button { margin-left: auto; }
/* a hint saying which button to press, on the bar beside them (D-350; critique C1-2 of slice 49) */
.actionbar > .field__hint { flex: 0 1 22rem; padding: 0 0 10px; }
/* what a slow action is doing while it waits («Читаю файл…»), beside its disabled button (which reads as busy:
   see «buttons»). While the line is empty the button keeps the right edge. */
.actionbar__busy { align-self: center; margin-left: auto; font-size: var(--text-sm); color: var(--accent); font-weight: var(--weight-bold); }
.actionbar__busy:empty { display: none; }
.actionbar .actionbar__busy:not(:empty) + button { margin-left: 0; }
/* an actionbar inside a ruled block: no stickiness, no second sheet edge */
.panel .actionbar { position: static; margin: var(--space-4) 0 0; padding: var(--space-3) 0 0; border-top: var(--rule); }
/* a file being read: the zone above the bar goes still */
form:has(.actionbar__busy:not(:empty)) .dropzone { opacity: 0.6; pointer-events: none; }

/* ======================================================================= the drop zone */
.dropzone {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  margin: var(--space-2) var(--cell-pad-x) var(--space-3); padding: var(--space-5) var(--space-4); text-align: center;
  background: var(--band); border: 1px dashed var(--line-strong);
  transition: background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}
.dropzone--over { background: var(--accent-soft); border: 1px solid var(--accent); }
.dropzone__text { margin: 0; color: var(--ink-2); }
.dropzone__pick { color: var(--accent); text-decoration: underline; cursor: pointer; }
.dropzone__pick:hover { color: var(--accent-press); }
.dropzone__file { margin: 0; padding-bottom: 2px; font-weight: var(--weight-bold); color: var(--ink); border-bottom: var(--rule-ink); overflow-wrap: anywhere; }
.dropzone__file:empty { display: none; }
/* with its script, the zone stands for the browser's control: hidden from the eye, never from the keyboard */
.dropzone--js { position: relative; }
.dropzone--js input[type="file"] {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.field:has(> .dropzone) { background: var(--surface); }

/* ======================================================================= «Ждут монтажа», «История» */
/* the strip: «дольше всех» and the totals as one compact ruled band */
.strip { display: grid; gap: 0; margin: 0 0 var(--space-5); border-top: var(--rule); border-bottom: var(--rule); }
.strip > .facts { border: 0; }
.strip > .facts + .facts { border-top: var(--rule-hair); }
.strip > .facts + .facts dd { font-weight: var(--weight-regular); }    /* the totals' line quieter than «дольше всех» */

/* a table's row actions («Без ДМЦ», «Монтаж»): quiet buttons at the right of the row, always visible */
.montage-list tr:not(.table-group) > td:last-child, .montage-list tr[data-dmc] > td:last-child { text-align: right; white-space: nowrap; }
/* a list's column heads («Монтаж»'s two lists, «ДМЦ», «Ждут монтажа») stay on one line where the table has room: an
   auto table gave a head over short values less than its words («Аббревиатура УЗ» over a three-letter value broke at
   1280 px, «Согласован ОД» at 1024) and wrapped the long values no less. At 1024 px and wider every list has that room
   but «Ждут «Демонтировано»», whose eight columns (the date box, the button, the place's 160 px) need about 1040 px
   on one line of heads: it keeps them whole from 1180 px, and narrower its heads wrap as the table needs, as every
   list's do under 1024 px (wave 1's Show, W-5) */
@media (min-width: 1024px) {
  :is(.montage-list, .dmc-list, .pipeline-list) > thead > tr > th { white-space: nowrap; }
}
@media (min-width: 1180px) {
  .demount-list > thead > tr > th { white-space: nowrap; }
}
/* «Ждут «Демонтировано»»: the date typed in the row */
.demount-list td:nth-child(3) { min-width: 160px; }
.demount-list input.date { width: 12ch; min-width: 0; }
/* a place that makes no ЦФО row, under «Установлено»'s groups: a quiet line */
.unmade { font-size: var(--text-sm); }

/* a construction's way, oldest first: the date in the margin, a rule running down the events */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid; grid-template-columns: 110px 1fr; gap: 2px var(--space-5);
  padding: var(--space-3) 0; border-top: var(--rule-hair);
}
.timeline li:first-child { border-top: 0; }
.timeline__when { grid-row: span 2; padding-right: var(--space-4); border-right: var(--rule-ink); font-variant-numeric: tabular-nums; font-size: var(--text-sm); color: var(--ink-2); text-align: right; }
.timeline__what { font-weight: var(--weight-bold); color: var(--ink); }
.timeline__detail { font-size: var(--text-sm); color: var(--ink-2); }
.timeline__detail .status { font-size: var(--text-sm); }
.timeline li[data-source="master"] .timeline__what { font-weight: var(--weight-regular); color: var(--ink-2); }
.timeline li:last-child .timeline__what { font-size: var(--text-lg); font-family: var(--font-display); }
/* the way sits on the sheet, not in a box: its rules are its frame; «заявок нет» after it on a hairline */
.timeline-wrap { margin-top: var(--space-5); }
.timeline-wrap > .no-requests { margin-top: var(--space-3); padding-top: var(--space-2); border-top: var(--rule-hair); font-size: var(--text-sm); }
.found-by { margin: 0 0 var(--space-2); font-size: var(--text-sm); }

/* ======================================================================= «Договор», «Загрузка ЦФО» */
/* the verdict: the one thing decided on a page («По сравнению с действующей»), in a block ruled as the main block, its
   status set large, the action signing the foot of the same block */
.verdict { margin: 0 0 var(--space-5); padding: var(--space-4) var(--space-5) 0; border: var(--rule-heavy); background: var(--surface); }
.verdict:not(:has(form)) { padding-bottom: var(--space-4); }
.verdict .facts { border: 0; padding: 0; }
.verdict .facts > div { flex-direction: column; align-items: flex-start; gap: var(--space-1); padding: 0; border: 0; inset-inline-start: 0; }
.verdict .facts dt { font-size: var(--text-xs); }
.verdict .facts .status { font-size: var(--text-lg); white-space: normal; line-height: 1.3; }
.verdict .actionbar { position: static; margin: var(--space-4) calc(-1 * var(--space-5)) 0; padding: var(--space-3) var(--space-5) var(--space-4); }
.verdict + .facts { margin-bottom: var(--space-3); }
/* files to download side by side under a ruled block */
.files { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; margin-top: var(--space-4); }
/* «Проверить» weighted by group, each group its own tbody: a strong group's line gets the amber edge (its rows are
   tinted already); a quiet group («Подставлено по правилу») reads in quiet ink. Every line stays (R-55). */
tbody.check-group--strong tr.table-group > td { box-shadow: inset 4px 0 0 var(--warn); }
tbody.check-group--quiet tr.table-group > td { background: var(--surface); border-top: var(--rule-hair); font-weight: var(--weight-regular); color: var(--ink-2); }
tbody.check-group--quiet td { color: var(--ink-2); font-size: var(--text-sm); }
.check-table td:first-child { white-space: nowrap; }
/* a repeat cell: a value repeating the row above («Было → стало»'s «Гиперссылка» of rows 2…n), in the quietest ink */
td.repeat { color: var(--ink-3); }
/* a ДМЦ's place's «Адрес» keeps room for a short address whole beside a long place (at 1024 «Договор» broke «ул. Новая,»
   over «5»); a long one wraps (the whole-system Show, W-7) */
:is(.dogovor-places, .dmc-lines) td[data-col="address"] { min-inline-size: 16ch; }

/* ======================================================================= login */
/* the desk, and on it one small sheet */
.login { min-height: 100vh; display: grid; place-items: center; padding: var(--space-5); }
.login__card {
  position: relative;
  width: 100%; max-width: calc(var(--space-8) * 6); padding: var(--space-6) var(--space-6) var(--space-6);
  background: var(--surface); border: 1px solid var(--sheet-edge); border-radius: var(--radius-sheet); box-shadow: var(--sheet-shadow);
}
.login__card h1 { font-size: var(--text-xl); }
.login__master { margin: var(--space-1) 0 var(--space-5); padding-bottom: var(--space-4); border-bottom: var(--rule-double); font-size: var(--text-sm); color: var(--ink-2); }
.login__card .notice { margin-bottom: var(--space-4); }
.login__card .field + .field { margin-top: calc(-1 * var(--space-4) - 1px); }   /* «Логин» and «Пароль» share a rule */
.login__card .btn--primary { width: 100%; margin-top: var(--space-2); }

/* ======================================================================= mockup furniture */
/* mockup furniture: the state headings, notes and frames between the drawn pages of mockups/ and design/sheet.html.
   Not part of any page: no drawing module writes these classes. */
.mock-sec { width: min(100% - 2 * var(--page-gutter), var(--page-max)); margin: var(--space-7) auto 0; }
.mock-sec:last-child, .mock-end { margin-bottom: var(--space-8); }
.mock-h { display: flex; align-items: baseline; gap: var(--space-3); margin: 0 0 var(--space-2); font: var(--weight-bold) var(--text-md)/1.3 var(--font-body); color: var(--ink-2); }
.mock-h::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }
.mock-note { margin: 0 0 var(--space-3); font-size: var(--text-sm); color: var(--ink-2); max-width: 110ch; }
.mock-sec > .page { width: auto; margin: var(--space-3) 0 0; }
.mock-sec > .page.page--centred { width: min(100%, calc(var(--space-8) * 9 + var(--page-pad) * 2)); margin-left: auto; margin-right: auto; }
.mock-sec .page > .mock-note { margin-top: var(--space-4); }
.mock-sec .appbar, .mock-sec .actionbar { position: static; }
.mock-sec .request > .request__head { position: static; }
/* a screen drawn whole (its top bar, or its top bar and its sheet) on a piece of desk */
.mock-frame { margin: var(--space-3) 0 0; border: 1px dashed var(--line-strong); background: var(--canvas); }
.mock-frame .appbar__inner { width: auto; padding: 0 var(--space-4); }
.mock-frame .page { width: auto; margin: var(--space-4); }
.mock-frame .page--centred { width: min(100% - 2 * var(--space-4), calc(var(--space-8) * 9 + var(--page-pad) * 2)); margin-left: auto; margin-right: auto; }
.mock-frame--1280 { width: 1280px; max-width: 100%; }
.mock-frame + .page { margin-top: 0; }
/* small states side by side */
.mock-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--space-4); }
.mock-cards > figure { margin: 0; display: grid; gap: var(--space-2); align-content: start; }
.mock-cards > figure > figcaption { font-size: var(--text-xs); color: var(--ink-2); }
.mock-cards > .login, .mock-frame .login { min-height: 0; padding: var(--space-6) var(--space-4); }
.mock-cards > .login { border: 1px dashed var(--line-strong); }
.mock-cards + .mock-note { margin-top: var(--space-3); }
.mock-end { height: 1px; }

/* ======================================================================= print */
/* a page prints as its tables, without the frame and without the controls' boxes, «ЦФО от» on its own line (S-38) */
@media print {
  html, body { background: var(--print-paper); }
  .appbar, .actionbar, .pager, .page-head__actions, .filters, .request__actions form, .request__actions .btn { display: none !important; }
  .print-master { display: block !important; margin: 0 0 var(--space-2); font-size: 9pt; color: var(--print-ink); }
  /* … one line, as it is read: «ЦФО от …», its « · » shown, the stale mark and its note; the link to «Загрузка ЦФО»
     (a step to click) not printed (slice 33's Show, S-3: three stacked lines and the link's words) */
  .print-master .appbar__stale, .print-master .appbar__stale > * { display: inline; }
  .print-master .appbar__stale .visually-hidden { position: static !important; width: auto; height: auto; overflow: visible; clip: auto; }
  .print-master .appbar__stale > span:has(> a) { display: none; }
  .print-master .appbar__stale .status { font-size: inherit; }
  .page { width: auto; margin: 0; padding: 0; border: 0; box-shadow: none; background: var(--print-paper); }
  :root { --group-key: 170px; }
  .page-head { padding-bottom: 6pt; margin-bottom: 8pt; }
  .group td:first-child, .group th:first-child { display: none; }
  /* D-172 (a): the found page prints what the request asks — «Для всех строк» with its chosen values, each group's
     «как для всех строк: …» / «свои: …» line — without the boxes, the ticks or the actionbar («Установлено»'s
     block for all rows stays off paper, as before) */
  .group--all:not(#request .group--all), #request .group input[type="checkbox"] { display: none; }
  .group__own > :not(summary), .group__own > summary > strong, .group__own > summary::before { display: none; }
  .group__own > summary { padding-left: var(--space-3); background: none; }
  #request .group--all .fields, #request .group--all .fields > *, #request .group--all .field { background: none; border: 0; outline: 0; }
  #request .group--all :is(select, input, textarea) { min-height: 0; padding-top: 0; background: none; border: 0; outline: 0; }
  #request .group--all select { padding-right: 0; }   /* no chevron on paper, so no room kept for it: the value whole */
  /* an empty box prints empty: a placeholder («дд.мм.гггг») is not a value written (slice 29's Show, S-3) */
  input::placeholder, textarea::placeholder { color: transparent; }
  /* controls disappear on paper (ui/rules.md 6): «Монтаж»'s «Ждут «Демонтировано»» prints its rows, not «Кто подаёт»
     with no name chosen nor a «Дата демонтажа» left empty; a name chosen or a date typed prints as written */
  #demontazh > .field--alone:has(select option[value=""]:checked), #demontazh td > input:placeholder-shown { display: none; }
  /* … and what is chosen or typed prints as plain text, as «Для всех строк»'s values do: no box, no chevron, no ring
     (slice 30's Show 2, N-1) */
  #demontazh > .field--alone, #demontazh :is(.field--alone select, td > input) { border: 0; background: none; outline: 0; box-shadow: none; }
  #demontazh :is(.field--alone select, td > input) { min-height: 0; padding-left: 0; padding-right: 0; }
  /* a ДМЦ's lines on paper: the three text columns share the width (each a fifth), the numbers and «Этаж» as narrow
     as their values, the mark the rest; a short address no longer squeezed onto three lines */
  .dmc-lines td:is([data-col="address"], [data-col="construction"], [data-col="place"]) { width: 20%; }
  .dmc-lines td:is(.num, [data-col="floor"]) { width: 1%; white-space: nowrap; }
  .dmc-lines th.num { width: 1%; white-space: normal; }  /* «Строк ЦФО» on two lines over its narrow figures */
  /* a panel holding nothing but controls, which do not print (base.css: button, .btn, .no-print), is not drawn: its
     frame would print as an empty ruled box («Заявка №n · Договор»'s files; slice 33's Show, S-1). A panel with words
     of its own stays */
  .panel:has(> :is(button, .btn)):not(:has(> :not(button, .btn, .no-print))) { display: none; }
  /* nothing sticks on paper */
  .request > .request__head, .group > legend { position: static !important; }

  /* breaks: a big block flows across pages (no quarter-page blanks); only rows and short heads stay whole */
  .group, .request, .panel, .preamble, .table-wrap, table, tbody, .verdict, .stack, .done-block { break-inside: auto; }
  tr, thead, .request__head, .group > legend, .group__facts > *, .asked--all, .section-title, .notice, .attention li, .timeline li, .action-list li { break-inside: avoid; }
  /* a group's line or a block's asked line never ends a page: it keeps at least its first row (the block's thead,
     with its asked line, is repeated on the next page) */
  thead { display: table-header-group; }
  .group > legend, .group__facts > *, thead, tr.asked, tr.req-head, tr.table-group, .request__head, .asked--all,
  .section-title, h2, h3 { break-after: avoid; }
  tbody > tr:first-child { break-before: avoid; }
  .request > .table-wrap, .request > .count-block { break-before: avoid; }
  /* a group's line in block flow on paper (a grid's rows do not keep together across a page break): the hyperlink
     cell floats at the left of the line's other cells, and the line keeps its first row with it */
  .group:not(.group--all) { display: block; }
  .group:not(.group--all) > legend { float: left; width: var(--group-key); }
  .group:not(.group--all) > .group__facts { display: flex; margin-left: var(--group-key); break-after: avoid; }
  .group:not(.group--all) > .table-wrap { clear: both; break-before: avoid; }

  .group:not(.group--all) > legend, .group__facts, .request__head, .req-table tr.asked > td, tr.table-group > td { background: var(--print-paper); }
  /* D-182 (c): the split head's facts line prints as the one head's did, with its title and over its lines */
  .request--split > .request__facts { background: var(--print-paper); break-inside: avoid; break-after: avoid; }
  tr[data-state="warn"] > td { background: var(--print-paper); }
  /* a marked row keeps its edge: the browser drops box-shadow on paper, so the edge is a border here (in a group the
     tick column is not printed, so the edge moves to the monitor number) */
  tr[data-state="warn"] > td:first-child, tr[data-state="bad"] > td:first-child,
  .group tr[data-state="warn"] > td:nth-child(2), .group tr[data-state="bad"] > td:nth-child(2),
  .group:has(tr[data-state="warn"]) > legend, .group:not(.group--all):has([aria-invalid="true"]) > legend,
  .action-list li, .attention-panel, tbody.check-group--strong tr.table-group > td { border-left: 3pt solid var(--print-ink); }
  .mark, .mark::before { color: var(--print-ink); background: none; }
  /* still paper: the visa prints at full strength, whatever moment the page was printed in */
  .visa, .grif, .notice--gives-visa ~ .page-head > .visa--waiting, .notice--gives-visa ~ .page-head > .visa--given, .visa--land { animation: none !important; opacity: 1; transform: none; }
  /* a notice (a confirmation, a refusal, a warning, a restored draft) is of the moment, not of the record: on paper
     none is drawn, its «…ниже» pointing to no form that prints (no page's Prints line in brief.md names a notice;
     slice 31's Show 3) */
  .notice { display: none !important; }
  .mock-sec, .mock-h, .mock-note { display: none !important; }
}

/* slice 53: «Изменение сведений», the manager's form (design-edits main, found, many, check): a changed field's «было в
   ЦФО», a group of columns headed by its title, the columns ticked on the page of many hyperlinks, a cell's own box */
.field__was--cfo::before { content: "было в ЦФО: "; }
.family { grid-column: 1 / -1; display: flex; align-items: baseline; gap: var(--space-3); margin: var(--space-5) 0 var(--space-2); }
.family h3 { margin: 0; }
.family .muted { font-size: var(--text-sm); }
.picks { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 var(--space-4); padding: 0; list-style: none; }
.pick { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: var(--text-sm); cursor: pointer; }
.pick--on { border-color: var(--ink); background: var(--accent-soft); font-weight: var(--weight-bold); }
td > input.cell-box, td > textarea.cell-box, td > select.cell-box { width: 100%; min-height: 30px; padding: 3px 8px; border: 1px solid var(--line-strong); background: var(--surface); font: inherit; }
td > input.cell-box--held, td > textarea.cell-box--held, td > select.cell-box--held { background: var(--band); color: var(--ink-2); }
.group table.cells th:first-child, .group table.cells td:first-child { width: auto; padding-left: var(--row-px); padding-right: var(--row-px); }
.group table.cells thead th { white-space: normal; }
.group tr:has(input.cell-box) > td:not(:has(input.cell-box)) { padding-top: 10px; }
.group tr:has(input.cell-box) > td:has(> input[type=checkbox]) { padding-top: 11px; }
.fields--grid > .fields__fill { background: var(--surface); }
.fields--grid > .fields__fill--2 { grid-column: span 2; }
.fields--grid > .fields__fill--3 { grid-column: span 3; }

/* slice 53 (request pages): a request «Изменение сведений» after it is sent (design-edits sent, entered, approve,
   queue): what was and what will be in a change's line, and the hyperlinks of one value folded under the open ones */
.was { color: var(--ink-2); }
.now { font-weight: var(--weight-bold); color: var(--ink); }
.to { color: var(--ink-3); padding: 0 4px; }
.fold--rest > summary { display: flex; align-items: baseline; gap: var(--space-2); padding: var(--space-2) var(--space-3); }
.fold--rest > summary strong { white-space: nowrap; }
/* the table of an edits request's changes, on its page and in the approvers' block: fixed column widths, so a monitor
   number, a value and the marks each keep room (tsfo/pages/edits_view.py → WIDTHS) */
.req-table--edits { table-layout: fixed; width: 100%; }
.req-table--edits tr.req-head > th:nth-child(1) { width: 13%; }
.req-table--edits tr.req-head > th:nth-child(2) { width: 15%; }
.req-table--edits tr.req-head > th:nth-child(3) { width: 23%; }
.req-table--edits tr.req-head > th:nth-child(4) { width: 25%; }
.req-table--edits tr.req-head > th:nth-child(5) { width: 24%; }
.req-table--edits td { overflow-wrap: anywhere; }

/* slice 54: «Согласование сведений» (the approvers' edits card) */
/* mockups/approver-edits.html, redrawn by W-0212b-7 (the walk of 02.12.2026 (b)). A request «Изменение сведений»
   waiting on the approvers' tab: the head of every request in a list (its flag «Требуют внимания: K» beside the chip),
   the comment, then one block «Что меняется»: ONE table, a line per column and «станет» («Столбец ЦФО» on its first
   line, «Было в ЦФО», «Станет», «Где»), a marked line amber with its marks under it; then ONE fold «Все изменения по
   гиперссылкам» (<details>, no script): a flat table, a line per hyperlink. Long values wrap; nothing is cut. */
.request__head > .edits-flag { align-self: center; font-size: var(--text-sm); }
.edits-body > h4 { margin-bottom: var(--space-2); }
.edits-sum__table, .edits-all__table { table-layout: fixed; }
.edits-sum__table td, .edits-all__table td { overflow-wrap: anywhere; }
.edits-sum__table th:nth-child(1) { width: 19%; }
.edits-sum__table th:nth-child(2) { width: 29%; }
.edits-sum__table th:nth-child(3) { width: 29%; }
.edits-sum__table td.where { color: var(--ink-2); font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.edits-was-list { margin: 0; padding: 0; list-style: none; }
.edits-was-list li + li { margin-top: 2px; }
.edits-was-list .muted { font-size: var(--text-sm); white-space: nowrap; }
/* a line and its marks read as one: no rule between them, one hover */
.edits-sum__table tr:has(+ tr.edits-sum__marks) > td { border-bottom: 0; padding-bottom: var(--space-1); }
.edits-sum__table tr.edits-sum__marks > td { padding-top: 0; }
.edits-sum__table > tbody:hover > tr:not([data-state]) > td { background: var(--hover); }
.edits-sum__table > tbody:hover > tr[data-state="warn"] > td { background: color-mix(in oklch, var(--warn-soft) 82%, var(--warn)); }
.edits-sum__table tr[id] { scroll-margin-top: calc(var(--bar-bottom) + var(--space-8) * 3); }
/* the fold: one flat table under the summary, quieter; «было → станет» in a cell */
.edits-all { margin: 0 0 var(--space-3); }
.edits-all > summary { display: flex; align-items: baseline; gap: var(--space-2); padding: var(--space-1) var(--space-1); margin-left: calc(-1 * var(--space-1)); }
.edits-all > summary .muted { font-size: var(--text-sm); }
.edits-all > .table-wrap { margin-top: var(--space-2); }
.edits-all__table { font-size: var(--text-sm); }
.edits-all__table thead th { position: static; }
.edits-all__table th:nth-child(1) { width: 8.5rem; }
.edits-all__table th:nth-child(2) { width: 16%; }
.edits-all__table--long th:nth-child(3) { width: 19%; }
.edits-all__table td.key b { font-variant-numeric: tabular-nums; }
.edits-all__table td.change .now { font-weight: var(--weight-bold); }
.edits-all__table--long > tbody + tbody > tr:first-child > td { border-top: var(--rule-hair); }
/* the top bar between 1280 and 1439 px (wrap-up of 02.12.2026, for the owner's review): the approvers' seven tabs keep
   the bar's one row without scrolling the page sideways — the tabs and the bar's gaps tighter, the same on every login */
@media (min-width: 1280px) and (max-width: 1439.98px) {
  .appbar__inner { column-gap: var(--space-3); }
  .appbar__nav a, .appbar__nav span[aria-disabled="true"] { padding-left: var(--space-2); padding-right: var(--space-2); font-size: calc(var(--text-md) - 1px); }
  .appbar__user { gap: var(--space-2); }
}

/* slice 54: «Изменение сведений», the manager's form */
/* the sweep of 02.12.2026, items 5 to 7, and the walk's W-1. «Что меняем»: each group's title over its boxes, every
   group's boxes on one set of equal columns (one minimum width, so the columns stand at the same x in every group), a
   long name wrapping inside its box; a box ticked shows so before the round trip too */
.picks-group { margin: 0 0 var(--space-3); }
.picks-group > h4 { margin: 0 0 var(--space-1); }
.picks--grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: 6px; margin: 0; }
.picks--grid > li { display: flex; min-width: 0; }
.picks--grid .pick { flex: 1; align-items: flex-start; min-width: 0; padding: 6px 10px; line-height: 1.3; }
.picks--grid .pick > input { flex: none; margin-top: 1px; }
.picks--grid .pick > span { min-width: 0; overflow-wrap: anywhere; }
.pick:has(> input:checked) { border-color: var(--ink); background: var(--accent-soft); }
.picks-show { margin: var(--space-3) 0 var(--space-4); }
/* one block per ticked column: its name, its one value for all, then a line per hyperlink on fixed shares of the
   page, so nothing is wider than the page; a value wraps in its cell, the own box takes its cell whole */
.edits-note { margin: 0 0 var(--space-2); font-size: var(--text-sm); }
.edits-block { margin: var(--space-5) 0 0; padding-top: var(--space-3); border-top: var(--rule-ink); }
.edits-block > h3 { margin: 0 0 var(--space-2); overflow-wrap: anywhere; }
.edits-block > .fields { margin-bottom: var(--space-2); }
.edits-lines { table-layout: fixed; width: 100%; }
.edits-lines th:nth-child(1) { width: 36px; }
.edits-lines th:nth-child(2) { width: 7.5rem; }
.edits-lines th:nth-child(3) { width: 21%; }
.edits-lines th:nth-child(4) { width: 25%; }
.edits-lines th:nth-child(5) { width: 25%; }
.edits-lines td { overflow-wrap: anywhere; }
.edits-lines td:first-child, .edits-lines th:first-child { padding-left: var(--space-2); padding-right: 0; }
.edits-lines td:first-child > input { margin-top: 6px; }
.edits-lines td.was { white-space: normal; }
/* W-0212b-5: under a hyperlink found by monitor numbers, those numbers, quiet; they wrap inside the column */
.edits-lines td.link > .edits-monitors { display: block; font-size: var(--text-sm); font-weight: var(--weight-regular); color: var(--ink-2); white-space: normal; }
.edits-lines td.link > .edits-monitors > span { white-space: nowrap; }
/* W-0212b-4: a line's own «Ответственный менеджер» is a list: its chevron kept on the line's box (td > select.cell-box
   draws the box's background whole) */
.edits-lines td > select.cell-box {
  padding-right: 32px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
/* a hyperlink taken off the request: its lines struck through in every block (the tick is one, EDITS_SCRIPT) */
.edits-lines tr:has(> td > input[data-on]:not(:checked)) > td:not(:first-child) { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-strong); }
/* W-1: a box of several lines is as tall as its value wherever the browser can size it so (the server's rows stand
   elsewhere); a table of rows shares the page's width, so a value's box never pushes it wider */
#edits .fields textarea, #edits .edits-lines textarea, #edits table.cells textarea { field-sizing: content; }
#edits table.cells { table-layout: fixed; width: 100%; }
#edits table.cells td { overflow-wrap: anywhere; }
