:root {
  color-scheme: dark;
  --bg: #091827;
  --panel: #10263b;
  --panel-alt: #0d2033;
  --line: rgba(195, 221, 235, 0.15);
  --text: #f3f8fa;
  --muted: #a6bdc9;
  --subtle: #708c9a;
  --accent: #75dfd3;
  --amber: #ffc96b;
  --danger: #ff927c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body { margin: 0; min-width: 320px; background: radial-gradient(1000px 600px at 92% -10%, #174465 0%, transparent 60%), var(--bg); color: var(--text); }
button, input { font: inherit; }
button { cursor: pointer; }
.page-shell { width: min(100%, 1100px); margin: 0 auto; padding: calc(1.25rem + env(safe-area-inset-top)) calc(clamp(1rem, 4vw, 3rem) + env(safe-area-inset-right)) calc(3rem + env(safe-area-inset-bottom)) calc(clamp(1rem, 4vw, 3rem) + env(safe-area-inset-left)); }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: .5rem 0 2.6rem; }
.brand { display: inline-flex; gap: .6rem; align-items: center; color: var(--text); font-size: 1.06rem; font-weight: 750; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border: 1px solid rgba(117,223,211,.45); border-radius: 50%; color: var(--accent); }
.live-indicator { display: inline-flex; gap: .4rem; align-items: center; font-size: .72rem; letter-spacing: .12em; color: var(--muted); font-weight: 700; }
.live-indicator i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(117,223,211,.13); }
.hero { max-width: 720px; padding: 1.3rem 0 2.3rem; }
.eyebrow, .card-label { margin: 0 0 .45rem; color: var(--accent); font-size: .72rem; letter-spacing: .14em; font-weight: 800; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 1rem; font-size: clamp(2.5rem, 7vw, 4.7rem); line-height: .98; letter-spacing: -.065em; }
.hero-copy { max-width: 550px; margin: 0; color: var(--muted); font-size: 1.03rem; line-height: 1.7; }
.controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .75rem; padding: .85rem; border: 1px solid var(--line); background: rgba(10, 29, 46, .8); border-radius: 1rem; box-shadow: 0 18px 60px rgba(0, 0, 0, .13); }
.airport-search { position: relative; display: flex; align-items: center; min-width: 0; padding: 0 .9rem; background: #0b1d2e; border: 1px solid transparent; border-radius: .65rem; transition: border-color .15s; }
.airport-search:focus-within { border-color: rgba(117,223,211,.7); }
.search-symbol { padding-right: .55rem; color: var(--accent); font-size: 1.5rem; line-height: 1; }
.airport-search input { width: 100%; min-width: 0; padding: .8rem 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 1rem; }
.airport-search input::placeholder { color: #7390a0; }
.suggestions { position: absolute; z-index: 10; right: 0; left: 0; top: calc(100% + .5rem); overflow: hidden; border: 1px solid var(--line); border-radius: .65rem; background: #112b42; box-shadow: 0 15px 30px rgba(0,0,0,.3); }
.suggestion { display: block; width: 100%; padding: .75rem .9rem; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; }
.suggestion:last-child { border-bottom: 0; }
.suggestion:hover, .suggestion:focus-visible { background: rgba(117,223,211,.13); outline: 0; }
.suggestion small { display: block; margin-top: .17rem; color: var(--muted); }
.location-button { padding: .8rem 1rem; border: 1px solid rgba(117,223,211,.28); border-radius: .65rem; background: #12374e; color: var(--text); font-weight: 700; white-space: nowrap; }
.location-button:hover { background: #18465f; }
.location-status { display: flex; gap: .5rem; align-items: center; min-height: 3.3rem; padding: .8rem .15rem; color: var(--muted); font-size: .9rem; }
.status-pin { color: var(--accent); font-size: 1.35rem; }
.airport-overview { display: flex; gap: 1.5rem; align-items: end; justify-content: space-between; padding: 1.6rem 0 1.25rem; border-bottom: 1px solid var(--line); }
.airport-overview h2 { margin: 0 0 .28rem; font-size: clamp(1.5rem, 4vw, 2.2rem); letter-spacing: -.04em; }
.airport-meta, .updated-at { margin: 0; color: var(--muted); font-size: .9rem; }
.updated-at { padding-bottom: .25rem; text-align: right; white-space: nowrap; }
.weather-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1rem; padding: 1rem 0 2rem; }
.weather-card { min-height: 300px; padding: 1.25rem; border: 1px solid var(--line); border-radius: 1rem; background: linear-gradient(145deg, rgba(21,52,78,.92), rgba(11,31,49,.92)); }
.primary-card { background: linear-gradient(145deg, #153e58, #102b44); }
.card-heading, .section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
.card-heading h3, .section-heading h2 { margin-bottom: 0; font-size: 1.25rem; letter-spacing: -.025em; }
.data-state, .source-note { padding: .3rem .5rem; border-radius: 999px; background: rgba(117,223,211,.11); color: var(--accent); font-size: .73rem; font-weight: 800; }
.data-state.is-error { background: rgba(255,146,124,.12); color: var(--danger); }
.weather-summary { margin: 2.1rem 0 1.35rem; color: var(--text); font-size: 1.3rem; font-weight: 650; line-height: 1.32; letter-spacing: -.025em; }
.metrics { display: grid; grid-template-columns: repeat(2, 1fr); gap: .7rem; }
.metric { padding: .7rem; border: 1px solid rgba(198,220,233,.12); border-radius: .65rem; background: rgba(5,17,29,.2); }
.metric span { display: block; color: var(--subtle); font-size: .72rem; font-weight: 700; letter-spacing: .08em; }
.metric strong { display: block; margin-top: .18rem; font-size: 1rem; }
.raw-report { margin: 1rem 0 0; padding: .8rem; overflow-wrap: anywhere; border: 1px solid rgba(198,220,233,.12); border-radius: .65rem; background: rgba(6,18,30,.42); color: #cfe0e8; font: .73rem/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.muted { color: #aec4cf; }
.forecast-note { min-height: 3.1rem; margin: 2.1rem 0 1.35rem; color: var(--muted); line-height: 1.55; }
.operations { padding: 1rem 0 2.2rem; }
.section-heading { margin-bottom: 1rem; }
.source-note { align-self: center; color: var(--muted); background: rgba(157,191,205,.1); }
.operation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.operation-card { display: flex; gap: .8rem; padding: 1rem; border: 1px solid var(--line); border-radius: .85rem; background: var(--panel-alt); }
.operation-icon { display: grid; flex: 0 0 auto; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .55rem; background: rgba(255,201,107,.12); color: var(--amber); font-weight: 900; }
.operation-card h3 { margin: .05rem 0 .35rem; font-size: .95rem; }
.operation-card p { margin: 0; color: var(--muted); font-size: .84rem; line-height: 1.55; }
footer { padding-top: 1.2rem; border-top: 1px solid var(--line); color: var(--subtle); font-size: .75rem; line-height: 1.55; }
footer p { margin-bottom: .35rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.connection-note { display: flex; gap: .55rem; align-items: center; margin: 0 0 1rem; padding: .7rem .9rem; border: 1px solid rgba(255,201,107,.3); border-radius: .75rem; background: rgba(255,201,107,.09); color: var(--amber); font-size: .85rem; line-height: 1.5; }
.connection-note::before { content: "◍"; flex: 0 0 auto; font-size: 1rem; }
.live-indicator.is-offline { color: var(--amber); }
.live-indicator.is-offline i { background: var(--amber); box-shadow: 0 0 0 4px rgba(255,201,107,.13); }

.overview-side { display: flex; flex-direction: column; align-items: end; gap: .6rem; }
.refresh-button { display: inline-flex; gap: .45rem; align-items: center; padding: .5rem .9rem; border: 1px solid rgba(117,223,211,.28); border-radius: 999px; background: #12374e; color: var(--text); font-size: .83rem; font-weight: 700; }
.refresh-button:hover { background: #18465f; }
.refresh-button[disabled] { opacity: .6; cursor: default; }
.refresh-button[disabled] .refresh-symbol { animation: spin 1s linear infinite; }
.refresh-symbol { display: inline-block; color: var(--accent); font-size: 1rem; line-height: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .refresh-button[disabled] .refresh-symbol { animation: none; } }

.card-badges { display: inline-flex; flex-wrap: wrap; gap: .4rem; justify-content: end; }
.flight-category { padding: .3rem .55rem; border-radius: 999px; background: rgba(117,223,211,.14); color: var(--accent); font-size: .73rem; font-weight: 800; letter-spacing: .04em; }
.flight-category.is-marginal { background: rgba(255,201,107,.14); color: var(--amber); }
.flight-category.is-instrument { background: rgba(255,146,124,.14); color: var(--danger); }
.observed-at { margin: -.75rem 0 1.15rem; color: var(--muted); font-size: .82rem; }

@media (max-width: 680px) {
  .page-shell { padding-top: calc(.75rem + env(safe-area-inset-top)); }
  .topbar { padding-bottom: 1.6rem; }
  .controls, .weather-grid, .operation-grid { grid-template-columns: 1fr; }
  .location-button { width: 100%; }
  .airport-overview { display: block; }
  .updated-at { margin-top: .75rem; text-align: left; }
  .weather-card { min-height: 0; }
  .overview-side { flex-direction: row; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .75rem; }
  .updated-at { margin-top: 0; }
  .refresh-button { flex: 0 0 auto; }
}
