/* Плоский современный язык: без градиентов и объёма, крупные скругления, заливные поля, мягкие тени.
   Цвета бренда только на кнопках: синий (основное) и оранжевый (переход к отправке).
   Светлая тема по умолчанию, тёмная через data-theme на html. Шкала отступов 4/8/12/16/24/32. */
:root {
  color-scheme: light;
  --bg: #eceef2; --surface: #fdfdfe; --ink: #14181d; --muted: #5d6874; --line: #e4e7ec;
  --field: #eff1f4; --field-hover: #e7eaee; --soft: #f5f6f8;
  --blue: #1e3a89; --blue-hover: #172e70; --blue-ink: #f4f6ff;
  --orange: #ff8a1f; --orange-hover: #ff9a3d; --orange-ink: #1c0d00; --orange-glow: rgb(255 122 13 / .45);
  --danger: #b42318; --danger-bg: #fdecea;
  --ring: #1e3a89;
  --shadow-btn: 0 1px 2px rgb(16 24 40 / .08), 0 6px 12px -6px rgb(16 24 40 / .18); --blue-glow: rgb(30 58 137 / .55);
  --shadow-card: 0 1px 2px rgb(16 24 40 / .04), 0 10px 28px -10px rgb(16 24 40 / .12);
  --shadow-pop: 0 2px 6px rgb(16 24 40 / .08), 0 18px 40px -8px rgb(16 24 40 / .22);
  --r: 12px; --r-lg: 20px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1013; --surface: #171c21; --ink: #eef1f4; --muted: #97a2ad; --line: #252c33;
  --field: #212830; --field-hover: #2a323b; --soft: #1c2229;
  --blue: #93acf6; --blue-hover: #aabdf8; --blue-ink: #0b1636;
  --orange: #ff9a3d; --orange-hover: #ffac5e; --orange-ink: #1c0d00; --orange-glow: rgb(255 138 31 / .28);
  --danger: #ff8f84; --danger-bg: #3a1f1c;
  --ring: #93acf6;
  --shadow-btn: 0 1px 2px rgb(0 0 0 / .4), 0 6px 12px -6px rgb(0 0 0 / .6); --blue-glow: rgb(147 172 246 / .28);
  --shadow-card: 0 1px 2px rgb(0 0 0 / .3), 0 10px 28px -10px rgb(0 0 0 / .5);
  --shadow-pop: 0 2px 6px rgb(0 0 0 / .4), 0 18px 40px -8px rgb(0 0 0 / .6);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
main { max-width: 1760px; margin: 0 auto; padding: var(--s2) clamp(12px, 2.5vw, 36px) 72px; }
h1 { font-size: clamp(22px, 1.4vw + 15px, 30px); font-weight: 700; margin: var(--s5) 0 var(--s4); letter-spacing: -0.025em; line-height: 1.15; }
h2 { font-size: 18px; font-weight: 700; margin: var(--s5) 0 var(--s3); letter-spacing: -0.015em; line-height: 1.25; }
a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted, .note { color: var(--muted); font-size: 14px; }
.note { margin: 0; }
.num, .sub, td, input#order, input#serial, input#part_pn { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* иконки Phosphor (спрайт assets/icons.svg) */
.ic { width: 18px; height: 18px; flex: none; fill: currentColor; display: block; }
.row-actions .ic, .chips .ic { width: 16px; height: 16px; }
.ic-lg { width: 44px; height: 44px; color: var(--muted); opacity: .7; margin-bottom: var(--s2); }
.h-label, .label { font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--muted); margin: 0 0 var(--s2); }

/* шапка и главное меню: вкладки на всю высоту панели, активная с подчёркиванием; на телефоне нижняя панель под большой палец */
.top { background: var(--surface); box-shadow: 0 1px 0 var(--line); position: sticky; top: 0; z-index: 40; }
.top-inner { max-width: 1760px; margin: 0 auto; padding: 0 clamp(12px, 2.5vw, 36px); height: 64px; display: flex; align-items: stretch; gap: var(--s6); }
.brand { align-self: center; display: inline-flex; align-items: center; gap: var(--s3); font-weight: 700; font-size: 17px; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; white-space: nowrap; }
.brand-logo { height: 40px; width: auto; display: block; flex: none; }
nav { display: flex; align-items: stretch; gap: var(--s1); flex: 1; }
nav a {
  position: relative; display: inline-flex; align-items: center; gap: var(--s2); padding: 0 var(--s4);
  color: var(--muted); font-size: 15px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}
nav a .ic { width: 22px; height: 22px; }
nav a:hover { color: var(--ink); background: var(--soft); }
nav a[aria-current="page"] { color: var(--blue); font-weight: 600; }
nav a[aria-current="page"]::after { content: ""; position: absolute; left: var(--s3); right: var(--s3); bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--blue); }
#theme-toggle { align-self: center; white-space: nowrap; }

/* поля: заливка без рамки, подпись над полем */
.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted); min-width: 0; }
input:not([type=radio]):not([type=checkbox]) {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: var(--field);
  border: 2px solid transparent; border-radius: var(--r); padding: 0 var(--s4); height: 48px; width: 100%; min-width: 0;
  transition: background-color .15s ease, border-color .15s ease;
}
input::placeholder { color: var(--muted); opacity: .8; }
input:not([type=radio]):not([type=checkbox]):hover:not(:disabled) { background: var(--field-hover); }
input:not([type=radio]):not([type=checkbox]):focus { outline: 0; background: var(--surface); border-color: var(--ring); }
input:disabled { opacity: .55; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--blue); }

/* главный экран: форма слева, список справа */
.layout { display: grid; grid-template-columns: clamp(300px, 27vw, 440px) minmax(0, 1fr); gap: clamp(12px, 1.6vw, 24px); align-items: start; margin-top: var(--s4); }
.layout > .card { position: sticky; top: var(--s4); }
.card, .list, .panel { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
.card, .panel { padding: var(--s5); }
.card h2 { font-size: 19px; margin: 0 0 var(--s4); }
.stack { display: flex; flex-direction: column; gap: var(--s4); }
.stack .note { margin: calc(-1 * var(--s2)) 0 0; }
.stack .note:empty, .stack .chips:empty { display: none; }
.wide { width: 100%; }
.pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 108px), 1fr)); gap: var(--s3); align-items: start; }
.form-actions { display: flex; flex-direction: column; gap: var(--s2); padding-top: var(--s2); }
.hint { font-size: 12px; font-weight: 400; color: var(--muted); }
.seg-hint { margin: var(--s2) 0 0; font-size: 13px; line-height: 1.4; }
.sub { font-size: 12px; color: var(--muted); }

/* панель ввода, отправка */
.entry { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap, var(--s3)); align-items: start; }
.s2 { grid-column: span 2; } .s3 { grid-column: span 3; } .s4 { grid-column: span 4; }
.s5 { grid-column: span 5; } .s6 { grid-column: span 6; } .s12 { grid-column: 1 / -1; }
.actions-end { align-self: end; }
.actions { display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; margin: var(--s4) 0; }

/* сегментный выбор (вид, категория): серая дорожка, выбранный сегмент залит синим */
.seg { border: 0; padding: 0; margin: 0; min-width: 0; }
.seg legend { font-size: 13px; font-weight: 500; color: var(--muted); padding: 0; margin-bottom: 6px; }
.seg-track { display: flex; gap: var(--s1); padding: var(--s1); background: var(--field); border-radius: calc(var(--r) + 4px); min-width: 0; }
.seg label { position: relative; flex: 1 1 0; min-width: 0; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.seg span {
  display: flex; align-items: center; justify-content: center; gap: var(--s2); height: 40px; padding: 0 var(--s3); border-radius: var(--r);
  color: var(--ink); font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background-color .15s ease, color .15s ease;
}
.seg label:hover input:not(:checked) + span { background: var(--field-hover); }
.seg input:checked + span { background: var(--blue); color: var(--blue-ink); }
.seg input:focus-visible + span { outline: 2px solid var(--ring); outline-offset: 2px; }

/* кнопки: плоские, высота 48, без градиентов */
button, .button {
  font: inherit; font-size: 15px; font-weight: 600; min-height: 48px; padding: 0 var(--s5); border: 0; border-radius: var(--r);
  background: var(--field); color: var(--ink); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); line-height: 1.2;
  box-shadow: var(--shadow-btn); transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
button:hover, .button:hover { background: var(--field-hover); }
button:active, .button:active { transform: translateY(1px) scale(.99); }
button:focus-visible, .button:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.primary { background: var(--blue); color: var(--blue-ink); box-shadow: 0 8px 20px -8px var(--blue-glow); }
.primary:hover { background: var(--blue-hover); box-shadow: 0 12px 24px -8px var(--blue-glow); transform: translateY(-1px); }
.primary:active { box-shadow: 0 3px 8px -4px var(--blue-glow); }
.cta { background: var(--orange); color: var(--orange-ink); box-shadow: 0 8px 20px -6px var(--orange-glow); }
.cta:hover { background: var(--orange-hover); box-shadow: 0 12px 26px -6px var(--orange-glow); transform: translateY(-1px); }
.cta:active { transform: translateY(1px) scale(.99); box-shadow: 0 4px 10px -4px var(--orange-glow); }
.quiet { box-shadow: none; background: transparent; color: var(--ink); min-height: 36px; padding: 0 var(--s3); font-weight: 500; text-decoration: underline; text-decoration-color: var(--muted); text-underline-offset: 3px; }
.quiet:hover { background: var(--field); }
button.danger { line-height: 1; box-shadow: none; background: transparent; color: var(--danger); min-height: 36px; padding: 0 var(--s3); font-weight: 500; }
button.danger:hover { background: var(--danger-bg); }
#theme-toggle { box-shadow: none; background: transparent; color: var(--muted); min-height: 40px; font-weight: 500; text-decoration: none; }
#theme-toggle:hover { background: var(--field); color: var(--ink); }

/* подсказки: строго под полем, ширина поля, зазор 6px */
.combo { position: relative; }
.combo > label { font-size: 13px; font-weight: 500; color: var(--muted); }
.suggest {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: var(--s2); list-style: none;
  max-height: 288px; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
}
.suggest li {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px var(--s3); border-radius: var(--r);
  cursor: pointer; font-size: 15px; font-weight: 400; color: var(--ink); line-height: 1.3;
}
.suggest .sg-name { font-weight: 600; }
.suggest .sg-pn { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.suggest li:hover, .suggest li[aria-selected="true"] { background: var(--field); }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; }
.chips button { min-height: 36px; padding: 0 var(--s3); font-size: 14px; }

/* список накопления и таблицы */
.list { overflow: hidden; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding: var(--s5) var(--s5) var(--s3); }
.list-head h2 { margin: 0; font-size: 20px; }
.list-head .muted { font-size: 13px; }
.table-wrap { container-type: inline-size; overflow-x: auto; }
.list .table-wrap { border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: var(--s4) var(--s4); vertical-align: middle; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: var(--s5); }
th:last-child, td:last-child { padding-right: var(--s5); }
tbody tr:last-child td { border-bottom: 0; }
th { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .03em; white-space: nowrap; padding-top: var(--s3); padding-bottom: var(--s3); background: var(--soft); }
tbody tr { transition: background-color .12s ease; }
tbody tr:hover td { background: var(--soft); }
td.num { white-space: nowrap; font-weight: 600; }
td:empty::after { content: "-"; color: var(--muted); font-weight: 400; }
td.pick { width: 1%; }
.card-flush { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-card); }
td[data-label="Деталь"], td[data-label="З/Ч"] { font-weight: 600; }
tr.editing td { background: var(--field); }
tr.editing:hover td { background: var(--field); }
.row-actions { width: 1%; white-space: nowrap; }
.row-actions .row-actions-inner { display: flex; gap: var(--s1); align-items: center; }
.row-actions form { display: inline-block; }
.row-actions a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 var(--s3); border-radius: var(--r); background: var(--field); box-shadow: var(--shadow-btn); font-size: 14px; font-weight: 600; text-decoration: none; transition: background-color .15s ease, box-shadow .15s ease, transform .1s ease; }
.row-actions a:hover { background: var(--field-hover); }
.row-actions a:active { transform: translateY(1px); }
.row-actions button { white-space: nowrap; font-size: 14px; }
.tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--field); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .02em; line-height: 1.5; }
.tag.sent { background: var(--blue); color: var(--blue-ink); }
.list-foot { padding: var(--s4) var(--s5); border-top: 1px solid var(--line); display: flex; justify-content: flex-end; }

/* состояния */
.flash { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r); margin: var(--s4) 0 0; background: var(--field); color: var(--ink); font-weight: 500; }
.flash .ic { width: 22px; height: 22px; }
.flash.info { color: var(--muted); font-weight: 400; }
.flash.error { background: var(--danger-bg); color: var(--danger); }
.empty { padding: var(--s6) var(--s5); text-align: center; color: var(--muted); display: flex; flex-direction: column; align-items: center; }
.empty.card { padding: var(--s6) var(--s5); }
.list .empty { border-top: 1px solid var(--line); }
.empty p { margin: var(--s1) 0; }
.empty strong { color: var(--ink); font-size: 17px; }

/* отправка, письмо, история */
.place-dims { margin-left: var(--s3); font-size: 14px; font-weight: 400; color: var(--muted); }
/* место (коробка): таблица деталей, размеры и вес, урна */
#formed-places { display: flex; flex-direction: column; gap: var(--s4); margin-bottom: var(--s4); }
.place-card { display: flex; flex-direction: column; gap: var(--s4); }
.place-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.place-title { margin: 0; font-size: 18px; }
.place-items { background: var(--soft); box-shadow: none; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.place-items th { background: var(--field); }
.box-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 130px), 1fr)); gap: var(--s3); }
input[aria-invalid="true"] { border-color: var(--danger); background: var(--danger-bg); }
button.box-del { flex: none; width: 44px; min-height: 44px; padding: 0; background: var(--field); }
button.box-del:hover { background: var(--field-hover); }
.mail { display: grid; grid-template-columns: minmax(70px, 110px) minmax(0, 1fr); gap: var(--s1) var(--s3); margin: 0 0 var(--s3); overflow-wrap: anywhere; }
.mail dt { color: var(--muted); } .mail dd { margin: 0; }
.letter { background: var(--surface); border-radius: var(--r-lg); padding: var(--s5); white-space: pre-wrap; font: 15px/1.55 var(--font); margin: 0 0 var(--s4); box-shadow: var(--shadow-card); }
.ship { margin: var(--s4) 0; }
.ship-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.ship-head h2 { margin: 0; display: flex; align-items: center; gap: var(--s2); }
.ship-open { margin-left: auto; min-height: 40px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: var(--s5); margin: var(--s4) 0; }
ul.plain { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--s2); }
ul.plain li { line-height: 1.4; }
.inline-form { display: flex; gap: var(--s3); align-items: end; flex-wrap: wrap; max-width: 520px; }
form[data-confirm] { display: inline; }
.cancel-form { display: block; margin-top: var(--s3); }
.cancel-list { display: flex; flex-direction: column; gap: var(--s3); margin: 0 0 var(--s4); }
.cancel-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); flex-wrap: wrap; padding: var(--s4) var(--s5); }
.cancel-row .tag { margin-left: var(--s2); }

/* резиновая вёрстка: от широкого монитора до телефона */
/* поле с кнопкой камеры внутри */
.input-scan { position: relative; display: block; }
.input-scan input { padding-right: 52px; }
button.scan-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; min-height: 36px; height: 36px; padding: 0; background: var(--surface); box-shadow: var(--shadow-btn); }
button.scan-btn:hover { background: var(--field-hover); }
button.scan-btn:active { transform: translateY(-50%) scale(.96); }

/* окно сканера */
dialog#scan-dialog { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); width: min(520px, calc(100vw - 24px)); }
dialog#scan-dialog::backdrop { background: rgb(16 24 40 / .55); }
.scan-box { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s4); }
.scan-box h3 { margin: 0; font-size: 17px; }
.scan-view { position: relative; aspect-ratio: 4 / 3; background: #101418; border-radius: var(--r); overflow: hidden; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; inset: 22% 10%; border: 3px solid rgb(255 255 255 / .92); border-radius: 14px; box-shadow: 0 0 0 999px rgb(0 0 0 / .35); pointer-events: none; }
.scan-error { color: var(--danger); font-weight: 500; }
.scan-actions { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); flex-wrap: wrap; }

/* окно подтверждения */
dialog#confirm-dialog { border: 0; padding: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop); width: min(420px, calc(100vw - 32px)); }
dialog#confirm-dialog::backdrop { background: rgb(16 24 40 / .45); }
.confirm-box { padding: var(--s5); display: flex; flex-direction: column; gap: var(--s5); }
.confirm-box p { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.4; }
.confirm-actions { display: flex; justify-content: flex-end; gap: var(--s3); flex-wrap: wrap; }

@media (max-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .layout > .card { position: static; }
}
@media (max-width: 760px) {
  .top-inner { height: 56px; gap: var(--s3); justify-content: space-between; }
  .brand-logo { height: 34px; }
  #theme-label { display: none; }
  nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s1);
        padding: 6px var(--s2) calc(6px + env(safe-area-inset-bottom)); background: var(--surface); box-shadow: 0 -1px 0 var(--line), 0 -10px 24px -12px rgb(16 24 40 / .2); }
  nav a { flex-direction: column; justify-content: center; gap: 2px; padding: var(--s2) var(--s1); border-radius: var(--r); font-size: 12px; font-weight: 500; }
  nav a[aria-current="page"] { background: var(--field); color: var(--blue); }
  nav a[aria-current="page"]::after { display: none; }
  main { padding-bottom: 104px; }
  .card, .panel { padding: var(--s4); }
  .list-head { padding: var(--s4) var(--s4) var(--s3); }
  .mail { grid-template-columns: 1fr; }
}
/* строки таблицы превращаются в карточки, когда самой таблице тесно (а не только экрану) */
@container (max-width: 900px) {
  .opis-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .opis-table, .opis-table tbody, .opis-table tr, .opis-table td { display: block; width: 100%; }
  .opis-table tr { display: flex; flex-direction: column; padding: var(--s4); border-bottom: 1px solid var(--line); }
  .opis-table tbody tr:last-child { border-bottom: 0; }
  .opis-table td, .opis-table td:first-child, .opis-table td:last-child { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); padding: var(--s1) 0; border: 0; text-align: right; overflow-wrap: anywhere; }
  .opis-table td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 500; text-align: left; flex: 0 0 38%; }
  .opis-table td:empty, .opis-table td:empty::after { display: none; }
  .opis-table .cell { min-width: 0; text-align: right; }
  .opis-table td[data-label="Деталь"] { order: -2; justify-content: flex-start; text-align: left; font-size: 17px; padding-bottom: var(--s2); }
  .opis-table td[data-label="Деталь"]::before { display: none; }
  .opis-table td[data-label="Категория"] { order: -1; }
  .opis-table td[data-label="Выбрать"] { order: -3; justify-content: flex-start; }
  .opis-table td[data-label="Выбрать"]::before { content: "Включить в отправку"; }
  .opis-table td .sub { text-align: right; white-space: normal; }
  .opis-table .row-actions { justify-content: flex-end; padding-top: var(--s3); width: 100%; }
  .opis-table .row-actions::before { content: none; }
  .opis-table .row-actions .row-actions-inner { margin-left: auto; }
  .opis-table tbody tr:hover td, .opis-table tr.editing td, .opis-table tr.editing:hover td { background: transparent; }
  .opis-table tr.editing { background: var(--field); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
  button:active, .button:active, .cta:hover { transform: none; }
}

/* вход и выход */
.login { max-width: 400px; margin: var(--s6) auto; }
.login-logo { display: block; margin: 0 auto var(--s3); width: 110px; height: auto; }
.login h2 { text-align: center; }
.account-login { text-align: center; color: var(--muted); margin: calc(-1 * var(--s2)) 0 var(--s4); }

/* кнопки справа в шапке: как табы нижнего меню */
.top-inner form.logout { margin: 0; align-self: center; }
.top-btn { align-self: center; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; min-width: 40px; padding: 0 var(--s3);
  border: 0; border-radius: var(--r); background: transparent; box-shadow: none; color: var(--muted); font-weight: 500; text-decoration: none; white-space: nowrap; cursor: pointer; }
.top-btn:hover { background: var(--field); color: var(--ink); }
.top-btn[aria-current="page"] { background: var(--field); color: var(--blue); }
@media (max-width: 760px) { .account-link span { display: none; } .top-inner { gap: var(--s1); } .top-btn { padding: 0; width: 40px; } .brand { margin-right: auto; } }

/* средние ширины: подпись темы прячем, чтобы шапка не налезала */
@media (min-width: 761px) and (max-width: 1150px) { #theme-label, .account-link span { display: none; } .account-link { padding: 0; width: 40px; } #theme-toggle { padding: 0; width: 40px; } .top-inner { gap: var(--s3); } }
@media (min-width: 761px) and (max-width: 900px) { .brand { font-size: 0; } nav a { padding-left: var(--s2); padding-right: var(--s2); } }

/* несколько кодов на наклейке: выбор нужного */
.scan-choices { display: flex; flex-direction: column; gap: var(--s2); }
button.scan-choice { justify-content: flex-start; text-align: left; font-variant-numeric: tabular-nums; word-break: break-all; min-height: 52px; }
input[type=range].scan-zoom { width: 100%; min-height: 0; padding: 0; background: transparent; border: 0; accent-color: var(--blue); }
