/* Склад — оформление. Плоский стиль: без теней и градиентов, крупные кнопки.
   Зелёный — приход, оранжевый — уход, красный — ошибка. Цвет всегда
   дублируется словом, чтобы смысл не держался на одном цвете. */

:root {
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --fg: #0F172A;
  --fg-2: #475569;
  --muted: #F1F5F9;
  --line: #E2E8F0;
  --line-strong: #64748B;
  --primary: #334155;
  --primary-2: #1E293B;
  --in: #047857;
  --in-2: #065F46;
  --in-bg: #D1FAE5;
  --in-fg: #065F46;
  --out: #C2410C;
  --out-2: #9A3412;
  --out-bg: #FFEDD5;
  --out-fg: #9A3412;
  --bad: #DC2626;
  --bad-2: #B91C1C;
  --bad-bg: #FEE2E2;
  --bad-fg: #991B1B;
  --warn-bg: #FEF3C7;
  --warn-fg: #92400E;
  --ring: #2563EB;
  --r: 12px;
  --top-h: 52px;
  --tabs-h: 64px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 var(--font);
}
h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, label[for], select { cursor: pointer; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: absolute; left: 8px; top: -80px; z-index: 100;
  background: var(--primary-2); color: #fff; padding: 10px 14px; border-radius: 8px;
}
.skip:focus { top: 8px; }
.ic { flex: none; }

/* ---------- шапка и разделы ---------- */

.top { position: sticky; top: 0; z-index: 40; background: var(--primary); color: #fff; }
.top-in {
  max-width: 1120px; margin: 0 auto; padding: 0 16px; height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
}
.brand {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px;
  font-weight: 700; font-size: 18px; text-decoration: none;
}
.nav { display: none; gap: 2px; flex: 1; min-width: 0; }
.nav a {
  padding: 8px 12px; border-radius: 8px; text-decoration: none;
  font-weight: 500; color: #E2E8F0; white-space: nowrap;
  transition: background-color .15s ease;
}
.nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }
.nav a[aria-current] { background: #fff; color: var(--primary-2); font-weight: 700; }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; min-width: 0; }
.who-name { font-size: 14px; color: #E2E8F0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who form { display: none; }
.top .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .55); }
.top .btn-ghost:hover { background: rgba(255, 255, 255, .14); }

.page {
  max-width: 1120px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabs-h) + 24px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}
.page:focus { outline: none; }
.narrow { max-width: 640px; width: 100%; margin-left: auto; margin-right: auto; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  min-height: var(--tabs-h); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; font-size: 12px; font-weight: 500; color: var(--fg-2);
  border-top: 3px solid transparent;
}
.tabs a[aria-current] { color: var(--primary-2); font-weight: 700; border-top-color: var(--primary); }

/* ---------- текст ---------- */

.title { font-size: 24px; line-height: 1.25; font-weight: 700; text-wrap: balance; }
.h2 { font-size: 18px; line-height: 1.3; font-weight: 700; }
.sub { color: var(--fg-2); }
.small { font-size: 14px; }
.count { color: var(--fg-2); font-weight: 500; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.back {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  min-height: 44px; color: var(--fg-2); text-decoration: none; font-weight: 600;
}
.back:hover { color: var(--fg); }
.link { color: #1D4ED8; text-decoration: underline; text-underline-offset: 2px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, "Courier New", monospace; }
.wrap-any { overflow-wrap: anywhere; }
.n { font-variant-numeric: tabular-nums; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 8px 16px;
  border: 1px solid transparent; border-radius: 10px;
  background: var(--muted); color: var(--fg);
  font-weight: 600; text-decoration: none; text-align: center;
  transition: background-color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-in { background: var(--in); color: #fff; }
.btn-in:hover { background: var(--in-2); }
.btn-out { background: var(--out); color: #fff; }
.btn-out:hover { background: var(--out-2); }
.btn-ghost { background: var(--card); border-color: var(--line-strong); }
.btn-ghost:hover { background: var(--muted); }
.btn-danger { background: var(--card); border-color: var(--bad); color: var(--bad-2); }
.btn-danger:hover { background: var(--bad-bg); }
.btn-lg { min-height: 56px; padding: 12px 20px; font-size: 18px; }
.btn-sm { min-height: 36px; padding: 4px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
@media (pointer: coarse) { .btn-sm { min-height: 44px; } }

/* ---------- формы ---------- */

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label, .label { font-weight: 600; font-size: 15px; }
.input {
  width: 100%; min-height: 48px; padding: 10px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: #fff; font-size: 16px;
}
.input:focus-visible { outline-offset: 1px; border-radius: 10px; }
textarea.input { min-height: 132px; resize: vertical; line-height: 1.4; }
select.input { appearance: auto; }
.hint { color: var(--fg-2); font-size: 14px; }
.err { color: var(--bad-fg); font-size: 14px; font-weight: 600; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); }
.radios { display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* ---------- блоки ---------- */

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.card-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 4px 12px; margin-bottom: 8px;
}
.cols { display: grid; gap: 16px; }
.actions { display: grid; grid-template-columns: 1fr; gap: 12px; }

details.card > summary {
  list-style: none; display: flex; align-items: center; gap: 10px;
  min-height: 44px; margin: -16px; padding: 12px 16px;
  border-radius: var(--r); font-weight: 700;
}
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after {
  content: ""; margin-left: auto; width: 9px; height: 9px; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s ease;
}
details.card[open] > summary { margin-bottom: 8px; }
details.card[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
details.card > summary:hover { background: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: flex; flex-direction: column; gap: 2px; min-height: 104px;
  padding: 14px 16px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r); text-decoration: none;
  transition: border-color .15s ease;
}
a.tile:hover { border-color: var(--line-strong); }
.tile-num { font-size: 30px; line-height: 1.15; font-weight: 700; font-variant-numeric: tabular-nums; }
.tile-label { font-weight: 600; font-size: 15px; line-height: 1.3; }
.tile-sub { color: var(--fg-2); font-size: 13px; line-height: 1.35; }
.tile-in .tile-num { color: var(--in); }
.tile-out .tile-num { color: var(--out); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 999px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
}
.b-in { background: var(--in-bg); color: var(--in-fg); }
.b-out { background: var(--out-bg); color: var(--out-fg); }
.b-new { background: var(--warn-bg); color: var(--warn-fg); }
.b-void, .b-undo_in, .b-undo_out, .b-off { background: var(--muted); color: var(--fg-2); }

.flash {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px; border-radius: var(--r); font-weight: 500;
}
.flash .ic { margin-top: 2px; }
.flash-ok { background: var(--in-bg); color: var(--in-fg); }
.flash-error { background: var(--bad-bg); color: var(--bad-fg); }
.note { background: var(--warn-bg); color: var(--warn-fg); padding: 12px 14px; border-radius: var(--r); }
.empty { text-align: center; color: var(--fg-2); padding: 28px 16px; }

progress.progress {
  appearance: none; -webkit-appearance: none; display: block;
  width: 100%; height: 12px; border: 0; border-radius: 999px;
  background: var(--muted); overflow: hidden; color: var(--in);
}
progress.progress::-webkit-progress-bar { background: var(--muted); border-radius: 999px; }
progress.progress::-webkit-progress-value { background: var(--in); border-radius: 999px; }
progress.progress::-moz-progress-bar { background: var(--in); border-radius: 999px; }

/* ---------- списки ---------- */

.list > li { border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.item {
  display: flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 10px 0; text-decoration: none;
}
a.item:hover .item-title { text-decoration: underline; }
.item-title { display: block; font-weight: 700; overflow-wrap: anywhere; }
.item-sub { display: block; color: var(--fg-2); font-size: 14px; overflow-wrap: anywhere; }
.item .ic { color: var(--fg-2); }
.menu-list a {
  display: flex; align-items: center; gap: 12px; min-height: 56px;
  padding: 8px 4px; font-weight: 600; text-decoration: none;
}

/* ---------- таблицы ---------- */

.table-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: clip; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 10px 12px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.table thead th {
  position: sticky; top: var(--top-h); z-index: 5;
  background: var(--muted); color: var(--fg-2); font-size: 13px; font-weight: 700;
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--bg); }
.table .n { text-align: right; white-space: nowrap; }
.table tfoot th, .table tfoot td {
  background: var(--muted); font-weight: 700;
  border-top: 1px solid var(--line); border-bottom: 0;
}
.t-main { display: block; font-weight: 700; overflow-wrap: anywhere; }
.t-sub { display: block; color: var(--fg-2); font-size: 14px; overflow-wrap: anywhere; }
.cell-link { display: block; text-decoration: none; }
.cell-link:hover .t-main { text-decoration: underline; }
.strong { font-weight: 700; font-size: 17px; }
.zero { color: var(--fg-2); font-weight: 400; }
.sort {
  appearance: none; border: 0; background: none; padding: 4px 0; margin: 0;
  display: inline-flex; align-items: center; gap: 4px;
  font: inherit; color: inherit; min-height: 32px;
}
.sort::after { content: "↕"; font-size: 12px; opacity: .55; }
th[aria-sort="ascending"] .sort::after { content: "↑"; opacity: 1; }
th[aria-sort="descending"] .sort::after { content: "↓"; opacity: 1; }
th[aria-sort] .sort { color: var(--fg); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card);
  font-weight: 600; font-size: 15px; text-decoration: none;
  transition: background-color .15s ease;
}
.chip:hover { background: var(--muted); }
.chip[aria-pressed="true"], .chip[aria-current] {
  background: var(--primary); border-color: var(--primary); color: #fff;
}
@media (pointer: coarse) { .chip { min-height: 44px; } }
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.toolbar .search { flex: 1 1 260px; }
.filters {
  display: grid; gap: 12px; align-items: end;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.dates { align-items: flex-end; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.n-time { white-space: nowrap; color: var(--fg-2); font-size: 14px; }

/* Правка списка товаров: в каждой строке поля «артикул» и «название». */
/* Третий столбец — отметка «Сохранено»: место под неё занято заранее,
   поэтому строки не прыгают, когда она появляется. */
.row-edit {
  display: grid; align-items: center; gap: 6px 8px;
  grid-template-columns: minmax(90px, 200px) minmax(0, 1fr) 96px;
}
.row-edit .input { min-height: 44px; padding: 8px 10px; }
.row-state { font-size: 13px; color: var(--fg-2); }
.row-state:empty { display: none; }
.row-state.is-ok { color: var(--in-fg); font-weight: 600; }
.row-state.is-bad { grid-column: 1 / -1; color: var(--bad-fg); font-weight: 600; }
.input[aria-invalid="true"] { border-color: var(--bad); box-shadow: inset 0 0 0 1px var(--bad); }
.btn[aria-pressed="true"] { background: var(--in); color: #fff; }
@media (max-width: 560px) { .row-edit { grid-template-columns: minmax(0, 1fr); } }

/* Раскрывающийся блок прямо в строке: «Сменить пароль», «Свои даты». */
.inline > summary { list-style: none; display: inline-flex; }
.inline > summary::-webkit-details-marker { display: none; }
.inline[open] { flex-basis: 100%; }
.inline[open] > summary { margin-bottom: 10px; }

fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field > legend { padding: 0; margin-bottom: 6px; }

/* ---------- вход ---------- */

.auth { max-width: 400px; width: 100%; margin: 6vh auto 0; display: flex; flex-direction: column; gap: 16px; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-size: 26px; font-weight: 700; }

/* ---------- приход ---------- */

/* Три пронумерованных шага: товар, количество, этикетки. */
.step { display: flex; flex-direction: column; gap: 10px; }
.step + .step { padding-top: 16px; border-top: 1px solid var(--line); }
.step-title { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; line-height: 1.3; }
.step-n {
  flex: none; width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 16px; font-variant-numeric: tabular-nums;
}

/* Окно выбора товара: на телефоне во весь экран, на компьютере по центру. */
dialog.picker {
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0; background: var(--card); color: var(--fg);
}
dialog.picker[open] { display: flex; flex-direction: column; }
dialog.picker::backdrop { background: rgba(15, 23, 42, .55); }
.picker-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
}
.picker-search { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px 8px; }
.picker-list {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  display: flex; flex-direction: column; gap: 4px; padding: 4px 16px 16px;
}
.picker-list button {
  width: 100%; min-height: 48px; padding: 6px 12px; text-align: left;
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border: 1px solid var(--line-strong); border-radius: 10px;
  transition: background-color .15s ease;
}
.picker-list button:hover { background: var(--muted); }
@media (min-width: 640px) {
  dialog.picker {
    width: min(620px, calc(100vw - 48px)); height: min(760px, calc(100dvh - 48px));
    margin: auto; border-radius: 16px;
  }
}
.picked {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  border: 2px solid var(--in); border-radius: 10px; background: var(--in-bg); color: var(--in-fg);
}
.qty { display: grid; grid-template-columns: 56px minmax(0, 1fr) 56px; gap: 8px; }
.qty .input { min-height: 56px; text-align: center; font-size: 24px; font-weight: 700; }
.qty button {
  min-height: 56px; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--card);
}
.qty button:hover { background: var(--muted); }

/* ---------- сканер ---------- */

.scanner { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 560px; margin: 0 auto; }
.modes {
  position: sticky; top: var(--top-h); z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  background: var(--bg); padding: 8px 0;
}
.mode {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 64px; padding: 8px 12px; text-align: left;
  border: 2px solid var(--line-strong); border-radius: var(--r);
  background: var(--card); color: var(--fg-2);
  transition: background-color .15s ease, border-color .15s ease;
}
.mode b { display: block; font-size: 20px; line-height: 1.15; }
.mode small { display: block; font-size: 13px; line-height: 1.2; }
.mode-in[aria-pressed="true"] { background: var(--in); border-color: var(--in); color: #fff; }
.mode-out[aria-pressed="true"] { background: var(--out); border-color: var(--out); color: #fff; }

/* Камера квадратная и не выше 44 % экрана: итог скана, камера и поле
   ручного ввода помещаются на телефоне без прокрутки. */
.cam {
  position: relative; width: min(100%, 44dvh); aspect-ratio: 1 / 1; margin: 0 auto;
  background: #0F172A; border: 4px solid var(--in); border-radius: var(--r); overflow: hidden;
}
body[data-mode="out"] .cam { border-color: var(--out); }
.cam video { display: block; width: 100%; height: 100%; object-fit: cover; }
.cam-guide {
  position: absolute; inset: 14%; pointer-events: none;
  border: 3px solid rgba(255, 255, 255, .92); border-radius: 16px;
  transition: border-color .12s ease;
}
.cam.hit-ok .cam-guide { border-color: #34D399; border-width: 6px; }
.cam.hit-bad .cam-guide { border-color: #F87171; border-width: 6px; }
.cam-off {
  position: absolute; inset: 0; padding: 16px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: #0F172A; color: #E2E8F0; text-align: center;
}
.cam-off .btn { background: #fff; color: var(--primary-2); }
.cam-msg { font-size: 15px; max-width: 34ch; }
.cam-btn {
  position: absolute; right: 10px; bottom: 10px; width: 48px; height: 48px;
  display: grid; place-items: center; border: 0; border-radius: 50%;
  background: rgba(15, 23, 42, .72); color: #fff;
}
.cam-btn[aria-pressed="true"] { background: #FACC15; color: #0F172A; }

.result {
  display: flex; flex-direction: column; justify-content: center; gap: 2px;
  min-height: 104px; padding: 12px 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r);
}
.result-title { display: flex; align-items: center; gap: 8px; font-size: 22px; font-weight: 800; line-height: 1.2; }
.result-main { font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.result-detail { font-size: 15px; }
.result.is-idle .result-title { font-size: 18px; font-weight: 600; color: var(--fg-2); }
.result.is-in { background: var(--in-bg); border-color: var(--in); color: var(--in-fg); }
.result.is-out { background: var(--out-bg); border-color: var(--out); color: var(--out-fg); }
.result.is-bad { background: var(--bad-bg); border-color: var(--bad); color: var(--bad-fg); }
.manual .row { flex-wrap: nowrap; }
.manual .input { flex: 1; min-width: 0; }

.hist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.hist li:last-child { border-bottom: 0; }
.hist .h-mark { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; }
.hist .is-in .h-mark { background: var(--in-bg); color: var(--in-fg); }
.hist .is-out .h-mark { background: var(--out-bg); color: var(--out-fg); }
.hist .is-bad .h-mark { background: var(--bad-bg); color: var(--bad-fg); }
.hist .h-main { flex: 1; min-width: 0; }
.hist .h-title { font-weight: 700; overflow-wrap: anywhere; }
.hist .h-sub { color: var(--fg-2); font-size: 14px; overflow-wrap: anywhere; }
.hist .is-undone .h-title { text-decoration: line-through; color: var(--fg-2); }

/* ---------- широкий экран ---------- */

@media (min-width: 640px) {
  .actions { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  .nav { display: flex; }
  .tabs { display: none; }
  .who form { display: block; }
  .page { padding: 24px 24px 48px; gap: 20px; }
  .top-in { padding: 0 24px; }
  .title { font-size: 28px; }
  .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cols { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}

/* Телефон: таблица остатков целиком помещается в ширину экрана —
   столбец «Остаток» не должен уезжать за край. */
@media (max-width: 560px) {
  .table:not(.table-cards) { table-layout: fixed; }
  .table:not(.table-cards) th, .table:not(.table-cards) td { padding: 10px 6px; }
  .table:not(.table-cards) th:first-child, .table:not(.table-cards) td:first-child { padding-left: 12px; }
  .table:not(.table-cards) th:last-child, .table:not(.table-cards) td:last-child { padding-right: 12px; }
  .table:not(.table-cards) .n { width: 62px; }
  .table:not(.table-cards) .n:last-child { width: 80px; }
  .table:not(.table-cards) thead th { font-size: 12px; }
  .sort::after { content: none; }
  th[aria-sort="ascending"] .sort::after { content: "↑"; }
  th[aria-sort="descending"] .sort::after { content: "↓"; }
}

/* Узкий экран: журнал превращается из таблицы в карточки. */
@media (max-width: 720px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; }
  .table-cards tr { padding: 10px 12px; border-bottom: 1px solid var(--line); }
  .table-cards tbody tr:last-child { border-bottom: 0; }
  .table-cards td { padding: 1px 0; border: 0; }
  .table-cards td[data-label]::before { content: attr(data-label) ": "; color: var(--fg-2); font-size: 13px; }
}

@media print {
  .top, .tabs, .no-print, .skip { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; max-width: none; }
  .table thead th { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
