:root {
  --bg: #f3f5f4;
  --card: #ffffff;
  --text: #1c2622;
  --muted: #5d6b65;
  --line: #dfe5e2;
  --accent: #2f7d5b;
  --accent-soft: #e3f1ea;
  --water: #1b6e8f;
  --water-soft: #e3eef5;
  --good-bg: #dcf2e3;
  --good-ink: #1b6b38;
  --mod-bg: #fdefc6;
  --mod-ink: #7a5200;
  --windy-bg: #fbdcd8;
  --windy-ink: #9c1f14;
  --light-bg: #e9edef;
  --light-ink: #4b5a56;
  --yellow: #f5c518;
  --orange: #f08a24;
  --red: #d93a2b;
  --radius: 16px;
  --warm: #f59e0b;
  --shadow: 0 1px 2px rgba(16, 24, 20, .04), 0 8px 24px rgba(16, 24, 20, .06);
  --glass: rgba(255, 255, 255, .78);
  --rain-bar: #4a90d9;
  --wind-bar: #3aa58f;
  --sun-bar: #f5b829;
  --series-1: #2f7d5b;
  --series-2: #4a90d9;
  --series-3: #f08a24;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111715;
    --card: #1a2320;
    --text: #e7eeea;
    --muted: #9aaba3;
    --line: #2a3632;
    --accent: #5cc295;
    --accent-soft: #1f3a2e;
    --water: #6fb9db;
    --water-soft: #17303b;
    --good-bg: #1c3a28;
    --good-ink: #8fe0a8;
    --mod-bg: #3e3312;
    --mod-ink: #f5cf62;
    --windy-bg: #46211d;
    --windy-ink: #f5a79f;
    --light-bg: #27322e;
    --light-ink: #9aaba3;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
    --glass: rgba(26, 35, 32, .78);
    --rain-bar: #5aa0e6;
    --wind-bar: #4cbf9f;
    --sun-bar: #f7c14a;
    --series-1: #5cc295;
    --series-2: #5aa0e6;
    --series-3: #f5a04a;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.topbar {
  /* Brand on the left, town search centred on the page. */
  display: grid;
  grid-template-columns: 1fr minmax(0, 440px) 1fr;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}
.brand-mark { width: 38px; height: 35px; flex: none; }
.brand-irish { color: var(--accent); }
.brand-tld { color: var(--muted); font-weight: 600; }

.brand { justify-self: start; }

.picker { display: flex; gap: 6px; margin: 0; }

@media (max-width: 640px) {
  .topbar { grid-template-columns: 1fr; justify-items: center; }
  .brand { justify-self: center; }
  .picker { width: 100%; }
}

.search { position: relative; flex: 1; }
.search input {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 8px 16px;
  transition: border-color .2s, box-shadow .2s;
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.results {
  position: absolute;
  z-index: 10;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  animation: pop .18s var(--ease);
}
.results li { padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.results li .detail { color: var(--muted); font-size: 13px; margin-left: 6px; }
.results li.active, .results li:hover { background: var(--accent-soft); }
.results li.note { color: var(--muted); cursor: default; background: none; }

/* Pin for the place whose forecast is showing. */
.pin {
  width: 18px;
  height: 18px;
  border-radius: 50% 50% 50% 0;
  background: var(--red);
  border: 2px solid #fff;
  transform: rotate(-45deg);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}

select, button {
  font: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 99px;
  padding: 6px 12px;
  cursor: pointer;
  transition: background-color .25s var(--ease), color .25s var(--ease), border-color .2s, transform .15s var(--ease);
}

button:hover, select:hover { border-color: var(--accent); }
button:active { transform: scale(.96); }
#locate { padding: 6px 10px; }

/* Warnings, under the written forecasts */
.warnings { display: grid; gap: 8px; }
.warnings[hidden] { display: none; }

.warning {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 14px;
  border-left: 6px solid var(--yellow);
  background: var(--card);
  box-shadow: var(--shadow);
  animation: rise .5s var(--ease) both;
}
.warning.orange { border-left-color: var(--orange); }
.warning.red { border-left-color: var(--red); }
.warning summary { cursor: pointer; font-weight: 600; }
.warning .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.warning p { margin: 6px 0 0; }
.badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 99px;
  margin-right: 6px;
  color: #1c2622;
  background: var(--yellow);
}
.badge.orange { background: var(--orange); }
.badge.red { background: var(--red); color: #fff; }

/* Layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  padding: 16px;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  /* One column: warnings and the forecast panel come straight after the map, before the written forecasts. */
  .layout > .main-col { display: contents; }
  .map-wrap { order: 1; }
  .warnings { order: 2; }
  .panel { order: 3; }
  .texts { order: 4; }
}

.map-wrap {
  position: relative;
  min-height: 70vh;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow);
}

#map { position: absolute; inset: 0; }

.main-col { display: grid; gap: 16px; align-content: start; min-width: 0; }

/* Crosshair over the map, so it is clear where the readout is taken. */
.map-wrap .maplibregl-canvas-container.maplibregl-interactive { cursor: crosshair; }
.map-wrap .maplibregl-canvas-container.maplibregl-interactive:active { cursor: grabbing; }

/* Big readout of the value under the cursor, top centre of the map. */
.readout {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
  text-align: center;
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #1c2622;
  border-radius: 16px;
  padding: 6px 18px 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  white-space: nowrap;
}
.readout[hidden] { display: none; }
.readout .value { font-size: 44px; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.readout .value .unit { font-size: 22px; font-weight: 700; margin-left: 4px; }
.readout .value .arrow { display: inline-block; font-size: 30px; margin-right: 6px; }
.readout .label { font-size: 13px; color: #4a5853; }
@media (max-width: 600px) { .readout .value { font-size: 32px; } }

.map-controls {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  pointer-events: none;
  z-index: 5; /* above the town markers */
}
.map-controls > * { pointer-events: auto; }

.layers, .radar-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(1.6) blur(12px);
  backdrop-filter: saturate(1.6) blur(12px);
  border-radius: 99px;
  padding: 4px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
}
.layers { flex-wrap: wrap; } /* layer buttons go onto two rows on phones */
.layers button { border: none; background: transparent; }
.layers button:hover { background: var(--accent-soft); }
.layers button.on { background: var(--accent); color: #fff; box-shadow: 0 2px 8px rgba(47, 125, 91, .35); }
@media (max-width: 600px) { .layers { border-radius: 18px; } }
.views[hidden] { display: none; }
.views button { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: var(--accent); }

.radar-bar { flex: 1; min-width: 240px; max-width: 460px; padding: 4px 10px 4px 4px; }
.radar-bar input { flex: 1; accent-color: var(--accent); }
.radar-bar span { font-variant-numeric: tabular-nums; font-size: 13px; min-width: 92px; text-align: right; }
.radar-bar[hidden] { display: none; }

.legend {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-radius: 99px;
  padding: 6px 12px;
  font-size: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .16);
  animation: pop .3s var(--ease);
}
.legend[hidden] { display: none; }
.legend .bar { width: 160px; height: 10px; border-radius: 5px; }

/* Time the weather on the map applies to, top left of the map. */
.map-time {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 5;
  pointer-events: none;
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  color: #1c2622;
  border-radius: 12px;
  padding: 4px 10px 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  line-height: 1.25;
}
.map-time .when { font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.map-time .what { font-size: 12px; color: #4a5853; }
@media (max-width: 600px) {
  /* Below the readout, which sits top centre, and clear of the controls at the bottom. */
  .map-time { top: 100px; }
}

/* Map markers: a pill with the layer's value (a dot on the rain layers) and
   the town name, styled as a button so it is clearly clickable. MapLibre
   positions the .marker element itself, so the looks go on the .pill inside
   it; the padding around the pill makes a bigger tap target. */
.marker {
  margin: 0;
  padding: 8px;
  border: 0;
  background: none;
  font: 600 12px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  white-space: nowrap;
  cursor: pointer;
}
.marker:focus-visible { outline: none; }
.marker .pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px 2px 2px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  transition: transform .12s, box-shadow .12s;
}
.marker:hover .pill, .marker:focus-visible .pill { transform: scale(1.08); box-shadow: 0 2px 8px rgba(0, 0, 0, .4); }
/* Named pills sit over chip-only ones; the selected and hovered town over all. */
.maplibregl-marker.marker { z-index: 1; }
.marker.compact { z-index: 0; }
.marker.selected { z-index: 2; }
.maplibregl-marker:hover { z-index: 3; }
.marker .chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 24px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  color: #fff;
  font-weight: 700;
}
.marker .chip.dot { min-width: 0; width: 12px; height: 12px; margin-left: 4px; padding: 0; background: var(--accent); }
.marker .arrow { display: inline-block; }
/* Only the chip, where the name would sit on top of a neighbour. */
.marker.compact .pill { padding-right: 2px; }
.marker.compact .name { display: none; }
.marker.hidden { display: none; }
.marker.selected .pill, .marker:focus-visible .pill { outline: 2px solid var(--accent); outline-offset: 1px; }

/* Written forecasts, under the map */
.texts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.text-fc { padding: 0; }
.text-fc summary { cursor: pointer; list-style: none; position: relative; padding: 16px 44px 16px 18px; }
.text-fc summary::-webkit-details-marker { display: none; }
.text-fc summary::after { /* a chevron that turns when the card is open */
  content: ''; position: absolute; right: 22px; top: 20px; width: 9px; height: 9px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform .2s var(--ease), top .2s var(--ease);
}
.text-fc[open] summary::after { transform: rotate(225deg); top: 25px; }
.text-fc summary:hover h2 { color: var(--accent); }
.text-fc h2 { margin-bottom: 4px; }
.text-fc .issued, .text-fc .muted { color: var(--muted); font-size: 13px; margin: 0; }
.text-fc .peek { color: var(--muted); font-size: 14px; margin: 6px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.text-fc[open] .peek { display: none; }
.text-fc .body { padding: 0 18px 16px; }
.text-fc h3 { font-size: 14px; margin: 10px 0 2px; }
.text-fc .body h3:first-child { margin-top: 0; }
.text-fc p { margin: 0; }
.text-fc .note { color: var(--muted); font-size: 12px; margin-top: 10px; }

/* Side panel */
.panel { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; min-width: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.card h2 { font-size: 13px; margin: 0 0 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

/* Entrance for cards whose contents were just replaced (reveal() in app.js). */
.reveal { animation: rise .55s var(--ease) both; }
.reveal .hour, .reveal .day { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* Current conditions: a sky that matches the weather, with white text. */
.current {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  color: #fff;
  border: none;
  padding: 18px 20px 20px;
  background: linear-gradient(160deg, #4f8fd9, #7fb6ea);
  transition: background .6s var(--ease);
}
.current.sky-clear { background: linear-gradient(160deg, #2f80ed 0%, #56a8f5 55%, #9bd0fb 100%); }
.current.sky-partly { background: linear-gradient(160deg, #3b7fd0 0%, #6aa5e0 55%, #a9c9e8 100%); }
.current.sky-cloud { background: linear-gradient(160deg, #5c6f84 0%, #8396ab 60%, #a8b6c5 100%); }
.current.sky-rain { background: linear-gradient(160deg, #36495e 0%, #57708a 60%, #7b90a6 100%); }
.current.sky-storm { background: linear-gradient(160deg, #1f2436 0%, #3a3f5c 60%, #5b5f7d 100%); }
.current.sky-snow { background: linear-gradient(160deg, #5f7896 0%, #8aa2bd 60%, #b4c6d9 100%); }
.current.sky-fog { background: linear-gradient(160deg, #7c8791 0%, #a0aab3 60%, #c3cbd2 100%); }
.current.is-night { background: linear-gradient(160deg, #0b1533 0%, #1b2a55 55%, #34407a 100%); }
.current.is-night.sky-cloud, .current.is-night.sky-rain, .current.is-night.sky-fog { background: linear-gradient(160deg, #141b2b 0%, #27324a 60%, #3d4a66 100%); }
.current.is-night.sky-storm { background: linear-gradient(160deg, #0d0f1c 0%, #22243a 60%, #3a3c58 100%); }

/* Moving layer behind the text: stars, a sun glow, drifting cloud, falling rain or snow. */
.sky-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.sky-clear:not(.is-night) .sky-fx, .sky-partly:not(.is-night) .sky-fx {
  background: radial-gradient(circle at 88% 8%, rgba(255, 236, 160, .75), rgba(255, 220, 120, 0) 45%);
  animation: glow 6s ease-in-out infinite alternate;
}
.is-night .sky-fx {
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 32% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 58% 28%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 76% 10%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 90% 34%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 44% 44%, #fff 50%, transparent 51%),
    radial-gradient(1.2px 1.2px at 8% 60%, #fff 50%, transparent 51%);
  animation: twinkle 4s ease-in-out infinite alternate;
}
.sky-cloud .sky-fx::before, .sky-fog .sky-fx::before, .sky-partly .sky-fx::before {
  content: "";
  position: absolute;
  inset: -20% -40%;
  background:
    radial-gradient(closest-side, rgba(255, 255, 255, .28), transparent) 10% 30% / 40% 30% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .22), transparent) 60% 15% / 50% 35% no-repeat,
    radial-gradient(closest-side, rgba(255, 255, 255, .18), transparent) 85% 70% / 45% 30% no-repeat;
  animation: drift 26s linear infinite alternate;
}
.sky-rain .sky-fx, .sky-storm .sky-fx {
  background-image: repeating-linear-gradient(105deg, transparent 0 14px, rgba(255, 255, 255, .13) 14px 15px, transparent 15px 31px);
  background-size: 200px 200px;
  animation: pour .7s linear infinite;
}
.sky-storm .sky-fx::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  animation: flash 7s infinite;
}
.sky-snow .sky-fx {
  background-image:
    radial-gradient(2px 2px at 20px 30px, #fff 50%, transparent 51%),
    radial-gradient(2.5px 2.5px at 90px 80px, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 150px 20px, #fff 50%, transparent 51%),
    radial-gradient(2px 2px at 60px 140px, #fff 50%, transparent 51%);
  background-size: 180px 180px;
  animation: settle 9s linear infinite;
}
@keyframes glow { from { opacity: .7; } to { opacity: 1; } }
@keyframes twinkle { from { opacity: .55; } to { opacity: 1; } }
@keyframes drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes pour { to { background-position: -54px 200px; } }
@keyframes settle { to { background-position: 40px 180px; } }
@keyframes flash { 0%, 91%, 95%, 100% { opacity: 0; } 92% { opacity: .35; } 94% { opacity: .15; } }

.current .place { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.current .updated { color: rgba(255, 255, 255, .8); font-size: 13px; }
.current .big { display: flex; align-items: center; gap: 14px; margin: 10px 0 14px; }
.current .sym .wx { width: 104px; height: 104px; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .18)); }
.current .temp { font-size: 64px; font-weight: 300; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.current .desc { font-size: 17px; font-weight: 600; margin-top: 4px; }
.current .hilo { color: rgba(255, 255, 255, .85); font-size: 13px; margin-top: 2px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.stats > div {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-radius: 12px;
  padding: 8px 10px;
}
.stats dt { color: rgba(255, 255, 255, .78); font-size: 12px; }
.stats dd { margin: 0; font-weight: 600; font-size: 14px; white-space: nowrap; }
@media (max-width: 380px) { .stats { grid-template-columns: 1fr 1fr; } }
.wind-arrow { display: inline-block; margin-right: 3px; font-weight: 700; }

/* Next 24 hours: times, a temperature curve, then icon, rain and wind per hour. */
.hourly { overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; scroll-behavior: smooth; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
.hourly-track { position: relative; }

/* Sunrise and sunset, and air quality, under the 7-day forecast */
.sun-times { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px 12px; margin-bottom: 8px; }
.sun-times div { display: grid; gap: 2px; }
.sun-times .label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.sun-times .value { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sun p, .air p { margin: 0; }
.air p.small { margin-bottom: 10px; }
.air-row { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.aqi { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--line); color: #1c2622; white-space: nowrap; }
.aqi.good, .aqi.none, .aqi.low { background: #cdeccf; }
.aqi.fair, .aqi.moderate { background: #f5e6a3; }
.aqi.poor, .aqi.high { background: #f7c59f; }
.aqi.very-poor, .aqi.very-high { background: #f2a6a0; }
.aqi.extremely-poor { background: #d98cc9; }
.hourly .times, .hourly .hours { display: flex; }
.hourly .times span { flex: 0 0 64px; text-align: center; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hourly .times span:first-child { color: var(--text); font-weight: 700; }
.tcurve { display: block; overflow: visible; }
.tcurve .area { fill: url(#tcurveFill); }
.tcurve .line { fill: none; stroke: var(--warm); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.reveal .tcurve .line { animation: draw 1.2s var(--ease) both; }
.tcurve circle { fill: var(--card); stroke: var(--warm); stroke-width: 2; }
.tcurve text { fill: var(--text); font-size: 13px; font-weight: 700; text-anchor: middle; }
@keyframes draw { from { stroke-dashoffset: 1; } }
.hour {
  flex: 0 0 64px;
  text-align: center;
  font-size: 12px;
  padding: 2px 0;
}
.hour .s .wx { width: 34px; height: 34px; }
.hour .r { color: #2a6fd6; font-size: 11px; font-weight: 600; min-height: 16px; }
.hour .w { color: var(--muted); font-size: 11px; }

/* 7 days: icon, low, a bar from low to high on the week's scale, high. */
.daily { display: grid; }
.day {
  display: grid;
  grid-template-columns: 52px 38px 30px 1fr 30px;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 8px;
  padding: 7px 4px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  transition: background-color .2s;
}
.day:hover { background: var(--accent-soft); }
.day:last-child { border-bottom: none; }
.day .name { font-weight: 600; grid-row: span 2; }
.day .s { grid-row: span 2; }
.day .s .wx { width: 36px; height: 36px; display: block; }
.day .lo { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.day .hi { font-weight: 700; font-variant-numeric: tabular-nums; }
.range-bar { position: relative; height: 6px; border-radius: 3px; background: var(--line); }
.range-bar .fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; min-width: 6px; transform-origin: left; }
.reveal .range-bar .fill { animation: grow .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms + 150ms); }
@keyframes grow { from { transform: scaleX(0); } }
.day .extra { grid-column: 3 / -1; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Animated weather icons (icons.js). */
.wx { display: inline-block; width: 40px; height: 40px; overflow: visible; vertical-align: middle; }
.wx-cloud { fill: #eef2f7; stroke: #a9b6c6; stroke-width: 1.4; animation: float 5s ease-in-out infinite; }
.wx-cloud.wx-mid { fill: #cfd8e3; stroke: #95a3b5; }
.wx-cloud.wx-dark { fill: #94a3b8; stroke: #6b7a90; }
.wx-cloud.wx-storm { fill: #5b6476; stroke: #434b5c; }
.wx-sun .wx-rays { animation: spin 18s linear infinite; transform-origin: inherit; transform-box: view-box; }
.wx-sun { animation: breathe 4s ease-in-out infinite; }
.wx-moon { animation: rock 6s ease-in-out infinite; }
.wx-stars circle { animation: twinkle 2s ease-in-out infinite alternate; }
.wx-rain line { stroke: #3b82f6; stroke-width: 2.4; stroke-linecap: round; animation: fall 1.1s linear infinite; }
.wx-drizzle line { stroke-width: 2; animation-duration: 1.4s; }
.wx-snow circle { fill: #e0f2fe; stroke: #60a5fa; stroke-width: 1; animation: flake 2.6s linear infinite; }
.wx-bolt { fill: #facc15; animation: zap 3s steps(1) infinite; }
.wx-fog line { stroke: #94a3b8; stroke-width: 3; stroke-linecap: round; animation: slide 4s ease-in-out infinite alternate; }
/* On the coloured sky the icon's light cloud reads better a touch brighter. */
.current .wx-cloud { stroke: none; }
.current .wx-cloud.wx-light { fill: #fff; }
.current .wx-cloud.wx-mid { fill: #e2e8f0; }
.current .wx-rain line { stroke: #bfdbfe; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.05); } }
@keyframes rock { 50% { transform: rotate(-8deg); } }
@keyframes float { 50% { transform: translateX(2px); } }
@keyframes fall { from { transform: translateY(-8px); opacity: 0; } 30% { opacity: 1; } to { transform: translateY(6px); opacity: 0; } }
@keyframes flake { from { transform: translate(0, -9px); opacity: 0; } 25% { opacity: 1; } to { transform: translate(3px, 6px); opacity: 0; } }
@keyframes zap { 0%, 100% { opacity: 1; } 10% { opacity: .2; } 14% { opacity: 1; } 18% { opacity: .4; } 22% { opacity: 1; } }
@keyframes slide { from { transform: translateX(-3px); } to { transform: translateX(3px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Ad slots keep a fixed height so the page doesn't jump when an ad loads,
   and carry a small label so they read as ads, not forecast cards. */
.ad-slot { margin: 0 16px; min-height: 90px; text-align: center; }
.ad-slot::before { content: "Advertisement"; display: block; font-size: 11px; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.panel .ad-slot { margin: 0; min-height: 250px; }
/* The top banner would push the map below the fold on a phone. */
@media (max-width: 900px) { .ad-top { display: none !important; } }

/* ---------- section tabs and the server-rendered pages ---------- */

.tabs { display: flex; gap: 4px; padding: 6px 12px; overflow-x: auto; scrollbar-width: none; background: var(--card); border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 6px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current] { background: var(--accent-soft); color: var(--accent); }

.page { max-width: 960px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.page > * { min-width: 0; } /* a wide table scrolls inside its card instead of widening the page */
.page h1 { font-size: 26px; line-height: 1.2; margin: 0 0 6px; }
.prose h2 { font-size: 18px; margin: 20px 0 6px; color: var(--text); text-transform: none; letter-spacing: 0; }
.prose h3 { font-size: 15px; margin: 14px 0 4px; }
.prose p { margin: 0 0 10px; }
.prose p:last-child { margin-bottom: 0; }
.prose ul { padding-left: 20px; margin: 0 0 10px; }
.prose li { margin: 4px 0; }
.small { font-size: 13px; }
.note { margin: 0; color: var(--muted); font-size: 14px; }
.button { display: inline-block; padding: 8px 14px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; text-decoration: none; }
.jump { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 14px; font-weight: 600; margin: -4px 2px; }
.page .ad-slot { margin: 0; }

.table-card { padding: 8px 0; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.climate-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.climate-table caption { text-align: left; padding: 4px 18px 10px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.climate-table th, .climate-table td { padding: 6px 8px; text-align: right; white-space: nowrap; }
.climate-table thead th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.climate-table thead th:first-child, .climate-table th[scope="row"] { text-align: left; padding-left: 18px; position: sticky; left: 0; background: var(--card); }
.climate-table th[scope="row"] { font-weight: 600; }
.climate-table th[scope="row"] small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.climate-table th[scope="row"] a { text-decoration: none; }
.climate-table th[scope="row"] a:hover { text-decoration: underline; }
.climate-table .group th { position: static; text-align: left; padding: 14px 18px 4px; color: var(--accent); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.climate-table td[style] { color: #1c2622; }
.climate-table .sky { text-align: left; }
.climate-table.detail tbody tr:nth-child(even) > * { background: color-mix(in srgb, var(--line) 35%, var(--card)); }

.chart { width: 100%; height: auto; display: block; margin-top: 6px; }
.chart text { fill: var(--text); font-size: 11px; font-weight: 600; text-anchor: middle; font-family: inherit; }
.chart .m, .chart .lo { fill: var(--muted); font-weight: 400; }
.chart .zero { stroke: var(--line); stroke-dasharray: 3 3; }
.chart .grid { stroke: var(--line); }
.chart .t { text-anchor: end; fill: var(--muted); font-weight: 400; }
.legend-row { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 8px 0 0; font-size: 13px; font-weight: 600; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row i { width: 12px; height: 12px; border-radius: 3px; }

/* the county section: links between its pages, the compare form, rankings and records */
.subnav { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: -4px 0 -6px; font-size: 14px; font-weight: 600; }
.subnav a { padding: 4px 10px; border-radius: 999px; color: var(--muted); text-decoration: none; border: 1px solid transparent; }
.subnav a:hover { color: var(--text); border-color: var(--line); }
.subnav a[aria-current] { color: var(--accent); border-color: var(--accent); }
.climate-table td.total, .climate-table tr.total th, .climate-table tr.total td { font-weight: 700; }
.climate-table tr.total th, .climate-table tr.total td { border-top: 1px solid var(--line); }
.climate-table.detail tbody tr.me > * { background: var(--accent-soft); }
.compare-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin: 12px 0 0; }
.compare-form label { display: grid; gap: 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.compare-form select { min-width: 150px; font-size: 15px; color: var(--text); }
.compare-form button { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.rank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px 24px; }
.rank-grid h3 { margin: 10px 0 2px; }
.rank-grid ol { margin: 0; padding-left: 22px; }
.rank-grid li { margin: 3px 0; }
.rank-grid a { font-weight: 600; text-decoration: none; }
.rank-grid a:hover { text-decoration: underline; }
.record-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin: 10px 0 12px; }
.record { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; }
.record h4 { margin: 0 0 2px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.prose h3.record-group { margin: 18px 0 0; color: var(--accent); font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
.record .record-value { font-size: 24px; font-weight: 700; line-height: 1.2; margin: 0 0 6px; color: var(--accent); }
.record p { margin: 0 0 6px; }
.record p:last-child { margin: 0; }
.jump { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; font-size: 14px; font-weight: 600; }
.jump a { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); text-decoration: none; }
.jump a:hover { border-color: var(--accent); }
.record-list { display: grid; grid-template-columns: minmax(150px, max-content) 1fr; gap: 8px 18px; margin: 10px 0 0; }
.record-list dt { font-weight: 700; }
.record-list dd { margin: 0; }
@media (max-width: 560px) { .record-list { grid-template-columns: 1fr; gap: 2px; } .record-list dd { margin-bottom: 10px; } }
.record-table thead th { text-align: left; }
.record-table td { text-align: left; white-space: normal; min-width: 150px; vertical-align: top; }
@media (max-width: 560px) { .record-table td { min-width: 132px; } .record-table th[scope="row"] { padding-right: 4px; } }
#all-time, #years, #months, #events, #counties, #sources, .table-card[id] { scroll-margin-top: 72px; }
.record-table td strong { display: block; font-variant-numeric: tabular-nums; }
.record-table td small { display: block; color: var(--muted); font-size: 12px; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.timeline .year { font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; padding-top: 1px; }
.timeline h3 { margin: 0; }
.timeline p { margin: 2px 0 0; }
.prose .timeline p.small { margin: 0 0 4px; }

.zone h2 { font-size: 18px; margin: 0 0 6px; color: var(--text); text-transform: none; letter-spacing: 0; }
.zone h2 .muted { font-weight: 400; font-size: 14px; margin-left: 6px; }
.offsets { margin: 0 0 8px; }
.clocks { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 24px; }
.clocks li { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.clocks time { font-variant-numeric: tabular-nums; font-weight: 600; }

.town-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 2px 12px; }
.prose .town-list { padding: 0 0 0 8px; margin: 0 0 10px; }
.town-list a { display: block; padding: 4px 0; font-weight: 600; text-decoration: none; }
.town-list a:hover { text-decoration: underline; }

.intro { margin: 16px 16px 0; padding: 12px 18px; }
.intro h2 { margin: 0 0 4px; }
.intro p { margin: 0 0 6px; color: var(--muted); font-size: 14px; }
.intro p:last-child { margin: 0; }
.intro .popular a { font-weight: 600; text-decoration: none; }
.intro .popular a:hover { text-decoration: underline; }
@media (max-width: 600px) { .intro .popular { display: none; } } /* the map stays near the top on phones */
.site-links { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 4px 16px; font-size: 14px; font-weight: 600; }

.footer { padding: 8px 16px 24px; color: var(--muted); font-size: 13px; }

.error { color: var(--red); }
.climate-table .rank { display: inline-block; min-width: 26px; color: var(--muted); font-weight: 600; }
.table-card .table-note { padding: 10px 18px 2px; font-size: 13px; }
.town-form { margin-top: 8px; }
.sports thead th { vertical-align: bottom; }
.sports thead th .day, .sports thead th .wind { display: block; color: var(--text); text-transform: none; letter-spacing: 0; }
.sports thead th .day { font-size: 13px; }
.sports thead th .wind { font-size: 16px; font-weight: 700; margin-top: 2px; }
.sports thead th small { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; margin-top: 2px; }
/* Verdicts as soft pills, one per cell, with white space between them so the
   grid reads as chips rather than blocks of colour. */
.sports td.v { text-align: center; font-weight: 600; padding: 3px 4px; }
.sports td.v span { display: block; padding: 5px 6px; border-radius: 999px; font-size: 13px; line-height: 1.3; }
/* Traffic lights: green, amber and red for the wind, grey for too little of it. */
.sports td.good span, .sports-key .good, .now-list .good .k { background: var(--good-bg); color: var(--good-ink); }
.sports td.moderate span, .sports-key .moderate, .now-list .moderate .k { background: var(--mod-bg); color: var(--mod-ink); }
.sports td.windy span, .sports-key .windy, .now-list .windy .k { background: var(--windy-bg); color: var(--windy-ink); }
.sports td.light span, .sports-key .light, .now-list .light .k { background: var(--light-bg); color: var(--light-ink); }
.sports td.unknown { color: var(--muted); }
.sports-key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 18px 2px; font-size: 13px; color: var(--muted); }
.sports-key i { display: inline-block; width: 14px; height: 14px; border-radius: 999px; margin-right: 6px; vertical-align: -2px; }
.limits thead th { text-align: left; }
.limits td { white-space: normal; text-align: left; min-width: 120px; }
.limits td small { color: var(--muted); }
.limits td small.muted { display: block; }
.glance li, .notes li { margin: 4px 0; }
.sports thead th { padding: 6px 6px 8px; }
.sports thead th:not(:first-child) { text-align: center; }

/* The Sports page banner: a sea-to-land gradient with the sport pictograms drifting behind the text. */
.sports-hero { position: relative; overflow: hidden; border-color: transparent; color: #fff; background: linear-gradient(118deg, #0d3a58, #1b6e8f 52%, #2f7d5b); padding: 24px 22px 22px; }
.sports-hero .hero-art { position: absolute; inset: 0; width: 100%; height: 100%; color: #fff; opacity: .22; pointer-events: none; }
.sports-hero .wave { fill: none; stroke: currentColor; stroke-width: 3; opacity: .7; }
@media (min-width: 700px) { .sports-hero .hero-art.tall { display: none; } .sports-hero .hero-art { -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .4), #000 62%); mask-image: linear-gradient(90deg, rgba(0, 0, 0, .4), #000 62%); } }
@media (max-width: 699px) { .sports-hero .hero-art.wide { display: none; } .sports-hero .hero-art { opacity: .17; } }
.sports-hero .hero-text { position: relative; max-width: 660px; }
.sports-hero h1 { color: #fff; text-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.sports-hero p { color: rgba(255, 255, 255, .94); text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.sports-hero a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.sports-hero .compare-form label { color: rgba(255, 255, 255, .9); }
.sports-hero .compare-form button { background: #fff; color: #0d3a58; border-color: #fff; }
.sports-hero .compare-form button:hover { background: #e3f1ea; }
.float { animation: float 6s ease-in-out infinite alternate; }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-7px); } }
@media (prefers-reduced-motion: reduce) { .float { animation: none; } }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Sport pictograms: green on land, blue on the water. */
.sp { width: 20px; height: 20px; vertical-align: -5px; margin-right: 8px; color: var(--accent); }
.water .sp { color: var(--water); }
.sports .group th, .limits .group th { background: linear-gradient(90deg, var(--accent-soft), transparent 60%); }
.sports .group.water th, .limits .group.water th { color: var(--water); background: linear-gradient(90deg, var(--water-soft), transparent 60%); }
.glance { list-style: none; padding: 0; }
.notes { list-style: none; padding: 0; margin: 0 0 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 10px; }
.notes li { margin: 0; display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; }
.notes .badge { width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.notes li.water .badge { background: var(--water-soft); color: var(--water); }
.notes .badge .sp { width: 26px; height: 26px; margin: 0; vertical-align: 0; color: inherit; }

/* Next 3 hours: an hour tile each, then the sports sorted by how they fare in the windiest of them. */
.now-card h2 { margin-bottom: 12px; }
.now-hours { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.now-hour { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--line) 35%, var(--card)); text-align: center; }
.now-hour .t { font-size: 13px; font-weight: 600; color: var(--text); }
.now-hour .t small { font-weight: 400; color: var(--muted); }
.now-hour .w { font-size: 20px; font-weight: 700; }
.now-hour > small { font-size: 12px; color: var(--muted); }
.now-sum { margin: 12px 0 8px; font-size: 14px; }
.now-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.now-list li { display: grid; grid-template-columns: 118px 1fr; gap: 6px 10px; align-items: start; }
.now-list .k { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; text-align: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; padding: 3px 10px 3px 7px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; }
.chip .sp { width: 18px; height: 18px; margin-right: 5px; vertical-align: 0; }
@media (max-width: 480px) { .now-list li { grid-template-columns: 1fr; } .now-hour { padding: 8px 6px; } .now-hour .w { font-size: 17px; } .now-hour > small { font-size: 11px; } }
.tabs .sep { flex: none; width: 1px; margin: 5px 4px; background: var(--line); }
/* Phones: the short label, and tighter pills so the tabs fit, or scroll, on a 360px screen. */
@media (max-width: 480px) {
  .tabs { padding: 6px 8px; gap: 2px; }
  .tabs a { padding: 6px 9px; font-size: 13.5px; }
  .tabs .sep { margin: 5px 3px; }
  .tabs .wide { display: none; }
}
.guide-list { list-style: none; padding: 0; margin: 0; }
.guide-list li { margin: 0 0 14px; }
.guide-list li:last-child { margin-bottom: 0; }
.guide-list a { font-weight: 700; font-size: 17px; text-decoration: none; }
.guide-list a:hover { text-decoration: underline; }
.guide-list p { margin: 2px 0 0; }
.guide-list.compact li { margin: 0 0 6px; }
.guide-list.compact a { font-size: 15px; font-weight: 600; }
.guide-meta a { font-weight: 600; text-decoration: none; }
.guide .lead { font-size: 17px; color: var(--muted); margin-bottom: 14px; }
.guide .scroll { margin: 8px 0 12px; }
.guide-table th, .guide-table td { white-space: normal; text-align: left; vertical-align: top; }
.guide-table thead th:first-child, .guide-table th[scope="row"] { padding-left: 8px; }
.guide-table th[scope="row"] { min-width: 110px; }
