/* Прора — дизайн-система.
   Бетонный фон, графитовый текст, акцент «сурик» — цвет грунта по металлу.
   Unbounded — заголовки и крупные цифры, Onest — текст и цены. */

@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(../fonts/onest-cyrillic-400-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 400; font-display: swap; src: url(../fonts/onest-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20BD, U+2212; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(../fonts/onest-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 500; font-display: swap; src: url(../fonts/onest-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20BD, U+2212; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(../fonts/onest-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 600; font-display: swap; src: url(../fonts/onest-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20BD, U+2212; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url(../fonts/onest-cyrillic-700-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-weight: 700; font-display: swap; src: url(../fonts/onest-latin-700-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20BD, U+2212; }
@font-face { font-family: "Unbounded"; font-weight: 500; font-display: swap; src: url(../fonts/unbounded-cyrillic-500-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 500; font-display: swap; src: url(../fonts/unbounded-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20BD, U+2212; }
@font-face { font-family: "Unbounded"; font-weight: 600; font-display: swap; src: url(../fonts/unbounded-cyrillic-600-normal.woff2) format("woff2"); unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Unbounded"; font-weight: 600; font-display: swap; src: url(../fonts/unbounded-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20BD, U+2212; }

:root {
  --paper: #f1f2f4;
  --surface: #ffffff;
  --ink: #1c2026;
  --ink-2: #4b525c;
  --mute: #868d97;
  --line: #dcdfe3;
  --line-strong: #c3c8cf;
  --sunken: #f6f7f8;
  --red: #d8351b;
  --red-hover: #b92b14;
  --red-soft: #fcebe7;
  --ok: #237a4b;
  --ok-soft: #e3f2e9;
  --alt: #8a5a00;
  --alt-soft: #fff1d6;

  --display: "Unbounded", "Onest", system-ui, sans-serif;
  --text: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --focus: 0 0 0 3px rgba(216, 53, 27, .28);
  --pop: 0 12px 32px rgba(28, 32, 38, .14), 0 2px 6px rgba(28, 32, 38, .08);
  --sidebar: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.5 var(--text);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: 3px; }
a:hover { color: var(--red); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
img, svg { display: block; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font: 600 28px/1.15 var(--display); letter-spacing: -.02em; }
h2 { font: 600 19px/1.25 var(--display); letter-spacing: -.01em; }
h3 { font: 600 16px/1.3 var(--text); }
p { margin: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- утилиты ---------- */
.muted { color: var(--mute); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- логотип ---------- */
.logo { display: inline-flex; align-items: center; flex: none; text-decoration: none; color: var(--ink); line-height: 0; }
.logo:hover { color: var(--ink); }
.logo__img { display: block; height: 76px; width: auto; }
.logo:focus-visible { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 8px; }

/* ---------- кнопки ---------- */
.btn { --h: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: var(--h);
  padding: 0 18px; border-radius: var(--r-sm); border: 1px solid transparent; font: 600 15px/1 var(--text);
  cursor: pointer; text-decoration: none; white-space: nowrap; background: var(--red); color: #fff;
  transition: background-color .15s, border-color .15s, color .15s; }
.btn:hover { background: var(--red-hover); color: #fff; }
.btn:disabled { opacity: .45; cursor: default; }
.btn-ink { background: var(--ink); }
.btn-ink:hover { background: #343a43; }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); color: var(--ink); }
.btn-danger { background: transparent; border-color: transparent; color: var(--red); padding: 0 10px; }
.btn-danger:hover { background: var(--red-soft); color: var(--red-hover); }
.btn-sm { --h: 34px; padding: 0 12px; font-size: 14px; }
.btn-lg { --h: 52px; padding: 0 26px; font-size: 16px; }
.btn-block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--ink-2); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.link-btn:hover { color: var(--red); text-decoration-color: currentColor; }

/* ---------- панели ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; }
.panel--flush { padding: 0; overflow: hidden; }
.panel--tight { padding: 16px 20px; }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel__head h2, .panel__head h3 { margin: 0; }
.panel + .panel { margin-top: 16px; }
.grid-2 > .panel { margin-top: 0; }
.section { margin-top: 32px; }
.section > h2 { margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }

/* ---------- таблицы ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 13px; font-weight: 500; color: var(--mute); padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--sunken); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot td { border-bottom: 0; padding-top: 8px; padding-bottom: 8px; }
.table tfoot tr:first-child td { border-top: 1px solid var(--line); padding-top: 16px; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: #fafafb; }
.table .idx { color: var(--mute); width: 44px; }
.table .right { text-align: right; }
.table--compact td { padding: 10px 0; }
.table--compact th { padding: 0 0 8px; background: none; }
.table--compact th + th, .table--compact td + td { padding-left: 16px; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
.dl dt { color: var(--mute); }
.dl dd { margin: 0; font-weight: 500; }
.dl--stack { grid-template-columns: 1fr; gap: 2px; }
.dl--stack dd + dt { margin-top: 10px; }

/* ---------- статусы ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; padding: 3px 10px 3px 8px;
  border-radius: 999px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge--collecting, .badge--pending { color: var(--red); background: var(--red-soft); border-color: transparent; }
.badge--choosing { color: #fff; background: var(--ink); border-color: var(--ink); }
.badge--selected, .badge--accepted, .badge--sent { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.badge--cancelled, .badge--rejected { color: var(--mute); }
.tag { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--red); color: #fff; }

/* ---------- приложение: боковая панель ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh;
  background: linear-gradient(to right, var(--surface) calc(var(--sidebar) - 1px), var(--line) calc(var(--sidebar) - 1px), var(--line) var(--sidebar), transparent var(--sidebar)); }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 22px 16px; gap: 22px; }
.sidebar .logo { padding: 0 8px; }
.sidebar .logo__img { height: 64px; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar__nav a { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px;
  border-radius: var(--r-sm); text-decoration: none; color: var(--ink-2); font-weight: 500; position: relative; }
.sidebar__nav a:hover { background: var(--sunken); color: var(--ink); }
.sidebar__nav a.active { background: var(--sunken); color: var(--ink); font-weight: 600; }
.sidebar__nav a.active::before { content: ""; position: absolute; left: -16px; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--red); }
.sidebar__group { font-size: 13px; color: var(--mute); padding: 0 12px 6px; }
.sidebar__user { margin-top: auto; border-top: 1px solid var(--line); padding: 16px 8px 0; font-size: 14px; }
.sidebar__user b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar__user form { margin-top: 10px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 600; }
.count--muted { background: var(--line); color: var(--ink-2); }

.main { min-width: 0; padding: 32px 40px 64px; }
.main__inner { max-width: 1160px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head__title { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.back { display: inline-block; font-size: 14px; color: var(--mute); text-decoration: none; margin-bottom: 10px; }
.back:hover { color: var(--ink); }

/* двухколоночная страница: работа слева, сводка справа */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.aside { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- публичные страницы ---------- */
.topbar { max-width: 1240px; margin: 0 auto; padding: 12px 32px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.topbar nav { display: flex; align-items: center; gap: 24px; font-weight: 500; }
.topbar nav a { text-decoration: none; color: var(--ink-2); }
.public-main { max-width: 1240px; margin: 0 auto; padding: 0 32px 80px; }

/* ---------- уведомления ---------- */
.flash { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r-sm);
  margin-bottom: 20px; font-weight: 500; background: var(--surface); border: 1px solid var(--line); }
.flash::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); flex: none; }
.flash--error { border-color: #f1c3ba; background: var(--red-soft); color: var(--red-hover); }
.flash--error::before { background: var(--red); }
.notice { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 20px;
  border-radius: var(--r); background: var(--ink); color: #fff; margin-bottom: 28px; }
.notice .btn-ghost { background: transparent; color: #fff; border-color: #5a616b; }
.notice .btn-ghost:hover { border-color: #fff; color: #fff; }
.warn { padding: 10px 14px; border-radius: var(--r-sm); background: var(--alt-soft); color: var(--alt); font-weight: 500; margin-bottom: 16px; }

/* ---------- формы ---------- */
.field { display: block; }
.field__label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 6px; color: var(--ink-2); }
.input { width: 100%; height: 44px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); padding: 0 12px;
  font: inherit; background: var(--surface); color: var(--ink); transition: border-color .15s; }
.input::placeholder { color: #a3a9b1; }
.input:hover { border-color: var(--mute); }
.input:focus { outline: none; border-color: var(--red); box-shadow: var(--focus); }
.input:disabled { background: var(--sunken); color: var(--mute); }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
select.input { appearance: none; padding-right: 36px; cursor: pointer;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%234b525c' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 13px center; }
.input.sm { height: 38px; }
.input.num { text-align: right; }
.check { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; accent-color: var(--red); margin: 0; }
.hint { font-size: 13px; color: var(--mute); margin-top: 6px; }
.segmented { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented input + span { display: inline-block; padding: 8px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  cursor: pointer; font-weight: 500; font-size: 14px; background: var(--surface); }
.segmented input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }
.segmented input:disabled + span { color: var(--mute); border-style: dashed; cursor: not-allowed; }
.soon { font-size: 12px; color: var(--mute); margin-left: 6px; }

.items-table td { padding: 8px 6px; vertical-align: middle; border-bottom: 1px solid var(--line); }
.items-table th { padding: 0 6px 8px; background: none; border-bottom: 1px solid var(--line); }
.items-table td:first-child, .items-table th:first-child { padding-left: 0; }
.items-table td:last-child { padding-right: 0; }
.items-table .w-pack { width: 96px; }
.items-table .w-unit { width: 92px; }
.items-table .w-qty { width: 96px; }
.items-table .w-x { width: 36px; text-align: center; }
.matched { font-size: 12px; color: var(--ok); font-weight: 500; margin-top: 3px; }
.matched:empty { display: none; }
.icon-btn { width: 32px; height: 32px; border-radius: var(--r-sm); border: 0; background: none; color: var(--mute);
  cursor: pointer; font-size: 18px; line-height: 1; }
.icon-btn:hover { background: var(--red-soft); color: var(--red); }
.dropzone { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 16px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-sm); background: var(--sunken); margin-bottom: 16px; }
.dropzone.is-over { border-color: var(--red); background: var(--red-soft); }
.dropzone.is-busy { pointer-events: none; opacity: .8; }
.dropzone.is-busy .btn { visibility: hidden; }

/* ---------- автокомплит ---------- */
.ac { position: relative; }
.ac__list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; min-width: max(100%, 140px); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--pop); list-style: none; margin: 0; padding: 4px;
  max-height: 280px; overflow: auto; }
.ac__list li { padding: 9px 10px; border-radius: 4px; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; }
.ac__list li small { color: var(--mute); white-space: nowrap; }
.ac__list li.active, .ac__list li:hover { background: var(--sunken); }
.ac__list li.active { box-shadow: inset 2px 0 0 var(--red); }

/* ---------- табы ---------- */
.tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.tabs a, .tabs button { display: inline-flex; align-items: center; gap: 8px; padding: 0 0 12px; text-decoration: none;
  color: var(--mute); border: 0; background: none; font: 500 15px/1.2 var(--text); cursor: pointer; margin-bottom: -1px;
  border-bottom: 2px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs .active { color: var(--ink); border-bottom-color: var(--red); font-weight: 600; }
.tabs button:disabled { cursor: not-allowed; }

/* ---------- таймеры ---------- */
.timer { font: 500 22px/1 var(--display); letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.progress { height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--red); transform-origin: left; transform: scaleX(var(--progress, 0)); transition: transform 1s linear; }

.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.live { display: flex; flex-direction: column; gap: 14px; padding: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); text-decoration: none; transition: border-color .15s; }
.live:hover { border-color: var(--ink); color: inherit; }
.live__top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.live__title { font-weight: 600; }
.live__meta { font-size: 13px; color: var(--mute); }
.live__reach { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.live__foot { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); }

.waiting { padding: 44px 32px 36px; text-align: center; }
.waiting h2 { margin-bottom: 8px; }
.waiting .timer { font-size: 56px; margin: 28px 0 22px; }
.waiting .progress { max-width: 420px; margin: 0 auto 24px; }
.pill { display: inline-flex; align-items: center; gap: 10px; padding: 8px 16px; border-radius: 999px; background: var(--sunken);
  border: 1px solid var(--line); font-weight: 500; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: pulse 1.8s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(216, 53, 27, .45); } 100% { box-shadow: 0 0 0 10px rgba(216, 53, 27, 0); } }

/* ---------- звёзды ---------- */
.stars { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); white-space: nowrap; }
.stars__row { display: inline-flex; gap: 1px; font-size: 14px; line-height: 1; letter-spacing: 0; }
.star { color: var(--line-strong); }
.star.full { color: var(--red); }
.star.half { background: linear-gradient(90deg, var(--red) 50%, var(--line-strong) 50%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.rating-input { display: inline-flex; flex-direction: row-reverse; gap: 6px; }
.rating-input input { position: absolute; opacity: 0; pointer-events: none; }
.rating-input label { font-size: 32px; line-height: 1; color: var(--line-strong); cursor: pointer; transition: color .1s; }
.rating-input label:hover, .rating-input label:hover ~ label, .rating-input input:checked ~ label { color: var(--red); }
.rating-input input:focus-visible + label { text-shadow: 0 0 0 var(--red); outline: 2px solid var(--red); border-radius: 4px; }

/* ---------- предложения ---------- */
.offers { display: flex; flex-direction: column; gap: 12px; }
.offer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); position: relative; }
.offer--best { border-color: var(--red); box-shadow: inset 3px 0 0 var(--red); }
.offer__head { display: grid; grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(96px, 1fr)) auto; gap: 20px;
  align-items: center; padding: 18px 20px 18px 24px; }
.offer__seller { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.offer__label { font-size: 13px; color: var(--mute); }
.offer__value { font-weight: 600; font-size: 16px; }
.offer__value--total { font: 600 18px/1.3 var(--display); }
.offer__counts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; margin-top: 6px; }
.offer__counts .ok { color: var(--ok); }
.offer__counts .no { color: var(--red); }
.offer__counts .alt { color: var(--alt); }
.offer__body { border-top: 1px solid var(--line); padding: 20px 24px 24px; display: none; }
.offer.open .offer__body { display: block; }
.offer.open .chev { transform: rotate(180deg); }
.chev { display: inline-block; transition: transform .2s; }
.line-unavailable td { color: var(--mute); }
.line-note { font-size: 13px; margin-top: 3px; }
.line-note--alt { color: var(--alt); }
.line-note--no { color: var(--red); }
.totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 0; font-size: 15px; margin: 0; }
.totals dt { color: var(--ink-2); }
.totals dd { margin: 0; padding-left: 16px; text-align: right; font-weight: 600; }
.totals .grand { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 4px; }
.totals dd.grand { font: 600 22px/1.2 var(--display); }

.seller-card { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.seller-card__name { font: 600 22px/1.2 var(--display); margin: 4px 0 8px; }

/* ---------- модальное окно ---------- */
.modal { position: fixed; inset: 0; background: rgba(28, 32, 38, .55); display: none; place-items: center; z-index: 50; padding: 20px; }
.modal.open { display: grid; }
.modal__box { background: var(--surface); border-radius: var(--r-lg); width: 100%; max-width: 440px; padding: 32px; position: relative; box-shadow: var(--pop); }
.modal__close { position: absolute; right: 14px; top: 12px; width: 36px; height: 36px; border-radius: 50%; background: none; border: 0;
  font-size: 22px; cursor: pointer; color: var(--mute); }
.modal__close:hover { background: var(--sunken); color: var(--ink); }
.modal__box h2 { margin-bottom: 8px; }
.role-switch { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--r-sm); background: var(--sunken); border: 1px solid var(--line); }
.role-switch label { text-align: center; padding: 10px; border-radius: 4px; cursor: pointer; font-weight: 600; color: var(--ink-2); position: relative; }
.role-switch input { position: absolute; opacity: 0; pointer-events: none; }
.role-switch label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(28, 32, 38, .12); }
.role-switch label:has(input:focus-visible) { box-shadow: var(--focus); }
.code-input { font: 500 30px/1 var(--display); letter-spacing: .35em; text-align: center; height: 64px; padding-left: .35em; }
.auth-card { max-width: 440px; margin: 48px auto 0; }

/* ---------- лендинг ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 64px; align-items: center; padding: 56px 0 88px; }
.hero h1 { font-size: 54px; line-height: 1.04; letter-spacing: -.035em; max-width: 14ch; text-wrap: balance; }
.hero__lead { font-size: 19px; line-height: 1.5; color: var(--ink-2); max-width: 46ch; margin: 24px 0 36px; }
.hero__note { margin-top: 18px; font-size: 14px; color: var(--mute); }

.demo { position: relative; }
.demo__sheet { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px 24px 18px; }
.demo__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.demo__title { font: 600 15px/1.2 var(--display); }
.demo__timer { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.demo__timer b { font: 500 14px/1 var(--display); color: var(--ink); }
.demo__items { width: 100%; border-collapse: collapse; font-size: 14px; }
.demo__items td { padding: 8px 0; border-top: 1px solid var(--line); }
.demo__items td:last-child { text-align: right; color: var(--mute); white-space: nowrap; padding-left: 12px; }
.demo__bids { margin: -10px 18px 0 38px; position: relative; display: flex; flex-direction: column; gap: 8px; }
.bid { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; align-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; box-shadow: var(--pop); }
.bid__name { font-weight: 600; font-size: 14px; }
.bid__meta { font-size: 12px; color: var(--mute); }
.bid__sum { font: 600 16px/1 var(--display); grid-row: span 2; }
.bid--best { border-color: var(--red); box-shadow: var(--pop), inset 3px 0 0 var(--red); }
.bid--best .bid__sum { color: var(--red); }

.how { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--ink); }
.how__step { padding: 28px 32px 8px 0; }
.how__step + .how__step { padding-left: 32px; border-left: 1px solid var(--line); }
.how__num { font: 600 15px/1 var(--display); color: var(--red); margin-bottom: 18px; }
.how__step h3 { font-size: 18px; margin-bottom: 8px; }
.how__step p { color: var(--ink-2); max-width: 34ch; }

.sellers-band { display: flex; justify-content: space-between; align-items: center; gap: 32px; margin-top: 88px; padding: 36px 40px;
  border-radius: var(--r-lg); background: var(--ink); color: #fff; }
.sellers-band h2 { font-size: 24px; max-width: 24ch; }
.sellers-band p { color: #b5bac2; margin-top: 10px; max-width: 54ch; }

.faq { margin-top: 88px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px; border-top: 1px solid var(--ink); padding-top: 28px; }
.faq h2 { font-size: 26px; max-width: 14ch; }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__item summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px;
  padding: 16px 0; font-weight: 600; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; flex-shrink: 0; width: 20px; text-align: center; color: var(--red); font: 600 20px/1 var(--display); transition: transform .15s; }
.faq__item[open] summary::after { transform: rotate(45deg); }
.faq__item summary:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.faq__item p { color: var(--ink-2); max-width: 64ch; padding-bottom: 18px; }
@media (max-width: 800px) { .faq { grid-template-columns: 1fr; gap: 8px; margin-top: 56px; } }
@media (prefers-reduced-motion: reduce) { .faq__item summary::after { transition: none; } }

.showcase { margin-top: 88px; }
.showcase__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 20px; }
.showcase__head h2 { font-size: 26px; }
.slider__track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 16px) / 4); gap: 16px; overflow-x: auto;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding-bottom: 4px; }
.slider__track::-webkit-scrollbar { display: none; }
.slider__nav { display: flex; gap: 8px; }
.slider__nav button { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface);
  cursor: pointer; font-size: 18px; color: var(--ink); }
.slider__nav button:hover { border-color: var(--ink); }
.material { scroll-snap-align: start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 20px; display: flex; flex-direction: column; min-height: 200px; }
.material__pack { font-size: 13px; color: var(--mute); margin-bottom: 10px; }
.material__name { font-weight: 600; font-size: 16px; line-height: 1.35; flex: 1; }
.material__price { margin-top: 18px; font-size: 14px; color: var(--ink-2); }
.material__price b { font: 600 20px/1 var(--display); color: var(--ink); margin-left: 4px; }

.footer { border-top: 1px solid var(--line); }
.footer__inner { max-width: 1240px; margin: 0 auto; padding: 24px 32px; display: flex; justify-content: space-between; gap: 16px;
  font-size: 13px; color: var(--mute); }
.empty { text-align: center; padding: 48px 24px; color: var(--ink-2); }
.empty h2 { margin-bottom: 8px; }
.empty p { color: var(--mute); margin-bottom: 20px; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .split { grid-template-columns: minmax(0, 1fr) 300px; }
  .main { padding: 28px 28px 56px; }
  .hero { gap: 40px; }
  .hero h1 { font-size: 44px; }
  .slider__track { grid-auto-columns: calc((100% - 2 * 16px) / 3); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; background: none; }
  /* шапка кабинета: логотип и пользователь в первой строке, разделы — вкладками, кнопка сметы — во всю ширину */
  .sidebar { position: static; height: auto; display: grid; grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "logo user" "nav nav" "cta cta"; align-items: center; gap: 12px 16px;
    padding: 10px 16px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar:not(:has(> .btn)) { grid-template-areas: "logo user" "nav nav"; }
  .sidebar > .logo { grid-area: logo; padding: 0; }
  .sidebar .logo__img { height: 48px; }
  .sidebar > .btn { grid-area: cta; }
  .sidebar__nav { grid-area: nav; flex-direction: row; gap: 4px; overflow-x: auto; scrollbar-width: none;
    margin: 0 -16px; padding: 0 16px; }
  .sidebar__nav::-webkit-scrollbar { display: none; }
  .sidebar__nav a { flex: none; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
  .sidebar__nav a.active::before, .sidebar__group { display: none; }
  .sidebar__user { grid-area: user; margin: 0; border: 0; padding: 0; min-width: 0;
    display: grid; grid-template-columns: auto auto; justify-content: end; align-items: baseline; column-gap: 10px; text-align: right; }
  .sidebar__user b { grid-column: 1 / -1; max-width: 100%; }
  .sidebar__user form { margin: 0; }
  .split, .hero, .grid-2 { grid-template-columns: 1fr; }
  .aside { position: static; }
  .offer__head { grid-template-columns: 1fr 1fr; }
  .how { grid-template-columns: 1fr; }
  .how__step + .how__step { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .sellers-band { flex-direction: column; align-items: flex-start; }
  .slider__track { grid-auto-columns: 46%; }
}
@media (max-width: 600px) {
  html, body { overflow-x: clip; }   /* страховка: ничего не должно давать горизонтальный скролл */
  .input, select.input, textarea.input { font-size: 16px; }   /* iOS не увеличивает страницу при вводе */
  .showcase__head .slider__nav { display: none; }   /* на телефоне карточки листаются свайпом */
  .showcase__head h2 { font-size: 22px; }
  .main, .public-main, .topbar { padding-left: 16px; padding-right: 16px; }
  .topbar { padding-top: 10px; padding-bottom: 10px; }
  .logo__img, .sidebar .logo__img { height: 52px; }
  .hero h1 { font-size: 31px; }
  .slider__track { grid-auto-columns: 80%; }
  .table th, .table td { padding-left: 10px; padding-right: 10px; }
}

.offer__sub { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 6px; }
.offer__sub .offer__counts { margin-top: 0; }
.unloading { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.unloading .check { height: 38px; }

/* ---------- доработки: ошибки форм, редактирование, контакты, отзывы ---------- */
.input.is-invalid { border-color: var(--red); }
.field-error { margin-top: 6px; font-size: 14px; color: var(--red-hover); }
.field-info { margin-top: 6px; font-size: 14px; color: var(--ok); }
.narrow-col { max-width: 760px; }
.details { margin-top: 40px; }
.details > .grid-2 { align-items: start; }
.details__title { margin-bottom: 14px; }
.offers + .details, .waiting + .details { margin-top: 48px; }

.editable__form { display: none; margin-top: 4px; }
.editable.is-editing .editable__form { display: block; }
.editable.is-editing .editable__view { display: none; }
.editable__view { display: flex; align-items: center; gap: 8px; }
.editable__value { font-size: 16px; font-weight: 500; }
.icon-btn--edit { display: inline-grid; place-items: center; color: var(--ink-2); }
.icon-btn--edit:hover { background: var(--sunken); color: var(--ink); }

.contacts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.contact { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line);
  border-radius: var(--r-sm); background: var(--sunken); }
.contact__name { font-weight: 600; }
.add-contact > summary { list-style: none; width: fit-content; }
.add-contact > summary::-webkit-details-marker { display: none; }
.add-contact[open] > summary { display: none; }
.new-contact { margin-top: 0; }
.contact-preview { margin-top: 6px; }

.chosen { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; align-items: start; }
.chosen__phone { display: inline-block; margin: 14px 0 8px; font: 600 22px/1.2 var(--display); text-decoration: none; }
.chosen__totals { padding: 18px 20px; border-radius: var(--r-sm); background: var(--sunken); }
@media (max-width: 960px) { .chosen { grid-template-columns: 1fr; } }

a.stars--link { text-decoration: none; }
a.stars--link > span:last-child { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
a.stars--link:hover > span:last-child { color: var(--red); text-decoration-color: currentColor; }
.modal__box--wide { max-width: 560px; max-height: 80vh; overflow: auto; }
.reviews__head { display: flex; flex-direction: column; gap: 6px; padding-bottom: 16px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.review { padding: 14px 0; border-bottom: 1px solid var(--line); }
.review:last-child { border-bottom: 0; }
.review p { margin-top: 6px; }

/* ---------- выпадающее меню (PDF) ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu[open] .chev { transform: rotate(180deg); }
.menu__list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 100%; width: max-content; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); box-shadow: var(--pop); }
.menu__list a { display: block; padding: 10px 14px; border-radius: 4px; text-decoration: none; font-weight: 500; white-space: nowrap; }
.menu__list a:hover { background: var(--sunken); color: var(--ink); }

/* ---------- ИИ-распознавание: сканер поверх блока «Материалы» ---------- */
.panel--ai { position: relative; transition: min-height .3s ease; }
.panel--ai.is-recognizing { min-height: 340px; }
.ai-scan { position: absolute; inset: 0; z-index: 40; border-radius: inherit; overflow: hidden;
  display: grid; place-items: center; text-align: center;
  background: rgba(255, 255, 255, .8); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s; }
.panel--ai.is-recognizing .ai-scan { opacity: 1; visibility: visible; transition: opacity .3s ease; }
/* точечная сетка, растворяется к краям */
.ai-scan::before { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(28, 32, 38, .18) 1px, transparent 1.3px); background-size: 16px 16px;
  -webkit-mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 20%, transparent 80%);
  mask-image: radial-gradient(ellipse 70% 65% at 50% 50%, #000 20%, transparent 80%); }
/* луч сканера: шлейф и яркая кромка */
.ai-scan__beam { position: absolute; left: 0; right: 0; top: -140px; height: 140px; pointer-events: none;
  background: linear-gradient(to bottom, rgba(216, 53, 27, 0), rgba(216, 53, 27, .08) 60%, rgba(216, 53, 27, .22));
  animation: ai-beam 2.8s cubic-bezier(.45, 0, .4, 1) infinite; }
.ai-scan__beam::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--red);
  box-shadow: 0 0 10px 1px rgba(216, 53, 27, .55), 0 0 28px 4px rgba(216, 53, 27, .25); }
@keyframes ai-beam { 0% { top: -140px; } 100% { top: 100%; } }
.ai-scan__center { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px; }
.ai-scan__spark { fill: var(--red); margin-bottom: 8px; filter: drop-shadow(0 0 10px rgba(216, 53, 27, .35));
  animation: ai-spark 2.8s ease-in-out infinite; }
@keyframes ai-spark { 0%, 100% { transform: scale(.82) rotate(0deg); opacity: .75; } 50% { transform: scale(1) rotate(45deg); opacity: 1; } }
.ai-scan__title { font: 600 18px/1.25 var(--display); letter-spacing: -.01em; }
.ai-scan__meta { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.ai-scan__hint { color: var(--mute); font-size: 13px; margin-top: 6px; }
/* распознанные позиции появляются по очереди */
.items-table tr.is-new td { animation: ai-row-in .7s ease-out both; animation-delay: calc(var(--i, 0) * 60ms); }
@keyframes ai-row-in { from { opacity: 0; transform: translateY(6px); background: var(--red-soft); }
  60% { opacity: 1; transform: none; background: var(--red-soft); } to { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  .ai-scan__beam { animation: none; top: 45%; }
}

/* ---------- согласия и юридические документы ---------- */
.consents { display: grid; gap: 10px; }
.consent { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 1.45; color: var(--ink-2); cursor: pointer; }
.consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--red); }
.consent a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.upload-note { margin: -4px 0 16px; }
.upload-note a { color: inherit; text-decoration: underline; }
.footer__inner { flex-wrap: wrap; }
.footer__links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.footer__links a { color: inherit; }
.footer__links a:hover { color: var(--ink); }

.legal { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding: 40px 0 88px; align-items: start; }
.legal__nav { position: sticky; top: 24px; display: grid; gap: 4px; }
.legal__nav a { text-decoration: none; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; }
.legal__nav a[aria-current] { background: var(--surface); color: var(--ink); font-weight: 600; }
.legal__doc { max-width: 72ch; }
.legal__doc h1 { font-size: 34px; line-height: 1.1; letter-spacing: -.02em; margin-bottom: 8px; }
.legal__meta { color: var(--mute); font-size: 14px; margin-bottom: 32px; }
.legal__doc h2 { font-size: 20px; margin: 36px 0 12px; }
.legal__doc p, .legal__doc li { font-size: 16px; line-height: 1.65; color: var(--ink-2); }
.legal__doc p + p { margin-top: 10px; }
.legal__doc ol, .legal__doc ul { padding-left: 22px; display: grid; gap: 6px; margin: 8px 0; }
.legal__doc ul { list-style: disc; }
.legal__doc ol { list-style: decimal; }
.legal__doc a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.legal__doc .todo { background: #fff3c4; padding: 0 4px; border-radius: 3px; }
@media (max-width: 960px) {
  .legal { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .legal__nav { position: static; display: flex; flex-wrap: wrap; }
  .legal__doc h1 { font-size: 26px; }
}

/* ---------- условия доставки полосой над формой продавца ---------- */
.terms-strip { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px 32px; margin-bottom: 24px; }
.terms-strip__cell { display: grid; gap: 4px; align-content: start; min-width: 0; }
.terms-strip__cell b { font-size: 16px; font-weight: 600; line-height: 1.35; }
.terms-strip__cell--full { grid-column: 1 / -1; padding-top: 14px; border-top: 1px solid var(--line); color: var(--ink-2); }
.terms-strip__label { font-size: 13px; color: var(--mute); }
@media (max-width: 760px) { .terms-strip { grid-template-columns: 1fr 1fr; } .terms-strip__cell--wide { grid-column: 1 / -1; } }

/* ---------- сбор с уже пришедшими предложениями ---------- */
.waiting__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 16px; }
.waiting--compact { margin-bottom: 32px; }
.waiting--compact { padding: 28px 32px 24px; }
.waiting--compact .timer { font-size: 40px; margin: 16px 0 14px; }
.waiting--compact .progress { margin-bottom: 18px; }

/* ---------- новые победы продавца ---------- */
.nav-badge { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--ok); color: #fff;
  font-size: 12px; font-weight: 600; line-height: 1.4; vertical-align: 1px; white-space: nowrap; }
.count--win { background: var(--ok); color: #fff; }
.tag--win { background: var(--ok-soft); color: var(--ok); }
.win-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap;
  margin-bottom: 24px; padding: 20px 24px; border-radius: var(--r, 14px); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 30%, transparent); }
.win-banner b { font-size: 17px; }
.win-banner p { margin-top: 4px; color: var(--ink-2); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.win-banner b a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.consent-note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--mute); text-align: center; }
.consent-note a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }
.stack > .consent-note { margin-top: 12px; }

/* ---------- позиции сметы на телефоне: карточки вместо таблицы ---------- */
@media (max-width: 600px) {
  .items-table, .items-table tbody { display: block; width: 100%; }
  .items-table thead { display: none; }
  .items-table tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 36px; gap: 8px 10px;
    padding: 14px 0; border-bottom: 1px solid var(--line); }
  .items-table td { display: block; padding: 0 !important; border: 0; width: auto !important; }
  .items-table td.idx { grid-column: 1 / 4; grid-row: 1; align-self: center; font-size: 13px; color: var(--mute); text-align: left; }
  .items-table td.idx::before { content: "Позиция "; }
  .items-table td.w-x { grid-column: 4; grid-row: 1; justify-self: end; }
  .items-table td.w-name { grid-column: 1 / -1; grid-row: 2; }
  .items-table td.w-pack { grid-column: 1; grid-row: 3; }
  .items-table td.w-unit { grid-column: 2; grid-row: 3; }
  .items-table td.w-qty { grid-column: 3 / -1; grid-row: 3; }
  .items-table td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 4px; font-size: 12px; color: var(--mute); }
  .items-table .input { width: 100%; height: 44px; }
  .items-table .input.num { text-align: left; }
  #add-item { width: 100%; }
}
@media (max-width: 600px) {
  .dropzone { flex-direction: column; align-items: stretch; text-align: left; }
  .dropzone .btn { width: 100%; }
  .material { min-height: 0; }
  .material__name { flex: none; }
  .slider__track { grid-auto-columns: 72%; }
}
.items-hint { margin: 20px 0 8px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.items-hint b { color: var(--ink); font-weight: 600; }
