/* Своя вёрстка без CSS-фреймворка (D-решение: стенд поднимается одним dotnet run, без npm). */

:root {
    --ink: #16233a;
    --ink-soft: #3d4a60;
    --muted: #6d6f76;
    --brand: #0e6b5c;
    --brand-dark: #0a4f44;
    --brand-soft: #e6f1ee;
    --accent: #d9531e;
    --accent-dark: #b8410f;
    --bg: #f6f4ef;
    --surface: #ffffff;
    --line: #e3ded2;
    --line-strong: #cfc8b8;
    --danger: #b3261e;
    --ok: #1f7a45;
    --radius: 10px;
    --radius-sm: 6px;
    --shadow: 0 1px 2px rgba(22, 35, 58, .06), 0 8px 24px rgba(22, 35, 58, .06);
    --shadow-sm: 0 1px 2px rgba(22, 35, 58, .08);
    --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
    color: var(--ink);
    background: var(--bg);
}

img { max-width: 100%; display: block; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; color: var(--ink); }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }

p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.3em; }
li { margin-bottom: .35em; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.stack > * + * { margin-top: 1rem; }
.hidden { display: none !important; }

.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ---------- Шапка ---------- */

.header {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 40;
}

.header__top {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 70px;
    padding-top: 10px;
    padding-bottom: 10px;
}

.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo__mark { width: 46px; height: 44px; flex: none; }
.logo__text { font-weight: 700; font-size: 1.1rem; color: var(--ink); white-space: nowrap; }
.logo__sub { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; white-space: nowrap; }
/* Подпись не переносится на вторую строку: если ей не хватает места, app.js ставит
   этот класс и подпись исчезает целиком, а название встаёт по центру логотипа.
   Высоту шапки держит min-height у .header__top, так что она не прыгает. */
.header__top--compact .logo__sub { display: none; }

/* Слоган не влияет на высоту шапки: текст позиционирован абсолютно внутри блока,
   который растягивается на высоту строки. app.js показывает его (.is-fit), только
   если текст целиком помещается; без JS он просто не виден. */
.slogan {
    flex: 1;
    min-width: 0;
    align-self: stretch;
    position: relative;
    overflow: hidden;
    margin: 0;
    font-size: .8rem;
    line-height: 1.25;
    color: var(--muted);
    visibility: hidden;
}
.slogan.is-fit { visibility: visible; }
.slogan__text {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
}
.slogan strong { color: var(--accent); }

.header__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; min-width: 0; }
/* Надпись CTA — всегда в одну строку; при нехватке места сначала сжимаются поля входа,
   потом текст кнопки обрезается троеточием. display: block нужен для text-overflow. */
.header__actions .btn--accent {
    display: block;
    flex: 0 1 auto;
    min-width: 4.5em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    min-width: 0;
    line-height: 1.3;
}
.user-box__email {
    font-weight: 600;
    font-size: .85rem;
    max-width: 210px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-box__links { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: flex-end; }

/* display: contents — поля становятся соседями CTA в .header__actions, и их flex-shrink
   сравнивается с кнопкой напрямую. Коэффициент огромный: пока полям есть куда сжиматься,
   кнопке не достаётся даже доли пикселя (иначе троеточие появляется при почти полной
   ширине); min-width держит плейсхолдер целиком. */
.login-inline { display: contents; }
.login-inline input { flex: 0 1000000 140px; width: 140px; min-width: 5.6em; }
.login-inline .btn, .header__actions .login-mobile, .header__actions .burger { flex: none; white-space: nowrap; }
.login-inline__extra { display: flex; flex-direction: column; }
.header__actions .login-mobile { display: none; }

.link-button {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: var(--brand);
    cursor: pointer;
    text-decoration: underline;
}
.link-button:hover { color: var(--brand-dark); }

.nav {
    border-top: 1px solid var(--line);
    background: var(--surface);
}
.nav__list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 18px;
    margin: 0;
    padding: 8px 0;
}
.nav__list li { margin: 0; }
.nav__link {
    display: inline-block;
    padding: 4px 0;
    font-size: .92rem;
    color: var(--ink-soft);
}
.nav__link.is-active { color: var(--accent); font-weight: 600; }

.burger {
    display: none;
    background: none;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    font-size: .9rem;
    cursor: pointer;
}

/* ---------- Кнопки и формы ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 9px 16px;
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    background: var(--brand);
    color: #fff;
    transition: background .15s ease;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; color: #fff; }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 3px solid #f0b429;
    outline-offset: 1px;
}
.btn--accent { background: var(--accent); }
.btn--accent:hover { background: var(--accent-dark); }
.btn--ghost { background: transparent; color: var(--brand); border-color: var(--line-strong); }
.btn--ghost:hover { background: var(--brand-soft); color: var(--brand-dark); }
.btn--danger { background: var(--danger); }
.btn--danger:hover { background: #8c1c16; }
.btn--sm { padding: 5px 10px; font-size: .82rem; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }

input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=search], select, textarea {
    width: 100%;
    font-family: inherit;
    font-size: .95rem;
    padding: 8px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
}
textarea { min-height: 110px; resize: vertical; }

.field { margin-bottom: 14px; }
.field--check { display: flex; align-items: flex-start; gap: 8px; }
.field--check label { margin: 0; font-weight: 400; font-size: .92rem; }
.field--check input { margin-top: 3px; }

.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 14px; }

.form-error { color: var(--danger); font-size: .85rem; margin-top: 4px; }
.validation-summary { border-left: 3px solid var(--danger); background: #fdf1f0; padding: 10px 12px; border-radius: var(--radius-sm); margin-bottom: 16px; }
.validation-summary ul { margin: 0; padding-left: 1.1em; }

.notice { border-radius: var(--radius-sm); padding: 12px 14px; margin-bottom: 18px; border: 1px solid; }
.notice--ok { background: #eef8f1; border-color: #bfe2cb; color: #14532d; }
.notice--info { background: #eef4fb; border-color: #c7d9ef; color: #1c3d63; }
.notice--warn { background: #fdf6e6; border-color: #efdca8; color: #6b4c07; }
.notice--error { background: #fdf1f0; border-color: #efc4c0; color: #7a1c16; }

/* ---------- Каркас страницы ---------- */

.layout {
    display: grid;
    grid-template-columns: 272px minmax(0, 1fr) 220px;
    gap: 22px;
    align-items: start;
    padding-top: 20px;
    padding-bottom: 40px;
}
.layout--wide { grid-template-columns: minmax(0, 1fr); }
.layout--two { grid-template-columns: 272px minmax(0, 1fr); }

/* Колонка едет вместе со страницей, а когда её содержимое кончилось — замирает и ждёт
   выдачу (и наоборот при прокрутке вверх). Само прилипание держит браузер (sticky),
   иначе оно дёргается: скрипт успевает поправить положение лишь через кадр. app.js
   только подставляет inset (top/bottom) при смене направления прокрутки. */
/* align-self: stretch обязателен: sticky-блок двигается только внутри своей колонки,
   а по умолчанию (align-items: start) колонка ровно по высоте содержимого. */
.sidebar { position: relative; align-self: stretch; }
.rail { display: grid; gap: 16px; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.card__body { padding: 16px; }
.card__title { font-size: 1rem; font-weight: 700; margin: 0 0 12px; }

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.panel + .panel { margin-top: 18px; }

.red-note {
    background: #fff4f0;
    border: 1px solid #f2c9bb;
    border-radius: var(--radius);
    padding: 14px 16px;
    font-size: .88rem;
}
.red-note strong { color: var(--accent-dark); }

/* ---------- Фильтр ---------- */

.filter__group { margin-bottom: 16px; }
.filter__legend { font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin-bottom: 8px; }
.check-list { display: grid; gap: 5px; }
.check {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: .92rem;
    cursor: pointer;
    font-weight: 400;
    color: var(--ink);
    margin: 0;
}
.check input { width: auto; }

.price-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.range-wrap { position: relative; height: 26px; margin-top: 10px; }
.range-wrap input[type=range] {
    position: absolute;
    left: 0;
    width: 100%;
    margin: 0;
    background: none;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    height: 26px;
}
.range-wrap input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--brand);
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px var(--brand);
    cursor: pointer;
}
.range-wrap input[type=range]::-moz-range-thumb {
    pointer-events: auto;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--brand);
    border: 2px solid #fff;
    cursor: pointer;
}
.range-track { position: absolute; top: 11px; left: 0; right: 0; height: 4px; background: var(--line-strong); border-radius: 2px; }
.range-track span { position: absolute; height: 100%; background: var(--brand); border-radius: 2px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-soft);
    color: var(--brand-dark);
    border-radius: 999px;
    padding: 3px 10px;
    font-size: .82rem;
}
.chip button { border: none; background: none; cursor: pointer; color: inherit; font-size: 1rem; line-height: 1; padding: 0; }

.filter__count { font-size: .9rem; color: var(--muted); margin: 10px 0; }

/* Подсказка у изменённого поля фильтра: «Показать N объектов» — как на старом сайте.
   Вид берёт от .btn--ghost .btn--sm (как «Выбрать на схеме метро»), здесь только
   положение, тень и непрозрачный фон: она висит поверх каталога.
   z-index выше модального окна (90): станции метро выбирают в нём. */
.filter-hint {
    position: fixed;
    z-index: 95;
    background: var(--surface);
    box-shadow: var(--shadow);
}
/* Обязательно: display у .btn перебивает браузерное [hidden] { display: none },
   и скрытая подсказка оставалась бы на экране. */
.filter-hint[hidden] { display: none; }

/* ---------- Лента ---------- */

.feed-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.feed-head h1 { margin: 0; }

.listing {
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    gap: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 14px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm);
}
.listing__photo { position: relative; display: block; border-radius: var(--radius-sm); overflow: hidden; background: var(--brand-soft); aspect-ratio: 4 / 3; }
.listing__photo img { width: 100%; height: 100%; object-fit: cover; }
.listing__photo-count {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(22, 35, 58, .72);
    color: #fff;
    font-size: .75rem;
    padding: 2px 7px;
    border-radius: 999px;
}
.listing__price { font-size: 1.25rem; font-weight: 700; }
.listing__title { font-size: 1.05rem; margin: 2px 0 6px; }
.listing__meta { font-size: .88rem; color: var(--muted); margin-bottom: 8px; }
.listing__features { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.feature {
    font-size: .78rem;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--ink-soft);
    border-radius: 999px;
    padding: 2px 9px;
}
.listing__footer { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.listing__date { font-size: .82rem; color: var(--muted); margin-left: auto; }

.phone-block { display: flex; align-items: center; gap: 8px; font-size: .92rem; flex-wrap: wrap; }
/* Контактов бывает несколько — телефон и мессенджеры. */
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.contact-list li { margin: 0; }
.contact-value { font-weight: 700; font-size: 1.05rem; letter-spacing: .01em; overflow-wrap: anywhere; }

.placeholder-photo {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    color: var(--brand);
    background: repeating-linear-gradient(45deg, #eaf2f0, #eaf2f0 12px, #e0ece9 12px, #e0ece9 24px);
    font-size: .8rem;
    text-align: center;
    padding: 8px;
}

/* ---------- Пагинация ---------- */

.pager { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 22px 0; }
.pager a, .pager span {
    min-width: 38px;
    text-align: center;
    padding: 7px 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: .9rem;
}
.pager .is-current { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.pager .is-gap { border: none; background: none; min-width: auto; padding: 7px 2px; }

/* ---------- Карточка объекта ---------- */

/* Правая колонка объявления забрала себе место убранной колонки с пакетами,
   поэтому она шире левой с фотографиями. */
.object { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; }
.gallery__main { border-radius: var(--radius); overflow: hidden; background: var(--brand-soft); aspect-ratio: 4 / 3; }
.gallery__main img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.gallery__thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.gallery__thumbs button {
    width: 74px;
    height: 56px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: none;
}
.gallery__thumbs button.is-active { border-color: var(--brand); }
.gallery__thumbs img { width: 100%; height: 100%; object-fit: cover; }

.map { height: 300px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--brand-soft); }
.map--catalog { height: 420px; }
.map--form { height: 320px; }

.specs { list-style: none; padding: 0; margin: 0; }
.specs li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: .92rem; }
.specs li:last-child { border-bottom: none; }
.specs span:first-child { color: var(--muted); }
.specs span:last-child { text-align: right; font-weight: 600; }

.tick-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; }
.tick-list li { font-size: .92rem; }
.tick-list li::before { content: "✓ "; color: var(--ok); font-weight: 700; }

/* ---------- Модалки ---------- */

.modal {
    position: fixed;
    inset: 0;
    z-index: 90;
    display: none;
    padding: 16px;
    overflow: auto;
    background: rgba(15, 23, 38, .55);
}
/* minmax(0, 1fr): иначе колонка тянется по содержимому, и широкая схема метро
   растягивает окно шире экрана вместо своей прокрутки. */
.modal.is-open { display: grid; place-items: start center; grid-template-columns: minmax(0, 1fr); }
.modal__box {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    max-width: 720px;
    width: 100%;
    margin: 5vh 0;
    padding: 22px;
    position: relative;
}
.modal__box--wide { max-width: 940px; }
.modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: none;
    background: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}

/* Схема метро: столбцы по линиям с цветными маркерами (актуальнее старой картинки 2019 года). */
/* ---------- Схема метро в фильтре ---------- */

.metro-map {
    position: relative;
    /* Своей вертикальной прокрутки нет: схема листается вместе с окном. По горизонтали
       она уже экрана только на телефоне — там прокручивается пальцем, как обычная картинка. */
    overflow-x: auto;
    overflow-y: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    /* Выбор станций кликами: выделять текст названий незачем, а при Shift он выделялся. */
    user-select: none;
    -webkit-user-select: none;
}
/* Схема во всю ширину окна: так названия станций читаются. Если по высоте не влезает,
   прокручивается сама схема — уменьшать её ради полного обзора значит потерять подписи. */
.metro-map svg { display: block; width: 100%; height: auto; min-width: 700px; }
.metro-map__status { margin: 0; padding: 24px; text-align: center; }

/* Прямоугольник под названием: и область нажатия побольше, и подсветка выбранного.
   Его размер считает app.js по названию в жирном начертании — выбранное название жирнее
   обычного и иначе не помещалось бы в свою подсветку. */
.metro-map__hit { fill: transparent; stroke: none; }
.metro-map--measure .metro-map__station text { font-weight: 700; }
.metro-map__station:hover .metro-map__hit { fill: var(--line); fill-opacity: .45; }
.metro-map__station.is-picked .metro-map__hit { fill: var(--brand-soft); stroke: var(--brand); stroke-width: 1; }
.metro-map__station.is-picked text { font-weight: 700; }

/* Запасной список станций для клавиатуры и чтения с экрана. */
.metro-map__list { margin: 12px 0; }
.metro-map__list summary { cursor: pointer; color: var(--brand); }
.metro-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-top: 10px; }
.metro-line__name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: .9rem; margin-bottom: 6px; }
.metro-line__dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.metro-line__stations { display: grid; gap: 3px; border-left: 3px solid; padding-left: 10px; }

.metro-map__hint { margin-bottom: 8px; }
/* На тачскрине Shift обычно негде нажать. */
@media (hover: none) {
    .metro-map__hint--shift { display: none; }
}

.packages { display: grid; gap: 10px; }
.package {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 12px;
    cursor: pointer;
    font-weight: 400;
    margin: 0;
}
.package:hover { border-color: var(--brand); background: var(--brand-soft); }
.package input { width: auto; margin-top: 4px; }
.package__name { font-weight: 700; }
.package__price { margin-left: auto; font-weight: 700; font-size: 1.1rem; white-space: nowrap; }

/* ---------- Реклама ---------- */

.ad-slot { border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); padding: 10px; background: var(--surface); }
.ad-slot:empty { display: none; }
/* Явно: без этого правила любое авторское display у .ad-slot перебило бы [hidden] из браузера. */
.ad-slot[hidden] { display: none; }
.ad-slot__label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 6px; }

/* ---------- Подвал ---------- */

.footer { background: #14202f; color: #cdd5e0; margin-top: 30px; padding: 28px 0; font-size: .88rem; }
.footer a { color: #fff; text-decoration: underline; }
.footer__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 22px; }
.footer h3 { color: #fff; font-size: .95rem; }
.footer ul { list-style: none; padding: 0; }
.footer__bottom { border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 20px; padding-top: 14px; color: #8f9aab; }

/* ---------- Cookie ---------- */

.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 80;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 14px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    font-size: .88rem;
}
.cookie-banner p { margin: 0; flex: 1; min-width: 220px; }

/* ---------- Таблицы и админка ---------- */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); }
table.data th, table.data td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
table.data tr:hover td { background: #fbfaf7; }

.status { display: inline-block; font-size: .76rem; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.status--published { background: #eef8f1; border-color: #bfe2cb; color: #14532d; }
.status--pending, .status--pendingmoderation { background: #fdf6e6; border-color: #efdca8; color: #6b4c07; }
.status--draft { background: #f1f2f4; border-color: #d9dbe0; color: #4b5563; }
.status--rejected, .status--unpublished { background: #fdf1f0; border-color: #efc4c0; color: #7a1c16; }

.admin-shell { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; padding-top: 20px; padding-bottom: 40px; }
.admin-nav { display: grid; gap: 2px; align-content: start; position: sticky; top: 20px; }
.admin-nav a { padding: 8px 10px; border-radius: var(--radius-sm); color: var(--ink-soft); font-size: .92rem; }
.admin-nav a:hover { background: var(--surface); text-decoration: none; }
.admin-nav a.is-active { background: var(--brand); color: #fff; }
.admin-topbar { background: #14202f; color: #fff; padding: 10px 0; }
.admin-topbar a { color: #fff; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
/* Панель после плиток статистики прилипала к ним вплотную. */
.stat-grid + .panel { margin-top: 18px; }
/* Кнопки под формой: без отступа они липнут к последнему полю. */
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.stat__value { font-size: 1.6rem; font-weight: 700; }
.stat__label { font-size: .82rem; color: var(--muted); }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 16px; }
.toolbar .field { margin: 0; }

/* Столбики статистики: без библиотек, просто высота в процентах от максимума за период. */
.chart { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow-x: auto; }
.chart__col { flex: 1 0 6px; min-width: 6px; height: 100%; display: flex; align-items: flex-end; }
.chart__bar { width: 100%; min-height: 1px; background: var(--brand); border-radius: 2px 2px 0 0; }
.chart__bar--reveals { background: #2f6f4f; }
.chart__bar--users { background: #8a6d3b; }

/* ---------- Адаптив ---------- */

.filter-toggle { display: none; }

@media (max-width: 1199px) {
    .layout { grid-template-columns: 260px minmax(0, 1fr); }
    /* Без места под третью колонку объявление читается одной колонкой. */
    .object { grid-template-columns: minmax(0, 1fr); }
    /* Повтор обязателен: правило выше перебивает .layout--wide, и страницы без боковой
       колонки (форма объекта, вход, оплата…) ужимались в первую колонку шириной 260px. */
    .layout--wide { grid-template-columns: minmax(0, 1fr); }
    .rail--ads { display: none; }
    /* Шапке не хватает места на ноутбуках: слоган уступает место входу и CTA. */
    .slogan { display: none; }
}

@media (max-width: 899px) {
    .layout, .layout--two { grid-template-columns: minmax(0, 1fr); }
    .admin-shell { grid-template-columns: minmax(0, 1fr); }
    .admin-nav { position: static; grid-auto-flow: column; overflow-x: auto; }
    .login-inline { display: none; }
    .header__actions .login-mobile { display: inline-flex; }
    .burger { display: inline-flex; }
    .nav { display: none; }
    .nav.is-open { display: block; }
    .filter-toggle { display: inline-flex; width: 100%; margin-bottom: 14px; }
    .sidebar { position: static; }
    .sidebar__inner { display: none; }
    .sidebar__inner.is-open { display: grid; gap: 16px; }
    .listing { grid-template-columns: minmax(0, 1fr); }
    .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
    body { font-size: 15px; }
    h1 { font-size: 1.35rem; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .tick-list { grid-template-columns: minmax(0, 1fr); }
    .header__top { gap: 8px 10px; flex-wrap: wrap; }
    .header__actions { flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
    .header__actions .btn--accent { font-size: .85rem; padding: 8px 10px; }
    .user-box { align-items: flex-start; max-width: 100%; }
    .user-box__email { max-width: 100%; }
    .user-box__links { justify-content: flex-start; }
    .logo__sub { display: none; }
    .logo__text { font-size: 1rem; }
    /* Кнопки не уместились в строку с логотипом (класс ставит app.js):
       логотип сверху, кнопки под ним, всё по центру. */
    .header__top--stacked { flex-direction: column; align-items: center; }
    .header__top--stacked .header__actions { margin-left: 0; justify-content: center; max-width: 100%; }
    .header__top--stacked .user-box { align-items: center; text-align: center; }
    .header__top--stacked .user-box__links { justify-content: center; }
    .modal__box { padding: 16px; margin: 2vh 0; }
    .phone-block .btn { flex: 1; }
    .listing__date { margin-left: 0; }
}

@media print {
    .header, .footer, .sidebar, .rail, .cookie-banner, .btn { display: none !important; }
    .layout { grid-template-columns: minmax(0, 1fr); }
}
