@font-face {
  font-family: Inter;
  src: url("/vendor/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #090e14;
  --bg-2: #121a24;
  --card: #141c28;
  --card-2: #1b2636;
  --line: #314258;
  --text: #eef4fb;
  --muted: #9aafc4;
  --faint: #7d91a8;
  --steel: #8ec8ff;
  --brass: #e4c07a;
  --focus: #f2d7a2;
  --danger: #ff6b78;
  --ok: #7dE7b8;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.22);
  --radius: 14px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(900px 320px at 0% -10%, rgba(226, 91, 102, 0.18), transparent 55%),
    radial-gradient(800px 280px at 100% 0%, rgba(142, 200, 255, 0.16), transparent 50%),
    linear-gradient(180deg, #101826 0%, var(--bg) 280px);
  color: var(--text);
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 16.5px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; }
a { color: var(--steel); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #d5e6f5; }
button, summary, a, input { font: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; }
.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: #fff;
  color: #111;
  padding: 8px 12px;
  z-index: 5;
}
.skip:focus { top: 12px; }

.wrap { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }
.narrow { width: min(640px, calc(100% - 32px)); padding: 32px 0 64px; }

.mast {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(180deg, rgba(16, 24, 38, 0.96), rgba(9, 14, 20, 0.92));
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, #e25b66, #e4c07a, #8ec8ff) 1;
  backdrop-filter: blur(14px);
}
.mast-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 10px 0;
}
.brand { display: flex; gap: 12px; align-items: center; color: inherit; text-decoration: none; }
.logo-mark { display: block; filter: drop-shadow(0 0 10px rgba(142, 200, 255, 0.35)); }
.brand-name {
  display: block;
  font-weight: 720;
  letter-spacing: -0.04em;
  font-size: 1.35rem;
  line-height: 1.05;
  background: linear-gradient(90deg, #fff 20%, #f2d7a2 55%, #8ec8ff);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-sub { display: block; color: var(--muted); font-size: 0.84rem; margin-top: 2px; }
.mast-meta { text-align: right; color: var(--muted); font-size: 0.86rem; }
.mast-live { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.mast-meta strong { color: var(--text); font-weight: 650; font-variant-numeric: tabular-nums; font-size: 1.15rem; }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #2f8f68;
  background: rgba(15, 92, 64, 0.45);
  color: #d9ffe9;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  font-weight: 720;
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #7de7b8;
  box-shadow: 0 0 0 0 rgba(125, 231, 184, 0.7);
  animation: live-pulse 1.8s ease-out infinite;
}
.live-badge[data-state="storm"] {
  border-color: #ff8a6a;
  background: rgba(141, 30, 44, 0.55);
  color: #ffe4e2;
}
.live-badge[data-state="storm"] .live-dot { background: #ff6b57; box-shadow: 0 0 0 0 rgba(255, 107, 87, 0.7); }
.live-badge[data-state="checking"] { border-color: var(--line); color: var(--muted); background: transparent; }
.live-badge[data-state="checking"] .live-dot { background: var(--faint); animation: none; }

.layout-preview {
  background: #3d3420;
  color: #fff8e8;
  text-align: center;
  padding: 10px 16px;
  font-size: 0.92rem;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 0 28px;
}

.banner {
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  background: linear-gradient(135deg, #1b2636, #141c28);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.banner h2 {
  margin: 0 0 6px;
  font-size: clamp(1.45rem, 4.4vw, 2.05rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  font-weight: 650;
}
.banner p { margin: 0; max-width: 68ch; }
.banner[data-level="tor"],
.banner[data-level="tor-hit"] {
  background: linear-gradient(120deg, #b42333, #6e1420 70%);
  border-color: #ff8b96;
  color: #fff;
  animation: glow-red 2.2s ease-in-out infinite;
}
.banner[data-level="svr"],
.banner[data-level="svr-hit"] {
  background: linear-gradient(120deg, #c45a16, #6e2e0c 72%);
  border-color: #ffc089;
  color: #fff;
  animation: glow-orange 2.4s ease-in-out infinite;
}
.banner[data-level="tor-watch"] {
  background: linear-gradient(120deg, #a56a0a, #5c3a08);
  border-color: #f0c14a;
  color: #fff;
}
.banner[data-level="svr-watch"],
.banner[data-level="other-watch"] {
  background: linear-gradient(120deg, #4a3b1c, #2a2416);
  border-color: #e4c07a;
  color: #fff8e8;
}
.banner[data-level="winter-warn"],
.banner[data-level="winter"] {
  background: linear-gradient(120deg, #1d4e78, #102433);
  border-color: #8ec8ff;
  color: #f3f8fc;
}
.banner[data-level="other-warn"] {
  background: linear-gradient(120deg, #8a3d1c, #4a2010);
  border-color: #ffb089;
  color: #fff;
}
.banner[data-level="spc"] { background: linear-gradient(120deg, #24344a, #151d2b); }
.banner[data-level="clear"] {
  background: linear-gradient(120deg, #127a52, #0c3d2c);
  border-color: #7de7b8;
  color: #f3fff8;
}
.banner[data-level="unknown"] { background: linear-gradient(120deg, #243044, #151c28); }
@keyframes glow-red {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 120, 0.15); }
  50% { box-shadow: 0 0 28px 2px rgba(255, 107, 120, 0.38); }
}
@keyframes glow-orange {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 160, 80, 0.12); }
  50% { box-shadow: 0 0 26px 2px rgba(255, 160, 80, 0.34); }
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(125, 231, 184, 0.55); }
  70% { box-shadow: 0 0 0 8px rgba(125, 231, 184, 0); }
  100% { box-shadow: 0 0 0 0 rgba(125, 231, 184, 0); }
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  color: var(--muted);
  font-size: 0.92rem;
}
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--card);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 620;
}
body[data-mode="storm"] .pill { border-color: #a85858; color: #ffd0d4; }
body[data-mode="calm"] .pill { border-color: #2f6d56; color: var(--ok); }
.linkish {
  background: none;
  border: 0;
  color: var(--steel);
  padding: 8px 0;
  min-height: 44px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 42%), var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: card-in 0.45s ease both;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.card:nth-child(2) { animation-delay: 0.04s; }
.card:nth-child(3) { animation-delay: 0.08s; }
.card:nth-child(4) { animation-delay: 0.12s; }
@keyframes card-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (hover: hover) {
  .card:hover {
    border-color: #5b7594;
    transform: translateY(-2px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.28);
  }
}
.card > summary, .card-head {
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 14px 16px;
  cursor: pointer;
  min-height: 52px;
}
.card > summary::-webkit-details-marker { display: none; }
.card > summary h2, .card-head h2 {
  margin: 0;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  font-weight: 620;
}
.card .slot, .card .static { padding: 0 16px 16px; }
.src, .stamp { color: var(--faint); font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; }
.kicker { margin: 0 0 8px; color: var(--muted); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; }
.lede { margin-top: 0; }

.hero {
  border-left: 4px solid #e25b66;
  background: #2a151a;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.hero.svr { border-left-color: #e08a3c; background: #2a1c12; }
.hero h3 { margin: 0 0 6px; font-size: 1.25rem; letter-spacing: -0.02em; }
.meta { color: var(--muted); margin: 0 0 8px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tag {
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  font-size: 0.82rem;
}
.watch {
  border-left: 4px solid var(--brass);
  padding: 10px 12px;
  margin: 8px 0;
  background: #221c12;
  border-radius: 8px;
}
.row-list { display: flex; flex-direction: column; gap: 8px; }
.alert-row, .day-row, .gauge, .lake, .river, .cam {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.alert-row h3, .day-row h3, .lake h3, .cam h3, .river h3 { margin: 0 0 4px; font-size: 1rem; }
.estimate { color: #d7e4f2; }
.small { color: var(--muted); font-size: 0.9rem; }
.error { color: #ffb4b8; margin: 0; }
.fallback, .note {
  background: #101820;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--muted);
}
.note { color: var(--text); border-color: #3d536b; margin-top: 0; }
.ok-note { color: var(--ok); }

.gauges, .lakes, .cams, .hours, .outlook-grid, .days {
  display: grid;
  gap: 10px;
}
.gauges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cond-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 12px;
  padding: 16px 18px;
  border-radius: 14px;
  background:
    radial-gradient(120px 80px at 12% 20%, rgba(142, 200, 255, 0.22), transparent 70%),
    linear-gradient(135deg, #24344c, #152033);
  border: 1px solid #3d5674;
}
.cond-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #f2d7a2;
  background: rgba(8, 12, 18, 0.45);
  border: 1px solid #4a627c;
}
.cond-icon svg { width: 34px; height: 34px; }
.cond-temp {
  font-size: clamp(3.2rem, 10vw, 4.6rem);
  font-weight: 720;
  letter-spacing: -0.05em;
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
}
.cond-temp span { font-size: 0.42em; margin-left: 4px; color: var(--muted); font-weight: 560; }
.cond-sky { color: #d5e4f4; margin-top: 4px; }
.gauge-top { display: flex; align-items: center; gap: 6px; color: var(--steel); }
.gauge-top .src { color: var(--faint); }
.gauge .num {
  font-size: clamp(1.8rem, 7vw, 2.7rem);
  font-weight: 620;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  margin: 4px 0;
}
.gauge .unit { color: var(--muted); font-size: 0.85rem; }
.hours { grid-auto-flow: column; grid-auto-columns: minmax(148px, 1fr); overflow-x: auto; padding-bottom: 4px; }
.hour { min-width: 148px; }
.hour strong { font-variant-numeric: tabular-nums; font-size: 1.35rem; }
.days { grid-template-columns: 1fr; }
.outlook-grid { grid-template-columns: 1fr; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 8px;
  border-radius: 6px;
  font-weight: 650;
  letter-spacing: 0.02em;
}
.outlook-figure { margin: 8px 0 0; }
.outlook-figure img { width: 100%; border-radius: 8px; background: #0b1016; }
.outlook-figure figcaption { color: var(--muted); font-size: 0.82rem; margin-top: 4px; }
.afd {
  white-space: pre-wrap;
  font-family: Inter, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  line-height: 1.45;
  max-height: 360px;
  overflow: auto;
  background: #101820;
  border-radius: 8px;
  padding: 12px;
  margin: 0;
}
.map-frame { position: relative; }
#map {
  height: 340px;
  border-radius: 10px;
  background: #101820;
}
body[data-mode="storm"] #sec-map.map-hero {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  border-radius: 0;
  border-left: 0;
  border-right: 0;
}
body[data-mode="storm"] #map {
  height: 65vh;
  min-height: 420px;
  border-radius: 0;
}
.map-legend {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0;
  padding: 8px 10px;
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 500;
  background: rgba(9, 14, 20, 0.88);
  border: 1px solid #314258;
  border-radius: 10px;
  color: #eef4fb;
  font-size: 0.78rem;
}
.map-legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.swatch.tor { background: #c62833; }
.swatch.svr { background: #d86a1c; }
.swatch.watch { background: transparent; border: 2px dashed #e7c15a; height: 8px; }
.swatch.track { background: #ffc089; height: 3px; width: 18px; }
.swatch.ring { border: 2px dashed #d5e2ef; background: transparent; border-radius: 50%; width: 12px; height: 12px; }
.leaflet-div-icon.map-pill, .leaflet-div-icon.zone-label { background: transparent; border: 0; }
.map-pill span {
  display: inline-block;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(9, 14, 20, 0.78);
  color: #fff;
  border: 1px solid rgba(255, 192, 137, 0.7);
  font-size: 11px;
  line-height: 1.35;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.map-pill.tor span { border-color: rgba(255, 139, 150, 0.85); }
.map-pill.mini span { font-size: 10px; padding: 1px 6px; opacity: 0.85; }
.zone-label span {
  display: block;
  text-align: center;
  color: #7fd1c7;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  text-shadow: 0 1px 2px #000;
}
.map-edge { position: absolute; inset: 0; pointer-events: none; z-index: 450; }
.edge-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(9, 14, 20, 0.82);
  border: 1px solid #ffc089;
  color: #ffd9b8;
  font-size: 11px;
  font-weight: 600;
}
.map-zone-note {
  position: absolute;
  top: 10px;
  left: 56px;
  right: 10px;
  z-index: 520;
  width: fit-content;
  max-width: calc(100% - 66px);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(9, 14, 20, 0.88);
  border: 1px solid #7fd1c7;
  color: #c9f2ec;
  font-size: 12px;
  font-weight: 600;
}
.map-zone-note[hidden] { display: none; }
@media (max-width: 640px) { .map-zone-note { font-size: 11px; padding: 3px 8px; border-radius: 10px; } }
.map-recenter { display: flex !important; align-items: center; justify-content: center; color: #1b2733; }
.swatch.zone { border: 2px dashed #7fd1c7; background: transparent; height: 8px; }
.map-tools { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin: 8px 0; }
.arrow-icon { background: transparent; border: 0; }
.leaflet-container { font-family: Inter, "Segoe UI", sans-serif; background: #101820; }

.cams { grid-template-columns: 1fr; }
.cam img { width: 100%; border-radius: 8px; background: #0b1016; aspect-ratio: 16/10; object-fit: cover; }
.lakes, .rivers { grid-template-columns: 1fr; }

form { display: grid; gap: 10px; }
label { display: grid; gap: 4px; font-size: 0.92rem; }
input, textarea {
  width: 100%;
  background: #0f1620;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  min-height: 44px;
}
textarea { min-height: 120px; resize: vertical; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.button, button.primary, a.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid #3d536b;
  background: #24364a;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
}
button.primary { background: #d7e2ee; color: #14202c; border-color: #d7e2ee; font-weight: 620; }
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.links { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.footer {
  border-top: 1px solid var(--line);
  padding: 22px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}
.footer p { margin: 0 0 8px; }
.skywarn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.skywarn-grid div { background: var(--card-2); border-radius: 8px; padding: 10px; }
.skywarn-grid strong { display: block; font-size: 1.05rem; }

@media (min-width: 720px) {
  .gauges { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cams, .lakes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outlook-grid { grid-template-columns: 1fr 1fr; }
  .days { grid-template-columns: 1fr 1fr; }
  body[data-mode="calm"] #map { height: 480px; }
  .skywarn-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .mast-inner { align-items: flex-start; }
  .mast-meta { font-size: 0.78rem; }
  .brand-name { font-size: 1.15rem; }
  .cond-icon { width: 52px; height: 52px; }
  .cond-temp { font-size: 3rem; }
  body[data-mode="storm"] #map { height: 55vh; min-height: 300px; }
  .map-legend { left: 8px; right: 8px; bottom: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .banner,
  .live-dot,
  .card { animation: none !important; }
  .card { transition: none; }
  .logo-mark { filter: none; }
}
