/* Delay Origin — plain CSS, no external assets. Mobile-first. */

/* Theme palettes. The default (:root) values are the NIGHT theme — the
   site's original navy look. The inline script in index.html sets
   data-theme="day" on <html> during the visitor's daytime (07:00–19:00
   local) and the [data-theme="day"] block below swaps in the bright
   day palette. If the script never runs, the site keeps the night look
   exactly as before. Only colors change between themes — layout,
   content and branding are identical. */
:root {
  --ink: #14213d;
  --ink-soft: #3c4a63;
  --paper: #ffffff;
  --surface: #ffffff;
  --wash: #f4f6fa;
  --line: #c9d2e0;
  --accent: #0b5fa5;
  --accent-dark: #084a82;
  --origin: #8a2b06;
  --origin-bg: #fdf0e7;
  --ok: #14632f;
  --ok-bg: #eef7f0;
  --warn-bg: #fff7e0;
  --banner-line: #d9b93a;
  --callout-bg: #e8f1f9;
  --header-bg: #14213d;
  --header-ink: #ffffff;
  --header-soft: #cfd9ea;
  --header-strong: #ffffff;
  --ticker-bg: #0d1830;
  --ticker-ink: #ffffff;
  --ticker-dot: #8fb8dd;
}

/* DAY theme — bright sky/airport feel: pale blue surfaces, navy text,
   the same red/blue accents. */
html[data-theme="day"] {
  --wash: #e9f2fb;
  --line: #b7cbdf;
  --callout-bg: #d9ecfc;
  --ok-bg: #e4f3e8;
  --warn-bg: #fff3cf;
  --origin-bg: #fdeee2;
  --header-bg: #cfe6f9;
  --header-ink: #14213d;
  --header-soft: #3c4a63;
  --header-strong: #14213d;
  --ticker-bg: #eef6fd;
  --ticker-ink: #14213d;
  --ticker-dot: #0b5fa5;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--wash);
  line-height: 1.55;
}

.wrap { max-width: 46rem; margin: 0 auto; padding: 0 1rem; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: 0.5rem 1rem; z-index: 10;
}
.skip-link:focus { left: 0; }

.site-header {
  background: var(--header-bg); color: var(--header-ink); padding: 1.1rem 0 0.9rem;
}
.brand { font-size: 1.5rem; font-weight: 700; margin: 0; letter-spacing: 0.01em; }
.tagline { margin: 0.15rem 0 0; color: var(--header-soft); }
.live-clock { margin: 0.3rem 0 0; color: var(--header-soft); font-size: 0.92rem; }
.live-clock time { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--header-strong); }

.install-row { margin: 0.6rem 0 0; }
.install-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: var(--accent); color: #fff;
  border: 1px solid var(--accent-dark);
  font-weight: 700; font-size: 0.95rem;
  padding: 0.5rem 0.95rem;
}
.install-btn:hover { background: var(--accent-dark); }
.install-glyph { flex: 0 0 auto; }
.install-hint { margin: 0.5rem 0 0; color: var(--header-soft); font-size: 0.92rem; max-width: 34rem; }
/* Already installed and running as an app — no install button needed. */
@media (display-mode: standalone) {
  .install-row, .install-hint { display: none; }
}

/* Live ticker — scrolls the FAA programs under the header */
.ticker {
  display: flex; align-items: stretch;
  background: var(--ticker-bg); color: var(--ticker-ink);
  border-bottom: 3px solid var(--accent);
  overflow: hidden;
}
.ticker-label {
  flex: 0 0 auto; display: flex; align-items: center;
  background: var(--origin); color: #fff;
  font-weight: 700; font-size: 0.78rem; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 0.45rem 0.7rem;
}
.ticker-viewport { flex: 1 1 auto; overflow: hidden; display: flex; align-items: center; }
.ticker-track { display: flex; align-items: center; white-space: nowrap; }
.ticker-track.scrolling {
  animation-name: ticker-scroll;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  will-change: transform;
}
.ticker:hover .ticker-track.scrolling,
.ticker:focus-within .ticker-track.scrolling { animation-play-state: paused; }
.ticker-group { display: flex; align-items: center; }
.ticker-item { padding: 0.45rem 0; font-size: 0.92rem; }
.ticker-item::after { content: "\2022"; margin: 0 1rem; color: var(--ticker-dot); }
.ticker-elapsed { font-variant-numeric: tabular-nums; font-weight: 600; }
@keyframes ticker-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none !important; flex-wrap: wrap; white-space: normal; }
  .ticker-group { flex-wrap: wrap; }
  .ticker-viewport { overflow: visible; }
}

main { padding-bottom: 2rem; }

.hero { padding: 1.4rem 0 0.4rem; }
.hero h1 { font-size: 1.7rem; line-height: 1.25; margin: 0 0 0.6rem; }
.only-ones {
  border-left: 4px solid var(--accent);
  background: var(--callout-bg);
  padding: 0.6rem 0.8rem;
  font-weight: 600;
}

.card, .trace-view {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.1rem 1.2rem;
  margin-top: 1.1rem;
}
.card h2, .trace-view h2 { margin-top: 0.2rem; font-size: 1.25rem; }

.field { margin-bottom: 0.85rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.25rem; }
.field .optional { font-weight: 400; color: var(--ink-soft); font-size: 0.9em; }
.field input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  font-size: 1rem;
  border: 1px solid var(--ink-soft);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
}
.field input:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

button {
  font: inherit;
  border-radius: 6px;
  cursor: pointer;
  padding: 0.65rem 1.1rem;
}
button.primary {
  background: var(--accent); color: #fff; border: 1px solid var(--accent-dark);
  font-weight: 700; width: 100%;
}
button.primary:hover { background: var(--accent-dark); }
button.secondary {
  background: var(--surface); color: var(--accent-dark); border: 1px solid var(--accent);
}

.lookup-result { margin-top: 1rem; }
.lookup-result:empty { margin-top: 0; }
.notice {
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--wash);
  padding: 0.7rem 0.9rem;
  border-radius: 6px;
}
.notice.warn { border-left-color: var(--origin); background: var(--warn-bg); }

/* Trace timeline */
.trace-flight-line { font-weight: 600; }
.example-banner {
  background: var(--warn-bg);
  border: 1px solid var(--banner-line);
  padding: 0.6rem 0.8rem;
  border-radius: 6px;
  font-weight: 600;
}
.timeline { list-style: none; margin: 1rem 0; padding: 0; }
.timeline li {
  border: 1px solid var(--line);
  border-left: 5px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 0.7rem;
  background: var(--surface);
}
.timeline li.origin {
  border-left-color: var(--origin);
  background: var(--origin-bg);
}
.timeline .leg-route { font-weight: 700; font-size: 1.05rem; }
.timeline .leg-times { color: var(--ink-soft); font-size: 0.92rem; }
.timeline .leg-split { margin-top: 0.35rem; }
.timeline .tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  margin-left: 0.4rem;
  vertical-align: middle;
}
.tag-origin { background: var(--origin); color: #fff; }
.tag-yours { background: var(--ink); color: #fff; }
.timeline .leg-evidence { font-size: 0.92rem; margin-top: 0.3rem; }
.timeline .leg-timer { margin-top: 0.35rem; font-weight: 600; }
.timeline .leg-elapsed { font-variant-numeric: tabular-nums; }
.verdict {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem 1rem;
  background: var(--wash);
}
.verdict h3 { margin: 0 0 0.4rem; font-size: 1.1rem; }

/* Examples */
.example-list { list-style: none; padding: 0; margin: 0; }
.example-list li { margin-bottom: 0.6rem; }
.example-list button {
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--accent);
  color: var(--accent-dark);
  font-weight: 600;
}
.example-list button:hover { background: var(--callout-bg); }
.example-list .ex-summary { display: block; font-weight: 400; color: var(--ink-soft); margin-top: 0.25rem; font-size: 0.92rem; }

/* FAA board */
.faa-status { color: var(--ink-soft); }
.faa-item {
  border: 1px solid var(--line);
  border-left: 5px solid var(--accent);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.7rem;
  background: var(--surface);
}
.faa-item.gs { border-left-color: var(--origin); }
.faa-item h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.faa-item p { margin: 0.25rem 0; }
.faa-item .faa-raw { color: var(--ink-soft); font-size: 0.88rem; }
.faa-item .faa-timer { font-weight: 600; }
.faa-item .faa-scope { font-weight: 600; }
.faa-item .faa-elapsed { font-variant-numeric: tabular-nums; }
.faa-refresh { color: var(--ink-soft); font-size: 0.92rem; }
.faa-refresh #faa-countdown { font-variant-numeric: tabular-nums; font-weight: 600; }
.faa-clear {
  border: 1px solid var(--line);
  border-left: 5px solid var(--ok);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  background: var(--ok-bg);
}

.how-list li, .honest-list li { margin-bottom: 0.5rem; }
.fineprint { color: var(--ink-soft); font-size: 0.88rem; }

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.9rem;
  padding: 1rem 0 1.6rem;
  background: var(--paper);
}

@media (min-width: 40rem) {
  button.primary { width: auto; }
  .hero h1 { font-size: 2rem; }
}

/* ================================================================== */
/* Build-all additions (2026-11-28)                                    */
/* ================================================================== */

/* Horizontal-overflow backstop + root-cause guards. `clip` is used
   (with `hidden` as the fallback line) because it does not create a
   scroll container, so the sticky header keeps working. The ticker's
   own internal animation is untouched — it lives inside its
   overflow:hidden viewport. */
html, body { overflow-x: hidden; overflow-x: clip; max-width: 100%; }
.ticker-viewport { min-width: 0; }
.ticker-track { min-width: 0; }
.ticker-label { min-width: 0; }
img, svg { max-width: 100%; }
input, select, textarea { max-width: 100%; }
.faa-item, .timeline li, .verdict, .notice, .card, .trace-view { min-width: 0; }
.faa-raw, .program-meta, .leg-evidence, .data-source { overflow-wrap: break-word; }

/* Header: Update button (family pattern) + section nav */
.update-row { margin: 0.6rem 0 0; }
.update-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  background: transparent; color: var(--header-ink);
  border: 1px solid var(--header-soft);
  font-weight: 600; font-size: 0.95rem; padding: 0.45rem 0.85rem;
}
.update-btn:hover { border-color: var(--header-strong); }
.update-btn:disabled { opacity: 0.6; cursor: default; }
.site-nav { margin-top: 0.65rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.1rem; }
.site-nav a {
  color: var(--header-ink); font-weight: 600; text-decoration: none;
  border-bottom: 2px solid var(--accent); padding-bottom: 0.1rem;
}
.brand-link { color: inherit; text-decoration: none; }

/* What's New modal (family pattern) */
.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(8, 14, 26, 0.55);
  display: none; align-items: flex-end; justify-content: center;
}
.modal.open { display: flex; }
.modal .sheet {
  background: var(--paper); color: var(--ink);
  width: 100%; max-width: 34rem; max-height: 86vh; overflow: auto;
  border-radius: 14px 14px 0 0; padding: 1rem 1.1rem 1.3rem;
}
@media (min-width: 40rem) {
  .modal { align-items: center; }
  .modal .sheet { border-radius: 14px; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0.2rem 0; font-size: 1.2rem; }
.sheet-head .close {
  background: transparent; border: 0; color: var(--ink);
  font-size: 1.5rem; line-height: 1; padding: 0.3rem 0.6rem;
}
.whats-new-entry h3 { margin: 0.8rem 0 0.3rem; font-size: 1rem; }
.whats-new-entry ul { margin: 0.3rem 0 0.6rem; padding-left: 1.2rem; }
.whats-new-entry li { margin-bottom: 0.3rem; }
.whats-new-update-btn {
  width: 100%; min-height: 48px; border: 1px solid var(--accent-dark);
  border-radius: 11px; background: var(--accent); color: #fff;
  padding: 13px; font-size: 15px; font-weight: 700; cursor: pointer; margin-top: 0.6rem;
}
.whats-new-update-btn:disabled { opacity: 0.6; cursor: default; }
.whats-new-note { color: var(--ink-soft); font-size: 0.9rem; }

/* One-box lookup */
.field-note { color: var(--ink-soft); font-size: 0.88rem; margin: 0.3rem 0 0; }
.more-fields { margin-bottom: 0.85rem; }
.more-fields summary { cursor: pointer; font-weight: 600; margin-bottom: 0.5rem; }
.airline-picker {
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  background: var(--wash); border-radius: 6px; padding: 0.7rem 0.9rem; margin-bottom: 0.85rem;
}
.picker-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.4rem; }
.picker-btn {
  background: var(--surface); color: var(--accent-dark);
  border: 1px solid var(--accent); font-weight: 600; min-height: 44px;
}

/* Airport icon tiles */
.airport-tiles {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.7rem; margin-top: 0.8rem;
}
.airport-tile {
  position: relative; display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  text-decoration: none; color: var(--ink); background: var(--surface);
  min-height: 44px;
}
.airport-tile:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tile-codebg {
  height: 92px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(155deg, #14213d 0%, #0b5fa5 100%);
  color: #fff; font-size: 1.85rem; font-weight: 800; letter-spacing: 0.05em;
}
.tile-meta { display: flex; flex-direction: column; padding: 0.45rem 0.6rem 0.55rem; }
.tile-meta strong { font-size: 1rem; line-height: 1.2; }
.tile-meta span { color: var(--ink-soft); font-size: 0.85rem; }
.airport-chip {
  display: inline-block; font-weight: 600; color: var(--accent-dark);
  margin: 0.1rem 0 0.2rem;
}
.airport-code-line { display: flex; align-items: center; gap: 0.6rem; color: var(--ink-soft); font-weight: 600; margin: 0; }
.airport-code-chip {
  background: var(--ink); color: #fff; font-weight: 800; letter-spacing: 0.05em;
  border-radius: 6px; padding: 0.15rem 0.55rem; font-size: 1.05rem;
}

/* Direction ("will it get worse?") lines */
.direction {
  font-weight: 600; border-left: 4px solid var(--line);
  background: var(--wash); padding: 0.4rem 0.65rem; border-radius: 0 6px 6px 0;
}
.direction.dir-worse { border-left-color: var(--origin); background: var(--origin-bg); }
.direction.dir-better { border-left-color: var(--ok); background: var(--ok-bg); }
.direction.dir-steady { border-left-color: var(--accent); background: var(--callout-bg); }
.faa-local { color: var(--ink-soft); font-size: 0.92rem; }
.gloss-note { color: var(--ink-soft); font-size: 0.88rem; font-style: italic; }

/* Trace extras */
.trace-extra > div { margin-top: 1rem; }
.rights-snapshot, .first-ten, .risk-box {
  border: 1px solid var(--line); border-radius: 8px;
  padding: 0.8rem 0.95rem; background: var(--surface);
}
.rights-snapshot h3, .first-ten h3, .risk-box h3 { margin: 0 0 0.4rem; font-size: 1.05rem; }
.commit-list { list-style: none; padding: 0; margin: 0.4rem 0; }
.commit-list li { margin-bottom: 0.25rem; }
.commit-list li.yes { color: var(--ok); font-weight: 600; }
.commit-list li.no { color: var(--ink-soft); }
.first-ten ol { margin: 0.4rem 0; padding-left: 1.3rem; }
.first-ten li { margin-bottom: 0.3rem; }
.ask-script {
  border-left: 4px solid var(--accent); background: var(--callout-bg);
  padding: 0.6rem 0.8rem; margin: 0.5rem 0 0; font-style: italic;
}

/* Shareable trace card */
.share-card {
  border: 2px solid var(--ink); border-radius: 12px;
  padding: 0.95rem 1.05rem; margin-top: 1rem; background: var(--surface);
}
.share-card-brand { margin: 0; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.14em; color: var(--accent-dark); }
.share-card-flight { margin: 0.25rem 0; font-size: 1.15rem; font-weight: 700; }
.share-card-verdict { margin: 0.3rem 0; }
.share-card-split { margin: 0.2rem 0; color: var(--ink-soft); font-weight: 600; }
.share-card-url { margin: 0.3rem 0 0; color: var(--ink-soft); font-size: 0.88rem; }
.share-row { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.share-status { color: var(--ok); font-weight: 600; font-size: 0.92rem; }

/* Glossary */
.glossary dt { font-weight: 700; margin-top: 0.55rem; }
.glossary dd { margin: 0.15rem 0 0; color: var(--ink-soft); }

/* Photos (verified real photos only; credits always attached) */
.hero-photo, .airport-photo, .board-photo { margin: 0 0 0.9rem; }
.hero-photo img, .airport-photo img, .board-photo img {
  width: 100%; display: block; border-radius: 10px;
}
.hero-photo { position: relative; }
.hero-photo img { aspect-ratio: 21 / 9; object-fit: cover; object-position: 50% 35%; }
.hero-photo .photo-credit {
  position: absolute; right: 0.45rem; bottom: 0.35rem; margin: 0;
  background: rgba(10, 16, 28, 0.72); color: #fff;
  font-size: 0.72rem; padding: 0.12rem 0.45rem; border-radius: 4px;
}
.hero-photo .photo-credit a { color: #cfe0f2; }
html[data-theme="night"] .hero-photo img,
html[data-theme="night"] .airport-photo img,
html[data-theme="night"] .board-photo img { filter: brightness(0.9) saturate(0.95); }
.photo-credit { color: var(--ink-soft); font-size: 0.75rem; text-align: right; margin: 0.25rem 0 0; }
.photo-credits-block h2 { font-size: 1rem; margin: 0.8rem 0 0.3rem; }
.photo-credits-block .photo-credit { text-align: left; }

/* Rights page */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.commit-table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.9rem; }
.commit-table th, .commit-table td { border: 1px solid var(--line); padding: 0.4rem 0.5rem; text-align: center; }
.commit-table th[scope="row"] { text-align: left; background: var(--wash); }
.commit-table thead th { background: var(--wash); }
.commit-table td.yes { color: var(--ok); font-weight: 700; }
.commit-table td.no { color: var(--ink-soft); }
.field select {
  width: 100%; padding: 0.6rem 0.7rem; font-size: 1rem;
  border: 1px solid var(--ink-soft); border-radius: 6px;
  background: var(--surface); color: var(--ink);
}

/* Trace library */
.pm-card, .trace-card {
  border: 1px solid var(--line); border-left: 5px solid var(--accent);
  border-radius: 8px; padding: 0.8rem 0.95rem; margin-bottom: 0.8rem; background: var(--surface);
}
.pm-card h3, .trace-card h3 { margin: 0 0 0.35rem; font-size: 1.05rem; }
.trace-card-cat {
  margin: 0 0 0.25rem; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.05em;
  text-transform: uppercase; color: var(--accent-dark);
}

/* Delay Wire */
.news-list { display: flex; flex-direction: column; gap: 0.9rem; margin-top: 1.1rem; }
.news-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.9rem 1.05rem 1rem;
}
.news-card h3 { margin: 0.2rem 0 0.4rem; font-size: 1.12rem; line-height: 1.35; }
.news-card h3 a { color: var(--ink); text-decoration: none; }
.news-card h3 a:hover { text-decoration: underline; }
.news-meta { margin: 0; color: var(--ink-soft); font-size: 0.88rem; font-weight: 600; }
.news-consequence {
  border-left: 4px solid var(--accent); background: var(--callout-bg);
  padding: 0.5rem 0.7rem; border-radius: 0 6px 6px 0;
}
.news-photo img { width: 100%; display: block; border-radius: 8px; aspect-ratio: 16 / 9; object-fit: cover; }
html[data-theme="night"] .news-photo img { filter: brightness(0.9) saturate(0.95); }
.news-strip { display: flex; flex-direction: column; gap: 0.7rem; }
.news-strip .news-card { background: var(--wash); }

/* Live Plane Map */
.sky-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem 0.8rem; margin-bottom: 0.85rem; }
.sky-controls .field { margin-bottom: 0; }
@media (max-width: 30rem) { .sky-controls { grid-template-columns: 1fr; } }
.sky-faa { margin-bottom: 0.6rem; text-align: center; }
.sky-faa p { margin: 0; }
.sky-map-wrap { position: relative; }
.sky-map {
  height: 62vh; min-height: 320px; width: 100%;
  border: 1px solid var(--line); border-radius: 10px; background: var(--wash);
  touch-action: none;
}
.sky-map .leaflet-container { touch-action: none; }
/* Zoom buttons are a phone's main zoom control — full-size tap targets.
   The ID selector is deliberate: Leaflet's own touch rules
   (.leaflet-touch .leaflet-bar a, 30px) load after this sheet and would
   win a specificity tie. */
#sky-map .leaflet-bar a {
  width: 42px; height: 42px; line-height: 42px; font-size: 1.25rem;
}
/* Attribution sits under the map as a centered line — balanced, and it
   never covers planes or sits on top of the map's own controls. */
.sky-attrib {
  margin: 0.5rem 0 0; text-align: center;
  color: var(--ink-soft); font-size: 0.78rem;
}
.sky-attrib a { color: var(--accent-dark); }
.sky-legend { text-align: center; color: var(--ink-soft); font-size: 0.85rem; margin: 0.4rem 0 0; }
#sky-status { text-align: center; }
/* The planes wear their airline's design: a disc in the brand color
   (--brand, set per aircraft in map.js) with the white plane glyph,
   and the airline's code on a pill under it. No brand = slate disc. */
.plane-icon { background: transparent; border: 0; }
.plane-badge { display: flex; flex-direction: column; align-items: center; gap: 1px; }
.plane-disc {
  width: 26px; height: 26px; border-radius: 50%; flex: 0 0 auto;
  background: #5b6672; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(8, 20, 40, 0.45), inset 0 0 0 2px rgba(255, 255, 255, 0.85);
}
.plane-badge.branded .plane-disc { background: var(--brand); }
.plane-icon.selected .plane-disc {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--origin), 0 1px 4px rgba(8, 20, 40, 0.5);
}
.plane-glyph { display: block; line-height: 0; }
.plane-glyph svg { display: block; }
.plane-code {
  background: var(--brand); color: #fff;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em; line-height: 1;
  padding: 0.14rem 0.3rem; border-radius: 999px;
  box-shadow: 0 1px 2px rgba(8, 20, 40, 0.4);
}
.plane-code.dark { color: #14213d; }
/* Panel brand header: the airline's colors and name over the facts. */
.plane-brand {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  background: var(--brand, #5b6672); color: #fff;
  border-radius: 8px; padding: 0.5rem 0.7rem; margin-bottom: 0.7rem;
}
.plane-brand.darkband { color: #14213d; }
.plane-brand-code {
  background: rgba(255, 255, 255, 0.92); color: var(--brand, #5b6672);
  font-weight: 800; font-size: 0.85rem; letter-spacing: 0.04em;
  border-radius: 6px; padding: 0.15rem 0.45rem;
}
.plane-brand.darkband .plane-brand-code { background: #14213d; color: #fff; }
.plane-brand-name { font-weight: 700; font-size: 1.05rem; }
.plane-brand-cs { font-size: 0.85rem; opacity: 0.85; }
.plane-brand.unknown { background: #5b6672; }
.plane-brand.unknown .plane-brand-name { font-size: 0.95rem; }
.plane-facts { margin: 0.3rem 0 0.6rem; padding-left: 1.2rem; }
.plane-facts li { margin-bottom: 0.25rem; }
.primary-link { font-weight: 700; color: var(--accent-dark); font-size: 1.05rem; }

/* Featured map icon tile (homepage) */
.map-tile {
  display: flex; align-items: center; gap: 0.9rem;
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  text-decoration: none; color: var(--ink); background: var(--surface);
  padding: 0.7rem 0.9rem; min-height: 64px;
}
.map-tile-icon {
  flex: 0 0 auto; width: 64px; height: 64px; border-radius: 12px;
  background: linear-gradient(155deg, #14213d 0%, #0b5fa5 100%);
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.map-tile-meta { display: flex; flex-direction: column; }
.map-tile-meta strong { font-size: 1.1rem; }
.map-tile-meta span { color: var(--ink-soft); font-size: 0.9rem; }

/* Live sky coloring — tile backgrounds and the top band follow the
   actual weather (Open-Meteo via our weather function, painted by
   sky.js). The gradients are drawn as skies: bright warm blue for a
   clear day, grey for rain/overcast, dark and heavy for storms, pale
   ice for snow, deep indigo for a clear night. The default tile face
   (no weather loaded) is a NEUTRAL SLATE — never the brand navy, so
   a plain tile never pretends to be a weather reading. */
.tile-codebg {
  background: linear-gradient(160deg, #5b6672, #7c8794);
  color: #fff;
  flex-direction: column; gap: 0.05rem;
}
.tile-code-letters { font-size: 1.85rem; font-weight: 800; letter-spacing: 0.05em; line-height: 1.05; }
.tile-wx { font-size: 0.78rem; font-weight: 600; min-height: 1em; }
.tile-codebg .tile-code-letters, .tile-codebg .tile-wx { text-shadow: 0 1px 3px rgba(8, 20, 40, 0.45); }
.tile-wx-chip {
  display: inline-block; margin-top: 0.3rem; align-self: flex-start;
  font-size: 0.75rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 999px;
  color: #fff; text-shadow: 0 1px 2px rgba(8, 20, 40, 0.4);
}

.wx-clear.wx-day    { background:
  radial-gradient(circle 26px at 84% 16%, rgba(255, 248, 174, 0.95) 0 58%, rgba(255, 214, 64, 0.55) 78%, rgba(255, 214, 64, 0) 100%),
  linear-gradient(180deg, #2b6cb8 0%, #5ea0dd 48%, #a9d2f2 100%); }
.wx-clear.wx-night  { background:
  radial-gradient(1.5px 1.5px at 22% 30%, rgba(255,255,255,0.9) 50%, transparent 51%),
  radial-gradient(1px 1px at 68% 18%, rgba(255,255,255,0.8) 50%, transparent 51%),
  radial-gradient(1.2px 1.2px at 84% 42%, rgba(255,255,255,0.7) 50%, transparent 51%),
  radial-gradient(1px 1px at 45% 12%, rgba(255,255,255,0.75) 50%, transparent 51%),
  linear-gradient(180deg, #070d24 0%, #16264f 68%, #24365f 100%); }
.wx-partly.wx-day   { background:
  radial-gradient(ellipse 70% 45% at 78% 8%, rgba(255,255,255,0.55), transparent 70%),
  linear-gradient(180deg, #3d7ab5 0%, #7fb0dd 55%, #c3d9ec 100%); }
.wx-partly.wx-night { background:
  radial-gradient(circle 15px at 82% 16%, rgba(244, 241, 222, 0.95) 0 60%, rgba(244, 241, 222, 0) 100%),
  radial-gradient(1.2px 1.2px at 30% 22%, rgba(255,255,255,0.7) 50%, transparent 51%),
  radial-gradient(1px 1px at 55% 12%, rgba(255,255,255,0.6) 50%, transparent 51%),
  linear-gradient(180deg, #101a36 0%, #2a3c66 100%); }
.wx-overcast.wx-day   { background: linear-gradient(180deg, #5f6b78 0%, #8d97a1 58%, #aeb6bd 100%); }
.wx-overcast.wx-night { background: linear-gradient(180deg, #2c333c 0%, #4a545f 100%); }
.wx-fog.wx-day   { background:
  repeating-linear-gradient(180deg, rgba(255,255,255,0.16) 0 12px, rgba(255,255,255,0) 12px 30px),
  linear-gradient(180deg, #7e8891 0%, #b9c0c4 55%, #d8dbdc 100%); }
.wx-fog.wx-night { background:
  repeating-linear-gradient(180deg, rgba(255,255,255,0.07) 0 12px, rgba(255,255,255,0) 12px 30px),
  linear-gradient(180deg, #3a4149 0%, #5f686f 100%); }
.wx-rain.wx-day   { background:
  repeating-linear-gradient(115deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 9px),
  linear-gradient(180deg, #2e4258 0%, #4d6580 58%, #68809a 100%); }
.wx-rain.wx-night { background:
  repeating-linear-gradient(115deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 9px),
  linear-gradient(180deg, #1a2837 0%, #33465c 100%); }
.wx-storm.wx-day   { background: linear-gradient(180deg, #17141f 0%, #2e2742 55%, #473b63 100%); }
.wx-storm.wx-night { background: linear-gradient(180deg, #0f0d17 0%, #241f38 60%, #352b52 100%); }
.wx-snow.wx-day   { background:
  radial-gradient(2px 2px at 18% 24%, rgba(110,140,175,0.55) 50%, transparent 51%),
  radial-gradient(1.6px 1.6px at 42% 62%, rgba(110,140,175,0.5) 50%, transparent 51%),
  radial-gradient(2.4px 2.4px at 66% 30%, rgba(110,140,175,0.5) 50%, transparent 51%),
  radial-gradient(1.8px 1.8px at 82% 58%, rgba(110,140,175,0.55) 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 30% 84%, rgba(110,140,175,0.45) 50%, transparent 51%),
  linear-gradient(180deg, #b9cfe2 0%, #e3edf6 55%, #f8fcff 100%); }
.wx-snow.wx-night { background:
  radial-gradient(2px 2px at 18% 24%, rgba(255,255,255,0.85) 50%, transparent 51%),
  radial-gradient(1.6px 1.6px at 42% 62%, rgba(255,255,255,0.8) 50%, transparent 51%),
  radial-gradient(2.4px 2.4px at 66% 30%, rgba(255,255,255,0.8) 50%, transparent 51%),
  radial-gradient(1.8px 1.8px at 82% 58%, rgba(255,255,255,0.85) 50%, transparent 51%),
  radial-gradient(1.5px 1.5px at 30% 84%, rgba(255,255,255,0.75) 50%, transparent 51%),
  linear-gradient(180deg, #5d7189 0%, #93a9bf 60%, #c3d3e2 100%); }
.wx-snow.wx-day .tile-code-letters, .wx-snow.wx-day .tile-wx { text-shadow: none; }
.tile-codebg.wx-snow.wx-day { color: #14213d; }
.tile-wx-chip.wx-snow.wx-day { color: #14213d; text-shadow: none; }

/* Drawn clouds (Cliff's order: "There must be clouds" — a cloudy sky
   SHOWS clouds, it is not just grey). A soft layer of cloud puffs sits
   over the gradient on the header band and the airport tiles wherever
   the condition is cloudy, and drifts slowly. Pure CSS gradients —
   no images, safe on old shells; still under reduced motion. */
.site-header { position: relative; }
.site-header .wrap { position: relative; z-index: 1; }
.tile-codebg { position: relative; }
.tile-codebg > * { position: relative; z-index: 1; }
.wx-partly.wx-day    { --cloud-a: rgba(255,255,255,0.75); --cloud-b: rgba(255,255,255,0.5); }
.wx-partly.wx-night  { --cloud-a: rgba(190,205,230,0.28); --cloud-b: rgba(190,205,230,0.18); }
.wx-overcast.wx-day  { --cloud-a: rgba(255,255,255,0.55); --cloud-b: rgba(120,130,142,0.45); }
.wx-overcast.wx-night { --cloud-a: rgba(200,210,222,0.22); --cloud-b: rgba(10,14,20,0.35); }
.wx-rain.wx-day      { --cloud-a: rgba(200,212,224,0.4); --cloud-b: rgba(40,55,72,0.4); }
.wx-rain.wx-night    { --cloud-a: rgba(160,175,195,0.22); --cloud-b: rgba(8,12,20,0.4); }
.wx-storm.wx-day, .wx-storm.wx-night { --cloud-a: rgba(16,12,28,0.5); --cloud-b: rgba(60,50,90,0.45); }
.wx-fog.wx-day       { --cloud-a: rgba(255,255,255,0.5); --cloud-b: rgba(255,255,255,0.35); }
.wx-fog.wx-night     { --cloud-a: rgba(210,218,226,0.2); --cloud-b: rgba(210,218,226,0.12); }
.site-header.wx-partly::before, .site-header.wx-overcast::before,
.site-header.wx-rain::before, .site-header.wx-storm::before, .site-header.wx-fog::before,
.tile-codebg.wx-partly::before, .tile-codebg.wx-overcast::before,
.tile-codebg.wx-rain::before, .tile-codebg.wx-storm::before, .tile-codebg.wx-fog::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-repeat: repeat-x; background-size: 240px 100%;
  background-image:
    radial-gradient(ellipse 90px 26px at 60px 30%, var(--cloud-a) 55%, transparent 72%),
    radial-gradient(ellipse 120px 32px at 170px 62%, var(--cloud-b) 55%, transparent 72%),
    radial-gradient(ellipse 70px 20px at 205px 18%, var(--cloud-a) 55%, transparent 72%);
  animation: wx-drift 80s linear infinite;
}
@keyframes wx-drift {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 240px 0, 240px 0, 240px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header::before, .tile-codebg::before { animation: none; }
}

/* Top band: the header takes the sky gradient when weather paints it.
   Light skies flip the header ink to navy so text stays readable. */
.site-header { transition: background-color 0.6s ease; }
.site-header.wx-clear, .site-header.wx-partly, .site-header.wx-overcast,
.site-header.wx-fog, .site-header.wx-rain, .site-header.wx-storm, .site-header.wx-snow {
  --header-ink: #ffffff; --header-soft: #dbe7f5; --header-strong: #ffffff;
}
.site-header.wx-snow.wx-day, .site-header.wx-fog.wx-day {
  --header-ink: #14213d; --header-soft: #3c4a63; --header-strong: #14213d;
}
.header-wx { margin: 0.45rem 0 0; color: var(--header-soft); font-size: 0.92rem; font-weight: 600; }
.wx-locate-btn {
  background: transparent; color: var(--header-ink); border: 1px solid var(--header-soft);
  font-size: 0.85rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px;
}

/* Weather legend */
.wx-legend { margin-top: 0.9rem; }
.wx-legend .wx-swatches { display: flex; flex-wrap: wrap; gap: 0.35rem 0.9rem; }
.wx-legend .wx-swatch { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.wx-dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 1px solid var(--line); }
.wx-legend p { color: var(--ink-soft); font-size: 0.85rem; margin: 0.4rem 0 0; }

/* Animated world mark on the Live Plane Map tile */
.map-tile-icon .orbit { transform-box: fill-box; transform-origin: center; animation: orbit-spin 26s linear infinite; }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .map-tile-icon .orbit { animation: none; }
}
/* Photo focal points (per the photo integration spec) — airport
   pages and boards only; tiles carry no photos (see airport.js). */
.board-photo img { aspect-ratio: 16 / 9; object-fit: cover; object-position: 50% 30%; }
.airport-photo img { aspect-ratio: 16 / 9; object-fit: cover; }
@media (max-width: 40rem) { .hero-photo img { aspect-ratio: 16 / 10; } }
/* Phone photo discipline (Cliff: "That picture is too big"): on a
   phone the hero is a BAND, not a screen — an explicit height (never
   aspect-ratio alone: an <img> height attribute can override that on
   some engines and blow the photo up to full size). The focal point
   stays on the Delta jet at the gate, right of center. Airport and
   board photos get the same cap so no photo swallows a first screen. */
@media (max-width: 30rem) {
  .hero-photo img {
    height: 250px; height: 34vh; max-height: 300px;
    aspect-ratio: auto; object-position: 62% 40%;
  }
  .airport-photo img { height: 210px; height: 28vh; max-height: 260px; aspect-ratio: auto; }
  .board-photo img { height: 200px; height: 27vh; max-height: 240px; aspect-ratio: auto; }
}

/* Social layer: Delay Wire reactions/comments + Airport Lounge */
.social-bar { margin-top: .8rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.social-reactions { display: flex; flex-wrap: wrap; gap: .45rem; }
.react-btn { min-height: 2.6rem; padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: .9rem; cursor: pointer; }
.react-btn.on { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.social-comments { margin-top: .7rem; }
.comment-list, .lounge-list { list-style: none; margin: .6rem 0; padding: 0; display: grid; gap: .55rem; }
.comment, .lounge-post { background: var(--surface); border: 1px solid var(--line); border-radius: .7rem; padding: .55rem .7rem; }
.comment p, .lounge-post p { margin: .15rem 0; overflow-wrap: anywhere; }
.comment-when { color: var(--muted); font-size: .82rem; }
.comment-empty, .lounge-empty { color: var(--muted); padding: .6rem .2rem; }
.comment-form, .lounge-form { display: grid; gap: .5rem; margin-top: .5rem; }
.comment-form { grid-template-columns: 1fr auto; align-items: center; }
.comment-input, .lounge-input, .handle-input, .lounge-flight, .lounge-filter-input {
  width: 100%; min-height: 2.6rem; padding: .5rem .6rem; border-radius: .55rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.btn-small { min-height: 2.6rem; padding: .5rem .95rem; border-radius: .55rem; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.link-btn { background: none; border: none; color: var(--accent); font: inherit; font-size: .85rem;
  cursor: pointer; padding: .2rem; text-decoration: underline; }
.report-btn { color: var(--muted); font-size: .78rem; }
.social-note { color: var(--muted); font-size: .85rem; margin: .2rem 0; }
.social-msg { color: var(--accent); font-size: .9rem; min-height: 1.1em; margin: .2rem 0; }
.social-handle { margin: .3rem 0; }
.social-handle-form { display: grid; gap: .45rem; margin-bottom: .5rem; }
.lounge-row { display: flex; gap: .6rem; align-items: end; flex-wrap: wrap; }
.lounge-row label { flex: 1 1 10rem; display: grid; gap: .25rem; font-size: .9rem; }
.lounge-filter { margin-top: .7rem; }
.lounge-filter label { display: grid; gap: .25rem; font-size: .9rem; max-width: 16rem; }
.lounge-switcher { margin: .3rem 0 .8rem; }
.lounge-switcher label { display: grid; gap: .25rem; font-size: .9rem; max-width: 20rem; }
.lounge-airport-select {
  width: 100%; min-height: 2.6rem; padding: .5rem .6rem; border-radius: .55rem;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; }
.flight-tag { background: var(--surface2); border: 1px solid var(--line); border-radius: .4rem;
  padding: .05rem .4rem; font-size: .82rem; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
