:root {
  --bg: #f4f2ee;
  --surface: #ffffff;
  --surface-2: #f8f7f4;
  --ink: #1b2430;
  --ink-2: #4a5462;
  --ink-3: #6f7885;
  --line: #e3e0da;
  --accent: #e8590c;
  --accent-ink: #ffffff;
  --accent-hover: #cc4a06;
  --warn: #c92a2a;
  --ok: #2f9e44;
  --work: #f59f00;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(27,36,48,.06), 0 6px 20px rgba(27,36,48,.10);
  --top-h: 64px;
  --font: 'Onest', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --t-xs: 12px; --t-sm: 13px; --t-md: 15px; --t-lg: 18px; --t-xl: 22px; --t-2xl: 32px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: var(--t-md); line-height: 1.5;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.page { min-height: 100vh; display: flex; flex-direction: column; }
body.page-map { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
button, select, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
img { max-width: 100%; }

/* ---------- шапка ---------- */
.top {
  height: var(--top-h); flex: none; display: flex; align-items: center; gap: 20px;
  padding: 0 20px; background: var(--ink); color: #fff; position: relative; z-index: 1000;
}
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; min-width: 0; flex: none; }
.coat { width: auto; height: 46px; display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; white-space: nowrap; }
.brand-text b { font-size: var(--t-lg); font-weight: 700; letter-spacing: -.01em; }
.brand-text small { font-size: var(--t-xs); color: #aeb6c2; }

.nav { display: flex; align-items: center; justify-content: center; gap: 2px; }
/* меню по центру шапки: бренд | меню | кнопка */
@media (min-width: 901px) {
  .top { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
  .brand { justify-self: start; }
  #btn-report { justify-self: end; }
}
.nav a {
  color: #d5dae1; text-decoration: none; font-size: var(--t-sm); font-weight: 500;
  padding: 8px 12px; border-radius: 999px; white-space: nowrap; transition: background .15s, color .15s;
}
.nav a:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav a[aria-current="page"] { color: #fff; background: rgba(255,255,255,.14); }
#btn-report { margin-left: auto; }
.burger { display: none; width: 40px; height: 40px; border: 0; background: rgba(255,255,255,.08); border-radius: 10px; padding: 0; place-content: center; gap: 4px; }
.burger span { display: block; width: 18px; height: 2px; background: #fff; border-radius: 1px; transition: transform .2s, opacity .2s; }
.nav-open .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .burger span:nth-child(2) { opacity: 0; }
.nav-open .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px;
  padding: 10px 18px; font-weight: 600; font-size: var(--t-sm); white-space: nowrap; text-decoration: none;
  transition: background .15s, color .15s, box-shadow .15s, border-color .15s;
}
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { background: var(--accent-hover); }
.btn-line { background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.btn-line:hover { border-color: var(--ink-3); }
.btn:disabled { opacity: .6; cursor: default; }
.icon-btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- общие элементы ---------- */
.field { display: grid; gap: 4px; }
.field-lbl { font-size: var(--t-xs); color: var(--ink-3); font-weight: 500; }
select {
  appearance: none; width: 100%; padding: 9px 34px 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='m1 1.5 5 5 5-5' stroke='%234a5462' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 12px center;
}
.seg { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; border-radius: 999px; padding: 6px 8px; font-size: var(--t-sm); font-weight: 500; color: var(--ink-2); }
.seg button[aria-checked="true"] { background: var(--ink); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 5px 12px; font-size: var(--t-sm); color: var(--ink-2); text-decoration: none;
}
.chip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex: none; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; white-space: nowrap;
  padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--c) 14%, white); color: color-mix(in srgb, var(--c) 70%, black);
}
.pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.hint { font-size: var(--t-xs); color: var(--ink-3); margin: 0; }
.empty { text-align: center; padding: 40px 16px; color: var(--ink-3); font-size: var(--t-sm); list-style: none; }
.skel { height: 84px; margin: 8px 0; border-radius: var(--radius-sm); list-style: none; background: linear-gradient(90deg, var(--surface-2), #ece9e3, var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; }
@keyframes sk { to { background-position: -200% 0; } }
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 3000;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-size: var(--t-sm);
  box-shadow: var(--shadow); max-width: calc(100vw - 32px);
}

/* ---------- страницы ---------- */
.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.main { flex: 1; padding-top: 40px; padding-bottom: 64px; }
.main.narrow { max-width: 800px; }
.page-head { margin-bottom: 28px; display: grid; gap: 16px; }
h1 { font-size: var(--t-2xl); line-height: 1.15; letter-spacing: -.02em; margin: 0; }
.lead { font-size: var(--t-lg); color: var(--ink-2); margin: 0; max-width: 680px; line-height: 1.45; }
.note { font-size: var(--t-sm); color: var(--ink-3); margin-top: 24px; }
.more { display: flex; justify-content: center; margin-top: 20px; }
.foot { background: var(--surface); border-top: 1px solid var(--line); font-size: var(--t-xs); color: var(--ink-3); }
.foot-in { display: flex; justify-content: space-between; gap: 8px 24px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 20px; }

/* Темы */
.search { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; max-width: 520px; color: var(--ink-3); }
.search:focus-within { border-color: var(--ink-3); }
.search input { border: 0; outline: 0; background: none; padding: 12px 0; flex: 1; min-width: 0; color: var(--ink); }
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 24px 12px; margin-bottom: 16px; scroll-margin-top: 16px; }
.cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.cat-head i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.cat-head h2 { font-size: var(--t-xl); margin: 0; letter-spacing: -.01em; }
.cat-map { margin-left: auto; font-size: var(--t-sm); font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.cat-map:hover { text-decoration: underline; }
.sub h3 { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 16px 0 4px; font-weight: 600; }
.tlist { list-style: none; margin: 0; padding: 0; }
.titem { display: grid; grid-template-columns: 1fr auto 18px; align-items: center; gap: 16px; padding: 10px 8px; margin: 0 -8px; border-radius: var(--radius-sm); text-decoration: none; border-top: 1px solid var(--surface-2); }
.titem:hover { background: var(--surface-2); }
.t-name { font-weight: 500; }
.t-nums { font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; display: flex; align-items: center; gap: 4px 12px; flex-wrap: wrap; justify-content: flex-end; }
.t-nums b { color: var(--ink); font-size: var(--t-sm); }
.t-split { display: inline-flex; align-items: center; gap: 4px; }
.t-split i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); margin-left: 8px; }
.t-split i:first-child { margin-left: 0; }
.t-go { color: var(--ink-3); }
.titem.is-empty .t-name { color: var(--ink-2); }

/* Результат */
.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpi-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 2px; justify-items: center; text-align: center; }
.kpi-box b { font-size: 28px; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.kpi-box span { font-size: var(--t-xs); color: var(--ink-3); }
.kpi-box:first-child b { color: var(--ok); }
.filter-row { display: flex; gap: 10px; flex-wrap: wrap; }
.filter-row select { width: auto; min-width: 220px; }
.day { font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 28px 0 10px; font-weight: 600; }
.day:first-child { margin-top: 0; }
.rlist { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.rlist li + li { border-top: 1px solid var(--line); }
.ritem { display: grid; grid-template-columns: 72px 1fr auto; gap: 16px; padding: 14px 16px; text-decoration: none; align-items: start; }
.ritem:hover { background: var(--surface-2); }
.thumb { width: 72px; height: 72px; border-radius: var(--radius-sm); object-fit: cover; background: var(--surface-2); display: block; }
.r-body { display: grid; gap: 3px; min-width: 0; }
.r-theme { font-weight: 600; line-height: 1.3; }
.r-addr { font-size: var(--t-sm); color: var(--ink-3); }
.r-answer { font-size: var(--t-sm); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.r-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; margin-top: 4px; }
.badge-ok { font-size: 11px; font-weight: 600; color: #1f7a33; background: #e6f4e9; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.r-exec { font-size: var(--t-xs); color: var(--ink-3); }
.r-date { font-size: var(--t-xs); color: var(--ink-3); white-space: nowrap; }

/* Новости */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { border: 0; background: none; padding: 10px 10px; font-weight: 600; font-size: var(--t-sm); color: var(--ink-3); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); }
.news { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.nitem { display: grid; gap: 6px; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .15s; }
.nitem:hover { border-color: var(--ink-3); }
.n-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: var(--t-xs); color: var(--ink-3); margin: 0; }
.n-kind { font-weight: 600; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.n-city { background: #e7f0fb; color: #1c5fa8; }
.n-project { background: color-mix(in srgb, var(--accent) 14%, white); color: #a33f06; }
.n-title { font-weight: 600; font-size: var(--t-lg); line-height: 1.3; }
.n-sum { color: var(--ink-2); font-size: var(--t-sm); }
.ext { color: var(--ink-3); font-weight: 400; }
.article h1 { margin: 10px 0 16px; }
.article .lead { margin-bottom: 20px; }
.back { display: inline-block; font-size: var(--t-sm); font-weight: 600; color: var(--ink-2); text-decoration: none; margin-bottom: 20px; }
.back:hover { color: var(--ink); }

/* О проекте и тексты */
.prose h2 { font-size: var(--t-xl); margin: 36px 0 12px; letter-spacing: -.01em; }
.prose p, .prose li { color: var(--ink-2); max-width: 70ch; }
.prose h1 + .lead { margin-top: 16px; }
.prose a { color: var(--accent); }
.prose ul { padding-left: 20px; }
.steps { list-style: none; counter-reset: s; padding: 0; display: grid; gap: 12px; margin: 0; }
.steps li { counter-increment: s; position: relative; padding: 14px 18px 14px 58px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.steps li::before { content: counter(s); position: absolute; left: 18px; top: 14px; width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 700; font-size: var(--t-sm); display: grid; place-items: center; }
.steps b { color: var(--ink); }
.statuses { display: grid; grid-template-columns: max-content 1fr; gap: 12px 18px; align-items: center; margin: 0; }
.statuses dd { margin: 0; color: var(--ink-2); font-size: var(--t-sm); }

/* ---------- главная: карта ---------- */
.mapwrap { flex: 1; position: relative; min-height: 0; isolation: isolate; }
#map { position: absolute; inset: 0; background: #ece9e3; }
.maplibregl-map { font-family: var(--font); }
.loading { position: absolute; top: 0; left: 0; right: 0; height: 3px; z-index: 20; overflow: hidden; }
.loading span { display: block; height: 100%; width: 30%; background: var(--accent); animation: ld 1s infinite ease-in-out; }
@keyframes ld { from { transform: translateX(-100%); } to { transform: translateX(400%); } }

.filters {
  position: absolute; top: 16px; left: 16px; z-index: 10; width: 280px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow);
}
.f-count { margin: 0; font-size: var(--t-xs); color: var(--ink-3); }
.theme-chip { display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff; border-radius: var(--radius-sm); padding: 6px 6px 6px 12px; font-size: var(--t-sm); }
.theme-chip span { flex: 1; min-width: 0; line-height: 1.3; }
.theme-chip button { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 26px; height: 26px; border-radius: 50%; font-size: 16px; line-height: 1; flex: none; }
.btn-float { display: none; position: absolute; top: 12px; left: 12px; z-index: 11; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.btn-float .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

.legend {
  position: absolute; left: 16px; bottom: 24px; z-index: 10; display: flex; gap: 12px;
  background: rgba(255,255,255,.94); backdrop-filter: blur(6px); border-radius: 999px; padding: 6px 14px;
  font-size: var(--t-xs); color: var(--ink-2); box-shadow: var(--shadow);
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend i.ring { border: 2.5px solid var(--warn); background: #fff; width: 11px; height: 11px; }

.cl {
  --s: 40px; width: var(--s); height: var(--s); border-radius: 50%; display: grid; place-items: center; border: 0; padding: 0;
  background: conic-gradient(var(--work) 0 var(--p), var(--ok) var(--p) 100%);
  box-shadow: 0 2px 8px rgba(27,36,48,.25); transition: transform .15s;
}
.cl b { width: calc(var(--s) - 10px); height: calc(var(--s) - 10px); border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 13px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.cl:hover { transform: scale(1.08); }
.maplibregl-popup.dtip .maplibregl-popup-content, .maplibregl-popup.ptip .maplibregl-popup-content {
  background: var(--ink); color: #fff; border-radius: 6px; font-size: 12px; padding: 5px 9px; box-shadow: none; line-height: 1.35;
}
.maplibregl-popup.dtip .maplibregl-popup-content { font-weight: 600; }
.maplibregl-popup.dtip .maplibregl-popup-tip, .maplibregl-popup.ptip .maplibregl-popup-tip { display: none; }
.maplibregl-popup { pointer-events: none; }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* карточка сообщения */
.drawer {
  position: absolute; top: 12px; right: 12px; bottom: 12px; width: 420px; z-index: 30;
  background: var(--surface); border-radius: var(--radius); box-shadow: 0 8px 32px rgba(27,36,48,.22);
  display: flex; flex-direction: column; overflow: hidden;
}
.drawer-open .maplibregl-ctrl-top-right { right: 444px; }
.card-top { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 20px; border-bottom: 1px solid var(--line); flex: none; }
.card-no { font-size: var(--t-xs); color: var(--ink-3); font-variant-numeric: tabular-nums; }
.card { flex: 1; overflow-y: auto; padding: 16px 20px 28px; overscroll-behavior: contain; }
.card h2 { font-size: var(--t-lg); line-height: 1.3; margin: 10px 0 6px; letter-spacing: -.01em; }
.card .addr { color: var(--ink-2); font-size: var(--t-sm); margin: 0 0 14px; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--t-sm); margin: 0 0 16px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }
.facts .warn { color: var(--warn); font-weight: 600; }
.desc { margin: 0 0 16px; white-space: pre-line; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 20px; }
.photos a { display: block; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); }
.photos img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card h3 { font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); margin: 20px 0 10px; font-weight: 600; }
.answer { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.answer-head { display: flex; justify-content: space-between; gap: 12px; font-size: var(--t-xs); color: var(--ink-3); margin-bottom: 6px; }
.answer-head > span:last-child { white-space: nowrap; }
.answer-org { font-weight: 600; color: var(--ink); }
.answer p { margin: 0; font-size: var(--t-sm); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 12px 10px; font-size: var(--t-sm); }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--ink-3); }
.timeline li:last-child::before { background: var(--accent); border-color: var(--accent); }
.timeline time { display: block; font-size: var(--t-xs); color: var(--ink-3); }
.card-actions { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .brand-text small { display: none; }
  .nav a { padding: 8px 10px; }
}
@media (max-width: 1020px) {
  #btn-report span { display: none; }
  #btn-report { padding: 10px; }
}
@media (max-width: 900px) {
  :root { --top-h: 58px; }
  .top { gap: 10px; padding: 0 12px; }
  .coat { height: 40px; }
  .burger { display: grid; }
  .nav {
    position: absolute; top: var(--top-h); left: 0; right: 0; margin: 0; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ink); padding: 6px 12px 14px; box-shadow: 0 12px 24px rgba(0,0,0,.25);
    display: none;
  }
  .nav-open .nav { display: flex; }
  .nav a { padding: 12px 12px; font-size: var(--t-md); border-radius: var(--radius-sm); }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .btn-float { display: inline-flex; }
  .filters { top: 60px; left: 12px; right: 12px; width: auto; display: none; }
  .filters-open .filters { display: grid; }
  .legend { left: 12px; bottom: 12px; }
  .drawer { top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 62%; border-radius: 16px 16px 0 0; }
  .drawer-open .maplibregl-ctrl-top-right { right: 0; }
  .drawer-open .legend, .drawer-open .maplibregl-ctrl-bottom-right { display: none; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .main { padding-top: 28px; }
  h1 { font-size: 26px; }
  .lead { font-size: var(--t-md); }
  .cat { padding: 16px 16px 8px; }
  .cat-head { flex-wrap: wrap; }
  .cat-map { margin-left: 22px; width: 100%; }
  .titem { grid-template-columns: 1fr 18px; gap: 4px 12px; }
  .t-nums { grid-column: 1; grid-row: 2; justify-content: flex-start; }
  .t-go { grid-row: 1 / span 2; grid-column: 2; }
  .ritem { grid-template-columns: 56px 1fr; gap: 12px; padding: 12px; }
  .thumb { width: 56px; height: 56px; }
  .r-date { display: none; }
  .filter-row select { min-width: 0; flex: 1 1 160px; }
  .statuses { grid-template-columns: 1fr; gap: 4px 0; }
  .statuses dd { margin-bottom: 10px; }
  .kpi-box b { font-size: 24px; }
  .brand-text b { font-size: var(--t-md); }
}
/* ---------- поиск адреса и здание ---------- */
.asearch { position: absolute; top: 16px; left: 16px; z-index: 12; width: 280px; }
.asearch input {
  width: 100%; height: 44px; border: 0; border-radius: var(--radius); padding: 0 38px 0 40px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-sm); box-shadow: var(--shadow);
}
.asearch input::-webkit-search-cancel-button { display: none; }
.asearch input:focus { outline: 2px solid var(--accent); outline-offset: 0; }
.asearch-ico { position: absolute; left: 13px; top: 13px; color: var(--ink-3); pointer-events: none; }
.asearch-x { position: absolute; right: 6px; top: 7px; width: 30px; height: 30px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-3); font-size: 20px; line-height: 1; }
.asearch-x:hover { background: var(--surface-2); color: var(--ink); }
.asearch-list {
  list-style: none; margin: 6px 0 0; padding: 6px; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;   /* без прокрутки: прокручиваемый слой над WebGL-картой даёт артефакты */
}
.asearch-list li { padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; display: grid; gap: 1px; }
.asearch-list li[aria-selected="true"], .asearch-list li:hover { background: var(--surface-2); }
.asearch-list b { font-weight: 600; font-size: var(--t-sm); color: var(--ink); }
.asearch-list small { font-size: var(--t-xs); color: var(--ink-3); }
.asearch-list .a-empty { cursor: default; color: var(--ink-3); font-size: var(--t-sm); }
.asearch-list .a-empty:hover { background: none; }
.filters { top: 72px; }

.maplibregl-popup.bpop .maplibregl-popup-content { border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); font-family: var(--font); min-width: 210px; }
.bpop h4 { margin: 0 24px 2px 0; font-size: var(--t-md); line-height: 1.3; color: var(--ink); }
.bpop p { margin: 0 0 10px; font-size: var(--t-xs); color: var(--ink-3); }
.bpop .btn { width: 100%; justify-content: center; height: 36px; font-size: var(--t-sm); }
.bpop .maplibregl-popup-close-button { font-size: 18px; width: 28px; height: 28px; right: 4px; top: 4px; border-radius: 50%; color: var(--ink-3); }
.maplibregl-popup.bpop { pointer-events: auto; }

@media (max-width: 860px) {
  .asearch { top: 12px; left: 12px; right: 54px; width: auto; }
  .btn-float { top: 64px; }
  .filters { top: 112px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
@media (max-width: 600px) {
  .legend { gap: 8px; padding: 5px 10px; font-size: 11px; }
}

/* ---------- слой УК и сведения ГИС ЖКХ ---------- */
.switch { margin-top: 0; display: flex; align-items: center; gap: 10px; font-size: var(--t-sm); color: var(--ink-2); cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { flex: none; width: 34px; height: 20px; border-radius: 10px; background: var(--line); position: relative; transition: background .18s; }
.switch .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .18s; }
.switch input:checked + .sw { background: var(--accent); }
.switch input:checked + .sw::after { transform: translateX(14px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp { margin: -4px 0 10px; font-size: var(--t-xs); color: var(--ink-2); }
.hp-facts { margin: 0 0 6px !important; color: var(--ink-2) !important; }
.hp-warn { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 4px; background: #ffe3e3; color: #c92a2a; font-weight: 600; }
.hp-org { padding: 8px 10px; border-radius: 8px; background: var(--surface-2); display: grid; gap: 3px; }
.hp-org b { font-size: var(--t-sm); color: var(--ink); line-height: 1.3; }
.hp-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); }
.hp-muted { color: var(--ink-3); line-height: 1.35; }
.hp-dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 8px; margin: 2px 0; }
.hp-dl dt { color: var(--ink-3); } .hp-dl dd { margin: 0; overflow-wrap: anywhere; }
.hp a { color: var(--accent); text-decoration: none; }
.hp-route { margin-top: 2px; color: var(--ink-2); font-weight: 600; }

/* ---------- страница «УК» ---------- */
.uk-search { position: relative; max-width: 620px; }
.uk-search .search { max-width: none; }
.uk-addr { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; }
.uk-house { background: #fff4e6; border: 1px solid #ffd8a8; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px; font-size: var(--t-md); }
.uk-house a { color: var(--accent); font-weight: 600; }
.ukc-list { display: grid; gap: 12px; margin-top: 8px; }
.ukc { background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--radius); padding: 16px 20px; scroll-margin-top: 80px; }
.ukc.is-picked { box-shadow: 0 0 0 2px var(--accent); }
.ukc-head { display: grid; grid-template-columns: 12px 1fr auto; gap: 12px; align-items: start; }
.ukc-head > i { width: 12px; height: 12px; border-radius: 3px; background: var(--c); margin-top: 6px; }
.ukc-head h2 { margin: 0; font-size: var(--t-lg); line-height: 1.3; }
.ukc-head small { color: var(--ink-3); font-size: var(--t-xs); }
.ukc-num { text-align: right; line-height: 1.1; }
.ukc-num b { display: block; font-size: var(--t-xl); font-variant-numeric: tabular-nums; }
.ukc-num span { font-size: var(--t-xs); color: var(--ink-3); }
.ukc-body { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 8px 24px; margin: 12px 0 0 24px; font-size: var(--t-sm); }
.ukc-dl { margin: 0; align-content: start; }
.ukc-kpi .kpi-box:first-child b { color: inherit; }
.ukc-side p { margin: 0 0 6px; }
.ukc-facts { color: var(--ink-2); }
.ukc-ds { display: flex; flex-wrap: wrap; gap: 4px; }
.ukc-ds span { background: var(--surface-2); border-radius: 999px; padding: 2px 8px; font-size: var(--t-xs); color: var(--ink-2); }
.ukc-act { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 0 24px; }
.ukc-act .btn { padding: 7px 14px; font-size: var(--t-xs); }
.ukc-houses { margin: 12px 0 0 24px; }
.ukh { list-style: none; margin: 0; padding: 0; columns: 2 280px; column-gap: 24px; font-size: var(--t-sm); }
.ukh li { break-inside: avoid; padding: 4px 0; border-bottom: 1px solid var(--surface-2); display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.ukh a { color: var(--ink); text-decoration: none; } .ukh a:hover { color: var(--accent); text-decoration: underline; }
.ukh small { color: var(--ink-3); font-size: var(--t-xs); }
.ukh em { font-style: normal; font-size: 11px; padding: 0 6px; border-radius: 4px; background: #ffe3e3; color: #c92a2a; font-weight: 600; }
@media (max-width: 700px) {
  .ukc { padding: 14px; }
  .ukc-body, .ukc-act, .ukc-houses { margin-left: 0; }
  .ukc-body { grid-template-columns: 1fr; }
  .filter-row select { min-width: 0; flex: 1 1 160px; }
}

/* ---------- реклама: баннер под фильтрами карты (как в 2ГИС: картинка 336×280, подпись снизу) ---------- */
.lcol { position: absolute; top: 72px; left: 16px; z-index: 10; width: 280px; display: flex; flex-direction: column; gap: 12px; max-height: calc(100% - 120px); }
.lcol > .filters { position: static; width: auto; flex: none; }
.pr-box { background: rgba(255,255,255,.96); backdrop-filter: blur(8px); border-radius: var(--radius); box-shadow: var(--shadow); flex: none; overflow: hidden; }
.pr-stage { position: relative; display: grid; }
.pr-frame { grid-area: 1 / 1; position: relative; }
.pr-frame.is-in { z-index: 1; animation: pr-in .45s ease both; }
@keyframes pr-in { from { opacity: 0; } to { opacity: 1; } }
.pr-link { display: grid; gap: 4px; text-decoration: none; color: var(--ink); }
.pr-link img { width: 100%; height: auto; aspect-ratio: 6 / 5; object-fit: cover; display: block; background: var(--surface-2); }
.pr-txt { display: grid; gap: 3px; min-width: 0; padding: 12px 14px 4px; }
.pr-link.pr-has-img .pr-txt { padding-top: 6px; }
.pr-txt b { font-size: var(--t-md); line-height: 1.3; }
.pr-txt span { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.4; }
.pr-txt em { font-style: normal; font-size: var(--t-sm); font-weight: 600; color: var(--accent); }
.pr-link:hover b { text-decoration: underline; }
.pr-foot { display: flex; align-items: center; gap: 8px; padding: 6px 12px 8px; }
.pr-lbl { flex: 1; min-width: 0; font-size: 11px; line-height: 1.35; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-lbl:hover, .pr-ad .pr-lbl { white-space: normal; overflow-wrap: anywhere; }
.pr-dots { display: flex; gap: 2px; flex: none; }
.pr-dots button { width: 16px; height: 16px; border: 0; padding: 0; background: none; display: grid; place-items: center; }
.pr-dots button::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #c9cdd3; transition: background .2s, transform .2s; }
.pr-dots button[aria-current="true"]::before { background: var(--accent); transform: scale(1.25); }
.pr-box.is-self { background: rgba(255,248,241,.97); }
.ad-formats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin: 12px 0 8px; }
.adf { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 4px; }
.adf b { font-size: var(--t-md); } .adf span { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.45; }
@media (max-width: 860px) {
  .lcol { display: contents; }
  .lcol > .filters { position: absolute; }
  .pr-map { display: none !important; }   /* на телефоне карта важнее */
}
/* подгонка под высоту экрана (pr.js): компактные фильтры, затем уменьшение баннера по центру */
.pr-map { width: var(--pr-w, 100%); max-width: 100%; align-self: center; flex: none; }
.pr-compact .lcol { max-height: none; }
.pr-compact .legend { bottom: 12px; }
.pr-compact .lcol > .filters { gap: 8px; padding: 10px 12px; }
.pr-compact .lcol > .filters .field { gap: 2px; }
.pr-compact .lcol > .filters select { padding-top: 6px; padding-bottom: 6px; }
.pr-compact .lcol > .filters .seg button { padding: 4px 8px; }
.pr-compact .lcol > .filters .switch { line-height: 1.25; }
.pr-map.pr-off { display: none !important; }
@media (prefers-reduced-motion: reduce) { .pr-frame.is-in { animation: none; } }
@media (max-width: 600px) { .ad-formats { grid-template-columns: 1fr; } }
