:root{
  --bg:#f4f6f7;--card:#fff;--ink:#172329;--muted:#68757c;--line:#dce3e7;
  --nav:#132d38;--nav2:#1b3b49;--accent:#245f78;--soft:#f8fafb;
}
*{box-sizing:border-box}
html,body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
button,input,select{font:inherit}
a{color:#235d78}
header{background:linear-gradient(120deg,var(--nav),var(--nav2));color:#fff}
.head{max-width:1640px;margin:auto;padding:15px 20px;display:flex;justify-content:space-between;align-items:center;gap:18px}
.brand{font-size:22px;font-weight:850}.sub{font-size:11px;opacity:.75;margin-top:3px}
.headActions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.headActions a{color:#fff;text-decoration:none;font-size:11px;border:1px solid #ffffff50;border-radius:999px;padding:7px 10px}
.headActions a:hover{background:#ffffff12}
.toolbar{max-width:1640px;margin:10px auto 0;padding:0 20px;display:grid;grid-template-columns:1.45fr repeat(7,minmax(110px,.65fr)) auto;gap:8px}
.toolbar input,.toolbar select,.toolbar button{width:100%;border:1px solid var(--line);background:#fff;border-radius:8px;padding:9px 10px;color:var(--ink);min-width:0}
.toolbar button{cursor:pointer;font-weight:750;width:auto}
.shell{max-width:1640px;margin:10px auto 0;padding:0 20px 20px;display:grid;grid-template-columns:minmax(0,1fr) 390px;gap:10px;align-items:start}
.card{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.mapHead{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:10px 12px;border-bottom:1px solid var(--line)}
.mapTitle{font-size:14px;font-weight:800}.note{font-size:10px;color:var(--muted);line-height:1.45}
#map{height:690px;background:#e9eef0}
.legend{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:9px 12px;border-top:1px solid var(--line);font-size:10px;color:#4e5960}
.legendItem{display:flex;align-items:center;gap:5px}.swatch{width:11px;height:11px;border-radius:50%;display:inline-block}
.legendSpacer{margin-left:auto}.shapeSolid{width:11px;height:11px;border-radius:50%;background:#58666d}.shapeRep{width:11px;height:11px;border-radius:50%;border:2px dashed #58666d;background:transparent}
.side{min-height:755px;max-height:755px;overflow:auto;padding:14px}
.side h2{font-size:19px;margin:4px 0 4px}.eyebrow{font-size:10px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.pills{display:flex;flex-wrap:wrap;gap:5px;margin:9px 0}.pill{display:inline-block;border-radius:999px;padding:4px 7px;font-size:10px;font-weight:750;background:#edf1f3;color:#4a5961}
.pillA{background:#fde6e6;color:#a33232}.pillB{background:#fff0d9;color:#885910}.pillC{background:#e6eef8;color:#3d638b}
.pillConfirmed{background:#dfeef5;color:#245b73}.pillReported{background:#fff0d9;color:#8b5d19}.pillInferred{background:#eceeef;color:#5a6469}
.metricRow{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:10px 0}.metric{border:1px solid var(--line);background:var(--soft);border-radius:8px;padding:8px}.metric b{display:block;font-size:17px}.metric span{font-size:9px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.kv{display:grid;grid-template-columns:118px 1fr;gap:7px;padding:7px 0;border-bottom:1px solid #edf0f2;font-size:11px}.kv b{color:#4b5961}
.section{margin-top:14px}.section h3{font-size:12px;margin:0 0 6px}.box{border:1px solid var(--line);border-radius:8px;padding:8px;margin-top:6px;background:#fafcfd;font-size:10px;line-height:1.5}
.box b{font-size:11px}.eventCard{border-left:3px solid #6f5b83}.milestone{border-left-color:#a7782a}.relCard{border-left:3px solid #567d8c}
.sourceLinks a{display:inline-block;margin:2px 8px 2px 0}
.empty{padding:18px 6px;color:var(--muted);font-size:12px;line-height:1.55}
.unmapped{margin-top:10px}.unmappedHead{display:flex;justify-content:space-between;gap:10px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line)}.unmappedList{display:flex;gap:6px;flex-wrap:wrap;padding:10px 12px}.unmappedList button{border:1px solid var(--line);background:#fff;border-radius:999px;padding:6px 8px;font-size:10px;cursor:pointer}.unmappedList button:hover{border-color:#97b2be}
.marker-label{background:#fff;border:1px solid #cbd5da;border-radius:4px;padding:2px 5px;font-size:9px;box-shadow:0 1px 3px #0002;color:#26363e}
.leaflet-tooltip.marker-label:before{display:none}
.statusBar{max-width:1640px;margin:9px auto 0;padding:0 20px;display:grid;grid-template-columns:repeat(6,1fr);gap:8px}
.status{background:#fff;border:1px solid var(--line);border-radius:9px;padding:8px 10px}.status b{display:block;font-size:18px}.status span{font-size:9px;text-transform:uppercase;letter-spacing:.05em;color:var(--muted)}
.error{max-width:900px;margin:30px auto;padding:20px;background:#fff;border:1px solid #e4bcbc;border-radius:12px;color:#8b3737}
@media(max-width:1100px){
  .toolbar{grid-template-columns:1.2fr 1fr 1fr 1fr}.toolbar input{grid-column:1/-1}.shell{grid-template-columns:1fr}.side{min-height:0;max-height:none}.statusBar{grid-template-columns:repeat(3,1fr)}#map{height:590px}
}
@media(max-width:650px){
  .head{align-items:flex-start;flex-direction:column}.toolbar{grid-template-columns:1fr 1fr;padding:0 9px}.toolbar input{grid-column:1/-1}.shell{padding:0 9px 14px}.statusBar{padding:0 9px;grid-template-columns:1fr 1fr}.status:last-child{grid-column:1/-1}.mapHead{align-items:flex-start;flex-direction:column}#map{height:500px}.legendSpacer{margin-left:0}.metricRow{grid-template-columns:1fr 1fr 1fr}
}
