:root{--bg:#0f172a;--panel:#1e293b;--text:#e2e8f0;--muted:#94a3b8;--accent:#22c55e;--accent2:#3b82f6;--warn:#f59e0b;--bad:#ef4444}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--text);font:16px/1.35 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-tap-highlight-color:transparent}
header{display:flex;justify-content:space-between;align-items:center;padding:calc(env(safe-area-inset-top) + 10px) 14px 8px;background:var(--panel)}
.title{font-weight:700;font-size:18px}.sub{color:var(--muted);font-size:13px}
.right{display:flex;gap:8px;align-items:center}
.badge{background:#334155;border-radius:999px;padding:2px 10px;font-size:12px;text-transform:uppercase}
main{padding:10px 12px calc(env(safe-area-inset-bottom) + 12px);display:flex;flex-direction:column;gap:10px;max-width:640px;margin:0 auto}
.row{display:flex;gap:8px;align-items:end}.grow{flex:1}
label{display:flex;flex-direction:column;gap:4px;font-size:13px;color:var(--muted)}
input,select,textarea{font:inherit;color:var(--text);background:#0b1220;border:1px solid #334155;border-radius:8px;padding:10px}
button{font:inherit;border:0;border-radius:10px;padding:12px 14px;background:var(--accent2);color:#fff;font-weight:600}
button.secondary{background:#334155}button.mini{padding:6px 10px;font-size:13px;background:#334155}
button:disabled{opacity:.5}
.big{font-size:26px;padding:26px;background:var(--accent);color:#052e16;border-radius:16px;width:100%}
.big.busy{background:var(--warn);color:#1c1917}
.progress{min-height:1.4em;font-size:14px;color:var(--muted);text-align:center}
.seg{display:flex;border:1px solid #334155;border-radius:10px;overflow:hidden}
.seg button{background:transparent;color:var(--muted);border-radius:0;padding:10px 14px}.seg button.on{background:var(--accent2);color:#fff}
.result{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;background:var(--panel);padding:10px;border-radius:12px}
.result div{display:flex;flex-direction:column;align-items:center}.result b{font-size:22px}.result span{font-size:11px;color:var(--muted)}
.hidden{display:none!important}
.counts{display:flex;justify-content:space-around;font-size:13px;color:var(--muted)}.counts b{color:var(--text)}
#map{height:46vh;min-height:260px;border-radius:12px;background:#000}
.legend{display:flex;flex-wrap:wrap;gap:8px;font-size:12px;color:var(--muted)}
.legend i{display:inline-block;width:10px;height:10px;border-radius:50%;margin-right:4px}
.toast{position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:#111827;border:1px solid #374151;padding:10px 16px;border-radius:10px;z-index:2000;max-width:90vw}
.toast.bad{border-color:var(--bad)}
dialog{background:var(--panel);color:var(--text);border:0;border-radius:14px;padding:16px;width:min(94vw,520px)}
dialog::backdrop{background:rgba(0,0,0,.6)}
dialog form{display:flex;flex-direction:column;gap:10px}dialog h2{margin:0 0 4px;font-size:18px}
dialog menu{display:flex;gap:8px;justify-content:flex-end;margin:0;padding:0}
.check{flex-direction:row;align-items:center;gap:8px}
.pickmap{height:240px;border-radius:10px}
.swatches{display:flex;gap:8px;flex-wrap:wrap}.swatches span{width:30px;height:30px;border-radius:50%;border:3px solid transparent}.swatches span.on{border-color:#fff}
#photoPreview{max-height:200px;object-fit:contain;border-radius:8px;background:#000}
.dot{border-radius:50%;border:2px solid rgba(255,255,255,.7)}
.ap-icon{background:#f59e0b;color:#000;font-weight:700;border-radius:6px;padding:2px 5px;font-size:12px;white-space:nowrap;border:2px solid #fff;box-shadow:0 1px 4px #000}
.ap-icon.off{background:#64748b;color:#fff}
.note-icon,.photo-icon{font-size:18px;text-shadow:0 1px 3px #000}
.leaflet-popup-content{color:#111}
