:root {
  --bg: #f6f7f9; --panel: #ffffff; --text: #1b1f24; --muted: #667080; --line: #e3e6eb;
  --accent: #2459d6; --accent-soft: #e8eefc; --down: #0e7340; --up: #c2372b; --tag: #fff3d6; --tag-text: #7a5300;
  --radius: 10px;
  --zebra: #f7f9fc; --hover: #eef3fd; --head: #f2f4f8;
  --on-accent: #ffffff; --on-up: #ffffff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418; --panel: #191d23; --text: #e6e9ee; --muted: #9aa3b0; --line: #2b313a;
    --accent: #7aa2ff; --accent-soft: #1e2a45; --down: #4cc68a; --up: #ff7b6e; --tag: #3a3020; --tag-text: #f2cf86;
    --zebra: #1d2229; --hover: #222b3a; --head: #1f242c;
    --on-accent: #0b1220; --on-up: #0b1220;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }      /* атрибут hidden сильнее любого display в стилях */
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
/* ссылки внутри текста — с подчёркиванием (не только цветом: WCAG 1.4.1); кнопки, карточки, меню — с классами, их не трогает */
:where(p, li, td:not(.price, .c-type), dd, footer, .sub, .lead, .foot, label) a:not([class]) {
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px;
  text-decoration-color: color-mix(in srgb, currentColor 45%, transparent); }
:where(p, li, td:not(.price, .c-type), dd, footer, .sub, .lead, .foot, label) a:not([class]):hover { text-decoration-color: currentColor; }
h1 { font-size: 28px; margin: 24px 0 4px; }
h2 { font-size: 19px; margin: 28px 0 10px; }
h3 { font-size: 17px; margin: 2px 0; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.lead, .sub, .crumbs { color: var(--muted); }
.sub { font-size: 13px; }
.lead { margin: 0 0 16px; }
.crumbs { margin: 18px 0 0; font-size: 14px; }

.top { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 18px; color: var(--text); display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 28px; height: 28px; flex: none; }
.logo span { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: -2px; }
@media (max-width: 720px) { .logo span { display: none; } }
nav a { margin-left: 18px; color: var(--muted); }
nav a.on { color: var(--text); font-weight: 600; }
/* пункты меню в шапке — нажимаемая высота не меньше 32 px (WCAG 2.5.8, удобно пальцем) */
.top nav a, .user-nav a { display: inline-block; padding: 7px 0; }
.user-nav .reg { padding: 7px 12px; }

.search input { width: 100%; padding: 11px 14px; font-size: 16px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--panel); color: var(--text); margin-bottom: 10px; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.filters label, .filters fieldset { max-width: 100%; display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.filters fieldset { border: 0; padding: 0; margin: 0; }
.filters legend { padding: 0; margin-bottom: 4px; }
.filters select { max-width: 100%; }
.filters select, .filters input[type=number] { padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--text); font-size: 14px; min-width: 0; }
.filters input[type=number] { width: 84px; }
.range { display: flex; gap: 6px; }
.chip { display: inline-block !important; }
.rooms { flex-direction: row !important; flex-wrap: wrap; }
.rooms legend { width: 100%; }
.chip input { position: absolute; opacity: 0; }
.chip span { display: inline-block; padding: 6px 11px; border: 1px solid var(--line); border-radius: 7px;
  margin-right: 4px; color: var(--text); cursor: pointer; background: var(--bg); }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
button, .btn { background: var(--accent); color: var(--on-accent); border: 0; border-radius: 7px; padding: 8px 18px;
  font-size: 14px; cursor: pointer; display: inline-block; }
.btn:hover { text-decoration: none; opacity: .9; }
.sorts { font-size: 14px; color: var(--muted); margin: 6px 0 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.sorts a.on { color: var(--text); font-weight: 600; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  color: var(--text); display: flex; flex-direction: column; }
.card:hover { text-decoration: none; border-color: var(--accent); }
.card .img { height: 160px; background: var(--accent-soft); overflow: hidden; }
.card .img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 12px 14px 14px; }
.dev { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 8px; }
.tag { display: inline-block; background: var(--tag); color: var(--tag-text); font-size: 12px; border-radius: 5px; padding: 1px 7px; }

.tbl-wrap:focus-visible { outline-offset: 0; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.tbl th { font-weight: 600; color: var(--muted); font-size: 13px; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl.compact { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.price a { font-weight: 600; color: var(--text); }
.down { color: var(--down); } .up { color: var(--up); } .ok { color: var(--down); }
.empty { color: var(--muted); text-align: center; padding: 28px; }
.pager { display: flex; gap: 16px; justify-content: center; align-items: center; margin: 16px 0; }

.hero { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 24px; align-items: start; margin-top: 8px; }
.hero-img { display: block; width: 100%; height: 240px; object-fit: cover; border-radius: var(--radius); background: var(--accent-soft); }
.desc { max-width: 70ch; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }

.flat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin-top: 12px; }
.plan { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.plan img { max-width: 100%; max-height: 460px; }
.noplan { color: var(--muted); padding: 80px 0; }
.bigprice { font-size: 28px; font-weight: 700; margin: 12px 0 0; }
.facts-list { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0; }
.facts-list dt { color: var(--muted); }
.facts-list dd { margin: 0; }

.chart { width: 100%; height: auto; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2.5; }
.chart circle { fill: var(--accent); }
.chart .g { stroke: var(--line); }
.chart text { fill: var(--muted); font-size: 12px; }

.foot { color: var(--muted); font-size: 13px; padding: 32px 16px; }
.foot .copy { margin: 0 0 6px; color: var(--text); }

@media (max-width: 800px) {
  .hero, .grid2, .flat { grid-template-columns: minmax(0, 1fr); }
  .hero-img { height: 180px; }
  nav a { margin: 0 14px 0 0; }
  h1 { font-size: 23px; }
  .filters input[type=number] { width: 72px; }
}

/* Просмотр картинки на весь экран (img[data-zoom]) */
img[data-zoom] { cursor: zoom-in; }
body.lb-on { overflow: hidden; }
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(10, 12, 15, .92);
      display: flex; align-items: center; justify-content: center; padding: 48px 16px; cursor: zoom-out; }
.lb[hidden] { display: none; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; background: #fff; border-radius: 6px;
          box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.lb-close { position: absolute; top: 8px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 50%;
            background: rgba(255, 255, 255, .12); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.lb-close:hover, .lb-close:focus-visible { background: rgba(255, 255, 255, .25); outline: none; }
.lb-orig { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); color: #fff; opacity: .8;
           font-size: 14px; text-decoration: underline; cursor: pointer; }
.lb-orig:hover { opacity: 1; }
.lb-img.photo { background: transparent; }

/* Превью планировки / фото ЖК в строке квартиры */
.tbl .pv { width: 56px; padding-right: 0; }
.tbl td.pv img { display: block; width: 56px; height: 56px; object-fit: contain; background: #fff;
                 border: 1px solid var(--line); border-radius: 6px; }
.tbl td.pv img[data-zoom-photo] { object-fit: cover; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tbl td.pv .pv-none { display: block; width: 56px; height: 56px; border-radius: 6px; background: var(--accent-soft); }

/* Карта на странице ЖК */
.map { position: relative; height: 380px; border: 1px solid var(--line); border-radius: var(--radius);
       overflow: hidden; background: var(--accent-soft); }
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-sec .sub { margin-top: 8px; }
@media (max-width: 800px) { .map { height: 300px; } }

/* Переключатель «Списком / На карте» */
.head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.head-row h1 { margin-bottom: 0; }
.view-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.view-switch > * { padding: 6px 14px; font-size: 14px; text-decoration: none; }
.view-switch .on { background: var(--accent-soft); font-weight: 600; }

/* Карта поиска */
.search-map { height: calc(100vh - 260px); min-height: 420px; border: 1px solid var(--line);
              border-radius: var(--radius); overflow: hidden; background: var(--accent-soft); margin-top: 12px; }
@media (max-width: 800px) { .search-map { height: 70vh; min-height: 360px; } }
.map-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 8px; }
.map-legend .dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: #2457d6;
                   border: 2px solid #fff; box-shadow: 0 0 0 1px #2457d6; vertical-align: -2px; }
.map-legend .dot.approx { background: #fff; box-shadow: 0 0 0 2px #8a94a6; border-color: #fff; }

/* Карточка ЖК во всплывающем окне карты (тёмная тема не влияет: фон окна MapLibre белый) */
.mcard { display: flex; gap: 10px; align-items: flex-start; font: 13px/1.35 system-ui, sans-serif; color: #1b1f24; }
.mcard img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; flex: none; }
.mcard-title { font-weight: 600; font-size: 14px; color: #2457d6; text-decoration: none; }
.mcard-title:hover { text-decoration: underline; }
.mcard-sub, .mcard-note { color: #667080; font-size: 12px; }
.mcard-facts { margin: 4px 0; }
.mcard-go { color: #2457d6; font-weight: 600; text-decoration: none; }
.maplibregl-popup-content { padding: 12px 28px 12px 12px; border-radius: 10px; }

/* Метка на странице ЖК */
.mpin { width: 26px; height: 34px; background: #2457d6; border: 3px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35);
        border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.mpin.approx { background: #8a94a6; }

/* ---------- Таблицы в стиле DataTables ---------- */
.tbl thead th { background: var(--head); }
.tbl.zebra > tbody > tr:nth-child(even) > td { background: var(--zebra); }
.tbl.zebra > tbody > tr:hover > td { background: var(--hover); }
.tbl tr.on > td { background: var(--accent-soft) !important; }
.tbl tfoot td { font-weight: 600; border-top: 2px solid var(--line); border-bottom: 0; background: var(--head); }

/* сортировка по заголовку */
.tbl th.sortable { padding: 0; }
.tbl th.sortable a { display: flex; align-items: center; gap: 4px; padding: 9px 12px; color: inherit; text-decoration: none; }
.tbl th.sortable.num a { justify-content: flex-end; }
.tbl th.sortable a:hover { color: var(--text); }
.tbl th.sortable .arr { display: inline-block; min-width: 10px; opacity: .35; font-size: 11px; }
.tbl th.sortable .arr::before { content: "↕"; }
.tbl th.sortable.asc, .tbl th.sortable.desc { color: var(--accent); }
.tbl th.sortable.asc .arr, .tbl th.sortable.desc .arr { opacity: 1; }
.tbl th.sortable.asc .arr::before { content: "▲"; font-size: 9px; }
.tbl th.sortable.desc .arr::before { content: "▼"; font-size: 9px; }

/* «Показано 1–50 из 844» · «Показывать по» */
.tbl-info { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 16px;
            margin: 12px 0 8px; font-size: 13px; color: var(--muted); }
.per-page a, .per-page b { display: inline-block; min-width: 34px; text-align: center; padding: 3px 6px; margin-left: 4px;
                           border: 1px solid var(--line); border-radius: 6px; text-decoration: none; }
.per-page b { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* нумерованная пагинация */
.pager { gap: 4px; flex-wrap: wrap; }
.pager a, .pager span { min-width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
                        padding: 0 8px; border-radius: 7px; text-decoration: none; }
.pager a { border: 1px solid var(--line); background: var(--panel); }
.pager a:hover { background: var(--hover); }
.pager .cur { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.pager .dis { color: var(--muted); opacity: .45; border: 1px solid var(--line); }
.pager .gap { min-width: 20px; color: var(--muted); }

/* ---------- Страница ЖК: панели одинаковой высоты ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; margin-top: 24px; }
.panel > h2:first-child { margin-top: 0; }
.panel .tbl-wrap { border-radius: 8px; }
.cards2 { align-items: stretch; margin-top: 8px; }
.cards2 .panel { margin-top: 16px; display: flex; flex-direction: column; }
.cards2 .panel .tbl-wrap { flex: 1; background: var(--panel); }

/* группы корпусов по сроку сдачи */
.tbl.groups .grp-item { display: none; }
.tbl.groups .grp.open .grp-item { display: table-row; }
.tbl.groups .grp-item > td:first-child { padding-left: 34px; }
.tbl.groups .grp-item > td { font-size: 13px; background: var(--panel) !important; }
.tbl.groups .grp-item:hover > td { background: var(--hover) !important; }
.tbl.groups .grp-head > td { background: var(--zebra); }
.tbl.groups .grp-item.on > td { background: var(--accent-soft) !important; }
.grp-toggle { all: unset; cursor: pointer; color: var(--accent); font-weight: 600; }
.grp-toggle::before { content: "▸"; display: inline-block; width: 16px; transition: transform .15s; color: var(--muted); }
.grp.open .grp-toggle::before { transform: rotate(90deg); }
.grp-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.grp-single { font-weight: 600; padding-left: 16px; }

/* шапка блока квартир */
.dt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.dt-head h2 { margin: 0; }
.dt .reset { font-size: 14px; }
.dt .dt-filters { border: 0; padding: 12px 0 4px; background: none; box-shadow: none; }

/* компактные таблицы панелей: без переносов внутри значений */
.tbl.compact th, .tbl.compact td { padding: 8px 10px; }
.cards2 .tbl td:first-child { white-space: nowrap; }
.cards2 .panel .tbl-wrap { flex: 0 1 auto; }   /* таблица своей высоты, без пустого «хвоста» рамки */
.panel .hint { margin: 10px 2px 0; font-size: 13px; }
.tbl.zebra > tbody > tr > td { vertical-align: middle; }
.dt-actions { display: inline-flex; gap: 16px; align-items: baseline; font-size: 14px; }
.dt-actions a.on { font-weight: 600; }
.filters select[name=finish], .filters select[name=building] { max-width: 220px; }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; font-size: 14px; color: var(--text);
                        padding: 7px 2px; cursor: pointer; white-space: nowrap; }
.filters label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* ---------- Админка ---------- */
.adm-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; margin: 4px 0 16px;
           padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.adm-nav a { padding: 6px 12px; border-radius: 7px; text-decoration: none; }
.adm-nav a.on { background: var(--accent-soft); font-weight: 600; }
.adm-user { margin-left: auto; color: var(--muted); font-size: 14px; display: inline-flex; gap: 8px; align-items: center; }
.adm-msg { background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; }
.adm-err { background: #fde8e6; color: #9b1c12; border-radius: 8px; padding: 10px 14px; }
.adm-err-text { color: var(--up); }
.run { color: var(--accent); font-weight: 600; }
.adm-login { max-width: 380px; margin: 40px auto; }
.adm-form { display: flex; flex-direction: column; gap: 12px; }
.adm-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.adm-form input:not([type=checkbox]) { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font: inherit;
                                        background: var(--bg); color: var(--text); }
.adm-form label.check { flex-direction: row; align-items: center; color: var(--text); font-size: 14px; }
.adm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.adm-cards .panel { margin-top: 0; display: flex; flex-direction: column; gap: 4px; }
.adm-cards b { font-size: 24px; }
.adm-cards span { color: var(--muted); font-size: 13px; }
.adm-actions { white-space: nowrap; }
.adm-scroll { max-height: 420px; overflow: auto; }
.adm-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 8px; }
.tbl tr.off td { opacity: .55; }
.tbl td.bad { color: var(--up); font-weight: 600; }
.tbl td.warn { color: #9a6a00; }
form.inline { display: inline; }
.abtn { padding: 7px 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--panel); color: var(--text); cursor: pointer; font: inherit; font-size: 14px; }
.abtn:hover { background: var(--hover); }
.abtn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.abtn.ghost { background: transparent; }
.abtn.small { padding: 4px 9px; font-size: 13px; }
.abtn.link { border: 0; background: none; color: var(--accent); padding: 0; text-decoration: underline; }
.adm-user form.inline button.abtn.link { background: none; border: 0; color: var(--accent); padding: 0; font-weight: 400; text-decoration: underline; }
.adm-actions form.inline button.abtn, .adm-cards form.inline button.abtn { background: var(--panel); color: var(--text); border: 1px solid var(--line); }
.adm-actions form.inline button.abtn:hover { background: var(--hover); }
.head-row form.inline button.abtn.primary, p form.inline button.abtn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
/* темп продаж: полоска пропорционально значению */
.tbl td.pace { position: relative; min-width: 110px; }
.tbl td.pace .bar { position: absolute; left: 8px; bottom: 5px; height: 3px; border-radius: 2px; background: var(--accent); opacity: .55; max-width: calc(100% - 16px); }
.adm-help summary { cursor: pointer; font-weight: 600; }
.adm-help p { font-size: 14px; color: var(--muted); max-width: 95ch; }

/* ---------- аккаунт пользователя ---------- */
.top-in { gap: 12px 20px; flex-wrap: wrap; }
.user-nav { display: flex; align-items: center; gap: 4px 14px; font-size: 14px; flex-wrap: wrap; }
.user-nav a { color: var(--text); white-space: nowrap; }
.user-nav a.on { color: var(--accent); font-weight: 600; }
.user-nav .reg { background: var(--accent); color: var(--on-accent); border-radius: 7px; }
.user-nav .reg:hover { text-decoration: none; opacity: .9; }
.bell { position: relative; }
.badge { display: inline-block; min-width: 18px; padding: 1px 6px; border-radius: 9px; background: var(--up); color: var(--on-up);
  font-size: 12px; font-weight: 600; line-height: 16px; text-align: center; vertical-align: middle; }
.bell .badge { position: absolute; top: -8px; right: -12px; }
.auth { max-width: 440px; margin: 32px auto; padding: 24px 28px; }
.panel.auth, .acc-box, .search-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.auth h1 { margin-top: 0; }
.form { display: flex; flex-direction: column; gap: 12px; margin: 12px 0; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.form label.check { flex-direction: row; align-items: flex-start; gap: 8px; }
.form label.check input { margin-top: 3px; }
.form input[type=email], .form input[type=password], .form input[type=text], .form input:not([type]) {
  padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 16px;
  background: var(--panel); color: var(--text); }
.form button { align-self: flex-start; }
.alert { background: #fdecea; color: #8a1f17; border: 1px solid #f5c2bd; border-radius: 7px; padding: 9px 12px; }
.note { border-radius: 7px; padding: 10px 14px; }
.ok-note { background: #e7f6ee; color: #0d5c33; border: 1px solid #bfe5cf; }
@media (prefers-color-scheme: dark) {
  .alert { background: #3a1d1b; color: #ffb4ab; border-color: #6b2c26; }
  .ok-note { background: #15301f; color: #9be0b7; border-color: #245a3a; }
}
.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.btn-ghost { display: inline-block; background: transparent; color: var(--accent); border: 1px solid var(--accent);
  border-radius: 7px; padding: 7px 16px; font-size: 14px; cursor: pointer; }
.btn-ghost:hover { text-decoration: none; background: var(--accent-soft); }
.btn-danger { background: var(--up); }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.acc-box { padding: 16px 20px; }
.acc-box h2 { margin-top: 0; font-size: 18px; }
.acc-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
details.danger summary { cursor: pointer; color: var(--up); margin-top: 12px; }
.fav-f { display: inline; margin: 0; }
.fav { background: none; border: 0; padding: 2px 6px; font-size: 20px; line-height: 1; color: var(--muted);
  cursor: pointer; text-decoration: none; border-radius: 6px; }
.fav:hover { color: #e0a100; text-decoration: none; background: var(--accent-soft); }
.fav.on { color: #e0a100; }
.fav:focus-visible { outline: 2px solid var(--accent); }
.tbl .fav-cell { width: 36px; text-align: center; padding-left: 4px; padding-right: 8px; }
.h1-row { display: flex; align-items: center; gap: 8px; }
.h1-row h1 { margin-bottom: 4px; }
.h1-row .fav { font-size: 26px; }
.tag.sold { background: var(--line); color: var(--muted); }
.tbl tr.new-row > td:first-child { box-shadow: inset 3px 0 0 var(--down); }
.save-search { display: inline; margin: 0; }
.save-search button { padding: 5px 12px; font-size: 13px; }
.search-list { display: grid; gap: 12px; }
.search-item { display: flex; justify-content: space-between; gap: 12px 20px; padding: 14px 18px; flex-wrap: wrap; }
.search-item.on { border-color: var(--accent); }
.search-item h2 { margin: 0 0 4px; font-size: 18px; }
.si-facts { margin-top: 6px; font-size: 14px; }
.si-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.si-actions details { position: relative; }
.si-actions details summary { list-style: none; }
.si-actions details summary::-webkit-details-marker { display: none; }
.si-actions details[open] .form { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  min-width: 260px; }
@media (max-width: 640px) {
  .user-nav { width: 100%; }
  .auth { padding: 18px 16px; margin: 16px auto; }
}
.abtn.danger { color: var(--up); border-color: var(--up); }
.adm-pick { height: 340px; margin: 4px 0 2px; }

/* ---------- уведомление о cookie ---------- */
.cookie-bar { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px 20px; padding: 14px 18px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0, 0, 0, .14); font-size: 14px; }
.cookie-bar p { margin: 0; flex: 1; }
.cookie-bar form { margin: 0; flex-shrink: 0; }
@media (max-width: 560px) { .cookie-bar { flex-direction: column; align-items: stretch; } .cookie-bar button { width: 100%; } }
.doc { max-width: 760px; }

/* ---------- сравнение и ипотека ---------- */
.flat-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cmp-btn.on { background: var(--accent-soft); }
.cmp-wrap { background: var(--panel); }
.tbl.cmp th[scope=col] { vertical-align: top; min-width: 170px; color: var(--text); font-size: 14px; white-space: normal; }
.tbl.cmp th[scope=col] img { display: block; width: 96px; height: 96px; object-fit: contain; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; cursor: zoom-in; }
.tbl.cmp th[scope=row] { color: var(--muted); font-weight: 600; white-space: nowrap; width: 1%; }
.tbl.cmp td.best { background: #e7f6ee; color: #0d5c33; font-weight: 600; }
@media (prefers-color-scheme: dark) { .tbl.cmp td.best { background: #15301f; color: #9be0b7; } }
.cmp-remove { display: block; margin-top: 6px; background: none; color: var(--muted); padding: 0; font-size: 12px; }
.cmp-remove:hover { color: var(--up); }
.mortgage { padding: 16px 20px; margin-top: 24px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.mortgage h2 { margin-top: 0; }
.mg-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.mg-form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.mg-form input { padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 16px; background: var(--panel); color: var(--text); }
.mg-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 4px; }
.chip-btn { background: var(--accent-soft); color: var(--accent); padding: 4px 10px; font-size: 13px; border-radius: 14px; }
.mg-out { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 16px; margin: 14px 0 8px; }
.mg-out div { display: flex; flex-direction: column; }
.mg-out dt { color: var(--muted); font-size: 13px; }
.mg-out dd { margin: 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mg-out .mg-big { font-size: 24px; color: var(--accent); }

/* ---------- для застройщиков ---------- */
.dev-hero { max-width: 860px; }
.dev-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 20px 0; }
.dev-stats div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 2px; }
.dev-stats b { font-size: 26px; color: var(--accent); font-variant-numeric: tabular-nums; }
.dev-stats span { color: var(--muted); font-size: 13px; }
.dev-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 24px 0; }
.dev-card, .dev-how, .dev-form { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.dev-card h2, .dev-how h2, .dev-form h2 { margin-top: 0; font-size: 18px; }
.dev-card p { margin: 0 0 8px; }
.dev-how { margin-bottom: 24px; }
.dev-how ol { padding-left: 20px; display: grid; gap: 8px; }
.dev-form { max-width: 760px; margin-bottom: 24px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.form select, .form textarea, .form input[type=tel] { padding: 9px 11px; border: 1px solid var(--line); border-radius: 7px;
  font: inherit; font-size: 16px; background: var(--panel); color: var(--text); }
.form textarea { resize: vertical; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.cookie-settings { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; margin: 20px 0; }
.cookie-settings h2 { margin-top: 0; }
@media (max-width: 560px) { .cookie-actions button { flex: 1; } }

/* ---------- что рядом ---------- */
.nearby { margin: 24px 0; }
.nb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.nb-item { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.nb-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.nb-head .sub { margin-left: auto; }
.nb-item ul { margin: 6px 0 0; padding-left: 18px; font-size: 14px; }
.nb-item li { margin: 2px 0; }
.todo { background: #fff3d6; color: #7a5300; padding: 0 4px; border-radius: 4px; }

/* карта: режим «цена м²» */
.map-mode { display: flex; flex-direction: column; background: #fff; font: 13px/1.3 system-ui, sans-serif; color: #1b1f24; }
.map-mode > button { width: auto !important; height: auto !important; padding: 6px 10px; text-align: left; color: #1b1f24; background: #fff; }
.map-mode > button.on { background: #e8eefc; font-weight: 600; color: #2457d6; }
.map-legend-price { padding: 8px 10px; border-top: 1px solid #e3e6eb; }
.mlp-title { font-size: 12px; color: #667080; margin-bottom: 4px; }
.mlp-scale { display: flex; flex-direction: column; gap: 3px; }
.mlp-item { display: flex; align-items: center; gap: 6px; font-size: 12px; white-space: nowrap; }
.mlp-item i { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }

/* ---------- телефон: фильтры-кнопка и карточки квартир ---------- */
.fbox > .fbox-sum { display: none; }
@media (max-width: 700px) {
  .fbox { margin: 8px 0 12px; }
  .fbox > .fbox-sum { display: flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; padding: 10px 14px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--panel); font-weight: 600; }
  .fbox > .fbox-sum::-webkit-details-marker { display: none; }
  .fbox > .fbox-sum::after { content: "▾"; margin-left: auto; color: var(--muted); }
  .fbox[open] > .fbox-sum::after { content: "▴"; }
  .fbox[open] > .filters { padding-top: 12px; }
  .filters label, .filters fieldset { width: 100%; }
  .filters select { width: 100%; }

  .tbl-wrap:has(.flats-tbl) { border: 0; overflow: visible; background: transparent; }
  .flats-tbl, .flats-tbl tbody { display: block; }
  .flats-tbl thead { display: none; }
  .flats-tbl tbody tr { display: grid; grid-template-columns: 64px 1fr auto; column-gap: 10px; row-gap: 2px;
    background: var(--panel) !important; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; }
  .flats-tbl tbody tr > td { display: block; padding: 0; border: 0; background: transparent !important; text-align: left; }
  .flats-tbl td.pv { grid-row: 1 / span 4; grid-column: 1; width: auto; }
  .flats-tbl td.c-type { grid-column: 2; font-weight: 600; font-size: 15px; }
  .flats-tbl td.fav-cell { grid-column: 3; grid-row: 1; width: auto; padding: 0; }
  .flats-tbl td.c-cx { grid-column: 2 / span 2; font-size: 13px; }
  .flats-tbl td.c-price { grid-column: 2 / span 2; font-size: 16px; }
  .flats-tbl td.c-area, .flats-tbl td.c-floor, .flats-tbl td.c-m2, .flats-tbl td.c-date, .flats-tbl td.c-finish {
    grid-column: 2 / span 2; font-size: 13px; color: var(--muted); }
  .flats-tbl td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .flats-tbl td.c-date .sub { display: inline; margin-left: 4px; }
  .flats-tbl td.c-date .sub::before { content: "· "; }
  .flats-tbl td.empty { grid-column: 1 / -1; text-align: center; }
  .flats-tbl tbody tr.new-row > td:first-child { box-shadow: none; }
  .flats-tbl tbody tr.new-row { border-left: 3px solid var(--down); }
}
@media (max-width: 700px) {
  .flats-tbl tbody tr > td { text-align: left !important; }
  .flats-tbl td.c-type { grid-row: 1; order: 1; }
  .flats-tbl td.fav-cell { order: 2; }
  .flats-tbl td.c-price { order: 3; margin: 2px 0; }
  .flats-tbl td.c-price { white-space: normal; }       /* цена, «−N%» и «▼ …» — переносятся целиком, не за край */
  .flats-tbl td.c-price > * { white-space: nowrap; }
  .flats-tbl td.c-price .sub { display: inline-block; margin-left: 6px; }
  .flats-tbl td.c-cx { order: 4; }
  .flats-tbl td.c-area { order: 5; } .flats-tbl td.c-floor { order: 6; } .flats-tbl td.c-m2 { order: 7; }
  .flats-tbl td.c-date { order: 8; } .flats-tbl td.c-finish { order: 9; }
  .flats-tbl td.c-cx .sub { display: inline; margin-left: 4px; }
  .flats-tbl td.c-cx .sub::before { content: "· "; }
}
@media (max-width: 700px) {
  .filters label.chip { width: auto; }
  .filters .rooms { flex-direction: row !important; gap: 6px; }
  .filters .range { width: 100%; }
  .filters .range input[type=number] { flex: 1; width: auto; min-width: 0; }
  .filters button[type=submit] { width: 100%; padding: 11px; font-size: 15px; }
}

/* ---------- доступность ---------- */
.skip { position: absolute; left: 8px; top: -60px; z-index: 200; background: var(--accent); color: var(--on-accent);
  padding: 8px 14px; border-radius: 7px; font-weight: 600; }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button:focus-visible, .btn:focus-visible { outline-color: var(--text); }
/* цели переходов (main у ссылки «К содержимому»): фокус ставится и щелчком мыши — без рамки вокруг всей страницы */
[tabindex="-1"]:focus { outline: none; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.cmp-tabs { margin: 0 0 16px; }
.tbl.cmp th[scope=col] img.cmp-photo { object-fit: cover; }
.launch { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.launch li { display: flex; gap: 12px; align-items: flex-start; }
.lc-mark { flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; color: #fff; background: var(--muted); }
.lc-ok .lc-mark { background: var(--down); } .lc-fail .lc-mark { background: var(--up); }
.lc-warn .lc-mark { background: #b26b00; } .lc-optional .lc-mark { background: transparent; color: var(--muted); border: 2px solid var(--line); }
.lc-hint { font-size: 13px; margin-top: 2px; }

/* ---------- выгрузка, печать, ссылка-подборка ---------- */
.page-actions { display: inline-flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-box { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; }
.share-box p { margin: 0 0 8px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.share-row form { margin: 0; }
.share-row input[readonly] { flex: 1; min-width: 220px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--text); font-size: 14px; }
@media print {
  @page { margin: 12mm; }
  body { background: #fff !important; color: #000; }
  .top, .foot, .cookie-bar, .skip, .fbox, .dt-actions, .page-actions, .share-box, .tbl-info, .pager, .per-page,
  .fav-cell, .si-actions, .flat-actions, .cmp-tabs, .cmp-remove, #cmp-clear, .lb, .map, .map-sec, .mortgage,
  .nearby, .view-switch, button { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  a { color: #000; text-decoration: none; }
  .panel, .tbl-wrap { border: 0 !important; box-shadow: none !important; overflow: visible !important; }
  .tbl th, .tbl td { padding: 4px 6px; font-size: 10.5pt; }
  .tbl tr { break-inside: avoid; }
  .tbl.zebra > tbody > tr:nth-child(even) > td { background: #f3f3f3 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* на бумаге — обычная таблица, даже если лист узкий и сработала бы «мобильная» вёрстка карточками */
  .flats-tbl { display: table !important; } .flats-tbl thead { display: table-header-group !important; }
  .flats-tbl tbody { display: table-row-group !important; } .flats-tbl tbody tr { display: table-row !important; }
  .flats-tbl tbody tr > td { display: table-cell !important; } .flats-tbl td[data-label]::before { content: none !important; }
  h1 { font-size: 18pt; margin: 0 0 6pt; }
}

/* ---------- «?» у входа: для чего нужна регистрация ---------- */
.why-wrap { position: relative; display: inline-flex; }
.why-btn { width: 26px; height: 26px; padding: 0; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 14px; line-height: 26px; text-align: center; }
.why-btn[aria-expanded="true"] { background: var(--accent); color: var(--on-accent); }
.why-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 360px; max-width: calc(100vw - 32px);
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .16); padding: 16px 18px; font-size: 14px; line-height: 1.45; white-space: normal; }
.why-pop[hidden] { display: none; }
.why-pop::before { content: ""; position: absolute; top: -7px; right: 8px; width: 12px; height: 12px; background: var(--panel);
  border-left: 1px solid var(--line); border-top: 1px solid var(--line); transform: rotate(45deg); }
.why-pop h2 { font-size: 16px; margin: 0 28px 8px 0; }
.why-pop ul { margin: 8px 0; padding-left: 18px; display: grid; gap: 6px; }
.why-pop p { margin: 6px 0; }
.why-close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; padding: 0; border-radius: 50%;
  background: transparent; color: var(--muted); font-size: 20px; line-height: 28px; }
.why-close:hover { background: var(--hover); color: var(--text); }
.why-actions { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px !important; }
.user-nav .why-actions a.btn { color: var(--on-accent); }
@media (max-width: 640px) {
  .why-wrap { position: static; }
  .why-pop { position: fixed; left: 16px; right: 16px; top: 64px; width: auto; max-height: calc(100vh - 80px); overflow: auto; }
  .why-pop::before { display: none; }
}
@media print { .why-wrap { display: none !important; } }
.why-pop a:not(.btn) { color: var(--accent); text-decoration: underline; }
.user-nav .why-wrap { margin-left: -6px; }

/* ---------- помощь ---------- */
.help section { margin: 20px 0; }
.faq { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; }
.faq summary { cursor: pointer; padding: 12px 16px; font-weight: 600; list-style: none; display: flex; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "+"; color: var(--accent); font-weight: 700; width: 12px; }
.faq[open] summary::before { content: "−"; }
.faq p { margin: 0; padding: 0 16px 14px 38px; }
@media print { .faq { break-inside: avoid; } .faq p { display: block !important; } }
/* ---------- сообщить об ошибке ---------- */
.report { margin: 28px 0 8px; }
.report summary { cursor: pointer; color: var(--muted); font-size: 14px; display: inline-block; }
.report summary:hover { color: var(--text); }
.report-form { max-width: 520px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
@media print { .report { display: none !important; } }
.notify-opts { border: 0; padding: 0 0 0 4px; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.notify-opts[disabled] { opacity: .5; }
.notify-opts legend { padding: 0; margin-bottom: 4px; }
.check.switch { font-size: 15px; }

/* ---------- посадочные страницы ---------- */
.chips-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.chips-nav a { padding: 6px 12px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); font-size: 14px; }
.chips-nav a:hover { border-color: var(--accent); text-decoration: none; }
.link-cloud ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.link-cloud h2 { font-size: 18px; }
.seo-faq { margin: 28px 0; max-width: 860px; }
.guide { max-width: 760px; }
.guide h2 { margin-top: 28px; }
.guide li { margin: 6px 0; }
.guide .tip { background: var(--accent-soft); border-radius: 8px; padding: 12px 16px; }

/* ---------- подсказки в поиске ЖК ---------- */
.suggest-wrap { position: relative; }
.suggest { position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 40; margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 28px rgba(0, 0, 0, .14);
  max-height: 420px; overflow-y: auto; }
.suggest[hidden] { display: none; }
.suggest li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 9px 12px; border-radius: 7px; cursor: pointer; }
.suggest li[aria-selected="true"], .suggest li:hover { background: var(--hover); }
.sg-name { font-weight: 600; }
.sg-sub { grid-column: 1; color: var(--muted); font-size: 13px; }
.sg-n { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (max-width: 560px) { .suggest li { grid-template-columns: 1fr; } .sg-n { grid-column: 1; grid-row: auto; } }

/* поле «ЖК, город или метро» в фильтрах — с подсказками */
.filters .place-f { flex: 1 1 260px; min-width: 220px; max-width: 360px; }
.filters .place-f .suggest-wrap { display: block; }
.filters .place-f input[type=search] { width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.filters .place-f .suggest { color: var(--text); font-size: 14px; width: max(100%, 460px); right: auto; }
.suggest li[data-kind="city"] .sg-name::before { content: "📍 "; }
.suggest li[data-kind="metro"] .sg-name { color: var(--accent); }
.suggest li[data-kind="developer"] .sg-name::before { content: "🏗 "; }
@media (max-width: 560px) { .filters .place-f { max-width: none; } .filters .place-f .suggest { width: auto; right: 0; } }

/* «Недавно смотрели» — лента карточек, на телефоне листается вбок */
.seen { margin: 18px 0 8px; }
.seen[hidden] { display: none; }
.seen-head { display: flex; align-items: baseline; gap: 14px; }
.seen-head h2 { margin: 0 0 8px; font-size: 17px; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.seen-list { list-style: none; margin: 0; padding: 2px 2px 8px; display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x proximity; }
.seen-list li { flex: 0 0 200px; scroll-snap-align: start; }
.seen-card { display: grid; grid-template-columns: 64px 1fr; grid-template-rows: auto auto auto; gap: 0 10px; height: 100%;
  padding: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); font-size: 13px; }
.seen-card:hover { text-decoration: none; border-color: var(--accent); }
.seen-img { grid-row: 1 / span 3; width: 64px; height: 64px; border-radius: 6px; overflow: hidden; background: var(--head); }
.seen-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.seen-card b { font-size: 13px; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.seen-card .sub { font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seen-price { font-weight: 600; }
.facet-note { max-width: 860px; background: var(--accent-soft); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }

/* страницы ошибок */
.err { max-width: 760px; margin: 24px 0 8px; }
.err-code { font-size: 56px; font-weight: 700; color: #0e8a47; margin: 0; line-height: 1; }
.err .lead { margin-bottom: 16px; }
.err-search { margin: 0 0 8px; }

/* цена относительно похожих */
.ppos h2 { margin-top: 0; }
.ppos h3 { font-size: 16px; margin: 18px 0 6px; }
.ppos-v { white-space: nowrap; }
.ppos-lo { color: var(--down); } .ppos-hi { color: var(--up); } .ppos-mid { color: var(--muted); }
.ppos-bar { position: relative; height: 10px; border-radius: 5px; margin: 14px 6px 4px;
  background: linear-gradient(90deg, var(--down), #c9a227 50%, var(--up)); opacity: .85; }
.ppos-dot { position: absolute; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%;
  background: var(--panel); border: 3px solid var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.ppos-scale { display: flex; justify-content: space-between; font-size: 13px; }
.ppos-list { list-style: none; margin: 0; padding: 0; }
.ppos-list li { display: grid; grid-template-columns: 1fr auto auto; gap: 2px 12px; padding: 8px 0; border-top: 1px solid var(--line); align-items: baseline; }
.ppos-list li .sub { grid-column: 1; grid-row: 2; font-size: 13px; }
.ppos-save { color: var(--down); font-weight: 600; white-space: nowrap; }
@media (max-width: 560px) { .ppos-list li { grid-template-columns: 1fr auto; } .ppos-save { grid-column: 2; } }
.dev-stats b.down { color: var(--down); } .dev-stats b.up { color: var(--up); }

.watch-hint { margin-top: 12px; }

/* капча при регистрации */
.captcha { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: center; }
.captcha-img { border: 1px solid var(--line); border-radius: 7px; background: #f6f7f9; }
.captcha label, .captcha .sub { grid-column: 1 / -1; }
.captcha-new { justify-self: start; }

/* станции метро */
.metro-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; margin: 16px 0; }
.metro-list a { display: flex; flex-direction: column; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; color: var(--text); }
.metro-list a:hover { border-color: var(--accent); text-decoration: none; }
.metro-list .sub { font-size: 13px; }

/* отметки скидок */
.disc { display: inline-block; padding: 1px 7px; border-radius: 10px; background: #e3f4ea; color: #0b6a35; font-size: 12px;
  font-weight: 700; white-space: nowrap; vertical-align: middle; }
@media (prefers-color-scheme: dark) { .disc { background: #173b28; color: #7fe0a8; } }
.disc-big { font-size: 15px; padding: 2px 9px; }
.disc-link { font-weight: 600; color: var(--down); }

/* ---------- телефон: мелкие ссылки и кнопки — выше, чтобы попадать пальцем (не меньше 32 px) ---------- */
@media (max-width: 800px) {
  .sorts a, .dt-actions a, .dt-head > a, .ppos-list a, .seen-head .link-btn { display: inline-block; padding-top: 6px; padding-bottom: 6px; }
  .chip-btn { padding: 7px 12px; }
  .report summary { padding-top: 6px; padding-bottom: 6px; }
}

/* ---------- телефон: шапка в две строки и не прилипает (раньше — 4 строки ≈ 200 px поверх страницы) ---------- */
@media (max-width: 800px) {
  .top { position: static; }
  .top-in { gap: 0 10px; min-height: 0; padding-top: 6px; padding-bottom: 2px; }
  .top-in > nav:not(.user-nav) { order: 3; flex: 1 0 100%; display: flex; overflow-x: auto; white-space: nowrap;
    scrollbar-width: none; margin: 0 -16px; padding: 0 16px; }
  .top-in > nav:not(.user-nav)::-webkit-scrollbar { display: none; }
  .user-nav { width: auto; margin-left: auto; gap: 0 12px; flex-wrap: nowrap; }
  .user-nav .reg { padding: 6px 10px; }
}
@media (max-width: 400px) { .logo { font-size: 16px; } .logo-mark { width: 24px; height: 24px; } .user-nav .why-wrap { display: none; } .user-nav { font-size: 13px; gap: 0 10px; } .user-nav .reg { padding: 6px 8px; } }
.chips-nav a[aria-current] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }

/* обзор цен за месяц (review.html) */
.review-facts { margin: 0 0 8px; padding-left: 20px; line-height: 1.6; }
.review-facts li { margin: 4px 0; }
.dl-history { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.dl-history h3 { font-size: 15px; margin: 0 0 6px; }
.dl-history ul { margin: 0 0 6px; padding-left: 18px; font-size: 14px; }

/* ход строительства (страница ЖК) */
.progress-text p { margin: 0 0 8px; }
.progress-text details summary { cursor: pointer; color: var(--accent); margin-bottom: 8px; }
.progress-photos { list-style: none; padding: 0; margin: 12px 0 8px; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.progress-photos img { width: 100%; height: auto; aspect-ratio: 15 / 8; object-fit: cover; border-radius: 8px; display: block;
  background: var(--line); }
@media (max-width: 560px) { .progress-photos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
