:root {
  --bg: #07131f;
  --surface: #0b1d2b;
  --surface-2: #0f2636;
  --surface-3: #133044;
  --border: rgba(157, 201, 220, 0.14);
  --text: #f3f8fb;
  --muted: #91a9b8;
  --subtle: #607b8d;
  --cyan: #45d0d9;
  --blue: #5ba8ff;
  --green: #46d49a;
  --yellow: #f4c86b;
  --orange: #ff966b;
  --red: #ff6577;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -10%, rgba(42, 118, 148, .24), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(30, 104, 126, .18), transparent 25%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, a { font: inherit; }
a { color: inherit; }
button { cursor: pointer; white-space: nowrap; }

.app-shell { width: min(1500px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 48px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 88px; border-bottom: 1px solid var(--border); margin-bottom: 28px;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 13px; background: linear-gradient(145deg, rgba(69,208,217,.22), rgba(91,168,255,.14)); border: 1px solid rgba(93,210,221,.28); box-shadow: inset 0 1px rgba(255,255,255,.08); }
.brand-mark svg { width: 30px; fill: none; stroke: var(--cyan); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand h1 { font-size: 17px; line-height: 1.15; letter-spacing: -.01em; margin: 0; font-weight: 680; }
.brand p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.live-indicator, .updated { font-size: 12px; color: var(--muted); }
.live-indicator { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 999px; }
.live-indicator span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 5px rgba(70,212,154,.1); }
.button { border: 0; border-radius: 10px; padding: 9px 13px; font-size: 12px; font-weight: 650; white-space: nowrap; transition: transform .18s ease, border-color .18s ease, background .18s ease; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: #03151b; background: var(--cyan); box-shadow: 0 8px 20px rgba(69,208,217,.14); }
.button.secondary { color: var(--text); background: rgba(255,255,255,.025); border: 1px solid rgba(157,201,220,.22); }
.button.secondary:hover { background: rgba(255,255,255,.065); border-color: rgba(157,201,220,.34); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }

.top-disclaimer {
  display: flex; align-items: center; gap: 8px; margin: -10px 0 18px; padding: 11px 14px;
  border: 1px solid rgba(244,200,107,.22); border-radius: 12px; background: rgba(244,200,107,.055);
  color: #cbd9df; font-size: .88rem; line-height: 1.5;
}
.top-disclaimer strong { color: var(--yellow); white-space: nowrap; }
.top-disclaimer-copy { flex: 1 1 auto; min-width: 0; }
.call-link { color: var(--cyan); font-weight: 760; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

.status-hero {
  position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 36px;
  min-height: 260px; padding: 38px 42px; border: 1px solid rgba(93,210,221,.18); border-radius: 24px;
  background: linear-gradient(115deg, rgba(15,50,68,.96), rgba(8,29,43,.94)); box-shadow: var(--shadow);
}
.status-hero::after { content: ""; position: absolute; width: 520px; height: 520px; right: -180px; top: -280px; border-radius: 50%; border: 1px solid rgba(78,203,214,.1); box-shadow: 0 0 0 55px rgba(78,203,214,.035), 0 0 0 110px rgba(78,203,214,.025); pointer-events: none; }
.status-copy { position: relative; z-index: 1; max-width: 900px; }
.eyeline { color: var(--cyan); font-size: 11px; font-weight: 750; letter-spacing: .16em; margin-bottom: 15px; }
.status-copy h2 { max-width: 820px; font-size: clamp(30px, 4vw, 52px); line-height: 1.05; letter-spacing: -.045em; margin: 0; font-weight: 680; }
.status-copy > p { max-width: 720px; color: #b7cad4; font-size: 15px; margin: 18px 0 0; }
.status-meta { display: flex; align-items: center; gap: 14px; margin-top: 24px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.risk-badge { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 7px 11px; font-weight: 750; color: #07131f; }
.risk-badge.neutral { color: var(--muted); background: rgba(255,255,255,.06); }
.risk-badge.low { background: var(--green); }
.risk-badge.guarded { background: var(--yellow); }
.risk-badge.elevated { background: var(--orange); }
.risk-badge.high, .risk-badge.critical { background: var(--red); color: white; }
.risk-dial-wrap { position: relative; z-index: 1; width: 170px; display: grid; justify-items: center; text-align: center; }
.risk-dial { --risk-color: var(--green); width: 132px; height: 132px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(from -90deg, var(--risk-color) 0 var(--risk-angle), transparent var(--risk-angle)), conic-gradient(from -90deg, rgba(70,212,154,.22) 0 25%, rgba(244,200,107,.22) 25% 50%, rgba(255,150,107,.22) 50% 75%, rgba(255,101,119,.22) 75% 100%); position: relative; box-shadow: 0 0 40px rgba(69,208,217,.09); }
.risk-dial::before { content: ""; position: absolute; inset: 8px; background: #0a2130; border-radius: 50%; border: 1px solid rgba(255,255,255,.05); }
.risk-dial-inner { position: relative; display: grid; line-height: 1; }
.risk-dial-inner strong { font-size: 34px; letter-spacing: -.04em; }
.risk-dial-inner span { color: var(--muted); font-size: 10px; margin-top: 7px; }
.risk-dial-wrap p { color: var(--subtle); font-size: 10px; line-height: 1.4; margin: 12px 0 0; }

.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 14px; margin-top: 16px; }
.metric-card, .panel { background: linear-gradient(145deg, rgba(14,36,52,.96), rgba(9,27,41,.96)); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 14px 35px rgba(0,0,0,.14); }
.metric-card { min-height: 140px; padding: 20px; }
.metric-label { color: var(--muted); font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .08em; }
.metric-main { display: flex; align-items: baseline; gap: 10px; margin-top: 12px; }
.metric-main strong { font-size: 30px; line-height: 1; letter-spacing: -.04em; }
.metric-main span { color: #b5c9d5; font-size: 12px; }
.metric-detail { color: var(--subtle); font-size: 11px; margin-top: 12px; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(360px, .85fr); gap: 16px; margin-top: 16px; }
.panel { padding: 22px; min-width: 0; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.panel-heading h3 { font-size: 15px; line-height: 1.25; letter-spacing: -.015em; margin: 0; }
.panel-heading p { color: var(--muted); font-size: 11px; margin: 5px 0 0; }
.panel-heading > span { color: var(--muted); font-size: 11px; }
.text-link, .text-button { font-size: 11px; text-decoration: none; white-space: nowrap; }
.text-link { color: var(--cyan); }
.text-button { color: var(--muted); border: 0; background: transparent; padding: 0; font-weight: 700; }
.text-button:hover { color: var(--text); }
.panel-count { display: grid; place-items: center; min-width: 28px; height: 28px; border-radius: 8px; background: rgba(255,255,255,.05); border: 1px solid var(--border); color: var(--text)!important; font-weight: 750; }

.map-wrap { position: relative; }
.gulf-map { width: 100%; display: block; border-radius: 16px; border: 1px solid rgba(143,194,215,.12); }
.coast { fill: #183a43; opacity: .92; }
.coast-line { fill: none; stroke: #2c6570; stroke-width: 2; }
.map-water-label { fill: rgba(168,209,225,.14); font-size: 18px; font-weight: 750; letter-spacing: .22em; text-anchor: middle; }
.galveston-marker circle:last-of-type { fill: var(--cyan); stroke: white; stroke-width: 2; }
.galveston-marker text { fill: #dffcff; font-size: 12px; font-weight: 700; }
.location-pulse { fill: rgba(69,208,217,.14); animation: pulse 2.4s infinite; }
.storm-marker .storm-ring { fill: rgba(255,101,119,.12); stroke: rgba(255,101,119,.8); stroke-width: 1.3; }
.storm-marker .storm-core { fill: var(--red); }
.storm-marker text { fill: #ffdce1; font-size: 11px; font-weight: 700; }
.storm-marker .storm-subtext { fill: var(--muted); font-size: 9px; font-weight: 500; }
.connection-line { stroke: rgba(255,101,119,.42); stroke-width: 1.5; stroke-dasharray: 5 6; }
.connection-distance { fill: #f3f8fb; stroke: #07131f; stroke-width: 4px; paint-order: stroke fill; font-size: 11px; font-weight: 800; text-anchor: middle; }
.map-legend { display: flex; gap: 16px; margin-top: 12px; color: var(--muted); font-size: 10px; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; }
.legend-dot.location { background: var(--cyan); }
.legend-dot.storm { background: var(--red); }
@keyframes pulse { 50% { r: 20; opacity: .2; } }

.alerts-list, .systems-list { display: grid; gap: 10px; max-height: 420px; overflow: auto; padding-right: 3px; }
.alert-item { padding: 14px; border-radius: 13px; background: rgba(255,255,255,.025); border: 1px solid var(--border); }
.alert-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.alert-title { font-size: 12px; font-weight: 730; }
.alert-severity { padding: 4px 7px; border-radius: 999px; background: rgba(244,200,107,.13); color: var(--yellow); font-size: 9px; font-weight: 750; text-transform: uppercase; }
.alert-item p { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 8px 0 0; }
.alert-time { color: var(--subtle)!important; }
.no-alerts, .empty-state { display: grid; place-items: center; min-height: 145px; text-align: center; color: var(--muted); font-size: 11px; border: 1px dashed var(--border); border-radius: 14px; padding: 18px; }

.forecast-panel { margin-top: 16px; }
.forecast-strip { display: grid; grid-template-columns: repeat(7, minmax(130px, 1fr)); gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.forecast-card { min-height: 190px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: rgba(255,255,255,.022); }
.forecast-card .day { color: #d8e8ef; font-size: 11px; font-weight: 720; }
.forecast-illustration { width: 68px; height: 68px; display: grid; place-items: center; margin: 12px 0 10px; border: 1px solid rgba(143,216,199,.13); border-radius: 16px; background: radial-gradient(circle at 30% 22%, rgba(143,216,199,.12), rgba(255,255,255,.025) 58%, transparent 72%); }
.forecast-illustration-svg { width: 62px; height: 56px; overflow: visible; }
.wx-sun circle { fill: #f5b84f; stroke: #ffd37b; stroke-width: 2; }
.wx-sun path { fill: none; stroke: #f5b84f; stroke-width: 2.6; stroke-linecap: round; }
.wx-moon path { fill: #d6e7ee; stroke: #eff8fb; stroke-width: 1.8; }
.wx-moon circle { fill: #8fd8c7; }
.wx-cloud path { fill: #b9d0d9; stroke: #e2f0f4; stroke-width: 2; stroke-linejoin: round; }
.wx-rain path { fill: none; stroke: #61c9e7; stroke-width: 3.4; stroke-linecap: round; }
.wx-snow path { fill: none; stroke: #d7f4ff; stroke-width: 2.4; stroke-linecap: round; }
.wx-lightning { fill: #f4c86b; stroke: #ffe3a1; stroke-width: 1.2; stroke-linejoin: round; }
.wx-fog path { fill: none; stroke: #afc7d1; stroke-width: 4; stroke-linecap: round; }
.forecast-card .temp { display: flex; align-items: baseline; gap: 8px; }
.forecast-card .temp strong { font-size: 25px; }
.forecast-card .rain { color: var(--blue); font-size: 10px; }
.forecast-card .summary { color: var(--muted); font-size: 10px; line-height: 1.35; margin-top: 8px; }
.forecast-card .wind { color: var(--subtle); font-size: 9px; margin-top: 7px; }

.lower-grid { grid-template-columns: 1.15fr .85fr; }
.system-item { display: grid; grid-template-columns: auto 1fr auto; gap: 13px; align-items: center; padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.022); }
.system-icon { min-width: 74px; min-height: 38px; padding: 7px 9px; border-radius: 12px; display: grid; place-items: center; text-align: center; background: rgba(91,168,255,.1); color: var(--blue); font-size: 10px; line-height: 1.2; font-weight: 800; border: 1px solid rgba(91,168,255,.18); }
.system-name { font-size: 12px; font-weight: 730; }
.system-meta { color: var(--muted); font-size: 9px; margin-top: 3px; }
.system-distance { text-align: right; }
.system-distance strong { display: block; font-size: 14px; }
.system-distance span { color: var(--subtle); font-size: 9px; }
.system-links { grid-column: 2 / 4; display: flex; gap: 11px; flex-wrap: wrap; }
.system-links a { color: var(--cyan); font-size: 9px; text-decoration: none; }

.timeline { display: grid; gap: 0; max-height: 380px; overflow: auto; }
.timeline-item { position: relative; display: grid; grid-template-columns: 16px 1fr; gap: 11px; padding-bottom: 15px; }
.timeline-item::before { content: ""; position: absolute; left: 5px; top: 13px; bottom: 0; width: 1px; background: var(--border); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 11px; height: 11px; border-radius: 50%; margin-top: 2px; background: var(--cyan); border: 3px solid #0b1d2b; box-shadow: 0 0 0 1px rgba(69,208,217,.45); z-index: 1; }
.timeline-content strong { display: block; font-size: 10px; }
.timeline-content p { color: var(--muted); font-size: 9px; margin: 3px 0 0; }
.timeline-content time { color: var(--subtle); font-size: 8px; }

.sources-panel { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-top: 16px; }
.source-copy h3 { font-size: 13px; margin: 0; }
.source-copy p { max-width: 900px; color: var(--muted); font-size: 10px; margin: 6px 0 0; }
.source-status { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; color: var(--muted); font-size: 10px; white-space: nowrap; }
.source-status span { display: inline-flex; align-items: center; gap: 7px; }
.source-status i { width: 7px; height: 7px; border-radius: 50%; background: var(--subtle); }
.source-status i.good { background: var(--green); }
.source-status i.bad { background: var(--red); }

.skeleton { position: relative; overflow: hidden; border-radius: 12px; background: rgba(255,255,255,.035); }
.skeleton::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255,255,255,.045), transparent); animation: shimmer 1.5s infinite; }
.skeleton.tall { height: 90px; }
.skeleton.forecast { height: 190px; }
@keyframes shimmer { 100% { transform: translateX(100%); } }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 30; display: grid; gap: 8px; }
.toast { width: min(360px, calc(100vw - 36px)); padding: 13px 15px; border-radius: 12px; background: #112b3b; border: 1px solid var(--border); color: var(--text); font-size: 11px; box-shadow: var(--shadow); animation: toastIn .25s ease; }
.toast.error { border-color: rgba(255,101,119,.4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid, .lower-grid { grid-template-columns: 1fr; }
  .forecast-strip { grid-template-columns: repeat(7, 145px); }
}
@media (max-width: 760px) {
  .app-shell { width: min(100% - 24px, 1500px); }
  .topbar { align-items: flex-start; padding: 18px 0; }
  .topbar, .sources-panel { flex-direction: column; }
  .topbar-actions { justify-content: flex-start; }
  .status-hero { grid-template-columns: 1fr; padding: 28px 24px; }
  .risk-dial-wrap { width: auto; grid-template-columns: auto 1fr; justify-items: start; text-align: left; gap: 16px; align-items: center; }
  .risk-dial { width: 94px; height: 94px; }
  .risk-dial-inner strong { font-size: 27px; }
  .metric-grid { grid-template-columns: 1fr; }
  .panel { padding: 18px; }
  .source-status { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms!important; animation-iteration-count: 1!important; scroll-behavior: auto!important; }
}

.hidden { display: none !important; }
.button.tiny { padding: 7px 10px; border-radius: 9px; font-size: 10px; }
.panel-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 10px; }

.traffic-panel { margin-top: 16px; }
.traffic-heading { align-items: center; }
.setup-banner { display: flex; align-items: center; justify-content: space-between; gap: 22px; margin: 0 0 16px; padding: 16px 18px; border: 1px solid rgba(244,200,107,.28); border-radius: 14px; background: rgba(244,200,107,.07); }
.setup-banner strong { display: block; color: var(--yellow); font-size: 12px; }
.setup-banner p { color: var(--muted); font-size: 10px; margin: 4px 0 0; }
.setup-banner code { color: #dcebf1; }
.setup-banner a { flex: none; color: var(--cyan); font-size: 11px; text-decoration: none; }
.traffic-route-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.route-card { min-height: 220px; padding: 18px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.024); }
.route-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 13px; }
.route-direction { color: var(--cyan); font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.route-card h4 { font-size: 13px; line-height: 1.3; margin: 4px 0 0; }
.traffic-status { display: inline-flex; align-items: center; min-height: 23px; padding: 4px 8px; border: 1px solid transparent; border-radius: 999px; font-size: 8px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; }
.traffic-status.neutral { color: var(--muted); background: rgba(255,255,255,.045); border-color: var(--border); }
.traffic-status.clear { color: var(--green); background: rgba(70,212,154,.1); border-color: rgba(70,212,154,.2); }
.traffic-status.moderate { color: var(--yellow); background: rgba(244,200,107,.1); border-color: rgba(244,200,107,.2); }
.traffic-status.heavy { color: var(--orange); background: rgba(255,150,107,.1); border-color: rgba(255,150,107,.2); }
.traffic-status.severe { color: var(--red); background: rgba(255,101,119,.1); border-color: rgba(255,101,119,.25); }
.route-eta { display: flex; align-items: baseline; gap: 8px; margin-top: 24px; }
.route-eta strong { font-size: 48px; line-height: .95; letter-spacing: -.055em; }
.route-eta span { color: var(--muted); font-size: 11px; }
.route-eta.small strong { font-size: 38px; }
.route-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 20px; }
.route-stats span { display: grid; gap: 3px; color: var(--subtle); font-size: 8px; }
.route-stats b { color: #d9e8ee; font-size: 10px; font-weight: 720; }
.route-card > p { color: var(--muted); font-size: 9px; line-height: 1.45; margin: 17px 0 0; }
.compact-route-card { min-height: 220px; }
.speed-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 26px; }
.speed-compare > div { padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: rgba(255,255,255,.02); }
.speed-compare strong { display: block; font-size: 27px; letter-spacing: -.04em; }
.speed-compare span { color: var(--subtle); font-size: 8px; }
.location-traffic-card .route-card-top { align-items: center; }
.traffic-lower-grid { display: grid; grid-template-columns: minmax(0,1.45fr) minmax(300px,.55fr); gap: 12px; margin-top: 12px; }
.traffic-history-wrap, .evacuation-note { min-height: 154px; padding: 17px; border: 1px solid var(--border); border-radius: 15px; background: rgba(255,255,255,.018); }
.subheading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.subheading-row h4 { font-size: 11px; margin: 0; }
.subheading-row p { color: var(--muted); font-size: 9px; margin: 3px 0 0; }
.traffic-trend { min-height: 96px; margin-top: 12px; }
.traffic-trend .empty-state.compact { min-height: 88px; }
.traffic-chart { width: 100%; height: 104px; display: block; overflow: visible; }
.traffic-chart .grid-line { stroke: rgba(157,201,220,.1); stroke-width: 1; }
.traffic-chart .trend-fill { fill: rgba(69,208,217,.08); }
.traffic-chart .trend-line { fill: none; stroke: var(--cyan); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.traffic-chart .trend-dot { fill: var(--cyan); stroke: #0b1d2b; stroke-width: 2; }
.traffic-chart text { fill: var(--subtle); font-size: 8px; }
.evacuation-note strong { display: block; color: var(--yellow); font-size: 11px; }
.evacuation-note p { color: var(--muted); font-size: 9px; line-height: 1.55; margin: 8px 0 13px; }
.note-links { display: flex; flex-wrap: wrap; gap: 8px 12px; color: var(--subtle); font-size: 8px; }
.note-links a { color: var(--cyan); text-decoration: none; }

.shelter-grid { grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr); }
.privacy-note { margin: -7px 0 12px; color: var(--subtle); font-size: 9px; }
.shelter-map { height: 520px; overflow: hidden; border: 1px solid rgba(143,194,215,.13); border-radius: 16px; background: #0b2230; }
.shelter-legend { flex-wrap: wrap; }
.legend-dot.open-shelter { background: var(--green); }
.legend-dot.facility { background: var(--yellow); }
.leaflet-container { background: #0b2230; font-family: inherit; }
.leaflet-control-attribution { background: rgba(7,19,31,.84)!important; color: var(--muted)!important; font-size: 8px!important; }
.leaflet-control-attribution a { color: var(--cyan)!important; }
.leaflet-bar a { background: #102b3d!important; color: var(--text)!important; border-color: var(--border)!important; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #102b3d; color: var(--text); }
.leaflet-popup-content { margin: 12px 14px; font-size: 10px; line-height: 1.45; }
.map-pin { width: 18px; height: 18px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 2px solid #07131f; box-shadow: 0 3px 10px rgba(0,0,0,.35); }
.map-pin.open { background: var(--green); }
.map-pin.facility { background: var(--yellow); }
.map-pin.user { background: var(--cyan); }
.map-pin > span { display: block; width: 5px; height: 5px; margin: 4px; border-radius: 50%; background: #07131f; }
.shelter-list-heading { align-items: center; }
.segmented-control { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 10px; background: rgba(255,255,255,.025); }
.segmented-control button { border: 0; padding: 6px 9px; border-radius: 7px; color: var(--muted); background: transparent; font-size: 9px; }
.segmented-control button.active { color: #dffcff; background: rgba(69,208,217,.18); box-shadow: inset 0 0 0 1px rgba(69,208,217,.34); font-weight: 750; }
.nearest-shelter-card { padding: 16px; border: 1px solid rgba(70,212,154,.23); border-radius: 14px; background: linear-gradient(135deg, rgba(70,212,154,.09), rgba(69,208,217,.035)); }
.nearest-shelter-card h4 { font-size: 14px; margin: 7px 0 0; }
.nearest-shelter-card.warning { border-color: rgba(244,200,107,.42); background: linear-gradient(135deg, rgba(244,200,107,.14), rgba(255,150,107,.05)); box-shadow: inset 4px 0 0 rgba(244,200,107,.75); }
.nearest-shelter-card.warning .eyeline, .nearest-shelter-card.warning h4 { color: var(--yellow); }
.nearest-shelter-card p { color: var(--muted); font-size: 9px; margin: 6px 0 0; }
.nearest-shelter-card .nearest-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.nearest-shelter-card a { color: var(--cyan); font-size: 9px; text-decoration: none; }
.shelter-warning { display: grid; gap: 3px; margin: 11px 0; padding: 11px 12px; border-radius: 11px; background: rgba(244,200,107,.065); border: 1px solid rgba(244,200,107,.16); }
.shelter-warning strong { color: var(--yellow); font-size: 9px; }
.shelter-warning span { color: var(--muted); font-size: 8px; line-height: 1.45; }
.shelter-list { display: grid; gap: 9px; max-height: 420px; overflow: auto; padding-right: 3px; }
.shelter-item { padding: 13px; border: 1px solid var(--border); border-radius: 13px; background: rgba(255,255,255,.02); }
.shelter-item-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.shelter-item h4 { font-size: 11px; line-height: 1.35; margin: 0; }
.shelter-distance { color: var(--cyan); font-size: 10px; font-weight: 750; white-space: nowrap; }
.shelter-address { color: var(--muted); font-size: 9px; margin-top: 4px; }
.shelter-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.shelter-tag { padding: 4px 6px; border-radius: 999px; background: rgba(255,255,255,.045); border: 1px solid var(--border); color: #b7cad4; font-size: 7px; text-transform: uppercase; letter-spacing: .04em; }
.shelter-tag.open { color: var(--green); border-color: rgba(70,212,154,.22); background: rgba(70,212,154,.08); }
.shelter-tag.closed, .shelter-tag.full { color: var(--red); border-color: rgba(255,101,119,.22); background: rgba(255,101,119,.07); }
.shelter-tag.standby, .shelter-tag.alert { color: var(--yellow); border-color: rgba(244,200,107,.22); background: rgba(244,200,107,.07); }
.shelter-item-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.shelter-item-actions a { color: var(--cyan); font-size: 8px; text-decoration: none; }
.shelter-item-note { color: var(--subtle); font-size: 8px; line-height: 1.45; margin-top: 8px; }

@media (max-width: 1280px) {
  .traffic-route-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .shelter-grid { grid-template-columns: 1fr; }
}
@media (max-width: 1080px) {
  .traffic-lower-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .traffic-route-grid { grid-template-columns: 1fr; }
  .traffic-heading, .panel-heading-actions { align-items: flex-start; }
  .traffic-heading { flex-direction: column; }
  .panel-heading-actions { justify-content: flex-start; }
  .setup-banner { align-items: flex-start; flex-direction: column; }
  .route-card { min-height: auto; }
  .route-eta strong { font-size: 42px; }
  .shelter-map { height: 390px; }
  .shelter-list-heading { align-items: flex-start; flex-direction: column; }
  .segmented-control { width: 100%; }
  .segmented-control button { flex: 1; }
}

/* Island Shield v4 accessibility, branding and readability */
:root {
  --text: #f8fbfc;
  --muted: #b4c8d2;
  --subtle: #91aab8;
  --cyan: #8fd8c7;
  --green: #62d7a5;
  --yellow: #f2c66d;
  --orange: #f2a06f;
  --red: #ff7585;
  --focus: #f2c66d;
}
html { font-size: 16px; scroll-behavior: smooth; }
body { font-size: 16px; line-height: 1.6; }
button, a { -webkit-tap-highlight-color: transparent; }
a:hover { color: #b7f0e3; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip-link { position: fixed; left: 18px; top: 14px; z-index: 1000; transform: translateY(-180%); padding: 12px 16px; border-radius: 10px; background: #f7f1e3; color: #0b2230; font-weight: 800; text-decoration: none; }
.skip-link:focus { transform: translateY(0); }
.app-shell { width: min(1640px, calc(100% - 48px)); padding-bottom: 0; }
.topbar { min-height: 112px; padding: 18px 0; margin-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 18px; min-width: 280px; text-decoration: none; }
.brand-logo { width: 252px; max-width: 40vw; height: auto; display: block; }
.brand-description { max-width: 250px; color: var(--muted); font-size: 0.88rem; line-height: 1.4; border-left: 1px solid var(--border); padding-left: 18px; }
.topbar-actions { gap: 12px; }
.live-indicator, .updated { font-size: 0.86rem; }
.live-indicator { padding: 10px 13px; }
.button { min-height: 44px; padding: 11px 16px; border-radius: 11px; font-size: 0.9rem; }
.button.tiny { min-height: 40px; padding: 9px 13px; font-size: 0.82rem; }
.stale-banner { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 14px 18px; border: 1px solid rgba(242,198,109,.35); border-radius: 13px; color: #f8e3b6; background: rgba(242,198,109,.1); font-size: 0.92rem; }
.stale-banner strong { color: var(--yellow); }
.status-hero { min-height: 290px; padding: 44px 48px; }
.eyeline { font-size: 0.78rem; line-height: 1.5; }
.status-copy h2 { font-size: clamp(2.35rem, 4vw, 3.7rem); }
.status-copy > p { font-size: 1.05rem; line-height: 1.6; }
.status-meta { font-size: 0.9rem; }
.risk-badge { padding: 9px 14px; font-size: 0.9rem; }
.risk-dial-wrap { width: 205px; }
.risk-dial { width: 150px; height: 150px; }
.risk-dial-inner strong { font-size: 2.5rem; }
.risk-dial-inner span { font-size: 0.82rem; }
.risk-dial-wrap p { font-size: 0.78rem; line-height: 1.55; }
.metric-grid { gap: 16px; }
.metric-card { min-height: 166px; padding: 24px; }
.metric-label { font-size: 0.78rem; }
.metric-main { margin-top: 16px; }
.metric-main strong { font-size: 2.2rem; }
.metric-main span { font-size: 0.92rem; }
.metric-detail { font-size: 0.86rem; line-height: 1.55; }
.panel { padding: 28px; }
.panel-heading { margin-bottom: 22px; }
.panel-heading h3 { font-size: 1.25rem; }
.panel-heading p { font-size: 0.9rem; line-height: 1.5; }
.panel-heading > span, .panel-heading-actions { font-size: 0.84rem; }
.text-link, .text-button { font-size: 0.88rem; font-weight: 700; }
.panel-count { min-width: 34px; height: 34px; font-size: 0.95rem; }
.map-legend { font-size: 0.82rem; gap: 20px; }
.alerts-list, .systems-list { gap: 12px; max-height: 480px; }
.alert-item { padding: 18px; }
.alert-title { font-size: 1rem; }
.alert-severity { font-size: 0.72rem; padding: 5px 9px; }
.alert-item p { font-size: 0.86rem; line-height: 1.6; }
.no-alerts, .empty-state { font-size: 0.9rem; line-height: 1.55; }
.forecast-strip { grid-template-columns: repeat(7, minmax(170px,1fr)); gap: 12px; }
.forecast-card { min-height: 238px; padding: 18px; }
.forecast-card .day { font-size: 0.95rem; }
.forecast-illustration { width: 78px; height: 78px; }
.forecast-illustration-svg { width: 70px; height: 64px; }
.forecast-card .temp strong { font-size: 2rem; }
.forecast-card .rain { font-size: 0.84rem; }
.forecast-card .summary { font-size: 0.88rem; line-height: 1.5; }
.forecast-card .wind { font-size: 0.82rem; }
.system-item { gap: 16px; padding: 17px; }
.system-icon { min-width: 104px; min-height: 46px; font-size: 0.78rem; }
.system-name { font-size: 1rem; }
.system-meta { font-size: 0.84rem; }
.system-distance strong { font-size: 1.05rem; }
.system-distance span, .system-links a { font-size: 0.8rem; }
.timeline-item { grid-template-columns: 20px 1fr; gap: 14px; padding-bottom: 18px; }
.timeline-item > div strong, .timeline-content strong { display: block; font-size: 0.92rem; }
.timeline-item > div span, .timeline-content p { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.toast { padding: 15px 17px; font-size: 0.9rem; }
.setup-banner strong { font-size: 0.95rem; }
.setup-banner p, .setup-banner a { font-size: 0.84rem; }
.traffic-route-grid { gap: 14px; }
.route-card { min-height: 270px; padding: 22px; }
.route-direction { font-size: 0.7rem; }
.route-card h4 { font-size: 1.05rem; }
.traffic-status { min-height: 28px; padding: 5px 10px; font-size: 0.7rem; }
.route-eta { margin-top: 28px; }
.route-eta strong { font-size: 3.4rem; }
.route-eta span { font-size: 0.88rem; }
.route-eta.small strong { font-size: 2.7rem; }
.route-stats { gap: 10px; margin-top: 24px; }
.route-stats span { gap: 4px; font-size: 0.76rem; }
.route-stats b { font-size: 0.92rem; }
.route-card > p { font-size: 0.84rem; line-height: 1.55; }
.speed-compare strong { font-size: 2rem; }
.speed-compare span { font-size: 0.76rem; }
.traffic-history-wrap, .evacuation-note { min-height: 190px; padding: 21px; }
.subheading-row h4 { font-size: 0.95rem; }
.subheading-row p { font-size: 0.8rem; }
.traffic-chart { height: 130px; }
.traffic-chart text { font-size: 11px; }
.evacuation-note strong { font-size: 0.95rem; }
.evacuation-note p { font-size: 0.83rem; line-height: 1.65; }
.note-links { font-size: 0.78rem; }
.privacy-note { font-size: 0.84rem; line-height: 1.55; }
.leaflet-control-attribution { font-size: 0.72rem!important; }
.leaflet-popup-content { font-size: 0.86rem; }
.segmented-control button { min-height: 38px; padding: 8px 12px; font-size: 0.78rem; }
.nearest-shelter-card { padding: 20px; }
.nearest-shelter-card h4 { font-size: 1.08rem; }
.nearest-shelter-card p, .nearest-shelter-card a { font-size: 0.84rem; }
.shelter-warning { gap: 5px; padding: 14px 15px; }
.shelter-warning strong { font-size: 0.84rem; }
.shelter-warning span { font-size: 0.8rem; line-height: 1.55; }
.shelter-list { gap: 11px; max-height: 500px; }
.shelter-item { padding: 17px; }
.shelter-item h4 { font-size: 0.98rem; }
.shelter-distance { font-size: 0.9rem; }
.shelter-address { font-size: 0.84rem; }
.shelter-tag { padding: 5px 8px; font-size: 0.68rem; }
.shelter-item-actions a, .shelter-item-note { font-size: 0.8rem; }
.sources-panel { align-items: flex-start; }
.source-copy h3 { font-size: 1.15rem; }
.source-copy p { font-size: 0.9rem; line-height: 1.65; }
.source-links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 14px; }
.source-links a { color: var(--cyan); font-size: 0.84rem; font-weight: 700; text-decoration: none; }
.source-status { font-size: 0.84rem; gap: 16px; }
.source-status i { width: 9px; height: 9px; }
.official-disclaimer { display: flex; gap: 14px; align-items: flex-start; margin-top: 16px; padding: 18px 22px; border: 1px solid rgba(242,198,109,.24); border-radius: 16px; background: rgba(242,198,109,.055); }
.official-disclaimer strong { flex: none; color: var(--yellow); font-size: 0.92rem; }
.official-disclaimer p { margin: 0; color: var(--muted); font-size: 0.88rem; line-height: 1.65; }
.site-footer { margin-top: 24px; padding: 34px 0 42px; border-top: 1px solid var(--border); }
.footer-main { display: grid; grid-template-columns: minmax(320px, 1fr) minmax(360px, .85fr); gap: 40px; align-items: center; }
.footer-brand { display: flex; align-items: center; gap: 22px; min-width: 0; }
.footer-brand img { width: min(240px, 42vw); height: auto; flex: none; }
.footer-brand-copy { display: grid; gap: 7px; max-width: 330px; }
.footer-brand p, .footer-brand span, .footer-support-block p, .footer-notes p { color: var(--muted); font-size: 0.92rem; line-height: 1.6; margin: 0; }
.footer-brand span { color: var(--subtle); font-size: .84rem; }
.footer-support-block { padding: 20px 22px; border: 1px solid rgba(143,216,199,.18); border-radius: 16px; background: rgba(143,216,199,.035); }
.footer-support-block > strong { display: block; margin-bottom: 7px; color: #eefaf7; font-size: 1.03rem; }
.footer-support-block p { margin-bottom: 14px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 34px; align-items: flex-start; margin-top: 28px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.055); }
.footer-notes { max-width: 680px; display: grid; gap: 7px; text-align: right; }
.footer-notes strong { color: #e9f5f1; }

@media (max-width: 1180px) {
  .brand-description { display: none; }
  .brand-logo { max-width: 46vw; }
}
@media (max-width: 760px) {
  .app-shell { width: min(100% - 24px, 1640px); }
  .topbar { min-height: auto; }
  .brand-logo { width: 230px; max-width: 82vw; }
  .topbar-actions { width: 100%; }
  .topbar-actions .button { flex: 1; }
  .status-hero { padding: 32px 24px; }
  .risk-dial-wrap { width: 100%; }
  .panel { padding: 22px; }
  .forecast-strip { grid-template-columns: repeat(7, 180px); }
  .route-card { min-height: auto; }
  .route-stats { gap: 14px; }
  .shelter-map { height: 430px; }
  .official-disclaimer { flex-direction: column; }
  .footer-main { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .footer-notes { text-align: left; }
  .footer-brand { align-items: flex-start; }
}
@media (max-width: 420px) {
  .topbar-actions .live-indicator, .topbar-actions .updated { width: 100%; }
  .topbar-actions .button { flex-basis: 100%; }
  .status-copy h2 { font-size: 2rem; }
  .route-stats { grid-template-columns: 1fr; }
  .speed-compare { grid-template-columns: 1fr; }
}


/* CSP-safe risk states and map fallback */
.risk-dial.risk-low, .timeline-dot.risk-low { --risk-color: #46d49a; }
.risk-dial.risk-guarded, .timeline-dot.risk-guarded { --risk-color: #f4c86b; }
.risk-dial.risk-elevated, .timeline-dot.risk-elevated { --risk-color: #ff966b; }
.risk-dial.risk-high, .timeline-dot.risk-high { --risk-color: #ff6577; }
.risk-dial.risk-critical, .timeline-dot.risk-critical { --risk-color: #ff405d; }
.risk-dial.risk-neutral, .timeline-dot.risk-neutral { --risk-color: #69d4dd; }
.timeline-dot.risk-low, .timeline-dot.risk-guarded, .timeline-dot.risk-elevated,
.timeline-dot.risk-high, .timeline-dot.risk-critical, .timeline-dot.risk-neutral { background: var(--risk-color); }
.risk-score-0 { --risk-angle: 8deg; }
.risk-score-1 { --risk-angle: 30deg; }
.risk-score-2 { --risk-angle: 60deg; }
.risk-score-3 { --risk-angle: 90deg; }
.risk-score-4 { --risk-angle: 120deg; }
.risk-score-5 { --risk-angle: 150deg; }
.risk-score-6 { --risk-angle: 180deg; }
.risk-score-7 { --risk-angle: 210deg; }
.risk-score-8 { --risk-angle: 240deg; }
.risk-score-9 { --risk-angle: 270deg; }
.risk-score-10 { --risk-angle: 300deg; }
.risk-score-11 { --risk-angle: 330deg; }
.risk-score-12 { --risk-angle: 360deg; }
.map-fallback { height: 100%; min-height: 360px; padding: 30px; }

/* Large, legible emergency-information text */
html { font-size: 17px; }
.panel-heading h3 { font-size: 1.35rem; }
.panel-heading p,
.source-copy p,
.status-copy > p { font-size: 1rem; }
.panel-heading > span,
.panel-heading-actions,
.live-indicator,
.updated,
.metric-detail,
.route-card > p,
.privacy-note,
.shelter-address,
.shelter-item-note,
.shelter-item-actions a,
.nearest-shelter-card p,
.nearest-shelter-card a,
.evacuation-note p,
.source-links a,
.source-status,
.official-disclaimer p,
.footer-brand p,
.footer-notes p { font-size: 0.92rem; }
.metric-label,
.route-direction,
.traffic-status,
.speed-compare span,
.shelter-tag,
.alert-severity { font-size: 0.8rem; }
.metric-main span,
.route-eta span,
.route-stats span,
.segmented-control button,
.note-links,
.system-meta,
.system-distance span,
.system-links a,
.timeline-item > div span,
.timeline-content p { font-size: 0.86rem; }
.route-stats b,
.subheading-row h4,
.evacuation-note strong,
.nearest-shelter-card h4,
.shelter-item h4,
.alert-title,
.system-name { font-size: 1rem; }
.traffic-chart text { font-size: 13px; }
.eyeline { font-size: 0.82rem; }
.risk-dial-wrap p { font-size: 0.84rem; }
.leaflet-control-attribution { font-size: 0.78rem!important; }
.leaflet-popup-content { font-size: 0.92rem; line-height: 1.5; }
@media (max-width: 760px) {
  html { font-size: 16px; }
}

/* Community support */
.support-panel { margin-top: 16px; padding: 28px; }
.support-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 28px; }
.support-heading h3 { margin: 0; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; letter-spacing: -.025em; max-width: 850px; }
.support-heading p { margin: 12px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.65; max-width: 920px; }
.support-heading img { width: 74px; height: 84px; flex: none; opacity: .95; }
.support-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 24px; }
.kofi-support-grid { grid-template-columns: minmax(360px, .92fr) minmax(0, 1.08fr); align-items: stretch; }
.support-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 290px; padding: 24px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.025); }
.support-kicker { color: var(--cyan); font-size: .8rem; font-weight: 760; text-transform: uppercase; letter-spacing: .12em; }
.support-card h4 { margin: 10px 0 0; font-size: 1.25rem; line-height: 1.25; }
.support-card p { margin: 12px 0 20px; color: var(--muted); font-size: .98rem; line-height: 1.65; }
.support-card small { display: block; margin-top: 14px; color: var(--subtle); font-size: .82rem; line-height: 1.5; }
.support-action { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; text-decoration: none; }
.support-pending { margin-top: auto; display: inline-flex; padding: 10px 13px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); font-size: .9rem; }

.support-story-card { min-height: 100%; background: linear-gradient(155deg, rgba(143,216,199,.055), rgba(255,255,255,.018)); border-color: rgba(143,216,199,.21); }
.support-story-card > p { margin-bottom: 12px; }
.support-monthly-note { margin: 0 0 18px!important; padding: 14px 16px; border-left: 3px solid var(--cyan); border-radius: 0 10px 10px 0; background: rgba(69,208,217,.055); color: #c7dce5!important; font-size: .92rem!important; line-height: 1.6!important; }
.support-story-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.support-story-actions .button { min-height: 44px; }
.support-story-card .support-pending { margin-top: 0; }
.support-story-card small { margin-top: 14px; }
.support-qr { display: grid; grid-template-columns: 116px minmax(0,1fr); gap: 16px; align-items: center; width: 100%; margin-top: 20px; padding-top: 20px; border-top: 1px solid rgba(157,201,220,.12); }
.support-qr-image-link { display: block; width: 116px; height: 116px; border-radius: 12px; }
.support-qr img { display: block; width: 116px; height: 116px; padding: 7px; border-radius: 12px; background: #fff; }
.support-qr-image-link:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
.support-qr strong { display: block; color: #eaf8f4; font-size: .98rem; }
.support-qr span { display: block; margin-top: 6px; color: var(--muted); font-size: .84rem; line-height: 1.55; }

.kofi-widget-card { min-height: 0; width: 100%; overflow: hidden; background: linear-gradient(145deg, rgba(69,208,217,.055), rgba(255,255,255,.02)); border-color: rgba(69,208,217,.22); }
.kofi-widget-card > p { margin-bottom: 16px; }
.kofi-frame { display: block; width: 100%; height: 712px; padding: 4px; border: 0; border-radius: 12px; background: #f9f9f9; color-scheme: light; }
.kofi-embed-fallback { width: 100%; padding: 18px; border: 1px dashed var(--border); border-radius: 12px; background: rgba(255,255,255,.025); }
.kofi-embed-fallback p { margin: 0 0 12px; }
.support-uses { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; padding: 16px 18px; border-radius: 14px; background: rgba(255,255,255,.02); border: 1px solid var(--border); }
.support-uses strong { margin-right: 4px; font-size: .95rem; }
.support-uses span { padding: 6px 9px; border-radius: 999px; background: rgba(69,208,217,.075); color: #c7edf0; font-size: .82rem; }
.support-legal-note { margin: 16px 2px 0; color: var(--muted); font-size: .88rem; line-height: 1.65; }
.support-legal-note a, .official-disclaimer a { color: var(--cyan); text-underline-offset: 3px; }
.footer-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-start; }
.footer-support-link,
.footer-social-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 15px; border-radius: 10px; text-decoration: none; font-weight: 760; font-size: .92rem; }
.footer-support-link { border: 1px solid rgba(143,216,199,.32); color: #dffbf4; background: rgba(143,216,199,.085); }
.footer-social-link { gap: 8px; border: 1px solid rgba(157,201,220,.24); color: var(--text); background: rgba(255,255,255,.025); }
.footer-social-link:hover { border-color: rgba(157,201,220,.42); background: rgba(255,255,255,.055); }
.x-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1px solid currentColor; border-radius: 6px; font-size: .72rem; font-weight: 850; line-height: 1; }
.social-handle { color: var(--muted); font-weight: 650; }
.social-button { display: inline-flex; align-items: center; gap: 8px; }
.social-button .x-mark { width: 20px; height: 20px; font-size: .68rem; }
.footer-legal-links { display: flex; justify-content: flex-start; gap: 12px 18px; flex-wrap: wrap; max-width: 560px; }
.footer-legal-links a { color: var(--cyan); font-size: .9rem; text-decoration: none; }
.footer-legal-links a:hover, .footer-support-link:hover, .footer-social-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Standalone legal and policy pages */
.legal-body { background: var(--bg); }
.legal-shell { width: min(980px, calc(100% - 40px)); margin: 0 auto; padding: 24px 0 64px; }
.legal-header { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.legal-header img { width: 230px; height: auto; }
.legal-header a { color: var(--cyan); text-decoration: none; font-weight: 700; }
.legal-main { margin-top: 28px; }
.legal-hero { padding: 32px; border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(145deg, rgba(14,36,52,.98), rgba(9,27,41,.98)); }

.about-hero-copy { min-width: 0; }
.founder-story-section { position: relative; overflow: hidden; border-color: rgba(143,216,199,.22); background: linear-gradient(145deg, rgba(143,216,199,.055), rgba(255,255,255,.018)); }
.founder-story-section::after { content: ""; position: absolute; right: -80px; bottom: -90px; width: 220px; height: 220px; border: 1px solid rgba(143,216,199,.1); border-radius: 50%; box-shadow: 0 0 0 34px rgba(143,216,199,.025), 0 0 0 68px rgba(143,216,199,.018); pointer-events: none; }
.founder-story-label { position: relative; z-index: 1; color: var(--cyan); font-size: .78rem; font-weight: 760; letter-spacing: .14em; }
.founder-story-section h2, .founder-story-section p { position: relative; z-index: 1; }

.legal-hero h1 { margin: 0; font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; letter-spacing: -.04em; }
.legal-hero p { margin: 16px 0 0; color: var(--muted); font-size: 1rem; line-height: 1.7; }
.legal-meta { color: var(--subtle); font-size: .88rem!important; }
.legal-warning { margin-top: 18px; padding: 16px 18px; border-left: 4px solid var(--yellow); border-radius: 10px; background: rgba(244,200,107,.07); color: #e7d7ad; line-height: 1.65; }
.legal-content { display: grid; gap: 14px; margin-top: 18px; }
.legal-section { padding: 24px 26px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.02); }
.legal-section h2 { margin: 0 0 12px; font-size: 1.25rem; }
.legal-section h3 { margin: 20px 0 8px; font-size: 1.05rem; }
.legal-section p, .legal-section li { color: #b7c9d3; font-size: .98rem; line-height: 1.75; }
.legal-section p { margin: 10px 0 0; }
.legal-section ul { margin: 10px 0 0; padding-left: 22px; }
.legal-section a { color: var(--cyan); }
.legal-callout { border-color: rgba(255,150,107,.28); background: rgba(255,150,107,.05); }
.legal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.legal-footer { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; line-height: 1.6; }

@media (max-width: 900px) {
  .support-grid, .kofi-support-grid { grid-template-columns: 1fr; }
  .footer-main { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; }
  .footer-actions { justify-content: flex-start; }
}
@media (max-width: 760px) {
  .support-panel { padding: 22px; }
  .support-heading { flex-direction: column-reverse; }
  .support-heading img { width: 60px; height: 68px; }
  .support-card { min-height: 0; }
  .support-story-actions { width: 100%; }
  .support-story-actions .button { width: 100%; }
  .support-qr { display: none; }
  .kofi-frame { height: 740px; }
  .footer-legal-links { justify-content: flex-start; }
  .footer-brand { flex-direction: column; }
  .footer-brand img { width: 220px; max-width: 85vw; }
  .footer-support-block { width: 100%; box-sizing: border-box; }
  .legal-shell { width: min(100% - 28px, 980px); }
  .legal-header { align-items: flex-start; flex-direction: column; }
  .legal-header img { width: 205px; }
  .legal-hero, .legal-section { padding: 22px; }
}

/* v5.2: keep live metrics visible in short desktop preview windows without reducing readability */
@media (min-width: 900px) and (max-height: 760px) {
  .app-shell {
    width: min(1640px, calc(100% - 32px));
  }

  .topbar {
    min-height: 78px;
    margin-bottom: 14px;
    padding: 8px 0;
  }

  .brand-logo {
    width: 208px;
    max-width: 34vw;
  }

  .brand-description {
    max-width: 225px;
    padding-left: 14px;
    font-size: 0.82rem;
  }

  .topbar-actions {
    gap: 8px;
  }

  .button {
    min-height: 40px;
    padding: 9px 13px;
  }

  .status-hero {
    min-height: 0;
    padding: 27px 34px;
    gap: 24px;
  }

  .eyeline {
    margin-bottom: 8px;
  }

  .status-copy h2 {
    max-width: 1040px;
    font-size: clamp(2rem, 3.1vw, 3rem);
    line-height: 1.06;
  }

  .status-copy > p {
    margin-top: 11px;
    font-size: 0.98rem;
  }

  .status-meta {
    margin-top: 14px;
  }

  .risk-dial-wrap {
    width: 175px;
  }

  .risk-dial {
    width: 116px;
    height: 116px;
  }

  .risk-dial-inner strong {
    font-size: 2rem;
  }

  .risk-dial-wrap p {
    margin-top: 7px;
    font-size: 0.72rem;
  }

  .metric-grid {
    margin-top: 13px;
  }

  .metric-card {
    min-height: 148px;
    padding: 20px 22px;
  }

  .metric-main {
    margin-top: 12px;
  }
}

/* v5.3: prioritize the live snapshot and make the risk score/message unmistakable */
.risk-summary {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 24px 30px;
  border: 1px solid rgba(93, 210, 221, .22);
  border-radius: 20px;
  background: linear-gradient(115deg, rgba(15, 50, 68, .98), rgba(8, 29, 43, .96));
  box-shadow: var(--shadow);
}
.risk-summary::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: var(--risk-summary-color, var(--cyan));
  z-index: 2;
}
.risk-summary.risk-neutral { --risk-summary-color: var(--cyan); }
.risk-summary.risk-low { --risk-summary-color: var(--green); border-color: rgba(70,212,154,.28); background: linear-gradient(115deg, rgba(18,57,57,.96), rgba(8,29,43,.97)); }
.risk-summary.risk-guarded { --risk-summary-color: var(--yellow); border-color: rgba(244,200,107,.34); background: linear-gradient(115deg, rgba(63,52,27,.76), rgba(8,29,43,.97)); }
.risk-summary.risk-elevated { --risk-summary-color: var(--orange); border-color: rgba(255,150,107,.38); background: linear-gradient(115deg, rgba(72,43,31,.8), rgba(8,29,43,.97)); }
.risk-summary.risk-high, .risk-summary.risk-critical { --risk-summary-color: var(--red); border-color: rgba(255,101,119,.42); background: linear-gradient(115deg, rgba(72,29,40,.84), rgba(8,29,43,.97)); }
.risk-summary::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -145px;
  top: -210px;
  border-radius: 50%;
  border: 1px solid rgba(78, 203, 214, .09);
  box-shadow: 0 0 0 44px rgba(78, 203, 214, .03), 0 0 0 88px rgba(78, 203, 214, .02);
  pointer-events: none;
}
.risk-summary-copy { position: relative; z-index: 1; min-width: 0; }
.risk-summary .eyeline { margin-bottom: 9px; }
.risk-summary-heading {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-width: 0;
}
.risk-summary-heading .risk-badge { flex: none; margin-top: .2rem; }
.risk-summary-heading h2 {
  margin: 0;
  font-size: clamp(1.55rem, 2.35vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -.03em;
}
.risk-summary-copy > p {
  max-width: 980px;
  margin: 10px 0 0;
  color: #bed1da;
  font-size: 1rem;
  line-height: 1.55;
}
.risk-summary-meta { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; color: var(--muted); font-size: .88rem; }
.risk-scale-note { color: var(--subtle); }
.risk-summary .risk-dial-wrap { width: 170px; }
.risk-summary .risk-dial { width: 138px; height: 138px; }
.risk-summary .risk-dial-inner strong { font-size: 2.5rem; }
.risk-summary .risk-dial-inner span { font-size: .82rem; }
.risk-score-caption { position: relative; z-index: 1; max-width: 170px; margin-top: 10px; color: var(--muted); font-size: .78rem; line-height: 1.4; text-align: center; }

.snapshot-section { margin-top: 18px; }
.snapshot-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin: 0 4px 12px; }
.snapshot-heading h2 { margin: 0; font-size: 1.28rem; line-height: 1.2; letter-spacing: -.02em; }
.snapshot-heading p { margin: 5px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.snapshot-heading > span { flex: none; color: var(--cyan); font-size: .82rem; font-weight: 700; }
.metric-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; margin-top: 0; }
.metric-card { min-height: 154px; padding: 20px; }
.metric-main { align-items: flex-start; flex-direction: column; gap: 6px; margin-top: 13px; }
.metric-main strong { font-size: clamp(1.65rem, 2.1vw, 2.15rem); overflow-wrap: anywhere; }
.metric-main span { line-height: 1.3; }
.metric-detail { margin-top: 10px; }

.outlook-context {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  margin-top: 16px;
  padding: 0;
  overflow: hidden;
}
.outlook-context-block { padding: 22px 26px; }
.outlook-context-block + .outlook-context-block { border-left: 1px solid var(--border); }
.context-label { color: var(--cyan); font-size: .75rem; font-weight: 760; letter-spacing: .12em; }
.outlook-context h3 { margin: 7px 0 0; font-size: 1.08rem; }
.outlook-context p { margin: 8px 0 0; color: var(--muted); font-size: .94rem; line-height: 1.6; }
.methodology-block { background: rgba(255,255,255,.018); }

@media (max-width: 1350px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .risk-summary { grid-template-columns: 1fr; }
  .risk-summary .risk-dial-wrap { width: 100%; grid-template-columns: auto 1fr; justify-items: start; text-align: left; gap: 14px; }
  .risk-score-caption { max-width: 260px; margin-top: 0; text-align: left; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outlook-context { grid-template-columns: 1fr; }
  .outlook-context-block + .outlook-context-block { border-left: 0; border-top: 1px solid var(--border); }
}
@media (max-width: 620px) {
  .risk-summary { padding: 22px; }
  .risk-summary-heading { grid-template-columns: 1fr; gap: 10px; }
  .risk-summary-heading .risk-badge { justify-self: start; margin-top: 0; }
  .risk-summary-heading h2 { font-size: 1.65rem; }
  .snapshot-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .metric-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 0; }
}
@media (min-width: 900px) and (max-height: 760px) {
  .risk-summary { padding: 18px 24px; }
  .risk-summary-heading h2 { font-size: clamp(1.35rem, 2.2vw, 2rem); }
  .risk-summary-copy > p { margin-top: 6px; font-size: .92rem; }
  .risk-summary-meta { margin-top: 8px; }
  .risk-summary .risk-dial { width: 112px; height: 112px; }
  .risk-summary .risk-dial-inner strong { font-size: 2.1rem; }
  .snapshot-section { margin-top: 12px; }
  .snapshot-heading { margin-bottom: 8px; }
  .metric-card { min-height: 132px; padding: 16px 18px; }
  .metric-main { margin-top: 9px; }
  .metric-detail { margin-top: 7px; }
  .outlook-context { margin-top: 12px; }
  .outlook-context-block { padding: 16px 20px; }
}

/* v5.6 safety-flow and clarity refinements */
@media (max-width: 620px) {
  .top-disclaimer { align-items: flex-start; flex-direction: column; margin-top: -4px; font-size: .86rem; }
  .top-disclaimer strong { white-space: normal; }
  .route-card-top { flex-wrap: wrap; }
  .location-traffic-card .route-card-top .button, .shelter-map-panel .panel-heading .button { width: auto; max-width: 100%; }
}


/* v5.7: clearer 24-hour wind summary and stable brand-vs-severity color roles */
#windPeak { color: #a9c2cf; line-height: 1.55; }
.button, .text-button, .segmented-control button { white-space: nowrap; }
.risk-summary.risk-guarded .risk-summary-heading h2,
.risk-summary.risk-elevated .risk-summary-heading h2,
.risk-summary.risk-high .risk-summary-heading h2,
.risk-summary.risk-critical .risk-summary-heading h2 { color: #fff8f2; }


/* v5.8: clearer shelter-tab context, illustrated forecast icons and a larger assessment dial */
@media (max-width: 620px) {
  .risk-summary .risk-dial { width: 112px; height: 112px; }
  .risk-summary .risk-dial-inner strong { font-size: 2.1rem; }
  .risk-summary .risk-dial-wrap { gap: 16px; }
}

/* v5.9: restore header hierarchy — alerts outlined, manual update filled */


/* v5.10: always show meaningful pet-accommodation information */
.pet-accommodations-note {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: baseline;
}
.pet-accommodations-note strong { color: #d8edf4; }


/* Launch readiness pages and exact data timestamps */
.section-updated { display: block; margin-top: 6px; color: var(--subtle); font-size: .76rem; line-height: 1.35; }
.panel-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.source-title-row { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.source-title-row .section-updated { margin-top: 0; }
.source-help-links { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.about-hero { background: linear-gradient(145deg, rgba(14,54,70,.98), rgba(9,27,41,.98)); }
.correction-form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; margin-top: 18px; }
.correction-form label { display: grid; gap: 7px; color: var(--text); font-weight: 650; font-size: .92rem; }
.correction-form input, .correction-form select, .correction-form textarea { width: 100%; border: 1px solid rgba(157,201,220,.22); border-radius: 10px; padding: 12px 13px; color: var(--text); background: #0b1d2b; font: inherit; font-weight: 450; }
.correction-form input:focus, .correction-form select:focus, .correction-form textarea:focus { outline: 3px solid rgba(69,208,217,.2); border-color: var(--cyan); }
.correction-form textarea { min-height: 180px; resize: vertical; line-height: 1.6; }
.form-wide { grid-column: 1 / -1; }
.checkbox-label { display: flex!important; grid-column: 1 / -1; grid-template-columns: auto 1fr!important; align-items: center; justify-content: start; gap: 10px!important; font-weight: 500!important; }
.checkbox-label input { width: 18px; height: 18px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.form-status { min-height: 1.5em; color: var(--yellow); margin: 0; }
.status-shell { width: min(1080px, calc(100% - 40px)); }
.status-overview-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.status-overview-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 22px; color: var(--muted); flex-wrap: wrap; }
.status-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; margin-top: 18px; }
.status-card { padding: 22px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.02); }
.status-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.status-card h2 { margin: 0; font-size: 1.1rem; }
.status-card p { color: #b7c9d3; line-height: 1.65; }
.status-time { color: var(--subtle); font-size: .82rem; }
.status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 7px 10px; font-size: .8rem; font-weight: 760; white-space: nowrap; }
.status-badge.operational { color: #062018; background: var(--green); }
.status-badge.degraded, .status-badge.not_configured { color: #2b2006; background: var(--yellow); }
.status-badge.unavailable { color: white; background: var(--red); }
.status-badge.checking { color: var(--muted); background: rgba(255,255,255,.06); }
.status-note { margin-top: 18px; }

@media (max-width: 760px) {
  .correction-form, .status-grid { grid-template-columns: 1fr; }
  .form-wide { grid-column: auto; }
  .status-overview-actions { align-items: flex-start; flex-direction: column; }
  .panel-heading-actions { align-items: flex-end; }
}
