:root {
  /* Dark-only design: night-time airfield palette. */
  --bg: #0f1216;
  --fg: #e8eaed;
  --muted: #a3a9b0;
  --line: #2a2f37;
  --panel: #161a1f;
  --accent: #7fb0ec;
  --warn-bg: #3a3014;
  --warn-fg: #f3dd9b;
  --up: #ff7a93;
  --down: #6fd39b;
  --on-accent: #0d1117;
  --label-halo: #0f1216;
  --series-today: #5794da;
  --series-r3: #e8506f;
  --night: rgba(255, 255, 255, 0.04);
  --header-h: 52px;
  --notice-h: 0px;
  color-scheme: dark;
  /* Body: Schibsted Grotesk (designed for Scandinavian newspapers). Zeros are plain, not slashed.
     Display: Big Shoulders Display (Chicago city signage). Data: Azeret Mono. */
  --font-body: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Big Shoulders Display", "Arial Narrow", "Roboto Condensed", sans-serif-condensed, system-ui, sans-serif;
  --font-data: "Azeret Mono", ui-monospace, Menlo, Consolas, monospace;
  font-family: var(--font-body);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); }
body { line-height: 1.5; font-size: 16px; }
a { color: var(--accent); }


.notice { background: var(--warn-bg); color: var(--warn-fg); padding: 8px 16px; font-size: 14px; }
.notice a { color: inherit; }

/* Map page layout */
html:has(.map-page), html:has(.map-page) body { height: 100%; }
.map-page { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.layout { flex: 1; display: flex; min-height: 0; }
.map { flex: 1; min-height: 0; }
.panel {
  width: 380px; flex-shrink: 0; overflow-y: auto; padding: 16px;
  background: var(--panel); border-right: 1px solid var(--line);
}
.panel-handle { display: none; }

.search label { font-weight: 600; display: block; margin-bottom: 6px; }
.search-row { display: flex; gap: 8px; }
.search input {
  flex: 1; min-width: 0; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--fg); text-transform: uppercase;
}
button {
  font: inherit; font-weight: 600; padding: 10px 16px; border: 0; border-radius: 6px;
  background: var(--accent); color: #fff; cursor: pointer; min-height: 44px;
}
button { color: var(--on-accent); }
.help { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.small { color: var(--muted); font-size: 12px; }

fieldset { border: 0; padding: 0; margin: 16px 0 0; }
legend { font-weight: 600; margin-bottom: 6px; padding: 0; }
.toggle { display: flex; flex-wrap: wrap; gap: 6px; }
.toggle legend { width: 100%; }
.toggle label {
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer;
  font-size: 14px; background: var(--bg); min-height: 36px; display: inline-flex; align-items: center;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle label:has(input:checked) { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.toggle label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.layers label { display: flex; gap: 8px; align-items: center; font-size: 14px; padding: 3px 0; }

.legend { margin-top: 16px; font-size: 13px; }
.legend-title { font-weight: 600; margin-bottom: 4px; }
.ramp { height: 10px; border-radius: 3px; }
.ramp-noise { background: linear-gradient(to right, #3b0f70, #8c2981, #de4968, #fe9f6d, #fcfdbf); }
.ramp-diff { background: linear-gradient(to right, #2166ac, #f7f7f7, #b2182b); }
.ramp-labels { display: flex; justify-content: space-between; color: var(--muted); }
.legend-keys { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.legend-keys i { display: inline-block; width: 14px; height: 4px; margin-right: 5px; vertical-align: middle; }

.result { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.result h2 { font-size: 18px; margin: 0 0 8px; }
.result h3 { font-size: 15px; margin: 16px 0 4px; }
.metrics { width: 100%; border-collapse: collapse; font-size: 14px; }
.metrics th, .metrics td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
.metrics thead th { font-size: 12px; color: var(--muted); font-weight: 600; }
.metrics tbody th { font-weight: 400; width: 44%; }
.delta { display: block; font-size: 12px; color: var(--muted); }
.delta.up { color: var(--up); }
.delta.down { color: var(--down); }
abbr { text-decoration: underline dotted; cursor: help; }
.money { font-size: 14px; }

/* Mobile: map full screen, panel as bottom sheet */
@media (max-width: 760px) {
  .notice { font-size: 13px; padding: 6px 16px; }
  .layout { position: relative; }
  .map { position: absolute; inset: 0; }
  .panel {
    position: absolute; left: 0; right: 0; bottom: 0; width: auto; z-index: 2;
    max-height: 34%; border-right: 0; border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0; box-shadow: 0 -4px 18px rgba(0,0,0,.15);
    padding-top: 22px; transition: max-height .25s ease;
  }
  .panel.expanded { max-height: 78%; }
  .panel-handle {
    display: block; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 64px; height: 22px; min-height: 0; padding: 0; background: transparent;
  }
  .panel-handle::after {
    content: ""; display: block; width: 40px; height: 5px; margin: 8px auto 0;
    border-radius: 3px; background: var(--line);
  }
}

/* Content pages */
.content { max-width: 820px; margin: 0 auto; padding: 24px 16px 64px; }
.content h1 { font-size: 28px; line-height: 1.2; }
.content h2 { margin-top: 32px; font-size: 21px; }
.content table { width: 100%; border-collapse: collapse; font-size: 14px; }
.content th, .content td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap { overflow-x: auto; position: relative; }
.card-list { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.card-list li { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: var(--panel); }
.card-list strong { display: block; }
.status { display: inline-block; font-size: 12px; padding: 1px 6px; border-radius: 4px; background: var(--warn-bg); color: var(--warn-fg); }
textarea { width: 100%; min-height: 220px; font: inherit; font-size: 14px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg); }
.site-footer { border-top: 1px solid var(--line); padding: 16px; color: var(--muted); font-size: 13px; text-align: center; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.search input::placeholder { text-transform: none; }
.place-label { font-size: 12px; font-weight: 600; color: var(--fg); text-shadow: 0 0 3px var(--label-halo), 0 0 3px var(--label-halo); pointer-events: none; white-space: nowrap; }

/* Intro page */
.intro section { margin-top: 40px; }
.intro .hero { margin-top: 16px; }
.eyebrow { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 0; }
.hero h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.15; margin: 8px 0 16px; text-wrap: balance; }
.lead { font-size: 18px; max-width: 65ch; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.button {
  display: inline-flex; align-items: center; min-height: 44px; padding: 10px 18px; border-radius: 6px;
  background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
}
.button.secondary { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 0; }
.stats > div { border-top: 3px solid var(--accent); padding-top: 10px; min-width: 0; }
.stats dt { font-size: 14px; color: var(--muted); }
.stats dd { margin: 4px 0 0; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stats dd.to { color: var(--up); }
.stats dd span { display: block; font-size: 13px; font-weight: 400; color: var(--muted); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.features h3 { margin: 0 0 4px; font-size: 17px; }
.features p { margin: 0; }
.steps { padding-left: 20px; display: grid; gap: 8px; }
.terms { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; }
.terms dt { font-weight: 700; font-variant-numeric: tabular-nums; }
.terms dd { margin: 0; }
@media (max-width: 520px) { .terms { grid-template-columns: 1fr; } .terms dd { margin-bottom: 8px; } }
.timeline { list-style: none; padding: 0; border-left: 2px solid var(--line); display: grid; gap: 14px; }
.timeline li { padding-left: 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 7px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.timeline time { display: block; font-weight: 700; }
.intro-check { display: flex; gap: 8px; flex: 1 1 320px; min-width: 0; max-width: 420px; }
.intro-check input {
  flex: 1; min-width: 0; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--fg);
}
.intro-result { max-width: 640px; border: 1px solid var(--line); border-radius: 8px; padding: 16px; margin-top: 16px; background: var(--panel); }
.intro-result h2 { margin-top: 0; }
.seat { font-size: 14px; }

/* Incident history */
.incident-list { list-style: none; padding: 0; margin: 16px 0 0; border-left: 2px solid var(--line); display: grid; gap: 20px; }
.incident-list > li { padding-left: 16px; position: relative; min-width: 0; }
.incident-list > li::before { content: ""; position: absolute; left: -6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.incident-list time { font-weight: 700; font-variant-numeric: tabular-nums; }
.incident-list h3 { margin: 2px 0 0; font-size: 17px; }
.incident-list .aircraft { font-weight: 400; color: var(--muted); margin-left: 8px; font-size: 15px; }
.incident-list .meta { margin: 2px 0 6px; color: var(--muted); font-size: 14px; }
.incident-list p { margin: 4px 0; overflow-wrap: anywhere; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.tag.fatal { border-color: var(--up); color: var(--up); }
.tag.off { border-color: var(--accent); color: var(--accent); }
.content .toggle { margin-top: 24px; }

/* Share controls */
.share { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 16px; }
.share-title { font-weight: 600; margin: 0 0 8px; }
.share-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 12px;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--fg);
  font: inherit; font-size: 14px; font-weight: 600; text-decoration: none; cursor: pointer;
}
.share-btn:hover { border-color: var(--accent); }
.share-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.share-btn svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.share-btn.whatsapp svg { fill: #25d366; }
.share-btn.facebook svg { fill: #1877f2; }
.share-btn.linkedin svg { fill: #0a66c2; }
.share-btn.instagram svg { fill: #d62976; }
.share-btn.substack svg { fill: #ff6719; }
.share-btn.x svg { fill: var(--fg); }
.share-btn.nextdoor svg { fill: #8ed500; }
.share-btn[data-done]::after { content: attr(data-done); font-weight: 400; color: var(--muted); }
.share-note { font-size: 13px; color: var(--muted); margin: 8px 0 0; }
.panel .share-btn span { font-size: 13px; }

/* Day profile chart */
.day-profile { position: relative; margin-top: 20px; border-top: 1px solid var(--line); padding-top: 12px; }
.day-profile h3 { margin: 0 0 4px; }
.dp-controls { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.dp-controls fieldset { margin-top: 8px; }
.dp-summary { font-size: 14px; }
.dp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.dp-legend i, .dp-tip i { display: inline-block; width: 14px; height: 10px; margin-right: 5px; vertical-align: middle; border-radius: 2px; }
.sw-peak { background: color-mix(in srgb, var(--muted) 35%, transparent); }
.sw-avg { height: 2px !important; background: var(--fg); }
.sw-night { background: var(--night); border: 1px solid var(--line); }
.sw-today { background: var(--series-today); }
.sw-r3 { background: var(--series-r3); }
.dp-chart { width: 100%; min-width: 0; touch-action: pan-y; }
.dp-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.dp-chart .grid { stroke: var(--line); stroke-width: 1; }
.dp-chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.dp-chart .night { fill: var(--night); }
.dp-chart .series.today { --c: var(--series-today); }
.dp-chart .series.r3 { --c: var(--series-r3); }
.dp-chart .peak { fill: var(--c); fill-opacity: 0.22; stroke: none; }
.dp-chart .avg { fill: none; stroke: var(--c); stroke-width: 2; stroke-linejoin: round; }
.dp-chart .ref { stroke: var(--fg); stroke-width: 1; stroke-dasharray: 4 3; opacity: 0.6; }
.dp-chart .ref-label { fill: var(--muted); font-size: 11px; font-weight: 400; }
.dp-chart .panel-title { fill: var(--fg); font-size: 13px; font-weight: 600; }
.dp-chart .crosshair { stroke: var(--muted); stroke-width: 1; }
.dp-tip {
  position: absolute; z-index: 3; width: 230px; margin-top: -8px; padding: 8px 10px; font-size: 12px;
  background: var(--bg); color: var(--fg); border: 1px solid var(--line); border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,.12); pointer-events: none;
}
.dp-tip div { margin-top: 4px; }
table.hourly { font-size: 13px; font-variant-numeric: tabular-nums; }
table.hourly th, table.hourly td { padding: 4px 6px; text-align: right; }
table.hourly th[scope="row"] { text-align: left; }
.day-profile details { margin-top: 8px; font-size: 14px; }

/* Email my MP */
.mp-email { margin-top: 16px; }
.mp-panel { margin-top: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
.mp-panel p { margin: 0 0 8px; }
.mp-address { font-weight: 600; user-select: all; overflow-wrap: anywhere; }
.mp-fields { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 4px; }
.mp-fields label { display: grid; gap: 4px; font-size: 14px; font-weight: 600; }
.mp-fields input, .mp-fields textarea, .mp-body {
  font: inherit; font-size: 15px; font-weight: 400; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 6px; background: var(--bg); color: var(--fg); width: 100%;
}
.mp-fields textarea { min-height: 0; resize: vertical; }
.mp-body { min-height: 260px; font-size: 14px; line-height: 1.45; margin-top: 8px; }
.mp-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.mp-actions .button, .mp-email > .button { cursor: pointer; border: 0; font: inherit; font-weight: 600; }
.mp-actions .button.secondary { border: 1px solid var(--accent); }
.linkish { background: none; border: 0; padding: 0; min-height: 0; color: var(--accent); font: inherit; font-size: 14px; text-decoration: underline; cursor: pointer; }

/* Site header: logo, wordmark, menu and call to action */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 16px; height: auto; min-height: 64px;
  padding-block: 8px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: #0b0d10; border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); flex-shrink: 0; }
.logo-mark { width: 40px; height: 40px; flex-shrink: 0; }
.wordmark { display: flex; flex-direction: column; line-height: 1.05; }
.wm-main { font-family: var(--font-display); font-weight: 800; font-size: 25px; letter-spacing: .05em; text-transform: uppercase; }
.wm-sub { font-size: 12px; color: var(--muted); letter-spacing: .02em; margin-top: 3px; }
.site-header nav { display: flex; align-items: center; gap: 4px 18px; margin-left: auto; flex-wrap: wrap; justify-content: flex-end; overflow: visible; }
.site-header nav a { color: var(--muted); text-decoration: none; font-size: 15px; white-space: nowrap; padding: 6px 0; }
.site-header nav a:hover { color: var(--fg); }
.site-header nav a[aria-current="page"] { color: var(--fg); font-weight: 600; box-shadow: inset 0 -2px 0 #ffcc33; }
.site-header nav a.nav-cta { color: #14171c; background: #ffcc33; padding: 8px 14px; border-radius: 6px; font-weight: 700; }
.site-header nav a.nav-cta:hover { background: #ffd95c; }
.site-header a:focus-visible, .menu-toggle:focus-visible { outline: 2px solid #ffcc33; outline-offset: 3px; }
.menu-toggle { display: none; margin-left: auto; background: transparent; color: var(--fg); border: 1px solid var(--line); padding: 8px 14px; min-height: 40px; }

/* Status strip: departure-board style information line */
.status-strip {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px;
  padding-block: 7px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: #14171c; border-bottom: 1px solid var(--line);
  font-family: var(--font-data); font-size: 12.5px; color: #ffcc33; letter-spacing: .02em;
}
.status-item { display: inline-flex; align-items: center; gap: 8px; }
.status-strip a { color: #ffcc33; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #6fd39b; box-shadow: 0 0 0 3px rgba(111, 211, 155, .18); }
@media (prefers-reduced-motion: no-preference) { .status-dot { animation: pulse 2.4s ease-in-out infinite; } }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(111, 211, 155, 0); } }
.anchor { position: absolute; }

@media (max-width: 900px) {
  .site-header { flex-wrap: wrap; }
  .menu-toggle { display: inline-flex; align-items: center; }
  .site-header nav { display: none; width: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 8px 0 4px; }
  .site-header nav.open { display: flex; }
  .site-header nav a { padding: 10px 0; border-top: 1px solid var(--line); font-size: 16px; }
  .site-header nav a[aria-current="page"] { box-shadow: inset 3px 0 0 #ffcc33; padding-left: 10px; }
  .site-header nav a.nav-cta { margin-top: 8px; text-align: center; border-top: 0; }
}
@media (max-width: 420px) { .wm-sub { display: none; } .status-strip { font-size: 11.5px; } }
@media (max-width: 600px) { .status-strip .hide-sm { display: none; } .status-strip { flex-wrap: nowrap; } .status-item:first-child { min-width: 0; } }

/* Headings in the display face */
h1, h2, .hero h1, .content h1, .content h2, .lo h1 { font-family: var(--font-display); font-weight: 800; letter-spacing: .01em; }
.content h1, .lo h1 { font-size: clamp(34px, 5.4vw, 52px); line-height: 1.02; }
.hero h1 { font-size: clamp(38px, 6vw, 60px); line-height: 1.0; }
.content h2 { font-size: 28px; }
.result h2 { font-family: var(--font-display); font-size: 26px; letter-spacing: .02em; }
input, button, textarea, select { font-family: inherit; }
@media (max-width: 420px) { .wm-main { font-size: 22px; } }
.panel-feedback { margin-top: 20px; }
.site-footer a { color: var(--muted); }
.feedback-form { display: grid; gap: 8px; max-width: 640px; margin-top: 12px; }
.feedback-form > label, .fb-row label { font-weight: 600; font-size: 15px; margin-top: 8px; display: block; }
.feedback-form input:not([type="radio"]):not([type="checkbox"]), .feedback-form textarea {
  font: inherit; width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--fg);
}
.feedback-form textarea { min-height: 140px; }
.feedback-form .optional { font-weight: 400; color: var(--muted); }
.fb-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.feedback-form button { justify-self: start; margin-top: 8px; }
.fb-status { min-height: 1.5em; margin: 0; }
[id] { scroll-margin-top: 110px; }
.intro-results { margin-top: 24px; max-width: 960px; }
.legend-keys i.dashed { background: repeating-linear-gradient(90deg, currentColor 0 6px, transparent 6px 9px); }
#flow[hidden] { display: none; }
