/* Инвестиционная карта ДНР — светлое оформление: белые панели поверх карты,
   тёмно-синий акцент. Заголовки и крупные цифры — Bebas Neue, текст — PT Root UI. */

/* Айдентика Донецкой Народной Республики: золото, бумага, шрифты KEKUR (заголовки, цифры)
   и PT Root UI (интерфейс), герб — vendor/dnr-logo.svg, паттерн — vendor/pattern.png. */
@font-face { font-family: "Kekur"; src: url("vendor/fonts/kekur-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "PT Root UI"; src: url("vendor/fonts/ptroot-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "PT Root UI"; src: url("vendor/fonts/ptroot-medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "PT Root UI"; src: url("vendor/fonts/ptroot-bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* золото айдентики: --brand — основной, --brand-2 — ссылки и обводки (темнее для
     контраста на светлом), --brand-ink — заголовки и крупные цифры (самое тёмное) */
  --brand: #b88c46;
  --brand-ink: #55391a;
  --brand-2: #8a6229;
  --brand-soft: #f6efe2;
  --brand-line: #e0cba4;
  --text: #1b2026;
  --muted: #6d7681;
  --line: #e6dccb;
  --bg: #f6f2ea;
  --panel: #ffffff;
  --chip: #faf6ee;
  --shadow: 0 6px 24px rgba(85, 57, 26, .12), 0 1px 3px rgba(85, 57, 26, .08);
  --r: 16px;
  --r-s: 10px;
  --head: 56px;
  --display: "Kekur", "PT Root UI", system-ui, sans-serif;
  --ui: "PT Root UI", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.4 var(--ui); color: var(--text); background: var(--bg); overflow: hidden; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
body:not(.service) .only-service { display: none !important; }

/* ------------------------------------------------------------- шапка */
.topbar {
  position: fixed; inset: 0 0 auto 0; height: var(--head); z-index: 1000;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 18px; background: var(--panel); color: var(--text);
  border-bottom: 1px solid var(--line); box-shadow: 0 2px 14px rgba(85, 57, 26, .08);
}
/* фирменный паттерн — еле заметной полосой по шапке */
.topbar::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("vendor/pattern.png") right center / auto 100% repeat-x; opacity: .07;
}
.topbar > * { position: relative; z-index: 1; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; min-width: 0; }
.brand-mark { width: 26px; height: 37px; flex: none; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1; min-width: 0; }
.brand-text b { font: 700 19px/1 var(--display); letter-spacing: .04em; text-transform: uppercase; color: var(--brand-ink); white-space: nowrap; }
.brand-text small { font-size: 11.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; letter-spacing: .01em; }
.topnav { display: flex; align-items: center; gap: 8px; }
.nav-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 19px; background: var(--panel); color: var(--brand-2);
  text-decoration: none; font-weight: 700; white-space: nowrap;
}
.nav-btn:hover { border-color: var(--brand); color: var(--brand-ink); background: var(--brand-soft); }
.nav-btn svg { width: 18px; height: 18px; }
.service-pill { font-size: 12px; font-weight: 700; letter-spacing: .02em; padding: 5px 10px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-ink); border: 1px solid var(--brand-line); }

.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: 44px; width: 280px; padding: 6px; display: none;
  background: var(--panel); color: var(--text); border-radius: 14px; box-shadow: var(--shadow);
}
.menu.open .menu-pop { display: block; }
.menu-pop button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 9px 12px; border-radius: 10px; }
.menu-pop button:hover { background: var(--brand-soft); }
.menu-pop b { display: block; font-weight: 700; }
.menu-pop small { color: var(--muted); }

/* ------------------------------------------------------------- сцена */
.stage { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; background: #f6f2ea; }

.panel {
  position: absolute; z-index: 600; background: var(--panel); border-radius: var(--r);
  box-shadow: var(--shadow);
}
.panel.left {
  top: calc(var(--head) + 14px); left: 14px; bottom: 14px; width: 372px;
  display: flex; flex-direction: column; overflow: hidden;
}
.panel.right {
  top: calc(var(--head) + 14px); right: 14px; width: 330px; max-height: calc(100% - var(--head) - 28px);
  overflow: auto; padding: 18px 20px;
}

/* вкладки */
.tabs { display: flex; gap: 4px; padding: 10px 10px 0; }
.tab {
  flex: 1; border: 0; background: none; padding: 9px 8px; border-radius: 12px 12px 0 0;
  font-weight: 700; color: var(--muted); border-bottom: 2px solid var(--line);
}
.tab.on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tab-body { padding: 12px 16px 0; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.tab-body[data-body="mo"] { padding-bottom: 16px; }

.count-pill {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  background: var(--brand-soft); border-radius: 22px; padding: 9px 14px; font-size: 13px;
}
.link { border: 0; background: none; color: var(--brand-2); padding: 0; font-weight: 500; }
.link:hover { text-decoration: underline; }

/* слои */
.layers { display: flex; flex-direction: column; gap: 2px; background: var(--chip); border-radius: 14px; padding: 6px; }
.layer {
  display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; cursor: pointer;
}
.layer:hover { background: #fff; }
.layer input { position: absolute; opacity: 0; pointer-events: none; }
.layer .tick {
  width: 18px; height: 18px; flex: none; border-radius: 50%; border: 2px solid var(--brand-line); background: #fff;
  display: grid; place-items: center;
}
.layer input:checked + .tick { border-color: var(--brand); background: var(--brand); }
.layer input:checked + .tick::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.layer input:focus-visible + .tick { outline: 2px solid var(--brand-2); outline-offset: 2px; }
.layer img { width: 20px; height: 20px; flex: none; }
.layer .lt { flex: 1; line-height: 1.25; }
.layer .lc { color: var(--muted); font-variant-numeric: tabular-nums; }
.layer.empty { opacity: .55; }

/* поиск и поля */
.search {
  display: flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px;
  border: 1px solid var(--line); border-radius: 21px; background: #fff;
}
.search:focus-within { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(36,87,214,.12); }
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; flex: 1; min-width: 0; background: none; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sel { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
.sel select, .sort select {
  height: 36px; border: 1px solid var(--line); border-radius: 18px; padding: 0 30px 0 12px; background: #fff
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23667085' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E")
    no-repeat right 12px center; appearance: none; color: var(--text); font-size: 13.5px; min-width: 0; width: 100%;
  text-overflow: ellipsis;
}
.sel select:focus, .sort select:focus { outline: 0; border-color: var(--brand-2); }

.block-title { font-weight: 700; font-size: 13px; }
.hint { display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid var(--brand-2); color: var(--brand-2); font-size: 10px; cursor: help; margin-left: 4px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  border-radius: 16px; padding: 4px 10px 4px 8px; font-size: 12.5px;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; }
.chip b { font-weight: 700; font-variant-numeric: tabular-nums; }
.chip.on { background: var(--brand-soft); border-color: var(--brand); }
.chip.zero { opacity: .5; }

/* список */
.list-head { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.sort { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.sort select { height: 30px; width: auto; font-size: 12.5px; }
.list { display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; }
.pcard {
  text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 11px 12px;
  display: grid; grid-template-columns: 28px 1fr; gap: 4px 10px; width: 100%;
}
.pcard:hover { border-color: var(--brand-line); background: #fbfcff; }
.pcard.on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(20,55,143,.12); }
.pcard img { width: 28px; height: 28px; grid-row: span 2; }
.pcard h3 { margin: 0; font-size: 13.5px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pcard .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.pcard .meta b { color: var(--text); font-weight: 700; }
.pcard .tags { grid-column: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.tag { font-size: 11.5px; padding: 2px 8px; border-radius: 10px; background: var(--chip); color: var(--text); white-space: nowrap; }
.tag.dl { color: #fff; }
.tag.nocoords { background: #fff3e0; color: #8a4b00; }
.tag.ok { background: #e7f6ee; color: #11683f; }
.empty-list { text-align: center; color: var(--muted); padding: 30px 10px; }

/* таблица округов */
.switch { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.switch input { width: 16px; height: 16px; accent-color: var(--brand); }
.mo-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mo-table th { text-align: left; font-size: 11.5px; font-weight: 500; color: var(--muted); padding: 6px 6px; border-bottom: 1px solid var(--line); }
.mo-table td { padding: 8px 6px; border-bottom: 1px solid var(--line); }
.mo-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mo-table tbody tr { cursor: pointer; }
.mo-table tbody tr:hover td { background: var(--brand-soft); }
.mo-table tbody tr.on td { background: var(--brand-soft); font-weight: 700; }
.mo-table tfoot td { font-weight: 700; border-bottom: 0; }
.mo-bar { height: 4px; border-radius: 2px; background: var(--brand-2); margin-top: 4px; opacity: .55; }
.mo-dl { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; color: #fff; font-size: 11px; text-align: center; margin-left: 4px; }

.checkbox-line { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.checkbox-line input { width: 16px; height: 16px; accent-color: var(--brand); flex: none; }
.exec-sum { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; }
.exec-row .top { display: flex; justify-content: space-between; font-size: 12.5px; gap: 8px; }
.exec-row .top b { font-weight: 700; }
.ebar { height: 8px; border-radius: 4px; background: var(--chip); overflow: hidden; margin-top: 4px; }
.ebar i { display: block; height: 100%; background: var(--brand-2); }
.stage-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.stage-list li { display: grid; grid-template-columns: 20px 1fr; gap: 2px 8px; font-size: 13px; align-items: start; }
.stage-list .dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 11px; color: #fff; margin-top: 1px; }
.stage-list .done .dot { background: #12b76a; border-color: #12b76a; }
.stage-list .late .dot { background: #f04438; border-color: #f04438; }
.stage-list .cur .dot { border-color: var(--brand); }
.stage-list small { grid-column: 2; color: var(--muted); font-size: 11.5px; }
.stage-list .late small { color: #b42318; }
.curator { display: flex; align-items: center; gap: 8px; font-size: 13px; background: var(--brand-soft); border-radius: 10px; padding: 7px 10px; margin: 8px 0; }

/* правая панель: сводка */
.sum-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.sum-head h2 { margin: 0; font: 700 17px/1.2 var(--display); text-transform: uppercase; letter-spacing: .03em; color: var(--brand-ink); }
.sum-sub { margin: 10px 0 2px; font-weight: 700; font-size: 15px; }
.icon-btn { width: 30px; height: 30px; flex: none; border: 0; border-radius: 50%; background: var(--chip); display: grid; place-items: center; }
.icon-btn svg { width: 16px; height: 16px; }
.big { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 14px; border-bottom: 1px solid var(--line); }
.big-row { display: grid; grid-template-columns: minmax(96px, auto) 1fr; align-items: center; gap: 12px; }
.big-row b { font: 700 30px/0.95 var(--display); color: var(--brand); text-align: right; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.big-row span { font-weight: 700; font-size: 13px; line-height: 1.2; }
.deadline-sum { padding: 12px 0; border-bottom: 1px solid var(--line); }
.dl-bar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 8px 0; background: var(--chip); }
.dl-bar span { display: block; height: 100%; cursor: pointer; }
.dl-legend { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; font-size: 12.5px; }
.dl-legend button { display: contents; }
.dl-legend .lbl { display: flex; align-items: center; gap: 7px; text-align: left; }
.dl-legend .lbl i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dl-legend .n { font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.dl-legend .on { color: var(--brand); text-decoration: underline; }
.sum-foot { padding-top: 10px; }

/* карточка проекта */
.card-top { display: flex; align-items: flex-start; gap: 10px; }
.card-top h2 { margin: 0; font-size: 16px; line-height: 1.3; flex: 1; }
.card-back { border: 0; background: none; color: var(--brand-2); padding: 0 0 10px; font-weight: 500; }
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; }
.card-tags .tag { font-size: 12px; padding: 3px 9px; }
.dl-box { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; margin: 8px 0 12px; color: #fff; }
.dl-box b { font: 700 26px/0.95 var(--display); }
.dl-box span { font-size: 12.5px; line-height: 1.25; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.fact { background: var(--chip); border-radius: 12px; padding: 9px 10px; }
.fact b { display: block; font: 700 19px/1.05 var(--display); color: var(--brand-ink); }
.fact span { font-size: 11.5px; color: var(--muted); }
.kv { margin: 0; display: grid; gap: 8px; }
.kv div { display: grid; gap: 1px; }
.kv dt { font-size: 11.5px; color: var(--muted); }
.kv dd { margin: 0; font-size: 13.5px; overflow-wrap: anywhere; }
.kv .svc dt::after { content: " · служебное"; color: #a15c00; }
.card-section { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.card-section h4 { margin: 0 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.card-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 17px; border: 1px solid var(--brand-line); background: #fff; color: var(--brand); font-weight: 700; text-decoration: none; font-size: 13px; }
.btn.primary { background: var(--brand); color: #1b2026; border-color: var(--brand); }

.gallery { position: relative; border-radius: 12px; overflow: hidden; background: #e9edf3; aspect-ratio: 16 / 10; margin: 10px 0 4px; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .gnav { position: absolute; top: 50%; transform: translateY(-50%); width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); display: grid; place-items: center; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
.gallery .gnav svg { width: 16px; height: 16px; }
.gallery .prev { left: 8px; } .gallery .next { right: 8px; }
.gallery .gcount { position: absolute; right: 8px; bottom: 8px; background: rgba(12,36,99,.75); color: #fff; font-size: 12px; padding: 2px 8px; border-radius: 10px; }

/* инструменты карты */
.map-tools { position: absolute; z-index: 600; right: 360px; top: calc(var(--head) + 14px); display: flex; flex-direction: column; gap: 10px; }
.round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: #fff; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--brand-ink); }
.round svg { width: 22px; height: 22px; }
@media (hover: hover) { .round:hover { background: var(--brand-soft); } }
.round.on { background: var(--brand); color: #1b2026; }

.legend { position: absolute; z-index: 600; right: 14px; bottom: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.legend-btn { height: 40px; padding: 0 16px; border: 0; border-radius: 20px; background: #fff; box-shadow: var(--shadow); font-weight: 700; }
.legend-body { background: #fff; border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; max-height: 50vh; overflow: auto; width: 290px; order: -1; }
.legend-body h5 { margin: 6px 0 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
.legend-body h5:first-child { margin-top: 0; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 2px 0; }
.legend-item img { width: 18px; height: 18px; }
.legend-item i { width: 12px; height: 12px; border-radius: 50%; }

.leaflet-control-attribution { font-size: 10.5px; background: rgba(255,255,255,.8) !important; border-radius: 8px 0 0 0; }
.leaflet-container { font-family: var(--ui); }

/* кластеры-«бублики» */
.donut { position: relative; display: grid; place-items: center; filter: drop-shadow(0 2px 4px rgba(12,36,99,.3)); }
.donut svg { position: absolute; inset: 0; z-index: 0 !important; }  /* leaflet.css ставит svg z-index 200 */
.donut b { position: relative; z-index: 1; font: 700 14px/1 var(--ui); color: var(--brand-ink); }

/* подписи округов на карте */
.mo-label { font: 700 11px/1.1 var(--ui); color: #6f4e20; text-transform: uppercase; letter-spacing: .05em; text-align: center; white-space: nowrap; transform: translate(-50%, -50%); text-shadow: 0 0 3px #f6f2ea, 0 0 3px #f6f2ea, 0 0 3px #f6f2ea; pointer-events: none; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--brand-ink); color: #fff; padding: 10px 16px; border-radius: 20px; opacity: 0; transition: .25s; z-index: 2000; pointer-events: none; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sheet-toggle { display: none; }
.move-bar {
  position: absolute; z-index: 900; left: 50%; bottom: 22px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 18px; box-shadow: var(--shadow);
  padding: 10px 12px 10px 18px; max-width: calc(100vw - 24px); border: 2px solid var(--brand);
}
.move-bar > div { display: flex; flex-direction: column; min-width: 0; }
.move-bar b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 420px; }
.move-bar span { font-size: 12px; color: var(--muted); }
.move-bar .btn { height: 36px; }
body.moving #map { cursor: crosshair; }
body.moving .sheet-toggle { display: none; }

/* ----------------------------------------------------------- планшет и телефон */
@media (max-width: 1180px) {
  .panel.right { width: 290px; }
  .map-tools { right: 318px; }
  .panel.left { width: 340px; }
}
@media (max-width: 900px) {
  :root { --head: 52px; }
  body { overflow: hidden; }
  .topbar { padding: 0 10px; border-radius: 0 0 16px 16px; }
  .brand-text b { font-size: 15px; }
  .brand-text small { display: none; }
  .nav-btn { padding: 0 11px; height: 36px; }
  .nav-btn span { display: none; }
  .panel.right {
    top: calc(var(--head) + 8px); left: 8px; right: 8px; width: auto; padding: 10px 12px; max-height: 40vh;
  }
  .panel.right .big { flex-direction: row; flex-wrap: wrap; gap: 6px 14px; padding: 6px 0 8px; }
  .panel.right .big-row { grid-template-columns: auto auto; gap: 6px; }
  .panel.right .big-row b { font-size: 22px; }
  .panel.right .big-row span { font-size: 11px; }
  .panel.right .big-row span br { display: none; }
  .sum-sub, .sum-foot { display: none; }
  .sum-head h2 { font-size: 15px; }
  .sum-head { padding-bottom: 6px; }
  .deadline-sum { padding: 6px 0 0; border: 0; }
  .dl-legend { display: none; }
  .panel.left {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 62vh; border-radius: 18px 18px 0 0;
    transform: translateY(calc(100% - 0px)); transition: transform .25s;
  }
  body.sheet-open .panel.left { transform: none; }
  body.sheet-open .panel.right { display: none; }
  .sheet-toggle {
    display: block; position: absolute; z-index: 700; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
    height: 44px; padding: 0 20px; border: 0; border-radius: 22px; background: var(--brand); color: #1b2026; font-weight: 700; box-shadow: var(--shadow);
  }
  body.sheet-open .sheet-toggle { bottom: calc(62vh + 10px); }
  body.sheet-open .map-tools, body.sheet-open .legend, body.sheet-open .leaflet-control-attribution { display: none; }
  /* отступы снизу с учётом полосы iPhone (safe area) */
  .map-tools { right: 8px; top: auto; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .round { width: 40px; height: 40px; }
  .legend { left: 8px; right: auto; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); align-items: flex-start; }
  .legend-body { width: min(290px, calc(100vw - 16px)); }
  body.card-open .panel.right { max-height: 62vh; }
  body.moving .panel.right, body.moving .legend { display: none; }
  body.moving .map-tools { bottom: calc(170px + env(safe-area-inset-bottom, 0px)); }
  .service-pill { display: none; }
  /* служебный режим на телефоне — золотая точка у названия вместо плашки */
  body.service .brand-text b::after { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-left: 6px; vertical-align: middle; }
  .move-bar { flex-wrap: wrap; bottom: 12px; }
  .move-bar b { max-width: 70vw; }
}

/* документы, светофор, фото на весь экран */
.files { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.files a { display: grid; grid-template-columns: 38px 1fr; gap: 2px 10px; align-items: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; color: var(--text); text-decoration: none; }
.files a:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.fext { grid-row: span 2; font: 700 10px/1 var(--ui); text-transform: uppercase; color: #fff; background: var(--brand-2); border-radius: 7px; padding: 10px 0; text-align: center; }
.fname { font-size: 13px; font-weight: 700; overflow-wrap: anywhere; }
.files small { grid-column: 2; color: var(--muted); font-size: 11.5px; }
.health-card { display: flex; align-items: center; gap: 10px; border: 2px solid; border-radius: 12px; padding: 8px 10px; margin: 8px 0; }
.health-card i { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.health-card b { display: block; font-size: 13.5px; }
.health-card small { color: var(--muted); font-size: 12px; }
.gallery img { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 3000; background: rgba(20, 16, 10, .92); display: none; align-items: center; justify-content: center; }
.lightbox.show { display: flex; }
.lightbox img { max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,.5); cursor: default; }
.lb-close, .lb-nav { position: absolute; border: 0; background: rgba(255,255,255,.14); color: #fff; width: 46px; height: 46px; border-radius: 50%; font-size: 28px; line-height: 1; display: grid; place-items: center; }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 14px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 14px; top: 50%; transform: translateY(-50%); }
.lb-count { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font-size: 13px; background: rgba(0,0,0,.4); padding: 3px 10px; border-radius: 10px; }
body.lb-open { overflow: hidden; }
@media (max-width: 900px) { .lb-close { top: calc(10px + env(safe-area-inset-top, 0px)); } .lb-count { bottom: calc(14px + env(safe-area-inset-bottom, 0px)); } }
