/* ===== СХЕМА ЭТАЖЕЙ — встроенная в основной сайт Делосити ===== */

/* Шапка — добавляем кнопку входа/выхода */
.header__auth {
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    color: var(--gray-700);
    padding: 0 14px;
    height: 40px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, color .15s, background-color .15s, box-shadow .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    border-radius: 12px;
}
.header__auth:hover {
    border-color: var(--red);
    color: var(--red);
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.header__auth.is-admin {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}
.header__auth.is-admin:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    color: #fff;
}
.header__auth svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* Тёмная тема — кнопки в шапке */
:root[data-theme="dark"] .header__auth {
    background: var(--card-bg);
    border-color: var(--border);
    color: var(--fg);
}
:root[data-theme="dark"] .header__auth:hover {
    border-color: var(--red);
    color: var(--red);
}

/* Баннер админа */
.admin-banner {
    display: none;
    background: var(--red);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 0;
    text-align: center;
    margin-bottom: -8px;
}
.admin-banner.is-visible { display: block; }
.admin-banner .dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #fff;
    margin-right: 8px;
    vertical-align: middle;
}

/* ===== Секция схемы ===== */
.scheme {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 24px;
    align-items: start;
    margin-top: 32px;
}
.scheme__summary { order: 0; }
.scheme__stage { order: 1; }

/* Левая колонка — этажи + SVG */
.scheme__stage {    border-radius: 12px;

    background: var(--white);
    border: 1px solid var(--gray-300);
    padding: 20px;
    box-shadow: var(--shadow);
}
.scheme__floors {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.scheme__floor {
    border-radius: 10px;
    background: var(--white);
    border: 1.5px solid var(--gray-300);
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    color: var(--gray-700);
    transition: border-color .15s, color .15s, background-color .15s;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 88px;
}
.scheme__floor:hover { border-color: var(--red); color: var(--red); }
.scheme__floor.is-active {
    background: var(--red);
    border-color: var(--red);
    color: #fff;
}
.scheme__floor .n { font-size: 22px; font-weight: 700; line-height: 1; }
.scheme__floor .lbl { font-size: 11px; opacity: .85; }

.scheme__svg-box {
    width: 100%;
    background: var(--gray-100);
    border-radius: 8px;
}
#schemeSvg {
    display: block;
    width: 100%;
    max-width: 100%;
}

/* SVG комнаты */
.room-svg, .zone-svg {
    stroke: var(--gray-300);
    stroke-width: 1.5;
    cursor: pointer;
    transition: stroke .15s, stroke-width .15s;
}
.room-svg.is-free { fill: #ECFDF5; stroke: #6EE7B7; }
.room-svg.is-occupied { fill: #FDECEE; stroke: #FCA5A5; }
.room-svg:hover, .zone-svg:hover { stroke: var(--red); stroke-width: 2.5; }
.room-svg.is-selected, .zone-svg.is-selected { stroke: var(--red); stroke-width: 3.5; }
/* Санузел — синий фон, чтобы визуально отличать от обычных комнат */
.room-svg.is-sanuzel { fill: #DBEAFE; stroke: #60A5FA; }
.room-svg.is-sanuzel.is-occupied { fill: #FCA5A5; stroke: #B91C1C; }
/* Кабинет директора — фирменный красный фон, выделяется в общем ряду */
.room-svg.is-director { fill: #FDECEE; stroke: var(--red); stroke-dasharray: 2 2; }
.room-svg.is-director .svg-room-num { fill: var(--red-dark); }

.svg-label { fill: var(--gray-700); font-size: 18px; font-weight: 700; }
.svg-cor-label { fill: var(--gray-500); font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.svg-cor-fill { fill: var(--gray-100); stroke: var(--gray-300); }
.svg-stair { fill: #FDECEE; stroke: #FCA5A5; stroke-dasharray: 7 4; stroke-width: 1.5; }
/* ===== Тёмная тема для SVG-схемы ===== */
:root[data-theme="dark"] .room-svg.is-free { fill: #14532D; stroke: #22C55E; }
:root[data-theme="dark"] .room-svg.is-occupied { fill: #450A0A; stroke: #DC2626; }
:root[data-theme="dark"] .room-svg, :root[data-theme="dark"] .zone-svg { stroke: #475569; }
:root[data-theme="dark"] .room-svg.is-sanuzel { fill: #1E3A8A; stroke: #60A5FA; }
:root[data-theme="dark"] .room-svg.is-director { fill: #450A0A; stroke: var(--red); }
:root[data-theme="dark"] .svg-label { fill: #F1F5F9; }
:root[data-theme="dark"] .svg-cor-label { fill: #94A3B8; }
:root[data-theme="dark"] .svg-cor-fill { fill: #1E293B; stroke: #475569; }
:root[data-theme="dark"] .svg-stair { fill: #450A0A; stroke: #DC2626; }
:root[data-theme="dark"] .svg-room-num { fill: #F1F5F9; }
:root[data-theme="dark"] .svg-entrance { fill: #1E293B; stroke: #DC2626; }

.svg-stair-text { fill: var(--red); font-size: 16px; font-weight: 700; }
.svg-room-num { fill: var(--black); font-size: 24px; font-weight: 700; }
.svg-entrance { fill: var(--white); stroke: var(--red); stroke-width: 2; }
.svg-entrance-text { fill: var(--red); font-size: 14px; font-weight: 700; letter-spacing: 1px; }

/* Фото-бейдж */
.svg-photo-badge {
    fill: var(--red);
    stroke: #fff;
    stroke-width: 1.5;
}
.svg-photo-badge-num { fill: #fff; font-size: 11px; font-weight: 700; }
.svg-photo-badge-rect { fill: #fff; }

/* ===== Правая колонка — панель ===== */
.scheme__panel {
    background: var(--white);
    border: 1px solid var(--gray-300);
    box-shadow: var(--shadow);
    padding: 24px;
    position: sticky;
    top: 16px;
}
.scheme__panel h3 {
    margin: 0 0 14px;
    font-size: 17px;
    font-weight: 700;
}
.scheme__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 18px;
}
.scheme__stat {    border-radius: 10px;

    background: var(--gray-100);
    padding: 12px;
    border: 1px solid var(--gray-300);
}
.scheme__stat .k { font-size: 11px; color: var(--gray-500); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }
.scheme__stat .v { font-size: 22px; font-weight: 700; margin-top: 4px; color: var(--black); }
.scheme__stat.is-free .v { color: #047857; }
.scheme__stat.is-occupied .v { color: var(--red); }

.scheme__selected {
    border: 1.5px solid var(--gray-300);
    padding: 18px;
    margin-bottom: 16px;
    min-height: 80px;
}
.scheme__selected.is-empty {
    text-align: center;
    color: var(--gray-500);
    font-size: 13px;
    border-style: dashed;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 36px 18px;
}
.scheme__obj-title {    border-radius: 8px;

    font-size: 19px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.scheme__badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    padding: 3px 9px;
    border: 1px solid;
}
.scheme__badge.is-free { background: #ECFDF5; color: #047857; border-color: #6EE7B7; }
.scheme__badge.is-occupied { background: #FDECEE; color: var(--red); border-color: #FCA5A5; }
.scheme__badge .d { width: 7px; height: 7px; background: currentColor; }

.scheme__sub { font-size: 13px; color: var(--gray-500); margin-top: 4px; }

/* Поля админа */
.scheme__field { margin-top: 14px; }
.scheme__field label {
    display: block;
    font-size: 12px;
    color: var(--gray-500);
    margin-bottom: 4px;
    font-weight: 600;
}
.scheme__field input,
.scheme__field .ro {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid var(--gray-300);
    font-size: 14px;
    font-weight: 600;
    color: var(--black);
    background: var(--white);
    font-family: inherit;
    border-radius: 0;
}
.scheme__field .ro { background: var(--gray-100); color: var(--gray-700); cursor: default; }
.scheme__field input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.scheme__switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    padding: 12px 14px;
}
.scheme__switch { position: relative; width: 52px; height: 28px; flex: 0 0 auto; }
.scheme__switch input { opacity: 0; width: 0; height: 0; }
.scheme__switch-slider {
    position: absolute; inset: 0;
    background: var(--gray-300);
    cursor: pointer;
    transition: background-color .15s;
}
.scheme__switch-slider::before {
    content: ""; position: absolute;
    height: 22px; width: 22px;
    left: 3px; top: 3px;
    background: #fff;
    transition: transform .15s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.scheme__switch input:checked + .scheme__switch-slider { background: var(--red); }
.scheme__switch input:checked + .scheme__switch-slider::before { transform: translateX(24px); }

/* Фото */
.scheme__photos {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--gray-300);
}
.scheme__photos-head {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 14px; font-weight: 600;
}
.scheme__photos-head .cnt { color: var(--gray-500); font-weight: 500; font-size: 12px; }
.scheme__ph-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 10px;
}
.scheme__ph-thumb {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    overflow: hidden;
    cursor: pointer;
}
.scheme__ph-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.scheme__ph-thumb .del {
    position: absolute;
    top: 3px; right: 3px;
    background: rgba(17,17,17,.7);
    color: #fff;
    border: 0;
    width: 22px; height: 22px;
    cursor: pointer;
    font-size: 13px;
    line-height: 20px;
    padding: 0;
}
.scheme__ph-add {
    display: block;
    margin-top: 10px;
    border: 1.5px dashed var(--gray-300);
    color: var(--gray-500);
    text-align: center;
    padding: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: border-color .15s, color .15s;
}
.scheme__ph-add:hover { border-color: var(--red); color: var(--red); }

.scheme__btn {
    width: 100%;
    border: 1px solid var(--gray-300);
    padding: 11px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    background: var(--white);
    color: var(--gray-700);
    transition: border-color .15s, color .15s;
    font-family: inherit;
    border-radius: 0;
}
.scheme__btn:hover { color: var(--red); border-color: var(--red); }
.scheme__btn.is-hidden { display: none; }

/* Тултип */
#schemeTooltip {
    position: fixed;
    z-index: 50;
    background: var(--black);
    color: #fff;
    padding: 8px 12px;
    font-size: 12px;
    pointer-events: none;
    opacity: 0;
    white-space: nowrap;
    transition: opacity .15s;
}
#schemeTooltip.is-visible { opacity: 1; }

/* Лайтбокс для фото */
.scheme__lb {
    position: fixed;
    inset: 0;
    background: rgba(17,17,17,.92);
    display: none;
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.scheme__lb.is-visible { display: flex; }
.scheme__lb img { max-width: 90vw; max-height: 78vh; display: block; }
.scheme__lb-bar {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--gray-300);
    font-size: 13px;
    margin-bottom: 10px;
}
.scheme__lb-bar button {
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 0;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
}
.scheme__lb-bar button:hover { background: rgba(255,255,255,.22); }
.scheme__lb-bar button.danger:hover { background: var(--red); }
.scheme__lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.12);
    color: #fff;
    border: 0;
    width: 44px; height: 44px;
    cursor: pointer;
    font-size: 20px;
}
.scheme__lb-nav:hover { background: rgba(255,255,255,.22); }
.scheme__lb-nav.prev { left: 18px; }
.scheme__lb-nav.next { right: 18px; }

/* Капча в модалке входа админа */
.scheme__captcha {
    margin: 12px 0 4px;
    min-height: 0;
    transition: min-height .15s;
}
.scheme__captcha[style*="display: none"] { min-height: 0; }
/* Адаптация виджета SmartCaptcha под темную/светлую тему.
   Сам виджет подгружается со своими стилями — мы лишь центрируем и ограничиваем ширину. */
.scheme__captcha > * { margin: 0 auto; }
/* Капча в форме заявок */
.form__row--captcha { display: flex; justify-content: center; }
.form__row--captcha > div { margin: 0 auto; }
@media (max-width: 480px) {
    /* На очень узких экранах SmartCaptcha может не влезть — скейлим пропорционально */
    .scheme__captcha, .form__row--captcha { transform-origin: top left; }
}

/* Модалка входа */
.scheme__modal {
    position: fixed;
    inset: 0;
    background: rgba(17,17,17,.6);
    display: none;
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.scheme__modal.is-visible { display: flex; }
.scheme__modal-box {
    background: var(--white);
    border: 1px solid var(--gray-300);
    padding: 28px;
    max-width: 380px;
    width: 92%;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.scheme__modal-box h3 { margin: 0 0 8px; font-size: 19px; }
.scheme__modal-box p { margin: 0 0 16px; font-size: 13px; color: var(--gray-500); }
.scheme__modal-box input {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid var(--gray-300);
    font-size: 15px;
    background: var(--white);
    color: var(--black);
    font-weight: 600;
    font-family: inherit;
    border-radius: 0;
}
.scheme__modal-box input:focus {
    outline: none;
    border-color: var(--red);
    box-shadow: 0 0 0 3px var(--red-soft);
}
.scheme__modal-err {
    color: var(--red);
    font-size: 13px;
    font-weight: 600;
    margin-top: 8px;
    display: none;
}
.scheme__modal-err.is-visible { display: block; }
.scheme__modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.scheme__modal-actions .scheme__btn { flex: 1; }
.scheme__modal-actions .scheme__btn--primary {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
}
.scheme__modal-actions .scheme__btn--primary:hover {
    background: var(--red-dark);
    border-color: var(--red-dark);
    color: #fff;
}

/* Подпись под схемой */
.scheme__legend {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 13px;
    color: var(--gray-700);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--gray-300);
}
.scheme__legend i {
    width: 14px;
    height: 14px;
    display: inline-block;
    margin-right: 6px;
    vertical-align: -2px;
}
.scheme__legend .l-free {    border-radius: 6px;
 background: #ECFDF5; border: 1.5px solid #6EE7B7; }
.scheme__legend .l-occupied {    border-radius: 6px;
 background: #FDECEE; border: 1.5px solid #FCA5A5; }
.scheme__legend .l-selected {    border-radius: 6px;
 background: #fff; border: 2px solid var(--red); }
.scheme__legend .l-stair {    border-radius: 6px;
 background: #FDECEE; border: 1.5px dashed #FCA5A5; }
/* ===== Доп. элементы v3 ===== */
.scheme__legend .l-sanuzel {    border-radius: 6px;
 background: #DBEAFE; border: 1.5px solid #93C5FD; }

/* ===== Сводка: на десктопе — плавающая справа, на мобиле — normal flow ===== */
.scheme__summary {
    border-radius: 14px;
    background: var(--white);
    border: 1px solid var(--gray-300);
    box-shadow: 0 20px 60px rgba(0,0,0,.18), 0 8px 20px rgba(0,0,0,.10);
    padding: 22px 24px;
    width: 440px;
    max-width: calc(100vw - 40px);
    position: fixed;
    right: 100px;
    bottom: 50px;
    z-index: 30;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}
.scheme__summary:not(.is-visible) {
    display: none;
}


.scheme__summary__close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--gray-500);
    font-size: 24px;
    line-height: 1;
    z-index: 5;
}
.scheme__summary__close:hover { color: var(--red); }

.scheme__summary.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.scheme__summary h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.scheme__summary h3 #schemeScope {
    font-size: 12px;
    color: var(--gray-500);
    font-weight: 600;
}
.scheme__summary .scheme__stats {
    margin-bottom: 12px;
}
.scheme__summary .scheme__obj {    border-radius: 10px;

    display: none;
    padding-top: 10px;
    border-top: 1px solid var(--gray-300);
}
.scheme__summary .scheme__obj.is-visible {
    display: block;
}
.scheme__summary .scheme__obj-title {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ===== Кнопка «2-е здание» ===== */
.scheme__building-btn {
    border-radius: 10px;
    background: #FEF3C7;
    border: 1.5px solid #FCD34D;
    color: #92400E;
    padding: 12px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, background-color .15s, color .15s;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 100px;
}
.scheme__building-btn:hover {
    border-color: #F59E0B;
    background: #FDE68A;
}
.scheme__building-btn.is-active {
    background: #F59E0B;
    border-color: #F59E0B;
    color: #fff;
}
.scheme__building-btn .n { font-size: 22px; font-weight: 700; line-height: 1; }
.scheme__building-btn .lbl { font-size: 11px; opacity: .85; }

/* ===== Блок «Второе здание» ===== */
.building2 {
    background: linear-gradient(135deg, #FEF3C7 0%, #FDE68A 100%);
    border: 1.5px solid #F59E0B;
    padding: 36px;
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 14px;
}
.building2__icon { font-size: 48px; line-height: 1; }
.building2 h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #92400E;
}
.building2 p {
    margin: 0;
    max-width: 560px;
    color: #78350F;
    font-size: 15px;
    line-height: 1.5;
}
.building2__contacts {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 8px;
}
.building2__hours {
    font-size: 13px;
    color: #92400E;
    opacity: .8;
}

/* ===== Санузел на SVG ===== */
.svg-sanuzel-label {
    fill: #1D4ED8;
    font-size: 18px;
    font-weight: 700;
}
.room-svg.is-occupied[data-obj="206"],
.room-svg.is-occupied[data-obj="306"] {
    fill: #DBEAFE;
    stroke: #93C5FD;
}

/* Кнопка «Назад к схеме» в блоке building2 */
.building2__back {
    background: rgba(255, 255, 255, 0.7);
    border: 1.5px solid #F59E0B;
    color: #92400E;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    align-self: flex-start;
    transition: background-color .15s;
    font-family: inherit;
    border-radius: 0;
}
.building2__back:hover {
    background: #fff;
}

/* ===== v5: компактнее и новые фичи ===== */

/* "Наша сторона" — мельче */
.svg-label--small {
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

/* Статистика в сводке — 3 метрики вместо 4 (без площади) */
.scheme__summary .scheme__stats {
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: auto;
}
.scheme__summary .scheme__stat:last-child {
    display: none;
}

/* Фото в сводке */
.scheme__photos-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 12px;
}
.scheme__photos-mini img {    border-radius: 8px;

    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    cursor: pointer;
    transition: transform .15s;
}
.scheme__photos-mini img:hover {
    transform: scale(1.03);
}

/* Ячейка-обёртка для одного фото с возможностью наложения крестика удаления */
.scheme__photo-cell {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
}
.scheme__photo-cell img { display: block; width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; }
/* Крестик удаления — появляется в правом верхнем углу только для админа */
.scheme__photo-del {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 50%;
    background: rgba(17, 17, 17, 0.72);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
}
.scheme__photo-del:hover { background: var(--red); }
.scheme__photo-del:disabled { opacity: 0.5; cursor: progress; }
/* Кнопка «+ Добавить фото» — плейсхолдер в общей сетке превью */
.scheme__photo-add {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: 1.5px dashed var(--gray-300);
    aspect-ratio: 4/3;
    border-radius: 8px;
    transition: border-color .15s, background .15s;
}
.scheme__photo-add:hover { border-color: var(--red); background: #fff5f5; }
.scheme__photo-add-btn {
    background: transparent;
    border: 0;
    color: var(--gray-700);
    font-family: inherit;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
}
.scheme__photo-add-btn .plus {
    font-size: 24px;
    line-height: 1;
    color: var(--red);
    font-weight: 400;
}
.scheme__photo-add-btn:disabled,
.scheme__photo-add-btn.is-loading { opacity: 0.55; cursor: progress; }
.scheme__photo-add-btn:disabled .plus,
.scheme__photo-add-btn.is-loading .plus { animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }
/* Соло-плейсхолдер (когда у комнаты вообще нет фото) — во всю ширину мини-сетки */
.scheme__photo-add--solo {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 5;
}
.scheme__photo-add--solo .scheme__photo-add-btn { flex-direction: row; gap: 10px; font-size: 14px; }
.scheme__photo-add--solo .scheme__photo-add-btn .plus { font-size: 28px; }
@media (max-width: 720px) {
    .scheme__photo-add--solo { aspect-ratio: 5 / 2; }
}

/* Лайтбокс для фото в сводке */
.scheme__ph-mini-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(15,23,42,.92);
    display: none;
    z-index: 100;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}
.scheme__ph-mini-lightbox.is-visible {
    display: flex;
}
.scheme__ph-mini-lightbox img {
    max-width: 90vw;
    max-height: 78vh;
    display: block;
}
.scheme__ph-mini-lightbox .close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255,255,255,.15);
    color: #fff;
    border: 0;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 22px;
}

/* Сводка — на всю ширину, без position:fixed */
/* removed for desktop fixed width */
.scheme__summary h3 { font-size: 18px !important; }
.scheme__summary .scheme__stat .v { font-size: 22px !important; }
.scheme__summary .scheme__stat .k { font-size: 11px !important; }

/* Фото — крупнее */
.scheme__photos-mini {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-top: 14px !important;
}
.scheme__photos-mini img {
    height: 150px !important;
    cursor: zoom-in;
}

/* Мелкие надписи в SVG — "Наша сторона" */
.svg-label--small {
    font-size: 13px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
}

/* ===== v7: лестницы с надписью + клик фото ===== */
.scheme__photos-mini img {
    cursor: zoom-in !important;
}
.scheme__photos-mini img:hover {
    transform: scale(1.05) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Лайтбокс фото — выше всего */
.scheme__ph-mini-lightbox {
    z-index: 300 !important;
}
.scheme__ph-mini-lightbox img {
    cursor: zoom-out;
}

/* ===== v9: кнопка "Забронировать" в сводке ===== */
.scheme__book-btn {
    border-radius: 10px;
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 14px 18px;
    background: var(--red);
    color: #fff;
    border: 0;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .1s;
    font-family: inherit;
    letter-spacing: 0.2px;
}
.scheme__book-btn:hover { background: var(--red-dark); }
.scheme__book-btn:active { transform: translateY(1px); }
.scheme__book-hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--muted-fg, #7A7A7A);
    text-align: center;
    line-height: 1.4;
}
:root[data-theme="dark"] .scheme__book-hint { color: #94A3B8; }

/* ===== Мобильная версия схемы (phone) ===== */
@media (max-width: 720px) {
    .scheme { gap: 12px; }
    .scheme__stage { padding: 10px; }
    .scheme__floors { gap: 6px; }
    .scheme__floor { padding: 8px 10px; min-width: 0; flex: 1; }
    .scheme__floor .n { font-size: 18px; }
    .scheme__floor .lbl { font-size: 9px; }
    .scheme__building-btn { padding: 8px 10px; flex: 1; }

    /* Сводка — в normal flow, на мобиле показываем стат. блок, скрываем сводку объекта */
    /* На мобиле — сводка в normal flow, во всю ширину */
    .scheme { grid-template-columns: 1fr; gap: 12px; }
    .scheme__summary {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        box-shadow: 0 2px 8px rgba(0,0,0,.04);
        padding: 14px 16px;
    }
    .scheme__summary__close { display: block; top: 8px; right: 8px; }
    .scheme__summary h3 { padding-right: 36px; font-size: 16px !important; }
    .scheme__summary .scheme__stat { flex: 1 1 calc(50% - 10px); min-width: 0; padding: 8px 10px; }
    .scheme__summary .scheme__stat .k { font-size: 10px; }
    .scheme__summary .scheme__stat .v { font-size: 18px; }
    .scheme__summary .scheme__photos-mini { grid-template-columns: 1fr 1fr; }
    .scheme__summary .scheme__photos-mini img { height: 110px; }

    /* Скрыть легенду снизу схемы на мобиле — экономия места */
    .scheme__legend { display: none; }
    .scheme__building2 { padding: 20px 16px; }

    /* Лайтбокс фото на мобиле */
    .scheme__ph-mini-lightbox { z-index: 200; }

    /* Прокрутка к форме с учётом шапки */
    #request { scroll-margin-top: 16px; padding-bottom: 60px; }

    /* Скрыть основную шапку */
    .header { display: none; }
    .header-spacer { display: none; }
    /* Только логотип как плавающая кнопка + кнопка заявки */
    .floating-actions {
        position: fixed;
        top: 12px;
        right: 12px;
        display: flex;
        gap: 8px;
        z-index: 70;
    }
    .floating-actions .btn { padding: 8px 14px; font-size: 12px; }
    .floating-logo {
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 70;
        background: var(--white);
        padding: 6px 10px;
        border-radius: 8px;
        box-shadow: 0 2px 8px rgba(0,0,0,.12);
        display: flex;
        align-items: center;
        gap: 6px;
        font-weight: 700;
        font-size: 14px;
        color: var(--black);
    }
    .floating-logo img, .floating-logo svg { height: 20px; width: auto; }
    body { padding-top: 0; }
}

@media (max-width: 480px) {
    .scheme__floors .scheme__floor { font-size: 11px; }
    .scheme__summary .scheme__stats { gap: 6px; }
}

/* ===== Тач-устройства: скрыть тултип hover ===== */
@media (hover: none) {
    #schemeTooltip { display: none !important; }
}

/* ===== Сводка: горизонтальный layout (десктоп) ===== */
.scheme__summary .scheme__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 10px;
}
.scheme__summary .scheme__stat {
    flex: 0 0 auto;
    min-width: 110px;
    padding: 10px 16px;
    background: var(--gray-100);
}
.scheme__summary .scheme__stat .k { font-size: 10px; }
.scheme__summary .scheme__stat .v { font-size: 20px; }

.scheme__summary .scheme__obj {
    margin-top: 14px;
    padding: 14px;
    background: #FAFAFA;
    border: 1px solid var(--gray-300);
    border-radius: 10px;
    display: none;
}
.scheme__summary .scheme__obj.is-visible { display: block; }

.scheme__summary .scheme__obj-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.scheme__summary .scheme__photos-mini {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 10px;
}
.scheme__summary .scheme__photos-mini img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    cursor: zoom-in;
}

/* Компактный row для объекта */
.scheme__summary .scheme__obj-row {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}
.scheme__summary .scheme__obj-row .scheme__photos-mini {
    flex: 0 0 auto;
    width: 240px;
    margin: 0;
}
.scheme__summary .scheme__obj-row .scheme__obj-info {
    flex: 1 1 300px;
    min-width: 0;
}
.scheme__summary .scheme__book-btn {
    margin-top: 12px;
}

/* SVG контейнер с aspect ratio (десктоп — широкий) */
.scheme__svg-wrap {
    width: 100%;
    padding-bottom: 52.4793%; /* 508/968 = 0.52479... */
    position: relative;
    background: #FAFBFC;
    border-radius: 8px;
}

/* На мобиле — компактная схема с сохранением пропорций */
@media (max-width: 720px) {
    .scheme__svg-wrap {
        padding-bottom: 62% !important;
    }
}
.scheme__svg-wrap #schemeSvg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Плавающие элементы: только на мобиле */
.floating-logo, .floating-actions {
    display: none;
}
@media (max-width: 720px) {
    .floating-logo, .floating-actions {
        display: flex;
    }
}

/* ===== Switch (toggle) для админки ===== */
.scheme__switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
    padding: 10px 12px;
    background: var(--gray-100);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-700);
}
.scheme__switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}
.scheme__switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.scheme__switch-slider {
    position: absolute;
    inset: 0;
    background: #D1D5DB;
    border-radius: 26px;
    transition: background-color .2s;
}
.scheme__switch-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform .2s;
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.scheme__switch input:checked + .scheme__switch-slider {
    background: var(--red);
}
.scheme__switch input:checked + .scheme__switch-slider::before {
    transform: translateX(22px);
}
.scheme__switch input:focus-visible + .scheme__switch-slider {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}
.scheme__switch input:disabled + .scheme__switch-slider {
    opacity: .5;
    cursor: wait;
}
