/* White Squirrel Weather — site styles
 * Type and colour follow the WKU Disaster Science Operations Center (wkudsoc.org):
 * Neue Haas Grotesk (falling back to Helvetica Neue / Helvetica / Arial), black, carbon and #be141b red.
 * The live dashboard borrows the DSOC event-dashboard pattern: a dimmed brand backdrop, big clock,
 * alert bar, rounded tiles with a red top edge and 24H history badges, and a heat-stress flag with its scale. Graphics are the original White Squirrel Weather art.
 */

:root {
	--red: #be141b;
	--red-bright: #e3262d;
	--black: #000000;
	--bg: #070707;
	--panel: rgba(14, 14, 16, 0.82);
	--panel-solid: #111113;
	--ink: #222222;
	--carbon: #333333;
	--line: #2a2a2d;
	--gray-mid: #555555;
	--gray-muted: #8a8a8a;
	--gray-line: #cccccc;
	--gray-bg: #efefef;
	--white: #ffffff;
	--sky: #3b8fe0;
	--sun: #f2b01e;
	--ok: #2fa84f;
	--font-display: "Neue Haas Grotesk Display Pro", "neue-haas-grotesk-display", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--font-body: "Neue Haas Grotesk Text Pro", "neue-haas-grotesk-text", "Helvetica Neue", Helvetica, Arial, sans-serif;
	--container: 1320px;
	--pad-x: max(clamp(1rem, 3vw, 2.5rem), env(safe-area-inset-left), env(safe-area-inset-right));
	--header-h: 3.75rem;
	--radius: 1.25rem;
	--gap: 1.1rem;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--gray-bg);
	font: 400 1rem/1.55 var(--font-body);
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}
/* The WSWX squirrel backdrop, dimmed so the numbers stay readable. */
body::before {
	content: ""; position: fixed; inset: 0; z-index: -2;
	background:
		linear-gradient(180deg, rgba(5, 5, 6, .55) 0%, rgba(5, 5, 6, .7) 50%, rgba(5, 5, 6, .9) 100%),
		url("../img/wswx-backdrop.jpg") right center / cover no-repeat;
}
/* Fine film grain. */
body::after {
	content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none; opacity: .07;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
p { margin: 0; }
img { max-width: 100%; }
a { color: inherit; }
.wrap { width: min(var(--container), 100% - 2 * var(--pad-x)); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; z-index: 100; background: var(--white); color: var(--black); padding: 8px 12px; }

h2 {
	font: 700 clamp(1.8rem, 4vw, 2.8rem)/1.05 var(--font-display);
	text-transform: uppercase; letter-spacing: -0.01em; margin: 0.6rem 0 1.75rem;
}
h2 em, h3 em { font-style: normal; color: var(--red); }
.section--dark h2 em { color: var(--red-bright); }

.label {
	font: 600 0.72rem/1.3 var(--font-display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gray-muted);
}
.eyebrow {
	font: 500 0.72rem/1.3 var(--font-display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gray-muted);
	display: flex; align-items: center; gap: 0.65rem;
}
.eyebrow::before { content: ""; width: 0.5rem; height: 0.5rem; background: var(--red); flex: none; }
.section--dark .eyebrow { color: var(--gray-line); }

.btn {
	display: inline-block; font: 600 0.82rem/1 var(--font-body); letter-spacing: 0.09em; text-transform: uppercase;
	text-decoration: none; padding: 0.95rem 1.6rem; border: 1px solid transparent;
	transition: background-color .18s, color .18s, border-color .18s;
}
.btn--sm { padding: 0.6rem 1rem; font-size: 0.72rem; }
.btn--alert { background: var(--red); color: var(--white); }
.btn--alert:hover { background: var(--white); color: var(--black); }
.btn--ghost { border-color: var(--gray-muted); color: inherit; }
.btn--ghost:hover { border-color: currentColor; }

.live-dot { width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--red-bright); flex: none; animation: blip 2.4s ease-out infinite; }
.live-dot.stale { background: var(--gray-muted); animation: none; }
@keyframes blip {
	0% { box-shadow: 0 0 0 0 rgba(227, 38, 45, .6); }
	70% { box-shadow: 0 0 0 0.7rem rgba(227, 38, 45, 0); }
	100% { box-shadow: 0 0 0 0 rgba(227, 38, 45, 0); }
}

/* ---------- Header ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: rgba(0, 0, 0, .88); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); color: var(--white); }
.topbar-inner { display: flex; align-items: center; gap: 1.75rem; height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; }
.brand img { border-radius: 50%; }
.brand span { display: flex; flex-direction: column; line-height: 1.15; }
.brand strong { font: 700 0.9rem/1.1 var(--font-display); text-transform: uppercase; letter-spacing: 0.08em; white-space: nowrap; }
.nav { display: flex; gap: 1.6rem; margin-left: auto; }
.nav a {
	font: 500 0.72rem/1 var(--font-display); letter-spacing: 0.18em; text-transform: uppercase;
	text-decoration: none; color: var(--gray-line); padding: 0.4rem 0; border-bottom: 1px solid transparent;
}
.nav a:hover { color: var(--white); border-bottom-color: var(--red-bright); }

/* ---------- Tiles (shared) ---------- */
.tile {
	position: relative;
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	padding: 1.4rem 1.6rem;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
	min-width: 0;
}
[data-chart] { cursor: pointer; }
[data-chart]:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 3px; }
.hx-hint {
	position: absolute; top: 1rem; right: 1.1rem;
	font: 700 0.6rem/1 var(--font-display); letter-spacing: 0.12em; color: var(--gray-muted);
	border: 1px solid var(--gray-mid); border-radius: 0.35rem; padding: 0.3rem 0.4rem;
	transition: color .18s, border-color .18s;
}
[data-chart]:hover .hx-hint { color: var(--white); border-color: var(--red-bright); }
body.no-history .hx-hint { display: none; }
body.no-history [data-chart] { cursor: default; }

/* ---------- Dashboard ---------- */
.dash { padding: 1.6rem 0 1rem; display: flex; flex-direction: column; gap: var(--gap); }
.dash-top { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 1.5rem; }
.event { display: flex; flex-direction: column; gap: 0.5rem; }
.wordmark { width: min(330px, 100%); height: auto; display: block; }
.event-sub {
	display: flex; align-items: center; gap: 0.7rem;
	font: 600 0.78rem/1.3 var(--font-display); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gray-line);
}
.dash-logo { justify-self: end; width: 5.4rem; height: 5.4rem; border-radius: 50%; }

/* Day, date, local time | Zulu time, resting on the alert bar and flush with its right edge */
.timebar {
	display: flex; justify-content: flex-end; align-items: baseline; gap: 0.9rem; flex-wrap: wrap;
	margin: 0 0 calc(-1 * var(--gap) + 0.45rem);
	font: 500 0.82rem/1.2 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-muted);
	font-variant-numeric: tabular-nums;
}
#tb-local, #tb-z { color: var(--gray-line); letter-spacing: 0.08em; }
#tb-z b { color: var(--red-bright); font-weight: 700; }
.tb-sep { color: var(--gray-mid); }

/* Alert bar */
.alertbar {
	display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 1.4rem;
	background: var(--panel); border: 1px solid var(--line); border-left: 0.35rem solid var(--ok);
	border-radius: 0.9rem; padding: 0.8rem 1.3rem; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.alertbar-label {
	display: flex; align-items: center; gap: 0.6rem; white-space: nowrap;
	font: 700 0.72rem/1 var(--font-display); letter-spacing: 0.2em; text-transform: uppercase; color: var(--gray-line);
}
.alertbar-label svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: var(--ok); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.alertbar-list { display: flex; flex-wrap: wrap; gap: 0.5rem; font: 600 0.95rem/1.3 var(--font-display); color: var(--white); min-width: 0; }
.alertbar-list button {
	font: 700 0.75rem/1 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer;
	border: 0; border-radius: 0.4rem; padding: 0.5rem 0.75rem; background: var(--red); color: var(--white);
}
.alertbar-meta { font: 500 0.66rem/1.3 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-muted); white-space: nowrap; }
.alertbar[data-level="warning"] { border-left-color: var(--red-bright); background: rgba(80, 8, 10, .82); }
.alertbar[data-level="warning"] svg { stroke: var(--red-bright); }
.alertbar[data-level="watch"] { border-left-color: #e08a00; }
.alertbar[data-level="watch"] svg { stroke: #e08a00; }
.alertbar[data-level="watch"] .alertbar-list button { background: #b8620b; }
.alertbar[data-level="advisory"] { border-left-color: #f2c200; }
.alertbar[data-level="advisory"] svg { stroke: #f2c200; }
.alertbar[data-level="advisory"] .alertbar-list button { background: #5a4ab0; }
.alertbar[data-level="loading"] { border-left-color: var(--gray-mid); }
.alertbar[data-level="loading"] svg { stroke: var(--gray-muted); }
.alert-details { background: var(--panel); border: 1px solid var(--line); border-radius: 0.9rem; padding: 1.1rem 1.4rem; }
.alert-details h4 { margin: 0 0 0.5rem; font: 700 1rem/1.3 var(--font-display); text-transform: uppercase; }
.alert-details p { white-space: pre-line; color: var(--gray-line); font-size: 0.92rem; }

/* Station switcher */
.stationbar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.station-seg { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 0.7rem; padding: 0.25rem; gap: 0.25rem; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.station-seg button {
	background: none; border: 0; border-radius: 0.5rem; cursor: pointer; color: var(--gray-line);
	font: 600 0.7rem/1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; padding: 0.65rem 0.95rem; white-space: nowrap;
	transition: background-color .18s, color .18s;
}
.station-seg button:hover { color: var(--white); }
.station-seg button[aria-pressed="true"] { background: var(--red); color: var(--white); }
.dash.loading .acorn-temp, .dash.loading .metric-value, .dash.loading .now-hilo dd { opacity: .35; transition: opacity .2s; }

/* Main: conditions (acorn + readings) and forecast */
.dash-main { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: var(--gap); }
.acorn-tile { display: flex; flex-direction: column; gap: 0.8rem; }
.tile-head { display: flex; justify-content: space-between; gap: 1rem; }
.acorn-body { flex: 1; display: grid; grid-template-columns: minmax(200px, 0.8fr) minmax(0, 1.25fr); align-items: center; gap: 1.4rem; }
.acorn-fig { position: relative; margin: 0; width: 100%; max-width: 310px; justify-self: center; container-type: inline-size; border-radius: 1rem; }
.acorn-fig .hx-hint { top: 0; right: 0; }
.acorn-fig img { width: 100%; height: auto; display: block; filter: drop-shadow(0 12px 30px rgba(0, 0, 0, .5)); }
/* Centred on the acorn's green body (the lower ~60% of the art). */
.acorn-read {
	position: absolute; left: 4%; right: 4%; top: 38%; bottom: 14%;
	display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
}
.acorn-temp {
	font: 700 32cqw/0.9 var(--font-display); letter-spacing: -0.04em; color: var(--white);
	text-shadow: 0 2px 18px rgba(0, 0, 0, .35); font-variant-numeric: tabular-nums;
	padding-left: 0.08em; /* balance the degree sign */
}
.acorn-feels { font: 500 6.4cqw/1.3 var(--font-display); color: rgba(255, 255, 255, .88); margin-top: 3cqw; text-shadow: 0 1px 8px rgba(0, 0, 0, .45); }
.acorn-feels b { color: var(--white); font-weight: 700; }
.tile-foot { font: 500 0.66rem/1.4 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-muted); }
/* Station footer: source and time on the left, update note on the right (stacks on narrow screens) */
.tile-foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0 1.5rem; }

/* Readings, set inside the conditions tile to the right of the acorn */
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }
.metric {
	position: relative; min-width: 0;
	background: rgba(255, 255, 255, .035); border: 1px solid var(--line); border-top: 0.25rem solid var(--red); border-radius: 0.9rem;
	display: flex; flex-direction: column; justify-content: space-between; gap: 0.45rem; padding: 0.85rem 1rem 0.95rem;
}
.metric .hx-hint { top: 0.7rem; right: 0.7rem; }
.metric-value { font: 700 2.25rem/0.95 var(--font-display); letter-spacing: -0.02em; color: var(--white); font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-value small { font-size: 0.42em; font-weight: 600; color: var(--gray-muted); margin-left: 0.2rem; letter-spacing: 0; }
.metric-note { font: 500 0.82rem/1.3 var(--font-display); color: var(--gray-line); min-height: 1.1em; }
.bar { height: 0.4rem; border-radius: 1rem; background: #262628; overflow: hidden; position: relative; }
.bar span { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--sky); border-radius: inherit; transition: width .8s; }
/* Humidity: light brown (dry) to dark green (humid); the gradient spans the whole track, so the fill's end colour matches the reading. */
.bar--rh span { background: linear-gradient(90deg, #8b6347 0%, #715742 22%, #4d4337 42%, #7c7563 55%, #d9d4ba 65%, #c3e6b4 70%, #7fcb6f 78%, #3ea33a 87%, #17621a 100%); background-repeat: no-repeat; }
.bar--uv { background: linear-gradient(90deg, #3aa757, #f5d000, #f28c00, #e1301e, #8e3ab5); overflow: visible; }
.bar--uv span { width: 0.35rem !important; height: 0.9rem; top: -0.25rem; background: var(--white); left: 0; transition: left .8s; }
.wind-row { display: flex; align-items: center; gap: 0.8rem; }
.compass { position: relative; width: 3.2rem; height: 3.2rem; flex: none; border-radius: 50%; border: 2px solid var(--gray-mid); }
.compass .n { position: absolute; top: 0.2rem; left: 50%; transform: translateX(-50%); font: 700 0.58rem/1 var(--font-display); color: var(--gray-muted); }
.compass svg { position: absolute; inset: 0.3rem; width: calc(100% - 0.6rem); height: calc(100% - 0.6rem); transition: transform 1s cubic-bezier(.3, 1.4, .5, 1); }
.compass path { fill: var(--red-bright); }
.metric-value.calm span { font-size: 0.75em; }


/* Forecast column */
.dash-fc { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

/* Heat stress flag */
.wbgt {
	--flag: #555;
	display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1.5fr); align-items: center; gap: 1.6rem;
	background: linear-gradient(90deg, color-mix(in srgb, var(--flag) 26%, rgba(14, 14, 16, .82)) 0%, var(--panel) 45%);
	transition: background .8s;
}
.wbgt[data-band="0"] { --flag: #3aa757; }
.wbgt[data-band="1"] { --flag: #f5d000; }
.wbgt[data-band="2"] { --flag: #f28c00; }
.wbgt[data-band="3"] { --flag: #e1301e; }
.wbgt[data-band="4"] { --flag: #8e3ab5; }
.flag svg { width: 4.6rem; height: 6.2rem; display: block; overflow: visible; }
.flag .pole { fill: #bdbdbd; }
.flag .cloth { fill: var(--flag); transform-origin: 14px 44px; animation: wave 3.2s ease-in-out infinite; transition: fill .8s; }
@keyframes wave { 0%, 100% { transform: skewY(0deg) scaleX(1); } 50% { transform: skewY(-3deg) scaleX(.97); } }
.wbgt-read { display: flex; flex-direction: column; gap: 0.2rem; }
.wbgt-value { font: 700 3rem/1 var(--font-display); color: var(--white); font-variant-numeric: tabular-nums; margin-top: 0.2rem; }
.wbgt-value small { font-size: 0.4em; color: var(--gray-muted); margin-left: 0.2rem; }
.wbgt-band { font: 700 1.25rem/1.2 var(--font-display); text-transform: uppercase; letter-spacing: 0.04em; color: var(--flag); }
.wbgt[data-band="-1"] .wbgt-band { color: var(--gray-muted); }
.wbgt-advice { font: 500 0.86rem/1.35 var(--font-display); color: var(--gray-line); }
.scale { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.4rem; }
.seg { display: flex; align-items: center; gap: 0.55rem; padding: 0.45rem 0.55rem; border-radius: 0.5rem; border: 1px solid transparent; color: var(--gray-muted); transition: border-color .6s, color .6s; }
.seg i { width: 1rem; height: 1rem; border-radius: 0.25rem; flex: none; opacity: .45; }
.seg span { display: flex; flex-direction: column; font: 500 0.66rem/1.2 var(--font-display); }
.seg b { font: 700 0.7rem/1.2 var(--font-display); letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; }
.seg[data-band="0"] i { background: #3aa757; }
.seg[data-band="1"] i { background: #f5d000; }
.seg[data-band="2"] i { background: #f28c00; }
.seg[data-band="3"] i { background: #e1301e; }
.seg[data-band="4"] i { background: #8e3ab5; }
.seg.on { border-color: var(--gray-line); color: var(--white); }
.seg.on i { opacity: 1; }

/* ---------- Rows below the dashboard ---------- */
.row { display: grid; gap: var(--gap); padding: var(--gap) 0 0; }
.row--live { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.row--sky { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 4rem; }
.radarsat .stage { aspect-ratio: auto; flex: 1; min-height: 300px; }

.theater { padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.tabs { display: flex; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button {
	background: none; border: 0; border-bottom: 2px solid transparent; color: var(--gray-muted); cursor: pointer;
	font: 600 0.72rem/1 var(--font-display); letter-spacing: 0.18em; text-transform: uppercase;
	padding: 1.05rem 1.3rem 0.95rem; white-space: nowrap;
}
.tabs button:hover { color: var(--white); }
.tabs button[aria-selected="true"] { color: var(--white); border-bottom-color: var(--red-bright); }
.stage { position: relative; aspect-ratio: 16 / 9; background: var(--black); }
.view { position: absolute; inset: 0; }
.view[hidden] { display: none; }
.view iframe { width: 100%; height: 100%; border: 0; display: block; }
.view img { width: 100%; height: 100%; object-fit: contain; display: block; }
/* Radar map (Leaflet) and the loop controls under radar / satellite */
.wx-map { width: 100%; height: 100%; background: #0e0e10; }
.wx-map .leaflet-control-attribution { background: rgba(0, 0, 0, .55); color: var(--gray-muted); font-size: 0.6rem; }
.wx-map .leaflet-control-attribution a { color: var(--gray-line); }
.wx-map .leaflet-bar a { background: rgba(18, 18, 20, .9); color: var(--white); border-color: var(--line); }
.wx-map .leaflet-bar a:hover { background: var(--red); }
.loop-msg { position: absolute; inset: auto 1rem 1rem; z-index: 500; margin: 0; padding: 0.6rem 0.8rem; border-radius: 0.5rem; background: rgba(0, 0, 0, .7); color: var(--white); font-size: 0.8rem; text-align: center; }
.loop-msg[hidden] { display: none; }
.loop-bar { display: flex; align-items: center; gap: 0.6rem; padding: 0.4rem 1.3rem 0.4rem 0.9rem; border-top: 1px solid var(--line); }
#loop-range { flex: 1; min-width: 60px; accent-color: var(--red-bright); height: 2.1rem; touch-action: pan-x; }
.view--light { background: var(--white); }
/* Campus cam timelapse: frame fills the stage, controls float along the bottom */
.lapse img { object-fit: cover; }
.lapse-msg[hidden] { display: none; }
/* Temperature and wind at the time of the frame on screen */
.lapse-wx { position: absolute; top: 0.7rem; left: 0.7rem; z-index: 2; margin: 0; padding: 0.35rem 0.65rem; border-radius: 0.4rem; background: rgba(0, 0, 0, .55); color: var(--white); font: 600 clamp(0.72rem, 1.6vw, 0.95rem)/1.2 var(--font-display); white-space: pre; pointer-events: none; }
.lapse-wx[hidden] { display: none; }
.lapse-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; font: 500 0.85rem/1.4 var(--font-display); color: var(--gray-line); text-align: center; padding: 1rem; }
/* Tabs and, for the timelapse, its controls share the header row */
.theater-head { display: flex; align-items: center; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.theater-head .tabs { border-bottom: 0; flex: none; }
.lapse-bar { flex: 1 1 auto; min-width: min-content; display: flex; align-items: center; gap: 0.7rem; padding: 0.35rem 1rem 0.35rem 0.4rem; }
.lapse-bar[hidden] { display: none; }
.lapse-play, .lapse-speed { flex: none; display: grid; place-items: center; min-width: 2.1rem; height: 2.1rem; border: 0; border-radius: 50%; background: var(--red); color: var(--white); cursor: pointer; }
.lapse-play svg { width: 0.9rem; height: 0.9rem; fill: currentColor; }
.lapse-transport { flex: none; display: flex; align-items: center; gap: 0.15rem; }
.lapse-step { flex: none; display: grid; place-items: center; width: 1.8rem; height: 2.1rem; border: 0; border-radius: 0.5rem; background: none; color: var(--gray-line); cursor: pointer; }
.lapse-step svg { width: 0.85rem; height: 0.85rem; fill: currentColor; }
.lapse-step:hover, .lapse-step:focus-visible { background: rgba(255, 255, 255, .1); color: var(--white); outline: none; }
.lapse-save { flex: none; display: grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: 0.5rem; background: rgba(255, 255, 255, .1); color: var(--gray-line); }
.lapse-save:hover, .lapse-save:focus-visible { background: var(--red); color: var(--white); outline: none; }
.lapse-wx-btn[aria-pressed="true"] { color: var(--white); box-shadow: inset 0 0 0 1.5px var(--red-bright); }
/* Export menu: drops down over the top-right of the picture */
.lapse-menu { position: absolute; top: 0.6rem; right: 0.6rem; z-index: 5; width: min(17rem, calc(100% - 1.2rem)); max-height: calc(100% - 1.2rem); overflow-y: auto; overscroll-behavior: contain; padding: 0.8rem; border: 1px solid var(--line); border-radius: 0.8rem; background: rgba(18, 18, 20, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); box-shadow: 0 12px 30px rgba(0, 0, 0, .45); }
.lapse-menu[hidden], .lapse-menu [hidden] { display: none; }
.lapse-menu .card-kicker { margin: 0 0 0.5rem; color: var(--red-bright); }
.lapse-menu-list a, .lapse-menu-list button { display: flex; flex-direction: column; gap: 0.15rem; width: 100%; padding: 0.55rem 0.65rem; border: 0; border-radius: 0.5rem; background: none; color: var(--white); text-align: left; text-decoration: none; cursor: pointer; font: inherit; }
.lapse-menu-list a:hover, .lapse-menu-list button:hover, .lapse-menu-list a:focus-visible, .lapse-menu-list button:focus-visible { background: rgba(255, 255, 255, .09); outline: none; }
.lapse-menu-list strong { font: 700 0.85rem/1.2 var(--font-display); }
.lapse-menu-list span { font-size: 0.74rem; color: var(--gray-line); }
.lapse-range-pick { display: grid; gap: 0.4rem; margin-top: 0.3rem; padding: 0.6rem 0.65rem 0.2rem; border-top: 1px solid var(--line); }
.lapse-range-pick label { display: grid; grid-template-columns: 2.6rem 1fr; align-items: center; font-size: 0.74rem; color: var(--gray-line); }
.lapse-range-pick select { min-width: 0; padding: 0.35rem 0.4rem; border: 1px solid var(--line); border-radius: 0.4rem; background: var(--black); color: var(--white); font: 600 0.78rem/1.2 var(--font-display); }
.lapse-menu-list .lapse-range-go { align-items: center; margin-top: 0.2rem; background: var(--red); }
.lapse-menu-list .lapse-range-go:hover, .lapse-menu-list .lapse-range-go:focus-visible { background: var(--red-bright); }
.lapse-menu-list .lapse-range-go span { color: var(--white); font: 700 0.8rem/1.2 var(--font-display); }
.lapse-menu-list .lapse-range-go:disabled { opacity: .45; cursor: default; }
.lapse-menu-status { margin: 0 0 0.6rem; font: 600 0.82rem/1.3 var(--font-display); color: var(--white); font-variant-numeric: tabular-nums; }
.lapse-menu .bar span { background: var(--red-bright); transition: width .2s; }
.lapse-menu-cancel { margin-top: 0.7rem; padding: 0.45rem 0.9rem; border: 1px solid var(--gray-mid); border-radius: 999px; background: none; color: var(--white); font: 600 0.78rem/1 var(--font-display); cursor: pointer; }
.lapse-menu-cancel:hover { border-color: var(--red-bright); }
.lapse-save { border: 0; cursor: pointer; }
.lapse-save[aria-expanded="true"] { background: var(--red); color: var(--white); }
.lapse-pop .i-close, .lapse-pop[aria-pressed="true"] .i-open { display: none; }
.lapse-pop[aria-pressed="true"] .i-close { display: inline; }
/* Large timelapse view: the panel floats centred over a dimmed page, 16:9 like the YouTube player */
.theater.is-pop {
	position: fixed; z-index: 90; left: 50%; top: 50%; transform: translate(-50%, -50%);
	/* 75% of the largest 16:9 size that fits the screen; phones still get nearly the full width */
	width: max(min(94vw, 360px), min(72vw, calc((100vh - 9rem) * 4 / 3))); width: max(min(94vw, 360px), min(72vw, calc((100dvh - 9rem) * 4 / 3)));
	box-shadow: 0 30px 80px rgba(0, 0, 0, .6);
}
.pop-shade { position: fixed; inset: 0; z-index: 89; background: rgba(0, 0, 0, .78); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
body.has-pop { overflow: hidden; }
.lapse-save svg { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lapse-play .i-pause, .lapse-play.is-playing .i-play { display: none; }
.lapse-play.is-playing .i-pause { display: inline; }
.lapse-speed { display: none; border-radius: 0.5rem; background: rgba(255, 255, 255, .12); font: 700 0.78rem/1 var(--font-display); }
.lapse-speeds { flex: none; display: flex; padding: 0.2rem; gap: 0.15rem; border-radius: 0.55rem; background: rgba(255, 255, 255, .1); }
.lapse-speeds button {
	min-width: 1.9rem; height: 1.7rem; padding: 0 0.4rem; border: 0; border-radius: 0.4rem; background: none; cursor: pointer;
	color: var(--gray-line); font: 700 0.74rem/1 var(--font-display); font-variant-numeric: tabular-nums;
}
.lapse-speeds button:hover { color: var(--white); }
.lapse-speeds button[aria-pressed="true"] { background: var(--red); color: var(--white); }
/* Time span and speed: compact dropdowns with a chevron */
.lapse-select {
	flex: none; height: 2.1rem; padding: 0 1.7rem 0 0.7rem; border: 0; border-radius: 0.5rem; cursor: pointer;
	field-sizing: content; /* as wide as the current choice, where supported */
	-webkit-appearance: none; appearance: none; color: var(--white); font: 700 0.78rem/1 var(--font-display); font-variant-numeric: tabular-nums;
	background: rgba(255, 255, 255, .12) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 0.6rem center / 0.6rem;
}
.lapse-select:hover { background-color: rgba(255, 255, 255, .2); }
.lapse-select:focus-visible { outline: 2px solid var(--red-bright); outline-offset: 1px; }
.lapse-select option { color: #000; background: #fff; }
.lapse-time { flex: none; min-width: 5.5rem; text-align: right; font: 600 0.78rem/1 var(--font-display); color: var(--white); font-variant-numeric: tabular-nums; }
#lapse-range { flex: 1; min-width: 60px; accent-color: var(--red-bright); height: 2.1rem; touch-action: pan-x; }
.stage-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.75rem 1.3rem; flex-wrap: wrap; }
.stage-caption { font: 500 0.64rem/1.5 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-muted); }
.stage-caption a { color: var(--gray-line); }
.radar-sites { display: flex; border: 1px solid var(--line); border-radius: 0.5rem; overflow: hidden; }
.radar-sites[hidden] { display: none; }
.radar-sites button {
	background: none; color: var(--gray-line); border: 0; cursor: pointer;
	font: 600 0.62rem/1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; padding: 0.55rem 0.8rem;
}
.radar-sites button + button { border-left: 1px solid var(--line); }
.radar-sites button[aria-pressed="true"] { background: var(--red); color: var(--white); }

.today { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; flex: 1; align-content: center; }
.period { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 0.3rem; min-width: 0; }
.period .label { letter-spacing: 0.14em; }
.period img { width: 100%; max-width: 150px; height: auto; aspect-ratio: 1; margin-top: 0.4rem; }
.period .t { font: 700 1.5rem/1 var(--font-display); color: var(--white); margin-top: 0.3rem; }
.period .s { font-size: 0.82rem; color: var(--gray-line); line-height: 1.3; }
.chance { font: 600 0.62rem/1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--sky); min-height: 0.7rem; }

/* Both forecast boxes jump to the full forecast below. */
.fc-link { text-decoration: none; color: inherit; transition: border-color .18s; }
.fc-link:hover, .fc-link:focus-visible { border-color: var(--red-bright); outline: none; }
.outlook { display: flex; flex-direction: column; gap: 1rem; }
.outlook-days { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 0.6rem; }
.outlook-days div { display: flex; flex-direction: column; align-items: center; gap: 0.2rem; }
.outlook-days img { width: 100%; max-width: 116px; height: auto; aspect-ratio: 1; }
.outlook-days b { font: 700 0.74rem/1 var(--font-display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray-line); margin-top: 0.3rem; }
.outlook-days span { font: 700 1.15rem/1.2 var(--font-display); color: var(--white); }
.outlook-days span i { font-style: normal; color: var(--gray-muted); margin-left: 0.3rem; }
.outlook:hover 
.summary { display: flex; flex-direction: column; gap: 0.9rem; }
.sm-rain { font: 500 0.78rem/1.3 var(--font-display); color: var(--gray-muted); }
.sm-rain b { color: #3fbf5a; font-weight: 700; }
.sm-trace { position: relative; flex: 1; min-height: 160px; border-radius: 0.6rem; }
.sm-trace svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.sm-tick { stroke: var(--line); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.sm-marks { position: absolute; inset: 0; pointer-events: none; }
.sm-hour { position: absolute; bottom: 0.1rem; transform: translateX(4px); font: 600 0.6rem/1 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-mid); }
.sm-pin { position: absolute; width: 0.6rem; height: 0.6rem; margin: -0.3rem 0 0 -0.3rem; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--panel-solid), 0 0 14px var(--c); }
.sm-pin b { position: absolute; left: 50%; transform: translateX(-50%); font: 700 0.95rem/1 var(--font-display); color: var(--c); white-space: nowrap; }
.sm-pin.is-hi b { bottom: 0.95rem; }
.sm-pin.is-lo b { top: 0.95rem; }
.sm-pin.is-left b { left: auto; right: -0.2rem; transform: none; }
.sm-pin.is-right b { left: -0.2rem; transform: none; }
.sm-now { position: absolute; width: 0.5rem; height: 0.5rem; margin: -0.25rem 0 0 -0.25rem; border-radius: 50%; background: var(--white); animation: blip 2s infinite; }
.sm-trace:hover .sm-tick { stroke: var(--gray-mid); }
.sm-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; }
.sm-stat { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.75rem 0.85rem; border-radius: 0.7rem; background: rgba(255, 255, 255, .035); border: 1px solid var(--line); min-width: 0; }
.sm-stat span { font: 600 0.6rem/1 var(--font-display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--gray-muted); }
.sm-stat b { font: 700 1.45rem/1.05 var(--font-display); color: var(--white); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sm-stat i { font: 500 0.74rem/1.2 var(--font-display); font-style: normal; color: var(--gray-line); }
.sm-range { position: relative; height: 0.32rem; margin-top: 0.35rem; border-radius: 1rem; background: var(--line); }
.sm-range em { position: absolute; top: 0; bottom: 0; border-radius: 1rem; }
@media (max-width: 520px) { .sm-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.sunarc { width: 100%; max-height: 110px; display: block; margin-top: 0.8rem; }
.arc-track { fill: none; stroke: var(--gray-mid); stroke-width: 1.5; }
.arc-fill { fill: none; stroke: var(--sun); stroke-width: 2.5; }
.horizon { stroke: var(--gray-mid); stroke-width: 1; }
#sun-dot { fill: var(--sun); }
.sun-times { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 0.5rem; }
.sun-times p, .moon div { display: flex; flex-direction: column; line-height: 1.25; }
.sun-times .c { text-align: center; }
.sun-times .r { text-align: right; }
.sun-times span, .moon span { font: 600 0.6rem/1.7 var(--font-display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray-muted); }
.sun-times b, .moon b { font: 700 1rem/1.25 var(--font-display); color: var(--white); }
.moon-tile { display: flex; flex-direction: column; }
.moon { display: flex; align-items: center; gap: 1.4rem; margin: 1rem 0; flex: 1; }
.moon svg { width: 116px; height: 116px; flex: none; }
.moon b { font-size: 1.35rem; }
/* The next four phases, each with a small moon and its date */
.moon-phases { list-style: none; margin: 0; padding: 0.9rem 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; text-align: center; }
.moon-phases li { display: flex; flex-direction: column; align-items: center; gap: 0.25rem; }
.moon-phases svg { width: 30px; height: 30px; }
.moon-phases span { font: 600 0.58rem/1.3 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-muted); }
.moon-phases b { font: 700 0.8rem/1.2 var(--font-display); color: var(--white); white-space: nowrap; }

/* ---------- 24H chart dialog: a large wide card ---------- */
.chart-dialog {
	width: min(94vw, 1400px); height: min(88vh, 980px); height: min(88dvh, 980px); max-width: none; max-height: none;
	padding: 1.4rem 1.6rem 1.2rem;
	background: var(--panel-solid); color: var(--gray-bg); border: 1px solid var(--line); border-top: 0.3rem solid var(--red);
	border-radius: var(--radius);
}
.chart-dialog[open] { display: flex; flex-direction: column; }
.chart-dialog::backdrop { background: rgba(0, 0, 0, .7); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.chart-dialog, .map-dialog { transform-origin: center; backface-visibility: hidden; }
.chart-head { display: flex; align-items: flex-start; gap: 1rem; flex: none; }
.chart-head > div { flex: 1; }
.chart-head h3 { margin: 0.3rem 0 0; font: 700 1.6rem/1.1 var(--font-display); text-transform: uppercase; color: var(--white); }
.chart-read { font: 700 1rem/1.3 var(--font-display); color: var(--white); text-align: right; font-variant-numeric: tabular-nums; min-height: 2.6em; }
.chart-read span { display: block; font: 500 0.7rem/1.4 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-muted); }
.chart-close { background: none; border: 1px solid var(--gray-mid); color: var(--white); border-radius: 0.4rem; width: 2.2rem; height: 2.2rem; font-size: 1.3rem; line-height: 1; cursor: pointer; flex: none; }
.chart-close:hover { border-color: var(--red-bright); }
.chart-body { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-top: 1rem; }
.chart { width: 100%; flex: 1; min-height: 0; display: block; overflow: visible; touch-action: none; }
.chart .grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart .ylab { fill: var(--gray-muted); font: 500 11px var(--font-display); }
.chart .line { fill: none; stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.chart .line.dashed { stroke-width: 1.75; stroke-dasharray: 5 4; }
.chart .area { opacity: .32; }
.chart .rh-band { opacity: .85; }
.chart .cross { stroke: var(--gray-line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 0.5rem; padding-left: 44px; flex: none; font: 500 0.66rem/1 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-muted); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 0.6rem 1.6rem; margin-top: 0.9rem; flex: none; font: 500 0.78rem/1.2 var(--font-display); color: var(--gray-line); }
.chart-legend:empty { display: none; }
.chart-legend span { display: inline-flex; align-items: center; gap: 0.5rem; }
.key { display: inline-block; width: 1.6rem; height: 0.25rem; border-radius: 1rem; }
.key--dashed { -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 8px); mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 8px); }
.key--rh { width: 3rem; height: 0.7rem; border-radius: 0.2rem; background: linear-gradient(90deg, #8b6347 0%, #715742 22%, #4d4337 42%, #7c7563 55%, #d9d4ba 65%, #c3e6b4 70%, #7fcb6f 78%, #3ea33a 87%, #17621a 100%); }

/* All-readings view: pick readings, each gets its own panel on a shared time axis */
.chart-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1rem; flex: none; }
.chart-chips[hidden] { display: none; }
.chip {
	display: inline-flex; align-items: center; gap: 0.45rem; cursor: pointer;
	background: none; color: var(--gray-muted); border: 1px solid var(--line); border-radius: 999px;
	font: 600 0.72rem/1 var(--font-display); padding: 0.45rem 0.75rem;
}
.chip i { width: 0.6rem; height: 0.6rem; border-radius: 50%; opacity: .4; }
.chip[aria-pressed="true"] { color: var(--white); border-color: var(--gray-mid); background: rgba(255, 255, 255, .06); }
.chip[aria-pressed="true"] i { opacity: 1; }
.chart-stack { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 0.6rem; touch-action: pan-y; }
.chart-stack[hidden] { display: none; }
.stack-panel { flex: 1 0 92px; display: flex; flex-direction: column; min-height: 92px; }
.stack-head { display: flex; justify-content: space-between; font: 600 0.68rem/1.2 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-muted); margin-bottom: 0.25rem; }
.stack-head b { color: var(--white); letter-spacing: 0.02em; font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.chart--mini { flex: 1; min-height: 60px; }
.stack-empty { color: var(--gray-muted); margin: auto; }
.stack-panel--combo { flex-grow: 2; min-height: 150px; }
.stack-panel--combined { flex: 1; min-height: 0; }
.stack-panel--combined .chart { min-height: 0; }
.chart .ylab--unit { fill: var(--gray-line); font-weight: 700; }
.chart-legend b { color: var(--white); margin-left: 0.25rem; font-variant-numeric: tabular-nums; }
/* Separate / Combined switch and the T / Td / RH chip */
.mode-seg { display: inline-flex; border: 1px solid var(--gray-mid); border-radius: 999px; overflow: hidden; margin-right: 0.4rem; }
.mode-seg button {
	background: none; border: 0; cursor: pointer; color: var(--gray-muted);
	font: 700 0.66rem/1 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; padding: 0.55rem 0.8rem;
}
.mode-seg button[aria-pressed="true"] { background: var(--red); color: var(--white); }
.chip--combo i.key--rh { width: 1.4rem; height: 0.6rem; border-radius: 0.2rem; opacity: .45; }
.chip--combo[aria-pressed="true"] i.key--rh { opacity: 1; }

/* ---------- Forecast (light section) ---------- */
.section--dark { background: rgba(0, 0, 0, .92); color: var(--gray-bg); }
.section--light { background: var(--gray-bg); color: var(--ink); padding: 4.5rem 0; }
.card-grid { display: grid; gap: 1px; background: var(--gray-line); border: 1px solid var(--gray-line); }
.card-grid--7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.card-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card-grid--1 { grid-template-columns: 1fr; }
.card { background: var(--white); padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: 0.6rem; transition: background-color .18s; min-width: 0; }
.card:hover { background: #f7f7f7; }
.card-kicker { font: 500 0.66rem/1 var(--font-display); letter-spacing: 0.18em; text-transform: uppercase; color: var(--red); }
.card h3 { font: 700 1.05rem/1.2 var(--font-display); text-transform: uppercase; margin: 0; }
.card p { font-size: 0.92rem; color: var(--gray-mid); }
.day { align-items: center; text-align: center; padding: 1.4rem 0.75rem; }
.day:hover { background: #e6e6e6; }
.day img { width: 92px; height: 92px; }
.day .hl { font: 700 1.25rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.day .hl i { font-style: normal; color: var(--gray-muted); margin-left: 0.4rem; font-weight: 500; }
.day .hl i.solo { margin-left: 0; }
.day p { font-size: 0.8rem; line-height: 1.3; min-height: 2.6em; }
.day .chance, .hour .chance { color: #1f6fbf; }
/* Forecast style switcher */
.fc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.fc-head h2 { margin-bottom: 0; }
.fc-tabs { display: inline-flex; border: 1px solid var(--gray-line); border-radius: 999px; overflow: hidden; background: var(--white); }
.fc-tabs button {
	background: none; border: 0; cursor: pointer; color: var(--gray-mid);
	font: 700 0.72rem/1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; padding: 0.7rem 1.1rem;
}
.fc-tabs button:hover { color: var(--ink); }
.fc-tabs button[aria-selected="true"] { background: var(--red); color: var(--white); }

/* 5-Day and Extended use the same white day cards as the week */
.card-grid--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.card-grid--5 .day img { width: 112px; height: 112px; }
.day.is-night .card-kicker { color: var(--gray-mid); }
.day.is-empty { background: var(--gray-bg); }
.day.is-empty:hover { background: var(--gray-bg); }

/* "WKU Forecast" on the squirrel sign from the old forecast banners */
.fc-sign { display: flex; align-items: stretch; height: 130px; }
.fc-sign img { width: auto; height: 100%; flex: none; }
.fc-sign h2 {
	/* The sign's fill and rounded end are slices of the same banner art, so there's no seam. */
	position: relative; margin: 0 32px 0 -1px; display: flex; align-items: center; padding: 0.55em 1rem 0 0.4rem;
	background: url(../img/sign-fill.png) left top / auto 100% repeat-x;
	color: var(--white); font-size: clamp(1.7rem, 3.2vw, 2.6rem); white-space: nowrap;
}
.fc-sign h2::after { content: ""; position: absolute; left: calc(100% - 1px); top: 0; bottom: 0; aspect-ratio: 64 / 260; background: url(../img/sign-end.png) left top / auto 100% no-repeat; }
.fc-sign h2 em { color: var(--red-bright); margin-left: 0.3em; }

.hourly-wrap { margin-top: 2.5rem; }
.eyebrow--plain::before { display: none; }
/* Padding gives a hovered hour room to grow without being clipped by the scroll area. */
.hourly { display: flex; overflow-x: auto; margin: 0.4rem -12px 0; padding: 16px 12px; scrollbar-width: thin; }
.hour {
	flex: 0 0 82px; display: flex; flex-direction: column; align-items: center; gap: 0.3rem; padding: 0.85rem 0.25rem 0.75rem;
	border: 1px solid var(--gray-line); border-top-width: 3px; margin-left: -1px; position: relative;
	transition: transform .18s ease, box-shadow .18s ease;
}
.hour:first-child { margin-left: 0; }
/* Hovered hour bubbles up and gets a red box. */
.hour:hover {
	transform: scale(1.18); z-index: 2; border-radius: 0.5rem;
	box-shadow: 0 0 0 2px var(--red), 0 10px 24px rgba(0, 0, 0, .28);
}
/* Day hours read light and sky-tinted, night hours dark navy. */
.hour.is-day { background: linear-gradient(180deg, #eaf4ff 0%, var(--white) 70%); color: var(--ink); }
.hour.is-night { background: linear-gradient(180deg, #121a2c 0%, #1d2740 100%); color: var(--white); }
.hour.now-hr { border-top-color: var(--red); }
.hour:not(.now-hr) { border-top-color: var(--gray-line); }
.hour .t { font: 600 0.62rem/1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-muted); }
.hour.is-night .t { color: #9aa6c2; }
.hour.now-hr .t { color: var(--red); }
.hour.is-night.now-hr .t { color: #ff6b66; }
.hour img { width: 52px; height: 52px; border-radius: 0.5rem; }
.hour .v { font: 700 1.05rem/1 var(--font-display); font-variant-numeric: tabular-nums; }
.hour.is-night .chance { color: #7fb6ff; }
.discussion { margin-top: 2.5rem; border-top: 1px solid var(--gray-line); padding-top: 1.25rem; }
.discussion summary { cursor: pointer; font: 600 0.78rem/1 var(--font-body); letter-spacing: 0.09em; text-transform: uppercase; }
.discussion dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.8rem 2rem; margin: 1.5rem 0 0; }
.discussion dt { font: 700 0.85rem/1.5 var(--font-display); text-transform: uppercase; }
.discussion dd { margin: 0; color: var(--gray-mid); font-size: 0.95rem; }

/* ---------- Maps ---------- */
.maps { padding: 5rem 0; border-top: 1px solid var(--carbon); }
.maps h2 { color: var(--white); }
.map-tabs { display: inline-flex; flex-wrap: wrap; gap: 0.25rem; background: var(--panel-solid); border: 1px solid var(--line); border-radius: 0.7rem; padding: 0.25rem; margin-bottom: 1.4rem; }
.map-tabs button {
	background: none; border: 0; border-radius: 0.5rem; cursor: pointer; color: var(--gray-line);
	font: 600 0.7rem/1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; padding: 0.7rem 1rem; white-space: nowrap;
}
.map-tabs button:hover { color: var(--white); }
.map-tabs button[aria-selected="true"] { background: var(--red); color: var(--white); }
.map-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap); }
.map-card {
	background: var(--panel-solid); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
	display: flex; flex-direction: column; cursor: zoom-in; text-align: left; padding: 0; color: inherit; font: inherit;
	transition: border-color .18s;
}
.map-card:hover, .map-card:focus-visible { border-color: var(--red-bright); outline: none; }
.map-card span { padding: 0.9rem 1.1rem; font: 600 0.7rem/1.3 var(--font-display); letter-spacing: 0.16em; text-transform: uppercase; color: var(--gray-line); }
.map-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--white); display: block; }
.map-card .map-stack { position: relative; display: block; padding: 0; aspect-ratio: 4 / 3; background: var(--white); }
.map-stack img { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; background: none; }
.map-legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; margin-bottom: 0.8rem; color: var(--gray-line); letter-spacing: 0.08em; }
.map-legend span { display: inline-flex; align-items: center; gap: 0.45rem; }
.map-legend i { width: 0.95rem; height: 0.95rem; border-radius: 0.2rem; border: 1px solid rgba(255, 255, 255, .25); }
.map-dialog {
	width: min(1200px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); padding: 1.2rem 1.4rem 1.4rem;
	background: var(--panel-solid); color: var(--gray-bg); border: 1px solid var(--line); border-top: 0.3rem solid var(--red); border-radius: var(--radius);
}
.map-dialog::backdrop { background: rgba(0, 0, 0, .75); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.map-big-wrap { position: relative; margin-top: 1rem; }
.map-dialog img { display: block; width: 100%; max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); object-fit: contain; background: var(--white); border-radius: 0.6rem; }
/* A transparent layer (state lines) drawn exactly over the map under it */
.map-dialog img.map-over { position: absolute; inset: 0; height: 100%; max-height: none; background: none; pointer-events: none; }
.map-dialog img.map-over[hidden] { display: none; }
.map-source { align-self: center; font: 600 0.66rem/1 var(--font-display); letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-muted); text-decoration: none; white-space: nowrap; }
.map-source:hover { color: var(--white); }

/* Dashboard tab: the old maps page grid, four across, plain titles over the maps */
.map-grid.is-dashboard { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.4rem 1.1rem; }
.map-grid.is-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 68rem; }
.map-more { margin: 1.2rem 0 0; font: 600 0.78rem/1.4 var(--font-display); letter-spacing: 0.12em; text-transform: uppercase; }
.map-more[hidden] { display: none; }
.map-more a { color: var(--gray-line); text-decoration: underline; text-underline-offset: 0.25em; }
.map-more a:hover, .map-more a:focus-visible { color: var(--red-bright); }
.is-dashboard .map-card { background: none; border: 0; border-radius: 0; gap: 0.45rem; }
.is-dashboard .map-card span { padding: 0; font: 500 0.92rem/1.3 var(--font-display); letter-spacing: 0; text-transform: none; color: var(--gray-line); transition: color .18s; }
.is-dashboard .map-card:hover span, .is-dashboard .map-card:focus-visible span { color: var(--red-bright); }
.is-dashboard .map-card img { aspect-ratio: 1100 / 850; height: auto; object-fit: contain; border-radius: 0.35rem; outline: 1px solid transparent; transition: outline-color .18s; }
.is-dashboard .map-card img.is-fill { object-fit: cover; }
.is-dashboard .map-card:hover img, .is-dashboard .map-card:focus-visible img { outline-color: var(--red-bright); }

/* ---------- Links ---------- */
.links { padding: 5rem 0; border-top: 1px solid var(--carbon); }
.links h2 { color: var(--white); }
.links .card-grid { background: var(--carbon); border-color: var(--carbon); }
.links .card { background: var(--ink); gap: 0.9rem; }
.links .card:hover { background: var(--ink); }
.links .card-kicker { color: var(--red-bright); font-weight: 800; }
.links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.links li a {
	display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--carbon);
	color: var(--gray-bg); text-decoration: none; font-size: 0.92rem; transition: color .18s;
}
.links li:last-child a { border-bottom: 0; }
.links li a:hover, .links li a:focus-visible { color: var(--red-bright); outline: none; }

/* ---------- About ---------- */
.about { padding: 5rem 0; border-top: 1px solid var(--carbon); }
.about-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 3.5rem; align-items: start; }
.about h2 { color: var(--white); font-size: clamp(2.2rem, 5vw, 3.6rem); }
.lede { color: var(--gray-line); font-size: 1.05rem; line-height: 1.75; }
.lede + .lede { margin-top: 1rem; }
.cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.about .card-grid { background: var(--carbon); border-color: var(--carbon); }
.about .card { background: var(--ink); color: var(--gray-bg); }
.about .card:hover { background: var(--carbon); }
.about .card p { color: var(--gray-line); }
.about .card-kicker { color: var(--gray-line); }
.card.windy { flex-direction: row; align-items: center; gap: 1rem; }
.card.windy img { flex: none; }

.footer { padding-bottom: env(safe-area-inset-bottom); background: var(--black); border-top: 1px solid var(--carbon); color: var(--gray-muted); }
.footer-inner { padding: 1.75rem 0 2.5rem; display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.82rem; }
.footer-inner p:first-child { color: var(--gray-line); font: 500 0.7rem/1.6 var(--font-display); letter-spacing: 0.16em; text-transform: uppercase; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
	.dash-main { grid-template-columns: minmax(0, 1fr); }
	.dash-fc { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.wbgt { grid-template-columns: auto minmax(0, 1fr); }
	.wbgt .scale { grid-column: 1 / -1; }
	.card-grid--7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.card-grid--7.fc-periods { grid-template-columns: repeat(7, minmax(130px, 1fr)); overflow-x: auto; }
	.card-grid--4 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.nav { gap: 1.1rem; }
}
@media (max-width: 960px) {
	.topbar-inner { flex-wrap: wrap; height: auto; padding: 0.6rem 0 0; gap: 0.4rem 1rem; }
	.topbar-inner .btn { margin-left: auto; }
	.nav { order: 3; width: 100%; overflow-x: auto; gap: 1.3rem; padding-bottom: 0.6rem; scrollbar-width: none; }
	.nav a { white-space: nowrap; }
	html { scroll-padding-top: 6.5rem; }
	.row--live { grid-template-columns: minmax(0, 1fr); }
	.row--sky { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.row--sky .summary { grid-column: 1 / -1; }
	.radarsat .stage { aspect-ratio: 1 / 1; min-height: 0; flex: none; }
	.about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
	.card-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.map-grid, .map-grid.is-dashboard { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	:root { --gap: 0.8rem; --radius: 1rem; }
	.dash { padding-top: 1.1rem; }
	.dash-top { grid-template-columns: minmax(0, 1fr) auto; }
	.dash-logo { display: none; }
	.wordmark { width: 210px; }
	.event-sub { font-size: 0.62rem; letter-spacing: 0.14em; }
	.alertbar { grid-template-columns: minmax(0, 1fr); gap: 0.5rem; }
	.timebar { font-size: 0.68rem; gap: 0.5rem; letter-spacing: 0.08em; }
	.stationbar { gap: 0.5rem; }
	.stationbar > .label { display: none; }
	.station-seg { width: 100%; }
	.station-seg button { flex: 1; padding: 0.65rem 0.4rem; letter-spacing: 0.06em; font-size: 0.62rem; white-space: normal; line-height: 1.2; }
	.acorn-body { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
	.acorn-fig { max-width: 260px; }
	.dash-fc { grid-template-columns: minmax(0, 1fr); }
	.wbgt { gap: 1rem; }
	.flag svg { width: 3.4rem; height: 4.6rem; }
	.wbgt-value { font-size: 2.3rem; }
	.metric-value { font-size: 2rem; }
	.metric .hx-hint { display: none; } /* tiles stay tappable; the badge would cover the label */
	.metric .label { letter-spacing: 0.14em; }
	.compass { width: 3rem; height: 3rem; }
	.wind-row { gap: 0.7rem; }
	.scale { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.2rem; }
	.seg { flex-direction: column; align-items: flex-start; padding: 0.35rem; gap: 0.3rem; }
	.seg span { font-size: 0.56rem; }
	.seg b { font-size: 0.56rem; letter-spacing: 0.04em; }
	.row--sky { grid-template-columns: minmax(0, 1fr); }
	.card-grid--7, .card-grid--7.fc-periods, .card-grid--5, .card-grid--4, .map-grid, .map-grid.is-dashboard, .map-grid.is-pairs { grid-template-columns: minmax(0, 1fr); }
	.fc-periods .day { order: var(--o); }
	.fc-periods .day.is-empty { display: none; }
	.card-grid--5 .day img { width: 56px; height: 56px; }
	.fc-sign { height: 78px; max-width: 100%; }
	.fc-sign h2 { margin-right: 19px; padding-right: 0.4rem; font-size: 1.3rem; }
	.map-tabs { display: flex; }
	.map-tabs button { flex: 1; padding-inline: 0.5rem; letter-spacing: 0.08em; }
	.day { flex-direction: row; text-align: left; padding: 0.7rem 1rem; gap: 1rem; }
	.day img { width: 56px; height: 56px; }
	.day .card-kicker { width: 3.6rem; line-height: 1.3; }
	.day p { flex: 1; min-height: 0; }
	.day .chance { min-width: 2.5rem; text-align: right; }
	.day .hl { min-width: 4.6rem; text-align: right; }
	.tabs button { padding-inline: 0.9rem; letter-spacing: 0.12em; }
	/* Phones: scrubber and time on the first row, the buttons on the row below */
	.lapse-bar { flex-basis: 100%; flex-wrap: wrap; gap: 0.3rem 0.25rem; padding: 0.3rem 0.6rem 0.5rem; border-top: 1px solid var(--line); }
	#lapse-range { flex: 1 1 calc(100% - 6rem); order: -2; }
	.lapse-time { order: -1; min-width: 0; font-size: 0.7rem; }
	.lapse-transport { margin-right: auto; gap: 0; }
	.lapse-step { width: 1.5rem; }
	.chart-dialog { width: 94vw; height: 86vh; height: 86dvh; padding: 1.1rem 1rem 1rem; }
	.chart-head h3 { font-size: 1.25rem; }
}
@media (max-width: 420px) {
	.brand strong { font-size: 0.7rem; letter-spacing: 0.03em; }
	.brand img { width: 30px; height: 30px; }
	.topbar-inner .btn { padding: 0.5rem 0.6rem; font-size: 0.66rem; letter-spacing: 0.06em; }
	.acorn-fig { max-width: 230px; }
	.metric { padding: 0.75rem 0.8rem 0.85rem; }
}
@media (prefers-reduced-motion: reduce) {
	* { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Touch, Apple Pencil and Safari ---------- */
button, [role="button"], a, .hour, .day { -webkit-tap-highlight-color: transparent; }
[data-chart], button, .map-card { touch-action: manipulation; } /* no double-tap zoom delay */
.hourly { overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
body:has(dialog[open]) { overflow: hidden; } /* the page behind a chart or map doesn't scroll */
.day p { overflow-wrap: anywhere; }

/* Fingers and the Pencil: at least 44px to hit, the Apple guideline. */
@media (pointer: coarse) {
	.fc-tabs button, .map-tabs button, .tabs button, .station-seg button, .radar-sites button,
	.mode-seg button, .chip, .alertbar-list button, .chart-close, .nav a, .lapse-play, .lapse-step, .lapse-speed, .lapse-save, .lapse-menu-list a, .lapse-menu-list button, .lapse-menu-cancel { min-height: 44px; }
	.lapse-play, .lapse-speed, .lapse-save { min-width: 44px; }
	.lapse-select { min-height: 44px; font-size: 16px; } /* 16px stops iOS zooming in on tap */
	.nav a { display: inline-flex; align-items: center; }
}

/* Touch screens have no hover: a tap shouldn't leave a card stuck grey or an hour stuck enlarged. */
@media (hover: none) {
	.section--light .card:hover { background: var(--white); }
	.about .card:hover { background: var(--ink); }
	.hour:hover { transform: none; box-shadow: none; border-radius: 0; z-index: auto; }
	.hour:active { transform: scale(1.18); z-index: 2; border-radius: 0.5rem; box-shadow: 0 0 0 2px var(--red), 0 10px 24px rgba(0, 0, 0, .28); }
	.day:active { background: #e6e6e6; }
}
