:root {
  --bg: #f6f5f2; --card: #fff; --ink: #1d1f22; --muted: #6b6f76; --line: #e2e0db;
  --acc: #1f6f5c; --acc-ink: #fff; --warn: #a33a2a; --ok-bg: #e7f3ee; --err-bg: #fbe9e6; --chip: #eeece7;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--acc); }
h1 { font-size: 24px; margin: 18px 0 12px; }
h2 { font-size: 18px; margin: 18px 0 8px; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 620px; }
.muted { color: var(--muted); font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; }
.inline { display: inline; }
mark { background: #fff0b3; }

/* шапка: строже по просьбе папы 06.11 (msg 284045) — полоса цвета сверху, подпись отделена чертой,
   меню тёмным текстом с подчёркиванием текущего раздела, пользователь и «Выйти» отдельным блоком справа */
.top { background: var(--card); border-top: 3px solid var(--acc); border-bottom: 1px solid var(--line); box-shadow: 0 1px 3px #0000000a; }
.top-in { display: flex; align-items: center; gap: 12px 28px; min-height: 76px; flex-wrap: wrap; }
.logo { text-decoration: none; color: var(--ink); display: flex; align-items: center; gap: 16px; }
.logo img { height: 58px; width: auto; display: block; margin: 1px 0 22px; }   /* логотип — tools/logo/vtracer_logo.py, вариант «корзина вместо ё» */
/* надпись «КошёлкА» в логотипе ниже середины картинки (сверху ручка корзины и точки): на 69 % высоты.
   Отступы картинки (сверху 1 px, снизу 22 px) ставят надпись посередине шапки, ручка с точками уходит вверх,
   как точки над «ё». Подпись, меню и блок пользователя стоят по центру строки и сдвинуты на 2 px вниз: у строки
   текста заглавные выше её середины, со сдвигом середины заглавных в меню и в надписи совпадают (44 px).
   На телефоне шапка в две строки, там «Выйти» сдвигаем к середине надписи на 10 px. */
.top { --logo-text-shift: 2px; }
.logo .tagline, .top-in > .menu, .top-in > .account { position: relative; top: var(--logo-text-shift); }
.logo .tagline { color: var(--muted); font-size: 11px; line-height: 1.4; letter-spacing: .07em; text-transform: uppercase;
  max-width: 240px; padding-left: 16px; border-left: 1px solid var(--line); }
.menu { display: flex; align-items: center; gap: 26px; flex-wrap: wrap; margin-left: auto; }
.menu a { color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; letter-spacing: .01em; padding: 6px 0; position: relative; }
.menu a:hover { color: var(--acc); }
.menu a.on { color: var(--acc); }
.menu a.on::after { content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--acc); border-radius: 1px; }
.account { display: flex; align-items: center; gap: 14px; padding-left: 24px; border-left: 1px solid var(--line); }
.who { display: grid; line-height: 1.25; text-align: right; font-size: 13px; }
.who b { font-weight: 600; color: var(--ink); }
.who span { color: var(--muted); font-size: 12px; }
.btn-out { font: inherit; font-size: 13px; color: var(--muted); background: none; border: 1px solid var(--line); border-radius: 7px; padding: 5px 12px; cursor: pointer; }
.btn-out:hover { color: var(--ink); border-color: #c9c6bf; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 13px; padding-top: 28px; padding-bottom: 28px; }

.btn { display: inline-block; background: var(--acc); color: var(--acc-ink); border: 0; border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.small { padding: 6px 12px; font-size: 14px; }
.btn.ghost { background: transparent; color: var(--acc); border: 1px solid var(--acc); }
.link { background: none; border: 0; padding: 0; color: var(--acc); font: inherit; cursor: pointer; text-decoration: underline; }

.flash { padding: 10px 14px; border-radius: 8px; margin: 14px 0; background: var(--ok-bg); }
.flash.err { background: var(--err-bg); color: var(--warn); }
.copy { width: 100%; margin-top: 6px; font: 13px monospace; padding: 6px; }

.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 4px; font-size: 14px; }
.form input:not([type=checkbox]):not([type=radio]), .form select, .form textarea {
  font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; background: #fff; width: 100%; }
.form .check { display: flex; gap: 8px; align-items: flex-start; }
.form .check input { margin-top: 3px; }
.row-form { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); align-items: end; margin-bottom: 18px; }
.consent-text { font-size: 13px; background: var(--bg); border-radius: 8px; padding: 8px 12px; }
.consent-text summary { cursor: pointer; color: var(--acc); }
.doc p { margin: 6px 0; }

.tbl { width: 100%; border-collapse: collapse; background: var(--card); font-size: 14px; }
.tbl th, .tbl td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-weight: 600; color: var(--muted); font-size: 13px; }
.tbl td.num, .tbl th.num { text-align: right; white-space: nowrap; }
.tbl tr.dim td { color: var(--muted); }
.tbl-wrap { overflow-x: auto; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; text-decoration: none; color: var(--ink); display: grid; gap: 6px; }
.tile span { color: var(--muted); font-size: 13px; }
.crumbs { margin: 14px 0 0; font-size: 13px; }
.lot-nav { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
.lot-nav .arrows { display: flex; gap: 14px; }
.lot-tools { display: flex; align-items: baseline; gap: 16px; margin-top: 14px; }
.lot-tools .crumbs { margin: 0; }
/* кнопка «Печать» в карточке и в каталоге (папа 06.11, msg 284080) */
.btn-print { font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; border: 1px solid var(--line); border-radius: 7px; padding: 4px 12px 4px 30px;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555' stroke-width='2' stroke-linejoin='round'%3E%3Cpath d='M6 9V3h12v6'/%3E%3Crect x='3' y='9' width='18' height='8' rx='2'/%3E%3Cpath d='M6 14h12v7H6z'/%3E%3C/svg%3E") no-repeat 10px center / 14px; }
.btn-print:hover { border-color: #c9c6bf; }
.result-tools { display: flex; align-items: center; gap: 12px; }
.out-title { font-size: 18px; font-weight: 600; margin: 0 0 6px; }

/* каталог */
.section-bar { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin: 18px 0 0; padding: 12px 18px;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--acc); border-radius: 10px; }
.section-bar h1 { margin: 0; font-size: 22px; letter-spacing: .01em; }
.section-bar span { order: 2; color: var(--muted); font-size: 11px; letter-spacing: .07em; text-transform: uppercase; }
.cat { display: grid; grid-template-columns: 250px 1fr; gap: 20px; align-items: start; margin-top: 14px; }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow: auto; }
.filters fieldset { border: 0; padding: 0; margin: 0 0 14px; }
.filters legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.filters .grp { font-size: 12px; color: var(--muted); margin: 6px 0 2px; }
.filters label { display: flex; gap: 6px; align-items: center; font-size: 14px; padding: 1px 0; }
.filters input[type=search] { width: 100%; font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px; }
.filters .cnt { color: var(--muted); font-size: 12px; margin-left: auto; }
.sw { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 1px solid #0003; flex: none; }
input[type=color], .inline-search input[type=color]:not([type=hidden]) { width: 44px; min-width: 44px; height: 34px; padding: 2px; flex: none; cursor: pointer; }
.sw-white { background: #fbfbf9; } .sw-grey { background: #a3a6a8; } .sw-black { background: #222; } .sw-beige { background: #dccfb4; }
.sw-brown { background: #7a5a43; } .sw-wood { background: linear-gradient(135deg, #e0b989, #9a6a42); } .sw-stone { background: linear-gradient(135deg, #d9d9d6, #8f918f); }
.sw-yellow { background: #e6c832; } .sw-green { background: #4b8f5c; } .sw-blue { background: #4f74a8; }
.sw-color { background: linear-gradient(135deg, #e3a0a6, #9c86c4); } .sw-other { background: repeating-linear-gradient(45deg, #ddd 0 3px, #fff 3px 6px); }
/* фактура (с 11.11 отдельно от цвета) */
.sw-tx-plain { background: #c9cbc8; } .sw-tx-wood { background: repeating-linear-gradient(100deg, #d9b58a 0 2px, #a87a50 2px 4px); }
.sw-tx-stone { background: radial-gradient(circle at 30% 35%, #f2f2ef 0 18%, transparent 20%), radial-gradient(circle at 70% 70%, #6f716f 0 16%, transparent 18%), #b3b5b2; }
.sw-tx-fabric { background: repeating-linear-gradient(0deg, #b8b2a6 0 1px, #e6e1d6 1px 3px), #e6e1d6; background-blend-mode: multiply; }
.sw-tx-other { background: repeating-linear-gradient(45deg, #ddd 0 3px, #fff 3px 6px); }
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.result-head select { font: inherit; padding: 5px 8px; border-radius: 7px; border: 1px solid var(--line); }
.guest-note { background: #fff7e0; border: 1px solid #f0e0a8; border-radius: 8px; padding: 9px 12px; font-size: 14px; margin-bottom: 10px; }

.lots { display: grid; gap: 8px; }
.lot { display: grid; grid-template-columns: 74px 1fr 120px 130px; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; text-decoration: none; color: var(--ink); }
.lot:hover { border-color: var(--acc); }
.lot .ph { width: 74px; height: 74px; border-radius: 7px; background: var(--chip); object-fit: cover; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 11px; text-align: center; overflow: hidden; }
.lot .ttl { font-weight: 600; }
.lot .meta { color: var(--muted); font-size: 13px; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.lot .qty, .lot .price { text-align: right; white-space: nowrap; }
.lot .price b { font-size: 16px; }
.lot .small { font-size: 12px; color: var(--muted); }
.lock { color: var(--muted); font-size: 13px; }
.lot .gated { grid-column: span 2; text-align: right; }
.chip { display: inline-block; background: var(--chip); border-radius: 20px; padding: 1px 9px; font-size: 12px; color: var(--ink); }
.chip.own { background: var(--ok-bg); }
.chip.warn { background: var(--err-bg); color: var(--warn); }

/* карточка лота */
.lot-page { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 26px; margin-top: 10px; }
.gallery .main { width: 100%; aspect-ratio: 3 / 4; object-fit: contain; background: var(--chip); border-radius: 10px; display: block; }
.gallery .noph { aspect-ratio: 4 / 3; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--chip); border-radius: 10px; }
.thumbs { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; }
.thumbs img.on { border-color: var(--acc); }
.sample-mini { display: flex; gap: 10px; align-items: center; margin: 10px 0 0; font-size: 13px; color: var(--muted); }
.sample-mini img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; flex: none; }
.sample-mini img.on { border-color: var(--acc); }
.gallery .main.sample { aspect-ratio: 1 / 1; object-fit: cover; box-shadow: inset 0 0 0 1px var(--line); border: 1px solid var(--line); }
img.ph { border: 1px solid var(--line); box-sizing: border-box; }
.gallery .small { font-size: 13px; margin: 6px 0 0; }
.buy { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin: 12px 0; }
.buy .price { font-size: 26px; font-weight: 700; }
.passport { width: 100%; border-collapse: collapse; }
.passport th { text-align: left; color: var(--muted); font-weight: 400; padding: 6px 12px 6px 0; width: 45%; vertical-align: top; }
.passport td { padding: 6px 0; border-bottom: 1px solid var(--line); }

.photo-edit { display: flex; gap: 10px; flex-wrap: wrap; }
.photo-edit figure { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px; text-align: center; }
.photo-edit img { width: 120px; height: 160px; object-fit: cover; display: block; border-radius: 5px; }
.photo-edit figcaption { display: flex; gap: 6px; justify-content: center; margin-top: 4px; font-size: 13px; }

.stat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.stat div { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.stat b { display: block; font-size: 22px; }
.up { color: var(--acc); } .down { color: var(--warn); }

@media screen and (max-width: 860px) {   /* только экран: лист A4 (~700 px) иначе получил бы телефонную вёрстку */
  .cat, .lot-page { grid-template-columns: 1fr; }
  .filters { position: static; max-height: none; }
  .filters-body { display: none; }
  .filters.open .filters-body { display: block; }
  .lot { grid-template-columns: 64px 1fr auto; gap: 4px 12px; }
  .lot .ph { width: 64px; height: 64px; grid-row: span 2; }
  .lot > div:nth-child(2) { grid-column: 2 / 4; }
  .lot .qty { grid-column: 2; text-align: left; }
  .lot .price { grid-column: 3; }
  .lot .gated { grid-column: 2 / 4; text-align: left; }
  /* телефон: логотип и «Выйти» в первой строке, меню — второй строкой во всю ширину, без сдвига */
  .top-in { gap: 0 18px; padding-bottom: 4px; }
  .account { order: 2; margin-left: auto; padding-left: 0; border-left: 0; }
  .top-in > .menu { order: 3; flex-basis: 100%; margin-left: 0; gap: 20px; top: 0; }
  .logo img { height: 52px; margin: 6px 0 4px; }
  .top { --logo-text-shift: 10px; }
  .section-bar { margin-top: 12px; padding: 10px 14px; }
  .section-bar span { display: none; }
  /* «Печать» — только значок, иначе в карточке стрелки «← предыдущий · следующий →» переносятся */
  .btn-print { font-size: 0; width: 34px; height: 29px; padding: 0; background-position: center; }
  .lot-nav .arrows { white-space: nowrap; }
}
/* средняя ширина: сначала убираем подпись, потом имя пользователя — иначе блок «Выйти» уезжает на вторую строку */
@media screen and (max-width: 1180px) { .logo .tagline { display: none; } }
@media screen and (max-width: 1000px) { .who { display: none; } }
@media (min-width: 861px) { .filters-toggle { display: none; } }

/* заявки, подписки, админка этапа 5 */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--warn); color: #fff; font-size: 12px; text-align: center; }
.req-form { margin: 10px 0 6px; }
.req-form textarea { resize: vertical; }
.form.req-form input[readonly] { background: var(--chip); }   /* серый: «только целиком», править нельзя */
.chip.st-new { background: #fff0b3; } .chip.st-work { background: #dbe9ff; } .chip.st-sold { background: var(--ok-bg); } .chip.st-refused { background: var(--err-bg); color: var(--warn); }
.status-form select { font: inherit; font-size: 13px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 6px; }
.inline-search { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.inline-search input:not([type=hidden]) { font: inherit; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; min-width: 0; flex: 1 1 160px; max-width: 360px; }
.bulk-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0 0 10px; font-size: 14px; }
.bulk-group { display: inline-flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-right: 8px; border-right: 1px solid var(--line); }
.bulk-group:last-child { border-right: 0; }
.bulk-group input { font: inherit; font-size: 14px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; width: 8em; }
.who a { color: var(--muted); font-size: 12px; text-decoration: none; }
.who a:hover { color: var(--acc); text-decoration: underline; }
.join-link { font-size: 14px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.price-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px 4px; margin: 0; display: grid; gap: 10px; }
.price-box legend { font-weight: 600; font-size: 14px; padding: 0 4px; }
.price-box p { margin: 0; }
.form .price-box input[name=floor_pct] { width: 4.5em; padding: 3px 6px; display: inline-block; }
fieldset.plain { border: 0; padding: 0; margin: 0; display: grid; gap: 4px; }
fieldset.plain legend { font-size: 14px; padding: 0; margin-bottom: 4px; }
.check-inline { display: inline-flex; gap: 6px; align-items: center; margin-right: 10px; font-weight: 600; color: var(--warn); }
.join-card { margin-bottom: 12px; padding: 12px 16px; }
.join-card p { margin: 4px 0; }
.photo-edit figure a { display: block; cursor: zoom-in; }
.subscribe-link { font-size: 13px; }

/* Печатный лист (папа 06.11, msg 284080): логотип и адрес сайта сверху, без меню, фильтров и кнопок;
   карточка — фото или образец и паспорт, каталог — текущий отбор таблицей. Цена и остаток — как на экране. */
.print-head, .print-only { display: none; }
@media print {
  @page { size: A4; margin: 12mm 12mm 14mm; }
  body { background: #fff; color: #000; font-size: 10pt; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }
  .top, .foot, .filters, .lot-nav, .result-tools, .subscribe-link, .flash, form, .btn, .no-print, .chip.own, .buy p.muted, .thumbs { display: none !important; }
  .print-only { display: block; }
  .print-head { display: flex; align-items: center; gap: 6mm; padding-bottom: 3mm; margin-bottom: 4mm; border-bottom: .6pt solid #000; }
  .print-head img { height: 13mm; width: auto; }
  .print-head .site { flex: 1; display: grid; gap: .5mm; }
  .print-head .site b { font-size: 12pt; }
  .print-head .when { display: grid; gap: .5mm; text-align: right; font-size: 9pt; }
  .print-head span { color: #555; font-size: 8.5pt; }
  h1 { font-size: 16pt; margin: 0 0 1.5mm; }
  h2 { font-size: 12pt; margin: 4mm 0 2mm; }
  .print-link, .print-sel { margin: 0 0 3mm; font-size: 9pt; color: #333; }
  /* карточка лота */
  .lot-page { grid-template-columns: 62mm minmax(0, 1fr); gap: 7mm; margin-top: 2mm; }
  .gallery .main { aspect-ratio: auto; max-height: 82mm; object-fit: contain; background: none; border-radius: 0; }
  .gallery .main.sample { aspect-ratio: 1 / 1; object-fit: cover; }
  .gallery .noph { aspect-ratio: auto; padding: 6mm 0; border: .4pt solid #bbb; background: none; }
  .buy { border: .6pt solid #999; border-radius: 2mm; padding: 3mm 4mm; margin: 0 0 3mm; }
  .buy .price { font-size: 16pt; }
  .buy p { margin: 1.5mm 0 0; }
  .passport th, .passport td { padding: 1.2mm 0; }
  .passport th { color: #444; }
  .passport td { border-bottom: .4pt solid #bbb; }
  .tbl { font-size: 9.5pt; background: none; }
  .tbl th, .tbl td { padding: 1.2mm 2mm 1.2mm 0; border-bottom: .4pt solid #bbb; }
  /* каталог: отбор таблицей */
  .section-bar { margin: 0 0 1.5mm; padding: 0; border: 0; border-radius: 0; background: none; }
  .section-bar h1 { font-size: 16pt; }
  .section-bar span { display: none; }
  .cat { display: block; margin: 0; }
  .guest-note { background: none; border: .6pt solid #999; }
  .result-head { margin-bottom: 1.5mm; }
  .lots { display: block; }
  .lot, .lots-head { display: grid; grid-template-columns: 15mm minmax(0, 1fr) 26mm 26mm; gap: 3mm; align-items: center;
    background: none; border: 0; border-bottom: .4pt solid #bbb; border-radius: 0; padding: 1.2mm 0; break-inside: avoid; }
  .lots-head { font-size: 8.5pt; font-weight: 600; color: #444; border-bottom: .8pt solid #000; }
  .lots-head span:nth-child(n+3) { text-align: right; }
  .lot .ph { width: 13mm; height: 13mm; border-radius: 1mm; font-size: 6pt; }
  .lot .meta { font-size: 8.5pt; color: #444; }
  .lot .price b { font-size: 10.5pt; }
  .lot .small { font-size: 7.5pt; color: #555; }
  .lot .price .small { display: none; }   /* «за пог. м с НДС» — в заголовке колонки */
  .lot .gated { display: none; }   /* гостю: «цена и остаток — после входа» уже сказано в плашке над списком */
}
/* две колонки в форме (цвет и фактура в паспорте лота) */
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
@media screen and (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }
