:root {
  --bg:#0b111c; --panel:rgba(13,19,31,.94); --line:#24324a; --fg:#e8eef8; --mut:#8c9ab0; --acc:#ffc531; --red:#ff4d5e;
  --st: env(safe-area-inset-top, 0px); --sb: env(safe-area-inset-bottom, 0px);
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html,body { margin:0; height:100%; background:var(--bg); color:var(--fg);
  font: 15px/1.35 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif; overscroll-behavior:none; }
a { color:var(--acc); }
#map { position:fixed; inset:0; background:#0b111c; }
.leaflet-container { background:#0b111c; }
.leaflet-control-attribution { background:rgba(11,17,28,.7)!important; color:var(--mut)!important; font-size:10px; }
.leaflet-control-attribution a { color:#b9c4d6!important; }

.topbar { position:fixed; z-index:1000; top:calc(8px + var(--st)); left:8px; right:8px; display:flex; gap:8px; align-items:center;
  background:var(--panel); border:1px solid var(--line); border-radius:14px; padding:6px 6px 6px 12px; box-shadow:0 6px 24px rgba(0,0,0,.45); }
.brand { font-weight:700; color:var(--acc); white-space:nowrap; }
.brand span { color:var(--fg); }
@media (max-width:520px){ .brand span { display:none; } }
.search { flex:1; min-width:0; }
.search input { width:100%; background:#162034; border:1px solid var(--line); color:var(--fg); border-radius:10px; padding:9px 10px; font-size:16px; }
.icon-btn { background:#162034; color:var(--fg); border:1px solid var(--line); border-radius:10px; width:40px; height:40px; font-size:18px; cursor:pointer; }

.sheet { position:fixed; z-index:1001; background:var(--panel); border:1px solid var(--line); border-radius:16px; box-shadow:0 8px 30px rgba(0,0,0,.55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.sheet[hidden] { display:none; }
.close { position:absolute; right:8px; top:6px; background:rgba(0,0,0,.35); border:0; color:#fff; font-size:22px; width:34px; height:34px; border-radius:50%; cursor:pointer; z-index:2; }

.menu { top:calc(62px + var(--st)); right:8px; width:min(330px, calc(100% - 16px)); padding:12px 14px; }
.menu h3 { margin:0 0 8px; font-size:13px; color:var(--mut); text-transform:uppercase; letter-spacing:.05em; }
.seg { display:flex; background:#162034; border-radius:10px; padding:3px; margin-bottom:10px; }
.seg button { flex:1; background:none; border:0; color:var(--mut); padding:7px 4px; border-radius:8px; font-weight:600; cursor:pointer; }
.seg button.on { background:var(--acc); color:#111; }
.row { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:7px 0; border-top:1px solid var(--line); }
.row select { background:#162034; color:var(--fg); border:1px solid var(--line); border-radius:8px; padding:5px; }
.row input[type=checkbox] { width:18px; height:18px; accent-color:var(--acc); order:2; }
.legend { display:flex; gap:4px; margin:10px 0 6px; flex-wrap:wrap; }
.legend span { font-size:11px; padding:2px 6px; border-radius:6px; background:color-mix(in srgb, var(--c) 22%, transparent); border:1px solid var(--c); }
.link { background:none; border:0; color:var(--acc); padding:6px 0 0; text-decoration:underline; cursor:pointer; font-size:14px; }

.info { left:8px; right:8px; bottom:calc(8px + var(--sb)); max-height:62vh; overflow:auto; padding:0 0 12px; }
@media (min-width:760px){ .info { left:auto; right:12px; top:calc(70px + var(--st)); bottom:auto; width:370px; max-height:calc(100vh - 100px); } }
.photo img { width:100%; aspect-ratio:16/9; object-fit:cover; display:block; border-radius:16px 16px 0 0; background:#111a29; }
.photo .credit { font-size:11px; color:var(--mut); padding:4px 14px 0; }
.photo .credit a { color:#cfd8e6; }
.head { display:flex; align-items:center; gap:8px; padding:10px 14px 0; }
.head h2 { margin:0; font-size:22px; color:var(--acc); }
.badge { font-size:11px; font-weight:700; padding:2px 7px; border-radius:6px; background:var(--red); color:#fff; }
.badge.mil { background:#4b6b3a; }
.sub { padding:0 14px; color:var(--mut); font-size:13px; }
.route { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:6px; margin:10px 14px 0; padding:10px; background:#162034; border-radius:12px; text-align:center; }
.route b { display:block; font-size:22px; letter-spacing:.03em; }
.route small { color:var(--mut); font-size:12px; }
.route .arrow { color:var(--acc); font-size:18px; }
.route-note { padding:4px 14px 0; font-size:11px; color:var(--mut); }
.grid { display:grid; grid-template-columns:repeat(3,1fr); gap:10px 8px; padding:12px 14px 0; }
.k { font-size:10.5px; color:var(--mut); text-transform:uppercase; letter-spacing:.05em; }
.v { font-size:15px; font-weight:600; overflow-wrap:anywhere; }
.actions { display:flex; gap:12px; align-items:center; padding:12px 14px 0; font-size:14px; }
.actions button { background:var(--acc); color:#111; border:0; border-radius:9px; padding:8px 14px; font-weight:700; cursor:pointer; }
.actions button.on { background:var(--red); color:#fff; }

.credits { inset:calc(70px + var(--st)) 8px calc(8px + var(--sb)); overflow:auto; padding:6px 18px 18px; max-width:560px; margin:0 auto; }
.credits li { margin-bottom:8px; }
.credits p, .credits li { color:#c9d3e2; font-size:14px; }

.fabs { position:fixed; z-index:999; right:10px; bottom:calc(110px + var(--sb)); display:flex; flex-direction:column; gap:8px; }
.status { position:fixed; z-index:999; left:8px; bottom:calc(22px + var(--sb)); background:var(--panel); border:1px solid var(--line);
  border-radius:10px; padding:5px 10px; font-size:12.5px; color:var(--mut); max-width:calc(100% - 70px); }
.status b { color:var(--fg); }
.banner { position:fixed; z-index:999; left:50%; transform:translateX(-50%); top:calc(64px + var(--st)); background:#2a2210; color:#ffe39a;
  border:1px solid #6b5520; border-radius:10px; padding:6px 12px; font-size:13px; max-width:calc(100% - 24px); text-align:center; }
.banner[hidden] { display:none; }
.leaflet-top.leaflet-right { top:calc(56px + var(--st)); }
.me-dot { width:14px; height:14px; border-radius:50%; background:#3fa2ff; border:3px solid #fff; box-shadow:0 0 0 6px rgba(63,162,255,.25); }
