/* Токени з прототипу Figma (RebuildWatch, 6 екранів) */
:root {
  --bg: #f5f5f5; --card: #fff; --line: #d4d4d4; --head: #fafafa;
  --ink: #1a1a1a; --muted: #6b6b6b;
  --red: #e0001b; --red-dark: #b80016; --pink: #fde8eb;
  --orange: #f07c00; --yellow: #e3b505; --green: #2e9e5b; --grey: #9e9e9e;
  --warn-bg: #fff4e5; --river: #c9d6df; --map: #ececec;
  --r-sm: 6px; --r: 8px; --r-lg: 12px; --r-xl: 16px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font: 15px/1.45 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Шапка ---------- */
.topbar { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 24px; padding: 0 32px; background: #fff; border-bottom: 1px solid var(--line); }
.brand { flex: none; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; text-decoration: none; min-width: 236px; }
.logo { flex: none; width: 28px; height: 28px; border-radius: var(--r-sm); background: var(--red); color: #fff; display: grid; place-items: center; font-size: 16px; font-weight: 700; }
.nav { display: flex; height: 100%; flex: 1; }
.nav a { position: relative; display: flex; align-items: center; padding: 0 22px 0 0; margin-right: 42px; text-decoration: none; color: var(--muted); font-size: 15px; white-space: nowrap; }
.nav a.active { color: var(--ink); font-weight: 600; }
.nav a.active::after { content: ""; position: absolute; left: 0; right: 22px; bottom: 0; height: 4px; border-radius: 2px; background: var(--red); }

/* ---------- Кнопки ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 24px; border-radius: var(--r); border: 1.5px solid var(--red); background: var(--red); color: #fff; font-weight: 600; font-size: 16px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-outline { background: #fff; color: var(--red); font-size: 15px; }
.btn-outline:hover { background: var(--pink); border-color: var(--red); }
.btn:disabled, .btn[aria-disabled="true"] { background: #e0e0e0; border-color: #e0e0e0; color: var(--grey); cursor: not-allowed; }
.btn-sm { height: 36px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--red); font-weight: 600; cursor: pointer; text-decoration: underline; font-size: 13px; }
.linkbtn:disabled { color: var(--grey); cursor: default; }

/* ---------- Каркас сторінок ---------- */
.view { max-width: 1440px; margin: 0 auto; padding: 22px 32px 60px; outline: none; }
.crumbs { font-size: 14px; color: var(--muted); margin: 0 0 12px; white-space: pre-wrap; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
h1 { font-size: 26px; margin: 0 0 6px; line-height: 1.2; }
h2 { font-size: 20px; margin: 0; }
.subtitle { font-size: 16px; color: var(--muted); margin: 0 0 12px; }
.card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--r); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin: 26px 0 12px; flex-wrap: wrap; }

/* ---------- Статуси ---------- */
.dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); border: 2px solid #fff; flex: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 14px; border-radius: 13px; border: 1.2px solid var(--c); background: color-mix(in srgb, var(--c) 13%, #fff); color: var(--c); font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill-sm { font-size: 12px; min-width: 150px; justify-content: center; }
.lv-ok { --c: var(--green); } .lv-moderate, .lv-below { --c: var(--yellow); } .lv-review { --c: var(--orange); } .lv-high { --c: var(--red); } .lv-insufficient { --c: var(--grey); }
.pill.lv-moderate, .pill.lv-below { color: #8a6d00; }
.tc-review { color: var(--orange); } .tc-high { color: var(--red); } .tc-moderate, .tc-below { color: #a68300; } .tc-ok { color: var(--green); } .tc-insufficient { color: var(--muted); }

/* ---------- Карта (екран 01) ---------- */
.searchbar { display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 10px 0 24px; background: #fff; border: 1.5px solid var(--line); border-radius: var(--r); }
.searchbar input { flex: 1; border: 0; outline: none; font-size: 16px; background: transparent; min-width: 0; }
.searchbar input::placeholder { color: var(--muted); }
.searchbar .btn { width: 156px; height: 44px; }
.map-title { margin: 11px 0 0; font-size: 22px; }
.map-sub { margin: 4px 0 14px; font-size: 14px; color: var(--muted); }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filter { position: relative; }
.filter select { appearance: none; height: 36px; min-width: 130px; padding: 0 30px 0 18px; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; font-size: 14px; cursor: pointer; }
.filter::after { content: "▾"; position: absolute; right: 14px; top: 9px; font-size: 11px; pointer-events: none; }
.filter select.on { border-color: var(--ink); }
.map-layout { display: grid; grid-template-columns: minmax(0, 1060px) 292px; gap: 24px; align-items: start; }
.map { position: relative; isolation: isolate; z-index: 0; aspect-ratio: 1060 / 590; background: var(--map); border: 1.5px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.map .river { position: absolute; left: 43.25%; top: 0; width: 13.2%; height: 100%; pointer-events: none; }
.map .river-label { position: absolute; left: 53.4%; top: 45%; font-size: 13px; color: #8aa1b1; pointer-events: none; }
.map-dot { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--c); border: 2px solid #fff; cursor: pointer; padding: 0; transition: transform .12s; }
.map-dot:hover, .map-dot:focus-visible, .map-dot.open { transform: scale(1.55); z-index: 3; outline: none; }
.hotspot { position: absolute; z-index: 4; width: 300px; padding: 11px 16px 12px; background: #fff; border: 2px solid var(--c); border-radius: 10px; text-decoration: none; box-shadow: 0 6px 18px rgba(0,0,0,.08); }
.hotspot b { display: block; font-size: 15px; margin-bottom: 6px; }
.hotspot .muted { font-size: 13px; display: block; margin-bottom: 8px; }
.hotspot .cta { font-size: 13px; font-weight: 600; color: var(--c); }
.hotspot.lv-moderate .cta { color: #a68300; }
.map-empty { position: absolute; inset: 0; z-index: 1001; display: grid; place-items: center; text-align: center; padding: 24px; }
.map-empty .card { padding: 24px 28px; max-width: 440px; }
.map-empty .row { justify-content: center; }
.map-note { font-size: 13px; color: var(--muted); margin-top: 10px; }
.side { display: flex; flex-direction: column; gap: 20px; }
.legend { padding: 14px 16px 16px; width: 250px; }
.legend h3, .pilot h3 { margin: 0 0 14px; font-size: 14px; }
.legend ul { list-style: none; margin: 0; padding: 0; }
.legend li { display: flex; align-items: center; gap: 11px; font-size: 13px; margin: 0 0 12px; }
.legend li:last-child { margin: 0; }
.pilot { padding: 14px 16px 16px; min-height: 380px; display: flex; flex-direction: column; }
.pilot h3 { font-size: 16px; margin-bottom: 18px; }
.pilot p { margin: 0 0 26px; font-size: 14px; color: var(--muted); line-height: 1.85; }
.pilot .stats { color: var(--ink); }
.pilot .btn { margin-top: auto; }

/* ---------- Таблиці (каталог, об'єкт) ---------- */
.table-card { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 16px; min-width: 860px; }
table.data th { height: 48px; padding: 0 18px; background: var(--head); color: var(--muted); font-size: 13px; font-weight: 600; text-align: left; border-bottom: 1.5px solid var(--line); white-space: nowrap; }
table.data td { height: 56px; padding: 8px 18px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { cursor: pointer; }
table.data tbody tr:hover { background: #fafafa; }
table.data tr.hl, table.data tr.hl:hover { background: var(--pink); }
table.data tr.hl td:first-child { font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .sub { display: block; font-size: 13px; color: var(--muted); margin-top: 2px; }
.over { font-weight: 700; white-space: nowrap; }
.sort { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.sort select { border: 0; background: transparent; color: var(--muted); font-size: 14px; cursor: pointer; }

/* ---------- Картка об'єкта (екран 02) ---------- */
.obj-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; }
.obj-head .btn { width: 232px; height: 44px; flex: none; }
.head-actions { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; margin-top: 4px; }
.head-actions .btn-sm { width: 232px; height: 36px; }
table.data tr.nolink { cursor: default; }
.print-only { display: none; }
.site-foot { max-width: 1440px; margin: 0 auto; padding: 0 32px 28px; font-size: 13px; color: var(--muted); display: flex; gap: 18px; flex-wrap: wrap; }
.site-foot a { color: var(--muted); }

/* ---------- Друк / збереження звіту в PDF ---------- */
@media print {
  @page { margin: 14mm; }
  body { background: #fff; font-size: 12px; }
  .topbar, .site-foot, .head-actions, .tools, .sort, .toast, .crumbs, button.linkbtn { display: none !important; }
  .view { padding: 0; max-width: none; }
  .print-only { display: block; margin: 8px 0 0; color: #444; }
  .card, .kpi { break-inside: avoid; border-color: #bbb; }
  table.data { min-width: 0; font-size: 11px; }
  table.data td, table.data th { height: auto; padding: 6px 8px; }
  .table-card { overflow: visible; }
  tr { break-inside: avoid; }
  .pill { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  table.data tr.hl { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 22px; }
.kpi { padding: 18px 20px; min-height: 96px; }
.kpi span { display: block; font-size: 14px; color: var(--muted); }
.kpi b { display: block; font-size: 24px; margin-top: 8px; }
.tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 0 0 12px; font-size: 13px; color: var(--muted); }
.warnings { margin: 14px 0 0; padding: 12px 16px; font-size: 14px; color: #7a5200; background: var(--warn-bg); border: 1.5px solid #f3c58a; border-radius: var(--r); }
.warnings ul { margin: 0; padding-left: 18px; }

/* ---------- Картка матеріалу (екран 03) ---------- */
.mat-meta { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 10px; font-size: 14px; color: var(--muted); }
.mat-grid { display: grid; grid-template-columns: minmax(0, 860px) minmax(0, 496px); gap: 20px; margin-top: 24px; }
.chart { padding: 22px 24px; }
.chart h3 { margin: 0 0 30px; font-size: 16px; }
.bar-row { display: grid; grid-template-columns: 244px 1fr; align-items: center; margin-bottom: 36px; font-size: 14px; }
.bar-row.first { font-weight: 600; }
.bar-track { display: flex; align-items: center; gap: 12px; }
.bar { height: 36px; border-radius: var(--r-sm); background: var(--grey); min-width: 4px; }
.bar.contract { background: var(--red); }
.bar-val { font-size: 16px; white-space: nowrap; }
.bar-val.contract { color: var(--red); font-weight: 700; }
.chart-foot { border-top: 1px solid var(--line); padding-top: 12px; font-weight: 700; font-size: 15px; }
.result { padding: 22px 24px; border-radius: var(--r-lg); border: 2px solid var(--c); background: var(--pink); display: flex; flex-direction: column; }
.result.lv-ok { background: color-mix(in srgb, var(--green) 9%, #fff); }
.result.lv-insufficient { background: #f7f7f7; }
.result.lv-moderate, .result.lv-below { background: color-mix(in srgb, var(--yellow) 10%, #fff); }
.result h3 { margin: 0 0 16px; font-size: 18px; }
.result p { margin: 0 0 4px; }
.result h4 { margin: 28px 0 8px; font-size: 15px; }
.result ul { margin: 0; padding: 0; list-style: none; }
.result li { margin-bottom: 4px; }
.result li::before { content: "• "; }
.result .spacer { min-height: 24px; flex: 1; }
.sources { margin-top: 10px; }
.source { display: grid; grid-template-columns: 1fr 200px 120px; gap: 16px; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--line); }
.source:last-child { border-bottom: 0; }
.source b { display: block; font-size: 16px; font-weight: 600; }
.source .sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.source .price { font-weight: 700; font-size: 16px; }
.source a.open { color: var(--red); font-weight: 600; text-decoration: none; text-align: right; }
.source a.open:hover { text-decoration: underline; }

/* ---------- Тарифи і заявка (екрани 04–06) ---------- */
.center-head { text-align: center; margin: 4px 0 34px; }
.center-head h1 { font-size: 30px; }
.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; max-width: 1040px; margin: 0 auto 36px; }
.plan { position: relative; padding: 24px 24px 22px; display: flex; flex-direction: column; border-radius: var(--r-lg); }
.plan.selected { border: 2px solid var(--red); padding: 23.5px 23.5px 21.5px; }
.plan .tag { position: absolute; top: -12px; left: 24px; padding: 2px 10px; border-radius: 10px; background: var(--red); color: #fff; font-size: 12px; font-weight: 600; }
.plan .tag.new { background: var(--ink); }
.plan h3 { margin: 0 0 6px; font-size: 19px; }
.plan .lead { font-size: 14px; color: var(--muted); margin: 0; min-height: 40px; }
.plan .price { font-size: 26px; font-weight: 700; margin: 12px 0 2px; }
.plan .per { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.plan ul { margin: 0 0 20px; padding: 0; list-style: none; font-size: 14px; }
.plan li { padding-left: 22px; position: relative; margin-bottom: 8px; }
.plan li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 700; }
.plan .btn { margin-top: auto; height: 44px; font-size: 15px; }
.signup { display: grid; grid-template-columns: 500px 500px; gap: 40px; justify-content: center; scroll-margin-top: 90px; }
.benefits, .form-card { padding: 25px 32px 32px; border-radius: var(--r-lg); }
.form-card { border: 2px solid var(--red); }
.benefits h2, .form-card h2 { margin-bottom: 24px; }
.benefits ul { list-style: none; margin: 0; padding: 0; font-size: 16px; }
.benefits li { margin-bottom: 13px; padding-left: 26px; position: relative; }
.benefits li::before { content: "✓"; position: absolute; left: 0; }
.benefits .pilot-note { margin-top: 40px; font-size: 16px; line-height: 2; }
.benefits .price-line { margin-top: 18px; font-size: 14px; color: var(--muted); }
.field { margin-bottom: 20px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 9px; }
.field input { width: 100%; height: 48px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--r); background: #fff; font-size: 15px; outline: none; }
.field input:focus { border-color: var(--ink); }
.field input::placeholder { color: var(--muted); }
.field.invalid input { border: 2px solid var(--red); }
.field .err { display: none; margin-top: 10px; font-size: 14px; font-weight: 600; color: var(--red); }
.field.invalid .err { display: block; }
.seg { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--line); border-radius: var(--r); overflow: hidden; }
.seg button { height: 44px; border: 0; background: #fff; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.seg button.on { background: var(--ink); color: #fff; }
.consent { display: flex; align-items: center; gap: 12px; margin: 30px 0 28px; font-size: 14px; color: var(--muted); cursor: pointer; }
.consent input { width: 20px; height: 20px; margin: 0; accent-color: var(--red); flex: none; }
.form-card .btn { height: 52px; }
.form-foot { text-align: center; font-size: 13px; color: var(--muted); margin-top: 25px; }
.offline { margin: 0 0 24px; padding: 18px 20px; background: var(--warn-bg); border: 1.5px solid var(--orange); border-radius: 10px; font-size: 15px; line-height: 1.7; }
.offline-note { font-size: 14px; color: var(--muted); margin-top: 18px; line-height: 1.6; }
.thanks { max-width: 600px; margin: 110px auto 0; padding: 50px 100px 48px; text-align: center; border-radius: var(--r-xl); }
.thanks .check { width: 96px; height: 96px; margin: 0 auto 24px; border-radius: 50%; border: 2px solid var(--green); background: color-mix(in srgb, var(--green) 13%, #fff); color: var(--green); font-size: 44px; font-weight: 700; display: grid; place-items: center; }
.thanks h1 { font-size: 28px; margin-bottom: 16px; }
.thanks p { margin: 0; color: var(--muted); font-size: 16px; line-height: 1.65; }
.thanks .btn { margin-top: 64px; width: 100%; height: 52px; }

/* ---------- Перевірка кошторису ---------- */
.check-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; margin-top: 20px; }
.tabs { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.tab { height: 36px; padding: 0 18px; border-radius: 18px; border: 1.5px solid var(--line); background: #fff; font-weight: 600; font-size: 14px; cursor: pointer; }
.tab.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.panel { padding: 20px; }
.drop { display: block; border: 2px dashed var(--red); background: var(--pink); border-radius: var(--r-lg); padding: 44px 20px; text-align: center; cursor: pointer; }
.drop.over { background: #fbd3da; }
.drop small { display: block; color: var(--muted); margin-top: 6px; }
.row { display: flex; gap: 12px; align-items: center; margin-top: 16px; flex-wrap: wrap; }
.row input[type=text] { flex: 1; min-width: 200px; height: 48px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--r); }
.doc { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.status { margin: 16px 0 0; padding: 14px 16px; border-radius: var(--r); background: #fff; border: 1.5px solid var(--line); }
.status.error { border-color: var(--red); color: var(--red-dark); background: var(--pink); }
.status.busy::before { content: ""; display: inline-block; width: 14px; height: 14px; margin-right: 10px; vertical-align: -2px; border: 2px solid var(--line); border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.how { padding: 20px 22px; }
.how h3 { margin: 0; font-size: 16px; }
.how ol { margin: 10px 0 0; padding-left: 20px; line-height: 1.8; font-size: 14px; }

/* ---------- Недостатньо даних (екран 06, третій випадок) ---------- */
.nodata { max-width: 520px; padding: 20px; margin-top: 22px; }
.nodata .obj { display: flex; align-items: center; gap: 10px; font-weight: 700; margin-bottom: 14px; }
.nodata p { margin: 14px 0 22px; line-height: 1.6; }

/* ---------- Методологія ---------- */
.prose { max-width: 860px; }
.prose h2 { margin: 32px 0 10px; }
.prose p, .prose li { line-height: 1.7; }
.levels { display: grid; gap: 10px; margin: 12px 0; }
.levels div { display: flex; gap: 12px; align-items: center; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; padding: 12px 18px; border-radius: var(--r); background: var(--ink); color: #fff; font-size: 14px; max-width: 90vw; }
.empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Адаптив ---------- */
@media (max-width: 1200px) {
  .map-layout, .mat-grid, .check-grid { grid-template-columns: 1fr; }
  .side { flex-direction: row; flex-wrap: wrap; }
  .legend, .pilot { width: auto; flex: 1 1 260px; min-height: 0; }
  .signup { grid-template-columns: 1fr; max-width: 560px; margin: 0 auto; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .nav a { margin-right: 18px; padding-right: 8px; }
  .nav a.active::after { right: 8px; }
  .brand { min-width: 0; }
}
@media (max-width: 760px) {
  .head-actions { align-items: stretch; }
  .head-actions .btn-sm { width: 100%; }
  .topbar { padding: 0 16px; gap: 12px; overflow-x: auto; }
  .brand span:last-child { display: none; }
  .view { padding: 16px 16px 48px; }
  .plans, .kpis { grid-template-columns: 1fr; }
  .obj-head { flex-direction: column; }
  .obj-head .btn { width: 100%; }
  .searchbar { height: auto; padding: 8px; flex-wrap: wrap; }
  .searchbar input { height: 44px; padding-left: 8px; }
  .searchbar .btn { width: 100%; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
  .source { grid-template-columns: 1fr; gap: 6px; }
  .source a.open { text-align: left; }
  .thanks { padding: 36px 20px; margin-top: 40px; }
  .hotspot { width: 240px; }
  .benefits, .form-card { padding: 20px; }
}

/* ---------- Справжня карта (Leaflet + OpenStreetMap) ---------- */
.map.real .river, .map.real .river-label { display: none; }
.map .leaf { position: absolute; inset: 0; }
.map.real .map-empty { background: rgba(245,245,245,.55); }
.rw-popup .leaflet-popup-content-wrapper { border: 2px solid var(--c); border-radius: 10px; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.rw-popup .leaflet-popup-content { margin: 11px 16px 12px; font: 13px/1.4 Inter, system-ui, sans-serif; min-width: 230px; }
.rw-popup .leaflet-popup-tip { background: var(--c); }
.rw-popup b { display: block; font-size: 15px; margin-bottom: 6px; color: var(--ink); }
.rw-popup .muted { display: block; margin-bottom: 8px; }
.rw-popup a.cta { font-weight: 600; color: var(--c); text-decoration: none; }
.rw-popup.lv-moderate a.cta { color: #a68300; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }

#docs details { margin-top: 12px; }
#docs summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
#docs .auto-box { display: flex; gap: 16px; align-items: center; justify-content: space-between; background: #fde8eb; border-radius: 12px; padding: 14px 16px; margin: 12px 0; }
#docs .doc-dim { opacity: .6; }
@media (max-width: 640px) { #docs .auto-box { flex-direction: column; align-items: stretch; } }

/* ---------- UX-поліпшення: зрозумілі дії та доступність ---------- */
:root {
  --green-ink: #15683c; --yellow-ink: #755600; --orange-ink: #924300;
  --high-ink: #ad1025; --grey-ink: #4b5563;
}
.topbar .nav { align-items: stretch; justify-content: flex-end; min-width: 0; }
.topbar .nav a { margin-right: 20px; padding: 0 10px; }
.topbar .nav a.active::after { right: 10px; }
.site-foot { justify-content: center; align-items: center; text-align: center; gap: 12px 24px; border-top: 1px solid var(--line); padding-top: 24px; }
.site-foot a { text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #2459a4; outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.search-area { margin-bottom: 8px; }
.search-hint { font-size: 13px; color: #575757; margin: 7px 0 12px 4px; }
.searchbar:focus-within { border-color: #2459a4; box-shadow: 0 0 0 2px #2459a41a; }
.searchbar input:focus { outline: none; }
.filter-summary { display: flex; gap: 14px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin: -3px 0 14px; min-height: 30px; }
.active-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.filter-chip { padding: 5px 11px; border: 1px solid #8b95a3; border-radius: 18px; background: #fff; cursor: pointer; font-size: 13px; }
.filter-chip span { display: inline-block; margin-left: 7px; font-size: 16px; line-height: 1; }
.filter-chip:hover { background: #ebeff4; }
.clear-filters { border: none; background: transparent; text-decoration: underline; text-underline-offset: 3px; color: #a41128; font-size: 13px; cursor: pointer; }
.results-count { font-weight: 600; font-size: 13px; }
.status-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 23px; height: 23px; border-radius: 50%; color: var(--c); border: 1.7px solid currentColor; background: #fff; font: 800 15px/1 system-ui, sans-serif; }
.lv-ok { --c: var(--green-ink); }
.lv-moderate, .lv-below { --c: var(--yellow-ink); }
.lv-review { --c: var(--orange-ink); }
.lv-high { --c: var(--high-ink); }
.lv-insufficient { --c: var(--grey-ink); }
.pill { height: auto; min-height: 30px; gap: 7px; padding: 2px 11px 2px 4px; color: var(--c) !important; white-space: normal; }
.pill .status-icon { width: 22px; height: 22px; }
.legend { width: 100%; }
.legend li { align-items: flex-start; margin-bottom: 15px; }
.legend li .status-icon { margin-top: 2px; }
.legend li b { display: block; font-size: 13px; line-height: 1.4; }
.legend li small { display: block; color: #535965; font-size: 12px; line-height: 1.4; margin-top: 3px; }
.legend-hint { color: #535965; font-size: 12px; margin: 8px 0 0; }
.map-dot, .rw-map-marker { display: grid; place-items: center; color: white; background: var(--c); font: 800 13px/1 system-ui, sans-serif; text-align: center; }
.map-dot { width: 24px; height: 24px; margin: -12px 0 0 -12px; box-shadow: 0 1px 4px #0005; }
.rw-map-marker { border-radius: 50%; border: 2px solid white; box-shadow: 0 1px 5px #0005; cursor: pointer; }
.rw-map-marker span { display: block; }
.hotspot { width: 240px; padding: 12px 14px; max-width: 60%; }
.hotspot-close { position: absolute; right: 6px; top: 4px; border: none; background: transparent; cursor: pointer; font-size: 18px; }
.hotspot b { padding-right: 16px; }
.popup-status { display: flex; align-items: center; gap: 7px; color: var(--c); font-weight: 600; font-size: 12px; margin: 7px 0; }
.popup-status .status-icon { width: 20px; height: 20px; font-size: 12px; }
.hotspot .muted { overflow-wrap: anywhere; }
.hotspot .cta, .rw-popup .cta { color: #a41128 !important; font-size: 13px; display: inline-block; text-decoration: underline; text-underline-offset: 3px; }
.rw-popup .leaflet-popup-content { min-width: 185px; max-width: 215px; margin: 10px 13px 12px; }
.rw-popup .leaflet-popup-content-wrapper { box-shadow: 0 3px 12px #0003; }
.rw-popup .popup-status { margin-bottom: 8px; }
.rw-popup .muted { overflow-wrap: anywhere; }
.form-plan-eyebrow { display: inline-block; color: #a41128; background: #fce8ec; padding: 5px 12px; border-radius: 20px; font-weight: 700; font-size: 13px; margin: 0 0 14px; }
.form-description { margin: -14px 0 24px; color: #535965; font-size: 14px; }
.field-hint { margin: 6px 0 0; color: #535965; font-size: 12px; }
.search-overlay { position: fixed; inset: 0; display: grid; place-items: center; z-index: 2000; background: #1218209c; padding: 20px; }
.search-dialog { width: 100%; max-width: 450px; padding: 24px; box-shadow: 0 12px 44px #0004; }
.search-dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.search-dialog-heading h2 { font-size: 20px; }
.dialog-close { background: transparent; border: 0; font-size: 27px; cursor: pointer; width: 38px; height: 38px; }
.search-steps { list-style: none; margin: 24px 0; padding: 0; display: grid; gap: 16px; }
.search-steps li { display: flex; gap: 12px; align-items: center; color: #59616e; }
.search-steps li::before { content: '·'; display: grid; place-items: center; flex: none; width: 27px; height: 27px; border-radius: 50%; border: 1.5px solid #919ba8; background: white; font-weight: 700; }
.search-steps li.working::before { content: '↻'; color: #ad1025; border-color: #ad1025; animation: spin 1.5s linear infinite; }
.search-steps li.done { color: #15683c; }
.search-steps li.done::before { content: '✓'; color: #15683c; border-color: #15683c; }
.search-steps li.failed::before { content: '!'; color: #ad1025; border-color: #ad1025; }
.search-dialog #searchProgressText { line-height: 1.5; }
@media (max-width: 940px) {
  .topbar { height: auto; min-height: 64px; flex-wrap: wrap; gap: 8px 14px; padding: 12px 16px; }
  .topbar .nav { width: 100%; flex: 1 1 100%; flex-wrap: wrap; gap: 0 8px; justify-content: flex-start; }
  .topbar .nav a { min-height: 36px; margin: 0; padding: 0 8px; font-size: 14px; }
  .topbar .nav a.active::after { right: 8px; height: 3px; }
  .brand span:last-child { display: inline; }
}
@media (max-width: 760px) {
  .searchbar { padding: 8px; }
  .searchbar input { min-width: 100%; }
  .hotspot { max-width: 80%; width: 220px; }
  .site-foot { padding: 24px 16px; }
  .filter-summary { display: block; }
  .results-count { display: block; margin: 8px 0; }
  .signup { max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Розгорнуті відомості займають бічну колонку, не закриваючи карту. */
.object-details { width: 100%; padding: 15px 17px 18px; scroll-margin-top: 90px; }
.object-details:focus { outline: none; }
.object-details .detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.object-details .detail-head h3 { margin: 0; font-size: 17px; }
.object-details .detail-head button { border: 0; background: transparent; font-size: 24px; cursor: pointer; }
.object-details h4 { margin: 0 0 12px; font-size: 15px; overflow-wrap: anywhere; }
.object-details dl { margin: 0 0 18px; }
.object-details dt { font-size: 12px; color: #535965; margin: 11px 0 2px; }
.object-details dd { font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.object-details dd .pill { font-size: 12px; }
