:root {
  color-scheme: dark;
  --bg: #071014;
  --surface: #121c21;
  --surface-muted: #0c171c;
  --ink: #e7f0ee;
  --muted: #95aaa7;
  --line: #263940;
  --teal: #35c4b5;
  --teal-dark: #168b82;
  --warning: #f2a72e;
  --danger: #ff655d;
  --violet: #b08cff;
  --blue: #59aee8;
  --green: #62d184;
  --shadow: 0 20px 48px rgba(0, 0, 0, 0.36);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #0a151a 0%, var(--bg) 42%, #050b0e 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1440px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
  gap: 18px;
  align-items: end;
  padding: 4px 0 16px;
}

.brand-block h1,
.storm-header h2,
.panel-title h3 {
  margin: 0;
}

.brand-block {
  display: flex;
  min-width: 0;
  gap: 14px;
  align-items: center;
}

.brand-logo {
  width: 78px;
  height: 78px;
  flex: 0 0 auto;
  border: 1px solid rgba(119, 174, 182, 0.24);
  border-radius: 16px;
  background: #071014;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.28),
    0 0 0 4px rgba(53, 196, 181, 0.04);
  object-fit: cover;
}

.brand-copy {
  min-width: 0;
}

.home-link {
  flex: 0 0 auto;
  display: inline-flex;
  border-radius: 16px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.home-link:hover,
.home-link:focus-visible {
  transform: translateY(-2px);
  outline: none;
}

.home-logo {
  width: 78px;
  height: 78px;
  display: block;
  border: 1px solid rgba(119, 174, 182, 0.24);
  border-radius: 16px;
  background: #071014;
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.28),
    0 0 0 4px rgba(53, 196, 181, 0.04);
  object-fit: cover;
}

.home-link:hover .home-logo,
.home-link:focus-visible .home-logo {
  border-color: rgba(53, 196, 181, 0.55);
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.34),
    0 0 0 4px rgba(53, 196, 181, 0.12);
}

.brand-block h1 {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 780;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 780;
  text-transform: uppercase;
}

.active-storms {
  display: grid;
  gap: 8px;
  justify-self: end;
  width: 100%;
  max-width: 520px;
}

.active-storms > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.storm-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.storm-tab {
  display: grid;
  gap: 4px;
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e181d;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
}

.storm-tab:hover,
.storm-tab.active {
  border-color: rgba(53, 196, 181, 0.65);
  background: #12252a;
}

.storm-tab.active {
  box-shadow: 0 0 0 3px rgba(53, 196, 181, 0.11);
}

.storm-tab strong {
  font-size: 14px;
  line-height: 1.15;
}

.storm-tab span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.storm-empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e181d;
  color: var(--muted);
  padding: 12px;
  font-size: 13px;
  font-weight: 720;
}

.primary-action,
.secondary-action,
.segment {
  border: 1px solid transparent;
  border-radius: 6px;
  font-weight: 760;
}

.primary-action {
  background: var(--teal-dark);
  color: #eafffb;
  padding: 11px 15px;
}

.primary-action:hover {
  background: #20a79b;
}

.primary-action:disabled {
  cursor: not-allowed;
  background: #304349;
  color: #8fa19f;
}

.secondary-action {
  background: #0b151a;
  border-color: var(--line);
  color: var(--ink);
  padding: 11px 15px;
}

.secondary-action:hover {
  border-color: #44606a;
}

.status-strip {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  min-height: 46px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
}

.status-strip > div:first-child {
  display: flex;
  min-width: 0;
  gap: 9px;
  align-items: center;
  font-weight: 760;
}

.status-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #607472;
}

.status-dot.active {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 101, 93, 0.16);
}

.status-dot.clear {
  background: var(--green);
}

.status-meta {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  gap: 16px;
  align-items: stretch;
}

.map-panel,
.side-panel {
  min-height: calc(100vh - 130px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.map-panel {
  display: grid;
  grid-template-rows: auto minmax(420px, 1fr);
  overflow: hidden;
}

.map-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 12px;
  background: var(--surface-muted);
}

.ad-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(22, 139, 130, 0.12), transparent 42%),
    #0a1419;
  padding: 10px 12px;
}

.page-ad-slot {
  margin: 0 0 14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.bottom-ad-slot {
  margin: 16px 0 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.ad-frame {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  width: min(728px, 100%);
  min-height: 74px;
  margin: 0 auto;
  border: 1px dashed rgba(149, 170, 167, 0.42);
  border-radius: 8px;
  background: rgba(7, 16, 20, 0.78);
  color: var(--muted);
  padding: 12px 16px;
}

.ad-frame strong {
  min-width: 0;
  color: var(--ink);
  font-size: 16px;
  text-align: center;
}

.ad-frame span {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(90px, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}

.segment {
  min-height: 36px;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
}

.segment + .segment {
  border-left: 1px solid var(--line);
}

.segment.active {
  background: #163d45;
  color: #eafffb;
}

.layer-toggles {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.layer-toggles input {
  accent-color: var(--teal);
}

.layer-toggles label {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  min-height: 28px;
}

.map-stage {
  position: relative;
  min-height: 0;
  background: #061620;
}

.leaflet-map {
  width: 100%;
  height: 100%;
  min-height: 520px;
  background: #061620;
}

.leaflet-container {
  background: #061620;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

.leaflet-tile-pane {
  filter: brightness(0.54) contrast(1.14) saturate(0.72) hue-rotate(158deg);
}

.leaflet-control-zoom a {
  background: #111d22;
  border-color: #263940;
  color: var(--ink);
}

.leaflet-control-zoom a:hover {
  background: #18282f;
  color: #ffffff;
}

.leaflet-control-attribution {
  background: rgba(9, 18, 22, 0.82);
  color: #a9bdbc;
}

.leaflet-control-attribution a {
  color: #91d8d1;
}

.map-fallback {
  position: absolute;
  inset: 14px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b151a;
  color: var(--muted);
  padding: 20px;
  text-align: center;
}

.storm-map-legend {
  display: grid;
  gap: 7px;
  min-width: 180px;
  border: 1px solid rgba(119, 174, 182, 0.22);
  border-radius: 8px;
  background: rgba(12, 23, 28, 0.86);
  color: #dcebe7;
  padding: 10px 11px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.storm-map-legend strong {
  font-size: 12px;
}

.legend-row {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: #b6c9c7;
  font-size: 11px;
  font-weight: 720;
}

.legend-swatch {
  height: 0;
  border-top: 3px solid var(--swatch);
  border-radius: 999px;
}

.legend-swatch.cone {
  height: 12px;
  border: 2px dashed var(--warning);
  background: rgba(242, 167, 46, 0.2);
}

.storm-marker-icon {
  display: grid;
  place-items: center;
}

.storm-marker-core {
  width: 18px;
  height: 18px;
  border: 3px solid #101a1f;
  border-radius: 50%;
  background: var(--danger);
  box-shadow:
    0 0 0 8px rgba(255, 101, 93, 0.18),
    0 0 18px rgba(255, 101, 93, 0.6);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 17px;
  overflow: auto;
  padding: 18px;
}

.storm-header h2 {
  font-size: 24px;
  line-height: 1.15;
}

.storm-header p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 12px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.1;
}

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

.panel-title h3 {
  font-size: 15px;
}

.panel-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.timeline-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e181d;
  padding: 10px 11px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.timeline-index {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(53, 196, 181, 0.12);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.timeline-main strong {
  display: block;
  font-size: 14px;
}

.timeline-main span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.timeline-wind {
  color: var(--danger);
  font-size: 13px;
  font-weight: 820;
}

.attribution {
  margin: auto 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.safety-disclaimer {
  margin: 16px 0 0;
  border: 1px solid rgba(242, 167, 46, 0.26);
  border-radius: 8px;
  background: #1b1510;
  color: #d9b782;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.45;
}

.beach-ops-about {
  margin: 20px 0 0;
  padding: 18px 18px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-muted);
}

.beach-ops-about h2 {
  margin: 0 0 8px;
  font-size: 18px;
  color: var(--ink);
}

.beach-ops-about > p {
  margin: 0 0 16px;
  max-width: 70ch;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted);
}

.beach-ops-about .about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.beach-ops-about .about-grid article {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.beach-ops-about .about-grid h3 {
  margin: 0 0 6px;
  font-size: 13.5px;
  color: var(--teal);
}

.beach-ops-about .about-grid p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--muted);
}

.site-footer {
  margin: 18px 0 0;
  padding: 12px 14px 18px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.site-footer .footer-disclaimer {
  margin: 0 auto;
  max-width: 80ch;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

.site-footer .footer-ads {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--ink);
}

.site-footer .footer-ads a {
  color: var(--teal);
  text-decoration: none;
}

.site-footer .footer-ads a:hover {
  text-decoration: underline;
}

.land {
  fill: url(#landGradient);
  stroke: #70815f;
  stroke-width: 1.8;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.32));
}

.coastline {
  fill: none;
  stroke: rgba(164, 224, 220, 0.46);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.state-line {
  fill: none;
  stroke: rgba(176, 196, 150, 0.28);
  stroke-width: 1.2;
  stroke-dasharray: 6 5;
}

.shelf-band {
  fill: rgba(109, 188, 190, 0.1);
  stroke: rgba(141, 218, 216, 0.18);
  stroke-width: 1.4;
}

.deep-band {
  fill: rgba(11, 45, 74, 0.36);
  stroke: rgba(73, 142, 178, 0.2);
  stroke-width: 1.2;
}

.graticule {
  fill: none;
  stroke: rgba(157, 213, 217, 0.18);
  stroke-width: 1;
}

.graticule-label {
  fill: rgba(167, 218, 217, 0.62);
  font-size: 10px;
  font-weight: 760;
}

.city-dot {
  fill: #e7f0ee;
  stroke: #061620;
  stroke-width: 2;
}

.water-label,
.map-label {
  fill: rgba(209, 225, 219, 0.78);
  font-size: 13px;
  font-weight: 740;
}

.country-label {
  fill: rgba(232, 241, 238, 0.16);
  font-size: 32px;
  font-weight: 860;
  letter-spacing: 0;
}

.water-label {
  fill: rgba(179, 223, 221, 0.62);
  font-size: 17px;
  letter-spacing: 0;
  text-shadow: 0 1px 1px rgba(11, 50, 73, 0.2);
}

.cone-shape {
  fill: rgba(242, 167, 46, 0.18);
  stroke: rgba(255, 101, 93, 0.76);
  stroke-width: 2.4;
  stroke-dasharray: 10 7;
}

.wind-radius {
  fill: none;
  stroke: rgba(53, 196, 181, 0.42);
  stroke-width: 1.8;
  stroke-dasharray: 7 5;
}

.wind-radius.hurricane {
  fill: none;
  stroke: rgba(255, 101, 93, 0.58);
  stroke-width: 2.2;
}

.official-line {
  fill: none;
  stroke: var(--danger);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 2px rgba(85, 20, 20, 0.18));
}

.official-point {
  fill: #101a1f;
  stroke: var(--danger);
  stroke-width: 3;
}

.ecmwf-line {
  fill: none;
  stroke: var(--member-color, var(--violet));
  stroke-width: 2.35;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.76;
}

.warning-poly {
  fill: rgba(242, 167, 46, 0.18);
  stroke: var(--warning);
  stroke-width: 3;
}

.warning-poly.tornado {
  fill: rgba(255, 101, 93, 0.16);
  stroke: var(--danger);
}

.storm-marker {
  fill: var(--danger);
  stroke: #101a1f;
  stroke-width: 4;
  filter: url(#markerShadow);
}

.marker-ring {
  fill: none;
  stroke: rgba(201, 59, 51, 0.45);
  stroke-width: 3;
}

.track-label {
  fill: #ecf5f2;
  font-size: 12px;
  font-weight: 800;
  paint-order: stroke;
  stroke: rgba(6, 18, 24, 0.82);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.map-legend {
  fill: rgba(12, 23, 28, 0.82);
  stroke: rgba(119, 174, 182, 0.22);
  stroke-width: 1;
}

.legend-text {
  fill: #dcebe7;
  font-size: 11px;
  font-weight: 760;
}

.legend-line {
  fill: none;
  stroke-linecap: round;
  stroke-width: 3;
}

.hidden-layer {
  display: none;
}

@media (max-width: 980px) {
  .topbar,
  .workspace {
    grid-template-columns: 1fr;
  }

  .active-storms {
    justify-self: stretch;
    max-width: none;
  }

  .map-panel,
  .side-panel {
    min-height: auto;
  }

  .map-toolbar,
  .status-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .status-meta {
    text-align: left;
  }

  .layer-toggles {
    justify-content: flex-start;
  }

  .leaflet-map {
    min-height: 440px;
  }
}

@media (max-width: 620px) {
  .app-shell {
    padding: 12px;
  }

  .brand-block h1 {
    font-size: 23px;
  }

  .brand-block {
    gap: 10px;
  }

  .brand-logo {
    width: 58px;
    height: 58px;
    border-radius: 12px;
  }

  .home-logo {
    width: 58px;
    height: 58px;
    border-radius: 12px;
  }

  .metrics-grid,
  .storm-tabs {
    grid-template-columns: 1fr;
  }

  .map-toolbar {
    padding: 10px;
  }

  .ad-frame {
    grid-template-columns: 1fr;
    gap: 4px;
    min-height: 82px;
    text-align: center;
  }

  .segmented {
    width: 100%;
  }

  .leaflet-map {
    min-height: 360px;
  }

  .timeline-list li {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .timeline-wind {
    grid-column: 2;
  }
}
