/* Речни бариери · RiverLIFE
   Тъмен по подразбиране, монохромни икони, едри цели за пръст (≥48px),
   главното действие долу под палеца. На голям екран — същото, по-широко. */
:root{
  --bg:#0f1716; --surface:#172120; --surface-2:#1f2b29; --fg:#eef2f1; --muted:#93a19e;
  --line:#2a3533; --accent:#6cc4d6; --accent-soft:#16343b; --on-accent:#06171b;
  --ok:#6cc08b; --warn:#d9a441; --err:#e8847e;
  --tap:48px; --r:12px; color-scheme:dark;
}
:root[data-theme="light"]{
  --bg:#f6f7f6; --surface:#fff; --surface-2:#eef0ef; --fg:#15201e; --muted:#62706d;
  --line:#dde2e0; --accent:#1f7487; --accent-soft:#e1eff2; --on-accent:#fff;
  --ok:#2f7d4f; --warn:#9a6700; --err:#b4231f; color-scheme:light;
}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;padding:0}
body{background:var(--bg);color:var(--fg);font:17px/1.45 "Sofia Sans",system-ui,-apple-system,sans-serif;
  overscroll-behavior-y:contain}
svg{stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
a{color:var(--accent)}
.wrap{max-width:760px;margin:0 auto}

/* ── горна лента ───────────────────────────────────────────────────────── */
.top{position:sticky;top:0;z-index:20;background:var(--surface);border-bottom:1px solid var(--line);
  padding:max(8px,env(safe-area-inset-top)) 10px 8px}
.top .in{max-width:760px;margin:0 auto;display:flex;align-items:center;gap:8px}
.top h1{font-size:1.02rem;font-weight:600;margin:0;flex:1;min-width:0;white-space:nowrap;
  overflow:hidden;text-overflow:ellipsis}
.brand{flex:1;display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.brand img{height:30px;width:auto;display:block}
:root[data-theme="light"] .brand img{filter:invert(1) brightness(.35)}
.brand .ver{font-size:11px;color:var(--muted);margin-top:1px;letter-spacing:.02em}
.brand .app{font-size:13px;font-weight:600;margin-top:2px}
.iconbtn{width:var(--tap);height:var(--tap);border:0;background:none;display:grid;place-items:center;
  border-radius:10px;flex:0 0 auto}
.iconbtn:active{background:var(--surface-2)}
.iconbtn svg{width:23px;height:23px}

/* ── връзка ────────────────────────────────────────────────────────────── */
.net{display:flex;align-items:center;gap:7px;padding:7px 14px;font-size:13px;
  background:var(--surface-2);border-bottom:1px solid var(--line);color:var(--muted)}
.net svg{width:15px;height:15px;flex:0 0 auto}
.net .grow{flex:1}
.net.off{background:#3a2f14;color:#e5bf6b}
.net.pend{background:var(--accent-soft);color:var(--accent)}
.net.err{background:#3b1d1b;color:var(--err)}
:root[data-theme="light"] .net.off{background:#fdf3e0;color:#7a5200}
:root[data-theme="light"] .net.err{background:#fdecea}
.net button{border:0;background:none;color:inherit;text-decoration:underline;padding:0}

main{padding:12px 12px calc(100px + env(safe-area-inset-bottom))}

/* ── карти и редове ────────────────────────────────────────────────────── */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:13px 15px;margin-bottom:9px}
.card.tap{display:flex;gap:12px;align-items:center;width:100%;text-align:left}
.card.tap:active{background:var(--surface-2)}
.card h3{margin:0 0 2px;font-size:1rem;font-weight:600}
.card .meta{font-size:13px;color:var(--muted)}
.card .thumb{width:58px;height:58px;border-radius:9px;object-fit:cover;background:var(--surface-2);flex:0 0 auto;
  display:grid;place-items:center;color:var(--muted)}
.card .thumb svg{width:24px;height:24px}
.card .body{flex:1;min-width:0}
.pill{display:inline-block;font-size:11.5px;padding:2px 8px;border-radius:999px;border:1px solid var(--line);
  color:var(--muted);margin-left:4px;vertical-align:1px}
.pill.pend{border-color:var(--accent);color:var(--accent)}
.pill.err{border-color:var(--err);color:var(--err)}
.sect{font-size:12px;font-weight:600;color:var(--muted);letter-spacing:.05em;text-transform:uppercase;margin:20px 2px 8px}
.rows{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);overflow:hidden}
.row{display:flex;align-items:flex-start;gap:12px;width:100%;min-height:var(--tap);padding:11px 14px;
  border:0;border-bottom:1px solid var(--line);background:none;text-align:left}
.row:last-child{border-bottom:0}
.row .k{color:var(--muted);font-size:14px;flex:1;min-width:0}
.row .v{font-weight:600;text-align:right;max-width:60%}
.row .v.none{color:var(--muted);font-weight:400}
.empty{text-align:center;color:var(--muted);padding:28px 14px;font-size:15px}
.note{background:var(--surface);border:1px solid var(--line);border-left:3px solid var(--accent);
  border-radius:10px;padding:10px 13px;font-size:14px;margin-bottom:10px}
.note.warn{border-left-color:var(--warn)} .note.err{border-left-color:var(--err)}
.srch{width:100%;min-height:var(--tap);border:1px solid var(--line);border-radius:11px;
  background:var(--surface);padding:10px 13px;margin-bottom:10px}
.big{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:62px;border-radius:14px;
  border:0;background:var(--accent);color:var(--on-accent);font-weight:700;font-size:1.08rem;margin:4px 0 6px}
.big svg{width:24px;height:24px}
.stats{display:flex;gap:18px;font-size:13px;color:var(--muted);margin:2px 2px 4px;flex-wrap:wrap}
.stats b{color:var(--fg);font-variant-numeric:tabular-nums}

/* ── долна лента ───────────────────────────────────────────────────────── */
.bottom{position:fixed;left:0;right:0;bottom:0;z-index:25;background:var(--surface);border-top:1px solid var(--line);
  padding:9px 12px calc(9px + env(safe-area-inset-bottom))}
.bottom .in{max-width:760px;margin:0 auto;display:flex;gap:9px}
.bottom button{flex:1;min-height:52px;border-radius:12px;border:1px solid var(--line);background:var(--surface-2);
  font-weight:600;display:flex;align-items:center;justify-content:center;gap:7px}
.bottom button svg{width:20px;height:20px}
.bottom button.main{background:var(--accent);border-color:var(--accent);color:var(--on-accent);flex:1.8}
.bottom button:disabled{opacity:.45}

/* ── стъпки на въвеждането ─────────────────────────────────────────────── */
.prog{height:3px;background:var(--line)}
.prog i{display:block;height:3px;background:var(--accent);transition:width .2s}
.step h2{font-size:1.18rem;margin:6px 2px 4px;font-weight:700;line-height:1.3}
.step .hint{color:var(--muted);font-size:14px;margin:0 2px 14px}
.step .kicker{font-size:12px;color:var(--muted);letter-spacing:.05em;text-transform:uppercase;margin:4px 2px 0}
.opts{display:flex;flex-direction:column;gap:8px}
.opt{min-height:56px;border-radius:12px;border:1px solid var(--line);background:var(--surface);
  text-align:left;padding:12px 16px;font-size:1.02rem;display:flex;align-items:center;gap:12px}
.opt .dot{width:20px;height:20px;border-radius:50%;border:2px solid var(--line);flex:0 0 auto}
.opt[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.opt[aria-pressed="true"] .dot{border-color:var(--accent);background:radial-gradient(var(--accent) 45%,transparent 50%)}
.opt.unk{color:var(--muted)}
.types{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.type{min-height:64px;border-radius:12px;border:1px solid var(--line);background:var(--surface);text-align:left;
  padding:11px 13px;font-weight:600;font-size:.98rem}
.type[aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}
.typedesc{font-size:14px;color:var(--muted);margin:10px 2px 0;min-height:2.6em}
label.f{display:block;font-size:13px;color:var(--muted);margin:16px 2px 6px}
.f-in{width:100%;min-height:var(--tap);border:1px solid var(--line);border-radius:11px;background:var(--surface);
  padding:10px 13px;font-size:17px}
.f-in:focus{outline:2px solid var(--accent-soft);border-color:var(--accent)}
textarea.f-in{min-height:110px;resize:vertical}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:9px}

/* ── снимки ────────────────────────────────────────────────────────────── */
.gal{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:7px}
.gal .ph{position:relative}
.gal img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px;display:block;background:var(--surface-2)}
.gal .ph .x{position:absolute;top:4px;right:4px;width:30px;height:30px;border-radius:50%;border:0;
  background:rgba(0,0,0,.6);color:#fff;display:grid;place-items:center}
.gal .ph .x svg{width:16px;height:16px}
.gal .ph .st{position:absolute;left:4px;bottom:4px;font-size:11px;padding:1px 7px;border-radius:999px;
  background:rgba(0,0,0,.6);color:#fff}
.camrow{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-bottom:12px}
.cam{min-height:96px;border-radius:14px;border:1.5px dashed var(--line);background:var(--surface);
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;font-weight:600}
.cam svg{width:28px;height:28px}
.cam.main{border-style:solid;border-color:var(--accent);color:var(--accent)}

/* ── място ─────────────────────────────────────────────────────────────── */
.gps{display:flex;align-items:center;gap:12px}
.gps .acc{font-size:2rem;font-weight:700;font-variant-numeric:tabular-nums}
.gps .acc small{font-size:.9rem;color:var(--muted);font-weight:400}
.acc.good{color:var(--ok)} .acc.mid{color:var(--warn)} .acc.bad{color:var(--err)}
#map{height:260px;border-radius:12px;border:1px solid var(--line);margin-top:10px;background:var(--surface-2)}
.leaflet-container{font:inherit}

/* ── меню ──────────────────────────────────────────────────────────────── */
.scrim{position:fixed;inset:0;z-index:50;background:rgba(0,0,0,.5);display:flex;justify-content:flex-end}
.drawer{width:min(340px,88vw);height:100%;background:var(--surface);border-left:1px solid var(--line);
  padding:max(14px,env(safe-area-inset-top)) 12px 20px;overflow:auto}
.drawer .who{padding:6px 6px 14px;border-bottom:1px solid var(--line);margin-bottom:8px;font-size:14px}
.drawer .who b{display:block;font-size:15px}
.mi{display:flex;align-items:center;gap:12px;width:100%;min-height:var(--tap);padding:8px 8px;border:0;
  background:none;text-align:left;border-radius:10px;text-decoration:none;color:inherit}
.mi:active{background:var(--surface-2)}
.mi svg{width:21px;height:21px;color:var(--muted);flex:0 0 auto}
.mi .sw{margin-left:auto;width:42px;height:24px;border-radius:999px;background:var(--line);position:relative;flex:0 0 auto}
.mi .sw::after{content:"";position:absolute;top:3px;left:3px;width:18px;height:18px;border-radius:50%;background:var(--fg);transition:left .15s}
.mi .sw.on{background:var(--accent)} .mi .sw.on::after{left:21px;background:var(--on-accent)}
.mi small{display:block;color:var(--muted);font-size:12px}

/* ── проектна видимост (EU / LIFE) ─────────────────────────────────────── */
.funding{margin:28px 0 8px;padding:16px 4px 0;border-top:1px solid var(--line)}
.funding .logos{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.funding .eu{height:44px;width:auto;max-width:100%}
.funding p{font-size:11.5px;color:var(--muted);margin:10px 0 0;line-height:1.45}

/* ── таблица (достъп) ──────────────────────────────────────────────────── */
table.t{width:100%;border-collapse:collapse;font-size:14px}
table.t td,table.t th{border-bottom:1px solid var(--line);padding:8px 6px;text-align:left;vertical-align:top}
table.t th{color:var(--muted);font-weight:600;font-size:12px}
.btn{min-height:42px;border-radius:10px;border:1px solid var(--line);background:var(--surface-2);padding:8px 14px;font-weight:600}
.btn.main{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.btn.danger{color:var(--err)}
.toast{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(84px + env(safe-area-inset-bottom));z-index:60;
  background:var(--fg);color:var(--bg);padding:10px 16px;border-radius:10px;font-size:14px;max-width:90vw}
