/* ICE flights at AEX — Kingfish Data tool. Light and dark via prefers-color-scheme. */

/* Tokens map onto the Kingfish brand layer (/static/kingfish.css). Arrivals are
   Bayou, departures Brass, and Delta is spent only on ICE / alert signals. */

:root {
  color-scheme: light;
  --bg: var(--kf-paper);
  --surface: var(--kf-paper);
  --surface-2: #f6f4ef;
  --border: #dedad0;
  --border-strong: #b9b4a6;
  --fg: var(--kf-ink);
  --fg-2: #3d4248;
  --muted: var(--kf-fog);
  --link: var(--kf-bayou);
  --primary: var(--kf-bayou);
  --primary-hover: var(--kf-bayou-alt);
  --on-primary: var(--kf-on-primary);
  --accent: var(--kf-delta);
  --focus: var(--kf-brass);
  --series-in: #1f3d2e;
  --series-out: #b5894c;
  --grid: #ebe8e0;

  --in-bg: #e3ece6;
  --in-fg: #1f3d2e;
  --out-bg: #f4ead9;
  --out-fg: #6e4c1a;

  --t-confirmed-bg: #8b1f2f;
  --t-confirmed-fg: #ffffff;
  --t-likely-bg: #f6e1e4;
  --t-likely-fg: #6e1825;
  --t-review-bg: #e8eaed;
  --t-review-fg: #2f3439;
  --t-dismissed-bg: #f3f1ec;
  --t-dismissed-fg: #6b7178;

  --ev-ground-bg: #e3ece6;
  --ev-ground-fg: #1f3d2e;
  --ev-low-bg: #e8eaed;
  --ev-low-fg: #2f3439;
  --ev-inferred-bg: #f3f1ec;
  --ev-inferred-fg: #5d6268;

  --flag-bg: #f4ead9;
  --flag-fg: #6e4c1a;
  --ok: #2f7a52;
  --off: #a3a199;
  --row-hover: #faf8f3;

  --kf-max: 1320px; /* align the Kingfish bar and footer with .wrap */
  --radius: var(--kf-radius-sm);
  --font: var(--kf-font-sans);
  --font-serif: var(--kf-font-serif);
  --font-mono: var(--kf-font-mono);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --surface: #15181d;
    --surface-2: #1d2126;
    --border: #2c3138;
    --border-strong: #454b53;
    --fg-2: #cdc8bc;
    --link: #6fa98a;
    --series-in: #5fa07d;
    --series-out: #c9a063;
    --grid: #23272d;

    --in-bg: #1b3127;
    --in-fg: #b9dcc8;
    --out-bg: #382c1a;
    --out-fg: #e6c894;

    --t-confirmed-bg: #b8323f;
    --t-confirmed-fg: #ffffff;
    --t-likely-bg: #3d1a20;
    --t-likely-fg: #f2b6bd;
    --t-review-bg: #262a30;
    --t-review-fg: #d6d9dd;
    --t-dismissed-bg: #1c1f24;
    --t-dismissed-fg: #9ba1a8;

    --ev-ground-bg: #1b3127;
    --ev-ground-fg: #b9dcc8;
    --ev-low-bg: #262a30;
    --ev-low-fg: #d6d9dd;
    --ev-inferred-bg: #1c1f24;
    --ev-inferred-fg: #b5b0a5;

    --flag-bg: #382c1a;
    --flag-fg: #e6c894;
    --ok: #5fa07d;
    --off: #6f6d66;
    --row-hover: #1a1d22;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--font);
  overflow-x: hidden;
}

a {
  color: var(--link);
  text-underline-offset: 3px;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[role="tab"]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.wrap {
  max-width: 1320px;
  margin-inline: auto;
  padding-inline: clamp(12px, 3vw, 28px);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.85rem;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.tnum,
.data td,
.kpi__value,
time {
  font-variant-numeric: tabular-nums;
}

.nowrap {
  white-space: nowrap;
}

/* ------------------------------------------------------------ masthead */

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.masthead__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  justify-content: space-between;
  align-items: flex-end;
  padding-block: 1.1rem 1rem;
}

.masthead__title {
  flex: 1 1 28rem;
  min-width: 0;
}

.kicker {
  margin: 0;
}

h1 {
  margin: 0.5rem 0 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.dek {
  margin: 0.35rem 0 0;
  color: var(--fg-2);
  max-width: 46rem;
}

.masthead__status {
  flex: 0 1 26rem;
  min-width: 0;
}

.pills {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.82rem;
  background: var(--surface-2);
  cursor: default;
}

.pill__state {
  color: var(--muted);
}

.dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--off);
  flex: none;
}

.pill--on .dot {
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent);
}

.coverage {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: right;
}

/* ---------------------------------------------------------------- KPIs */

.kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.6rem;
  margin-block: 1rem 0.6rem;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.7rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.kpi:hover {
  border-color: var(--primary);
}

.kpi__value {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.15;
}

.kpi__sep {
  color: var(--muted);
  font-weight: 400;
  margin-inline: 0.15em;
}

.kpi__label {
  font-size: 0.82rem;
  color: var(--fg-2);
}

.kpi__label small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
}

.kpi--live {
  border-color: var(--accent);
}

.kpi--live .kpi__value {
  color: var(--accent);
}

@media (max-width: 760px) {
  .kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpis .kpi:last-child {
    grid-column: span 2;
  }

  .kpi__value {
    font-size: 1.4rem;
  }
}

/* ---------------------------------------------------------------- tabs */

.tabs {
  display: flex;
  gap: 0.2rem;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: thin;
  margin-top: 0.6rem;
}

.tabs [role="tab"] {
  flex: none;
  padding: 0.6rem 0.85rem;
  color: var(--fg-2);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  white-space: nowrap;
}

.tabs [role="tab"]:hover {
  color: var(--fg);
}

.tabs [role="tab"][aria-selected="true"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

main {
  padding-block: 1rem 2rem;
  outline: none;
}

.lede {
  margin: 0 0 0.8rem;
  color: var(--fg-2);
  max-width: 50rem;
}

/* ------------------------------------------------------------- filters */

.filters {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.6rem;
}

.filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.field--grow {
  flex: 1 1 16rem;
}

.field__label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0;
}

input[type="search"],
input[type="date"],
input[type="password"],
select,
textarea {
  font: inherit;
  font-size: 0.92rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.4rem 0.55rem;
  min-width: 0;
  max-width: 100%;
}

textarea {
  width: 100%;
  resize: vertical;
}

.checks {
  border: 0;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.9rem;
  align-items: center;
}

.checks legend {
  float: left;
  width: 100%;
  margin-bottom: 0.25rem;
}

.checks label,
.check-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.92rem;
  white-space: nowrap;
  cursor: pointer;
}

.segmented {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 100%;
}

.segmented button {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.38rem 0.7rem;
  background: var(--surface);
  color: var(--fg-2);
  border: 0;
  border-right: 1px solid var(--border);
  cursor: pointer;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button[aria-pressed="true"] {
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
}

.daterange {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

/* --------------------------------------------------------- result bar */

.resultbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  justify-content: space-between;
  align-items: center;
  margin: 0.4rem 0 0.6rem;
}

.resultbar__count {
  margin: 0;
  color: var(--fg-2);
}

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  border-color: var(--fg-2);
}

.button--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

.button--primary:hover {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
}

.button--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--link);
}

.more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 0;
}

.more:empty {
  display: none;
}

/* -------------------------------------------------------------- tables */

.table-wrap {
  position: relative; /* contains absolutely positioned .sr-only text */
  overflow: auto;
  max-height: 78vh;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  -webkit-overflow-scrolling: touch;
}

#aircraft-detail .table-wrap {
  max-height: 60vh;
}

table.data {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}

.data th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fg-2);
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.data td {
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.data tbody tr:hover td {
  background: var(--row-hover);
}

.data tbody tr:last-child td {
  border-bottom: 0;
}

.data .num {
  text-align: right;
}

.data--compact td,
.data--compact th {
  padding: 0.3rem 0.6rem;
}

.data .empty {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

.row--aex td {
  background: color-mix(in srgb, var(--accent) 6%, transparent);
}

.sub {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.sub.fromto {
  display: inline;
  margin-right: 0.15rem;
}

.alts {
  font-style: italic;
}

.tail {
  font-weight: 700;
  font-size: 1rem;
  color: var(--fg);
  text-decoration-color: var(--border-strong);
  text-underline-offset: 3px;
  font-variant-numeric: tabular-nums;
}

.tail:hover {
  color: var(--link);
}

.airport {
  font-weight: 600;
}

.approx {
  color: var(--muted);
  margin-right: 0.15em;
}

abbr[title] {
  text-decoration: underline dotted var(--border-strong);
  cursor: help;
}

.sources {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ------------------------------------------------------------- badges */

.dir,
.tier,
.ev,
.flag {
  display: inline-block;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.5;
  padding: 0 0.4rem;
  white-space: nowrap;
  vertical-align: 0.08em;
}

.dir {
  min-width: 2.6rem;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dir--in {
  background: var(--in-bg);
  color: var(--in-fg);
}

.dir--out {
  background: var(--out-bg);
  color: var(--out-fg);
}

.tier--confirmed {
  background: var(--t-confirmed-bg);
  color: var(--t-confirmed-fg);
}

.tier--likely {
  background: var(--t-likely-bg);
  color: var(--t-likely-fg);
}

.tier--review {
  background: var(--t-review-bg);
  color: var(--t-review-fg);
}

.tier--dismissed,
.tier--none {
  background: var(--t-dismissed-bg);
  color: var(--t-dismissed-fg);
}

.ev {
  font-weight: 600;
  cursor: help;
}

.ev--ground {
  background: var(--ev-ground-bg);
  color: var(--ev-ground-fg);
}

.ev--low {
  background: var(--ev-low-bg);
  color: var(--ev-low-fg);
}

.ev--inferred {
  background: var(--ev-inferred-bg);
  color: var(--ev-inferred-fg);
  border: 1px dashed var(--border-strong);
  line-height: 1.35;
}

.conf {
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.flag {
  background: var(--flag-bg);
  color: var(--flag-fg);
  font-weight: 600;
  cursor: help;
}

.flag--aex {
  background: var(--accent);
  color: #fff;
}

.chip {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  margin: 0 0.2rem 0.3rem 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surface-2);
}

/* ------------------------------------------------------------ notices */

.notice {
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  margin-bottom: 0.6rem;
}

.notice--error {
  border-left-color: var(--accent);
}

.notice--ground {
  border-left-color: var(--accent);
}

.notice__title {
  margin: 0 0 0.4rem;
  font-size: 1rem;
}

.ground {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.ground li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 0.6rem;
  align-items: baseline;
}

/* -------------------------------------------------------------- detail */

.crumbs {
  margin: 0 0 0.6rem;
}

.detail__head h2 {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.2rem;
}

.detail__tail {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  font-variant-numeric: tabular-nums;
}

.detail__flags {
  margin: 0.4rem 0 0;
}

.detail__flags:empty {
  display: none;
}

.detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem 2rem;
  margin: 1rem 0 1.4rem;
}

@media (max-width: 760px) {
  .detail__grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ident {
  align-self: start;
  align-content: start;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.35rem 1rem;
  margin: 0;
  padding: 0.9rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ident dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.ident dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.why h3:first-child {
  margin-top: 0;
}

#aircraft-detail h3 {
  margin: 1.4rem 0 0.5rem;
  font-size: 1rem;
}

.why h3 {
  font-size: 1rem;
}

.review {
  margin-top: 1.6rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-width: 44rem;
}

#aircraft-detail .review h3 {
  margin-top: 0;
}

.review__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.6rem;
}

.review__token {
  margin-top: 0.6rem;
}

.review__msg {
  margin: 0.5rem 0 0;
  min-height: 1.2em;
}

.review__msg--error {
  color: var(--accent);
  font-weight: 600;
}

/* Editor sign-in: a quiet nav button and its dialog. */
.kf-nav__admin {
  display: block;
  padding: 0.3rem 0.1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  font: inherit;
  font-size: var(--kf-text-small);
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
}

.kf-nav__admin:hover,
.kf-nav__admin--on {
  color: var(--kf-bayou);
  border-bottom-color: var(--kf-bayou);
}

.admin {
  width: min(28rem, calc(100vw - 32px));
  padding: 1.2rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

.admin::backdrop {
  background: rgb(0 0 0 / 0.45);
}

.admin h2 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
}

.admin .field input {
  width: 100%;
}

/* --------------------------------------------------------------- stats */

#stats-window {
  margin-bottom: 1rem;
}

.statline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-bottom: 1rem;
  color: var(--fg-2);
}

.statline__v {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  margin-right: 0.25rem;
}

.chart-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}

.chart-block h3,
.rank h3 {
  margin: 0 0 0.3rem;
  font-size: 1rem;
}

.legend {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: var(--fg-2);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.key {
  display: inline-block;
  width: 0.75rem;
  height: 0.75rem;
  border-radius: 2px;
}

.key--out {
  margin-left: 0.8rem;
}

.key--in,
.bar--in {
  background: var(--series-in);
  fill: var(--series-in);
}

.key--out,
.bar--out {
  background: var(--series-out);
  fill: var(--series-out);
}

.chart-scroll {
  overflow-x: auto;
}

.chart {
  display: block;
  max-width: none;
}

.chart .grid {
  stroke: var(--grid);
  stroke-width: 1;
}

.chart .baseline {
  stroke: var(--border-strong);
  stroke-width: 1;
}

.chart .axis {
  fill: var(--muted);
  font-size: 11px;
  font-family: var(--font);
}

.chart .hit {
  fill: transparent;
}

.chart .bar-group.is-hover .hit {
  fill: var(--grid);
  opacity: 0.6;
}

.table-view {
  margin-top: 0.5rem;
  font-size: 0.88rem;
}

.table-view summary {
  cursor: pointer;
  color: var(--link);
}

.table-view .table-wrap {
  max-height: 40vh;
  margin-top: 0.4rem;
}

.ranks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
  gap: 1rem;
}

.rank {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  min-width: 0;
}

.rank ol {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
}

.rank li {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr) 2.5rem;
  gap: 0.6rem;
  align-items: center;
  font-size: 0.9rem;
}

.rank__label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank__bar {
  height: 0.6rem;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
}

.rank__bar span {
  display: block;
  height: 100%;
  background: var(--fg-2);
  border-radius: 0 3px 3px 0;
}

.rank__count {
  text-align: right;
}

.tooltip {
  position: fixed;
  z-index: 3000;
  pointer-events: none;
  background: var(--fg);
  color: var(--bg);
  font-size: 0.8rem;
  padding: 0.3rem 0.55rem;
  border-radius: 4px;
  max-width: 18rem;
}

/* ---------------------------------------------------------------- live */

.live {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
  gap: 0.8rem;
  min-height: 70vh;
}

@media (max-width: 860px) {
  .live {
    grid-template-columns: minmax(0, 1fr);
  }
}

.live__map {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 60vh;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 60vh;
}

.live__side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  max-height: 75vh;
}

.live__controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
}

.live__list {
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-y: auto;
}

.live__list > .muted {
  padding: 1rem;
}

.live__row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}

.live__row button {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.5rem;
  align-items: baseline;
  text-align: left;
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.live__row button:hover {
  background: var(--row-hover);
}

.live__row--flagged {
  border-left: 3px solid var(--accent);
}

.live__name {
  font-weight: 700;
}

.live__meta {
  flex-basis: 100%;
  font-size: 0.8rem;
  color: var(--muted);
}

.live__link {
  align-self: center;
  padding: 0 0.8rem;
  font-size: 0.82rem;
}

.plane-icon {
  font-size: 16px;
  line-height: 18px;
  text-align: center;
  color: var(--series-in);
  text-shadow: 0 0 2px #fff;
}

.plane-icon--flagged {
  color: var(--accent);
  font-size: 20px;
}

.airport-icon {
  color: var(--accent);
  font-size: 16px;
  line-height: 16px;
  text-align: center;
}

.leaflet-container {
  font: inherit;
}

/* --------------------------------------------------------------- about */

.prose {
  max-width: 46rem;
}

.prose h2 {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  margin: 0.4rem 0 0.6rem;
}

.prose h3 {
  margin: 1.6rem 0 0.4rem;
  font-size: 1.1rem;
}

.prose p,
.prose li {
  line-height: 1.6;
}

.prose li {
  margin-bottom: 0.4rem;
}

.defs {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 0.5rem 1rem;
  margin: 0.6rem 0;
}

.defs dt {
  padding-top: 0.15rem;
}

.defs dd {
  margin: 0;
}

@media (max-width: 480px) {
  .defs {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.2rem;
  }

  .defs dd {
    margin-bottom: 0.6rem;
  }
}


@media (max-width: 600px) {
  .coverage,
  .pills {
    text-align: left;
    justify-content: flex-start;
  }

  .rank li {
    grid-template-columns: minmax(0, 8rem) minmax(0, 1fr) 2rem;
  }
}

/* ---------------------------------------------------------- at AEX now */

.at-aex {
  margin-block: 0.4rem 0.4rem;
}

.at-aex__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.2rem 1rem;
  justify-content: space-between;
}

.at-aex__head h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.at-aex__head p {
  margin: 0;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  gap: 0.8rem;
  margin-bottom: 0.4rem;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}

.card .photo {
  margin: 0;
  border-bottom: 1px solid var(--border);
}

.card__body {
  padding: 0.6rem 0.8rem 0.8rem;
}

.card__title {
  margin: 0 0 0.2rem;
  font-size: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.card__title .tail {
  font-size: 1.3rem;
}

.card__meta,
.card__flags,
.card__time {
  margin: 0.15rem 0 0;
  font-size: 0.88rem;
  color: var(--fg-2);
}

.card__time strong {
  color: var(--fg);
}

.seats {
  cursor: help;
  border-bottom: 1px dotted var(--border-strong);
}

.seats__note {
  color: var(--muted);
}

/* -------------------------------------------------------------- photos */

.photo {
  margin: 0;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.photo--thumb {
  min-height: 7rem;
}

.photo--large {
  min-height: 10rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

.photo__ph {
  color: var(--border-strong);
  font-size: 2rem;
  line-height: 1;
}

.photo--none .photo__ph {
  opacity: 0.6;
}

.photo > a {
  display: block;
  line-height: 0;
}

.photo img {
  display: block;
  max-width: 100%;
  height: auto;
}

.photo figcaption {
  align-self: stretch;
  line-height: 1.35;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.25rem 0.5rem;
  background: var(--surface);
}

.photo-cell {
  width: 8.5rem;
}

.photo-cell .photo {
  width: 8rem;
  min-height: 3.5rem;
  border-radius: 4px;
  overflow: hidden;
}

.photo-cell .photo figcaption {
  font-size: 0.65rem;
  padding: 0.15rem 0.3rem;
  line-height: 1.3;
}

.photo-cell .photo__ph {
  font-size: 1.3rem;
}

/* ------------------------------------------------- reports & compare */

.linkish {
  font: inherit;
  font-size: 0.8rem;
  color: var(--link);
  background: none;
  border: 0;
  padding: 0.2rem 0;
  cursor: pointer;
  text-align: left;
  white-space: nowrap;
}

.linkish:hover {
  text-decoration: underline;
}

.reports-row > td {
  background: var(--surface-2);
}

.data--nested {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
}

.data--nested th {
  position: static;
}

.row--bad td {
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

.bad {
  color: var(--accent);
}

.flag--bad {
  background: var(--accent);
  color: #fff;
}

.compare__window {
  max-width: 52rem;
  color: var(--fg-2);
  font-size: 0.9rem;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 10rem), 1fr));
  gap: 0.6rem;
  margin: 0.8rem 0 0.4rem;
}

.tile {
  display: flex;
  flex-direction: column;
  padding: 0.6rem 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.tile__v {
  font-size: 1.4rem;
  font-weight: 700;
}

.tile__l {
  font-size: 0.8rem;
  color: var(--fg-2);
}

.tile__x {
  font-size: 0.75rem;
  font-weight: 600;
}

.data .mark {
  text-align: center;
  white-space: nowrap;
}

.mark--yes {
  color: var(--ok);
  font-weight: 700;
}

.mark--no {
  color: var(--accent);
  font-weight: 700;
}

.mark--none {
  color: var(--border-strong);
}

.delta--big {
  color: var(--accent);
  font-weight: 700;
}

.chart-block__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.3rem 1rem;
}

.seatsline p {
  margin: 0.15rem 0;
}

/* -------------------------------------------------------------- routes */

.routes__toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.6rem;
}

.routes__toolbar .legend {
  margin: 0;
}

.routes__main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 17rem);
  gap: 0.8rem;
}

.routes--static .routes__main {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 860px) {
  .routes__main {
    grid-template-columns: minmax(0, 1fr);
  }
}

.routes__stage {
  min-width: 0;
}

.routes__map {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}

#routes-map {
  width: 100%;
  height: clamp(320px, 62vh, 680px);
  background: var(--surface-2);
}

@media (prefers-color-scheme: dark) {
  .routes-tiles {
    filter: brightness(0.62) contrast(1.1) saturate(0.6);
  }
}

.routes__side {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 0.9rem;
  min-width: 0;
}

.routes__clock {
  margin: 0 0 0.6rem;
}

.routes__clock time {
  font-size: 1.15rem;
  font-weight: 700;
}

.routes__counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0 0 0.8rem;
}

.routes__counts div {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.4rem 0.5rem;
}

.routes__counts dt {
  font-size: 0.72rem;
  color: var(--fg-2);
  line-height: 1.2;
}

.routes__counts dd {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  font-weight: 700;
}

.routes__h {
  font-size: 0.85rem;
  margin: 0 0 0.3rem;
}

.routes__recent {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.routes__recent li {
  border-top: 1px solid var(--border);
}

.routes__recent a {
  display: block;
  padding: 0.35rem 0;
  color: inherit;
  text-decoration: none;
}

.routes__recent a:hover strong {
  color: var(--link);
}

.routes__timeline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin-top: 0.7rem;
  padding: 0.6rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

#routes-play {
  min-width: 5.5rem;
  justify-content: center;
}

.routes__slider {
  flex: 1 1 14rem;
  min-width: 0;
  display: flex;
}

.routes__slider input {
  width: 100%;
  accent-color: var(--primary);
}

.routes__note {
  margin: 0.6rem 0;
  max-width: 60rem;
}

.leaflet-tooltip .mono {
  font-size: 0.85em;
}

.routes__fallback {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--fg);
  font-weight: 600;
}

/* ------------------------------------------------ predicted destinations */

.predicted {
  cursor: help;
}

.predicted__airport {
  font-style: italic;
  font-weight: 600;
  color: var(--fg-2);
}

.badge-pred {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 600;
  font-style: normal;
  line-height: 1.35;
  padding: 0 0.35rem;
  border-radius: 4px;
  border: 1px dashed var(--border-strong);
  color: var(--muted);
  background: transparent;
  vertical-align: 0.1em;
  white-space: nowrap;
}

.badge-pred--filed {
  border-style: solid;
  border-color: var(--link);
  color: var(--link);
}

/* ------------------------------------------------------- at AEX now view */

.tab-count {
  display: inline-block;
  min-width: 1.4em;
  padding: 0 0.35em;
  margin-left: 0.2em;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--fg-2);
  font-size: 0.75rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.tab-count--live {
  background: var(--accent);
  color: #fff;
}

.now__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 0.4rem 1rem;
  margin-bottom: 0.6rem;
}

.now__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 3vw, 1.7rem);
}

.now__head p {
  margin: 0.2rem 0 0;
}

.now__map {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0.8rem;
}

#now-map {
  width: 100%;
  height: clamp(220px, 34vh, 360px);
  background: var(--surface-2);
}

.now-label {
  font-weight: 600;
}

.now__count {
  margin: 0 0 0.8rem;
}

.now__cards {
  display: grid;
  gap: 1rem;
}

.ncard {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  break-inside: avoid;
  page-break-inside: avoid;
}

.ncard--overdue {
  border-left-style: dashed;
}

@media (max-width: 820px) {
  .ncard {
    grid-template-columns: minmax(0, 1fr);
  }
}

.ncard__photo .photo--large {
  justify-content: flex-start;
  margin: 0;
  border: 0;
  border-radius: 0;
  height: 100%;
  min-height: 12rem;
}

.ncard__body {
  padding: 0.9rem 1.1rem 1rem;
  min-width: 0;
}

.ncard__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}

.ncard__tail {
  margin: 0;
}

.ncard__tail .tail {
  font-size: clamp(1.7rem, 5vw, 2.3rem);
  font-weight: 800;
  text-decoration-thickness: 2px;
}

.ncard__type,
.ncard__op {
  margin: 0.2rem 0 0;
  color: var(--fg-2);
}

.ncard__why {
  margin: 0.35rem 0 0;
}

.ncard__ground {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.3rem 0.6rem;
  margin: 0.7rem 0 0.5rem;
  padding: 0.5rem 0.7rem;
  background: var(--surface-2);
  border-radius: var(--radius);
}

.ncard__ground-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--fg-2);
  font-weight: 700;
}

.ncard__ground-value {
  font-size: 1.6rem;
  font-weight: 800;
}

.ncard__facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.3rem;
  font-size: 0.92rem;
}

.ncard__facts li {
  overflow-wrap: anywhere;
}

.estimate {
  font-weight: 700;
  font-style: italic;
  color: var(--fg-2);
}

.now__recent {
  margin-top: 0.7rem;
  font-size: 0.88rem;
}

.now__recent summary {
  cursor: pointer;
  color: var(--link);
}

.now__recent .table-wrap {
  margin-top: 0.4rem;
  max-height: none;
}

.now__departed {
  margin-top: 1.4rem;
}

.now__departed h3 {
  margin: 0 0 0.5rem;
}

.now__departed .table-wrap {
  max-height: none;
}

.now__coverage {
  margin-top: 1rem;
  max-width: 52rem;
}

.now__empty p {
  margin: 0.2rem 0;
}

@media print {
  .masthead__status,
  .kpis,
  .tabs,
  .kf-nav,
  .kf-foot,
  .now__refresh,
  .leaflet-control-container,
  .kf-skip {
    display: none !important;
  }

  body {
    background: #fff;
    color: #000;
  }

  .now__recent:not([open]) {
    display: none;
  }

  .ncard {
    grid-template-columns: 260px 1fr;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
  }
}
