.odl-map-section {
    --odl-line: var(--line, #bed4df);
    --odl-surface: var(--surface-solid, #f8fbfd);
    --odl-ink: var(--ink, #15364b);
    --odl-muted: var(--muted, #526e80);
    --odl-accent: #1a76a9;
    padding: clamp(12px, 2vw, 24px);
    border: 1px solid var(--odl-line);
    box-shadow: var(--shadow-soft);
}
.odl-map-section > .panel-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
}
.odl-map-section > .panel-heading h2 { margin: 0; }
.odl-map-section > .panel-heading p { margin: 4px 0 0; color: var(--odl-muted); }
.odl-button, .odl-map-controls select {
    min-height: 36px;
    max-width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--odl-line);
    border-radius: 8px;
    background: var(--odl-surface);
    color: var(--odl-ink);
    font: inherit;
}
.odl-button { cursor: pointer; font-weight: 650; }
.odl-map-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px 14px;
    margin: 12px 0;
}
.odl-map-controls label {
    display: grid;
    gap: 3px;
    min-width: 0;
    color: var(--odl-muted);
    font-size: .82rem;
    font-weight: 660;
}
.odl-map-controls select { width: 100%; max-width: min(100%, 240px); font-weight: 530; }
.odl-map-controls .odl-check { display: flex; align-items: center; gap: 4px; min-height: 36px; }
.odl-map-controls input { accent-color: var(--odl-accent); }
.odl-map-status { margin: 0 0 8px; color: var(--odl-muted); font-size: .83rem; }
.odl-map-stage {
    --sea: #d8ecf1;
    --land: #eff5df;
    --neighbor: #e8eff0;
    --edge: #70929a;
    --county: #9caaa0;
    --button-bg: #f4fafc;
    --button-ink: #14354a;
    position: relative;
    overflow: hidden;
    height: clamp(390px, 52vw, 680px);
    background: var(--sea);
    border: 1px solid var(--odl-line);
    border-radius: 12px;
}
.odl-map-stage[data-style=dark] {
    --sea: #0b1b29;
    --land: #1e3442;
    --neighbor: #172a38;
    --edge: #74939e;
    --county: #4a6672;
    --button-bg: #183240;
    --button-ink: #eaf5fa;
}
.odl-map-stage > svg,
.odl-map-stage > canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}
.odl-map-stage > svg { pointer-events: none; }
.odl-map-stage > canvas { touch-action: pan-y; cursor: grab; }
.odl-map-stage > canvas.has-point { cursor: pointer; }
.odl-map-stage > canvas:active { cursor: grabbing; }
.odl-map-stage svg path { vector-effect: non-scaling-stroke; fill-rule: evenodd; stroke-width: .8; }
.odl-map-stage .odl-context { fill: var(--neighbor); stroke: var(--edge); }
.odl-map-stage .odl-state { fill: var(--land); stroke: var(--edge); }
.odl-map-stage [data-odl-districts] path { fill: none; stroke: var(--county); stroke-width: .5; }
.odl-map-zoom { position: absolute; z-index: 1; top: 10px; left: 10px; display: grid; gap: 5px; }
.odl-map-zoom .odl-button {
    width: 36px;
    padding: 0;
    color: var(--button-ink);
    background: var(--button-bg);
    font-size: 1.15rem;
}
.odl-map-tooltip {
    position: absolute;
    z-index: 2;
    max-width: calc(100% - 12px);
    padding: 6px 9px;
    border-radius: 7px;
    background: var(--button-bg);
    color: var(--button-ink);
    box-shadow: 0 3px 12px #112c4248;
    font-size: .84rem;
    font-weight: 660;
    pointer-events: none;
}
.odl-map-legend {
    --p1: #197caa; --p2: #12806e; --p3: #ad6800; --p4: #b64723; --p5: #6e7c84;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 12px;
    margin-top: 9px;
    font-size: .78rem;
    color: var(--odl-muted);
}
.odl-map-content[data-style=dark] .odl-map-legend {
    --p1: #61c7f1; --p2: #66d7be; --p3: #efbf5e; --p4: #ff8966; --p5: #a2afb4;
}
.odl-map-legend span { display: inline-flex; gap: 5px; align-items: center; }
.odl-map-legend i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid #12304428; }
.odl-map-legend span:nth-of-type(1) i { background: var(--p1); }
.odl-map-legend span:nth-of-type(2) i { background: var(--p2); }
.odl-map-legend span:nth-of-type(3) i { background: var(--p3); }
.odl-map-legend span:nth-of-type(4) i { background: var(--p4); }
.odl-map-legend span:nth-of-type(5) i { background: var(--p5); }
.odl-map-sources { margin-top: 12px; font-size: .82rem; color: var(--odl-muted); }
.odl-map-sources summary { cursor: pointer; font-weight: 650; }
.odl-map-dialog {
    box-sizing: border-box;
    inset: 0;
    max-width: calc(100% - 20px);
    max-height: calc(100% - 20px);
    margin: auto;
    padding: clamp(12px, 2.5vw, 22px);
    overflow: auto;
    border: 1px solid var(--odl-line);
    border-radius: 15px;
    background: var(--odl-surface);
    color: var(--odl-ink);
    box-shadow: 0 14px 45px #0a233a50;
}
.odl-map-dialog::backdrop { background: #071622af; }
.odl-map-dialog > header { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.odl-map-dialog h2, .odl-map-dialog h3, .odl-map-dialog p { margin: 0; }
.odl-map-dialog h2 { font-size: clamp(1.05rem, 3vw, 1.45rem); }
.odl-map-dialog h3 { font-size: 1rem; }
.odl-map-large { width: min(96vw, 1450px); }
.odl-map-large .odl-map-stage { height: min(70dvh, 840px); }
.odl-map-large canvas { touch-action: none; }
.odl-map-detail { width: 570px; }
.odl-reading { margin: 12px 0; }
.odl-reading-values { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.odl-reading strong { display: block; font-size: 1.55rem; }
.odl-reading-values span { color: var(--odl-muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.odl-reading p, .odl-history p { color: var(--odl-muted); font-size: .84rem; }
.odl-history { border-top: 1px solid var(--odl-line); padding-top: 10px; }
.odl-history svg { display: block; width: 100%; margin-top: 6px; }
.odl-history svg[hidden] { display: none; }
.odl-history line { stroke: var(--odl-line); }
.odl-history text { fill: var(--odl-muted); font: 13px system-ui, sans-serif; }
.odl-history path { stroke: var(--odl-accent); stroke-width: 2; fill: none; }
.odl-history circle { fill: var(--odl-accent); }
@media (max-width: 600px) {
    .odl-map-controls { gap: 8px; }
    .odl-map-stage { height: 420px; }
    .odl-map-large .odl-map-stage { height: min(59dvh, 660px); }
}
@media (pointer: coarse) {
    .odl-map-zoom .odl-button { width: 44px; min-height: 44px; }
}
