/* ─── Кожа «как KLAIT» (24.09.2026) ────────────────────────────────────────
   Просьба юзера: стилистика как у klait.ru, акцент — НАШ зелёный (макет
   согласован 24.09). Меняется только вид: цвета, шрифт, скругления, тёмная
   навигация. Раскладка, плотность ленты (фото 88×88), высоты кнопок и
   ширины режимов — прежние: они подобраны замерами 04.08, и кожа их не трогает.

   Отдельным файлом и ПОСЛЕДНИМ в каскаде: вся кожа снимается удалением одной
   строки `<link>` в index.html, без раскопок по пяти файлам.

   Что взято у KLAIT:
     · тёмная поверхность (`--dark`) — навигация и одна «карточка-герой» на
       экране (цена лота), больше нигде: второй тёмный блок спорит с первым;
     · крупные скругления карточек, поля и кнопки — «таблетки»;
     · выбранный сегмент — тёмная пилюля, а не белая плашка на сером;
     · шрифт Geologica (самохостинг, как Inter: CSP `default-src 'self'`).
   ──────────────────────────────────────────────────────────────────────── */

@font-face {
  font-family: 'Geologica';
  src: url('/static/fonts/geologica-var-cyr-lat.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --r: 22px;
  --r-sm: 14px;
  --shadow: 0 1px 2px rgba(23, 25, 26, .04);
  /* Нижняя навигация стала плавающей таблеткой: 52 кнопка + 2×6 поля + 10
     отступ от края. На это число отступают снизу все экраны и тост. */
  --nav-h: 74px;
}

/* ═══ КОМПОНЕНТЫ — общий словарь всех экранов ═══════════════════════════
   Экраны собираются из этих кирпичей, а не рисуют каждый своё: «карточка с
   иконкой в круге» на экране лота, в «Ещё» и в задачах — ОДИН класс. */

/* Линейная иконка (icons.js). Размер от кегля, цвет от текста. Отступ после
   неё заменяет пробел, который стоял за эмодзи; в рядах с `gap` он лишний. */
.ic {
  width: 1.15em; height: 1.15em; flex: none;
  display: inline-block; vertical-align: -.2em;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  margin-inline-end: .32em;
}
/* Одинокая иконка (кнопка без подписи) отступа не держит — флаг ставит icons.js. */
.ic-solo, .ico > .ic, .pill > .ic { margin-inline-end: 0; }
.ic-ok { color: var(--ok); }
.ic-no { color: var(--danger); }
.ic-warn { color: var(--warn); }
.ic-info { color: var(--ink-soft); }
.ic-dot { fill: currentColor; stroke: none; }
.ic-dot-high { color: var(--danger); }
.ic-dot-mid { color: var(--warn); }
.ic-dot-ok { color: var(--ok); }
.ic-dot-none { color: var(--line); }

/* Иконка в круге — метка заголовка карточки (как у KLAIT у каждого блока). */
.ico {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  display: inline-grid; place-items: center;
  background: var(--surface); color: var(--ink);
}
.ico > .ic { width: 20px; height: 20px; }

/* Карточка раздела: белая, крупное скругление, без рамки. */
.sec {
  background: var(--bg); border-radius: var(--r);
  padding: var(--sp-4); margin: var(--sp-3) 0 0;
}
.sec-h { display: flex; align-items: center; gap: var(--sp-3); min-width: 0; }
.sec-h .t { flex: 1; min-width: 0; }
.sec-h .t b { display: block; font-size: var(--fs-ui); font-weight: 600; line-height: 1.25; }
.sec-h .t small { display: block; font-size: var(--fs-meta); color: var(--ink-soft); margin-top: 1px; }
.sec-h .aside { flex: none; font-size: var(--fs-small); color: var(--ink-soft); }
.sec-h + * { margin-top: var(--sp-3); }

/* Тёмная карточка-герой: одна на экран, главное число экрана. */
.hero {
  background: var(--dark); color: var(--on-dark);
  border: 2px solid var(--accent); border-radius: var(--r);
  padding: var(--sp-4) 18px;
}
.hero .ico { background: var(--dark-2); color: var(--on-dark); }
.hero .sub, .hero small { color: var(--on-dark-soft); }
.hero-big {
  font-size: var(--fs-display); font-weight: 700; letter-spacing: -.02em;
  line-height: 1.08; font-variant-numeric: tabular-nums;
}
.hero-stats {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  margin-top: var(--sp-3); padding-top: var(--sp-3);
  border-top: 1px solid var(--dark-2);
}
.hero-stats > div { min-width: 0; }
.hero-stats > div + div { border-left: 1px solid var(--dark-2); padding-left: var(--sp-3); }
.hero-stats b { display: block; font-size: var(--fs-lead); font-weight: 700; font-variant-numeric: tabular-nums; }
.hero-stats span { display: block; font-size: var(--fs-meta); color: var(--on-dark-soft); }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--sp-2); }
.hero-chips span {
  background: var(--dark-2); color: var(--on-dark); border-radius: var(--r-pill);
  padding: 4px 10px; font-size: var(--fs-meta);
}

/* Пилюля статуса. Точка слева — вариант `.dotted`. */
.pill {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  border-radius: var(--r-pill); padding: 3px 10px;
  font-size: var(--fs-meta); font-weight: 600; line-height: 1.5;
  background: var(--surface); color: var(--ink-soft);
}
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.pill.no { background: var(--danger-soft); color: var(--danger); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.acc { background: var(--accent-soft); color: var(--accent-strong); }
.pill.dotted::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* Круглая кнопка-иконка (назад, закрыть, шеврон). */
.round-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none;
  display: inline-grid; place-items: center; padding: 0;
  background: var(--bg); color: var(--ink); cursor: pointer;
}
.round-btn > .ic { width: 20px; height: 20px; margin: 0; }

/* Geologica впереди, системный и Inter — фолбэком, если файл не приехал. */
body { font-family: 'Geologica', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', sans-serif; }
body, #screen-detail { background: var(--canvas); }

/* ═══ КАРКАС ═════════════════════════════════════════════════════════════ */

/* ─── шапка: на канве, без полосы; знак, имя, счётчик-пилюля ─── */
#top { background: var(--canvas); border-bottom: 0; }
#brand { gap: 10px; padding: calc(10px + env(safe-area-inset-top)) 16px 4px; }
/* Знак-картинку не показываем — имя приложения текстом (решение юзера 24.09). */
#brand .mark { display: none; }
#brand .logo {
  color: var(--ink); font-size: var(--fs-ui); font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase;
}
#brand .total {
  background: var(--bg); color: var(--ink-soft); border-radius: var(--r-pill);
  padding: 5px 11px; font-size: var(--fs-meta); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
#brand .total:empty { display: none; }
#dest-hint button.i { width: 30px; height: 30px; background: var(--bg); border: 0; }

/* Заголовок раздела крупно + дата (как «Доброе утро, …» у KLAIT). */
#page-head { padding: 6px 16px 12px; }
#page-title { margin: 0; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
#page-sub { margin-top: 3px; font-size: var(--fs-small); color: var(--ink-soft); }
#page-sub::first-letter { text-transform: uppercase; }

/* ─── сегменты: отдельные пилюли, выбранная тёмная ───
   Один вид на оба переключателя (лента и задачи): два вида одного элемента на
   соседних экранах читаются как два приложения (урок 03.09). */
#segment { margin: 0 16px 10px; }
#segment, .tsk-seg { background: none; padding: 0; gap: 6px; }
#segment button, .tsk-seg button {
  border-radius: var(--r-pill); background: var(--bg); box-shadow: none; height: 38px;
}
#segment button[aria-selected="true"], .tsk-seg button[aria-selected="true"] {
  background: var(--dark); color: var(--on-dark); box-shadow: none;
}
#segment button[aria-selected="true"] .n { background: var(--dark-2); color: var(--on-dark-soft); }
#segment button[aria-selected="false"] .n { background: var(--surface); }
#segment button:first-child:nth-last-child(n+4),
#segment button:first-child:nth-last-child(n+4) ~ button { letter-spacing: -.01em; }
#segment:has(> button:nth-child(4)) { gap: 4px; }

/* ─── поиск и кнопки рядом: белые таблетки на канве ─── */
#searchbar { gap: 8px; padding: 0 16px 12px; }
#searchbar input, #searchbar button {
  height: 44px; border-radius: var(--r-pill); background-color: var(--bg);
}
#searchbar input { padding-left: 38px; background-position: 14px 50%; }
/* Geologica шире системного: «адрес или #номер лота» кегля --fs-ui в поле
   390-го экрана обрезалось на последней букве (снимок 24.09). */
#searchbar input::placeholder { font-size: var(--fs-small); }
#searchbar button { padding: 0 14px; font-weight: 600; }
#searchbar button.on { background: var(--dark); color: var(--on-dark); }
#map-toggle { width: 44px; padding: 0 !important; display: inline-grid; place-items: center; }
#map-toggle .ic { width: 20px; height: 20px; }

/* ─── панель фильтров: белая карточка под поиском ─── */
#filters {
  margin: 0 16px 12px; padding: 16px; gap: 12px;
  background: var(--bg); border-top: 0; border-radius: var(--r);
  /* Шапка выросла на строку заголовка (~50 px), навигация стала выше на 20:
     прежний запас 150 px уводил «Показать» под плавающую таблетку. */
  max-height: calc(100vh - 230px);
  max-height: calc(100dvh - 230px);
}
#filters label { color: var(--ink-soft); font-weight: 500; }
#filters select, #filters input {
  height: 44px; border-radius: var(--r-sm); background: var(--surface); padding: 0 12px;
}
#filters button { height: 46px; border-radius: var(--r-pill); }
#filters button.ghost { background: var(--surface); }
#saved-filters .sf { border-radius: var(--r-pill); padding: 6px 8px 6px 14px; }

/* ─── нижняя навигация: тёмная плавающая таблетка ─── */
#nav {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom));
  padding: 6px; gap: 2px;
  background: var(--dark); border-top: 0; border-radius: var(--r-pill);
  box-shadow: 0 10px 24px -8px rgba(23, 25, 26, .45);
}
#nav button { height: 52px; border-radius: var(--r-pill); color: var(--on-dark-soft); }
#nav button[aria-selected="true"] { background: var(--accent); color: var(--on-accent); }
#nav .n { background: var(--on-dark); color: var(--dark); }
#nav button[aria-selected="true"] .n { background: var(--on-dark); color: var(--accent-strong); }

/* ─── сообщение: тёмная таблетка над навигацией ─── */
#toast { border-radius: 18px; background: var(--dark); padding: 12px 16px; }

/* ─── тёмная карточка-герой над лентой ─── */
#feed-hero { margin: 0 16px 4px; }
#feed-hero.tappable { cursor: pointer; }
#feed-hero .hero-big { margin-top: var(--sp-3); }
#feed-hero .sec-h small {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-deadline { display: flex; align-items: center; gap: 14px; margin-top: var(--sp-3); }
.hero-day {
  width: 64px; height: 64px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--dark-2); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.hero-when { border-left: 1px solid var(--dark-2); padding-left: 14px; min-width: 0; }
.hero-when b { display: block; font-size: var(--fs-lead); font-weight: 700; }
.hero-when span { display: block; font-size: var(--fs-small); color: var(--on-dark-soft); }

/* ═══ ЛЕНТА ══════════════════════════════════════════════════════════════ */
#feed { padding: 8px 16px 20px; gap: 10px; }
.group { padding: 10px 4px 0; color: var(--ink-3); }
.card, .skel { border-radius: var(--r); padding: 12px; gap: 9px; box-shadow: var(--shadow); }
.card .main { gap: 12px; }
.card .thumb, .card .shot img, .skel .sq { border-radius: 16px; }
.card .price { font-size: var(--fs-lead); font-weight: 700; letter-spacing: -.015em; }
.card .num { color: var(--ink-3); font-weight: 500; }
.card .addr { font-weight: 500; }
.card .meta { color: var(--ink-3); }

/* Плашки — пилюли; значок внутри берёт цвет текста. */
.chips { gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: var(--r-pill); padding: 3px 10px; font-weight: 500;
}
.chip .ic { width: 1.05em; height: 1.05em; margin: 0; }
.chip.due, .chip.soon, .chip.rent { font-weight: 600; }

/* Кнопки оценки — компактные таблетки, прижатые вправо (у KLAIT круглые
   кнопки-действия стоят справа в строке). Счётчик рядом с иконкой. */
.card .acts { justify-content: flex-end; gap: 6px; }
.card .acts button { flex: 0 0 auto; min-width: 56px; height: 36px; padding: 0 12px; }
.acts button { border-radius: var(--r-pill); gap: 5px; }
.acts button .ic { width: 19px; height: 19px; }
.acts .count { font-size: var(--fs-small); font-weight: 600; }

/* «Новое сегодня» — бледный акцент без полосы слева: при радиусе 22 полоса
   гнётся полумесяцем. Признак не теряется — такие карточки и так стоят под
   заголовком «Сегодня». */
.card.fresh { box-shadow: var(--shadow); }
/* Важность — цветной кант по всей карточке, как у героя KLAIT. Смысл решения
   30.07 сохранён: красный ЗНАЧОК занят сроком «≤3 дней», поэтому важность —
   не значок, а контур карточки + заливка. */
.card.imp-high, .card.imp-medium { border-left: 0; }
.card.imp-high { box-shadow: inset 0 0 0 2px var(--danger); }
.card.imp-medium { box-shadow: inset 0 0 0 2px var(--warn); }

/* ═══ ЭКРАН ЛОТА ═════════════════════════════════════════════════════════ */
#gallery { gap: 8px; padding: calc(12px + env(safe-area-inset-top)) 16px 4px; }
#gallery img { height: 210px; border-radius: 20px; }
#detail .pad { padding: 0 16px; }
#lot-back {
  border-radius: var(--r-pill); background: var(--bg); color: var(--ink);
  box-shadow: 0 4px 14px -6px rgba(23, 25, 26, .35);
}
#detail .kind { color: var(--ink-3); margin-top: 14px; }
#detail .kind .ic { width: 15px; height: 15px; vertical-align: -.25em; }
#detail h1 { font-size: 24px; letter-spacing: -.02em; margin: 6px 0 4px; }
#detail .meta { color: var(--ink-3); }
#detail .subject { color: var(--ink-soft); }

/* Цена — «карточка-герой»: единственный тёмный блок экрана. */
#detail .lot-hero { margin: 14px 0 10px; }
#detail .lot-hero .price-big { margin: 0; }
#detail .lot-hero .hero-stats b { font-size: var(--fs-ui); }

/* Карточки разделов на экране лота: всё белое на канве. */
#detail .sec, .funnel, .block, .finbox, .deckbox {
  background: var(--bg); border-radius: var(--r); padding: var(--sp-4);
  margin: var(--sp-3) 0 0; box-shadow: none;
}

/* «Что делаем с лотом» — карточка с иконкой в заголовке. */
.funnel { gap: 12px; }
.funnel-head { justify-content: flex-start; gap: 12px; color: var(--ink); }
.funnel-head .ttl { flex: 1; font-size: var(--fs-ui); font-weight: 600; }
.funnel-head .more {
  width: 36px; height: 36px; padding: 0; border-radius: 50%;
  background: var(--surface); color: var(--ink); font-size: 18px;
}
.funnel-row button:not(.i) {
  border: 0; background: var(--surface); border-radius: var(--r-pill);
  padding: 9px 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 6px;
}
.funnel-row button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.funnel-row button .ic { margin: 0; }
.funnel-row .lab { font-weight: 500; }
.stage-mon { border-radius: var(--r-pill); display: inline-flex; align-items: center; gap: 5px; }
button.i { border: 0; background: var(--surface); color: var(--ink-soft); }
.journal { padding-top: 4px; }
.jrow { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 8px; }
.outcome { border-radius: var(--r-pill); }
.funnel-note textarea, #note-form textarea {
  border: 0; background: var(--surface); border-radius: var(--r-sm);
}
.funnel-note .row button, #note-form button { border-radius: var(--r-pill); }
.sheet-in { border-radius: var(--r) var(--r) 0 0; }
.sheet-in button:not(.i) { border-radius: var(--r-pill); }

/* Заголовки блоков-справок: значок в начале подписи становится кругом. */
.block { gap: 4px; }
.block-title, .decktitle {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--fs-ui); font-weight: 600; margin-bottom: 6px;
}
.block-title > .ic:first-child, .decktitle > .ic:first-child {
  width: 20px; height: 20px; padding: 9px; margin: 0; box-sizing: content-box;
  border-radius: 50%; background: var(--surface); color: var(--ink);
}
.block-title > .ic-warn:first-child { background: var(--warn-soft); color: var(--warn); }
.block-line { padding-left: 50px; }
.deckbox .sub { padding-left: 0; }

/* Предупреждения — мягкие карточки без полосы. */
#detail .warn { border-left: 0; border-radius: var(--r-sm); padding: 12px 14px; }

/* Характеристики — таблица без вертикальных линий, серые подписи. */
#detail .sec-specs table { margin-top: 4px; }
#detail .sec-specs td { padding: 11px 0; }

/* Профили: строки с пилюлей вердикта. */
#detail .verticals { display: flex; flex-direction: column; gap: 0; margin: 12px 0 0; }
#detail .vert {
  background: none; border: 0; border-radius: 0; padding: 12px 0; margin: 0;
  border-top: 1px solid var(--line);
}
#detail .vert:first-child { border-top: 0; padding-top: 0; }
#detail .vert .head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 600; }
#detail .vert .head > span:first-child { display: inline-flex; align-items: center; }
#detail .vert .verdict {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  border-radius: var(--r-pill); padding: 3px 10px; font-size: var(--fs-meta); font-weight: 600;
  background: var(--ok-soft); color: var(--ok);
}
#detail .vert .verdict.no { background: var(--danger-soft); color: var(--danger); }
#detail .vert .verdict .ic { display: none; }
#detail .vert .verdict::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#detail .vert .nums { color: var(--ink-soft); margin-top: 4px; }
#detail .vert .nums b { color: var(--ink); font-weight: 600; }
#detail .vert .nums .ic { width: 14px; height: 14px; margin: 0 1px; vertical-align: -.15em; }

/* Описание. */
#detail .sec-desc .desc { margin: 0; }
#detail .sec-desc .more { padding-bottom: 0; margin-bottom: 0; }

/* Заметки. */
#detail .sec-notes .notes-cap { color: var(--ink-soft); }
#detail .sec-notes .notes { margin-top: 10px; }
.note { border-left: 0; border-radius: var(--r-sm); }
.note.mine { background: var(--accent-soft); }

/* Фин-модель: плитки чисел. */
.finbox .sec-h { margin-bottom: 12px; }
.finnum { background: var(--surface); border-radius: var(--r-sm); padding: 10px 12px; }
.finnum .val { font-size: var(--fs-lead); font-weight: 700; color: var(--ink); }
#detail .finmodel {
  border: 0; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent);
  font-weight: 600; padding: 13px;
}
#detail .finmodel:disabled { background: var(--surface); color: var(--ink-soft); }
.finparams input { border: 0; border-radius: var(--r-sm); }
.finparams .apply, .deckbtn { border-radius: var(--r-pill); }

/* Карта и ссылки: кнопка карты + список строк с «наружу». */
.map-open {
  border: 0; border-radius: var(--r-pill); background: var(--surface); color: var(--ink);
  font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px;
}
#detail .links { display: flex; flex-direction: column; margin-top: 10px; }
#detail .links a {
  display: flex; align-items: center; gap: 10px; padding: 12px 0;
  border-top: 1px solid var(--line); color: var(--ink); text-decoration: none; font-weight: 500;
}
#detail .links a:first-child { border-top: 0; }
#detail .links a::after { content: none; }
#detail .links a .lead { margin: 0; color: var(--ink-soft); width: 19px; height: 19px; }
#detail .links a .go { margin: 0 0 0 auto; color: var(--ink-3); width: 18px; height: 18px; }

/* Кнопки оценки лота: белая плавающая таблетка у нижнего края. */
#detail .actbar {
  background: transparent; border-top: 0; box-shadow: none;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
#detail .actbar .acts {
  background: var(--bg); border-radius: var(--r-pill); padding: 6px; gap: 6px;
  box-shadow: 0 10px 26px -10px rgba(23, 25, 26, .35);
}
#detail .acts button { height: 46px; background: var(--surface); }
#detail .acts button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }

/* ═══ ШИРОКИЕ ЭКРАНЫ ═════════════════════════════════════════════════════ */
@media (min-width: 760px) {
  #page-head, #feed-hero { max-width: var(--feed-max); margin-left: auto; margin-right: auto; }
  #page-head { padding-left: 16px; padding-right: 16px; box-sizing: border-box; width: 100%; }
  /* Край героя — по краю карточек ленты: у `#feed` поля по 16 px внутри
     `--feed-max`, значит и герою ширина `--feed-max` минус 32. */
  #feed-hero { width: calc(100% - 32px); max-width: calc(var(--feed-max) - 32px); box-sizing: border-box; }
  #page-title { font-size: 34px; }
  .card { padding: var(--sp-3); }
  .card .shot img, .card .thumb { border-radius: 18px; }
  /* Широкий режим держит кнопки гридом 2×2 (feed.css, клетки по 50 px).
     Таблетке со счётчиком нужно 60, иначе соседние слипаются. */
  .card .acts { grid-template-columns: repeat(2, 60px); gap: 6px; }
  .card .acts button { min-width: 0; padding: 0 8px; }
}

/* Карточки экрана лота раскладываются по колонкам так же, как их прежние
   прямые предки (порядок в detail.css): герой — к заголовку, профили — выше
   справок, характеристики и описание — ниже. */
@media (min-width: 980px) {
  #screen-detail #detail .pad > .lot-hero { order: 2; }
  /* Путь по карточке (24.09) задан порядком РАЗМЕТКИ — характеристики,
     описание, профили, карта, задачи, заметки, фин-модель. Прежние `order`
     из detail.css (профили выше таблицы) здесь гасим, иначе на широком экране
     путь был бы другим, чем на телефоне. Правая колонка (кнопки, воронка)
     стоит по grid-column и от порядка не зависит. */
  #screen-detail #detail .pad > .block,
  #screen-detail #detail .pad > .warn,
  #screen-detail #detail .pad > .fold { order: 9; }
  /* Статус лота на широком экране не нужен: воронка и так видна справа. */
  #screen-detail #detail .pad > .lot-status { display: none; }
  #screen-detail #detail .actbar {
    background: transparent; border: 0; box-shadow: none; padding: 0;
  }
  #screen-detail #detail .actbar .acts { box-shadow: var(--shadow); }
  #screen-detail #detail .funnel { margin-top: calc(var(--rail-acts-h) + var(--rail-gap)); }
}

/* ─── навигация десктопа «как KLAIT» (24.09, ч.2) ───────────────────────
   Слева — тёмная рейка иконок РАЗДЕЛОВ, сверху — таблетки ПОДРАЗДЕЛОВ
   текущего раздела (строит buildWideNav/paintWideNav в app.js). Рейка уже
   прежней колонки (96 против 210 px): ширина только прибавилась документу,
   см. `test_the_roomy_rail_never_takes_width_from_the_document`. */
#nav-top { display: none; }
@media (min-width: 1180px) {
  body:has(#nav-wide:not([hidden])) { padding-left: 96px; }
  #nav-wide {
    top: 0; bottom: 0; left: 0; width: 96px; padding: 20px 0;
    background: transparent; border-right: 0; border-radius: 0;
    align-items: center; gap: 0; overflow: visible;
  }
  .side-brand {
    padding: 8px 0 0; font-size: var(--fs-ui); font-weight: 800; letter-spacing: .06em;
    text-transform: uppercase; color: var(--ink); white-space: nowrap;
  }
  #nav-wide .rail {
    margin: auto 0; display: flex; flex-direction: column; gap: 8px; padding: 10px;
    background: var(--dark); border-radius: var(--r-pill);
    box-shadow: 0 14px 30px -14px rgba(23, 25, 26, .55);
  }
  #nav-wide .side-item {
    width: 46px; height: 46px; min-height: 0; padding: 0; gap: 0;
    justify-content: center; border-radius: 50%; color: var(--on-dark-soft);
  }
  #nav-wide .side-item .ic { width: 21px; height: 21px; margin: 0; }
  #nav-wide .side-item:hover { background: var(--dark-2); color: var(--on-dark); }
  #nav-wide .side-item[aria-current="true"] { background: var(--accent); color: var(--on-accent); }

  /* Рейка «как KLAIT» (вариант 7, 24.09): разделы · инструменты · настройки,
     аккаунт кружком внизу, счётчики на иконках, название — подсказкой. */
  #nav-wide .rail { gap: 6px; }
  #nav-wide .rail-sep { width: 24px; height: 1px; margin: 4px auto; background: var(--dark-2); }
  #nav-wide .side-item { position: relative; width: 44px; height: 44px; }
  #nav-wide .side-item .n {
    position: absolute; top: -3px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px;
    box-sizing: border-box; display: flex; align-items: center; justify-content: center;
    border-radius: var(--r-pill); border: 2px solid var(--dark);
    background: var(--accent); color: var(--on-accent);
    font-size: 11px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums;
  }
  #nav-wide .side-item .n.hot { background: var(--danger); color: var(--on-dark); }
  #nav-wide .side-item[aria-current="true"] .n { border-color: var(--dark); }
  /* Подсказка справа от кнопки: тёмная плашка, как у KLAIT. Показ — на
     наведение и на фокус с клавиатуры. */
  #nav-wide .side-item[data-tip]::after {
    content: attr(data-tip); position: absolute; left: calc(100% + 14px); top: 50%;
    transform: translateY(-50%); padding: 7px 11px; border-radius: 10px;
    background: var(--dark); color: var(--on-dark); font-size: var(--fs-small); font-weight: 600;
    white-space: nowrap; pointer-events: none; opacity: 0; visibility: hidden;
    transition: opacity var(--fast) ease;
    box-shadow: 0 10px 24px -12px rgba(23, 25, 26, .55);
  }
  #nav-wide .side-item:hover::after,
  #nav-wide .side-item:focus-visible::after { opacity: 1; visibility: visible; }
  /* Аккаунт — белый кружок внизу колонки (у KLAIT там аватар). */
  #nav-wide .side-account {
    flex: none; background: var(--bg); color: var(--ink); box-shadow: var(--shadow);
  }
  #nav-wide .side-account:hover { background: var(--surface); color: var(--ink); }
  #nav-wide .side-account[aria-current="true"] { background: var(--dark); color: var(--on-dark); }

  #nav-top:not([hidden]) {
    display: flex; align-items: center; gap: 28px; flex-wrap: nowrap;
    max-width: var(--feed-max); margin: 0 auto; padding: 22px 16px 4px;
    box-sizing: border-box;
  }
  /* Одна строка: у «Ещё» восемь подразделов, и перенос на вторую строку
     выглядел поломкой. Не влезли — строка листается вбок. */
  .top-items {
    display: flex; flex-wrap: nowrap; gap: 4px; min-width: 0;
    overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  }
  .top-items::-webkit-scrollbar { display: none; }
  .top-item { flex: none; }
  .top-item {
    height: 44px; padding: 0 16px; border: 0; border-radius: var(--r-pill);
    display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
    background: none; color: var(--ink); font: inherit; font-size: var(--fs-ui); font-weight: 600;
    transition: background var(--fast) ease, color var(--fast) ease;
  }
  .top-item .ic { width: 19px; height: 19px; margin: 0; }
  .top-item .n {
    font-size: var(--fs-meta); font-weight: 600; font-variant-numeric: tabular-nums;
    background: var(--bg); color: var(--ink-soft); border-radius: var(--r-pill); padding: 1px 7px;
  }
  .top-item:hover { background: var(--bg); }
  .top-item[aria-current="true"] { background: var(--dark); color: var(--on-dark); }
  .top-item[aria-current="true"] .n { background: var(--dark-2); color: var(--on-dark-soft); }

  .no-tg #screen-detail:not([hidden]) #lot-back { left: calc(96px + 14px); }
  #toast { left: calc(96px + 12px); }
  /* Счётчик выборки и «i» — в одну строку с заголовком раздела, справа (как
     кнопки у «Доброе утро» в KLAIT), а не отдельным рядом над ним. Шапка
     становится гридом: заголовок слева, счётчик справа, остальное — на всю
     ширину ниже. */
  #top {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center;
    max-width: var(--feed-max); margin: 0 auto; padding: 0 16px; box-sizing: border-box;
  }
  #top > * { grid-column: 1 / -1; max-width: none; margin-left: 0; margin-right: 0; }
  #top > #page-head { grid-column: 1; grid-row: 1; padding-left: 0; padding-right: 0; }
  #top > #brand { grid-column: 2; grid-row: 1; padding: 0; }
  #top > #searchbar { padding-left: 0; padding-right: 0; }
  #top > #filters { margin-left: 0; margin-right: 0; }
}

/* ═══ ЛОТ: СПРОС КОМПАКТНО (решение юзера 24.09) ══════════════════════════
   Voronoi / Smart — крупными числами с галочкой, под ними одна серая строка
   «из N · порог M · конкурентов K». Подробности — в «i» у заголовка раздела. */
.sec-h .aside { display: inline-flex; align-items: center; gap: 8px; }
.sec-h .aside button.i { width: 28px; height: 28px; padding: 0; border-radius: 50%; font-size: var(--fs-meta); }
#detail .demand { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; margin-top: 6px; }
#detail .sec-h + .demand { margin-top: var(--sp-3); }
#detail .demand .dm { display: inline-flex; align-items: baseline; gap: 6px; }
#detail .demand .dm small { font-size: var(--fs-meta); font-weight: 600; color: var(--ink-soft); }
#detail .demand .dm b {
  font-size: var(--fs-ui); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums;
}
#detail .demand .dm .ic { width: 16px; height: 16px; margin: 0; align-self: center; }
#detail .demand-meta .cut { color: var(--warn); font-weight: 600; white-space: nowrap; }
#detail .demand-meta .cut .ic { width: 13px; height: 13px; vertical-align: -.15em; margin: 0 2px 0 4px; }
#detail .vert .verdict.ref { background: var(--surface); color: var(--ink-soft); }
#detail .demand-meta {
  margin-top: 3px; font-size: var(--fs-meta); color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
#detail .demand-why { margin-top: 8px; font-size: var(--fs-small); color: var(--ink-soft); }
#detail .demand-why .ic { width: 15px; height: 15px; }

/* Воронка: стадии и важность — один ряд; важность — две точки справа. */
.funnel-row .imp-dots { display: inline-flex; gap: 6px; margin-left: auto; }
.funnel-row button.imp:not(.i) { width: 40px; height: 40px; padding: 0; justify-content: center; }
.funnel-row button.imp[aria-pressed="true"][data-imp="high"] {
  background: var(--danger-soft); box-shadow: inset 0 0 0 2px var(--danger);
}
.funnel-row button.imp[aria-pressed="true"][data-imp="medium"] {
  background: var(--warn-soft); box-shadow: inset 0 0 0 2px var(--warn);
}
.funnel-head button.i { width: 28px; height: 28px; padding: 0; border-radius: 50%; font-size: var(--fs-meta); }

/* Лист справки раздела. */
.info-sheet .sheet-h { font-size: var(--fs-ui); font-weight: 700; }
.info-sheet .sheet-line { font-size: var(--fs-body); line-height: 1.45; color: var(--ink); }
.info-sheet .sheet-line .ic { width: 15px; height: 15px; }

/* Статус лота под плашками: стадия / важность / исход. Тап — к воронке. */
#detail .lot-status {
  display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0;
  border: 0; background: none; font: inherit; text-align: left; cursor: pointer;
}
#detail .lot-status[hidden] { display: none; }
#detail .lot-status .chip { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }

/* Объекты, расхождение площадей и «Почему так определено» — внутри
   «Характеристик»: разделы-подвалы карточки, а не отдельные карточки. */
#detail .sec-specs > .block {
  background: none; border-radius: 0; padding: 12px 0 0; margin: 12px 0 0;
  border-top: 1px solid var(--line);
}
#detail .sec-specs > .block .block-line { padding-left: 0; }
#detail .sec-specs > .warn { margin: 12px 0 0; }
#detail .sec-specs > .fold { margin: 10px 0 0; }

/* ═══ ФИЛЬТРЫ — ШТОРКА (вариант A, решение юзера 24.09) ═════════════════════
   Телефон: шторка снизу поверх нижнего меню, «Показать N» прибита к низу и
   видна всегда (раньше «Применить» уходила под плавающее меню). Широкий
   экран: панель справа на всю высоту. Прокрутка — у тела шторки, шапка и
   подвал стоят. Поверх карты тоже: z-index выше `.lm` (22). */
#filters-dim { position: fixed; inset: 0; z-index: 40; background: rgba(23, 25, 26, .45); }
#filters-dim[hidden] { display: none; }
html.fs-open, html.fs-open body { overflow: hidden; }
#filters {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 41;
  margin: 0; max-width: none; padding: 0; gap: 0;
  max-height: 92vh; max-height: 92dvh;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border-radius: var(--r) var(--r) 0 0;
  box-shadow: 0 -20px 40px -20px rgba(23, 25, 26, .4);
}
#filters[hidden] { display: none; }
#filters .fs-head { flex: none; display: flex; align-items: center; gap: 8px; padding: 18px 16px 10px; }
#filters .fs-head b { flex: 1; font-size: var(--fs-title); font-weight: 800; color: var(--ink); }
#filters .fs-reset {
  height: 36px; padding: 0 8px; background: none; color: var(--accent-strong); font-weight: 700;
}
#filters .fs-close {
  width: 36px; height: 36px; padding: 0; border-radius: 50%; background: var(--surface); color: var(--ink);
}
#filters .fs-body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; gap: 18px; padding: 4px 16px 18px;
}
#filters .fs-grp { display: flex; flex-direction: column; gap: 8px; }
#filters .fs-t {
  font-size: var(--fs-meta); font-weight: 700; color: var(--ink-soft);
  text-transform: uppercase; letter-spacing: .06em;
}
#filters .fs-grp[data-chips] > select { display: none; }
#filters .fs-chips, #filters .fs-presets { display: flex; flex-wrap: wrap; gap: 6px; }
#filters .fs-chips button, #filters .fs-presets button {
  height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--ink); font-size: var(--fs-small); font-weight: 600;
}
#filters .fs-chips button .ic { width: 16px; height: 16px; margin: 0; }
#filters .fs-chips button[aria-pressed="true"],
#filters .fs-presets button[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); }
#filters .fs-saved #saved-filters:empty { display: none; }
#filters .fs-saved #save-filter { align-self: flex-start; height: 36px; font-size: var(--fs-small); padding: 0 14px; }
#filters .fs-more > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between;
  height: 44px; padding: 0 16px; border-radius: var(--r-pill); background: var(--surface);
  font-weight: 700; color: var(--ink);
}
#filters .fs-more > summary::-webkit-details-marker { display: none; }
#filters .fs-more > summary::after { content: "▾"; color: var(--ink-soft); }
#filters .fs-more[open] > summary::after { content: "▴"; }
#filters .fs-more > .fs-grp, #filters .fs-more > .switch { margin-top: 16px; }
#filters .fs-foot {
  flex: none; padding: 12px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg);
}
#filters .fs-foot button { width: 100%; height: 52px; border-radius: var(--r-pill); font-size: var(--fs-ui); font-weight: 800; }
@media (min-width: 760px) {
  #filters {
    top: 0; left: auto; width: 440px; max-height: none;
    border-radius: var(--r) 0 0 var(--r);
    box-shadow: -20px 0 40px -20px rgba(23, 25, 26, .4);
  }
  #filters .fs-foot { padding-bottom: 18px; }
}

/* Кнопка «Фильтры» со значком-числом и ряд действующих условий под поиском. */
#filters-toggle { display: inline-flex; align-items: center; gap: 7px; }
#filters-toggle .ic { width: 18px; height: 18px; margin: 0; }
#filters-toggle .dotn {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 800;
}
#active-filters {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  padding: 0 16px 8px;
}
#active-filters::-webkit-scrollbar { display: none; }
#active-filters[hidden] { display: none; }
#active-filters button {
  flex: none; height: 34px; border: 0; border-radius: var(--r-pill); padding: 0 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--dark); color: var(--on-dark); font: inherit; font-size: var(--fs-small); font-weight: 600;
}
#active-filters button .x { font-size: 11px; opacity: .75; }
#active-filters button.clear { background: none; color: var(--accent-strong); }
@media (min-width: 1180px) {
  #top > #active-filters { padding-left: 0; padding-right: 0; }
}

/* Кнопка карты прячется вне «Поиска» — `display` выше перебивал бы [hidden]. */
#map-toggle[hidden] { display: none; }
