/* Главный экран, вид 2 (chrome.js). Грузится после nav.css и переопределяет
 * его раскладку: одна карточка сверху, один блок кнопок справа, короткая
 * подпись внизу. Цвета — переменными: тёмная тема меняет только их.
 *
 *   поверхность  --c-surface   ink --c-ink   приглушённый --c-mut
 *   акцент       --c-acc       мягкий фон --c-soft
 * Радиус: 14 у карточек, 17 у чипов; тень одна на весь экран. */
:root {
  --c-surface: #fff; --c-ink: #172033; --c-mut: #64748b; --c-line: rgba(15, 23, 42, .1);
  --c-acc: #0969da; --c-soft: #eaf2fd; --c-soft2: #f4f7fb;
  --c-shadow: 0 2px 12px rgba(15, 23, 42, .16);
  --c-sab: env(safe-area-inset-bottom, 0px); --c-sat: env(safe-area-inset-top, 0px);
}
body.theme-dark {
  --c-surface: #172134; --c-ink: #e6ecf5; --c-mut: #94a3b8; --c-line: rgba(255, 255, 255, .1);
  --c-acc: #4da3ff; --c-soft: #1f3556; --c-soft2: #1d2a42;
  --c-shadow: 0 2px 14px rgba(0, 0, 0, .5);
}

/* ---- прежние элементы: убраны, их роль у новых ---- */
#map { top: 0 !important }
#topbar, .fab, .leaflet-control-zoom, .maplibregl-ctrl-top-right,
.leaflet-control-attribution, .maplibregl-ctrl-attrib { display: none !important }
body.d3active #hdr3d-nav, body.d3active #hdr3d-themes, body.d3active #hdr3d-filters, body.d3active #info3d { display: none !important }
body.d3active #map3d-map { top: 0 !important }

/* ---- верхняя карточка ---- */
.tc { position: fixed; z-index: 1250; top: calc(10px + var(--c-sat)); left: 10px; right: 10px;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none }
.tc > * { pointer-events: auto }
.tc-card { position: relative; display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 5px 0 4px;
  background: var(--c-surface); border-radius: 14px; box-shadow: var(--c-shadow) }
.tc .search-wrap { flex: 1; min-width: 0; position: relative }
.tc .sw3d { display: none }
body.d3active .tc .sw3d { display: block }
body.d3active .tc .sw2d { display: none }
.tc .search-wrap input { width: 100%; height: 46px; padding: 0 30px 0 38px; border: 0; background: transparent; box-shadow: none;
  border-radius: 12px; font-size: 16px; color: var(--c-ink); outline: none }
.tc .search-wrap input:focus { box-shadow: none }
.tc .search-wrap input::placeholder { color: var(--c-mut) }
.tc .search-wrap .ic { left: 12px; display: flex; color: var(--c-mut) }
.tc .search-wrap .clr { right: 2px; background: var(--c-soft2); color: var(--c-mut) }
.tc .search-results { top: 54px; left: -4px; right: auto; width: calc(100vw - 20px); max-width: 100vw; border-radius: 14px; border: 0; box-shadow: var(--c-shadow);
  background: var(--c-surface); color: var(--c-ink) }
#sr3d { background: var(--c-surface) !important; border: 0 !important; border-radius: 14px !important; box-shadow: var(--c-shadow) !important }
#sr3d .sr3d-item { border-bottom: 1px solid var(--c-line) }
#sr3d .sr3d-item div { color: var(--c-ink) !important }
#sr3d .sr3d-item div + div { color: var(--c-mut) !important }
.tc-b { flex: none; display: flex !important; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0 !important; margin: 0 !important;
  border: 0 !important; border-radius: 50% !important; background: transparent; color: var(--c-acc); cursor: pointer; touch-action: manipulation; line-height: 0 }
.tc-b:hover { background: var(--c-soft2) }
.tc-lang svg { border-radius: 3px; box-shadow: 0 0 0 1px var(--c-line) }
.tc-card .pf-btn .pf-t { display: none }
.tc-card .pf-btn .pf-ava { width: 30px; height: 30px; font-size: 14px }
/* список языков */
.tc .tc-menu { z-index: 5; position: absolute; top: 54px; right: 0; left: auto; bottom: auto; display: none; flex-direction: column; gap: 0; padding: 6px;
  min-width: 190px; background: var(--c-surface); border-radius: 14px; box-shadow: var(--c-shadow); transform: none }
body.lang-open .tc .tc-menu { display: flex }
.tc .tc-menu button { display: flex; align-items: center; gap: 12px; width: 100%; height: 44px; padding: 0 12px; border: 0; border-radius: 10px;
  background: transparent; color: var(--c-ink); font: 600 15px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; cursor: pointer; text-align: left }
.tc .tc-menu button::after { content: attr(title) }
.tc .tc-menu button { opacity: 1; border: 0 }
.tc .tc-menu button:hover { background: var(--c-soft2) }
.tc .tc-menu button.on { background: var(--c-soft); color: var(--c-acc) }

/* ---- чипы ---- */
.tc-row { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 3px 4px 10px; margin: -3px -4px -10px }
.tc-row::-webkit-scrollbar { display: none }
.tc-chip, .tc-row .chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border: 0; border-radius: 17px;
  background: var(--c-surface); color: var(--c-ink); box-shadow: var(--c-shadow); font: 600 13px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  cursor: pointer; white-space: nowrap; touch-action: manipulation }
.tc-f i { font-style: normal; font-size: 10px; opacity: .6 }
.tc-f .n { display: none; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 9px; background: var(--c-acc); color: #fff; font-size: 11px; text-align: center }
.tc-f.on .n { display: inline-block }
.tc-f.on { background: var(--c-soft); color: var(--c-acc) }
.tc-row .chip.active { background: var(--c-acc); color: #fff }
.tc-back { display: none }
body.d3active .tc-back { display: inline-flex }
body.d3active .tc-fav { display: none }
.tc-st { display: none; flex: none; height: 34px; line-height: 34px; padding: 0 12px; border-radius: 17px; margin: 0; background: var(--c-surface);
  box-shadow: var(--c-shadow); color: var(--c-mut); font-size: 12px }
body.has-filter .tc-st:not(.tc-st3) { display: block }
body.d3active .tc-st:not(.tc-st3) { display: none !important }
body.d3active.has-filter .tc-st3 { display: block }

/* ---- лист «Фильтры» ---- */
.fs { position: fixed; z-index: 1260; display: none; left: 0; right: 0; bottom: 0; padding: 14px 14px calc(16px + var(--c-sab));
  background: var(--c-surface); color: var(--c-ink); border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .28) }
body.fs-open .fs { display: block }
.fs-h { display: flex; align-items: center; gap: 8px; margin-bottom: 10px }
.fs-h b { flex: 1; font-size: 17px }
.fs-r { border: 0; background: transparent; color: var(--c-acc); font: 600 14px/1 inherit; cursor: pointer; padding: 8px }
.fs-x { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--c-soft2); color: var(--c-mut); cursor: pointer; display: flex; align-items: center; justify-content: center }
.fs-g { display: none; flex-direction: column; gap: 8px }
.fs-2d { display: flex }
body.d3active .fs-2d { display: none }
body.d3active .fs-3d { display: flex }
.fs .chip { position: relative; display: flex; justify-content: space-between; width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; box-shadow: none;
  background: var(--c-soft2); border: 1px solid var(--c-line); font-size: 15px; font-weight: 500; color: var(--c-ink) }
.fs-row { display: flex; flex-direction: column; gap: 4px }
.fs-row span { font-size: 12px; color: var(--c-mut) }
.fs-row select { height: 46px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--c-line); background: var(--c-soft2); color: var(--c-ink); font-size: 15px }
.fs-row select option { background: var(--c-surface); color: var(--c-ink) }

/* ---- правый блок ---- */
.rail { position: fixed; z-index: 1250; right: 10px; bottom: calc(74px + var(--c-sab)); display: flex; flex-direction: column;
  background: var(--c-surface); border-radius: 14px; box-shadow: var(--c-shadow); overflow: hidden }
.rb { width: 44px; height: 44px; border: 0; padding: 0; background: transparent; color: var(--c-ink); cursor: pointer; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent }
.rb + .rb { border-top: 1px solid var(--c-line) }
.rb:hover { background: var(--c-soft2) }
.rb:active { background: var(--c-soft) }
.rb.on { color: var(--c-acc); background: var(--c-soft) }
#rbLoc { color: var(--c-acc) }
#rbCompass { display: none }
#rbCompass svg { transition: transform .15s }
body.d3active #rbCompass { display: flex }
body.d3active .rail { bottom: calc(24px + var(--c-sab)) }
body:has(#routePanel.show) .rail { bottom: calc(206px + var(--c-sab)) }
body.picking .tc, body.picking .rail { display: none }
body.navigating .tc, body.navigating .rail { display: none !important }

/* слои: всплывает слева от блока */
.layers-ctrl { position: fixed; z-index: 1270; left: auto; right: 64px; top: 120px; bottom: auto; display: none; min-width: 210px; border-radius: 14px;
  background: var(--c-surface); color: var(--c-ink); box-shadow: var(--c-shadow); overflow: hidden }
.layers-ctrl.open { display: block }
body:not(.d3active) .lc3 { display: none !important }
body.d3active .layers-ctrl:not(.lc3):not(.lcu) { display: none !important }
body.d3active .layers-ctrl.lc3.open { display: block !important }
.layers-ctrl button { background: transparent; color: var(--c-ink) }
.layers-ctrl button.active { background: var(--c-acc); color: #fff }
.layers-ctrl button + button { border-top-color: var(--c-line) }

/* ---- подпись ---- */
.attr-pill { position: fixed; z-index: 1240; left: 10px; bottom: calc(70px + var(--c-sab)); display: inline-flex; align-items: center; gap: 5px; height: 24px;
  padding: 0 9px 0 6px; border: 0; border-radius: 12px; background: rgba(255, 255, 255, .86); color: #475569; font: 500 11px/1 system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .18); cursor: pointer; backdrop-filter: blur(4px) }
.attr-pill i { font-style: normal; font-size: 13px; color: var(--c-acc) }
body.theme-dark .attr-pill { background: rgba(23, 33, 52, .88); color: #aab8cc }
body.d3active .attr-pill { bottom: calc(12px + var(--c-sab)) }
body:has(#routePanel.show) .attr-pill { bottom: calc(190px + var(--c-sab)) }
body.navigating .attr-pill { bottom: calc(84px + var(--c-sab)) }
body.picking .attr-pill { display: none }
body.attr-open:not(.d3active) .leaflet-control-attribution, body.attr-open.d3active .maplibregl-ctrl-attrib {
  display: block !important; position: fixed; left: 10px; right: auto; bottom: calc(100px + var(--c-sab)); z-index: 1245; max-width: calc(100vw - 20px);
  padding: 9px 12px; border-radius: 12px; background: var(--c-surface) !important; color: var(--c-ink) !important; box-shadow: var(--c-shadow); font-size: 12px; line-height: 1.5 }
body.d3active.attr-open .maplibregl-ctrl-attrib { bottom: calc(44px + var(--c-sab)) }
body.attr-open .leaflet-control-attribution a, body.attr-open .maplibregl-ctrl-attrib a { color: var(--c-acc) !important }

/* ---- нижние вкладки: тоньше и легче ---- */
.tabbar { left: 10px; right: 10px; bottom: calc(8px + var(--c-sab)); padding: 2px 4px; border-radius: 18px; background: var(--c-surface); box-shadow: var(--c-shadow) }
.tab { min-height: 46px; padding: 4px 2px; gap: 2px; font-size: 10.5px; font-weight: 600; color: var(--c-mut) }
.tab svg { width: 22px; height: 22px }
.tab.on { color: var(--c-acc) }
body.theme-dark .tabbar { background: var(--c-surface) }
body.theme-dark .tab { color: var(--c-mut) }
body.theme-dark .tab.on { color: var(--c-acc) }

/* ---- компьютер ---- */
@media (min-width: 700px) {
  .tc { left: 14px; right: auto; width: 400px }
  .tc .search-results { width: 400px }
  .fs { left: 14px; right: auto; bottom: auto; top: 112px; width: 400px; border-radius: 16px; padding-bottom: 16px; box-shadow: var(--c-shadow) }
  .rail { right: 14px; top: 50%; bottom: auto; transform: translateY(-50%) }
  body.d3active .rail { bottom: auto }
  body:has(#routePanel.show) .rail { bottom: auto }
  .layers-ctrl { right: 70px }
  .tabbar { width: 340px; left: 50%; right: auto; transform: translateX(-50%) }
  .attr-pill { left: 14px; bottom: 14px }
  body:has(#routePanel.show) .attr-pill { bottom: 14px }
  body.attr-open:not(.d3active) .leaflet-control-attribution, body.attr-open.d3active .maplibregl-ctrl-attrib { left: 14px; bottom: 46px }
  body.d3active.attr-open .maplibregl-ctrl-attrib { bottom: 46px }
}

/* ---- список языков (36, с флагами и поиском) ---- */
.tc .lm { width: 300px; max-width: calc(100vw - 20px); padding: 8px; gap: 6px }
.lm-q { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--c-line); border-radius: 10px; background: var(--c-soft2); color: var(--c-ink); font-size: 15px; outline: none }
.lm-q:focus { border-color: var(--c-acc) }
.lm-list { max-height: min(58vh, 420px); overflow-y: auto; display: flex; flex-direction: column }
.tc .lm-list button::after { content: none }
.tc .lm-list button { height: 42px; flex: none }
.tc .lm-list button span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
/* ---- справа налево (ar, fa, ps): интерфейс зеркалится, карта — нет ---- */
html[dir=rtl] #map, html[dir=rtl] #map3d-map, html[dir=rtl] .leaflet-container, html[dir=rtl] .maplibregl-map { direction: ltr }
html[dir=rtl] .leaflet-popup-content, html[dir=rtl] .maplibregl-popup-content { direction: rtl; text-align: right }
html[dir=rtl] .tc .search-wrap input { text-align: right; padding: 0 38px 0 30px }
html[dir=rtl] .tc .search-wrap .ic { left: auto; right: 12px }
html[dir=rtl] .tc .search-wrap .clr { right: auto; left: 2px }
html[dir=rtl] .tc .tc-menu { right: auto; left: 0 }
html[dir=rtl] .au-act, html[dir=rtl] .au-card { text-align: right }
html[dir=rtl] .au-ch { transform: scaleX(-1) }
html[dir=rtl] .au-r input { padding-right: 13px; padding-left: 44px }
html[dir=rtl] .au-eye { right: auto; left: 4px }
html[dir=rtl] .au-x { right: auto; left: 10px }
html[dir=rtl] .au-win .as-head { padding: 0 0 10px 36px }
html[dir=rtl] .au-prof { padding: 4px 0 14px 36px }
html[dir=rtl] .fs-row select, html[dir=rtl] .fs .chip { direction: rtl }
html[dir=rtl] .tc-f i { margin-right: 0 }

/* ---- поиск: свой крестик, без встроенного браузерного (были два подряд) ---- */
.tc .search-wrap input[type=search] { -webkit-appearance: none; appearance: none }
.tc .search-wrap input::-webkit-search-cancel-button, .tc .search-wrap input::-webkit-search-decoration { -webkit-appearance: none; display: none }
/* ---- лист фильтров: кнопка «Показать N» ---- */
.fs-done { display: block; width: 100%; height: 48px; margin-top: 12px; border: 0; border-radius: 14px; background: var(--c-acc); color: #fff; font: 700 16px/1 inherit; cursor: pointer }
body.theme-dark .fs-done { color: #0b1220 }

/* ---- карточка места: нижний лист на телефоне (card.js) ---- */
.pc { display: none }
@media (max-width: 699px) {
  /* всплывающие окна Leaflet на телефоне заменены листом; меню правой кнопки остаётся */
  .leaflet-popup:not(.ctx-pop), .maplibregl-popup:not(.ctx-pop3m) { display: none !important }
  .pc { display: flex; flex-direction: column; position: fixed; z-index: 1256; left: 0; right: 0; bottom: 0; max-height: 88vh; max-height: 88dvh;
    background: var(--c-surface); color: var(--c-ink); border-radius: 20px 20px 0 0; box-shadow: 0 -6px 28px rgba(15, 23, 42, .28);
    transition: transform .26s cubic-bezier(.2, .8, .2, 1); will-change: transform; padding-bottom: var(--c-sab) }
  .pc.closed { transform: translateY(105%); visibility: hidden; transition: transform .26s, visibility 0s .26s }
  .pc.peek { transform: translateY(calc(100% - var(--peek, 200px) - var(--c-sab))) }
  .pc.full { transform: none }
  .pc.peek .pc-more { overflow: hidden }
  .pc-top { flex: none; position: relative; padding: 0 16px 14px }
  .pc-grab { width: 42px; height: 5px; border-radius: 3px; background: var(--c-line); margin: 8px auto 10px; cursor: pointer }
  .pc-x { position: absolute; top: 8px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--c-soft2); color: var(--c-mut); display: flex; align-items: center; justify-content: center; z-index: 2 }
  .pc-photos { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px 10px; padding: 0 16px; scrollbar-width: none }
  .pc-photos::-webkit-scrollbar { display: none }
  .pc-photos.none { display: none }
  .pc-photos img { flex: none; height: 96px; width: 150px; object-fit: cover; border-radius: 12px; scroll-snap-align: start; background: var(--c-soft2) }
  .pc-photos img:only-child { width: 100%; height: 108px }
  .pc.full .pc-photos img { height: 190px; width: 270px }
  .pc.full .pc-photos img:only-child { height: 200px }
  .pc-h { padding-right: 40px }
  .pc-t { margin: 0; font: 700 20px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; overflow-wrap: anywhere }
  .pc-s { margin-top: 3px; color: var(--c-mut); font-size: 14px }
  .pc-go { margin-top: 12px }
  .pc.full .pc-go { display: none }
  .pc-more { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 16px 18px; overscroll-behavior: contain }
  .pc-act { display: flex; gap: 14px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; border-bottom: 1px solid var(--c-line) }
  .pc-act::-webkit-scrollbar { display: none }
  .pc-b { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; background: none; border: 0; padding: 0; color: var(--c-acc);
    font: 600 11.5px/1.2 system-ui, -apple-system, Segoe UI, Roboto, sans-serif; text-decoration: none; cursor: pointer; touch-action: manipulation }
  .pc-bi { width: 48px; height: 48px; border-radius: 50%; background: var(--c-soft); display: flex; align-items: center; justify-content: center }
  .pc-b.pc-blue .pc-bi { background: var(--c-acc); color: #fff }
  .pc-b.on .pc-bi { background: #f59e0b; color: #fff }
  .pc-bl { max-width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--c-ink) }
  .pc-primary { flex-direction: row; justify-content: center; gap: 10px; width: 100%; height: 50px; border-radius: 14px; background: var(--c-acc); color: #fff }
  .pc-primary .pc-bi { width: auto; height: auto; background: none; color: #fff }
  .pc-primary .pc-bl { max-width: none; color: #fff; font-size: 16px; font-weight: 700 }
  .pc-info { padding-top: 8px }
  .pc-r { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--c-line); font-size: 15px; line-height: 1.35 }
  .pc-r .pc-i { color: var(--c-acc); flex: none; margin-top: 1px }
  .pc-rt { min-width: 0; overflow-wrap: anywhere }
  .pc-rt a { color: var(--c-acc); text-decoration: none }
  .pc-soc { display: flex; gap: 14px; flex-wrap: wrap }
  .pc-d { color: var(--c-mut); font-size: 14px; line-height: 1.45; margin: 12px 0 0 }
  .pc.generic .pc-top { padding-bottom: 0 }
  .pc.generic .pc-more { padding-top: 0 }
  /* пока лист открыт — вкладки и правый блок уступают ему место, подпись поднимается над ним */
  body.pc-open .tabbar, body.pc-open .rail { display: none }
  body.pc-open .attr-pill { bottom: calc(var(--pc-vis, 0px) + 10px) }
  body.pc-open.d3active .attr-pill { bottom: calc(var(--pc-vis, 0px) + 10px) }
  html[dir=rtl] .pc-x { right: auto; left: 10px }
  html[dir=rtl] .pc-h { padding-right: 0; padding-left: 40px }
}

/* ---- единая панель слоёв ---- */
.layers-ctrl:not(.lcu) { display: none !important }
.layers-ctrl.lcu.open { display: block !important; width: 268px; max-width: calc(100vw - 84px); max-height: calc(100vh - 150px); max-height: calc(100dvh - 150px); overflow-y: auto; padding: 6px 0 8px }
.lcu .lc-h { padding: 12px 14px 4px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; opacity: .62 }
.lcu .lc-g { padding: 8px 14px 2px; font-size: 11px; opacity: .5 }
.lcu button { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; border-top: 0 !important; padding: 9px 14px; font: inherit; font-size: 13.5px; text-align: left; cursor: pointer; background: transparent; color: inherit }
.lcu button:hover { background: rgba(127,127,127,.1) }
.lcu .lc-o small { margin-left: auto; font-size: 10.5px; opacity: .55; text-align: right; max-width: 90px; line-height: 1.2 }
.lcu .lc-dot { flex: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; opacity: .45; position: relative }
.lcu .lc-o.on .lc-dot { opacity: 1; border-color: var(--c-acc, #0969da) }
.lcu .lc-o.on .lc-dot::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; background: var(--c-acc, #0969da) }
.lcu .lc-o.on { font-weight: 700 }
.lcu .lc-seg { display: flex; gap: 6px; padding: 4px 14px 2px }
.lcu .lc-seg button { justify-content: center; border: 1px solid rgba(127,127,127,.35) !important; border-radius: 9px; padding: 8px 6px; background: transparent }
.lcu .lc-seg button.active { background: var(--c-acc, #0969da); border-color: var(--c-acc, #0969da) !important; color: #fff }
.lcu .lc-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 2px }
.lcu .lc-chip { width: auto; padding: 6px 10px; border: 1px solid rgba(127,127,127,.35) !important; border-radius: 999px; font-size: 12.5px }
.lcu .lc-chip.on { background: var(--c-acc, #0969da); border-color: var(--c-acc, #0969da) !important; color: #fff }
.lcu .lc-t span { flex: 1 }
.lcu .lc-sw { flex: none; width: 34px; height: 20px; border-radius: 10px; background: rgba(127,127,127,.4); position: relative; transition: background .15s }
.lcu .lc-sw::after { content: ''; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s }
.lcu .lc-t.on .lc-sw { background: var(--c-acc, #0969da) }
.lcu .lc-t.on .lc-sw::after { left: 16px }
.lcu .lc-t small, .lcu button.off small { font-size: 10.5px; opacity: .6 }
.lcu button.off { opacity: .5; cursor: default }
.lcu .lc-d { margin-top: 4px; border-top: 1px solid rgba(127,127,127,.25) !important; justify-content: flex-start }

/* ---- фильтр «Места»: категории кнопками ---- */
.fs-pl { padding: 4px 0 10px }
.fs-pl-h { font-weight: 700; font-size: 13.5px; margin: 2px 0 2px }
.fs-pl-s { font-size: 12px; opacity: .62; margin-bottom: 6px; min-height: 0 }
.fs-pl-s:empty { display: none }
.fs-pl-c { display: flex; flex-wrap: wrap; gap: 6px; max-height: 190px; overflow-y: auto; padding: 2px 0 }
.fs-pc { border: 1px solid var(--c-line, rgba(127,127,127,.35)); background: transparent; color: inherit; border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 12.5px; cursor: pointer; white-space: nowrap }
.fs-pc.on { background: var(--c-acc, #0969da); border-color: var(--c-acc, #0969da); color: #fff }
.fs-pc.all { font-weight: 700 }

/* ---- касания: без задержки 300 мс и двойного тап-зума, зона нажатия не меньше 44×44 ---- */
button, a, summary, select, label, input, textarea, [role=button], .sr-item, .sr3d-item, .lcu button, .au-act, .as-it, .fs-pc, .pc-b { touch-action: manipulation; -webkit-tap-highlight-color: transparent }
.tc-b { width: 44px; height: 44px }
.tc-chip, .tc-row .chip { position: relative }
.tc-chip::after, .tc-row .chip::after { content: ''; position: absolute; left: 0; right: 0; top: -2px; bottom: -8px }   /* видимая высота 34, зона нажатия 44 */
.attr-pill::after { content: ''; position: absolute; inset: -10px -8px }
.pc-x { width: 44px; height: 44px; top: 4px; right: 6px }
.toast { pointer-events: none }      /* невидимое уведомление лежало поверх вкладки «Избранное» и съедало касания */
#clr { position: absolute }
#clr::after { content: ''; position: absolute; inset: -10px }
@media (max-width: 699px), (pointer: coarse) {
  .lcu .lc-o, .lcu .lc-seg button, .lcu .lc-chip, .lcu .lc-t, .lcu .lc-d, .fs-pc { min-height: 44px }
  .lcu .lc-chip, .fs-pc { padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center }
}
/* значки мест: зона нажатия не меньше 44×44, даже если значок меньше */
.leaflet-marker-icon:not(.leaflet-div-icon)::after { content: ''; position: absolute; inset: -9px; border-radius: 50% }
.leaflet-marker-icon { touch-action: manipulation }


/* масштабная линейка и измерение (ruler.js) */
.pscale { position: fixed; z-index: 1239; left: 12px; bottom: calc(100px + var(--c-sab)); pointer-events: none; font: 600 11px system-ui, sans-serif; color: var(--c-ink); text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 2px #fff }
.pscale span { display: block; margin: 0 0 1px 2px }
.pscale i { display: block; height: 6px; border: 2px solid var(--c-ink); border-top: 0; box-shadow: 0 0 0 1px rgba(255,255,255,.7) }
body.theme-dark .pscale { color: #e6edf6; text-shadow: 0 0 3px #0d1523, 0 0 3px #0d1523 }
body.theme-dark .pscale i { border-color: #e6edf6; box-shadow: 0 0 0 1px rgba(0,0,0,.5) }
body.d3active .pscale { bottom: calc(42px + var(--c-sab)) }
body:has(#routePanel.show) .pscale { bottom: calc(218px + var(--c-sab)) }
body.navigating .pscale { display: none }
.pruler { position: fixed; z-index: 1260; left: 50%; transform: translateX(-50%); bottom: calc(24px + var(--c-sab)); display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 90px); padding: 4px 6px 4px 14px; border-radius: 24px; background: var(--c-bg, #fff); color: var(--c-ink); box-shadow: 0 2px 14px rgba(0,0,0,.28); font: 14px system-ui, sans-serif }
.pruler b { font-weight: 600; white-space: nowrap }
.pruler span { font-weight: 700; color: #cf222e; min-width: 56px; text-align: right; white-space: nowrap }
.pruler button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 20px; cursor: pointer; touch-action: manipulation }
.pruler button:hover { background: var(--c-soft2, #eef1f5) }
.pruler button:disabled { opacity: .35; cursor: default }
body.ruling .leaflet-container, body.ruling .maplibregl-canvas { cursor: crosshair !important }
.pruler { bottom: calc(86px + var(--c-sab)) }
body.d3active .pruler { bottom: calc(24px + var(--c-sab)) }
body.ruling .pscale { bottom: calc(160px + var(--c-sab)) }
body.ruling.d3active .pscale { bottom: calc(100px + var(--c-sab)) }

/* список результатов фильтра */
.rl { position: fixed; z-index: 1245; display: none; flex-direction: column; background: var(--c-bg, #fff); color: var(--c-ink); box-shadow: 0 4px 22px rgba(0,0,0,.28); overflow: hidden }
.rl.on { display: flex }
.rl-h { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--c-line, #e3e8ee); font-size: 15px }
.rl-x { width: 44px; height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer; border-radius: 50%; display: flex; align-items: center; justify-content: center }
.rl-b { overflow-y: auto; flex: 1; -webkit-overflow-scrolling: touch }
.rl-r { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 56px; padding: 8px 16px; border: 0; border-bottom: 1px solid var(--c-line, #eef1f4); background: transparent; color: inherit; text-align: left; cursor: pointer; font: inherit }
.rl-r:hover { background: var(--c-soft2, #f2f5f9) }
.rl-i { font-size: 22px; width: 28px; text-align: center; flex: none }
.rl-t { display: flex; flex-direction: column; min-width: 0 }
.rl-t b { font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.rl-t small { font-size: 12px; opacity: .65; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
@media (min-width: 700px) { .rl { left: 12px; top: 128px; bottom: 12px; width: 340px; border-radius: 16px } }
@media (max-width: 699px) { .rl { left: 0; right: 0; bottom: 0; height: 46%; border-radius: 18px 18px 0 0; padding-bottom: env(safe-area-inset-bottom, 0) } }
body.navigating .rl, body.picking .rl { display: none !important }

/* тип пунктов в фильтре: Города / Сёла и поиск */
.ct { margin: 4px 0 8px }
.ct-t { display: flex; background: var(--c-soft, #eef1f5); border-radius: 12px; padding: 3px; gap: 3px }
.ct-b { flex: 1; min-height: 40px; border: 0; border-radius: 10px; background: transparent; color: var(--c-ink); font: 600 14px system-ui, sans-serif; cursor: pointer; touch-action: manipulation }
.ct-b.on { background: var(--c-bg, #fff); color: var(--c-acc); box-shadow: 0 1px 4px rgba(0,0,0,.18) }
.ct-q { width: 100%; box-sizing: border-box; margin-top: 8px; min-height: 40px; padding: 0 12px; border: 1px solid var(--c-line, #d0d7de); border-radius: 10px; background: var(--c-bg, #fff); color: var(--c-ink); font: 14px system-ui, sans-serif }

/* ---- низкие окна (ноутбук 1366×768 ≈ 600 px видимой высоты): ничего не обрезается ---- */
body.fs-open .fs { display: flex; flex-direction: column; max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px) }
.fs-h, .fs-done { flex: none }
.fs-b { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch }
.fs-done { position: sticky; bottom: 0 }
@media (min-width: 700px) {
  body.fs-open .fs { max-height: calc(100vh - 124px); max-height: calc(100dvh - 124px) }
  .rail { max-height: calc(100vh - 28px); max-height: calc(100dvh - 28px); overflow-y: auto; scrollbar-width: none }
  .rail::-webkit-scrollbar { display: none }
}
.leaflet-popup-content { max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); overflow-y: auto }
.maplibregl-popup-content { max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); overflow-y: auto }
@media (max-height: 640px) and (min-width: 700px) { .fs-pl-c { max-height: 120px } }
