/* SkyTracker "glass cockpit": the map fills the window and everything else floats over it on
   frosted panels. html[data-ui] (set by app.js from the map style) picks light or dark glass. */

:root {
  --ui-font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --code-font: "Chivo Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --display-font: "Big Shoulders Display", "Arial Narrow", sans-serif;

  --accent: #ffb547; /* amber: selection, primary buttons, route lines */
  --accent-ink: #1a1205;
  --good: #22a565;
  --wish: #f5b301;
  --home: #ff4d6d;
  --gutter: 16px;
  --radius: 14px;

  /* Light glass */
  --glass: rgb(255 255 255 / 82%);
  --glass-solid: #ffffff;
  --glass-line: rgb(15 30 50 / 10%);
  --ink: #142030;
  --ink-2: #4f5d70;
  --ink-3: #7a8799;
  --tile: rgb(15 30 50 / 5%);
  --tile-hover: rgb(15 30 50 / 9%);
  --chip-on: #142030;
  --chip-on-ink: #ffffff;
  --shadow: 0 10px 30px rgb(10 25 45 / 18%);
  --ocean: #9ebdff;
  color-scheme: light;
}

:root[data-ui="dark"] {
  /* Slate, a step lighter than near-black, matching the recoloured dark map */
  --glass: rgb(46 62 82 / 84%);
  --glass-solid: #2e3e52;
  --glass-line: rgb(255 255 255 / 12%);
  --ink: #eef3f9;
  --ink-2: #c0ccda;
  --ink-3: #95a6ba;
  --tile: rgb(255 255 255 / 8%);
  --tile-hover: rgb(255 255 255 / 14%);
  --chip-on: #eef3f9;
  --chip-on-ink: #22324a;
  --shadow: 0 10px 30px rgb(10 20 35 / 30%);
  --ocean: #22324a;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  font-family: var(--ui-font);
  color: var(--ink);
  background: var(--ocean);
}

#map {
  position: fixed;
  inset: 0;
  /* Ocean colour, so any edge not yet drawn while dragging blends in instead of showing grey. */
  background: var(--ocean);
}

button { font: inherit; color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

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

.glass {
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  color: var(--ink);
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .glass { background: var(--glass-solid); }
}

.hud {
  position: fixed;
  z-index: 1001;
  display: flex;
  pointer-events: none;
}

.hud > * { pointer-events: auto; }

.hud-left {
  top: var(--gutter);
  left: var(--gutter);
  bottom: var(--gutter);
  width: min(23rem, calc(100% - 2 * var(--gutter)));
  flex-direction: column;
  gap: 10px;
}

.hud-right {
  top: var(--gutter);
  right: var(--gutter);
  gap: 8px;
  align-items: flex-start;
}

/* ---- Brand + search ---------------------------------------------------------- */

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 10px;
  position: relative;
  z-index: 2;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  flex: none;
}

.brand img { border-radius: 7px; display: block; }

.brand h1 {
  margin: 0;
  font: 800 1.3rem/1 var(--display-font);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.search {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.search > input {
  width: 100%;
  min-width: 0;
  height: 38px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--glass-line);
  border-radius: 10px;
  background: var(--tile);
  color: var(--ink);
  font: inherit;
  font-size: 0.92rem;
}

.search input::placeholder { color: var(--ink-3); }
.search input:focus { outline: none; border-color: var(--accent); }

.search kbd {
  margin-left: -30px;
  font: 0.72rem/1 var(--code-font);
  border: 1px solid var(--glass-line);
  border-radius: 5px;
  padding: 3px 6px;
  color: var(--ink-3);
  pointer-events: none;
}

.search input:focus + kbd { display: none; }

.search ul {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  margin: 0;
  padding: 6px;
  list-style: none;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--glass-solid);
}

.search li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 0.9rem;
}

.search li span { flex: 1; min-width: 0; }
.search li small { display: block; color: var(--ink-3); font-size: 0.78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search li .code { flex: none; width: 3.2rem; font: 600 0.95rem/1 var(--code-font); color: var(--accent); }
.search li .size { font-style: normal; font-size: 0.72rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }

.search li:hover,
.search li[aria-selected="true"] { background: var(--tile-hover); }

:root[data-ui="light"] .search li .code { color: #b06a00; }

/* ---- Filter chips ---------------------------------------------------------------- */

.chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chip {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--ink-2);
  font-size: 0.8rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.chip[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); border-color: var(--chip-on); font-weight: 500; }

.count {
  font: 0.75rem/1 var(--code-font);
  color: var(--ink);
  background: var(--glass);
  padding: 5px 8px;
  border-radius: 6px;
}

.count:empty { display: none; }

/* ---- Pills (top right) ------------------------------------------------------------------ */

.pill {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 6px 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
}

.pill:hover { background: var(--glass-solid); }

.mine-toggle { padding-left: 8px; text-align: left; }
.mine-toggle b { font-weight: 500; display: block; }
.mine-toggle small { display: block; font-size: 0.74rem; color: var(--ink-3); font-weight: 400; }
.mine-toggle small:empty { display: none; }
.mine-toggle[aria-pressed="true"] { border-color: var(--accent); }

.avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4f86ff, #8bd3ff);
  color: #0e1621;
  font-weight: 700;
  font-size: 0.85rem;
  flex: none;
}

/* ---- Split-flap tiles --------------------------------------------------------------------- */

.flap { display: inline-flex; gap: 2px; vertical-align: middle; }

.flap > span {
  position: relative;
  display: grid;
  place-items: center;
  width: 0.78em;
  height: 1.12em;
  background: #1c1c1c;
  color: #f5c518;
  border-radius: 0.09em;
  font-family: var(--code-font);
  font-weight: 600;
  line-height: 1;
  box-shadow: inset 0 -1px 0 #000;
}

.flap > span::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgb(0 0 0 / 80%);
}

.flap.small { font-size: 0.82rem; }

/* ---- Airport details card ------------------------------------------------------------------- */

.details {
  padding: 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  max-height: 100%;
  display: grid;
  gap: 14px;
  align-content: start;
}

.details[hidden] { display: none; }

/* Wikipedia photo at the top of the card (photo.js) */
.details-photo { position: relative; margin: 0; border-radius: 10px; overflow: hidden; }
/* Rows keep their full height (a long card used to squeeze the photo, whose overflow: hidden let it
   shrink), and the one column stays the card's width even when a form inside is wider. */
.details { grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; }
.card-media { position: relative; display: block; }
.runway-chip {
  position: absolute;
  left: 8px;
  bottom: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 0;
  border-radius: 999px;
  background: rgb(10 18 30 / 72%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 35%);
}
.runway-chip::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; box-sizing: border-box; }
.runway-chip:hover { background: rgb(10 18 30 / 90%); }
.runway-thumb { width: 100%; height: 150px; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: #1a2230; cursor: pointer; }
.runway-thumb-tiles { position: absolute; top: 0; left: 50%; width: 480px; height: 150px; transform: translateX(-50%); }
.runway-thumb-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; }
.details-photo img { display: block; width: 100%; height: 150px; object-fit: cover; }
.details-photo figcaption { position: absolute; right: 6px; bottom: 6px; font-size: 0.7rem; background: var(--glass-solid); color: var(--ink-2); border-radius: 5px; padding: 1px 6px; }
.details-photo a { color: inherit; }

.details-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.details-code { display: flex; align-items: baseline; gap: 10px; font-size: 2.2rem; }
.details-code small { font: 0.85rem/1 var(--code-font); color: var(--ink-3); }
.details h2 { margin: 10px 0 0; font-size: 1.02rem; font-weight: 500; line-height: 1.3; }
.details-place { margin: 2px 0 0; font-size: 0.85rem; color: var(--ink-2); }

.close {
  border: 0;
  background: var(--tile);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-2);
  flex: none;
}

.close:hover { background: var(--tile-hover); }

/* The card's close button sits in the top-right corner, over the photo when there is one: it
   shares the first grid cell with whatever comes first. Dark disc with a white ring and white ×
   reads on any photo. */
.details-close,
.details-close + * { grid-row: 1; grid-column: 1; }
.details-close {
  z-index: 2;
  align-self: start;
  justify-self: end;
  margin: 8px 8px 0 0;
  width: 34px;
  height: 34px;
  font-size: 1.35rem;
  background: rgb(10 18 30 / 72%);
  color: #fff;
  box-shadow: 0 0 0 2px rgb(255 255 255 / 90%), 0 2px 8px rgb(0 0 0 / 35%);
}
.details-close:hover { background: rgb(10 18 30 / 90%); }
.details-head { padding-right: 44px; }
/* "International" in the regular font so the whole word fits its tile. */
.details-stats b.word { font-family: inherit; font-size: 0.85rem; line-height: 1.4; }

.details-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.details-stats div { background: var(--tile); border-radius: 9px; padding: 9px 10px; min-width: 0; }
.details-stats b { display: block; font: 600 0.95rem/1.25 var(--code-font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.details-stats span { font-size: 0.68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; }

.details-links { margin: 0; font-size: 0.82rem; color: var(--ink-3); }
.details-links a { color: var(--ink-2); }

/* Round action buttons under the airport's name: Been here, Want to go, Home, Routes */
.card-actions { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
.card-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: 0.72rem;
  line-height: 1.2;
  cursor: pointer;
}
.card-action i {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--tile);
  color: var(--ink);
  font-size: 1.1rem;
  font-style: normal;
  transition: background 0.15s;
}
.card-action:hover i { background: var(--tile-hover); }
.card-action[data-mine="visited"] i { background: var(--accent); color: var(--accent-ink); }
.card-action[data-mine="visited"][aria-pressed="true"] i { background: var(--good); color: #fff; }
.card-action[data-mine="wishlist"][aria-pressed="true"] i { background: var(--wish); color: #201600; }
.card-action[data-mine="home"][aria-pressed="true"] i { background: var(--home); color: #fff; }
.card-action[data-routes][aria-pressed="true"] i { background: #ffb547; color: #201600; }
.card-action[aria-pressed="true"] { color: var(--ink); font-weight: 500; }

/* Nonstop routes: a departure board */
.routes-open {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--glass-line);
  border-radius: 9px;
  background: transparent;
  font-size: 0.85rem;
  cursor: pointer;
}

.routes-open:hover { background: var(--tile); }

.routes { display: grid; gap: 8px; }
.routes:empty { display: none; }

.board-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  background: #0b0b0b;
  color: #bdbdbd;
  border-radius: 9px 9px 0 0;
  font: 0.72rem/1.3 var(--code-font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.board-head b { color: #f5c518; font-weight: 600; }

.board-list {
  margin: -8px 0 0;
  padding: 0 8px 8px;
  list-style: none;
  background: #0b0b0b;
  border-radius: 0 0 9px 9px;
  max-height: 22rem;
  overflow-y: auto;
}

.board-country {
  padding: 10px 4px 4px;
  font: 0.68rem/1 var(--code-font);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7a7a7a;
}

.board-country span { color: #f5c518; }

.routes-dest {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 4px;
  border: 0;
  border-top: 1px solid #1d1d1d;
  background: none;
  color: #d9d9d9;
  font-size: 0.82rem;
  text-align: left;
  cursor: pointer;
}

.routes-dest:hover { background: #161616; }
.routes-dest .dest { flex: 1; min-width: 0; }
.routes-dest small { display: block; color: #7a7a7a; font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.routes-dest .km { font: 0.72rem/1 var(--code-font); color: #a8a8a8; white-space: nowrap; }

.board-empty, .board-note { margin: 0; font-size: 0.76rem; color: var(--ink-3); }

/* ---- Leaflet controls --------------------------------------------------------------- */

.leaflet-bottom.leaflet-right { margin-right: calc(var(--gutter) - 10px); }
.leaflet-control-attribution { border-radius: 6px 0 0 0; }

.layers { display: flex; padding: 4px; gap: 4px; }

.layers button {
  padding: 7px 12px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--ink-2);
  font-size: 0.8rem;
  cursor: pointer;
}

.layers button[aria-pressed="true"] { background: var(--tile-hover); color: var(--ink); font-weight: 500; }

/* The bottom-right stack (Weather, map style): one height, one text size, even gaps. */
.leaflet-bottom.leaflet-right .leaflet-control { margin-bottom: 8px; }
.wx-dock > .wx-button, .layers { min-height: 40px; box-sizing: border-box; }
.wx-dock > .wx-button { padding: 6px 14px; font-size: 0.85rem; }
.layers { height: 40px; align-items: center; }
.layers button { padding: 6px 12px; font-size: 0.85rem; }

:root[data-ui="dark"] .leaflet-control-attribution { background: rgb(46 62 82 / 80%); color: #c0ccda; }
:root[data-ui="dark"] .leaflet-control-attribution a { color: #c9d6e6; }

/* ---- My airports: the logbook panel ----------------------------------------------------------- */

.mine-panel {
  position: fixed;
  z-index: 1002;
  top: calc(var(--gutter) + 56px);
  right: var(--gutter);
  bottom: var(--gutter);
  width: min(24rem, calc(100% - 2 * var(--gutter)));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
  font-size: 0.9rem;
  line-height: 1.4;
  background: var(--glass-solid);
}

.mine-panel[hidden] { display: none; }

.mine-panel header { display: flex; align-items: center; justify-content: space-between; }

.mine-panel h2 {
  margin: 0;
  font: 800 1.7rem/1 var(--display-font);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.mine-panel h3 {
  display: flex;
  justify-content: space-between;
  margin: 1.2rem 0 0.5rem;
  font: 600 0.68rem/1 var(--code-font);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.mine-panel h3 span { color: var(--ink-2); }

.mine-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 1rem 0 0.4rem;
}

.mine-stats strong { display: block; font: 600 1.7rem/1.1 var(--code-font); letter-spacing: -0.03em; }
.mine-stats span { font-size: 0.78rem; color: var(--ink-3); }

.earth { margin: 0.4rem 0 0; font-size: 0.8rem; color: var(--ink-3); }
.earth > i, .mine-badges .bar { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: var(--tile-hover); overflow: hidden; }
.earth > i > i, .mine-badges .bar > i { display: block; height: 100%; background: #2f6bff; }

/* Logbook / Statistics tabs and the statistics view */
.mine-tabs { display: flex; gap: 4px; margin-top: 0.8rem; padding: 3px; border-radius: 999px; background: var(--tile); }
.mine-tabs button { flex: 1; border: 0; background: none; padding: 6px 10px; border-radius: 999px; font-weight: 600; font-size: 0.85rem; color: var(--ink-2); cursor: pointer; }
.mine-tabs button[aria-selected="true"] { background: var(--chip-on); color: var(--chip-on-ink); }
.unit-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.unit-chips button { border: 1px solid var(--glass-line); background: var(--tile); color: var(--ink-2); border-radius: 999px; padding: 4px 10px; font-size: 0.78rem; cursor: pointer; }
.unit-chips button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.stat-hero { margin: 0.7rem 0 0.2rem; }
.stat-hero strong { display: block; font: 800 2.6rem/1 var(--display-font); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.stat-hero span { font-size: 0.8rem; color: var(--ink-3); }
.stat-note { margin: 0.4rem 0 0; font-size: 0.78rem; color: var(--ink-3); line-height: 1.45; }
.stat-sub { margin: 0.6rem 0 0.35rem; font-size: 0.75rem; color: var(--ink-2); font-weight: 600; }
.stat-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.stat-bars li { display: grid; grid-template-columns: minmax(0, 9rem) minmax(0, 1fr) 2rem; gap: 8px; align-items: center; font-size: 0.82rem; }
.stat-bars span, .stat-bars li > button { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-panel .stat-bars li > button { display: block; width: auto; min-width: 0; margin: 0; border: 0; border-radius: 0; background: none; padding: 0; text-align: left; color: var(--ink); cursor: pointer; font: inherit; }
.mine-panel .stat-bars li > button:hover { text-decoration: underline; }
.stat-bars li > i { display: block; height: 8px; border-radius: 4px; background: var(--tile-hover); overflow: hidden; }
.stat-bars li > i > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.stat-bars li.blank > i > i { background: var(--ink-3); opacity: 0.5; }
.stat-bars li.blank span { color: var(--ink-3); }
.stat-bars b { text-align: right; font: 600 0.8rem var(--code-font); font-variant-numeric: tabular-nums; }
.stat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.stat-chips span { background: var(--tile); border-radius: 999px; padding: 3px 9px; font-size: 0.8rem; }
.stat-chips b { font-family: var(--code-font); color: var(--ink-3); font-weight: 600; }

.mine-home { margin: 0.7rem 0 0; font-size: 0.85rem; color: var(--ink-2); }
.mine-home button { padding: 0; border: 0; background: none; color: var(--ink); font-weight: 600; cursor: pointer; text-decoration: underline; text-decoration-color: var(--home); text-underline-offset: 3px; }

.stamps { display: flex; flex-wrap: wrap; gap: 10px; }

.stamp {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid var(--stamp);
  background: none;
  color: var(--stamp);
  display: grid;
  place-content: center;
  text-align: center;
  position: relative;
  transform: rotate(var(--tilt));
  font-family: var(--code-font);
  cursor: pointer;
}

.stamp::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; border: 1px dashed var(--stamp); opacity: 0.7; }
.stamp b { font-size: 1rem; line-height: 1; }
.stamp small { font-size: 0.52rem; letter-spacing: 0.05em; margin-top: 3px; }
.stamp:hover { transform: rotate(0deg) scale(1.05); }

:root[data-ui="dark"] .stamp { filter: brightness(1.35); }

.pass {
  display: grid;
  grid-template-columns: 1fr auto;
  border-radius: 12px;
  background: #1d2433;
  color: #fff;
  overflow: hidden;
}

:root[data-ui="dark"] .pass { background: #22324a; }

.pass-main { padding: 12px 14px; display: grid; gap: 4px; min-width: 0; }
.pass-main small { font: 0.66rem/1.2 var(--code-font); letter-spacing: 0.08em; color: #9aa3b8; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass-route { display: flex; align-items: center; gap: 10px; font: 600 1.4rem/1 var(--code-font); }
.pass-route span { opacity: 0.6; font-size: 1rem; }
.pass-stub { width: 76px; border-left: 2px dashed #3a4357; display: grid; place-content: center; text-align: center; font: 0.66rem/1.4 var(--code-font); color: #9aa3b8; text-transform: uppercase; }
.pass-stub b { color: var(--accent); font-size: 0.95rem; }

.mine-panel ul { margin: 0; padding: 0; list-style: none; }

.mine-panel li button {
  display: block;
  width: 100%;
  padding: 0.45rem 0;
  border: 0;
  border-bottom: 1px solid var(--glass-line);
  background: none;
  font-size: 0.88rem;
  text-align: left;
  cursor: pointer;
}

.mine-panel li button:hover { background: var(--tile); }
.mine-panel li small { display: block; color: var(--ink-3); }

.mine-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.6rem 0; }

.mine-buttons button {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--tile);
  font-size: 0.8rem;
  cursor: pointer;
}

.mine-buttons button:hover { background: var(--tile-hover); }
.mine-buttons button[type="submit"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 500; }

.mine-card img { width: 100%; border-radius: 8px; margin-top: 0.5rem; }
.mine-empty, .mine-note { font-size: 0.82rem; color: var(--ink-3); }
.mine-note { margin-top: 1.2rem; }
.mine-note a { color: var(--ink-2); }

.mine-account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  margin: 0.7rem 0 0;
  font-size: 0.82rem;
  color: var(--ink-2);
}

.mine-google {
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--glass-line);
  border-radius: 999px;
  background: var(--tile);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}

.mine-google:hover { background: var(--tile-hover); }

.mine-account button,
.mine-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-2);
  font-size: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.mine-notice {
  margin: 0.6rem 0 0;
  padding: 0.5rem 0.7rem;
  background: rgb(255 181 71 / 18%);
  border-radius: 8px;
  font-size: 0.82rem;
}

.mine-flight-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem 0.6rem;
  margin: 0.4rem 0;
}

.mine-flight-form label { display: flex; flex-direction: column; font-size: 0.76rem; color: var(--ink-3); }

.mine-flight-form input,
.mine-flight-form select {
  margin-top: 0.2rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--tile);
  color: var(--ink);
  font: inherit;
  font-size: 0.88rem;
  min-width: 0;
}

.details .mine-flight-form { margin-top: 0.7rem; }
.mine-flight-form .mine-step { grid-column: 1 / -1; margin: 0; font-size: 0.85rem; font-weight: 500; }
.mine-flight-form .mine-step small { color: var(--ink-3); font-weight: 400; }
.mine-flight-link { margin: 0.6rem 0 0; font-size: 0.82rem; }

/* Option lists open as a solid menu; the translucent field colour made them unreadable. */
.mine-flight-form option { background: var(--glass-solid); color: var(--ink); }

.mine-flight-form .mine-hint,
.mine-flight-form .mine-error,
.mine-flight-form .mine-buttons { grid-column: 1 / -1; margin: 0; font-size: 0.78rem; }

.mine-flight-form .mine-error { color: #e5484d; }
.mine-flight-form .mine-error:empty,
.mine-flight-form .mine-hint:empty { display: none; }

.mine-panel li.mine-flight {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--glass-line);
  font-size: 0.88rem;
}

.mine-panel li.mine-flight b { font-family: var(--code-font); font-weight: 600; }
.mine-panel li.mine-flight small { display: block; color: var(--ink-3); }

.mine-panel li.mine-flight button {
  width: auto;
  padding: 0 0.3rem;
  border: 0;
  color: var(--ink-3);
  font-size: 1.2rem;
}

.mine-panel ul.mine-badges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mine-badges li {
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--glass-line);
  font-size: 0.8rem;
  opacity: 0.6;
}

.mine-badges li b { display: block; font-weight: 600; }
.mine-badges li small { display: block; color: var(--ink-3); line-height: 1.3; margin-top: 2px; }
.mine-badges li.earned { opacity: 1; background: rgb(34 165 101 / 12%); border-color: rgb(34 165 101 / 35%); }
.mine-badges li.earned b::before { content: "✓ "; color: var(--good); }

/* Live flights (flights.js, currently not loaded) */

/* ---- Phones ------------------------------------------------------------------- */

@media (max-width: 640px) {
  :root { --gutter: 10px; }

  .hud-left { bottom: auto; }
  .brand h1 { display: none; }
  body:has(.details:not([hidden])) .hud-right { display: none; }

  .hud-right { top: auto; bottom: calc(var(--gutter) + 22px); left: var(--gutter); right: auto; }
  .hud-right .pill { min-height: 40px; }

  /* The airport card becomes a sheet along the bottom of the screen. */
  .details {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 58vh;
    border-radius: 18px 18px 0 0;
    padding: 18px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    background: var(--glass-solid);
    z-index: 1003;
  }

  .mine-panel {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 85vh;
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    z-index: 1004;
  }

  .leaflet-bottom.leaflet-right { margin-bottom: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .stamp:hover { transform: rotate(var(--tilt)); }
}


/* Live airport weather (weather.js): the card's "Weather now" section and the map toggle */
.wx { display: grid; gap: 8px; }
.wx h3 { margin: 0; font-size: 0.68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.wx-note { margin: 0; font-size: 0.82rem; color: var(--ink-3); }
.wx-now { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.wx-now b { font-size: 1rem; }
.wx-temp { font: 600 1rem var(--code-font); color: var(--ink-2); }
.wx-cat {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--cat);
  color: #fff;
  font: 600 0.7rem var(--code-font);
  font-style: normal;
}
.wx-stats b { font-size: 0.85rem; white-space: normal; }
.wx-raw { font-size: 0.75rem; color: var(--ink-3); }
.wx-raw summary { cursor: pointer; }
.wx-raw code { display: block; margin-top: 6px; padding: 7px 9px; border-radius: 8px; background: var(--tile); color: var(--ink-2); font: 0.75rem/1.4 var(--code-font); white-space: normal; word-break: break-word; }

/* Weather button and live summary (bottom right); the effects are drawn on a canvas over the map */
.wx-dock { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.wx-button { gap: 7px; border: 1px solid var(--glass-line); }
.wx-button svg { color: #6aa8ff; }
.wx-button[aria-pressed="true"] { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.wx-button[aria-pressed="true"] svg { color: #fff; }
/* Live flights button (flights.js), docked with the Weather button */
.flights-toggle { gap: 7px; min-height: 40px; box-sizing: border-box; padding: 6px 14px; font-size: 0.85rem; border: 1px solid var(--glass-line); }
.flights-toggle svg { color: #f29900; }
.flights-toggle small { font-size: 0.74rem; color: var(--ink-3); font-weight: 400; }
.flights-toggle small:empty { display: none; }
.flights-toggle[aria-pressed="true"] { background: #f29900; border-color: #f29900; color: #fff; }
.flights-toggle[aria-pressed="true"] svg, .flights-toggle[aria-pressed="true"] small { color: #fff; }
.plane-canvas { position: absolute; top: 0; left: 0; pointer-events: none; }
.leaflet-container.plane-hover, .leaflet-container.plane-hover .leaflet-interactive { cursor: pointer; }
.wx-canvas { position: absolute; inset: 0; z-index: 450; pointer-events: none; }

/* Live flight card (flight-card.js): a popup on the plane you clicked */
.flight-popup .leaflet-popup-content-wrapper { background: var(--glass-solid); color: var(--ink); border: 1px solid var(--glass-line); border-radius: var(--radius); box-shadow: var(--shadow); }
.flight-popup .leaflet-popup-tip { background: var(--glass-solid); }
.flight-popup .leaflet-popup-content { margin: 12px 14px 10px; font: 0.82rem/1.35 var(--ui-font); }
.flight-popup a.leaflet-popup-close-button { color: var(--ink-3); }
.flight-card { display: grid; gap: 8px; }
.flight-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding-right: 14px; }
.flight-card h2 { margin: 0; font: 600 1.45rem/1 var(--display-font); letter-spacing: 0.04em; }
.flight-card p { margin: 0; }
.fc-airline { margin-top: 2px !important; color: var(--ink-2); font-weight: 500; }
.fc-type { flex: none; padding: 2px 7px; border-radius: 6px; background: var(--tile); font: 0.72rem/1.4 var(--code-font); color: var(--ink-2); }
.fc-model { color: var(--ink-3); font-size: 0.76rem; }
.fc-route { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--tile); }
.fc-end { display: grid; min-width: 0; max-width: 84px; }
.fc-end.to { text-align: right; }
.fc-end b { font: 600 1.25rem/1.05 var(--display-font); letter-spacing: 0.05em; }
.fc-end span { overflow: hidden; color: var(--ink-3); font-size: 0.7rem; text-overflow: ellipsis; white-space: nowrap; }
.fc-track { position: relative; height: 2px; margin: 0 4px; border-radius: 1px; background: repeating-linear-gradient(90deg, var(--ink-3) 0 3px, transparent 3px 7px); opacity: 0.9; }
.fc-track span { position: absolute; inset: 0 auto 0 0; border-radius: 1px; background: #ff6a3d; }
.fc-track svg { position: absolute; top: 50%; width: 18px; height: 18px; transform: translate(-50%, -50%) rotate(90deg); fill: #ff6a3d; stroke: var(--glass-solid); stroke-width: 1.5; }
.fc-togo { color: var(--ink-2); font-size: 0.76rem; }
.fc-quiet { color: var(--ink-3); font-size: 0.76rem; }
.fc-stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 0; }
.fc-stats div { padding: 6px 8px; border-radius: 8px; background: var(--tile); }
.fc-stats dt { color: var(--ink-3); font-size: 0.66rem; letter-spacing: 0.06em; text-transform: uppercase; }
.fc-stats dd { margin: 1px 0 0; font: 600 0.88rem/1.25 var(--ui-font); font-variant-numeric: tabular-nums; }
.fc-stats dd small { color: var(--ink-3); font-weight: 400; font-size: 0.7rem; }
.flight-card footer { display: flex; justify-content: space-between; gap: 10px; color: var(--ink-3); font-size: 0.74rem; }
.flight-card footer a { color: var(--ink-2); font-weight: 500; }
.fc-live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: var(--good); vertical-align: 1px; }
.fc-note { color: var(--ink-3); font-size: 0.68rem; }
.leaflet-tooltip.flight-end { padding: 1px 6px; border: 0; border-radius: 5px; background: #ff6a3d; color: #fff; font: 600 0.7rem/1.4 var(--code-font); box-shadow: none; }
.leaflet-tooltip.flight-end::before { display: none; }

.wx-summary { width: 230px; max-width: calc(100vw - 2 * var(--gutter)); padding: 10px 12px; display: grid; gap: 6px; animation: wx-pop 0.18s ease-out; }
@keyframes wx-pop { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
@media (prefers-reduced-motion: reduce) { .wx-summary { animation: none; } }
.wx-summary[hidden] { display: none; }
.wx-summary header { display: grid; }
.wx-summary header b { font-size: 0.9rem; font-weight: 600; }
.wx-summary header small { font-size: 0.72rem; color: var(--ink-3); }
.wx-summary ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 40vh; overflow-y: auto; }
.wx-summary li { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 0.82rem; color: var(--ink-2); }
.wx-summary li span { width: 18px; text-align: center; }
.wx-summary li b { margin-left: auto; font: 600 0.8rem var(--code-font); color: var(--ink); }
.wx-summary li small { margin-left: auto; font-size: 0.74rem; color: var(--ink-3); white-space: nowrap; }
.wx-summary .wx-storm { color: var(--ink); font-weight: 500; }

/* ---- Card tools (cardtools.js): local time, runway view, distance ---------------------------- */

.local-time { display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 9px; background: var(--tile); font-size: 0.82rem; color: var(--ink-2); }
.local-time b { font: 600 0.95rem var(--code-font); color: var(--ink); }
.local-time small { margin-left: 4px; color: var(--ink-3); font-size: 0.72rem; }
.local-time span:last-child { display: block; font-size: 0.76rem; color: var(--ink-3); }
.sun-icon { font-size: 1.3rem; line-height: 1; color: var(--accent); }

.tool {
  padding: 9px 12px;
  border: 1px solid var(--glass-line);
  border-radius: 9px;
  background: var(--tile);
  font-size: 0.85rem;
  cursor: pointer;
}
.tool:hover, .tool[aria-expanded="true"] { background: var(--tile-hover); }


/* Runway view: a satellite close-up in a popup */
.runway-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: grid;
  place-items: center;
  background: rgb(5 12 22 / 55%);
}
.runway-modal[hidden] { display: none; }
.runway-card { overflow: hidden; background: var(--glass-solid); }
.runway-card header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; font-size: 0.9rem; }
.runway-card header b { font-family: var(--code-font); }
.runway-card header small { display: block; font-size: 0.72rem; color: var(--ink-3); }
.runway-zoom { display: flex; gap: 6px; flex: none; }
.runway-zoom button:not(.close) { width: 30px; height: 30px; border: 1px solid var(--glass-line); border-radius: 8px; background: var(--tile); cursor: pointer; }
.runway-zoom button:disabled { opacity: 0.4; cursor: default; }
.runway-tiles { position: relative; overflow: hidden; background: #1a2230; }
.runway-tiles img { position: absolute; width: 256px; height: 256px; max-width: none; }
.runway-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgb(0 0 0 / 35%);
}
.runway-card footer { padding: 8px 12px; font-size: 0.72rem; color: var(--ink-3); }
.runway-card footer a { color: inherit; }

/* ---- Flying planes and the replay bar (fly.js) ----------------------------------------------- */

.fly-plane { background: none; border: 0; pointer-events: none; }
.fly-plane span { display: block; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 50%)); }
.fly-plane svg { display: block; }

.replay-bar {
  position: fixed;
  z-index: 1005;
  left: 50%;
  bottom: calc(var(--gutter) + 24px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100% - 2 * var(--gutter));
  padding: 8px 8px 8px 14px;
  font-size: 0.85rem;
  white-space: nowrap;
}
.replay-bar[hidden] { display: none; }
.replay-bar b { font-family: var(--code-font); }
.replay-bar span { overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); }
.replay-count { font: 0.75rem var(--code-font); color: var(--ink-3) !important; }

/* ---- Globe (globe.js) -------------------------------------------------------------------------- */

.globe {
  position: fixed;
  inset: 0;
  z-index: 1000; /* over the map and its controls, under the search, card and logbook */
  background: radial-gradient(circle at 50% 45%, var(--ocean) 0%, color-mix(in srgb, var(--ocean) 55%, #000) 100%);
  touch-action: none;
}
.globe[hidden] { display: none; }
.globe canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.globe canvas:active { cursor: grabbing; }
.globe-hint {
  position: absolute;
  left: 50%;
  bottom: calc(var(--gutter) + 6px);
  transform: translateX(-50%);
  margin: 0;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--ink-2);
  white-space: nowrap;
  pointer-events: none;
}
.globe-tools { position: absolute; right: var(--gutter); bottom: var(--gutter); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.globe-tools .wx-button { min-height: 40px; }
body.globe-open .hud-right > :not(.mine-toggle):not(.plan-toggle):not(.records-link) { display: none; }

@media (max-width: 640px) {
  /* No room beside the globe's buttons and My airports. */
  .globe-hint { display: none; }
  /* Above the Plan a trip and My airports row, like the flat map's buttons. */
  .globe-tools { bottom: calc(var(--gutter) + 70px); }
  .replay-bar { bottom: calc(var(--gutter) + 70px); }
}

/* ---- Year in review (review.js) ------------------------------------------------------------- */

.review {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  background: rgb(5 10 20 / 72%);
}
.review[hidden] { display: none; }
.review-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(420px, 100vw);
  height: min(780px, 100dvh);
  padding: 14px 18px 22px;
  border-radius: 20px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(170deg, #22385c, #0d1728 70%);
  box-shadow: 0 20px 60px rgb(0 0 0 / 45%);
}
.slide-distance { background: linear-gradient(170deg, #4a2d6b, #12152a 70%); }
.slide-new, .slide-favourites { background: linear-gradient(170deg, #1d5a52, #0c1a22 70%); }
.slide-longest, .slide-months { background: linear-gradient(170deg, #6b3a1d, #1a1210 70%); }
.review-progress { display: flex; gap: 4px; }
.review-progress > i { flex: 1; height: 3px; border-radius: 2px; background: rgb(255 255 255 / 25%); overflow: hidden; }
.review-progress > i > i { display: block; height: 100%; width: 0; background: #fff; }
.review-progress > i.done > i { width: 100%; }
.review-progress > i.now > i { animation: review-fill linear forwards; }
@keyframes review-fill { to { width: 100%; } }
.review-head { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.review-years { display: flex; gap: 4px; flex-wrap: wrap; }
.review-years button { padding: 3px 9px; border: 1px solid rgb(255 255 255 / 30%); border-radius: 99px; background: none; color: #fff; font-size: 0.75rem; cursor: pointer; }
.review-years button[aria-pressed="true"] { background: #fff; color: #142030; }
.review .close { background: rgb(255 255 255 / 15%); color: #fff; }
.review-slide { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px; min-height: 0; }
.review-slide small { font-size: 0.85rem; color: rgb(255 255 255 / 70%); text-transform: uppercase; letter-spacing: 0.08em; }
.review-slide p { margin: 0; font-size: 1.1rem; }
.review-slide hr { width: 100%; margin: 18px 0; border: 0; border-top: 1px solid rgb(255 255 255 / 18%); }
.review-year { margin: 0; font: 800 5.5rem/1 var(--display-font); color: var(--accent); }
.review-big { font: 750 4.4rem/1 var(--display-font) !important; }
.review-route { font: 700 2.4rem/1.1 var(--display-font) !important; }
.review-route.small { font-size: 1.8rem !important; }
.review-note { font-size: 0.95rem !important; color: rgb(255 255 255 / 75%); }
.review-map { width: 100%; height: auto; border-radius: 12px; background: rgb(0 0 0 / 18%); }
.review-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.review-tags li { padding: 4px 10px; border-radius: 99px; background: rgb(255 255 255 / 14%); font-size: 0.85rem; }
.review-months { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; height: 150px; margin: 18px 0 0; padding: 0; list-style: none; }
.review-months li { display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; font-size: 0.7rem; color: rgb(255 255 255 / 60%); }
.review-months i { width: 100%; min-height: 2px; border-radius: 3px 3px 0 0; background: rgb(255 255 255 / 30%); }
.review-months li.top i { background: var(--accent); }
.review-preview { align-self: center; height: min(52vh, 440px); width: auto; border-radius: 12px; box-shadow: 0 8px 24px rgb(0 0 0 / 40%); }
.review-actions { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.review-actions .tool { background: #fff; color: #142030; border: 0; font-weight: 600; }
.review-nav { position: absolute; top: 70px; bottom: 0; z-index: 1; width: 35%; border: 0; background: none; cursor: pointer; }
.review-nav.prev { left: 0; }
.review-nav.next { right: 0; width: 65%; }
.slide-share .review-nav { bottom: 70px; }
body.review-open { overflow: hidden; }

@media (max-width: 480px) {
  .review-card { border-radius: 0; }
}

/* ---- Plan a trip (planner.js) --------------------------------------------------------------- */

.plan-toggle { font-weight: 600; }
.plan-toggle .plan-ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 0.95rem; }
.plan-toggle[aria-pressed="true"] { border-color: var(--accent); }

.planner {
  position: fixed;
  inset: 0;
  z-index: 1150;
  display: grid;
  place-items: center;
  padding: var(--gutter);
  background: rgb(5 10 20 / 45%);
}
.planner[hidden] { display: none; }
.plan-card {
  width: min(30rem, 100%);
  max-height: min(860px, calc(100dvh - 2 * var(--gutter)));
  overflow-y: auto;
  padding: 16px 18px 18px;
  background: var(--glass-solid);
}
.plan-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.plan-head h2 { margin: 0; font-size: 1.15rem; }
.plan-back { border: 0; background: none; color: var(--ink-2); font: 500 0.95rem var(--ui-font); cursor: pointer; padding: 4px 0; }

.plan-form { display: flex; flex-direction: column; gap: 12px; }
.plan-pair { position: relative; display: flex; flex-direction: column; gap: 8px; }
.plan-swap { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--glass-line); background: var(--glass-solid); color: var(--ink); cursor: pointer; }
.plan-field { position: relative; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.plan-field[hidden] { display: none; }
.plan-field > span, .plan-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.plan-field input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--glass-line); border-radius: 10px; background: var(--tile); color: var(--ink); font: 500 1rem var(--ui-font); }
.plan-field input:focus { outline: none; border-color: var(--accent); }
.plan-picks { position: absolute; top: 100%; left: 0; right: 0; z-index: 5; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--glass-solid); border: 1px solid var(--glass-line); border-radius: 10px; box-shadow: var(--shadow); }
.plan-picks li { display: flex; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
.plan-picks li:hover { background: var(--tile-hover); }
.plan-picks .code { width: 2.6rem; font: 600 0.9rem var(--code-font); color: var(--accent); }
:root[data-ui="light"] .plan-picks .code { color: #b06a00; }
.plan-picks span { display: flex; flex-direction: column; min-width: 0; font-size: 0.9rem; }
.plan-picks small { color: var(--ink-3); font-size: 0.78rem; }
.plan-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-dates { flex-wrap: nowrap; }
.plan-label { min-width: 6.5rem; }
.plan-chip { padding: 7px 13px; border: 1px solid var(--glass-line); border-radius: 99px; background: var(--tile); color: var(--ink); font: 500 0.88rem var(--ui-font); cursor: pointer; }
.plan-chip[aria-pressed="true"] { background: var(--chip-on); color: var(--chip-on-ink); border-color: transparent; }
.plan-stepper { display: flex; align-items: center; gap: 12px; }
.plan-stepper button { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--glass-line); background: var(--tile); color: var(--ink); font-size: 1.1rem; cursor: pointer; }
.plan-error { margin: 0; color: #c0392b; font-size: 0.9rem; }
.plan-go { margin-top: 4px; padding: 12px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: 700 1rem var(--ui-font); cursor: pointer; }

.plan-summary p { margin: 0; color: var(--ink-2); font-size: 0.92rem; }
.plan-codes { display: flex; align-items: center; gap: 10px; font: 800 2.6rem/1.05 var(--display-font); color: var(--ink) !important; }
.plan-codes i { font-style: normal; font-size: 1.6rem; color: var(--accent); }
.plan-meta { margin-top: 2px !important; color: var(--ink-3) !important; }
.plan-book { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; padding: 11px 13px; border: 1px solid var(--glass-line); border-radius: 12px; background: var(--tile); color: var(--ink); text-decoration: none; }
.plan-book:hover { border-color: var(--accent); }
.plan-book .ico { grid-row: span 2; width: 26px; text-align: center; font-size: 1.15rem; }
.plan-book b { font-size: 0.95rem; }
.plan-book small { color: var(--ink-2); font-size: 0.8rem; }
.plan-book.primary { margin-top: 14px; background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.plan-book.primary small { color: var(--accent-ink); opacity: 0.8; }
.plan-section { margin-top: 18px; }
.plan-section h3 { margin: 0 0 8px; font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-3); }
.plan-option { padding: 12px 13px; border: 1px solid var(--glass-line); border-radius: 12px; margin-bottom: 8px; }
.plan-option.best { border-color: var(--accent); }
.plan-option header { display: flex; align-items: center; gap: 8px; }
.plan-badge { padding: 2px 8px; border-radius: 99px; background: var(--accent); color: var(--accent-ink); font-size: 0.72rem; font-weight: 700; }
.plan-time { margin-left: auto; font: 600 0.9rem var(--code-font); }
.plan-legs { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-legs li { display: grid; grid-template-columns: 2.6rem 1rem 2.6rem 1fr; align-items: baseline; gap: 4px; font-size: 0.85rem; }
.plan-legs .code { font: 600 0.9rem var(--code-font); }
.plan-legs i { font-style: normal; color: var(--ink-3); }
.plan-leg-info { color: var(--ink-2); }
.plan-leg-info small { display: block; color: var(--ink-3); font-size: 0.76rem; }
.plan-map { padding: 6px 12px; border: 1px solid var(--glass-line); border-radius: 99px; background: none; color: var(--ink); font: 500 0.82rem var(--ui-font); cursor: pointer; }
.plan-empty { margin: 0; color: var(--ink-2); font-size: 0.9rem; }
.plan-alts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-alts .plan-book { grid-template-columns: 1fr; }
.plan-extras { display: grid; gap: 8px; }
.plan-note { margin: 16px 0 0; color: var(--ink-3); font-size: 0.78rem; line-height: 1.45; }
.plan-note a { color: inherit; }
.plan-tip { font: 600 0.75rem var(--code-font); }

@media (max-width: 640px) {
  .planner { padding: 0; place-items: end stretch; }
  .plan-card { width: 100%; max-height: 92dvh; border-radius: 18px 18px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}

/* ---- Airport history and event replays (events.js) ------------------------------------------ */

.events h3, .event-view h4 { margin: 0 0 6px; font-size: 0.68rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; }
.events ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.event-row {
  width: 100%;
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 11px;
  background: var(--tile);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.event-row:hover { background: var(--tile-hover); }
.event-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #1e3a5f, #3b82f6); font-size: 1.05rem; }
.event-icon.sad { background: linear-gradient(135deg, #2b2f36, #5b6472); }

/* "On this day": a small card under the filter chips, hidden while a card or replay is open */
.today { position: relative; display: flex; align-items: stretch; width: max-content; max-width: min(360px, 100%); box-sizing: border-box; }
.hud-left:has(#details:not([hidden])) .today, .hud-left:has(.event-view:not([hidden])) .today { display: none; }
.today-open { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 10px; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.today-icon { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #1e3a5f, #3b82f6); font-size: 1.05rem; }
.today-icon.sad { background: linear-gradient(135deg, #2b2f36, #5b6472); }
.today-text { display: grid; min-width: 0; line-height: 1.25; }
.today-text b { font-size: 0.86rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today-text small { font-size: 0.7rem; color: var(--ink-3); }
.today .event-play { flex: none; }
.today-close { flex: none; align-self: flex-start; width: 26px; height: 26px; margin: 4px 4px 0 0; border: 0; border-radius: 50%; background: none; color: var(--ink-3); font-size: 1rem; cursor: pointer; }
.today-close:hover { background: var(--glass-solid); color: inherit; }
.event-row b { display: block; font-size: 0.9rem; font-weight: 600; }
.event-row small { display: block; font-size: 0.75rem; color: var(--ink-3); }
.event-play { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 0.7rem; }

.event-view h4 { margin: 4px 0 -6px; }
.event-back { justify-self: start; border: 0; background: none; padding: 0; color: var(--ink-3); font: inherit; font-size: 0.8rem; cursor: pointer; }
.event-back:hover { color: var(--ink); }
.event-head h2 { margin: 2px 0 4px; font-size: 1.3rem; font-weight: 650; line-height: 1.2; }
.event-head p { margin: 0; font-size: 0.85rem; color: var(--ink-2); line-height: 1.4; }
.event-head .event-date { font: 600 0.72rem var(--code-font); color: var(--accent); text-transform: uppercase; letter-spacing: 0.05em; }

.event-player { display: grid; gap: 10px; padding: 12px; border-radius: 14px; background: rgb(8 16 28 / 88%); color: #e8f0fa; }
.event-hud { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 6px; }
.event-hud.three { grid-template-columns: 1.4fr 1fr 1fr; }
.event-hud div { display: grid; padding: 6px 8px; border-radius: 9px; background: rgb(255 255 255 / 6%); }
.event-hud b { font: 600 0.95rem var(--code-font); font-variant-numeric: tabular-nums; color: #7fd1ff; }
.event-hud span { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgb(232 240 250 / 55%); }
.event-hud .ok { color: #4ade80; }
.event-hud .warn { color: #fbbf24; }
.event-hud b[data-hud="gauge"] { font-size: 0.82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event-hud .lost { color: #ff6b3d; animation: event-blink 1s steps(2) infinite; }
@keyframes event-blink { 50% { opacity: 0.35; } }
.event-caption { min-height: 5.6em; }
.event-start { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 12px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 700; font-size: 1rem; cursor: pointer; animation: event-pulse 1.6s ease-in-out infinite; }
.event-start[hidden] { display: none; }
@keyframes event-pulse { 50% { box-shadow: 0 0 0 6px rgb(255 181 71 / 25%); } }
.event-caption b { display: block; font-size: 1rem; color: #fff; }
.event-caption p { margin: 3px 0 0; font-size: 0.86rem; line-height: 1.4; color: rgb(232 240 250 / 82%); }
.event-controls { display: flex; align-items: center; gap: 10px; }
.event-toggle { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.event-controls input { flex: 1; min-width: 0; accent-color: var(--accent); }
.event-again { flex: none; border: 1px solid rgb(255 255 255 / 20%); border-radius: 999px; background: none; color: inherit; font: inherit; font-size: 0.78rem; padding: 5px 10px; cursor: pointer; }
.event-sound { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 1px solid rgb(255 255 255 / 20%); border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.event-sound[aria-pressed="false"] { opacity: 0.6; }
.event-note { margin: 0; font-size: 0.7rem; color: rgb(232 240 250 / 50%); }

.event-outcome { padding: 8px 12px; border-radius: 10px; background: rgb(34 165 101 / 14%); color: #22a565; font-weight: 600; font-size: 0.88rem; }
.event-outcome.sad { background: var(--tile); color: var(--ink-2); }
.event-summary { margin: 0; font-size: 0.88rem; line-height: 1.5; color: var(--ink-2); }
.event-view > p { font-size: 0.86rem; line-height: 1.5; color: var(--ink-2); margin: 0; }
.event-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0; }
.event-facts div { padding: 7px 9px; border-radius: 9px; background: var(--tile); }
.event-facts dt { font-size: 0.66rem; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.05em; }
.event-facts dd { margin: 2px 0 0; font-size: 0.82rem; color: var(--ink); }
.event-timeline { list-style: none; margin: 0; padding: 0 0 0 10px; border-left: 2px solid var(--glass-line); display: grid; gap: 2px; }
.event-timeline button { display: grid; gap: 1px; width: 100%; padding: 6px 8px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; position: relative; }
.event-timeline button::before { content: ""; position: absolute; left: -16px; top: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 3px var(--glass-solid); }
.event-timeline button:hover { background: var(--tile); }
.event-timeline button.now { background: var(--tile-hover); }
.event-timeline button.now::before { background: var(--accent); }
.event-timeline time { font: 0.72rem var(--code-font); color: var(--ink-3); }
.event-timeline b { font-size: 0.86rem; }
.event-timeline span { font-size: 0.78rem; color: var(--ink-2); line-height: 1.4; }
.event-crew, .event-sources { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 0.84rem; }
.event-crew span { display: block; font-size: 0.78rem; color: var(--ink-3); }
.event-sources a { color: var(--ink-2); }

/* On the map: the plane, places, boats and the bird strike and splash effects */
.event-plane, .event-boat, .event-burst { background: none; border: 0; pointer-events: none; }
.event-plane span { position: relative; display: grid; place-items: center; width: 40px; height: 40px; color: #fff; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 55%)); }
.event-plane svg { width: 26px; height: 26px; }
.event-plane .event-shadow { position: absolute; inset: 0; z-index: -1; color: #000; opacity: 0.35; filter: blur(1.5px); }
.event-plane .event-shadow::after { content: none; }
.event-plane .smoking::after, .event-plane .burning::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 70%;
  width: 6px;
  height: 22px;
  margin-left: -3px;
  border-radius: 3px;
  background: linear-gradient(rgb(90 90 90 / 70%), transparent);
  animation: event-smoke 0.6s ease-in-out infinite alternate;
}
@keyframes event-smoke { from { transform: scaleX(1); opacity: 0.8; } to { transform: scaleX(1.8); opacity: 0.4; } }
.event-plane .burning::after { height: 30px; background: linear-gradient(#fff3b0, #ff8a1f 30%, rgb(255 60 20 / 70%) 60%, rgb(60 60 60 / 50%)); animation-duration: 0.25s; }
.event-plane .glowing svg { filter: drop-shadow(0 0 4px #9fd4ff) drop-shadow(0 0 10px #6aa8ff); animation: event-glow 0.8s ease-in-out infinite alternate; }
@keyframes event-glow { to { filter: drop-shadow(0 0 2px #9fd4ff) drop-shadow(0 0 16px #c7b4ff); } }
.event-plane .floating { animation: event-bob 2.4s ease-in-out infinite; }
@keyframes event-bob { 50% { filter: drop-shadow(0 1px 1px rgb(0 0 0 / 40%)) brightness(0.92); } }
.event-boat svg { display: block; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 50%)); }
.leaflet-tooltip.event-place { padding: 2px 7px; border: 0; border-radius: 6px; background: rgb(8 16 28 / 82%); color: #fff; font-size: 0.72rem; box-shadow: none; }
.leaflet-tooltip.event-place::before { display: none; }

.event-birds, .event-splash { position: relative; display: block; width: 120px; height: 120px; }
.event-birds i {
  position: absolute;
  left: 50%;
  top: 50%;
  font-style: normal;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  text-shadow: 0 0 3px #000;
  animation: event-scatter var(--d) ease-out forwards;
}
@keyframes event-scatter {
  from { transform: rotate(var(--a)) translateY(0); opacity: 1; }
  to { transform: rotate(var(--a)) translateY(-55px); opacity: 0; }
}
.event-birds b { position: absolute; inset: 35px; border-radius: 50%; background: radial-gradient(#fff6c2, #ff6b3d 45%, transparent 70%); animation: event-flash 0.7s ease-out forwards; }
@keyframes event-flash { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
.event-splash i { position: absolute; inset: 50px; border: 2px solid #e8f6ff; border-radius: 50%; animation: event-ripple 2.4s ease-out forwards; }
.event-splash i:nth-child(2) { animation-delay: 0.35s; }
.event-splash i:nth-child(3) { animation-delay: 0.7s; }
.event-trail { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px; border-radius: 50%; pointer-events: none; animation: event-puff 2.6s ease-out forwards; }
.event-trail.smoke { background: radial-gradient(rgb(70 70 70 / 70%), rgb(70 70 70 / 0) 70%); }
.event-trail.fire { background: radial-gradient(rgb(255 150 40 / 85%), rgb(90 70 60 / 50%) 45%, rgb(60 60 60 / 0) 70%); }
.event-trail.wake { width: 18px; height: 18px; margin: -9px; border: 1.5px solid rgb(232 246 255 / 80%); animation: event-wake 3s ease-out forwards; }
@keyframes event-puff { from { transform: scale(0.6); opacity: 1; } to { transform: scale(3.2) translate(4px, -3px); opacity: 0; } }
@keyframes event-wake { from { transform: scale(0.5); opacity: 0.9; } to { transform: scale(3); opacity: 0; } }
@keyframes event-ripple { from { transform: scale(0.2); opacity: 1; } to { transform: scale(2.4); opacity: 0; } }

.event-fireball, .event-ash { position: relative; display: block; width: 120px; height: 120px; }
.event-fireball b { position: absolute; inset: 30px; border-radius: 50%; background: radial-gradient(#fff6c2, #ff8a1f 40%, rgb(220 40 20 / 70%) 65%, transparent 72%); animation: event-flash 1.2s ease-out forwards; }
.event-fireball i { position: absolute; inset: 40px; border-radius: 50%; background: radial-gradient(rgb(70 70 70 / 70%), transparent 70%); animation: event-ripple 3s ease-out forwards; }
.event-fireball i:nth-child(3) { animation-delay: 0.5s; }
.event-ash b { position: absolute; inset: 30px; border-radius: 50%; background: radial-gradient(rgb(120 120 120 / 75%), transparent 70%); animation: event-ripple 2.8s ease-out forwards; }
.event-ash b:nth-child(2) { animation-delay: 0.4s; }
.event-ash b:nth-child(3) { animation-delay: 0.8s; }
.event-flames { position: relative; display: block; width: 36px; height: 36px; }
.event-flames i { position: absolute; bottom: 6px; left: 50%; width: 14px; height: 22px; margin-left: -7px; border-radius: 50% 50% 40% 40%; background: radial-gradient(circle at 50% 80%, #fff3b0, #ff8a1f 45%, rgb(230 50 20 / 0%) 75%); transform-origin: 50% 100%; animation: event-flicker 0.5s ease-in-out infinite alternate; }
.event-flames i:nth-child(2) { margin-left: -14px; height: 16px; animation-delay: 0.15s; }
.event-flames i:nth-child(3) { margin-left: 1px; height: 18px; animation-delay: 0.3s; }
@keyframes event-flicker { from { transform: scaleY(0.8) rotate(-4deg); } to { transform: scaleY(1.15) rotate(4deg); } }

/* Weather laid over the map during a replay */
.event-weather { position: absolute; inset: 0; z-index: 420; pointer-events: none; }
.event-weather.fog { background: radial-gradient(ellipse at 50% 50%, rgb(210 218 226 / 38%), rgb(190 200 210 / 58%)); animation: event-fog 9s ease-in-out infinite alternate; }
@keyframes event-fog { to { opacity: 0.78; } }
.event-weather.night { background: rgb(4 10 24 / 45%); }
.event-weather.storm { background: repeating-linear-gradient(105deg, rgb(200 220 255 / 0%) 0 14px, rgb(200 220 255 / 22%) 14px 15px), rgb(20 30 50 / 30%); background-size: 60px 60px, auto; animation: event-rain 0.35s linear infinite, event-lightning 7s steps(1) infinite; }
@keyframes event-rain { to { background-position: -16px 60px, 0 0; } }
@keyframes event-lightning { 0%, 100% { filter: none; } 62% { filter: brightness(2.6); } 63% { filter: none; } 65% { filter: brightness(1.8); } 66% { filter: none; } }

@media (max-width: 640px) {
  .event-view { max-height: 48vh; }
  .event-hud b { font-size: 0.85rem; }
  .event-caption { min-height: 4.4em; }
}
@media (prefers-reduced-motion: reduce) {
  .event-hud .lost, .event-plane .smoking::after, .event-plane .burning::after, .event-plane .floating, .event-plane .glowing svg, .event-flames i, .event-weather, .event-start { animation: none; }
}
