:root{--bg:#ffffff;--fg:#1b1f24;--muted:#57606a;--line:#d0d7de;--card:#f6f8fa;--accent:#0b5cad;--accentfg:#fff;--shadow:0 2px 12px rgba(0,0,0,.18)}
[data-theme=dark]{--bg:#14171b;--fg:#e6edf3;--muted:#9aa5b1;--line:#30363d;--card:#1f242b;--accent:#58a6ff;--accentfg:#0d1117;--shadow:0 2px 12px rgba(0,0,0,.6)}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--fg);font:15px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
.topbar{position:fixed;top:0;left:0;right:0;height:60px;display:flex;align-items:center;gap:8px;padding:0 10px;padding-left:max(10px,env(safe-area-inset-left));background:var(--bg);border-bottom:1px solid var(--line);z-index:1000}
.title{flex:1;min-width:0}
h1{font-size:17px;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sub{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.btn{min-height:44px;min-width:44px;padding:0 12px;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--fg);font:inherit;font-weight:600;cursor:pointer;white-space:nowrap}
.btn.primary{background:var(--accent);color:var(--accentfg);border-color:var(--accent)}
.btn.small{min-height:44px;padding:0 14px}
.btn:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
.layout{position:fixed;top:60px;left:0;right:0;bottom:0;display:flex}
#map{flex:1;height:100%;background:#0b0e12}
.panel{width:380px;height:100%;overflow:hidden;display:flex;flex-direction:column;background:var(--bg);border-left:1px solid var(--line)}
.panel[hidden]{display:none}
.panel-body{overflow-y:auto;padding:4px 14px 24px;-webkit-overflow-scrolling:touch}
.sheet-handle{display:flex;justify-content:flex-end;padding:6px 10px;border-bottom:1px solid var(--line)}
.sheet-handle span{display:none}
section{padding:10px 0;border-bottom:1px solid var(--line)}
section:last-child{border-bottom:0}
h2{font-size:15px;margin:4px 0 8px}h3{font-size:14px;margin:12px 0 6px}
.hint{font-size:12.5px;color:var(--muted);margin:4px 0 8px}
.counts{font-weight:700;margin:4px 0}.checked{font-size:13px;margin:4px 0 8px;color:var(--muted)}
input[type=search],select{width:100%;min-height:44px;font:inherit;padding:8px 10px;border-radius:10px;border:1px solid var(--line);background:var(--card);color:var(--fg)}
.row{display:flex;gap:8px;margin-bottom:6px}
.legend{list-style:none;margin:0;padding:0}
.legend li label,.legend.special label,.legend.special>div{display:flex;align-items:center;gap:10px;min-height:44px;padding:4px 2px;cursor:pointer}
.legend input[type=checkbox]{width:22px;height:22px;flex:none;accent-color:var(--accent)}
.sw{width:22px;height:22px;border-radius:50%;flex:none;border:2px solid #000;box-shadow:0 0 0 1.5px #fff}
.sw.dash{border-style:dashed}
.legend .lbl{flex:1;font-size:14px}.legend .n{color:var(--muted);font-size:13px;font-variant-numeric:tabular-nums}
.legend.special{margin-top:6px;border-top:1px dashed var(--line);padding-top:4px}
.sitelist{list-style:none;margin:0;padding:0}
.sitelist li{background:var(--card);border:1px solid var(--line);border-radius:10px;margin:8px 0;padding:8px 10px}
.sitelist summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-weight:600}
.sources{list-style:none;padding:0;margin:0;font-size:13px}
.sources li{padding:6px 0;border-bottom:1px dotted var(--line)}
.status{display:inline-block;padding:1px 7px;border-radius:8px;font-size:12px;font-weight:700;border:1px solid var(--line)}
.status.ok{background:#1a7f37;color:#fff;border-color:#1a7f37}.status.bad{background:#cf222e;color:#fff;border-color:#cf222e}.status.other{background:#9a6700;color:#fff;border-color:#9a6700}
a{color:var(--accent);word-break:break-word}
.card dl{margin:0;display:grid;grid-template-columns:auto 1fr;gap:3px 10px;font-size:13px}
.card dt{color:var(--muted);font-weight:600}.card dd{margin:0;word-break:break-word}
.card .wt{font-weight:700;font-size:15px;display:flex;align-items:center;gap:8px;margin-bottom:4px}
.card .wt .sw{width:16px;height:16px}
.card .road{font-size:14px;margin-bottom:6px}
.card .warn{font-size:12.5px;padding:6px 8px;border-radius:8px;background:rgba(240,180,0,.18);margin-top:6px}
.visually-hidden{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:var(--bg);color:var(--fg);box-shadow:var(--shadow)}
.leaflet-popup-content{margin:12px 14px;max-height:55vh;overflow-y:auto;width:min(320px,78vw)!important}
.leaflet-container a.leaflet-popup-close-button{width:40px;height:40px;font-size:24px;line-height:36px;color:var(--fg)}
.leaflet-control-attribution{font-size:11px}
[data-theme=dark] .leaflet-control-attribution,[data-theme=dark] .leaflet-bar a,[data-theme=dark] .leaflet-control-layers{background:rgba(20,23,27,.85);color:#e6edf3}
[data-theme=dark] .leaflet-control-attribution a{color:#8cc4ff}
.leaflet-bar a{width:44px!important;height:44px!important;line-height:44px!important;font-size:22px!important}
.imagery-tag{background:rgba(0,0,0,.6);color:#fff;font-size:12px;padding:3px 8px;border-radius:6px}
@media (max-width:799px){
  .topbar{height:60px}
  h1{font-size:15px}
  #panelBtn{padding:0 10px}
  .panel{position:fixed;left:0;right:0;bottom:0;width:100%;height:auto;max-height:72vh;border-left:0;border-top:1px solid var(--line);border-radius:16px 16px 0 0;box-shadow:var(--shadow);z-index:1100;padding-bottom:env(safe-area-inset-bottom)}
  .sheet-handle{justify-content:space-between;align-items:center}
  .sheet-handle span{display:block;width:44px;height:5px;border-radius:3px;background:var(--line);margin-left:calc(50% - 22px - 60px)}
}
@media (max-width:420px){#themeBtn .t{display:none}}
@media (max-width:520px){#panelBtn .t2{display:none}}
