:root {
  color-scheme: dark;
  --bg: #0a0f1c;
  --panel: rgba(255,255,255,0.06);
  --panel-solid: #ffffff;
  --text: #eef2ff;
  --muted: #a8b0c7;
  --border: rgba(255,255,255,0.10);
  --shadow: 0 24px 80px rgba(0,0,0,0.25);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(34,211,238,0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(59,130,246,0.14), transparent 24%),
    var(--bg);
  color: var(--text);
}
.shell { max-width: 1240px; margin: 0 auto; padding: 24px; }
.hero, .toolbar, .refresh-banner, .map-panel, .summary-panel {
  border: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}
.hero {
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: end;
  border-radius: 28px;
  padding: 24px;
}
.toolbar {
  display: flex;
  gap: 24px;
  align-items: end;
  border-radius: 28px;
  padding: 24px;
}
.newcastle-logo-small {
  height: 16px;
  width: auto;
  display: block;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
.open-meteo-logo-small {
  height: 16px;
  width: 16px;
  display: block;
  opacity: 0.8;
  transition: opacity 0.2s ease;
}
.banner-link #sourceLink {
  height: 16px;
  width: 55px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
}
.banner-link #sourceLink:hover .newcastle-logo-small {
  opacity: 1;
}
.banner-link a:hover .open-meteo-logo-small {
  opacity: 1;
}
.banner-value.banner-link {
  display: flex;
  align-items: center;
  gap: 8px;
}
.refresh-banner {
  margin-top: 16px;
  border-radius: 24px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.07), rgba(34,211,238,0.08));
}
.banner-label { margin: 0 0 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .16em; color: #a5f3fc; }
.banner-value { margin: 0; font-size: 1rem; font-weight: 600; color: #fff; width: 100%; }
.banner-link a { color: #fff; }
.overview-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(320px, 1fr);
  gap: 16px;
}
.map-panel, .summary-panel {
  border-radius: 28px;
  padding: 20px;
}
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.section-head h2, .toolbar h2 { margin: 0; font-size: 1.35rem; }
.section-head p, .toolbar p { margin: 6px 0 0; color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .2em; font-size: 12px; color: #a5f3fc; margin: 0 0 12px; }
h1 { font-size: clamp(2.4rem, 6vw, 4.5rem); margin: 0; line-height: 1; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 56ch; }
.chips, .filters { display: flex; gap: 10px; flex-wrap: wrap; }
.chip, .filter {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  padding: 10px 14px;
  color: var(--text);
}
.filter { cursor: pointer; }
.filter.is-active { background: #fff; color: #111827; border-color: #fff; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)); gap: 12px; min-width: 360px; }
.stat {
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 16px;
}
.stat span { display:block; color: var(--muted); font-size: .95rem; }
.stat strong { display:block; font-size: 2.4rem; margin-top: 6px; }
.stat-danger { background: rgba(239,68,68,0.22); }
.stat-good { background: rgba(16,185,129,0.22); }
.map-strip { margin-top: 14px; }
.map-track {
  position: relative;
  min-height: 202px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(59,130,246,0.24), rgba(14,116,144,0.15));
  border: 1px solid rgba(255,255,255,0.08);
}
.map-water {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.16), transparent 30%);
}
.map-coast {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0px;
  height: 95px;
  background: linear-gradient(180deg, #d6c4a0, #b78d59);
  clip-path: polygon(14.87% 43.94%, 24.72% 51.31%, 33.38% 43.18%, 37.1% 34.78%, 40.65% 46.43%, 46.67% 50.94%, 52.87% 45.22%, 57.64% 47.25%, 62.1% 59.44%, 73.34% 68.28%, 83.51% 74.23%, 88.95% 67.43%, 94.64% 72.85%, 100% 72.85%, 100% 100%, 0% 100%, 0% 75.75%, 12.31% 50.94%, 16.06% 59.44%, 19.81% 94.61%, 19.44% 69.51%);
  box-shadow: inset 0 8px 20px rgba(255,255,255,0.18);
}
.map-label {
  position: absolute;
  top: 14px;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .16em;
  color: rgba(255,255,255,0.78);
}
.map-label.north { left: 16px; }
.map-label.south { right: 16px; }
.map-pin {
  position: absolute;
  bottom: 60px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
.map-dot {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.5);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}
.map-pin-open .map-dot { background: #048e60; }
.map-pin-seasonal .map-dot { background: #d97706; }
.map-pin-closed .map-dot {
  background: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}.map-pin-closed .map-dot::before {
  content: "⚠️";
  font-size: 12px;
  line-height: 1;
  margin-top: 1px;
}
.map-name {
  font-size: .78rem;
  color: white;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  white-space: nowrap;
}
.map-mini {
  border-radius: 999px;
  padding: 6px 10px;
  color: white;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.best-card {
  margin-top: 34px;
  border-radius: 22px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
}
.best-card .card-status { border-bottom-color: rgba(255,255,255,0.12); }
.best-card-body { padding: 18px; }
.best-kicker { font-size: 1.35rem; font-weight: 700; color: white; }
.best-metrics { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.best-copy { color: var(--muted); line-height: 1.5; }
.best-link { color: white; font-weight: 700; text-decoration: none; }
.stat-total {
  font-size: 0.35em;
  font-weight: 600;
  opacity: 0.7;
  margin-left: 0.25rem;
}
.toolbar { margin-top: 16px; align-items: center; }
.cards { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.card {
  background: var(--panel-solid);
  color: #0f172a;
  text-decoration: none;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(15,23,42,0.06);
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-2px); transition: transform .2s ease; }
.card-status {
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-align: center;
  border-bottom: 1px solid rgba(15,23,42,0.08);
}
.card-status-closed { background: #dc2626dd; color: #fff; }
.card-status-seasonal { background: #d97706dd; color: #fff; }
.card-status-open { background: #1bb381dd; color: #fff; }
.card-status-strong { background: #048e60dd; color: #fff; }
.card-body {
  padding: 16px;
  flex: 1;
}
.card-title { margin: 0 0 4px; font-size: 1.35rem; font-weight: 700; }
.card-updated {
  margin: 0 0 12px;
  color: #64748b;
  font-size: 0.9rem;
}
.stale-indicator {
  display: inline-flex;
  position: relative;
  align-items: center;
  gap: 4px;
  background: none;
  color: #92400e;
  cursor: help;
}
.stale-indicator::after {
  content: attr(data-tooltip);
  position: absolute;
  left: -130px;
  bottom: calc(100% - 57.64%);
  transform: none;
  background: #535762;
  color: #fff;
  line-height: 1.3;
  padding: 6px 8px;
  border-radius: 6px;
  white-space: normal;
  max-width: 210px;
  width: 210px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.08s ease;
  z-index: 20;
}
.stale-indicator:hover::after,
.stale-indicator:focus-visible::after {
  opacity: 1;
  visibility: visible;
}
.card-scores {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #475569;
}
.score-line { margin: 4px 0; }
.card-temps {
  margin-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.temp-item {
  font-size: 0.74rem;
  font-weight: 600;
  color: #475569;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 3px 8px;
}
.temp-item-air { background: azure; }
.temp-item-water { background: lightskyblue; }
.card-footer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(15,23,42,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-link {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0f766e;
  text-decoration: none;
}
.card-link::after {
  content: " \2197";
  font-size: 0.78rem;
}
.card-link:hover { text-decoration: underline; }
.card-link-disabled {
  color: #94a3b8;
  pointer-events: none;
  text-decoration: none;
}
.card-link-disabled::after { content: ""; }
.empty-state {
  border-radius: 24px;
  border: 1px dashed rgba(255,255,255,0.2);
  padding: 26px;
  color: var(--muted);
  background: rgba(255,255,255,0.04);
}
.gradient-stockton { background: linear-gradient(135deg, #164e63, #0ea5e9 58%, #cbd5e1); }
.gradient-nobbys { background: linear-gradient(135deg, #1d4ed8, #38bdf8 55%, #fef3c7); }
.gradient-newcastle { background: linear-gradient(135deg, #0f766e, #22d3ee 55%, #e2e8f0); }
.gradient-bar { background: linear-gradient(135deg, #7c3aed, #60a5fa 55%, #fde68a); }
.gradient-dixon { background: linear-gradient(135deg, #be123c, #fb7185 55%, #fbcfe8); }
.gradient-merewether { background: linear-gradient(135deg, #0f766e, #10b981 55%, #fde68a); }

@media (max-width: 980px) {
  .hero, .toolbar { flex-direction: column; align-items: stretch; }
  .stats, .refresh-banner { min-width: 0; grid-template-columns: repeat(3, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .shell { padding: 16px; }
  .stats, .refresh-banner, .metrics { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .map-track { min-height: 260px; }
  .map-pin { bottom: 94px; }
  .map-name { writing-mode: vertical-rl; text-orientation: mixed; }
}
