/*
 * Election Overwatch — opt-in controls on the existing MapLibre globe.
 * All styling scoped under .eo- / #mapView: no global shell or event feed changes.
 */
#mapView .eo-launch,
#mapView .eo-panel,
#mapView .eo-panel *{box-sizing:border-box}
#mapView .eo-launch{
 position:absolute;left:calc(12px + env(safe-area-inset-left));top:calc(10px + var(--ow-tb, 32px));
 z-index:95;max-width:calc(100vw - 40px);min-height:40px;padding:9px 16px;
 border:1px solid rgba(114,202,255,.7);border-radius:12px;
 background:linear-gradient(135deg,rgba(16,49,78,.94),rgba(5,13,29,.97));
 color:#e0f2ff;font:700 12px/1.25 ui-sans-serif,system-ui,sans-serif;letter-spacing:.15em;
 box-shadow:0 6px 26px rgba(0,0,0,.42),inset 0 0 12px rgba(59,130,246,.12);
 cursor:pointer;touch-action:manipulation
}
#mapView .eo-launch::before{content:"◉";color:#ffbb63;margin-right:9px;font-size:15px}
#mapView .eo-launch:hover{background:#173d5b;border-color:#93d8ff}
#mapView .eo-launch:focus-visible,#mapView .eo-panel :focus-visible{outline:2px solid #93d8ff;outline-offset:2px}
#mapView .eo-panel{
 position:absolute;z-index:96;top:calc(8px + var(--ow-tb,32px));left:calc(10px + env(safe-area-inset-left));
 bottom:calc(80px + env(safe-area-inset-bottom));width:min(384px,calc(100vw - 24px));
 display:flex;flex-direction:column;overflow:hidden;border:1px solid rgba(123,174,210,.55);
 border-radius:14px;background:rgba(5,15,29,.96);color:#e9f4ff;
 box-shadow:0 14px 50px rgba(0,0,0,.54),inset 0 0 28px rgba(22,83,118,.10);
 font:13px/1.48 ui-sans-serif,system-ui,sans-serif;
 backdrop-filter:blur(14px);-webkit-backdrop-filter:blur(14px)
}
#mapView .eo-panel[hidden],#mapView .eo-launch[hidden]{display:none!important}
#mapView .eo-panel.is-open{animation:eo-slide-in .24s ease-out both}
@keyframes eo-slide-in{from{opacity:0;transform:translateX(-22px)}to{opacity:1;transform:translateX(0)}}
#mapView .eo-head{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px 11px;border-bottom:1px solid rgba(129,167,192,.25);background:linear-gradient(120deg,rgba(38,83,119,.4),transparent)}
#mapView .eo-head-title{display:flex;flex-direction:column;gap:2px}
#mapView .eo-name{color:#d8efff;letter-spacing:.14em;font-size:12px}
#mapView .eo-kicker{color:#91b6d0;letter-spacing:.08em;font-size:10px}
#mapView .eo-close{border:1px solid rgba(150,194,219,.42);background:#102a3f;color:#e7f5ff;border-radius:9px;width:34px;height:34px;font-size:23px;line-height:1;cursor:pointer}
#mapView .eo-status{display:flex;align-items:center;gap:8px;padding:9px 15px;color:#b9cfe0;border-bottom:1px solid rgba(130,162,184,.18);font-size:11px;min-height:39px}
#mapView .eo-dot{width:7px;height:7px;border-radius:50%;background:#657d90;flex:none}
#mapView .eo-dot[data-tone=live]{background:#46d3a3;box-shadow:0 0 9px #46d3a3}
#mapView .eo-dot[data-tone=warning]{background:#f4b45e}
#mapView .eo-dot[data-tone=error]{background:#f47d86}
#mapView .eo-filter-block{padding:11px 14px 4px;border-bottom:1px solid rgba(130,162,184,.18)}
#mapView .eo-choice-row{display:flex;gap:5px;margin-bottom:10px}
#mapView .eo-choice{flex:1;border:1px solid rgba(123,168,193,.32);border-radius:8px;background:#0e2638;color:#c6d7e5;padding:7px 4px;font-size:11px;cursor:pointer;white-space:nowrap}
#mapView .eo-choice.is-on{border-color:#7bbde8;background:#214a68;color:white}
#mapView .eo-select-row label{display:flex;justify-content:space-between;align-items:center;color:#a9c1d2;font-size:11px;margin-bottom:7px}
#mapView .eo-select,#mapView .eo-poll-filter{font:inherit;color:#e0edf6;background:#112d43;border:1px solid #35556b;border-radius:7px;padding:6px 8px;max-width:190px}
#mapView .eo-metrics{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px;padding:9px 14px}
#mapView .eo-field{display:flex;flex-direction:column;gap:1px;margin:0}
#mapView .eo-field-key{font-size:10px;color:#89aabf}
#mapView .eo-field-value{font-size:14px;color:#eaf6ff;overflow-wrap:anywhere}
#mapView .eo-state-picker{padding:2px 14px 11px;color:#89aabf;font-size:11px;display:flex;justify-content:space-between;align-items:center}
#mapView .eo-state-picker select{max-width:65%}
#mapView .eo-body{overflow-y:auto;overscroll-behavior:contain;flex:1;min-height:80px;padding:0 12px 14px}
#mapView .eo-card,#mapView .eo-race{background:#102537;border:1px solid rgba(96,146,178,.24);border-radius:11px;padding:11px;margin:8px 0}
#mapView .eo-race{background:#091b2b;border-color:rgba(125,180,212,.4);padding:12px}
#mapView .eo-card h3,#mapView .eo-state-head h3,#mapView .eo-race h4{font-size:14px;color:#f0f8ff;line-height:1.3;margin:0 0 7px}
#mapView .eo-card h4{font-size:12px;line-height:1.3;color:#d5efff;margin:0 0 9px}
#mapView .eo-card p,#mapView .eo-state-head p{margin:5px 0 10px;color:#aec5d4}
#mapView .eo-legend{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:12px}
#mapView .eo-legend-item{display:flex;align-items:center;gap:6px;color:#b7ccdd;font-size:11px}
#mapView .eo-swatch{width:10px;height:10px;border-radius:3px;display:inline-block}
#mapView .eo-state-links{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}
#mapView .eo-state-link{border:1px solid #31566c;border-radius:9px;padding:8px 7px;color:#daebf5;background:#122c3e;text-align:left;font-size:11px;cursor:pointer}
#mapView .eo-state-link:hover{background:#1f4966}
#mapView .eo-state-head{padding:10px 4px 4px}
#mapView .eo-back{border:0;border-radius:7px;background:#1b4057;color:#d3eaf9;padding:6px 9px;cursor:pointer}
#mapView .eo-rating{display:inline-block;border:1px solid #6b7c85;color:#ffe1ac;border-radius:6px;padding:3px 7px;margin:0 0 8px;background:#324154}
#mapView .eo-note{font-size:10px;color:#92adbe;display:block;margin:7px 0}
#mapView .eo-source-link{color:#83d4ff;display:inline-block;margin-right:10px;margin-top:7px;font-size:11px;text-decoration:underline;text-underline-offset:2px}
#mapView .eo-unavailable{font-size:11px;color:#a3bacb;font-style:italic}
#mapView .eo-vote-row{display:grid;grid-template-columns:1fr auto;column-gap:10px;padding:8px 0;border-top:1px solid rgba(113,147,171,.2)}
#mapView .eo-candidate{grid-row:span 2;color:#d4e8f4}
#mapView .eo-vote-row small{text-align:right;color:#8eacbf}
#mapView .eo-comparison{border-bottom:1px solid rgba(126,159,183,.15);padding:7px 0;display:grid;grid-template-columns:1fr auto;gap:5px;color:#bdd0de;font-size:11px}
#mapView .eo-comparison strong{font-size:11px;color:#eaf1f6}
#mapView .eo-bar-rail{grid-column:span 2;height:5px;background:#263d53;border-radius:5px;overflow:hidden}
#mapView .eo-bar{height:100%;display:block;background:#71a8ee}
#mapView .eo-bar[data-party=R]{background:#ef7d78}
#mapView .eo-poll-head{display:flex;align-items:center;justify-content:space-between;gap:8px}
#mapView .eo-poll-filter{font-size:10px;max-width:142px}
#mapView .eo-poll{display:flex;flex-direction:column;gap:3px;padding:8px 0;border-bottom:1px solid rgba(126,159,183,.18)}
#mapView .eo-poll small{color:#96b2c4}
#mapView .eo-poll-margin{font-size:12px;color:#d4eafb}
#mapView .eo-sources{border-top:1px solid rgba(126,159,183,.2);padding:10px 15px;color:#b7d0de;font-size:10px}
#mapView .eo-sources p{margin:5px 0;color:#9cbbcb}
#mapView .eo-existing-events{display:flex;flex-direction:column;gap:3px;border-top:1px solid rgba(126,159,183,.2);padding:9px 15px;background:#081725;color:#b4d2e4;font-size:10px;max-height:75px;overflow:hidden}
#mapView .eo-existing-events small{color:#84a6b8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:759px){
 #mapView .eo-launch{top:calc(7px + var(--ow-tb, 36px));left:calc(8px + env(safe-area-inset-left));min-height:44px;font-size:11px}
 #mapView .eo-panel{top:calc(5px + var(--ow-tb,36px));left:calc(5px + env(safe-area-inset-left));bottom:calc(75px + env(safe-area-inset-bottom));width:calc(100vw - 12px - env(safe-area-inset-left) - env(safe-area-inset-right));max-height:72vh}
 #mapView .eo-choice{min-height:40px}
 #mapView .eo-close{min-height:44px;min-width:44px}
}
@media(prefers-reduced-motion:reduce){#mapView .eo-panel.is-open{animation:none}}
