/* DBPOWER — Сметчик. Чёрный / графит / белый, оранжевые акценты. */
:root {
  --black: #0d0d0f;
  --graphite: #1c1c1f;
  --graphite-2: #2b2b2e;
  --graphite-3: #3a3a3f;
  --line: #e4e4e7;
  --line-2: #d4d4d8;
  --bg: #f4f4f5;
  --card: #ffffff;
  --text: #18181b;
  --muted: #6b6b73;
  --orange: #ff6a00;
  --orange-2: #e65f00;
  --orange-soft: #fff1e6;
  --red: #c4002b;
  --red-soft: #fde8ec;
  --green: #0f7b3e;
  --green-soft: #e6f6ec;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --surface-2: #fafafa;
  --surface-3: #f4f4f5;
  --hover: #ececee;
  --input-bg: #ffffff;
  --text-2: #2b2b2e;
  --ink: #1c1c1f;
  --orange-text: #b44a00;
  --orange-bg2: #fffaf6;
  --orange-line: #ffc9a3;
  --blue: #1d4ed8;
  --blue-soft: #e6efff;
  --skel-a: #eeeeee;
  --skel-b: #f6f6f6;
  --photo-bg: #ffffff;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font: 14px/1.45 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- шапка */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--black); color: #fff; height: 56px; display: flex; align-items: center; gap: 18px; padding: 0 18px; border-bottom: 3px solid var(--orange); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: .5px; }
.brand-mark { font-size: 19px; }
.brand-mark b { color: var(--orange); }
.brand-sub { font-weight: 500; font-size: 12px; color: #a1a1aa; letter-spacing: 0; border-left: 1px solid #3f3f46; padding-left: 10px; }
.nav { display: flex; gap: 4px; margin-left: 8px; }
.nav a { text-decoration: none; color: #d4d4d8; padding: 8px 12px; border-radius: 8px; font-weight: 500; }
.nav a:hover { color: #fff; background: var(--graphite-2); }
.nav a.active { color: #fff; background: var(--graphite-2); box-shadow: inset 0 -2px 0 var(--orange); }
.topbar .spacer { flex: 1; }
.user { display: flex; align-items: center; gap: 10px; color: #a1a1aa; font-size: 13px; }
.user form { margin: 0; }
.burger { display: none; background: none; border: 0; color: #fff; font-size: 22px; padding: 4px 8px; cursor: pointer; }

/* ---------- раскладка */
.page { max-width: 1320px; margin: 0 auto; padding: 22px 18px 60px; }
.page-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head .spacer { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-body { padding: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px 16px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------- кнопки и поля */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--card); color: var(--text); cursor: pointer; text-decoration: none; font-weight: 600; font-size: 13px; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--text-2); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-2); border-color: var(--orange-2); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: var(--graphite-2); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-ghost:hover { background: var(--hover); border-color: transparent; }
.btn-danger { color: var(--red); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-icon { width: 30px; padding: 0; height: 30px; }
label.f { display: block; }
label.f > span { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; font-weight: 500; }
.input, select.input, textarea.input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--input-bg); color: var(--text); outline: none; }
textarea.input { height: auto; min-height: 70px; padding: 8px 10px; resize: vertical; }
.input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(255,106,0,.15); }
.input.sm { height: 30px; font-size: 13px; padding: 0 7px; }
.check { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.check input { accent-color: var(--orange); width: 16px; height: 16px; }

/* ---------- метки */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--hover); color: var(--text-2); white-space: nowrap; }
.badge.orange { background: var(--orange-soft); color: var(--orange-text); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.dark { background: var(--ink); color: #fff; }
.st-draft { background: var(--hover); } .st-sent { background: var(--blue-soft); color: var(--blue); } .st-approved { background: var(--green-soft); color: var(--green); } .st-done { background: var(--ink); color: #fff; }

/* ---------- уведомления */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 12px; font-weight: 500; }
.flash.ok { background: var(--green-soft); color: var(--green); }
.flash.error { background: var(--red-soft); color: var(--red); }
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.25); max-width: 360px; font-size: 13px; animation: tin .18s ease-out; }
.toast.error { background: var(--red); }
.toast.ok { border-left: 4px solid var(--orange); }
@keyframes tin { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- таблицы */
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); position: sticky; top: 0; }
table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:hover td { background: var(--surface-2); }
.empty { text-align: center; padding: 40px 16px; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 4px; }

/* ---------- состояния загрузки */
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--orange); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--skel-a) 25%, var(--skel-b) 37%, var(--skel-a) 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- каталог */
.catalog { display: flex; flex-direction: column; min-height: 0; }
.cat-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px; border-bottom: 1px solid var(--line); background: var(--card); }
.cat-search { flex: 1 1 220px; position: relative; }
.cat-search input { padding-left: 34px; }
.cat-search svg { position: absolute; left: 10px; top: 10px; color: var(--muted); }
.cat-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--surface-2); font-size: 13px; }
.cat-filters .input { width: auto; }
.cat-count { font-size: 12px; color: var(--muted); padding: 8px 12px 0; }
.view-toggle { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.view-toggle button { border: 0; background: var(--card); height: 34px; width: 36px; cursor: pointer; color: var(--muted); }
.view-toggle button.on { background: var(--ink); color: #fff; }
.tree { font-size: 13px; padding: 8px 6px; }
.tree a { display: flex; justify-content: space-between; gap: 6px; padding: 5px 8px; border-radius: 6px; text-decoration: none; color: var(--text); cursor: pointer; }
.tree a:hover { background: var(--hover); }
.tree a.on { background: var(--ink); color: #fff; }
.tree a .n { color: var(--muted); font-size: 11px; }
.tree a.on .n { color: #bbb; }
.tree ul { list-style: none; margin: 0; padding: 0 0 0 12px; }
.tree > ul { padding: 0; }
.tree .tw { cursor: pointer; display: inline-block; width: 14px; color: var(--muted); }
.products { padding: 12px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.products.list { display: block; padding: 0; }
.pcard { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, border-color .15s; }
.pcard:hover { box-shadow: var(--shadow); border-color: var(--line-2); }
.pcard .ph { aspect-ratio: 4/3; background: var(--photo-bg); display: flex; align-items: center; justify-content: center; border-bottom: 1px solid var(--line); cursor: zoom-in; }
.pcard .ph img { max-width: 100%; max-height: 100%; object-fit: contain; }
.noimg { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; background: repeating-linear-gradient(45deg, var(--surface-2), var(--surface-2) 8px, var(--surface-3) 8px, var(--surface-3) 16px); color: #a1a1aa; font-size: 11px; }
.pcard .body { padding: 10px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pcard .vendor { font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 600; }
.pcard .name { font-weight: 600; font-size: 13px; line-height: 1.3; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .name:hover { color: var(--orange-2); }
.pcard .price { margin-top: auto; padding-top: 6px; font-weight: 800; font-size: 15px; }
.pcard .price small { font-weight: 500; color: var(--muted); font-size: 11px; }
.pcard .add { display: flex; gap: 6px; padding: 0 10px 10px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; height: 32px; background: var(--card); }
.qty button { border: 0; background: var(--surface-3); width: 26px; height: 100%; cursor: pointer; font-weight: 700; }
.qty input { width: 40px; border: 0; text-align: center; height: 100%; outline: none; }
.prow { display: grid; grid-template-columns: 56px minmax(0,1fr) 120px 150px; gap: 10px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--card); }
.prow .thumb { width: 56px; height: 42px; display: flex; align-items: center; justify-content: center; cursor: zoom-in; }
.prow .thumb img { max-height: 42px; object-fit: contain; }
.prow .nm { min-width: 0; }
.prow .nm a { font-weight: 600; text-decoration: none; }
.prow .nm .meta { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prow .pr { text-align: right; font-weight: 700; }
.prow .pr small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.prow .ac { display: flex; gap: 6px; justify-content: flex-end; }
.pager { display: flex; justify-content: center; gap: 6px; padding: 14px; }

/* ---------- рабочее место: каталог + смета */
.workspace { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); height: calc(100vh - 56px); }
.ws-catalog { display: grid; grid-template-columns: 210px minmax(0,1fr); border-right: 1px solid var(--line); min-height: 0; background: var(--surface-2); }
.ws-catalog .tree-pane { overflow: auto; border-right: 1px solid var(--line); background: var(--card); }
.ws-catalog .catalog { overflow: auto; }
.ws-catalog .cat-toolbar, .ws-catalog .cat-filters { position: sticky; z-index: 3; }
.ws-catalog .cat-toolbar { top: 0; }
.ws-catalog .products { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.ws-estimate { overflow: auto; background: var(--card); display: flex; flex-direction: column; }
.est-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; position: sticky; top: 0; background: var(--card); z-index: 5; }
.est-head .title-input { font-size: 18px; font-weight: 700; border: 1px solid transparent; border-radius: 8px; padding: 4px 8px; margin-left: -8px; width: 100%; outline: none; }
.est-head .title-input:hover { border-color: var(--line); }
.est-head .title-input:focus { border-color: var(--orange); }
.save-state { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.save-state .dot { width: 8px; height: 8px; border-radius: 50%; background: #a1a1aa; }
.save-state.saved .dot { background: #16a34a; }
.save-state.dirty .dot { background: var(--orange); }
.save-state.error .dot { background: var(--red); }
details.box { border-bottom: 1px solid var(--line); }
details.box > summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; }
details.box > summary::-webkit-details-marker { display: none; }
details.box > summary::before { content: "▸"; color: var(--muted); transition: transform .15s; }
details.box[open] > summary::before { transform: rotate(90deg); }
details.box .inner { padding: 0 16px 14px; }
.lines { padding: 8px 12px 12px; }
.lines-toolbar { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); align-items: center; }
.sec-title { margin: 14px 4px 6px; font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--orange-2); display: flex; align-items: center; gap: 8px; }
.sec-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.line { border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 8px; background: var(--card); }
.line.warn { border-color: var(--orange-line); background: var(--orange-bg2); }
.line.drag { opacity: .5; }
.line-top { display: flex; gap: 10px; align-items: flex-start; }
.line-top .lthumb { width: 46px; height: 46px; flex: none; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: var(--photo-bg); }
.line-top .lthumb img { max-height: 44px; object-fit: contain; }
.line-name { flex: 1; min-width: 0; }
.line-name input { font-weight: 600; border: 1px solid transparent; padding: 3px 6px; margin-left: -6px; border-radius: 6px; width: 100%; outline: none; background: transparent; }
.line-name input:hover { border-color: var(--line); }
.line-name input:focus { border-color: var(--orange); background: var(--card); }
.line-name .meta { font-size: 11px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.line-total { text-align: right; font-weight: 800; font-size: 15px; white-space: nowrap; }
.line-total small { display: block; font-weight: 500; font-size: 11px; color: var(--muted); }
.line-grid { display: grid; grid-template-columns: 82px 70px 110px 70px 70px 70px minmax(0,1fr); gap: 6px; margin-top: 8px; align-items: end; }
.line-grid label span { font-size: 10.5px; color: var(--muted); display: block; margin-bottom: 2px; white-space: nowrap; }
.line-extra { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 6px; margin-top: 6px; }
.line-actions { display: flex; gap: 2px; }
.attn { font-size: 11.5px; color: var(--orange-text); margin-top: 6px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.totals { margin-top: auto; border-top: 2px solid var(--text); background: var(--surface-2); padding: 14px 16px; }
.head-total { font-size: 18px; font-weight: 800; color: var(--orange-2); white-space: nowrap; }
.head-total small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); text-align: right; }
.totals table { width: 100%; max-width: 420px; margin-left: auto; border-collapse: collapse; }
.totals td { padding: 3px 0; }
.totals td:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.totals .grand td { font-size: 19px; font-weight: 800; padding-top: 8px; border-top: 1px solid var(--line-2); }
.totals .grand td:last-child { color: var(--orange-2); }
.warn-box { background: var(--orange-soft); color: var(--orange-text); padding: 8px 12px; border-radius: 8px; font-size: 12.5px; margin-bottom: 10px; }
.mobile-bar { display: none; }

/* ---------- модальные окна */
.modal-bg { position: fixed; inset: 0; background: rgba(13,13,15,.6); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--card); border-radius: 12px; max-width: 920px; width: 100%; max-height: 92vh; overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 2; }
.modal-head h2 { margin: 0; flex: 1; font-size: 16px; }
.modal-body { padding: 16px; }
.gallery { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 20px; }
.gallery-main { aspect-ratio: 4/3; border: 1px solid var(--line); border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--photo-bg); overflow: hidden; }
.gallery-main img { max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.gallery-thumbs button { width: 60px; height: 48px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); padding: 2px; cursor: pointer; }
.gallery-thumbs button.on { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(255,106,0,.25); }
.gallery-thumbs img { max-height: 100%; object-fit: contain; }
.specs { width: 100%; border-collapse: collapse; font-size: 13px; }
.specs td { padding: 6px 0; border-bottom: 1px dashed var(--line); vertical-align: top; }
.specs td:first-child { color: var(--muted); padding-right: 12px; width: 45%; }
.desc { white-space: pre-line; font-size: 13px; }

/* ---------- списки проектов */
.plist td .ttl { font-weight: 700; text-decoration: none; }
.plist td .ttl:hover { color: var(--orange-2); }
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--black); padding: 16px; }
.login-card { width: 100%; max-width: 380px; background: var(--card); border-radius: 14px; padding: 28px; border-top: 4px solid var(--orange); }
.login-card .brand-mark { font-size: 26px; font-weight: 900; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.stat b { display: block; font-size: 22px; }
.stat span { font-size: 12px; color: var(--muted); }
.admin-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-nav a { text-decoration: none; padding: 7px 12px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); font-weight: 600; font-size: 13px; }
.admin-nav a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
pre.log { background: var(--black); color: #d4d4d8; padding: 12px; border-radius: 8px; max-height: 320px; overflow: auto; font: 12px/1.45 var(--mono); white-space: pre-wrap; }

/* ---------- адаптивность */
@media (max-width: 1180px) {
  .ws-catalog { grid-template-columns: minmax(0,1fr); }
  .ws-catalog .tree-pane { display: none; }
  .line-grid { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
@media (max-width: 900px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--black); flex-direction: column; padding: 8px; margin: 0; }
  .nav.open { display: flex; }
  .user .uname { display: none; }
  .brand-sub { display: none; }
  .workspace { display: block; height: auto; }
  .ws-catalog, .ws-estimate { display: none; height: auto; min-height: calc(100vh - 56px - 64px); }
  .workspace[data-tab="catalog"] .ws-catalog { display: block; }
  .workspace[data-tab="estimate"] .ws-estimate { display: flex; }
  .ws-catalog .catalog { overflow: visible; }
  .ws-estimate { padding-bottom: 72px; }
  .totals { position: static; }
  .mobile-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--black); color: #fff; padding: 10px 12px; gap: 10px; align-items: center; border-top: 3px solid var(--orange); padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .mobile-bar .mtotal { flex: 1; }
  .mobile-bar .mtotal b { font-size: 17px; display: block; }
  .mobile-bar .mtotal span { font-size: 11px; color: #a1a1aa; }
  .mobile-bar .btn { height: 40px; }
  .grid2, .grid3 { grid-template-columns: minmax(0,1fr); }
  .gallery { grid-template-columns: minmax(0,1fr); }
  .prow { grid-template-columns: 48px minmax(0,1fr); }
  .prow .pr { grid-column: 2; text-align: left; }
  .prow .ac { grid-column: 1 / -1; justify-content: flex-start; }
  .products { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; padding: 8px; }
  .line-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .line-top { flex-wrap: wrap; }
  .line-name { flex: 1 1 calc(100% - 60px); }
  .line-total { flex: 1; text-align: left; }
  .head-total { display: none; }
  .toasts { left: 12px; right: 12px; bottom: 84px; }
  .toast { max-width: none; }
  .cat-toolbar .view-toggle { margin-left: auto; }
  .line-extra { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .page { padding: 14px 10px 80px; }
  table.t.responsive thead { display: none; }
  table.t.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.t.responsive td { display: flex; justify-content: space-between; gap: 10px; border: 0; padding: 3px 10px; }
  table.t.responsive td::before { content: attr(data-l); color: var(--muted); font-size: 12px; }
  .modal-bg { padding: 0; }
  .modal { max-height: 100vh; height: 100%; border-radius: 0; }
}
@media print { .topbar, .mobile-bar, .ws-catalog { display: none !important; } }

/* ---------- главная: каталог и калькулятор сметы ---------- */
.hero-calc { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.hero-calc .hero-text { flex: 3 1 360px; min-width: 0; }
.hero-calc h1 { margin: 0 0 8px; }
.hero-calc .hero-steps { margin: 10px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.hero-calc .hero-cta { flex: 1 1 240px; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.hero-calc .hero-cta .btn { font-size: 16px; padding: 12px 18px; }
.pay-panel { border: 2px solid var(--orange); border-radius: 10px; padding: 12px 14px; margin: 8px 0; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.pay-panel .pay-text { flex: 1 1 260px; min-width: 0; }
.pay-panel form { margin: 0; }
.btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

/* ---------- разделы сметы, требования райдера, замена ---------- */
.sec-title { justify-content: space-between; }
.sec-title .sec-sum { order: 3; text-transform: none; letter-spacing: 0; font-weight: 700; color: var(--text-2); font-size: 12px; white-space: nowrap; }
.sec-title::after { order: 2; }
.sec-title { flex-wrap: wrap; }
.sec-title .sec-adj { order: 1; display: inline-flex; gap: 6px; text-transform: none; letter-spacing: 0; font-weight: 600; color: var(--text-2); }
.sec-title .sec-adj label { display: inline-flex; align-items: center; gap: 3px; }
.sec-title .sec-adj input { width: 54px; padding: 2px 6px; font-size: 12px; text-align: right; }
@media (max-width: 700px) {
  .sec-title .sec-sum { white-space: normal; flex-basis: 100%; text-align: right; }
}
.sec-sel { width: auto; max-width: 150px; font-size: 12px; }
.req { margin-top: 6px; padding: 6px 8px; border-left: 3px solid var(--line); background: var(--surface-2); border-radius: 0 6px 6px 0; font-size: 12.5px; }
.req.unresolved { border-left-color: var(--red); background: var(--red-soft); }
.req-text { line-height: 1.35; }
.replace-bar { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--orange-soft); color: var(--orange-text); font-size: 13px; position: sticky; top: 0; z-index: 5; }
.replace-bar .txt { flex: 1; }
.replace-bar[hidden], .recs[hidden] { display: none; }
.recs { margin: 8px 0; padding: 10px 12px; border: 1px dashed var(--orange); border-radius: 10px; background: var(--orange-bg2); }
.recs .rec { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 5px 0; border-top: 1px solid var(--line); font-size: 13px; }
.recs .rec:first-of-type { border-top: 0; }
#t-table tr.sec-row td { font-size: 12.5px; color: var(--text-2); }
.nowrap { white-space: nowrap; }
@media (max-width: 640px) { .line-top { flex-wrap: wrap; } .line-actions { flex-wrap: wrap; } }

/* ---------- публичная часть: главная, превью, кабинет ---------- */
.hero { max-width: 860px; margin: 10px 0 18px; }
.hero h1 { font-size: 30px; letter-spacing: -.3px; }
.hero .lead { font-size: 16px; color: var(--text-2); margin: 0; }
.hero-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-bottom: 22px; }
.hero-card { padding: 20px; display: flex; flex-direction: column; gap: 12px; position: relative; border-top: 3px solid var(--orange); }
.hero-card h2 { font-size: 19px; margin: 0; }
.hc-num { position: absolute; top: 14px; right: 16px; font-weight: 900; font-size: 34px; color: var(--hover); line-height: 1; }
.drop { flex: 1; min-height: 170px; border: 2px dashed var(--line-2); border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 16px; cursor: pointer; color: var(--text-2); transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--orange); background: var(--orange-soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hero-card textarea { flex: 1; min-height: 170px; resize: vertical; }
.btn-lg { height: 46px; font-size: 15px; padding: 0 20px; }
.steps { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 18px; counter-reset: st; }
.steps > div { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.steps b { color: var(--text); font-size: 14px; }
.steps b::before { counter-increment: st; content: counter(st) ". "; color: var(--orange); }
.pv-grid { display: grid; grid-template-columns: minmax(0,1fr) 380px; gap: 16px; align-items: start; }
.pv-grid aside { position: sticky; top: 72px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; display: flex; flex-direction: column; }
.tile b { font-size: 26px; line-height: 1.1; }
.tile span { font-size: 12px; color: var(--muted); }
.tile.ok b { color: var(--green); } .tile.warn b { color: var(--orange-2); } .tile.bad b { color: var(--red); }
.req-t td { vertical-align: top; }
.req-t tr.st-clarify td, .req-t tr.st-not_found td { background: var(--red-soft); }
.sum-t td { padding: 5px 0; } .sum-t tr.grand td { font-weight: 800; font-size: 15px; border-top: 2px solid var(--orange); padding-top: 8px; }
.sum-card hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
.q-req { color: var(--red); font-weight: 600; }
.rec-opt { align-items: flex-start; }
.acc-list { display: flex; flex-direction: column; gap: 10px; }
.acc-item { display: flex; gap: 16px; justify-content: space-between; flex-wrap: wrap; }
.acc-main { flex: 1 1 360px; min-width: 0; }
.acc-title { font-weight: 700; font-size: 16px; text-decoration: none; display: block; margin: 2px 0; }
.acc-title:hover { color: var(--orange-2); }
.acc-side { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; flex: 0 1 340px; }
@media (max-width: 900px) {
  .hero-grid, .pv-grid { grid-template-columns: minmax(0,1fr); }
  .pv-grid aside { position: static; }
  .steps { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hero h1 { font-size: 24px; }
}
.flash:not(.ok):not(.error) { background: var(--hover); color: var(--text-2); }
@media (max-width: 640px) {
  .req-t { table-layout: fixed; }
  .req-t th:nth-child(3), .req-t td:nth-child(3) { display: none; }
  .req-t th:nth-child(1) { width: 44%; } .req-t th:nth-child(2) { width: 48px; }
  .req-t td { padding: 8px 6px; word-break: break-word; }
  .topbar { gap: 8px; padding: 0 10px; }
  .topbar .brand-mark, .topbar .brand-sub { display: none; }
  .user .uname { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

/* ---------- тёмная тема: системная по умолчанию, ручной выбор сохраняется (data-theme на <html>) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --line: #2f2f35; --line-2: #3d3d44; --bg: #111113; --card: #1a1a1e; --text: #ececef; --muted: #a0a0aa;
  --orange-soft: #3a2413; --red: #ff7a8f; --red-soft: #3b1821; --green: #5ee08f; --green-soft: #12301f;
  --surface-2: #202025; --surface-3: #26262c; --hover: #2c2c33; --input-bg: #141417; --text-2: #d0d0d8; --ink: #3f3f48;
  --orange-text: #ffb27d; --orange-bg2: #24180f; --orange-line: #6b3b16; --blue: #9db9ff; --blue-soft: #1d2a48;
  --skel-a: #222227; --skel-b: #2b2b31;
  /* фон под фото оборудования — белый в обеих темах (фото сняты на белом, водяной знак рассчитан на белый) */
  --photo-bg: #ffffff;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 4px 14px rgba(0,0,0,.35);
}
:root[data-theme="light"] { color-scheme: light; }
.theme-toggle { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid #3f3f46; background: var(--graphite-2); color: #fff; cursor: pointer; font-size: 12.5px; font-weight: 600; }
.theme-toggle:hover { border-color: var(--orange); }
.theme-toggle .ico { font-size: 15px; line-height: 1; }
:root[data-theme="dark"] .theme-toggle .ico-sun { display: inline; } :root[data-theme="dark"] .theme-toggle .ico-moon { display: none; }
.theme-toggle .ico-sun { display: none; }
:root[data-theme="dark"] img.logo-img { filter: none; }
:root[data-theme="dark"] .flash.ok { background: var(--green-soft); }
:root[data-theme="dark"] .login-wrap { background: #050506; }
.auth-theme { position: fixed; top: 12px; right: 12px; z-index: 5; }
@media (max-width: 640px) { .theme-toggle .tt-label { display: none; } .theme-toggle { padding: 0 8px; } }
.legal-doc { max-width: 900px; margin: 0 auto; line-height: 1.6; }
.legal-doc h2 { margin-top: 18px; }
.legal-doc mark.fill { background: var(--orange-soft); color: var(--orange-text); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.legal-doc hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0 10px; }
.input.need { border-color: var(--orange); }
.site-footer { border-top: 1px solid var(--line); padding: 14px 18px; color: var(--muted); font-size: 12.5px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.site-footer a { color: var(--muted); }
.consent-box { border: 1px solid var(--line); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.consent-box .check { align-items: flex-start; }
.profile-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1.2fr); gap: 16px; align-items: start; }
.stats3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 10px; }
.hist-t td { vertical-align: top; }
.rename summary { cursor: pointer; color: var(--muted); }
@media (max-width: 900px) { .profile-grid { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 640px) { .hist-t thead { display: none; } .hist-t tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; } .hist-t td { display: block; border: 0; padding: 3px 10px; } .hist-t td.num { text-align: left; } }

/* ---------- интерактивная предварительная смета ---------- */
.badge.blue { background: var(--blue-soft); color: var(--blue); }
.prelim-note { background: var(--orange-bg2); border: 1px solid var(--orange-line); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; color: var(--text); }
.prelim-note b { color: var(--orange-text); }
.assume-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.assume-list { margin: 0; padding-left: 34px; font-size: 13px; display: flex; flex-direction: column; gap: 3px; }
.assumed { color: var(--orange-text); }
.kit-panel { border-left: 3px solid var(--orange); }
.kit-panel.resolved { border-left-color: var(--green); }
.kit-fields { display: flex; flex-wrap: wrap; gap: 12px 18px; }
.kit-field { display: flex; flex-direction: column; gap: 4px; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.seg-btn { border: 0; border-right: 1px solid var(--line-2); background: var(--card); color: var(--text); height: 32px; padding: 0 12px; cursor: pointer; font-size: 13px; font-weight: 600; }
.seg-btn:last-child { border-right: 0; }
.seg-btn:hover { background: var(--hover); }
.seg-btn.on { background: var(--ink); color: #fff; }
.seg-btn.on.assumed { background: var(--orange-soft); color: var(--orange-text); box-shadow: inset 0 0 0 1px var(--orange); }
.kit-checks { margin: 0; padding-left: 18px; color: var(--text-2); display: flex; flex-direction: column; gap: 2px; }
.linkbtn { border: 0; background: none; color: var(--orange-text); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.est-sec { border-top: 1px solid var(--line); }
.est-sec-h { display: flex; align-items: center; gap: 6px; padding: 9px 16px; background: var(--surface-2); font-size: 14px; }
.est-row { display: grid; grid-template-columns: 56px minmax(0,1fr) 150px; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); }
.est-row.st-clarify, .est-row.st-analog { background: var(--orange-bg2); }
.est-row.st-not_found { background: var(--red-soft); }
.est-ph { width: 56px; height: 56px; border-radius: 8px; background: var(--photo-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; color: #8a8a93; }
.est-ph img { max-width: 100%; max-height: 100%; object-fit: contain; }
.est-name { font-weight: 700; }
.est-badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 3px 0; }
.est-why { color: var(--text-2); }
.est-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.est-nums { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.qty-form { display: flex; align-items: center; gap: 4px; }
.qty-form .input { width: 70px; text-align: right; }
.est-sum { font-weight: 700; }
.est-total { display: flex; justify-content: space-between; padding: 12px 16px; border-top: 2px solid var(--orange); font-size: 16px; }
.alts { margin-top: 6px; }
.alts > summary { cursor: pointer; color: var(--orange-text); font-weight: 600; }
.alt-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 8px; margin-top: 6px; }
.alt-card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.alt-card.on { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.alt-ph { height: 90px; background: var(--photo-bg); border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.alt-ph img { max-width: 100%; max-height: 100%; object-fit: contain; }
.alt-name { font-weight: 700; line-height: 1.25; }
.alt-specs { margin: 0; padding-left: 14px; color: var(--text-2); }
.alt-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: auto; flex-wrap: wrap; }
button.busy { opacity: .6; cursor: progress; }
@media (max-width: 640px) {
  .est-row { grid-template-columns: 44px minmax(0,1fr); }
  .est-ph { width: 44px; height: 44px; }
  .est-nums { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; }
  .alt-cards { grid-template-columns: repeat(2, minmax(0,1fr)); }
}
:root[data-theme="dark"] .seg-btn.on:not(.assumed) { background: var(--orange); color: #141414; }

/* ---------- каталог: группы, фасеты, единицы аренды ---------- */
.cat-layout { display: grid; grid-template-columns: 240px minmax(0,1fr); overflow: hidden; }
.cat-layout > .tree { border-right: 1px solid var(--line); max-height: 82vh; overflow: auto; }
.tree a.muted { color: var(--muted); }
.cat-facets { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 0 12px; font-size: 13px; }
.cat-facets:not(:empty) { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.facet { display: inline-flex; align-items: center; gap: 6px; }
.facet > span { color: var(--text-2); }
.facet .input { width: auto; max-width: 220px; }
.psep { padding: 8px 12px; font-size: 12px; font-weight: 700; color: var(--orange-text); background: var(--orange-bg2); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .03em; }
.psep-grid { grid-column: 1 / -1; border-radius: 8px; border: 1px solid var(--orange-line); }
@media (max-width: 900px) { .cat-layout { grid-template-columns: minmax(0,1fr); } .cat-layout > .tree { display: none; } }

/* ---------- моё оборудование ---------- */
.own-empty { padding: 48px 16px; }
.own-filter { margin-bottom: 12px; }
.own-list { display: flex; flex-direction: column; gap: 8px; }
.own-item { display: grid; grid-template-columns: 72px minmax(0,1fr) 150px auto; gap: 12px; align-items: center; padding: 10px 12px; }
.own-item.archived { opacity: .7; }
.own-ph { width: 72px; height: 56px; border-radius: 8px; background: var(--photo-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; text-decoration: none; }
.own-ph img { max-width: 100%; max-height: 100%; object-fit: contain; }
.own-name { font-weight: 700; text-decoration: none; }
.own-price { text-align: right; }
.own-acts { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.own-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; align-items: start; }
.own-form > .card:first-child { grid-row: span 2; }
.own-save { grid-column: 1 / -1; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; }
.seg-radio { display: inline-flex; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; cursor: pointer; font-size: 13px; font-weight: 600; border-right: 1px solid var(--line-2); background: var(--card); color: var(--text); }
.seg-radio:last-child span { border-right: 0; }
.seg-radio input:checked + span { background: var(--ink); color: #fff; }
.seg-radio input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: -2px; }
:root[data-theme="dark"] .seg-radio input:checked + span { background: var(--orange); color: #141414; }
.own-photos { display: flex; flex-wrap: wrap; gap: 10px; }
.own-photo { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.own-photo img { width: 120px; height: 90px; object-fit: contain; background: var(--photo-bg); border-radius: 8px; border: 1px solid var(--line); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 14px; }
.steps-line { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; counter-reset: sl; flex-wrap: wrap; }
.steps-line li { counter-increment: sl; padding: 6px 12px; border-radius: 999px; background: var(--hover); color: var(--text-2); font-size: 13px; font-weight: 600; }
.steps-line li::before { content: counter(sl) ". "; }
.steps-line li.on { background: var(--ink); color: #fff; }
:root[data-theme="dark"] .steps-line li.on { background: var(--orange); color: #141414; }
@media (max-width: 760px) {
  .own-item { grid-template-columns: 56px minmax(0,1fr); }
  .own-ph { width: 56px; height: 48px; }
  .own-price { text-align: left; grid-column: 2; }
  .own-acts { grid-column: 1 / -1; justify-content: flex-start; }
  .own-form { grid-template-columns: minmax(0,1fr); }
  .own-form > .card:first-child { grid-row: auto; }
  .grid3 { grid-template-columns: minmax(0,1fr); }
}

/* ---------- этапы расчёта ---------- */
.stepper { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 0 0 16px; }
.stepper .st { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--text-2); text-decoration: none; font-size: 14px; }
.stepper .st i { width: 24px; height: 24px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-weight: 800; font-size: 12px; background: var(--hover); color: var(--text-2); }
.stepper a.st:hover { border-color: var(--orange); }
.stepper .st.done i { background: var(--green-soft); color: var(--green); }
.stepper .st.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.stepper .st.on i { background: var(--orange); color: #141414; }
:root[data-theme="dark"] .stepper .st.on { background: #2c2c33; border-color: var(--orange); }
.stepper .st-arrow { color: var(--muted); }
.tpl-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.chip { border: 1px solid var(--line-2); background: var(--card); color: var(--text); border-radius: 999px; padding: 5px 12px; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--orange); }
.chip.on { background: var(--orange); border-color: var(--orange); color: #141414; }
.event-card { margin-bottom: 22px; }
.ev-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px 14px; }
.src-opts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.src-opt { display: flex; gap: 8px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; cursor: pointer; background: var(--card); }
.src-opt input { margin-top: 3px; accent-color: var(--orange); }
.src-opt span { display: flex; flex-direction: column; gap: 2px; }
.src-opt small { color: var(--muted); }
.src-opt:has(input:checked) { border-color: var(--orange); box-shadow: inset 0 0 0 1px var(--orange); }
.src-opt.disabled { opacity: .6; cursor: default; }
.badge.src-own { background: var(--blue-soft); color: var(--blue); }
.badge.src-dbp { background: var(--hover); color: var(--text-2); }
@media (max-width: 900px) { .ev-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } .src-opts { grid-template-columns: minmax(0,1fr); } }
@media (max-width: 520px) { .ev-grid { grid-template-columns: minmax(0,1fr); } .stepper .st b { font-size: 13px; } .stepper .st { padding-right: 9px; } }

/* ---------- подбор, превью: пояснения, предупреждения, водяной знак ---------- */
.why { margin-top: 4px; }
.why > summary { cursor: pointer; font-size: 12.5px; color: var(--blue); font-weight: 600; list-style: none; }
.why > summary::-webkit-details-marker { display: none; }
.why > summary::before { content: "? "; display: inline-flex; width: 16px; height: 16px; border-radius: 50%; background: var(--blue-soft); justify-content: center; align-items: center; font-size: 11px; margin-right: 4px; }
.why ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); display: flex; flex-direction: column; gap: 2px; }
.mreq { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; padding: 14px 16px; border-top: 1px solid var(--line); }
.mreq.st-clarify, .mreq.st-analog { background: var(--orange-bg2); }
.mreq.st-not_found { background: var(--red-soft); }
.mreq.muted-row { opacity: .8; }
.mreq-prod { display: flex; gap: 10px; align-items: flex-start; }
.analog-note { background: var(--orange-soft); color: var(--text); border-radius: 8px; padding: 6px 10px; margin-top: 6px; }
.level-card .seg { flex-wrap: nowrap; }
.level-explain { color: var(--text-2); margin-top: 8px; }
.warn-card h2 { margin: 0; }
.warn-list { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.warn-list li { padding: 6px 10px 6px 30px; border-radius: 8px; position: relative; background: var(--surface-2); }
.warn-list li::before { position: absolute; left: 9px; top: 6px; font-weight: 800; }
.warn-list li.w-error { background: var(--red-soft); } .warn-list li.w-error::before { content: "!"; color: var(--red); }
.warn-list li.w-warn { background: var(--orange-soft); } .warn-list li.w-warn::before { content: "!"; color: var(--orange-text); }
.warn-list li.w-info::before { content: "i"; color: var(--blue); }
.issue-list { margin: 4px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; }
.delta { font-weight: 700; } .delta.up { color: var(--red); } .delta.down { color: var(--green); }
.alt-price { margin-top: auto; }
.chip-s { display: inline-block; font-size: 11.5px; background: var(--hover); color: var(--text-2); border-radius: 6px; padding: 1px 6px; margin: 3px 4px 0 0; }
.parse-t td { vertical-align: top; }
.ign-row { display: flex; gap: 6px; padding: 3px 0; align-items: flex-start; }
.add-box { border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; }
.add-res { display: flex; flex-direction: column; gap: 6px; }
.add-row { display: grid; grid-template-columns: 44px minmax(0,1fr) auto auto; gap: 8px; align-items: center; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; background: var(--card); }
.add-ph { width: 44px; height: 36px; background: var(--photo-bg); border-radius: 6px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.add-ph img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* водяной знак неоплаченного превью */
.est-card.wm { position: relative; }
.est-card.wm::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 2; opacity: .09;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='220'><text x='10' y='150' transform='rotate(-24 210 110)' font-family='Arial,sans-serif' font-size='30' font-weight='700' fill='%23ff6a00'>Предварительный расчёт</text></svg>");
  background-repeat: repeat; }
:root[data-theme="dark"] .est-card.wm::after { opacity: .13; }
.print-block { display: none; }
@media print {
  body.unpaid > *:not(.print-block) { display: none !important; }
  body.unpaid .print-block { display: block !important; font: 16px/1.5 sans-serif; padding: 40px; }
}
@media (max-width: 760px) { .mreq { grid-template-columns: minmax(0,1fr); gap: 8px; } .level-card .seg { flex-wrap: wrap; } .add-row { grid-template-columns: 36px minmax(0,1fr); } }
/* варианты — горизонтальная лента, чтобы страница не растягивалась */
.alt-cards { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 6px; scroll-snap-type: x proximity; }
.alt-card { flex: 0 0 190px; scroll-snap-align: start; }

/* ---------- личный профиль ---------- */
.stats4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tab { padding: 9px 14px; text-decoration: none; color: var(--text-2); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.on { color: var(--text); border-bottom-color: var(--orange); }
.est-filter { margin-bottom: 10px; }
.eq-mini { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
@media (max-width: 640px) { .stats4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.est-steps { padding: 8px 16px; display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; border-bottom: 1px solid var(--line); }
.est-steps .stepper { margin: 0; }
.est-steps .stepper .st { font-size: 12.5px; padding: 3px 9px 3px 3px; }
.est-steps .stepper .st i { width: 20px; height: 20px; font-size: 11px; }
@media (max-width: 640px) {
  table.t.responsive td { display: block; text-align: left; }
  table.t.responsive td::before { display: block; margin-bottom: 2px; }
  table.t.responsive td.num { text-align: left; }
  .hist-t td .row { flex-wrap: wrap; }
}
@media (max-width: 520px) {
  .stepper { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 4px; }
  .stepper .st-arrow { display: none; }
  .stepper .st { flex-direction: column; gap: 2px; padding: 5px 2px; border-radius: 10px; justify-content: center; }
  .stepper .st b { font-size: 11.5px; }
}

/* ---------- оплаченный объём ---------- */
.comp-locked [data-act="del"], .comp-locked [data-act="dup"], .comp-locked [data-act="replace"], .comp-locked [data-act="cands"],
.comp-locked .lines-toolbar, .comp-locked #recs { display: none !important; }
.comp-locked .line-grid input[readonly] { background: var(--hover); color: var(--text-2); }
.scope-panel { margin: 10px 0; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.scope-panel > summary { list-style: none; cursor: pointer; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.scope-panel > summary::-webkit-details-marker { display: none; }
.scope-panel .inner { padding: 0 14px 14px; display: grid; gap: 12px; }
.scope-kpi { display: inline-flex; align-items: baseline; gap: 6px; font-size: 13px; }
.scope-kpi b { font-size: 15px; }
.scope-kpi.warn b { color: var(--red); }
.scope-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.scope-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; align-content: start; }
.scope-box h3 { margin: 0; font-size: 14px; }
.scope-box ul { margin: 0; padding-left: 18px; font-size: 13px; }
.draft-banner { margin: 10px 0; border: 1px solid var(--orange); background: var(--orange-soft); border-radius: 12px; padding: 12px 14px; display: grid; gap: 8px; }
.draft-banner .row form { display: inline; }
.locked-banner { margin: 10px 0; border: 1px solid var(--line); background: var(--hover); border-radius: 12px; padding: 10px 14px; font-size: 13px; }
.scope-terms { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.scope-terms ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- уточнения у позиций, формулы, покрытие райдера ---------- */
.qbox { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 2px; padding: 6px 8px; border: 1px dashed var(--orange); border-radius: 10px; background: var(--orange-soft); }
.qbox.answered { border-style: solid; border-color: var(--line); background: transparent; }
.qbox-l { font-size: 12px; font-weight: 600; }
.est-formula { grid-column: 2 / -1; }
.formula { color: var(--text-2); margin-top: 2px; }
.formula b { color: var(--text); }
.not-incl { border-top: 1px dashed var(--line); padding-top: 6px; }
.not-incl ul { margin: 4px 0 0; padding-left: 18px; }
.warn-list .fix { margin-top: 4px; gap: 8px; align-items: center; justify-content: space-between; }
.coverage > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.coverage > summary::-webkit-details-marker { display: none; }
.cov-counts { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.cov-chip { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--hover); color: var(--text-2); white-space: nowrap; }
.cov-chip.cov-done { background: var(--green-soft); color: var(--green); }
.cov-chip.cov-replaced, .cov-chip.cov-clarify { background: var(--orange-soft); color: var(--orange-text); }
.cov-chip.cov-not_found, .cov-chip.cov-unrecognized { background: var(--red-soft); color: var(--red); }
.cov-chip.cov-kit { background: var(--blue-soft); color: var(--blue); }
.cov-t td { vertical-align: top; }
/* «Райдер → смета» на телефоне: таблица прокручивается внутри карточки, страница — нет */
.cov-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cov-t td:first-child { min-width: 64px; max-width: 90px; white-space: normal; }
.line .formula { margin-top: 6px; }
.t-cats td { font-size: 13px; }

/* ---------- публичный сайт DBPOWER: главная, страницы, калькулятор ---------- */
.hero-site { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 22px; align-items: stretch; margin-bottom: 26px;
  background: var(--black); color: #fff; border-radius: 14px; padding: 28px; border-bottom: 3px solid var(--orange); }
.hero-site h1 { font-size: 30px; line-height: 1.15; margin: 6px 0 10px; }
.hero-site p { color: #d4d4d8; font-size: 15px; max-width: 60ch; }
.hero-site .eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--orange); }
.hero-site-cta { margin-top: 16px; }
.hero-site-cta .btn:not(.btn-primary) { background: transparent; color: #fff; border-color: #52525b; }
.hero-site-cta .btn:not(.btn-primary):hover { border-color: var(--orange); }
.hero-site-contacts { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px 16px; color: #e4e4e7; }
.hero-site-contacts a { color: #e4e4e7; }
.hero-site-contacts .muted { color: #a1a1aa; }
.hero-site-card { display: flex; flex-direction: column; background: #fff; color: #18181b; border-radius: 12px; overflow: hidden; text-decoration: none; min-height: 260px; }
.hero-site-card .ph { flex: 1; display: flex; align-items: center; justify-content: center; padding: 14px; background: #fff; }
.hero-site-card .ph img { max-height: 240px; object-fit: contain; }
.hero-site-card .cap { padding: 12px 14px; border-top: 1px solid #e4e4e7; display: grid; gap: 2px; }
.hero-site-card .cap .muted { color: #6b6b73; }
.hero-site-card .price, .feat-card .price { font-weight: 800; color: var(--orange-2); }
.hero-site-card .price small, .feat-card .price small { font-weight: 500; color: var(--muted); }
.site-sec { margin-bottom: 28px; }
.site-sec-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.site-sec-head h2 { font-size: 20px; margin: 0; }
.site-sec-head .spacer { flex: 1; }
.cat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cat-tile { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; box-shadow: var(--shadow); transition: border-color .12s, transform .12s; }
.cat-tile:hover { border-color: var(--orange); transform: translateY(-1px); }
.cat-tile .ph { aspect-ratio: 4/3; background: var(--photo-bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cat-tile .ph img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.cat-tile .cap { padding: 10px 12px; display: grid; gap: 2px; border-top: 3px solid var(--orange); }
.cat-tile .cap b { font-size: 15px; }
.grp-chips { margin-top: 12px; }
.grp-chips .chip { text-decoration: none; }
.feat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.feat-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; text-decoration: none; }
.feat-card:hover { border-color: var(--orange); }
.feat-card .ph { aspect-ratio: 1/1; background: var(--photo-bg); display: flex; align-items: center; justify-content: center; }
.feat-card .ph img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 10px; }
.feat-card .body { padding: 10px 12px; display: grid; gap: 4px; }
.feat-card .body b { font-size: 13.5px; line-height: 1.3; }
.calc-promo { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; border-left: 4px solid var(--orange); }
.calc-promo h2 { font-size: 20px; }
.steps3 { list-style: none; counter-reset: s; padding: 0; margin: 12px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.steps3 li { counter-increment: s; border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 4px; font-size: 13px; }
.steps3 li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--orange); color: #141414; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps3 li span { color: var(--muted); }
.about-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; }
.contacts-card > * + * { margin-top: 6px; }
.site-page { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.site-subnav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 72px; }
.site-subnav a { text-decoration: none; padding: 8px 10px; border-radius: 8px; color: var(--text-2); }
.site-subnav a:hover { background: var(--hover); }
.site-subnav a.on { background: var(--card); box-shadow: inset 3px 0 0 var(--orange); font-weight: 700; }
.site-article { max-width: 860px; line-height: 1.6; }
.site-body h2 { margin-top: 18px; }
.site-body ul { padding-left: 20px; }
mark.todo { background: var(--orange-soft); color: var(--orange-text); padding: 0 4px; border-radius: 4px; font-weight: 600; }
.contacts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 8px 0 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.calc-terms { margin-top: 16px; }
.calc-terms ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.product-page .pp-price { font-size: 26px; font-weight: 800; }
.product-page .gallery-thumbs a { width: 60px; height: 48px; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: center; background: var(--photo-bg); }
/* личный кабинет */
.stats5 { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.stats5 .tile { text-decoration: none; }
.stats5 .tile:hover { border-color: var(--orange); }
.views-seg { margin-bottom: 10px; }
.views-seg a.seg-btn { display: inline-flex; align-items: center; text-decoration: none; }
.logo-preview { border: 1px dashed var(--line-2); border-radius: 10px; padding: 16px; background: var(--photo-bg); display: flex; align-items: center; justify-content: center; min-height: 120px; }
.logo-preview img { max-height: 110px; object-fit: contain; }
/* редактор сметы: оформление и закрытый расчёт */
.brand-bar { margin: 6px 0; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.calc-locked { border: 1px solid var(--orange-line); background: var(--orange-bg2); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; }
.archive-banner { border-color: var(--orange-line); }
.est.archived .line input, .est.archived .title-input { background: transparent; }
.chip [data-uncat] { border: 0; background: none; color: inherit; cursor: pointer; padding: 0 0 0 4px; }
.cat-admin { columns: 2 320px; }
.cat-admin-row { break-inside: avoid; padding: 3px 0; }
@media (max-width: 1400px) { .brand-sub { display: none; } .nav a { padding: 8px 9px; } }
@media (max-width: 1240px) {
  .burger { display: block; }
  .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; background: var(--black); flex-direction: column; padding: 8px; margin: 0; }
  .nav.open { display: flex; }
}
@media (max-width: 900px) {
  .hero-site, .calc-promo, .about-row, .site-page { grid-template-columns: minmax(0, 1fr); }
  .site-subnav { position: static; flex-direction: row; flex-wrap: wrap; }
  .steps3 { grid-template-columns: minmax(0, 1fr); }
  .stats5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .hero-site { padding: 18px; border-radius: 10px; }
  .hero-site h1 { font-size: 23px; }
  .hero-site-card { min-height: 0; }
  .cat-tiles, .feat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .stats5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .views-seg { display: flex; width: 100%; }
  .views-seg a.seg-btn { flex: 1 1 auto; justify-content: center; padding: 0 6px; font-size: 12px; }
}
:root[data-theme="dark"] .hero-site { background: #070708; }
:root[data-theme="dark"] .site-subnav a.on { background: var(--surface-2); }
/* ---------- админка: сгруппированное меню, обзор, формы сайта ---------- */
.admin-nav2 { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: flex-start; margin-bottom: 16px; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.admin-nav2 a { text-decoration: none; padding: 5px 9px; border-radius: 7px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.admin-nav2 a:hover { background: var(--hover); }
.admin-nav2 a.on { background: var(--ink); color: #fff; }
.admin-nav2 .an-group { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; padding-left: 12px; border-left: 2px solid var(--line); }
.admin-nav2 .an-title { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin-right: 4px; }
.admin-nav2 .an-home { background: var(--surface-2); }
.admin-nav2 .an-site { margin-left: auto; color: var(--orange-text); }
.quick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 10px; }
.quick { display: grid; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; box-shadow: var(--shadow); }
.quick:hover { border-color: var(--orange); }
.quick b { font-size: 15px; }
.quick span { font-size: 12.5px; color: var(--muted); }
.adm-thumb { width: 64px; height: 48px; object-fit: contain; background: var(--photo-bg); border-radius: 6px; border: 1px solid var(--line); }
.adm-logo { height: 36px; max-width: 220px; object-fit: contain; background: #1c1c1f; padding: 4px; border-radius: 6px; }
.muted-row td { opacity: .6; }
.fs { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.fs legend { font-weight: 700; padding: 0 4px; }
.btn-row, .menu-row { gap: 6px; }
.bulk-bar { margin-bottom: 8px; position: sticky; top: 60px; z-index: 5; }
.prod-t td:first-child { width: 28px; }
.page-edit { align-items: start; }
.tbl-wrap { overflow-x: auto; }
.site-body img { max-width: 100%; height: auto; border-radius: 8px; }
.cat-intro { max-width: 900px; margin: 6px 0; }
/* кнопки «Изменить» для администратора на публичных страницах */
.admin-edit { position: absolute; top: 8px; right: 8px; z-index: 3; font-size: 12px; font-weight: 600; text-decoration: none; padding: 3px 8px;
  border-radius: 6px; background: var(--orange); color: #141414; opacity: .85; }
.admin-edit:hover { opacity: 1; }
.site-sec, .hero-site, .site-article { position: relative; }
.admin-strip { display: flex; gap: 6px; justify-content: center; margin: 10px 0; }
/* главная: фон шапки, карточка-баннер, свой баннер */
.hero-site.has-bg { background: linear-gradient(rgba(0,0,0,.62), rgba(0,0,0,.62)), var(--hero-bg) center / cover no-repeat; }
.hero-site.no-card { grid-template-columns: minmax(0, 1fr); }
.hero-banner .ph img { max-height: 280px; width: 100%; object-fit: cover; }
/* главная: слайд-шоу оборудования в шапке (templates/_hero_slides.html, static/js/slideshow.js).
   Все слайды лежат в одной ячейке сетки — высота блока равна самому высокому слайду, смена не сдвигает страницу;
   картинка — в области 4:3 целиком (вертикальные, горизонтальные и прозрачные фото без искажений и обрезки). */
.hero-slides { min-height: 0; position: relative; }
.hero-slides[hidden] { display: none !important; }
.hs-stage { display: grid; flex: 1; }
.hs-slide { grid-area: 1 / 1; margin: 0; display: flex; flex-direction: column; opacity: 0; visibility: hidden;
  transition: opacity .7s ease, visibility 0s linear .7s; }
.hs-slide.is-active { opacity: 1; visibility: visible; transition: opacity .7s ease, visibility 0s; z-index: 1; }
.hs-link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.hs-link:focus-visible { outline: 3px solid var(--orange); outline-offset: -3px; border-radius: 12px; }
.hero-slides .ph { flex: none; aspect-ratio: 4 / 3; padding: 14px; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hero-slides .ph img { width: 100%; height: 100%; max-height: none; object-fit: contain; transform: scale(1.04);
  transition: transform 6s ease-out; will-change: transform; }
.hero-slides .hs-slide.is-active .ph img { transform: scale(1); }
.hero-slides .cap { flex: 1; align-content: start; min-height: 72px; }
.hero-slides .cap b { font-size: 15px; line-height: 1.3; }
.hero-site-card .price small { color: #6b6b73; }     /* карточка всегда белая — цвет не зависит от темы */
.hs-controls { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-top: 1px solid #e4e4e7; background: #fff; position: relative; z-index: 2; }
.hs-dots { flex: 1; display: flex; justify-content: center; flex-wrap: wrap; gap: 0; }
.hs-btn, .hs-dot { appearance: none; border: 0; background: transparent; cursor: pointer; color: #3f3f46; border-radius: 8px; }
.hs-btn { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; }
.hs-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hs-play svg { width: 18px; height: 18px; }
.hs-play .i-play { fill: currentColor; stroke: none; display: none; }
.hs-play.paused .i-play { display: block; }
.hs-play.paused .i-pause { display: none; }
.hs-btn:hover { background: #f4f4f5; color: #18181b; }
.hs-dot { width: 26px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.hs-dot span { width: 8px; height: 8px; border-radius: 50%; background: #d4d4d8; transition: background .2s, transform .2s; }
.hs-dot:hover span { background: #a1a1aa; }
.hs-dot[aria-current="true"] span { background: var(--orange); transform: scale(1.25); }
.hs-btn:focus-visible, .hs-dot:focus-visible { outline: 3px solid var(--orange); outline-offset: 1px; }
.hero-slides.single .hs-controls { display: none; }
@media (prefers-reduced-motion: reduce) {
  .hs-slide, .hs-slide.is-active { transition: none; }
  .hero-slides .ph img, .hero-slides .hs-slide.is-active .ph img { transform: none; transition: none; }
}
@media (max-width: 640px) {
  .hero-slides .ph { padding: 10px; }
  .hero-slides .cap { min-height: 64px; padding: 10px 12px; }
  .hs-btn { width: 40px; height: 40px; }
}
/* админка → Оборудование: вкладки групп, «по группам», кнопки в строке */
.grp-tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.grp-tabs > a, .grp-tabs .seg a { text-decoration: none; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--card); color: var(--text-2); font-size: 13px; font-weight: 600; }
.grp-tabs > a small { color: var(--muted); font-weight: 500; margin-left: 2px; }
.grp-tabs > a:hover, .grp-tabs .seg a:hover { border-color: var(--orange); }
.grp-tabs > a.on, .grp-tabs .seg a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.grp-tabs > a.on small { color: #d4d4d8; }
.grp-tabs .seg { display: inline-flex; gap: 4px; }
.prod-t .grp-row td { background: var(--surface-2); font-weight: 700; font-size: 13px; padding-top: 8px; padding-bottom: 8px; }
.row-acts { white-space: nowrap; }
.row-acts .btn { margin: 1px 0; }
@media (max-width: 640px) { .row-acts { white-space: normal; } .grp-tabs { gap: 4px; } }
/* админка: водяной знак (пример) и редактор слайдов */
.wm-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); gap: 16px; align-items: start; }
.wm-preview { margin: 0; display: grid; gap: 4px; }
.wm-preview img { width: 100%; border: 1px solid var(--line); border-radius: 8px; background: var(--photo-bg); }
.sl-edit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 16px; align-items: start; }
.sl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sl-item { display: grid; grid-template-columns: 22px 84px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.sl-item.off { opacity: .55; }
.sl-item.dragging { opacity: .4; }
.sl-item.drop-before { box-shadow: inset 0 3px 0 var(--orange); }
.sl-item.drop-after { box-shadow: inset 0 -3px 0 var(--orange); }
.sl-handle { cursor: grab; color: var(--muted); font-size: 18px; text-align: center; user-select: none; }
.sl-thumb { width: 84px; height: 63px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.sl-body { display: grid; gap: 4px; min-width: 0; }
.sl-body .grid2 { gap: 6px; }
.sl-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 210px; }
.sl-actions .btn { padding: 0 8px; }
.sl-picker { display: grid; gap: 6px; max-height: 340px; overflow: auto; }
.sl-pick { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 4px 6px; border: 1px solid var(--line); border-radius: 8px; }
.sl-pick img { width: 48px; height: 36px; object-fit: contain; background: #fff; border-radius: 4px; }
.sl-preview { position: sticky; top: 72px; display: grid; gap: 8px; }
.sl-preview .hero-site-card { border: 1px solid var(--line); }
.sl-dirty { color: var(--orange-text); font-weight: 600; }
@media (max-width: 900px) {
  .wm-edit, .sl-edit { grid-template-columns: minmax(0, 1fr); }
  .sl-preview { position: static; }
  .sl-item { grid-template-columns: 22px 64px minmax(0, 1fr); }
  .sl-thumb { width: 64px; height: 48px; }
  .sl-actions { grid-column: 1 / -1; max-width: none; justify-content: flex-start; }
}
.banner-blk { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); overflow: hidden; align-items: center; }
.banner-blk .bb-img img { width: 100%; height: 100%; max-height: 320px; object-fit: cover; display: block; }
.banner-blk:not(:has(.bb-img)) { grid-template-columns: minmax(0, 1fr); }
.steps3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
/* подвал */
.site-footer2 { border-top: 1px solid var(--line); padding: 18px; color: var(--muted); font-size: 12.5px; display: grid; gap: 10px; justify-items: center; text-align: center; }
.site-footer2 a { color: var(--muted); }
.site-footer2 .sf-links a { color: var(--text-2); font-weight: 600; }
.site-footer2 > div { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: center; }
.site-footer2 .sf-note { white-space: pre-line; }
@media (max-width: 900px) { .banner-blk { grid-template-columns: minmax(0, 1fr); } .admin-nav2 .an-site { margin-left: 0; } }
@media (max-width: 640px) {
  .admin-nav2 { gap: 4px 6px; padding: 8px; }
  /* на телефоне каждая группа — одна строка с прокруткой внутри строки; «Обзор» и «Открыть сайт» — первой строкой */
  .admin-nav2 .an-home, .admin-nav2 .an-site { order: -1; }
  .admin-nav2 .an-group { padding-left: 0; border-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .admin-nav2 .an-group::-webkit-scrollbar { display: none; }
  .admin-nav2 .an-group > * { flex: none; white-space: nowrap; }
  .admin-nav2 .an-title { min-width: 78px; }
  .bulk-bar { position: static; }
  .adm-thumb { width: 48px; height: 36px; }
}
/* атрибут hidden всегда скрывает элемент (даже с display:flex у класса) */
[hidden] { display: none !important; }
