/* Прайс комплектующих «Сферы»: оформление страницы. Цвета и размеры - переменные из ui.css (подключается первым). */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + var(--cols-h) + 8px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
svg { flex: none; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- вход по коду ---------- */
.gate { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px;
  background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent 60%),
              radial-gradient(900px 500px at 110% 110%, var(--accent-soft), transparent 60%), var(--bg); }
.gate-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); padding: 34px 28px 22px; text-align: center; }
.gate-mark { width: 64px; height: 64px; color: var(--accent); }
.gate-card h1 { margin: 14px 0 6px; font-size: 22px; letter-spacing: -.01em; }
.gate-sub { margin: 0 0 22px; color: var(--muted); }
.gate-input { width: 100%; height: 54px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2);
  text-align: center; font: 600 22px/1 var(--mono); letter-spacing: .08em; outline: none; margin-bottom: 12px; }
.gate-input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.gate-err { min-height: 1.4em; margin: 12px 0 0; color: var(--up); font-size: 13px; }
/* вход по логину и паролю, пароль по приглашению: поля - компоненты ui.css */
.gate-alt { margin: 6px 0 0; }
.gate-link { min-height: 44px; padding: 0 12px; border-radius: 10px; color: var(--accent); font-weight: 600; }
.gate-link:hover { background: var(--accent-soft); }
.gate-fields { display: grid; gap: 14px; margin-bottom: 16px; text-align: left; }
.gate-fields .ui-input { min-height: 48px; font-size: 16px; }

.btn { height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface);
  font-weight: 600; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.wide { width: 100%; height: 48px; font-size: 15px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* ---------- каркас ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); grid-template-areas: "top top" "side main";
  grid-template-rows: auto 1fr; min-height: 100dvh; }      /* строки: без них свободное место короткой страницы делится и
  растягивает шапку (телефон, короткий список «Поставок»; 4.4.2) */
.top { grid-area: top; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px;
  min-height: 64px; padding: 10px 20px; background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.side { grid-area: side; position: sticky; top: var(--top-h); height: calc(100dvh - var(--top-h)); overflow: auto;
  overscroll-behavior: contain; background: var(--surface); border-right: 1px solid var(--line); scrollbar-width: thin; }
.main { grid-area: main; min-width: 0; padding: 20px 28px 110px; }

.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.sm svg { width: 16px; height: 16px; }
.tree-btn { display: none; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; flex: none; }
.brand-mark { width: 34px; height: 34px; color: var(--accent); }
.brand-t b { display: block; font-size: 16px; line-height: 1.1; letter-spacing: -.01em; }
.brand-t small { display: block; font-size: 12px; color: var(--muted); }
.lvl { flex: none; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--staff);
  background: var(--staff-soft); padding: 4px 9px; border-radius: 999px; }

.search { position: relative; flex: 1 1 auto; max-width: 680px; margin: 0 auto; display: flex; align-items: center; }
.search input { width: 100%; height: 44px; padding: 0 44px 0 44px; border: 1px solid var(--line-2); border-radius: 12px;
  background: var(--surface-2); font-size: 15px; outline: none; transition: border-color .15s, box-shadow .15s, background .15s; }
.search input::placeholder { color: var(--dim); }
.search input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input::-webkit-search-cancel-button { display: none; }
.search-ico { position: absolute; left: 14px; width: 18px; height: 18px; color: var(--dim); pointer-events: none; }
.search-kbd { position: absolute; right: 12px; font: 12px/1 var(--mono); color: var(--dim); border: 1px solid var(--line-2);
  border-radius: 6px; padding: 4px 7px; pointer-events: none; }
.search input:focus ~ .search-kbd, .search input:not(:placeholder-shown) ~ .search-kbd { display: none; }
#qClear { position: absolute; right: 7px; }

.status { display: flex; align-items: center; gap: 8px; flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--muted); font-size: 13px; white-space: nowrap; }
.status:hover { border-color: var(--line-2); color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.dot.ok { background: var(--down); box-shadow: 0 0 0 3px var(--down-soft); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px var(--staff-soft); }
.dot.bad { background: var(--up); box-shadow: 0 0 0 3px var(--up-soft); }
.status.busy .dot { animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.menu-wrap { position: relative; flex: none; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 250px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 40; }
.menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 9px 11px; border-radius: 9px; font-size: 14px; text-align: left; }
.menu button:hover, .menu button:focus-visible { background: var(--hover); outline: none; }
.menu button svg { width: 18px; height: 18px; color: var(--muted); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 6px; }

/* ---------- дерево разделов ---------- */
.side-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 16px 6px 20px;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.side-close { display: none; }
.tree { padding: 2px 10px 40px; }
.node { display: flex; align-items: flex-start; gap: 4px; width: 100%; padding: 6px 10px 6px calc(6px + var(--lvl, 0) * 16px);
  border-radius: 9px; text-align: left; font-size: 14px; line-height: 1.3; color: var(--text); }
.node:hover { background: var(--hover); }
.node.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.node .chev { width: 18px; height: 18px; margin-top: 0; color: var(--dim); border-radius: 5px; transition: transform .15s; }
.node .chev:hover { background: var(--hover); color: var(--text); }
.node.open > .chev { transform: rotate(90deg); }
.node .chev.leaf { visibility: hidden; }
.node .nm { flex: 1; min-width: 0; padding-top: 0; overflow-wrap: anywhere; }
.node .cnt { flex: none; margin-left: 6px; font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; padding-top: 1px; }
.node.on .cnt { color: var(--accent); }
.node.zero { opacity: .42; }
.node.all { font-weight: 600; margin-bottom: 4px; }
.kids { display: none; }
.node.open + .kids { display: block; }

/* ---------- шапка раздела и фильтры ---------- */
.print-head { display: none; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.crumbs { min-width: 0; }
.crumb-path { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; font-size: 13px; color: var(--dim); margin-bottom: 2px; }
.crumb-path button { color: var(--muted); border-radius: 6px; padding: 1px 4px; margin: 0 -4px; }
.crumb-path button:hover { color: var(--accent); background: var(--accent-soft); }
.crumbs h1 { margin: 0; font-size: 26px; line-height: 1.2; letter-spacing: -.02em; overflow-wrap: anywhere; }
.found { color: var(--muted); font-size: 14px; white-space: nowrap; padding-bottom: 3px; }
.found b { color: var(--text); }

.tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 18px; margin-bottom: 14px; }
.kinds { display: flex; flex-wrap: wrap; gap: 6px; }
.kind { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 500; transition: all .12s; }
.kind:hover { border-color: var(--accent-line); color: var(--text); }
.kind.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.kind.staff.on { background: var(--staff); border-color: var(--staff); }
.kind.idle:not(.on) { opacity: .5; }
.kind.idle.on { opacity: .62; }
.kind svg { width: 13px; height: 13px; }
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.chk { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.chk:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
select { height: 32px; padding: 0 30px 0 11px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface);
  font-size: 13px; color: var(--text); appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m7 10 5 5 5-5' fill='none' stroke='%238b919e' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 16px; }
#period:disabled { opacity: .55; }

/* ---------- вкладки «Цены» и «Оборачиваемость» (оборачиваемость - только код сотрудника) ---------- */
.views { display: inline-flex; gap: 2px; padding: 3px; margin-bottom: 14px; border-radius: 999px; background: var(--surface);
  border: 1px solid var(--line-2); }
.view { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; border-radius: 999px; font-size: 13px;
  font-weight: 600; color: var(--muted); }
.view svg { width: 13px; height: 13px; }
.view:hover { color: var(--text); }
.view.on { background: var(--accent); color: #fff; }
.view.on[data-v="mv"] { background: var(--staff); }
.main:not(.mv) .mv-only, .main.mv .price-only { display: none !important; }
/* учетная запись без права на цены: номенклатура без видов цен и отбора изменений цен */
.main.bare #kinds, .main.bare #period, .main.bare label:has(> #onlyChanged) { display: none !important; }
.mv-note { margin: -4px 0 12px; font-size: 12px; color: var(--muted); }
.kind .n { font-variant-numeric: tabular-nums; font-weight: 650; opacity: .85; }
.cols .h-m { text-align: right; cursor: pointer; border-radius: 6px; padding: 6px 4px 6px 0; }
.cols .h-m:hover { color: var(--text); }
.cols .h-m.sorted { color: var(--accent); }
.c-m { min-width: 0; overflow: hidden; text-overflow: ellipsis; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums;
  padding-left: 8px; font-size: 14px; }
.c-m.dim { color: var(--dim); }
.c-m.bad { color: var(--up); font-weight: 650; }
.c-m.warn { color: var(--warn); font-weight: 650; }
.c-m.money { color: var(--staff); font-weight: 650; }
.c-m.sorted:not(.bad):not(.warn):not(.money) { color: var(--accent); }
.sec-sum { color: var(--staff); font-weight: 650; }

/* ---------- таблица цен ---------- */
.cols { position: sticky; top: var(--top-h); z-index: 10; display: grid; grid-template-columns: var(--grid); align-items: center;
  min-height: var(--cols-h); margin: 0 1px; padding: 0 12px; background: var(--bg); border-bottom: 1px solid var(--line-2);
  font-size: 12px; font-weight: 600; color: var(--muted); }
.cols > div { padding: 6px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cols .h-p { text-align: right; cursor: pointer; border-radius: 6px; padding: 6px 4px 6px 0; }
.cols .h-p:hover { color: var(--text); }
.cols .h-p.sorted { color: var(--accent); }
.cols .h-p.staff { color: var(--staff); }
.cols .h-p svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 3px; }
.cols .h-name { cursor: pointer; }
.cols .h-st { text-align: right; cursor: pointer; padding: 6px 6px 6px 0; }
.cols .h-st:hover { color: var(--text); }
.cols .h-st.sorted { color: var(--accent); }
.cols .h-name.sorted { color: var(--accent); }

.sec { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); overflow: clip;
  content-visibility: auto; contain-intrinsic-size: auto 480px; }
.sec-h, .sec-xh { position: sticky; top: calc(var(--top-h) + var(--cols-h)); z-index: 5; display: flex; align-items: baseline; gap: 6px;
  padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.sec-h { cursor: pointer; }      /* .sec-xh - «Точное совпадение» и «Связанные варианты» поиска: не раздел, щелчок ничего не открывает */
.sec-h:hover .sec-leaf { color: var(--accent); }
.sec-path { color: var(--dim); font-size: 13px; overflow-wrap: anywhere; }
.sec-leaf { font-weight: 650; font-size: 15px; overflow-wrap: anywhere; }
.sec-n { margin-left: auto; padding-left: 10px; color: var(--dim); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.row { display: grid; grid-template-columns: var(--grid); align-items: center; gap: 0; min-height: 50px; padding: 7px 12px;
  border-bottom: 1px solid var(--line); }
.row:last-child { border-bottom: 0; }
.row:hover { background: var(--hover); }
.c-name { min-width: 0; padding-right: 14px; display: flex; align-items: center; gap: 12px; }
.c-txt { min-width: 0; flex: 1; }
.ph { flex: none; width: 48px; height: 48px; display: grid; place-items: center; overflow: hidden; border-radius: 10px;
  background: #fff; border: 1px solid var(--line); cursor: zoom-in; transition: transform .12s, box-shadow .12s; }
.ph img { width: 100%; height: 100%; object-fit: contain; display: block; }
button.ph:hover { transform: scale(1.06); box-shadow: 0 4px 14px rgba(16, 24, 40, .14); border-color: var(--accent-line); }
.ph.none { background: var(--surface-2); color: var(--line-2); cursor: default; }
.ph.none svg, .ph.txt svg { width: 22px; height: 22px; }
.ph.txt { background: var(--accent-soft); color: var(--accent); border-color: transparent; cursor: pointer; }
.row.inf .nm { cursor: pointer; }
.row.inf .nm:hover { color: var(--accent); }
.list.no-ph .ph { display: none; }
.nm { font-weight: 500; line-height: 1.32; overflow-wrap: anywhere; }
.sub { margin-top: 2px; font-size: 12px; color: var(--dim); }
.sub .art { color: var(--muted); }
.sub .u-m { display: none; }
.c-unit { color: var(--muted); font-size: 13px; }
.c-st { justify-self: end; min-width: 0; max-width: 100%; padding: 4px 8px; border-radius: 8px; text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums; font-weight: 600; font-size: 14px; color: var(--down); cursor: pointer; }
.c-st:hover { background: var(--accent-soft); }
.c-st.zero { color: var(--dim); font-weight: 500; }
.c-st.neg { color: var(--up); }
.c-st.sorted { color: var(--accent); }

/* список остатков по складам */
.pop { position: fixed; z-index: 65; width: min(330px, calc(100vw - 16px)); max-height: min(440px, 72vh); overflow: auto;
  padding: 12px 12px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.pop-h b { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; }
.pop-h span { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.pop ul { list-style: none; margin: 8px 0 0; padding: 0; }
.pop li { display: flex; justify-content: space-between; gap: 14px; padding: 5px 7px; border-radius: 8px; font-size: 13px; }
.pop li b { font-variant-numeric: tabular-nums; }
.pop li.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pop li.neg b { color: var(--up); }
.pop-t { display: flex; justify-content: space-between; margin-top: 6px; padding: 8px 7px 2px; border-top: 1px solid var(--line); font-size: 13px; }
.pop-empty { margin: 8px 0 2px; font-size: 13px; color: var(--muted); }
.pop-mv { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }      /* «В пути» по перемещениям (этап 5.4) */
.pop-h2 { padding: 2px 7px 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.pop.wide { width: min(430px, calc(100vw - 16px)); }
.pop-tb { width: 100%; margin-top: 8px; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.pop-tb th { padding: 0 6px 4px; font-size: 11px; font-weight: 500; color: var(--muted); text-align: right; vertical-align: bottom; }
.pop-tb td { padding: 5px 6px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
.pop-tb th:first-child, .pop-tb td:first-child { text-align: left; white-space: normal; }
.pop-tb tr.on td { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.pop-tb td.neg { color: var(--up); }
.pop-tb tfoot td { font-weight: 650; border-top: 1px solid var(--line-2); }
#store { max-width: 240px; }
.c-p { min-width: 0; overflow: hidden; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; padding-left: 8px; }
.c-p .v { font-weight: 650; font-size: 15px; letter-spacing: -.01em; }
.c-p .pu { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 11px; line-height: 1.2; color: var(--dim); font-weight: 500; }
.c-p.staff .v { color: var(--staff); }
.c-p.sorted .v { color: var(--accent); }
.c-p.staff.sorted .v { color: var(--staff); }
.chg { display: block; font-size: 11px; font-weight: 600; line-height: 1.15; margin-top: 1px; }
.chg.up { color: var(--up); }
.chg.down { color: var(--down); }
.c-p.fresh { animation: fresh 2.2s ease-in-out 4; border-radius: 6px; }
@keyframes fresh { 50% { background: var(--fresh); } }
.c-act { display: flex; justify-content: flex-end; }
.copy { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--dim); opacity: 0; transition: opacity .12s; }
.copy svg { width: 17px; height: 17px; }
.row:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { background: var(--accent-soft); color: var(--accent); }
.copy.done { opacity: 1; color: var(--down); }
mark { background: var(--mark); color: inherit; border-radius: 3px; padding: 0 1px; }
.list-end { height: 1px; }      /* метка конца списка: строки ниже дорисовываются по мере прокрутки (app.js, more) */

.empty { margin: 48px auto; max-width: 440px; text-align: center; color: var(--muted); }
.empty b { display: block; font-size: 18px; color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 16px; }
.more { padding: 18px; text-align: center; color: var(--dim); font-size: 13px; }

.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 25; width: 46px; height: 46px; display: grid; place-items: center;
  border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); color: var(--muted); }
.to-top:hover { color: var(--accent); }
.to-top svg { width: 20px; height: 20px; }
.toast { position: fixed; left: 50%; bottom: 26px; z-index: 60; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: min(92vw, 520px); padding: 11px 18px; border-radius: 12px; background: #1d2330; color: #fff; font-size: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.scrim { display: none; }

/* ---------- карточка товара: фото и описание ---------- */
html.viewing { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 24px 16px; background: rgba(8, 11, 16, .82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.v-fig { margin: 0; display: flex; align-items: stretch; min-width: 0; max-width: calc(100vw - 150px); max-height: calc(100dvh - 48px);
  background: var(--surface); color: var(--text); border-radius: 18px; overflow: hidden; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.v-frame { flex: 0 1 auto; min-width: 0; display: grid; place-items: center; background: #fff; padding: 16px; }
.v-frame img { display: block; width: min(1000px, calc(100vw - 582px)); height: auto; max-height: calc(100dvh - 80px); object-fit: contain; }
.v-none { display: grid; place-items: center; align-content: center; gap: 10px; width: min(360px, calc(100vw - 582px)); aspect-ratio: 1;
  color: #9aa1ad; font-size: 14px; }
.v-none svg { width: 56px; height: 56px; }
.v-cap { flex: 0 0 400px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 22px 22px 24px;
  border-left: 1px solid var(--line); text-align: left; }
.v-cap b { display: block; font-size: 17px; font-weight: 650; line-height: 1.35; }
.v-sub { display: block; margin-top: 4px; font-size: 13px; color: var(--muted); }
.v-prices { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.v-p { padding: 5px 11px 6px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); font-weight: 650;
  font-size: 15px; font-variant-numeric: tabular-nums; }
.v-p small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
.v-p i { font-style: normal; font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.v-p.staff { background: var(--staff-soft); }
.v-desc { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.v-blk + .v-blk { margin-top: 10px; }
.v-desc p { margin: 0; }
.v-desc p + p { margin-top: 3px; }
.v-desc ul { margin: 0; padding-left: 20px; }
.v-desc p + ul, .v-desc ul + p { margin-top: 6px; }
.v-desc li + li { margin-top: 3px; }
.v-wait { color: var(--muted); }
.v-btn { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; color: #fff;
  background: rgba(255, 255, 255, .12); }
.v-btn:hover { background: rgba(255, 255, 255, .24); }
.v-btn svg { width: 22px; height: 22px; }
.v-btn[hidden] { display: grid !important; visibility: hidden; }
.v-close { position: absolute; top: 14px; right: 14px; }

/* ---------- узкие экраны ---------- */
@media (max-width: 1180px) {
  .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .tree-btn { display: grid; }
  .side { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; height: auto; width: min(340px, 88vw); transform: translateX(-102%);
    transition: transform .22s ease; box-shadow: var(--shadow); }
  .side.open { transform: none; }
  .side-close { display: grid; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(10, 14, 20, .38); }
  .main { padding: 18px 20px 110px; }
}
@media (max-width: 1000px) {   /* карточка товара: фото сверху, цены и описание под ним, листается вся */
  .viewer { display: block; overflow-y: auto; overscroll-behavior: contain; padding: 62px 12px 84px; }
  .v-fig { flex-direction: column; width: 100%; max-width: 640px; max-height: none; margin: 0 auto; border-radius: 14px; }
  .v-frame { padding: 10px; }
  .v-frame img { width: 100%; max-height: 62dvh; }
  .v-none { width: 100%; height: 140px; aspect-ratio: auto; }
  .v-cap { flex: none; overflow: visible; border-left: 0; border-top: 1px solid var(--line); padding: 16px 16px 18px; }
  .v-close { position: fixed; }
  .v-prev, .v-next { position: fixed; z-index: 1; bottom: 16px; width: 48px; height: 48px; background: rgba(8, 11, 16, .72); }
  .v-prev { left: 16px; }
  .v-next { right: 16px; }
}
@media screen and (max-width: 760px) {
  :root { --cols-h: 0px; }
  .top { flex-wrap: wrap; gap: 8px 6px; padding: 8px 10px 10px; }
  .brand-t { display: none; }
  .brand-mark { width: 30px; height: 30px; }
  .lvl { padding: 3px 7px; font-size: 10px; }
  .search { order: 10; flex: 1 0 100%; max-width: none; }
  .search input { height: 42px; font-size: 16px; }
  .search-kbd { display: none; }
  .status { margin-left: auto; padding: 6px 10px; font-size: 12px; }
  .main { padding: 14px 10px 110px; }
  .crumbs h1 { font-size: 21px; }
  .tools { gap: 8px; }
  .kinds, .filters { flex-wrap: nowrap; overflow-x: auto; margin: 0 -10px; padding: 0 10px 2px; scrollbar-width: none; width: calc(100% + 20px); }
  .kinds::-webkit-scrollbar, .filters::-webkit-scrollbar { display: none; }
  .kind, .filters > * { flex: none; }
  .sec { margin-top: 12px; border-radius: 12px; }
  .sec-h, .sec-xh { top: var(--top-h); padding: 9px 12px; }
  .viewer { padding: 56px 8px 80px; }
  .v-frame { padding: 8px; }
  .v-cap { padding: 14px 14px 16px; }
  #store { max-width: 220px; }
  .views { display: flex; }
  .main.mv .sec-h { flex-wrap: wrap; }
  .view { flex: 1; justify-content: center; padding: 0 10px; }
  .to-top { right: 14px; bottom: 16px; }
}
/* Строки таблицы карточками: телефон и окно, в которое колонки не помещаются (класс cards у .main ставит app.js,
   fitGrid). :where - вес правил как у прежнего условия по ширине окна: правила vitrina.css и filters.css сильнее. */
@media screen {
  .main.cards { --cols-h: 0px; }
  :where(.main.cards) .cols { display: none; }
  :where(.main.cards) .row { display: flex; flex-wrap: wrap; align-items: flex-start; padding: 10px 12px 12px; gap: 0; }
  :where(.main.cards) .c-name { flex: 1 1 calc(100% - 44px); padding-right: 6px; gap: 10px; align-items: flex-start; }
  :where(.main.cards) .ph { width: 56px; height: 56px; }
  :where(.main.cards) .c-unit { display: none; }
  :where(.main.cards) .sub .u-m { display: inline; }
  :where(.main.cards) .c-act { order: 1; flex: none; margin: -4px -6px 0 0; }
  :where(.main.cards) .copy { opacity: 1; }
  :where(.main.cards) .c-p { order: 2; flex: 0 0 auto; text-align: left; padding: 5px 10px 6px; margin: 8px 6px 0 0; border-radius: 9px; background: var(--surface-2); }
  :where(.main.cards) .c-p::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
  :where(.main.cards) .c-p.na { display: none; }
  :where(.main.cards) .c-p.staff { background: var(--staff-soft); }
  :where(.main.cards) .c-st { order: 2; flex: 0 0 auto; justify-self: auto; text-align: left; padding: 5px 10px 6px; margin: 8px 6px 0 0; border-radius: 9px;
    background: var(--down-soft); }
  :where(.main.cards) .c-st.zero { background: var(--surface-2); }
  :where(.main.cards) .c-st.neg { background: var(--up-soft); }
  :where(.main.cards) .c-st::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
  :where(.main.cards) .chg { display: inline; margin-left: 5px; }
  :where(.main.cards) .c-p .pu { display: inline; margin-left: 4px; }
  :where(.main.cards) .c-p { overflow: visible; }
  :where(.main.cards) .c-m { order: 2; flex: 0 0 auto; text-align: left; padding: 5px 10px 6px; margin: 8px 6px 0 0; border-radius: 9px;
    background: var(--surface-2); overflow: visible; }
  :where(.main.cards) .c-m::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 500; color: var(--muted); }
}
@media (hover: none) { .copy { opacity: 1; } }

/* ---------- печать ---------- */
@media print {
  @page { margin: 10mm 9mm; }
  :root { --top-h: 0px; --cols-h: 0px; --bg: #fff; --surface: #fff; --surface-2: #f0f2f5; --text: #000; --muted: #333; --dim: #555; --line: #ccc; }
  body { background: #fff; font-size: 11px; }
  .top, .side, .scrim, .tools, .to-top, .toast, .c-act, .empty, .found, .ph, .viewer, .pop, .views { display: none !important; }
  .c-st { color: #000 !important; padding: 0; }
  .app { display: block; }
  .main { padding: 0; }
  .print-head { display: flex !important; justify-content: space-between; gap: 12px; font-size: 12px; margin-bottom: 6px; }
  .crumbs h1 { font-size: 16px; }
  .cols { position: static; display: grid !important; font-size: 10px; min-height: 0; background: #fff; }
  .sec { margin-top: 8px; border: 0; border-radius: 0; content-visibility: visible; overflow: visible; }
  .sec-h, .sec-xh { position: static; padding: 4px 6px; -webkit-print-color-adjust: exact; print-color-adjust: exact; break-after: avoid; }
  .sec-x[data-sx="vars"] { display: none !important; }      /* связанные варианты в печать не идут (правило 5 этапа 2.5) */
  .row { min-height: 0; padding: 3px 6px; break-inside: avoid; }
  .nm { font-weight: 400; }
  .c-p .v { font-size: 11px; }
  .chg { font-size: 9px; }
}
