/* STRUCTURA Calculator — стили. Светлый нейтральный фон, графитовый текст, Inter. */

@font-face { font-family: Inter; src: url(/assets/inter-400.woff) format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: Inter; src: url(/assets/inter-500.woff) format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: Inter; src: url(/assets/inter-600.woff) format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter Display'; src: url(/assets/inter-display-300.woff) format('woff'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Inter Display'; src: url(/assets/inter-display-400.woff) format('woff'); font-weight: 400; font-display: swap; }

:root {
  --paper: #f5f5f3;
  --surface: #ffffff;
  --ink: #23262b;
  --ink-2: #464a50;
  --muted: #74777c;
  --line: #e4e4e0;
  --line-2: #d0d0cb;
  --fill: #efefec;
  --accent: #23262b;
  --accent-ink: #ffffff;
  --accent-hover: #3a3e44;
  --accent-text: #23262b;
  --ok: #2f6b4f;
  --warn: #a2622a;
  --danger: #a33a2b;
  --r-sm: 4px;
  --r: 8px;
  --r-lg: 12px;
  --shadow: 0 1px 2px rgba(35, 38, 43, .04), 0 10px 30px rgba(35, 38, 43, .06);
  --display: 'Inter Display', Inter, system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; background: var(--paper); color: var(--ink);
  font: 400 15px/1.55 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss03'; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: currentColor; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

/* ---------- Типографика ---------- */
h1, h2, h3, h4, p { margin: 0; }
.display { font: 300 clamp(40px, 5.4vw, 72px)/1.02 var(--display); letter-spacing: -.03em; text-wrap: balance; }
.h1 { font: 300 clamp(28px, 3.2vw, 40px)/1.1 var(--display); letter-spacing: -.02em; text-wrap: balance; }
.h2 { font: 300 clamp(24px, 2.4vw, 32px)/1.15 var(--display); letter-spacing: -.015em; }
.h3 { font-size: 18px; font-weight: 500; line-height: 1.3; letter-spacing: -.005em; }
.h4 { font-size: 16px; font-weight: 500; line-height: 1.35; }
.lead { font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num, .price-from, .choice-price, .option-price, .summary-total, .receipt, .figures strong { font-variant-numeric: tabular-nums; }
code { font-size: 14px; background: var(--fill); padding: 2px 6px; border-radius: var(--r-sm); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); color: var(--ink);
  font-size: 14px; font-weight: 500; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-quiet { border-color: transparent; background: transparent; padding: 0 12px; }
.btn-quiet:hover { background: var(--fill); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-block { width: 100%; }
.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.is-busy::after { content: ''; position: absolute; inset: 50% auto auto 50%; width: 16px; height: 16px; margin: -8px; border: 2px solid var(--muted); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-primary.is-busy::after { border-color: var(--accent-ink); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(1turn); } }
.link { background: none; border: 0; padding: 0; font-size: 14px; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.link:hover { color: var(--ink); text-decoration-color: currentColor; }
.link:disabled { opacity: .4; cursor: default; }
.link.danger { color: var(--danger); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface); }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

/* ---------- Формы ---------- */
.form { display: grid; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px 20px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field-label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field i { font-style: normal; font-weight: 400; color: var(--muted); }
input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=file]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface); font-size: 15px; transition: border-color .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(35, 38, 43, .08); }
select { appearance: none; padding-right: 36px; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2374777c' stroke-width='1.6'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 18px; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.check a { color: var(--ink); }
.form-error { color: var(--danger); font-size: 14px; white-space: pre-line; }
.form-error:empty { display: none; }
.prefixed { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); padding-right: 12px; }
.prefixed > span { padding-left: 12px; color: var(--muted); }
.prefixed input { border: 0 !important; box-shadow: none !important; }
.prefixed:focus-within { border-color: var(--ink); }
.narrow { max-width: 420px; }

/* ---------- Шапка и подвал ---------- */
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; max-width: var(--max); margin: 0 auto; padding: 20px var(--gutter); }
.wordmark { font-weight: 600; font-size: 15px; letter-spacing: .14em; text-decoration: none; }
.wordmark.small { font-size: 13px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; font-weight: 600; font-size: 16px; text-decoration: none; }
.brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-logo { height: 36px; width: auto; max-width: 160px; object-fit: contain; }
.site-nav { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.site-nav a:not(.btn) { text-decoration: none; }
.phone { font-variant-numeric: tabular-nums; }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 40px; width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--max) - 2 * var(--gutter)); margin: 96px auto 0; padding: 32px 0 48px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.site-footer > div { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer strong { color: var(--ink); font-weight: 500; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.site-footer nav a { text-decoration: none; }
.site-footer nav a:hover { color: var(--ink); text-decoration: underline; }
.site-footer p { flex-basis: 100%; }
.preview-bar { background: var(--ink); color: #fff; font-size: 13px; text-align: center; padding: 10px var(--gutter); }

/* ---------- Публичный калькулятор: главный экран и каталог ---------- */
.public-main { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.catalog { scroll-margin-top: 16px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--fill); border-radius: var(--r); }
.segmented button { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border: 0; border-radius: 6px; background: transparent; font-size: 14px; color: var(--ink-2); }
.segmented button:hover { color: var(--ink); }
.segmented button[aria-selected=true] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(35, 38, 43, .08); }
.segmented .count { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.search { position: relative; display: flex; align-items: center; min-width: 240px; }
.search.wide { max-width: 360px; margin-bottom: 20px; }
.search svg { position: absolute; left: 12px; color: var(--muted); pointer-events: none; }
.search input { padding-left: 40px !important; }
.empty { padding: 40px 0; color: var(--muted); }

.card { position: relative; display: grid; gap: 16px; }
.placeholder { display: grid; place-items: center; height: 100%; color: var(--line-2); }
.placeholder svg { width: 38%; height: auto; stroke-width: 1.2; }
.card-body { display: grid; gap: 10px; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-title .muted { font-size: 13px; }
.facts-inline { display: flex; gap: 24px; margin: 0; font-size: 14px; }
.facts-inline dt { font-size: 12px; color: var(--muted); }
.facts-inline dd { margin: 0; }

/* ---------- Калькулятор ---------- */
.steps { display: flex; gap: 6px; margin: 8px 0 40px; padding: 0; list-style: none; counter-reset: s; overflow-x: auto; scrollbar-width: none; }
.steps li { flex: 1 0 auto; border-top: 2px solid var(--line); padding-top: 12px; font-size: 13px; color: var(--muted); }
.steps li.done { border-color: var(--ink-2); color: var(--ink-2); }
.steps li.current { border-color: var(--accent); color: var(--ink); font-weight: 500; }
.steps button, .steps span { display: inline-flex; gap: 8px; align-items: baseline; padding: 0 12px 0 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; }
.steps button:hover { color: var(--ink); }
.steps b { font-weight: 500; font-variant-numeric: tabular-nums; }

.calc { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(32px, 5vw, 72px); align-items: start; }
.calc-main { display: grid; gap: 28px; min-width: 0; }
.crumb { display: flex; gap: 8px; font-size: 13px; color: var(--muted); }
.crumb a { text-decoration: none; }
.crumb a:hover { color: var(--ink); }
.section-gap { margin-top: 12px; }

.project-info { display: grid; gap: 24px; }
.gallery { margin: 0; display: grid; gap: 10px; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; }
.gallery-thumbs button { flex: none; width: 84px; height: 60px; padding: 0; border: 1px solid transparent; border-radius: 6px; overflow: hidden; background: var(--fill); opacity: .65; }
.gallery-thumbs button.active, .gallery-thumbs button:hover { opacity: 1; border-color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0 32px; margin: 0; }
.facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }
details > summary { cursor: pointer; font-size: 14px; font-weight: 500; list-style: none; display: inline-flex; gap: 6px; align-items: center; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: '+'; color: var(--muted); }
details[open] > summary::after { content: '–'; }
.plan img { margin-top: 12px; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }

.choices, .options { display: grid; gap: 10px; }
.choice { display: grid; gap: 6px; padding: 18px 20px 18px 50px; position: relative; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.choice:hover { border-color: var(--muted); }
.choice.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.choice input { position: absolute; left: 20px; top: 21px; }
.choice-head { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.choice-price { font-weight: 500; white-space: nowrap; }
.choice .muted { font-size: 14px; }
.composition { margin-top: 4px; }
.composition ul { margin: 10px 0 0; padding-left: 18px; color: var(--ink-2); font-size: 14px; }

.option { border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.option:hover { border-color: var(--muted); }
.option.selected { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.option-main { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: start; padding: 16px 20px; cursor: pointer; }
.option-main input { position: absolute; opacity: 0; pointer-events: none; }
.checkmark { display: grid; place-items: center; width: 20px; height: 20px; margin-top: 1px; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface); }
.checkmark svg { width: 14px; height: 14px; stroke-width: 2.2; opacity: 0; color: var(--accent-ink); }
.option.selected .checkmark { background: var(--accent); border-color: var(--accent); }
.option.selected .checkmark svg { opacity: 1; }
.option-main input:focus-visible + .checkmark { outline: 2px solid var(--accent); outline-offset: 2px; }
.option-text { display: grid; gap: 2px; }
.option-text .muted { font-size: 14px; }
.option-price { font-size: 14px; white-space: nowrap; text-align: right; }
.qty { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 0 20px 16px 54px; }
.qty input { width: 88px !important; text-align: center; }
.qty .icon-btn { width: 36px; height: 36px; }

.receipt { display: grid; border-top: 1px solid var(--ink); }
.receipt-row { display: flex; justify-content: space-between; gap: 24px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.receipt-row span:last-child { white-space: nowrap; }
.receipt-row.total { border-bottom: 0; padding-top: 18px; font: 300 30px/1.2 var(--display); letter-spacing: -.015em; }
.receipt p { margin-top: 8px; }

.calc-nav { display: flex; justify-content: space-between; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.calc-nav .btn-quiet { padding-left: 6px; }

.summary { position: sticky; top: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }
.summary-body { display: grid; gap: 6px; padding: 22px 24px 24px; }
.summary-lines { display: grid; gap: 8px; margin: 14px 0 6px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 14px; }
.summary-lines div { display: flex; justify-content: space-between; gap: 16px; }
.summary-lines span:first-child { color: var(--ink-2); }
.summary-lines span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-label { margin-top: 8px; font-size: 13px; color: var(--muted); }
.summary-total { font: 300 40px/1.05 var(--display); letter-spacing: -.025em; margin-bottom: 8px; }
.mobile-bar { display: none; }

.lead-form { max-width: 640px; }
.success { display: grid; gap: 14px; justify-items: start; padding: 32px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.success-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.success-icon svg { width: 22px; height: 22px; stroke-width: 2; }

/* ---------- Лендинг и вход ---------- */
.landing { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.landing-hero { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 96px); align-items: center; padding: clamp(24px, 4vw, 64px) 0 clamp(64px, 8vw, 120px); }
.landing-copy { display: grid; gap: 28px; }
.landing-photo { margin: 0; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 5; background: var(--fill); }
.landing-photo img { width: 100%; height: 100%; object-fit: cover; }
.landing-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; padding-top: 40px; border-top: 1px solid var(--line); }
.landing-steps > div { display: grid; gap: 10px; align-content: start; }
.step-index { font: 300 32px/1 var(--display); color: var(--muted); font-variant-numeric: tabular-nums; }
.login, .center-page { max-width: 400px; margin: 0 auto; padding: 12vh 20px 40px; display: grid; gap: 28px; }
.center-page { justify-items: start; gap: 16px; }
.boot { height: 100vh; }

/* ---------- Кабинет и панель ---------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 28px; padding: 24px 16px; border-right: 1px solid var(--line); background: var(--surface); }
.sidebar-top { display: flex; justify-content: space-between; align-items: center; padding: 0 8px; }
.menu-toggle { display: none; }
.company { display: grid; gap: 6px; padding: 0 8px; font-size: 14px; }
.side-nav { display: grid; gap: 2px; }
.side-nav a { display: flex; justify-content: space-between; align-items: center; padding: 9px 10px; border-radius: 6px; font-size: 14px; color: var(--ink-2); text-decoration: none; }
.side-nav a:hover { background: var(--fill); color: var(--ink); }
.side-nav a.active { background: var(--fill); color: var(--ink); font-weight: 500; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.sidebar-bottom { margin-top: auto; display: grid; gap: 12px; justify-items: start; padding: 0 8px; font-size: 14px; }
.sidebar-bottom a { color: var(--ink-2); }
.status-dot { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.status-dot::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); }
.status-dot.on::before { background: var(--ok); }
.status-dot.warn::before { background: var(--warn); }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; align-content: start; padding: 40px clamp(20px, 4vw, 56px) 80px; max-width: 1240px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; }
.page-head > div:first-child { display: grid; gap: 8px; }
.page-head .muted { max-width: 68ch; }
.figures { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.figures > div { display: grid; gap: 4px; padding: 20px 24px 20px 0; font-size: 14px; }
.figures > div + div { padding-left: 24px; border-left: 1px solid var(--line); }
.figures strong { font: 300 34px/1.1 var(--display); letter-spacing: -.02em; }
.figures strong.date { font-size: 22px; line-height: 1.6; }
.panel { display: grid; gap: 20px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.checklist { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.checklist li { display: flex; align-items: center; gap: 12px; }
.checklist li.ok { color: var(--muted); }
.tick { display: grid; place-items: center; width: 20px; height: 20px; border: 1px solid var(--line-2); border-radius: 50%; }
.checklist li.ok .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.tick svg { width: 13px; height: 13px; stroke-width: 2.4; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table .end { text-align: right; }
.table .nowrap { white-space: nowrap; }
.table .comment { max-width: 260px; color: var(--ink-2); }
.table select { min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 14px; min-width: 132px; }
.row-title { display: flex; align-items: center; gap: 14px; padding: 0; border: 0; background: none; text-align: left; font-weight: 500; }
.row-title > span { display: grid; }
.row-title small { font-weight: 400; }
.row-title .thumb, .thumb-empty { width: 64px; height: 46px; object-fit: cover; border-radius: 4px; background: var(--fill); flex: none; }
.thumb-empty { display: grid; place-items: center; color: var(--line-2); }
.thumb-empty svg { width: 34px; height: 24px; }

.doc-list { border-top: 1px solid var(--line); }
.doc-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 24px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--line); }
.doc-row > div:first-child { display: grid; gap: 4px; }
.doc-editor { font-size: 14px; line-height: 1.6; min-height: 360px; }

.settings { gap: 24px; }
.settings .panel { gap: 18px; }
.media-list { display: grid; gap: 12px; }
.media-item { display: grid; grid-template-columns: 120px minmax(0, 1fr); grid-template-rows: auto auto; gap: 8px 16px; align-items: center; }
.media-actions { display: flex; flex-wrap: wrap; gap: 16px; }
.upload { position: relative; display: grid; justify-items: start; gap: 2px; padding: 18px 20px; border: 1px dashed var(--line-2); border-radius: var(--r); cursor: pointer; font-size: 14px; font-weight: 500; }
.upload:hover { border-color: var(--ink); }
.upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.upload:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.upload small { font-weight: 400; }
.upload.inline { display: inline-grid; padding: 10px 16px; }
.upload.tile { place-content: center; justify-items: center; min-height: 120px; text-align: center; }
.logo-edit { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; }
.logo-edit > div:last-child { display: grid; gap: 10px; justify-items: start; }
#logo-preview { display: grid; place-items: center; width: 200px; height: 96px; border: 1px solid var(--line); border-radius: var(--r); background: repeating-conic-gradient(#f2f2ef 0 25%, #fff 0 50%) 0 0 / 16px 16px; padding: 12px; text-align: center; }
#logo-preview img { max-height: 70px; max-width: 170px; object-fit: contain; }
.color-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.color-row input[type=color] { width: 44px; height: 44px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r-sm); background: none; }
.color-row input[name=color] { width: 120px !important; font-variant-numeric: tabular-nums; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line-2); padding: 0; }
.swatch:hover { box-shadow: 0 0 0 1px var(--ink); }
.color-sample { margin-top: 12px; }
.save-bar { position: sticky; bottom: 0; z-index: 2; display: flex; flex-wrap: wrap; align-items: center; gap: 20px; padding: 16px 0; background: linear-gradient(to top, var(--paper) 70%, transparent); font-size: 14px; }

/* ---------- Диалоги ---------- */
#dialog, #dialog2 { width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 0; border: 0; border-radius: var(--r-lg); background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px rgba(20, 22, 26, .22); }
#dialog.wide, #dialog2.wide { width: min(880px, calc(100vw - 24px)); }
#dialog::backdrop, #dialog2::backdrop { background: rgba(28, 30, 34, .42); }
#dialog[open], #dialog2[open] { animation: dialog-in .2s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px); } }
#dialog-body, #dialog2-body { position: relative; display: grid; gap: 18px; padding: 32px; }
.dialog-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--muted); }
.dialog-close:hover { background: var(--fill); color: var(--ink); }
.dialog-title { font: 300 28px/1.15 var(--display); letter-spacing: -.015em; padding-right: 40px; }
fieldset > .btn-quiet { justify-self: start; }
fieldset { display: grid; gap: 16px; margin: 0; padding: 24px 0 0; border: 0; border-top: 1px solid var(--line); }
legend { float: left; width: 100%; padding: 0; margin-bottom: 4px; font-size: 16px; font-weight: 500; }
legend + * { clear: both; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; }
.media-tile { position: relative; display: grid; gap: 8px; align-content: start; }
.media-tile input { min-height: 36px !important; padding: 6px 10px !important; font-size: 13px !important; }
.media-tile .media-actions { gap: 12px; font-size: 13px; }
.media-tile .link { font-size: 13px; }
.media-tile.plan { max-width: 240px; }
.media-tile.plan img { object-fit: contain; background: #fff; border: 1px solid var(--line); }
.tag { position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 4px; background: rgba(255, 255, 255, .92); font-size: 12px; font-weight: 500; }
.plan-edit { display: grid; gap: 8px; justify-items: start; }
.row-edit { display: grid; grid-template-columns: 1fr 1.4fr 40px; gap: 10px; align-items: center; }
.row-edit .icon-btn { border: 0; color: var(--muted); }
.block-edit { display: grid; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: var(--r); background: #fbfbfa; }
.block-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-check { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; cursor: pointer; background: var(--surface); }
.pill-check:has(input:checked) { border-color: var(--ink); }
.pill-check input { width: 14px; height: 14px; margin: 0; }
.editor-bar { position: sticky; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin: 0 -32px -32px; padding: 16px 32px; border-top: 1px solid var(--line); background: var(--surface); }
.editor-bar .link { margin-left: auto; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; }
.danger-zone { display: grid; gap: 14px; padding: 18px; border-radius: var(--r); background: #fbf3f1; font-size: 14px; }
.sub-form { padding-top: 22px; border-top: 1px solid var(--line); gap: 12px; }

/* ---------- Уведомления ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; z-index: 100; max-width: min(520px, calc(100vw - 32px)); padding: 12px 18px; border-radius: var(--r); background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow); white-space: pre-line;
  opacity: 0; transform: translate(-50%, 8px); pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--danger); }

/* ---------- Страница документа ---------- */
.doc-page { background: var(--surface); }
.doc { max-width: 720px; margin: 0 auto; padding: 56px 24px 96px; display: grid; gap: 20px; }
.doc-back { font-size: 14px; color: var(--muted); text-decoration: none; }
.doc .eyebrow { font-size: 13px; color: var(--muted); }
.doc h1 { font: 300 clamp(28px, 4vw, 40px)/1.15 var(--display); letter-spacing: -.02em; }
.doc-text { font-size: 16px; line-height: 1.75; color: var(--ink-2); }

/* ---------- Адаптивность ---------- */
@media (max-width: 1080px) {
  .calc { grid-template-columns: minmax(0, 1fr) 320px; }
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .figures > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .figures > div:nth-child(n+3) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .landing-hero { grid-template-columns: 1fr; align-items: start; }
  .landing-photo { aspect-ratio: 4 / 3; }
  .landing-steps { grid-template-columns: 1fr; gap: 28px; }
  .calc { grid-template-columns: 1fr; }
  .summary { display: none; }
  .mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 16px;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); backdrop-filter: blur(8px); }
  .mobile-bar > div { display: grid; }
  .mobile-bar strong { font: 400 22px/1.15 var(--display); font-variant-numeric: tabular-nums; }
  .public-main:has(.mobile-bar) + .site-footer { padding-bottom: 120px; }
  .calc-nav .btn-primary { display: none; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: sticky; z-index: 30; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0; padding: 12px var(--gutter); border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar-top { flex: 1; padding: 0; }
  .menu-toggle { display: inline-grid; }
  .sidebar .company, .sidebar .side-nav, .sidebar .sidebar-bottom { display: none; flex-basis: 100%; }
  .sidebar.open .company, .sidebar.open .side-nav, .sidebar.open .sidebar-bottom { display: grid; }
  .sidebar.open .company { padding: 16px 0 8px; }
  .sidebar.open .sidebar-bottom { padding: 16px 0 4px; margin: 0; }
  .workspace { padding-top: 28px; gap: 32px; }
  .doc-row { grid-template-columns: 1fr; gap: 10px; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .site-header { padding-top: 14px; padding-bottom: 14px; }
  .site-nav { gap: 14px; }
  .site-header.public .phone { display: none; }
  .steps li { flex: 0 0 auto; }
  .steps li:not(.current) button, .steps li:not(.current) span { font-size: 0; gap: 0; }
  .steps li:not(.current) b { font-size: 13px; }
  .search { min-width: 0; width: 100%; }
  .toolbar { align-items: stretch; }
  .segmented { width: 100%; }
  .option-main { grid-template-columns: auto 1fr; }
  .option-price { grid-column: 2; text-align: left; }
  .qty { padding-left: 54px; }
  .choice-head { flex-direction: column; gap: 2px; }
  .figures { grid-template-columns: 1fr 1fr; }
  .figures > div { padding: 16px 12px 16px 0; }
  .figures > div + div { padding-left: 12px; }
  .figures > div:nth-child(3) { padding-left: 0; }
  .figures strong { font-size: 28px; }
  .panel { padding: 20px; }
  #dialog-body, #dialog2-body { padding: 24px 18px; }
  .editor-bar { margin: 0 -18px -24px; padding: 14px 18px; }
  .row-edit { grid-template-columns: 1fr 40px; }
  .row-edit input:nth-child(2) { grid-column: 1; }
  .row-edit .icon-btn { grid-row: 1 / span 2; grid-column: 2; }
  .media-item { grid-template-columns: 88px minmax(0, 1fr); }
  .receipt-row.total { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Заявки на узком экране — карточками */
@media (max-width: 560px) {
  .figures strong.date { font-size: 18px; }
  .table.leads thead { display: none; }
  .table.leads, .table.leads tbody { display: block; }
  .table.leads tr { display: grid; gap: 8px; padding: 16px; border-bottom: 1px solid var(--line); }
  .table.leads tr:last-child { border-bottom: 0; }
  .table.leads td { padding: 0; border: 0; max-width: none; }
  .table.leads td.nowrap { color: var(--muted); font-size: 13px; }
}

/* ================= 1.3: шаблон, кадры, галереи ================= */

/* Фон и углы публичного калькулятора */
html[data-bg=warm] { --paper: #f6f3ee; --fill: #eeeae3; }
html[data-bg=white] { --paper: #ffffff; --fill: #f2f2f0; }
html[data-corners=sharp] { --r-sm: 2px; --r: 2px; --r-lg: 3px; }

/* Кадр изображения */
.frame { position: relative; overflow: hidden; background: var(--fill); }
.frame > img { display: block; }
.frame > .cover { width: 100%; height: 100%; object-fit: cover; }
.frame > .cropped { position: absolute; max-width: none; }
.r-card { aspect-ratio: 4 / 3; }
.r-wide { aspect-ratio: 16 / 9; }

/* Лента изображений */
.slider { position: relative; border-radius: var(--r); overflow: hidden; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; }
.slide-btn { position: absolute; top: 50%; margin-top: -20px; border: 0; background: rgba(255, 255, 255, .9); opacity: 0; transition: opacity .2s; }
.slide-btn.prev { left: 14px; }
.slide-btn.next { right: 14px; }
.slider:hover .slide-btn, .slider:focus-within .slide-btn { opacity: 1; }
@media (hover: none) { .slide-btn { display: none; } }
.dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); box-shadow: 0 0 0 1px rgba(0, 0, 0, .06); transition: background-color .2s, width .2s; }
.dots span.on { width: 16px; border-radius: 3px; background: #fff; }

/* Шапка */
.site-header.public { flex-wrap: wrap; }
.site-header.public .site-nav { flex-wrap: wrap; justify-content: flex-end; gap: 12px 20px; }
.btn-link { border-color: transparent; background: none; padding: 0 4px; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.btn-link:hover { border-color: transparent; text-decoration-color: currentColor; }
.logo-s .brand-logo { height: 28px; max-width: 140px; }
.logo-m .brand-logo { height: 40px; max-width: 200px; }
.logo-l .brand-logo { height: 60px; max-width: 280px; }
.logo-xl .brand-logo { height: 84px; max-width: 360px; }

/* Главный экран */

/* Каталог */
.toolbar-end { display: flex; flex-wrap: wrap; gap: 12px; }
select.sort { width: auto; min-width: 200px; }
.grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 40px 28px; }
.grid.cols-2 { --cols: 2; }
.grid.cols-4 { --cols: 4; gap: 32px 20px; }
.card { display: grid; gap: 16px; align-content: start; }
.card-media { cursor: pointer; border-radius: var(--r); overflow: hidden; }
.card-media > .frame { border-radius: var(--r); }
.card-media .placeholder { display: grid; place-items: center; color: var(--line-2); }
.card-body { display: grid; gap: 10px; color: inherit; text-decoration: none; border-radius: 4px; }
.card-body:hover .h4 { text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 4px; }
.card-title { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.facts-inline { display: flex; gap: 24px; font-size: 14px; }
.facts-inline > span { display: grid; }
.facts-inline small { font-size: 12px; color: var(--muted); }

/* Страница проекта */
.gallery .slider { border-radius: var(--r); }
.gallery-thumbs button > .frame { width: 100%; height: 100%; aspect-ratio: auto; }
.summary > .frame { border-radius: 0; }

/* Кабинет: черновик, уведомления, история, предпросмотр */
.notice { padding: 14px 18px; border-radius: var(--r); background: var(--fill); font-size: 14px; color: var(--ink-2); }
.notice.warn { background: #f7eee6; color: #6c4120; }
.notice ul { margin: 8px 0; padding-left: 18px; }
.draft-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; padding: 18px 20px; border: 1px solid var(--accent); border-radius: var(--r-lg); background: var(--surface); }
.draft-bar > div:first-child { display: grid; gap: 4px; max-width: 640px; }
.badge.quiet { background: transparent; color: var(--accent); min-width: 0; padding: 0; font-size: 18px; }
.history { padding: 4px 0; }
.history > summary { font-size: 15px; }
.history > p { margin: 10px 0 14px; }
.history .table { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.change-list { max-height: 320px; overflow: auto; margin: 0; padding: 12px 12px 12px 30px; border: 1px solid var(--line); border-radius: var(--r); font-size: 14px; line-height: 1.7; }
.row-title .thumb { border-radius: 4px; }
.media-item > .frame { grid-row: span 2; width: 120px; border-radius: 6px; }
.media-tile > .frame { border-radius: 6px; }
.media-tile .tag-right { left: auto; right: 8px; }
.seg { position: relative; display: inline-flex; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border-radius: 6px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(35, 38, 43, .08); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.field > .segmented { justify-self: start; }
.narrow-field { max-width: 220px; }
.settings-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
.live-preview { display: none; }
@media (min-width: 1360px) {
  .settings-layout { grid-template-columns: minmax(0, 1fr) 390px; }
  .live-preview { display: grid; gap: 10px; position: sticky; top: 24px; }
  .live-preview iframe { width: 390px; height: min(780px, calc(100vh - 90px)); border: 1px solid var(--line); border-radius: 22px; background: var(--paper); box-shadow: var(--shadow); }
}

/* Кадрирование */
.crop-stage { width: 100%; max-height: 60vh; border-radius: var(--r); cursor: grab; touch-action: none; user-select: none; }
.crop-stage.dragging { cursor: grabbing; }
.crop-stage img { position: absolute; max-width: none; pointer-events: none; }
.crop-stage::after { content: ''; position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .6);
  background: linear-gradient(to right, transparent calc(33.33% - .5px), rgba(255,255,255,.45) calc(33.33% - .5px) calc(33.33% + .5px), transparent calc(33.33% + .5px) calc(66.66% - .5px), rgba(255,255,255,.45) calc(66.66% - .5px) calc(66.66% + .5px), transparent calc(66.66% + .5px)),
  linear-gradient(to bottom, transparent calc(33.33% - .5px), rgba(255,255,255,.45) calc(33.33% - .5px) calc(33.33% + .5px), transparent calc(33.33% + .5px) calc(66.66% - .5px), rgba(255,255,255,.45) calc(66.66% - .5px) calc(66.66% + .5px), transparent calc(66.66% + .5px)); }
#dialog2 { z-index: 10; }

/* Документ-файл */
.doc-frame { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: var(--r); }
.doc .btn { justify-self: start; }

@media (max-width: 1080px) {
  .grid, .grid.cols-4 { --cols: 2; }
}
@media (max-width: 860px) {
}
@media (max-width: 640px) {
  .grid, .grid.cols-2, .grid.cols-4 { --cols: 1; }
  .site-header.public { gap: 12px; }
  .site-header.public .site-nav { width: 100%; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .site-header.public .site-nav .btn { flex: none; }
  .logo-l .brand-logo { height: 48px; }
  .logo-xl .brand-logo { height: 64px; max-width: 100%; }
  .toolbar-end, select.sort { width: 100%; }
  .media-item > .frame { width: 88px; }
}
input[type=range] { accent-color: var(--accent); width: 100%; }


/* ================= 1.4: варианты главного экрана, анимации, характер ================= */

html { scroll-behavior: smooth; }
body { overflow-x: clip; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
::selection { background: var(--accent); color: var(--accent-ink); }

/* Шапка: прилипает, полупрозрачная с размытием после прокрутки */
.site-header.public { position: sticky; top: 0; z-index: 40; max-width: none; padding-inline: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter)));
  transition: background-color .3s, box-shadow .3s, padding .3s; }
.site-header.public.scrolled { background: color-mix(in srgb, var(--paper) 82%, transparent); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); box-shadow: 0 1px 0 var(--line); }
.brand-logo { transition: height .3s; }

/* Кнопки: мягкий отклик */
.btn { transition: background-color .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s; }
.btn-primary:hover { box-shadow: 0 6px 18px -8px var(--accent); }
.btn:active { transform: translateY(0); }

/* ---------- Главный экран: общее ---------- */
.hero { position: relative; display: grid; gap: clamp(32px, 5vw, 80px); padding: clamp(16px, 3vw, 40px) 0 clamp(64px, 8vw, 112px); }
.hero-copy { display: grid; gap: 24px; justify-items: start; align-content: end; position: relative; z-index: 2; }
.hero-copy .lead { max-width: 54ch; }
.hero-media { position: relative; min-width: 0; }

/* Смена фото: растворение и медленный наплыв */
.fader { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--fill); }
.fader:focus-visible { outline-offset: 4px; }
.fade-slide { position: absolute; inset: 0; overflow: hidden; opacity: 0; transition: opacity 1.1s cubic-bezier(.4, 0, .2, 1); }
.fade-slide.on { opacity: 1; }
.fade-slide > img.cover { width: 100%; height: 100%; object-fit: cover; }
.fade-slide > img.cropped { position: absolute; max-width: none; }
.fade-slide > img { transform-origin: 50% 60%; }
.fade-slide.on > img { animation: drift var(--fade-interval, 8s) ease-out both; }
@keyframes drift { from { transform: scale(1.07); } to { transform: scale(1); } }
.fader-nav { position: absolute; right: 16px; bottom: 16px; z-index: 3; display: flex; align-items: center; gap: 6px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .86); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); font-size: 12px; font-variant-numeric: tabular-nums; color: var(--ink); }
.fader-nav .icon-btn { width: 32px; height: 32px; border: 0; background: transparent; }
.fader-nav .icon-btn:hover { background: rgba(0, 0, 0, .06); }
.fader-count { min-width: 34px; text-align: center; }
.fader-bar { position: absolute; left: 16px; bottom: 30px; z-index: 3; display: flex; gap: 6px; }
.fader-bar span { width: 28px; height: 2px; border-radius: 1px; background: rgba(255, 255, 255, .45); overflow: hidden; }
.fader-bar span.done i, .fader-bar span.on i { display: block; height: 100%; background: #fff; }
.fader-bar span.on i { transform-origin: left; animation: progress var(--fade-interval, 6s) linear both; }
.fader:not(.auto) .fader-bar span.on i { animation: none; }
.fader.paused .fader-bar span.on i { animation-play-state: paused; }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* 1. Фото справа */
.hero-split { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: end; }

/* 2–4. На всю ширину экрана */
.hero-bleed { margin-inline: calc(50% - 50vw); width: 100vw; padding: 0; gap: 0; grid-template-columns: 1fr; margin-bottom: clamp(56px, 7vw, 96px); }
.hero-bleed > * { grid-area: 1 / 1; }
.hero-bleed .fader { border-radius: 0; height: clamp(520px, 78vh, 860px); }
.hero-bleed.h-l .fader { height: clamp(560px, calc(100vh - 80px), 1000px); }
.hero-bleed .hero-media::after { content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.hero-bleed .hero-copy { align-self: end; width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter) clamp(40px, 6vw, 88px); color: #fff; }
.hero-bleed .lead { color: rgba(255, 255, 255, .88); }
.hero-bleed .display { text-shadow: 0 1px 30px rgba(0, 0, 0, .18); }
.hero-bleed .hero-actions .btn:not(.btn-primary):not(.btn-link) { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .55); color: #fff; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.hero-bleed .hero-actions .btn:not(.btn-primary):hover { background: rgba(255, 255, 255, .26); border-color: #fff; }
.hero-bleed .hero-actions .btn-link { color: #fff; text-decoration-color: rgba(255, 255, 255, .5); }
.hero-bleed .fader-bar { left: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); bottom: 24px; }
.hero-bleed .fader-nav { right: max(var(--gutter), calc((100% - var(--max)) / 2 + var(--gutter))); bottom: 20px; }
.hero-bleed .hero-copy { padding-bottom: clamp(64px, 7vw, 104px); }

/* 2. Текст на фото: градиент снизу, без плашки */
.hero-cover .hero-media::after { background: linear-gradient(to top, rgba(14, 16, 18, calc(var(--overlay) + .25)) 0%, rgba(14, 16, 18, var(--overlay)) 32%, rgba(14, 16, 18, 0) 68%); }
.hero-cover .hero-copy > * { max-width: 780px; }

/* 3. Стеклянная плашка */
.hero-glass .hero-media::after { background: rgba(14, 16, 18, calc(var(--overlay) * .5)); }
.hero-glass .hero-copy { padding-bottom: clamp(64px, 7vw, 104px); }
.hero-glass .hero-copy > .glass-wrap, .hero-glass .hero-copy { --glass: rgba(255, 255, 255, .16); }
.hero-glass .hero-copy { justify-items: start; }
.hero-glass .hero-copy::before { content: ''; position: absolute; z-index: -1; left: var(--gutter); bottom: clamp(40px, 5vw, 76px); width: min(680px, calc(100% - 2 * var(--gutter))); top: calc(-1 * clamp(28px, 3vw, 40px));
  border-radius: var(--r-lg); background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .28); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); }
.hero-glass .hero-copy > * { max-width: min(600px, calc(100vw - 4 * var(--gutter))); margin-left: clamp(24px, 3vw, 40px); }
.hero-glass .display { font-size: clamp(34px, 4.4vw, 60px); }

/* 4. По центру */
.hero-center .hero-media::after { background: rgba(14, 16, 18, var(--overlay)); }
.hero-center .hero-copy { align-self: center; justify-items: center; text-align: center; padding-bottom: 0; }
.hero-center .hero-copy > * { max-width: 900px; }
.hero-center .lead { margin-inline: auto; }
.hero-center .hero-actions { justify-content: center; }

/* 5. Журнальный: крупный заголовок, затем широкое фото */
.hero-editorial { grid-template-columns: 1fr; gap: clamp(28px, 4vw, 48px); }
.hero-editorial .hero-copy { grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); align-items: end; gap: 20px 56px; }
.hero-editorial .display { font-size: clamp(44px, 7.4vw, 116px); line-height: .96; letter-spacing: -.04em; grid-row: span 2; }
.hero-editorial .lead { align-self: end; }
.hero-editorial .hero-actions { align-self: start; }

/* 6. Мозаика */
.hero-mosaic { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); align-items: center; }
.hero-mosaic .hero-media { order: 2; display: grid; gap: 14px; grid-template-columns: 1.35fr 1fr; grid-template-rows: auto auto; }
.hero-mosaic .tile { border-radius: var(--r-lg); }
.hero-mosaic .t0 { grid-row: span 2; aspect-ratio: auto; height: 100%; min-height: 360px; }
.hero-mosaic .t0 > img.cropped { width: 100% !important; height: 100% !important; left: 0 !important; top: 0 !important; object-fit: cover; }
.hero-mosaic.m2 .hero-media { grid-template-columns: 1.2fr 1fr; }
.hero-mosaic.m2 .t1 { align-self: end; margin-bottom: 15%; }
.hero-mosaic .t1 { transform: translateY(-18px); }
.hero-mosaic .t2 { transform: translateY(18px); }

/* 7. Только текст */
.hero-text { grid-template-columns: minmax(0, 960px); padding-top: clamp(40px, 7vw, 120px); }
.hero-text .display { font-size: clamp(44px, 6.6vw, 104px); line-height: .98; letter-spacing: -.04em; }

/* Появление главного экрана (один раз при открытии) */
.hero.intro .hero-copy > * { animation: rise .9s cubic-bezier(.2, .7, .2, 1) both; }
.hero.intro .hero-copy > :nth-child(2) { animation-delay: .12s; }
.hero.intro .hero-copy > :nth-child(3) { animation-delay: .22s; }
.hero.intro .hero-media { animation: unveil 1.2s cubic-bezier(.2, .7, .2, 1) both; }
.hero.intro.hero-bleed .hero-media { animation: fadein 1.2s ease-out both; }
.hero.intro .tile.t1 { animation: rise 1s .15s cubic-bezier(.2, .7, .2, 1) both; }
.hero.intro .tile.t2 { animation: rise 1s .28s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(22px); } }
@keyframes unveil { from { opacity: 0; clip-path: inset(8% 0 0 0 round var(--r-lg)); transform: translateY(12px); } to { clip-path: inset(0 0 0 0 round var(--r-lg)); } }
@keyframes fadein { from { opacity: 0; } }

/* Появление при прокрутке */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms), transform .8s cubic-bezier(.2, .7, .2, 1) var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* Карточки: размерная линия как на чертеже, мягкий наплыв фото */
.card { gap: 14px; }
.card-media .frame > img, .card-media .slide > img { transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.card:hover .card-media .frame > img.cover, .card:hover .card-media .slide.frame > img.cover { transform: scale(1.04); }
.dim { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.dim::before, .dim::after { content: ''; flex: 1; height: 9px; background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat; opacity: .55; }
.dim::before { border-left: 1px solid; }
.dim::after { border-right: 1px solid; }
.card .dim { margin-top: -4px; }
.wide-dim { font-size: 13px; }
.card-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.card-area { font-size: 14px; color: var(--ink-2); }
.price-from { font: 400 22px/1.2 var(--display); letter-spacing: -.01em; white-space: nowrap; }
.price-from small { font: 400 13px Inter, sans-serif; color: var(--muted); letter-spacing: 0; }
.card-body { gap: 8px; }

/* Переходы между экранами (View Transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .38s; animation-timing-function: cubic-bezier(.2, .7, .2, 1); }
::view-transition-new(root) { animation-name: vt-in; }
::view-transition-old(root) { animation-name: vt-out; }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes vt-out { to { opacity: 0; } }

/* Калькулятор: отклик выбора */
.option.selected .checkmark svg, .choice.selected input { animation: pop .28s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { from { transform: scale(.4); } }
.option, .choice { transition: border-color .2s, box-shadow .2s, transform .2s; }
.option:hover, .choice:hover { box-shadow: 0 4px 14px -10px rgba(35, 38, 43, .35); }
.steps li { transition: border-color .4s, color .4s; }
.summary-total { transition: color .3s; }

/* Выбор варианта главного экрана в кабинете */
.layout-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; }
.lp { position: relative; display: grid; gap: 8px; cursor: pointer; }
.lp input { position: absolute; opacity: 0; pointer-events: none; }
.lp-name { font-size: 13px; color: var(--ink-2); }
.lp input:checked ~ .lp-name { color: var(--ink); font-weight: 500; }
.lp-art { position: relative; display: block; aspect-ratio: 16 / 10; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.lp:hover .lp-art { border-color: var(--muted); }
.lp input:checked + .lp-art { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.lp input:focus-visible + .lp-art { outline: 2px solid var(--accent); outline-offset: 2px; }
.lp-art i, .lp-art b, .lp-art u { position: absolute; display: block; }
.lp-art i { background: linear-gradient(135deg, #b9c2b4, #8d9a88); border-radius: 3px; }
.lp-art i:nth-of-type(2), .lp-art i:nth-of-type(3) { display: none; }
.lp-art b { height: 5px; border-radius: 2px; background: var(--ink); }
.lp-art b + b { height: 3px; background: var(--muted); opacity: .6; }
.lp-art u { width: 18%; height: 7px; border-radius: 2px; background: var(--accent); }
.lp-split i { right: 8%; top: 14%; width: 46%; height: 72%; }
.lp-split b { left: 8%; top: 46%; width: 34%; } .lp-split b + b { top: 58%; width: 28%; } .lp-split u { left: 8%; top: 70%; }
.lp-cover i, .lp-glass i, .lp-center i { inset: 0; border-radius: 0; }
.lp-cover::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(0, 0, 0, .45)); }
.lp-cover b, .lp-cover u, .lp-glass b, .lp-glass u, .lp-center b, .lp-center u { z-index: 1; }
.lp-cover b { left: 8%; top: 60%; width: 46%; background: #fff; } .lp-cover b + b { top: 72%; width: 36%; background: #fff; } .lp-cover u { left: 8%; top: 82%; }
.lp-glass::after { content: ''; position: absolute; left: 6%; top: 44%; width: 52%; height: 46%; border-radius: 4px; background: rgba(255, 255, 255, .3); border: 1px solid rgba(255, 255, 255, .55); }
.lp-glass b { left: 11%; top: 54%; width: 38%; background: #fff; } .lp-glass b + b { top: 65%; width: 30%; background: #fff; } .lp-glass u { left: 11%; top: 76%; }
.lp-center::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .35); }
.lp-center b { left: 25%; top: 40%; width: 50%; background: #fff; } .lp-center b + b { left: 32%; top: 52%; width: 36%; background: #fff; } .lp-center u { left: 41%; top: 64%; }
.lp-editorial b { left: 8%; top: 12%; width: 60%; height: 9px; } .lp-editorial b + b { left: 72%; top: 14%; width: 20%; height: 3px; } .lp-editorial u { display: none; }
.lp-editorial i { left: 8%; right: 8%; top: 34%; bottom: 10%; }
.lp-mosaic i { right: 32%; top: 14%; width: 28%; height: 72%; }
.lp-mosaic i:nth-of-type(2) { display: block; right: 8%; top: 10%; width: 21%; height: 36%; }
.lp-mosaic i:nth-of-type(3) { display: block; right: 8%; top: 52%; width: 21%; height: 36%; }
.lp-mosaic b { left: 8%; top: 46%; width: 26%; } .lp-mosaic b + b { top: 58%; width: 20%; } .lp-mosaic u { left: 8%; top: 70%; }
.lp-text i { display: none; }
.lp-text b { left: 10%; top: 32%; width: 66%; height: 9px; } .lp-text b + b { top: 52%; width: 48%; height: 3px; } .lp-text u { left: 10%; top: 66%; }

@media (max-width: 860px) {
  .hero-split, .hero-mosaic, .hero-text { grid-template-columns: 1fr; }
  .hero-split .hero-media { order: -1; }
  .hero-mosaic .hero-media { order: -1; }
  .hero-mosaic .t0 { min-height: 240px; }
  .hero-editorial .hero-copy { grid-template-columns: 1fr; }
  .hero-editorial .display { grid-row: auto; }
  .hero-bleed .fader { height: clamp(520px, 86svh, 760px); }
  .hero-glass .hero-copy::before { left: 12px; width: calc(100% - 24px); }
  .hero-glass .hero-copy > * { margin-left: 16px; max-width: calc(100vw - 64px); }
  .fader-nav { display: none; }
  .hero-bleed .fader-bar { left: var(--gutter); bottom: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; }
  .fade-slide.on > img { animation: none; }
}

/* ================= Каталог PDF ================= */
.catalog-link { margin-left: 14px; color: var(--ink); }
.theme-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.tp { position: relative; display: grid; gap: 8px; cursor: pointer; }
.tp input { position: absolute; opacity: 0; pointer-events: none; }
.tp input:checked ~ .lp-name { color: var(--ink); font-weight: 500; }
.tp-art { position: relative; display: block; aspect-ratio: 210 / 297; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; background: #fff; transition: border-color .2s, box-shadow .2s, transform .25s; }
.tp:hover .tp-art { border-color: var(--muted); }
.tp input:checked + .tp-art { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent), 0 8px 20px -12px rgba(0, 0, 0, .3); }
.tp input:focus-visible + .tp-art { outline: 2px solid var(--accent); outline-offset: 2px; }
.tp-art i, .tp-art b, .tp-art u { position: absolute; display: block; }
.tp-art i { left: 10%; right: 10%; top: 8%; height: 34%; background: linear-gradient(135deg, #b9c2b4, #7f8d7a); border-radius: 2px; }
.tp-art b { left: 10%; top: 48%; width: 50%; height: 5px; border-radius: 1px; background: #23262b; }
.tp-art b + b { top: 54%; width: 34%; height: 3px; background: #9a9c9f; }
.tp-art u { left: 10%; right: 10%; top: 62%; bottom: 10%; background: repeating-linear-gradient(#e2e2de 0 1px, transparent 1px 7px); }
.tp-blueprint { background-color: #f5f3ee; background-image: linear-gradient(rgba(60,70,80,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(60,70,80,.08) 1px, transparent 1px); background-size: 8px 8px; }
.tp-blueprint::after { content: ''; position: absolute; inset: 5%; border: 1px solid rgba(40,45,50,.4); }
.tp-blueprint i { border-radius: 0; filter: saturate(.7); }
.tp-dark { background: #17191c; }
.tp-dark b { background: #efede8; }
.tp-dark u { background: repeating-linear-gradient(#33363b 0 1px, transparent 1px 7px); }
.tp-editorial i { left: 0; right: 0; top: 30%; height: 38%; border-radius: 0; }
.tp-editorial b { top: 9%; width: 70%; height: 9px; }
.tp-editorial b + b { top: 20%; }
.tp-editorial u { top: 74%; }
.catalog-preview { display: grid; gap: 10px; }
.cp-frame { width: 100%; height: 520px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-lg); background: #d9d9d5; }
.cp-frame iframe { width: 200%; height: 200%; border: 0; transform: scale(.5); transform-origin: 0 0; }
@media (min-width: 1360px) {
  .catalog-layout { grid-template-columns: minmax(0, 1fr) 420px; }
  .catalog-preview { position: sticky; top: 24px; }
  .cp-frame { height: calc(100vh - 90px); }
}

/* ================= 1.5: каталог-редактор, статистика, уведомления, документы ================= */
.tabs { margin-bottom: 4px; justify-self: start; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pick { position: relative; padding: 0; border: 2px solid transparent; border-radius: 8px; background: none; overflow: hidden; }
.pick .frame { border-radius: 6px; }
.pick.on { border-color: var(--accent); }
.pick:hover { border-color: var(--line-2); }
.pick.on:hover { border-color: var(--accent); }
.pick-n { position: absolute; top: 6px; left: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 600; display: grid; place-items: center; }
.pdf-items { display: grid; gap: 2px; border-top: 1px solid var(--line); }
.pdf-item { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.pdf-item .thumb { width: 72px; border-radius: 4px; }
.pdf-item > div:nth-child(2) { display: grid; gap: 2px; }
.pdf-item.off { opacity: .55; }
.pdf-item .icon-btn { width: 32px; height: 32px; }
.pdf-item .icon-btn svg { transform: rotate(90deg); width: 16px; height: 16px; }
.pdf-item .actions { gap: 8px; }
.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.tp-light { background: #fff; }
.tp-warm { background: #f7f4ee; }
.tp-warm u { background: repeating-linear-gradient(#ddd8ce 0 1px, transparent 1px 7px); }
.chip { display: inline-block; margin: 2px 0; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--surface); font-size: 12px; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--ink); }
.example-doc { max-height: 52vh; overflow: auto; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--r); background: #fbfbfa; white-space: pre-wrap; font-size: 13.5px; line-height: 1.6; color: var(--ink-2); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 24px; }
.chart { display: flex; align-items: flex-end; gap: 2px; height: 200px; padding-bottom: 22px; position: relative; border-bottom: 1px solid var(--line); }
.chart .bar { position: relative; flex: 1; height: 100%; display: flex; align-items: flex-end; }
.chart .bar i { display: block; width: 100%; min-height: 1px; border-radius: 3px 3px 0 0; background: color-mix(in srgb, var(--accent) 70%, transparent); transition: height .6s cubic-bezier(.2, .7, .2, 1); }
.chart .bar:hover i { background: var(--accent); }
.chart .bar b { position: absolute; left: 50%; transform: translate(-50%, -4px); font-size: 11px; font-weight: 600; color: var(--ok); }
.chart .bar span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 6px 0 0; vertical-align: -1px; }
.key.v { background: var(--accent); }
.key.l { background: var(--ok); margin-left: 12px; }
.funnel { display: grid; gap: 14px; }
.funnel > div { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; font-size: 14px; }
.funnel b { font-variant-numeric: tabular-nums; }
.funnel i { grid-column: span 2; height: 8px; border-radius: 4px; background: var(--accent); }
.funnel small { grid-column: span 2; }
@media (max-width: 640px) { .pdf-item { grid-template-columns: 56px minmax(0, 1fr); } .pdf-item .actions { grid-column: span 2; } .pdf-item .thumb { width: 56px; } }

/* 1.6 — параметры проекта и регионы */
.warn-text{color:var(--danger)}
.region-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:2px 16px;max-height:280px;overflow:auto;padding:10px 12px;border:1px solid var(--line);border-radius:var(--r-sm);margin-top:0}
.region-list .check{margin:0;padding:4px 0}
.region-list label[hidden]{display:none}
#regions-box .search{margin-top:6px}
