/* BSRealty — global styles. CSS-vars based, no build step. */
:root {
    --c-bg: #ffffff;
    --c-surface: #ffffff;
    --c-text: #0d0d0d;
    --c-muted: #374151;
    --c-border: #e5e7eb;
    --c-border-strong: #cbd5e1;
    /* ОСНОВНОЙ цвет (1) — меняется ТОЛЬКО здесь (применяется и как rgba(var(--c-primary-rgb), a)).
       Прежние: бирюза #0d7a5f / вишнёвый #5a0e1c / оригинал #800020. */
    --c-primary: #14492f;
    --c-primary-dk: #0e3522;
    --c-primary-rgb: 20, 73, 47;
    /* ВТОРОЙ основной цвет (2) — тёмно-синий акцент. */
    --c-accent: #004274;
    --c-accent-dk: #002d52;
    --c-success: #10b981;
    --c-danger: #ef4444;
    --c-warn: #f59e0b;

    --r-sm: 5px;
    --r-md: 5px;
    --r-lg: 5px;

    --shadow-1: 0 1px 2px rgba(0,0,0,.06);
    --shadow-2: 0 4px 12px rgba(0,0,0,.08);
    --shadow-3: 0 10px 30px rgba(0,0,0,.12);

    --pad-page: 20px;
    --pad-card: 20px;

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font: 15px/1.5 var(--font);
    color: var(--c-text);
    background: var(--c-bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh; display: flex; flex-direction: column;   /* sticky footer */
}
body > .site-main { flex: 1 0 auto; }
body > .site-foot { flex-shrink: 0; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary); text-decoration: underline; }

/* BSR.datePicker — лёгкий календарь (формат YYYY-MM-DD единый по сайту) */
.dp-pop { position: absolute; top: 100%; left: 0; z-index: 200; margin-top: 4px; background: #fff; border: 1px solid var(--c-border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.14); padding: 10px; width: 240px; }
.dp-hd { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 6px; }
.dp-mon { font-weight: 600; font-size: 14px; }
.dp-year { font-weight: 600; font-size: 14px; border: 1px solid var(--c-border); border-radius: 4px; padding: 2px 4px; background: #fff; cursor: pointer; }
.dp-nav { border: none; background: none; cursor: pointer; font-size: 18px; line-height: 1; padding: 2px 10px; color: var(--c-primary); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.dp-dow { text-align: center; font-size: 11px; color: var(--c-muted); padding: 2px 0; }
.dp-cell { border: none; background: none; cursor: pointer; font-size: 13px; padding: 6px 0; border-radius: 6px; text-align: center; color: var(--c-text); }
.dp-cell:hover { background: rgba(var(--c-primary-rgb), .12); }
.dp-cell.on { background: var(--c-primary); color: #fff; }
.dp-empty { visibility: hidden; }
img { max-width: 100%; height: auto; display: block; }
/* Авторское правило `img{display:block}` перебивало UA `[hidden]{display:none}`
   (origin: author > UA) → скрытые <img hidden> показывались битой картинкой. Возвращаем. */
[hidden] { display: none; }
.container { max-width: 100%; margin: 0 auto; padding: 0 24px; } /* TEMP: full-width, вернуть 1280px */
.muted { color: var(--c-muted); }

/* BUTTONS ------------------------------------------------------------------ */
.btn-primary, .btn-secondary, .btn-ghost, .btn-outline, .btn-success {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 5px;
    font: inherit; font-weight: 600; cursor: pointer;
    border: 1px solid transparent; transition: .15s;
}
.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover { background: var(--c-primary-dk); }
/* Кнопка-ссылка: общее a:hover красит текст в цвет primary — на зелёном фоне он пропадал
   (Sign-in на странице перед Sell). Белый текст у кнопки сильнее правила для ссылок. */
a.btn-primary:hover { color: #fff; text-decoration: none; }
.btn-primary:disabled { background: #d4d4d4; color: #fff; cursor: not-allowed; }
.btn-secondary { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-secondary:hover { border-color: var(--c-primary); color: var(--c-primary-dk); }
.btn-success { background: #16a34a; color: #fff; }
.btn-success:hover { background: #128a3d; }
.btn-success:disabled { background: #d4d4d4; color: #fff; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--c-text); }
.btn-ghost:hover { background: var(--c-bg); }
/* Иконка-кнопка в шапке (User / Admin / Favorites) — компактная, квадратная */
.hdr-ico { padding: 8px 10px; color: var(--c-text); }
.hdr-ico:hover { color: var(--c-primary); background: var(--c-bg); }
.hdr-ico.on { color: var(--c-primary); }
.hdr-ico svg { display: block; }
/* Красная точка на шестерёнке: админ ходит по сайту и под maintenance,
   и должен видеть, что для остальных сайт закрыт (index.php, templates/header.php). */
.hdr-ico.hdr-mnt, .hdr-drawer-ico.hdr-mnt { position: relative; }
.hdr-ico.hdr-mnt::after, .hdr-drawer-ico.hdr-mnt::after { content: ''; position: absolute; top: 5px; right: 6px;
    width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px var(--c-surface); }
/* Прозрачная кнопка-контур: заливается при наведении, текст белеет */
.btn-outline { background: transparent; color: var(--c-primary); border-color: var(--c-primary); }
.btn-outline:hover { background: var(--c-primary); color: #fff; }

/* ===========================================================================
   ADMIN
   =========================================================================== */
/* Фон админ-панелей (фильтр/список/редактор). Действует и в админке, и в кабинете
   агентства/агента — у обоих <body class="adm">. Меняется одной этой переменной. */
body.adm {
    background: #ffffff;
    --c-adm-panel: #00000009;                       /* фон списка/редактора */
    --c-adm-filter: rgb(0 155 255 / 14%); /* фон панели фильтра (синий, прозрачность) */
}
/* Панели списка/редактора — фон из --c-adm-panel; фильтр — из --c-adm-filter. Поля внутри белые. */
body.adm .adm-two .adm-pane {
    background: var(--c-adm-panel); border: 1px solid var(--c-border);
    box-shadow: none;
}
body.adm .obj-filter-panel {
    background: var(--c-adm-filter); border: 1px solid var(--c-border);
    box-shadow: none;
}
/* Тело списка (левая панель) — белое; строка пагинации/счётчика — серая. */
body.adm .adm-two .adm-pane:first-child .adm-pane-body { background: #fff; }
body.adm .obj-listbar { background: transparent; border: none; }
body.adm .obj-filter-panel input:not([type=range]):not([type=checkbox]):not([type=radio]),
body.adm .obj-filter-panel select,
body.adm .obj-filter-panel textarea,
body.adm .adm-pane input:not([type=range]):not([type=checkbox]):not([type=radio]),
body.adm .adm-pane select,
body.adm .adm-pane textarea {
    background: #fff;
}
.adm-top {
    background: #fff; color: var(--c-text);
    display: flex; align-items: center;
    padding: 0 24px; height: 56px;
    border-bottom: 1px solid var(--c-border);
    position: sticky; top: 0; z-index: 100;
}
.adm-brand {
    display: flex; align-items: center; gap: 10px;
    color: var(--c-text); font-weight: 600; padding-right: 16px;
}
.adm-brand:hover { color: var(--c-primary); }
.adm-brand-mark {
    background: var(--c-primary); color: #fff;
    width: 32px; height: 32px; border-radius: 5px;
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 800; letter-spacing: -.5px;
}
.adm-brand-mark.big { width: 56px; height: 56px; font-size: 22px; border-radius: 5px; }
/* Логотип сайта в шапке кабинета/админки. Высота — как у прежнего квадратика «BS» (32px),
   чтобы шапка не подросла; на экране входа — крупнее. */
.adm-brand-img { height: 32px; width: auto; display: block; }
.adm-brand-img-big { height: 56px; margin: 0 auto; }
.adm-brand-name small { opacity: .65; font-weight: 400; margin-left: 4px; }
.adm-site-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; margin-right: 8px;
    border-radius: 5px; color: var(--c-muted);
    border: 1px solid var(--c-border);
    transition: color .15s, border-color .15s, background .15s;
}
.adm-site-icon:hover { color: var(--c-primary); border-color: var(--c-primary); background: rgba(var(--c-primary-rgb),.08); }
.adm-top-spacer { flex: 1; }
/* В админке/кабинете меню идёт одной строкой прямо в шапке (.adm-top).
   overflow:visible — чтобы не обрезалась выпадашка Others.
   flex:0 1 auto + min-width:0 — nav может ужиматься; пункты (flex:0 0 auto) не
   сжимаются, поэтому их ширина стабильна для JS-замера overflow (см. main.js). */
.adm-nav { display: flex; gap: 2px; align-items: center; overflow: visible; margin-left: 8px; flex: 0 1 auto; min-width: 0; }
/* Вариант .adm-nav-row — отдельная вторая строка (кабинет агентства, _panel_tabs admin-chrome) */
.adm-nav-row {
    background: #fff;
    padding: 6px 24px;
    position: sticky; top: 56px; z-index: 99;
    border-bottom: 1px solid var(--c-border);
    flex-wrap: wrap; margin-left: 0;
}
.adm-nav-link {
    color: var(--c-muted); padding: 8px 14px;
    border-radius: 5px; font-size: 14px; font-weight: 500;
    text-transform: capitalize; white-space: nowrap; flex: 0 0 auto;
}
.adm-nav-link:hover { background: var(--c-bg-soft, #f0f2f7); color: var(--c-text); }
.adm-nav-link.on { background: var(--c-primary); color: #fff; }

/* Подменю «Others» (второстепенные страницы) */
.adm-nav-row { overflow: visible; }   /* иначе выпадашка обрежется (был overflow-x:auto) */
.adm-nav-dd { position: relative; }
.adm-nav-dd-btn { background: none; border: none; cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 5px; }
.adm-nav-dd-caret { font-size: 10px; opacity: .7; }
.adm-nav-dd-menu {
    position: absolute; top: 100%; left: 0; min-width: 180px;
    background: #fff; border: 1px solid var(--c-border);
    border-radius: 6px; box-shadow: var(--shadow-1);
    padding: 4px; display: none; flex-direction: column; gap: 2px; z-index: 120;
}
.adm-nav-dd:hover .adm-nav-dd-menu,
.adm-nav-dd:focus-within .adm-nav-dd-menu { display: flex; }
.adm-nav-dd-menu .adm-nav-link { display: block; }
/* Logout в строке кабинета — прижат вправо (в подменю overflow margin не действует). */
.adm-nav > .adm-nav-logout-item { margin-left: auto; }
/* Logout закреплён внизу Others — отделяем чертой. */
.adm-nav-dd-menu .adm-nav-logout-item {
    margin-top: 4px; padding-top: 10px;
    border-top: 1px solid var(--c-border);
}

/* === Бургер мобильного меню кабинета агентства/агента (.adm-panel) ===
   Главную админку (body.adm без .adm-panel) НЕ трогаем — все правила скоупим на .adm-panel. */
.adm-nav-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 4px;
    width: 38px; height: 38px; padding: 0 8px; box-sizing: border-box; cursor: pointer;
    background: #fff; border: 1px solid var(--c-border); border-radius: 5px; margin-left: 8px;
}
.adm-nav-toggle span { display: block; height: 2px; width: 100%; background: var(--c-text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.adm-nav-toggle.on span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.adm-nav-toggle.on span:nth-child(2) { opacity: 0; }
.adm-nav-toggle.on span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
.adm-nav-head { display: none; }     /* шапка drawer-меню (язык + ✕) — только на мобиле */
@media (max-width: 768px) {
    .adm-panel .adm-nav-toggle { display: flex; order: -1; margin-left: 0; margin-right: 6px; }
    .adm-panel .adm-top { padding: 0 12px; }
    /* Класс ставит JS на время открытого меню: шапка (а с ней и .adm-nav внутри неё)
       поднимается над затемнением #drawer-mask (z-index 1400). */
    .adm-panel .adm-top.adm-nav-open { z-index: 1500; }
    /* Меню страниц = левый off-canvas drawer (как на фронте) */
    .adm-panel .adm-nav {
        position: fixed; top: 0; left: 0; z-index: 1500;
        width: min(82vw, 320px); height: 100vh; height: 100dvh;
        flex-direction: column; align-items: stretch; gap: 2px; margin: 0; padding: 10px;
        background: var(--c-surface); border-right: 1px solid var(--c-border);
        box-shadow: 2px 0 24px rgba(0,0,0,.18);
        transform: translateX(-100%); transition: transform .25s ease;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    .adm-panel .adm-nav.open { transform: none; }
    .adm-panel .adm-nav-link { padding: 13px 14px; border-radius: 6px; }
    .adm-panel .adm-nav > .adm-nav-logout-item { margin-left: 0; }
    .adm-panel .adm-nav-dd { display: none !important; }
    /* Язык из шапки убираем — он живёт в шапке меню-drawer (.adm-nav-head) */
    .adm-panel .adm-top > .adm-site-icon,
    .adm-panel .adm-top > .hdr-lang-wrap { display: none; }
    /* Шапка меню: флажок языка слева, крестик справа (как в drawer'е фронта).
       position:sticky — она же containing block для popup'а языка (см. ниже). */
    .adm-panel .adm-nav-head {
        display: flex; align-items: center; justify-content: space-between; gap: 8px;
        flex: 0 0 auto; padding: 4px 6px 10px; margin: 0 -4px 6px;
        border-bottom: 1px solid var(--c-border);
        position: sticky; top: -10px; background: var(--c-surface); z-index: 1;
    }
    .adm-panel .adm-nav-head .hdr-lang-wrap { display: block; }
    /* Список языков — на ВСЮ ширину меню и в 2 столбика, как в drawer'е фронта.
       .hdr-lang-wrap static → popup позиционируется от .adm-nav-head. */
    .adm-panel .adm-nav-head .hdr-lang-wrap { position: static; }
    .adm-panel .adm-nav-head .hdr-lang-pop {
        left: 4px; right: 4px; width: auto; top: calc(100% + 6px);
        max-height: calc(100dvh - 80px);
    }
    .adm-panel .adm-nav-head .hdr-lang-list { grid-template-columns: 1fr 1fr; gap: 2px; }
    .adm-panel .adm-nav-head .hdr-lang-opt { padding: 12px 10px; }
    .adm-panel .adm-nav-head .hdr-lang-opt .hl-native { font-size: 14px; }
    .adm-panel .adm-nav-head .hdr-lang-opt .hl-flag { width: 22px; height: 16px; }
    /* Справа в шапке меню — переход на сайт и ✕ (язык остаётся слева). */
    .adm-panel .adm-nav-head-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
    .adm-nav-site, .adm-nav-close {
        width: 38px; height: 38px; flex: 0 0 auto; display: inline-flex;
        align-items: center; justify-content: center; padding: 0; cursor: pointer;
        background: #fff; border: 1px solid var(--c-border); border-radius: 8px; color: var(--c-text);
    }
    .adm-nav-site:hover, .adm-nav-close:hover { border-color: var(--c-primary); color: var(--c-primary); }
}
.adm-user { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.adm-user-name { color: var(--c-muted); }
.adm-logout {
    color: var(--c-muted); padding: 6px 12px;
    border: 1px solid var(--c-border); border-radius: 5px;
}
.adm-logout:hover { color: var(--c-primary); border-color: var(--c-primary); }

.adm-main { padding: var(--pad-page); max-width: 100%; margin: 0; }
.adm-page-head { margin-bottom: 16px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.adm-page-head h1 { display: none; }
/* Если в шапке остались только action-кнопки — компактный вид */
.adm-page-head:empty { display: none; }
.adm-page-head-actions { display: flex; gap: 8px; align-items: center; }

/* AGENTS TAB (редактор Objects/NB) — карточки агентов с аватаром-инициалами */
.ag-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px,1fr)); gap: 10px; padding: 8px 0; }
.ag-card {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px;
    border: 1px solid var(--c-border); border-radius: 8px; cursor: pointer; position: relative;
    transition: border-color .15s, background .15s; user-select: none;
    background: #fff;
}
.ag-card input { position: absolute; opacity: 0; pointer-events: none; }
.ag-card:hover { border-color: var(--c-primary); }
.ag-card.on { border-color: var(--c-primary); background: rgba(var(--c-primary-rgb),.06); }
.ag-ava {
    flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%;
    color: #fff; font-weight: 700; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center;
}
.ag-info { display: flex; flex-direction: column; min-width: 0; }
.ag-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-meta { font-size: 12px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-tick {
    margin-left: auto; flex: 0 0 auto; width: 20px; height: 20px; border-radius: 50%;
    border: 1px solid var(--c-border); color: transparent;
    display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
}
.ag-card.on .ag-tick { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }

/* INQUIRIES PAGE */
.inq-filters {
    display: flex; gap: 10px; align-items: center;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px;
    padding: 10px 14px; margin-bottom: 14px;
}
.inq-filters select { padding: 6px 10px; border: 1px solid var(--c-border); border-radius: 5px; font: inherit; min-width: 200px; }
.inq-filters select:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb),.18); }
.inq-only-unread { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; cursor: pointer; }
.inq-count { margin-left: auto; font-size: 13px; }

.inq-list { display: flex; flex-direction: column; gap: 10px; }
.inq-card {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px;
    padding: 12px 14px;
}
.inq-card.is-unread { border-left: 3px solid var(--c-primary); background: #fffaf3; }
.inq-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.inq-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; }
.inq-id { font-family: ui-monospace, Consolas, monospace; color: var(--c-muted); }
.inq-date { color: var(--c-muted); }
.inq-badge { background: var(--c-primary); color: #fff; padding: 1px 8px; border-radius: 3px; font-size: 10px; font-weight: 600; letter-spacing: .5px; }
.inq-actions { display: flex; gap: 6px; }
.inq-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px 14px; margin-bottom: 10px; font-size: 13px;
}
.inq-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.inq-field span { font-size: 11px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .3px; }
.inq-field b { font-weight: 500; word-break: break-word; }
.inq-field a { color: var(--c-primary-dk); }
.inq-field small { font-size: 11px; }
.inq-field-wide { grid-column: 1 / -1; }
.inq-msg {
    background: #f6f7fb; border-radius: 5px; padding: 10px 12px;
    font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
    max-height: 200px; overflow-y: auto;
    margin-bottom: 10px;
}
.inq-links { display: flex; gap: 6px; flex-wrap: wrap; }
.inq-links .btn-mini { text-decoration: none; }

/* OPTIONS PAGE */
.opt-grid { display: grid; grid-template-columns: 220px 1fr; gap: 16px; }
.opt-cats { display: flex; flex-direction: column; gap: 4px; background: #dcfce7; border: 1px solid var(--c-border); border-radius: 5px; padding: 8px; height: max-content; position: sticky; top: 16px; }
.opt-cat { background: none; border: none; padding: 8px 12px; border-radius: 5px; cursor: pointer; text-align: left; font: inherit; color: var(--c-text); }
.opt-cat:hover { background: #f0f2f7; }
.opt-cat.on { background: var(--c-primary); color: #fff; }
.opt-list {
    background: var(--c-adm-panel, #00000009); border: 1px solid var(--c-border); border-radius: 5px;
    padding: 20px;
    /* НЕ ставим overflow:hidden — клипает dropdown'ы у некоторых браузеров */
}
.opt-empty { padding: 30px; text-align: center; }
.opt-row {
    display: grid; grid-template-columns: 220px 1fr 1.5fr;
    gap: 14px; align-items: center;
    padding: 8px 14px; border-bottom: 1px solid var(--c-border);
    transition: background .15s;
}
/* Виджеты типа multilang/textarea — input на всю освободившуюся ширину */
.opt-row-wide { grid-template-columns: 220px 1fr; align-items: start; }
.opt-row:last-child { border-bottom: none; }
.opt-row:hover { background: #fafbfc; }
.opt-row.dirty { background: rgba(var(--c-primary-rgb),.06); }
.opt-row-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.opt-row-label { font-weight: 500; font-size: 13px; color: var(--c-text); }
.opt-row-key {
    font-family: ui-monospace, Consolas, monospace; font-size: 10px;
    color: var(--c-muted); padding: 0; background: none;
}
.opt-row-desc { font-size: 12px; color: var(--c-muted); line-height: 1.4; }
.opt-row-input input, .opt-row-input select, .opt-row-input textarea {
    width: 100%; padding: 6px 10px; font: inherit; font-size: 13px;
    border: 1px solid var(--c-border); border-radius: 5px; background: #fff;
    line-height: 1.4;
}
/* Высоту явно НЕ задаём — пусть растёт по контенту, чтобы native-dropdown'ы у select'ов рендерились нормально */
.opt-row-input select { height: auto; }
.opt-row-input input:focus, .opt-row-input select:focus, .opt-row-input textarea:focus {
    outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb),.18);
}
.opt-row-input textarea {
    font-family: ui-monospace, Consolas, monospace; font-size: 12px;
    resize: vertical; min-height: 60px; height: auto;
}
.opt-row-input input[readonly], .opt-row-input textarea[readonly], .opt-row-input select[readonly] {
    background: #fafafa; color: var(--c-muted);
}

/* Checkbox widget */
.opt-check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.opt-check input { width: 16px; height: 16px; margin: 0; }
/* Матрица уведомлений (Options → Telegram): событие × канал. */
.ev-table { border-collapse: collapse; font-size: 13px; }
.ev-table th { text-align: center; font-size: 12px; color: var(--c-muted); padding: 4px 14px; font-weight: 600; }
.ev-table th:first-child { text-align: left; }
.ev-table td { padding: 5px 14px; border-top: 1px solid var(--c-border, #e5e7eb); text-align: center; }
.ev-table td.ev-name { text-align: left; padding-left: 0; }
.ev-table td.ev-name code { display: block; font-size: 11px; color: var(--c-muted); }
.ev-table input { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.ev-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.ev-actions .opt-desc { margin: 0; }

/* Multilang tag-picker */
.ml-wrap { display: flex; flex-direction: column; gap: 6px; }
.ml-tags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 24px; }
.ml-tag {
    display: inline-flex; align-items: center; gap: 4px;
    background: rgba(var(--c-primary-rgb),.12); color: var(--c-primary-dk);
    border: 1px solid rgba(var(--c-primary-rgb),.3); border-radius: 5px;
    padding: 2px 4px 2px 8px; font-size: 12px; line-height: 1.3;
}
.ml-tag-locked { background: #f0f2f7; color: var(--c-text); border-color: var(--c-border); }
.ml-tag small { opacity: .6; font-family: ui-monospace, Consolas, monospace; }
.ml-x {
    background: transparent; border: none; cursor: pointer; color: inherit;
    font-size: 16px; line-height: 1; padding: 0 4px; opacity: .6;
}
.ml-x:hover { opacity: 1; color: #b22; }
/* Multilang two-column picker */
.ml-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ml-col  { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ml-col-h {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .3px;
    padding: 0 2px;
}
.ml-list {
    border: 1px solid var(--c-border); border-radius: 5px; background: #fff;
    height: 250px;             /* ~10 строк × 25px */
    overflow-y: auto; padding: 3px;
    display: flex; flex-direction: column; gap: 1px;
}
.ml-row {
    display: flex; align-items: center; gap: 4px;
    background: transparent; border: none;
    padding: 4px 8px; border-radius: 3px;
    font: inherit; font-size: 13px; line-height: 1.3;
    text-align: left; color: var(--c-text); cursor: pointer;
}
.ml-row:hover { background: #f1f5f9; color: var(--c-text); }
.ml-row small { opacity: .5; font-family: ui-monospace, Consolas, monospace; font-size: 11px; }
.ml-list-selected .ml-row { background: transparent; color: var(--c-text); }
.ml-list-selected .ml-row:hover { background: #fee2e2; color: #b22; }
.ml-empty {
    padding: 10px; text-align: center; color: var(--c-muted); font-size: 12px;
    font-style: italic;
}
.ml-bulk {
    flex: 0 0 auto; padding: 3px 8px; font-size: 11px; line-height: 1;
    border: 1px solid var(--c-border); border-radius: 5px; background: #fff;
    cursor: pointer; color: var(--c-text);
}
.ml-bulk:hover { border-color: var(--c-primary); color: var(--c-primary-dk); }
.ml-bulk:disabled { opacity: .4; cursor: not-allowed; }
.opt-status { font-size: 13px; }
.opt-status.warn { color: #c66700; font-weight: 500; }
.opt-status.ok   { color: #21803a; font-weight: 500; }
.opt-status.err  { color: #b22; font-weight: 500; }

/* TOAST stack (bottom-right) */
.bsr-toast-stack {
    position: fixed; right: 20px; bottom: 20px; z-index: 9999;
    display: flex; flex-direction: column; gap: 8px;
    pointer-events: none;
}
.bsr-toast {
    pointer-events: auto;
    display: flex; align-items: center; gap: 12px;
    min-width: 240px; max-width: 420px;
    padding: 10px 14px; border-radius: 5px;
    background: #2c2c2c; color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    font-size: 13px; line-height: 1.4;
    transform: translateX(120%); opacity: 0;
    transition: transform .22s ease, opacity .22s ease;
}
.bsr-toast.on { transform: translateX(0); opacity: 1; }
.bsr-toast-msg { flex: 1; word-break: break-word; }
.bsr-toast-x {
    background: transparent; border: none; color: rgba(255,255,255,.7);
    cursor: pointer; font-size: 18px; line-height: 1; padding: 0 2px;
}
.bsr-toast-x:hover { color: #fff; }
.bsr-toast-ok   { background: #2e7d4f; }
.bsr-toast-err  { background: #b22a2a; }
.bsr-toast-warn { background: #c66700; }
.bsr-toast-info { background: #2c2c2c; }

/* Inline form-сообщения убраны в пользу всплывающих toast'ов */
.adm-form-msg, .adm-editor-msg, .adm-action-msg, .form-msg { display: none !important; }

/* Locations: search bar (global) */
.loc-search-bar {
    display: flex; gap: 8px; align-items: center; margin-bottom: 12px;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px;
    padding: 8px 10px;
}
.loc-search-bar input[type="text"] {
    flex: 1 1 220px; padding: 6px 10px; border: 1px solid var(--c-border); border-radius: 5px;
    font: inherit;
}
.loc-search-bar input[type="text"]:focus {
    outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb),.18);
}
.loc-search-bar select {
    padding: 6px 8px; border: 1px solid var(--c-border); border-radius: 5px; font: inherit;
    max-width: 180px;
}
.loc-search-bar select:disabled { background: #f6f7fb; color: var(--c-muted); }
.loc-search-bar button { padding: 6px 12px; }

/* Locations: per-column local filter */
.loc-col-q {
    flex: 1; min-width: 0; padding: 3px 8px; font-size: 12px;
    border: 1px solid var(--c-border); border-radius: 5px;
}
.loc-col-q:focus { outline: none; border-color: var(--c-primary); }
.loc-col-q:disabled { background: #f6f7fb; }
.loc-col-head { gap: 6px; }

/* Editor: compact heading + Save (push to right) */
.loc-ed-save { padding: 4px 14px; font-size: 13px; margin-left: auto; }
.loc-form .adm-field input,
.loc-form .adm-field select {
    padding: 6px 10px; font-size: 13px;
}
.loc-form .adm-field select { height: auto; }
.loc-form .adm-field span { font-size: 12px; margin-bottom: 2px; }
.loc-ed-grid { gap: 6px 12px !important; }
/* Форма редактора — не растягивать на всю ширину колонки */
.loc-form { max-width: 640px; }
/* Row с Lat/Lng/Status/Order/Population — одна горизонтальная строка.
   Ширина в долях, чтобы поля не вылезали за пределы редактора на узких экранах. */
.loc-ed-row {
    display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; align-items: flex-end;
}
/* Lat/Lng — растягиваются равномерно. min-width:0 разрешает сжиматься ниже content size */
.loc-ed-row .adm-field { flex: 1 1 0; min-width: 0; margin: 0; }
.loc-ed-row .adm-field input,
.loc-ed-row .adm-field select { width: 100%; min-width: 0; }
/* Status / Order — компактные фиксированные. Используем процент чтобы не ломать layout */
.loc-ed-row .adm-field[data-narrow="1"]   { flex: 0 1 12%; min-width: 50px; max-width: 80px; }
/* Status — большой чекбокс вместо select */
.loc-status-cell {
    display: inline-flex; align-items: center; justify-content: flex-start;
    height: 28px; padding: 0 4px;
}
.loc-status-cb { width: 22px; height: 22px; margin: 0; cursor: pointer; }
.loc-ed-row .adm-field[data-narrow="num"] { flex: 0 1 18%; min-width: 70px; max-width: 110px; }

/* Locations: batch-import panel */
.loc-import {
    background: #fafbfc; border: 1px solid var(--c-border); border-radius: 5px;
    padding: 14px 16px; margin-bottom: 18px;
}
.loc-import[hidden] { display: none; }
.loc-import-row { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.loc-import-row .adm-field { flex: 1 1 360px; min-width: 280px; }
.loc-import-row .adm-field select { width: 100%; }
.loc-import .small { font-size: 12px; margin: 8px 0 0; }
.loc-import code {
    background: #eef1f4; padding: 1px 6px; border-radius: 3px;
    font-family: ui-monospace, Consolas, monospace; font-size: 12px;
}

/* Popup: import statistics */
.bsr-pop-stats { display: grid; gap: 4px; font-size: 14px; margin-top: 8px; }
.bsr-pop-stats b { color: var(--c-text); }
.bsr-pop-err { color: #b22; margin: 0; }
.bsr-pop-errs { margin-top: 10px; font-size: 12px; }
.bsr-pop-errs pre { background: #f6f6f6; padding: 8px; border-radius: 4px; overflow: auto; max-height: 160px; }

.adm-foot {
    display: flex; justify-content: space-between; padding: 16px 24px;
    color: var(--c-muted); font-size: 13px; border-top: 1px solid var(--c-border);
}
.adm-muted { color: var(--c-muted); }

/* Stats list (plain, not cards) */
.adm-stat-list { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px; margin-top: 24px; }
.adm-stat-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 18px; border-bottom: 1px solid var(--c-border);
    color: var(--c-text); font-size: 14px;
}
.adm-stat-row:last-child { border-bottom: 0; }
.adm-stat-row:hover { background: #f7f8fa; }
.adm-stat-row-lbl { color: var(--c-muted); text-transform: capitalize; }
.adm-stat-row-num { font-weight: 700; }

/* Fake-data table inside Actions */
.adm-fake-h { margin: 24px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--c-muted); }
.adm-fake-table { border-collapse: collapse; width: 100%; max-width: 640px; }
/* Колонка заголовков вдвое шире: с прежней «New buildings» и «Price history» ломались
   на две строки. Числовое поле — тоже вдвое, чтобы 5-значные значения были видны целиком. */
.adm-fake-table th { text-align: left; padding: 6px 12px 6px 0; font-weight: 600; font-size: 14px; width: 220px; }
.adm-fake-table td { padding: 6px 8px; }
.adm-fake-table input { width: 180px; padding: 6px 10px; border: 1px solid var(--c-border); border-radius: 5px; font: inherit; }
.adm-fake-table .btn-primary, .adm-fake-table .btn-secondary { padding: 6px 14px; font-size: 13px; }
.adm-fake-all th { padding-top: 12px; border-top: 1px solid var(--c-border); }
.adm-fake-all td { padding-top: 12px; border-top: 1px solid var(--c-border); }

/* Actions */
.adm-actions {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 5px; padding: var(--pad-card); margin-bottom: 24px;
}
.adm-actions h2 { margin: 0 0 16px; font-size: 16px; text-transform: uppercase; letter-spacing: .5px; color: var(--c-muted); }
.adm-actions-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.adm-action-msg { margin-top: 16px; min-height: 20px; font-size: 14px; }
.adm-action-msg.ok { color: var(--c-success); }
.adm-action-msg.err { color: var(--c-danger); }

.adm-banner {
    background: #fff7e0; border: 1px solid var(--c-warn); color: #92400e;
    padding: 12px 18px; border-radius: 5px;
    display: flex; align-items: center; gap: 10px;
}
.adm-banner-link { margin-left: auto; color: #92400e; font-weight: 600; }

.adm-placeholder {
    background: var(--c-surface); border: 1px dashed var(--c-border-strong);
    border-radius: 5px; padding: 60px 20px;
    text-align: center; color: var(--c-muted);
}
.adm-placeholder svg { color: var(--c-border-strong); margin-bottom: 12px; }
.adm-placeholder h2 { color: var(--c-text); margin: 0 0 4px; }

/* LOGIN -------------------------------------------------------------------- */
.adm-login-body {
    background: linear-gradient(135deg, #004274 0%, #002d52 100%);
    min-height: 100vh; margin: 0;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
}
.adm-login-card {
    background: var(--c-surface); border-radius: 5px;
    box-shadow: var(--shadow-3); padding: 40px;
    width: 100%; max-width: 400px;
}
.adm-login-brand { text-align: center; margin-bottom: 28px; }
.adm-login-brand h1 { margin: 16px 0 4px; font-size: 18px; }
.adm-login-brand .adm-brand-mark { margin: 0 auto; }

.adm-form { display: flex; flex-direction: column; gap: 16px; }
.adm-field { display: flex; flex-direction: column; gap: 6px; }
.adm-field span { font-size: 13px; color: var(--c-muted); font-weight: 500; }
.adm-field input,
.adm-field select,
.adm-field textarea {
    border: 1px solid var(--c-border-strong); border-radius: 5px;
    padding: 10px 12px; font: inherit; transition: .15s;
    background: #fff; color: inherit; width: 100%; box-sizing: border-box;
}
.adm-field select { padding: 9px 12px; height: 42px; }
.adm-field textarea { min-height: 60px; resize: vertical; }
.adm-field input:focus,
.adm-field select:focus,
.adm-field textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb),.18); }
.adm-form .btn-primary { justify-content: center; padding: 12px; font-size: 15px; }
.adm-form-msg { min-height: 18px; text-align: center; font-size: 14px; }
.adm-form-msg.err { color: var(--c-danger); }

/* ===========================================================================
   FRONTEND
   =========================================================================== */
.site-top { background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.site-top-inner { display: flex; align-items: center; gap: 14px; padding: 12px 20px; }
/* Логотип — цельная картинка-локап; высоту задаём, ширину считает браузер. */
.site-logo { display: flex; align-items: center; gap: 10px; color: var(--c-text); font-weight: 700; font-size: 18px; }
.site-logo img { height: 38px; width: auto; display: block; }
/* Шапка — одна строка: логотип, страна, меню, переключатели. Пунктов много, поэтому
   меню сжимается (min-width: 0) и пункты не переносятся внутри себя (nowrap);
   когда строка перестаёт помещаться, включается бургер (медиа ниже). */
.site-nav { display: flex; gap: 2px; flex: 1; min-width: 0; }
.site-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.site-nav a { padding: 8px 10px; color: var(--c-text); font-weight: 500; border-radius: 5px; white-space: nowrap; }
.site-nav a:hover { background: var(--c-bg); color: var(--c-primary-dk); }
.site-nav a.on { color: var(--c-primary); font-weight: 700; box-shadow: inset 0 -2px 0 var(--c-primary); border-radius: 0; }
.site-nav-disabled { opacity: .4; pointer-events: none; }

/* === Бургер мобильного меню === скрыт на десктопе, показывается ≤760px (см. медиа ниже) */
.hdr-nav-toggle {
    display: none; flex-direction: column; justify-content: center; gap: 4px;
    width: 40px; height: 40px; padding: 0 9px; box-sizing: border-box; cursor: pointer;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px;
}
.hdr-nav-toggle span { display: block; height: 2px; width: 100%; background: var(--c-text); border-radius: 2px; transition: transform .2s, opacity .2s; }
.site-top.nav-open .hdr-nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-top.nav-open .hdr-nav-toggle span:nth-child(2) { opacity: 0; }
.site-top.nav-open .hdr-nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* === Шапка фронта на мобильных === лого + страна + иконки в ряд, меню — выпадающим списком.
   Брейкпоинт 1160, а не 760: шапка идёт одной строкой, а 7 пунктов меню + страна +
   переключатели валюты/языка перестают в неё влезать уже около 1130px — там и
   включаем бургер (меню уезжает в левый drawer, см. блок drawer-панелей ниже). */
@media (max-width: 1160px) {
    .site-top-inner { gap: 10px; padding: 10px 14px; flex-wrap: wrap; }
    .site-logo { font-size: 16px; }
    .site-logo img { height: 30px; width: auto; }
    .hdr-nav-toggle { display: flex; }
    .site-actions { gap: 6px; }
    /* Меню переносится на свою строку под шапкой и раскрывается по бургеру */
    .site-nav {
        order: 10; flex: 0 0 100%; flex-direction: column; gap: 2px;
        margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--c-border);
        display: none;
    }
    .site-top.nav-open .site-nav { display: flex; }
    .site-nav a { padding: 12px 10px; }
    .site-nav a.on { box-shadow: none; background: var(--c-bg); border-radius: 6px; }
}

/* Фильтр-бар: на всю ширину экрана (class .container давал margin:0 auto и центрировал
   его как flex-ребёнка body → перебиваем), белый фон как в Rent/Buy + липнет к верху. */
.site-search-bar { padding: 8px 24px; position: sticky; top: 0; z-index: 50; background: var(--c-surface); border-bottom: 1px solid var(--c-border); width: 100%; margin: 0; align-self: stretch; }
.site-search {
    background: transparent; border: 0; border-radius: 5px;
    display: flex; gap: 5px; align-items: center; flex-wrap: wrap;
}
/* Единая высота всех контролов фильтра (Search и X — как остальные поля) */
.site-search > input[type=search],
.site-search > .ssrch-btn,
.site-search > .ssrch-select,
.site-search > .btn-primary,
.site-search > .hdr-country-wrap { height: 40px; }

/* === Фильтр-бар на мобильных === flex-строка из ~9 контролов сворачивается по рядам:
   Локация (вся ширина) → Поиск (вся ширина) → Type/Rooms/Price/More по 2 → Reset+Search+List/MAP. */
@media (max-width: 768px) {
    .site-search-bar { padding: 8px 12px; }
    .site-search { flex-wrap: wrap; row-gap: 8px; }
    .site-search > #hdr-loc-open,
    .site-search > #hdr-locex-open { order: 0; flex: 1 1 100%; justify-content: center; }
    .site-search-bar .site-search > input[type=search] { order: 1; flex: 1 1 100%; }
    .site-search > .ssrch-select,
    .site-search > .ssrch-btn[data-pop] { order: 2; flex: 1 1 calc(50% - 3px); justify-content: center; }
    /* Сортировка и Filter — одной строкой по 50%: сортировка слева, Filter справа.
       min-width:0 обязателен: по умолчанию у flex-элемента min-width:auto, и селект
       не даёт ужать себя уже самого длинного пункта («Price: low to high») — из-за
       этого строка не вмещала оба элемента и Filter уезжал на следующую. */
    .site-search > .ssrch-sort { order: 2; flex: 1 1 calc(50% - 3px); min-width: 0; }
    .site-search > .ssrch-adv  { order: 2; flex: 1 1 calc(50% - 3px); min-width: 0; }
    /* Reset (слева) + List/MAP (справа) — одной строкой; Search — на всю ширину отдельной строкой */
    .site-search > .ssrch-reset { order: 3; flex: 0 0 auto; }
    .site-search > .ssrch-views { order: 3; flex: 0 0 auto; margin-left: auto; }
    .site-search > .btn-primary { order: 4; flex: 1 1 100%; }
}

/* ===========================================================================
   МОБИЛЬНЫЕ OFF-CANVAS DRAWER-ПАНЕЛИ (≤1160 меню слева, ≤768 поиск справа)
   Затемнение фона .drawer-mask; тело блокирует скролл при открытой панели.
   =========================================================================== */
.hdr-drawer { display: none; }
.hdr-search-toggle { display: none; }
.drawer-mask { position: fixed; inset: 0; z-index: 1400; background: rgba(0,0,0,.45); }
.drawer-mask[hidden] { display: none; }
body.drawer-lock { overflow: hidden; }

/* Бургер → X, когда открыт drawer (класс .on ставит JS) */
.hdr-nav-toggle.on span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hdr-nav-toggle.on span:nth-child(2) { opacity: 0; }
.hdr-nav-toggle.on span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 1160px) {
    /* На мобиле страну/меню/иконки убираем из шапки — всё в drawer-меню. */
    .site-top-inner .hdr-country-wrap,
    .site-top-inner .site-actions { display: none; }
    .hdr-nav-toggle { order: -1; }
    .site-logo { order: 0; margin-right: auto; }

    /* Главная (.site-top-min): drawer'а нет, поэтому язык и вход остаются в самой шапке. */
    .site-top-min .site-top-inner .site-actions { display: flex; }

    /* Левая панель-меню */
    .hdr-drawer {
        display: flex; flex-direction: column;
        position: fixed; top: 0; left: 0; z-index: 1500;
        width: min(82vw, 320px); height: 100vh; height: 100dvh;
        background: var(--c-surface); border-right: 1px solid var(--c-border);
        box-shadow: 2px 0 24px rgba(0,0,0,.18);
        transform: translateX(-100%); transition: transform .25s ease;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
    }
    .hdr-drawer.open { transform: none; }
    .hdr-drawer-head {
        display: flex; align-items: center; justify-content: space-between;
        padding: 14px 16px; border-bottom: 1px solid var(--c-border);
        position: sticky; top: 0; background: var(--c-surface); z-index: 1;
    }
    .hdr-drawer-title { font-weight: 700; font-size: 16px; }
    .hdr-drawer-close { background: none; border: 0; padding: 4px; cursor: pointer; color: var(--c-text); display: inline-flex; }
    /* Иконки логина/админки + ✕ в одной строке справа от заголовка. */
    .hdr-drawer-head-actions { display: flex; align-items: center; gap: 6px; }
    .hdr-drawer-ico {
        display: inline-flex; align-items: center; justify-content: center;
        width: 38px; height: 38px; border: 1px solid var(--c-border); border-radius: 6px; color: var(--c-text);
    }
    .hdr-drawer-ico.on { color: var(--c-primary); border-color: var(--c-primary); }
    /* Низ меню: шестерёнка админки. margin-top:auto прижимает блок к нижнему краю
       (.hdr-drawer — flex-колонка), поэтому иконка всегда внизу слева. */
    .hdr-drawer-foot { margin-top: auto; padding: 12px 16px; border-top: 1px solid var(--c-border); }
    /* Страна + язык: два «селектбокса» по 50% в один ряд. */
    /* Выбор страны стоит в шапке меню вместо названия сайта — тянется по свободному месту. */
    .hdr-drawer-cc { flex: 1 1 auto; min-width: 0; display: flex; margin-right: 8px; }
    .hdr-drawer-cc .hdr-country { width: 100%; height: 38px; justify-content: space-between; }
    .hdr-drawer-cc .hdr-country > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    /* Список стран в меню: на всю ширину панели и со скроллом по вертикали.
       Базовое правило .hdr-country-pop — overflow:hidden и без max-height, поэтому
       длинный список просто уезжал за нижний край экрана и не прокручивался.
       position:static у wrap'а — чтобы якорем стала шапка меню (как у списка языков),
       иначе popup шире своей кнопки вылезал бы вбок и давал горизонтальный скролл. */
    .hdr-drawer .hdr-country-wrap { position: static; }
    .hdr-drawer .hdr-country-pop {
        left: 8px; right: 8px; width: auto; max-width: none; top: calc(100% + 6px);
        max-height: calc(100dvh - 80px); overflow-y: auto; overflow-x: hidden;
    }
    /* Список языков раскрываем на ВСЮ ширину меню (раньше 300px popup обрезался правым
       краем панели) и с крупными строками — чтобы попадать пальцем.
       .hdr-lang-wrap делаем static: тогда popup позиционируется от .hdr-drawer-head. */
    .hdr-drawer .hdr-lang-wrap { position: static; }
    .hdr-drawer .hdr-lang-pop {
        left: 8px; right: 8px; width: auto; top: calc(100% + 6px);
        max-height: calc(100dvh - 80px);
    }
    .hdr-drawer .hdr-lang-list { grid-template-columns: 1fr 1fr; gap: 4px; }
    .hdr-drawer .hdr-lang-opt { min-height: 48px; padding: 12px 12px; gap: 10px; border-radius: 10px; }
    .hdr-drawer .hdr-lang-opt .hl-native { font-size: 15px; }
    .hdr-drawer .hdr-lang-opt .hl-flag { width: 24px; height: 18px; }
    .hdr-drawer-nav { display: flex; flex-direction: column; padding: 8px; }
    .hdr-drawer-nav a { padding: 12px; border-radius: 6px; color: var(--c-text); font-weight: 600; }
    .hdr-drawer-nav a.on { background: var(--c-bg); color: var(--c-primary-dk); }
}

@media (max-width: 768px) {
    /* Лупа: открывает/закрывает правый drawer-поиск; иконка ↔ ✕ */
    .hdr-search-toggle {
        display: inline-flex; order: 1; align-items: center; justify-content: center;
        width: 40px; height: 40px; padding: 0; cursor: pointer; color: var(--c-text);
        background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px;
    }
    .hdr-search-toggle .ico-x { display: none; }
    .hdr-search-toggle.on .ico-s { display: none; }
    .hdr-search-toggle.on .ico-x { display: inline-flex; }

    /* Фильтр-бар → правая off-canvas панель */
    .site-search-bar {
        position: fixed; top: 0; right: 0; z-index: 1500;
        width: min(88vw, 380px); height: 100vh; height: 100dvh;
        transform: translateX(100%); transition: transform .25s ease;
        overflow-y: auto; -webkit-overflow-scrolling: touch;
        box-shadow: -2px 0 24px rgba(0,0,0,.18);
        padding: 14px 14px 48px; border-bottom: 0;
    }
    .site-search-bar.open { transform: none; }

    /* Location у простых баров (agencies/agents/new-buildings) — на всю ширину */
    .site-search > .ssrch-btn[data-pop="fbloc"],
    .site-search > .ssrch-btn[data-pop="nbloc"] { order: 0; flex: 1 1 100%; justify-content: center; }
    /* Нижняя панель действий: [Reset] [ Search ] [✕] — прибита к самому низу панели.
       Форму делаем position:static, чтобы якорем для absolute стала сама панель
       (.site-search-bar, она fixed на всю высоту), а не короткая форма. Растягивать форму
       через min-height нельзя: она вытолкнет вниз статичный блок фильтра More, который
       лежит СЛЕДОМ за формой. sticky тоже не подходит — он не двигает элемент вниз,
       когда прокручивать нечего. padding-bottom панели резервирует место под строку. */
    /* position:fixed, а НЕ absolute: форма получает inline position:relative из JS
       (Google-автоподстановка в header.php), перебить её стилем нельзя, а якорь-форма
       короткая — строка вставала бы сразу под фильтрами. Панель прижата к правому краю
       экрана, поэтому отсчитываем от него через --fdrawer-w. Бонус: строка остаётся
       на месте при прокрутке панели. Когда панель закрыта, у неё transform —
       она становится контейнером для fixed-потомков, и кнопки уезжают вместе с ней. */
    .site-search-bar { --fdrawer-w: min(88vw, 380px); padding-bottom: 76px; }
    .site-search > .ssrch-reset,
    .site-search > .btn-primary,
    .site-search > .ssrch-close {
        position: fixed; bottom: 14px; height: 46px; z-index: 6; margin: 0; left: auto;
    }
    .site-search > .ssrch-close { right: 14px; width: 46px; display: inline-flex; justify-content: center; }
    .site-search > .ssrch-reset { right: calc(var(--fdrawer-w) - 60px); width: 46px; justify-content: center; }
    .site-search > .btn-primary { right: 74px; width: calc(var(--fdrawer-w) - 148px); }
    /* List/MAP переехали в шапку (кнопка-тоггл слева от лупы) — в панели они не нужны. */
    .site-search > .ssrch-views { display: none; }
    .site-search > .ssrch-best { order: 2; flex: 1 1 100%; justify-content: center; }

    /* More(adv) раскрывается ВНИЗ внутри панели (не центр-модалкой) */
    .ssrch-modal-mask { display: none !important; }
    .ssrch-pop.ssrch-pop-modal#ssrch-pop-adv {
        position: static; transform: none; left: auto; top: auto;
        width: 100%; max-width: none; max-height: none; box-shadow: none;
        border: 0; padding: 8px 0; margin-top: 8px;
    }
    /* Type / Condition / Rooms / Price — на ВСЮ ширину панели и строго ПОД своей кнопкой.
       JS проставляет inline left/top от кнопки: top оставляем (он и даёт «под кнопкой»),
       а left/width перебиваем !important, иначе popup уезжает за правый край экрана.
       Раньше Price был position:static и падал в конец формы — под кнопки List/MAP. */
    #ssrch-pop-type, #ssrch-pop-cond, #ssrch-pop-rooms, #ssrch-pop-price {
        position: absolute !important;
        left: 0 !important; right: 0 !important;
        width: auto !important; min-width: 0 !important; max-width: none !important;
        z-index: 70;
    }
    /* Area / Land внутри More: разворачиваем на всю ширину панели, а не узкой выпадашкой.
       :has() — чтобы поле с открытым подпопапом занимало обе колонки сетки. */
    /* .site-search-bar в селекторе — чтобы перебить базовое правило .advf-subpop
       (position:absolute; min-width:250px), объявленное НИЖЕ по файлу. */
    .site-search-bar .advf-subpop {
        position: static; width: auto; min-width: 0;
        box-shadow: none; border: 0; padding: 10px 0 0;
    }
    .site-search-bar .advf-range-field:has(.advf-subpop:not([hidden])) { grid-column: 1 / -1; }
    .ssrch-pop-adv2 .advf-grid,
    .ssrch-pop-adv2 .features-grid,
    .ssrch-pop-adv2 .advf-row4 { grid-template-columns: 1fr 1fr; }
    /* Внутренний picker location-popup не растягиваем фиксированной шириной */
    .site-search-bar [id$="-loc-picker"] { min-width: 0 !important; }
    /* Слоты фильтра (Save / Load / Subscribe): на телефоне их 5 групп в строку не влезают —
       переносим отдельным блоком над Close/Apply и даём кнопкам палец-размер. */
    .advf-foot { flex-wrap: wrap; }
    .advf-subs-wrap { order: -1; width: 100%; margin: 0 0 10px; }
    .advf-subs { gap: 6px; }
    .advf-slot { padding: 2px; gap: 0; }
    .advf-slot-n { width: 14px; font-size: 10px; }
    .advf-slot-btn { width: 34px; height: 34px; }
}

/* Выбор страны — справа от логотипа в шапке. Popup со всеми странами в 6 колонок. */
.hdr-country-wrap { position: relative; display: inline-flex; }
.hdr-country {
    display: inline-flex; align-items: center; gap: 8px; height: 36px;
    border: 1px solid var(--c-border); background: var(--c-surface); padding: 0 14px;
    border-radius: 5px; font: inherit; font-weight: 600; cursor: pointer;
    color: var(--c-accent); white-space: nowrap;
}
.hdr-country:hover { border-color: var(--c-accent); }
.hdr-country .caret { color: #94a3b8; font-size: 11px; }
.hdr-country-pop {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 200; width: max-content; max-width: 92vw;
    background: #fff; border: 1px solid var(--c-border); border-radius: 8px; box-shadow: 0 12px 36px rgba(0,0,0,.18);
    padding: 8px; overflow: hidden;
}
.hdr-country-pop[hidden] { display: none; }
/* Все страны видны сразу: сетка в 6 колонок */
.hdr-country-list { display: grid; grid-template-columns: repeat(6, minmax(130px, 1fr)); gap: 2px; }
@media (max-width: 1100px) { .hdr-country-list { grid-template-columns: repeat(4, minmax(130px, 1fr)); } }
@media (max-width: 760px)  { .hdr-country-list { grid-template-columns: repeat(2, minmax(130px, 1fr)); } }
.hdr-country-opt {
    display: block; width: 100%; text-align: left; border-radius: 4px;
    border: 0; background: none; padding: 7px 10px; font: inherit; font-size: 13px; cursor: pointer; color: var(--c-text);
}
.hdr-country-opt:hover { background: rgba(0, 66, 116, .08); color: var(--c-accent); }
.hdr-country-opt.on { background: var(--c-accent); color: #fff; font-weight: 600; }
/* Страна без объектов — серая, не кликается (disabled в header.php). */
.hdr-country-opt:disabled { color: #b3b7bd; cursor: default; background: none; }
.site-search input[type=search] {
    /* min-width:0 обязателен: у flex-элемента по умолчанию min-width:auto, и поле
       не даёт ужать себя уже своей «интринсик» ширины (~180px) — из-за этого строка
       не вмещала всё и пара List/MAP уезжала на второй ряд. Свой минимум задаём
       явно: до 150px поле сжимается, дальше уже переносим ряд. */
    flex: 1; min-width: 150px;
    border: 1px solid var(--c-border); border-radius: 5px;
    padding: 8px 11px; font: inherit; outline: none; transition: border-color .15s;
}
.site-search input[type=search]:focus { border-color: var(--c-primary); }
.ssrch-btn {
    border: 1px solid var(--c-border); background: var(--c-surface); padding: 8px 11px;
    border-radius: 5px; cursor: pointer; font: inherit; font-weight: 500;
    color: var(--c-text); transition: .15s;
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
}
.ssrch-btn:hover { border-color: var(--c-primary); color: var(--c-primary-dk); }
.ssrch-select {
    border: 1px solid var(--c-border); background: var(--c-surface); padding: 8px 11px;
    border-radius: 5px; cursor: pointer; font: inherit; font-weight: 500; color: var(--c-text);
}
.ssrch-select:hover { border-color: var(--c-primary); }
.ssrch-adv { color: var(--c-primary-dk); font-weight: 600; }
.ssrch-reset { padding: 8px 9px; color: var(--c-muted); text-decoration: none; line-height: 0; }
.ssrch-reset:hover { color: var(--c-primary); border-color: var(--c-primary); }
/* Подпись у Reset — только на десктопе и только в баре Rent/Buy (span есть лишь там).
   На телефоне кнопка живёт внизу drawer'а фиксированной ширины — там остаётся иконка. */
.ssrch-reset-t { display: none; }
@media (min-width: 769px) {
    .site-search > .ssrch-reset { line-height: normal; padding: 8px 11px; white-space: nowrap; }
    .site-search > .ssrch-reset .ssrch-reset-t { display: inline; }
}
/* «Best» toggle в фильтр-баре (новостройки/листинги). */
.ssrch-best {
    border: 1px solid var(--c-border); background: var(--c-surface); padding: 8px 11px;
    border-radius: 5px; cursor: pointer; font: inherit; font-weight: 500; color: var(--c-text);
    display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; transition: .15s;
}
.ssrch-best input { position: absolute; opacity: 0; pointer-events: none; }
.ssrch-best:hover { border-color: var(--c-primary); color: var(--c-primary-dk); }
.ssrch-best.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.ssrch-best.on .i { color: #fff; }   /* иначе .i { color: --c-text } красит звёздочку тёмной */
/* Кнопка закрытия панели фильтра — только мобильная (в drawer'е), на десктопе не нужна. */
.ssrch-close { display: none; }
/* Сортировка в форме фильтра — только мобильная: на десктопе селект сортировки
   уже стоит в results-bar справа от пикера колонок, дубль там не нужен. */
.ssrch-sort { display: none; }
@media (max-width: 768px) { .ssrch-sort { display: block; } }
.ssrch-pop {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px;
    padding: 18px; margin-top: 8px; box-shadow: var(--shadow-2);
    position: relative;
}
.ssrch-pop-wide { padding: 14px; overflow: visible; }

/* Price popup + dual-range slider */
.ssrch-pop-price { position: absolute; z-index: 60; margin-top: 0; max-width: 360px; padding: 18px; }
.ps-slider { position: relative; height: 28px; margin: 4px 8px 14px; }
.ps-rail {
    position: absolute; top: 50%; left: 0; right: 0; height: 4px;
    transform: translateY(-50%); background: var(--c-border); border-radius: 2px;
}
.ps-fill { position: absolute; top: 0; bottom: 0; background: var(--c-primary); border-radius: 2px; }
.ps-range {
    position: absolute; top: 0; left: 0; width: 100%; height: 28px; margin: 0;
    background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.ps-range::-webkit-slider-thumb {
    -webkit-appearance: none; pointer-events: auto; width: 16px; height: 16px; border-radius: 50%;
    background: var(--c-surface); border: 2px solid var(--c-primary); cursor: pointer; box-shadow: var(--shadow-1);
}
.ps-range::-moz-range-thumb {
    pointer-events: auto; width: 16px; height: 16px; border-radius: 50%;
    background: var(--c-surface); border: 2px solid var(--c-primary); cursor: pointer;
}
.ps-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ps-fields .adm-field input {
    width: 100%; border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit;
}
.ps-apply { padding-left: 22px; padding-right: 22px; }
/* Низ price-popup: результат слева, Apply справа. */
.ps-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; }
.ps-result { font-size: 14px; font-weight: 600; color: var(--c-text); }
.ps-fields > input {
    width: 100%; border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit;
}

/* Advanced popup (More) — full width, 6 fields per row */
.ssrch-pop-adv2 { width: 100%; }
/* Модалка для подокна "More": centered fixed + light overlay. */
.ssrch-modal-mask {
    position: fixed; inset: 0; background: rgba(255, 255, 255, .55);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    z-index: 990;
}
.ssrch-pop.ssrch-pop-modal {
    position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(960px, 92vw); max-height: 85vh; overflow: auto;
    margin-top: 0; z-index: 1000; padding: 24px;
}
.ssrch-modal-close {
    position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
    border: 1px solid var(--c-border); background: var(--c-surface);
    border-radius: 50%; cursor: pointer; font-size: 20px; line-height: 1;
    color: var(--c-text); transition: .15s;
}
.ssrch-modal-close:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
/* 7 колонок: Floor, Floors, Energy class, Year built, Area, Land, Garage — одной строкой. */
.advf-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 1280px) { .advf-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .advf-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .advf-grid { grid-template-columns: repeat(2, 1fr); } }
.advf-grid .adm-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.advf-grid .adm-field > span { font-size: 12px; color: var(--c-muted); }
.advf-grid select, .advf-grid input[type=text], .advf-grid input[type=number] {
    border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit; width: 100%;
}
.advf-check { flex-direction: row !important; align-items: center; justify-content: space-between; }
.advf-toggle { position: relative; display: inline-block; width: 40px; height: 22px; flex: none; }
.advf-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.advf-toggle span { position: absolute; inset: 0; background: var(--c-border); border-radius: 11px; cursor: pointer; transition: .15s; }
.advf-toggle span::before { content: ''; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.advf-toggle input:checked + span { background: var(--c-primary); }
.advf-toggle input:checked + span::before { transform: translateX(18px); }

/* Area / Land — кнопка + маленький popup со слайдером (как Price) */
.advf-range-btn {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    width: 100%; text-align: left; background: var(--c-surface); cursor: pointer;
}
.advf-range-btn .i { color: var(--c-muted); }
.advf-subpop {
    position: absolute; top: calc(100% + 4px); left: 0; z-index: 60;
    min-width: 250px; background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 6px; box-shadow: var(--shadow-2); padding: 14px;
}
.advf-subpop .ps-fields { display: flex; gap: 10px; margin-top: 12px; }
.advf-subpop .ps-fields input { width: 100%; border: 1px solid var(--c-border); border-radius: 5px; padding: 7px 9px; font: inherit; }
/* .adm-field input навешивает border/padding на ВСЕ инпуты поля — для range-ползунков слайдера это ломает вид. Сбрасываем. */
.advf-range-field .ps-range { border: 0; padding: 0; background: none; box-shadow: none; height: 28px; }
.advf-range-field .ps-range:focus { border: 0; box-shadow: none; outline: none; }
.advf-subok { width: 100%; margin-top: 12px; }
.advf-section-title { font-size: 13px; font-weight: 600; color: var(--c-muted); margin: 4px 0 10px; }

/* Agent / Agency — отдельная строка (2 поля) */
.advf-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.advf-row2 .adm-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.advf-row2 .adm-field > span { font-size: 12px; color: var(--c-muted); }
.advf-row2 input[type=text] { border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit; width: 100%; }
/* Agent + Agency + Code + Code only — в одну строку. */
/* Ряд: Agency + New building + Code + пилюли Code only / Best — всё в одну строку. */
/* Ряд из четырёх РАВНЫХ колонок: Agency + New building + Особое состояние + Code. */
.advf-row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; align-items: end; }
.advf-row4 select { border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit; width: 100%; background: #fff; }
.advf-row4 .adm-field { display: flex; flex-direction: column; gap: 4px; position: relative; }
.advf-row4 .adm-field > span { font-size: 12px; color: var(--c-muted); }
.advf-row4 input[type=text] { border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit; width: 100%; }
@media (max-width: 560px) { .advf-row2 { grid-template-columns: 1fr; } }

/* Autocomplete dropdown (agent / agency) */
.suggest-pop {
    position: absolute; top: 100%; left: 0; right: 0; z-index: 30; margin-top: 2px;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px;
    box-shadow: var(--shadow-2); overflow: hidden;
}
.suggest-item { display: block; width: 100%; text-align: left; padding: 8px 10px; border: 0; background: none; font: inherit; cursor: pointer; }
.suggest-item:hover { background: var(--c-bg); color: var(--c-primary-dk); }

/* Features (внутри More) — 6 в ряд */
.ssrch-pop-adv2 .features-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin-bottom: 14px; }
@media (max-width: 900px) { .ssrch-pop-adv2 .features-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .ssrch-pop-adv2 .features-grid { grid-template-columns: repeat(2, 1fr); } }
.ssrch-pop-adv2 .feat-item { display: flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1.5px solid var(--c-border); border-radius: 6px; cursor: pointer; user-select: none; font-size: 12px; }
.ssrch-pop-adv2 .feat-item input { position: absolute; opacity: 0; pointer-events: none; }
.ssrch-pop-adv2 .feat-check { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; border-radius: 50%; border: 1.5px solid var(--c-border); color: transparent; flex: none; }
.ssrch-pop-adv2 .feat-item.on { background: #fdf2f4; border-color: var(--c-primary); color: var(--c-primary-dk); }
.ssrch-pop-adv2 .feat-item.on .feat-check { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
/* «Code only» — высотой как инпуты слева (Agent/Agency/Code) */
.ssrch-pop-adv2 .feat-item.advf-codeonly { height: 40px; padding: 0 14px; align-self: end; font-size: 13px; }
/* Низ модалки More: Close слева, Apply справа */
/* Верх слотов фильтра — на одном уровне с Close/Apply (подсказка под слотами свисает ниже). */
.advf-foot { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-top: 4px; }
/* Close — с иконкой × слева от подписи. */
.advf-close { display: inline-flex; align-items: center; gap: 6px; }
.advf-close .i { display: inline-flex; }
/* Подписки на фильтр — 5 слотов сразу справа от Close. Занятый слот подсвечен. */
/* Слоты фильтра: 3 группы «сохранить / восстановить / подписаться». */
/* Обёртка слотов + подсказка под ними: занимает всё место между Close и Apply, содержимое по центру. */
.advf-subs-wrap { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 5px; }
.advf-subs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.advf-subs-hint { font-size: 12px; line-height: 1.3; color: var(--c-muted); text-align: center; }
.advf-slot { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 2px;
    border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface); }
.advf-slot.taken { border-color: var(--c-primary); }
.advf-slot-n { width: 18px; text-align: center; font-size: 11px; font-weight: 700; color: var(--c-muted); }
.advf-slot-btn { display: inline-flex; align-items: center; justify-content: center;
    width: 30px; height: 30px; padding: 0; border: 0; border-radius: 6px;
    background: transparent; color: #475569; cursor: pointer; transition: .12s; }
.advf-slot-btn:hover:not(:disabled) { background: var(--c-bg); color: var(--c-primary); }
.advf-slot-btn:disabled { opacity: .35; cursor: default; }
.advf-slot-btn.on { color: var(--c-primary); background: rgba(var(--c-primary-rgb), .12); }
.advf-slot-btn.advf-notify.on svg { fill: currentColor; }

/* Крупнее шрифт в popup-фильтрах шапки (More / Price + подпопапы Area / Land) — читабельнее. */
.ssrch-pop-price .adm-field span,
.ssrch-pop-adv2 .adm-field > span { font-size: 14px; }
.ssrch-pop-price input[type=number],
.ssrch-pop-adv2 .advf-grid select,
.ssrch-pop-adv2 .advf-grid input[type=text],
.ssrch-pop-adv2 .advf-grid input[type=number],
.ssrch-pop-adv2 .advf-row4 input[type=text],
.ssrch-pop-adv2 .advf-range-btn,
.ssrch-pop-adv2 .advf-subpop input[type=number] { font-size: 15px; }
.ssrch-pop-adv2 .advf-section-title { font-size: 15px; }
.ssrch-pop-adv2 .feat-item,
.ssrch-pop-adv2 .feat-item.advf-codeonly { font-size: 14px; }

/* Фильтр More: вкладки «Фильтры / Особенности»; список особенностей скроллится внутри вкладки. */
.advf-tabs { display: flex; gap: 6px; margin-bottom: 14px; border-bottom: 1px solid var(--c-border); }
.advf-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 8px 14px; font: inherit; font-size: 15px; font-weight: 600; color: var(--c-muted); cursor: pointer; margin-bottom: -1px; }
.advf-tab.on { color: var(--c-primary-dk); border-bottom-color: var(--c-primary); }
.advf-tab-n { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: var(--c-primary); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.advf-pane-feat { max-height: min(52vh, 460px); overflow-y: auto; overscroll-behavior: contain; padding-right: 4px; margin-bottom: 10px; -webkit-overflow-scrolling: touch; }
.ssrch-pop-adv2 .features-grid.feat-compact { grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 10px; }
.ssrch-pop-adv2 .feat-compact .feat-item { font-size: 12px; padding: 4px 7px; line-height: 1.25; }
@media (max-width: 900px) { .ssrch-pop-adv2 .features-grid.feat-compact { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .ssrch-pop-adv2 .features-grid.feat-compact { grid-template-columns: repeat(2, 1fr); } .advf-pane-feat { max-height: 50vh; } }

/* Соцсети в профиле пользователя (/me и кабинет агента) */
.usr-soc-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.usr-soc-grid .adm-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
@media (max-width: 900px) { .usr-soc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .usr-soc-grid { grid-template-columns: 1fr 1fr; } }

/* Objects results bar (count + sort, right-aligned) */
/* Number-input без браузерных стрелок (для Area / Land / Garage m² в админке).
   ВАЖНО: standard `appearance: textfield` НЕ ставим — в Chrome он переключает
   рендеринг на UA-тему (другой бордюр/высота, поле выбивается из ряда).
   Chrome-спиннеры убирает ::-webkit-правило, Firefox — -moz-appearance. */
input[type=number].no-spin::-webkit-outer-spin-button,
input[type=number].no-spin::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number].no-spin { -moz-appearance: textfield; }

.results-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--c-muted); }
.results-bar select { border: 1px solid var(--c-border); border-radius: 5px; padding: 7px 10px; font: inherit; }
.results-title { margin: 0 auto 0 0; font-size: 18px; font-weight: 700; color: var(--c-text); line-height: 1.3; }
/* Локация в заголовке — после «Properties • Rent», отделена точкой, приглушённая. */
.results-title .results-count { font-weight: 600; color: var(--c-muted); }
.results-title .results-loc { font-weight: 600; color: var(--c-muted); }
.results-title .results-loc::before { content: '•'; margin: 0 8px; font-weight: 400; }

/* Заголовок страницы + фильтр по стране справа (agents / agencies) */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head select { border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 12px; font: inherit; cursor: pointer; }

/* 4-column grid on desktop (agents / agencies) — выше специфичность, чтобы перебить .obj-grid */
.obj-grid.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .obj-grid.grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .obj-grid.grid-4 { grid-template-columns: 1fr; } }

.ssrch-pop h4 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
.ssrch-loc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.ssrch-loc-link {
    padding: 8px 12px; border: 1px solid var(--c-border); border-radius: 5px;
    color: var(--c-text); font-size: 13px; text-align: center;
}
.ssrch-loc-link:hover { border-color: var(--c-primary); background: #fafafa; }
.ssrch-adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.ssrch-adv-grid .adm-field input,
.ssrch-adv-grid .adm-field select {
    border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit; width: 100%;
}

/* Стрелка у обычных <select> фильтра — своя, ОДНА и вниз. Safari на macOS/iOS рисует
   у нативного селекта двойной шеврон (вверх+вниз), и он выбивался из ряда соседних
   кнопок фильтра, где стоит svg('chevron_down'). Рисуем ту же иконку фоном
   (viewBox 24, stroke-width 1.6), нативную убираем appearance: none. */
.ssrch-select,
.ssrch-adv-grid .adm-field select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    padding-right: 30px;
    background-color: var(--c-surface);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%230d0d0d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 14px 14px;
}
/* Старый Edge/IE рисовал собственную кнопку списка — убираем и её. */
.ssrch-select::-ms-expand,
.ssrch-adv-grid .adm-field select::-ms-expand { display: none; }

/* HOMEPAGE */
.hero {
    position: relative; padding: 80px 0; overflow: hidden;
    background: linear-gradient(135deg, #004274 0%, #003158 100%);
    color: #fff; text-align: center;
}
.hero-bg {
    position: absolute; inset: 0; opacity: .15;
    background: radial-gradient(circle at 30% 50%, var(--c-primary) 0%, transparent 50%);
}
.hero-inner { position: relative; }
.hero h1 { font-size: clamp(22px, 3.5vw, 32px); margin: 0 0 16px; }
.hero-sub { font-size: 18px; opacity: .8; margin: 0; }

.ad-blocks {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px;
    margin-top: -40px; position: relative; z-index: 2;
}
@media (max-width: 768px) { .ad-blocks { grid-template-columns: 1fr; } }
.ad-block {
    background: var(--c-surface); border-radius: 5px; overflow: hidden;
    box-shadow: var(--shadow-2); aspect-ratio: 3/2;
    display: flex; align-items: flex-end; padding: 24px;
    color: var(--c-text); transition: .15s;
}
.ad-block:hover { box-shadow: var(--shadow-3); transform: translateY(-2px); }
.ad-block-1 { background: linear-gradient(135deg, #ff7a00, #d96900); color: #fff; }
.ad-block-2 { background: linear-gradient(135deg, #004274, #002d52); color: #fff; }
.ad-block-3 { background: linear-gradient(135deg, #10b981, #047857); color: #fff; }
.ad-block-eyebrow { font-size: 12px; opacity: .8; text-transform: uppercase; letter-spacing: 1px; }
.ad-block h3 { margin: 4px 0 0; font-size: 16px; }

.coming { padding: 60px 0; text-align: center; }
.coming h2 { font-size: 18px; margin-bottom: 8px; }

/* FOOTER */
.site-foot {
    background: var(--c-primary); color: rgba(255,255,255,.9); padding: 12px 0;
    margin-top: 60px;
}
/* align-items: stretch — правая колонка тянется на всю высоту подвала, поэтому
   копирайт внизу встаёт на одну строку с последней ссылкой левой колонки. */
.site-foot-inner { display: flex; align-items: stretch; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
/* Подвал: две колонки ссылок слева (правила и «о сайте»), третья — соцсети с
   копирайтом — прижата вправо (.site-foot-side ниже). */
.site-foot-nav { display: flex; gap: 24px 56px; flex-wrap: wrap; }
.site-foot-col { display: flex; flex-direction: column; gap: 8px; }
.site-foot-nav a { color: rgba(255,255,255,.85); font-size: 14px; }
.site-foot-nav a:hover { color: #fff; }
/* Четвёртая колонка — реквизиты фирмы: не ссылки, а текст, потому чуть мельче. */
.site-foot-co { gap: 4px; color: rgba(255,255,255,.85); font-size: 13px; line-height: 1.5; max-width: 280px; }
.site-foot-co b { color: #fff; font-size: 14px; }
/* Правая колонка подвала: иконки соцсетей, под ними копирайт. */
.site-foot-side { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end;
    justify-content: space-between; gap: 12px; }
.site-foot-soc { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.foot-store { display: block; line-height: 0; }
.foot-store img { display: block; width: 134px; height: 40px; }
.foot-store:hover img { opacity: .85; }
.foot-soc {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px;
    border: 1px solid rgba(255,255,255,.35); border-radius: 50%; color: rgba(255,255,255,.85);
}
.foot-soc svg { display: block; }
a.foot-soc:hover { color: #fff; border-color: #fff; background: rgba(255,255,255,.12); }
.site-foot-meta { color: rgba(255,255,255,.85); font-size: 12px; line-height: 1.5; text-align: right; max-width: 560px; }

/* ===========================================================================
   ADMIN: GENERIC LIST + EDITOR LAYOUTS
   =========================================================================== */

/* Two-pane layout: 20% list, 80% editor (для Objects/Users/Agents/Agency/Bulk) */
.adm-two {
    display: grid; grid-template-columns: minmax(260px, 22%) 1fr; gap: 20px;
    height: calc(100vh - 56px - var(--pad-page) * 2);
    min-height: 500px;
}
.adm-pane {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 5px; display: flex; flex-direction: column; min-height: 0; min-width: 0;
}
.adm-pane-head {
    padding: 14px 16px; border-bottom: 1px solid var(--c-border);
    display: flex; align-items: center; gap: 10px;
}
.adm-pane-head h3 { margin: 0; font-size: 14px; text-transform: uppercase; letter-spacing: .5px; color: var(--c-muted); flex: 1; }
.adm-pane-body { flex: 1; overflow-y: auto; padding: 8px; }
.adm-pane-body.no-pad { padding: 0; }

/* Менеджер объектов/агентов внутри кабинета (agency): шапка тут другая (site-top +
   вкладки), фикс-высота .adm-two из админки не подходит — растягиваем по содержимому,
   редактор (правая панель) без внутреннего скролла/обрезки. */
/* XML в кабинете: поток один на вкладку, списка слева нет — редактор на всю ширину. */
.adm-two.xml-solo { grid-template-columns: 1fr; }
/* Вкладки целей импорта (Objects / New buildings). */
.xml-tabs { display: flex; gap: 6px; margin: 0 0 14px; }
.xml-tab { padding: 8px 16px; border: 1px solid var(--c-border); border-radius: 8px 8px 0 0;
    background: #fff; font: inherit; font-size: 14px; cursor: pointer; color: var(--c-muted); }
.xml-tab.on { border-bottom-color: #fff; color: var(--c-text); font-weight: 700; }
/* Демо-фиды и подсказка про собственный формат — в строке источника. */
.xml-demo { display: flex; align-items: center; gap: 10px; font-size: 13px; align-self: end; }
.xml-demo a { text-decoration: underline; }
.xml-own-note { align-self: end; margin: 0; font-size: 13px; }
.xml-start-row { display: flex; align-items: center; gap: 12px; }
/* Листалка записей фида + колонка значений в таблице маппинга. */
.xml-nav { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; font-size: 13px; }
.xml-nav[hidden] { display: none; }
.xml-nav .btn-secondary { padding: 2px 10px; font-size: 14px; line-height: 1.4; }
.xml-map .xmap-v { max-width: 320px; font-size: 12px; color: var(--c-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.xml-valid-bad pre { white-space: pre-wrap; font-size: 12px; margin: 6px 0 0; }
.panel-wrap .adm-two { height: auto; min-height: 0; }
.panel-wrap .adm-two .adm-pane-body { overflow: visible; }
/* Мобайл кабинета: двухпанельный менеджер (список|редактор) стекуем в одну колонку —
   иначе на телефоне список занимает 260px, а редактор ужимается до нечитаемых ~75px.
   Скоуп .adm-panel — главную админку не трогаем. */
/* Моб. элементы кабинетного менеджера скрыты на десктопе. */
.adm-tabs-m { display: none; }
.adm-search-toggle { display: none; }
.obj-filter-close { display: none; }   /* ✕ фильтра — только в мобильном drawer кабинета */
/* Шапка панели фильтра тоже только мобильная: display:contents оставляет
   разметку десктопа такой же, как до появления обёртки. */
.obj-filter-head { display: contents; }
.obj-filter-title { display: none; }
.obj-add-m { display: none; }
/* Нижняя кнопка Search в панели фильтра (её ставит main.js) — только мобильная. */
.obj-filter-foot { display: none; }

@media (max-width: 768px) {
    .adm-panel .adm-two { grid-template-columns: 1fr; }

    /* === Список ↔ редактор как отдельные «экраны» === */
    .adm-panel .adm-two > .adm-pane:nth-child(2) { display: none; }            /* редактор скрыт */
    .adm-panel .adm-two.mgr-editing > .adm-pane:nth-child(1) { display: none; } /* при правке — только редактор */
    .adm-panel .adm-two.mgr-editing > .adm-pane:nth-child(2) { display: flex; }

    /* Кнопки «+ Add» над списком нет: новый объект добавляется иконкой «+»
       в шапке редактора (слева от R) — как на десктопе. */
    /* Пагинация над списком — крупнее под палец. */
    .adm-panel .obj-listbar { flex-wrap: wrap; gap: 8px; padding: 8px; }
    .adm-panel .obj-pager { margin-left: auto; }
    .adm-panel .obj-pager .pager-btn { width: 34px; height: 34px; }
    .adm-panel .obj-pager .pager-select { height: 34px; }

    /* === Моб. строка вкладок редактора: [‹ Back] [имя вкладки] [☰] === */
    .adm-panel .adm-tabs-m {
        display: flex; align-items: center; gap: 8px;
        position: sticky; top: 0; z-index: 5;
        background: var(--c-surface); border-bottom: 1px solid var(--c-border);
        padding: 8px 4px; margin: -8px -8px 10px;
    }
    .adm-panel .adm-tabs-m-back {
        background: none; border: 1px solid var(--c-border); border-radius: 6px;
        padding: 8px 10px; font: inherit; cursor: pointer; color: var(--c-text); line-height: 1; flex: 0 0 auto;
    }
    /* Вкладки — селектбокс (а не гамбургер): имя + каретка, на всю оставшуюся ширину. */
    .adm-panel .adm-tabs-m-sel {
        display: flex; align-items: center; justify-content: space-between; gap: 8px; flex: 1 1 auto;
        background: #fff; border: 1px solid var(--c-border-strong); border-radius: 8px;
        padding: 9px 12px; font: inherit; cursor: pointer; color: var(--c-text); line-height: 1;
    }
    /* line-height 1.35: при 1 хвосты букв g/y срезало overflow:hidden. */
    .adm-panel .adm-tabs-m-name { font-weight: 700; font-size: 14px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .adm-panel .adm-tabs-m-car { color: #94a3b8; font-size: 12px; flex: 0 0 auto; }

    /* Десктопный ряд вкладок → выпадающее меню по ☰.
       .adm-editor-compact — тот же редактор у новостроек. */
    .adm-panel .adm-editor,
    .adm-panel .adm-editor-compact { position: relative; }
    .adm-panel .adm-editor-compact .adm-tabs,
    .adm-panel .adm-editor .adm-tabs {
        display: none; flex-direction: column; gap: 2px;
        position: absolute; right: 8px; left: 8px; z-index: 20;
        background: var(--c-surface); border: 1px solid var(--c-border-strong);
        border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.16); padding: 6px;
    }
    .adm-panel .adm-editor.adm-tabs-open .adm-tabs,
    .adm-panel .adm-editor-compact.adm-tabs-open .adm-tabs { display: flex; }
    .adm-panel .adm-editor .adm-tab,
    .adm-panel .adm-editor-compact .adm-tab { font-size: 14px; padding: 10px 12px; border-bottom: 0; border-radius: 6px; text-align: left; }
    .adm-panel .adm-editor .adm-tab.on,
    .adm-panel .adm-editor-compact .adm-tab.on { background: var(--c-bg); }

    /* === Шапка редактора объекта ===
       Агент/агентство — по центру над рейтингом; рейтинг — двумя рядами крупных
       квадратов; кнопки действий — отдельной строкой под ним, тоже по центру. */
    .adm-panel .obj-ed-row1 { justify-content: center; text-align: center; }
    .adm-panel .obj-ed-row2 { flex-direction: column; align-items: center; gap: 10px; }
    /* Код новостройки — отдельной строкой над кнопками: в ряду с ними
       он ломал строку и Save уезжал вниз один. */
    .adm-panel .obj-ed-actions .obj-ed-pid { flex: 1 1 100%; text-align: center; }
    .adm-panel .obj-ed-actions.left,
    .adm-panel .obj-ed-actions.right { margin: 0; justify-content: center; flex-wrap: wrap; }
    /* Рейтинг переехал во вкладку Common (JS) — отделяем его от полей. */
    .adm-panel .adm-tab-pane > .obj-ed-actions.left { margin-bottom: 12px; }
    /* 11 квадратов (× + 1…10) → ровно два ряда по 6 и 5 */
    .adm-panel .mark-picker-head {
        display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 6px 4px; width: 100%; justify-items: center;
    }
    .adm-panel .mark-picker-head .mark-swatch {
        width: 100% !important; height: auto !important; min-width: 0; aspect-ratio: 1;
        border-radius: 6px; font-size: 16px;
    }

    /* Location: адрес — отдельной строкой во всю ширину, ZIP и координаты под ним. */
    .adm-panel .loc-row-addr { flex-wrap: wrap; }
    .adm-panel .loc-row-addr .loc-addr { flex: 1 1 100%; }
    .adm-panel .loc-row-addr .loc-zip { flex: 1 1 80px; }
    .adm-panel .loc-row-addr .loc-coord { flex: 1 1 100px; }

    /* Images / Floor plans: список групп сверху во всю ширину, картинки — под ним
       (в две колонки на телефоне на картинки оставалось ~150px). */
    .adm-panel .nb-img-wrap { flex-direction: column; gap: 10px; }
    .adm-panel .nb-floor-side { flex: 0 0 auto; width: 100%; }

    /* === Поля редактора: узкие по 2 в ряд, большие текстовые — на всю ширину === */
    .adm-panel .row-main,
    .adm-panel .row-narrow,
    .adm-panel .row-cond,
    .adm-panel .row-media3 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    /* New building на десктопе занимает 2 колонки из 6; в двухколоночном мобильном
       ряду это растянуло бы его на всю строку, а Condition ушёл бы вниз. */
    .adm-panel .row-cond .nb-ac-field { grid-column: auto; }
    .adm-panel .row-comments { grid-template-columns: 1fr; }
    /* Crypto payment / Access code / 3D tour — по одному на всю ширину */
    .adm-panel .row-media-crypto { grid-template-columns: 1fr; align-items: stretch; }
    .adm-panel .desc-block { grid-column: 1 / -1; }
    /* Features — одна колонка: в двух длинные названия ломаются на две строки. */
    /* Сетки полей — и в редакторе объектов (.adm-editor), и в редакторе
       новостроек (.adm-editor-compact): 4 колонки на телефоне не читаются. */
    .adm-panel .adm-editor .features-grid,
    .adm-panel .adm-editor-compact .features-grid { grid-template-columns: 1fr; }
    .adm-panel .adm-editor .adm-grid-2,
    .adm-panel .adm-editor-compact .adm-grid-2 { grid-template-columns: 1fr; }
    .adm-panel .adm-editor .adm-grid-3,
    .adm-panel .adm-editor .adm-grid-4,
    .adm-panel .adm-editor-compact .adm-grid-3,
    .adm-panel .adm-editor-compact .adm-grid-4 { grid-template-columns: 1fr 1fr; }

    /* === Кабинетный фильтр объектов → правый off-canvas drawer (лупа в шапке) === */
    .adm-search-toggle[data-drawer-btn] {
        display: inline-flex; align-items: center; justify-content: center;
        width: 38px; height: 38px; padding: 0; cursor: pointer; color: var(--c-text);
        background: #fff; border: 1px solid var(--c-border); border-radius: 6px;
    }
    .adm-search-toggle .ico-x { display: none; }
    .adm-search-toggle.on .ico-s { display: none; }
    .adm-search-toggle.on .ico-x { display: inline-flex; }
    /* body.adm.adm-panel — специфичность выше, чем у `body.adm .obj-filter-panel`
       (полупрозрачный синий --c-adm-filter), иначе drawer просвечивает насквозь. */
    body.adm.adm-panel .obj-filter-panel {
        position: fixed; top: 0; right: 0; z-index: 1500;
        width: min(90vw, 380px); height: 100vh; height: 100dvh;
        transform: translateX(100%); transition: transform .25s ease;
        overflow-y: auto; background: var(--c-surface); border: 0;
        box-shadow: -2px 0 24px rgba(0,0,0,.18); padding: 14px;
        display: flex; flex-direction: column;   /* футер с Search — по нижнему краю */
    }
    body.adm.adm-panel .obj-filter-panel > * { flex: 0 0 auto; }
    body.adm.adm-panel .obj-filter-panel.open { transform: none; }
    /* ✕ внутри панели: шапку с лупой drawer перекрывает, закрыть больше нечем.
       sticky — кнопка остаётся на виду при прокрутке фильтра. */
    .adm-panel .obj-filter-head {
        display: flex; align-items: center; gap: 8px; margin: 0 0 8px;
        position: sticky; top: 0; z-index: 3; background: var(--c-surface);
    }
    .adm-panel .obj-filter-title {
        display: block; margin-right: auto; font-weight: 700; font-size: 16px; color: var(--c-text);
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    /* ↺ и ✕ живут внизу, рядом с Search (их переносит main.js) — в шапке только название. */
    .adm-panel .obj-filter-close {
        display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
        width: 38px; height: 38px; padding: 0; cursor: pointer; color: var(--c-text);
        background: #fff; border: 1px solid var(--c-border); border-radius: 8px;
    }
    .adm-panel .obj-filter-close:hover { border-color: var(--c-primary); color: var(--c-primary); }
    /* Сетка фильтра: максимум 2 колонки, третий элемент уезжает на новую строку.
       Никаких flex-basis в px — иначе поля вылезают за правый край панели. */
    .adm-panel .obj-filter-panel .obj-filter-row {
        display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center;
    }
    .adm-panel .obj-filter-panel .obj-filter-row > * {
        width: 100%; min-width: 0; max-width: 100%; flex: none; margin: 0;
    }
    /* Поиск, локация, Price и MORE — во всю строку */
    .adm-panel .obj-filter-panel #f-search,
    .adm-panel .obj-filter-panel .flt-loc-btn,
    .adm-panel .obj-filter-panel .flt-more { grid-column: 1 / -1; }
    /* Фильтр по XML-потоку в кабинете агентства не нужен */
    .adm-panel .obj-filter-panel #f-stream { display: none; }
    /* Локация — первой строкой панели, за ней поиск (как в фильтре сайта). */
    .adm-panel .obj-filter-panel .flt-loc-btn { order: -2; }
    .adm-panel .obj-filter-panel .obj-filter-row > .flt-cell-full,
    .adm-panel .obj-filter-panel .obj-filter-row > #f-search { order: -1; }
    /* Нижняя кнопка Search: прилипает к низу панели. */
    .adm-panel .obj-filter-panel .obj-filter-foot {
        display: flex; align-items: center; gap: 8px;
        position: sticky; bottom: 0; z-index: 3; margin-top: auto;   /* прижат к низу */
        padding: 10px 0 calc(6px + env(safe-area-inset-bottom, 0px));
        background: var(--c-surface); border-top: 1px solid var(--c-border);
    }
    .adm-panel .obj-filter-panel .obj-filter-apply {
        flex: 1 1 auto; height: 44px; justify-content: center; font-size: 16px;
    }
    /* ↺ и ✕ по краям от Search — квадраты той же высоты. */
    .adm-panel .obj-filter-panel .obj-filter-foot .filter-reset-btn,
    .adm-panel .obj-filter-panel .obj-filter-foot .obj-filter-close {
        flex: 0 0 auto; width: 44px; height: 44px; margin: 0;
    }
    .adm-panel .obj-filter-panel .obj-filter-foot .filter-reset-btn { width: 38px; justify-self: start; }
    /* В самой строке фильтра ↺ на мобильном не нужен — он продублирован внизу панели. */
    .adm-panel .obj-filter-panel .obj-filter-row .filter-reset-btn { display: none; }
    /* Подпись над контролом (JS оборачивает поле в .flt-cell). */
    .adm-panel .obj-filter-panel .obj-filter-row { align-items: end; }
    .adm-panel .obj-filter-panel .flt-cell { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
    .adm-panel .obj-filter-panel .flt-cell-full { grid-column: 1 / -1; }
    .adm-panel .obj-filter-panel .flt-cap {
        font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
        color: var(--c-muted); padding-left: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    /* flex: none — в колонке flex-basis из общих правил панели (240px)
       превращается в ВЫСОТУ поля. */
    .adm-panel .obj-filter-panel .flt-cell > *:not(.flt-cap) { width: 100%; flex: none; min-width: 0; }

    /* Галки в MORE — крупнее и по одной в строку (пальцем в мелкие не попасть). */
    .adm-panel .adm-morepop .adm-feat { display: flex; align-items: center; gap: 10px; min-height: 40px; font-size: 14px; }
    .adm-panel .adm-morepop input[type=checkbox] { width: 20px; height: 20px; flex: 0 0 auto; margin: 0; }
    .adm-panel .adm-more-checks { display: flex; flex-direction: column; gap: 4px; grid-column: 1 / -1; }

    /* Area и Land — по половине ряда, а их popup раскрывается на всю ширину
       (в половине строки слайдер и два поля Min/Max не умещаются). */
    .adm-panel .obj-filter-panel .flt-price { grid-column: auto; position: relative; }
    .adm-panel .obj-filter-panel .flt-price .adm-pricepop {
        position: absolute; top: calc(100% + 6px); left: 0; width: calc(200% + 8px);
        box-sizing: border-box; z-index: 6; padding: 10px;
        background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px;
        box-shadow: 0 12px 32px rgba(0,0,0,.16);
    }
    /* Второе поле ряда (Land) — прижимаем popup к правому краю. */
    .adm-panel .obj-filter-panel .flt-range-2 .adm-pricepop { left: auto; right: 0; }
    /* Min/Max и кнопки — одной строкой (как в popup Цены). */
    .adm-panel .obj-filter-panel .flt-price .adm-pop-row-btns { display: flex; align-items: center; gap: 6px; }
    .adm-panel .obj-filter-panel .flt-price .adm-pop-row-btns input { flex: 1 1 0; min-width: 0; }
    .adm-panel .obj-filter-panel .flt-price .adm-pop-row-btns .adm-pop-x,
    .adm-panel .obj-filter-panel .flt-price .adm-pop-row-btns .adm-pop-ok { flex: 0 0 auto; }
    /* Popup'ы Price / MORE раскрываются внутри панели на всю её ширину */
    .adm-panel .obj-filter-panel .adm-morepop,
    .adm-panel .obj-filter-panel .adm-pricepop {
        position: static; width: 100%; box-sizing: border-box; box-shadow: none; border: 0; padding: 8px 0 0;
    }
    /* Внутри MORE: селекты и фичи — по 2 в ряд; диапазоны Area/Land — по одному
       на строку, иначе поля Min/Max обрезаются. */
    .adm-panel .adm-morepop-grid,
    .adm-panel .adm-morepop-feats { grid-template-columns: 1fr 1fr; }
    .adm-panel .adm-morepop-ranges { grid-template-columns: 1fr; }
    .adm-panel .adm-morepop-grid select,
    .adm-panel .adm-morepop-range input { min-width: 0; }

    /* Порядок блоков вкладки Common: метки — под Crypto/Access/3D tour,
       прямо над Agent comment (в разметке они выше, переставляем через order). */
    .adm-panel .adm-tab-pane.on[data-pane="common"] { display: flex; flex-direction: column; }
    .adm-panel .adm-tab-pane.on[data-pane="common"] > .row-label { order: 1; }
    .adm-panel .adm-tab-pane.on[data-pane="common"] > .row-comments,
    .adm-panel .adm-tab-pane.on[data-pane="common"] > .row-comments-solo { order: 2; }
    .adm-panel .adm-tab-pane.on[data-pane="common"] > .desc-block { order: 3; }
    /* Метка — на всю ширину строки: в половину не помещался ни один длинный вариант
       («Under construction», «Price reduced»). Поля Open house остаются половинными и
       встают парой в строку ПОД своей меткой — порядок в разметке это уже даёт. */
    .adm-panel .row-label { grid-template-columns: 1fr 1fr; }
    .adm-panel .row-label > .adm-field:not(.oh-field) { grid-column: 1 / -1; }
}

.adm-list-item {
    display: flex; gap: 10px; padding: 10px 12px; border-radius: 5px;
    cursor: pointer; transition: .12s; border: 1px solid transparent;
    align-items: center;
}
.adm-list-item:hover { background: #f0f2f7; }
.adm-list-item.on { background: var(--c-primary); color: #fff; }
.adm-list-item.on .adm-list-item-sub { color: rgba(255,255,255,.85); }
.adm-list-item-thumb {
    width: 40px; height: 40px; border-radius: 5px; object-fit: cover;
    background: #e5e7eb; flex-shrink: 0;
}
.adm-list-item-text { flex: 1; min-width: 0; }
.adm-list-item-name { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.adm-list-item-sub { font-size: 12px; color: var(--c-muted); }

.adm-filter {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 5px; padding: 12px 16px; margin-bottom: 16px;
    display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
}
.adm-filter input, .adm-filter select {
    border: 1px solid var(--c-border); border-radius: 5px;
    padding: 5px 8px; font: inherit; font-size: 13px; height: 30px; box-sizing: border-box;
}
.adm-filter input:focus, .adm-filter select:focus { outline: none; border-color: var(--c-primary); }
.adm-filter-grow { flex: 1; min-width: 200px; }

/* Reset кнопка для фильтров — иконка ↺. Универсальный стиль для всех админ-страниц. */
.filter-reset-btn {
    width: 30px; height: 30px; padding: 0; cursor: pointer; font-size: 16px; line-height: 1;
    border: 1px solid var(--c-border); background: #fff; border-radius: 5px; color: #64748b;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.filter-reset-btn:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
/* Такой же значок, но для сброса ОДНОГО поля (например выбранной локации): он не
   должен уезжать в мобильный футер вместе с кнопкой сброса всего фильтра. */
.flt-loc-clear {
    width: 30px; height: 30px; padding: 0; cursor: pointer; font-size: 16px; line-height: 1;
    border: 1px solid var(--c-border); background: #fff; border-radius: 5px; color: #64748b;
    display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.flt-loc-clear:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
/* display:inline-flex выше перебивает браузерное [hidden] — возвращаем скрытие. */
.flt-loc-clear[hidden] { display: none; }

/* Editor area */
.adm-editor { padding: 20px; }
.adm-editor-actions {
    display: flex; gap: 10px; margin-bottom: 18px;
    padding-bottom: 16px; border-bottom: 1px solid var(--c-border);
}
.adm-tabs {
    display: flex; gap: 4px; margin-bottom: 18px;
    border-bottom: 1px solid var(--c-border-strong);
}
.adm-tab {
    background: none; border: none; font: inherit; cursor: pointer;
    padding: 10px 18px; color: var(--c-muted); font-weight: 500;
    border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.adm-tab.on { color: var(--c-primary-dk); border-color: var(--c-primary); }
.adm-tab-pane { display: none; }
.adm-tab-pane.on { display: block; }
/* Компактные вкладки во ВСЕХ админ-редакторах (objects/agency/users) — единый размер. */
body.adm .adm-tabs { flex-wrap: wrap; }
body.adm .adm-tab { font-size: 12px; padding: 5px 9px; }
/* Внутренний отступ форм-редакторов (objects/agency/users). */
body.adm .adm-editor { padding: 12px; }
/* Строка Location (Address + ZIP + Lat + Lng в один ряд) — общая для всех редакторов. */
.loc-row-addr { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px; }
.loc-row-addr .loc-addr  { flex: 1 1 auto; min-width: 0; }
.loc-row-addr .loc-zip   { flex: 0 0 80px; }
.loc-row-addr .loc-coord { flex: 0 0 100px; }
.loc-row-addr .loc-addr > span { white-space: nowrap; }
.loc-addr input, .loc-zip input, .loc-coord input { width: 100%; box-sizing: border-box; }
.loc-find { padding: 0; width: 34px; height: 30px; align-self: end; cursor: pointer; flex: 0 0 auto; }
.loc-find:disabled { opacity: 0.6; cursor: wait; }
.loc-pick-icon { flex: 0 0 auto; width: 34px; height: 30px; padding: 0; align-self: end; font-size: 15px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
/* Крошка локации = кнопка, открывающая Location popup. */
.loc-row-picker { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 12px; font-size: 13px; color: var(--c-text);
    border: 1px solid var(--c-border-strong); background: #fff; border-radius: 6px; padding: 8px 12px; cursor: pointer; max-width: 100%; }
.loc-row-picker:hover { border-color: var(--c-primary); background: #f8fafc; }
.loc-pick-pin { flex: 0 0 auto; }
.loc-map-google { width: 100%; height: 100%; min-height: 360px; }
.loc-map-wrap { width: 100%; height: calc(100vh - 460px); min-height: 260px; border: 1px solid var(--c-border); border-radius: 6px; overflow: hidden; background: #f8fafc; }

.adm-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.adm-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.adm-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
/* New Buildings · Common: вертикальный отступ между блоками-строками полей */
#nb-form .adm-grid-3 { margin-bottom: 14px; }

.adm-field textarea {
    border: 1px solid var(--c-border-strong); border-radius: 5px;
    padding: 10px 12px; font: inherit; min-height: 100px; resize: vertical;
}
.adm-field select {
    border: 1px solid var(--c-border-strong); border-radius: 5px;
    padding: 10px 12px; font: inherit; background: #fff;
}

/* ===========================================================================
   LOCATIONS PAGE — 5 columns
   =========================================================================== */
.loc-grid {
    display: grid;
    grid-template-columns: repeat(5, 150px) 1fr;
    gap: 8px;
    height: calc(100vh - 56px - 56px - var(--pad-page) * 2 - 60px);
    min-height: 500px;
}
.loc-col {
    background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 5px; display: flex; flex-direction: column; min-height: 0;
}
.loc-col-head {
    padding: 10px 12px; border-bottom: 1px solid var(--c-border);
    display: flex; align-items: center; gap: 8px;
}
.loc-col-head { padding: 8px 10px; }
.loc-col-head h3 { margin: 0; flex: 0 0 auto; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--c-muted); }
.loc-list { list-style: none; margin: 0; padding: 4px; flex: 1; overflow-y: auto; }
.loc-empty { padding: 20px 12px; text-align: center; font-size: 13px; }
.loc-item {
    padding: 0 10px; border-radius: 5px; cursor: pointer;
    font-size: 13px; line-height: 1.6;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.loc-item:hover { background: #f0f2f7; }
.loc-item.on { background: var(--c-primary); color: #fff; }
.loc-item.off { opacity: .5; }
.loc-editor-col .loc-col-head h3 { color: var(--c-primary-dk); }
.loc-map-wrap {
    position: relative; margin-top: 8px; padding-top: 0;
    flex: 1 1 auto; min-height: 200px; overflow: hidden;
    border: 1px solid #e5e7eb; border-radius: 5px;
}
.loc-map-wrap iframe {
    display: block; border: 0; width: 100%;
    /* Больше контейнера на 32px + overflow:hidden — отрезает нижнюю плашку OSM с атрибуцией */
    height: calc(100% + 32px); margin-bottom: -32px;
}
.loc-map-reset {
    /* В правом нижнем углу — там, где OSM ничего не рисует (атрибуция уже скрыта) */
    position: absolute; bottom: 8px; right: 8px; z-index: 2;
    padding: 4px 10px; font-size: 12px; border-radius: 5px;
    background: rgba(255,255,255,.95); border: 1px solid var(--c-border); color: var(--c-text);
    cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.loc-map-reset:hover { background: #fff; border-color: var(--c-primary); color: var(--c-primary-dk); }
.loc-editor {
    padding: 16px; overflow-y: auto;
    display: flex; flex-direction: column;
    flex: 1 1 auto; min-height: 0;
}
.loc-form { flex: 0 0 auto; }
.loc-ed-h { font-size: 16px; font-weight: 600; margin-bottom: 12px; text-transform: capitalize; }
.loc-ed-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px;
}
.loc-ed-grid .span2 { grid-column: 1 / span 2; }
.loc-ed-grid .adm-field { margin: 0; }
.loc-ed-actions { display: flex; gap: 10px; margin-top: 14px; }

/* ===========================================================================
   FRONTEND: OBJECTS LIST + DETAIL
   =========================================================================== */
.objects-page { padding: 24px 24px 60px; }
.objects-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 16px; }
.objects-head h1 { margin: 0; font-size: 20px; }
.objects-filter {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px;
    padding: 12px; display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; align-items: center;
}
.objects-filter input, .objects-filter select {
    border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit;
}
.objects-filter input[type=search] { flex: 1; min-width: 180px; }
.objects-filter input[type=number] { width: 100px; }

.obj-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px; margin-bottom: 32px;
}
/* === Витрина рекламной недели (Home Week) ===
   Шапка витрины идёт по центру колонкой: заголовок (имя агентства в нём — ссылка),
   под ним текст агентства (не шире 1000px), под текстом — отдельная ссылка на агентство.
   Дальше сетки Rent / Sell (4 колонки) и раздел Video (3 колонки).
   Разметку страницы никто не редактирует руками. */
.hw-wrap { margin: 28px auto 40px; }
.hw-head { margin-bottom: 10px; text-align: center; }
.hw-title { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 400; }
.hw-title a { color: inherit; text-decoration: none; }
.hw-title a:hover { text-decoration: underline; }
.hw-agency-link { font-size: 14px; font-weight: 600; color: var(--c-primary, #0a6cff); text-decoration: none; white-space: nowrap; }
.hw-agency-link:hover { text-decoration: underline; }
/* Текст агентства — по центру, узкой колонкой: во всю ширину экрана читать неудобно. */
.hw-text { margin: 0 auto 14px; max-width: 1000px; color: var(--c-text); text-align: center; }
.hw-text :is(p, ul, ol) { margin: 0 0 10px; }
/* Визитка агентства под текстом: логотип → контакты → ссылка на страницу агентства. */
.hw-foot { margin: 0 0 22px; text-align: center; }
.hw-foot-logo { display: block; max-height: 64px; max-width: 220px; width: auto; margin: 0 auto 10px; object-fit: contain; }
.hw-foot-meta { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 20px; margin: 0 0 10px;
    font-size: 14px; color: var(--c-muted, #64748b); }
.hw-foot-meta a, .hw-foot-meta span { display: inline-flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; }
.hw-foot-meta a:hover { color: var(--c-primary); text-decoration: underline; }
.hw-foot-meta .i { display: inline-flex; color: var(--c-primary); }
.hw-section { margin: 26px 0 12px; font-size: 20px; }
.hw-grid { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1200px) { .hw-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .hw-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .hw-grid { grid-template-columns: 1fr; } }
.hw-videos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 32px; }
@media (max-width: 900px) { .hw-videos { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .hw-videos { grid-template-columns: 1fr; } }
.hw-video { margin: 0; }
.hw-video-frame { display: block; position: relative; aspect-ratio: 16 / 9; border-radius: 10px; overflow: hidden; background: #0f172a; }
.hw-video-frame iframe, .hw-video-frame img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.hw-video figcaption { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 14px; }
.hw-video figcaption a { color: var(--c-text); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hw-video figcaption a:hover { text-decoration: underline; }
.hw-video-price { font-weight: 700; white-space: nowrap; }
/* Бесплатные пакеты недели во вкладке Promotions объекта. */
.promo-free .promo-freetag { font-size: 11px; font-weight: 700; color: #15803d; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 20px; padding: 1px 8px; }

/* List view (страница /objects) — фиксированные 3 колонки; 4 на широких экранах. */
.objects-page .obj-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px)  { .objects-page .obj-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .objects-page .obj-grid { grid-template-columns: 1fr; } }
@media (min-width: 1800px) { .objects-page .obj-grid { grid-template-columns: repeat(4, 1fr); } }
/* Пользовательский выбор кол-ва колонок (иконки 2–6 в results-bar). Только десктоп/планшет —
   на узких экранах остаётся адаптив (1–2 колонки выше). Специфичность (0,3,0) бьёт правила выше. */
@media (min-width: 981px) {
    .objects-page .obj-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
    .objects-page .obj-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .objects-page .obj-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
    .objects-page .obj-grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
    /* List (1 колонка): картинка слева, инфо справа, + описание. Фикс-высота → ровные панели. */
    /* List: фиксированная ширина колонки, по центру страницы. */
    .objects-page .obj-grid.cols-1 { grid-template-columns: 1fr; max-width: 1040px; margin-left: auto; margin-right: auto; }
    .objects-page .obj-grid.cols-1 .obj-card { height: 240px; }
    .objects-page .obj-grid.cols-1 .obj-card-link { flex-direction: row; height: 100%; }
    .objects-page .obj-grid.cols-1 .obj-card-img { flex: 0 0 360px; width: 360px; height: 100%; aspect-ratio: auto; }
    .objects-page .obj-grid.cols-1 .obj-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
    .objects-page .obj-grid.cols-1 .obj-card-desc {
        display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
        margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--c-muted);
    }
    /* NB-карточка (<a class="obj-card nb-card">, без внутреннего .obj-card-link) — тот же List-вид. */
    .objects-page .obj-grid.cols-1 a.nb-card { flex-direction: row; }
    .objects-page .obj-grid.cols-1 a.nb-card .obj-card-img { flex: 0 0 360px; width: 360px; height: 100%; aspect-ratio: auto; }
    .objects-page .obj-grid.cols-1 a.nb-card .obj-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
}
/* Описание в карточке видно только в List-виде. */
.obj-card-desc { display: none; }
/* ── Rich-редакторы админки (Templates / Locations): языковые вкладки + таблицы ── */
/* Языков много (20+) — строка вкладок обязана переноситься, иначе она растягивает
   колонку редактора и у всей страницы появляется горизонтальный скролл. */
.tpl-langs { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.tpl-lang { padding: 5px 14px; border: 1px solid var(--c-border); border-radius: 6px; background: var(--c-surface);
    cursor: pointer; font: inherit; font-size: 13px; font-weight: 600; color: var(--c-muted); }
.tpl-lang.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.tpl-tablebar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 8px 0 6px; }
.tpl-tablebar button { padding: 4px 10px; border: 1px solid var(--c-border); border-radius: 5px; background: var(--c-surface);
    cursor: pointer; font: inherit; font-size: 12px; color: var(--c-text); }
.tpl-tablebar button:hover { border-color: var(--c-primary); color: var(--c-primary); }
/* Таблицы внутри Quill — видимые рамки. */
.ql-editor table { border-collapse: collapse; width: 100%; }
.ql-editor td { border: 1px solid #cbd5e1; padding: 6px 8px; min-width: 40px; }

/* Таблицы из текстового редактора (TinyMCE) на фронте: по умолчанию во всю ширину
   блока, как в самом редакторе. Заданная в контенте ширина сильнее: инлайновый
   style="width:…" перебивает это правило, а атрибут width отсекает :not([width]).
   Пропорции колонок (ширины у td/col) при этом сохраняются. */
.home-editable table:not([width]),
.country-editable table:not([width]),
.info-page table:not([width]),
.inv-help-body table:not([width]),
.op-desc table:not([width]),
.pm-block-body table:not([width]),
.sc-text table:not([width]) { width: 100%; }

/* Простой селект в баре (страна на Investments). Сортировка живёт в .sortp — ниже. */
.sort-select { height: 34px; padding: 0 10px; margin-left: 8px; border: 1px solid var(--c-border);
    border-radius: 6px; background: var(--c-surface); color: var(--c-text); font: inherit; font-size: 14px; cursor: pointer; }
.sort-select:hover { border-color: var(--c-primary); }
/* На мобильном селект в results-bar прячем — как было, когда класс носила сортировка
   (там её роль играет .ssrch-sort в панели фильтра). */
@media (max-width: 768px) { .sort-select { display: none; } }

/* Сортировка (справа от пикера колонок в results-bar) — кнопка + popup в стиле Type
   из фильтра, только выбор одиночный: клик по пункту сразу применяет сортировку.
   Пункты списка красит общее правило .sortp-pop .feat-item (см. блок Type ниже). */
.sortp { position: relative; margin-left: 8px; }
.sortp-btn {
    height: 34px; padding: 0 11px; border: 1px solid var(--c-border); border-radius: 6px;
    background: var(--c-surface); color: var(--c-text); font: inherit; font-size: 14px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; cursor: pointer; transition: .15s;
}
.sortp-btn:hover,
.sortp.open .sortp-btn { border-color: var(--c-primary); color: var(--c-primary-dk); }
.sortp-btn .i { display: inline-flex; transition: transform .15s; }
.sortp.open .sortp-btn .i { transform: rotate(180deg); }
/* Прижат вправо: пикер стоит у правого края бара, влево места больше. */
.sortp-pop {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
    display: flex; flex-direction: column; gap: 6px; min-width: 100%; width: max-content; max-width: 320px;
    padding: 12px; background: var(--c-surface); border: 1px solid var(--c-border);
    border-radius: 5px; box-shadow: var(--shadow-2);
}
/* display:flex выше перебивает браузерное [hidden]{display:none} — гасим явно,
   иначе список висит раскрытым и кнопка щёлкает атрибутом впустую. */
.sortp-pop[hidden] { display: none; }
/* Пункты — <button>, а не label с чекбоксом: гасим кнопочные умолчания. */
.sortp-pop .feat-item { width: 100%; background: none; text-align: left; color: var(--c-text); font: inherit; }
@media (max-width: 768px) { .sortp { display: none; } }
/* Пикер кол-ва колонок в results-bar (иконки со столбиками). */
.cols-picker { display: inline-flex; gap: 4px; }
.cols-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
    border: 1px solid var(--c-border); border-radius: 6px; background: var(--c-surface); color: var(--c-muted); cursor: pointer;
}
.cols-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.cols-btn.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
@media (max-width: 980px) { .cols-picker { display: none; } }

/* Popup Rooms + Bathrooms — сегментные переключатели (Any/1..5+). */
.ssrch-pop-rooms { position: absolute; z-index: 60; padding: 16px; min-width: 340px; max-width: 420px; }
.rmp-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.rmp-head > span { font-weight: 700; font-size: 16px; color: var(--c-text); }
.rmp-done { padding: 8px 18px; font-size: 14px; }
.rmp-lbl { font-size: 13px; color: var(--c-muted); margin: 12px 0 6px; }
.rmp-seg { display: flex; gap: 8px; }
.rmp-opt { flex: 1 1 0; padding: 11px 6px; border: 1.5px solid var(--c-border); border-radius: 8px; background: #fff; font: inherit; font-size: 14px; cursor: pointer; color: var(--c-text); }
.rmp-opt:hover { border-color: var(--c-primary); }
.rmp-opt.on { border-color: var(--c-primary); color: var(--c-primary-dk); font-weight: 700; }

/* Popup выбора типа (мультивыбор чекбоксами — как Features, с Reset и All). */
.ssrch-pop-type { position: absolute; z-index: 60; padding: 16px; min-width: 300px; max-width: 440px; }
.ssrch-pop-type-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 14px; }
@media (max-width: 560px) { .ssrch-pop-type-grid { grid-template-columns: 1fr; } }
/* Пункты списка те же и в popup сортировки (.sortp-pop) — вид один в один с Type. */
.ssrch-pop-type .feat-item,
.sortp-pop .feat-item { display: flex; align-items: center; gap: 6px; padding: 7px 10px; border: 1.5px solid var(--c-border); border-radius: 6px; cursor: pointer; user-select: none; font-size: 14px; }
.ssrch-pop-type .feat-item input { position: absolute; opacity: 0; pointer-events: none; }
.ssrch-pop-type .feat-check,
.sortp-pop .feat-check { display: inline-flex; width: 16px; height: 16px; align-items: center; justify-content: center; border-radius: 50%; border: 1.5px solid var(--c-border); color: transparent; flex: none; }
.ssrch-pop-type .feat-item.on,
.sortp-pop .feat-item.on { background: #fdf2f4; border-color: var(--c-primary); color: var(--c-primary-dk); }
.ssrch-pop-type .feat-item.on .feat-check,
.sortp-pop .feat-item.on .feat-check { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.sortp-pop .feat-item:hover { border-color: var(--c-primary); }

/* Type: 4 группы (Residential / Non-residential / Historic / Special) — по колонке на группу.
   Заголовок группы — кнопка: клик отмечает/снимает всю группу. */
.ssrch-pop-types4 { max-width: 940px; min-width: 640px; }
.ssrch-type-cols { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px 14px; margin-bottom: 14px; }
.ssrch-type-cols .tgrp { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.tgrp-head {
    display: block; width: 100%; text-align: left; padding: 2px 2px 6px; margin: 0;
    border: 0; border-bottom: 1px solid var(--c-border); background: none; cursor: pointer;
    font: inherit; font-size: 12px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .03em; color: var(--c-muted);
}
/* Название типа + счётчик объектов этого типа в базе (прижат к правому краю). */
.ssrch-type-cols .feat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssrch-type-cols .feat-cnt {
    margin-left: auto; padding-left: 6px; flex: none;
    font-size: 12px; font-weight: 600; color: var(--c-muted); font-variant-numeric: tabular-nums;
}
.ssrch-type-cols .feat-item.on .feat-cnt { color: var(--c-primary-dk); }
.tgrp-head:hover { color: var(--c-primary-dk); }
.tgrp-head.on { color: var(--c-primary); }
/* Шапка с названием и ✕ — только в мобильном полноэкранном режиме. */
.ssrch-pop-head { display: none; }
.ssrch-pop-x { border: 0; background: none; font: inherit; font-size: 28px; line-height: 1; color: var(--c-text); cursor: pointer; padding: 0 4px; }
@media (max-width: 900px) and (min-width: 769px) {
    .ssrch-pop-types4 { min-width: 0; }
    .ssrch-type-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 60vh; overflow-y: auto; }
}
/* Мобильный: выбор типа — popup на всё окно (37 типов в узкой выпадашке нечитаемы).
   Перебиваем общее правило для #ssrch-pop-* (там position:absolute + inline left/top от JS). */
@media (max-width: 768px) {
    #ssrch-pop-type.ssrch-pop-types4 {
        position: fixed !important;
        left: 0 !important; right: 0 !important; top: 0 !important; bottom: 0 !important;
        width: 100% !important; min-width: 0 !important; max-width: none !important;
        height: 100vh; height: 100dvh; z-index: 1600;
        display: flex; flex-direction: column; gap: 0;
        margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
    }
    #ssrch-pop-type.ssrch-pop-types4[hidden] { display: none !important; }
    /* Сверху + env(safe-area-inset-top): в iPhone-приложении заголовок и × иначе под часами. */
    .ssrch-pop-types4 .ssrch-pop-head {
        display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto;
        padding: calc(12px + env(safe-area-inset-top, 0px)) 14px 12px; border-bottom: 1px solid var(--c-border);
        font-size: 17px; font-weight: 700;
    }
    .ssrch-pop-types4 .ssrch-type-cols {
        flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px 10px; margin: 0; padding: 12px 14px; align-content: start;
    }
    /* Заголовок группы липнет к верху при прокрутке — видно, где находишься. */
    .ssrch-pop-types4 .tgrp-head { position: sticky; top: 0; background: var(--c-surface); z-index: 1; padding-top: 6px; }
    .ssrch-pop-types4 .advf-foot {
        flex: 0 0 auto; margin: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--c-border); background: var(--c-surface);
    }
    .ssrch-pop-types4 .feat-item { padding: 9px 10px; }
}
@media (max-width: 360px) { .ssrch-pop-types4 .ssrch-type-cols { grid-template-columns: 1fr; } }

/* Страны в фильтре аукционов: тот же попап с галочками, что Type/Condition, но
   список может быть длинным — поэтому скролл, а счётчик лотов уходит вправо. */
.ssrch-pop-countries { min-width: 340px; max-width: 480px; }
.ssrch-cnt-grid { max-height: 46vh; overflow-y: auto; align-content: start; padding-right: 2px; }
.ssrch-pop-countries .feat-item { min-width: 0; }
.ssrch-pop-countries .feat-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ssrch-pop-countries .cnt-n { margin-left: auto; font-size: 12px; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.ssrch-pop-countries .feat-item.on .cnt-n { color: var(--c-primary-dk); }
.ssrch-pop-empty { margin: 0 0 14px; color: var(--c-muted); }
/* Мобильный: как у Type — попап на всё окно, иначе список стран не пролистать. */
@media (max-width: 768px) {
    #ssrch-pop-country.ssrch-pop-countries {
        position: fixed !important;
        left: 0 !important; right: 0 !important; top: 0 !important; bottom: 0 !important;
        width: 100% !important; min-width: 0 !important; max-width: none !important;
        height: 100vh; height: 100dvh; z-index: 1600;
        display: flex; flex-direction: column; gap: 0;
        margin: 0; padding: 0; border: 0; border-radius: 0; box-shadow: none;
    }
    #ssrch-pop-country.ssrch-pop-countries[hidden] { display: none !important; }
    .ssrch-pop-countries .ssrch-pop-head {
        display: flex; align-items: center; justify-content: space-between; flex: 0 0 auto;
        padding: 12px 14px; border-bottom: 1px solid var(--c-border);
        font-size: 17px; font-weight: 700;
    }
    /* Отступ под строку состояния iPhone — только у полноэкранного попапа: тот же класс носят
       выпадашки стран на /investitions и /exchange, им он не нужен. */
    #ssrch-pop-country .ssrch-pop-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
    .ssrch-pop-countries .ssrch-cnt-grid {
        flex: 1 1 auto; max-height: none; overflow-y: auto; -webkit-overflow-scrolling: touch;
        gap: 6px 10px; margin: 0; padding: 12px 14px;
    }
    .ssrch-pop-countries .advf-foot {
        flex: 0 0 auto; margin: 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid var(--c-border); background: var(--c-surface);
    }
    .ssrch-pop-countries .feat-item { padding: 9px 10px; }
}

/* Hero страны (/{country}): картинка на всю ширину + название поверх.
   Файл — /assets/hero/<iso>.webp; нет файла → секции нет вовсе (см. шаблон). */
/* Высота = высоте исходников (1920×500), чтобы на широком экране картинка шла 1:1. */
.ch-hero { position: relative; width: 100%; height: 500px; overflow: hidden; background: #0f172a; }
.ch-hero-img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Затемнение снизу — под текстом, чтобы название читалось на любой картинке. */
.ch-hero::after { content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,.15) 0%, rgba(0,0,0,.10) 45%, rgba(0,0,0,.62) 100%); }
.ch-hero-in { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
    max-width: 1280px; margin: 0 auto; padding: 0 24px 28px; color: #fff; }
.ch-hero-in h1 { margin: 0; font-size: 44px; line-height: 1.1; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.ch-hero-sub { margin: 8px 0 0; font-size: 15px; color: rgba(255,255,255,.88); text-transform: capitalize; }
@media (max-width: 768px) {
    .ch-hero { height: 240px; }
    .ch-hero-in { padding: 0 16px 18px; }
    .ch-hero-in h1 { font-size: 28px; }
    .ch-hero-sub { font-size: 13px; }
}

/* Homepage отдельной страны: /{country} */
.country-home { padding: 24px 24px 40px; }
.ch-head { text-align: center; }
.ch-head h1 { margin: 0 0 24px; font-size: 28px; }
.ch-section-title { margin: 32px 0 14px; font-size: 20px; font-weight: 700; color: var(--c-text); }
/* Country home: центрированные заголовки секций + отступ снизу */
.ch-section-title.ch-center { text-align: center; margin-bottom: 24px; }
.cpanel-list.ch-list { margin-left: auto; margin-right: auto; }
.country-home .ch-grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px)  { .country-home .ch-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .country-home .ch-grid-3 { grid-template-columns: 1fr; } }
@media (min-width: 1800px) { .country-home .ch-grid-3 { grid-template-columns: repeat(4, 1fr); } }
.obj-card {
    position: relative;
    background: var(--c-surface); border-radius: 14px; overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,.10), 0 2px 10px rgba(0,0,0,.06);
    transition: box-shadow .2s, transform .2s; color: var(--c-text);
    display: flex; flex-direction: column;
}
.obj-card:hover { box-shadow: 0 8px 28px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.10); transform: translateY(-2px); }
/* Promo «подсветка» — единственная услуга рамки (премиум-вариант снят, миграция 146):
   КРАСНАЯ рамка и тень того же цвета, оплачено с кредита агентства. */
.obj-card.promo-shadow { box-shadow: 0 0 0 2px #dc2626, 0 8px 26px rgba(220,38,38,.22); }
.obj-card.promo-shadow:hover { box-shadow: 0 0 0 2px #dc2626, 0 12px 34px rgba(220,38,38,.32); }
.obj-card-link { display: flex; flex-direction: column; flex: 1; color: inherit; }
/* Карточка целиком — ссылка: не подчёркиваем текст при наведении (ни в grid, ни в list). */
a.obj-card, a.obj-card:hover, .obj-card-link, .obj-card-link:hover, .obj-card a, .obj-card a:hover { text-decoration: none; }
/* Quick view — кнопка поверх карточки, появляется при наведении */
.oc-quick {
    position: absolute; top: 10px; right: 10px; z-index: 3;
    background: rgba(255,255,255,.92); color: var(--c-primary-dk);
    border: 1px solid var(--c-border); border-radius: 5px; padding: 6px 10px;
    font: inherit; font-size: 12px; font-weight: 600; cursor: pointer;
    opacity: 0; transition: .15s;
}
.obj-card:hover .oc-quick { opacity: 1; }
.oc-quick:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
@media (hover: none) { .oc-quick { opacity: 1; } }

/* Quick view modal (iframe 80%×80%) */
.qv-overlay {
    position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.55);
    display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .15s;
}
.qv-overlay.on { opacity: 1; }
.qv-modal { position: relative; width: 90%; max-width: 1600px; height: 100vh; background: #fff; border-radius: 0; overflow: hidden; box-shadow: var(--shadow-2); }
.qv-frame { width: 100%; height: 100%; border: 0; display: block; }
/* List / MAP — пара кнопок-вкладок справа от Search. Высота = кнопке Search (40px). */
.ssrch-views { display: inline-flex; border: 1px solid var(--c-border); border-radius: 5px; overflow: hidden; height: 40px; box-sizing: border-box; }
/* Подписи переводятся, и в части языков слово длинное («Žemėlapis», «Saraksts»),
   поэтому кегль и разрядка скромные, а перенос запрещён — иначе кнопка ломает строку бара. */
.ssrch-view {
    display: inline-flex; align-items: center; padding: 0 12px; height: 100%; box-sizing: border-box;
    font-size: 11px; font-weight: 700; letter-spacing: .2px; text-transform: uppercase;
    white-space: nowrap;
    color: var(--c-text); background: var(--c-surface); cursor: pointer; text-decoration: none;
}
.ssrch-view { justify-content: center; gap: 6px; }
.ssrch-view .i { display: inline-flex; align-items: center; }
.ssrch-view + .ssrch-view { border-left: 1px solid var(--c-border); }
/* Пара List/MAP живёт в results-bar справа от сортировки (_view_switch.php).
   Высота — как у соседнего селекта сортировки, а не 40px как в фильтр-баре.
   На телефоне переключение вынесено в шапку (.hdr-view-toggle) — здесь прячем. */
.results-bar .results-views { height: 34px; }   /* ровно как соседняя кнопка сортировки (.sortp-btn) */
.results-bar .results-views .ssrch-view { padding: 0 10px; }
@media (max-width: 768px) { .results-bar .results-views { display: none; } }
/* Узкий десктоп (769–1400): Reset сворачиваем в одну иконку — иначе строка бара ломается
   (кнопки занимают ~800px без поля поиска). Правило идёт ПОСЛЕ «широкой» декларации:
   специфичность равная, решает порядок. */
@media (min-width: 769px) and (max-width: 1400px) {
    .site-search > .ssrch-reset { line-height: 0; padding: 8px 9px; }
    .site-search > .ssrch-reset .ssrch-reset-t { display: none; }
}
/* Мини-кнопки в шапке (Наверх + тоггл List/MAP) — только мобильные, рядом с лупой. */
.hdr-mini-btn { display: none; }
@media (max-width: 768px) {
    .hdr-mini-btn {
        display: inline-flex; align-items: center; justify-content: center;
        width: 40px; height: 40px; flex: none; padding: 0;
        background: var(--c-surface); border: 1px solid var(--c-border);
        border-radius: 5px; color: var(--c-text); cursor: pointer; text-decoration: none;
    }
    .hdr-mini-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
}
/* «Наверх» — плавающая кнопка снизу справа, ТОЛЬКО мобильный. Из шапки убрана:
   там кнопка была 40px и жалась к лупе, снизу под палец — круг 56px. Появляется
   после прокрутки примерно на экран, у верха страницы скрыта. Сама прокрутка
   плавная — обработчик [data-scroll-top] в assets/main.js. */
.fab-top { display: none; }
@media (max-width: 768px) {
    .fab-top {
        display: inline-flex; align-items: center; justify-content: center;
        position: fixed; right: 16px; z-index: 901;   /* выше конвертика связи (900); right — как у .op-contact-fab, чтобы стояли в одну колонку */
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        width: 56px; height: 56px; padding: 0;
        background: var(--c-surface); color: var(--c-text);
        border: 1px solid var(--c-border); border-radius: 50%;
        box-shadow: 0 6px 18px rgba(0,0,0,.22); cursor: pointer;
        opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none;
        transition: opacity .18s ease, transform .18s ease;
    }
    .fab-top.show { opacity: 1; transform: none; pointer-events: auto; }
    .fab-top.show:active { transform: scale(.94); }
    .fab-top svg { display: block; }
    /* На странице объекта снизу справа уже висит конвертик связи (.op-contact-fab) —
       встаём над ним, класс ставит main.js. */
    .fab-top.stacked { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
    /* Пока открыт дравер (меню/поиск) — страница не скроллится, кнопка лишняя. */
    body.drawer-lock .fab-top { opacity: 0; pointer-events: none; }
}
.ssrch-view:hover { background: var(--c-bg); }
/* Активная вкладка List/MAP — второй фирменный цвет (accent, глубокий синий) */
.ssrch-view.on, .ssrch-view.on:hover { background: rgba(var(--c-primary-rgb), .1); color: var(--c-text); }
.obj-card-img {
    position: relative; aspect-ratio: 3/2; background: #e5e7eb; overflow: hidden;
}
.obj-card-img img { width: 100%; height: 100%; object-fit: cover; }
.obj-card-deal {
    position: absolute; top: 12px; left: 12px;
    padding: 4px 10px; border-radius: 5px; color: #fff; font-size: 11px;
    text-transform: uppercase; font-weight: 600; letter-spacing: .5px;
}
.deal-sale { background: var(--c-success); }
.deal-rent { background: #3b82f6; }
/* Метки объекта (Label / Label2) — ЛЕВЫЙ верхний угол фото, до двух штук в столбик.
   Справа они спорили с диагональной ленточкой «Auction» и звездой Best, слева угол
   свободен. В карточку попадают, только пока оплачены услуги Label 1 / Label 2
   (objects::label_badges). */
.oc-labels {
    position: absolute; top: 12px; left: 12px; z-index: 3;
    max-width: calc(100% - 24px);
    display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.oc-label {
    max-width: 100%;
    padding: 5px 10px; border-radius: 5px;
    background: var(--c-primary); color: #fff;
    font-size: 12px; font-weight: 700; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
/* Цвет бейджа — по коду метки (класс .lb-<code> ставит _obj_card.php).
   Незнакомый код остаётся на базовом --c-primary. Текст всегда белый,
   у open_house дата — часть той же подписи, поэтому красная вместе с ней. */
.oc-label.lb-recommended       { background: #16a34a; }  /* зелёный  */
.oc-label.lb-updated           { background: #2563eb; }  /* синий    */
.oc-label.lb-sold              { background: #ea580c; }  /* оранж.   */
.oc-label.lb-reserved          { background: #6b7280; }  /* серый    */
.oc-label.lb-price_reduced     { background: #dc2626; }  /* красный  */
.oc-label.lb-urgent_sale       { background: #dc2626; }  /* красный  */
.oc-label.lb-negotiable        { background: #ea580c; }  /* оранж.   */
.oc-label.lb-renovated         { background: #111827; }  /* чёрный   */
.oc-label.lb-sea_view          { background: #2563eb; }  /* синий    */
.oc-label.lb-exclusive         { background: #0ea5e9; }  /* голубой  */
.oc-label.lb-new               { background: #2563eb; }  /* синий    */
.oc-label.lb-under_construction{ background: #111827; }  /* чёрный   */
.oc-label.lb-open_house        { background: #dc2626; }  /* красный  */
/* Ленточка «Auction» — по диагонали в правом верхнем углу фото. Ставится карточкой,
   когда у объявления идут (или вот-вот начнутся) торги: см. $_auc_on в _obj_card.php. */
.oc-auc {
    position: absolute; z-index: 5; top: 16px; right: -38px;
    width: 150px; padding: 5px 0; text-align: center;
    transform: rotate(45deg); pointer-events: none;
    background: #dc2626; color: #fff;
    font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0,0,0,.28);
}
/* Звезда «Best» — в правом углу, под ленточкой аукциона. С метками она больше не
   пересекается: те ушли налево. */
.obj-card-img.has-auc .obj-card-feat { top: 58px; }
/* Белая плитка логотипа агентства выступает над верхом карточки и наезжает на левый
   угол фото — под ней метки опускаем ниже. Без логотипа (.oc-brand.no-logo — только
   название над карточкой) угол свободен и метки остаются наверху. */
.obj-card.has-brand .oc-brand:not(.no-logo) ~ .obj-card-link .oc-labels,
.obj-card.has-brand .oc-brand:not(.no-logo) ~ .obj-card-img .oc-labels { top: 36px; }
.obj-card-feat {
    position: absolute; top: 12px; right: 12px;
    background: var(--c-primary); color: #fff;
    width: 28px; height: 28px; border-radius: 5px;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.obj-card-body { padding: 16px; }
.obj-card-addr { font-size: 13px; color: var(--c-muted); margin-bottom: 6px; display: flex; align-items: center; gap: 4px; }
.obj-card-price { font-size: 24px; font-weight: 800; color: var(--c-text); margin-bottom: 4px; }
/* Диапазон цен новостройки «X – Y» — компактнее обычной цены объекта. */
.nb-card-price { font-size: 18px; font-weight: 700; line-height: 1.3; }
.nb-card-price .nb-price-sep { color: var(--c-muted); margin: 0 5px; }
.obj-card-period { font-size: 15px; color: var(--c-muted); font-weight: 400; }
.obj-card-title { font-size: 18px; margin: 0 0 6px; line-height: 1.3; }
.obj-card-meta { font-size: 13px; color: var(--c-muted); margin-bottom: 10px; }
.obj-card-features { display: flex; gap: 12px; padding-top: 10px; border-top: 1px solid var(--c-border); font-size: 13px; color: var(--c-muted); }

.empty-state { padding: 80px 20px; text-align: center; color: var(--c-muted); }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 24px 0; }
.pgn-link {
    padding: 8px 14px; border-radius: 5px; border: 1px solid var(--c-border);
    background: var(--c-surface); color: var(--c-text);
}
.pgn-link.on { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.pgn-link:hover { border-color: var(--c-primary); }
.halfmap-cards .pagination { padding: 12px 0 6px; flex-wrap: wrap; }
#hm-pager:empty { display: none; }

/* OBJECT DETAIL */
.obj-page { padding: 24px 0 80px; }
.crumbs { color: var(--c-muted); font-size: 13px; margin-bottom: 16px; }
.crumbs a { color: var(--c-muted); }
.crumbs a:hover { color: var(--c-primary-dk); }

.obj-hero {
    display: flex; justify-content: space-between; align-items: flex-end; gap: 24px;
    margin-bottom: 24px; flex-wrap: wrap;
}
.obj-hero h1 { margin: 8px 0 6px; font-size: 20px; }
.obj-meta { color: var(--c-muted); }
.obj-price { font-size: 22px; font-weight: 700; color: var(--c-primary-dk); margin-top: 8px; }

.obj-layout {
    display: grid; grid-template-columns: 1fr 360px; gap: 28px;
}
@media (max-width: 1024px) { .obj-layout { grid-template-columns: 1fr; } }

.obj-gallery { background: #1a1f36; border-radius: 5px; overflow: hidden; margin-bottom: 24px; }
.obj-gallery-main { aspect-ratio: 3/2; background: #000; }
.obj-gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.obj-gallery-thumbs { display: flex; gap: 4px; padding: 8px; overflow-x: auto; background: #000; }
.obj-thumb { background: none; border: 2px solid transparent; cursor: pointer; padding: 0; flex-shrink: 0; }
.obj-thumb.on { border-color: var(--c-primary); }
.obj-thumb img { width: 80px; height: 60px; object-fit: cover; display: block; }

.obj-features { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; margin-bottom: 24px; }
.obj-feat {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px;
    padding: 16px; text-align: center;
}
.obj-feat-num { display: block; font-size: 17px; font-weight: 700; color: var(--c-text); }
.obj-feat-lbl { color: var(--c-muted); font-size: 12px; text-transform: uppercase; }

.obj-section {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px;
    padding: 24px; margin-bottom: 20px;
}
.obj-section h2 { margin: 0 0 16px; font-size: 18px; }
.obj-section p { line-height: 1.7; }

#obj-map { height: 360px; border-radius: 5px; overflow: hidden; }

.calc-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.calc-form label { display: flex; flex-direction: column; gap: 4px; }
.calc-form label span { font-size: 12px; color: var(--c-muted); font-weight: 500; }
.calc-form input { border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit; width: 90px; }
.calc-result { padding: 8px 14px; background: var(--c-bg); border-radius: 5px; font-size: 16px; }

.obj-side { display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px; padding: 20px; }
.card h3 { margin: 0 0 14px; font-size: 14px; color: var(--c-muted); text-transform: uppercase; letter-spacing: .5px; }
.agent-card { display: flex; gap: 12px; align-items: flex-start; }
.agent-card img { width: 64px; height: 64px; border-radius: 5px; object-fit: cover; flex-shrink: 0; background: #e5e7eb; }
.agent-card a { color: var(--c-text); }

.inquiry-form { display: flex; flex-direction: column; gap: 10px; }
.inquiry-form input, .inquiry-form textarea {
    border: 1px solid var(--c-border); border-radius: 5px;
    padding: 8px 10px; font: inherit; width: 100%; box-sizing: border-box;
}
.form-msg { min-height: 18px; font-size: 14px; }
.form-msg.ok { color: var(--c-success); }
.form-msg.err { color: var(--c-danger); }

/* AGENT/AGENCY/COUNTRY pages share these */
.profile-hero { padding: 28px 0 12px; margin-bottom: 8px; }
.profile-hero-inner { display: flex; gap: 28px; align-items: stretch; }
.profile-hero-photo {
    width: 300px; height: 300px; border-radius: 10px; object-fit: cover;
    border: 1px solid var(--c-border); flex: none;
}
.profile-hero-body { flex: 1; display: flex; flex-direction: column; }
.profile-hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.profile-hero-info h1 { margin: 0; font-size: 32px; }
.profile-hero-meta { color: var(--c-text); font-size: 17px; margin: 10px 0 0; display: flex; align-items: center; gap: 8px; }
.profile-hero-meta .agency-logo-mini { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; border: 1px solid var(--c-border); }
.profile-hero p { font-size: 15px; margin: 7px 0 0; }
.profile-hero-actions { flex: none; }
.profile-hero-desc { margin-top: 22px; line-height: 1.6; color: var(--c-text); }
.verified-badge {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; border-radius: 50%;
    background: #16a34a; color: #fff; margin-left: 8px; vertical-align: middle;
}
.profile-spec { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 14px; }
.profile-spec-label { color: var(--c-muted); font-weight: 600; margin-right: 4px; }
.profile-spec-chip { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 999px; padding: 3px 10px; font-size: 13px; color: var(--c-text); }
.profile-areas { margin-top: 12px; font-size: 14px; color: var(--c-text); }
.profile-areas-label { color: var(--c-muted); font-weight: 600; margin-right: 6px; }
.profile-socials { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 8px; }
.profile-social {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 12px; border-radius: 999px; border: 1px solid var(--c-border-strong);
    font-size: 13px; font-weight: 600; color: var(--c-text); background: #fff;
    transition: .15s;
}
.profile-social:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.profile-social-youtube:hover   { background: #ff0000; border-color: #ff0000; }
.profile-social-instagram:hover { background: #e1306c; border-color: #e1306c; }
.profile-social-facebook:hover  { background: #1877f2; border-color: #1877f2; }
.profile-social-tiktok:hover    { background: #000;    border-color: #000; }
.profile-social-linkedin:hover  { background: #0a66c2; border-color: #0a66c2; }
.profile-social-twitter_x:hover { background: #000;    border-color: #000; }
.agency-map { width: 100%; height: 360px; border-radius: 8px; border: 1px solid var(--c-border); margin-bottom: 24px; }
@media (max-width: 760px) {
    .profile-hero-inner { flex-direction: column; align-items: stretch; }
    .profile-hero-photo { width: 100%; max-width: 320px; height: auto; aspect-ratio: 1 / 1; }
    .profile-hero-head { flex-direction: column; align-items: flex-start; }
}

/* User panels */
/* Legacy: боковое меню кабинета (заменено на .panel-tabs, оставлено на случай старых шаблонов) */
.panel-layout { display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 24px; }
.panel-side { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px; padding: 8px; height: max-content; }
.panel-side a { display: block; padding: 10px 14px; color: var(--c-text); border-radius: 5px; }
.panel-side a:hover { background: var(--c-bg); }
.panel-side a.on { background: var(--c-primary); color: #fff; }

/* Кабинеты (agency/agent/user): меню страниц сверху как вкладки */
.panel-wrap { padding: 24px 0; }
/* My account (кабинет пользователя) — ограничение ширины. */
.panel-wrap-narrow { max-width: 1280px; margin-left: auto; margin-right: auto; }
.panel-tabs { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; border-bottom: 2px solid var(--c-border); margin-bottom: 16px; }
.panel-tabs a { padding: 10px 18px; color: var(--c-text); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -2px; border-radius: 6px 6px 0 0; }
.panel-tabs a:hover { background: #f1f5f9; color: var(--c-primary-dk); }
.panel-tabs a.on { color: var(--c-primary-dk); border-bottom-color: var(--c-primary); font-weight: 700; }
.panel-tabs .panel-tab-logout { margin-left: auto; color: var(--c-muted); }
/* Обёртка вкладок кабинета юзера прозрачна для раскладки (display:contents) — на
   десктопе вкладки выглядят ровно как раньше. На мобиле сам ряд вкладок скрыт, а
   открывается выпадающим меню от кнопки в шапке (#panel-menu-btn, правее «наверх»). */
.panel-nav { display: contents; }
@media (max-width: 768px) {
    .panel-nav .panel-tabs { display: none; position: fixed; top: 56px; right: 10px; z-index: 1200;
        flex-direction: column; align-items: stretch; gap: 2px; width: min(72vw, 260px);
        margin: 0; padding: 6px; text-align: left;
        background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px;
        box-shadow: 0 12px 30px rgba(0,0,0,.16); }
    .panel-nav.open .panel-tabs { display: flex; }
    .panel-nav .panel-tabs a { padding: 12px 14px; margin: 0; border-bottom: 0; border-radius: 6px; }
    .panel-nav .panel-tabs a.on { background: var(--c-bg); }
    .panel-nav .panel-tabs .panel-tab-logout { margin-left: 0; }
}
/* Logout — такой же hover, как у остальных пунктов (без розового). */
.panel-main { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px; padding: 24px; }
/* На странице Sell панель без рамки/фона — контент на белом, как на остальных страницах */
.panel-main.sell-main { background: none; border: 0; border-radius: 0; padding: 0; }
/* Без общей рамки/карточки (My account, Favorites, Packages, Payments). */
.panel-main.panel-bare { background: none; border: 0; border-radius: 0; padding: 0; }

/* Текст выбранной локации в фильтрах (рядом с кнопкой 📍 Location). */
.flt-loc-text { font-size: 13px; color: var(--c-muted); align-self: center; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* H1 в кабинетах (agency/agent/user) — без вертикальных отступов */
.panel-main h1 { margin-top: 0; margin-bottom: 0; padding-top: 0; padding-bottom: 0; }
/* Общая сетка профилей: 3 поля в ряд (поля и пароли) */
.prof-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 8px; }
@media (max-width: 760px) { .prof-grid-3 { grid-template-columns: 1fr; } }
/* Шапка профиля: заголовок слева, Save справа. Все элементы по центру вертикали. */
.prof-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--c-border); }
.prof-head h1 { line-height: 1; }
.prof-head .prof-status { line-height: 1; display: inline-flex; align-items: center; height: 24px; }
/* Статус-бейдж в шапке профиля: approved — зелёный, pending — жёлтый, disabled — серый */
.prof-status { padding: 3px 10px; border-radius: 5px; font-size: 12px; font-weight: 600; }
.prof-status-0 { background: #fef9c3; color: #92400e; }
.prof-status-1 { background: #16a34a; color: #fff; }
.prof-status-2 { background: #e5e7eb; color: #475569; }

/* Auth pages */
.auth-page { max-width: 420px; margin: 60px auto; padding: 0 20px; }
/* На мобильном пустая полоса над карточкой не нужна — экран и так короткий. */
@media (max-width: 768px) { .auth-page { margin: 12px auto 28px; } }
/* Кнопки соцвхода до пройденной капчи: кликаются, но обработчик их
   останавливает — поэтому только гасим вид, pointer-events не трогаем. */
.btn-social.is-locked { opacity: .5; cursor: not-allowed; }
.auth-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px; padding: 32px; box-shadow: var(--shadow-3); }
.auth-card h1 { margin: 0 0 8px; }
/* Баннер «подтвердите email» в кабинете */
.ev-banner { display: flex; align-items: center; gap: 12px; background: #fff7ed; border: 1px solid #fed7aa;
    color: #9a3412; padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; flex-wrap: wrap; }
.ev-banner .ev-resend { margin-left: auto; background: transparent; border: 1px solid #9a3412; color: #9a3412;
    border-radius: 5px; padding: 5px 12px; cursor: pointer; font: inherit; white-space: nowrap; transition: .15s; }
.ev-banner .ev-resend:hover { background: #9a3412; color: #fff; }
.ev-banner .ev-resend:disabled { opacity: .5; cursor: default; }
/* Кнопки соцвхода (Google, Apple, Facebook) — сразу под формой, без разделителя «или».
   Кнопок может быть одна, несколько или ни одной — зависит от ключей в config.php. */
.auth-social { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.btn-social { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%;
    padding: 11px 16px; border: 1px solid var(--c-border-strong); border-radius: 5px;
    background: #fff; color: #1f2937; font: inherit; font-weight: 600; cursor: pointer; transition: .15s; }
.btn-social:hover { background: var(--c-bg); border-color: var(--c-muted); }
.btn-social-ic { display: inline-flex; }
.btn-social-ic svg { display: block; }
/* «Продолжить с Apple» (iPhone-приложение) — по правилам Apple: чёрная, белые логотип и текст. */
.btn-apple, .btn-apple:hover { background: #000; border-color: #000; color: #fff; }
.btn-social.is-busy { opacity: .6; pointer-events: none; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 20px; border-bottom: 1px solid var(--c-border); }
.auth-tab { padding: 10px 16px; color: var(--c-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 500; }

/* Поле пароля с иконками «глаз» (показать) и «генерация». */
.pwd-wrap { position: relative; display: block; }
.pwd-wrap > input { width: 100%; padding-right: 70px; }
.pwd-icon { position: absolute; top: 50%; transform: translateY(-50%); width: 30px; height: 30px;
    display: inline-flex; align-items: center; justify-content: center; background: none; border: 0;
    padding: 0; cursor: pointer; color: var(--c-muted); }
.pwd-icon:hover { color: var(--c-primary-dk); }
.pwd-icon.on { color: var(--c-primary); }
.pwd-eye { right: 4px; }
.pwd-gen { right: 36px; }
/* Popup генератора пароля. */
.pwd-gen-pop { position: fixed; inset: 0; z-index: 1000; background: rgba(15,23,42,.45);
    display: flex; align-items: center; justify-content: center; }
.pwd-gen-box { background: var(--c-surface); border-radius: 8px; box-shadow: var(--shadow-1);
    padding: 22px; width: 340px; max-width: 92vw; }
.pwd-gen-title { font-weight: 600; margin-bottom: 12px; }
.pwd-gen-val { width: 100%; border: 1px solid var(--c-border); border-radius: 5px; padding: 10px 12px;
    font: inherit; font-family: monospace; font-size: 16px; letter-spacing: 1px; text-align: center; margin-bottom: 14px; }
.pwd-gen-actions { display: flex; gap: 8px; justify-content: space-between; }
.auth-tab.on { color: var(--c-primary-dk); border-color: var(--c-primary); }

/* Info pages */
.info-page { max-width: 800px; margin: 40px auto; padding: 32px; background: var(--c-surface); border-radius: 5px; border: 1px solid var(--c-border); }
/* Страница с оглавлением: слева главы, справа текст. Ширину даём больше обычной
   info-страницы — иначе сайдбар съедает колонку текста. */
.info-page-toc { max-width: 1120px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
/* Липкая шапка сайта — 81px, под ней ещё липкая строка поиска (~57px): оглавление и
   якоря глав отсчитываем от их суммы, иначе заголовок уезжает под поиск. */
.info-page-toc { --toc-off: 150px; }
.info-toc { position: sticky; top: var(--toc-off); max-height: calc(100vh - var(--toc-off) - 24px); overflow: auto; }
.info-toc-h { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    color: var(--c-muted); margin-bottom: 10px; }
.info-toc nav { display: flex; flex-direction: column; gap: 2px; border-left: 2px solid var(--c-border); }
.info-toc a { padding: 6px 10px; margin-left: -2px; border-left: 2px solid transparent;
    font-size: 14px; line-height: 1.35; color: var(--c-text); text-decoration: none; }
.info-toc a:hover { color: var(--c-primary); }
.info-toc a.on { border-left-color: var(--c-primary); color: var(--c-primary); font-weight: 600; }
/* Якорь не должен уезжать под шапку при переходе по ссылке оглавления. */
.info-page-toc h2 { scroll-margin-top: var(--toc-off); }
.info-body > :first-child { margin-top: 0; }
@media (max-width: 900px) {
    /* На узком экране оглавление просто становится списком над текстом. */
    .info-page-toc { display: block; padding: 20px; --toc-off: 72px; }
    .info-toc { position: static; max-height: none; margin-bottom: 20px;
        padding-bottom: 16px; border-bottom: 1px solid var(--c-border); }
}
.info-page h1 { margin-top: 0; }
.info-page h2 { margin-top: 32px; }
/* Подзаголовки внутри главы: в оглавление не попадают (там только h2), но должны
   отличаться от обычного текста — иначе длинная глава читается сплошняком. */
.info-page h3 { margin: 22px 0 6px; font-size: 17px; color: #1f2937; }
.info-page code { background: #f1f5f9; border-radius: 3px; padding: 1px 5px; font-size: .92em; }
/* Примеры запросов и таблицы полей (документация API в Help). Оба блока шире текста
   не становятся: прокручиваются внутри себя, иначе страницу уводит вбок на телефоне. */
.info-page pre { background: #f8fafc; border: 1px solid var(--c-border); border-radius: 6px;
    padding: 12px 14px; margin: 12px 0; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.info-page pre code { background: none; padding: 0; font-size: inherit; }
.info-page table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse;
    margin: 12px 0; font-size: 14px; }
.info-page th, .info-page td { border: 1px solid var(--c-border); padding: 6px 10px;
    text-align: left; vertical-align: top; }
.info-page th { background: #f8fafc; font-weight: 600; white-space: nowrap; }

/* 404 */
.page-404 {
    text-align: center; padding: 100px 20px;
    max-width: 500px; margin: 0 auto;
}
.page-404 h1 {
    font-size: 80px; margin: 0; color: var(--c-primary);
    line-height: 1;
}

/* Image upload UI (panels) */
.img-drop {
    border: 2px dashed var(--c-border, #d4d8de);
    border-radius: 5px;
    padding: 24px; text-align: center;
    background: #fafbfc; color: #555;
    margin-top: 12px; transition: background .15s;
}
.img-drop.on { background: #f0f6ff; border-color: var(--c-primary, #ff7a00); }
.img-drop p { margin: 0; }
.link-like { color: var(--c-primary, #ff7a00); cursor: pointer; text-decoration: underline; }
.img-list {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px; margin-top: 14px;
}
.img-thumb {
    background: #fff; border-radius: 5px; overflow: hidden; border: 1px solid #e6e8ec;
    display: flex; flex-direction: column;
}
.img-thumb img { width: 100%; height: 110px; object-fit: cover; display: block; }
.img-thumb-actions { display: flex; gap: 6px; padding: 6px 8px; align-items: center; justify-content: space-between; }
.img-thumb-main { font-size: 12px; color: var(--c-primary, #ff7a00); font-weight: 600; }
.btn-mini {
    border: 1px solid #d4d8de; background: #fff; padding: 3px 8px;
    border-radius: 5px; cursor: pointer; font-size: 12px;
}
.btn-mini:hover { background: #f4f5f7; }

/* SVG icon helper — inline icons with currentColor */
.i { display: inline-flex; vertical-align: middle; line-height: 0; color: var(--c-text); }
.i svg { display: block; }

/* obj-card stats row (icons) */
.obj-card-addr { color: var(--c-muted); font-size: 15px; margin: 4px 0; display: flex; align-items: center; gap: 4px; }
.obj-card-stats { display: flex; gap: 14px; padding-top: 10px; margin-top: 8px; border-top: 1px solid var(--c-border); color: var(--c-muted); font-size: 14px; flex-wrap: wrap; }
.obj-card-stat { display: inline-flex; align-items: center; gap: 5px; }
.obj-card-stat strong { color: var(--c-text); font-weight: 600; }
/* Цена + кнопка «Email to agent» в теле карточки (НЕ на картинке) */
.obj-card-price-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; margin-bottom: 4px; }
/* Сумма с «/мес» не рвётся; не помещается рядом с кнопкой — кнопка уходит на строку ниже. */
.oc-price-main { white-space: nowrap; }
.obj-card-price-row .obj-card-price { margin-bottom: 0; }
/* Кнопка «Email agent» — контурная «пилюля»; при наведении становится ярко-красной. Без подчёркивания. */
.oc-email { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    padding: 8px 18px; border: 1px solid var(--c-border); border-radius: 999px; background: var(--c-surface);
    color: var(--c-text); cursor: pointer; font: inherit; font-size: 14px; font-weight: 600; line-height: 1;
    white-space: nowrap; text-decoration: none; transition: border-color .15s, background .15s, color .15s; }
/* Красная подсветка кнопки — при наведении на всю карточку (а также прямо на кнопку). */
.oc-email:hover, .obj-card:hover .oc-email { border-color: #e11d48; background: #e11d48; color: #fff; text-decoration: none; }

/* «Сердечко» (избранное) — на картинке, снизу справа */
.oc-fav { position: absolute; right: 8px; bottom: 8px; z-index: 4; width: 36px; height: 36px; border-radius: 50%;
    border: none; background: rgba(255,255,255,.92); color: #6b7280; cursor: pointer;
    display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 8px rgba(0,0,0,.18);
    transition: background .15s, color .15s, transform .15s; }
.oc-fav:hover { color: #e11d48; transform: scale(1.08); }
.oc-fav.on { color: #e11d48; }
.oc-fav.on svg { fill: #e11d48; }

/* obj-card carousel arrows */
.obj-card-img { position: relative; }
/* Слой-«зумер»: медленно наезжает при наведении на картинку. Кадры внутри него
   ездят по X (смена фото), поэтому zoom и slide не дерутся за transform. */
.oc-zoom {
    position: absolute; inset: 0; overflow: hidden; z-index: 1;
    transition: transform 2.6s cubic-bezier(.22, .61, .36, 1);
}
.obj-card-img:hover .oc-zoom { transform: scale(1.12); }
.obj-card-img .oc-img {
    position: absolute; inset: 0;
    width: 100%; height: 100%; object-fit: cover;
    transition: opacity .2s;
}
/* Слайд: старый кадр уезжает, новый приезжает с нужной стороны. */
.obj-card-img .oc-img.oc-anim { transition: transform .38s cubic-bezier(.4, 0, .2, 1); }
@media (prefers-reduced-motion: reduce) {
    .oc-zoom, .obj-card-img .oc-img.oc-anim { transition: none; }
    .obj-card-img:hover .oc-zoom { transform: none; }
}
.oc-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 30px; height: 30px;
    border: 0; border-radius: 5px;
    background: rgba(255,255,255,.7); color: #111;
    font-size: 22px; line-height: 1; cursor: pointer;
    display: none;
    align-items: center; justify-content: center;
    z-index: 4; transition: background .15s;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.oc-arrow:hover { background: rgba(255,255,255,.92); }
.oc-prev { left: 8px; }
.oc-next { right: 8px; }
/* Стрелки — только у карточек с галереей (>1 фото) и только при наведении.
   На тач-устройствах ховера нет — показываем всегда. */
.obj-card-img.has-gal:hover .oc-arrow,
.obj-card-img.has-gal:focus-within .oc-arrow { display: flex; }
/* Пока грузится следующее фото — лёгкое затемнение текущего. */
.obj-card-img.oc-busy .oc-img { opacity: .7; }
.oc-counter {
    position: absolute; bottom: 8px; left: 8px;
    background: rgba(0,0,0,.55); color: #fff;
    font-size: 11px; padding: 2px 8px; border-radius: 5px;
    z-index: 3; display: none;
}
.obj-card-img.has-gal .oc-counter { display: block; }
/* На тач-устройствах стрелок нет: листают свайпом, а сколько фото — показывают точки
   снизу (.bsr-dots, рисует BSR.dots в main.js). Счётчик «1 / N» там тоже не нужен.
   То же у галереи объекта/новостройки и в просмотрщике (.op-lb — стили в шаблоне,
   поэтому селекторы с родителем — иначе шаблонный display:flex перебивает). */
@media (hover: none) {
    .obj-card-img.has-gal .oc-arrow,
    .obj-card-img.has-gal:hover .oc-arrow,
    .obj-card-img.has-gal:focus-within .oc-arrow,
    .obj-card-img.has-gal .oc-counter,
    .op-photo-stage .op-nav,
    .op-photo-stage .op-counter,
    .op-lb .op-lb-nav { display: none; }
    .bsr-dots:not(:empty) { display: flex; }
}
/* Тёмная плашка под точками — чтобы их было видно и на светлом фото. */
.bsr-dots {
    position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%);
    display: none; align-items: center; gap: 5px;
    padding: 4px 7px; border-radius: 10px; background: rgba(0,0,0,.35);
    z-index: 3; pointer-events: none;
}
.op-photo-stage .bsr-dots { bottom: 10px; }
.op-lb .bsr-dots { bottom: 12px; }
.bsr-dots i {
    width: 6px; height: 6px; border-radius: 50%; flex: 0 0 auto;
    background: rgba(255,255,255,.55); box-shadow: 0 0 2px rgba(0,0,0,.45);
    transition: background .2s, transform .2s;
}
.bsr-dots i.on { background: #fff; transform: scale(1.3); }
/* Крайние точки окна, за которыми есть ещё фото, — меньше (как в Instagram). */
.bsr-dots i.sm { transform: scale(.6); }

/* ===========================================================================
   POPUP / DIALOG (BSR.popup, BSR.alert, BSR.confirm)
   =========================================================================== */
.bsr-pop-ov {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(15, 23, 42, .55);
    display: flex; align-items: center; justify-content: center;
    padding: 24px; opacity: 0; transition: opacity .15s ease-out;
}
.bsr-pop-ov.on { opacity: 1; }
.bsr-pop {
    background: var(--c-surface); color: var(--c-text);
    border-radius: 5px; box-shadow: 0 20px 50px rgba(0,0,0,.25);
    width: 100%; max-width: 440px; max-height: 90vh; overflow: hidden;
    display: flex; flex-direction: column;
    transform: translateY(8px); transition: transform .15s ease-out;
}
.bsr-pop-ov.on .bsr-pop { transform: translateY(0); }
.bsr-pop-wide { max-width: 720px; }
.bsr-pop-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--c-border); }
.bsr-pop-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.bsr-pop-x {
    border: 0; background: transparent; cursor: pointer; color: var(--c-muted);
    width: 28px; height: 28px; border-radius: 5px; font-size: 22px; line-height: 1;
}
.bsr-pop-x:hover { background: var(--c-bg); color: var(--c-text); }
.bsr-pop-x-only { position: absolute; top: 8px; right: 8px; }
.bsr-pop-body { padding: 18px; overflow-y: auto; font-size: 14px; line-height: 1.55; }
.bsr-pop-body p:first-child { margin-top: 0; }
.bsr-pop-body p:last-child  { margin-bottom: 0; }
.bsr-pop-foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--c-border); background: #fafbfc; }
.bsr-pop-btn { padding: 8px 18px; }
.btn-danger {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 18px; border-radius: 5px; font: inherit; font-weight: 600;
    cursor: pointer; border: 1px solid transparent; transition: .15s;
    background: var(--c-danger); color: #fff;
}
.btn-danger:hover { background: #c4302c; }

/* Progress popup */
.bsr-pop-label { font-size: 13px; color: var(--c-text); margin-bottom: 8px; min-height: 18px; }
.bsr-pop-bar { background: var(--c-bg); height: 10px; border-radius: 5px; overflow: hidden; }
.bsr-pop-bar-fill { background: var(--c-primary); height: 100%; width: 0%; transition: width .2s ease-out; }
.bsr-pop-ratio { font-size: 12px; color: var(--c-muted); margin-top: 6px; text-align: right; }
.bsr-pop-extra { margin-top: 10px; font-size: 12px; color: var(--c-muted); }
.bsr-pop-actions { display: flex; justify-content: flex-end; margin-top: 14px; }
.bsr-pop-cancel { padding: 6px 16px; cursor: pointer; }
.bsr-pop-cancel:disabled { opacity: 0.5; cursor: wait; }

/* Stat grid in popup body for push-result etc. */
.bsr-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 8px 0; }
.bsr-stat-grid .bsr-st { background: var(--c-bg); border-radius: 5px; padding: 10px 12px; }
.bsr-stat-grid .bsr-st-num { font-size: 20px; font-weight: 700; }
.bsr-stat-grid .bsr-st-lbl { color: var(--c-muted); font-size: 12px; margin-top: 2px; }
.bsr-pop pre { background: var(--c-bg); padding: 10px 12px; border-radius: 5px; font-size: 12px; max-height: 200px; overflow: auto; }

/* ===========================================================================
   OBJECT DETAIL PAGE (op-*)
   =========================================================================== */
.op-page { max-width: 1280px; margin: 0 auto; padding-top: 24px; padding-bottom: 60px; }
/* Quick View (iframe ?bare=1): убираем центрирующие поля — контент во всю ширину модалки. */
body.bare .op-page { max-width: none; margin: 0; }
.crumbs { color: var(--c-muted); font-size: 13px; margin-bottom: 12px; display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.crumbs a { color: var(--c-primary-dk); }
.crumbs .cr-sep { margin: 0 4px; color: #cbd5e1; }
.crumbs .cr-cur { color: var(--c-text); }
.op-back-btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 6px;
    padding: 4px 6px; color: var(--c-text); cursor: pointer; transition: .15s; line-height: 0;
}
.op-back-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
/* «Back to search» — единственный элемент над галереей */
.op-back-search {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px;
    padding: 8px 14px; color: var(--c-text); cursor: pointer; transition: .15s;
    font: inherit; font-weight: 600; font-size: 14px; text-decoration: none;
}
.op-back-search:hover { border-color: var(--c-primary); color: var(--c-primary); }
.op-back-search .i { display: inline-flex; line-height: 0; }
/* На мобильном — только стрелка: подпись в три строки занимала пол-экрана. */
@media (max-width: 768px) {
    .op-back-search .op-back-lbl { display: none; }
    .op-back-search { padding: 8px 12px; gap: 0; }
}
.op-head-nav { margin-bottom: 14px; align-items: center; position: relative; }
/* Логотип — по центру строки (абсолютно, поверх потока back|tools) */
.op-nav-logo { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--c-text); font-weight: 700; }
.op-nav-logo img { display: block; height: 34px; width: auto; }
.op-nav-logo span { font-size: 15px; }
/* Правый тулбар: favorite + печать + поделиться */
.op-nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.op-tool-btn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface, #fff); color: var(--c-text); cursor: pointer; transition: .15s; }
.op-tool-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.op-fav-tool.on { color: #e11d48; border-color: #e11d48; }
.op-fav-tool.on svg { fill: #e11d48; }
.op-share { position: relative; }
.op-share-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; min-width: 184px;
    background: var(--c-surface, #fff); border: 1px solid var(--c-border); border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,.14); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.op-share-menu[hidden] { display: none; }
.op-share-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 0; border-radius: 7px;
    background: none; font: inherit; font-size: 14px; color: var(--c-text); text-decoration: none; cursor: pointer; text-align: left; width: 100%; }
.op-share-item:hover { background: var(--c-bg, #f1f5f9); }
.op-share-item svg { flex: 0 0 auto; }
/* На узких экранах прячем центральный логотип, чтобы не наезжал на back/tools */
@media (max-width: 640px) { .op-nav-logo { display: none; } }
@media print { .op-head-nav, .op-side, .op-contact-fab { display: none !important; } }
/* Заголовок/цена, перенесённые под фото */
.op-head-under { margin-top: 16px; margin-bottom: 18px; }
.op-head-under .op-title-row { flex: 1; min-width: 0; }
.op-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.op-title-row h1 { margin: 0; line-height: 1; }
/* Путь локации — своей строкой под H1 (раньше стоял справа от заголовка).
   flex-basis 100% в flex-wrap строке = перенос на следующую строку. */
.op-loc-suffix { flex: 1 1 100%; width: 100%; margin-top: 6px; color: var(--c-muted); font-size: 13px; font-weight: 400; line-height: 1.4; }
/* .op-deal-badge-sm — больше не нужен, базовый класс уже мелкий. */

.op-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; margin-bottom: 18px; }
.op-head-l { flex: 1; min-width: 0; }
.op-head-l h1 { margin: 0 0 6px; font-size: 30px; font-weight: 700; line-height: 1.2; }
.op-addr { color: var(--c-muted); font-size: 14px; margin-bottom: 8px; }
.op-pin { color: var(--c-primary-dk); }
.op-deal-badge { display: inline-block; background: #475569; color: #fff; padding: 3px 5px; border-radius: 5px; font-size: 8px; text-transform: uppercase; letter-spacing: .4px; }
.op-deal-badge.deal-rent { background: #2563eb; }

.op-head-r { text-align: right; }
.op-head-actions { display: flex; gap: 6px; justify-content: flex-end; margin-bottom: 8px; }
.op-icon-btn {
    width: 30px; height: 30px; border: 1px solid var(--c-border); border-radius: 5px;
    background: var(--c-surface); cursor: pointer; font-size: 15px; line-height: 1;
}
.op-icon-btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.op-price { font-size: 30px; font-weight: 800; color: var(--c-text); margin-left: auto; white-space: nowrap; }
.op-cur { font-size: 22px; color: var(--c-muted); font-weight: 600; }
/* Префикс цены («from», «от») — задаётся у объекта, мельче самой цены. */
.op-price-prefix { font-size: 18px; color: var(--c-muted); font-weight: 600; }
.oc-price-prefix { font-size: 14px; color: var(--c-muted); font-weight: 600; }
/* Аренда: «/month» после цены (цена за месяц). */
.op-price-period { font-size: 16px; color: var(--c-muted); font-weight: 600; margin-left: 2px; }
/* Аренда: дата доступности — строкой под ценой, прижата вправо. */
.op-avail-from { text-align: right; margin-top: 4px; font-size: 14px; color: var(--c-muted); }
.op-avail-from b { color: var(--c-text); }
.op-price-pm { font-size: 14px; color: var(--c-muted); font-weight: 600; margin-left: 10px; }
/* Лот с аукционом: на месте цены — стартовая цена и последняя ставка. Остальные
   данные торгов живут в панели под строкой локации. */
.op-price-auc { display: flex; gap: 22px; white-space: nowrap; }
.op-pa { display: flex; flex-direction: column; gap: 2px; }
.op-pa > span { font-size: 12px; font-weight: 600; color: var(--c-muted); }
.op-pa > b { font-size: 26px; font-weight: 800; line-height: 1.1; }

/* Бейдж «crypto» справа от цены (карточка выдачи и страница объекта).
   Значит, что продавец готов принять оплату криптовалютой; подсказка — в title. */
.crypto-badge {
    display: inline-flex; align-items: center; vertical-align: middle;
    margin-left: 8px; padding: 2px 8px; border-radius: 999px;
    background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
    font-size: 11px; font-weight: 700; line-height: 1.4; letter-spacing: .02em;
    text-transform: lowercase; cursor: help; white-space: nowrap;
}
.op-period { font-size: 13px; color: var(--c-muted); }
.op-price-sub { color: var(--c-muted); font-size: 13px; }

.op-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: flex-start; }
/* grid-треки не должны раздуваться под min-content потомков (давало +20px overflow на телефоне) */
.op-layout > .op-main, .op-layout > .op-side { min-width: 0; }
/* Правый сайдбар (агент + контакт-форма) залипает при прокрутке */
.op-side { position: sticky; top: calc(var(--site-top-h, 64px) + 16px); align-self: start; }
/* Видео / 3D-тур — тот же прямоугольник 3:2, что и фото (было фиксированные 360px
   высоты, из-за чего на широком экране получалась узкая полоса). */
.op-media-frame { width: 100%; aspect-ratio: 3 / 2; height: auto; border: 0; display: block; background: #000; }
.op-nearby { margin-top: 44px; }
.op-nearby h2 { font-size: 20px; margin: 0 0 16px; }
/* Новостройка (объекты одного nb_code): кнопки «вся аренда / вся продажа» под карточками. */
/* Заголовок группы новостройки + кнопки «вся новостройка» справа от него. */
.op-nb-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.op-nb-head h2 { margin: 0; }
.op-nb-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.op-nb-actions .btn-secondary,
.op-nb-actions .btn-primary { text-decoration: none; padding: 8px 14px; font-size: 14px; }
@media (max-width: 560px) {
    .op-nb-actions { width: 100%; }
    .op-nb-actions .btn-secondary,
    .op-nb-actions .btn-primary { flex: 1 1 0; justify-content: center; text-align: center; }
}
/* Секции Nearby / More from agency и вкладки Sell/Rent на странице агентства/агента
   (_profile_objs_tabs) — List-вид (картинка слева, инфо справа), не Grid. */
.op-nlist { display: flex; flex-direction: column; gap: 16px; }
.op-nlist .obj-card { height: 200px; }
.op-nlist .obj-card-link { flex-direction: row; height: 100%; }
.op-nlist .obj-card-img { flex: 0 0 300px; width: 300px; height: 100%; aspect-ratio: auto; }
.op-nlist .obj-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.op-nlist .obj-card-desc {
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--c-muted);
}
/* На мобильном эти блоки — Grid (картинка сверху, инфо снизу), а не List: в List
   картинка ужимается до ~130px и карточка выглядит обрубком. Возвращаем базовый
   вид карточки (.obj-card-link — column, .obj-card-img — aspect-ratio 3/2). */
@media (max-width: 560px) {
    .op-nlist { display: grid; grid-template-columns: 1fr; }
    .op-nlist .obj-card { height: auto; }
    .op-nlist .obj-card-link { flex-direction: column; height: auto; }
    .op-nlist .obj-card-img { flex: none; width: 100%; height: auto; aspect-ratio: 3/2; }
    .op-nlist .obj-card-desc { display: none; }
}
@media (max-width: 960px) { .op-layout { grid-template-columns: 1fr; } .op-side { display: none; } }
/* Та же шапка контакта в основной колонке — только там, где колонки с формой нет. */
.op-mob-contact { display: none; }
@media (max-width: 960px) { .op-mob-contact { display: block; } }
.op-mob-contact .op-side-contact { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }

/* Мобильный FAB связи: конвертик снизу справа, открывает попап-форму. На десктопе — нет (форма в сайдбаре). */
.op-contact-fab { display: none; }
@media (max-width: 960px) {
    .op-contact-fab {
        display: inline-flex; align-items: center; justify-content: center;
        position: fixed; right: 16px; bottom: 16px; z-index: 900;
        width: 56px; height: 56px; padding: 0;
        border: 0; border-radius: 50%; cursor: pointer;
        background: var(--c-primary); color: #fff;
        box-shadow: 0 6px 18px rgba(0,0,0,.28);
    }
    .op-contact-fab:active { transform: scale(.96); }
    .op-contact-fab .i, .op-contact-fab svg { display: block; }
}

/* Gallery */
.op-gallery { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px; overflow: hidden; }
.op-media-tabs { display: flex; gap: 2px; background: var(--c-surface); border-bottom: 1px solid var(--c-border); }
.op-media-tabs .op-tab {
    background: transparent; border: 0; color: var(--c-muted); cursor: pointer;
    padding: 10px 16px; font: 600 13px/1 inherit; letter-spacing: .3px;
    border-bottom: 2px solid transparent; text-decoration: none;
}
.op-media-tabs .op-tab:hover { color: var(--c-text); }
.op-media-tabs .op-tab.on { color: var(--c-text); border-bottom-color: var(--c-primary); }
/* Open on Google Maps — обычный таб (без auto-margin и без оранжевого). */
.op-media-tabs .op-tab-ext { color: var(--c-muted); }
.op-media-tabs .op-tab-ext:hover { color: var(--c-text); }
.op-media-pane[hidden] { display: none; }
.op-gallery-main { position: relative; background: var(--c-surface); }
/* ВАЖНО: только прямой <img> photo-pane'а. Иначе селектор бьёт по иконкам внутри Google Maps controls
   (fullscreen, zoom, pegman) — они ломаются на 100% width. */
.op-media-pane[data-pane="photo"] > img,
.op-gallery-main > img { width: 100%; max-height: 540px; min-height: 360px; object-fit: cover; display: block; }
.op-media-pane[data-pane="map"] #op-map { width: 100%; height: 540px; background: #fff; }

/* Кнопка полноэкранного просмотра */
.op-fs-btn {
    position: absolute; top: 10px; right: 10px; z-index: 6;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,.55); background: rgba(0,0,0,.45); color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer; transition: .15s;
}
.op-fs-btn:hover { background: var(--c-primary); border-color: var(--c-primary); }

/* Полноэкранный режим галереи (класс навешивается JS на fullscreenchange) */
.op-gallery.is-fs { background: #000; display: flex; flex-direction: column; }
.op-gallery.is-fs .op-gallery-main { flex: 1 1 auto; min-height: 0; background: #000; }
.op-gallery.is-fs .op-media-pane { width: 100%; height: 100%; }
.op-gallery.is-fs .op-media-pane > img,
.op-gallery.is-fs #op-main-img { width: 100%; height: 100%; max-height: none; min-height: 0; aspect-ratio: auto; object-fit: contain; background: #000; }
.op-gallery.is-fs .op-media-frame { width: 100%; height: 100%; min-height: 0; aspect-ratio: auto; }
.op-gallery.is-fs .op-media-pane[data-pane="map"] #op-map { height: 100%; }
.op-gallery.is-fs .op-gallery-thumbs { flex: 0 0 auto; }
.op-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 40px; height: 40px; border: 0; border-radius: 5px;
    background: rgba(255,255,255,.7); color: #111;
    font-size: 26px; line-height: 1; cursor: pointer; z-index: 3; padding: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.op-nav:hover { background: rgba(255,255,255,.92); }
.op-nav-prev { left: 14px; }
.op-nav-next { right: 14px; }

/* Маленькие кнопки быстрого редактирования (видны залогиненным admin/agent/agency) */
.edit-btns { display: inline-flex; gap: 6px; vertical-align: middle; }
.edit-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border: 1px solid var(--c-border); border-radius: 6px; background: var(--c-surface); color: var(--c-muted); flex: 0 0 auto; }
.edit-btn:hover { border-color: var(--c-primary); color: var(--c-primary); background: #fff; }
.op-counter {
    position: absolute; bottom: 10px; right: 14px; background: rgba(0,0,0,.55);
    color: #fff; font-size: 12px; padding: 3px 10px; border-radius: 5px; z-index: 3;
}
/* Thumbnails — одна строка с горизонтальной прокруткой. */
.op-gallery-thumbs {
    display: flex; gap: 4px; padding: 4px; background: var(--c-surface);
    overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: thin;
}
.op-thumb {
    flex: 0 0 96px; width: 96px; height: 64px; padding: 0; border: 0; cursor: pointer;
    border-radius: 5px; overflow: hidden; opacity: .6; transition: opacity .15s;
    background: #2a2f46;
}
.op-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.op-thumb:hover, .op-thumb.on { opacity: 1; }

/* Cards */
.op-card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px; padding: 22px 24px; margin-top: 16px; }
/* Баннер «Объект в новостройке» — ссылка на страницу новостройки. */
.op-nb-link { padding: 0; overflow: hidden; }
.op-nb-banner { display: flex; align-items: center; gap: 16px; padding: 18px 22px; text-decoration: none; color: var(--c-text); transition: background .15s; }
.op-nb-banner:hover { background: rgba(var(--c-primary-rgb), .06); text-decoration: none; }
.op-nb-ico { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: rgba(var(--c-primary-rgb), .12); color: var(--c-primary); }
.op-nb-txt { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; }
.op-nb-txt small { color: var(--c-muted); font-size: 13px; }
.op-nb-txt strong { font-size: 17px; font-weight: 700; }
.op-nb-arrow { flex: 0 0 auto; font-size: 22px; color: var(--c-primary); }
.op-card-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; border-bottom: 1px solid var(--c-border); margin-bottom: 16px; }
.op-card-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
/* Описания локации — сворачиваемые секции (по умолчанию закрыты). Заголовок = кнопка. */
.op-locdesc-head { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--c-border);
    font: inherit; color: inherit; text-align: left; cursor: pointer; gap: 10px; }
.op-locdesc-head:hover h2 { color: var(--c-primary); }
/* Кликабельна вся панель, а не только заголовок. В закрытом виде — курсор-палец
   на всей площади; в открытом текст можно спокойно выделять. */
.op-locdesc.closed { cursor: pointer; }
.op-locdesc.closed:hover h2 { color: var(--c-primary); }
.op-locdesc-arrow { color: var(--c-muted); transition: transform .15s; }
.op-locdesc.closed .op-locdesc-arrow { transform: rotate(-90deg); }
.op-locdesc.closed .op-locdesc-head { padding-bottom: 0; border-bottom: 0; margin-bottom: 0; }
.op-locdesc.closed .op-desc { display: none; }
/* Сворачиваемая панель общего вида (Documents, Exchange на странице объекта).
   По умолчанию закрыта: разделы длинные и нужны не каждому посетителю.
   В отличие от описаний локации кликом сворачивается только заголовок — внутри
   лежат ссылки на файлы и таблица анкеты, клик по ним панель гасить не должен. */
.op-fold-head { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--c-border);
    font: inherit; color: inherit; text-align: left; cursor: pointer; gap: 10px; }
.op-fold-head:hover h2 { color: var(--c-primary); }
.op-fold-arrow { color: var(--c-muted); transition: transform .15s; }
.op-fold.closed .op-fold-arrow { transform: rotate(-90deg); }
.op-fold.closed .op-fold-head { padding-bottom: 0; border-bottom: 0; margin-bottom: 0; }
.op-fold.closed .op-fold-body { display: none; }
.op-fold-n { color: var(--c-muted); font-weight: 500; }
.op-pid { color: var(--c-muted); font-size: 13px; }
.op-pid strong { color: var(--c-text); }
.op-maps-btn { padding: 7px 14px; font-size: 13px; }

/* Overview */
.op-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 16px; }
/* Ровно 10 параметров — фиксируем 5 колонок (2 ряда по 5). */
.op-overview-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 768px) { .op-overview, .op-overview-5 { grid-template-columns: 1fr 1fr; gap: 12px 14px; } }
.op-ov-type strong { display: block; font-size: 14px; font-weight: 600; }
.op-ov-type small { display: block; color: var(--c-muted); font-size: 12px; margin-top: 4px; }
/* Open Hours — одна строка «иконка + время открытых дверей», над Overview. */
.op-oh-row { display: flex; gap: 10px; align-items: center; }
.op-oh-ico { font-size: 22px; opacity: .85; }
/* Красный — тот же, что у бейджа метки (.oc-label.lb-open_house). */
.op-oh-row strong { font-size: 15px; color: #dc2626; }
.op-ov-stat { display: flex; gap: 10px; align-items: center; }
.op-ov-ico { font-size: 22px; opacity: .85; }
.op-ov-stat strong { display: block; font-size: 14px; }
.op-ov-stat small { display: block; color: var(--c-muted); font-size: 12px; margin-top: 2px; }

.op-desc { color: var(--c-text); font-size: 14px; line-height: 1.7; }
/* Статистика объявления в шапке Overview, слева от Property ID:
   «208 days on BSRealty, 16 views, 0 saves». На узких экранах переносится. */
.op-listing-stats { margin-left: auto; margin-right: 16px; color: var(--c-muted); font-size: 13px; }
@media (max-width: 768px) {
    .op-card-head { flex-wrap: wrap; gap: 4px 10px; }
    .op-listing-stats { margin: 0; flex: 1 1 100%; order: 3; font-size: 12px; }
}

.op-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 32px; }
@media (max-width: 640px) { .op-grid-2 { grid-template-columns: 1fr; } }
.op-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--c-border); font-size: 13px; }
.op-row strong { color: var(--c-text); }
.op-row span { color: var(--c-muted); }

#op-map { height: 320px; border-radius: 5px; overflow: hidden; }

.op-details-box { background: #e8f7fc; border-radius: 5px; padding: 6px 18px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.op-details-box .op-row { display: grid; grid-template-columns: 1fr 1fr; padding: 11px 12px; border-bottom: 1px solid rgba(255,255,255,.6); }
.op-details-box .op-row:last-child { border-bottom: 0; }
.op-details-box .op-row span { text-align: right; color: var(--c-text); }
@media (max-width: 640px) { .op-details-box { grid-template-columns: 1fr; column-gap: 0; } }

.op-features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 24px; }
@media (max-width: 720px) { .op-features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .op-features { grid-template-columns: 1fr; } }
.op-feat-item { color: var(--c-muted); font-size: 14px; }

.op-calc { display: grid; grid-template-columns: 200px 1fr; gap: 32px; align-items: center; padding: 12px 0 24px; }
@media (max-width: 640px) { .op-calc { grid-template-columns: 1fr; } }
.op-calc-summary { text-align: center; padding: 24px; border: 12px solid #ef4444; border-radius: 50%; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.op-calc-monthly { font-size: 22px; font-weight: 700; color: var(--c-text); }
.op-calc-summary small { color: var(--c-muted); font-size: 13px; }
.op-calc-rows { display: flex; flex-direction: column; gap: 8px; }
.op-calc-row { display: grid; grid-template-columns: 16px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--c-border); font-size: 13px; }
.op-calc-row:last-child { border-bottom: 0; }
.op-calc-row strong { font-weight: 600; }
.op-calc-row .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid #cbd5e1; }
.op-calc-row .dot-1 { border-color: #ef4444; }
.op-calc-row .dot-2 { border-color: #2563eb; }
.op-calc-row .dot-3 { border-color: #f59e0b; }
.op-calc-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 18px; padding-top: 18px; border-top: 1px solid var(--c-border); }
@media (max-width: 760px) { .op-calc-form { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .op-calc-form { grid-template-columns: 1fr; } }
.op-calc-fld { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.op-calc-fld span { color: var(--c-text); font-weight: 600; }
.op-calc-fld input,
.op-calc-fld select { border: 1px solid var(--c-border); border-radius: 5px; padding: 9px 12px; font: inherit; background: var(--c-surface, #fff); color: var(--c-text); }
/* Stamp Duty (SDLT) */
.op-sdlt .op-calc-form { grid-template-columns: 220px 1fr; }
@media (max-width: 560px) { .op-sdlt .op-calc-form { grid-template-columns: 1fr; } }
.op-sdlt-types { display: flex; flex-wrap: wrap; gap: 8px; align-self: flex-start; }
.op-sdlt-type { padding: 8px 14px; border: 1px solid var(--c-border); border-radius: 8px; background: var(--c-surface, #fff); color: var(--c-text); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; transition: .15s; }
.op-sdlt-type:hover { border-color: var(--c-primary); color: var(--c-primary); }
.op-sdlt-type.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.op-sdlt-eff { color: var(--c-muted); font-weight: 400; font-size: 13px; }
.op-sdlt tfoot td { border-top: 2px solid var(--c-border); font-size: 15px; }
.op-sdlt-note { margin-top: 10px; font-size: 12px; }

.op-side-card { padding: 18px; }
.op-side > .op-card:first-child { margin-top: 0; }
/* Блок контакта над формой: имя агента/агентства + телефон tel:. */
.op-side-contact { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--c-border); text-align: center; }
.op-side-logo { display: inline-block; margin-bottom: 10px; }
.op-side-logo img { max-height: 46px; max-width: 170px; width: auto; height: auto; object-fit: contain; display: block; }
.op-side-cname { font-weight: 700; font-size: 16px; color: var(--c-text); }
.op-side-csub { font-size: 13px; color: var(--c-muted); margin-top: 2px; }
.op-side-cname a, .op-side-csub a { color: inherit; text-decoration: none; }
.op-side-cname a:hover, .op-side-csub a:hover { color: var(--c-primary); text-decoration: underline; }
.op-side-phone { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 700; font-size: 17px; color: var(--c-primary); text-decoration: none; }
.op-side-phone:hover { text-decoration: underline; }
.op-side-phone .i { display: inline-flex; }
/* Агент + форма в одной панели — разделитель */
.op-side-card .op-agent { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--c-border); }
.op-agent { display: flex; gap: 12px; align-items: center; justify-content: center; }
.op-agent img { width: 46px; height: 46px; border-radius: 5px; object-fit: cover; display: block; }
.op-agent-photo { display: block; flex: 0 0 auto; }
.op-agent-name { display: block; font-weight: 600; font-size: 14px; color: var(--c-text); text-decoration: none; }
.op-agent-photo:hover img, .op-agent-name:hover { opacity: .85; }
.op-agent-name:hover { color: var(--c-primary); }
.op-agent-link { font-size: 13px; color: #2563eb; }
.op-inq { display: flex; flex-direction: column; gap: 10px; }
.op-inq input, .op-inq textarea, .op-inq select {
    border: 1px solid var(--c-border); border-radius: 5px;
    padding: 10px 12px; font: inherit; width: 100%; box-sizing: border-box;
}
.op-inq textarea { resize: vertical; }
.op-inq-tos { font-size: 11px; margin: 4px 0; }
.op-inq-actions { display: flex; gap: 8px; }
.op-inq-actions .btn-primary { background: #16a34a; flex: 1; justify-content: center; }
.op-inq-actions .btn-primary:hover { background: #128a3d; }
.op-inq-actions .btn-primary:disabled { background: #cbd5e1; cursor: not-allowed; }
.op-inq-actions .btn-secondary { flex: 0 0 auto; padding: 10px 18px; }

/* Самодельная капча-слайдер. Пока не сдвинут — красный (сразу видно, что его надо пройти),
   после — зелёный (.done ставят все реализации: _captcha_slider.php, _contact_form.php,
   page_me_sell.php, page_challenge.php, admin/page_login.php, main.js). Ширина ручки 44px
   зашита в их JS (HW) — менять только вместе. */
.cap-slider {
    position: relative; height: 44px; border-radius: 5px; background: #fef2f2;
    border: 1px solid #ef4444; overflow: hidden; user-select: none; touch-action: none;
}
.cap-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 44px; background: rgba(239,68,68,.12); }
.cap-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; color: #dc2626; pointer-events: none; }
.cap-handle {
    position: absolute; left: 0; top: 0; width: 44px; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: #ef4444; color: #fff; cursor: grab; font-size: 20px; font-weight: 700;
    line-height: 1; box-sizing: border-box; padding-bottom: 3px; border-radius: 5px;
}
.cap-handle:active { cursor: grabbing; }
.cap-slider.done { border-color: var(--c-success); }
.cap-slider.done .cap-fill { background: rgba(16,185,129,.15); }
.cap-slider.done .cap-text { color: var(--c-success); font-weight: 600; }
.cap-slider.done .cap-handle { background: var(--c-success); }

/* Per-row colored marker chip used in admin/agent lists */
.mark-chip { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 2px; color: #fff; font-size: 12px; font-weight: bold; box-shadow: 0 0 0 1px rgba(0,0,0,.15); margin-right: 4px; vertical-align: middle; }
/* В списках админки (Objects / Agency / Users / New Buildings) метка-рейтинг — маленькая
   цифра в левом верхнем углу карточки, а не инлайновый чип в потоке (иначе она сдвигает
   превью и текст). .adm-list-item уже position:relative. */
.adm-list-item > .mark-chip {
    position: absolute; top: 4px; left: 4px; width: 18px; height: 18px;
    border-radius: 4px; font-size: 11px; margin: 0; z-index: 1;
}
/* Бейдж в правом верхнем углу карточки списка админки: S/R у объектов, A у агентов. */
.deal-chip {
    position: absolute; top: 4px; right: 6px; z-index: 1;
    width: 18px; height: 18px; border-radius: 4px; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; line-height: 1;
    box-shadow: 0 0 0 1px rgba(0,0,0,.15);
}
.deal-chip.sale  { background: #2563eb; }
.deal-chip.rent  { background: #ea580c; }
.deal-chip.agent { background: #0ea5e9; }
/* Заголовок обрезаем чуть раньше — чтобы длинное имя не уезжало под бейдж. */
.adm-list-item .adm-list-item-name { padding-right: 26px; }
.b-sticky { background: #fde68a; color: #92400e; }
.b-fake   { background: #ede9fe; color: #5b21b6; }
.b-tag    { background: #dbeafe; color: #1e3a8a; }

/* === BSR.locCombo: каскадный кастомный dropdown country→state→county→city === */
.loc-row   { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.loc-row-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 12px; }
.loc-row-5 { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
/* Каждое поле всегда 20% ширины (минус доля gap), не растягивается при скрытии соседей. */
.loc-row-5 > .loc-combo { flex: 0 0 calc(20% - 8px); min-width: 0; }
.loc-combo { position: relative; }
.loc-combo > span { display: block; font-size: 13px; color: var(--c-muted); font-weight: 500; margin-bottom: 4px; }
.loc-combo-btn { position: relative; width: 100%; box-sizing: border-box; padding: 8px 30px 8px 10px; border: 1px solid var(--c-border); border-radius: 5px; font: inherit; background: #fff; text-align: left; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 38px; color: inherit; }
.loc-combo-btn:hover { border-color: #94a3b8; }
.loc-combo-btn.placeholder .loc-combo-text { color: #94a3b8; }
.loc-combo-btn .loc-combo-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loc-combo-btn .loc-combo-caret { color: #64748b; font-size: 11px; }
/* X для очистки прямо в поле (только location). Показываем, когда выбрано значение — вместо стрелки. */
.loc-combo-x { display: none; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
    width: 24px; height: 24px; border-radius: 50%; align-items: center; justify-content: center;
    color: #64748b; font-size: 22px; line-height: 1; cursor: pointer; }
.loc-combo-x:hover { background: #fee2e2; color: #b91c1c; }
.loc-combo-btn.has-value .loc-combo-x { display: inline-flex; }
.loc-combo-btn.has-value .loc-combo-caret { display: none; }
.loc-combo-pop { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 50; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); display: flex; flex-direction: column; max-height: 320px; overflow: hidden; min-width: 200px; }
.loc-combo-pop[hidden] { display: none; }
.loc-combo-search { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 0; border-bottom: 1px solid #e2e8f0; font: inherit; outline: none; }
.loc-combo-clear { background: #f8fafc; border: 0; border-bottom: 1px solid #e2e8f0; padding: 6px 10px; text-align: left; font-size: 12px; color: #64748b; cursor: pointer; }
.loc-combo-clear:hover { background: #fee2e2; color: #b91c1c; }
.loc-combo-list { overflow-y: auto; flex: 1; }
.loc-combo-opt { padding: 7px 10px; cursor: pointer; font-size: 13px; }
.loc-combo-opt:hover { background: #eff6ff; }
.loc-combo-opt.on { background: #dbeafe; font-weight: 600; }
.loc-combo-empty { padding: 12px; color: #94a3b8; font-size: 13px; text-align: center; }

/* === /halfmap — split view map+cards ====================================
   Высота на весь экран минус шапка(~56) + .site-search-bar(~56). */
.halfmap-page { width: 100%; }
.halfmap-wrap { display: flex; height: calc(100vh - 56px - 56px); min-height: 500px; }
.halfmap-map { flex: 1 1 50%; min-width: 0; background: #e6ecf2; position: relative; }
.halfmap-map > #hm-map { width: 100%; height: 100%; }

/* DOM-маркер с ценой (вместо стандартного PinElement). Highlight = .hl при hover карточки справа. */
.hm-pin {
    display: inline-flex; align-items: center; justify-content: center;
    background: #3b82f6; color: #fff;
    padding: 3px 8px; border-radius: 14px;
    font-size: 12px; font-weight: 700; white-space: nowrap;
    border: 2px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,.25);
    transform: translateY(-50%); cursor: pointer;
    transition: transform .12s ease, background .12s, box-shadow .12s;
}
.hm-pin:hover { box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.hm-pin.hl {
    background: #f59e0b !important;
    transform: translateY(-50%) scale(1.35);
    z-index: 1000;
    box-shadow: 0 6px 14px rgba(0,0,0,.35);
}

/* Hover-preview маркера: миниатюра + цена + адрес. Позиционируется JS относительно карты. */
.hm-tip {
    position: absolute; transform: translate(-50%, -100%);
    width: 220px; background: #fff; border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,.22); overflow: hidden;
    pointer-events: none; z-index: 1001;
}
.hm-tip-img { width: 100%; height: 130px; object-fit: cover; display: block; background: #e5e7eb; }
.hm-tip-body { padding: 6px 10px; }
.hm-tip-price { font-weight: 700; font-size: 13px; color: var(--c-primary-dk); }
.hm-tip-title { font-size: 13px; font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tip-sub { font-size: 12px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Search-карта: в подсказке лежит полноценная карточка из грида (_obj_card.php) —
   с каруселью фото, поэтому она кликабельна и «наводима» (pointer-events).
   Адрес и кнопка «Email agent» в подсказке не нужны.
   .below — карточка не помещается над пином, JS показывает её снизу. */
.hm-tip-card { width: 300px; pointer-events: auto; overflow: visible; box-shadow: none; background: transparent; }
.hm-tip.below { transform: translate(-50%, 0); }
/* Телефон: карточка пина по касанию — внизу карты, по центру (см. page_objects.php, TOUCH). */
.hm-tip.is-sheet { top: auto; bottom: 10px; left: 50%; transform: translate(-50%, 0); width: min(300px, calc(100% - 20px)); }
/* Карта на телефоне — полэкрана: карточка пониже, чтобы над ней оставалась видна карта. */
.hm-tip.is-sheet .obj-card-img { aspect-ratio: auto; height: 130px; }
.hm-tip.is-sheet .obj-card-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-tip-card .obj-card { box-shadow: 0 6px 22px rgba(0,0,0,.28); }
.hm-tip-card .obj-card:hover { transform: none; }
.hm-tip-card .obj-card-addr,
.hm-tip-card .oc-email,
.hm-tip-card .oc-brand { display: none; }
/* Плашки агентства нет — метки возвращаются в угол фото. */
.hm-tip-card .obj-card.has-brand .oc-brand ~ .obj-card-link .oc-labels,
.hm-tip-card .obj-card.has-brand .oc-brand ~ .obj-card-img .oc-labels { top: 12px; }
/* Пин новостройки (без цены) — яркий кружок с иконкой здания (контраст к зелёной карте) */
.hm-pin-nb { background: #ef4444; color: #fff; padding: 0; width: 32px; height: 32px; border-radius: 50%; font-size: 16px; border-width: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.hm-pin-nb.hl { background: #f59e0b !important; transform: translateY(-50%) scale(1.4); }
.halfmap-cards { flex: 1 1 50%; min-width: 0; overflow-y: auto; padding: 12px 14px; background: #fff; border-left: 1px solid var(--c-border); }
.halfmap-cards-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 8px; font-size: 13px; }
/* MAP-раскладка: колонка карточек вдвое уже страницы, и заголовок в одной строке
   с контролами (колонки, сортировка, List/MAP) наезжал на них. Выносим заголовок
   отдельной строкой сверху, контролы оставляем прижатыми вправо. */
.halfmap-cards .results-bar { flex-wrap: wrap; justify-content: flex-end; }
.halfmap-cards .results-bar .results-title { flex: 1 1 100%; margin: 0 0 4px; }
.halfmap-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
/* Пикер колонок в Map-режиме (1–2). Только на десктопе — на узких halfmap стекается в 1 колонку. */
@media (min-width: 981px) {
    .halfmap-grid.cols-1 { grid-template-columns: 1fr; }
    .halfmap-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
    /* Map + 1 колонка = List (картинка слева, инфо справа), как без карты. */
    /* Высота панели в 1-колоночном режиме: 190px резало описание посреди строки,
       подняли до 250 и вернули 20px обратно — 3 строки описания влезают. */
    .halfmap-grid.cols-1 .obj-card { height: 230px; }
    .halfmap-grid.cols-1 .obj-card-link { flex-direction: row; height: 100%; }
    .halfmap-grid.cols-1 .obj-card-img { flex: 0 0 240px; width: 240px; height: 100%; aspect-ratio: auto; }
    .halfmap-grid.cols-1 .obj-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
    .halfmap-grid.cols-1 .obj-card-desc { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--c-muted); }
    /* NB-карточка в Map-режиме (<a class="obj-card nb-card">) — тот же List-вид. */
    .halfmap-grid.cols-1 a.nb-card { flex-direction: row; }
    .halfmap-grid.cols-1 a.nb-card .obj-card-img { flex: 0 0 240px; width: 240px; height: 100%; aspect-ratio: auto; }
    .halfmap-grid.cols-1 a.nb-card .obj-card-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
}
@media (max-width: 900px) {
    .halfmap-wrap { flex-direction: column; height: auto; }
    .halfmap-map { flex: 0 0 50vh; height: 50vh; }
    .halfmap-cards { flex: 1 1 auto; max-height: none; border-left: 0; border-top: 1px solid var(--c-border); }
    .halfmap-grid { grid-template-columns: 1fr; }
}

/* Mark picker (admin/agent privately tag objects with one of 10 colors) */
.mark-picker { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.mark-swatch { width: 28px; height: 28px; border: 1px solid #cbd5e1; border-radius: 2px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: bold; color: #fff; text-shadow: 0 0 2px rgba(0,0,0,.5); position: relative; }
.mark-swatch input { position: absolute; opacity: 0; pointer-events: none; }
.mark-swatch.on { box-shadow: 0 0 0 2px #2563eb; }
.mark-swatch:first-child { color: #64748b; text-shadow: none; }

/* === Shared admin patterns: filter panel, pager, list item statuses, ===
   === editor head 2-row, mark picker (head), description block, compact inputs.
   Используется в page_objects, page_users, page_agents, page_agency. */

/* Filter panel: основная строка + опциональная advanced строка */
.obj-filter-panel {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 6px;
    padding: 8px; margin-bottom: 20px;
}
.obj-filter-panel input[type="search"],
.obj-filter-panel input[type="text"],
.obj-filter-panel input[type="number"],
.obj-filter-panel select {
    border: 1px solid var(--c-border); border-radius: 5px;
    padding: 5px 8px; font: inherit; font-size: 13px; background: #fff; color: inherit;
    height: 30px; box-sizing: border-box; transition: .15s;
}
.obj-filter-panel select { padding: 4px 8px; }
.obj-filter-panel input:focus,
.obj-filter-panel select:focus {
    outline: none; border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(var(--c-primary-rgb),.15);
}
.obj-filter-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.obj-filter-row[hidden] { display: none !important; }
.obj-filter-row + .obj-filter-row { margin-top: 8px; }
.obj-filter-row .adm-filter-grow { flex: 0 1 240px; min-width: 140px; }
/* Кнопка Location в фильтрах: высотой как поля (30px), резиновая (заполняет остаток строки), путь с многоточием. */
.flt-loc-btn { flex: 1 1 auto; min-width: 120px; height: 30px; padding: 0 10px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; justify-content: flex-start; gap: 4px; }
/* Автодополнение Agent/Agency (фильтры и редакторы). */
.flt-ac { position: relative; flex: 1 1 240px; min-width: 160px; }
.flt-ac input[type="search"] { width: 100%; box-sizing: border-box; }
.flt-ac-dd { position: absolute; top: 100%; left: 0; right: 0; z-index: 60; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 260px; overflow-y: auto; margin-top: 2px; }
.flt-ac-dd[hidden] { display: none; }
.flt-ac-opt { padding: 7px 10px; cursor: pointer; font-size: 13px; }
.flt-ac-opt:hover { background: #eff6ff; }
/* В редакторе .flt-ac живёт внутри колоночного .adm-field, где flex-basis:240px
   трактуется как ВЫСОТА → огромный пустой провал. Сбрасываем до высоты по контенту. */
#obj-editor .flt-ac, #nb-editor .flt-ac { flex: none; min-width: 0; }

/* Левая ячейка: счётчик сверху + компактный pager снизу (legacy, ещё в payments) */
.obj-filter-left {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    min-width: 100px; padding-right: 8px; border-right: 1px solid #e2e8f0;
}
.obj-count { font-weight: 700; color: #1e293b; font-size: 15px; line-height: 1; text-align: center; }

/* Раскладка профиля агента/агентства: фото слева, основные поля справа 3-в-ряд */
.ag-prof-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 16px; }
.ag-prof-photo { flex: 0 0 160px; }
.ag-prof-photo .logo-dz { width: 160px; height: 160px; }
.ag-prof-fields { flex: 1 1 auto; min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 12px; align-content: start; }
/* Agency profile: первая строка — Status + Verified (во всю ширину, 2 колонки). */
.ag-prof-firstrow { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.ag-prof-group { margin-top: 16px; }
.ag-prof-h { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
/* Read-only бейдж «Blocked» (агентство не может менять заблокированного агента) */
.ag-status-blocked { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 5px; background: #fee2e2; color: #b91c1c; font-size: 12px; font-weight: 600; }
/* Контакты: 4 поля в ряд */
.ag-contacts-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }
/* Languages — компактный мультиселект (несколько строк) */
.ag-langs { height: auto !important; min-height: 84px; padding: 4px !important; }
.ag-langs option { padding: 2px 6px; }
/* Slug под Description — короткое поле */
.ag-slug-field { margin-top: 14px; max-width: 320px; }

/* Languages: мультивыбор на всю ширину; выбранные показаны в input, список — выпадашкой */
.langs-field { display: block; margin-top: 4px; }
.langs-box { position: relative; }
.langs-display { width: 100%; box-sizing: border-box; cursor: pointer; padding-right: 26px !important; }
.langs-caret { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: #64748b; font-size: 11px; pointer-events: none; }
.langs-menu { position: absolute; top: calc(100% + 4px); left: 0; right: auto; z-index: 60; background: #fff; border: 1px solid #cbd5e1; border-radius: 6px; box-shadow: 0 8px 24px rgba(0,0,0,.12); max-height: 240px; overflow: auto; padding: 3px; display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 1px 4px; min-width: 560px; max-width: 92vw; }
.langs-menu[hidden] { display: none; }
.langs-opt { display: flex; align-items: center; gap: 4px; padding: 2px 4px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.langs-opt:hover { background: #f1f5f9; }
.langs-opt input { width: 15px !important; height: 15px !important; flex: 0 0 auto; margin: 0; }
/* Шапка списка языков (заголовок + ✕). Нужна только в мобильном полноэкранном
   режиме — на десктопе выпадашка закрывается кликом мимо. Вставляется из main.js. */
.langs-menu-bar { display: none; grid-column: 1 / -1; position: sticky; top: 0; z-index: 1;
    align-items: center; justify-content: space-between; gap: 10px;
    background: #fff; padding: 12px 4px; border-bottom: 1px solid var(--c-border); }
.langs-menu-title { font-weight: 700; font-size: 16px; }
.langs-menu-done { border: 0; background: #f1f5f9; color: var(--c-text); border-radius: 8px;
    width: 40px; height: 40px; font-size: 20px; line-height: 1; cursor: pointer; flex: none; }
/* Мобильный: список языков (их ~50) не влезает выпадашкой шириной 560px — разворачиваем
   его на весь экран, в 2 колонки, с крупными чекбоксами под палец. */
@media (max-width: 700px) {
    .langs-menu:not([hidden]) {
        position: fixed; inset: 0; z-index: 2000;
        min-width: 0; max-width: none; max-height: none; margin: 0;
        border: 0; border-radius: 0; padding: 0 12px 16px;
        grid-template-columns: 1fr 1fr; gap: 2px 10px;
        align-content: start; overflow: auto;
    }
    .langs-menu:not([hidden]) .langs-menu-bar { display: flex; }
    /* iPhone-приложение (viewport-fit=cover): шапка — ниже часов и выреза, низ списка — выше
       полоски «домой». Шапка липкая (top:0), поэтому отступ сверху — у неё, а не у списка:
       иначе при прокрутке она уезжала бы под строку состояния. В браузере env() = 0. */
    .langs-menu:not([hidden]) { padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px)); }
    .langs-menu:not([hidden]) .langs-menu-bar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
    .langs-menu:not([hidden]) .langs-opt { font-size: 15px; padding: 11px 6px; gap: 10px; }
    .langs-menu:not([hidden]) .langs-opt input { width: 22px !important; height: 22px !important; }
}
/* User-редактор: профиль в 2 ряда по 4 поля */
.usr-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; align-items: start; }
@media (max-width: 900px){ .usr-grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
/* Контакты/соцсети юзера — 5 в ряд, чтобы 9 полей укладывались в 2 строки. */
/* Строка языков в редакторе юзера: разговорные (шире) + язык интерфейса/писем. */
.usr-grid-lang { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; align-items: start; }
.usr-grid-lang > .adm-field { min-width: 0; }
@media (max-width: 800px) { .usr-grid-lang { grid-template-columns: 1fr; } }
.usr-grid-5 { display: grid; grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; align-items: start; }
@media (max-width: 1200px){ .usr-grid-5 { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 800px){  .usr-grid-5 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 600px){  .usr-grid-5 { grid-template-columns: 1fr; } }
/* Фото пользователя слева + поля справа (как в профиле агентства). */
.usr-prof-top { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 4px; }
.usr-prof-top .usr-grid-4 { flex: 1 1 auto; min-width: 0; }
.usr-prof-top .usr-prof-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.usr-prof-firstrow { display: grid; grid-template-columns: 0.8fr 1fr 1fr 1.6fr; gap: 12px; }
@media (max-width: 900px){ .usr-prof-top { flex-direction: column; } .usr-prof-firstrow { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px){ .usr-prof-firstrow { grid-template-columns: 1fr; } }

/* Серая панель раздела кабинета (как .adm-pane в админке). Поля внутри — белые. */
.cab-panel { background: var(--c-adm-panel, #00000009); border: 1px solid var(--c-border); border-radius: 8px; padding: 18px 20px; margin: 0 0 18px; }
.cab-panel input:not([type=checkbox]):not([type=radio]), .cab-panel select, .cab-panel textarea { background: #fff; }

/* Тумблер «email подтверждён» в редакторах админки (иконка справа от поля Email). */
.ed-email-wrap { display: flex; align-items: stretch; gap: 6px; }
.ed-email-wrap input { flex: 1 1 auto; min-width: 0; }
/* Не подтверждён — серая иконка без галочки, подтверждён — зелёная с галочкой. */
.ev-toggle { flex: 0 0 auto; width: 40px; border: 1px solid var(--c-border); border-radius: 8px;
    background: #fff; color: #9ca3af; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: .15s; }
.ev-toggle:hover { border-color: var(--c-primary); color: #6b7280; }
.ev-toggle .ev-tick { display: none; }
.ev-toggle.on { color: #16a34a; border-color: #b7e3c4; background: #f3fbf5; }
.ev-toggle.on .ev-tick { display: inline; }
.ev-toggle.on .ev-ring { display: none; }

/* Описание локации (вкладки по адм. делениям) на странице объекта/новостройки */
.locdesc-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; border-bottom: 1px solid var(--c-border); }
.locdesc-tab { padding: 8px 14px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--c-muted); border-bottom: 2px solid transparent; font-size: 14px; }
.locdesc-tab.on { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.locdesc-pane { display: none; line-height: 1.6; }
.locdesc-pane.on { display: block; }

/* Agency → вкладка KYC: регистрационные поля + документы */
.kyc-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 4px 18px; }
.kyc-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--c-border); font-size: 13px; }
.kyc-k { color: var(--c-muted); font-weight: 600; }
.kyc-v { text-align: right; word-break: break-word; }
.kyc-docs { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.kyc-doc { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 8px; font-size: 13px; background: #fff; }
/* Загруженный документ: вся строка — ссылка, открывается в новой вкладке. Фон белый. */
a.kyc-doc.has { border-color: #b7e3c4; background: #fff; cursor: pointer; text-decoration: none; color: inherit; }
a.kyc-doc.has:hover { background: #f3fbf5; }
.kyc-doc-v { color: var(--c-success, #1a9e4b); word-break: break-word; }
@media (max-width: 760px){ .kyc-grid, .kyc-docs { grid-template-columns: 1fr; } }
/* KYC: сообщение заявителю + Approve */
.kyc-admin-msg { margin: 0 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--c-border); }
.kyc-admin-msg textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--c-border-strong); border-radius: 6px; padding: 8px 10px; font: inherit; min-height: 64px; resize: vertical; background: #fff; }
.kyc-admin-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* Кабинет /me · верх профиля: фото слева; справа ряд Name/Email/Phone + ряд Languages.
   Блок полей тянется по высоте фото, ряды распределяются — низ Languages вровень с низом фото. */
.me-prof-top { display: flex; gap: 16px; align-items: stretch; }
.me-prof-top .ag-prof-photo { flex: 0 0 auto; }
.me-prof-fields { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; }
.me-prof-row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
/* Языки разговора (мультивыбор) + один язык интерфейса/писем — в одну строку. */
.me-prof-row2 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; align-items: start; }
.me-prof-row2 > .adm-field { min-width: 0; }
.me-prof-fields .langs-field { min-width: 0; }
@media (max-width: 720px){
    .me-prof-top { flex-direction: column; align-items: stretch; }
    .me-prof-row3, .me-prof-row2 { grid-template-columns: 1fr; }
}

/* Work regions: каждый регион — белая панель во всю ширину редактора */
.ag-regions-list { display: flex; flex-direction: column; gap: 6px; }
.ag-region-panel {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    width: 100%; box-sizing: border-box;
    background: #fff; border: 1px solid var(--c-border); border-radius: 8px;
    padding: 8px 12px; font-size: 13px;
}
.ag-region-del {
    flex: 0 0 auto; width: 24px; height: 24px; line-height: 1; cursor: pointer;
    border: 1px solid var(--c-border); background: #fff; color: #ef4444; border-radius: 5px;
}
.ag-region-del:hover { background: #fee2e2; border-color: #fecaca; }

/* VIP: первые 4 поля в один ряд */
.vip-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }
/* Поле с кнопкой «открыть ссылку» справа (YouTube video, Video, 3D tour) */
.field-with-btn { display: flex; gap: 6px; align-items: stretch; }
.field-with-btn input { flex: 1 1 auto; min-width: 0; }
.open-link-btn { flex: 0 0 auto; width: 34px; border: 1px solid var(--c-border); background: #fff; border-radius: 5px; cursor: pointer; color: #475569; font-size: 15px; line-height: 1; }
.open-link-btn:hover { background: #f1f5f9; color: #0f172a; border-color: #94a3b8; }

/* Тонкая строка над списком: счётчик слева, pager справа — одна линия, минимум места.
   Кладётся первым ребёнком в .adm-pane (списочную колонку), список скроллит под ней. */
.obj-listbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 4px 8px; margin-bottom: 6px; flex: 0 0 auto;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 6px;
}
.obj-listbar .obj-count { font-size: 14px; text-align: left; white-space: nowrap; }

/* Очень компактный pager */
.obj-pager { display: flex; gap: 1px; align-items: center; }
.pager-btn {
    width: 18px; height: 18px; padding: 0; border: 1px solid var(--c-border-strong);
    background: #e2e8f0; border-radius: 3px; cursor: pointer; font-size: 9px; line-height: 1; color: #1e293b;
}
.pager-btn:hover:not(:disabled) { background: #cbd5e1; color: #0f172a; }
.pager-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pager-select { height: 18px; padding: 0 2px; border: 1px solid var(--c-border-strong); border-radius: 3px; font-size: 11px; min-width: 32px; max-width: 50px; background: #e2e8f0; color: #1e293b; }

/* Цветные карточки списка по статусу + выбранная карточка */
.adm-list-item { position: relative; }
.adm-list-item.st-approved { background: #dcfce7; border-left: 3px solid #16a34a; }
.adm-list-item.st-pending  { background: #fef9c3; border-left: 3px solid #ca8a04; }
.adm-list-item.st-disabled { background: #e5e7eb; border-left: 3px solid #6b7280; }
.adm-list-item.st-blocked  { background: #fee2e2; border-left: 3px solid #dc2626; }
.adm-list-item.on { box-shadow: inset 0 0 0 2px #2563eb; color: inherit !important; }
.adm-list-item.on.st-approved { background: #dcfce7 !important; color: inherit !important; }
.adm-list-item.on.st-pending  { background: #fef9c3 !important; color: inherit !important; }
.adm-list-item.on.st-disabled { background: #e5e7eb !important; color: inherit !important; }
.adm-list-item.on.st-blocked  { background: #fee2e2 !important; color: inherit !important; }
.adm-list-item.on .adm-list-item-sub { color: var(--c-muted) !important; }

/* Editor empty-state */
.obj-ed-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 80px 20px; color: var(--c-muted); }
.obj-ed-empty p { margin: 0; }

/* Квадратный image-dropzone (лого агентства / фото агента): картинка внутри,
   hover — затемнение с белым текстом. JS: BSR.imageDropzone(el). */
.logo-dz {
    position: relative; width: 160px; height: 160px;
    border: 1px solid var(--c-border-strong); border-radius: 5px;
    background: #fff; color: #64748b; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; text-align: center; font-size: 12px;
    /* Только hover-свойства. Раньше стоял transition: .15s (= all), и когда JS
       подгонял ширину до квадрата (inline width), рамка вместе с картинкой внутри
       (width/height: 100%) плавно СЪЕЗЖАЛА с 160px до нужной — выглядело так,
       будто лого при смене агентства сначала больше и потом уменьшается. */
    transition: border-color .15s, background-color .15s, color .15s;
}
.logo-dz:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.logo-dz.drag  { border-color: #2563eb; background: #dbeafe; }
.logo-dz input[type=file] { display: none; }
.logo-dz img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.logo-dz-hint { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; line-height: 1.4; }
/* Глобальный .adm-field span красит span'ы в muted — внутри хинта наследуем цвет dz */
.logo-dz-hint span { color: inherit; font-weight: inherit; font-size: inherit; }
/* Правила загрузки (форматы/размеры/вес) — мелкой строкой под «Drag & drop».
   Пишем их всегда, а не только в тексте ошибки: понятно до выбора файла. */
.logo-dz-rule { font-size: 11px !important; line-height: 1.35; opacity: .8; max-width: 100%; }
.join-file .logo-dz-rule { color: var(--c-muted); }
/* Картинка уже есть: хинт скрыт; при hover — затемнение с белым (#FFFFFF) текстом */
.logo-dz.has-img .logo-dz-hint,
.logo-dz.has-img .logo-dz-hint span { color: #FFFFFF; }
.logo-dz.has-img .logo-dz-hint {
    position: absolute; inset: 0; opacity: 0; transition: opacity .15s;
    background: rgba(15, 23, 42, .78);
    font-size: 13px; font-weight: 600;
    align-items: center; justify-content: center;
}
.logo-dz.has-img:hover .logo-dz-hint { opacity: 1; }

/* Drag-n-drop file upload (3D tour, фото агента, лого агентства). JS: BSR.dropzone(el). */
.adm-dz {
    display: flex; align-items: center; gap: 8px;
    height: 30px; box-sizing: border-box; padding: 4px 10px;
    border: 1.5px dashed #cbd5e1; border-radius: 5px;
    background: #f8fafc; color: #64748b; font-size: 12px;
    cursor: pointer; transition: .15s; overflow: hidden;
}
.adm-dz:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.adm-dz.drag  { border-color: #2563eb; background: #dbeafe; color: #1e40af; }
.adm-dz.has-file { border-style: solid; border-color: #16a34a; color: #166534; background: #f0fdf4; }
.adm-dz input[type=file] { display: none; }
.adm-dz-icon { font-size: 15px; line-height: 1; }
.adm-dz-file { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-dz-cur { font-size: 11px; color: #16a34a; margin-left: 6px; }

/* Editor head: 2 ряда (info + actions) */
/* Шапка редактора + вкладки закреплены при прокрутке. Отрицательные поля перекрывают
   padding .adm-editor (20px), чтобы содержимое не выглядывало по краям; фон — как у
   панели (полупрозрачный серый поверх белого). top ставит JS в _objects_manager.php. */
.obj-ed-pin { position: sticky; top: 0; z-index: 30; margin: -20px -20px 0; padding: 20px 20px 0;
    background: #f6f6f6; box-shadow: 0 6px 10px -8px rgba(0,0,0,.25); }
.obj-ed-head { display: flex; flex-direction: column; gap: 8px; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--c-border-strong); }
.obj-ed-row1 { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.obj-ed-addr { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 600; flex: 1 1 auto; min-width: 0; color: #0f172a; }
.obj-ed-id { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #e0e7ff; color: #1e3a8a; font-size: 13px; font-weight: 700; margin-right: 8px; vertical-align: middle; }
.obj-ed-id.muted { background: #f1f5f9; color: #94a3b8; font-weight: 500; }
.obj-ed-meta { font-size: 13px; color: #475569; flex: 0 0 auto; }
.obj-ed-meta strong { color: #1e3a8a; font-weight: 600; }
.obj-ed-meta-muted { color: #94a3b8; font-style: italic; font-weight: normal; }
.obj-ed-pid { font-size: 12px; color: #64748b; }
.obj-ed-pid strong { color: #1e293b; font-weight: 600; }
.obj-ed-row2 { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.obj-ed-actions { display: flex; align-items: center; gap: 8px; }
.obj-ed-actions.left  { margin-right: auto; }
.obj-ed-actions.right { margin-left: auto; }
.obj-ed-iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--c-border); color: var(--c-text); background: #fff; }
.obj-ed-iconbtn:hover { background: #f3f4f6; }
/* Delete (×) — боксовая кнопка-иконка с бордюром, как соседние (★/+/👁). */
.obj-ed-del { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; border: 1px solid var(--c-border); background: #fff; color: #ef4444; font-size: 20px; line-height: 1; cursor: pointer; padding: 0; }
.obj-ed-del:hover { background: #fee2e2; color: #b91c1c; border-color: #fecaca; }
/* Save в шапке редактора — зелёная, высотой как соседние иконки-кнопки (32px). */
.obj-ed-save { display: inline-flex; align-items: center; justify-content: center; height: 32px; padding: 0 16px; background: #16a34a; border: 1px solid #16a34a; color: #fff; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; }
.obj-ed-save:hover { background: #15803d; border-color: #15803d; }
.obj-ed-add { font-size: 22px; line-height: 1; font-weight: bold; color: #16a34a; border-color: #16a34a; }
.obj-ed-add:hover { background: #dcfce7; }
/* R — заполнить форму случайными данными (Objects / Agency / Users). */
.obj-ed-rnd { background: #fef3c7; border-color: #f59e0b; color: #92400e; font-weight: 700; padding: 0; text-align: center; cursor: pointer; }
.obj-ed-rnd:hover { background: #fde68a; }
.obj-ed-sticky { font-size: 18px; line-height: 1; color: #94a3b8; cursor: pointer; user-select: none; transition: .12s; }
.obj-ed-sticky input { position: absolute; opacity: 0; pointer-events: none; width: 0; height: 0; }
.obj-ed-sticky.on { background: #2563eb; color: #fff; border-color: #2563eb; opacity: 0.8; }
.obj-ed-sticky.on:hover { opacity: 1; }
.obj-ed-sticky:hover:not(.on) { background: #f1f5f9; color: #2563eb; }

/* Mark picker для шапки редактора (без label) — увеличенные swatch'и */
.mark-picker-head { display: inline-flex; flex-wrap: nowrap; gap: 4px; padding: 0; }
.mark-picker-head .mark-swatch { width: 32px !important; height: 32px !important; min-width: 32px; border-radius: 2px; font-size: 13px; border-width: 1.5px; padding: 0; flex: 0 0 auto; }
.mark-picker-head .mark-swatch.on { box-shadow: 0 0 0 2px #2563eb; }

/* Description: лейбл слева, маленький select справа */
.desc-label-row { display: flex !important; flex-direction: row !important; justify-content: space-between; align-items: center; gap: 12px; }
.desc-block { margin-top: 18px; }
.desc-area { width: 100%; box-sizing: border-box; }
.adm-editor-compact .desc-lang-select,
#obj-editor .desc-lang-select,
#pf-desc-lang {
    border: 1px solid var(--c-border); border-radius: 4px;
    padding: 2px 6px; font-size: 12px; background: #fff; color: inherit;
    height: 26px; box-sizing: border-box;
    width: auto !important; min-width: 0; max-width: 80px; flex: 0 0 auto;
    cursor: pointer; text-transform: uppercase;
}
.adm-editor-compact .desc-lang-select:focus,
#obj-editor .desc-lang-select:focus,
#pf-desc-lang:focus {
    outline: none; border-color: var(--c-primary);
    box-shadow: 0 0 0 2px rgba(var(--c-primary-rgb),.15);
}

/* Comments row: 50/50 */
.row-comments { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.row-comments textarea { width: 100%; box-sizing: border-box; resize: vertical; }

/* Compact inputs внутри редактора (.adm-editor-compact) — те же что в #obj-editor */
.adm-editor-compact input,
.adm-editor-compact select,
.adm-editor-compact textarea { width: 100%; box-sizing: border-box; min-width: 0; }
.adm-editor-compact .adm-field { gap: 3px; min-width: 0; }
.adm-editor-compact .adm-field span { font-size: 12px; }
.adm-editor-compact .adm-field input,
.adm-editor-compact .adm-field select,
.adm-editor-compact .adm-field textarea { padding: 5px 8px; height: 30px; font-size: 13px; }
.adm-editor-compact .adm-field textarea { height: auto; min-height: 50px; padding: 6px 8px; }
.adm-editor-compact .adm-field select { padding: 4px 8px; }
.adm-editor-compact .mark-swatch { flex: 0 0 auto; }

/* ===== ADMIN: TEMPLATES EDITOR ============================================ */
.tpl-grid { display: grid; grid-template-columns: 25% 1fr; gap: 16px; align-items: start; }
/* min-width:auto у грид-элементов даёт распор от широкого содержимого (вкладки языков,
   тулбар редактора) — колонка вылезает за сетку. Разрешаем ей сжиматься. */
.tpl-grid > * { min-width: 0; }
.tpl-sidebar { background: transparent; }
/* Плоский список без разделов: каждый элемент в бордюре, между ними промежуток. */
.tpl-list { display: flex; flex-direction: column; gap: 8px; }
.tpl-item { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left;
    padding: 10px 12px; border: 1px solid var(--c-border); border-radius: 6px;
    background: #dcfce7; cursor: pointer; width: 100%; transition: border-color .12s, box-shadow .12s; }
.tpl-item:hover { border-color: var(--c-primary); }
.tpl-item.on { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary) inset; background: #dcfce7; }
/* Заголовок группы в списке пакетов (Agency / Promotions). */
.pk-group-h { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
    color: var(--c-muted); padding: 6px 2px 2px; }
.pk-group-h:not(:first-child) { margin-top: 8px; border-top: 1px solid var(--c-border); padding-top: 10px; }
.tpl-item-title { font-weight: 600; font-size: 14px; color: var(--c-text); }
.tpl-item-kind { display: inline-block; font-size: 10px; text-transform: uppercase; letter-spacing: .04em;
    font-weight: 700; color: #fff; background: var(--c-primary); border-radius: 3px; padding: 1px 5px; margin-right: 2px; vertical-align: middle; }
/* Page-тип — другой цвет бейджа (синий), Email остаётся на --c-primary */
.tpl-item-kind--page { background: #6366f1; }
/* Редактируемый slug страницы + help-список блок-шорткодов */
.tpl-slug-inp { font-family: ui-monospace, monospace; font-size: 12px; height: 38px; box-sizing: border-box; padding: 0 10px; border: 1px solid var(--c-border); border-radius: 6px; max-width: 240px; }
.tpl-sc-help { margin-top: 12px; padding: 10px 12px; border: 1px solid var(--c-border); border-radius: 8px; background: #f8fafc; }
.tpl-sc-row { display: flex; align-items: center; gap: 10px; padding: 3px 0; font-size: 12.5px; }
.tpl-sc-desc { color: var(--c-muted); }
.tpl-item code { font-size: 11px; color: var(--c-muted); }

.tpl-editor { background: var(--c-adm-panel, #00000009); border: 1px solid var(--c-border); border-radius: 6px; padding: 20px; }
/* Banks: .bank-panel — это панель, красим как панель. Отступ между элементами списков. */
body.adm .bank-panel { background: var(--c-adm-panel); border: 1px solid var(--c-border); border-radius: 6px; }
body.adm #pk-editor.tpl-editor { padding: 6px; }   /* Packages-редактор компактнее */
body.adm #pk-list .tpl-item, body.adm #pk-list .tpl-item.on { background: #fff; }  /* Packages-список — белый */
/* Белый фон для списков агентов и платежей в редакторах (на сером фоне панели). */
body.adm .agc-agent-row { background: #fff; }
body.adm .up-block, body.adm .up-pkg, body.adm .up-table { background: #fff; }
body.adm .adm-pane-body .adm-list-item { margin-bottom: 6px; }
.tpl-ed-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.tpl-title-inp { flex: 1; height: 38px; box-sizing: border-box; border: 1px solid var(--c-border); border-radius: 5px; padding: 0 10px; font: inherit; font-weight: 600; }
.tpl-ed-head .btn-primary { height: 38px; padding: 0 16px; box-sizing: border-box; }
.tpl-slug { color: var(--c-muted); font-size: 12px; white-space: nowrap; }
/* PACKAGES — карточки в магазине профиля */
/* Пакеты: каждый на всю ширину. Слева контент (заголовок+цена+active until, ниже описание),
   справа — кнопка BUY. */
.pk-store { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.pk-card { background: #fff; border: 1px solid var(--c-border); border-radius: 8px; padding: 16px; display: flex; align-items: center; gap: 18px; }
.pk-card-active { border-color: #16a34a; box-shadow: 0 0 0 1px #16a34a inset; }
.pk-card-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.pk-card-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.pk-card-head h3 { margin: 0; font-size: 17px; }
.pk-card-price { font-size: 20px; font-weight: 700; color: var(--c-primary); white-space: nowrap; }
.pk-card-price small { font-size: 12px; color: var(--c-muted); font-weight: 500; }
.pk-card-desc { color: var(--c-text); font-size: 13px; line-height: 1.5; margin: 0; }
.pk-card-side { flex: 0 0 auto; }
.pk-card-badge { color: #16a34a; font-size: 13px; font-weight: 600; }
/* Мобайл: карточка пакета стекается, кнопка покупки — снизу во всю ширину */
@media (max-width: 768px) {
    .pk-card { flex-direction: column; align-items: stretch; }
    .pk-card-side { width: 100%; }
    /* текст по центру: у .btn-primary контент выровнен по левому краю,
       а на всю ширину это заметно. */
    .pk-card-side .pk-buy-btn { width: 100%; justify-content: center; text-align: center; }
}

/* Buy popup */
.pk-buy-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 9000; }
.pk-buy-overlay[hidden] { display: none; }
.pk-buy-modal { position: relative; background: #fff; border-radius: 10px; padding: 24px; width: 420px; max-width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.pk-buy-modal h3 { margin: 0 0 10px; }
.pk-buy-close { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--c-border); background: #fff; cursor: pointer; }
/* Итог покупки — крупно и по центру, под ним срок в месяцах. */
.pk-buy-total { display: flex; flex-direction: column; align-items: center; gap: 2px; margin: 16px 0 4px; }
.pk-buy-sum { font-size: 30px; font-weight: 800; line-height: 1.1; color: var(--c-text); }
.pk-buy-per { font-size: 13px; color: var(--c-muted); }
.pk-buy-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; }

/* PACKAGES — 5 input полей в одну линию + чекбоксы аудитории */
/* Packages: шапка редактора в 1 ряд (название слева, X+Save справа) */
.pk-ed-head { display: flex; flex-direction: row; align-items: center; gap: 12px; }
.pk-ed-head .obj-ed-actions { margin-left: auto; }
.pk-row5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.pk-row5 .adm-field input, .pk-row5 .adm-field select { width: 100%; }
.pk-audience { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 12px; padding: 10px 12px;
    background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 5px; }
.pk-audience-label { font-weight: 600; color: var(--c-muted); font-size: 13px; }
.pk-aud { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; font-size: 14px; }
.pk-aud input { margin: 0; }

/* PAYMENTS layout (список ~30% / редактор ~70%) + пресеты дат */
.pay-layout { grid-template-columns: 38% 1fr; }
.pay-presets { display: inline-flex; gap: 4px; }
.pay-preset {
    border: 1px solid var(--c-border-strong); background: #fff; border-radius: 5px;
    padding: 6px 10px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; color: var(--c-text);
    height: 30px; line-height: 1; display: inline-flex; align-items: center; box-sizing: border-box;
}
.pay-preset:hover { border-color: var(--c-primary); }
.pay-preset.on { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
/* Total справа от фильтра — отжимаем к правому краю строки */
.pay-filter-row .pay-sum { margin-left: auto; }
.pay-sum { font-weight: 700; color: var(--c-text); font-size: 14px; white-space: nowrap; }
/* Поля дат фильтра — визуально как кнопки-пресеты (высота/рамка/радиус/паддинг) */
.obj-filter-panel input.pay-date {
    height: 30px; padding: 0 10px; border: 1px solid var(--c-border-strong); border-radius: 5px;
    background: #fff; font: inherit; font-size: 13px; font-weight: 500; color: var(--c-text);
    box-sizing: border-box; cursor: pointer; flex: 0 0 auto;
}
.obj-filter-panel input.pay-date:hover { border-color: var(--c-primary); }
/* Селекты фильтра — компактная фиксированная ширина (не растягиваются на всю строку) */
.obj-filter-panel select.pay-filter-select { flex: 0 0 auto; width: 170px; height: 30px; }
/* Кнопка локации в фильтре платежей — компактная (не тянем во всю строку, как в Objects) */
.pay-filter-row .flt-loc-btn { flex: 0 1 auto; max-width: 240px; }
.pay-item .adm-list-item-name { font-size: 14px; }
.pay-item .adm-list-item-sub  { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
/* Субъект платежа (read-only): имя+email со ссылкой / название агентства */
.pay-subject { display: flex; flex-direction: column; gap: 2px; padding: 6px 0; }
.pay-subject-link { font-size: 15px; font-weight: 600; color: var(--c-accent, #004274); text-decoration: none; }
.pay-subject-link:hover { text-decoration: underline; }
.pay-subject-email { font-size: 13px; color: var(--c-muted); text-decoration: none; }
.pay-subject-email:hover { text-decoration: underline; }

/* Блок Packages & Payments внутри редактора юзера/агента/агентства */
.up-block { margin-top: 18px; border: 1px solid var(--c-border); border-radius: 6px; padding: 12px; background: #fafbfc; }
.up-block h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--c-muted); }
.up-active { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.up-active-chip { background: #16a34a; color: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 600; }
/* Платежи кабинета — панелями: пакет, подпись, даты, сумма. Таблица из шести колонок
   на телефоне читалась только горизонтальной прокруткой. */
.pay-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pay-card { position: relative; border: 1px solid var(--c-border); border-radius: 8px;
    padding: 12px 130px 12px 14px; background: #fff; }
/* Две строки: сверху название с подписью, снизу даты. Сумма — справа, у обеих строк. */
.pay-card-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.pay-card-title { font-weight: 700; font-size: 15px; }
.pay-card-note { font-size: 13px; color: var(--c-muted); }
.pay-card-dates { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; font-size: 13px; }
.pay-card-lbl { color: var(--c-muted); }
.pay-card-amount { position: absolute; top: 12px; right: 14px; font-size: 16px; white-space: nowrap; }
/* Списание по кредиту — отдельный вид: это не покупка пакета. */
.pay-card-credit { background: var(--c-bg-soft, #f8fafc); }
@media (max-width: 600px) {
    .pay-card { padding-right: 106px; }
    .pay-card-amount { font-size: 15px; }
}
.up-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.up-table th, .up-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--c-border); }
.up-table th { color: var(--c-muted); font-weight: 600; font-size: 11px; text-transform: uppercase; }
/* Таблица платежей на узких экранах: горизонтальный скролл вместо сжатия колонок (даты не переносятся) */
.up-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
    .up-table { min-width: 520px; }
    .up-table td, .up-table th { white-space: nowrap; }
    /* В шапке теперь два числа (баланс кредита + итог) — на телефоне переносим их под заголовок. */
    .up-head { flex-wrap: wrap; }
    .up-total { white-space: normal; }
}
.up-empty { color: var(--c-muted); font-size: 13px; padding: 6px 0; }

/* Заголовок блока пакетов/платежей: title слева, действие/итого справа */
.up-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.up-head h3 { margin: 0; }
.up-total { font-size: 13px; font-weight: 700; color: #16a34a; white-space: nowrap; }
.up-add-btn { padding: 4px 10px; font-size: 12px; }
/* Фильтры платежей в кабинете (read-only просмотр + история). */
.pay-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.pay-filter { padding: 7px 10px; border: 1px solid var(--c-border); border-radius: 6px; font: inherit; background: var(--c-surface); cursor: pointer; }
.pay-filter:hover { border-color: var(--c-primary); }
/* Операции по кредиту в ленте платежей кабинета (пополнения, бонусы, промо, начисления
   админом). Отличаются от строк за пакеты: описание под названием операции и баланс
   после неё под суммой. */
.up-credit { color: var(--c-text); font-weight: 600; margin-right: 12px; }
.up-credit strong { color: #16a34a; }
.pay-row-credit td:first-child { color: var(--c-muted, #6b7280); }
.pay-note, .pay-bal { display: block; font-weight: 400; font-size: 11px; line-height: 1.3; }
.up-table .pay-bal { color: var(--c-muted, #6b7280); }

/* Активные пакеты — панельками со скруглением (вместо «чипов») */
.up-active { flex-direction: column; }
.up-pkg { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 1px solid var(--c-border); border-radius: 6px; background: #fff; }
.up-pkg-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.up-pkg-title { font-weight: 600; font-size: 13px; }
.up-pkg-valid { color: var(--c-muted); font-size: 12px; }
.up-pkg-del { background: #fee2e2; color: #b91c1c; border: none; border-radius: 5px; padding: 4px 10px; font-size: 12px; cursor: pointer; }
.up-pkg-del:hover { background: #fecaca; }

/* Popup добавления пакета: список пакетов, у каждого — кол-во месяцев + Add */
.up-add-list { display: flex; flex-direction: column; gap: 8px; padding: 10px; }
.up-add-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 6px; }
.up-add-name { flex: 1; font-size: 13px; font-weight: 600; min-width: 0; }
.up-add-months { font-size: 12px; color: var(--c-muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.up-add-months input { width: 56px; padding: 4px 6px; border: 1px solid var(--c-border); border-radius: 5px; font: inherit; font-size: 13px; }
.up-add-agent { flex: 0 0 auto; max-width: 160px; padding: 4px 6px; border: 1px solid var(--c-border); border-radius: 5px; font: inherit; font-size: 12px; background: #fff; }
.up-add-do { padding: 5px 12px; font-size: 12px; white-space: nowrap; }

.tpl-subject-wrap { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.tpl-subject-wrap[hidden] { display: none; }   /* Email Subject — только для email-шаблонов */
.tpl-subject-wrap span { font-size: 12px; color: var(--c-muted); font-weight: 600; }
.tpl-subject-wrap input { border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit; }

/* Quill rich editor (взят из jeepstein) + переключатель HTML-исходника */
.tpl-editor-wrap { display: flex; flex-direction: column; }
/* display:flex перебивает [hidden] — возвращаем скрытие (блочный режим прячет обычный редактор). */
.tpl-editor-wrap[hidden] { display: none; }

/* Многоблочные страницы Templates (Property management): вкладки блоков + слоты. */
.tpl-blocks-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.tpl-block-tab { position: relative; min-width: 34px; height: 30px; padding: 0 8px;
    border: 1px solid var(--c-border); border-radius: 6px; background: var(--c-bg);
    color: var(--c-muted); font-weight: 600; font-size: 13px; cursor: pointer; }
.tpl-block-tab:hover { background: var(--c-bg-hover); }
.tpl-block-tab.on { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
/* Зелёная точка — в блоке есть контент хотя бы на одном языке. */
.tpl-block-tab.filled::after { content: ''; position: absolute; top: 4px; right: 4px;
    width: 6px; height: 6px; border-radius: 50%; background: #22c55e; }
.tpl-block-slot { display: none; }
.tpl-block-slot.on { display: block; }
.tpl-block-title { width: 100%; margin-bottom: 8px; padding: 8px 10px; font: inherit;
    border: 1px solid var(--c-border); border-radius: 6px; }
.tpl-html-toggle { align-self: flex-end; margin-bottom: 6px; border: 1px solid var(--c-border); background: #fff;
    border-radius: 4px; padding: 4px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.tpl-html-toggle:hover { background: var(--c-bg); }
.tpl-html-toggle.on { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
#tpl-editor-host, #an-editor-host { background: #fff; }
#tpl-editor-host .ql-container, #an-editor-host .ql-container { min-height: 340px; font-size: 14px; border-bottom-left-radius: 5px; border-bottom-right-radius: 5px; }
#tpl-editor-host .ql-editor, #an-editor-host .ql-editor { min-height: 340px; line-height: 1.55; }
#tpl-editor-host .ql-toolbar, #an-editor-host .ql-toolbar { border-top-left-radius: 5px; border-top-right-radius: 5px; }

/* ===== ADMIN: ANALYSIS ==================================================== */
.an-grid { display: grid; grid-template-columns: 20% 1fr; gap: 16px; align-items: start; }
.an-panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 6px; padding: 16px; }
.an-panel .bank-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.an-panel .bank-panel-head h2 { margin: 0; font-size: 18px; }
@media (max-width: 900px) { .an-grid { grid-template-columns: 1fr; } }

/* Вывод Quill-HTML анализа на странице объекта (списки/выравнивание) */
.op-analysis .ql-align-center  { text-align: center; }
.op-analysis .ql-align-right   { text-align: right; }
.op-analysis .ql-align-justify { text-align: justify; }
.op-analysis ol { list-style: none; padding-left: 1.5em; counter-reset: ql-num; }
.op-analysis li[data-list="bullet"] { list-style: none; }
.op-analysis li[data-list="bullet"]::before { content: '•'; display: inline-block; width: 1em; margin-left: -1em; }
.op-analysis li[data-list="ordered"] { counter-increment: ql-num; }
.op-analysis li[data-list="ordered"]::before { content: counter(ql-num) '. '; display: inline-block; width: 1.4em; margin-left: -1.4em; }
.tpl-html-source { width: 100%; min-height: 380px; border: 1px solid var(--c-border); border-radius: 5px;
    padding: 12px; font-family: monospace; font-size: 13px; line-height: 1.5; resize: vertical; }

.tpl-sc { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 12px 0 0; }
.tpl-sc-lbl { font-size: 12px; color: var(--c-muted); font-weight: 600; }
.tpl-sc-btn { border: 1px dashed var(--c-primary); color: var(--c-primary); background: rgba(var(--c-primary-rgb),.04); border-radius: 4px; padding: 3px 8px; font-size: 12px; font-family: monospace; cursor: pointer; }
.tpl-sc-btn:hover { background: var(--c-primary); color: #fff; }

/* ===== ADMIN: BANKS ======================================================= */
/* Ссылка на таблицу Google Sheets в шапке страницы: длинная, но места мало —
   даём ей фиксированную ширину и мелкий шрифт, полный адрес виден в подсказке. */
.bank-sheet-url { width: 260px; border: 1px solid var(--c-border); border-radius: 5px;
                  padding: 7px 10px; font: inherit; font-size: 12px; color: var(--c-muted); }
.bank-sheet-url:focus { color: var(--c-text); }
@media (max-width: 900px) { .bank-sheet-url { display: none; } }
.bank-grid { display: grid; grid-template-columns: 25% 1fr; gap: 16px; align-items: start; }
.bank-countries { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 6px; overflow: hidden; max-height: 70vh; overflow-y: auto; }
.bank-country { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
    text-align: left; padding: 8px 12px; border: 0; border-left: 3px solid transparent; background: none; cursor: pointer; font: inherit; }
.bank-country:hover { background: rgba(var(--c-primary-rgb),.05); }
.bank-country.on { background: rgba(var(--c-primary-rgb),.08); border-left-color: var(--c-primary); font-weight: 600; }
.bank-cc { font-size: 11px; color: var(--c-muted); background: var(--c-bg); border-radius: 10px; padding: 1px 8px; min-width: 22px; text-align: center; }
.bank-country.on .bank-cc { background: var(--c-primary); color: #fff; }

.bank-panel { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 6px; padding: 16px; }
.bank-panel-head h2 { margin: 0 0 12px; font-size: 18px; }
.bank-rows { display: flex; flex-direction: column; gap: 8px; }
.bank-row { display: flex; align-items: center; gap: 10px; }
.bank-row .bank-name { flex: 1; border: 1px solid var(--c-border); border-radius: 5px; padding: 7px 10px; font: inherit; }
/* Ссылка на подачу заявки: непусто → на странице объекта у банка кнопка «Подать заявку». */
.bank-row .bank-link { flex: 1.4; min-width: 0; border: 1px solid var(--c-border); border-radius: 5px; padding: 7px 10px; font: inherit; font-size: 13px; }
.bank-rate-wrap { display: flex; align-items: center; gap: 4px; }
.bank-rate-wrap input { width: 80px; border: 1px solid var(--c-border); border-radius: 5px; padding: 7px 8px; font: inherit; text-align: right; }
.bank-save { border: 1px solid var(--c-primary); color: var(--c-primary); background: #fff; border-radius: 5px; padding: 7px 12px; cursor: pointer; }
.bank-save:hover { background: var(--c-primary); color: #fff; }
.bank-del { border: 1px solid var(--c-border); background: #fff; color: var(--c-muted); border-radius: 5px; width: 32px; height: 32px; cursor: pointer; }
.bank-del:hover { border-color: #ef4444; color: #ef4444; }
/* On/off переключатель */
.bank-toggle { position: relative; display: inline-block; width: 38px; height: 22px; flex: 0 0 auto; cursor: pointer; }
.bank-toggle input { opacity: 0; width: 0; height: 0; }
.bank-toggle span { position: absolute; inset: 0; background: #cbd5e1; border-radius: 22px; transition: background .15s; }
.bank-toggle span::before { content: ''; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; transition: transform .15s; }
.bank-toggle input:checked + span { background: var(--c-success, #10b981); }
.bank-toggle input:checked + span::before { transform: translateX(16px); }
.bank-add { display: flex; gap: 10px; align-items: center; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--c-border); }
.bank-add input[type="text"] { flex: 1; border: 1px solid var(--c-border); border-radius: 5px; padding: 8px 10px; font: inherit; }
.bank-add input[type="number"] { width: 90px; border: 1px solid var(--c-border); border-radius: 5px; padding: 8px; font: inherit; text-align: right; }

/* ===== КРЕДИТ АГЕНТСТВА (кабинет + админка) и PROMO объектов ============== */
/* Отступ от заголовка страницы: у h1 в кабинете margin: 0, и блок кредита упирался в него. */
.cr-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 20px; }
.cr-top-label { font-size: 13px; color: var(--c-muted); }
.cr-top-value { font-size: 30px; font-weight: 800; color: var(--c-text); }
.cr-topup { display: flex; align-items: center; gap: 8px; }
.cr-topup input { width: 120px; height: 38px; border: 1px solid var(--c-border); border-radius: 6px; padding: 0 10px; font: inherit; text-align: right; }
.cr-hint { margin: 6px 0 18px; font-size: 13px; }
/* На телефоне блок кредита переносится в колонку: сумма и поле пополнения жались
   к левому краю и читались как обрывок строки — центрируем всё вместе. */
@media (max-width: 768px) {
    .cr-top { flex-direction: column; justify-content: center; text-align: center; gap: 12px; margin-top: 26px; }
    .cr-topup { justify-content: center; }
}
.cr-paid-ok { color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.cr-hist-title { font-size: 16px; margin: 18px 0 10px; }
.cr-log { display: flex; flex-direction: column; }
.cr-row { display: grid; grid-template-columns: 130px 90px 1fr 110px 110px; gap: 10px; align-items: center;
    padding: 8px 0; border-bottom: 1px solid var(--c-border); font-size: 13px; }
.cr-date, .cr-kind { color: var(--c-muted); }
.cr-note-txt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-delta { text-align: right; font-weight: 700; }
.cr-delta.plus  { color: #16a34a; }
.cr-delta.minus { color: #dc2626; }
.cr-bal { text-align: right; color: var(--c-muted); }
.cr-balance { font-size: 20px; font-weight: 800; }
.cr-form { display: flex; gap: 8px; align-items: center; margin: 12px 0 16px; flex-wrap: wrap; }
.cr-form input { height: 34px; border: 1px solid var(--c-border); border-radius: 6px; padding: 0 10px; font: inherit; }
.cr-form .cr-amount { width: 130px; text-align: right; }
.cr-form .cr-note { flex: 1 1 200px; min-width: 0; }
@media (max-width: 700px) { .cr-row { grid-template-columns: 1fr auto; } .cr-date, .cr-kind { display: none; } }

/* История цены на странице объекта: снижение — зелёным, рост — красным. */
.ph-diff { font-weight: 700; }
.ph-diff.down { color: #16a34a; }
.ph-diff.up   { color: #dc2626; }

/* Payments: бейдж вида операции (package / topup / admin / promo) в общей ленте. */
.pay-kind { display: inline-block; padding: 1px 7px; border-radius: 10px; background: var(--c-bg);
    color: var(--c-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; margin-right: 6px; }
.pay-credit { cursor: default; }

/* Promotions объекта (вкладка Promotions в редакторе).
   Строка компактная: слева название + статус + пояснение, справа в одну линию цена дня,
   число дней, итог и кнопка. Действующая услуга — светло-зелёная строка. */
.promo-balance { font-size: 14px; margin-bottom: 12px; }
.promo-card { border: 1px solid var(--c-border); border-radius: 8px; padding: 9px 14px; margin-bottom: 8px; background: #fff; }
.promo-card.on { background: #f0fdf4; border-color: #86efac; }
.promo-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.promo-info { flex: 1 1 300px; min-width: 0; }
.promo-head { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.promo-active { color: #166534; background: #dcfce7; border: 1px solid #86efac; border-radius: 20px;
    padding: 1px 9px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.promo-off { font-size: 12px; }
.promo-hint { margin: 2px 0 0; font-size: 12px; line-height: 1.4; }
.promo-buy { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.promo-price { font-size: 12px; color: var(--c-muted); white-space: nowrap; }
/* «Days N» в одну строку — подпись слева от поля, а не над ним. */
.promo-days { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--c-muted); }
.promo-days .promo-days-inp { width: 62px; height: 32px; padding: 0 6px; text-align: center;
    border: 1px solid var(--c-border); border-radius: 6px; font: inherit; font-size: 13px; }
.promo-total { font-size: 16px; font-weight: 800; min-width: 84px; text-align: right; white-space: nowrap; }
.promo-buy .btn-primary { height: 32px; padding: 0 16px; }
.promo-buy .hw-toggle { margin: 0; }
@media (max-width: 760px) {
    /* Телефон: в одну линию цена дня + число дней + итог не помещаются вместе
       с кнопкой (поле Days сжималось в полоску) — Buy и галка уезжают
       на свою строку во всю ширину карточки. */
    .promo-buy { flex: 1 1 100%; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
    /* Цена за день + Days + итог — всегда одной строкой: итог тянется
       по остатку, а не требует своих 84px и не уроняет себя на следующую. */
    .promo-buy .promo-price { flex: 0 1 auto; }
    .promo-buy .promo-days { flex: 0 0 auto; }
    .promo-buy .promo-total { flex: 1 1 auto; min-width: 0; font-size: 15px; }
    .promo-buy .btn-primary { flex: 1 1 100%; height: 40px; justify-content: center; }
    .promo-buy .hw-toggle { flex: 1 1 100%; justify-content: center; }
    .promo-days .promo-days-inp { width: 60px; height: 36px; }
}

/* ===== AUCTION ============================================================ */
/* Вкладка Auction в редакторе объекта: сводка сверху, поля торгов, история ставок. */
.auc-sum { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: 14px;
    border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 14px; margin-bottom: 14px; background: #fff; }
.auc-sum.is-live { background: #f0fdf4; border-color: #86efac; }
.auc-sum.is-end  { background: #f8fafc; }
.auc-badge { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    border-radius: 20px; padding: 2px 10px; background: #e2e8f0; color: #334155; }
.auc-sum.is-live .auc-badge { background: #dcfce7; color: #166534; }
/* Пересчёт в евро под суммой в валюте объекта: внутри платформы всё в евро. */
.auc-eur { display: block; margin-top: 3px; font-size: 12px; color: var(--c-muted); min-height: 15px; }
/* Даты торгов на вкладке Auction — только для чтения: их задаёт покупка услуги. */
.auc-fixed { display: block; padding: 9px 0 0; font-size: 15px; }
/* Попап покупки аукциона: даты От/До, под ними дни и сумма. */
.auc-buy-dates { display: flex; flex-wrap: wrap; gap: 14px; margin: 14px 0 6px; }
.auc-buy-dates .adm-field { flex: 1 1 180px; }
.auc-buy-sum { margin: 6px 0 14px; font-size: 15px; }
.auc-buy-act { display: flex; justify-content: flex-end; }
/* Резерв в сводке вкладки Auction: взят — зелёным, не взят — предупреждением. */
.auc-res { color: #b45309; font-weight: 600; }
.auc-res.ok { color: #166534; }
.auc-note { margin: 4px 0 0; font-size: 12px; }
.auc-actions { margin-top: 14px; }
.auc-h { margin: 24px 0 8px; font-size: 15px; }
.auc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.auc-table th, .auc-table td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--c-border); text-align: left; }
.auc-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); font-weight: 700; }
.auc-table td b { font-variant-numeric: tabular-nums; }
/* Верхняя строка — действующая (лидирующая) ставка. */
.auc-table tr.auc-top td { background: #f0fdf4; padding-left: 6px; }
/* Таблица ставок: две колонки — кто и сколько. Контакты и время — мелкой
   второй строкой в своей ячейке, чтобы таблица осталась узкой. */
.auc-bids td { padding: 6px 12px 6px 0; }
.auc-bids .auc-u { display: block; font-weight: 600; }
.auc-bids .auc-c { display: block; font-size: 11px; color: var(--c-muted); }
.auc-bids .auc-b { text-align: right; white-space: nowrap; }
.auc-bids .auc-b b { font-size: 14px; font-variant-numeric: tabular-nums; }
/* Ручное управление ставками — только в главной админке (кнопки рисует MGR_ADMIN). */
.auc-bids-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.auc-bids-tools .auc-c { font-size: 12px; color: var(--c-muted); }
.auc-bids .auc-bid-act { width: 1%; white-space: nowrap; text-align: right; }
.auc-bid-ed, .auc-bid-rm {
    border: 1px solid var(--c-border); background: #fff; color: var(--c-muted);
    width: 26px; height: 26px; border-radius: 6px; cursor: pointer; font-size: 13px; line-height: 1;
}
.auc-bid-ed:hover { border-color: var(--c-primary); color: var(--c-primary); }
.auc-bid-rm:hover { border-color: #dc2626; color: #dc2626; }
/* Попап ставки: e-mail участника + сумма. */
.auc-bp-ov { position: fixed; inset: 0; z-index: 1200; background: rgba(15,23,42,.45);
    display: flex; align-items: center; justify-content: center; padding: 20px; }
.auc-bp { width: min(420px, 100%); background: var(--c-surface); border-radius: 10px;
    box-shadow: var(--shadow-3); padding: 20px; }
.auc-bp-h { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.auc-bp .adm-field { display: block; margin-bottom: 12px; }
.auc-bp .adm-field > span { display: block; font-size: 12px; color: var(--c-muted); margin-bottom: 4px; }
.auc-bp .adm-field input { width: 100%; border: 1px solid var(--c-border); border-radius: 6px;
    padding: 8px 10px; font: inherit; box-sizing: border-box; }
.auc-bp-f { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
/* Идут торги — вкладка только для чтения. Пояснения под полями нет, поэтому
   недоступность должна читаться глазами: гасим поля и их подписи. */
#obj-editor .auc-wrap input:disabled,
#obj-editor .auc-wrap textarea:disabled {
    background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; cursor: not-allowed;
    -webkit-text-fill-color: #94a3b8; opacity: 1;   /* Safari гасит текст по-своему */
}
#obj-editor .auc-wrap[data-locked="1"] .adm-field > span,
#obj-editor .auc-wrap[data-locked="1"] .desc-label-row > span { color: #94a3b8; }

/* Панель аукциона на странице объявления — НА МЕСТЕ ЦЕНЫ, широкой строкой под
   заголовком. Имён участников тут нет: человеку важно, его ставка лидирует или нет. */
.op-auction { width: 100%; margin: 6px 0 4px; border: 1px solid var(--c-border);
    border-radius: 10px; padding: 14px 16px; background: #fff; }
.op-auction.is-live { border-color: #bbf7d0; background: #f7fdf9; }
.op-auction.is-ended { background: #f8fafc; }
.op-auc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.op-auc-tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800;
    text-transform: uppercase; letter-spacing: .06em; color: #dc2626; }
.op-auc-state { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
    border-radius: 20px; padding: 2px 10px; background: #e2e8f0; color: #334155; white-space: nowrap; }
.op-auction.is-live .op-auc-state { background: #dcfce7; color: #166534; }
.op-auction.is-ended .op-auc-state { background: #fee2e2; color: #991b1b; }
.op-auc-terms { margin-left: auto; font-size: 13px; }
/* Три суммы в ряд: стартовая цена, шаг, последняя ставка. */
.op-auc-nums { display: flex; flex-wrap: wrap; gap: 10px 28px; }
.op-auc-num { display: flex; flex-direction: column; gap: 2px; }
.op-auc-num span { font-size: 12px; color: var(--c-muted); }
.op-auc-num b { font-size: 20px; font-weight: 800; line-height: 1.15; }
.op-auc-num-now b { font-size: 26px; }
.op-auc-lead { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; }
.op-auc-lead .ok { color: #166534; font-weight: 700; }
.op-auc-lead .other { color: #b45309; font-weight: 600; }
.op-auc-bids { color: var(--c-muted); font-size: 13px; }
.op-auc-time { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px; font-size: 13px; color: var(--c-muted); }
.op-auc-time b { color: var(--c-text, #111); font-weight: 700; }
.op-auc-left { font-weight: 700; color: #b91c1c; }
.op-auc-form { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.op-auc-form input { height: 42px; padding: 0 12px; border: 1px solid var(--c-border);
    border-radius: 6px; font: inherit; min-width: 190px; }
.op-auc-form button { height: 42px; }
.op-auc-dep { margin: 10px 0 0; font-size: 12px; color: var(--c-muted); }
.op-auc-msg { font-size: 13px; margin-top: 8px; min-height: 18px; }
.op-auc-msg.err { color: #b91c1c; }
.op-auc-msg.ok  { color: #166534; }
/* Согласие с условиями: галочка + ссылка, открывающая попап. */
.op-auc-agree { display: flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.35; margin: 0; flex: 1 1 220px; }
.op-auc-agree input { margin-top: 2px; flex: none; width: 16px; height: 16px; }
/* Попап условий аукциона — поверх страницы, закрывается кликом мимо и Esc. */
.op-auc-modal { position: fixed; inset: 0; z-index: 4000; background: rgba(15,23,42,.55);
    display: flex; align-items: center; justify-content: center; padding: 20px; }
.op-auc-modal[hidden] { display: none; }
.op-auc-modal-box { position: relative; background: #fff; border-radius: 10px; padding: 24px 26px;
    max-width: 640px; width: 100%; max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.op-auc-modal-box h3 { margin: 0 0 12px; font-size: 19px; }
.op-auc-modal-body { font-size: 14px; line-height: 1.55; }
.op-auc-modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none;
    font-size: 26px; line-height: 1; cursor: pointer; color: var(--c-muted); }
.op-auc-modal-x:hover { color: #111; }
/* ── Витрина /auctions: та же панель, но СБОКУ от карточки лота ──────────────────
   Карточка с панелью — грид: шапка бренда во всю ширину, ниже слева ссылка (фото +
   инфо), справа торги. Панель стоит рядом со ссылкой, а не внутри неё (форма внутри
   <a> невалидна), поэтому колонки задаём областями. Витрина живёт только в List-виде:
   в узкой колонке панели не поместиться. */
.auctions-page .obj-grid.cols-1 { max-width: 1280px; }
@media (min-width: 981px) {
    .auctions-page .obj-grid.cols-1 .obj-card.has-aucbox {
        display: grid; height: auto; min-height: 260px;
        grid-template-columns: minmax(0, 1fr) 400px;
        grid-template-areas: "brand brand" "main side";
    }
    .auctions-page .obj-grid.cols-1 .obj-card.has-aucbox .oc-brand { grid-area: brand; }
    .auctions-page .obj-grid.cols-1 .obj-card.has-aucbox .obj-card-link { grid-area: main; min-width: 0; }
    .auctions-page .obj-grid.cols-1 .obj-card.has-aucbox .op-auction { grid-area: side; }
    /* Фото лота — квадрат 260×260 и БЕЗ пустоты снизу: min-height задаёт сторону
       квадрата (и тянет за собой высоту строки), а height: 100% растягивает фото,
       если панель торгов вдруг окажется выше. Панель на витрине без формы ставки,
       поэтому обычно карточка ровно в квадрат и есть. */
    .auctions-page .obj-grid.cols-1 .obj-card.has-aucbox .obj-card-img {
        flex: 0 0 260px; width: 260px; height: 100%; min-height: 260px; aspect-ratio: auto;
        border-radius: 14px 0 0 14px;
    }
    .auctions-page .obj-grid.cols-1 .obj-card.has-aucbox .obj-card-desc { -webkit-line-clamp: 2; }
}
/* Панель внутри карточки: без своей рамки — она часть карточки. Внешние (правые) углы
   скругляет сама: у карточки с логотипом агентства overflow: visible (плитка логотипа
   выступает за край), и квадратный угол панели съедал бы уголок красной promo-рамки. */
.op-auction.is-card { margin: 0; border: 0; border-left: 1px solid var(--c-border);
    border-radius: 0 14px 14px 0; padding: 14px 16px; }
.op-auction.is-card .op-auc-nums { gap: 8px 18px; }
.op-auction.is-card .op-auc-num b { font-size: 17px; }
.op-auction.is-card .op-auc-num-now b { font-size: 21px; }
.op-auction.is-card .op-auc-lead { margin-top: 8px; font-size: 13px; }
.op-auction.is-card .op-auc-time { margin-top: 6px; gap: 4px 14px; font-size: 12px; }
.op-auction.is-card .op-auc-form { margin-top: 10px; gap: 8px; }
/* Только поля ввода: галочка согласия — тоже input, её размер трогать нельзя. */
.op-auction.is-card .op-auc-form input[type="number"],
.op-auction.is-card .op-auc-form input[type="tel"] { height: 38px; min-width: 120px; flex: 1 1 120px; }
.op-auction.is-card .op-auc-form button { height: 38px; }
/* Согласие — своей строкой под полем ставки, а не растянутое рядом с ним. */
.op-auction.is-card .op-auc-agree { flex: 1 1 100%; gap: 6px; }
.op-auction.is-card .op-auc-dep { margin-top: 8px; }
.op-auction.is-card .op-auc-msg { margin-top: 6px; min-height: 0; }
/* На узком экране панель уезжает ПОД карточку — разделитель должен стать верхним. */
@media (max-width: 980px) {
    .op-auction.is-card { border-left: 0; border-top: 1px solid var(--c-border); border-radius: 0 0 14px 14px; }
}
/* Статус — бейдж (админка, кабинет юзера, список участников). */
.auc-st { display: inline-block; border-radius: 20px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.auc-st-held { background: #fef3c7; color: #92400e; }   /* торги идут, депозит заморожен */
.auc-st-done { background: #e2e8f0; color: #334155; }   /* торги закончились */
.auc-st-won  { background: #dcfce7; color: #166534; }   /* победа */
.auc-st-req  { background: #fef3c7; color: #92400e; }   /* запрошен возврат депозита */
/* Карточка депозита юзера в админке (вкладка Auction). */
.uauc-dep { border: 1px solid var(--c-border); border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; background: #fff; }
.uauc-dep-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* Поле «депозит» — админ вписывает пришедший перевод, сохраняется общим Save юзера. */
.uauc-dep-edit { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.uauc-dep-edit > span { color: var(--c-muted); font-size: 12px; }
.uauc-dep-edit input { width: 160px; border: 1px solid var(--c-border); border-radius: 6px; padding: 6px 9px; font: inherit; }
.uauc-dep-sum span:first-child { color: var(--c-muted); font-size: 12px; }
.uauc-dep-sum b { font-size: 20px; font-weight: 800; }
.uauc-dep-lim { margin: 6px 0 10px; font-size: 13px; color: var(--c-muted); }
.uauc-dep-lim b { color: var(--c-text, #111); }

/* ===== OBJECT PAGE: MORTGAGE BANK ROWS ==================================== */
.op-banks { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 14px; }
.op-banks th, .op-banks td { padding: 9px 10px; border-bottom: 1px solid var(--c-border); text-align: left; }
.op-banks th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--c-muted); font-weight: 700; }
.op-banks-num { text-align: right; white-space: nowrap; }
/* Кнопка «Подать заявку» — только у банков с заполненной ссылкой (Banks → Link). */
.op-banks-act { text-align: right; white-space: nowrap; width: 1%; }
.op-bank-apply {
    display: inline-block; padding: 6px 14px; border-radius: 6px;
    background: var(--c-primary); color: #fff; font-size: 13px; font-weight: 600;
    text-decoration: none; white-space: nowrap;
}
.op-bank-apply:hover { background: var(--c-primary-dk); color: #fff; text-decoration: none; }
/* nowrap нужен только числам в ячейках («207 415 €» не рвать), а вот длинные
   заголовки («Monthly Mortgage Payment») обязаны переноситься — иначе они
   распирают таблицу на ~480px и она не влезает в мобильный экран. */
.op-banks thead th { white-space: normal; }
.op-bank-name { font-weight: 600; }
.op-bank-total { font-weight: 700; color: var(--c-primary); }
.op-banks tbody tr:last-child td { border-bottom: 0; }
.op-banks-empty { margin-top: 12px; }
/* Страховка: если таблица всё же шире контейнера (длинные имена банков, другой
   язык) — горизонтальная прокрутка внутри карточки, а не разъезжание страницы. */
.op-tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 460px) {
    .op-banks { font-size: 13px; }
    .op-banks th, .op-banks td { padding: 8px 5px; }
    .op-banks th { font-size: 10px; letter-spacing: 0; }
    .op-banks td:first-child, .op-banks th:first-child { padding-left: 0; }
    .op-banks td:last-child, .op-banks th:last-child { padding-right: 0; }
}

@media (max-width: 900px) {
    .tpl-grid, .bank-grid { grid-template-columns: 1fr; }
}

/* Поддержка вывода Quill-редактора на публичных info-страницах (списки/выравнивание) */
.info-page .ql-align-center  { text-align: center; }
.info-page .ql-align-right   { text-align: right; }
.info-page .ql-align-justify { text-align: justify; }
/* Нумерацию обычного <ol> (так пишет нынешний редактор, TinyMCE) рисует браузер;
   у разметки Quill (li[data-list]) номера идут из счётчика ниже, там список гасим. */
.info-page ol { list-style: decimal; padding-left: 1.5em; counter-reset: ql-num; }
.info-page li[data-list] { list-style: none; }
.info-page li[data-list="bullet"] { list-style: none; }
.info-page li[data-list="bullet"]::before { content: '•'; display: inline-block; width: 1em; margin-left: -1em; }
.info-page li[data-list="ordered"] { counter-increment: ql-num; }
.info-page li[data-list="ordered"]::before { content: counter(ql-num) '. '; display: inline-block; width: 1.4em; margin-left: -1.4em; }

/* === Картинки по категориям (objects + new buildings): sidebar категорий слева + грид === */
.nb-img-wrap { display: flex; gap: 16px; align-items: flex-start; }
.nb-floor-side { flex: 0 0 200px; display: flex; flex-direction: column; gap: 4px; }
.nb-floor { position: relative; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 6px; cursor: pointer; font-size: 13px; background: var(--c-surface); }
.nb-floor.on { border-color: var(--c-primary); background: #fff7ed; font-weight: 600; }
.nb-floor.drag-over { border-color: var(--c-primary); background: #ffedd5; }
.nb-floor-n { float: right; color: var(--c-muted); font-weight: 400; }
.nb-floor-del { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); display: none; border: none; background: #fee2e2; color: #b91c1c; border-radius: 4px; width: 18px; height: 18px; line-height: 1; cursor: pointer; }
.nb-floor:hover .nb-floor-del { display: block; }

/* Категории объектов: грип для перетаскивания + имя + счётчик + rename/del */
.nb-floor.cat-row { display: flex; align-items: center; gap: 6px; padding-right: 8px; }
.nb-floor.cat-row .cat-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-floor.cat-row .nb-floor-n { float: none; flex: 0 0 auto; }
.nb-floor.cat-row .nb-floor-del { position: static; transform: none; display: inline-flex; align-items: center; justify-content: center; }
.cat-grip { flex: 0 0 auto; cursor: grab; color: #94a3b8; font-size: 13px; user-select: none; letter-spacing: -2px; }
.nb-floor.dragging { opacity: .5; }
.cat-act { flex: 0 0 auto; border: none; background: transparent; cursor: pointer; color: #94a3b8; font-size: 13px; padding: 2px 5px; border-radius: 4px; line-height: 1; }
.cat-act:hover { background: #e2e8f0; color: #0f172a; }
.cat-act.nb-floor-del { background: #fee2e2; color: #b91c1c; width: 20px; height: 20px; }
.cat-act.nb-floor-del:hover { background: #fecaca; }
.gpk-modal .cat-input { width: 100%; box-sizing: border-box; padding: 8px 10px; border: 1px solid var(--c-border); border-radius: 6px; font: inherit; }
/* Полоска-индикатор места вставки при реордере категорий */
.nb-floor.cat-drop-line { box-shadow: inset 0 3px 0 var(--c-primary); }
/* Drag-n-drop зона = вся галерея (грид с фото + подсказка снизу) */
.img-dz { border: 2px dashed var(--c-border); border-radius: 8px; padding: 12px; background: #fff; cursor: pointer; transition: border-color .15s, background .15s; min-height: 200px; }
.img-dz:hover { border-color: #cbd5e1; }
.img-dz.drag-over { border-color: var(--c-primary); background: #ffedd5; }
.img-dz .img-grid { margin-bottom: 0; }
.img-dz-hint { text-align: center; color: var(--c-muted); padding: 14px 8px 2px; font-size: 13px; }
/* Индикатор загрузки картинок. [hidden] прописан явно: авторский display:flex
   перебивает браузерное правило [hidden]{display:none}. */
.img-dz-prog { display: flex; align-items: center; gap: 10px; padding: 8px 8px 2px; }
.img-dz-prog[hidden] { display: none; }
.img-dz-prog-track { flex: 1 1 auto; height: 6px; border-radius: 3px; background: var(--c-bg); overflow: hidden; }
.img-dz-prog-bar { height: 100%; width: 0; background: var(--c-primary); transition: width .15s linear; }
.img-dz-prog-txt { flex: 0 0 auto; font-size: 12px; color: var(--c-muted); white-space: nowrap; }
.img-dz-hint small { color: var(--c-muted); }
.img-dz-ico { font-size: 16px; }
/* Галерея картинок (общая для objects и new buildings — движок BSR.ImgCats) */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.img-tile { position: relative; aspect-ratio: 3/2; border-radius: var(--r-md); overflow: hidden; border: 2px solid var(--c-border); background: #f1f5f9; }
.img-tile.is-main { border-color: var(--c-primary); }
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-main-badge { position: absolute; top: 4px; left: 4px; background: var(--c-primary); color: #fff; font-size: 11px; line-height: 1; padding: 3px 6px; border-radius: 4px; pointer-events: none; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.img-remove { position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border: none; border-radius: 4px; background: rgba(220,38,38,.92); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; }
.img-tile:hover .img-remove { opacity: 1; }
/* Индикатор места вставки при перетаскивании картинки (куда встанет) */
.img-tile.tile-drop { box-shadow: inset 5px 0 0 var(--c-primary), 0 0 0 2px var(--c-primary); }
.nb-img-main { flex: 1; min-width: 0; }
.nb-img-main .img-tile { cursor: grab; }
/* Плитка с инлайн-редактором тега: картинка сверху, поле тега + Save + Delete снизу. */
.img-tile.has-foot { aspect-ratio: auto; overflow: visible; border-radius: var(--r-md); }
.img-tile.has-foot > img { aspect-ratio: 3/2; height: auto; border-radius: var(--r-md) var(--r-md) 0 0; }
.img-tile-foot { display: flex; gap: 4px; align-items: center; padding: 6px; background: #fff; border-radius: 0 0 var(--r-md) var(--r-md); }
.img-tile-foot .img-tag { flex: 1 1 auto; min-width: 0; padding: 5px 7px; border: 1px solid var(--c-border); border-radius: 5px; font: inherit; font-size: 13px; }
.img-tile-foot .img-tag:focus { outline: none; border-color: var(--c-primary); }
/* Поле тега — <select> (выбор тега + Save = перенос картинки без drag&drop). */
.img-tile-foot select.img-tag { background: #fff; cursor: pointer; height: 30px; }
/* Save — белая с зелёной рамкой (заливка была сплошной зелёной и перетягивала внимание). */
/* Тег сохраняется сразу при выборе (img-cats.js saveTag): зелёная рамка — сохранено, красная — ошибка. */
.img-tile-foot select.img-tag { transition: border-color .3s, box-shadow .3s; }
.img-tile-foot select.img-tag.is-ok { border-color: #16a34a; box-shadow: 0 0 0 2px rgba(22,163,74,.25); }
.img-tile-foot select.img-tag.is-err { border-color: #dc2626; box-shadow: 0 0 0 2px rgba(220,38,38,.25); }
.img-tile-foot .img-remove { position: static; opacity: 1; width: 28px; height: 28px; flex: 0 0 auto; background: #fff; border: 1px solid var(--c-border); color: #dc2626; font-size: 15px; }
.img-tile-foot .img-remove:hover { background: #fef2f2; border-color: #dc2626; }

/* Images — плоская вкладка без сайдбара (на всю ширину) */
.nb-img-flat { width: 100%; }

/* Documents — плитки-файлы (иконка + имя + удалить). Общие для Objects и New Buildings. */
.doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.doc-tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 10px 10px; border: 1px solid var(--c-border); border-radius: 8px; background: #fff; cursor: grab; }
.doc-tile.tile-drop { box-shadow: inset 5px 0 0 var(--c-primary), 0 0 0 2px var(--c-primary); }
.doc-ico { display: flex; align-items: center; justify-content: center; width: 56px; height: 64px; border-radius: 6px; background: #fef2f2; color: #dc2626; text-decoration: none; border: 1px solid #fecaca; }
.doc-ext { font-size: 13px; font-weight: 800; letter-spacing: .5px; }
.doc-name { font-size: 12px; color: #334155; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.doc-remove { position: absolute; top: 4px; right: 4px; }

/* Videos — список ссылок с порядком. Общие для Objects и New Buildings. */
.vid-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 5px; }
.vid-row { display: flex; align-items: center; gap: 6px; }
.vid-idx { flex: 0 0 22px; text-align: center; font-size: 12px; color: #94a3b8; }
.vid-url { flex: 1 1 auto; min-width: 0; padding: 6px 8px; height: 32px; border: 1px solid var(--c-border); border-radius: 5px; font-size: 13px; box-sizing: border-box; }
.vid-btn { flex: 0 0 auto; width: 30px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--c-border); background: #fff; border-radius: 5px; cursor: pointer; font-size: 13px; color: #475569; text-decoration: none; }
.vid-btn:hover:not(:disabled) { background: #f1f5f9; }
/* Предпросмотр видео в админке: окно поверх всего, плеер 16:9. */
.vid-pv { position: fixed; inset: 0; z-index: 3000; background: rgba(15,23,42,.75); display: flex; align-items: center; justify-content: center; padding: 16px; }
.vid-pv-box { position: relative; width: min(960px, 100%); aspect-ratio: 16 / 9; background: #000; border-radius: 8px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.vid-pv-box iframe, .vid-pv-box video { width: 100%; height: 100%; border: 0; border-radius: 8px; display: block; }
.vid-pv-x { position: absolute; top: -14px; right: -14px; width: 32px; height: 32px; border: 0; border-radius: 50%; background: #fff; color: #111; font-size: 20px; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.4); z-index: 1; }
.vid-pv-none { height: 100%; display: flex; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; word-break: break-all; text-align: center; }
.vid-pv-none a { color: #fff; }
.vid-btn:disabled { opacity: 1; background: #fff; color: #cbd5e1; cursor: default; }
.vid-del { color: #ef4444; border-color: #fecaca; }
.vid-del:hover { background: #fee2e2; }
.vid-add-row { display: flex; gap: 6px; margin-top: 0; margin-bottom: 12px; }
.vid-add-row input { flex: 1 1 auto; min-width: 0; padding: 6px 8px; height: 34px; border: 1px solid var(--c-border); border-radius: 5px; box-sizing: border-box; }
.vid-add-btn { flex: 0 0 auto; width: 34px; height: 34px; padding: 0; font-size: 20px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }

/* Shortcode-блоки на редактируемых страницах (главная) */
/* Контент главной (текст редактора ИЛИ витрина агентства/страны) — той же фиксированной
   ширины, что и страница объекта (.op-page, 1280px). Общий .container сейчас во всю
   ширину окна, из-за чего на широких экранах блок растягивался. */
.home-editable { padding: 28px 24px; max-width: 1280px; margin-left: auto; margin-right: auto; }
/* Витрина (Templates → Home, режим агентства/страны) — во всю ширину экрана. */
.home-editable.home-showcase { max-width: none; }

/* Sell — ряды формы */
.sell-row-addr { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin-bottom: 8px; }
@media (max-width: 760px) { .sell-row-addr { grid-template-columns: 1fr; } }
.sell-grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 8px; }
@media (max-width: 980px) { .sell-grid5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .sell-grid5 { grid-template-columns: repeat(2, 1fr); } }
/* адресное поле: позиционный контекст для выпадашки автоподстановки */
.adm-field.loc-addr { position: relative; }
.loc-ac-dd { position: absolute; top: 100%; left: 0; right: 0; z-index: 40; margin-top: 2px;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 6px;
    box-shadow: var(--shadow-2); max-height: 260px; overflow-y: auto; }
.loc-ac-opt { padding: 8px 10px; cursor: pointer; font-size: 14px; }
.loc-ac-opt:hover { background: var(--c-bg); }

/* Sell — фото: превью + drag-n-drop зона без фона */
.sell-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin: 4px 0 10px; }
.sell-imgs:empty { display: none; }
.sell-thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; border: 1px solid var(--c-border); }
.sell-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sell-thumb .sl-rm { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: 0;
    border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: 16px;
    line-height: 1; display: flex; align-items: center; justify-content: center; }
.sell-drop { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
    padding: 30px 20px; border: 2px dashed var(--c-border-strong); border-radius: 10px; background: none;
    color: var(--c-muted); cursor: pointer; text-align: center; transition: border-color .15s, color .15s; }
.sell-drop:hover, .sell-drop.drag { border-color: var(--c-primary); color: var(--c-primary); }
.sell-drop.full { display: none; }
.sell-drop .sd-text { font-size: 14px; }

/* Sell — блок регистрации/входа гостя (как на странице signin/signup) */
.sell-auth { max-width: 460px; margin: 22px auto 0; padding: 24px; border: 1px solid var(--c-border);
    border-radius: 8px; background: var(--c-surface); box-shadow: var(--shadow-1); }
.sell-auth h2 { margin: 0 0 4px; font-size: 20px; }
.sell-auth .adm-field { margin-bottom: 12px; }
.sell-auth-toggle { display: inline-block; margin-top: 4px; color: var(--c-primary); font-weight: 600; text-decoration: none; }
.sell-auth-toggle:hover { text-decoration: underline; }

/* honeypot — уводим за экран, не display:none (боты его игнорируют) */
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Sell — низ формы: капча (как на странице объекта) + кнопка отправки */
.sell-foot { max-width: 460px; margin: 20px auto 0; display: flex; flex-direction: column; gap: 12px; }
.sell-foot .btn-success { width: 100%; }
/* Заявка уже уходила в этом месяце: вместо капчи и кнопки — сколько дней ждать. */
.sell-foot-wait { align-items: center; }
.sell-cooldown { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 44px;
    padding: 10px 16px; border: 1px solid #fde68a; border-radius: 8px; background: #fffbeb; color: #92400e;
    font-weight: 600; text-align: center; }

/* Список панелей агентов/агентств (вместо сетки) */
.cpanel-list { max-width: 1200px; margin: 16px auto; display: flex; flex-direction: column; gap: 12px; }
.cpanel { display: flex; align-items: center; gap: 16px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 10px; padding: 14px 18px; transition: box-shadow .15s, border-color .15s; }
.cpanel:hover { border-color: var(--c-border-strong); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.cpanel-id { display: flex; align-items: center; gap: 16px; flex: 1 1 auto; min-width: 0; text-decoration: none; color: var(--c-text); }
.cpanel-id:hover, .cpanel-id:hover .cpanel-title { text-decoration: none; }
.cpanel-photo { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; overflow: hidden; background: var(--c-bg); }
.cpanel-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpanel-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cpanel-title { font-size: 18px; font-weight: 700; color: var(--c-text); line-height: 1.2; }
.cpanel-sub { font-size: 14px; color: var(--c-text); }
.cpanel-meta { font-size: 13px; color: var(--c-muted); }
.cpanel-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--c-muted); margin-top: 3px; }
.cpanel-fact { white-space: nowrap; }
.cpanel-dot { color: var(--c-border-strong); }
.cpanel-contacts { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cpanel-ic { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--c-border); color: var(--c-text); background: #fff; transition: background .15s, color .15s, border-color .15s; }
.cpanel-ic:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
/* Конвертик (Email) краснеет при наведении на всю панель — как «Email agency» на Buy. */
.cpanel:hover .cp-mail { border-color: #e11d48; color: #e11d48; }
.cpanel:hover .cp-mail:hover, .cp-mail:hover { background: #e11d48; border-color: #e11d48; color: #fff; }
.cpanel-vip { border-color: #f0c14b; background: rgba(245,158,11,.06); box-shadow: 0 2px 12px rgba(245,158,11,.14); }
.cpanel-vip .cpanel-photo { box-shadow: 0 0 0 2px #f0c14b; }
/* Список агентств: 3 колонки на всю ширину (карточки вертикальные). */
.cpanel-grid-3 { max-width: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
/* Грид-карточка агентства: логотип СВЕРХУ, под ним название/инфо, а иконки контактов —
   горизонтальной строкой по НИЗУ панели (раньше лого слева, иконки столбцом справа).
   margin-top:auto у контактов прижимает их к низу, поэтому в ряду сетки строки иконок
   выравниваются между собой даже при разной высоте текста в карточках. */
.cpanel-grid-3 .cpanel { flex-direction: column; align-items: stretch; gap: 12px; }
.cpanel-grid-3 .cpanel-id { flex: 0 0 auto; min-width: 0; width: 100%; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.cpanel-grid-3 .cpanel-info { align-items: center; width: 100%; }
.cpanel-grid-3 .cpanel-facts { justify-content: center; }
.cpanel-grid-3 .cpanel-contacts {
    flex: 0 0 auto; width: 100%; flex-direction: row; flex-wrap: wrap;
    justify-content: center; align-items: center; gap: 8px;
    margin-top: auto; padding-top: 12px; border-top: 1px solid var(--c-border);
}
@media (max-width: 1100px) { .cpanel-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px)  { .cpanel-grid-3 { grid-template-columns: 1fr; } }
/* Пикер колонок для Agencies (1–8), только десктоп. */
@media (min-width: 981px) {
    /* Agencies List (1 колонка) — фиксированная ширина по центру, как в Buy. */
    .cpanel-grid-3.cols-1 { grid-template-columns: 1fr; max-width: 1040px; margin-left: auto; margin-right: auto; }
    .cpanel-grid-3.cols-2 { grid-template-columns: repeat(2, 1fr); }
    .cpanel-grid-3.cols-3 { grid-template-columns: repeat(3, 1fr); }
    .cpanel-grid-3.cols-4 { grid-template-columns: repeat(4, 1fr); }
    .cpanel-grid-3.cols-5 { grid-template-columns: repeat(5, 1fr); }
    .cpanel-grid-3.cols-6 { grid-template-columns: repeat(6, 1fr); }
    .cpanel-grid-3.cols-7 { grid-template-columns: repeat(7, 1fr); }
    .cpanel-grid-3.cols-8 { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 640px) {
    .cpanel { flex-wrap: wrap; }
    .cpanel-contacts { width: 100%; justify-content: flex-start; }
}

/* Страницы профиля агента/агентства (в стиле объекта) */
.obj-grid.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 980px) { .obj-grid.grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .obj-grid.grid-3 { grid-template-columns: 1fr; } }
.prof-head-card { display: flex; gap: 18px; align-items: flex-start; margin-top: 0;
    /* без рамки/фона/паддинга — фото слева, контент вровень с секциями ниже */
    border: 0; border-radius: 0; background: none; padding: 0; }
/* Вариант с рамкой-карточкой (как у секций ниже) — для шапки агента */
.prof-head-card.prof-head-framed { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px; padding: 22px 24px; }
.prof-ava { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--c-bg); }
.prof-ava-sq { border-radius: 12px; }
.prof-head-info { min-width: 0; }
.prof-head-info h1 { margin: 0 0 6px; }
/* Секции профиля агента/агентства — рамка-карточка как у .op-card на странице объекта */
.op-section { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 5px; padding: 22px 24px; margin-top: 16px; }
.op-section > h2 { margin: 0 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--c-border); font-size: 17px; font-weight: 600; }
.op-section .prof-objs-head { margin-bottom: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--c-border); }
.op-section .prof-objs-head h2 { font-size: 17px; font-weight: 600; }
/* Вкладки Buy/Rent в профиле агента/агентства */
.prof-tabs { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--c-border); margin-bottom: 16px; }
.prof-tabs-btns { display: flex; gap: 4px; }
.prof-tab { background: none; border: 0; border-bottom: 2px solid transparent; padding: 10px 14px; margin-bottom: -1px; font: inherit; font-size: 16px; font-weight: 600; color: var(--c-muted); cursor: pointer; }
.prof-tab:hover { color: var(--c-text); }
.prof-tab.on { color: var(--c-text); border-bottom-color: var(--c-primary); }
.prof-tab-n { color: var(--c-muted); font-weight: 400; font-size: 14px; }
.prof-viewall { flex: 0 0 auto; margin-bottom: 6px; }
.prof-pane { display: none; }
.prof-pane.on { display: block; }

/* Имя + кнопка Back (как у объектов) */
.prof-name-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.prof-name-row h1 { margin: 0; }
/* Фото агента/агентства над формой «Send message» в сайдбаре */
.op-side-photo { text-align: center; margin-bottom: 14px; }
.op-side-photo .prof-ava { width: 100%; max-width: 180px; height: auto; aspect-ratio: 1 / 1; }
.prof-agency { display: inline-flex; align-items: center; gap: 8px; color: var(--c-primary); text-decoration: none; font-weight: 600; }
.prof-agency img { width: 24px; height: 24px; border-radius: 4px; object-fit: cover; }
.prof-head-meta { color: var(--c-muted); font-size: 14px; margin: 6px 0; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.prof-langs { font-size: 14px; margin: 6px 0; }
.prof-socials { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.prof-socials a { font-size: 13px; padding: 3px 10px; border: 1px solid var(--c-border); border-radius: 20px; color: var(--c-text); text-decoration: none; }
.prof-socials a:hover { border-color: var(--c-primary); color: var(--c-primary); }
.prof-loc-list { display: flex; gap: 8px; flex-wrap: wrap; }
.prof-loc-chip { background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 6px; padding: 5px 10px; font-size: 13px; }
.prof-objs-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; }
.prof-objs-head h2 { margin: 0; }
.prof-video iframe { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 10px; }
.op-side-title { margin: 0 0 12px; font-size: 18px; }
@media (max-width: 720px) { .prof-head-card { flex-direction: column; } }

.sc-block { margin: 24px 0; }
.sc-block-title { font-size: 22px; margin: 0 0 14px; }
.sc-slider { position: relative; }
.sc-carousel {
    display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px;
    scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: none; -ms-overflow-style: none;   /* прячем скроллбар (FF/IE) */
}
.sc-carousel::-webkit-scrollbar { width: 0; height: 0; display: none; }  /* прячем скроллбар (WebKit) */
.sc-carousel > * { scroll-snap-align: start; flex: 0 0 auto; }
/* стрелки слайдера */
.sc-nav {
    position: absolute; top: 42%; transform: translateY(-50%); z-index: 5;
    width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--c-border);
    background: #fff; color: var(--c-text); font-size: 24px; line-height: 1; cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,.14); display: flex; align-items: center; justify-content: center;
    transition: background .15s, color .15s, border-color .15s;
}
.sc-nav:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.sc-prev { left: -10px; }
.sc-next { right: -10px; }
.sc-nav[hidden] { display: none; }
/* режим grid */
.sc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.sc-grid .sc-agent-card, .sc-grid .sc-obj-card { width: auto; }
.sc-grid .sc-agent-card img { width: 100%; height: auto; aspect-ratio: 1/1; }
.sc-grid .sc-obj-card img { width: 100%; height: auto; aspect-ratio: 3/2; }
.sc-agent-card { width: 150px; text-align: center; text-decoration: none; color: var(--c-text); }
.sc-agent-card img { width: 150px; height: 150px; object-fit: cover; border-radius: 12px; display: block; }
.sc-agent-name { display: block; margin-top: 8px; font-weight: 600; font-size: 14px; }
.sc-agent-name .sc-vip { background: linear-gradient(135deg,#f59e0b,#d97706); color:#fff; font-size:10px; font-weight:700; padding:1px 5px; border-radius:4px; vertical-align: middle; }
.sc-obj-card { position: relative; width: 240px; text-decoration: none; color: var(--c-text); }
.sc-obj-card img { width: 240px; height: 160px; object-fit: cover; border-radius: 10px; display: block; }
.sc-obj-price { position: absolute; left: 8px; top: 8px; background: rgba(0,0,0,.65); color:#fff; font-weight:700; font-size:13px; padding:2px 8px; border-radius:6px; }
.sc-obj-title { display: block; margin-top: 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Логотипы агентств — НЕ обрезать (contain), вписывать целиком на светлый фон */
.sc-agency-card img,
.sc-grid .sc-agency-card img { object-fit: contain; background: #fff; padding: 10px; border: 1px solid var(--c-border); }
.sc-agency-card .sc-obj-title { text-align: center; font-size: 16px; font-weight: 600; margin-top: 10px; }
/* Мобайл: сетки шорткодов (best/grid) задают cols inline-стилем → перебиваем !important,
   иначе на телефоне остаются 3-4 крошечные колонки. Слайдер (.sc-carousel) и так скроллится. */
@media (max-width: 768px) {
    .obj-grid.sc-best-grid,
    .sc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    /* карточки best-сетки по умолчанию фикс. 240px — тянем на всю ячейку */
    .sc-best-grid .sc-obj-card { width: auto; }
    .sc-best-grid .sc-obj-card img { width: 100%; height: auto; aspect-ratio: 3/2; }
}
@media (max-width: 480px) {
    .obj-grid.sc-best-grid,
    .sc-grid { grid-template-columns: 1fr !important; }
}

/* VIP-агент: бейдж + блок доп. полей в профиле */
.agent-vip-badge { display: inline-block; vertical-align: middle; background: linear-gradient(135deg,#f59e0b,#d97706); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .5px; padding: 2px 8px; border-radius: 6px; }
.profile-vip { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--c-border); }
.profile-vip h2 { font-size: 16px; margin: 0 0 10px; }
.profile-vip-grid { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 10px; }
.profile-vip-item { display: flex; flex-direction: column; }
.profile-vip-item span { font-size: 12px; }
.profile-vip-item strong { font-size: 17px; }
.profile-vip-includes { font-size: 14px; margin: 6px 0; }
.profile-vip-video { max-width: 560px; aspect-ratio: 16/9; margin-top: 10px; }
.profile-vip-video iframe { width: 100%; height: 100%; border: 0; border-radius: 8px; }

/* Logo on image (пакет агентства) — логотип в уголке карточки поиска */
/* Бренд агентства: белая плитка с логотипом ВЫСТУПАЕТ за верхнюю границу карточки и
   наезжает на фото; справа — название агентства (оно целиком над карточкой).
   Строка есть ТОЛЬКО когда у агентства есть логотип.
   overflow:visible нужен, чтобы плитка не обрезалась карточкой; скругление фото
   поэтому задаём самому .obj-card-img, а margin-top резервирует место сверху. */
.obj-card.has-brand { overflow: visible; margin-top: 28px; }
.obj-card.has-brand .obj-card-img { border-radius: 14px 14px 0 0; overflow: hidden; }
.oc-brand {
    position: absolute; left: 10px; right: 10px; top: -28px; z-index: 3;
    display: flex; align-items: flex-start; gap: 10px; pointer-events: none;
}
/* Логотип не оплачен — только название агентства в той же полосе над карточкой. */
.oc-brand.no-logo { left: 2px; }
.oc-brand-logo {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 74px; height: 56px; padding: 4px; box-sizing: border-box;
    background: #fff; border: 1px solid var(--c-border); border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.oc-brand-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
/* Название — ссылка на агентство; кликабельно только оно (у самой строки
   pointer-events:none, иначе плитка перехватывала бы клик по фото). */
.oc-brand-name {
    flex: 0 1 auto; min-width: 0; padding-top: 4px; line-height: 18px; pointer-events: auto;
    font-size: 13px; font-weight: 600; color: var(--c-text); text-decoration: none;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
a.oc-brand-name:hover { color: var(--c-primary); text-decoration: underline; }
/* В List-виде карточка горизонтальная: фото слева — скругляем ему только левые углы,
   плитка бренда так же выступает над верхом карточки. */
.obj-grid.cols-1 .obj-card.has-brand .obj-card-img,
.halfmap-grid.cols-1 .obj-card.has-brand .obj-card-img,
.op-nlist .obj-card.has-brand .obj-card-img { border-radius: 14px 0 0 14px; }
/* На телефоне .op-nlist снова вертикальная (фото сверху) — и углы как у обычной карточки. */
@media (max-width: 560px) { .op-nlist .obj-card.has-brand .obj-card-img { border-radius: 14px 14px 0 0; } }

/* ===========================================================================
   STICKY HEADER + ПОЛНОЭКРАННЫЙ ПОПАП-ФОРМА + МОБ. ВКЛАДКИ→СЕЛЕКТБОКС
   =========================================================================== */
/* Шапка всегда липкая (фронт + кабинет). Главную админку (/cp-*) не трогаем. */
.site-top { position: sticky; top: 0; z-index: 100; }
.adm-panel .adm-top { position: sticky; top: 0; z-index: 100; }
/* Десктоп: при прокрутке наверху остаётся ТОЛЬКО фильтр — шапка (логотип, меню,
   переключатели) уезжает со страницей. Высоту шапки в --site-top-h main.js пишет
   лишь пока она реально липкая, поэтому фильтр встаёт в самый верх. На мобильных
   шапка по-прежнему липкая: там фильтр off-canvas и заменять его нечем. */
@media (min-width: 769px) { .site-top { position: static; } }
@media (min-width: 769px) { .site-search-bar { top: var(--site-top-h, 0px); } }

/* Email-to-agent попап на телефоне — на весь экран. */
@media (max-width: 768px) {
    .bsr-pop-ov { padding: 0; }
    .bsr-pop, .bsr-pop.bsr-pop-wide {
        width: 100vw; max-width: 100vw; height: 100vh; height: 100dvh; max-height: none; border-radius: 0;
    }
    .bsr-pop-body { flex: 1 1 auto; overflow: auto; }
    /* iPhone-приложение (viewport-fit=cover): заголовок и × — ниже часов и выреза, кнопки внизу —
       выше полоски «домой». Нижний отступ — у последнего блока, чтобы его фон доходил до края. */
    .bsr-pop { padding-top: env(safe-area-inset-top, 0px); }
    .bsr-pop-x-only { top: calc(8px + env(safe-area-inset-top, 0px)); }
    .bsr-pop > .bsr-pop-foot:last-child { padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
    .bsr-pop > .bsr-pop-body:last-child { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
/* Попап выбора локации (BSR.locationPopup, assets/geo-picker.css) на телефоне тоже на весь экран:
   те же отступы под часы и полоску «домой». Два селектора — чтобы перебить
   .gpk-modal-box.gpk-modal-wide из geo-picker.css (он подключается позже). */
@media (max-width: 768px) {
    .gpk-modal .gpk-modal-box,
    .gpk-modal .gpk-modal-box.gpk-modal-wide {
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }
}

/* Группы вкладок → селектбокс с выпадающим меню (мобайл). Десктоп без изменений. */
.m-tabsel-wrap { display: contents; }
.m-tabsel-face { display: none; }
@media (max-width: 768px) {
    .m-tabsel-wrap { display: block; position: relative; width: 100%; box-sizing: border-box; }
    .m-tabsel-face {
        display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; box-sizing: border-box;
        height: 42px; padding: 0 12px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
        background: var(--c-surface); border: 1px solid var(--c-border-strong); border-radius: 8px; color: var(--c-text);
    }
    .m-tabsel-lbl { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .m-tabsel-car { color: #94a3b8; font-size: 12px; flex: 0 0 auto; }
    .m-tabsel-wrap > .m-tabsel {
        display: none !important; position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 35;
        flex-direction: column !important; align-items: stretch !important; gap: 2px !important; flex-wrap: nowrap !important;
        background: var(--c-surface); border: 1px solid var(--c-border-strong); border-radius: 8px;
        box-shadow: 0 12px 32px rgba(0,0,0,.16); padding: 4px; margin: 0 !important; max-height: 60vh; overflow: auto;
    }
    .m-tabsel-wrap.open > .m-tabsel { display: flex !important; }
    .m-tabsel-wrap > .m-tabsel > * {
        width: 100% !important; max-width: none !important; flex: 0 0 auto !important;
        text-align: left !important; justify-content: flex-start !important; margin: 0 !important;
        border: 0 !important; border-bottom: 1px solid var(--c-border) !important; border-radius: 6px !important;
        background: #fff !important; color: var(--c-text) !important;
    }
    .m-tabsel-wrap > .m-tabsel > .on { background: var(--c-bg) !important; color: var(--c-primary-dk) !important; }
    .m-tabsel-wrap > .m-tabsel > :last-child { border-bottom: 0 !important; }
}

/* Контекст-иконки страницы объекта/новостройки в общей шапке (back/edit/fav/mail). */
.hdr-obj-acts { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.hdr-obj-act {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px;
    border: 1px solid var(--c-border); border-radius: 6px; background: var(--c-surface); color: var(--c-muted); cursor: pointer;
}
.hdr-obj-act:hover { border-color: var(--c-primary); color: var(--c-primary); background: #fff; }

/* Контакт (агент/агентство) сверху формы Email-to-agent. */
.ca-contact { display: flex; align-items: center; gap: 10px; padding: 10px 12px; margin-bottom: 12px; background: var(--c-bg); border: 1px solid var(--c-border); border-radius: 8px; }
.ca-contact-ico { font-size: 20px; line-height: 1; }
.ca-contact-name { font-weight: 600; }
/* Шапка popup-формы «Send email» — как в сайдбаре страницы объекта (лого/агент/агентство/телефон). */
/* ---- Шапка контактной формы (.ccard): сайдбар страницы объекта и попап в выдаче.
   Слева фото агента (или лого агентства, если агента нет), справа имя · телефон ·
   языки · соцсети. Ниже отдельной строкой: лого агентства слева, название справа. ---- */
.ccard { text-align: center; }
/* Фото/лого — сверху по центру, данные под ним (в узком сайдбаре так читается лучше). */
.ccard-main { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.ccard-photo { flex: none; }
.ccard-photo img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; display: block; }
.ccard-logo { flex: none; display: inline-flex; align-items: center; }
.ccard-logo img { max-height: 60px; max-width: 160px; width: auto; height: auto; object-fit: contain; display: block; }
.ccard-body { width: 100%; min-width: 0; }
.ccard-name { font-weight: 700; font-size: 16px; color: var(--c-text); }
.ccard-name a { color: inherit; text-decoration: none; }
.ccard-name a:hover { color: var(--c-primary); text-decoration: underline; }
.ccard-phone { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; font-weight: 700; font-size: 17px; color: var(--c-primary); text-decoration: none; }
.ccard-phone:hover { text-decoration: underline; }
/* Языки — строкой под телефоном (без иконки). */
.ccard-langs { margin-top: 6px; font-size: 13px; color: var(--c-muted); }
/* Соцсети — ряд круглых иконок под языками. */
.ccard-socials { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ccard-socials a { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border: 1px solid var(--c-border); border-radius: 50%; color: var(--c-muted); transition: .12s; }
.ccard-socials a:hover { color: var(--c-primary); border-color: var(--c-primary); background: rgba(var(--c-primary-rgb), .06); }
/* Блок агентства под контактами агента: лого слева, название справа — одной строкой. */
.ccard-agency { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--c-border); }
.ccard-agency-logo { flex: none; display: inline-flex; align-items: center; }
.ccard-agency-logo img { max-height: 36px; max-width: 84px; width: auto; height: auto; object-fit: contain; display: block; }
.ccard-agency-name { font-size: 13px; color: var(--c-muted); }
.ccard-agency-name a { color: inherit; text-decoration: none; }
.ccard-agency-name a:hover { color: var(--c-primary); text-decoration: underline; }

/* Шапка попапа — та же .ccard-раскладка (фото/лого сверху, данные под ним). */
.ca-head { text-align: center; margin-bottom: 14px; }
.ca-head-logo { display: block; margin: 0 auto 8px; }
.ca-head-logo img { max-height: 56px; max-width: 160px; object-fit: contain; }
.ca-head-name { font-weight: 700; font-size: 16px; }
.ca-head-sub { font-size: 13px; color: var(--c-muted); margin-top: 2px; }
.ca-head-phone { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-weight: 700; color: var(--c-primary-dk); text-decoration: none; }
.ca-head-phone:hover { text-decoration: underline; }

/* Избранное — вплотную справа от цены (сама цена прижата вправо своим margin-left:auto).
   Второго margin-left:auto тут быть не должно: два auto делят свободное место пополам,
   и цена уезжала в середину строки. */
.op-fav-price {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    flex: 0 0 auto; border: 1px solid var(--c-border); border-radius: 8px;
    background: var(--c-surface); color: var(--c-muted); cursor: pointer;
}
.op-fav-price:hover { border-color: var(--c-primary); color: var(--c-primary); }
.op-fav-price.on { color: #e11d48; border-color: #e11d48; }
.op-fav-price.on svg { fill: #e11d48; }

/* Мобайл: H1 и location-path страницы объекта — на всю ширину экрана. */
@media (max-width: 768px) {
    .op-title-row { gap: 6px; }
    .op-title-row h1 { flex: 1 1 100%; width: 100%; }
    .op-head-l h1 { font-size: 22px; }
    .op-loc-suffix { flex: 1 1 100%; width: 100%; }
    .op-price { flex: 1 1 auto; }
}

/* Кабинет, редактор объекта (мобайл): рейтинг (mark) и Energy class — в одну строку. */
@media (max-width: 768px) {
    /* padding-top: overflow-x: auto делает ряд скролл-контейнером, и кольцо выбранной
       оценки (box-shadow) срезалось верхним краем — опускаем ряд на 10px. */
    /* overflow: visible — сетка теперь всегда влезает, а скролл-контейнер
       срезал кольцо выбранной оценки сверху и слева; padding — запас под это кольцо. */
    .adm-panel .mark-picker-head { flex-wrap: nowrap; overflow: visible; max-width: 100%; padding: 10px 3px 0; }
    /* Ширина — от колонки сетки: фиксированные квадраты не влезали в узкий
       экран и ряд уезжал в горизонтальный скролл. */
    .adm-panel .mark-picker-head .mark-swatch { width: 100% !important; max-width: 48px; height: auto !important; min-width: 0; aspect-ratio: 1; font-size: 14px; }
    /* Классы (— и A++++…H) — сеткой по 5 в ряд (три ряда) вместо
       горизонтального скролла: в одну строку они на телефоне не влезают. */
    .adm-panel .energy-class-row {
        display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: 6px 4px; overflow-x: visible; flex-wrap: wrap;
    }
    .adm-panel .energy-cls-swatch { min-width: 0; width: 100%; padding: 0; height: 38px; }
}

/* Email-to-agent: кнопка Call в попапе. */
.ca-call { display: block; width: 100%; text-align: center; margin-top: 8px; }

/* Мобайл: медиа-галерея без внешней рамки; промежуток под селектбоксом вкладок. */
@media (max-width: 768px) {
    .op-gallery { border: 0; border-radius: 0; overflow: visible; background: transparent; }
    .op-gallery > .m-tabsel-wrap > .m-tabsel-face { margin-bottom: 8px; }
    .op-gallery .m-tabsel-face { margin-bottom: 8px; }
    /* Подвал — по центру на мобиле. */
    .site-foot-inner { flex-direction: column; justify-content: center; text-align: center; gap: 10px; }
    .site-foot-nav { flex-direction: column; align-items: center; gap: 10px; }
    .site-foot-col { align-items: center; }
    .site-foot-co { text-align: center; max-width: none; }
    .site-foot-side { margin-left: 0; align-items: center; }
    .site-foot-meta { text-align: center; }
    /* Баннер «подтвердите email» — переносим кнопку Resend, чтобы была видна. */
    .ev-banner { flex-wrap: wrap; }
    .ev-banner .ev-resend { margin-left: 0; }
}

/* ===========================================================================
   РЕЖИМ ПРИЛОЖЕНИЯ (code/appmode.php) — Android/iPhone-приложение и ?app=1.
   Все правила висят на body.app-mode / body.app-tabs: вне режима ни одно не срабатывает.
   =========================================================================== */
body.app-mode { -webkit-tap-highlight-color: transparent; }
/* iPhone: страница заходит под статус-бар (viewport-fit=cover) — шапку отодвигаем. */
body.app-mode .site-top { padding-top: env(safe-area-inset-top, 0px); }
/* «Назад» вместо бургера — на внутренних страницах. Свои «назад» у объекта, новостройки,
   агентства дублировали бы её. */
.hdr-app-back {
    display: inline-flex; align-items: center; justify-content: center; order: -1; flex: none;
    width: 40px; height: 40px; padding: 0; cursor: pointer;
    background: var(--c-surface); color: var(--c-text);
    border: 1px solid var(--c-border); border-radius: 5px;
}
body.app-mode .op-back-search, body.app-mode .op-back-btn { display: none; }
/* Печать из приложения не работает (WebView без диалога печати). */
body.app-mode #op-print { display: none; }

/* Нижние вкладки, которые рисует сайт (без нативных вкладок: браузер, ?app=1). */
.app-tabbar { display: none; }
body.app-tabs { --app-tabbar-h: 58px; padding-bottom: calc(var(--app-tabbar-h) + env(safe-area-inset-bottom, 0px)); }
body.app-tabs .app-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    height: calc(var(--app-tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .97); border-top: 1px solid var(--c-border);
    -webkit-backdrop-filter: saturate(180%) blur(12px); backdrop-filter: saturate(180%) blur(12px);
}
.app-tab {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: #6b7280; font-size: 11px; font-weight: 500; line-height: 1.1;
}
.app-tab:hover { color: var(--c-primary); text-decoration: none; }
.app-tab.on { color: var(--c-primary); font-weight: 700; }
.app-tab svg { display: block; }
.app-tab span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Плавающие кнопки и тосты — над вкладками. */
body.app-tabs .fab-top { bottom: calc(var(--app-tabbar-h) + 14px + env(safe-area-inset-bottom, 0px)); }
body.app-tabs .fab-top.stacked { bottom: calc(var(--app-tabbar-h) + 84px + env(safe-area-inset-bottom, 0px)); }
body.app-tabs .op-contact-fab { bottom: calc(var(--app-tabbar-h) + 16px + env(safe-area-inset-bottom, 0px)); }
body.app-tabs .bsr-toast-stack { bottom: calc(var(--app-tabbar-h) + 20px + env(safe-area-inset-bottom, 0px)); }

/* Экраны приложения: «Ещё» (/app), «раздел недоступен», «кабинет на сайте». */
.app-page { width: 100%; max-width: 640px; margin: 0 auto; padding: 16px 16px 24px; }
.app-card {
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 12px;
    margin: 0 0 14px; overflow: hidden;
}
.app-row {
    display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 16px;
    color: var(--c-text); font-size: 16px; cursor: pointer; list-style: none;
    border-top: 1px solid var(--c-border); background: none; width: 100%; text-align: left;
}
.app-card > .app-row:first-child, .app-card > .app-pick:first-child > .app-row { border-top: 0; }
.app-row::-webkit-details-marker { display: none; }
.app-row:hover { text-decoration: none; color: var(--c-text); background: #f9fafb; }
.app-row-ic { display: inline-flex; color: var(--c-primary); flex: none; }
.app-row-t { flex: 1 1 auto; min-width: 0; }
.app-row-go { display: inline-flex; color: #9ca3af; flex: none; transform: rotate(-90deg); transition: transform .15s; }
.app-val { color: #6b7280; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.app-row-out .app-row-t { color: var(--c-danger); }
.app-badge {
    min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px; flex: none;
    background: var(--c-danger); color: #fff; font-size: 12px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.app-acct { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.app-row.app-acct { padding: 10px 16px; }
.app-row.app-acct .app-acct-t { flex: 1 1 auto; }
.app-row.app-acct .app-acct-ava { width: 40px; height: 40px; }
.app-row-out .app-row-ic { color: var(--c-danger); }
.app-acct-ava {
    width: 44px; height: 44px; border-radius: 50%; flex: none; object-fit: cover;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(var(--c-primary-rgb), .1); color: var(--c-primary); font-weight: 700; font-size: 18px;
}
.app-acct-t { display: flex; flex-direction: column; min-width: 0; }
.app-acct-t b { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-acct-t small { color: #6b7280; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-guest { display: flex; gap: 10px; padding: 16px; }
.app-guest > a { flex: 1 1 0; justify-content: center; text-align: center; padding: 12px; font-size: 16px; }
.app-pick[open] > .app-row .app-row-go { transform: rotate(0deg); }
/* «Меню»: страна, язык, валюта — одной строкой вверху, без подписей (значок + значение). */
.app-sels { display: flex; gap: 8px; margin: 0 0 14px; }
.app-sel {
    flex: 1 1 0; min-width: 0; display: flex; align-items: center; gap: 6px; height: 44px; padding: 0 8px 0 10px;
    background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 12px; margin: 0;
}
.app-sel-cur { flex: 0 0 auto; }
.app-sel-ic { display: inline-flex; flex: none; color: var(--c-primary); }
.app-sel select {
    flex: 1 1 auto; min-width: 0; width: 100%; height: 100%; margin: 0; padding: 0; border: 0; box-shadow: none;
    background: transparent; color: var(--c-text); font: inherit; font-size: 15px; text-overflow: ellipsis;
}
/* Страна — кнопка своего списка (.app-cc), с виду как соседние <select>. */
.app-sel-btn { font: inherit; color: var(--c-text); text-align: left; cursor: pointer; }
.app-sel-v { flex: 1 1 auto; min-width: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-sel-car { display: inline-flex; flex: none; color: #94a3b8; }
/* Список стран снизу экрана: с объявлениями — жирные, цвета сайта; без — серые; текущая — залита. */
.app-cc { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: flex-end; background: rgba(15, 23, 42, .45); }
.app-cc[hidden] { display: none; }
.app-cc-box {
    width: 100%; max-height: 80vh; max-height: 80dvh; display: flex; flex-direction: column;
    background: var(--c-surface); border-radius: 16px 16px 0 0; padding-bottom: env(safe-area-inset-bottom, 0px);
}
.app-cc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--c-border); font-size: 17px; }
.app-cc-x { display: inline-flex; padding: 6px; border: 0; background: none; color: var(--c-text); cursor: pointer; }
/* grid-auto-rows: max-content — у пунктов overflow:hidden, без этого сетка в прокручиваемом блоке
   сжимает строки по высоте блока и режет текст. */
.app-cc-list { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; gap: 2px; padding: 8px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.app-cc-opt { display: block; padding: 10px 12px; border-radius: 8px; font-size: 15px; line-height: 1.4; color: #b3b7bd; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-cc-opt.is-live { color: var(--c-primary); font-weight: 700; text-decoration: none; }
.app-cc-opt.is-live.on { background: var(--c-primary); color: #fff; }
/* Подменю (Аккаунт, Инфо): строки чуть меньше и с отступом. */
.app-sub { border-top: 1px solid var(--c-border); background: #fafafa; }
.app-sub > .app-row { min-height: 48px; padding-left: 28px; font-size: 15px; }
.app-sub > .app-row:first-child { border-top: 0; }
/* Приложение: карта и поиск — во вкладках внизу, в шапке их кнопок нет. Лупа остаётся в разметке
   скрытой: её «нажимает» повторное нажатие вкладки «Поиск» (srch=1, templates/_app_js.php). */
body.app-mode .hdr-view-toggle, body.app-mode .hdr-search-toggle { display: none !important; }
/* Панель фильтров в приложении выезжает слева (на сайте — справа, см. .site-search-bar выше). */
@media (max-width: 768px) {
    body.app-mode .site-search-bar { right: auto; left: 0; transform: translateX(-100%); box-shadow: 2px 0 24px rgba(0,0,0,.18); }
    body.app-mode .site-search-bar.open { transform: none; }
    body.app-mode .site-search > .ssrch-close { right: auto; left: calc(var(--fdrawer-w) - 60px); }
    body.app-mode .site-search > .ssrch-reset { right: auto; left: 14px; }
    body.app-mode .site-search > .btn-primary { right: auto; left: 74px; }
    /* iPhone: панель на весь экран — сверху строка с часами, снизу полоска «домой».
       На Android отступы даёт само приложение (MainActivity), там env() = 0. */
    body.app-mode .site-search-bar {
        padding-top: calc(14px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    }
    body.app-mode .site-search > .ssrch-reset,
    body.app-mode .site-search > .btn-primary,
    body.app-mode .site-search > .ssrch-close { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); }
}
/* Экран «Уведомления» (/app/notifications): заголовок, пояснение, переключатели. */
.app-h1 { font-size: 22px; margin: 4px 0 14px; }
.app-note { margin: 0; padding: 14px 16px 0; color: #6b7280; font-size: 15px; }
.app-row-chk { cursor: pointer; margin: 0; }
.app-switch {
    -webkit-appearance: none; appearance: none; flex: none; position: relative; margin: 0; cursor: pointer;
    width: 46px; height: 28px; border: 0; border-radius: 14px; background: #d1d5db; transition: background .15s;
}
.app-switch::after {
    content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .15s;
}
.app-switch:checked { background: var(--c-primary); }
.app-switch:checked::after { transform: translateX(18px); }
.app-pick-list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px 12px 12px;
    max-height: 50vh; overflow-y: auto;
}
.app-pick-cur { grid-template-columns: repeat(4, 1fr); }
.app-opt {
    display: block; padding: 10px 12px; border: 0; border-radius: 8px; background: #f3f4f6;
    color: var(--c-text); font: inherit; font-size: 15px; text-align: left; cursor: pointer;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.app-pick-cur .app-opt { text-align: center; }
.app-opt:hover { text-decoration: none; color: var(--c-text); background: #e5e7eb; }
.app-opt.on { background: rgba(var(--c-primary-rgb), .12); color: var(--c-primary); font-weight: 700; }
.app-ver { text-align: center; color: #9ca3af; font-size: 13px; margin: 6px 0 0; }
.app-msg { text-align: center; padding-top: 48px; }
.app-msg-ic { display: inline-flex; color: var(--c-primary); margin-bottom: 8px; }
.app-msg h1 { font-size: 22px; margin: 0 0 8px; }
.app-msg p { color: var(--c-muted); font-size: 16px; margin: 0 0 22px; }
.app-msg-acts { display: flex; flex-direction: column; gap: 10px; align-items: stretch; max-width: 360px; margin: 0 auto; }
.app-msg-acts > .btn-primary, .app-msg-acts > .btn-secondary { justify-content: center; padding: 12px; font-size: 16px; }
.app-link-out { color: var(--c-danger); padding: 8px; }
