/* TauarLab · «Ценник»: стальная полка, чёрная печать, жёлтый ярлык только у лучшей цены */
@import url("/static/fonts.css");

:root {
  color-scheme: light;
  --ground: #eceef1;
  --paper: #ffffff;
  --paper-2: #f6f7f8;
  --ink: #131417;
  --ink-2: #474c55;
  --ink-3: #626873;
  --line: #d9dde2;
  --line-2: #b8bec6;
  --hover: #e4e7eb;
  --press: #d5d9de;
  --tag: #ffd400;
  --tag-hover: #ffe14d;
  --tag-press: #f2c500;
  --flag: #d92a20;
  --flag-tint: #fde3df;
  --flag-ink: #9b1910;
  --radius: 6px;
  --shadow: 0 1px 1px rgb(19 20 23 / .05), 0 10px 28px -14px rgb(19 20 23 / .28);
  --display: "Fira Sans Extra Condensed", "Golos Text", "Arial Narrow", sans-serif;
  --ui: "Golos Text", "Segoe UI", system-ui, sans-serif;
  font: 400 16px/1.5 var(--ui);
  font-feature-settings: "tnum" 0;
  background: var(--ground);
  color: var(--ink);
  accent-color: var(--ink);
  scrollbar-color: var(--line-2) transparent;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body { margin: 0; min-width: 320px; min-height: 100vh; display: flex; flex-direction: column; background: var(--ground); }
main { flex: 1; }
::selection { background: var(--tag); color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
button, summary, select, label:has(> input[type="file"]) { cursor: pointer; }
h1, h2, p, figure { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 800; letter-spacing: -.01em; line-height: .98; text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6vw, 4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2rem); }
p { overflow-wrap: anywhere; text-wrap: pretty; }
a { color: var(--ink); text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
a:hover { text-decoration-color: var(--flag); }
:focus-visible { outline: 3px solid var(--tag); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); border-radius: 3px; }
mark { background: none; color: inherit; }
table { border-collapse: separate; border-spacing: 0; width: 100%; font-variant-numeric: tabular-nums; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.wrap { width: min(calc(100% - 64px), 1240px); margin-inline: auto; }
.note { color: var(--ink-2); font-size: .9rem; }

/* Шапка: чёрная планка полки */
.topbar { background: var(--ink); color: var(--paper); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--paper); text-decoration: none; font-family: var(--display); font-weight: 800; font-size: 1.6rem; letter-spacing: .005em; line-height: 1; border-radius: 3px; }
.brand:hover { color: var(--tag); }
.brand-tag { width: 34px; height: 24px; }
.brand-tag path { fill: var(--tag); }
.brand-tag circle { fill: var(--ink); }
.topbar-link { color: var(--paper); font-weight: 600; font-size: .95rem; text-decoration: none; padding: 8px 2px; border-bottom: 2px solid transparent; }
.topbar-link:hover { color: var(--tag); text-decoration: none; border-bottom-color: var(--tag); }
.topbar-link:active { color: var(--tag-press); border-bottom-color: var(--tag-press); }

.footer { margin-top: 64px; border-top: 1px solid var(--line-2); }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; padding-block: 20px 28px; color: var(--ink-2); font-size: .88rem; }
.footer-brand { font-family: var(--display); font-weight: 800; font-size: 1.1rem; color: var(--ink); line-height: 1.2; }

/* Кнопки: геометрия не меняется ни в одном состоянии, только цвет */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 46px; padding: 0 18px; border: 1.5px solid transparent; border-radius: var(--radius); font-weight: 600; font-size: .96rem; line-height: 1.2; text-decoration: none; text-align: center; white-space: nowrap; background: transparent; color: var(--ink); transition: background-color .14s ease-out, border-color .14s ease-out, color .14s ease-out; }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn-primary:hover { background: #30333a; border-color: #30333a; color: var(--paper); }
.btn-primary:active { background: var(--tag); border-color: var(--ink); color: var(--ink); }
.btn-secondary { background: var(--paper); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { border-color: var(--ink); background: var(--paper); }
.btn-secondary:active { background: var(--press); border-color: var(--ink); }
.btn-danger { padding-inline: 0; min-height: 40px; color: var(--flag-ink); }
.btn-danger:hover { color: var(--flag); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.btn-danger:active { color: #6e110b; }
.btn-wide { min-width: 220px; }
.btn.is-busy, form[aria-busy] .btn { cursor: progress; }
.btn.is-busy { background-image: repeating-linear-gradient(-45deg, transparent 0 8px, rgb(255 255 255 / .14) 8px 16px); background-size: 200% 100%; animation: busy 1s linear infinite; }
.btn-secondary.is-busy { background-image: repeating-linear-gradient(-45deg, transparent 0 8px, rgb(19 20 23 / .07) 8px 16px); }
form[aria-busy] .btn:not(.is-busy) { opacity: .55; }
@keyframes busy { to { background-position: -45px 0; } }
.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }

/* Ценник: подпись, крупная сумма, единица */
.tag { position: relative; display: inline-grid; justify-items: start; gap: 1px; min-width: 112px; padding: 6px 22px 7px 10px; border-radius: 3px; background: var(--tag); color: var(--ink); box-shadow: 0 1px 0 rgb(19 20 23 / .18); }
.tag::after { content: ""; position: absolute; top: 8px; right: 8px; width: 6px; height: 6px; border-radius: 50%; background: var(--paper); box-shadow: inset 0 1px 1px rgb(19 20 23 / .25); }
.tag-label { font-size: .7rem; font-weight: 700; line-height: 1.2; }
.tag-price { display: inline-flex; align-items: baseline; gap: 4px; font-family: var(--display); font-weight: 800; font-size: 1.9rem; line-height: 1; letter-spacing: -.005em; }
.tag-price .frac { font-size: .55em; vertical-align: .55em; }
.tag-price .cur { font-family: var(--ui); font-weight: 700; font-size: .5em; }
.tag-unit { font-size: .72rem; font-weight: 600; line-height: 1.2; }
.price { display: inline-flex; align-items: baseline; gap: 4px; font-family: var(--display); font-weight: 600; font-size: 1.45rem; line-height: 1.05; }
.price .frac { font-size: .6em; vertical-align: .5em; }
.price .cur { font-family: var(--ui); font-weight: 600; font-size: .55em; }
.price-none { font-family: var(--ui); font-size: .95rem; color: var(--ink-2); }
.gap { display: block; margin-top: 3px; color: var(--ink-2); font-size: .82rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.flag { display: inline-flex; align-items: center; min-height: 28px; padding: 3px 10px; border-radius: 3px; background: var(--flag); color: var(--paper); font-size: .8rem; font-weight: 700; white-space: nowrap; }
mark.diff { padding: 1px 5px; border-radius: 3px; background: var(--flag-tint); color: var(--flag-ink); font-weight: 700; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.chip { display: inline-flex; align-items: center; min-height: 30px; padding: 4px 11px; border: 1.5px solid var(--ink); border-radius: 3px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.none { color: var(--ink-3); }

/* Главная */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 72px); align-items: center; padding-block: clamp(48px, 8vw, 96px) clamp(40px, 6vw, 72px); }
.hero h1 { font-size: clamp(3.4rem, 8vw, 6rem); line-height: .92; letter-spacing: -.015em; }
.lead { max-width: 30rem; margin-top: 24px; color: var(--ink-2); font-size: clamp(1.02rem, 1.6vw, 1.15rem); }
.hero .actions { margin-top: 32px; }
.shelf { min-width: 0; background: var(--paper); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.shelf figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 12px 18px; background: var(--ink); color: #c9cdd3; font-size: .82rem; }
.shelf figcaption span:first-child { color: var(--paper); font-weight: 700; }

.compare th, .compare td { padding: 16px 18px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line); }
.compare thead th { padding-block: 11px; background: var(--paper-2); color: var(--ink-2); font-size: .8rem; font-weight: 700; vertical-align: bottom; }
.compare tbody th { width: 42%; font-weight: 400; }
.compare tbody th b { display: block; font-size: 1rem; font-weight: 700; line-height: 1.3; }
.compare tbody th span { display: block; margin-top: 3px; color: var(--ink-2); font-size: .84rem; }
.compare tbody tr:last-child > * { border-bottom: 0; }
.compare tbody tr:hover > * { background: #fafafb; }
.compare .review-cell { text-align: left; }
.compare .group-no { color: var(--ink-3); font-size: .76rem; }

.intake { padding: clamp(22px, 4vw, 40px); background: var(--paper); border-radius: 8px; box-shadow: var(--shadow); scroll-margin-top: 16px; }
.intake-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.intake-head p { margin-top: 10px; color: var(--ink-2); }
.drops { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.drop { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 112px; padding: 18px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--radius); background: var(--paper-2); transition: background-color .14s ease-out, border-color .14s ease-out; }
.drop:hover { border-color: var(--ink); background: var(--paper); }
.drop:active { background: var(--hover); }
.drop:focus-within { outline: 3px solid var(--tag); outline-offset: 2px; border-color: var(--ink); }
.drop.is-over { border-style: solid; border-color: var(--ink); background: #fff8cc; }
.drop.has-file { border-style: solid; border-color: var(--ink); background: var(--paper); }
.drop input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.drop-letter { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 3px; background: var(--ink); color: var(--paper); font-family: var(--display); font-weight: 800; font-size: 2rem; line-height: 1; }
.drop.has-file .drop-letter { background: var(--tag); color: var(--ink); }
.drop-text { display: grid; gap: 3px; min-width: 0; }
.drop-text b { font-size: 1rem; }
.drop-name { color: var(--ink-2); font-size: .88rem; overflow-wrap: anywhere; }
.drop.has-file .drop-name { color: var(--ink); font-weight: 600; }
.drop .icon { width: 22px; height: 22px; color: var(--ink-2); }
.intake-actions { margin-top: 24px; }

/* Рабочие экраны */
.workspace { padding-block: 28px 0; }
.steps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 22px; font-size: .88rem; color: var(--ink-2); }
.steps > * + *::before { content: ""; display: inline-block; width: 7px; height: 7px; margin: 0 10px 2px 4px; border-top: 1.5px solid var(--line-2); border-right: 1.5px solid var(--line-2); transform: rotate(45deg); }
.steps a { color: var(--ink-2); }
.steps a:hover { color: var(--ink); }
.steps [aria-current] { color: var(--ink); font-weight: 700; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-head p { margin-top: 10px; color: var(--ink-2); }
.page-head-side { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 12px; }
.notice { margin-block: 14px; padding: 12px 16px; border: 1.5px solid var(--flag); border-radius: var(--radius); background: var(--flag-tint); color: var(--flag-ink); font-weight: 600; }
.danger-zone { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 28px; }

/* Поля */
label { display: grid; gap: 6px; align-content: start; font-size: .84rem; font-weight: 600; color: var(--ink); }
input:not([type="checkbox"], [type="file"]), select { display: block; width: 100%; min-width: 0; min-height: 44px; padding: 8px 11px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--paper); color: var(--ink); font-size: .95rem; font-weight: 400; transition: border-color .14s ease-out, background-color .14s ease-out; }
select { appearance: none; padding-right: 34px; background-image: url("/static/chevron.svg"); background-repeat: no-repeat; background-position: right 12px center; }
input:hover, select:hover { border-color: var(--ink-2); }
input:focus-visible, select:focus-visible { border-color: var(--ink); box-shadow: none; border-radius: var(--radius); }
input::placeholder { color: var(--ink-3); }
.field-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto; gap: 14px; align-items: end; }
.field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.check { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-size: .92rem; }
.check input { width: 20px; height: 20px; }
.fold { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.fold summary { display: flex; align-items: center; gap: 10px; width: fit-content; min-height: 36px; padding-right: 6px; font-weight: 700; font-size: .95rem; list-style: none; border-radius: 3px; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: ""; width: 8px; height: 8px; margin-left: 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .16s ease-out; }
.fold[open] summary::before { transform: rotate(45deg); }
.fold summary:hover { color: var(--ink-2); }
.fold summary:active { color: var(--ink-3); }
.fold > .note { margin-top: 6px; }
.fold > .field-grid, .fold > .field-row { margin-top: 14px; }

.source, .basis { margin-bottom: 20px; padding: clamp(18px, 3vw, 28px); background: var(--paper); border-radius: 8px; box-shadow: var(--shadow); }
.source-head { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(200px, 300px); align-items: center; gap: 16px; margin-bottom: 20px; }
.source-letter { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 3px; background: var(--ink); color: var(--paper); font-family: var(--display); font-weight: 800; font-size: 2rem; }
.source-title p { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--ink-2); font-size: .9rem; min-width: 0; }
.source-title p span { overflow-wrap: anywhere; }
.btn-refresh { min-height: 44px; }
.basis h2 { margin-bottom: 8px; }
.basis > .field-row { margin-top: 18px; }

/* Предпросмотр: назначение прямо над колонкой */
.sheet { max-width: 100%; overflow: auto; margin-top: 22px; border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--paper); }
.preview { font-size: .84rem; }
.preview th, .preview td { min-width: 176px; max-width: 240px; padding: 9px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); overflow-wrap: anywhere; }
.preview tr > :last-child { border-right: 0; }
.preview tbody tr:last-child > * { border-bottom: 0; }
.preview .rownum { position: sticky; left: 0; z-index: 1; min-width: 56px; width: 56px; background: var(--paper-2); color: var(--ink-2); font-weight: 600; }
.preview .roles th { padding: 8px; background: var(--paper-2); position: sticky; top: 0; }
.preview .roles .rownum { z-index: 2; }
.preview .heads th { background: var(--paper-2); font-weight: 700; color: var(--ink); }
.preview .heads .rownum { color: var(--ink-2); }
.role { min-height: 38px; padding: 6px 30px 6px 10px; font-size: .84rem; font-weight: 600; color: var(--ink-2); border-style: dashed; }
.role.is-set { border-style: solid; border-color: var(--ink); background-color: var(--ink); color: var(--paper); background-image: url("/static/chevron-white.svg"); }
.role.is-set:hover { background-color: #30333a; border-color: #30333a; }
.role option { background: var(--paper); color: var(--ink); }
.preview .is-mapped { background: #f1f3f5; }
.preview .heads .is-mapped { background: #e3e6ea; }
.preview .is-price { background: #fff6c2; }
.preview .heads .is-price { background: var(--tag); }

/* Нижняя планка с главным действием */
.actionbar { position: sticky; bottom: 0; z-index: 5; margin-inline: calc(-1 * min(32px, 4vw)); padding: 14px min(32px, 4vw); background: rgb(236 238 241 / .94); border-top: 1px solid var(--line-2); backdrop-filter: blur(6px); }
.actionbar-inner { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; }

/* Результат */
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 20px; border-bottom: 1.5px solid var(--line-2); scrollbar-width: thin; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 14px; margin-bottom: -1.5px; border-bottom: 3px solid transparent; border-radius: 3px 3px 0 0; color: var(--ink-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); background: var(--hover); }
.tabs a:active { background: var(--press); }
.tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--ink); }
.tabs .count { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; border-radius: 3px; background: var(--paper); border: 1px solid var(--line-2); font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tabs a[aria-current] .count { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tabs a.has-work .count { background: var(--flag); border-color: var(--flag); color: var(--paper); }
.review-head { margin-bottom: 16px; }
.review-head p:first-child { font-weight: 600; }
.board { background: var(--paper); border-radius: 8px; box-shadow: var(--shadow); overflow: hidden; }
.compare td { width: 29%; }
.offer + .offer { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.offer .issue, .offer .src { display: block; margin-top: 5px; font-size: .78rem; color: var(--ink-2); }
.offer .issue { color: var(--flag-ink); font-weight: 600; }
.src { color: var(--ink-2); font-size: .82rem; overflow-wrap: anywhere; }

.list th, .list td { padding: 14px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: .92rem; }
.list thead th { padding-block: 11px; background: var(--paper-2); color: var(--ink-2); font-size: .8rem; font-weight: 700; }
.list tbody th { font-weight: 600; }
.list tbody th b { display: block; }
.list tbody th span, .list td .src { display: block; margin-top: 3px; color: var(--ink-2); font-size: .82rem; font-weight: 400; }
.list tbody tr:last-child > * { border-bottom: 0; }
.list .num { white-space: nowrap; }

.cards { display: grid; gap: 14px; }
.pair-card { padding: clamp(16px, 2.6vw, 24px); background: var(--paper); border-radius: 8px; box-shadow: var(--shadow); }
.pair-head { margin-bottom: 12px; }
.reason { font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 3px 11px 3px 8px; border-radius: 3px; font-size: .84rem; font-weight: 700; }
.status .icon { width: 16px; height: 16px; stroke-width: 2.4; }
.status-ok { background: var(--ink); color: var(--paper); }
.status-no { background: var(--flag-tint); color: var(--flag-ink); }
.pair { table-layout: fixed; border: 1px solid var(--line); border-radius: var(--radius); }
.pair th, .pair td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: .92rem; overflow-wrap: anywhere; }
.pair thead th { background: var(--paper-2); font-size: .8rem; font-weight: 700; color: var(--ink-2); }
.pair thead th:first-child { width: 22%; }
.pair tbody th { color: var(--ink-2); font-weight: 600; font-size: .84rem; }
.pair tbody tr:last-child > * { border-bottom: 0; }
.pair .differs { background: #fff8f7; }
.pair .origin-row td { color: var(--ink-2); font-size: .8rem; }
.pair-actions { margin-top: 16px; }
.single .src { margin-top: 6px; }

.empty { display: grid; justify-items: start; gap: 16px; padding: clamp(24px, 4vw, 40px); background: var(--paper); border-radius: 8px; box-shadow: var(--shadow); }
.empty p { font-family: var(--display); font-weight: 600; font-size: 1.5rem; line-height: 1.1; }
.pagination { display: flex; align-items: center; gap: 14px; margin-top: 18px; font-weight: 600; }
.error-page { display: grid; justify-items: start; gap: 12px; padding-top: 56px; }

/* Планшет */
@media (max-width: 1024px) {
  .field-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .btn-refresh { grid-column: 1 / -1; justify-self: start; }
  .field-row-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .wrap { width: calc(100% - 40px); }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .source-head { grid-template-columns: auto minmax(0, 1fr); }
  .supplier { grid-column: 1 / -1; }
}

/* Телефон */
@media (max-width: 690px) {
  .wrap { width: calc(100% - 32px); }
  .topbar-inner { min-height: 54px; }
  .brand { font-size: 1.4rem; }
  .hero { padding-block: 36px 32px; gap: 28px; }
  .hero h1 { font-size: clamp(3rem, 14.5vw, 4rem); }
  .lead { margin-top: 16px; }
  .hero .actions { margin-top: 22px; }
  .actions .btn, .actions form { flex: 1 1 auto; }
  .actions form .btn { width: 100%; }
  .shelf figcaption { padding: 10px 14px; }

  .compare thead { display: none; }
  .compare, .compare tbody { display: block; }
  .compare tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
  .compare tbody tr:last-child { border-bottom: 0; }
  .compare tbody tr > * { width: auto; border-bottom: 0; padding: 12px 14px; }
  .compare tbody th { grid-column: 1 / -1; padding-bottom: 2px; }
  .compare td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 6px; color: var(--ink-2); font-size: .74rem; font-weight: 700; }
  .compare .review-cell { grid-column: 1 / -1; }
  .compare tbody tr:hover > * { background: transparent; }
  .tag { min-width: 0; }
  .tag-price { font-size: 1.6rem; }

  .intake-head, .page-head { flex-direction: column; align-items: stretch; }
  .page-head-side { justify-content: space-between; }
  .page-head-side .btn { flex: 1 1 auto; }
  .drops { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .drop { min-height: 92px; gap: 14px; padding: 14px 16px; }
  .drop-letter, .source-letter { width: 44px; height: 44px; font-size: 1.7rem; }

  .field-row, .field-row-3, .field-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .source, .basis { padding: 16px; }
  .source-head { gap: 12px; }
  .preview th, .preview td { min-width: 130px; }
  .actionbar { margin-inline: -16px; padding: 12px 16px; }
  .actionbar .btn { width: 100%; }

  .tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; overflow: visible; border-bottom: 0; }
  .tabs a { justify-content: space-between; min-height: 46px; margin: 0; padding: 0 12px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--paper); color: var(--ink); }
  .tabs a:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .tabs a:hover { background: var(--paper); border-color: var(--ink); }
  .tabs a:active { background: var(--press); }
  .tabs a[aria-current] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
  .tabs a[aria-current] .count { background: var(--tag); border-color: var(--tag); color: var(--ink); }

  .list thead { display: none; }
  .list, .list tbody, .list tr { display: block; }
  .list tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .list tr:last-child { border-bottom: 0; }
  .list th, .list td { display: block; padding: 0; border: 0; }
  .list td { margin-top: 6px; }
  .list td[data-label]::before { content: attr(data-label) ": "; color: var(--ink-2); font-size: .8rem; font-weight: 700; }

  .pair, .pair thead, .pair tbody { display: block; }
  .pair tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-bottom: 1px solid var(--line); }
  .pair thead tr { position: sticky; top: 0; z-index: 1; }
  .pair thead th:first-child { display: none; }
  .pair thead th { width: auto !important; padding: 8px 12px; }
  .pair tbody tr:last-child { border-bottom: 0; }
  .pair tr > * { border-bottom: 0; padding: 8px 12px; }
  .pair tbody th { grid-column: 1 / -1; padding-bottom: 0; font-size: .76rem; }
  .page-head > .chip { align-self: flex-start; }
  .pair-actions .btn { flex: 1 1 0; padding-inline: 12px; }
  .footer-inner { flex-direction: column; gap: 4px; }
}

@media (max-width: 380px) {
  .field-row, .field-row-3, .field-grid { grid-template-columns: minmax(0, 1fr); }
  .btn { padding-inline: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .drop, input, select, .fold summary::before { transition: none; }
  .btn.is-busy { animation: none; }
}

/* ── Расширения: язык, много файлов, лендинг ── */
.topbar-nav { display: flex; align-items: center; gap: 22px; }
.lang { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid #3a3d44; border-radius: var(--radius); }
.lang a, .lang-current { display: inline-grid; place-items: center; min-width: 44px; min-height: 32px; padding: 0 8px; border-radius: 4px; font-size: .86rem; font-weight: 700; text-decoration: none; }
.lang a { color: #c9cdd3; }
.lang a:hover { color: var(--paper); background: #2a2d33; }
.lang a:active { background: #3a3d44; }
.lang-current { background: var(--tag); color: var(--ink); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--hover); }
.btn-ghost:active { background: var(--press); }
.btn .icon:only-child { margin: 0; }

.tag-supplier { margin-top: 3px; padding-top: 3px; border-top: 1px solid rgb(19 20 23 / .25); font-size: .74rem; font-weight: 700; line-height: 1.25; max-width: 18ch; }
.compare-groups tbody th { width: 36%; }
.compare-groups td { width: auto; vertical-align: top; }
.compare-groups td:nth-child(2) { width: 24%; }
.others { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.others li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 4px 10px; font-size: .9rem; }
.others li > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink-2); }
.others b { font-family: var(--display); font-weight: 600; font-size: 1.12rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.others b .frac { font-size: .65em; vertical-align: .45em; }
.others b .cur { margin-left: 3px; font-family: var(--ui); font-size: .62em; }
.others em { font-style: normal; font-size: .8rem; font-weight: 700; color: var(--flag-ink); white-space: nowrap; }
.others small { grid-column: 1 / -1; color: var(--ink-2); font-size: .76rem; }
.compare-demo .others li { grid-template-columns: 2.2em auto auto; justify-content: start; }

.leaders { margin-bottom: 20px; padding: 16px 20px; background: var(--paper); border-radius: 8px; box-shadow: var(--shadow); }
.leader-bars { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.leader-bars li { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) auto; align-items: center; gap: 14px; font-size: .92rem; }
.leader-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-bar { height: 14px; background: var(--paper-2); border-radius: 2px; overflow: hidden; }
.leader-bar i { display: block; height: 100%; width: 0; background: var(--tag); transition: width .6s cubic-bezier(.16, 1, .3, 1); }
.leader-bars li:first-child .leader-bar i { background: var(--ink); }
.leader-count { color: var(--ink-2); font-size: .86rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.review-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; }
.opinion { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 10px; padding: 8px 12px; border-radius: var(--radius); font-size: .9rem; }
.opinion .icon { width: 16px; height: 16px; }
.opinion span { color: var(--ink-2); flex-basis: 100%; padding-left: 24px; }
.opinion-same { background: #e8f3ea; color: #1b5e2b; }
.opinion-different { background: var(--flag-tint); color: var(--flag-ink); }
.opinion-unsure { background: #fff6c2; color: #6b5200; }

.roster { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.roster-item a { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 56px; padding: 8px 12px; border: 1.5px solid var(--line-2); border-radius: var(--radius); background: var(--paper); text-decoration: none; transition: border-color .14s ease-out, background-color .14s ease-out; }
.roster-item a:hover { border-color: var(--ink); }
.roster-item a:active { background: var(--press); }
.roster-item.is-needs a, .roster-item.is-error a { border-color: var(--flag); }
.roster-no { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 3px; background: var(--ink); color: var(--paper); font-family: var(--display); font-weight: 800; font-size: 1.05rem; }
.roster-name { display: grid; min-width: 0; line-height: 1.25; }
.roster-name b, .roster-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.roster-name small { color: var(--ink-2); font-size: .78rem; }
.roster-state { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 3px; font-size: .76rem; font-weight: 700; white-space: nowrap; background: var(--paper-2); color: var(--ink); }
.roster-state .icon { width: 14px; height: 14px; stroke-width: 2.4; }
.is-needs .roster-state, .roster-state.is-needs { background: var(--flag-tint); color: var(--flag-ink); }
.is-error .roster-state, .roster-state.is-error { background: var(--flag); color: var(--paper); }

details.source > summary { list-style: none; cursor: pointer; }
details.source > summary::-webkit-details-marker { display: none; }
details.source .source-head { grid-template-columns: auto minmax(0, 1fr) auto; margin: 0; border-radius: 3px; }
details.source[open] .source-head { margin-bottom: 18px; }
details.source .source-head:hover .source-supplier { text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.source-letter { font-size: 1.6rem; }
.source-supplier { display: block; font-family: var(--display); font-weight: 800; font-size: clamp(1.4rem, 2.6vw, 1.75rem); line-height: 1.05; overflow-wrap: anywhere; }
.source-file { display: flex; align-items: center; gap: 6px; margin-top: 4px; color: var(--ink-2); font-size: .88rem; }
.source-file span { overflow-wrap: anywhere; }
.source-body .field-row { grid-template-columns: minmax(180px, 1.4fr) repeat(4, minmax(0, 1fr)); }
.source-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.drop-multi { grid-template-columns: auto minmax(0, 1fr); min-height: 104px; }
.drop-multi .drop-letter .icon { width: 26px; height: 26px; color: currentColor; }
.file-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 16px; margin: 14px 0 0; padding: 0 0 0 22px; font-size: .9rem; }
.file-list li { padding: 2px 0; }
.file-list li::marker { font-weight: 700; color: var(--ink-2); }
.file-list span { overflow-wrap: anywhere; }
.file-list small { margin-left: 8px; color: var(--ink-2); }

.spec { margin-top: clamp(48px, 7vw, 88px); }
.spec-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 clamp(20px, 3vw, 40px); margin: 24px 0 0; }
.spec-list div { padding: 18px 0 22px; border-top: 2px solid var(--ink); }
.spec-list dt { font-family: var(--display); font-weight: 800; font-size: clamp(1.35rem, 2.2vw, 1.6rem); line-height: 1.05; }
.spec-list dd { margin: 10px 0 0; color: var(--ink-2); max-width: 36ch; }

.pilot { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); align-items: start; margin-top: clamp(40px, 6vw, 80px); padding: clamp(24px, 4vw, 48px); background: var(--ink); color: var(--paper); border-radius: 8px; scroll-margin-top: 16px; }
.pilot-copy p { margin: 14px 0 22px; color: #c9cdd3; max-width: 44ch; }
.pilot-copy .btn-secondary { background: transparent; border-color: #5a5e66; color: var(--paper); }
.pilot-copy .btn-secondary:hover { border-color: var(--paper); }
.pilot-copy .btn-secondary:active { background: #2a2d33; }
.pilot-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: clamp(18px, 3vw, 28px); background: var(--paper); color: var(--ink); border-radius: var(--radius); }
.pilot-form .span-2 { grid-column: 1 / -1; }
.pilot-form .check { margin: 0; font-weight: 500; }
.pilot-form .btn-primary { justify-self: start; }
.pilot-done { display: block; }
.pilot-done b { font-family: var(--display); font-size: 1.6rem; }
.pilot-done p { margin-top: 6px; color: var(--ink-2); }

@media (max-width: 1024px) {
  .source-body .field-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spec-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .pilot { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 690px) {
  .topbar-nav { gap: 12px; }
  .topbar-hide-sm { display: none; }
  .topbar-link { font-size: .88rem; }
  .lang a, .lang-current { min-width: 38px; }
  .compare-groups tbody tr { grid-template-columns: minmax(0, 1fr); }
  .compare-groups tbody th { width: auto; }
  .compare-groups td:nth-child(2) { width: auto; }
  .compare-groups td[data-label]::before { margin-bottom: 4px; }
  .compare-groups td + td { padding-top: 4px; }
  .compare-demo tbody tr { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .leader-bars li { grid-template-columns: minmax(0, 1fr) auto; }
  .leader-bar { grid-column: 1 / -1; grid-row: 2; }
  .roster { grid-template-columns: minmax(0, 1fr); }
  .source-body .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .source-body .supplier, .basis .unit-wide { grid-column: 1 / -1; }
  details.source .source-head { grid-template-columns: auto minmax(0, 1fr); }
  details.source .source-head > .roster-state { grid-column: 2; justify-self: start; }
  .spec-list { grid-template-columns: minmax(0, 1fr); }
  .pilot.wrap { width: 100%; margin-inline: 0; border-radius: 0; padding: 28px 16px; }
  .pilot-form { grid-template-columns: minmax(0, 1fr); }
  .pilot-form .btn-primary { justify-self: stretch; }
  .review-head .review-ai, .review-head .review-ai .btn { width: 100%; }
}
@media (max-width: 380px) {
  .source-body .field-row { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  .leader-bar i { transition: none; }
}
.roster-state.is-vat { background: #fff6c2; color: #6b5200; }
.fallback { margin-top: 20px; padding: 16px 18px; border: 1.5px solid var(--line-2); border-radius: var(--radius); }
.fallback.is-wanted { border-color: var(--tag-press); background: #fffbe0; }
.fallback h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 1.25rem; line-height: 1.1; }
.fallback .note { margin-top: 6px; }
.fallback .field-row { margin-top: 14px; }
.field-row-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 690px) { .field-row-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
