/* Стили приложения. Перенесены из design/mockups/kit.css (часть «экран»); раскладка
   зависит от ширины .app (container queries), тема — от настроек устройства. */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #dce2df;
}

@media (prefers-color-scheme: dark) {
  body {
    background: #101614;
  }
}

/* ---------- Экран: токены ---------- */

.app {
  /* Стиль «Бланк» (design/mockups/style.html, вариант Б, выбран 2026-11-15): как бумажная
     ведомость — графы и линейки, заголовки книжным шрифтом, цифры обычным. */
  --bg: #dce2df;
  --surface: #fcfdfb;
  --surface-2: #eff4f1;
  --ink: #1d292c;
  --muted: #5a686b;
  --line: #afc2bb;
  /* Линейка бланка: двойная черта под шапкой и заголовком карточки, рамки граф. */
  --rule: #5e7a72;
  --full: #1f4e9e;
  --full-soft: #e3eaf6;
  --empty: #4a575b;
  --short: #b42318;
  --short-soft: #f8e3e0;
  --extra: #8a5a00;
  --extra-soft: #f6ecd6;
  --ok: #2d6a3c;
  --ok-soft: #e1eee4;
  --wait: #8a5a00;
  --warn-soft: #f6eecf;
  --focus: #1f4e9e;
  --primary: #1f4e9e;
  --primary-ink: #ffffff;
  --key-press: #d9e3f1;
  --radius-l: 3px;
  --radius-m: 3px;
  --radius-s: 2px;
  --font-head:
    Charter, "Bitstream Charter", "Sitka Text", "Iowan Old Style", Cambria, Georgia, serif;
  --tap: 64px;
  /* Высота шапки в одну строку: отступы 10 + кнопка 44 + 10 + двойная черта 3. По ней
     прилипают шапки таблиц и колонка клавиатуры — они встают под шапку, а не под неё. */
  --head-h: 67px;
  --zebra: var(--surface-2);

  container-type: inline-size;
  color-scheme: light;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  font:
    18px / 1.4 system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
}

@media (min-width: 1100px) and (pointer: fine) {
  .app {
    font-size: 15px;
    --tap: 44px;
  }
}

@media (prefers-color-scheme: dark) {
  .app {
    --bg: #101614;
    --surface: #18201d;
    --surface-2: #1f2925;
    --ink: #e1e7e3;
    --muted: #93a39d;
    --line: #33443e;
    --rule: #5f7a71;
    --full: #86aef5;
    --full-soft: #1b2a44;
    --empty: #b3bfba;
    --short: #f27b70;
    --short-soft: #3b1d1a;
    --extra: #e3b25a;
    --extra-soft: #372b12;
    --ok: #7cc58f;
    --ok-soft: #16301f;
    --wait: #e3b25a;
    --warn-soft: #353014;
    --focus: #86aef5;
    --primary: #86aef5;
    --primary-ink: #0e1a2e;
    --key-press: #26384f;
    color-scheme: dark;
  }
}

.app *:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Просьба «без движения» должна перебить всё. */
@media (prefers-reduced-motion: reduce) {
  .app * {
    /* biome-ignore lint/complexity/noImportantStyles: см. выше */
    animation: none !important;
    /* biome-ignore lint/complexity/noImportantStyles: см. выше */
    transition: none !important;
  }
}

/* ---------- Экран: каркас ---------- */

.app-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  min-height: var(--head-h);
  /* Разделы и «Вийти» всегда под рукой: шапка прилипает к верху экрана (замечание №4).
     Ниже выдвижной панели (z-index 10), выше прилипших шапок таблиц. */
  position: sticky;
  top: 0;
  z-index: 5;
}

.app-head h1 {
  font-size: 1.1em;
  margin: 0;
  font-weight: 700;
  flex: 1;
  min-width: 0;
}

.app-head .who {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.85em;
}

.app-main {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@container (min-width: 700px) {
  .app-main {
    padding: 24px;
  }
}

.app-main.narrow {
  width: 100%;
  max-width: 640px;
  margin-inline: auto;
}

.app-main.wide {
  width: 100%;
  max-width: 1240px;
  margin-inline: auto;
}

/* ---------- Знак бутля: залитый — полные, контур — пустые ---------- */

.btl {
  width: 0.95em;
  height: 1.3em;
  vertical-align: -0.25em;
  flex: none;
}

.btl.full {
  color: var(--full);
}

.btl.empty {
  color: var(--empty);
}

.kind {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}

/* ---------- Кнопки ---------- */

.btn {
  appearance: none;
  border: 2px solid transparent;
  border-radius: var(--radius-m);
  min-height: var(--tap);
  padding: 0 22px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
}

.btn-primary:active {
  filter: brightness(0.9);
}

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

.btn-quiet {
  background: transparent;
  color: var(--full);
  min-height: 44px;
  padding: 0 10px;
}

.btn-danger {
  background: var(--short);
  color: #fff;
}

.btn[disabled] {
  opacity: 0.55;
  cursor: default;
}

.btn-block {
  width: 100%;
}

.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-row > .btn {
  flex: 1 1 160px;
}

.spinner {
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 3px solid currentColor;
  border-right-color: transparent;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- Панели, сообщения ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 16px;
}

.notice {
  border-radius: var(--radius-m);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.notice strong {
  display: block;
}

.notice.warn {
  background: var(--warn-soft);
  border-color: transparent;
}

.notice.error {
  background: var(--short-soft);
  border-color: transparent;
  color: var(--ink);
}

.notice.ok {
  background: var(--ok-soft);
  border-color: transparent;
}

.notice .icon {
  font-weight: 800;
  font-size: 1.1em;
  line-height: 1.3;
}

.notice.error .icon {
  color: var(--short);
}

.notice.ok .icon {
  color: var(--ok);
}

.field-error {
  color: var(--short);
  font-weight: 600;
  font-size: 0.9em;
}

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

.small {
  font-size: 0.85em;
}

/* ---------- Плитки выбора (экспедитор, имя) ---------- */

.tiles {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}

.tile {
  appearance: none;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-l);
  min-height: 96px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  -webkit-tap-highlight-color: transparent;
}

.tile {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tile .tile-name {
  font-size: 1.45em;
  font-weight: 750;
  line-height: 1.1;
}

.tile .tile-sub {
  color: var(--muted);
  font-size: 0.85em;
}

.tile[aria-pressed="true"],
.tile[aria-checked="true"] {
  border-color: var(--full);
  background: var(--full-soft);
  box-shadow: inset 0 0 0 2px var(--full);
}

.tile:active {
  background: var(--key-press);
}

/* ---------- Большое число ---------- */

.bignum {
  font-size: 4.5em;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.02em;
  min-height: 1em;
}

.bignum.placeholder {
  color: var(--line);
}

.caret::after {
  content: "";
  display: inline-block;
  width: 0.06em;
  height: 0.8em;
  margin-left: 0.05em;
  background: var(--full);
  vertical-align: -0.05em;
  animation: blink 1s steps(1) infinite;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* Поле-число: подпись со знаком бутля + значение. Нажатие по всей рамке ставит курсор. */
.numfield {
  appearance: none;
  font: inherit;
  color: var(--ink);
  text-align: left;
  width: 100%;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-l);
  padding: 12px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  cursor: pointer;
  min-height: 84px;
}

.numfield .nf-label {
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 8px;
}

.numfield .nf-value {
  font-size: 2.4em;
  font-weight: 750;
  line-height: 1;
  min-width: 2.2ch;
  text-align: right;
  grid-row: span 2;
}

.numfield .nf-value:empty::before {
  content: "—";
  color: var(--line);
}

.numfield .nf-hint {
  font-size: 0.8em;
  color: var(--muted);
}

.numfield[aria-current="true"] {
  border-color: var(--full);
  box-shadow: inset 0 0 0 2px var(--full);
}

.numfield[aria-invalid="true"] {
  border-color: var(--short);
  box-shadow: inset 0 0 0 2px var(--short);
}

.numfield .field-error {
  grid-column: 1 / -1;
}

/* Системная клавиатура: обычное поле, но крупное. */
.sysfield label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  margin-bottom: 6px;
}

.sysfield input,
.sysfield select,
.sysfield textarea {
  font: inherit;
  font-size: 1.6em;
  font-weight: 700;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-m);
  padding: 8px 14px;
  width: 100%;
  min-height: var(--tap);
}

.sysfield textarea,
.sysfield select.textlike {
  font-size: 1em;
  font-weight: 400;
}

.sysfield input:focus {
  border-color: var(--full);
  outline: none;
  box-shadow: inset 0 0 0 2px var(--full);
}

.sysfield input[aria-invalid="true"] {
  border-color: var(--short);
}

.sysfield .nf-hint {
  font-size: 0.8em;
  color: var(--muted);
  margin-top: 4px;
}

.sysfield .field-error {
  margin-top: 6px;
  display: block;
}

/* ---------- Шаги ---------- */

.steps {
  display: flex;
  gap: 6px;
}

.steps i {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--line);
}

.steps i.done {
  background: var(--full);
}

.steps i.now {
  background: var(--full);
  opacity: 0.5;
}

/* Сводка введённого: строка «знак — подпись — число». */
.summary {
  display: grid;
  gap: 8px;
}

.summary .row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-m);
  background: var(--surface-2);
}

.summary .row .v {
  font-size: 2.2em;
  font-weight: 750;
  line-height: 1;
}

.summary .row.lead {
  background: var(--full-soft);
}

.summary .row.lead .v {
  font-size: 1.6em;
}

/* ---------- Таблицы (компьютер) ---------- */

.table-wrap {
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

table.t {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

table.t th,
table.t td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

table.t th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.85em;
  background: var(--surface-2);
}

table.t td.n,
table.t th.n {
  text-align: right;
}

table.t tr:last-child td {
  border-bottom: 0;
}

/* Чередование строк (замечание №5). Считаются только строки с данными: заголовок
   экспедитора, итог и строка причины под строкой (.sub) в счёт не идут, а строка причины
   красится как своя строка. */
table.t tbody tr:nth-child(even of :not(.group, .total, .sub)) > td,
table.t tbody tr:nth-child(even of :not(.group, .total, .sub)) + tr.sub > td {
  background: var(--zebra);
}

/* Шапка таблицы прилипает под шапку страницы (замечание №1). Внутри блока с прокруткой вбок
   прилипание работает только относительно самого блока, поэтому на широком экране, где
   таблица и так помещается, прокрутку вбок снимаем. На телефоне таблица листается вбок, а
   шапка прилипает внутри блока: он не выше экрана. */
table.t thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  /* При border-collapse черта у прилипшей ячейки пропадает — рисуем тенью. */
  box-shadow: inset 0 -1px 0 var(--line);
}

@container (max-width: 899px) {
  .table-wrap {
    max-height: 75dvh;
    overflow: auto;
  }
}

@container (min-width: 900px) {
  .table-wrap {
    overflow: visible;
  }

  table.t thead th {
    top: var(--head-h);
  }

  /* Без обрезки блоком углы шапки таблицы скругляем сами. */
  table.t thead th:first-child {
    border-top-left-radius: var(--radius-m);
  }

  table.t thead th:last-child {
    border-top-right-radius: var(--radius-m);
  }

  table.t tbody:last-child tr:last-child td:first-child {
    border-bottom-left-radius: var(--radius-m);
  }

  table.t tbody:last-child tr:last-child td:last-child {
    border-bottom-right-radius: var(--radius-m);
  }
}

.num-btn {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  color: inherit;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}

.num-btn:hover {
  background: var(--full-soft);
}

/* Расхождение: красный — не хватает, янтарный — лишние. */
.diff {
  font-weight: 750;
  white-space: nowrap;
}

.diff.short {
  color: var(--short);
}

.diff.extra {
  color: var(--extra);
}

.diff.zero {
  color: var(--ok);
  font-weight: 600;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.82em;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--ink);
}

.chip.short {
  background: var(--short-soft);
  color: var(--short);
}

.chip.warn {
  background: var(--warn-soft);
}

.chip.ok {
  background: var(--ok-soft);
  color: var(--ok);
}

/* ---------- Выдвижная панель (раскрытие цифры, поправка) ---------- */

.drawer-back {
  position: absolute;
  inset: 0;
  background: rgb(10 20 30 / 0.45);
  display: flex;
  justify-content: flex-end;
  z-index: 10;
}

.drawer {
  background: var(--surface);
  width: min(520px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: -12px 0 30px -12px rgb(0 0 0 / 0.4);
}

.drawer h2 {
  margin: 0;
  font-size: 1.25em;
}

.drawer .x {
  margin-left: auto;
}

.app-stage {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Формула: слагаемые столбиком, итог под чертой. */
.formula {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 4px 10px;
  align-items: baseline;
}

.formula .op {
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  min-width: 1ch;
}

.formula .val {
  text-align: right;
  font-weight: 700;
}

.formula .sum {
  border-top: 2px solid var(--ink);
  padding-top: 4px;
  font-weight: 800;
}

.entry-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.entry-list li {
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  font-size: 0.9em;
}

/* Фото-заглушка кузова. */
.photo {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-m);
  background: #1b252b;
}

.thumb {
  width: 56px;
  height: 42px;
  border-radius: 6px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  border: 0;
  padding: 0;
}

.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Ввод «экспедитор + числа» (forms.js) ---------- */
/* Поля и клавиатура на одном экране; на широком планшете клавиатура справа. */
.one {
  display: grid;
  gap: 14px;
}
.one .fields {
  display: grid;
  gap: 10px;
}
.tiles.row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.tiles.row .tile {
  min-height: 72px;
  padding: 8px 12px;
}
.tiles.row .tile .tile-name {
  font-size: 1.25em;
}
/* Без своей клавиатуры правая колонка не нужна: на широком экране форма просто не растягивается. */
@container (min-width: 1000px) {
  .one {
    max-width: 760px;
  }
}
.btn-row > .btn.x,
.btn-row > .btn-quiet {
  flex: none;
}

.date-pick {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

/* На телефоне три экспедитора в ряд: имя мельче, машина не нужна. */
@container (max-width: 520px) {
  .tiles.row .tile .tile-name {
    font-size: 1.05em;
  }

  .tiles.row .tile .tile-sub {
    display: none;
  }
}

/* Вкладки режима под шапкой: «Приїзд / Завантаження», «Перерахунок / Старт обліку». */
.mode-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  padding: 12px 16px 0;
}

.mode-bar button {
  appearance: none;
  font: inherit;
  font-weight: 700;
  font-size: 1.1em;
  min-height: 60px;
  border-radius: var(--radius-m);
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.mode-bar button[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

@container (min-width: 700px) {
  .mode-bar {
    padding: 16px 24px 0;
  }
}

.tile .tile-flag {
  color: var(--extra);
  font-weight: 700;
}

/* ---------- Дополнения приложения (в макетах этого не было: там всё рисовал JS) ---------- */

/* Классы с display перебивают атрибут hidden — возвращаем ему силу. */
[hidden] {
  /* biome-ignore lint/complexity/noImportantStyles: hidden должен скрывать всегда */
  display: none !important;
}

.app-head form {
  display: inline;
}

/* Плитка экспедитора — радиокнопка: форма работает и без JS. */
.tile {
  position: relative;
}

.tile > input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.tile:has(> input:checked) {
  border-color: var(--full);
  background: var(--full-soft);
  box-shadow: inset 0 0 0 2px var(--full);
}

.tile:has(> input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

a.tile {
  text-decoration: none;
}

/* «Чекає завантаження» видно и на телефоне, где машину под именем прячем. */
@container (max-width: 520px) {
  .tiles.row .tile .tile-sub.tile-flag {
    display: block;
    font-size: 0.75em;
  }
}

/* Поле-число — настоящее поле ввода, цифры — системной клавиатурой (`inputmode="numeric"`). */
.numfield {
  cursor: text;
}

.numfield .nf-value {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 2.4em;
  font-weight: 750;
  width: 3.4ch;
  padding: 0;
}

.numfield .nf-value::placeholder {
  color: var(--line);
}

.numfield .nf-value:focus {
  outline: none;
}

.numfield:focus-within {
  border-color: var(--full);
  box-shadow: inset 0 0 0 2px var(--full);
}

.numfield .nf-label {
  grid-column: 1;
}

.numfield .nf-hint {
  grid-column: 1;
}

.mode-bar a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1em;
  min-height: 60px;
  border-radius: var(--radius-m);
  border: 2px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.mode-bar a[aria-current="page"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn {
  text-decoration: none;
}

.big-btn {
  min-height: 88px;
  font-size: 1.25em;
}

/* ---------- Вход ---------- */

.login {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
}

.login h2 {
  font-size: 1.5em;
  margin: 0;
}

.pin-head {
  text-align: center;
}

.pin-head .nm {
  font-size: 2em;
  font-weight: 800;
}

.pin-input {
  font: inherit;
  font-size: 2em;
  text-align: center;
  letter-spacing: 0.5em;
  width: 100%;
  max-width: 420px;
  margin-inline: auto;
  display: block;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
}

.pin-submit {
  max-width: 420px;
  margin: 12px auto 0;
}

.role-group + .role-group {
  margin-top: 12px;
}

/* ---------- Вечерний остаток (из evening.html) ---------- */

.day-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

.day-line b {
  font-size: 1.15em;
}

.photo-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 200px;
  border: 3px dashed var(--line);
  border-radius: var(--radius-l);
  background: var(--surface);
  color: var(--ink);
  font-weight: 700;
  font-size: 1.15em;
  cursor: pointer;
  text-align: center;
  padding: 16px;
}

.photo-btn[aria-invalid="true"] {
  border-color: var(--short);
}

.photo-btn input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.photo-btn .cam {
  font-size: 2.6em;
  line-height: 1;
}

.two {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr 1fr;
}

.two .sysfield input {
  font-size: 2.2em;
  text-align: center;
  padding: 6px;
}

.progress {
  height: 10px;
  border-radius: 5px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  background: var(--primary);
  width: 0;
  transition: width 0.12s linear;
}

.big-status {
  text-align: center;
  padding: 18px 8px;
}

.big-status .icon {
  font-size: 3em;
  font-weight: 800;
  line-height: 1;
}

.big-status h2 {
  margin: 6px 0;
  font-size: 1.5em;
}

.big-status.ok .icon,
.big-status.ok h2 {
  color: var(--ok);
}

.big-status.queued .icon,
.big-status.queued h2 {
  color: var(--extra);
}

.pair {
  display: flex;
  justify-content: center;
  gap: 24px;
  font-size: 1.2em;
}

.pair b {
  font-size: 1.8em;
}

/* ---------- Итог дня (из day-total.html) ---------- */

.dt-top {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
}

.dt-top h2 {
  margin: 0;
  font-size: 1.3em;
}

table.t input {
  font: inherit;
  font-size: 1.3em;
  font-weight: 700;
  width: 5.5ch;
  text-align: right;
  padding: 6px 8px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

table.t input:focus {
  outline: none;
  border-color: var(--full);
}

table.t input[aria-invalid="true"] {
  border-color: var(--short);
}

table.t input[readonly] {
  border-color: transparent;
  background: transparent;
}

table.t td .field-error {
  display: block;
  font-size: 0.8em;
  max-width: 16ch;
  margin-left: auto;
  text-align: right;
}

.th-sub {
  display: block;
  font-weight: 400;
  font-size: 0.9em;
}

.row-status {
  white-space: nowrap;
}

.reason-row td {
  background: var(--surface-2);
}

table.t .reason-row input {
  width: 100%;
  text-align: left;
  font-size: 1em;
  font-weight: 400;
}

@container (max-width: 699px) {
  table.t th.n:nth-child(n + 2):not(:last-child) .th-sub {
    display: none;
  }
}

/* ---------- Пользователи ---------- */

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.inline-form select,
.inline-form input {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
}

.inline-form input[inputmode="numeric"] {
  width: 6ch;
}

.inline-form .btn {
  min-height: 40px;
}

/* ---------- Разделы директора в шапке ---------- */

.app-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.app-nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: var(--radius-s);
  font-weight: 600;
  font-size: 0.9em;
}

.app-nav a:hover {
  background: var(--surface-2);
}

.app-nav a[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
}

/* ---------- Выдвижная панель страницы: открывается адресом, закрывается ссылкой ---------- */

.drawer-back.page {
  position: fixed;
}

.drawer-shade {
  flex: 1;
}

a.num-btn {
  display: inline-block;
}

a.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: default;
}

/* ---------- Отчёт (макет report.html, вариант Б) ---------- */

.rp-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: center;
}

.rp-day {
  display: flex;
  align-items: center;
  gap: 6px;
}

.rp-day h2 {
  margin: 0;
  font-size: 1.3em;
  min-width: 12ch;
  text-align: center;
}

.rp-day .btn {
  min-height: 44px;
  padding: 0 14px;
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface);
}

.seg a {
  padding: 8px 14px;
  color: var(--ink);
  text-decoration: none;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
}

.seg a + a {
  border-left: 1px solid var(--line);
}

.seg a[aria-current="true"] {
  background: var(--ink);
  color: var(--bg);
}

.rp-pair {
  display: grid;
  gap: 2px;
}

.rp-pair > span {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-content: flex-end;
  white-space: nowrap;
}

.rp-grid .rp-pair > span,
.entry-list .rp-pair > span,
.notice .rp-pair > span,
.closure-form .rp-pair > span,
.photo-caption .rp-pair > span {
  justify-content: flex-start;
}

.entry-list .rp-pair,
.why-h3 .rp-pair,
.closure-form p .rp-pair,
.photo-caption .rp-pair {
  display: inline-flex;
  gap: 12px;
  vertical-align: middle;
}

.marks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.guess {
  font-size: 0.85em;
  color: var(--muted);
}

.rp-cards {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.rp-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rp-card.bad {
  border-color: var(--short);
  box-shadow: inset 4px 0 0 var(--short);
}

.rp-card.wait {
  box-shadow: inset 4px 0 0 var(--wait);
}

.rp-card header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.rp-card header h3 {
  margin: 0;
  font-size: 1.35em;
}

.rp-verdict {
  font-size: 1.5em;
  font-weight: 800;
  line-height: 1.15;
}

.rp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.rp-grid > div {
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 8px 10px;
}

.rp-grid .k {
  font-size: 0.78em;
  color: var(--muted);
  display: block;
  margin-bottom: 2px;
}

.rp-small {
  color: var(--muted);
  font-size: 0.88em;
}

.rp-control {
  display: grid;
  gap: 6px;
}

.rp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.rp-actions .btn {
  min-height: 40px;
  padding: 0 14px;
  flex: 1 1 auto;
}

.why-h3 {
  margin: 6px 0 0;
  font-size: 1em;
  display: flex;
  gap: 6px;
  align-items: center;
}

.closure-form {
  display: grid;
  gap: 14px;
}

.closure-form fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.closure-form legend,
.closure-form .cl-h {
  font-weight: 650;
  margin-bottom: 6px;
}

.closure-form label.r {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.closure-form label.r:has(input:checked) {
  border-color: var(--full);
  background: var(--full-soft);
}

.closure-form .amts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.closure-form .sysfield input {
  font-size: 1.3em;
}

tr.group td {
  background: var(--surface-2);
  font-weight: 700;
}

tr.total td {
  font-weight: 700;
  border-top: 2px solid var(--ink);
}

/* ---------- Журнал (макет journal.html, вариант А) ---------- */

.jr-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
}

.jr-filters select {
  font: inherit;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  min-height: 40px;
}

.jr-filters label.cb {
  display: flex;
  gap: 6px;
  align-items: center;
}

tr.gone td {
  color: var(--muted);
}

tr.gone .vals b {
  text-decoration: line-through;
}

tr.amend td:first-child {
  box-shadow: inset 4px 0 0 var(--full);
}

.vals {
  font-size: 0.92em;
}

.jr-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.jr-actions .btn {
  min-height: 36px;
  padding: 0 10px;
  font-size: 0.9em;
}

.amend-form {
  display: grid;
  gap: 14px;
}

.fix-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.fix-grid .sysfield input {
  font-size: 1.3em;
}

@container (min-width: 1000px) {
  .jr-actions {
    flex-wrap: nowrap;
  }
}

/* На телефоне разделы — отдельной строкой под заголовком, иначе налезают на него. Заголовок
   не уже самого длинного слова: «Контрольний перерахунок» иначе вылезал под «Вносить». */
@container (max-width: 640px) {
  .app-head {
    flex-wrap: wrap;
  }

  .app-head h1 {
    min-width: min-content;
  }

  .app-nav {
    order: 3;
    width: 100%;
  }
}

/* ---------- Працівники: панель правки и выданный PIN ---------- */

.uform {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.uform label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-weight: 650;
}

.uform label input,
.uform label select {
  font: inherit;
  font-weight: 400;
  min-height: 44px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-s);
  background: var(--surface);
  color: var(--ink);
}

/* Новый работник: поля в ряд, на телефоне — столбиком. Подсказка под полем, а не в нём:
   в узком поле подсказка обрезалась. */
.uform.hire {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  align-items: start;
}

.uform.hire .btn {
  align-self: start;
  margin-top: 1.4em;
}

.uform .hint {
  color: var(--muted);
  font-size: 0.85em;
  font-weight: 400;
}

.uform input[name="pin"] {
  width: 6em;
  letter-spacing: 0.15em;
}

.uform.hire input[name="pin"] {
  width: auto;
}

.pin-shown {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
}

.pin-shown .notice {
  flex: 1 1 320px;
}

.pin-shown .pin {
  font-size: 2.6em;
  letter-spacing: 0.2em;
}

/* ---------- Вечерний остаток: домашний экран (макет driver-home, вариант А) ---------- */

.ev-todo {
  display: grid;
  gap: 10px;
}

.ev-todo h2 {
  margin: 0;
  font-size: 1.4em;
  line-height: 1.2;
}

.ev-todo p {
  margin: 0;
}

/* Отправленное фото — подтверждение, а не главное на экране: маленьким. */
.photo.ev-thumb {
  max-width: 160px;
  max-height: 120px;
  object-fit: cover;
}

.ev-home {
  justify-self: start;
  align-self: flex-start;
}

.ev-history h2 {
  margin: 0 0 4px;
  font-size: 1em;
}

.ev-history ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.ev-history li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.ev-history li:first-child {
  border-top: 0;
}

.ev-history .d {
  font-weight: 650;
}

.ev-history .s {
  grid-column: 1;
  color: var(--muted);
  font-size: 0.85em;
}

.ev-history .n {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  gap: 12px;
  font-weight: 700;
}

.ev-history .n span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ev-history li.miss .d {
  color: var(--short);
}

.ev-history li.off .d {
  color: var(--muted);
  font-weight: 400;
}

.shop-footer {
  align-self: flex-start;
}

/* ---------- «Сьогодні» — главная цеха (макет shop-home, вариант А) ---------- */

.today-acts {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.today-acts .btn {
  min-height: 84px;
  font-size: 1.2em;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}

.today-acts .btn small {
  font-weight: 400;
  font-size: 0.72em;
  opacity: 0.85;
}

.today-h {
  margin: 0;
  font-size: 1.05em;
}

.cars {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.car {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-l);
  padding: 14px 16px;
  display: grid;
  gap: 4px;
  align-content: start;
}

.car-name {
  font-size: 1.35em;
  font-weight: 750;
}

.car-veh {
  color: var(--muted);
  font-size: 0.85em;
}

.car-st {
  font-weight: 650;
}

.car.wait {
  border-color: var(--extra);
}

.car.wait .car-st {
  color: var(--extra);
}

.car.new {
  border-style: dashed;
}

.car .btn {
  margin-top: 6px;
  min-height: 48px;
  text-decoration: none;
}

/* ---------- Числа записи «пилюлями» и тип записи меткой (обход №6, вариант Б) ---------- */

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px 2px 6px;
  background: var(--surface);
  white-space: nowrap;
}

.pill b {
  font-size: 1.05em;
}

.pill .w {
  color: var(--muted);
  font-size: 0.85em;
}

.pill.in {
  border-color: var(--ok);
}

.pill.in b {
  color: var(--ok);
}

.pill.out {
  border-color: var(--short);
}

.pill.out b {
  color: var(--short);
}

/* Цвет метки — тип записи; белый текст читается на каждом цвете в обеих темах. */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.8em;
  font-weight: 700;
  color: #fff;
  background: #444;
  white-space: nowrap;
}

.tag.t-arrival {
  background: #6a4bc4;
}

.tag.t-load {
  background: #0b7d55;
}

.tag.t-evening {
  background: #8a5600;
}

.tag.t-control {
  background: #2f6f8f;
}

.tag.t-day_total {
  background: #a33b6b;
}

.tag.t-cancel {
  background: var(--muted);
}

tr.gone .tag {
  opacity: 0.55;
}

/* ---------- Входы на «Працівники» (обход №10) ---------- */

.logins {
  display: grid;
  gap: 10px;
}

.sec-h {
  margin: 0;
  font-size: 1.05em;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
}

.sigs {
  display: grid;
  gap: 10px;
}

.sig {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px 14px;
  align-items: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--extra);
  border-radius: var(--radius-m);
  padding: 12px 14px;
}

.sig.hard {
  border-left-color: var(--short);
}

.sig h3 {
  margin: 0;
  font-size: 1.05em;
}

.sig p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.9em;
}

.sig-acts .btn {
  min-height: 40px;
  font-size: 0.9em;
  padding: 0 12px;
}

.sig-quiet {
  margin: 0;
  color: var(--ok);
  font-weight: 650;
}

.shared-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.shared-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
  align-items: center;
}

@container (max-width: 640px) {
  .sig {
    grid-template-columns: 1fr;
  }
}

/* ---------- Вкладка «Рейси» в отчёте (обход №3, №7) ---------- */

.kpis {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 12px 14px;
  display: grid;
  gap: 2px;
  align-content: start;
}

.kpi .v {
  font-size: 1.6em;
  font-weight: 750;
}

.kpi .l {
  color: var(--muted);
  font-size: 0.85em;
}

/* Только число минут на вкладке «Рейси»: у карточки отчёта тоже класс .wait, и nowrap
   растягивал её за край. */
span.wait {
  font-weight: 700;
  white-space: nowrap;
}

span.wait.long {
  color: var(--extra);
}

.hours {
  display: grid;
  gap: 6px;
  align-items: end;
  padding-top: 8px;
}

.hours .hr {
  display: grid;
  gap: 4px;
  justify-items: center;
  font-size: 0.8em;
  color: var(--muted);
}

.hours .hr b {
  color: var(--ink);
  min-height: 1.2em;
}

.hours i {
  display: block;
  width: 100%;
  max-width: 34px;
  background: var(--full);
  border-radius: 4px 4px 0 0;
}

.hours i.long {
  background: var(--extra);
}

/* ---------- Лента дней (обход №12, вариант Б) ---------- */

/* row-reverse: без JS лента открыта на последних днях, старые — левее, листанием. */
.day-strip {
  display: flex;
  flex-direction: row-reverse;
  gap: 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 6px;
}

.dayb {
  flex: 0 0 60px;
  scroll-snap-align: end;
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 6px 4px;
  min-height: 72px;
  border: 2px solid var(--line);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.dayb .wd {
  font-size: 0.75em;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dayb .dn {
  font-size: 1.25em;
  font-weight: 750;
  line-height: 1.1;
}

.dayb .cnt {
  font-size: 0.72em;
  color: var(--short);
  font-weight: 700;
  min-height: 1em;
}

.dayb[aria-current="date"] {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.dayb[aria-current="date"] .wd,
.dayb[aria-current="date"] .cnt {
  color: var(--bg);
}

.dayb.off-day {
  border-style: dashed;
  opacity: 0.7;
}

.week-sep {
  flex: 0 0 2px;
  align-self: stretch;
  margin: 8px 2px;
  background: var(--line);
  border-radius: 1px;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.dot.done {
  background: var(--ok);
}

.dot.miss {
  border: 2.5px solid var(--short);
}

.dot.part {
  background: linear-gradient(90deg, var(--ok) 50%, transparent 50%);
  border: 2px solid var(--short);
}

.dot.off {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  background: var(--muted);
  margin-block: 3.5px;
}

.dot.wait {
  border: 2px dashed var(--muted);
}

.strip-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-size: 0.85em;
  color: var(--muted);
}

.strip-legend span {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}

.other-day summary {
  list-style: none;
  cursor: pointer;
}

.other-day summary::-webkit-details-marker {
  display: none;
}

.other-day[open] {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

/* ---------- Машины (задача 09-cars): кто за рулём, «Інший експедитор» ---------- */

/* Только блок на форме цеха: в шапке тоже .who (имя и «Вийти»), рамка ей не нужна. */
details.who {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 8px 12px;
}

details.who summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
}

details.who summary::-webkit-details-marker {
  display: none;
}

details.who summary b {
  font-size: 1.1em;
}

details.who summary .btn {
  margin-left: auto;
  min-height: 40px;
}

.chip-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 10px;
}

.chip-pick {
  position: relative;
  cursor: pointer;
}

.chip-pick > input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip-pick > span {
  display: inline-block;
  border: 2px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 650;
}

.chip-pick > input:checked + span {
  border-color: var(--full);
  background: var(--full-soft);
}

.chip-pick > input:focus-visible + span {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.car-chip {
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px 8px;
  background: var(--surface-2);
  white-space: nowrap;
}

/* Вечерний остаток: в какой машине считали. Другая машина — предупреждение, без JS. */
.ev-cars {
  display: grid;
  gap: 10px;
}

.ev-cars .tile {
  min-height: 72px;
}

.ev-cars .ev-car-warn {
  display: none;
}

.ev-cars:has(input[data-other]:checked) .ev-car-warn {
  display: flex;
}

ul.plain {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: grid;
  gap: 6px;
}

/* Отчёт: кто был в машине до этого экспедитора (задача 09-cars, `car-report` А). */
.rp-before {
  font-size: 0.88em;
  background: var(--surface-2);
  border-radius: var(--radius-s);
  padding: 8px 10px;
}

/* ---------- Стиль «Бланк»: линейки, штамп, графы (style.html, вариант Б) ----------
   Цвета и скругления — токены в начале файла; здесь то, что токенами не выразить.
   Цифры остаются обычным шрифтом: книжный — только заголовкам и подписям граф. */

.app h1,
.app h2,
.app h3,
.app legend {
  font-family: var(--font-head);
  font-weight: 600;
}

.app-head {
  border-bottom: 3px double var(--rule);
}

.app-nav a {
  font-weight: 500;
  color: var(--muted);
}

.app-nav a:hover {
  background: none;
  color: var(--ink);
}

.app-nav a[aria-current="page"] {
  background: none;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

.seg {
  border-color: var(--rule);
}

.seg a[aria-current="true"] {
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--ink);
}

.btn-secondary,
.tile {
  border-width: 1px;
  border-color: var(--rule);
}

.tile .tile-name {
  font-family: var(--font-head);
  font-weight: 600;
}

/* Выбранная плитка — рамка «ручкой», без заливки: на бумаге не закрашивают. */
.tile[aria-pressed="true"],
.tile[aria-checked="true"] {
  background: var(--surface);
  box-shadow: inset 0 0 0 3px var(--full);
}

/* Лист на столе: под карточкой — край второго листа. */
.card,
.rp-card {
  box-shadow:
    0 3px 0 -1px var(--surface),
    0 3px 0 0 var(--line);
}

.rp-card.bad {
  box-shadow:
    inset 4px 0 0 var(--short),
    0 3px 0 -1px var(--surface),
    0 3px 0 0 var(--line);
}

/* Только лишние — край карточки янтарный, как штамп. */
.rp-card.bad:not(:has(.rp-verdict .diff.short)) {
  border-color: var(--line);
  box-shadow:
    inset 4px 0 0 var(--extra),
    0 3px 0 -1px var(--surface),
    0 3px 0 0 var(--line);
}

.rp-card.wait {
  box-shadow:
    inset 4px 0 0 var(--wait),
    0 3px 0 -1px var(--surface),
    0 3px 0 0 var(--line);
}

.rp-card header {
  border-bottom: 3px double var(--rule);
  padding-bottom: 8px;
}

.rp-card header h3,
.rp-day h2 {
  font-size: 1.55em;
}

/* Вердикт — штамп: рамка цвета вердикта, чуть наискось. Нет итога — пунктир, ровно. */
.rp-verdict {
  align-self: flex-start;
  max-width: 100%;
  font-family: var(--font-head);
  font-size: 1.3em;
  font-weight: 700;
  padding: 4px 12px;
  border: 2px solid currentColor;
  border-radius: 4px;
  color: var(--ok);
  transform: rotate(-2deg);
}

.rp-card.bad .rp-verdict {
  color: var(--short);
}

/* Штамп одного цвета: только лишние — янтарный, есть нестача — красный. */
.rp-card.bad .rp-verdict:not(:has(.diff.short)) {
  color: var(--extra);
}

.rp-verdict .diff {
  color: inherit;
}

.rp-card.wait .rp-verdict {
  color: var(--wait);
  border-style: dashed;
  transform: none;
  font-size: 1.05em;
}

.rp-card.wait .rp-verdict .muted {
  color: inherit;
}

.guess {
  font-family: var(--font-head);
  font-style: italic;
}

/* Цифры карточки — графы бланка: линейки сверху и снизу, между графами черта. */
.rp-grid {
  gap: 0;
  border-block: 1px solid var(--rule);
}

.rp-grid > div {
  background: none;
  border-radius: 0;
}

.rp-grid > div + div {
  border-left: 1px solid var(--line);
}

.rp-grid .k,
table.t th {
  font-family: var(--font-head);
}

.table-wrap {
  border-color: var(--rule);
}

table.t thead th {
  box-shadow: inset 0 -2px 0 var(--rule);
}

/* Проверка рейса — строка накладной: подпись, точки-отточие, число. */
.summary .row {
  background: none;
  border-radius: 0;
  border-bottom: 2px dotted var(--line);
  padding-inline: 2px;
}

.summary .row.lead {
  background: none;
  font-family: var(--font-head);
  border-bottom: 3px double var(--rule);
}

.numfield {
  border-width: 1px;
  border-color: var(--rule);
}
