/* =========================================================
   Макетинг — дизайн-система
   Чертёжная эстетика: бумага, графит, сигнальный оранжевый,
   синие размерные линии. Светлая и тёмная темы.
   ========================================================= */

@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap;
  src: url("../fonts/manrope-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("../fonts/jetbrains-mono-cyrillic-wght-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url("../fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2212, U+00D7; }

:root {
  --bg: #f4f1ea;
  --bg-2: #ebe6da;
  --surface: #fffdf8;
  --surface-2: #f7f3ea;
  --ink: #1a1c1e;
  --ink-2: #4a4f56;
  --ink-3: #7b7f85;
  --line: #ddd5c6;
  --line-2: #c7bdaa;
  --accent: #e0521d;
  --accent-hover: #c94512;
  --accent-ink: #ffffff;
  --accent-soft: #fbe2d4;
  --blue: #2457c5;
  --blue-soft: #dfe7f8;
  --ok: #2b7a4b;
  --ok-soft: #dcefe2;
  --warn: #9a6208;
  --warn-soft: #f9ecd0;
  --danger: #b3261e;
  --danger-soft: #f8dcd8;
  --grid: rgba(36, 87, 197, 0.075);
  --grid-strong: rgba(36, 87, 197, 0.14);
  --shadow: 0 1px 0 rgba(26, 28, 30, 0.04), 0 8px 24px -12px rgba(26, 28, 30, 0.18);
  --shadow-hard: 4px 4px 0 rgba(26, 28, 30, 0.9);
  --plan-floor: #efe6d2;
  --plan-wall: #2b2e33;
  --plan-board-a: #d9b98a;
  --plan-board-b: #cfa874;
  --plan-board-line: #9c7444;

  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --r: 6px;
  --r-lg: 10px;
  --wrap: 1240px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121416; --bg-2: #17191c; --surface: #1b1e22; --surface-2: #22262b;
    --ink: #ece8e0; --ink-2: #b8b4ad; --ink-3: #8c8984; --line: #2c3136; --line-2: #3b4148;
    --accent: #ff6a33; --accent-hover: #ff8155; --accent-ink: #1a0f0a; --accent-soft: rgba(255, 106, 51, .15);
    --blue: #86a9ff; --blue-soft: rgba(134, 169, 255, .14);
    --ok: #6cc795; --ok-soft: rgba(108, 199, 149, .13); --warn: #f0b74e; --warn-soft: rgba(240, 183, 78, .13);
    --danger: #ff8a80; --danger-soft: rgba(255, 138, 128, .13);
    --grid: rgba(134, 169, 255, .06); --grid-strong: rgba(134, 169, 255, .12);
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
    --shadow-hard: 4px 4px 0 rgba(255, 106, 51, .55);
    --plan-floor: #2a2620; --plan-wall: #d9d4ca; --plan-board-a: #6e5537; --plan-board-b: #634b2f; --plan-board-line: #3a2c1c;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121416; --bg-2: #17191c; --surface: #1b1e22; --surface-2: #22262b;
  --ink: #ece8e0; --ink-2: #b8b4ad; --ink-3: #8c8984; --line: #2c3136; --line-2: #3b4148;
  --accent: #ff6a33; --accent-hover: #ff8155; --accent-ink: #1a0f0a; --accent-soft: rgba(255, 106, 51, .15);
  --blue: #86a9ff; --blue-soft: rgba(134, 169, 255, .14);
  --ok: #6cc795; --ok-soft: rgba(108, 199, 149, .13); --warn: #f0b74e; --warn-soft: rgba(240, 183, 78, .13);
  --danger: #ff8a80; --danger-soft: rgba(255, 138, 128, .13);
  --grid: rgba(134, 169, 255, .06); --grid-strong: rgba(134, 169, 255, .12);
  --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 30px -12px rgba(0, 0, 0, .6);
  --shadow-hard: 4px 4px 0 rgba(255, 106, 51, .55);
  --plan-floor: #2a2620; --plan-wall: #d9d4ca; --plan-board-a: #6e5537; --plan-board-b: #634b2f; --plan-board-line: #3a2c1c;
  color-scheme: dark;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.55 var(--font); font-feature-settings: "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  min-height: 100vh; display: flex; flex-direction: column;
}
main { flex: 1 0 auto; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(30px, 4.4vw, 52px); letter-spacing: -0.035em; }
h2 { font-size: clamp(22px, 2.6vw, 32px); }
h3 { font-size: 19px; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.mono, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent-soft); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 28px; } }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 14px; }
.tiny { font-size: 12.5px; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.hidden { display: none !important; }

/* ---------- Иконки (файлы в /assets/icons, цвет — из темы) ---------- */
.ic {
  display: inline-block; width: 20px; height: 20px; flex: none; vertical-align: -4px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat; mask: var(--icon) center / contain no-repeat;
}
.ic.sm { width: 16px; height: 16px; vertical-align: -3px; }
.ic.lg { width: 28px; height: 28px; }
.ic.xl { width: 40px; height: 40px; }

/* ---------- Кнопки ---------- */
.btn {
  --b: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid var(--b); background: var(--surface); color: var(--ink);
  font: 600 15px/1 var(--font); text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .12s var(--ease), box-shadow .15s var(--ease), background .15s, border-color .15s, color .15s;
}
.btn:hover { color: var(--ink); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.btn:active { transform: translate(1px, 1px); box-shadow: 0 0 0 var(--ink); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--ink); color: var(--accent-ink); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); border-color: var(--line-2); box-shadow: none; transform: none; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); box-shadow: 3px 3px 0 var(--danger); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn.icon { width: 44px; padding: 0; }
.btn.icon.sm { width: 34px; }
.btn.block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .55; pointer-events: none; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -0.03em; text-decoration: none; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo-mark {
  position: relative; width: 30px; height: 30px; border: 2px solid var(--ink); border-radius: 4px;
  display: grid; place-items: center; font: 700 11px/1 var(--mono); transition: transform .3s var(--ease);
}
.logo-mark::after { content: ""; position: absolute; right: -6px; bottom: -6px; width: 10px; height: 10px; background: var(--accent); border-radius: 2px; }
.logo:hover .logo-mark { transform: rotate(-6deg); }
.nav { display: flex; align-items: center; gap: 2px; margin-left: 12px; }
.nav a, .nav button.nav-link {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--r);
  text-decoration: none; color: var(--ink-2); font: 500 15px/1 var(--font); background: none; border: 0; cursor: pointer;
}
.nav a:hover, .nav button.nav-link:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--surface-2); }
.nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--r) var(--r) 0 0; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font: 700 11px/1 var(--mono); }

/* Поиск */
.search { position: relative; }
.search input {
  width: 240px; height: 40px; padding: 0 12px 0 36px; border-radius: var(--r);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 15px var(--font);
  transition: border-color .15s, width .25s var(--ease), box-shadow .15s;
}
.search input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); width: 300px; }
.search > .ic { position: absolute; left: 11px; top: 10px; color: var(--ink-3); pointer-events: none; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; min-width: 300px; z-index: 60;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 6px;
}
.search-results a { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: var(--r); text-decoration: none; }
.search-results a:hover, .search-results a.is-active { background: var(--surface-2); color: var(--ink); }
.search-results .hint { padding: 8px 10px; font-size: 13px; color: var(--ink-3); border-top: 1px dashed var(--line); margin-top: 4px; }

/* Мега-меню калькуляторов */
.mega { position: relative; }
.mega-panel {
  position: absolute; top: calc(100% + 10px); left: -12px; width: min(720px, 92vw); z-index: 60;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  opacity: 0; visibility: hidden; transform: translateY(-6px); transition: opacity .18s, transform .18s var(--ease), visibility .18s;
}
.mega.is-open .mega-panel { opacity: 1; visibility: visible; transform: none; }
.mega-panel h4 { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 4px 0 10px; }
.mega-panel a { display: flex; gap: 10px; align-items: center; padding: 8px; margin: 0 -8px; border-radius: var(--r); text-decoration: none; font-weight: 500; }
.mega-panel a:hover { background: var(--surface-2); color: var(--accent); }
.mega-panel a:hover .ic { transform: translateX(2px); }
.mega-panel .ic { transition: transform .2s var(--ease); }

/* Мобильное меню */
.burger { display: none; }
.mobile-nav { display: none; }
@media (max-width: 960px) {
  .nav, .search.desktop { display: none; }
  .burger { display: inline-flex; }
  .mobile-nav {
    position: fixed; inset: 64px 0 0; z-index: 49; background: var(--bg); overflow-y: auto; padding: 16px 16px 40px;
    display: block; transform: translateX(100%); transition: transform .25s var(--ease); visibility: hidden;
  }
  .mobile-nav.is-open { transform: none; visibility: visible; }
  .mobile-nav a { display: flex; align-items: center; gap: 12px; padding: 14px 4px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 17px; }
  .mobile-nav h4 { margin: 22px 0 4px; font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
  .mobile-nav .search input { width: 100%; }
}

/* Переключатель темы */
.theme-toggle .ic { transition: transform .4s var(--ease); }
.theme-toggle:hover .ic { transform: rotate(40deg); }

/* ---------- Подвал ---------- */
.site-footer { margin-top: 80px; border-top: 1px solid var(--line); background: var(--bg-2); padding: 40px 0 28px; font-size: 14px; color: var(--ink-2); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(4, 1fr); gap: 24px; }
.footer-grid h4 { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin-bottom: 12px; }
.footer-grid a { display: block; padding: 3px 0; text-decoration: none; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Сетка чертежа (фон) ---------- */
.blueprint {
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--grid-strong) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-strong) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
  background-position: -1px -1px;
}

/* ---------- Главная ---------- */
.hero { padding: 56px 0 64px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: 8px; font: 600 12.5px/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; }
.hero .eyebrow::before { content: ""; width: 24px; height: 2px; background: currentColor; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--accent-soft) 62%); }
.hero .lead { font-size: 19px; color: var(--ink-2); max-width: 560px; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-figure { position: relative; }
.hero-figure svg { width: 100%; height: auto; overflow: visible; }
.hero-stats { display: flex; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.hero-stats div { border-left: 2px solid var(--accent); padding-left: 12px; }
.hero-stats b { display: block; font: 700 24px/1.1 var(--mono); }
.hero-stats span { font-size: 13.5px; color: var(--ink-2); }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } .hero { padding: 32px 0 40px; } .hero-figure { order: -1; max-width: 460px; } }

/* Анимация чертежа на главной */
.draw-line { stroke-dasharray: var(--len, 600); stroke-dashoffset: var(--len, 600); animation: draw 1.6s var(--ease) forwards; }
.draw-line.d2 { animation-delay: .35s; } .draw-line.d3 { animation-delay: .7s; } .draw-line.d4 { animation-delay: 1s; }
.fade-in { opacity: 0; animation: fade .6s var(--ease) forwards; animation-delay: 1.2s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .draw-line { stroke-dashoffset: 0; } .fade-in { opacity: 1; }
}

.section { padding: 56px 0 8px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.kicker { font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.kicker::after { content: ""; flex: 0 0 40px; height: 1px; background: var(--line-2); }

/* ---------- Карточки ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px;
}
.card.flat { box-shadow: none; }
.card-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; margin: 0 0 14px; }

.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.calc-card {
  position: relative; display: flex; flex-direction: column; gap: 10px; padding: 20px 20px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  text-decoration: none; color: var(--ink); min-height: 190px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.calc-card .ic-box {
  width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line); transition: background .2s, color .2s, border-color .2s;
}
.calc-card h3 { margin: 4px 0 0; font-size: 18px; }
.calc-card p { margin: 0; color: var(--ink-2); font-size: 14.5px; line-height: 1.5; }
.calc-card .go { margin-top: auto; display: inline-flex; gap: 6px; align-items: center; font: 600 13px/1 var(--mono); color: var(--ink-3); text-transform: uppercase; letter-spacing: .05em; }
/* размерная линия, которая «прорисовывается» при наведении */
.calc-card::after {
  content: ""; position: absolute; left: 20px; right: 20px; bottom: -1px; height: 2px; background: var(--accent);
  transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease);
}
.calc-card::before {
  content: ""; position: absolute; top: 12px; right: 12px; width: 12px; height: 12px;
  border-top: 2px solid var(--accent); border-right: 2px solid var(--accent); opacity: 0; transform: translate(-4px, 4px);
  transition: opacity .2s, transform .25s var(--ease);
}
.calc-card:hover { color: var(--ink); border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: var(--shadow-hard); }
.calc-card:hover::after { transform: scaleX(1); }
.calc-card:hover::before { opacity: 1; transform: none; }
.calc-card:hover .ic-box { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.calc-card:hover .go { color: var(--accent); }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.steps .card { position: relative; padding-top: 44px; }
.steps .card::before {
  counter-increment: step; content: "0" counter(step); position: absolute; top: 16px; left: 20px;
  font: 700 13px/1 var(--mono); color: var(--accent); letter-spacing: .05em;
}
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

.feature-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 28px; margin: 0; padding: 0; list-style: none; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; }
.feature-list .ic { color: var(--ok); margin-top: 2px; }
@media (max-width: 700px) { .feature-list { grid-template-columns: 1fr; } }

/* ---------- Формы ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .field-label { font-size: 14px; font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.field .help-btn { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line-2); background: none; color: var(--ink-3); font: 700 11px/1 var(--mono); cursor: help; padding: 0; display: inline-grid; place-items: center; }
.field .help-btn:hover, .field .help-btn[aria-expanded="true"] { border-color: var(--blue); color: var(--blue); }
.field .help { font-size: 13px; color: var(--ink-2); background: var(--blue-soft); border-left: 2px solid var(--blue); padding: 8px 10px; border-radius: 0 var(--r) var(--r) 0; }
.input-wrap { position: relative; display: flex; align-items: stretch; }
.input, select.input, textarea.input {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: var(--r);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  font: 500 16px/1.2 var(--font); transition: border-color .15s, box-shadow .15s, background .15s;
}
.input.num-input { font-family: var(--mono); font-variant-numeric: tabular-nums; }
textarea.input { min-height: 120px; line-height: 1.5; resize: vertical; }
.input:hover { border-color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input-wrap .unit {
  position: absolute; right: 1px; top: 1px; bottom: 1px; display: flex; align-items: center; padding: 0 10px;
  font: 500 13px/1 var(--mono); color: var(--ink-3); background: var(--surface-2); border-left: 1px solid var(--line);
  border-radius: 0 var(--r) var(--r) 0; pointer-events: none;
}
.input-wrap .unit + .input, .input-wrap .input:has(+ .unit) { padding-right: 60px; }
.input-wrap.has-unit .input { padding-right: 64px; }
.field.has-error .input { border-color: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.field .error, .error-text { color: var(--danger); font-size: 13px; }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 16px; }
.fields .field.wide { grid-column: 1 / -1; }

/* Сегментный переключатель */
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: var(--r); padding: 3px; gap: 3px; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 8px 12px; border-radius: 4px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .15s, color .15s, box-shadow .15s; }
.seg label:hover span { color: var(--ink); background: var(--surface); }
.seg input:checked + span { background: var(--ink); color: var(--bg); }
.seg input:focus-visible + span { outline: 2px solid var(--blue); outline-offset: 1px; }

/* Переключатель вкл/выкл */
.toggle { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; padding: 6px 0; }
.toggle input { position: absolute; opacity: 0; }
.toggle .track { flex: none; width: 42px; height: 24px; border-radius: 12px; background: var(--line-2); position: relative; transition: background .2s; margin-top: 1px; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(18px); }
.toggle input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 2px; }
.toggle .t-label { font-weight: 600; font-size: 15px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; accent-color: var(--accent); margin-top: 2px; flex: none; }

/* Список чисел (замеры) */
.numlist { display: flex; flex-wrap: wrap; gap: 8px; }
.numlist .chip { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); overflow: hidden; }
.numlist .chip input { width: 76px; height: 38px; border: 0; background: none; padding: 0 8px; font: 500 15px var(--mono); color: var(--ink); }
.numlist .chip input:focus { outline: none; background: var(--blue-soft); }
.numlist .chip button { height: 38px; width: 28px; border: 0; border-left: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3); cursor: pointer; }
.numlist .chip button:hover { color: var(--danger); }

/* ---------- Страница калькулятора ---------- */
.page-head { padding: 28px 0 22px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13.5px; color: var(--ink-3); margin-bottom: 14px; }
.crumbs a { text-decoration: none; color: var(--ink-2); }
.crumbs .ic { width: 14px; height: 14px; }
.page-head h1 { display: flex; align-items: center; gap: 14px; font-size: clamp(28px, 3.6vw, 42px); }
.page-head .lead { color: var(--ink-2); font-size: 17px; max-width: 760px; margin: 0; }
.context-bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 12px 16px; border: 1px dashed var(--blue); background: var(--blue-soft); border-radius: var(--r-lg); margin-bottom: 18px; font-size: 14.5px; }

.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 24px; align-items: start; }
.calc-form > .card + .card { margin-top: 16px; }
.calc-section summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 17px; }
.calc-section summary::-webkit-details-marker { display: none; }
.calc-section summary .ic { transition: transform .2s var(--ease); color: var(--ink-3); }
.calc-section[open] summary .ic { transform: rotate(180deg); }
.calc-section[open] summary { margin-bottom: 16px; }
.calc-section .note { font-size: 14px; color: var(--ink-2); }
.result-col { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 1080px) { .calc-layout { grid-template-columns: 1fr; } .result-col { position: static; } }

/* Результат */
.result { padding: 0; overflow: hidden; }
.result-main { padding: 20px; background: var(--ink); color: var(--bg); position: relative; }
.result-main .label { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; opacity: .7; }
.result-main .value { font: 700 54px/1 var(--mono); letter-spacing: -0.04em; margin: 10px 0 6px; display: flex; align-items: baseline; gap: 10px; }
.result-main .value small { font-size: 18px; font-weight: 600; opacity: .75; letter-spacing: 0; }
.result-main .hint { font-size: 14px; opacity: .8; }
.result-main::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--accent); }
.result.is-loading .result-main .value { opacity: .5; }
.result.is-loading .result-main::after { animation: loadbar 1s linear infinite; transform-origin: left; }
@keyframes loadbar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.result-tiles { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.result-tiles .tile { padding: 12px 16px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.result-tiles .tile:nth-child(2n) { border-right: 0; }
.result-tiles .tile .t { font-size: 12.5px; color: var(--ink-3); }
.result-tiles .tile .v { font: 600 19px/1.3 var(--mono); }
.result-tiles .tile .h { font-size: 12px; color: var(--ink-3); }
.result-body { padding: 16px 20px 20px; }
.result-body h4 { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); margin: 18px 0 10px; }
.result-body h4:first-child { margin-top: 0; }
.mat-list { list-style: none; margin: 0; padding: 0; }
.mat-list li { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); transition: background .15s; }
.mat-list li:last-child { border-bottom: 0; }
.mat-list li:hover { background: linear-gradient(90deg, transparent, var(--surface-2) 20%, var(--surface-2) 80%, transparent); }
.mat-list .n { font-weight: 600; font-size: 15px; }
.mat-list .q { font: 700 16px/1.3 var(--mono); text-align: right; white-space: nowrap; }
.mat-list .d { grid-column: 1 / -1; font-size: 12.5px; color: var(--ink-3); }
.alerts { display: flex; flex-direction: column; gap: 8px; }
.alert { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--r); font-size: 14px; line-height: 1.45; }
.alert .ic { flex: none; margin-top: 1px; }
.alert.warn { background: var(--warn-soft); color: var(--ink); } .alert.warn .ic { color: var(--warn); }
.alert.info { background: var(--blue-soft); } .alert.info .ic { color: var(--blue); }
.alert.ok { background: var(--ok-soft); } .alert.ok .ic { color: var(--ok); }
.alert.error { background: var(--danger-soft); } .alert.error .ic { color: var(--danger); }
.how summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--ink-2); padding: 6px 0; }
.how dl { margin: 8px 0 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13.5px; }
.how dt { color: var(--ink-3); }
.how dd { margin: 0; font-family: var(--mono); font-size: 12.5px; }
.result-actions { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; padding: 0 20px 20px; }

/* Нижняя панель результата на телефоне */
.mobile-result {
  display: none; position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 40;
  background: var(--ink); color: var(--bg); border-radius: var(--r-lg); padding: 10px 12px 10px 16px;
  align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.3);
  transform: translateY(140%); transition: transform .3s var(--ease);
}
.mobile-result.is-visible { transform: none; }
.mobile-result .v { font: 700 22px/1 var(--mono); }
.mobile-result .t { font-size: 12px; opacity: .7; }
.mobile-result .btn { margin-left: auto; min-height: 40px; }
@media (max-width: 1080px) { .mobile-result { display: flex; } }

/* ---------- Редактор помещения ---------- */
.room-editor { display: flex; flex-direction: column; gap: 14px; }
.editor-modes { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.editor-canvas {
  position: relative; border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden;
  height: 380px; touch-action: none; user-select: none; -webkit-user-select: none;
}
.editor-canvas svg { width: 100%; height: 100%; cursor: grab; }
.editor-canvas svg.is-panning { cursor: grabbing; }
.editor-canvas .toolbar {
  position: absolute; right: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px; box-shadow: var(--shadow);
}
.editor-canvas .toolbar button { width: 34px; height: 34px; border: 0; border-radius: 4px; background: none; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.editor-canvas .toolbar button:hover { background: var(--surface-2); color: var(--ink); }
.editor-canvas .hint { position: absolute; left: 10px; bottom: 8px; right: 60px; font-size: 12px; color: var(--ink-3); pointer-events: none; }
.editor-canvas .view-tabs { position: absolute; left: 10px; bottom: 10px; }
@media (max-width: 600px) { .editor-canvas .view-tabs span { padding: 6px 9px; font-size: 13px; } }
@media (max-width: 600px) { .editor-canvas { height: 300px; } .editor-canvas .hint { display: none; } }

/* SVG-элементы плана */
.plan-floor { fill: var(--plan-floor); }
.plan-wall { fill: none; stroke: var(--plan-wall); stroke-width: 3; vector-effect: non-scaling-stroke; }
.plan-wall-hit { stroke: transparent; stroke-width: 18; vector-effect: non-scaling-stroke; cursor: ew-resize; }
.plan-wall-hit.h { cursor: ns-resize; }
.plan-wall-hit:hover + .plan-wall-hl, .plan-wall-hl.is-active { stroke: var(--accent); opacity: 1; }
.plan-wall-hl { stroke: var(--accent); stroke-width: 5; opacity: 0; vector-effect: non-scaling-stroke; pointer-events: none; transition: opacity .15s; }
.plan-label { font-family: var(--font); font-weight: 600; fill: var(--ink-2); }
.plan-wall-name { font-family: var(--mono); font-weight: 700; fill: var(--bg); }
.plan-wall-badge { fill: var(--ink); }
.dim-line { stroke: var(--blue); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dim-text { font-family: var(--mono); font-weight: 600; fill: var(--blue); paint-order: stroke; stroke: var(--bg); stroke-linejoin: round; }
.feat { cursor: grab; }
.feat:focus { outline: none; }
.feat .shape { fill: var(--surface); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; transition: fill .15s, stroke .15s; }
.feat.door .shape { fill: var(--accent-soft); stroke: var(--accent); }
.feat.window .shape { fill: var(--blue-soft); stroke: var(--blue); }
.feat.niche .shape { fill: var(--plan-floor); stroke: var(--plan-wall); }
.feat.ledge .shape, .feat.column .shape { fill: var(--line-2); stroke: var(--plan-wall); }
.feat.partition .shape { fill: var(--plan-wall); stroke: var(--plan-wall); }
.part-len { fill: var(--ink-2); font-family: var(--mono, monospace); }
.feat .swing { fill: none; stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 3; vector-effect: non-scaling-stroke; }
.feat .casing { fill: var(--accent); opacity: .5; }
.feat .handle { fill: var(--surface); stroke: var(--blue); stroke-width: 1.5; vector-effect: non-scaling-stroke; cursor: ew-resize; opacity: 0; transition: opacity .15s; }
.feat .handle.ns { cursor: ns-resize; }
.feat .handle.nwse { cursor: nwse-resize; }
.feat:hover .shape, .feat.is-hover .shape { stroke-width: 2.5; filter: drop-shadow(0 0 0 var(--accent)); }
.feat:hover .handle, .feat.is-selected .handle, .feat:focus .handle { opacity: 1; }
.feat.is-selected .shape, .feat:focus .shape { stroke: var(--blue); stroke-width: 2.5; }
.corner-handle { fill: var(--accent); stroke: var(--surface); stroke-width: 2; vector-effect: non-scaling-stroke; cursor: nwse-resize; transition: r .15s; }
.corner-handle:hover { r: 9; }
.plan-board { fill: var(--plan-board-a); stroke: var(--plan-board-line); stroke-width: .6; vector-effect: non-scaling-stroke; }
.plan-board.alt { fill: var(--plan-board-b); }
.plan-tile { fill: none; stroke: var(--line-2); stroke-width: .8; vector-effect: non-scaling-stroke; }
.elev-wall { fill: var(--surface-2); stroke: var(--plan-wall); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.elev-open { stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.elev-open.door { fill: var(--accent-soft); stroke: var(--accent); }
.elev-open.window { fill: var(--blue-soft); stroke: var(--blue); }
.elev-strip { fill: none; stroke: var(--accent); stroke-width: .8; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.elev-strip-fill { fill: var(--accent-soft); opacity: .55; }
.elev-name { font-family: var(--font); font-weight: 600; fill: var(--ink-2); }

/* Список элементов под редактором */
.feat-add { display: flex; flex-wrap: wrap; gap: 8px; }
.feat-list { display: flex; flex-direction: column; gap: 8px; }
.feat-row {
  display: grid; grid-template-columns: 36px 1fr auto; gap: 10px; align-items: start;
  padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface);
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.feat-row.is-hover, .feat-row:hover { border-color: var(--ink-3); }
.feat-row.is-selected { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.feat-row .feat-ic { width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r); background: var(--surface-2); }
.feat-row .feat-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.feat-row .feat-fields .field > label { font-size: 12px; font-weight: 500; }
.feat-row .feat-fields .input { min-height: 36px; padding: 6px 8px; font-size: 14px; }
.feat-row .feat-fields .input-wrap.has-unit .input { padding-right: 38px; }
.feat-row .feat-fields .unit { padding: 0 6px; font-size: 11px; }
.feat-row .feat-title { grid-column: 2 / 3; font-weight: 600; font-size: 14px; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.feat-row .feat-flags { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; font-size: 13px; }
.feat-row .feat-flags .checkbox { font-size: 13px; }
.walls-list .feat-row { grid-template-columns: 36px 1fr auto; }
.dims { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .dims { grid-template-columns: 1fr 1fr; } }

/* Схема раскладки (результат) */
.schema svg { width: 100%; height: auto; max-height: 520px; }
.schema-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* ---------- Модальное окно ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10, 12, 14, .55); animation: fade .2s forwards; }
.modal-box {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-lg); padding: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.35); animation: pop .25s var(--ease);
}
.modal-box h3 { margin-bottom: 16px; }
.modal-close { position: absolute; right: 12px; top: 12px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- Таблицы ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font: 600 12px/1.2 var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); background: var(--surface-2); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--surface-2); }
.table td.num, .table th.num { text-align: right; font-family: var(--mono); white-space: nowrap; }
.table .price-input { width: 110px; min-height: 34px; padding: 4px 8px; text-align: right; font-family: var(--mono); }
.table tfoot td { font-weight: 700; background: var(--surface-2); }

/* ---------- Кабинет ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.tile-link {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: var(--ink);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.tile-link:hover { color: var(--ink); border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: var(--shadow-hard); }
.tile-link .meta { font-size: 13px; color: var(--ink-3); font-family: var(--mono); }
.tile-link.add { border-style: dashed; align-items: center; justify-content: center; color: var(--ink-2); min-height: 110px; }
.tile-link.add:hover { color: var(--accent); border-color: var(--accent); box-shadow: none; transform: none; }
.status { padding: 12px 16px; border-radius: var(--r); background: var(--ok-soft); border-left: 3px solid var(--ok); margin-bottom: 18px; }
.guest-note { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; padding: 14px 18px; border: 1px dashed var(--accent); border-radius: var(--r-lg); background: var(--accent-soft); margin-bottom: 22px; }
.empty { text-align: center; padding: 40px 20px; color: var(--ink-2); border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.empty .ic { margin: 0 auto 12px; color: var(--ink-3); }

/* ---------- Авторизация ---------- */
.auth { display: grid; place-items: center; padding: 48px 16px; }
.auth .card { width: 100%; max-width: 440px; padding: 28px; }
.auth h1 { font-size: 30px; }
.auth form > * + * { margin-top: 16px; }
.hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Статьи ---------- */
.prose { font-size: 17.5px; line-height: 1.7; max-width: 720px; }
.prose h2 { margin: 1.6em 0 .6em; font-size: 26px; }
.prose h3 { margin: 1.4em 0 .5em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose blockquote { margin: 1.2em 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--surface); border-radius: 0 var(--r) var(--r) 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: 15px; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: 2px 5px; border-radius: 4px; }
.article-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); text-decoration: none; color: var(--ink); transition: border-color .2s, transform .2s var(--ease); }
.article-card:hover { color: var(--ink); border-color: var(--ink); transform: translateY(-2px); }
.article-card .meta { font: 500 12.5px/1 var(--mono); color: var(--ink-3); }

/* ---------- Подбор цвета ---------- */
.color-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 960px) { .color-layout { grid-template-columns: 1fr; } }
.swatch-pick { display: grid; grid-template-columns: 48px 1fr auto; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.swatch-pick .sw { width: 48px; height: 48px; border-radius: var(--r); border: 1px solid var(--line-2); position: relative; overflow: hidden; }
.swatch-pick input[type="color"] { position: absolute; inset: -8px; width: calc(100% + 16px); height: calc(100% + 16px); border: 0; padding: 0; cursor: pointer; background: none; }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.chip-color {
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); cursor: pointer;
  text-align: left; padding: 0; font: inherit; color: var(--ink); transition: transform .15s var(--ease), box-shadow .15s, border-color .15s;
}
.chip-color:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 3px 3px 0 var(--ink); }
.chip-color .c { height: 74px; position: relative; }
.chip-color .c .why { position: absolute; left: 6px; bottom: 6px; font: 600 10.5px/1 var(--mono); padding: 3px 5px; border-radius: 3px; background: rgba(255,255,255,.85); color: #222; }
.chip-color .m { padding: 7px 9px; font-size: 12.5px; line-height: 1.3; }
.chip-color .m b { display: block; font-size: 13px; }
.chip-color .m span { font-family: var(--mono); color: var(--ink-3); font-size: 11.5px; }
.room-preview { border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; }
.room-preview svg { width: 100%; height: auto; }
.wood-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.wood-card .c { height: 64px; }

/* ---------- Админка ---------- */
.admin-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding-top: 24px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 84px; align-self: start; }
.admin-nav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: var(--r); text-decoration: none; color: var(--ink-2); font-weight: 500; }
.admin-nav a:hover { background: var(--surface); color: var(--ink); }
.admin-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.stat .v { font: 700 30px/1.1 var(--mono); }
.stat .t { font-size: 13px; color: var(--ink-3); }
.bars { display: flex; flex-direction: column; gap: 8px; }
.bars .bar { display: grid; grid-template-columns: 160px 1fr 60px; gap: 10px; align-items: center; font-size: 14px; }
.bars .bar .track { height: 10px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bars .bar .fill { display: block; width: 0; height: 100%; background: var(--accent); border-radius: 5px; transform-origin: left; animation: grow .8s var(--ease); }
@keyframes grow { from { transform: scaleX(0); } }
.pill { display: inline-block; padding: 3px 8px; border-radius: 10px; font: 600 11.5px/1.3 var(--mono); background: var(--surface-2); color: var(--ink-2); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; } }
.pagination { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; font-family: var(--mono); font-size: 14px; }
.pagination .is-current { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 150%); z-index: 120;
  background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: var(--r-lg); box-shadow: var(--shadow);
  display: flex; gap: 10px; align-items: center; font-size: 15px; max-width: calc(100vw - 32px);
  transform: translate(-50%, calc(100% + 40px)); opacity: 0; visibility: hidden;
  transition: transform .3s var(--ease), opacity .3s, visibility .3s;
}
.toast.is-visible { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast a { color: var(--accent); }

/* ---------- Печать ---------- */
.print-only { display: none; }
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f4f4f4; --ink: #000; --line: #ccc; }
  .site-header, .site-footer, .no-print, .mobile-result, .result-actions, .toast { display: none !important; }
  .print-only { display: block; }
  body { font-size: 12pt; }
  .card { border: 1px solid #ccc; break-inside: avoid; }
  a { text-decoration: none; }
  .wrap { max-width: none; padding: 0; }
}

/* ---------- Утилиты отступов (inline-стили запрещены CSP) ---------- */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 12px; } .mt-3 { margin-top: 20px; } .mt-4 { margin-top: 32px; } .mt-5 { margin-top: 48px; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 12px; } .mb-3 { margin-bottom: 20px; } .mb-4 { margin-bottom: 32px; }
.w-full { width: 100%; } .ta-right { text-align: right; } .nowrap { white-space: nowrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 800px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.plan-hole { fill: var(--line-2); stroke: var(--plan-wall); stroke-width: 1; vector-effect: non-scaling-stroke; }

/* ---------- Чертёж на главной ---------- */
.l-1400 { --len: 1400; } .l-420 { --len: 420; } .l-320 { --len: 320; } .l-200 { --len: 200; } .l-260 { --len: 260; }
.hero-figure { color: var(--plan-wall); }
.hero-board-line { stroke: var(--plan-board-line); stroke-width: 1; opacity: .55; }
.hero-blue { stroke: var(--blue); }
.hero-text text { font: 600 14px var(--mono); fill: var(--blue); }
.hero-accent { stroke: var(--accent); }
.hero-column { fill: var(--line-2); stroke: var(--plan-wall); stroke-width: 1.5; }
.hero-chip { fill: var(--ink); }
.hero-chip-text { font: 600 13px var(--mono); fill: var(--bg); }
.hero-figure svg { filter: drop-shadow(0 20px 30px rgba(0,0,0,.08)); }
.preset { width: 22px; height: 22px; border-radius: 4px; border: 1px solid var(--line-2); cursor: pointer; padding: 0; transition: transform .12s var(--ease); }
.preset:hover { transform: scale(1.15); border-color: var(--ink); }
.swatch-pick.is-off { opacity: .55; }
.swatch-pick .row { gap: 4px; }
.editor-hint { margin-top: -6px; }

/* ---------- Несколько комнат в калькуляторе ---------- */
.rooms-field { display: flex; flex-direction: column; gap: 12px; }
.rooms-bar { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.room-tabs { display: flex; gap: 6px; flex-wrap: wrap; flex: 1 1 320px; }
.room-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 96px; max-width: 220px;
  padding: 7px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface);
  color: var(--ink-2); font: inherit; text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s, transform .15s var(--ease);
}
.room-tab:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.room-tab.is-active { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.room-tab-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.room-tab-meta { font: 500 11.5px/1 var(--mono); opacity: .7; }
.room-rename { width: 180px; min-height: 46px; }
.room-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.room-actions .btn { min-height: 34px; }
.schema-room + .schema-room { margin-top: 18px; }
.schema-room figcaption { font-weight: 600; font-size: 14px; margin-bottom: 6px; color: var(--ink-2); }
@media (max-width: 600px) { .room-actions .btn { padding: 0 9px; font-size: 13px; } }
.schema-multi { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.schema-multi .schema-room + .schema-room { margin-top: 0; }
.schema-room { margin: 0; }

/* ---------- Подбор цвета: выбор поверхности на картинке ---------- */
.room-preview.is-pickable { position: relative; }
.preview-hint { position: absolute; right: 12px; bottom: 10px; max-width: 60%; padding: 5px 10px; border-radius: 12px; background: rgba(20, 22, 24, .72); color: #fff; pointer-events: none; }
.pick-zone { cursor: pointer; outline: none; }
.pick-zone .zone-fill { fill: transparent; transition: fill .2s; }
.pick-zone .zone-line { fill: none; stroke: transparent; stroke-width: 3; stroke-linejoin: round; stroke-dasharray: 10 7; transition: stroke .2s; }
.pick-zone .zone-tag { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .25s var(--ease); pointer-events: none; }
.pick-zone .zone-tag rect { fill: #17191c; }
.pick-zone .zone-tag text { fill: #fff; font: 600 13px var(--font); }
.pick-zone:hover .zone-fill, .pick-zone:focus-visible .zone-fill { fill: rgba(255, 255, 255, .16); }
.pick-zone:hover .zone-line, .pick-zone:focus-visible .zone-line { stroke: #fff; animation: ants 2s linear infinite; }
.pick-zone:hover .zone-tag, .pick-zone:focus-visible .zone-tag { opacity: 1; transform: none; }
.pick-zone.is-target .zone-tag { display: none; }
/* Постоянное выделение выбранной поверхности */
.zone-selected .sel-fill { fill: var(--accent); fill-opacity: .14; animation: sel-in .5s var(--ease); }
.zone-selected .sel-line { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linejoin: round; }
.zone-selected .sel-ants { fill: none; stroke: #fff; stroke-width: 2; stroke-dasharray: 10 8; opacity: 0; transition: opacity .2s; }
/* Пульсация и бегущий пунктир — только пока мышь над картинкой; без мыши остаётся спокойное выделение */
.room-preview:hover .zone-selected .sel-line { animation: sel-pulse 2s ease-in-out infinite; }
.room-preview:hover .zone-selected .sel-ants { opacity: 1; animation: ants 2.4s linear infinite; }
.zone-selected .sel-tag rect { fill: var(--accent); }
.zone-selected .sel-tag text { fill: var(--accent-ink); font: 700 14px var(--font); }
@keyframes sel-in { from { fill-opacity: .4; } }
@keyframes sel-pulse { 50% { stroke-opacity: .55; } }
@keyframes ants { to { stroke-dashoffset: -34; } }
@keyframes zone-flash { from { fill: rgba(255, 106, 51, .35); } to { fill: transparent; } }

/* ---------- Гайды: разделы и карточки ---------- */
.topic-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.topic-tabs a { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 20px; text-decoration: none; font-weight: 600; font-size: 14px; color: var(--ink-2); background: var(--surface); transition: border-color .15s, color .15s; }
.topic-tabs a span { font: 600 12px var(--mono); color: var(--ink-3); }
.topic-tabs a:hover { border-color: var(--ink); color: var(--ink); }
.topic-tabs a.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.topic-tabs a.is-active span { color: var(--bg); opacity: .7; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.guide-card { display: flex; flex-direction: column; gap: 8px; padding: 0 0 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
.guide-card > *:not(img) { padding: 0 18px; }
.guide-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.guide-card .meta { font: 500 12px/1 var(--mono); color: var(--ink-3); margin-top: 6px; }
.guide-card .h3 { font-size: 18px; margin: 0; }
.guide-card:hover { color: var(--ink); border-color: var(--ink); transform: translate(-2px, -2px); box-shadow: var(--shadow-hard); }
.prose img { border: 1px solid var(--line); border-radius: var(--r-lg); background: #fbf8f1; margin: 8px 0; max-width: 100%; height: auto; }
.prose em { color: var(--ink-3); font-size: 14.5px; font-style: normal; display: block; margin-top: -4px; }
.article-cover { width: 100%; height: auto; border-radius: var(--r-lg); border: 1px solid var(--line); margin-bottom: 18px; }
.norms { padding: 14px 18px; border: 1px dashed var(--blue); background: var(--blue-soft); border-radius: var(--r-lg); font-size: 14.5px; }
.count-bad { color: var(--danger) !important; } .seo-issues { margin: 0; padding-left: 18px; font-size: 13px; } .seo-issues .error { color: var(--danger); } .score { font: 700 15px var(--mono); } .score.good { color: var(--ok); } .score.mid { color: var(--warn); } .score.bad { color: var(--danger); } .checklist li { margin-bottom: 6px; }

/* ---------- Общий план квартиры ---------- */
.room-other { cursor: pointer; outline: none; }
.room-other .other-floor { fill: var(--plan-floor); opacity: .82; transition: opacity .15s; }
.room-other .other-wall { fill: none; stroke: var(--plan-wall); stroke-width: 2; opacity: .45; vector-effect: non-scaling-stroke; }
.room-other:hover .other-floor, .room-other:focus-visible .other-floor { opacity: .95; }
.room-other:hover .other-wall, .room-other:focus-visible .other-wall { opacity: 1; stroke: var(--accent); stroke-dasharray: 8 6; animation: ants 2s linear infinite; }
.room-label { font-family: var(--font); font-weight: 700; fill: var(--ink); pointer-events: none; }
.room-label.is-active { opacity: .35; }
.room-sub { font-family: var(--mono); fill: var(--ink-3); pointer-events: none; }
.plan-floor[data-drag="room-move"] { cursor: move; }
/* Цвета материалов пола */
.mat-laminate .plan-floor, .mat-laminate .other-floor { fill: #d9b98a; }
.mat-tile .plan-floor, .mat-tile .other-floor { fill: #b9cbe0; }
.mat-linoleum .plan-floor, .mat-linoleum .other-floor { fill: #bfd8b5; }
.mat-none .plan-floor, .mat-none .other-floor { fill: var(--surface-2); }
.mat-seg .mat-laminate span::before, .mat-seg .mat-tile span::before, .mat-seg .mat-linoleum span::before, .mat-seg .mat-none span::before {
  content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: 0; border: 1px solid rgba(0,0,0,.25);
}
.mat-seg .mat-laminate span::before { background: #d9b98a; } .mat-seg .mat-tile span::before { background: #b9cbe0; }
.mat-seg .mat-linoleum span::before { background: #bfd8b5; } .mat-seg .mat-none span::before { background: transparent; }
.schema-room-name { font-family: var(--font); font-weight: 700; fill: var(--ink); paint-order: stroke; stroke: var(--surface); stroke-linejoin: round; } .schema-room-name.sub { font-weight: 500; fill: var(--ink-2); }
.joint-field { display: flex; align-items: center; gap: 8px; font-size: 13px; } .joint-select { min-height: 32px; padding: 4px 8px; font-size: 13px; width: auto; }

/* ---------- Рисунок укладки на плане ---------- */
.pattern-layer .pat-el { fill: none; stroke-width: 1; vector-effect: non-scaling-stroke; }
.pat-laminate .pat-el { stroke: var(--plan-board-line); opacity: .55; }
.pat-tile .pat-el { stroke: #8fa3b8; opacity: .7; }
.room-other .pattern-layer { opacity: .88; }
/* Общая стена соседних комнат — одна линия, такой же толщины, как у активной */
.room-other .other-wall { opacity: 1; stroke-width: 3; }
.room-active.is-snapped .plan-wall { stroke: var(--ok); }
.room-active.is-overlap .plan-floor { fill: var(--danger-soft); }
.room-active.is-overlap .plan-wall { stroke: var(--danger); }
.rooms-current { align-self: center; font-size: 15px; }
.room-name-input { font-weight: 600; }
.lay-seg { margin-top: 4px; }

/* ---------- Рекламные места ---------- */
.ad-slot { position: relative; margin: 18px 0; border-radius: var(--r-lg); background: var(--surface-2); overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ad-slot .ad-label { position: absolute; top: 6px; left: 10px; font: 600 10.5px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.ad-h90 { min-height: 90px; } .ad-h100 { min-height: 100px; } .ad-h120 { min-height: 120px; } .ad-h200 { min-height: 200px; }
.ad-h250 { min-height: 250px; } .ad-h280 { min-height: 280px; } .ad-h300 { min-height: 300px; } .ad-h600 { min-height: 600px; }
.ad-slot > div[id^="yandex_rtb_"] { width: 100%; }
.ad-banner img { max-width: 100%; height: auto; display: block; }
.ad-marking { font-size: 11px; color: var(--ink-3); padding: 6px 10px; align-self: stretch; }
.ad-test { border: 2px solid var(--accent); background: var(--accent-soft); }
.ad-test.ad-off { border-style: dashed; border-color: var(--line-2); background: transparent; opacity: .8; }
.ad-test-box { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 24px 16px; font-size: 13px; color: var(--ink-2); }
.ad-test-box b { color: var(--ink); font-size: 14px; }
.guide-grid-full { grid-column: 1 / -1; margin: 0; }
@media (max-width: 960px) { .ad-desktop { display: none !important; } }
@media (min-width: 961px) { .ad-mobile { display: none !important; } }

/* ---------- Меню по задачам ---------- */
.mega-panel.mega-narrow { width: 300px; grid-template-columns: 1fr; }
.mega-panel .mega-all { grid-column: 1 / -1; justify-content: flex-end; color: var(--accent); border-top: 1px dashed var(--line); border-radius: 0; margin: 0; padding-top: 12px; }

/* Нижняя панель на телефоне — до неё достаёт большой палец одной руки */
.tabbar { display: none; }
@media (max-width: 960px) {
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 48; display: grid; grid-template-columns: repeat(5, 1fr);
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 4px 0; background: none; border: 0;
    font: 500 11px/1.2 var(--sans, inherit); color: var(--ink-3); text-decoration: none; cursor: pointer;
  }
  .tabbar [aria-current="page"] { color: var(--accent); }
  .tabbar .ic { width: 22px; height: 22px; }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
}
@media print { .tabbar { display: none; } }

/* ---------- Схема во весь экран ---------- */
body.has-fullscreen { overflow: hidden; }
.is-fullscreen { position: fixed !important; inset: 0; z-index: 100; margin: 0 !important; border-radius: 0 !important; max-width: none !important; }
.editor-canvas.is-fullscreen { height: 100dvh !important; aspect-ratio: auto !important; }
.schema.is-fullscreen { overflow: auto; background: var(--surface); padding: 20px; }
.schema.is-fullscreen svg { max-height: calc(100dvh - 120px); }
.schema .card-title { display: flex; align-items: center; gap: 8px; }
.schema .card-title .fs-btn { margin-left: auto; }
.fs-btn { width: 34px; height: 34px; border: 0; border-radius: 4px; background: none; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.fs-btn:hover { background: var(--surface-2); color: var(--ink); }

/* Палитра цвета покрытия комнаты */
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; transition: transform .15s var(--ease); }
.swatch:hover { transform: scale(1.12); }
.swatch.is-on { box-shadow: 0 0 0 2px var(--accent); }
.swatch-auto { background: repeating-linear-gradient(45deg, var(--surface-2) 0 4px, var(--surface) 4px 8px); }

/* «Нашли ошибку?» под статьёй */
.feedback summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; list-style: none; }
.feedback summary::-webkit-details-marker { display: none; }
.feedback summary:hover { color: var(--accent); }
.feedback textarea { resize: vertical; min-height: 96px; }

/* ---------- 3D-примерка ---------- */
.r3d { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .r3d { grid-template-columns: 1fr; } }
.r3d-stage { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line-2); background: #dfe8ef; position: sticky; top: 76px; }
.r3d-view { height: min(68vh, 620px); }
.r3d-view canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.r3d-stage.is-fullscreen .r3d-view { height: 100dvh; }
.r3d-bar { position: absolute; top: 10px; left: 10px; right: 10px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.r3d-bar .fs-btn { margin-left: auto; background: var(--surface); }
.r3d-views { background: var(--surface); border-radius: var(--r); }
.r3d-hint { position: absolute; left: 12px; bottom: 10px; color: #3b4148; background: rgb(255 255 255 / .7); padding: 3px 8px; border-radius: 99px; }
.r3d-thumb { max-width: 320px; }
.r3d-color { width: 40px; height: 32px; padding: 0; border: 1px solid var(--line-2); border-radius: var(--r); background: none; cursor: pointer; }
.r3d-block .seg { flex-wrap: wrap; }
@media (max-width: 960px) { .r3d-stage { position: relative; top: 0; } .r3d-view { height: 60vh; } }
.r3d-crop { width: 100%; height: auto; border-radius: var(--r); display: block; margin: 8px 0 4px; touch-action: none; cursor: move; }
.finish-box { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 10px 12px; border: 1px dashed var(--line-2); border-radius: var(--r); background: var(--surface-2); }
.r3d-top { display: grid; grid-template-columns: minmax(220px, 320px) 1fr; gap: 16px; align-items: end; margin-bottom: 12px; }
@media (max-width: 700px) { .r3d-top { grid-template-columns: 1fr; } }
.r3d-saved { color: var(--ink-2); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.r3d-rooms { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.room-chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink-2); }
.room-chip:hover { border-color: var(--ink-3); color: var(--ink); }
.room-chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.r3d-views .btn.is-on { background: var(--ink); color: var(--bg); }
.r3d-panel-head { padding: 0 4px; color: var(--ink-2); }
.r3d-view:focus { outline: none; }
.r3d-stage:focus-within { box-shadow: 0 0 0 2px var(--accent); }
.swatch-match { position: relative; }
.swatch-match::after { content: "="; position: absolute; inset: 0; display: grid; place-items: center; font: 600 13px/1 var(--mono); color: rgb(255 255 255 / .9); text-shadow: 0 0 2px #000; }
.r3d-pad { position: absolute; right: 14px; bottom: 44px; display: grid; grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(2, 46px); gap: 6px; }
.r3d-pad[hidden] { display: none; }
.r3d-pad button { border: 0; border-radius: 12px; background: rgb(255 255 255 / .85); font-size: 22px; cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 2px 8px rgb(0 0 0 / .15); }
.r3d-pad button:active { background: var(--accent); color: #fff; }
.r3d-pad-up { grid-column: 2; grid-row: 1; } .r3d-pad-left { grid-column: 1; grid-row: 2; } .r3d-pad-down { grid-column: 2; grid-row: 2; } .r3d-pad-right { grid-column: 3; grid-row: 2; }

/* ---------- Рейтинги производителей ---------- */
.stars { display: inline-flex; gap: 1px; vertical-align: middle; }
.star { width: 15px; height: 15px; background: var(--line-2); -webkit-mask: url("../icons/star.svg") center / contain no-repeat; mask: url("../icons/star.svg") center / contain no-repeat; }
.star.full { background: #f2a516; }
.star.half { background: linear-gradient(90deg, #f2a516 50%, var(--line-2) 50%); }
.rating-cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.rating-cat { display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: inherit; transition: transform .2s var(--ease), border-color .2s; }
.rating-cat:hover { transform: translateY(-2px); border-color: var(--ink); }
.rating-cat .go { margin-top: auto; font: 600 13px/1 var(--mono); color: var(--accent); display: inline-flex; gap: 6px; align-items: center; }
.rating-mini { margin: 0; padding-left: 18px; display: grid; gap: 8px; }
.rating-mini li { display: flex; align-items: center; gap: 8px; }
.rating-mini img, .pick img, .brand-logo img { max-width: 100%; object-fit: contain; object-position: left center; }
.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.pick { display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: border-color .2s, transform .2s var(--ease); }
.pick:hover { border-color: var(--accent); transform: translateY(-2px); }
.helper-q { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 12px 0; }
.helper-q .seg { flex-wrap: wrap; }
@media (max-width: 900px) { .helper-q { grid-template-columns: 1fr; } }
.helper-out { padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.rating-tools { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; color: var(--ink-2); transition: border-color .15s, background .15s; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.brand-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.brand { transition: border-color .2s, box-shadow .2s; scroll-margin-top: 90px; }
.brand.is-match { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.brand-head { display: grid; grid-template-columns: 36px 150px 1fr auto; gap: 14px; align-items: center; }
.brand-rank { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font: 700 15px/1 var(--mono); background: var(--surface-2); }
.brand.is-match .brand-rank { background: var(--accent); color: #fff; }
.brand-logo { height: 40px; display: flex; align-items: center; padding: 3px 8px; background: #fff; border-radius: var(--r); border: 1px solid var(--line); }
.brand-score { text-align: right; display: grid; gap: 2px; justify-items: end; }
.brand-score b { font: 700 26px/1 var(--mono); }
.brand-match { margin-top: 10px; padding: 8px 12px; border-radius: var(--r); background: var(--accent-soft, var(--surface-2)); font-size: 14px; }
.brand-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.brand-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 20px; }
.crit { margin: 0; display: grid; gap: 6px; }
.crit div { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; }
.crit dt { color: var(--ink-2); }
.crit dd { margin: 0; display: flex; align-items: center; gap: 6px; }
.crit meter { width: 90px; height: 8px; }
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.proscons h3 { margin: 0 0 4px; }
.proscons ul { margin: 0; padding-left: 18px; font-size: 14px; display: grid; gap: 4px; }
.ok-t { color: var(--ok); } .bad-t { color: var(--danger, #c0392b); }
.brand-best { margin-top: 12px; font-size: 14.5px; }
.brand-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-top: 10px; border-top: 1px dashed var(--line); }
.brand-actions .btn:last-child { margin-left: auto; }
.table-wrap { overflow-x: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap th, .table-wrap td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
@media (max-width: 760px) {
  .brand-head { grid-template-columns: 32px 1fr auto; }
  .brand-logo { grid-column: 2 / 4; order: -1; grid-row: 1; width: max-content; max-width: 100%; }
  .brand-body, .proscons { grid-template-columns: 1fr; }
  .brand-actions .btn:last-child { margin-left: 0; }
}
.nav > a, .nav .nav-link { white-space: nowrap; }
.rating-tools select { width: auto; min-width: 190px; }
.rating-tools label { gap: 8px; align-items: center; }
@media (max-width: 760px) {
  .brand-rank { grid-column: 1; grid-row: 1; }
  .brand-logo { grid-column: 2 / 4; grid-row: 1; order: 0; }
  .brand-title { grid-column: 1 / 3; grid-row: 2; }
  .brand-score { grid-column: 3; grid-row: 2; }
}
.rating-cat h2 { font-size: 21px; line-height: 1.2; display: flex; gap: 8px; align-items: center; }
.rating-mini li { display: grid; grid-template-columns: 112px auto 1fr; gap: 8px; }
.rating-mini img { width: 112px; height: 22px; object-position: left center; }
/* Длинный текст вместо числа в главном итоге — мельче и с переносом, чтобы не вылезал за карточку */
.result-main .value.is-text { font-size: 26px; line-height: 1.15; letter-spacing: -0.01em; flex-wrap: wrap; overflow-wrap: anywhere; }
.result-main .value { overflow-wrap: anywhere; }

/* ---------- Тексты для поиска на страницах калькуляторов ---------- */
.calc-seo h2 { font-size: 22px; margin: 0 0 12px; }
.steps-list { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--ink-2); }
.link-list { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.faq details { border-bottom: 1px solid var(--line); padding: 10px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 600 18px/1 var(--mono); color: var(--ink-3); }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 8px 0 0; color: var(--ink-2); }

/* ---------- Плашка согласия на cookie ---------- */
.cookie-bar {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 90; max-width: 760px; margin: 0 auto;
  display: flex; gap: 16px; align-items: center; padding: 14px 16px; border-radius: var(--r-lg);
  background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow);
  opacity: 0; transform: translateY(12px); transition: opacity .25s, transform .25s var(--ease);
}
.cookie-bar.is-in { opacity: 1; transform: none; }
.cookie-bar p { margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
@media (max-width: 960px) {
  .cookie-bar { flex-direction: column; align-items: stretch; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .cookie-actions .btn { flex: 1; }
}
@media print { .cookie-bar { display: none; } }

/* Комната без выделения: ни ручек, ни размеров — все комнаты равноправны */
.editor-canvas.is-idle .room-active .handle,
.editor-canvas.is-idle .room-active .dim-line,
.editor-canvas.is-idle .room-active .dim-text,
.editor-canvas.is-idle .room-active .plan-wall-badge,
.editor-canvas.is-idle .room-active .plan-wall-name,
.editor-canvas.is-idle .room-active .plan-wall-hl { display: none; }
.editor-canvas.is-idle .room-active .plan-wall { stroke: var(--plan-wall); opacity: .8; }
.editor-canvas.is-idle .room-label.is-active { font-weight: 600; }
.rename-inline { position: absolute; z-index: 5; width: 220px; box-shadow: var(--shadow); }
.room-label, .room-sub { cursor: text; }
.cookie-bar { padding-right: 40px; }
.cookie-close { position: absolute; top: 6px; right: 8px; width: 28px; height: 28px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--ink-3); cursor: pointer; border-radius: 50%; }
.cookie-close:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Вход через Яндекс ---------- */
.social-login { display: grid; gap: 8px; margin-bottom: 16px; }
.social-yandex { display: flex; align-items: center; justify-content: center; gap: 10px; background: #fff; color: #000; border: 1px solid #d9d9d9; font-weight: 600; }
.social-yandex:hover { border-color: #000; color: #000; }
.social-ya { width: 24px; height: 24px; border-radius: 50%; background: #fc3f1d; color: #fff; display: grid; place-items: center; font: 700 14px/1 Arial, sans-serif; }
.social-or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: 12px; margin-top: 6px; }
.social-or::before, .social-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* Логотипы брендов — на светлой подложке в любой теме: у временных знаков цвет текста фирменный и может быть тёмным */
.rating-mini img, .pick img { background: #fff; border-radius: 6px; padding: 3px 6px; box-sizing: border-box; }
.pick img { width: max-content; max-width: 100%; height: 34px; }
[data-theme="dark"] .brand-logo { border-color: transparent; }
.install-list { display: grid; gap: 12px; }
.install-list summary { cursor: pointer; list-style: none; font-size: 17px; }
.install-list summary::-webkit-details-marker { display: none; }
.wrap.narrow { max-width: 820px; }

/* ---------- Список покупок ---------- */
.shop-bar { position: sticky; top: 72px; z-index: 5; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; font-weight: 600; }
.shop-section { margin-bottom: 12px; }
.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-list li { border-bottom: 1px solid var(--line); }
.shop-list li:last-child { border-bottom: 0; }
.shop-item { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: center; padding: 12px 2px; cursor: pointer; }
.shop-item input { width: 22px; height: 22px; accent-color: var(--accent); }
.shop-name { display: grid; gap: 2px; }
.shop-qty { font-weight: 700; white-space: nowrap; }
.shop-list li.is-done .shop-name, .shop-list li.is-done .shop-qty { text-decoration: line-through; opacity: .45; }
@media print { .shop-bar { display: none; } }

/* ---------- Быстрые ответы ---------- */
.qa-answer { border-left: 4px solid var(--accent); }
.qa-big { font: 700 44px/1.1 var(--mono); margin: 6px 0 10px; letter-spacing: -0.03em; }
.qa-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.qa-links { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-links a { padding: 5px 10px; border: 1px solid var(--line-2); border-radius: 99px; text-decoration: none; font-size: 14px; }
.qa-links a:hover { border-color: var(--accent); color: var(--accent); }
.table tr.is-current td { background: var(--accent-soft, var(--surface-2)); }

/* Рейтинги: текст карточек крупнее — его читают, а не пробегают глазами */
.brand-title .tiny { font-size: 14px; }
.brand-tags .pill { font-size: 13px; padding: 4px 10px; font-family: inherit; }
.crit div { font-size: 15px; }
.crit .mono.small { font-size: 15px; }
.crit meter { width: 110px; height: 10px; }
.proscons h3 { font-size: 16px; }
.proscons ul { font-size: 16px; line-height: 1.5; gap: 6px; }
.brand-best { font-size: 16.5px; }
.brand-match { font-size: 15.5px; }
.brand-actions .tiny { font-size: 13.5px; }
.pick .tiny, .rating-cat .tiny { font-size: 13.5px; }
.brand-body { grid-template-columns: 1fr; gap: 16px; }
.crit { grid-template-columns: 1fr 1fr; column-gap: 28px; row-gap: 8px; }
@media (max-width: 760px) { .crit { grid-template-columns: 1fr; } }

/* ---------- Ассистент в поиске ---------- */
.ask-btn { display: flex; gap: 8px; align-items: center; width: 100%; padding: 9px 10px; border: 0; border-top: 1px dashed var(--line); background: none; text-align: left; font: inherit; font-size: 14px; color: var(--accent); cursor: pointer; border-radius: var(--r); }
.ask-btn:hover { background: var(--surface-2); }
.search-results.assistant { padding: 10px; max-width: 520px; }
.assistant-text { white-space: pre-line; margin: 0 0 8px; font-size: 14.5px; line-height: 1.45; color: var(--ink); }
.assistant-result { display: grid !important; gap: 2px; padding: 10px 12px !important; margin-bottom: 6px; border-radius: var(--r); background: var(--surface-2); border-left: 3px solid var(--accent); }
.assistant-result b { font: 700 22px/1.2 var(--mono); }

/* ---------- Режим приложения (запуск с иконки), гость: только вход ---------- */
body.app-guest { padding-bottom: 0; }
body.app-guest .auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); }
.app-auth-logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 22px; margin-bottom: 18px; }
.app-splash {
  position: fixed; inset: 0; z-index: 200; display: grid; place-content: center; justify-items: center; gap: 14px;
  background: var(--bg); animation: splash-out .45s ease 1.35s forwards;
}
.app-splash-mark {
  position: relative; width: 84px; height: 84px; border: 5px solid var(--ink); border-radius: 12px; display: grid; place-items: center;
  font: 800 30px/1 var(--mono); animation: splash-draw .9s cubic-bezier(.2,.8,.2,1) both;
}
.app-splash-mark::after { content: ""; position: absolute; right: -14px; bottom: -14px; width: 26px; height: 26px; background: var(--accent); border-radius: 5px; animation: splash-pop .45s cubic-bezier(.3,1.6,.5,1) .65s both; }
.app-splash-mark span { animation: splash-fade .4s ease .45s both; }
.app-splash-name { font-weight: 800; font-size: 26px; letter-spacing: -.02em; animation: splash-fade .5s ease .8s both; }
@keyframes splash-draw { from { transform: scale(.4) rotate(-12deg); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes splash-pop { from { transform: scale(0); } to { transform: none; } }
@keyframes splash-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .app-splash { animation-delay: .1s; } .app-splash * { animation: none !important; } }

/* ---------- Без масштабирования страницы на телефоне: увеличиваются только схемы и открытые картинки ---------- */
html { touch-action: pan-x pan-y; -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; max-width: 100%; }
.prose img, [data-zoomable] { cursor: zoom-in; }
.zoom-box { position: fixed; inset: 0; z-index: 150; background: rgb(10 10 12 / .92); touch-action: none; overflow: hidden; display: grid; place-items: center; }
.zoom-box .zoom-item { max-width: 96vw; max-height: 88dvh; transform-origin: 0 0; will-change: transform; user-select: none; -webkit-user-select: none; }
.zoom-box svg.zoom-item { width: 96vw; height: 80dvh; background: var(--surface); border-radius: 8px; }
.zoom-box .zoom-close { position: absolute; top: calc(10px + env(safe-area-inset-top)); right: 12px; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .9); font-size: 24px; cursor: pointer; z-index: 2; }
.zoom-box .zoom-hint { position: absolute; bottom: calc(14px + env(safe-area-inset-bottom)); left: 0; right: 0; text-align: center; color: #ddd; font-size: 13px; pointer-events: none; }

/* ---------- Баннер «Приложение на телефон» на главной ---------- */
.app-promo {
  display: flex; align-items: center; gap: 16px; margin: 28px 0 0; padding: 16px 20px;
  border-radius: var(--r-lg); border: 1px solid var(--line-2);
  background: linear-gradient(110deg, var(--surface) 0%, var(--surface) 55%, var(--accent-soft, rgba(224, 82, 29, .1)) 100%);
  box-shadow: 0 1px 0 rgba(0,0,0,.03);
}
.app-promo-icon { width: 56px; height: 56px; border-radius: 14px; box-shadow: 0 4px 14px rgba(0,0,0,.12); flex-shrink: 0; }
.app-promo-text { display: grid; gap: 2px; flex: 1; }
.app-promo-text b { font-size: 17px; }
.app-promo-text span { color: var(--ink-2); font-size: 14.5px; }
.app-promo-actions { display: flex; gap: 8px; flex-shrink: 0; }
html[data-standalone] .app-promo { display: none; }
@media (max-width: 640px) {
  .app-promo { flex-wrap: wrap; padding: 14px; gap: 12px; }
  .app-promo-icon { width: 48px; height: 48px; border-radius: 12px; }
  .app-promo-actions { width: 100%; }
  .app-promo-actions .btn { flex: 1; }
}
/* Меню «Посчитать»: 8 разделов по этапам ремонта */
#mega-calc { width: min(1040px, 94vw); grid-template-columns: repeat(5, 1fr); }
.footer-grid { grid-template-columns: 1.4fr repeat(auto-fit, minmax(150px, 1fr)); }

/* ---------- Лаборатория ---------- */
.labs-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.labs-card { text-decoration: none; color: inherit; display: grid; gap: 8px; align-content: start; transition: border-color .2s, transform .2s var(--ease); }
.labs-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.ar-overlay { position: fixed; inset: 0; z-index: 300; pointer-events: none; display: flex; flex-direction: column; justify-content: space-between; padding: calc(16px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom)); }
.ar-info { background: rgb(0 0 0 / .65); color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 15px; }
.ar-actions { display: flex; gap: 8px; justify-content: center; pointer-events: auto; }
.pi-card { display: grid; gap: 12px; }
.pi-hint { font-weight: 600; }
.pi-stage { border: 1px solid var(--line-2); border-radius: var(--r-lg); min-height: 320px; display: grid; }
.pi-svg { width: 100%; max-height: 70dvh; touch-action: none; cursor: crosshair; }
.pi-room rect { fill: rgb(224 82 29 / .12); stroke: var(--accent); }
.pi-room.is-sel rect { fill: rgb(224 82 29 / .25); }
.pi-room text { fill: var(--ink); font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 4px; }
.pi-new { fill: rgb(36 87 197 / .12); stroke: #2457c5; stroke-dasharray: 6 4; }
.pi-cal { fill: #2457c5; } .pi-cal-line { stroke: #2457c5; }
.pi-door { stroke: #2b7a4b; stroke-linecap: round; }
.pi-list { display: grid; gap: 6px; margin-top: 12px; }
.pi-row { display: grid; grid-template-columns: 1fr 80px auto 80px auto auto; gap: 8px; align-items: center; padding: 6px 8px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.pi-row.is-sel { border-color: var(--accent); }
.fu-layout { display: grid; grid-template-columns: 260px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .fu-layout { grid-template-columns: 1fr; } .fu-catalog { grid-template-columns: repeat(2, 1fr) !important; max-height: 220px; } }
.fu-catalog { display: grid; gap: 6px; max-height: 70dvh; overflow: auto; }
.fu-cat { display: grid; text-align: left; gap: 2px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); cursor: pointer; font: inherit; font-size: 14px; }
.fu-cat:hover { border-color: var(--accent); }
.fu-stage { border: 1px solid var(--line-2); border-radius: var(--r-lg); margin-top: 10px; }
.fu-svg { width: 100%; max-height: 70dvh; touch-action: none; display: block; }
.fu-room { fill: var(--surface); stroke: var(--ink); stroke-width: 60; }
.fu-room-name { fill: var(--ink-3); font-weight: 700; }
.fu-door { fill: rgb(224 82 29 / .08); stroke: var(--accent); stroke-width: 20; stroke-dasharray: 60 40; }
.fu-item rect { fill: #c9d6e6; stroke: #3d5a80; stroke-width: 20; cursor: grab; }
.fu-item text { fill: #1d2b3a; font-weight: 700; pointer-events: none; }
.fu-item.is-sel rect { stroke: var(--accent); stroke-width: 40; }
.fu-item.is-bad rect { fill: #f6c9c4; stroke: #b3261e; }
.fu-zone { fill: rgb(43 122 75 / .1); stroke: rgb(43 122 75 / .5); stroke-width: 10; stroke-dasharray: 40 30; pointer-events: none; }
.fu-zone.is-tight { fill: rgb(179 38 30 / .12); stroke: rgb(179 38 30 / .6); }
.fu-issues { margin-top: 10px; }
.app-promo-os { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.os-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px 3px 7px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.os-chip .ic { width: 15px; height: 15px; }
.app-promo:hover .os-chip { border-color: var(--line-2); }

/* ---------- Баннер 3D-примерки на главной ---------- */
.r3d-promo {
  display: grid; grid-template-columns: 1fr 1.1fr; gap: 0; margin-top: 18px; border-radius: var(--r-lg); overflow: hidden;
  text-decoration: none; color: inherit; border: 1px solid var(--line-2); background: var(--surface);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s;
}
.r3d-promo:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--accent); color: inherit; }
.r3d-promo-text { padding: 28px 30px; display: grid; gap: 12px; align-content: center; }
.r3d-promo-text h2 { margin: 0; font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; }
.r3d-promo-text p { margin: 0; color: var(--ink-2); }
.r3d-promo-text .btn { justify-self: start; }
.r3d-promo-free {
  justify-self: start; padding: 6px 14px; border-radius: 99px; background: var(--accent); color: #fff;
  font: 800 14px/1 var(--mono); text-transform: uppercase; letter-spacing: .12em; transform: rotate(-2deg);
  box-shadow: 0 6px 18px rgb(224 82 29 / .35);
}
.r3d-promo-pic { position: relative; min-height: 260px; overflow: hidden; }
.r3d-promo-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.r3d-promo:hover .r3d-promo-pic img { transform: scale(1.04); }
.r3d-promo-badge { position: absolute; left: 14px; bottom: 14px; padding: 6px 12px; border-radius: 99px; background: rgb(255 255 255 / .92); color: #1c1c1c; font-size: 13px; font-weight: 600; }
@media (max-width: 760px) {
  .r3d-promo { grid-template-columns: 1fr; }
  .r3d-promo-pic { order: -1; min-height: 210px; }
  .r3d-promo-text { padding: 20px; }
  .r3d-promo-text h2 { font-size: 24px; }
}
/* График регистраций в админке */
.signup-chart { display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; align-items: end; height: 140px; margin-top: 12px; }
.signup-col { height: 100%; display: flex; flex-direction: column-reverse; align-items: center; gap: 2px; }
.signup-bar { width: 100%; border-radius: 3px 3px 0 0; background: var(--accent); min-height: 2px; opacity: .85; }
.signup-n { font: 600 10px/1 var(--mono); color: var(--ink-3); }

/* В установленном приложении не предлагаем установить приложение */
@media (display-mode: standalone) { .no-standalone { display: none !important; } }
html[data-standalone] .no-standalone { display: none !important; }

/* ===== Помощник-строитель ===== */
.mascot { display: inline-block; width: 44px; height: 44px; }
.mascot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.mascot .m-hat, .mascot .m-body, .mascot .m-head { transform-box: fill-box; transform-origin: 50% 100%; }
.is-wave .m-hat { animation: m-hat .8s cubic-bezier(.3,1.6,.5,1); }
.is-wave .m-head { animation: m-nod .8s ease-in-out; }
.is-wave .mascot { animation: m-pop .6s cubic-bezier(.3,1.6,.5,1); }
@keyframes m-hat { 0%{transform:none} 30%{transform:translateY(-9px) rotate(-12deg)} 60%{transform:translateY(0) rotate(6deg)} 100%{transform:none} }
@keyframes m-nod { 0%,100%{transform:none} 35%{transform:rotate(-7deg)} 70%{transform:rotate(5deg)} }
@keyframes m-pop { 0%{transform:scale(1)} 40%{transform:scale(1.14)} 100%{transform:scale(1)} }
@media (prefers-reduced-motion: reduce) { .is-wave .m-hat, .is-wave .m-head, .is-wave .mascot { animation: none; } }

.tab-helper { position: relative; }
.tab-helper .mascot { width: 54px; height: 54px; margin-top: -26px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); padding: 3px; box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.helper-fab { position: fixed; right: 24px; bottom: 24px; z-index: 60; width: 68px; height: 68px; border-radius: 50%; border: 3px solid var(--accent); background: var(--surface); padding: 5px; cursor: pointer; box-shadow: 0 10px 28px rgba(0,0,0,.22); transition: transform .2s; }
.helper-fab:hover { transform: translateY(-2px); }
.helper-fab .mascot { width: 100%; height: 100%; }
@media (max-width: 960px) { .helper-fab { display: none; } }

.helper-panel { position: fixed; z-index: 70; display: flex; flex-direction: column; background: var(--surface); color: var(--ink); opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .2s, transform .2s; overflow: hidden; }
.helper-panel.is-open { opacity: 1; transform: none; }
.helper-panel::before { content: ""; position: absolute; inset: 0; background: url("../mascot/blueprint.svg") right -60px bottom 40px / 360px no-repeat; opacity: .07; pointer-events: none; }
.helper-panel > * { position: relative; }
@media (min-width: 961px) { .helper-panel { right: 24px; bottom: 104px; width: 380px; height: min(560px, calc(100vh - 140px)); border-radius: 20px; border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(0,0,0,.25); transform-origin: right bottom; } }
@media (max-width: 960px) {
  .helper-panel { inset: 0; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
  .helper-panel::before { background-size: 520px; background-position: center bottom 90px; opacity: .08; }
  html.helper-on, html.helper-on body { overflow: hidden; }
}
.helper-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(135deg, var(--accent), #e0521d); color: #fff; }
.helper-head div { flex: 1; display: flex; flex-direction: column; }
.helper-head .faint { color: rgba(255,255,255,.85); }
.helper-head .mascot { width: 48px; height: 48px; background: #fff; border-radius: 50%; padding: 3px; }
.helper-close { background: rgba(255,255,255,.2); border: 0; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 24px; line-height: 1; cursor: pointer; }
.helper-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.helper-msg { max-width: 86%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.45; animation: m-in .25s ease-out; }
.helper-msg p { margin: 0; }
.helper-msg.bot { align-self: flex-start; background: var(--surface-2, #f2f0eb); border-bottom-left-radius: 4px; }
.helper-msg.me { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
@keyframes m-in { from { opacity: 0; transform: translateY(6px); } }
.helper-typing { opacity: .6; }
.helper-result { display: flex; flex-direction: column; margin-top: 8px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; color: inherit; }
.helper-result b { font-size: 20px; color: var(--accent); }
.helper-link { display: block; margin-top: 6px; color: var(--accent); }
.helper-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 10px; }
.helper-chips[hidden] { display: none; }
.helper-chips .chip { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; }
.helper-form { display: flex; gap: 8px; padding: 10px 16px 14px; border-top: 1px solid var(--line); background: var(--surface); }
.helper-form .input { flex: 1; }
@media (max-width: 960px) {
  .tabbar { align-items: end; }
  .tabbar a, .tabbar button { white-space: nowrap; font-size: 10.5px; min-width: 0; }
  .tab-helper .mascot { margin-bottom: -2px; }
}
.helper-panel { z-index: 1000; }

/* 3D-вид стен в схеме результата */
.schema-tabs { margin-bottom: 12px; }
.walls3d { position: relative; height: 440px; border-radius: 14px; overflow: hidden; background: linear-gradient(180deg, var(--surface-2, #f3f0ea), var(--surface)); border: 1px solid var(--line); cursor: grab; touch-action: none; }
.walls3d:active { cursor: grabbing; }
.walls3d canvas { display: block; }
.walls3d-load { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; }
.walls3d-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.walls3d-bar .btn[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.is-fullscreen .walls3d, :fullscreen .walls3d { height: calc(100vh - 170px); }
@media (max-width: 640px) { .walls3d { height: 340px; } }
.schema-tabs button { border: 0; background: none; padding: 6px 14px; border-radius: calc(var(--r) - 3px); font: inherit; color: var(--ink-2); cursor: pointer; }
.schema-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.helper-msg p { white-space: pre-line; }
.guide-card { display: flex; flex-direction: column; }
.guide-card .guide-date { margin-top: auto; padding-top: 10px; align-self: flex-end; font-size: 12.5px; color: var(--ink-3); }
.mascot .m-arm { transform-box: fill-box; transform-origin: 10% 95%; }
.is-wave .m-arm { animation: m-wave .9s ease-in-out; }
@keyframes m-wave { 0%,100%{transform:none} 25%{transform:rotate(-16deg)} 50%{transform:rotate(10deg)} 75%{transform:rotate(-10deg)} }
@media (prefers-reduced-motion: reduce) { .is-wave .m-arm { animation: none; } }

/* Главная: баннер прораба */
.helper-promo { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: center; padding: 28px; border-radius: 22px; background: linear-gradient(135deg, rgba(224,82,29,.10), rgba(36,87,197,.08)); border: 1px solid var(--line); position: relative; overflow: hidden; }
.helper-promo::after { content: ""; position: absolute; right: -40px; top: -40px; width: 260px; height: 260px; background: url("../mascot/blueprint.svg") center / contain no-repeat; opacity: .07; pointer-events: none; }
.helper-promo-text h2 { margin: 10px 0 8px; font-size: clamp(24px, 3vw, 34px); }
.helper-promo-text p { color: var(--ink-2); }
.mascot-lg { width: 84px; height: 84px; background: #fff; border-radius: 50%; padding: 4px; border: 3px solid var(--accent); box-shadow: 0 8px 22px rgba(0,0,0,.12); }
.helper-promo-list { list-style: none; padding: 0; margin: 14px 0; display: grid; gap: 8px; }
.helper-promo-list li { padding-left: 26px; position: relative; color: var(--ink-2); }
.helper-promo-list li::before { content: "✓"; position: absolute; left: 0; top: 0; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; display: grid; place-items: center; }
.helper-promo-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.helper-promo-chips .chip { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; cursor: pointer; transition: border-color .15s, transform .15s; }
.helper-promo-chips .chip:hover { border-color: var(--accent); transform: translateY(-1px); }
.helper-promo-chat { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.08); max-height: 460px; overflow: hidden; }
.helper-promo-chat .helper-msg { animation: none; }
.helper-promo-chat .helper-msg.bot p { white-space: pre-line; }
.helper-promo-chat .typing-caret::after { content: "▍"; color: var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
@media (max-width: 900px) { .helper-promo { grid-template-columns: 1fr; padding: 20px; } }

/* Главная: калькуляторы по разделам */
.task-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.task-card { padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.task-card header { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.task-card h3 { margin: 0; font-size: 18px; }
.task-card h3 a { color: inherit; text-decoration: none; }
.task-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.task-card li a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 15px; }
.task-card li a::after { content: "→"; color: var(--ink-3); transition: transform .15s; }
.task-card li a:hover { background: var(--surface-2); color: var(--accent); }
.task-card li a:hover::after { transform: translateX(3px); color: var(--accent); }
.task-card { display: flex; flex-direction: column; } .task-card .task-more { margin-top: auto; align-self: flex-start; } .task-card ul { margin-bottom: 12px; }

/* График ремонта */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.plan-works { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 6px 14px; margin-top: 10px; }
.plan-summary { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin: 16px 0; }
.plan-summary .card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.plan-summary b { font-size: 20px; }
.plan-chart { overflow-x: auto; padding: 12px; }
.plan-gantt { min-width: 760px; width: 100%; height: auto; display: block; }
.plan-gantt .g-label { font-size: 12.5px; fill: var(--ink-2); }
.plan-gantt .g-scale { font-size: 11px; fill: var(--ink-3); }
.plan-gantt .g-grid { stroke: var(--line); stroke-width: 1; }
.plan-gantt .g-bar { fill: var(--accent); }
.plan-gantt .g-eng { fill: #2457c5; }
.plan-gantt .g-bath { fill: #0e8f8a; }
.plan-gantt .g-walls { fill: #c27a12; }
.plan-gantt .g-floor { fill: #6a4ac2; }
.plan-gantt .g-dry { fill: var(--line-2); stroke: var(--ink-3); stroke-dasharray: 3 3; stroke-width: 1; }
.plan-gantt .g-today { stroke: #d63b3b; stroke-width: 2; }
.plan-legend { display: flex; gap: 16px; margin-top: 8px; }
.plan-legend span::before { content: ""; display: inline-block; width: 14px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.plan-legend .lg-work::before { background: var(--accent); }
.plan-legend .lg-dry::before { background: var(--line-2); border: 1px dashed var(--ink-3); }
.plan-legend .lg-today::before { background: #d63b3b; width: 3px; }

/* Мобильное меню: два уровня */
.mnav-level { animation: mnav-in .22s ease-out; }
.mnav-sub { animation-name: mnav-in-right; }
@keyframes mnav-in { from { opacity: 0; transform: translateX(-12px); } }
@keyframes mnav-in-right { from { opacity: 0; transform: translateX(16px); } }
.mobile-nav .mnav-section { display: flex; align-items: center; gap: 10px; }
.mobile-nav .mnav-section .mnav-t { flex: 1; }
.mobile-nav .mnav-section small { color: var(--ink-3); font-size: 12px; background: var(--surface-2); border-radius: 999px; padding: 2px 8px; }
.mnav-back { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; padding: 8px 0; cursor: pointer; }
.mnav-back .ic { transform: rotate(180deg); }
.mobile-nav .mnav-all { color: var(--accent); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .mnav-level { animation: none; } }
.calc-trust { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 10px 20px; margin: 22px 0 0; padding: 14px 16px; border: 1px dashed var(--line-2); border-radius: var(--r-lg); }
.calc-trust .norms { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; padding: 0; }
.calc-trust .norms li { font: 500 12.5px/1 var(--mono, monospace); padding: 5px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); }

/* Тренды */
.trend-sections { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.trend-sections a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-size: 14px; }
.trend-sections a small { color: var(--ink-3); }
.trend-sections a[aria-current="page"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.trend-sections a[aria-current="page"] small { color: inherit; opacity: .7; }
.trend-years a { padding: 6px 14px; text-decoration: none; color: var(--ink-2); border-radius: calc(var(--r) - 3px); }
.trend-years a[aria-current="page"] { background: var(--surface); color: var(--ink); }
.trend-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.trend-card { display: flex; flex-direction: column; gap: 8px; padding: 0 0 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; overflow: hidden; transition: transform .2s, box-shadow .2s; }
.trend-card > *:not(img) { padding: 0 16px; }
.trend-card img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--surface-2); }
.trend-card .meta { font: 500 12px/1 var(--mono, monospace); color: var(--ink-3); margin-top: 6px; }
.trend-card:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.08); }
.trend-safe { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #1f8a4c; margin-top: auto; }
.trend-hero { width: 100%; height: auto; border-radius: var(--r-lg); border: 1px solid var(--line); margin-bottom: 20px; background: var(--surface-2); }
.trend-safety { margin: 26px 0; padding: 18px 20px; border-radius: var(--r-lg); background: rgba(31,138,76,.07); border: 1px solid rgba(31,138,76,.25); }
.trend-safety h2 { display: flex; align-items: center; gap: 8px; margin-top: 0; color: #1f8a4c; }
.trend-calc { display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--ink); }
.trend-calc > span { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.trend-preview { border-radius: 10px; border: 1px solid var(--line); object-fit: cover; }
.trend-card .h3 { font-size: 19px; line-height: 1.3; margin: 0; }
/* Админка: статистика */
.stats-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.stats-cards .stat { display: flex; flex-direction: column; gap: 4px; }
.stats-cards .stat b { font-size: 26px; }
.delta { font-size: 12.5px; } .delta.up { color: #1f8a4c; } .delta.down { color: #c0392b; }
.visits-chart .signup-col { min-width: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1.2fr) 2fr auto; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.bar-track { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 99px; }
.seg-link { padding: 6px 12px; text-decoration: none; color: var(--ink-2); border-radius: calc(var(--r) - 3px); font-size: 14px; }
.seg-link[aria-current="page"] { background: var(--surface); color: var(--ink); }
.health { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.health li span { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 11px; color: #fff; margin-right: 6px; }
.health li.ok span { background: #1f8a4c; } .health li.bad span { background: #c0392b; }

/* Схема лестницы */
.stairs-plan { width: 100%; max-height: 460px; display: block; margin: 0 auto; }
.stairs-plan .st-cell { fill: none; stroke: var(--ink-3); stroke-width: 30; stroke-dasharray: 80 50; }
.stairs-plan .st-step { fill: #e6c9a4; stroke: #8a6a4a; stroke-width: 12; }
.stairs-plan .st-landing { fill: #d6b48c; stroke: #8a6a4a; stroke-width: 12; }
.stairs-plan .st-prev { fill: none; stroke: var(--ink-3); stroke-width: 10; stroke-dasharray: 40 30; }
.stairs-plan .st-open { fill: rgba(224,82,29,.10); stroke: #e0521d; stroke-width: 14; stroke-dasharray: 60 30; }
.stairs-plan .st-num { font-size: 110px; fill: #5a3f2e; }
.stairs-plan .st-dim { font-size: 140px; fill: var(--ink-2); }
.stairs-plan .st-arrow { stroke: #2457c5; stroke-width: 22; }
.stairs-plan .st-arrowhead { fill: #2457c5; }
.wrap-row { flex-wrap: wrap; }
.menu-sec .row > .input { width: auto; flex: 1 1 10em; min-width: 0; }
.menu-sec .row > .menu-icon { flex: 0 0 7em; }
.menu-sec .row > select.input { flex: 0 1 12em; }
.menu-sec .table td { padding-block: 6px; vertical-align: middle; }
/* «Читайте также» в боковой колонке статьи */
.more-list { list-style: none; margin: 8px 0 0; padding: 0; }
.more-list li + li { border-top: 1px solid var(--line); }
.more-list a { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; text-decoration: none; color: inherit; }
.more-list a > span { display: flex; flex-direction: column; gap: 2px; }
.more-list .ic { margin-top: 3px; flex: none; color: var(--accent); }
.more-list .more-t { font-weight: 600; line-height: 1.35; }
.more-list a:hover .more-t { color: var(--accent); }
/* Админка: переписка с ассистентом */
.chat-log { display: flex; flex-direction: column; gap: 10px; max-width: 760px; }
.chat-row { display: flex; }
.chat-row.me { justify-content: flex-end; }
.chat-bubble { max-width: 80%; padding: 10px 14px; border-radius: 14px; background: var(--surface-2, rgba(127,127,127,.12)); line-height: 1.45; }
.chat-row.me .chat-bubble { background: var(--accent-soft); }
.chat-bubble.is-miss { outline: 1px solid var(--accent); }
.chat-bubble .tiny { margin-top: 4px; }
.chat-link { display: block; margin-top: 6px; font-size: 14px; }
/* «Мой ремонт» без входа: призыв зарегистрироваться */
.guest-cta { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; padding: 20px 22px; margin-bottom: 24px; border-radius: var(--r); border: 1px solid var(--accent); background: var(--accent-soft); }
.guest-cta-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 15px; }
.guest-cta-list .ic { color: var(--accent); margin-right: 6px; }
.guest-cta-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.helper-auth { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.code-input { font: 600 28px/1 var(--mono); letter-spacing: .5em; text-align: center; max-width: 9em; }
/* Тренды: фото реальных примеров с атрибуцией */
.trend-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin: 20px 0 28px; }
.trend-gallery figure { margin: 0; }
.trend-gallery img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r); display: block; background: var(--line); }
.trend-gallery figcaption { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; font-size: 14px; line-height: 1.35; }
.trend-gallery .credit { font-size: 11px; color: var(--muted, #8a8275); }
.trend-gallery .credit a { color: inherit; }
.gallery-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.gallery-row .input { flex: 1 1 10em; width: auto; min-width: 0; }
.gallery-row img { border-radius: 6px; object-fit: cover; }
/* Админка: аналитика */
.an-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.an-tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; color: inherit; font-weight: 600; font-size: 14px; display: inline-flex; gap: 6px; align-items: center; }
.an-tabs a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.an-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 14px 0; }
.an-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); }
.an-kpi b { font: 700 26px/1.1 var(--font); }
.an-ratios .an-kpi { background: var(--accent-soft); border-color: transparent; }
.an-change { font-size: 13px; font-weight: 600; }
.an-change.up { color: #2e8b57; } .an-change.down { color: #d0453a; }
.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.an-widget.wide { grid-column: 1 / -1; }
@media (max-width: 900px) { .an-grid { grid-template-columns: 1fr; } }
.an-chart { margin: 10px 0 6px; min-height: 60px; }
.an-svg { width: 100%; height: auto; display: block; }
.an-svg .an-grid { stroke: var(--line); stroke-width: 1; }
.an-svg .an-ax { font: 11px var(--font); fill: currentColor; opacity: .6; }
.an-svg .an-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.an-svg .an-area { fill: var(--accent); opacity: .12; }
.an-svg .an-prev { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-dasharray: 5 4; opacity: .45; }
.an-svg .an-dot { fill: var(--accent); }
.an-svg .an-bar { fill: var(--accent); opacity: .85; }
.an-legend { display: flex; gap: 14px; font-size: 12px; opacity: .75; }
.an-legend .cur::before, .an-legend .prev::before { content: ''; display: inline-block; width: 18px; height: 0; border-top: 2.5px solid var(--accent); vertical-align: middle; margin-right: 6px; }
.an-legend .prev::before { border-top: 1.5px dashed currentColor; }
.an-hbar { display: grid; gap: 6px; }
.an-hrow { display: grid; grid-template-columns: minmax(0, 38%) 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.an-hl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-htrack { height: 10px; background: var(--line); border-radius: 5px; overflow: hidden; }
.an-hfill { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.an-hv { font-variant-numeric: tabular-nums; white-space: nowrap; opacity: .8; }
.an-insights { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 13px; line-height: 1.4; }
.an-i::before { content: '•'; margin-right: 6px; font-weight: 700; }
.an-i.up::before { content: '▲'; color: #2e8b57; } .an-i.down::before { content: '▼'; color: #d0453a; }
.an-i.warn::before { content: '!'; color: #d08a1a; } .an-i.muted { opacity: .65; }
.an-builder { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: flex-end; }
.an-builder > label:not(.checkbox) { display: flex; flex-direction: column; gap: 4px; font-size: 13px; flex: 1 1 160px; }
.an-builder .an-widget { flex: 1 1 100%; }
.an-kpis a.an-kpi { text-decoration: none; color: inherit; } .an-kpis a.an-kpi:hover { border-color: var(--accent); }
/* Предупреждение под калькулятором */
.calc-disclaimer { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 0; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--line); font-size: 13px; line-height: 1.45; color: var(--muted, inherit); }
.calc-disclaimer .ic { flex: none; margin-top: 2px; color: #d08a1a; }
.an-kpi.is-bumped b { animation: kpi-bump .8s ease; } @keyframes kpi-bump { 0% { color: var(--accent); } 100% { color: inherit; } }
/* График: недельные часы, переключатель квартира/дом, группы дома */
.plan-controls > .seg button { padding: 8px 18px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; border-radius: 8px; cursor: pointer; }
.plan-controls > .seg button.is-on { background: var(--accent); color: var(--accent-ink); }
.plan-week { margin-top: 14px; }
.plan-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 6px; }
.plan-day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.plan-day .input { text-align: center; padding-inline: 4px; }
.plan-day.is-weekend span { color: var(--accent); font-weight: 600; }
.plan-gantt .g-prep { fill: #7a7f87; }
.plan-gantt .g-house { fill: #8a5a2b; }
