/* Stormycast: Nexradar's aero glass over a dark map. */
:root {
  --aqua-200: #b8f0ff;
  --aqua-300: #7ee8fa;
  --aqua-400: #3fd0f5;
  --aqua-500: #00a3e0;
  --aqua-700: #004b8d;
  --aqua-900: #052b45;
  --lime: #c9ff5e;
  --glass-bg: linear-gradient(180deg, rgba(255, 255, 255, .30) 0%, rgba(150, 215, 245, .16) 46%, rgba(0, 60, 105, .34) 100%);
  --glass-edge: rgba(255, 255, 255, .55);
  --glass-edge-low: rgba(255, 255, 255, .16);
  --glass-shadow: 0 10px 30px rgba(2, 24, 43, .45), 0 2px 6px rgba(2, 24, 43, .35);
  --glass-inner: inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -1px 0 rgba(255, 255, 255, .1);
  --blur: blur(22px) saturate(175%);
  --ink: #f2fbff;
  --ink-dim: rgba(232, 248, 255, .72);
  --ink-faint: rgba(232, 248, 255, .48);
  --radius: 18px;
  --radius-sm: 11px;
  --gap: 12px;
  --font: "Segoe UI", "Segoe UI Variable", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body { background: #10161e; color: var(--ink); font: 14px/1.4 var(--font); }
#map { position: fixed; inset: 0; }
button, input { font: inherit; color: inherit; }
a { color: var(--aqua-300); }

.glass {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: var(--blur);
  -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--glass-edge-low);
  border-top-color: var(--glass-edge);
  border-radius: var(--radius);
  box-shadow: var(--glass-shadow), var(--glass-inner);
  z-index: 5;
}
.glass::before {
  content: "";
  position: absolute;
  inset: 1px 1px auto 1px;
  height: 46%;
  border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 40% 40% / calc(var(--radius) - 1px) calc(var(--radius) - 1px) 100% 100%;
  background: linear-gradient(180deg, rgba(255, 255, 255, .38) 0%, rgba(255, 255, 255, .11) 55%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

/* --- Pills -------------------------------------------------------------------- */
.pill, .seg button {
  position: relative;
  border: 1px solid rgba(255, 255, 255, .22);
  border-top-color: rgba(255, 255, 255, .5);
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .04) 55%, rgba(0, 40, 80, .2));
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 20, 40, .6);
  transition: background .15s, box-shadow .15s;
}
.pill:hover, .seg button:hover { background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .08) 55%, rgba(0, 60, 110, .25)); }
.pill[aria-pressed="true"], .seg button[aria-checked="true"] {
  background: linear-gradient(180deg, #8ff0ff 0%, var(--aqua-400) 45%, var(--aqua-500) 55%, var(--aqua-700) 100%);
  border-color: rgba(255, 255, 255, .7);
  box-shadow: 0 0 14px rgba(63, 208, 245, .55), inset 0 1px 0 rgba(255, 255, 255, .8);
  color: #fff;
}
:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }

/* --- Top bar ------------------------------------------------------------------ */
.bar {
  position: fixed;
  top: var(--gap);
  left: var(--gap);
  right: var(--gap);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { flex: none; filter: drop-shadow(0 2px 6px rgba(0, 163, 224, .6)); }
.brand h1 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: .2px; line-height: 1.1; }
.sub { margin: 0; font-size: 12px; color: var(--ink-dim); font-family: var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.days { display: flex; gap: 6px; flex: 1; justify-content: center; overflow-x: auto; scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days .pill { display: flex; flex-direction: column; align-items: center; padding: 4px 14px; line-height: 1.15; }
.days .pill b { font-weight: 600; font-size: 13px; }
.days .pill span { font-size: 11px; color: var(--ink-dim); }
.days .pill[aria-pressed="true"] span { color: #eafcff; }
.about-btn { flex: none; }

/* --- Hazard picker ------------------------------------------------------------- */
.hazards {
  position: fixed;
  top: calc(var(--gap) + 76px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 12px 6px 6px;
}
.seg { display: flex; gap: 4px; }
.sig { display: flex; align-items: center; gap: 6px; cursor: pointer; color: var(--ink-dim); white-space: nowrap; }
.sig input { accent-color: var(--aqua-500); width: 16px; height: 16px; margin: 0; }
.sig.off { opacity: .4; pointer-events: none; }

/* --- Legend -------------------------------------------------------------------- */
.legend {
  position: fixed;
  left: var(--gap);
  bottom: calc(var(--gap) + 26px);
  padding: 10px 12px;
  min-width: 150px;
}
.legend h2 { margin: 0 0 6px; font-size: 13px; font-weight: 600; }
.legend ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.legend li { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 12px; }
.legend i { width: 22px; height: 12px; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .45); }
.legend .note { margin: 6px 0 0; font-size: 11px; color: var(--ink-faint); max-width: 190px; }

/* --- Point readout ------------------------------------------------------------- */
.readout {
  position: fixed;
  right: var(--gap);
  bottom: calc(var(--gap) + 26px);
  padding: 10px 14px;
  min-width: 200px;
}
.readout h2 { margin: 0 0 6px; font-size: 13px; font-weight: 600; font-family: var(--mono); }
.readout table { border-collapse: collapse; width: 100%; font-size: 13px; }
.readout td { padding: 2px 0; }
.readout td:last-child { text-align: right; font-family: var(--mono); padding-left: 16px; }
.readout tr.zero td { color: var(--ink-faint); }
.readout .chip { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 7px; border: 1px solid rgba(255, 255, 255, .4); vertical-align: 0; }

.status {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 14px 20px;
}

/* --- About ---------------------------------------------------------------------- */
.about {
  width: min(560px, calc(100vw - 2 * var(--gap)));
  max-height: calc(100vh - 2 * var(--gap));
  overflow: auto;
  padding: 22px 26px;
  color: var(--ink);
  background: linear-gradient(180deg, rgba(40, 110, 160, .82), rgba(5, 43, 69, .94));
}
.about::backdrop { background: rgba(2, 12, 22, .55); backdrop-filter: blur(3px); }
.about h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.about h3 { margin: 18px 0 6px; font-size: 14px; font-weight: 600; color: var(--aqua-200); }
.about p { margin: 0 0 6px; }
.about .lead { color: var(--ink-dim); }
.about .facts { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.about table.record { border-collapse: collapse; width: 100%; font-size: 13px; margin: 6px 0; }
.about .record th { font-weight: 600; color: var(--aqua-200); text-align: right; padding: 3px 6px; }
.about .record td { padding: 3px 6px; text-align: right; font-family: var(--mono); border-top: 1px solid rgba(255, 255, 255, .12); }
.about .record th:first-child, .about .record td:first-child { text-align: left; font-family: var(--font); }
.about .note { font-size: 12px; color: var(--ink-dim); }
.about .credits { font-size: 12px; color: var(--ink-dim); }
.about .close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .12); font-size: 20px; line-height: 1; cursor: pointer; z-index: 1;
}

/* --- Map controls ---------------------------------------------------------------- */
.maplibregl-ctrl-attrib { font-size: 11px; background: rgba(5, 25, 40, .7) !important; color: var(--ink-dim); }
.maplibregl-ctrl-attrib a { color: var(--aqua-200) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-ctrl-top-right { top: calc(var(--gap) + 130px); }

/* --- Phones ---------------------------------------------------------------------- */
@media (max-width: 760px) {
  :root { --gap: 8px; }
  .bar { flex-wrap: wrap; gap: 8px 10px; padding: 8px 10px; }
  .brand { flex: 1; }
  .days { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .days .pill { padding: 3px 11px; }
  .hazards { top: auto; bottom: calc(var(--gap) + 30px); left: var(--gap); right: var(--gap); transform: none; flex-wrap: wrap; justify-content: center; padding: 6px; }
  .seg { flex-wrap: wrap; justify-content: center; }
  .seg button { padding: 5px 11px; }
  .legend { bottom: auto; top: calc(var(--gap) + 112px); padding: 8px 10px; min-width: 0; }
  .legend .note { display: none; }
  .readout { right: var(--gap); left: auto; bottom: auto; top: calc(var(--gap) + 112px); min-width: 170px; padding: 8px 10px; }
  .maplibregl-ctrl-top-right { display: none; }
  /* Credits stay folded behind their (i) on a phone, under the hazard buttons. */
  .maplibregl-ctrl-attrib.maplibregl-compact-show { max-width: calc(100vw - 2 * var(--gap)); }
  .maplibregl-ctrl-bottom-right { z-index: 6; }
}

/* --- Links styled as pills -------------------------------------------------------- */
a.pill { color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; }

/* --- Verification page (verify.html) ------------------------------------------------- */
body.page {
  --surface: #0f2233;
  overflow: auto;
  height: auto;
  min-height: 100%;
  background:
    radial-gradient(1200px 600px at 20% -10%, rgba(0, 163, 224, .28), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(126, 232, 250, .12), transparent 60%),
    linear-gradient(180deg, #0b2235 0%, #0a1824 60%, #09131c 100%);
  background-attachment: fixed;
}
html:has(body.page) { overflow: auto; height: auto; }
body.page .bar { position: sticky; top: var(--gap); margin: var(--gap); left: auto; right: auto; justify-content: space-between; z-index: 10; }
.verify { max-width: 1060px; margin: 0 auto; padding: 4px 16px 40px; display: grid; gap: 16px; }
.verify .panel { padding: 16px 18px; border-radius: var(--radius); }
.verify .panel > * { position: relative; }
.verify h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.verify h3 { margin: 16px 0 6px; font-size: 14px; font-weight: 600; color: var(--aqua-200); }
.verify .note { margin: 0 0 10px; color: var(--ink-dim); font-size: 13px; }
.verify .intro { margin: 0; color: var(--ink-dim); max-width: 760px; }
.verify .controls { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; padding: 8px; }
.verify .seg { flex-wrap: wrap; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile { display: grid; gap: 2px; padding: 12px 14px; border-radius: var(--radius-sm); }
.tile.wide { grid-column: 1 / -1; }
.tile > * { position: relative; }
.t-label { font-size: 12px; color: var(--ink-dim); }
.t-value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tile.wide .t-value { font-size: 17px; }
.t-sub { font-size: 12px; color: var(--ink-faint); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid { stroke: rgba(255, 255, 255, .08); stroke-width: 1; }
.chart .base { stroke: rgba(255, 255, 255, .35); stroke-width: 1; }
.chart .diag { stroke: rgba(255, 255, 255, .35); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .axis { fill: var(--ink-faint); font-size: 11px; font-family: var(--font); }
.chart .label { fill: var(--ink-dim); font-size: 12px; font-family: var(--font); }
.chart .pt { cursor: default; outline: none; }
.chart .pt:focus-visible circle:last-child, .chart .pt:focus-visible path { stroke: var(--lime); stroke-width: 2; }
.legend-row { display: flex; gap: 16px; font-size: 12px; color: var(--ink-dim); margin-bottom: 4px; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row i { width: 18px; height: 0; border-top: 2px solid var(--c); display: inline-block; }
.legend-row i.dashed { border-top-style: dashed; }
.table-wrap { overflow-x: auto; }
table.data, .days-table { border-collapse: collapse; width: 100%; font-size: 13px; }
table.data th, .days-table th { font-weight: 600; color: var(--aqua-200); text-align: right; padding: 5px 8px; white-space: nowrap; }
table.data td, .days-table td { padding: 5px 8px; text-align: right; font-variant-numeric: tabular-nums; border-top: 1px solid rgba(255, 255, 255, .1); white-space: nowrap; }
table.data th:first-child, table.data td:first-child, .days-table th:first-child, .days-table td:first-child { text-align: left; }
.days-table { max-height: 420px; }
.tag { font-size: 11px; color: var(--ink-faint); border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; padding: 0 6px; margin-left: 4px; }
.empty { color: var(--ink-faint); font-size: 13px; padding: 20px 0; text-align: center; }
.foot { color: var(--ink-faint); font-size: 12px; margin: 4px 0 0; }
.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 260px;
  padding: 8px 10px; border-radius: 10px; font-size: 12px; line-height: 1.45;
  background: rgba(5, 30, 48, .94); border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
@media (max-width: 760px) {
  .two { grid-template-columns: 1fr; }
  body.page .bar { flex-wrap: nowrap; }
  .verify { padding: 0 8px 32px; }
  .t-value { font-size: 22px; }
}
/* Tall panels: the glass shine stays a strip along the top, clear of tables and charts. */
.verify .glass::before { height: min(46%, 64px); border-radius: calc(var(--radius) - 1px) calc(var(--radius) - 1px) 50% 50% / calc(var(--radius) - 1px) calc(var(--radius) - 1px) 18px 18px; background: linear-gradient(180deg, rgba(255, 255, 255, .26) 0%, rgba(255, 255, 255, .06) 70%, rgba(255, 255, 255, 0) 100%); }
table.data thead tr:first-child th[colspan] { text-align: center; border-bottom: 1px solid rgba(255, 255, 255, .15); }
/* Grid children may shrink below their content (tables scroll inside their own box). */
.verify > *, .two > * { min-width: 0; }
body.page .brand { flex: 1; min-width: 0; }
body.page .brand > div { min-width: 0; }
body.page .brand h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) {
  body.page .brand h1 { font-size: 16px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .verify .controls { justify-content: flex-start; }
  .verify .panel { padding: 12px; }
}

/* --- Disclaimer --------------------------------------------------------------------- */
.legend .disc { margin: 6px 0 0; font-size: 11px; color: var(--ink-dim); }
.disclaimer p { margin: 0 0 8px; font-size: 13px; color: var(--ink-dim); }
.disclaimer p b { color: var(--ink); }
.notice {
  position: fixed; left: 50%; bottom: calc(var(--gap) + 40px); transform: translateX(-50%);
  width: min(520px, calc(100vw - 2 * var(--gap))); padding: 16px 18px; z-index: 20;
  background: linear-gradient(180deg, rgba(40, 110, 160, .9), rgba(5, 43, 69, .96));
}
.notice > * { position: relative; }
.notice h2 { margin: 0 0 6px; font-size: 16px; font-weight: 600; }
.notice p { margin: 0 0 12px; font-size: 13.5px; }
.notice-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pill.on {
  background: linear-gradient(180deg, #8ff0ff 0%, var(--aqua-400) 45%, var(--aqua-500) 55%, var(--aqua-700) 100%);
  border-color: rgba(255, 255, 255, .7); color: #fff;
}
@media (max-width: 760px) { .notice { bottom: calc(var(--gap) + 110px); } }

/* --- The Nexradar button ------------------------------------------------------------- */
.nexradar-btn { flex: none; gap: 8px; padding: 7px 18px 7px 8px; font-weight: 600; font-size: 15px; box-shadow: 0 0 18px rgba(63, 208, 245, .55), inset 0 1px 0 rgba(255, 255, 255, .8); }
.nexradar-btn img { filter: drop-shadow(0 1px 3px rgba(0, 40, 80, .6)); }
.nexradar-btn:hover { filter: brightness(1.08); }
.bar-actions { display: flex; gap: 8px; align-items: center; }
.short { display: none; }
@media (max-width: 760px) {
  .long { display: none; }
  .short { display: inline; }
  .nexradar-btn { font-size: 14px; padding: 5px 12px 5px 6px; }
  .bar .sub { display: none; }
  .brand h1 { font-size: 17px; }
}
.brand > div { min-width: 0; }
.brand h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 760px) { .bar a.verify-link { display: none; } }
