    :root {
      --bg: #F2F5F8;
      --panel: #FFFFFF;
      --panel2: #F6F8FA;
      --border: #DDE3EA;
      --border2: #B8C4CE;
      --accent: #3293D4;
      --accent-l: #E6F3FB;
      --text: #1A1A1A;
      --muted: #5A6472;
      --muted2: #9AA3AD;
      --green: #1A7A45;
      --blue: #3293D4;
      --dim-color: #3293D4;
      --sel-color: #F59E0B;
      --hover-color: #FCD34D;
      --shadow: 0 1px 3px rgba(0, 0, 0, .08), 0 4px 12px rgba(0, 0, 0, .05);
    }

    /* ── Тёмная тема (PRO) ──
       Меняем только CSS-переменные — весь интерфейс перекрашивается автоматически,
       т.к. цвета везде заданы через var(). Активируется атрибутом body[data-theme="dark"]
       (по умолчанию включается в PRO; переключается кнопками темы в тулбаре). */
    body[data-theme="dark"] {
      --bg: #11151D;
      --panel: #1B212E;
      --panel2: #2B3647;
      --border: #334155;
      --border2: #475569;
      --accent: #3F6FDD;
      --accent-l: #222B38;
      --text: #F1F5F9;
      --muted: #94A3B8;
      --muted2: #64748B;
      --blue: #3F6FDD;
      --dim-color: #3F6FDD;
    }

    /* PRO-функции скрыты на Базовом тарифе */
    body[data-plan="free"] .pro-only { display: none !important; }

    /* «Прозрачность» во всех разделах — только в PRO. В Базовом — неактивна. */
    body[data-plan="free"] [id*="transp"] {
      pointer-events: none !important;
      opacity: .4;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0
    }

    html,
    body {
      height: 100%;
      overflow: hidden;
      font-family: 'Roboto', sans-serif;
      background: var(--bg);
      color: var(--text);
      font-size: 13px
    }

    /* ── MAIN LAYOUT ── */
    .app-wrap {
      display: flex;
      flex-direction: column;
      height: 100vh;
      position: relative;
    }

    /* PRO: сверху резервируем 75px (для новых кнопок) — весь интерфейс
       (тулбар, вкладки панелей: Параметры/Слои/Мебель/Шаблоны/Свойства и т.д.)
       опускается вниз. Нижний бар (absolute) не затрагивается. */
    body[data-plan="pro"] .app-wrap {
      padding-top: 50px;
    }

    /* PRO: верхний тулбар с логотипом (занимает зарезервированные 50px сверху) */
    .app-topbar {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      height: 50px;
      background: var(--bg);
      display: flex;
      align-items: center;
      z-index: 60;
    }
    /* Тёмная тема — верхний тулбар глубокого тёмного цвета */
    body[data-theme="dark"] .app-topbar {
      background: #11151C;
    }

    .app-brand {
      display: flex;
      align-items: center;
      gap: 10px;
      width: 342px;
      /* 6 (отступ) + 320 (левый блок) + 6 (зазор) + 10 (margin тулбара) = левый край окна = левый край тулбара */
      padding: 0 16px;
      box-sizing: border-box;
      flex-shrink: 0;
    }

    /* Предупреждение в ИИ-ассистенте — следует теме (тёмное в PRO, светлое в светлой) */
    .ai-warn {
      background: var(--panel2);
      border: 1px solid var(--border);
    }
    .ai-warn-text {
      color: var(--muted);
    }
    body[data-theme="dark"] .ai-warn {
      background: #262F3F;
      border-color: #3A465B;
    }
    body[data-theme="dark"] .ai-warn-text {
      color: #C8D0DC;
    }

    /* По центру верхнего тулбара: статус проекта + круговой индикатор готовности */
    .app-topbar-center {
      position: absolute;
      left: 50%;
      top: 50%;
      transform: translate(-50%, -50%);
      display: flex;
      align-items: center;
      gap: 12px;
      pointer-events: none;
    }

    .app-status-text {
      font-family: 'Roboto', sans-serif;
      font-size: 13px;
      font-weight: 600;
      color: var(--text);
      white-space: nowrap;
    }

    .app-status-val {
      color: var(--accent);
      font-weight: 700;
    }

    .app-progress {
      position: relative;
      width: 38px;
      height: 38px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
    }

    .app-progress-pct {
      position: absolute;
      inset: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      font-weight: 700;
      color: var(--text);
    }

    /* Кнопки темы в верхнем тулбаре — правый край совпадает с правым краем тулбара
       (320 правый блок + 6 зазор + 6 отступ + 10 margin тулбара = 342px от правого края) */
    .app-topbar-right {
      position: absolute;
      right: 342px;
      top: 50%;
      transform: translateY(-50%);
      display: flex;
      align-items: center;
      gap: 3px;
    }

    /* Действия справа: Поделиться · Экспорт · Уведомления · Аватар.
       Группа занимает ширину правого блока (6 отступ + 320), поэтому левый край
       «Поделиться» совпадает по вертикали с левым краем правого блока. */
    .app-topbar-actions {
      position: absolute;
      right: 6px;
      width: 320px;
      top: 50%;
      transform: translateY(-50%);
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .app-export-wrap {
      position: relative;
    }

    .app-export-btn {
      background: var(--accent);
      color: #fff;
      border: none;
      border-radius: 9px;
      padding: 8px 16px;
      font-family: 'Roboto', sans-serif;
      font-size: 12.5px;
      font-weight: 700;
      cursor: pointer;
      transition: filter .15s;
    }

    .app-export-btn:hover {
      filter: brightness(1.08);
    }

    /* «Поделиться» — контурная кнопка слева от «Экспорт» */
    .app-share-btn {
      background: transparent;
      color: var(--text);
      border: 1px solid var(--border2);
      border-radius: 9px;
      padding: 8px 16px;
      font-family: 'Roboto', sans-serif;
      font-size: 12.5px;
      font-weight: 600;
      cursor: pointer;
      transition: border-color .15s, color .15s;
    }

    .app-share-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }

    /* «Уведомления» — чёрно-белая иконка справа от «Экспорт» */
    .app-notif-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 36px;
      height: 36px;
      background: transparent;
      border: 1px solid var(--border2);
      border-radius: 9px;
      color: var(--text);
      cursor: pointer;
      transition: border-color .15s, color .15s;
    }

    .app-notif-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }

    /* «Аватар» — круглая кнопка после «Уведомления» */
    .app-avatar-btn {
      flex-shrink: 0;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: var(--accent);
      color: #fff;
      border: none;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      transition: filter .15s;
    }

    .app-avatar-btn:hover {
      filter: brightness(1.08);
    }

    /* Раскрывающееся окно проектов в верхнем тулбаре */
    .app-proj-dd {
      position: relative;
    }

    .app-proj-btn {
      display: flex;
      align-items: center;
      gap: 8px;
      max-width: 260px;
      padding: 7px 12px;
      border: 1px solid var(--border);
      border-radius: 9px;
      background: var(--panel);
      color: var(--text);
      font-family: 'Roboto', sans-serif;
      font-size: 12.5px;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: border-color .15s;
    }

    .app-proj-btn:hover {
      border-color: var(--accent);
    }

    .app-proj-btn #appProjName {
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .app-proj-caret {
      color: var(--muted);
      font-size: 10px;
      flex-shrink: 0;
    }

    .app-proj-menu {
      position: absolute;
      top: calc(100% + 6px);
      left: 0;
      min-width: 280px;
      max-width: 340px;
      max-height: 65vh;
      overflow-y: auto;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 12px;
      box-shadow: 0 12px 40px rgba(0, 0, 0, .4);
      padding: 6px;
      z-index: 200;
    }

    .app-logo {
      height: 30px;
      width: auto;
      object-fit: contain;
      flex-shrink: 0;
    }

    .app-brand-text {
      font-family: 'Montserrat', sans-serif;
      font-weight: 800;
      font-size: 14px;
      letter-spacing: 1px;
      color: var(--text);
      text-transform: uppercase;
      display: flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
    }

    .app-brand-pro {
      background: #3F6FDD;
      color: #fff;
      font-size: 11px;
      font-weight: 800;
      letter-spacing: 1px;
      padding: 2px 8px;
      border-radius: 6px;
    }

    /* ── PRO: блочный (карточный) вид ──
       Каждый блок (слева, справа, снизу, Canvas, тулбар) — отдельная скруглённая
       карточка с минимальными зазорами на общем фоне #11151C. */
    body[data-plan="pro"] .app-wrap {
      background: var(--bg);
    }
    /* Тёмная тема — фон-подложка карточек чуть глубже основного */
    body[data-plan="pro"][data-theme="dark"] .app-wrap {
      background: #11151C;
    }

    body[data-plan="pro"] .workspace {
      gap: 6px;
      padding: 6px;
    }

    body[data-plan="pro"] .side-panel {
      border: none;
      border-radius: 14px;
      overflow: hidden;
      /* Нижний край боковых блоков на одном уровне с Canvas (у которого margin-bottom:50px) */
      margin-bottom: 50px;
    }

    body[data-plan="pro"] .center-area {
      gap: 6px;
    }

    body[data-plan="pro"] .action-toolbar {
      border-bottom: none;
      border-radius: 14px;
      /* края тулбара совпадают по вертикали с Canvas (тот инсетится на 10px по бокам) */
      margin-left: 10px;
      margin-right: 10px;
    }

    body[data-plan="pro"] .bottom-bar {
      left: 6px;
      right: 6px;
      bottom: 6px;
      border: none;
      border-radius: 14px;
      overflow: hidden;
    }

    .view-btn {
      padding: 4px 10px;
      border-radius: 5px;
      border: 1.5px solid var(--border);
      background: transparent;
      font-size: 10px;
      font-weight: 700;
      color: var(--muted);
      cursor: pointer;
      transition: all .15s;
      font-family: 'Roboto', sans-serif;
      letter-spacing: .5px;
      text-transform: uppercase
    }

    .view-btn.active {
      background: var(--accent);
      color: #fff;
      border-color: var(--accent)
    }

    .view-btn:hover:not(.active) {
      border-color: var(--accent);
      color: var(--accent)
    }

    .workspace {
      display: flex;
      flex: 1;
      overflow: hidden;
      min-height: 0
    }

    /* ── PANELS ── */
    .side-panel {
      width: 320px;
      flex-shrink: 0;
      background: var(--panel);
      border-right: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow: hidden
    }

    .right-panel {
      border-right: none;
      border-left: 1px solid var(--border)
    }

    .panel-head {
      padding: 12px 14px 0;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0
    }

    .panel-head-title {
      font-family: 'Montserrat', sans-serif;
      font-size: 14px;
      font-weight: 700;
      color: var(--text);
      margin-bottom: 10px
    }

    .panel-scroll {
      overflow-y: auto;
      overflow-x: hidden;
      flex: 1;
      padding: 12px 14px;
      padding-bottom: 500px;
      min-height: 0;
    }

    /* Panel sections */
    .ps-block {
      margin-bottom: 14px
    }

    .ps-label {
      font-size: 9px;
      letter-spacing: 1.5px;
      text-transform: uppercase;
      color: var(--muted2);
      font-weight: 700;
      margin-bottom: 7px;
      display: flex;
      align-items: center;
      gap: 6px
    }

    .ps-label::after {
      content: '';
      flex: 1;
      height: 1px;
      background: var(--border)
    }

    /* Треугольник-стрелка у сворачиваемых заголовков вкладки «Шаблоны».
       Ширина фиксирована, чтобы текст не дёргался при смене ▼ на ▶. */
    .tpl-caret {
      display: inline-block;
      width: 9px;
      font-size: 8px;
      line-height: 1;
      color: var(--muted2);
      flex-shrink: 0;
    }

    .field label {
      display: block;
      font-size: 10px;
      color: var(--muted);
      margin-bottom: 3px;
      font-weight: 500
    }

    .field {
      margin-bottom: 7px
    }

    .field input,
    .field select {
      width: 100%;
      background: var(--panel2);
      border: 1.5px solid var(--border);
      border-radius: 7px;
      padding: 6px 10px;
      color: var(--text);
      font-size: 12px;
      font-family: 'Roboto', sans-serif;
      outline: none;
      transition: border-color .15s
    }

    .field input:focus,
    .field select:focus {
      border-color: var(--accent)
    }

    .grid2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 7px
    }

    .grid3 {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 6px
    }

    /* Layer checkboxes */
    .layer-item {
      display: flex;
      align-items: center;
      gap: 8px;
      padding: 6px 8px;
      border-radius: 7px;
      cursor: pointer;
      transition: background .1s;
      margin-bottom: 3px
    }

    .layer-item:hover {
      background: var(--panel2)
    }

    .layer-item input[type=checkbox] {
      accent-color: var(--accent);
      width: 14px;
      height: 14px;
      cursor: pointer;
      flex-shrink: 0
    }

    .layer-dot {
      width: 9px;
      height: 9px;
      border-radius: 50%;
      flex-shrink: 0
    }

    .layer-name {
      font-size: 12px;
      font-weight: 500;
      flex: 1
    }

    /* Floor tabs */
    .floor-tabs {
      display: flex;
      align-items: flex-start;
      gap: 0;
      flex-wrap: wrap;
      margin-bottom: 0;
      flex-direction: column
    }

    .floor-tab {
      padding: 4px 10px;
      border-radius: 5px;
      border: 1.5px solid var(--border);
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      color: var(--muted);
      background: transparent;
      transition: all .15s;
      font-family: 'Roboto', sans-serif
    }

    .floor-tab.active {
      background: var(--accent);
      color: #fff;
      border-color: var(--accent)
    }

    .floor-tab-add {
      background: transparent;
      border: 1.5px dashed var(--border2);
      color: var(--muted);
      padding: 4px 9px;
      border-radius: 5px;
      cursor: pointer;
      font-size: 14px;
      transition: all .15s;
      line-height: 1
    }

    .floor-tab-add:hover {
      border-color: var(--accent);
      color: var(--accent)
    }

    /* Properties panel - no selection */
    .no-sel {
      text-align: center;
      padding: 40px 20px;
      color: var(--muted2)
    }

    .no-sel .ns-icon {
      font-size: 32px;
      margin-bottom: 8px
    }

    .no-sel .ns-text {
      font-size: 11px;
      line-height: 1.5
    }

    /* Color swatch */
    .mat-swatch {
      width: 100%;
      height: 30px;
      border-radius: 7px;
      border: 2px solid var(--border);
      cursor: pointer;
      transition: border-color .15s
    }

    .mat-swatch:hover {
      border-color: var(--accent)
    }

    /* ── CENTER AREA ── */
    .center-area {
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
      min-width: 0
    }

    /* Action toolbar */
    .action-toolbar {
      height: 52px;
      background: var(--panel);
      border-bottom: 1px solid var(--border);
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 10px;
      gap: 3px;
      flex-shrink: 0;
      position: relative;
      box-shadow: 0 1px 0 var(--border), 0 2px 6px rgba(0, 0, 0, .04);
    }

    .tb-group {
      display: flex;
      align-items: center;
      gap: 1px;
      background: var(--panel2);
      border: 1px solid var(--border);
      border-radius: 9px;
      padding: 3px;
    }

    .tool-btn {
      width: 38px;
      height: 38px;
      border-radius: 7px;
      border: none;
      background: transparent;
      cursor: pointer;
      font-size: 19px;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all .13s;
      position: relative;
      font-family: 'Roboto', sans-serif;
      color: var(--text);
    }

    .tool-btn:hover:not(.active) {
      background: rgba(0, 0, 0, .06)
    }

    /* Тёмная тема: чёрная подсветка наведения (rgba(0,0,0,.06)) на тёмном фоне
       почти не видна — заменяем тонкой белой квадратной областью со скруглёнными
       краями (border-radius уже задан в .tool-btn, скругление наследуется). */
    body[data-theme="dark"] .tool-btn:hover:not(.active) {
      background: rgba(255, 255, 255, .08);
      box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
    }

    .tool-btn.active {
      background: var(--accent-l);
      border: 1.5px solid var(--accent);
    }

    /* Иконки внутри кнопок — прозрачный фон PNG, blend не нужен.
       Без multiply иконки сохраняют натуральный цвет на любой теме (свет/тьма). */
    .tool-btn img {
      width: 26px;
      height: 26px;
      object-fit: contain;
      transition: filter .13s;
      pointer-events: none;
    }

    .tool-btn:hover img {
      filter: none;
      /* no purple tint, just normal */
    }


    .tool-btn[data-tip]:hover::after {
      content: attr(data-tip);
      position: absolute;
      top: calc(100% + 8px);
      left: 50%;
      transform: translateX(-50%);
      background: rgba(28, 25, 23, .92);
      color: #fff;
      font-size: 10px;
      font-weight: 500;
      padding: 3px 9px;
      border-radius: 5px;
      white-space: nowrap;
      pointer-events: none;
      z-index: 9999;
      font-family: 'Roboto', sans-serif;
    }

    .tool-btn[data-tip]:hover::before {
      content: '';
      position: absolute;
      top: calc(100% + 3px);
      left: 50%;
      transform: translateX(-50%);
      border: 4px solid transparent;
      border-bottom-color: rgba(28, 25, 23, .92);
      pointer-events: none;
      z-index: 9999;
    }

    .tb-key {
      position: absolute;
      bottom: 2px;
      right: 3px;
      font-size: 7px;
      font-weight: 700;
      color: var(--muted2);
      font-family: 'Roboto', sans-serif;
    }

    /* Текстовый пункт выпадающего меню тулбара (список кнопки «Сохранить»).
       Соседние меню (Элементы/Кровля) состоят из иконок и используют .tool-btn —
       здесь нужна строка во всю ширину списка с текстом слева. */
    .tb-menu-item {
      display: block;
      width: 100%;
      text-align: left;
      padding: 8px 10px;
      border: none;
      border-radius: 7px;
      background: transparent;
      color: var(--text);
      font-family: 'Roboto', sans-serif;
      font-size: 12.5px;
      font-weight: 500;
      line-height: 1.2;
      white-space: nowrap;
      cursor: pointer;
      transition: background .13s;
    }

    .tb-menu-item:hover {
      background: rgba(0, 0, 0, .06);
    }

    body[data-theme="dark"] .tb-menu-item:hover {
      background: rgba(255, 255, 255, .08);
    }

    .tool-btn.active .tb-key {
      color: rgba(255, 255, 255, .55)
    }

    .tb-sep {
      width: 1px;
      height: 28px;
      background: var(--border);
      margin: 0 3px;
      flex-shrink: 0
    }

    .view-btn {
      padding: 4px 10px;
      border-radius: 6px;
      border: 1.5px solid var(--border);
      background: transparent;
      font-size: 10px;
      font-weight: 700;
      color: var(--muted);
      cursor: pointer;
      transition: all .15s;
      font-family: 'Roboto', sans-serif;
      letter-spacing: .5px;
      text-transform: uppercase
    }

    .view-btn.active {
      background: var(--accent);
      color: #fff;
      border-color: var(--accent);
      box-shadow: 0 2px 8px rgba(50, 147, 212, .25)
    }

    .view-btn:hover:not(.active) {
      border-color: var(--accent);
      color: var(--accent)
    }

    /* Canvas area */
    .canvas-area {
      flex: 1;
      display: flex;
      position: relative;
      overflow: hidden;
      min-height: 0
    }

    /* PRO: Canvas не упирается в самый низ — приподнят снизу на ~100px */
    body[data-plan="pro"] .canvas-area {
      margin: 10px 10px 50px 10px;
      border-radius: 14px;
    }

    /* Базовый: Canvas приподнят снизу на ~50px */
    body[data-plan="free"] .canvas-area {
      margin-bottom: 50px;
    }

    .canvas-half {
      flex: 1;
      position: relative;
      overflow: hidden
    }

    .canvas-divider {
      width: 3px;
      background: var(--border);
      cursor: col-resize;
      flex-shrink: 0;
      position: relative;
      z-index: 10
    }

    .canvas-divider:hover {
      background: var(--accent)
    }

    #canvas2d {
      position: absolute;
      inset: 0;
      cursor: crosshair
    }

    #canvas3d {
      position: absolute;
      inset: 0;
      display: block
    }

    .canvas-label {
      position: absolute;
      top: 8px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 3px 10px;
      font-size: 10px;
      font-weight: 600;
      color: var(--muted);
      pointer-events: none;
      letter-spacing: .5px;
      text-transform: uppercase;
      backdrop-filter: blur(4px);
    }

    .canvas-2d-controls {
      position: absolute;
      top: 10px;
      left: 50%;
      transform: translateX(-50%);
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 3px 10px;
      display: flex;
      gap: 6px;
      align-items: center;
      backdrop-filter: blur(6px);
      box-shadow: 0 2px 8px rgba(0,0,0,.08);
      pointer-events: all;
      z-index: 15;
    }

    .c2d-btn {
      padding: 3px 8px;
      border-radius: 5px;
      border: 1px solid var(--border);
      background: var(--panel);
      font-size: 10px;
      color: var(--muted);
      cursor: pointer;
      font-family: 'Roboto', sans-serif;
      transition: all .12s
    }

    .c2d-btn:hover {
      border-color: var(--accent);
      color: var(--accent)
    }

    .zoom-val {
      font-size: 10px;
      color: var(--muted);
      min-width: 32px;
      text-align: center;
      font-weight: 600
    }

    /* 3D controls overlay */
    .vp3d-label {
      position: absolute;
      bottom: 10px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(255, 255, 255, .88);
      border: 1px solid var(--border);
      border-radius: 7px;
      padding: 4px 12px;
      font-size: 9px;
      color: var(--muted);
      display: flex;
      gap: 12px;
      pointer-events: none;
      backdrop-filter: blur(4px);
    }

    /* ViewCube panel — 6 views + parallel toggle */
    .viewcube-wrap {
      position: absolute;
      top: 10px;
      right: 10px;
      z-index: 15;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 8px;
      box-shadow: 0 2px 12px rgba(0, 0, 0, .1);
      backdrop-filter: blur(6px);
      user-select: none;
      /* 168px — запасное значение; ширину под «Этажи» задаёт JS (см. комментарий
         у .floor-3d-panel и _syncFloorViewsPanelWidth в script.js). */
      width: 168px;
    }

    .vc-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 4px;
    }

    .vc-view-btn {
      padding: 6px 8px;
      border-radius: 6px;
      border: 1.5px solid var(--border);
      background: var(--panel2);
      color: var(--muted);
      font-size: 11px;
      font-weight: 600;
      font-family: 'Roboto', sans-serif;
      cursor: pointer;
      transition: all .12s;
      text-align: center;
    }

    .vc-view-btn:hover:not(.active) {
      border-color: var(--accent);
      color: var(--accent);
    }

    .vc-view-btn.active {
      background: var(--accent);
      color: #fff;
      border-color: var(--accent);
    }

    .vc-ortho {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 8px;
      padding: 5px 6px;
      border-top: 1px solid var(--border);
      cursor: pointer;
      font-size: 11px;
      font-weight: 600;
      color: var(--text);
    }

    .vc-ortho input[type=checkbox] {
      width: 14px;
      height: 14px;
      accent-color: var(--accent);
      cursor: pointer;
      flex-shrink: 0;
    }

    /* ── BOTTOM BAR — absolute overlay so canvas fills full viewport height ── */
    .bottom-bar {
      position: absolute;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 50;
      height: 210px;
      background: var(--panel);
      border-top: 1px solid var(--border);
      display: flex;
      flex-direction: column;
      overflow: hidden;
      transition: height .35s cubic-bezier(.4,0,.2,1);
      box-shadow: 0 -2px 12px rgba(0,0,0,.08);
    }

    .bottom-bar.collapsed {
      height: 36px
    }

    .bb-curtain {
      position: absolute;
      left: 0;
      right: 0;
      top: -6px;
      height: 12px;
      cursor: ns-resize;
      z-index: 40;
    }

    .bb-curtain:before {
      content: "";
      position: absolute;
      left: 0;
      right: 0;
      top: 5px;
      height: 2px;
      background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .12), transparent);
    }

    .bb-head {
      height: 28px;
      flex-shrink: 0;
      display: flex;
      align-items: center;
      justify-content: center;
      padding: 0 16px;
      border-bottom: 1px solid var(--border);
      cursor: ns-resize;
      user-select: none;
      position: relative;
    }

    .bb-drag-handle {
      width: 40px;
      height: 4px;
      border-radius: 2px;
      background: #d0d5dd;
      transition: background .15s;
    }

    .bb-head:hover .bb-drag-handle {
      background: #3293D4;
    }

    .bb-close-btn {
      position: absolute;
      right: 12px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: var(--muted2);
      font-size: 12px;
      cursor: pointer;
      padding: 2px 4px;
      border-radius: 4px;
      line-height: 1;
      transition: color .15s, background .15s;
    }

    .bb-close-btn:hover {
      color: #DC2626;
      background: rgba(220,38,38,.08);
    }

    .bb-body {
      flex: 1;
      display: flex;
      overflow-x: auto;
      overflow-y: hidden;
      padding: 8px 10px;
      gap: 7px;
      align-items: stretch;
    }

    .bb-card {
      background: var(--panel2);
      border: 1px solid var(--border);
      border-radius: 12px;
      padding: 8px 11px;
      min-width: 160px;
      flex: 1;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    .bb-card-title {
      font-size: 9px;
      letter-spacing: 1.4px;
      text-transform: uppercase;
      color: var(--muted2);
      font-weight: 700;
      font-family: 'Montserrat', sans-serif;
      margin-bottom: 5px;
      flex-shrink: 0;
    }

    .bb-card-content {
      flex: 1;
      overflow-y: auto;
    }

    .bb-row {
      display: flex;
      justify-content: space-between;
      padding: 2px 0;
      border-bottom: 1px solid var(--border);
      font-size: 11px;
      gap: 4px;
    }

    .bb-row:last-child {
      border-bottom: none;
      padding-top: 3px;
    }

    .bb-row .bl {
      color: var(--muted);
      flex: 1;
    }

    .bb-row .bv {
      font-weight: 600;
      color: var(--text);
      white-space: nowrap;
    }

    .bb-row .bv.price {
      color: #3293D4;
      font-weight: 700;
    }

    .bb-card-total {
      background: var(--panel2);
      border: 1px solid var(--border);
    }

    .bb-card-total .bb-card-title {
      color: var(--muted2);
    }

    .bb-card-total .bb-row {
      border-bottom-color: var(--border);
    }

    .bb-card-total .bb-row .bl {
      color: var(--muted);
    }

    .bb-card-total .bb-row .bv {
      color: var(--text);
    }

    /* Кнопка ручного пересчёта сметы в карточке «Итого — материалы».
       База — полупрозрачная; после успешного расчёта получает .calculated (синяя). */
    .bb-recalc-btn {
      width: 100%;
      padding: 6px 8px;
      margin-top: 6px;
      border: none;
      border-radius: 6px;
      background: var(--accent);
      color: #fff;
      font-family: 'Montserrat', sans-serif;
      font-size: 11px;
      font-weight: 700;
      letter-spacing: .5px;
      cursor: pointer;
      transition: background .15s, filter .15s;
      flex-shrink: 0;
    }
    .bb-recalc-btn:hover { filter: brightness(1.08); }
    .bb-recalc-btn:disabled { opacity: .6; cursor: default; }
    .bb-recalc-btn.calculated { background: var(--accent); }

    .bb-card-prices {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 3px 6px;
      padding-bottom: 6px;
      margin-bottom: 5px;
      border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }

    .bb-card-prices-note {
      display: block;
      font-size: 9px;
      color: var(--muted);
      padding-bottom: 6px;
      margin-bottom: 5px;
      border-bottom: 1px solid var(--border);
      line-height: 1.4;
    }

    .bb-pf {
      position: relative;
    }

    .bb-pf label {
      font-size: 9px;
      color: var(--muted);
      display: block;
      margin-bottom: 1px;
      font-weight: 500;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .bb-pf input {
      width: 100%;
      background: var(--panel2);
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 3px 20px 3px 5px;
      font-size: 10px;
      font-family: 'Roboto', sans-serif;
      color: var(--text);
      outline: none;
      box-sizing: border-box;
    }

    .bb-pf::after {
      content: '₸';
      position: absolute;
      right: 6px;
      bottom: 4px;
      font-size: 9px;
      font-weight: 600;
      color: var(--muted);
      pointer-events: none;
      line-height: 1;
    }

    .bb-pf input:focus { border-color: var(--accent); }
    .bb-pf-no-cur::after { content: none; }

    #bb-total-prices {
      display: flex;
      flex-direction: column;
      border-bottom: none;
      padding-bottom: 4px;
      margin-bottom: 0;
    }

    .bb-grand-val {
      font-family: 'Montserrat', sans-serif;
      font-size: 21px;
      font-weight: 700;
      color: var(--text);
      line-height: 1.15;
      margin: 3px 0 2px;
    }

    .bb-grand-sub {
      font-size: 10px;
      color: var(--muted);
      margin-bottom: 6px;
    }

    .bb-bar-wrap {
      display: flex;
      align-items: center;
      gap: 5px;
      margin-bottom: 3px;
    }

    .bb-bar-lbl {
      font-size: 9px;
      color: var(--muted);
      min-width: 60px;
    }

    .bb-bar-track {
      flex: 1;
      height: 4px;
      background: var(--border);
      border-radius: 2px;
      overflow: hidden;
    }

    .bb-bar-fill {
      height: 100%;
      border-radius: 2px;
      background: #3293D4;
    }

    .bb-bar-pct {
      font-size: 9px;
      color: var(--muted2);
      min-width: 26px;
      text-align: right;
    }

    /* Scrollbars */
    ::-webkit-scrollbar {
      width: 5px;
      height: 5px
    }

    ::-webkit-scrollbar-track {
      background: transparent
    }

    ::-webkit-scrollbar-thumb {
      background: var(--border2);
      border-radius: 3px
    }

    /* Canvas view switcher — top-left of 2D canvas */
    /* Компас 2D — под переключателем Split/2D/3D (тот ~30px + отступ) */
    .canvas-compass {
      position: absolute;
      top: 50px;
      left: 10px;
      z-index: 15;
      pointer-events: none;          /* клики уходят на холст */
      line-height: 0;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 50%;
      box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
      backdrop-filter: blur(6px);
    }
    .canvas-compass .cc-ring { fill: none; stroke: var(--border2); stroke-width: 1.2 }
    .canvas-compass .cc-n    { fill: #E5484D }        /* север — красный, как на картах */
    .canvas-compass .cc-s,
    .canvas-compass .cc-hub  { fill: var(--muted) }
    .canvas-compass .cc-t {
      font: 700 11px 'Roboto', sans-serif;
      fill: var(--muted);
      text-anchor: middle;
    }
    .canvas-compass .cc-t-n  { fill: #E5484D }

    .canvas-view-switcher {
      position: absolute;
      top: 10px;
      left: 10px;
      z-index: 15;
      display: flex;
      gap: 2px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 8px;
      padding: 3px;
      backdrop-filter: blur(6px);
      box-shadow: 0 2px 8px rgba(0, 0, 0, .08);
      pointer-events: all;
    }

    .cvs-btn {
      padding: 4px 12px;
      border-radius: 5px;
      border: none;
      background: transparent;
      font-size: 11px;
      font-weight: 700;
      color: var(--muted);
      cursor: pointer;
      transition: all .15s;
      font-family: 'Roboto', sans-serif;
      letter-spacing: .3px;
    }

    .cvs-btn.active {
      background: var(--accent);
      color: #fff;
      box-shadow: 0 1px 4px rgba(50, 147, 212, .25)
    }

    .cvs-btn:hover:not(.active) {
      background: var(--panel2);
      color: var(--text)
    }

    /* Hotkey toast */
    #hkToast {
      position: absolute;
      bottom: 52px;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(28, 25, 23, .85);
      color: #fff;
      padding: 4px 14px;
      border-radius: 6px;
      font-size: 11px;
      pointer-events: none;
      z-index: 20
    }

    /* Section indicator */
    .section-indicator {
      position: absolute;
      pointer-events: none;
      z-index: 8;
      background: rgba(99, 102, 241, .65);
      box-shadow: 0 0 8px rgba(99, 102, 241, .4)
    }

    .section-indicator.h {
      left: 0;
      right: 0;
      height: 2px
    }

    .section-indicator.v {
      top: 0;
      bottom: 0;
      width: 2px
    }

    /* 3D selected highlight */
    .sel3d-badge {
      position: absolute;
      top: 8px;
      left: 8px;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 6px;
      padding: 4px 10px;
      font-size: 10px;
      color: var(--blue);
      font-weight: 600;
      pointer-events: none;
      backdrop-filter: blur(4px)
    }

    /* Bottom bar layer filters */
    .bb-layers {
      display: flex;
      align-items: center;
      gap: 6px;
      flex-wrap: wrap;
      padding: 0 6px
    }

    .bb-layer-chk {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 3px 8px;
      border-radius: 5px;
      border: 1.5px solid var(--border);
      background: var(--panel2);
      cursor: pointer;
      font-size: 10px;
      font-weight: 600;
      color: var(--muted);
      transition: all .15s;
      white-space: nowrap;
      user-select: none
    }

    .bb-layer-chk.active {
      border-color: currentColor
    }

    .bb-layer-chk .bl-dot {
      width: 7px;
      height: 7px;
      border-radius: 50%;
      flex-shrink: 0
    }

    .bb-layer-chk input {
      display: none
    }

    /* Furniture panel */
    .furn-panel {
      padding: 10px 12px;
      display: flex;
      flex-direction: column;
      overflow-y: auto;
      min-height: 0
    }

    .furn-grid {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 6px;
      margin-bottom: 10px
    }

    .furn-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 3px;
      padding: 6px 3px 5px;
      border-radius: 8px;
      border: 1.5px solid var(--border);
      background: var(--panel2);
      cursor: pointer;
      transition: all .13s;
      font-size: 9px;
      font-weight: 600;
      color: var(--muted);
      text-align: center;
    }

    .furn-item:hover {
      border-color: var(--accent);
      color: var(--accent);
      background: var(--accent-l)
    }

    .furn-item.selected {
      border-color: var(--accent);
      background: var(--accent-l);
      color: var(--accent)
    }

    .furn-icon {
      font-size: 26px;
      line-height: 1
    }

    .furn-preview {
      width: 40px;
      height: 40px;
      flex-shrink: 0;
      object-fit: contain
    }

    .furn-color-row {
      display: flex;
      gap: 5px;
      align-items: center;
      flex-wrap: wrap;
      margin-top: 4px
    }

    .furn-color-swatch {
      width: 20px;
      height: 20px;
      border-radius: 4px;
      border: 2px solid var(--border);
      cursor: pointer;
      transition: border-color .1s
    }

    .furn-color-swatch:hover,
    .furn-color-swatch.sel {
      border-color: var(--accent)
    }

    .furn-rot-btn {
      background: var(--panel2);
      border: 1px solid var(--border);
      border-radius: 5px;
      padding: 3px 8px;
      font-size: 11px;
      cursor: pointer;
      font-family: 'Roboto', sans-serif;
      color: var(--muted);
      transition: all .1s
    }

    .furn-rot-btn:hover {
      border-color: var(--accent);
      color: var(--accent)
    }

    .furn-placed-list {
      margin-top: 8px
    }

    .furn-placed-item {
      display: flex;
      align-items: center;
      gap: 6px;
      padding: 4px 6px;
      border-radius: 5px;
      font-size: 11px;
      color: var(--muted);
      cursor: pointer;
      transition: background .1s
    }

    .furn-placed-item:hover {
      background: var(--panel2)
    }

    .furn-placed-item.sel {
      background: var(--accent-l);
      color: var(--accent);
      font-weight: 500
    }

    /* ── ACCORDION ── */
    .acc-item {
      border: 1px solid var(--border);
      border-radius: 10px;
      margin-bottom: 6px;
      overflow: hidden;
      transition: box-shadow .13s, opacity .2s;
    }

    .acc-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,.07); }

    .acc-item.smeta-off { opacity: .52; }

    .acc-head {
      display: flex;
      align-items: center;
      gap: 0;
      padding: 0;
      background: var(--panel2);
      user-select: none;
      transition: background .13s;
    }

    .acc-head:hover { background: var(--accent-l); }
    .acc-head.open { background: var(--accent-l); border-bottom: 1px solid var(--border); }

    /* Toggle zone (left) */
    .acc-sw-wrap {
      padding: 11px 10px 11px 12px;
      flex-shrink: 0;
      cursor: pointer;
      display: flex;
      align-items: center;
    }

    .acc-sw {
      width: 30px;
      height: 17px;
      border-radius: 9px;
      background: var(--border2);
      position: relative;
      flex-shrink: 0;
      transition: background .2s;
      pointer-events: none;
    }

    .acc-sw.on { background: var(--accent); }

    .acc-sw::after {
      content: '';
      position: absolute;
      top: 2px; left: 2px;
      width: 13px; height: 13px;
      border-radius: 50%;
      background: #fff;
      transition: left .2s;
      box-shadow: 0 1px 3px rgba(0,0,0,.2);
    }

    .acc-sw.on::after { left: 15px; }

    /* Expand zone (center+right) */
    .acc-expand-wrap {
      flex: 1;
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 11px 12px 11px 8px;
      cursor: pointer;
      min-width: 0;
    }

    .acc-head-text { min-width: 0; }

    .acc-head-name {
      font-size: 12px;
      font-weight: 600;
      color: var(--text);
      line-height: 1.2;
    }

    .acc-head.open .acc-head-name { color: var(--accent); }

    .acc-head-desc {
      font-size: 10px;
      color: var(--muted);
      margin-top: 1px;
    }

    .acc-arrow {
      font-size: 9px;
      color: var(--muted2);
      transition: transform .2s;
      flex-shrink: 0;
      margin-left: 8px;
    }

    .acc-head.open .acc-arrow { transform: rotate(180deg); color: var(--accent); }

    .acc-body {
      padding: 10px 12px;
      background: var(--panel);
      display: none;
    }

    .acc-body.open { display: block; }

    .acc-sub-label {
      font-size: 9px;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      color: var(--muted2);
      font-weight: 700;
      margin: 8px 0 5px;
      padding-bottom: 3px;
      border-bottom: 1px solid var(--border);
    }

    .acc-sub-label:first-child { margin-top: 0; }

    .acc-sub-label-cb {
      display: flex;
      align-items: center;
      cursor: pointer;
      user-select: none;
      border-bottom: 1px solid var(--border);
      padding-bottom: 3px;
    }

    .op-grid-hdr {
      display: grid;
      grid-template-columns: 1fr 1fr 1fr;
      gap: 4px;
      text-align: center;
      font-size: 9px;
      color: var(--muted2);
      margin-bottom: 3px;
    }

    .op-row {
      display: grid;
      grid-template-columns: 60px 1fr 1fr 1fr;
      gap: 4px;
      margin-bottom: 4px;
      align-items: center;
    }

    .op-row-lbl {
      font-size: 10px;
      color: var(--muted);
      font-weight: 500;
    }

    .op-row input {
      width: 100%;
      background: var(--panel2);
      border: 1.5px solid var(--border);
      border-radius: 6px;
      padding: 4px 6px;
      color: var(--text);
      font-size: 11px;
      font-family: 'Roboto', sans-serif;
      text-align: center;
      outline: none;
      transition: border-color .15s;
    }

    .op-row input:focus { border-color: var(--accent); }

    .rng-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .rng-row input[type=range] {
      flex: 1;
      accent-color: var(--accent);
    }

    .rng-val {
      font-size: 12px;
      font-weight: 600;
      min-width: 34px;
      color: var(--text);
      text-align: right;
    }

    /* ── 3D FLOOR PANEL ── */
    .floor-3d-panel {
      position: absolute;
      top: 10px;
      right: 10px;
      z-index: 15;
      background: var(--panel);
      border: 1px solid var(--border);
      border-radius: 10px;
      padding: 8px 10px;
      /* 168px — запасное значение до расчёта в JS (_syncFloorViewsPanelWidth
         в script.js), который подгоняет фактическую ширину так, чтобы правый
         край текста «Этажи» совпадал с правым краем «Фундамент», и задаёт
         блоку «Виды» (.viewcube-wrap) такую же ширину. */
      width: 168px;
      box-sizing: border-box;
      box-shadow: 0 2px 12px rgba(0,0,0,.1);
      backdrop-filter: blur(6px);
    }

    /* Поле «Отм.» в блоке «Этажи» — без стрелок счётчика number */
    .floor-mark-input {
      -moz-appearance: textfield;
      appearance: textfield;
    }
    .floor-mark-input::-webkit-outer-spin-button,
    .floor-mark-input::-webkit-inner-spin-button {
      -webkit-appearance: none;
      margin: 0;
    }

    .f3dp-title {
      font-size: 9px;
      letter-spacing: 1.2px;
      text-transform: uppercase;
      color: var(--muted2);
      font-weight: 700;
      margin-bottom: 7px;
    }

    .f3dp-fields {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-top: 6px;
    }

    .f3dp-fields label {
      font-size: 9px;
      color: var(--muted);
      display: block;
      margin-bottom: 2px;
      font-weight: 500;
    }

    .f3dp-fields input {
      width: 100%;
      background: var(--panel2);
      border: 1.5px solid var(--border);
      border-radius: 6px;
      padding: 4px 6px;
      font-size: 11px;
      font-family: 'Roboto', sans-serif;
      color: var(--text);
      outline: none;
    }

    .f3dp-fields input:focus { border-color: var(--accent); }

    .floor-tab-del {
      background: transparent;
      border: none;
      color: var(--muted2);
      cursor: pointer;
      font-size: 13px;
      padding: 0 2px;
      line-height: 1;
      /* Крестик не должен сжиматься флексом и обрезаться: в строке этажа он
         последний, и при нехватке места ужимался именно он. */
      flex-shrink: 0;
      min-width: 16px;
      text-align: center;
    }

    .floor-tab-del:hover { color: #DC2626; }

    /* ── LAYERS PANEL (left sidebar) ── */
    .lp-layers-wrap {
      padding: 12px 14px;
      padding-bottom: 500px;
      overflow-y: auto;
      flex: 1;
      min-height: 0;
    }

    .layer-card {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 9px 12px;
      border: 1px solid var(--border);
      border-radius: 10px;
      margin-bottom: 6px;
      background: var(--panel2);
      cursor: pointer;
      transition: background .12s;
      user-select: none;
    }

    .layer-card:hover { background: var(--accent-l); }

    .layer-card.off {
      opacity: .45;
    }

    .layer-card-left {
      display: flex;
      align-items: center;
      gap: 10px;
    }

    .layer-dot-lg {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      flex-shrink: 0;
    }

    .layer-card-name {
      font-size: 12px;
      font-weight: 600;
      color: var(--text);
    }

    .layer-card-desc {
      font-size: 10px;
      color: var(--muted);
      margin-top: 1px;
    }

    .layer-toggle {
      width: 34px;
      height: 19px;
      border-radius: 10px;
      background: var(--border2);
      position: relative;
      flex-shrink: 0;
      transition: background .2s;
    }

    .layer-toggle.on { background: var(--accent); }

    .layer-toggle::after {
      content: '';
      position: absolute;
      top: 2px;
      left: 2px;
      width: 15px;
      height: 15px;
      border-radius: 50%;
      background: #fff;
      transition: left .2s;
      box-shadow: 0 1px 3px rgba(0,0,0,.2);
    }

    .layer-toggle.on::after { left: 17px; }

    .scale-btn {
  flex: 1;
  padding: 5px 8px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--panel2);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.scale-btn.active {
  border-color: var(--accent);
  background: var(--accent-l);
  color: var(--accent);
}

/* ── Верхний тулбар на ноутбуках ────────────────────────────────────────────
   Блоки тулбара позиционированы абсолютно жёсткими пикселями: .app-brand 342,
   .app-proj-btn до 260 (итого слева до 602), .app-topbar-right right:342 и
   .app-topbar-actions width:320 right:6 (итого справа ~412), а .app-topbar-center
   центрируется по 50%. Чтобы центр не наезжал на выпадашку проекта, нужна
   ширина окна >1424px — у ноутбуков её нет, поэтому блоки налезали друг на
   друга и обрезались по краям. Ниже — постепенное упрощение тулбара. */

/* Логотип и название проекта не должны вылезать за свои границы */
.app-brand-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-proj-dd {
  min-width: 0;
}

/* Ноутбуки: убираем декоративный центр (статус + индикатор готовности) —
   он первым начинает перекрывать соседние блоки */
@media (max-width: 1439px) {
  .app-topbar-center {
    display: none;
  }
}

/* Узкие ноутбуки / масштабирование 125–150%: левый блок и группа действий
   подстраиваются под содержимое, вместо фиксированных 342 и 320 */
@media (max-width: 1100px) {
  .app-brand {
    width: auto;
    max-width: 210px;
  }
  .app-proj-btn {
    max-width: 170px;
  }
  .app-topbar-actions {
    width: auto;
  }
}

/* Совсем узко: прячем «Поделиться» (кнопка и так неактивна) */
@media (max-width: 900px) {
  .app-share-btn {
    display: none;
  }
}

/* ── Демо-режим (до регистрации) ────────────────────────────────────────────
   Дашборд показывается целиком, но заморожен: кликабельны только 3D-вид
   (осмотр демо-дома) и карточка входа/регистрации, пристыкованная к 2D. */
body.demo-mode .app-topbar,
body.demo-mode .side-panel,
body.demo-mode .action-toolbar,
body.demo-mode .bottom-bar,
body.demo-mode .canvas-divider,
body.demo-mode #half2d {
  pointer-events: none;
  user-select: none;
}

/* 3D — единственная живая часть сцены (только вращение дома) */
body.demo-mode #half3d {
  pointer-events: auto;
}

/* Оверлеи поверх 3D («Виды», бейдж выбора) в демо заморожены — крутить дом можно,
   менять вид/ортогональность/фон нельзя */
body.demo-mode #viewCube,
body.demo-mode #sel3dBadge,
body.demo-mode #gen3dBar {
  pointer-events: none;
  opacity: .72;
}

/* Карточка авторизации живёт внутри замороженного #half2d — возвращаем ей клики */
body.demo-mode #authOverlay {
  pointer-events: auto;
  user-select: auto;
}

/* Панели приглушены; нижний блок со сметой — в полную силу, это витрина */
body.demo-mode .app-topbar,
body.demo-mode .side-panel,
body.demo-mode .action-toolbar {
  opacity: .72;
}

/* Оверлей авторизации, пристыкованный к 2D-половине (вместо fixed-полноэкранного).
   Инлайновые стили снимаются в JS (_authDock2d), здесь — только то, что
   переопределяет инлайн у вложенных узлов. */
#authOverlay.auth-in-2d img {
  width: 84px !important;
  height: 84px !important;
  margin-bottom: 0 !important;
}

#authOverlay.auth-in-2d .auth-card {
  padding: 22px !important;
  max-width: 340px !important;
  /* Матовое стекло вместо плотной белой карточки — текст остаётся контрастным */
  background: rgba(255, 255, 255, .86) !important;
  border-color: rgba(255, 255, 255, .55) !important;
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18) !important;
}

/* Задний фон окна регистрации — стеклянный (размытый холст), без светло-серой заливки */
#authOverlay.auth-in-2d {
  background: rgba(255, 255, 255, .06) !important;
  backdrop-filter: blur(16px) saturate(115%);
  -webkit-backdrop-filter: blur(16px) saturate(115%);
}

/* Нижний блок в демо: суммы читаются, а органы управления выглядят «стеклянными»
   — сразу видно, что они неактивны (клики уже сняты pointer-events выше). */
body.demo-mode .bottom-bar button,
body.demo-mode .bottom-bar input,
body.demo-mode .bottom-bar select,
body.demo-mode .bottom-bar .bb-tab-btn,
body.demo-mode .bottom-bar .bb-recalc-btn {
  background: rgba(140, 150, 170, .14) !important;
  color: var(--muted) !important;
  border-color: rgba(140, 150, 170, .22) !important;
  box-shadow: none !important;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: .65;
  cursor: default !important;
}

/* Ручка изменения высоты сметы — тоже неактивна */
body.demo-mode .bottom-bar .bb-curtain,
body.demo-mode .bottom-bar .bb-drag-handle {
  opacity: .35;
  cursor: default !important;
}