:root {
  color-scheme: light;
  --ink: #102335;
  --muted: #5d6b78;
  --line: #dbe3e8;
  --paper: #f7fafb;
  --white: #ffffff;
  --navy: #0b1f33;
  --navy-soft: #18334e;
  --teal: #14b8a6;
  --teal-light: #5eead4;
  --shadow: 0 18px 50px rgba(7, 25, 42, 0.16);
}

:root[data-theme="dark"],
body.dark-mode {
  color-scheme: dark;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --line: #334155;
  --paper: #0c1421;
  --white: #172437;
  --navy: #f8fafc;
  --navy-soft: #cbd5e1;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

button,
select {
  font: inherit;
}

button,
select,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(320px, 390px) 1fr;
  height: 100dvh;
}

.sidebar {
  position: relative;
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 28px 26px 24px;
  background: var(--paper);
  border-right: 1px solid rgba(10, 40, 62, 0.12);
  box-shadow: 10px 0 35px rgba(7, 25, 42, 0.08);
}

.masthead {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-toggle-wrap {
  display: flex;
  align-items: center;
}

.theme-toggle-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--white);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(7, 25, 42, 0.04);
}

.theme-toggle-button:hover {
  border-color: var(--navy-soft);
  color: var(--navy);
  box-shadow: 0 4px 12px rgba(7, 25, 42, 0.08);
}

.theme-toggle-button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.theme-icon-sun {
  display: none;
}

.theme-icon-moon {
  display: block;
}

:root[data-theme="dark"] .theme-icon-sun,
body.dark-mode .theme-icon-sun {
  display: block;
  color: #fbbf24;
}

:root[data-theme="dark"] .theme-icon-moon,
body.dark-mode .theme-icon-moon {
  display: none;
}

.lang-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 6px rgba(7, 25, 42, 0.04);
}

.lang-toggle-button:hover {
  border-color: var(--navy-soft);
  color: var(--navy);
  box-shadow: 0 4px 12px rgba(7, 25, 42, 0.08);
}

.lang-toggle-button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.lang-opt {
  transition: color 0.15s ease;
}

.lang-opt.is-active {
  color: var(--navy);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--teal);
}

.lang-sep {
  color: var(--line);
  font-weight: 400;
  user-select: none;
}

.county-mark {
  display: grid;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px;
  background: var(--navy);
  color: var(--teal-light);
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 20px rgba(11, 31, 51, 0.2);
}

.eyebrow,
.details-kicker {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  color: var(--navy);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3vw, 2rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.025em;
}

h2 {
  margin-bottom: 0;
  font-size: 0.93rem;
  line-height: 1.3;
}

.snapshot-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 21px 0 0;
  padding: 10px 12px;
  border: 1px solid #cfe7e2;
  border-radius: 10px;
  background: #ecfdf9;
  color: #28514e;
  font-size: 0.79rem;
  font-weight: 650;
}

.snapshot-row time {
  margin-left: auto;
  color: #3c6663;
  font-weight: 550;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12);
}

.evacuation-alerts {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid #d5dee4;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(7, 25, 42, 0.07);
}

.evacuation-alerts-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.alerts-kicker {
  margin: 0 0 1px;
  color: #687785;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.evacuation-alerts-heading > span {
  color: #4d5f6e;
  font-size: 0.72rem;
  font-weight: 750;
  white-space: nowrap;
}

.evacuation-notice-list {
  display: grid;
  gap: 8px;
}

.evacuation-notice {
  padding: 11px 11px 10px;
  border: 1px solid;
  border-left-width: 4px;
  border-radius: 9px;
}

.evacuation-notice-mandatory {
  border-color: #efb2b2;
  border-left-color: #bd1e2d;
  background: #fff5f5;
}

.evacuation-notice-voluntary {
  border-color: #efcf8f;
  border-left-color: #b66a00;
  background: #fffbeb;
}

.evacuation-notice-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.evacuation-notice-level {
  color: #7f1621;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.evacuation-notice-voluntary .evacuation-notice-level {
  color: #7c4a00;
}

.evacuation-notice-verification {
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 800;
  white-space: nowrap;
}

.evacuation-notice-verification-official {
  background: #d9f4e8;
  color: #175d43;
}

.evacuation-notice-verification-reported {
  background: #f5e7bd;
  color: #6b4a00;
}

.evacuation-notice h3 {
  margin: 0;
  color: #102335;
  font-size: 0.88rem;
}

.evacuation-notice-headline {
  margin: 1px 0 2px;
  color: #172b3d;
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.35;
}

.evacuation-notice time {
  display: block;
  color: #4c5e6c;
  font-size: 0.72rem;
  font-weight: 700;
}

.evacuation-notice-details {
  margin: 7px 0 0;
  color: #405363;
  font-size: 0.74rem;
  line-height: 1.42;
}

.evacuation-notice-sources {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 8px;
  font-size: 0.68rem;
}

.evacuation-notice-sources a {
  color: #245f87;
  font-weight: 750;
  text-underline-offset: 2px;
}

.evacuation-notice-sources small {
  flex-basis: 100%;
  color: #6b7882;
  font-size: 0.64rem;
}

.evacuation-alerts-footnote {
  margin: 9px 1px 0;
  color: #5f6e7a;
  font-size: 0.68rem;
  line-height: 1.4;
}

.control-block,
.legend-block {
  padding-top: 23px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.77rem;
}

label {
  display: block;
  margin-bottom: 6px;
  color: #415363;
  font-size: 0.79rem;
  font-weight: 700;
}

.select-wrap {
  position: relative;
}

.select-wrap + label {
  margin-top: 11px;
}

.layer-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 11px;
  padding: 10px 12px;
  border: 1px solid #c8d3da;
  border-radius: 10px;
  background: var(--white);
}

.layer-toggle + .layer-toggle {
  margin-top: 7px;
}

.layer-toggle label {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  cursor: pointer;
}

.layer-toggle input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--navy);
}

.layer-toggle small {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.route-line {
  width: 25px;
  height: 4px;
  border: 1px solid #ffffff;
  border-radius: 999px;
  background: repeating-linear-gradient(90deg, #082f49 0 8px, transparent 8px 12px);
  box-shadow: 0 0 0 1px rgba(8, 47, 73, 0.2);
}

.surge-swatch {
  width: 25px;
  height: 9px;
  border: 1px solid rgba(11, 31, 51, 0.25);
  border-radius: 3px;
  background: linear-gradient(90deg, #4f9df7 0 25%, #ffe55c 25% 50%, #ff9f43 50% 75%, #e53e3e 75%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
}

.surge-legend {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 7px 1px 0;
}

.surge-legend[hidden],
.surge-note[hidden] {
  display: none;
}

.surge-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #536675;
  font-size: 0.68rem;
  font-weight: 700;
}

.surge-depth {
  display: inline-block;
  flex: 0 0 9px;
  width: 9px;
  height: 9px;
  border: 1px solid rgba(11, 31, 51, 0.22);
  border-radius: 2px;
}

.surge-depth-1 { background: #4f9df7; }
.surge-depth-3 { background: #ffe55c; }
.surge-depth-6 { background: #ff9f43; }
.surge-depth-9 { background: #e53e3e; }

.surge-note {
  margin: 5px 2px 0;
  color: #657581;
  font-size: 0.68rem;
  line-height: 1.35;
}

.track-symbol {
  position: relative;
  width: 25px;
  height: 12px;
  border: 1px solid rgba(11, 31, 51, 0.35);
  border-radius: 8px 3px 8px 3px;
  background: rgba(255, 255, 255, 0.75);
}

.track-symbol::before {
  position: absolute;
  top: 4px;
  right: 2px;
  left: 2px;
  border-top: 2px dashed #1473e6;
  content: "";
}

.track-symbol::after {
  position: absolute;
  top: 2px;
  left: 10px;
  width: 6px;
  height: 6px;
  border: 1px solid #ffffff;
  border-radius: 50%;
  background: #071a2b;
  content: "";
}

.track-note {
  margin: 5px 2px 0;
  color: #657581;
  font-size: 0.68rem;
  line-height: 1.35;
}

.track-category-key {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  margin: 7px 2px 0;
  color: #536675;
  font-size: 0.68rem;
  font-weight: 650;
}

.track-category-key[hidden] {
  display: none;
}

.track-category-key span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.track-category-key b {
  display: inline-grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 3px;
  border: 1px solid #ffffff;
  border-radius: 50%;
  background: #071a2b;
  color: #ffffff;
  font-size: 0.58rem;
  box-shadow: 0 0 0 1px rgba(7, 26, 43, 0.22);
}

.track-category-marker {
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  text-align: center;
  pointer-events: none;
}

.track-category-badge {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #9f1c20;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
  box-shadow: 0 0 0 2px rgba(7, 26, 43, 0.86), 0 4px 10px rgba(7, 26, 43, 0.28);
}

.track-category-ts {
  background: #087c6c;
}

.track-category-td,
.track-category-ex,
.track-category-l {
  background: #51616e;
  font-size: 0.64rem;
}

.track-category-marker small {
  margin-top: 2px;
  padding: 1px 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.92);
  color: #071a2b;
  font-size: 0.6rem;
  font-weight: 850;
  line-height: 1.1;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(7, 26, 43, 0.18);
}

.track-note[hidden] {
  display: none;
}

.track-view-button {
  min-height: 0;
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #285f86;
  font-size: 0.72rem;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.track-view-button[hidden] {
  display: none;
}

.arrival-symbol {
  display: inline-grid;
  width: 25px;
  height: 17px;
  place-items: center;
  border-top: 2px solid #111827;
  border-bottom: 2px solid #111827;
  background: #ffffff;
  color: #111827;
  font-size: 0.54rem;
  font-weight: 850;
  line-height: 1;
}

.arrival-note {
  margin: 5px 2px 0;
  color: #657581;
  font-size: 0.68rem;
  line-height: 1.35;
}

.arrival-note[hidden] {
  display: none;
}

.select-wrap::after {
  position: absolute;
  top: 50%;
  right: 14px;
  content: "⌄";
  color: #4d5f6e;
  font-size: 1rem;
  pointer-events: none;
  transform: translateY(-58%);
}

select {
  width: 100%;
  min-height: 44px;
  padding: 0 38px 0 13px;
  appearance: none;
  border: 1px solid #c8d3da;
  border-radius: 10px;
  outline: none;
  background: var(--white);
  color: var(--ink);
  font-size: 0.92rem;
}

select:focus-visible,
button:focus-visible,
a:focus-visible,
#map:focus-visible {
  outline: 3px solid rgba(20, 184, 166, 0.32);
  outline-offset: 2px;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 9px;
  margin-top: 9px;
}

button {
  min-height: 44px;
  cursor: pointer;
}

.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 0;
  border-radius: 10px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.88rem;
  font-weight: 750;
  transition: background 160ms ease, transform 160ms ease;
}

.primary-button:hover {
  background: var(--navy-soft);
}

.primary-button:active,
.icon-button:active {
  transform: translateY(1px);
}

.crosshair {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 50%;
  box-shadow: inset 0 0 0 3px var(--navy);
}

.icon-button {
  border: 1px solid #c8d3da;
  border-radius: 10px;
  background: var(--white);
  color: var(--navy);
  font-size: 1.15rem;
}

.helper {
  margin: 8px 2px 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.elevation-card {
  margin-top: 22px;
  padding: 15px;
  border: 1px solid #cbd8df;
  border-radius: 14px;
  background: #eef9f8;
}

.elevation-card .section-heading {
  margin-bottom: 10px;
}

.elevation-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #91aaa9;
  border-radius: 10px;
  background: var(--white);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 750;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.elevation-button:hover {
  border-color: var(--teal);
}

.elevation-button.is-active {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.elevation-icon {
  width: 17px;
  height: 12px;
  background: currentColor;
  clip-path: polygon(0 100%, 35% 25%, 53% 59%, 72% 0, 100% 100%);
}

.elevation-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 0;
}

.elevation-card dl[hidden] {
  display: none;
}

.elevation-card dl div {
  padding-top: 8px;
  border-top: 1px solid #c5dcda;
}

.elevation-card dt {
  color: var(--muted);
  font-size: 0.68rem;
  text-transform: uppercase;
}

.elevation-card dd {
  margin: 2px 0 0;
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 750;
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: #3d5060;
  font-size: 0.75rem;
  font-weight: 700;
}

.legend-swatch {
  flex: 0 0 11px;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(16, 35, 53, 0.28);
  border-radius: 3px;
}

.details-card {
  margin-top: 22px;
  padding: 18px;
  border-radius: 14px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 14px 35px rgba(7, 25, 42, 0.18);
}

.details-card .details-kicker {
  color: #7dd3c9;
}

.details-card h2 {
  margin-bottom: 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
}

.details-card > p:last-of-type {
  margin-bottom: 0;
  color: #c7d3de;
  font-size: 0.84rem;
  line-height: 1.55;
}

.detail-notice {
  margin: 12px 0 0;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff !important;
  font-size: 0.75rem !important;
  font-weight: 800;
  line-height: 1.4 !important;
}

.detail-notice[hidden] {
  display: none;
}

.detail-notice-mandatory {
  border-color: #ff9b9b;
  background: rgba(190, 30, 45, 0.34);
}

.detail-notice-voluntary {
  border-color: #ffd27a;
  background: rgba(182, 106, 0, 0.34);
}

.details-card dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 15px 0 0;
}

.details-card dl[hidden] {
  display: none;
}

.details-card dl div {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.details-card dt {
  color: #9eafbe;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.details-card dd {
  margin: 2px 0 0;
  font-size: 0.86rem;
  font-weight: 700;
}

.data-footer {
  margin-top: auto;
  padding-top: 24px;
}

.download-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 13px;
  border: 1px solid #c8d3da;
  border-radius: 10px;
  background: var(--white);
  color: var(--navy);
  text-decoration: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.download-link:hover {
  border-color: #8fa4b2;
  box-shadow: 0 6px 18px rgba(7, 25, 42, 0.08);
}

.download-link span {
  font-size: 0.86rem;
  font-weight: 800;
}

.download-link small {
  color: var(--muted);
  font-size: 0.7rem;
  white-space: nowrap;
}

.data-footer p {
  margin: 10px 2px 0;
  color: #697783;
  font-size: 0.7rem;
  line-height: 1.45;
}

.data-footer p a {
  color: #365f7b;
}

.map-panel {
  position: relative;
  min-width: 0;
  background: #dce6e8;
}

#map {
  width: 100%;
  height: 100%;
  background: #dce6e8;
}

#map.is-elevation-mode,
#map.is-elevation-mode * {
  cursor: crosshair !important;
}

#map .leaflet-interactive {
  cursor: pointer;
}

#map .leaflet-surge-pane,
#map .leaflet-surge-pane *,
#map .leaflet-track-cone-pane,
#map .leaflet-track-cone-pane *,
#map .leaflet-track-pane,
#map .leaflet-track-pane *,
#map .leaflet-track-category-pane,
#map .leaflet-track-category-pane *,
#map .leaflet-arrival-pane,
#map .leaflet-arrival-pane * {
  pointer-events: none !important;
}

.leaflet-tooltip.arrival-contour-label {
  border: 1px solid #111827;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.94);
  color: #111827;
  box-shadow: 0 4px 12px rgba(7, 25, 42, 0.16);
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.leaflet-tooltip.arrival-contour-label::before {
  display: none;
}

.file-mode #map {
  background-color: #e9eef1;
  background-image:
    linear-gradient(rgba(11, 31, 51, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(11, 31, 51, 0.045) 1px, transparent 1px);
  background-size: 24px 24px;
}

.map-title-card,
.map-note,
.loading-card {
  position: absolute;
  z-index: 450;
  box-shadow: var(--shadow);
}

.map-title-card {
  top: 20px;
  left: 20px;
  display: flex;
  flex-direction: column;
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
}

.map-title-card span {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-title-card strong {
  color: var(--navy);
  font-size: 0.86rem;
}

.map-note {
  right: 18px;
  bottom: 24px;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(11, 31, 51, 0.91);
  color: #d8e6ef;
  font-size: 0.7rem;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.loading-card {
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 11px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.83rem;
  font-weight: 700;
  transform: translate(-50%, -50%);
  transition: opacity 180ms ease, visibility 180ms ease;
}

.loading-card.is-hidden {
  visibility: hidden;
  opacity: 0;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: var(--teal-light);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.leaflet-control-zoom {
  overflow: hidden;
  border: 0 !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 25px rgba(7, 25, 42, 0.16) !important;
}

.leaflet-control-zoom a {
  color: var(--navy) !important;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.86) !important;
  font-size: 10px !important;
}

.leaflet-tooltip.zone-tooltip {
  border: 0;
  border-radius: 7px;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 8px 20px rgba(7, 25, 42, 0.18);
  font-size: 0.75rem;
  font-weight: 750;
}

.leaflet-tooltip.route-tooltip,
.leaflet-tooltip.elevation-tooltip {
  border: 0;
  border-radius: 7px;
  background: #082f49;
  color: var(--white);
  box-shadow: 0 8px 20px rgba(7, 25, 42, 0.18);
  font-size: 0.75rem;
  font-weight: 750;
}

.leaflet-tooltip-top.route-tooltip::before,
.leaflet-tooltip-top.elevation-tooltip::before {
  border-top-color: #082f49;
}

.leaflet-tooltip-top.zone-tooltip::before {
  border-top-color: var(--navy);
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .app-shell {
    display: flex;
    min-height: 100dvh;
    height: auto;
    flex-direction: column;
  }

  .sidebar {
    order: 2;
    overflow: visible;
    padding: 22px 18px 26px;
    border-top: 1px solid var(--line);
    border-right: 0;
    box-shadow: none;
  }

  .map-panel {
    order: 1;
    height: 58dvh;
    min-height: 430px;
  }

  .legend-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .data-footer {
    margin-top: 0;
  }
}

@media (max-width: 440px) {
  .map-panel {
    min-height: 390px;
  }

  .map-title-card {
    top: 12px;
    left: 12px;
  }

  .map-note {
    right: 10px;
    bottom: 22px;
    left: 10px;
    text-align: center;
  }

  .legend-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==========================================================================
   Offline Readiness Badge
   ========================================================================== */
.offline-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: #e6f9f5;
  color: #0d9488;
  margin-left: auto;
}

.offline-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.offline-badge.offline-mode {
  background: #fef3c7;
  color: #b45309;
}

/* ==========================================================================
   Address Geocoding Search
   ========================================================================== */
.search-block {
  margin-top: 14px;
  margin-bottom: 12px;
}

.search-block label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.search-wrap {
  position: relative;
  display: flex;
  gap: 6px;
}

.search-wrap input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.9rem;
}

.search-wrap input[type="search"]:focus {
  outline: 2px solid var(--teal);
  outline-offset: 1px;
}

.search-wrap button {
  padding: 8px 14px;
  border: none;
  border-radius: 8px;
  background: var(--navy);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-wrap button:hover {
  background: var(--navy-soft);
}

.search-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 1000;
  margin-top: 4px;
  max-height: 220px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.search-result-item {
  display: block;
  width: 100%;
  padding: 9px 12px;
  text-align: left;
  border: none;
  background: none;
  color: var(--ink);
  font-size: 0.85rem;
  line-height: 1.35;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
}

.search-result-item:hover,
.search-result-item:focus {
  background: #f0fdf4;
  color: #0f766e;
}

/* ==========================================================================
   Layer Toggles & Storm Selector
   ========================================================================== */
.shelter-symbol,
.bridge-symbol,
.tide-symbol {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 0.9rem;
  background: #e2e8f0;
}

.storm-selector-block {
  margin: 10px 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f1f5f9;
  border: 1px solid var(--line);
}

.storm-selector-block label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--navy-soft);
  margin-bottom: 4px;
}

.storm-selector-block select {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

/* ==========================================================================
   Action Buttons
   ========================================================================== */
.plan-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  margin-top: 10px;
  padding: 10px 14px;
  border: 1px solid #0f766e;
  border-radius: 8px;
  background: #0f766e;
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.plan-button:hover {
  background: #115e59;
}

.plan-icon {
  font-size: 1.1rem;
}

/* ==========================================================================
   Detail Card Additions
   ========================================================================== */
.nearest-shelter {
  margin: 10px 0 6px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f0fdfa;
  border-left: 4px solid var(--teal);
  font-size: 0.85rem;
  color: #115e59;
  line-height: 1.4;
}

.bridge-warning {
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fffbeb;
  border-left: 4px solid #f59e0b;
  font-size: 0.85rem;
  color: #92400e;
  line-height: 1.4;
}

/* ==========================================================================
   Custom Leaflet Map Markers
   ========================================================================== */
.custom-shelter-icon {
  background: none;
  border: none;
}

.shelter-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0d9488;
  color: #ffffff;
  font-size: 14px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.shelter-pin-standby {
  background: #d97706;
}

.bridge-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dc2626;
  color: #ffffff;
  font-size: 14px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.tide-pin {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  font-size: 14px;
  border: 2px solid #ffffff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

.search-pin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e11d48;
  border: 3px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(225, 29, 72, 0.4);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0.6); }
  70% { box-shadow: 0 0 0 12px rgba(225, 29, 72, 0); }
  100% { box-shadow: 0 0 0 0 rgba(225, 29, 72, 0); }
}

/* ==========================================================================
   Plan Modal Dialog
   ========================================================================== */
.plan-modal {
  border: none;
  border-radius: 12px;
  padding: 0;
  max-width: 680px;
  width: 90vw;
  max-height: 85vh;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
  background: var(--white);
  color: var(--ink);
}

.plan-modal::backdrop {
  background: rgba(11, 31, 51, 0.7);
  backdrop-filter: blur(2px);
}

.plan-content {
  padding: 24px 28px;
  overflow-y: auto;
  max-height: 85vh;
}

.plan-header {
  border-bottom: 2px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 18px;
}

.plan-header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.plan-badge {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #dc2626;
  text-transform: uppercase;
}

.plan-close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
  padding: 0 4px;
}

.plan-header h2 {
  margin: 4px 0 2px;
  font-size: 1.35rem;
  color: var(--navy);
}

.plan-timestamp {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.plan-section {
  margin-bottom: 18px;
}

.plan-section h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.plan-status-section {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 14px;
}

.plan-status-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.plan-status-header h3 {
  margin: 0;
  border: none;
  padding: 0;
  font-size: 1.05rem;
  color: #991b1b;
}

.plan-status-pill {
  padding: 3px 10px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
}

.plan-deadline-box {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #fff;
  border-left: 4px solid #dc2626;
  font-size: 0.85rem;
  color: #7f1d1d;
  line-height: 1.4;
}

.plan-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.88rem;
  line-height: 1.5;
}

.plan-shelters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.plan-shelter-card {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.85rem;
}

.plan-shelter-card strong {
  display: block;
  color: var(--navy);
  margin-bottom: 3px;
}

.plan-shelter-card p {
  margin: 2px 0;
  color: var(--muted);
}

.plan-contacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  font-size: 0.85rem;
}

.contact-item a {
  color: #0f766e;
  font-weight: 600;
  text-decoration: none;
}

.plan-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
  font-size: 0.85rem;
}

.plan-checklist-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.plan-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.secondary-button {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   Print Stylesheet
   ========================================================================== */
@media print {
  body {
    overflow: visible !important;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .app-shell {
    display: none !important;
  }

  .plan-modal {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    max-height: none !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .plan-content {
    overflow: visible !important;
    padding: 0 !important;
    max-height: none !important;
  }

  .plan-actions,
  .plan-close-btn {
    display: none !important;
  }

  .plan-status-section {
    border: 2px solid #000000 !important;
    background: #f8fafc !important;
  }
}

/* ==========================================================================
   Dark Mode Component & Cartographic Styles
   ========================================================================== */
:root[data-theme="dark"] .leaflet-tile-pane,
body.dark-mode .leaflet-tile-pane {
  filter: invert(100%) hue-rotate(180deg) brightness(95%) contrast(90%);
}

:root[data-theme="dark"] .map-panel,
:root[data-theme="dark"] #map,
body.dark-mode .map-panel,
body.dark-mode #map {
  background: #090e17;
}

:root[data-theme="dark"] .file-mode #map,
body.dark-mode .file-mode #map {
  background-color: #0b1320;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

:root[data-theme="dark"] .leaflet-control-zoom,
body.dark-mode .leaflet-control-zoom {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4) !important;
}

:root[data-theme="dark"] .leaflet-control-zoom a,
body.dark-mode .leaflet-control-zoom a {
  background: var(--white) !important;
  color: var(--ink) !important;
  border-bottom: 1px solid var(--line) !important;
}

:root[data-theme="dark"] .leaflet-control-zoom a:hover,
body.dark-mode .leaflet-control-zoom a:hover {
  background: #1e324d !important;
  color: #ffffff !important;
}

:root[data-theme="dark"] .leaflet-control-attribution,
body.dark-mode .leaflet-control-attribution {
  background: rgba(11, 19, 32, 0.88) !important;
  color: #94a3b8 !important;
}

:root[data-theme="dark"] .leaflet-control-attribution a,
body.dark-mode .leaflet-control-attribution a {
  color: #38bdf8 !important;
}

:root[data-theme="dark"] .map-title-card,
body.dark-mode .map-title-card {
  background: rgba(19, 36, 55, 0.92);
  border-color: rgba(51, 65, 85, 0.7);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .map-title-card span,
body.dark-mode .map-title-card span {
  color: var(--muted);
}

:root[data-theme="dark"] .map-title-card strong,
body.dark-mode .map-title-card strong {
  color: #f8fafc;
}

:root[data-theme="dark"] .map-note,
body.dark-mode .map-note {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid #334155;
  color: #cbd5e1;
}

:root[data-theme="dark"] .loading-card,
body.dark-mode .loading-card {
  background: #172437;
  border: 1px solid #334155;
  color: #f8fafc;
}

:root[data-theme="dark"] .sidebar,
body.dark-mode .sidebar {
  border-right-color: rgba(255, 255, 255, 0.08);
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.35);
}

:root[data-theme="dark"] .county-mark,
body.dark-mode .county-mark {
  background: #172437;
  color: var(--teal-light);
  border: 1px solid #334155;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

:root[data-theme="dark"] .lang-toggle-button,
body.dark-mode .lang-toggle-button {
  background: var(--white);
  border-color: var(--line);
  color: var(--muted);
}

:root[data-theme="dark"] .lang-toggle-button:hover,
body.dark-mode .lang-toggle-button:hover {
  border-color: var(--teal);
  color: #f1f5f9;
}

:root[data-theme="dark"] .lang-opt.is-active,
body.dark-mode .lang-opt.is-active {
  color: #f8fafc;
}

:root[data-theme="dark"] .theme-toggle-button,
body.dark-mode .theme-toggle-button {
  background: var(--white);
  border-color: var(--line);
  color: var(--muted);
}

:root[data-theme="dark"] .theme-toggle-button:hover,
body.dark-mode .theme-toggle-button:hover {
  border-color: var(--teal);
  color: #fbbf24;
}

:root[data-theme="dark"] .snapshot-row,
body.dark-mode .snapshot-row {
  background: #062b28;
  border-color: #0f514b;
  color: #a7f3d0;
}

:root[data-theme="dark"] .snapshot-row time,
body.dark-mode .snapshot-row time {
  color: #6ee7b7;
}

:root[data-theme="dark"] .offline-badge,
body.dark-mode .offline-badge {
  background: #0f3d38;
  color: #2dd4bf;
}

:root[data-theme="dark"] .offline-badge.offline-mode,
body.dark-mode .offline-badge.offline-mode {
  background: #451a03;
  color: #fde68a;
}

:root[data-theme="dark"] .evacuation-alerts,
body.dark-mode .evacuation-alerts {
  background: var(--white);
  border-color: var(--line);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25);
}

:root[data-theme="dark"] .alerts-kicker,
body.dark-mode .alerts-kicker {
  color: #94a3b8;
}

:root[data-theme="dark"] .evacuation-alerts-heading > span,
body.dark-mode .evacuation-alerts-heading > span {
  color: #94a3b8;
}

:root[data-theme="dark"] .evacuation-notice-mandatory,
body.dark-mode .evacuation-notice-mandatory {
  background: #2a1215;
  border-color: #6b2128;
  border-left-color: #ef4444;
}

:root[data-theme="dark"] .evacuation-notice-mandatory .evacuation-notice-level,
body.dark-mode .evacuation-notice-mandatory .evacuation-notice-level {
  color: #fca5a5;
}

:root[data-theme="dark"] .evacuation-notice-voluntary,
body.dark-mode .evacuation-notice-voluntary {
  background: #2b1c09;
  border-color: #71460c;
  border-left-color: #f59e0b;
}

:root[data-theme="dark"] .evacuation-notice-voluntary .evacuation-notice-level,
body.dark-mode .evacuation-notice-voluntary .evacuation-notice-level {
  color: #fde68a;
}

:root[data-theme="dark"] .evacuation-notice-verification-official,
body.dark-mode .evacuation-notice-verification-official {
  background: #064e3b;
  color: #a7f3d0;
}

:root[data-theme="dark"] .evacuation-notice-verification-reported,
body.dark-mode .evacuation-notice-verification-reported {
  background: #451a03;
  color: #fde68a;
}

:root[data-theme="dark"] .evacuation-notice h3,
:root[data-theme="dark"] .evacuation-notice-headline,
body.dark-mode .evacuation-notice h3,
body.dark-mode .evacuation-notice-headline {
  color: #f8fafc;
}

:root[data-theme="dark"] .evacuation-notice time,
:root[data-theme="dark"] .evacuation-notice-details,
body.dark-mode .evacuation-notice time,
body.dark-mode .evacuation-notice-details {
  color: #cbd5e1;
}

:root[data-theme="dark"] .evacuation-notice-sources a,
body.dark-mode .evacuation-notice-sources a {
  color: #38bdf8;
}

:root[data-theme="dark"] .evacuation-notice-sources small,
body.dark-mode .evacuation-notice-sources small {
  color: #94a3b8;
}

:root[data-theme="dark"] .evacuation-alerts-footnote,
body.dark-mode .evacuation-alerts-footnote {
  color: #94a3b8;
}

:root[data-theme="dark"] label,
body.dark-mode label {
  color: #cbd5e1;
}

:root[data-theme="dark"] select,
:root[data-theme="dark"] input[type="search"],
body.dark-mode select,
body.dark-mode input[type="search"] {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .select-wrap::after,
body.dark-mode .select-wrap::after {
  color: var(--muted);
}

:root[data-theme="dark"] .primary-button,
body.dark-mode .primary-button {
  background: #0d9488;
  color: #ffffff;
}

:root[data-theme="dark"] .primary-button:hover,
body.dark-mode .primary-button:hover {
  background: #14b8a6;
}

:root[data-theme="dark"] .crosshair,
body.dark-mode .crosshair {
  box-shadow: inset 0 0 0 3px #0d9488;
}

:root[data-theme="dark"] .icon-button,
body.dark-mode .icon-button {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .icon-button:hover,
body.dark-mode .icon-button:hover {
  border-color: var(--teal);
  color: var(--teal-light);
}

:root[data-theme="dark"] .layer-toggle,
body.dark-mode .layer-toggle {
  background: var(--white);
  border-color: var(--line);
}

:root[data-theme="dark"] .storm-selector-block,
body.dark-mode .storm-selector-block {
  background: #111e30;
  border-color: var(--line);
}

:root[data-theme="dark"] .storm-selector-block label,
body.dark-mode .storm-selector-block label {
  color: #cbd5e1;
}

:root[data-theme="dark"] .shelter-symbol,
:root[data-theme="dark"] .bridge-symbol,
:root[data-theme="dark"] .tide-symbol,
body.dark-mode .shelter-symbol,
body.dark-mode .bridge-symbol,
body.dark-mode .tide-symbol {
  background: #1e293b;
  color: var(--ink);
}

:root[data-theme="dark"] .search-results,
body.dark-mode .search-results {
  background: var(--white);
  border-color: var(--line);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
}

:root[data-theme="dark"] .search-result-item,
body.dark-mode .search-result-item {
  color: var(--ink);
  border-bottom-color: var(--line);
}

:root[data-theme="dark"] .search-result-item:hover,
:root[data-theme="dark"] .search-result-item:focus,
body.dark-mode .search-result-item:hover,
body.dark-mode .search-result-item:focus {
  background: #1e3a5f;
  color: #5eead4;
}

:root[data-theme="dark"] .track-view-button,
body.dark-mode .track-view-button {
  color: #38bdf8;
}

:root[data-theme="dark"] .surge-legend span,
:root[data-theme="dark"] .surge-note,
:root[data-theme="dark"] .track-note,
:root[data-theme="dark"] .track-category-key,
:root[data-theme="dark"] .arrival-note,
body.dark-mode .surge-legend span,
body.dark-mode .surge-note,
body.dark-mode .track-note,
body.dark-mode .track-category-key,
body.dark-mode .arrival-note {
  color: var(--muted);
}

:root[data-theme="dark"] .elevation-card,
body.dark-mode .elevation-card {
  background: #082429;
  border-color: #134e4a;
}

:root[data-theme="dark"] .elevation-button,
body.dark-mode .elevation-button {
  background: var(--white);
  border-color: #2e4d58;
  color: var(--ink);
}

:root[data-theme="dark"] .elevation-button:hover,
body.dark-mode .elevation-button:hover {
  border-color: var(--teal);
}

:root[data-theme="dark"] .elevation-button.is-active,
body.dark-mode .elevation-button.is-active {
  background: var(--teal);
  color: #0b1320;
  border-color: var(--teal);
}

:root[data-theme="dark"] .elevation-card dl div,
body.dark-mode .elevation-card dl div {
  border-top-color: #134e4a;
}

:root[data-theme="dark"] .elevation-card dd,
body.dark-mode .elevation-card dd {
  color: #f1f5f9;
}

:root[data-theme="dark"] .legend-item,
body.dark-mode .legend-item {
  background: var(--white);
  color: var(--ink);
  border-color: var(--line);
}

:root[data-theme="dark"] .details-card,
body.dark-mode .details-card {
  background: #14243b;
  border: 1px solid #293d56;
  box-shadow: 0 14px 35px rgba(0, 0, 0, 0.4);
}

:root[data-theme="dark"] .nearest-shelter,
body.dark-mode .nearest-shelter {
  background: #042f2e;
  color: #99f6e4;
}

:root[data-theme="dark"] .bridge-warning,
body.dark-mode .bridge-warning {
  background: #2b1c09;
  color: #fde68a;
}

:root[data-theme="dark"] .download-link,
body.dark-mode .download-link {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .download-link:hover,
body.dark-mode .download-link:hover {
  border-color: var(--teal);
}

:root[data-theme="dark"] .download-link span,
body.dark-mode .download-link span {
  color: #f8fafc;
}

:root[data-theme="dark"] .data-footer p,
body.dark-mode .data-footer p {
  color: var(--muted);
}

:root[data-theme="dark"] .data-footer p a,
body.dark-mode .data-footer p a {
  color: #38bdf8;
}

:root[data-theme="dark"] .plan-modal,
body.dark-mode .plan-modal {
  background: #0f172a;
  color: #f1f5f9;
}

:root[data-theme="dark"] .plan-modal h2,
:root[data-theme="dark"] .plan-section h3,
body.dark-mode .plan-modal h2,
body.dark-mode .plan-section h3 {
  color: #f1f5f9;
}

:root[data-theme="dark"] .plan-header,
:root[data-theme="dark"] .plan-section h3,
:root[data-theme="dark"] .plan-actions,
body.dark-mode .plan-header,
body.dark-mode .plan-section h3,
body.dark-mode .plan-actions {
  border-color: var(--line);
}

:root[data-theme="dark"] .plan-status-section,
body.dark-mode .plan-status-section {
  background: #2a1215;
  border-color: #6b2128;
}

:root[data-theme="dark"] .plan-status-header h3,
body.dark-mode .plan-status-header h3 {
  color: #fca5a5;
}

:root[data-theme="dark"] .plan-deadline-box,
body.dark-mode .plan-deadline-box {
  background: #170d0f;
  border-left-color: #ef4444;
  color: #fca5a5;
}

:root[data-theme="dark"] .plan-shelter-card,
body.dark-mode .plan-shelter-card {
  background: #1e293b;
  border-color: var(--line);
}

:root[data-theme="dark"] .plan-shelter-card strong,
body.dark-mode .plan-shelter-card strong {
  color: #f8fafc;
}

:root[data-theme="dark"] .plan-shelter-card p,
body.dark-mode .plan-shelter-card p {
  color: var(--muted);
}

:root[data-theme="dark"] .secondary-button,
body.dark-mode .secondary-button {
  background: #1e293b;
  border-color: var(--line);
  color: var(--ink);
}

:root[data-theme="dark"] .secondary-button:hover,
body.dark-mode .secondary-button:hover {
  background: #2b3a4f;
}


