html {
	--weather-strip-bg: #819daa;
	background-color: var(--weather-strip-bg);
	--ribbon-height: 5.4rem;
	height: 100%;
	overflow: hidden;
	/* Prevent Safari rubber-band scroll on the document itself */
	overscroll-behavior: none;
}

body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	overscroll-behavior: none;
	background:
		radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.88), transparent 24rem),
		linear-gradient(180deg, #7faabe 0%, #b9def0 48%, #f2fbff 100%);
	background-color: var(--weather-strip-bg);
	font-family: system-ui, sans-serif;
	color: white;
}

/* Track the live viewport so Safari toolbar changes feel native. */
#main-content {
	display: flex;
	flex-direction: column;
	overflow-y: auto;
	height: 100vh;
	height: 100dvh;
	padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
	background:
			linear-gradient(180deg, rgba(7, 17, 28, 0.28), rgba(7, 17, 28, 0.16) 45%, rgba(7, 17, 28, 0.04)),
			linear-gradient(180deg, rgba(126, 169, 190, 0.98), rgba(185, 222, 240, 0.94) 48%, rgba(243, 251, 255, 0.98));
	background-color: var(--weather-strip-bg);
}

/*
 * Installed PWAs have no Safari toolbar, so pin the shell to the full app window.
 *
 * Both blocks are required and must stay in sync:
 *   @media (display-mode: standalone) — standard CSS, works on Chrome/Android PWAs.
 *   html.is-standalone — iOS Safari sets navigator.standalone but does not always
 *     match the display-mode media feature, so MarkStandaloneMode() adds the class
 *     via JS as a fallback. CSS selector lists cannot mix @media and class rules,
 *     so the two blocks cannot be merged without dropping one of the two signals.
 */
@media (display-mode: standalone) {
	#main-content {
		position: fixed;
		inset: 0;
		overflow: hidden;
		height: auto;
		padding-bottom: 0;
	}

	#app-panel {
		flex: 1 1 0;
		height: auto;
	}
}

html.is-standalone #main-content {
	position: fixed;
	inset: 0;
	overflow: hidden;
	height: auto;
	padding-bottom: 0;
}

html.is-standalone #app-panel {
	flex: 1 1 0;
	height: auto;
}

#ribbon {
	position: sticky;
	top: 0;
	z-index: 60;
	flex: 0 0 auto;
	display: flex;
	min-height: 5.4rem;
	padding: 0.85rem 1rem;
	margin-top: 0;
	background: var(--weather-strip-bg);
	border-bottom: 1px solid rgba(255, 255, 255, 0.35);
	box-shadow: 0 0.55rem 1.4rem rgba(49, 76, 92, 0.22);
}

#app-panel {
	flex: 1 1 auto;
	min-height: 0;
	height: calc(100dvh - var(--ribbon-height));
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto auto;
	gap: 1rem;
	padding: 0.55rem 1rem 1rem;
}

html.show-flow-radar #app-panel {
	grid-template-rows: auto minmax(8rem, 0.55fr) auto auto auto;
}

#app-panel > :not([hidden]) ~ :not([hidden]) {
	margin-top: 0;
}

#weather-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	min-height: 3.65rem;
}

#weather-header h1 {
	line-height: 0.95;
}

#temp {
	font-size: 3.75rem;
	font-weight: 200;
	letter-spacing: 0;
	line-height: 0.95;
	color: rgba(255, 255, 255, 0.92);
}

#brand-label {
	color: #3f4850;
}

.glass {
	background: rgba(12, 24, 38, 0.58);
	backdrop-filter: blur(20px);
	border: 1px solid rgba(255, 255, 255, 0.28);
}

.radar-layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 0.1s linear;
	pointer-events: none;
	/* Screen blend: black pixels vanish, coloured radar overlays map cleanly */
	mix-blend-mode: screen;
}

.radar-layer.active {
	opacity: 1;
}

#radar-stack {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: none;
	z-index: 10;
}

#flow-debug-panel {
	display: none;
	position: relative;
	z-index: 2;
	background: rgba(239, 250, 255, 0.72);
	border: 1px solid rgba(255, 255, 255, 0.7);
	border-radius: 1.2rem;
	box-shadow: 0 1rem 2.4rem rgba(54, 94, 120, 0.12);
	padding: 0.95rem;
	margin-top: 0.35rem;
}

#flow-debug-head {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.55rem;
	color: rgba(38, 56, 70, 0.74);
	font-size: 0.62rem;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
}

#flow-city-select {
	width: 100%;
	margin-bottom: 0.65rem;
	padding: 0.55rem 0.7rem;
	border: 1px solid rgba(38, 56, 70, 0.2);
	border-radius: 0.65rem;
	background: rgba(255, 255, 255, 0.62);
	color: #263846;
	font-size: 0.85rem;
	font-weight: 700;
}

#flow-debug-viewport {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	margin: 0 auto;
	overflow: hidden;
	border-radius: 0.8rem;
	background: #031321;
}

html.show-flow-radar #flow-debug-viewport {
	width: 100%;
}

#flow-ray-canvas {
	position: absolute;
	inset: 0;
	z-index: 40;
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

#flow-motion-canvas {
	position: absolute;
	inset: 0;
	z-index: 25;
	display: block;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

#flow-analysis-box {
	position: absolute;
	z-index: 50;
	width: calc(8 / 512 * 100%);
	height: calc(8 / 512 * 100%);
	border: 3px solid #ec4899;
	background: rgba(236, 72, 153, 0.18);
	box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 0 1rem rgba(236, 72, 153, 0.95);
	transform: translate(-50%, -50%);
	pointer-events: none;
}

#flow-debug-marker {
	position: absolute;
	z-index: 45;
	width: 0.5rem;
	height: 0.5rem;
	border: 2px solid #ffffff;
	border-radius: 999px;
	box-shadow: 0 0 0 2px #3b82f6, 0 0 0.7rem rgba(59, 130, 246, 0.74);
	transform: translate(-50%, -50%);
	pointer-events: none;
}

html.show-flow-radar #flow-debug-panel,
html.show-flow-radar #radar-stack {
	display: block;
}

#radar-display {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 10;
	pointer-events: none;
}

.radar-display-layer {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	opacity: 0;
	transition: opacity 0.1s linear;
	pointer-events: none;
	mix-blend-mode: multiply;
}

.radar-display-layer.active {
	opacity: 0.86;
}

#map-stage {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	transform-origin: 0 0;
	cursor: grab;
	touch-action: none;
	will-change: transform;
}

#map-stage.dragging {
	cursor: grabbing;
}

#vector-canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 20;
	pointer-events: none;
}

#location-marker {
	z-index: 30;
}

#map-base {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	opacity: 0.96;
	filter: saturate(0.72) brightness(1.02) contrast(1.02);
	/* Stays outside #map-stage so it is never CSS-upscaled by the pan/zoom transform.
	   Tiles are drawn at native resolution directly onto a canvas sized to the container. */
}

#map-base canvas {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	/* Explicit pixel size set by JS — no CSS scaling applied */
	image-rendering: auto;
}

.map-container {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 12rem;
	border-radius: 2rem;
	overflow: hidden;
	background: #d8edf7;
	border: 1px solid rgba(255, 255, 255, 0.45);
	touch-action: none;
	user-select: none;
}

#nowcast-panel {
	min-width: 0;
	background: rgba(239, 250, 255, 0.72);
	backdrop-filter: blur(5px);
	border: 1px solid rgba(255, 255, 255, 0.7);
	box-shadow: 0 1rem 2.4rem rgba(54, 94, 120, 0.12);
	padding: 1rem;
	color: #263846;
}

#nowcast-panel > :not([hidden]) ~ :not([hidden]) {
	margin-top: 0.75rem;
}

#nowcast-panel .text-white\/40,
#nowcast-panel .text-white\/50,
#nowcast-panel .text-white\/60,
#nowcast-panel .text-white\/70,
#nowcast-panel .text-white\/90 {
	color: rgba(38, 56, 70, 0.9);
}

#nowcast-panel .text-white\/30 {
	color: rgba(38, 56, 70, 0.72);
}

#nowcast-panel .opacity-30 {
	opacity: 0.58;
}

#nowcast-panel .opacity-60 {
	opacity: 0.9;
}

#nowcast-panel .border-white\/10 {
	border-color: rgba(38, 56, 70, 0.22);
}

#nowcast-panel #nowcast-card {
	display: block;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	color: #24323d;
	font-weight: 700;
	line-height: 1.35;
	min-height: 1.35em;
	overflow: hidden;
	white-space: nowrap;
}

#nowcast-card.is-marquee .nowcast-marquee-track {
	display: inline-flex;
	width: max-content;
	gap: 2.4rem;
	animation: nowcast-marquee var(--marquee-duration, 10s) linear infinite;
	will-change: transform;
}

#nowcast-card.is-marquee .nowcast-marquee-copy {
	flex: 0 0 auto;
}

@keyframes nowcast-marquee {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(calc(-50% - 1.2rem));
	}
}

#nowcast-panel #stat-eta,
#nowcast-panel #stat-duration,
#nowcast-panel #stat-vel,
#nowcast-panel #stat-storm,
#nowcast-panel #stat-bear {
	color: #314858;
}

#nowcast-panel .text-blue-400 {
	color: #2f7fd7;
}

#nowcast-panel .text-orange-400 {
	color: #c46622;
}

#nowcast-panel .text-red-400 {
	color: #d84545;
}

#control-bar {
	position: absolute;
	left: 50%;
	bottom: max(0.85rem, env(safe-area-inset-bottom));
	transform: translateX(-50%);
	background: rgba(235, 248, 255, 0.18);
	backdrop-filter: blur(6px);
	border: 1px solid rgba(255, 255, 255, 0.45);
	box-shadow: 0 0.8rem 2.2rem rgba(54, 94, 120, 0.22);
	pointer-events: auto;
	touch-action: manipulation;
}

#control-bar button {
	color: rgba(39, 65, 82, 0.72);
	cursor: pointer;
	touch-action: manipulation;
}

#control-bar button:hover {
	color: rgba(27, 50, 66, 0.95);
}

#control-bar button:disabled {
	opacity: 0.62;
}

#control-bar button.is-busy {
	color: rgba(47, 127, 215, 0.92);
}

#control-bar-sep-l,
#control-bar-sep-r {
	display: block;
	width: 1px;
	height: 1rem;
	background: rgba(39, 65, 82, 0.22);
}

/* Hide separators when the time label is not shown */
#time[hidden] ~ #control-bar-sep-r,
#control-bar-sep-l:has(~ #time[hidden]) {
	display: none;
}

#time {
	color: rgba(39, 65, 82, 0.62);
	letter-spacing: 0.04em;
}


.forecast-day.is-today .forecast-today-label {
	opacity: 0.7;
}

.no-scrollbar::-webkit-scrollbar {
	display: none;
}

#log-output {
	min-height: 1rem;
	font-size: 9px;
	color: rgba(255, 255, 255, 0.4);
	font-family: monospace;
}

#weather-test-panel {
	position: fixed;
	top: 1rem;
	right: 1rem;
	z-index: 1000;
	width: min(25rem, calc(100vw - 2rem));
	max-height: calc(100vh - 2rem);
	overflow: auto;
	padding: 0.9rem;
	border-radius: 1rem;
	background: rgba(245, 251, 255, 0.96);
	box-shadow: 0 1rem 3rem rgba(20, 50, 70, 0.28);
	color: #24323d;
	font: 12px/1.35 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#weather-test-panel .weather-test-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

#weather-test-panel .weather-test-head strong {
	display: block;
	font-size: 1rem;
}

#weather-test-panel .weather-test-head span {
	display: block;
	color: rgba(36, 50, 61, 0.62);
	font-weight: 700;
}

#weather-test-panel button {
	width: 1.7rem;
	height: 1.7rem;
	border-radius: 999px;
	background: rgba(36, 50, 61, 0.08);
	color: #24323d;
	font-size: 1.2rem;
	line-height: 1;
}

#weather-test-panel .weather-test-summary {
	margin-bottom: 0.75rem;
	padding: 0.55rem 0.7rem;
	border-radius: 0.65rem;
	font-weight: 800;
}

#weather-test-panel .weather-test-summary.pass {
	background: rgba(34, 197, 94, 0.16);
	color: #166534;
}

#weather-test-panel .weather-test-summary.fail {
	background: rgba(239, 68, 68, 0.14);
	color: #991b1b;
}

#weather-test-panel .weather-test-row {
	padding: 0.6rem 0;
	border-top: 1px solid rgba(36, 50, 61, 0.12);
}

#weather-test-panel .weather-test-group {
	color: rgba(36, 50, 61, 0.54);
	font-size: 0.65rem;
	font-weight: 900;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

#weather-test-panel .weather-test-label {
	font-weight: 800;
}

#weather-test-panel .weather-test-row.fail .weather-test-label {
	color: #b91c1c;
}

#weather-test-panel .weather-test-values {
	display: grid;
	gap: 0.2rem;
	margin-top: 0.25rem;
	color: rgba(36, 50, 61, 0.62);
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (max-width: 430px) {
	html {
		--ribbon-height: 4.35rem;
	}

	#ribbon {
		min-height: 4.35rem;
		padding: 0.5rem 0.85rem;
	}

	#app-panel {
		height: calc(100dvh - var(--ribbon-height));
		grid-template-rows: auto minmax(0, 1fr) auto auto;
		gap: 0.7rem;
		padding: 0.38rem 1rem max(0.25rem, env(safe-area-inset-bottom));
	}

	#weather-header h1 {
		font-size: 2.15rem;
		line-height: 1;
	}

	#temp {
		font-size: 3.35rem;
		line-height: 0.95;
	}

	.map-container {
		min-height: 10rem;
		border-radius: 1.55rem;
	}

	#nowcast-panel {
		border-radius: 1.7rem;
		padding: 0.9rem;
	}

	#nowcast-card {
		font-size: 0.95rem;
	}

	#control-bar {
		bottom: 0.75rem;
		padding: 0.55rem 1.3rem;
	}

	#weather-test-panel {
		top: auto;
		right: 0.75rem;
		bottom: 0.75rem;
		left: 0.75rem;
		width: auto;
		max-height: 55vh;
	}
}

/*
///////////////////////////////////////////////////////////////////////////////
//
// END OF FILE
//
///////////////////////////////////////////////////////////////////////////////
*/
