:root {
    --bg: #f6f4f0;
    --panel: #ffffff;
    --ink: #24221f;
    --muted: #7a756d;
    --line: #e4e0d8;
    --soft: #f1eee8;
    --accent: #b5652b;
    --accent-ink: #ffffff;
    --accent-soft: #f6e7db;
    --danger: #c0392b;
    --ok: #2e7d4f;
    --radius: 10px;
    --shadow: 0 6px 24px rgba(40, 30, 20, .12);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--ink);
    font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}

button, input, select { font: inherit; color: inherit; }

/* ---------- Шапка ---------- */
.top {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 56px;
    padding: 0 16px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.logo {
    font-size: 20px;
    letter-spacing: .2px;
    white-space: nowrap;
}
.logo b { color: var(--accent); }
.logo span { color: var(--muted); font-size: 14px; }
a.logo { color: inherit; text-decoration: none; }

/* Переключатель комнат в шапке */
.rooms { display: flex; gap: 4px; }
.rooms a {
    color: var(--muted);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 8px;
    font-weight: 600;
}
.rooms a:hover { color: var(--ink); background: var(--soft); }
.rooms a.on { color: var(--ink); background: var(--accent-soft); }

/* ---------- Стартовая страница ---------- */
body.landing { height: auto; min-height: 100%; }
.land { max-width: 960px; margin: 0 auto; padding: 40px 16px 60px; }
.land h1 { font-size: 34px; margin: 0 0 10px; letter-spacing: -.3px; }
.land-lead { font-size: 16px; color: var(--muted); max-width: 640px; margin: 0 0 28px; }
.room-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.room-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px 14px 18px;
    color: inherit;
    text-decoration: none;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.room-card:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.room-card svg { width: 100%; height: auto; border-radius: 10px; margin-bottom: 6px; }
.room-card b { font-size: 20px; }
.room-card span { color: var(--muted); }
.room-card em { font-style: normal; color: var(--accent); font-weight: 600; margin-top: 4px; }
.how { list-style: none; counter-reset: how; padding: 0; margin: 36px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.how li { counter-increment: how; display: flex; flex-direction: column; gap: 4px; }
.how li::before {
    content: counter(how);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--accent-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.how span { color: var(--muted); font-size: 13px; }

.project-name {
    flex: 1;
    min-width: 0;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 10px;
    background: var(--soft);
    cursor: text;
}
.project-name .pn-cap { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.project-name input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-weight: 600; color: inherit; padding: 2px 0; outline: none; }
.project-name .pn-edit { color: var(--muted); }
.project-name:hover, .project-name:focus-within { border-color: var(--accent); }

.top-actions { margin-left: auto; display: flex; gap: 8px; }

/* ---------- Кнопки ---------- */
.btn {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: var(--accent-ink);
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    white-space: nowrap;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.danger { background: transparent; color: var(--danger); border-color: #e9c3be; }
.btn.danger:hover { background: #fbecea; }
.btn.icon { padding: 6px 10px; }

/* ---------- Раскладка ---------- */
/* Комната слева, панель с блоками и управлением справа */
.layout {
    display: flex;
    flex-direction: row-reverse;
    height: calc(100% - 56px);
}

.panel {
    width: 360px;
    flex: none;
    display: flex;
    flex-direction: column;
    background: var(--panel);
    border-left: 1px solid var(--line);
    min-height: 0;
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
}
.tab {
    flex: 1;
    padding: 12px 4px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    cursor: pointer;
    color: var(--muted);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

.tab-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}
.tab-body h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin: 4px 0 10px; }
.tab-body h3:not(:first-child) { margin-top: 22px; }

.stage { position: relative; flex: 1; min-width: 0; }
#viewport { position: absolute; inset: 0; }
#viewport canvas { display: block; outline: none; touch-action: none; }

/* ---------- Поля ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.field input, .field select, .field textarea {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; cursor: pointer; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { flex: 1; border: 0; background: var(--panel); padding: 7px 6px; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: var(--accent-ink); }
.seg.small button { padding: 4px 8px; font-size: 13px; }

/* ---------- Шаги сборки ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; }
.step {
    position: relative;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 10px;
    padding: 8px 4px 7px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    line-height: 1.2;
    text-align: center;
}
.step i {
    font-style: normal;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--soft);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}
.step b {
    position: absolute;
    top: 4px;
    right: 5px;
    font-size: 10px;
    color: var(--muted);
    font-weight: 600;
}
.step:hover { border-color: var(--accent); }
.step.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.step.on i { background: var(--accent); color: var(--accent-ink); }
.step-hint { margin: 8px 0 12px; min-height: 16px; }
.heights td { padding: 4px; font-size: 13px; }
.clear-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.small-btn { padding: 4px 10px; font-size: 12px; }

/* ---------- Каталог ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 12px; }
.chip {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 99px;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 13px;
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color .15s, box-shadow .15s;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card-main {
    border: 0;
    background: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.vars { display: flex; flex-wrap: wrap; gap: 4px; }
.var {
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 6px;
    padding: 2px 6px;
    font-size: 12px;
    cursor: pointer;
}
.var:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
#catSearch { width: 100%; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.cat-set { width: 100%; margin-top: 6px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
/* стандартная кухня: вид блока крупными кнопками (планшет), фильтры, надпись про стандартные размеры */
.std-notice { font-size: 12px; line-height: 1.4; background: var(--soft); border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; }
.std-notice a { color: var(--accent); font-weight: 600; white-space: nowrap; }
.kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin: 0 0 10px; }
.kind-btn { min-height: 44px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); font-size: 13px; font-weight: 600; cursor: pointer; line-height: 1.2; }
.kind-btn:hover { border-color: var(--accent); }
.kind-btn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.flt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.flt-cap { font-size: 12px; color: var(--muted); min-width: 64px; }
.flt .chip { min-height: 34px; }
[hidden] { display: none !important; }
.card img, .card .noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--soft); border-radius: 6px; }
.card .nm { font-size: 13px; font-weight: 600; line-height: 1.25; }
.card .sz { font-size: 12px; color: var(--muted); }
.badge { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 99px; background: var(--soft); color: var(--muted); margin-left: 4px; vertical-align: middle; font-weight: 400; }

/* ---------- Цвета ---------- */
.cgroup { margin-bottom: 20px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.sw {
    border: 2px solid transparent;
    border-radius: 10px;
    background: none;
    padding: 0;
    cursor: pointer;
    text-align: center;
    font-size: 11px;
    color: var(--muted);
}
.sw i {
    display: block;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(0, 0, 0, .12);
    background-size: cover;
    margin-bottom: 3px;
}
.sw.on { border-color: var(--accent); color: var(--ink); }
.sw.custom i { display: flex; align-items: center; justify-content: center; font-size: 18px; color: var(--muted); background: repeating-linear-gradient(45deg, #fff, #fff 6px, var(--soft) 6px, var(--soft) 12px); }
.sw input[type=color] { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }

.linkbtn { border: 0; background: none; padding: 0; margin: -4px 0 10px; color: var(--accent); cursor: pointer; font-size: 12px; text-decoration: underline; }

/* ---------- Итог ---------- */
.sum-table { width: 100%; border-collapse: collapse; margin-bottom: 14px; }
.sum-table th, .sum-table td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.sum-table th { font-size: 12px; color: var(--muted); font-weight: 600; }
.sum-table td.n { text-align: right; white-space: nowrap; }
.warn { background: #fdf0ee; color: var(--danger); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.good { background: #ecf6f0; color: var(--ok); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; }
.files a { color: var(--accent); word-break: break-all; }
.files li { margin-bottom: 3px; }
.files ul { margin: 4px 0 10px; padding-left: 18px; }

/* ---------- Сцена ---------- */
/* Размеры на сцене */
.dims { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.dim {
    position: absolute;
    left: 0;
    top: 0;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}
.dim-room { color: #4a4540; }
.dim-block { color: #fff; background: var(--accent); }
.dim-free { color: var(--ok); }
.dim-placed { opacity: .55; font-size: 11px; }
.show-hidden { position: absolute; right: 12px; top: 60px; z-index: 6; font-weight: 600; box-shadow: var(--shadow); }
.show-hidden[hidden] { display: none; }
.sel-handles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.sel-handles[hidden] { display: none; }
@media (max-width: 820px) { .show-hidden { top: 54px; right: 8px; } }
/* «свободно N» - нажимается: каталог покажет блоки, которые туда помещаются */
.dim.dim-pick { pointer-events: auto; cursor: pointer; border: 1px solid var(--ok); }
.dim.dim-pick:hover { background: var(--ok); color: #fff; }
.gap-banner { font-size: 12px; background: #e6f2ea; border: 1px solid var(--ok); border-radius: 8px; padding: 6px 8px; margin: 0 0 10px; }
.gap-banner .gb-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.gap-banner .gb-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; }
.gap-banner .gb-opt { background: #fff; border-color: var(--ok); color: var(--ok); font-weight: 600; }
.gap-banner .gb-opt:hover { background: var(--ok); color: #fff; }
.card.exact { border-color: var(--ok); }
.var.exact { border-color: var(--ok); background: #e6f2ea; font-weight: 600; }
.badge.exact { background: var(--ok); color: #fff; }

.view-buttons {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    background: var(--panel);
    border-radius: 8px;
    box-shadow: var(--shadow);
    overflow: hidden;
}
.view-buttons button { border: 0; background: none; padding: 6px 12px; cursor: pointer; }
.view-buttons button.on { background: var(--ink); color: #fff; }
.view-buttons .open-all { border-left: 1px solid var(--line); color: var(--accent); font-weight: 600; }
/* «Виды» - одна кнопка с выпадающим списком */
.view-buttons.vb-drop { overflow: visible; z-index: 5; }
.view-buttons .vb-toggle { font-weight: 600; padding: 6px 14px; }
.vb-menu {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 170px;
    display: flex; flex-direction: column; background: var(--panel);
    border-radius: 8px; box-shadow: var(--shadow); overflow: hidden;
}
.vb-menu[hidden] { display: none; }
.view-buttons .vb-menu button { text-align: left; padding: 8px 14px; }
.view-buttons .vb-menu .vb-viewer { border-top: 1px solid var(--line); }
.btn:disabled { opacity: .4; cursor: default; filter: none; }

/* Окна и двери на вкладке «Комната» */
.opening { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px 10px; margin-bottom: 8px; background: var(--soft); }
.op-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.op-del { border: 0; background: none; font-size: 18px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.op-del:hover { color: var(--danger); }
.op-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.op-grid label { display: flex; flex-direction: column; font-size: 11px; color: var(--muted); gap: 2px; }
.op-grid input, .op-grid select { width: 100%; padding: 4px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 13px; }

.selbar {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    background: var(--panel);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 10px 12px;
    width: min(960px, calc(100% - 24px));   /* широкая и низкая: кнопки в ряд, комнату не закрывает (Андрей 30.10) */
    box-sizing: border-box;
}
.sel-title { display: flex; gap: 8px; align-items: baseline; margin-bottom: 8px; flex-wrap: wrap; }
.sel-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sel-off { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sel-off input { width: 84px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; }
.selbar.bad { outline: 2px solid var(--danger); }

.hint {
    position: absolute;
    left: 12px;
    top: 12px;
    max-width: 420px;
    font-size: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, .8);
    border-radius: 8px;
    padding: 6px 10px;
    pointer-events: none;
}

/* Силуэт кухни: подпись зоны у курсора и строка «Выбрано: …» над каталогом */
.ghost-tip {
    position: absolute; z-index: 6; pointer-events: none; white-space: nowrap;
    background: var(--ink); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; box-shadow: var(--shadow);
}
.ghost-tip[hidden] { display: none; }
.zone-now { flex-basis: 100%; font-size: 12px; line-height: 1.4; color: var(--muted); margin-bottom: 4px; }
.zone-now b { color: var(--accent); }

/* Кнопка «?» на сцене: наведение - короткая подсказка, щелчок - инструкция */
.help { position: absolute; left: 12px; top: 12px; z-index: 5; }
.help-btn {
    width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--panel); color: var(--accent); font-weight: 700; font-size: 15px;
    box-shadow: var(--shadow);
}
.help-tip {
    display: none; position: absolute; left: 0; top: 38px; width: 320px;
    font-size: 12px; color: var(--ink); background: var(--panel);
    border-radius: 8px; padding: 8px 10px; box-shadow: var(--shadow); pointer-events: none;
}
.help:hover .help-tip { display: block; }
.help-modal { position: fixed; inset: 0; z-index: 60; background: rgba(20, 16, 12, .55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.help-modal[hidden] { display: none; }
.help-box { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); width: min(560px, 100%); max-height: 100%; overflow-y: auto; padding: 14px 18px; }
.help-head { display: flex; align-items: center; justify-content: space-between; font-size: 16px; }
.help-x { border: 0; background: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; }
.help-box ol { padding-left: 20px; margin: 10px 0; font-size: 13px; line-height: 1.5; }
.help-box li { margin-bottom: 8px; }

.toast {
    position: absolute;
    left: 50%;
    top: 16px;
    transform: translateX(-50%);
    background: var(--ink);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    font-size: 13px;
}

/* ---------- Телефон ---------- */
@media (max-width: 820px) {
    .top { gap: 8px; padding: 0 12px; }
    .project-name { display: none; }
    .top-actions .btn.ghost { padding: 6px 8px; }
    #btnNew { display: none; }
    .layout { flex-direction: column-reverse; height: auto; }
    .stage { height: 58vh; flex: none; }
    .panel { width: 100%; border-left: 0; border-top: 1px solid var(--line); }
    .tab-body { overflow: visible; }
    .hint { display: none; }
    .cards { grid-template-columns: 1fr 1fr; }
    .rooms a { padding: 6px 8px; }
    .room-cards { grid-template-columns: 1fr; }
    .how { grid-template-columns: 1fr 1fr; }
    .land h1 { font-size: 26px; }
}

/* ---------- «3D просмотр» комнаты (без редактирования, с размерами) ---------- */
.room-viewer { position: fixed; inset: 0; z-index: 3000; background: var(--bg, #f6f4f0); display: flex; flex-direction: column; }
.room-viewer .rv-bar { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.room-viewer .rv-bar .btn { margin-left: auto; }
.room-viewer iframe { flex: 1; width: 100%; border: 0; }
.view-buttons .vb-viewer { font-weight: 600; color: var(--accent); }

/* ---------- Комнаты: планшет и телефон (палец) ---------- */
@media (pointer: coarse) {
    .btn { min-height: 40px; padding: 8px 14px; }
    .btn.icon { min-width: 44px; }
    .tab { padding: 14px 4px; }
    .var { min-height: 34px; min-width: 46px; font-size: 13px; }
    .chip { min-height: 36px; }
    .sel-off input { height: 40px; width: 96px; }
}
.sheet-handle { display: none; }
@media (max-width: 820px) {
    body.room-app { overflow: hidden; }
    body.room-app .top-actions { overflow-x: auto; }
    body.room-app .layout { display: block; position: relative; height: calc(100vh - 56px); height: calc(100dvh - 56px); }
    body.room-app .stage { position: absolute; inset: 0; height: auto; }
    body.room-app .panel { position: fixed; left: 0; right: 0; bottom: 0; width: auto; z-index: 20; height: 50vh;
        border: 0; border-radius: 14px 14px 0 0; box-shadow: 0 -6px 24px rgba(0, 0, 0, .18); transition: height .2s; }
    body.room-app.sheet-peek .panel { height: 92px; }
    body.room-app.sheet-full .panel { height: 88vh; }
    body.room-app .tab-body { overflow-y: auto; }
    body.room-app .sheet-handle { display: block; flex: none; width: 100%; height: 22px; border: 0; background: none; cursor: pointer; padding: 0; }
    body.room-app .sheet-handle i { display: block; width: 44px; height: 5px; border-radius: 3px; background: #c9c2b4; margin: 8px auto 0; }
    /* шапка - одной строкой, прокручивается вбок */
    body.room-app .top { flex-wrap: nowrap; height: 56px; overflow-x: auto; overflow-y: hidden; padding: 0 8px; }
    body.room-app .top .logo { flex: none; font-size: 15px; }
    body.room-app .top .rooms { display: flex; flex-wrap: nowrap; flex: none; }
    body.room-app .top .rooms a { white-space: nowrap; padding: 6px 6px; }
    body.room-app .top-actions { flex: none; overflow: visible; }
    body.room-app .top-actions .btn { min-height: 36px; padding: 4px 10px; }
    /* карточка выбранного блока - внизу, над свёрнутой шторкой */
    body.room-app .selbar { position: fixed; top: auto; bottom: 100px; left: 8px; right: 8px; transform: none; width: auto; max-width: none; z-index: 15; padding: 8px 10px; font-size: 13px; }
    body.room-app.sheet-half .selbar, body.room-app.sheet-full .selbar { display: none; }
    /* карточка низкая, комнату не закрывает (Андрей 30.10): название в строку, кнопки в один ряд - листаются пальцем вбок */
    body.room-app .selbar .sel-title { flex-wrap: nowrap; margin-bottom: 6px; white-space: nowrap; overflow: hidden; }
    body.room-app .selbar #selName { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
    body.room-app .selbar #selSize { flex: none; }
    body.room-app .selbar .sel-row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
    body.room-app .selbar .sel-row > * { flex: none; }
    body.room-app .selbar .sel-handles { margin-top: 6px; padding-top: 6px; }
}

/* ----- Фото (рендер) ----- */
.photo-modal { position: fixed; inset: 0; z-index: 50; background: rgba(20, 16, 12, .72); display: flex; align-items: center; justify-content: center; padding: 16px; }
.photo-modal[hidden] { display: none; }
.photo-box { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); width: min(1280px, 100%); max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.photo-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.photo-status { color: var(--muted); font-size: 13px; }
.photo-x { margin-left: auto; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.photo-x:hover { color: var(--ink); }
.photo-stage { position: relative; background: #1d1a17; min-height: 200px; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.photo-canvas { display: block; max-width: 100%; max-height: calc(100vh - 150px); width: auto !important; height: auto !important; }
.photo-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .15); }
.photo-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.photo-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.photo-hint { color: var(--muted); font-size: 13px; margin-right: auto; }

/* ---------- Цена в шапке ---------- */
.price-badge {
    display: flex; flex-direction: column; align-items: flex-end; gap: 0;
    border: 1px solid var(--line); background: var(--soft); border-radius: 8px;
    padding: 2px 10px; cursor: pointer; line-height: 1.2; white-space: nowrap; margin-left: auto;
}
.price-badge b { color: var(--accent); }
.price-badge .pb-make { font-size: 11px; color: var(--muted); }
.price-badge:hover { border-color: var(--accent); }
.price-badge + .top-actions { margin-left: 0; }
/* на сцене - в левом нижнем углу */
.stage .price-badge {
    position: absolute; left: 12px; top: 60px; z-index: 5; margin: 0;   /* вверху слева: внизу не закрывает карточку блока */
    align-items: flex-start; padding: 6px 12px; background: var(--panel); box-shadow: var(--shadow);
}
.btn.order { font-weight: 600; }
textarea { font: inherit; color: inherit; resize: vertical; }

/* ---------- Цена в «Итоге» ---------- */
.price-box { border: 1px solid var(--accent); background: var(--accent-soft); border-radius: 12px; padding: 12px; margin: 10px 0 18px; }
.pr-main { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.pr-main b { font-size: 22px; color: var(--accent); white-space: nowrap; }
.pr-order { width: 100%; margin-top: 10px; padding: 9px; font-weight: 600; }

/* ---------- Перетаскивание из каталога ---------- */
.card-main[draggable="true"], .var[draggable="true"] { cursor: grab; }
#viewport.drop-on { outline: 3px dashed var(--accent); outline-offset: -8px; }

/* ---------- Заявка ---------- */
.om { position: fixed; inset: 0; z-index: 60; background: rgba(20, 16, 12, .6); display: flex; align-items: center; justify-content: center; padding: 16px; }
.om[hidden] { display: none; }
.om-box { position: relative; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); width: min(440px, 100%); max-height: 100%; overflow-y: auto; padding: 18px 18px 14px; }
.om-box h2 { margin: 0 0 10px; font-size: 20px; }
.om-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }
.om-price { background: var(--soft); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.om-price div { display: flex; justify-content: space-between; gap: 10px; }
.om-price b { color: var(--accent); font-size: 18px; }
.om-hp { position: absolute; left: -5000px; width: 1px; height: 1px; opacity: 0; }
.om-err { background: #fdf0ee; color: var(--danger); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.om-foot { display: flex; gap: 8px; margin-top: 6px; }
.om-foot .btn { padding: 8px 16px; }

/* ---------- Тур ---------- */
.tour-hole { position: fixed; z-index: 70; border-radius: 10px; box-shadow: 0 0 0 9999px rgba(20, 16, 12, .55); pointer-events: none; transition: all .25s; }
.tour-box { position: fixed; z-index: 71; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; transition: top .25s, left .25s; }
.tour-text { margin-bottom: 10px; }
.tour-foot { display: flex; gap: 6px; align-items: center; }
.tour-foot .tour-n { margin-right: auto; }

/* ---------- Главная: галерея, отзывы, связь ---------- */
.land h2 { font-size: 24px; margin: 48px 0 16px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; cursor: zoom-in; }
.gallery img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery figcaption { padding: 8px 10px; font-size: 13px; color: var(--muted); }
.reviews { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.review { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.review .stars { color: #e3a008; letter-spacing: 2px; }
.review p { margin: 6px 0 8px; }
.review b { font-size: 13px; }
.lightbox { position: fixed; inset: 0; z-index: 80; background: rgba(10, 8, 6, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 80px); border-radius: 8px; }
.lightbox span { color: #fff; margin-top: 10px; }
.contact { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.contact p { margin: 0; flex: 1 1 260px; }
.price-how { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.price-how div { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.price-how b { display: block; margin-bottom: 4px; }

@media (max-width: 820px) {
    .price-badge .pb-make { display: none; }
    .price-badge { padding: 4px 8px; }
    #btnHelp { display: none; }
    .steps { grid-template-columns: repeat(3, 1fr); }
    .price-how { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
    .top { height: auto; min-height: 56px; flex-wrap: wrap; padding: 8px 12px; row-gap: 6px; }
    .top-actions { flex-wrap: wrap; }
}
a.btn { text-decoration: none; display: inline-block; }

@media (max-width: 820px) {
    .view-buttons { left: 46px; right: 8px; overflow-x: auto; }
    .view-buttons.vb-drop { left: auto; overflow: visible; }
    .view-buttons button { flex: none; white-space: nowrap; }
    .help { left: 8px; }
    .stage .price-badge { bottom: auto; top: 54px; left: 8px; }
    .help-tip { display: none !important; }
}

/* ---------- Страница «Конструкторам» ---------- */
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tool:hover { border-color: var(--accent); box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--accent); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.tool b { font-size: 18px; }
.tool span:not(.tool-ico) { color: var(--muted); }
.tool em { font-style: normal; color: var(--accent); font-weight: 600; }
.tool em.dev { align-self: flex-start; color: #8a5a14; background: #fbe9cc; border-radius: 6px; padding: 1px 8px; }
.shop { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.item { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.item b { font-size: 16px; padding-right: 40px; }
.item p { margin: 0; color: var(--muted); font-size: 13px; flex: 1; }
.item-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.item-price { font-weight: 700; color: var(--accent); }
.item-tag { position: absolute; top: 12px; right: 12px; font-size: 11px; background: var(--accent); color: #fff; border-radius: 99px; padding: 2px 8px; }
.item.soon { border-style: dashed; }
@media (max-width: 820px) { .tools { grid-template-columns: 1fr; } }
/* Описание сайта на главной */
.about { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin: 0 0 28px; }
.land .about h2 { font-size: 20px; margin: 0 0 8px; }
.about p { margin: 0 0 12px; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.about-cols div { color: var(--muted); font-size: 14px; }
.about-cols b { display: block; color: var(--ink); margin-bottom: 4px; }
@media (max-width: 820px) { .about-cols { grid-template-columns: 1fr; } }
/* «Полный отчёт»: инструмент внутри отчёта - без шапки сайта и кнопки кабинета */
.in-hub header.top, .in-hub body > .top, .in-hub .msa-pill { display: none !important; }
.in-hub #v3Left, .in-hub #esLeft { visibility: hidden; }   /* лимит считает сам отчёт */

/* ================= Тема страниц комнат (Гуля 25.10) =================
   Своя, не как у других сайтов: спокойный серый (не мрачный графит), янтарно-оранжевый (дерево) - главные действия
   и выбранное, листовой зелёный - «можно / свободно / цена». Только body.room-app (Кухня СТ, Кухня, Спальня). */
body.room-app {
    --bg: #474a4e;
    --panel: #53575c;
    --ink: #f4f2ee;
    --muted: #cdc8c1;
    --line: #6b7076;
    --soft: #5e6268;
    --accent: #f08c2e;
    --accent-ink: #1b1209;
    --accent-soft: rgba(240, 140, 46, .22);
    --ok: #4fd07e;
    --green: #2f9e58;
    --danger: #ff8a7d;
    --shadow: 0 8px 28px rgba(0, 0, 0, .3);
    --scene: #a7aaae;     /* фон 3D-сцены за комнатой (в 3D цвет темнеет - берём светлее панели) */
    --strong: #3d4044;     /* плашки: подсказки, сообщения */
    color-scheme: dark;
}
body.room-app .top { background: #3d4044; border-bottom-color: #5c6066; }
body.room-app .logo { display: inline-flex; align-items: center; }
/* название (Андрей 25.10): сверху «Mebel Sam», под ним чётко «Werdan constructor» */
.logo-txt { display: inline-flex; flex-direction: column; line-height: 1.05; }
.logo-name { font-size: 19px; font-weight: 700; letter-spacing: .3px; color: var(--ink); }
.logo .logo-name b { color: var(--accent); }
.logo .logo-sub { font-size: 10.5px; font-weight: 600; letter-spacing: 1.6px; text-transform: uppercase; margin-top: 3px; color: var(--ok); }
body.room-app .rooms a { white-space: nowrap; padding-left: 10px; padding-right: 10px; }
.logo-mark { width: 36px; height: 24px; flex: none; margin-right: 9px; }
/* две панели (компьютер): слева «Комната» и «Каталог» - с чего начинают, справа «Цвета» и «Итог» */
body.room-app .panel-left { border-left: 0; border-right: 1px solid var(--line); width: 340px; }
body.room-app.two-panels .panel:not(.panel-left) { width: 310px; }
body.room-app.two-panels .tab-body { overflow-x: hidden; }
body.room-app.two-panels .field select { text-overflow: ellipsis; }
/* название проекта - в «Комнате» (в шапке ему тесно) */
.project-name.in-panel { display: flex; max-width: none; width: 100%; margin: 0 0 14px; align-items: center; gap: 8px;
    background: var(--soft); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.project-name.in-panel input { flex: 1; min-width: 0; background: transparent; border: 0; color: var(--ink); font-weight: 600; }
/* заставка пустой комнаты: логотип по центру и с чего начать */
.splash { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 4; text-align: center; pointer-events: none;
    background: rgba(61, 64, 68, .88); border: 1px solid var(--line); border-radius: 18px; padding: 22px 28px; box-shadow: var(--shadow);
    animation: splash-in .6s ease-out; max-width: min(420px, 90%); }
.splash img { width: 108px; height: 72px; display: block; margin: 0 auto 10px; }
.splash .logo-name { font-size: 26px; }
.splash .logo-sub { font-size: 12px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; color: var(--ok); margin: 4px 0 12px; }
.splash p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.45; }
/* «Кухня под размер»: удобные размеры (картинка эргономики) */
.ergo { background: var(--soft); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 14px; font-size: 12.5px; line-height: 1.45; }
.ergo p { margin: 6px 0 4px; color: var(--muted); }
.ergo .linkbtn { margin: 0; }
.ergo-svg { display: block; width: 100%; max-width: 320px; margin: 6px auto 0; }
.ergo-svg .e-floor { stroke: var(--muted); stroke-width: 2; }
.ergo-svg .e-base, .ergo-svg .e-wall { fill: rgba(240, 140, 46, .25); stroke: var(--accent); stroke-width: 1.5; }
.ergo-svg .e-top { fill: var(--accent); }
.ergo-svg .e-man { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.ergo-svg .e-man circle { fill: var(--ink); }
.ergo-svg .e-dim line { stroke: var(--ok); stroke-width: 1.5; stroke-dasharray: 4 3; }
.ergo-svg .e-dim text { fill: var(--ok); font-size: 11px; font-weight: 700; }
.ergo-svg .e-lab { fill: var(--ink); font-size: 11px; }
.ergo-svg .e-lab2 { fill: var(--muted); font-size: 10px; }
.help-box .ergo-svg { max-width: 360px; }
/* «Полки − / +» в панели выбранного блока */
.sel-shelves { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: 13px; }
.sel-shelves .ss-row { display: inline-flex; align-items: center; gap: 6px; }
.sel-shelves b { min-width: 16px; text-align: center; font-size: 15px; }
.sel-shelves .btn.icon { padding: 2px 10px; font-size: 16px; line-height: 1.2; }
/* окно «Декоры» */
.decor-modal .help-box { width: min(760px, 100%); }
.dm-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 4px; }
.dm-q { flex: 1; min-width: 200px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--soft); color: var(--ink); }
.dm-brands { display: flex; flex-wrap: wrap; gap: 4px; }
.dm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 8px; }
.dm-it { border: 1px solid var(--line); border-radius: 10px; background: var(--soft); padding: 4px; cursor: pointer; color: var(--ink); font-size: 11px; line-height: 1.2; text-align: center; }
.dm-it:hover { border-color: var(--accent); }
.dm-it img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; display: block; margin-bottom: 3px; }
.sw.decor-more i { display: flex; align-items: center; justify-content: center; font-size: 20px; color: var(--accent); background: var(--soft); }
/* полоска преимуществ над сценой */
.perks { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 3; display: flex; gap: 6px; pointer-events: none; white-space: nowrap; }
.perks span { font-size: 12px; font-weight: 600; color: var(--ink); background: rgba(61, 64, 68, .82); border: 1px solid var(--line); border-radius: 99px; padding: 4px 10px; }
.perks span::before { content: '✓'; color: var(--ok); margin-right: 5px; font-weight: 700; }
@media (max-width: 1250px) { .perks span:nth-child(n+3) { display: none; } }
@media (max-width: 1750px) { body.two-panels .perks span:nth-child(n+3) { display: none; } }   /* сцена между двумя панелями уже */
@media (max-width: 820px) { .perks { display: none; } }
/* «хит» на ходовых видах блоков */
.kind-btn { position: relative; }
.kind-btn .hit { position: absolute; top: -7px; right: -4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
    background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 1px 6px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); }
/* цена с кнопкой «Купить» (от 3 блоков) */
.stage .price-badge.cta { flex-direction: row; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; font-size: 15px; border-color: var(--accent);
    box-shadow: 0 6px 20px rgba(240, 140, 46, .28); animation: cta-in .4s ease-out; }
.stage .price-badge.cta b { font-size: 18px; }
.price-badge .pb-buy { background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 8px; padding: 6px 14px; font-size: 14px; }
.price-badge .pb-buy:hover { filter: brightness(1.08); }
@keyframes cta-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
/* витрина готовых кухонь (пустая комната) */
.splash.showcase { pointer-events: auto; width: min(560px, 92%); max-width: none; padding: 16px 20px 18px; top: 50%; }
.showcase .sc-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.showcase .sc-head img { width: 39px; height: 26px; margin: 0; }
.showcase .sc-head .logo-name { font-size: 18px; text-align: left; }
.showcase .sc-head .logo-sub { font-size: 10px; margin: 2px 0 0; text-align: left; }
.showcase .logo-name b { color: var(--accent); }
.showcase h2 { margin: 6px 0 10px; font-size: 20px; line-height: 1.25; color: var(--ink); }
.sc-slide { position: relative; }
.sc-pic { aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: linear-gradient(135deg, #5e6268, #3d4044); }
.sc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; animation: sc-fade .5s ease-out; }
.sc-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(0, 0, 0, .45); color: #fff; font-size: 22px; line-height: 1; }
.sc-arrow:hover { background: var(--accent); color: var(--accent-ink); }
.sc-prev { left: 8px; } .sc-next { right: 8px; }
.sc-name { margin-top: 10px; font-size: 17px; font-weight: 700; color: var(--ink); }
.sc-note { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.sc-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 12px; }
.sc-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); cursor: pointer; }
.sc-dots i.on { background: var(--accent); width: 22px; border-radius: 4px; }
.sc-btns { display: flex; gap: 8px; justify-content: center; }
.sc-btns .btn { padding: 9px 18px; font-size: 14px; }
.sc-btns .sc-take { font-weight: 700; box-shadow: 0 4px 14px rgba(240, 140, 46, .35); }
/* витрина не наезжает на полоску и размеры: полоска прячется, карточка - по высоте сцены, картинка уменьшается */
body.showcase-open .perks { display: none; }
.splash.showcase { max-height: calc(100% - 20px); overflow-y: auto; }
.sc-pic { max-height: 34vh; }
@media (max-height: 760px) { .showcase .sc-head { display: none; } .showcase h2 { font-size: 17px; margin-top: 0; } .sc-pic { max-height: 28vh; } }
/* популярные блоки под каруселью */
.sc-pop-cap { font-size: 12px; color: var(--muted); margin: 12px 0 6px; }
.sc-pop { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.sc-pop-item { border: 1px solid var(--line); background: var(--soft); border-radius: 10px; padding: 4px; cursor: pointer; color: var(--ink); font-size: 11px; line-height: 1.2; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sc-pop-item:hover { border-color: var(--accent); }
.sc-pop-item img, .sc-pop-item .noimg { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; border-radius: 6px; background: rgba(255, 255, 255, .06); display: block; margin: 0; }
@keyframes sc-fade { from { opacity: .2; transform: scale(1.03); } to { opacity: 1; transform: none; } }
/* телефон: витрина на весь экран под шапкой, поверх шторки - иначе кнопки уходят под панель (Андрей 30.10) */
@media (max-width: 820px) {
    .splash.showcase { position: fixed; top: 56px; left: 0; right: 0; bottom: 0; width: auto; max-height: none; transform: none; animation: none; z-index: 30; border-radius: 0; padding: 12px 12px 20px; }
    .showcase .sc-head { display: none; }
    .showcase h2 { font-size: 16px; margin-top: 0; }
    .sc-pic { max-height: 30vh; }
    .sc-btns .btn { padding: 12px 14px; flex: 1; }
}
@keyframes splash-in { from { opacity: 0; transform: translate(-50%, -44%) scale(.94); } to { opacity: 1; transform: translate(-50%, -50%); } }
/* тарифы на вкладке «Итог»: бесплатно / купить проект / пробный доступ мастерам */
.plans { display: grid; gap: 8px; margin: 0 0 16px; }
.plan { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: var(--soft); }
.plan h4 { margin: 0 0 2px; font-size: 14px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.plan p { margin: 0 0 8px; font-size: 12px; color: var(--muted); line-height: 1.4; }
.plan .tag { font-size: 11px; font-weight: 600; border-radius: 99px; padding: 1px 8px; background: var(--accent-soft); color: var(--accent); }
.plan.free .tag { background: rgba(61, 187, 108, .16); color: var(--ok); }
.plan.buy { border-color: var(--accent); }
.plan .btn { width: 100%; }
body.room-app .logo b { color: var(--accent); }
body.room-app .rooms a.on { background: var(--accent-soft); color: var(--accent); }
body.room-app .btn.danger { border-color: rgba(255, 107, 91, .45); }
body.room-app .btn.danger:hover { background: rgba(255, 107, 91, .12); }
body.room-app .tab.active { color: var(--accent); }
body.room-app .field input, body.room-app .field select, body.room-app .field textarea,
body.room-app #catSearch, body.room-app .cat-set, body.room-app .sel-off input, body.room-app .op-grid input, body.room-app .op-grid select {
    background: var(--soft); color: var(--ink); border-color: var(--line);
}
/* выбранное в фильтрах и видах - зелёным (оранжевый уже у кнопок действий) */
body.room-app .chip.on, body.room-app .kind-btn.on, body.room-app .view-buttons button.on { background: var(--green); border-color: var(--green); color: #fff; }
body.room-app .toast, body.room-app .ghost-tip { background: var(--strong); color: var(--ink); border: 1px solid var(--line); }
body.room-app .sw.custom i { background: repeating-linear-gradient(45deg, #3a4148, #3a4148 6px, var(--soft) 6px, var(--soft) 12px); }
body.room-app .sw i { border-color: rgba(255, 255, 255, .12); }
body.room-app .warn { background: rgba(255, 107, 91, .12); }
body.room-app .good { background: rgba(31, 180, 140, .12); }
body.room-app .gap-banner, body.room-app .var.exact { background: rgba(31, 180, 140, .12); }
body.room-app .gap-banner .gb-opt { background: transparent; }
/* подписи размеров на сцене остаются светлыми (на светлых стенах читаются лучше) */
body.room-app .dim { color: #2a2620; }
body.room-app .dim-block { color: #fff; }
body.room-app .dim-free { color: #13805f; }
body.room-app .dim.dim-pick:hover { color: #fff; }
body.room-app .help-btn { background: var(--panel); color: var(--accent); border: 1px solid var(--line); }
body.room-app .price-badge { border-color: var(--line); }
body.room-app .price-badge b { color: var(--ok); }
body.room-app .zone-now b { color: var(--ok); }
@media (max-width: 820px) { body.room-app .sheet-handle i { background: #4a535b; } }

/* ================= Тёмная тема остальных страниц (Сонни, 25.10, по образцу комнат Жан Клода - значения те же) =================
   body.landing: главная, Конструкторам, Мастерам, Модели Базиса онлайн, Кабинет. */
body.landing {
    --bg: #474a4e; --panel: #53575c; --ink: #f4f2ee; --muted: #cdc8c1; --line: #6b7076; --soft: #5e6268;
    --accent: #f08c2e; --accent-ink: #1b1209; --accent-soft: rgba(240, 140, 46, .22);
    --ok: #4fd07e; --green: #2f9e58; --danger: #ff8a7d; --shadow: 0 8px 28px rgba(0, 0, 0, .3); --strong: #3d4044;
    color-scheme: dark; background: var(--bg); color: var(--ink);
}
body.landing .top { background: #3d4044; border-bottom-color: #5c6066; }
body.landing .logo { display: inline-flex; align-items: center; }
body.landing .rooms a.on { background: var(--accent-soft); color: var(--accent); }
body.landing a { color: inherit; }
body.landing .land a:not(.btn):not(.tool):not(.room-card):not(.lsc-card):not(.tier) { color: var(--accent); }
body.landing .btn { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
body.landing .btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
body.landing .btn.ghost:hover { background: var(--soft); }
body.landing .tool, body.landing .room-card, body.landing .about, body.landing .contact, body.landing .price-how > div, body.landing .review { background: var(--panel); border-color: var(--line); color: var(--ink); }
body.landing .tool em, body.landing .room-card em { color: var(--accent); }
body.landing .tool .tool-ico { background: var(--accent-soft); color: var(--accent); }
body.landing input, body.landing select, body.landing textarea { background: var(--soft); color: var(--ink); border-color: var(--line); }
/* ---- главная: первый экран ---- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 28px; align-items: center; padding: 28px 0 10px; }
.hero h1 { font-size: 40px; line-height: 1.12; margin: 0 0 12px; }
.hero h1 b { color: var(--accent); }
.hero .lead { font-size: 17px; color: var(--muted); line-height: 1.5; margin: 0 0 18px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.hero > * { min-width: 0; }   /* длинная кнопка не распирает страницу на телефоне */
.hero-cta .btn { padding: 12px 20px; font-size: 16px; font-weight: 700; white-space: normal; }
.hero-cta .btn:not(.ghost) { box-shadow: 0 6px 20px rgba(240, 140, 46, .35); }
.hero-perks { display: flex; flex-wrap: wrap; gap: 6px; }
.hero-perks span { font-size: 13px; font-weight: 600; background: var(--strong); border: 1px solid var(--line); border-radius: 99px; padding: 5px 11px; }
.hero-perks span::before { content: '✓'; color: var(--ok); margin-right: 6px; font-weight: 700; }
/* витрина готовых кухонь (в потоке страницы) */
.lsc { position: relative; }
.lsc-pic { aspect-ratio: 16 / 10; border-radius: 16px; overflow: hidden; background: linear-gradient(135deg, #5e6268, #3d4044); box-shadow: var(--shadow); }
.lsc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; animation: sc-fade .5s ease-out; }
.lsc-cap { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.lsc-cap b { font-size: 17px; }
.lsc-cap small { display: block; color: var(--muted); font-size: 13px; font-weight: 400; }
.lsc-tag { position: absolute; top: 12px; left: 12px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 3px 10px; }
.lsc .sc-arrow { top: calc(50% - 30px); }
.lsc .sc-dots { justify-content: flex-start; margin: 8px 0 0; }
/* выбор, с чего начать */
.starts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0 6px; }
.lsc-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s, border-color .15s; }
.lsc-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.lsc-card .ph { aspect-ratio: 16 / 9; background: #3d4044; overflow: hidden; }
.lsc-card .ph img, .lsc-card .ph svg { width: 100%; height: 100%; object-fit: cover; display: block; }
.lsc-card .tx { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.lsc-card .tx b { font-size: 17px; }
.lsc-card .tx span { color: var(--muted); font-size: 14px; line-height: 1.4; flex: 1; }
.lsc-card .tx em { font-style: normal; font-weight: 700; color: var(--accent); margin-top: 6px; }
.lsc-card .badge { align-self: flex-start; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 9px; background: rgba(79, 208, 126, .16); color: var(--ok); }
/* как это работает */
.steps4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; counter-reset: s4; margin: 8px 0; }
.steps4 div { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 14px 54px; position: relative; }
.steps4 div::before { counter-increment: s4; content: counter(s4); position: absolute; left: 14px; top: 14px; width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent); color: var(--accent-ink); font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps4 b { display: block; margin-bottom: 3px; }
.steps4 span { color: var(--muted); font-size: 14px; line-height: 1.4; }
/* тарифы */
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 8px 0; }
.tier { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.tier h3 { margin: 0; font-size: 19px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tier .tag { font-size: 11px; font-weight: 700; border-radius: 99px; padding: 2px 9px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; }
.tier.free .tag { background: rgba(79, 208, 126, .16); color: var(--ok); }
.tier .price { font-size: 26px; font-weight: 800; color: var(--accent); }
.tier.free .price { color: var(--ok); }
.tier ul { margin: 0; padding-left: 18px; color: var(--muted); font-size: 14px; line-height: 1.5; flex: 1; }
.tier.buy { border-color: var(--accent); box-shadow: 0 8px 26px rgba(240, 140, 46, .18); }
.tier .btn { width: 100%; text-align: center; font-weight: 700; }
/* для профессионалов */
.pros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 8px 0; }
.pros a { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; text-decoration: none; color: var(--ink); }
.pros a:hover { border-color: var(--accent); }
.pros b { display: block; margin-bottom: 3px; }
.pros span { color: var(--muted); font-size: 13px; line-height: 1.4; }
.land h2 { margin-top: 34px; }
.land h2 small { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 4px; }
@media (max-width: 900px) {
    .hero { grid-template-columns: 1fr; padding-top: 14px; }
    .hero h1 { font-size: 30px; }
    .starts, .tiers { grid-template-columns: 1fr; }
    .steps4, .pros { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) { .steps4, .pros { grid-template-columns: 1fr; } .hero-cta .btn { flex: 1 1 100%; text-align: center; } }
/* телефон: меню шапки переносится на вторую строку, а не раздвигает страницу */
@media (max-width: 820px) { body:not(.room-app) .top { flex-wrap: wrap; max-width: 100%; } body:not(.room-app) .top .rooms { flex-wrap: wrap; min-width: 0; max-width: 100%; } }
/* логотип ровно в любой шапке (и в инструментах, где светлая тема) */
.top .logo { display: inline-flex; align-items: center; text-decoration: none; }
body.landing .tool em.dev { background: var(--accent-soft); color: var(--accent); border-color: transparent; }