/* Сопоставительная ведомость -- operator screen styles.

   Base layout/color language/component shapes are a faithful port of the
   approved prototype (docs/prototypes/matching-screen.html) -- this is a
   refinement pass, not a redesign (see this branch's task brief). Additions
   over the prototype are grouped below each already-existing block and
   commented with which requirement introduced them:
     - "polish table" = the coordinator-approved Before/After/Why table
       (transitions, :active, row-level status transition, dialog entrance,
       @media(hover:hover) guard).
     - "craft-floor" / "operate" = impeccable skill's reference/craft-floor.md
       and reference/operate.md, applied after the coordinator re-read them
       mid-task (full component states, themed focus rings, loading/error
       states, motion timing 150-250ms, the Refuse list for NEW surfaces
       this task adds that the prototype never had, e.g. the upload form).

   Deliberately light-only (color-scheme: light), matching the prototype's
   own committed, uncontested world -- there is no dark-mode requirement
   anywhere in this product's brief. */

:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #fff;
  --ink: #16191d;
  /* Затемнён 2026-08-26 с #6b7280 по находке аудита. Прежний давал на белом
     4,83 и проваливался ниже порога AA 4,5 на любой подкрашенной подложке:
     4,23 на плашке расхождения, 4,25 на подсветке кандидата, 4,35 на
     зелёной строке. Этот проходит на всех фонах продукта, худший — 4,97. */
  --muted: #616772;
  --line: #e3e6ea;
  --accent: #1f5fa9;
  --accent-soft: #eaf1fa;
  --warn-bg: #fff8e6;
  --warn-line: #e8c766;
  --warn-ink: #8a5d00;
  --ok: #1f7a45;
  --ok-bg: #eaf6ee;
  --err: #c0392b;
  --err-bg: #fdecea;
  --radius: 8px;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  /* craft-floor: themed focus ring, not the browser default blue */
  --focus-ring: #1f5fa9;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.45 -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.wrap {
  max-width: 1560px;
  margin: 0 auto;
  padding: 18px;
}

.wrap--narrow {
  max-width: 30rem;
  padding-top: 3rem;
}

h1 {
  font-size: 16px;
  margin: 0 0 8px;
}

/* craft-floor "Browser surfaces": theme selection and scrollbars from the
   palette instead of leaving browser defaults -- cheap, easy-to-miss signal
   that the page was actually built. */
::selection {
  background: var(--accent);
  color: #fff;
}

.tablewrap {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.tablewrap::-webkit-scrollbar {
  height: 10px;
}

.tablewrap::-webkit-scrollbar-track {
  background: transparent;
}

.tablewrap::-webkit-scrollbar-thumb {
  background: var(--line);
  border-radius: 999px;
}

.tablewrap::-webkit-scrollbar-thumb:hover {
  background: var(--muted);
}

/* ---------------------------------------------------------------------- */
/* Document header / meta                                                  */
/* ---------------------------------------------------------------------- */

header.doc {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 12px;
}

.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 4px 22px;
  color: var(--muted);
  font-size: 12.5px;
}

.meta b {
  color: var(--ink);
  font-weight: 600;
}

/* ---------------------------------------------------------------------- */
/* Counters bar / filters                                                  */
/* ---------------------------------------------------------------------- */

.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.bar--filters {
  margin-top: -4px;
}

.stat {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 12px;
  min-width: 132px;
}

.stat .n {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat .l {
  color: var(--muted);
  font-size: 11.5px;
  margin-top: 2px;
}

.stat.warn {
  background: var(--warn-bg);
  border-color: var(--warn-line);
}

.stat.warn .n {
  color: var(--warn-ink);
}

.stat.err {
  background: var(--err-bg);
  border-color: var(--err);
}

.stat.err .n {
  color: var(--err);
}

.spacer {
  flex: 1;
}

.filters {
  display: flex;
  gap: 5px;
}

.filters button.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

/* ---------------------------------------------------------------------- */
/* Buttons -- full component-state coverage (operate.md):                  */
/* default, hover, focus, active, disabled, loading                        */
/* ---------------------------------------------------------------------- */

button {
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 6px 11px;
  font-size: 13px;
  /* polish table: alive, not an instant snap. operate.md tightens the
     range to 150-250ms for Operate-mode surfaces specifically. */
  transition: transform 160ms ease-out, background 150ms ease, border-color 150ms ease, opacity 150ms ease;
}

button:hover {
  border-color: var(--muted);
}

button.primary:hover {
  filter: brightness(0.94);
}

/* polish table: physical feedback that a click registered. */
button:active {
  transform: scale(0.97);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

button.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

button.primary[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

button.ghost {
  background: transparent;
}

button.mini {
  padding: 3px 8px;
  font-size: 12px;
}

/* craft-floor: themed focus ring on every interactive control, not the
   browser default blue outline (which clashes with this palette). Uses
   :focus-visible so a mouse click never shows a ring, only keyboard/AT
   navigation does. */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 4px;
}

a {
  color: var(--accent);
}

.button-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  /* Та же причина, что у .app-shell__brand: 19px при пороге 24. На странице
     ошибки это единственный выход с экрана. */
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.button-link:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------- */
/* Table                                                                    */
/* ---------------------------------------------------------------------- */

.tablewrap {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 1480px;
}

th,
td {
  padding: 7px 9px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  background: #fafbfc;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  position: sticky;
  top: 0;
}

td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tr.row {
  transition: background 150ms ease;
}

tr.row:hover {
  background: #fafbfd;
}

tr.st-need {
  background: var(--warn-bg);
}

tr.st-confirm {
  background: #fffdf5;
}

tr.excluded {
  opacity: 0.5;
}

tr.excluded td.name {
  text-decoration: line-through;
}

/* polish table: status change is a textbook state-indication animation.
   A full outerHTML-swapped <tr> has no "previous state" a CSS `transition`
   can animate FROM (the old node is gone, this is a brand new one) -- an
   `animation`/`@keyframes` is the technically correct tool here, since it
   plays automatically on insertion regardless of prior state, unlike
   `transition`. Kept under operate.md's 150-250ms band. */
@keyframes row-flash {
  from {
    background-color: var(--accent-soft);
  }
}

tr.row-flash {
  animation: row-flash 220ms ease-out;
}

/* htmx loading state (craft-floor/operate: skeleton/inline indicator, never
   a spinner dropped into the middle of content) -- dim and disable the row
   being acted on while its own request is in flight. */
tr.htmx-request {
  opacity: 0.6;
  pointer-events: none;
}

.code {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}

.name {
  max-width: 290px;
}

.rasc {
  max-width: 230px;
  font-size: 12.5px;
}

.src {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.cmt {
  color: var(--accent);
  font-size: 11px;
  margin-top: 2px;
  font-style: italic;
}

/* craft-floor Refuse list: "Unicode glyphs or emoji standing in for an
   icon system" -- .cmt's leading mark was previously the HTML entity
   &#9998; (pencil); drawn as a one-weight stroked SVG instead so it reads
   as authored UI, not a font-dependent character. */
.cmt .ico {
  vertical-align: -1px;
  margin-right: 1px;
}

.muted {
  color: var(--muted);
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.tag.auto {
  background: var(--ok-bg);
  color: var(--ok);
}

.tag.hand {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag.need {
  background: #fdecc8;
  color: var(--warn-ink);
}

.tag.conf {
  background: #fff0cc;
  color: var(--warn-ink);
}

.tag.excl {
  background: #eceff1;
  color: var(--muted);
}

.diff {
  color: var(--err);
  font-weight: 700;
}

.conf-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.conf-bar i {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  width: 44px;
  position: relative;
  overflow: hidden;
}

.conf-bar i span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
}

.conf-bar i span.ok {
  background: var(--ok);
}

.conf-bar i span.mid {
  background: #d9a441;
}

.conf-bar i span.low {
  background: var(--err);
}

.conf-bar b.ok {
  color: var(--ok);
}

/* Полоска остаётся охристой, а ЧИСЛО — нет: #d9a441 на белом даёт 2,25:1
   при пороге 4,5. Это тот самый процент, по которому оператор решает,
   доверять ли сопоставлению, и читать его надо без прищура. */
.conf-bar b.mid {
  color: var(--warn-ink);
}

.conf-bar b.low {
  color: var(--err);
}

.conf-bar b {
  font-size: 12px;
}

.acts {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.acts form {
  display: contents;
}

/* ---------------------------------------------------------------------- */
/* Inline row-level error / global alerts                                  */
/* ---------------------------------------------------------------------- */

[role="alert"],
.alert {
  color: var(--err);
  border: 1px solid var(--err);
  border-radius: var(--radius);
  background: var(--err-bg);
  padding: var(--space-3);
  margin: 0 0 var(--space-3);
  font-size: 13px;
}

.alert--row {
  flex-basis: 100%;
  padding: 4px 8px;
  margin: 0 0 4px;
  font-size: 12px;
}

/* ---------------------------------------------------------------------- */
/* Manual-match dialog                                                     */
/* ---------------------------------------------------------------------- */

/* craft-floor / operate.md: this IS a deliberate, considered use of
   <dialog> (see report) -- a multi-select of candidates plus coefficient,
   formula, and comment fields is a defensible case for protected focus,
   and the results table's own overflow-x:auto would clip an absolutely-
   positioned inline dropdown, which is exactly when operate.md says to
   reach for <dialog>/popover/position:fixed instead. */
dialog.match-dialog {
  border: none;
  border-radius: 10px;
  padding: 0;
  width: min(700px, 95vw);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
  /* polish table: weighted opening, not the browser's abrupt default pop. */
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 200ms ease-out, transform 200ms ease-out, overlay 200ms ease-out allow-discrete, display 200ms ease-out allow-discrete;
}

dialog.match-dialog[open] {
  opacity: 1;
  transform: scale(1);
}

@starting-style {
  dialog.match-dialog[open] {
    opacity: 0;
    transform: scale(0.95);
  }
}

dialog.match-dialog::backdrop {
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  transition: opacity 200ms ease-out, overlay 200ms ease-out allow-discrete, display 200ms ease-out allow-discrete;
}

dialog.match-dialog[open]::backdrop {
  opacity: 1;
}

@starting-style {
  dialog.match-dialog[open]::backdrop {
    opacity: 0;
  }
}

.dh {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.dh h2 {
  margin: 0 0 3px;
  font-size: 15px;
}

.dh p {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.db {
  padding: 12px 18px;
  max-height: 50vh;
  overflow: auto;
}

.df {
  padding: 11px 18px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.cand-list {
  margin-bottom: 4px;
}

/* Этап 2 (№9): заголовки двух блоков диалога — «Предложения системы»
   (оценённые кандидаты с %) и «Все строки ресурсных ведомостей». */
.scored-title {
  margin: 9px 0 5px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--muted);
}

/* Процент схожести в строке оценённого кандидата. */
.cand .pct {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.cand {
  display: flex;
  gap: 9px;
  align-items: flex-start;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease;
}

/* polish table: avoid sticky-hover on touch devices. */
@media (hover: hover) and (pointer: fine) {
  .cand:hover {
    background: #f4f7fb;
  }
}

.cand.sel {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cand[hidden] {
  display: none;
}

.cand .t {
  font-size: 12.5px;
}

.cand .s {
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

/* The parent расценка gets a line of its own: it is what tells apart the
   71 % of candidates whose шифр, наименование and единица are identical,
   so it must not be lost at the tail of the ведомость/ед. line. */
.cand .parent {
  display: block;
}

label.k {
  display: block;
  margin-top: 9px;
  font-size: 12.5px;
}

/* Форма порогов (T7c) связывает подпись с полем через `for`, а не оборачивает
   его собой, — так подпись и подсказка `aria-describedby` читаются
   правильнее. Побочный эффект вскрыл аудит 2026-08-26: селектор `label.k
   input` такие поля не ловит, и они остались со стилями браузера — не как все
   поля продукта и высотой 21px при пороге цели 24 (WCAG 2.5.8, AA). Поэтому
   `.panel--form input[type="text"]` стоит рядом: одно оформление независимо
   от того, вложено поле в подпись или связано с ней ссылкой. */
label.k input,
label.k select,
label.k textarea,
.panel--form input[type="text"] {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  margin-top: 3px;
  background: var(--panel);
  color: var(--ink);
  /* 24px — минимальная цель по WCAG 2.5.8 (AA). Собственная типографика
     полей даёт 32px и порог перекрывает, но правило держит его явно: оно
     теперь общее для всех текстовых полей продукта. */
  min-height: 24px;
  transition: border-color 150ms ease;
}

label.k input:hover,
label.k select:hover,
label.k textarea:hover,
.panel--form input[type="text"]:hover {
  border-color: var(--muted);
}

label.k.inline input {
  width: 150px;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin-right: auto;
}

.note {
  background: var(--accent-soft);
  border: 1px solid #cddff2;
  border-radius: 8px;
  padding: 11px 13px;
  margin-top: 12px;
  font-size: 12.5px;
  color: #22415f;
}

.note b {
  color: #12314d;
}

/* ---------------------------------------------------------------------- */
/* Inline переброс (T12a reallocation) row                                 */
/* ---------------------------------------------------------------------- */

tr.realloc-slot td {
  border-bottom: none;
}

tr.realloc-slot[hidden] {
  display: none;
}

.realloc-form {
  background: var(--accent-soft);
  border: 1px solid #cddff2;
  border-radius: var(--radius);
  padding: 10px 12px;
  margin: 4px 0;
}

.realloc-form__title {
  margin: 0 0 6px;
  font-weight: 600;
  font-size: 12.5px;
  color: #12314d;
}

.realloc-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.realloc-form__row label.k {
  flex: 1 1 160px;
  margin-top: 0;
}

.realloc-form__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}

/* ---------------------------------------------------------------------- */
/* App shell (brand + logout)                                              */
/* ---------------------------------------------------------------------- */

.app-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4);
  max-width: 1560px;
  margin: 0 auto 12px;
  padding: var(--space-3) 18px;
}

.app-shell__brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
  /* 24px — минимальная цель по WCAG 2.5.8 (уровень AA). Своей типографикой
     ссылка набирала 20px: строка текста, а не цель. Исключение «инлайн в
     предложении» тут не работает — это самостоятельная ссылка в шапке. */
  display: inline-flex;
  align-items: center;
  min-height: 24px;
}

.app-shell__link {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: var(--radius);
}

.app-shell__link:hover,
.app-shell__link:focus-visible {
  background: var(--accent-soft);
}

.notice {
  color: var(--ok);
  border: 1px solid var(--ok);
  border-radius: var(--radius);
  background: var(--ok-bg);
  padding: var(--space-3);
  margin: 0 0 var(--space-3);
  font-size: 13px;
}

.linkbtn {
  color: var(--accent);
  text-decoration: none;
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.linkbtn:hover,
.linkbtn:focus-visible {
  background: var(--accent-soft);
}

.journal__state {
  white-space: pre-wrap;
  margin: 0;
  font: inherit;
  color: var(--muted);
}

/* ---------------------------------------------------------------------- */
/* MU5' -- jobs list screen. Shapes taken from the approved prototype      */
/* (docs/prototypes/my-jobs-screen.html: date cell, object/contract cell,  */
/* progress bar), expressed in this stylesheet's own tokens and reusing    */
/* .wrap/.bar/.stat/.tablewrap/.linkbtn as they already are.               */
/* ---------------------------------------------------------------------- */

.jobs-date {
  white-space: nowrap;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 12.5px;
}

.jobs-object {
  font-weight: 600;
}

.jobs-sub {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.section-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 20px 2px 8px;
}

.section-label:first-of-type {
  margin-top: 2px;
}

.jobs-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.jobs-filter input {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 10px;
  min-width: 12rem;
  background: var(--panel);
  color: var(--ink);
}

.jobs-filter input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.jobs-empty-block {
  padding: 12px 16px;
}

.lifecycle-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.lifecycle-actions form {
  margin: 0;
}

/* Both export controls as one block at the bar's right edge. margin-left:auto
   rather than relying on the .spacer above: .bar wraps, and on a wrapped line
   the spacer sits on an earlier row and no longer pushes anything right. */
.export-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.progress {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.progress i {
  display: block;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  width: 70px;
  position: relative;
  overflow: hidden;
}

.progress i span {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 3px;
}

.progress i span.ok {
  background: var(--ok);
}

.progress i span.mid {
  background: var(--warn-line);
}

.progress b {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.rescore {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.rescore .muted {
  font-size: 12px;
}

.app-shell__logout {
  margin: 0;
}

/* ---------------------------------------------------------------------- */
/* Upload screen -- same design system as the main table (coordinator      */
/* correction: this is the first thing a demo viewer sees, must not read  */
/* as a bare, unstyled form stitched onto a polished screen).              */
/* ---------------------------------------------------------------------- */

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}

.panel--form {
  max-width: 30rem;
  margin: 0 auto;
}

.panel__hint {
  color: var(--muted);
  font-size: 12.5px;
  margin: 0 0 var(--space-3);
}

.panel--form form {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.panel--form label.k {
  margin-top: 0;
}

.panel--form button.primary {
  padding: 8px 14px;
  align-self: flex-start;
}

/* Custom accessible file picker: the real <input type="file"> stays in the
   layout (focusable, keyboard-operable) but is made visually transparent
   and stretched over the styled control, so the browser's native locale-
   dependent chrome is never what the user sees -- only the Russian label.
   Ported pattern from old/app/static/style.css, restyled to this screen's
   panel/line/accent language instead of DMTR's own palette. */
.file-field__control {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  transition: border-color 150ms ease;
}

.file-field__control:focus-within {
  border-color: var(--accent);
}

.file-field__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-field__button {
  padding: 4px 10px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 12.5px;
  white-space: nowrap;
}

.file-field__status {
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The two resource inputs are alternatives, not a pair to fill in -- the
   route refuses an upload carrying both. This separator is the only thing
   on the form that says so at a glance; without it the two labels read as
   a list. Muted and centred so it reads as a relationship between the two
   controls rather than as a third field of its own. */
.file-field__or {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------------------------------------------------------------------- */
/* Busy indicator (htmx-driven page-level requests: upload submit)         */
/* ---------------------------------------------------------------------- */

.busy-status {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: #fff;
  background: var(--accent);
  padding: 4px;
  transform: translateY(-100%);
  transition: transform 150ms ease-out;
  z-index: 20;
}

.busy-status:not(:empty) {
  transform: translateY(0);
}

@media (max-width: 40rem) {
  .wrap {
    padding: 12px;
  }

  .app-shell {
    padding: var(--space-2) 12px;
  }

  .realloc-form__row {
    flex-direction: column;
  }
}

/* Убираем ДВИЖЕНИЕ, а не обратную связь.

   Прежний блок гасил всё подряд: `transition-duration: 0.01ms` и
   `animation-duration: 0.01ms` для `*`. Вместе с движением исчезали
   подсветка изменившейся строки (`row-flash`) и цветовой отклик кнопок —
   ровно те сигналы «здесь что-то произошло», ради которых они написаны.
   Человеку, попросившему меньше анимации, нужна не менее внятная система, а
   та же система без укачивания. Найдено аудитом impeccable
   (reference/audit.md, «Motion sensitivity»).

   Анимации НЕ гасятся: единственные `@keyframes` в этом файле — `row-flash`,
   и они меняют `background-color`, то есть движения в них нет вовсе.
   Переходы остаются для цвета, прозрачности и теней; `transform` уходит из
   списка, поэтому масштаб кнопки при нажатии, всплытие диалога и выезд
   индикатора занятости становятся мгновенными, а не исчезают. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-property: opacity, background-color, border-color, color, box-shadow, filter !important;
  }

  /* Нажатие кнопки: физический отклик убираем, цветовой остаётся выше. */
  button:active {
    transform: none;
  }
}

/* ---------------------------------------------------------------------- */
/* Виджет обратной связи (FB, tasks/FEEDBACK.md)                          */
/* ---------------------------------------------------------------------- */

/* Плавающая кнопка: fixed, потому что требование владельца — «видна на
   любом экране». Экран сопоставления скроллится на тысячи строк, и кнопка,
   уехавшая вместе с шапкой, видна только в самом верху. */
.fb-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 999px;
  color: #fff;
  padding: 10px 18px;
  font-size: 13px;
  box-shadow: 0 2px 10px rgb(0 0 0 / 18%);
  /* 44px — минимальный тач-таргет. Своей типографикой кнопка набирала 41px:
     остальные кнопки продукта ниже, но они лежат в плотных панелях рядом с
     таблицей, а эта одна и висит над контентом. Найдено аудитом impeccable. */
  min-height: 44px;
}

.fb-fab:hover,
.fb-fab:focus-visible {
  filter: brightness(1.08);
}

.fb-dialog {
  width: min(560px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 0;
}

.fb-dialog::backdrop {
  background: rgb(0 0 0 / 35%);
}

.fb-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  margin: 0;
}

.fb-title {
  margin: 0;
  font-size: 16px;
}

.fb-kinds {
  display: flex;
  gap: 8px;
}

.fb-kind {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 6px 11px;
  font-size: 13px;
  cursor: pointer;
}

.fb-kind:has(input:checked) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.fb-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
}

.fb-field textarea,
.fb-field input {
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 7px 9px;
  resize: vertical;
}

/* Подпись поля — один flex-элемент, иначе «(необязательно)» становится
   вторым элементом колонки и уезжает на свою строку. */
.fb-label {
  display: block;
}

.fb-required {
  color: var(--warn-ink);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11.5px;
  font-weight: 600;
}

.fb-optional {
  color: var(--muted);
  font-weight: 400;
}

.fb-ctx {
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.fb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Подсказка забирает свободное место, поэтому кнопки уходят вправо без
   отдельной распорки. */
.fb-hint {
  flex: 1;
  color: var(--muted);
  font-size: 12.5px;
}

/* На узком экране подсказка и две кнопки в один ряд не помещаются: подсказка
   ломается на три строки и вытесняет кнопки. Отдаём ей всю ширину — кнопки
   остаются одной парой. Замерено на 375px. */
@media (max-width: 480px) {
  .fb-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .fb-hint {
    flex: 1 0 100%;
  }
}
