/* Flight Checker — a night dispatch desk.
   Colour follows the navigation display: magenta is the active course and nothing else,
   green means "airborne right now", amber means "treat with caution". Everything else is night. */

:root {
  /* night surfaces: one hue, stepped lightness */
  --night: #060a12;
  --deck: #0c121d;
  --deck-2: #111927;
  --deck-3: #172133;
  --well: #070b13;                      /* inputs sit below the deck */
  --rule: rgba(164, 190, 240, 0.10);
  --rule-2: rgba(164, 190, 240, 0.17);
  --rule-focus: rgba(255, 92, 220, 0.65);

  /* ink */
  --ink: #e7edf8;
  --ink-2: #aab6cb;
  --ink-3: #74829a;
  --ink-4: #49556b;

  /* signals */
  --course: #ff5cdc;
  --course-wash: rgba(255, 92, 220, 0.13);
  --airborne: #5fe08c;
  --airborne-wash: rgba(95, 224, 140, 0.12);
  --caution: #ffb85c;
  --traffic: #c4e6ff;

  --r-1: 4px;
  --r-2: 6px;
  --r-3: 10px;

  --sans: "B612", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: "B612 Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);

  --rack-w: 396px;
  --detail-w: 352px;
  --edge: 12px;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: radial-gradient(120% 90% at 50% 40%, #0b1424 0%, var(--night) 62%);
  color: var(--ink);
  font: 13px/1.45 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
/* second-language type (i18n.js): never uppercase or letter-spaced, in a face that has the script */
.sl { font-family: var(--sans); letter-spacing: 0; text-transform: none; }
.sl:lang(zh) { font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif; }
.sl:lang(ja) { font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif; }
.sl:lang(ko) { font-family: "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; }
.sl:lang(ru) { font-family: system-ui, sans-serif; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
[hidden] { display: none !important; }

#map { position: absolute; inset: 0; }
.maplibregl-canvas { outline: none; }
.maplibregl-ctrl-attrib { background: rgba(6, 10, 18, 0.6) !important; color: var(--ink-4); font: 10px var(--sans); }
.maplibregl-ctrl-attrib a { color: var(--ink-3) !important; }
.maplibregl-ctrl-bottom-right { right: var(--edge); bottom: var(--edge); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.maplibregl-ctrl-group { background: var(--deck) !important; border: 1px solid var(--rule-2); border-radius: var(--r-2) !important; box-shadow: none !important; overflow: hidden; }
.maplibregl-ctrl-group button { width: 32px; height: 32px; background-color: transparent !important; }
.maplibregl-ctrl-group button + button { border-top: 1px solid var(--rule) !important; }
.maplibregl-ctrl-group button:hover { background-color: var(--deck-3) !important; }
.maplibregl-ctrl-group button .maplibregl-ctrl-icon { filter: invert(0.86) hue-rotate(180deg); }

/* ---------- panels ---------- */

.panel {
  position: absolute;
  background: rgba(12, 18, 29, 0.94);
  backdrop-filter: blur(14px) saturate(120%);
  border: 1px solid var(--rule-2);
  border-radius: var(--r-3);
}

#rack {
  top: var(--edge); left: var(--edge); bottom: var(--edge);
  width: var(--rack-w);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.rack-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; outline: none; scrollbar-width: thin; scrollbar-color: var(--deck-3) transparent; }

#detail {
  top: var(--edge); right: var(--edge);
  width: var(--detail-w);
  max-height: calc(100% - var(--edge) * 2 - 96px);
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--deck-3) transparent;
  animation: slide-in 220ms var(--ease-out);
}
@keyframes slide-in { from { opacity: 0; transform: translateX(10px); } }

/* ---------- the leg: FROM → TO ---------- */

.leg {
  position: relative;
  display: grid; grid-template-columns: 1fr 36px 1fr; align-items: end; gap: 4px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--rule);
}
.leg-field { min-width: 0; }
.leg-field label { display: block; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 4px; }
.leg-field label .sl { font-size: 10px; color: var(--ink-4); margin-left: 4px; }
.leg-input {
  width: 100%; height: 44px; padding: 0 10px;
  background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-2);
  font: 700 24px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink); caret-color: var(--course); outline: none;
  transition: border-color 140ms var(--ease-out), background-color 140ms var(--ease-out);
}
.leg-input::placeholder { font: 400 13px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink-4); }
.leg-input:hover { border-color: var(--rule-2); }
.leg-input:focus { border-color: var(--rule-focus); background: #05080e; }
.leg-input.is-text { font: 400 15px/1 var(--sans); letter-spacing: 0; text-transform: none; }
.leg-sub { margin-top: 5px; height: 16px; font-size: 11px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-swap {
  width: 36px; height: 44px; margin-bottom: 21px; display: grid; place-items: center;
  background: none; border: 0; border-radius: var(--r-2); color: var(--ink-3);
  transition: color 140ms var(--ease-out), transform 140ms var(--ease-out), background-color 140ms var(--ease-out);
}
.leg-swap:hover { color: var(--course); background: var(--course-wash); }
.leg-swap:active { transform: scale(0.94); }
.leg-swap:focus-visible, .switch:focus-visible, .readout-live:focus-visible, .row:focus-visible, .strip:focus-visible, .btn:focus-visible, .chip:focus-visible, .back:focus-visible, .field:focus-visible { outline: 2px solid var(--rule-focus); outline-offset: 1px; }

.combo-list {
  position: absolute; left: 12px; right: 12px; top: calc(100% - 4px); z-index: 20;
  margin: 0; padding: 4px; list-style: none; max-height: 352px; overflow-y: auto;
  background: var(--deck-2); border: 1px solid var(--rule-2); border-radius: var(--r-2);
  transform-origin: top; animation: pop 150ms var(--ease-out);
}
@keyframes pop { from { opacity: 0; transform: scale(0.98) translateY(-3px); } }
.combo-opt { display: grid; grid-template-columns: 46px 1fr auto; gap: 8px; align-items: baseline; padding: 7px 8px; border-radius: var(--r-1); cursor: pointer; }
.combo-opt[aria-selected="true"] { background: var(--deck-3); }
.combo-opt .code { font: 700 13px var(--mono); color: var(--ink); }
.combo-opt .where { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.combo-opt .where b { font-weight: 400; color: var(--ink); }
.combo-opt .where span { color: var(--ink-3); }
.combo-opt .n { font: 11px var(--mono); color: var(--ink-4); }
.combo-empty { padding: 10px 8px; color: var(--ink-3); }

/* ---------- shared bits ---------- */

.cap { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.cap .sl { font-size: 10px; color: var(--ink-4); margin-left: 3px; word-break: keep-all; }   /* wrap whole words: 취항지, not 취항 / 지 */
.sec { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.sec:last-child { border-bottom: 0; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.sec-head .count { font: 11px var(--mono); color: var(--ink-3); }
.note { color: var(--ink-3); font-size: 12px; text-wrap: pretty; }
.note.credits a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 2px; }
.note.credits a:hover { color: var(--ink); }
.note b { color: var(--ink-2); font-weight: 400; }
.note.warn { color: var(--caution); }

.back { display: inline-flex; align-items: center; gap: 6px; height: 28px; margin: -4px 0 8px -6px; padding: 0 8px 0 6px; background: none; border: 0; border-radius: var(--r-1); color: var(--ink-3); font-size: 12px; }
.back:hover { color: var(--ink); background: var(--deck-3); }

.btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; background: var(--deck-2); border: 1px solid var(--rule-2); border-radius: var(--r-2); color: var(--ink-2); font-size: 12px; transition: background-color 140ms var(--ease-out), color 140ms var(--ease-out), transform 120ms var(--ease-out); }
.btn:hover { background: var(--deck-3); color: var(--ink); }
.btn:active { transform: scale(0.97); }
.btn.primary { border-color: rgba(255, 92, 220, 0.4); color: var(--course); background: var(--course-wash); }
.btn.primary:hover { background: rgba(255, 92, 220, 0.2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 6px; }

.chip { height: 24px; padding: 0 9px; background: none; border: 1px solid var(--rule-2); border-radius: 12px; color: var(--ink-3); font-size: 11px; white-space: nowrap; transition: color 120ms, border-color 120ms, background-color 120ms; }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--ink); background: var(--deck-3); border-color: var(--ink-4); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.field { width: 100%; height: 34px; padding: 0 10px; background: var(--well); border: 1px solid var(--rule); border-radius: var(--r-2); outline: none; color: var(--ink); }
.field::placeholder { color: var(--ink-4); }
.field:focus { border-color: var(--rule-focus); }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
.facts.two { grid-template-columns: repeat(2, 1fr); }
.fact .v { display: block; margin-top: 2px; font: 700 15px/1.25 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.fact .v small { font: 400 11px var(--mono); color: var(--ink-3); margin-left: 3px; }
.fact .v.text { font: 400 13px/1.35 var(--sans); }
.fact .u { display: block; font: 11px var(--mono); color: var(--ink-3); }

/* a clickable line in a list (airports, airlines, destinations) */
.rows { margin: 0 -8px; }
.row { display: grid; grid-template-columns: 44px 1fr auto; gap: 8px; align-items: center; width: 100%; min-height: 34px; padding: 5px 8px; background: none; border: 0; border-radius: var(--r-1); text-align: left; }
.row:hover { background: var(--deck-3); }
.row .code { font: 700 12px var(--mono); color: var(--ink); }
.row .main { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.row .main b { font-weight: 400; color: var(--ink); }
.row .main .sl { color: var(--ink-3); font-size: 12px; margin-left: 4px; }
.row .end { font: 11px var(--mono); color: var(--ink-3); text-align: right; white-space: nowrap; }
.row .bar { display: block; height: 2px; margin-top: 3px; background: var(--ink-4); border-radius: 1px; }
.more { width: 100%; margin-top: 4px; height: 30px; background: none; border: 1px dashed var(--rule-2); border-radius: var(--r-1); color: var(--ink-3); font-size: 12px; }
.more:hover { color: var(--ink); border-color: var(--ink-4); }

/* ---------- home ---------- */

.masthead { padding: 16px 16px 14px; border-bottom: 1px solid var(--rule); }
.mast-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin: 0 0 6px; }
.mast-top h1 { margin: 0; white-space: nowrap; }
.lang-pick select {
  height: 26px; max-width: 168px; padding: 0 24px 0 9px; appearance: none; -webkit-appearance: none;
  background: var(--well) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%2374829a' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 9px center;
  border: 1px solid var(--rule-2); border-radius: var(--r-2); color: var(--ink-2); font: 11px var(--sans); cursor: pointer;
  text-overflow: ellipsis; transition: border-color 140ms var(--ease-out), color 140ms var(--ease-out);
}
.lang-pick select:hover { color: var(--ink); border-color: var(--ink-4); }
.lang-pick select:focus-visible { outline: none; border-color: var(--rule-focus); }
.lang-pick option { background: var(--deck-2); color: var(--ink); }
.masthead h1 { margin: 0 0 4px; font: 700 13px var(--sans); letter-spacing: 0.16em; text-transform: uppercase; }
.masthead h1 i { font-style: normal; color: var(--course); }
.masthead h1 .mark { display: inline-block; width: 22px; height: 22px; margin: -4px 9px 0 0; vertical-align: middle; border-radius: 5px; }
.tally { display: grid; grid-template-columns: repeat(4, auto); justify-content: space-between; gap: 8px; margin-top: 12px; }
.tally .v { display: block; font: 700 17px/1.2 var(--sans); font-variant-numeric: tabular-nums; }
.tally .k { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-3); }

/* ---------- route header ---------- */

.pair { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; }
.pair .end { min-width: 0; }
.pair .end.b { text-align: right; }
.pair .iata { font: 700 30px/1 var(--mono); letter-spacing: 0.02em; background: none; border: 0; padding: 0; }
.pair .iata:hover { color: var(--course); }
.pair .city { margin-top: 5px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 130px; }
.pair .local { font: 11px var(--mono); color: var(--ink-3); }
.pair .track { position: relative; height: 30px; }
.pair .track::before { content: ""; position: absolute; left: 0; right: 0; top: 14px; height: 2px; background: var(--course); border-radius: 1px; box-shadow: 0 0 10px rgba(255, 92, 220, 0.55); }
.pair .track::after { content: ""; position: absolute; right: -1px; top: 10px; width: 8px; height: 10px; background: var(--course); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.pair .track span { position: absolute; left: 50%; top: -3px; transform: translateX(-50%); font: 11px var(--mono); color: var(--ink-3); white-space: nowrap; }

.carriers { display: flex; flex-wrap: wrap; gap: 6px; }
.carrier { display: inline-flex; align-items: baseline; gap: 6px; height: 26px; padding: 0 9px; background: var(--deck-2); border: 1px solid var(--rule); border-radius: var(--r-1); font-size: 12px; color: var(--ink-2); }
.carrier:hover { border-color: var(--ink-4); color: var(--ink); }
.carrier b { font: 700 12px var(--mono); color: var(--ink); }

/* ---------- flight strips ---------- */

.bay { margin: 0 -16px -14px; }
.bay-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 7px 16px 6px; background: var(--deck-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 12px; color: var(--ink-2); }
.bay-head b { font: 700 12px var(--mono); color: var(--ink); margin-right: 6px; }
.bay-head .count { font: 11px var(--mono); color: var(--ink-3); }

.strip {
  position: relative; display: grid; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--rule);
  padding: 9px 16px 9px 19px;
  transition: background-color 120ms var(--ease-out);
}
.strip::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ink-4); opacity: 0.5; }
.strip:hover { background: var(--deck-2); }
.strip.is-on { background: var(--deck-3); }
.strip.is-on::before { background: var(--course); opacity: 1; }

/* airborne: the full strip */
.strip.live { grid-template-columns: 92px 1fr auto; column-gap: 10px; row-gap: 8px; align-items: start; }
.strip.live::before { background: var(--airborne); opacity: 1; }
.strip .id b { display: block; font: 700 16px/1.15 var(--mono); }
.strip .id span { font: 11px var(--mono); color: var(--ink-3); }
.strip .ac { min-width: 0; }
.tail { display: inline-block; padding: 1px 6px 0; border: 1px solid var(--rule-2); border-radius: 3px; font: 700 12px/1.5 var(--mono); letter-spacing: 0.03em; color: var(--ink); background: var(--well); }
.tail.none { color: var(--ink-4); font-weight: 400; }
.strip .ac .type { display: block; margin-top: 4px; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .ac .type b { font: 700 12px var(--mono); color: var(--ink); margin-right: 5px; }
.strip .lvl { text-align: right; }
.strip .lvl b { display: block; font: 700 13px/1.3 var(--mono); }
.strip .lvl span { font: 11px var(--mono); color: var(--ink-3); }
.prog { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; font: 11px var(--mono); color: var(--ink-3); }
.prog .line { position: relative; height: 2px; background: var(--rule-2); border-radius: 1px; }
.prog .line i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--airborne); border-radius: 1px; }
.prog .line em { position: absolute; top: -4px; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--airborne); box-shadow: 0 0 0 3px var(--airborne-wash); }
.prog .eta { color: var(--ink-2); }

/* on the timetable but not seen airborne: one line */
.strip.idle { grid-template-columns: 70px 76px 1fr auto; column-gap: 8px; align-items: center; min-height: 34px; padding-top: 6px; padding-bottom: 6px; }
.strip.idle .no { font: 700 13px var(--mono); }
.strip.idle .cs { font: 11px var(--mono); color: var(--ink-3); }
.strip.idle .last { min-width: 0; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip.idle .last .mono { color: var(--ink-2); }
.strip.idle .go { font-size: 11px; color: var(--ink-4); }
.strip.idle:hover .go { color: var(--course); }
.strip.idle.busy .go { color: var(--caution); }

.dir { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--rule-2); border-radius: var(--r-2); overflow: hidden; }
.dir button { height: 30px; background: none; border: 0; font: 12px var(--mono); color: var(--ink-3); }
.dir button + button { border-left: 1px solid var(--rule-2); }
.dir button[aria-pressed="true"] { background: var(--deck-3); color: var(--ink); }
.dir button:hover { color: var(--ink); }
.dir .up { margin-left: 4px; color: var(--airborne); }

.conn { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; width: 100%; padding: 7px 8px; background: none; border: 0; border-radius: var(--r-1); text-align: left; }
.conn:hover { background: var(--deck-3); }
.conn .via { font: 12px var(--mono); color: var(--ink-2); }
.conn .via b { color: var(--ink); font-weight: 700; }
.conn .km { font: 11px var(--mono); color: var(--ink-3); text-align: right; }
.conn .who { grid-column: 1 / -1; font-size: 11px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

details.fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; font: 13px var(--mono); color: var(--ink-3); }
details.fold[open] > summary::after { content: "–"; }
details.fold[open] > summary { margin-bottom: 8px; }

/* ---------- aircraft data block ---------- */

.block-head { padding: 14px 16px 12px; border-bottom: 1px solid var(--rule); position: relative; }
.block-head .close { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; display: grid; place-items: center; background: none; border: 0; border-radius: var(--r-1); color: var(--ink-3); }
.block-head .close:hover { color: var(--ink); background: var(--deck-3); }
.block-head .callsign { font: 700 26px/1.1 var(--mono); letter-spacing: 0.02em; }
.block-head .callsign small { font: 400 12px var(--mono); color: var(--ink-3); margin-left: 8px; }
.block-head .who { margin-top: 4px; color: var(--ink-2); }
.state { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--ink-3); }
.state i { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.state.air { color: var(--airborne); } .state.air i { background: var(--airborne); box-shadow: 0 0 0 3px var(--airborne-wash); }
.state.gnd { color: var(--caution); } .state.gnd i { background: var(--caution); }

.photo { position: relative; margin: 0; border-bottom: 1px solid var(--rule); background: var(--well); }
.photo img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; outline: 1px solid rgba(255, 255, 255, 0.1); outline-offset: -1px; }
.photo figcaption { position: absolute; right: 6px; bottom: 6px; padding: 2px 6px; background: rgba(6, 10, 18, 0.72); border-radius: 3px; font-size: 10px; color: var(--ink-2); }
.photo a { color: inherit; text-decoration: none; }
.photo a:hover { text-decoration: underline; }

.plate { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.plate .tail { font-size: 20px; padding: 3px 10px 1px; border-radius: 4px; }
.plate .type { text-align: right; min-width: 0; }
.plate .type b { display: block; font: 700 15px var(--mono); }
.plate .type span { display: block; font-size: 12px; color: var(--ink-2); }

.links { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.links a { color: var(--ink-3); font-size: 12px; text-decoration: none; border-bottom: 1px solid var(--rule-2); }
.links a:hover { color: var(--ink); border-color: var(--ink-3); }

.seen { margin: 0; padding: 0; list-style: none; }
.seen li { display: grid; grid-template-columns: 78px 54px 1fr; gap: 8px; padding: 3px 0; font: 12px var(--mono); color: var(--ink-2); }
.seen li span:last-child { color: var(--ink-3); text-align: right; }

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

.readout {
  left: calc(var(--rack-w) + var(--edge) * 2); bottom: var(--edge);
  display: flex; align-items: center; gap: 4px; height: 38px; padding: 0 6px;
  max-width: calc(100% - var(--rack-w) - var(--edge) * 3 - 60px);
}
.readout-live { display: inline-flex; align-items: center; gap: 7px; height: 26px; padding: 0 9px; background: none; border: 0; border-radius: var(--r-1); font: 700 11px var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.readout-live:hover { background: var(--deck-3); }
.readout-live .lamp { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-4); }
.readout-live[aria-pressed="true"] { color: var(--airborne); }
.readout-live[aria-pressed="true"] .lamp { background: var(--airborne); animation: lamp 2.4s ease-in-out infinite; }
.readout-live.is-stale { color: var(--caution); }
.readout-live.is-stale .lamp { background: var(--caution); animation: none; }
@keyframes lamp { 50% { opacity: 0.35; } }
.readout-text { padding: 0 6px; font: 11px var(--mono); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-sep { width: 1px; height: 18px; background: var(--rule-2); margin: 0 4px; }
.switch { height: 26px; padding: 0 9px; background: none; border: 0; border-radius: var(--r-1); font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.switch:hover { background: var(--deck-3); color: var(--ink-2); }
.switch[aria-pressed="true"] { color: var(--ink); }
.switch[aria-pressed="true"]::before { content: ""; display: inline-block; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: var(--ink-2); vertical-align: 2px; }

/* ---------- tooltip / toast ---------- */

.tip { position: absolute; z-index: 30; pointer-events: none; max-width: 300px; padding: 7px 9px; background: var(--deck-2); border: 1px solid var(--rule-2); border-radius: var(--r-2); font-size: 12px; color: var(--ink-2); transform: translate(12px, 12px); }
.tip b { font: 700 13px var(--mono); color: var(--ink); margin-right: 6px; }
.tip .l2 { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11px; }
.tip .l2 .mono { color: var(--ink-2); }
.toast { position: absolute; left: 50%; top: 16px; z-index: 40; transform: translateX(-50%); padding: 8px 12px; background: var(--deck-2); border: 1px solid var(--rule-2); border-radius: var(--r-2); font-size: 12px; color: var(--ink); animation: pop 160ms var(--ease-out); }

.skeleton { height: 12px; margin: 8px 0; border-radius: 3px; background: linear-gradient(90deg, var(--deck-2), var(--deck-3), var(--deck-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- phones: the rack becomes a bottom sheet, the readout a line across the top ---------- */

.sheet-handle { display: none; }

@media (max-width: 860px) {
  :root {
    --edge: 8px; --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
    --sheet-h: calc(100dvh - var(--edge) * 2 - var(--safe-t) - var(--safe-b));
  }
  html { overflow: hidden; overscroll-behavior: none; }
  /* The sheet keeps its full height and slides: --hide is how much of it sits below the screen.
     Only the transform animates, so the list is not laid out again on every frame. */
  #rack {
    top: auto; left: var(--edge); right: var(--edge); bottom: calc(var(--edge) + var(--safe-b)); width: auto;
    height: var(--sheet-h);
    --hide: calc(var(--sheet-h) - 52dvh);
    transform: translateY(var(--hide));
    transition: transform 260ms var(--ease-out);
  }
  #rack.is-min { --hide: calc(var(--sheet-h) - 136px); }
  #rack.is-full { --hide: 0px; }
  .rack-body { padding-bottom: var(--hide); }   /* lets the list scroll clear of the part below the screen */
  .sheet-handle { display: grid; place-items: center; flex: none; width: 100%; height: 26px; padding: 0; background: none; border: 0; touch-action: none; }
  .sheet-handle span { width: 38px; height: 4px; border-radius: 2px; background: var(--ink-4); }
  .sheet-handle:active span { background: var(--ink-2); }
  .leg { padding-top: 2px; }

  #detail { top: calc(var(--edge) + var(--safe-t) + 46px); left: var(--edge); right: var(--edge); width: auto; max-height: 46dvh; }

  .readout { left: var(--edge); right: 52px; top: calc(var(--edge) + var(--safe-t)); bottom: auto; max-width: none; }
  .readout .switch, .readout-sep { display: none; }
  .readout-text { flex: 1; min-width: 0; }

  /* pinch and drag do the zooming here; keep only the map credit, in the top corner */
  .maplibregl-ctrl-bottom-right { top: calc(var(--edge) + var(--safe-t)); bottom: auto; right: var(--edge); }
  .maplibregl-ctrl-group { display: none; }
  .tip { display: none; }
  .toast { top: calc(var(--edge) + var(--safe-t) + 46px); width: max-content; max-width: calc(100vw - 24px); }

  /* iOS zooms the page when a focused field's text is under 16px */
  input { font-size: 16px !important; }
  .lang-pick select { height: 32px; font-size: 16px; max-width: 200px; }   /* iOS zooms into anything smaller */
  .leg-input { font-size: 22px !important; }
  .leg-input.is-text { font-size: 16px !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- page summary (written by the public site for each route, airport and airline; hosted/pages.js) ---------- */
.seo { padding: 14px 16px 18px; font-size: 13px; line-height: 1.55; color: var(--ink-2); }
.seo-fold .seo { padding: 4px 0 0; }
.seo h1 { margin: 2px 0 8px; font-size: 19px; line-height: 1.3; font-weight: 700; color: var(--ink); text-wrap: balance; }
.seo h2 { margin: 18px 0 6px; font-size: 10px; font-weight: 400; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.seo h3 { margin: 12px 0 4px; font-size: 12px; font-weight: 400; color: var(--ink-2); }
.seo p { margin: 0 0 8px; text-wrap: pretty; }
.seo .lead { color: var(--ink); }
.seo a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--ink-4); text-underline-offset: 2px; }
.seo a:hover { text-decoration-color: var(--course); }
.seo .dim, .seo small { color: var(--ink-3); font-size: 11px; }
.seo ul { margin: 0; padding: 0; list-style: none; }
.seo ul.links li { padding: 3px 0; border-bottom: 1px solid var(--rule); }
.seo ul.links li:last-child { border-bottom: 0; }
.seo ul.cols { columns: 2; column-gap: 16px; }
.seo ul.cols li { break-inside: avoid; border-bottom: 0; }
.seo ul.flights li { padding: 6px 0; border-bottom: 1px solid var(--rule); }
.seo ul.flights b { display: block; font-weight: 400; color: var(--ink); margin-bottom: 2px; }
.seo .fno { display: inline-block; margin: 0 10px 2px 0; font-family: var(--mono); font-size: 12px; color: var(--ink-2); }
.seo .via { font-family: var(--sans); font-size: 11px; color: var(--ink-3); }
.seo .facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; margin: 10px 0 12px; }
.seo .facts dt { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
.seo .facts dd { margin: 0; font-family: var(--mono); color: var(--ink); }
.crumbs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; font-size: 11px; color: var(--ink-3); }
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs i { font-style: normal; color: var(--ink-4); }
details.seo-fold > summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); }
details.seo-fold > summary::-webkit-details-marker { display: none; }
details.seo-fold > summary::after { content: "+"; font: 13px var(--mono); color: var(--ink-3); }
details.seo-fold[open] > summary::after { content: "–"; }
