:root {
  color-scheme: dark;
  --void: #050608;
  --black: #090c0e;
  --glass: rgba(7, 10, 12, 0.74);
  --glass-strong: rgba(7, 10, 12, 0.9);
  --sheet: #e8ece5;
  --sheet-soft: #d8ddd4;
  --white: #f2f5ef;
  --muted: #87908b;
  --muted-strong: #5e6762;
  --rule: rgba(242, 245, 239, 0.16);
  --rule-strong: rgba(242, 245, 239, 0.32);
  --sheet-rule: rgba(9, 12, 14, 0.18);
  --signal: #ff4d2d;
  --runway: #c8ff5f;
  --sodium: #f1a640;
  --ice: #96d7ce;
  --shadow: 0 26px 90px rgba(0, 0, 0, 0.46);
  --max: 1480px;

  /* Type system — editorial-cinematic.
     Display: high-contrast wonky serif (the romance). Text: literary screen serif
     (the personal notes). Mono: avionics-panel monospace (the logged data). */
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-text: "Newsreader", Georgia, "Times New Roman", serif;
  --font-mono: "Martian Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--void);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--white);
  font-family: var(--font-text);
  letter-spacing: 0;
  background: var(--void);
}

body::selection {
  color: var(--void);
  background: var(--runway);
}

a,
button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  border: 0;
  color: inherit;
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--runway);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

main {
  min-height: 100vh;
}

.globe-shell {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(5, 6, 8, 0.2), rgba(5, 6, 8, 0.96) 86%),
    repeating-linear-gradient(
      90deg,
      rgba(242, 245, 239, 0.032) 0,
      rgba(242, 245, 239, 0.032) 1px,
      transparent 1px,
      transparent 120px
    ),
    #050608;
}

.globe-shell::before,
.globe-shell::after,
.grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.globe-shell::before {
  z-index: 1;
  background:
    radial-gradient(ellipse at 58% 42%, transparent 0, transparent 34%, rgba(5, 6, 8, 0.52) 72%),
    linear-gradient(90deg, rgba(5, 6, 8, 0.86) 0, transparent 28%, transparent 64%, rgba(5, 6, 8, 0.78)),
    linear-gradient(180deg, rgba(5, 6, 8, 0.84) 0, transparent 22%, rgba(5, 6, 8, 0.9) 94%);
}

.globe-shell::after {
  z-index: 1;
  opacity: 0.52;
  background-image:
    linear-gradient(rgba(242, 245, 239, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(242, 245, 239, 0.05) 1px, transparent 1px);
  background-size: 160px 160px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.78), transparent 82%);
}

.grain {
  z-index: 6;
  opacity: 0.06;
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.24) 0, transparent 1px, transparent 5px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.12) 0, transparent 1px, transparent 7px);
  mix-blend-mode: screen;
}

.topbar {
  position: absolute;
  top: 24px;
  left: 50%;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  width: min(calc(100% - 64px), var(--max));
  color: var(--white);
  transform: translateX(-50%);
  transition:
    opacity 240ms ease,
    transform 240ms ease;
}

.brand,
.topbar nav,
.view-switch,
.year-strip,
.route-stack button,
.vitals span,
.section-kicker,
.rank-row,
.year-bars > div,
.drawer-carrier {
  display: flex;
  align-items: center;
}

.brand {
  gap: 10px;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
}

.brand img {
  width: 34px;
  height: 34px;
  padding: 7px;
  border: 1px solid var(--rule-strong);
  background: rgba(242, 245, 239, 0.06);
  filter: invert(1);
}

.topbar nav {
  flex-shrink: 1;
  gap: 1px;
  max-width: min(100%, 420px);
  overflow-x: auto;
  border: 1px solid var(--rule);
  background: rgba(5, 6, 8, 0.54);
  backdrop-filter: blur(18px);
}

.topbar nav a {
  min-width: 82px;
  padding: 12px 14px;
  color: rgba(242, 245, 239, 0.72);
  font-size: 0.82rem;
  font-weight: 600;
  text-align: center;
}

.topbar nav a:hover {
  color: var(--white);
  background: rgba(242, 245, 239, 0.08);
}

.globe-stage {
  position: absolute;
  inset: 0;
  z-index: 0;
}

#flight-globe {
  position: absolute;
  inset: -10svh -10vw -6svh -10vw;
  min-height: 800px;
  cursor: grab;
  opacity: 1;
  transition: opacity 220ms ease;
}

#flight-globe:active {
  cursor: grabbing;
}

#flight-globe canvas {
  display: block;
}

.flight-map {
  position: absolute;
  inset: -2svh -2vw -2svh -2vw;
  z-index: 0;
  min-height: 760px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.globe-shell[data-view="map"] #flight-globe {
  opacity: 0;
  pointer-events: none;
}

.globe-shell[data-view="map"] .flight-map {
  opacity: 1;
  pointer-events: auto;
}

.flight-map svg {
  display: block;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(150, 215, 206, 0.09), transparent 58%),
    rgba(5, 6, 8, 0.18);
  cursor: grab;
}

.flight-map svg:active {
  cursor: grabbing;
}

.map-graticule path {
  fill: none;
  stroke: rgba(242, 245, 239, 0.12);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
}

.map-land path {
  fill: rgba(242, 245, 239, 0.075);
  stroke: rgba(242, 245, 239, 0.14);
  stroke-width: 0.5;
  vector-effect: non-scaling-stroke;
}

.map-routes path {
  fill: none;
  stroke: rgba(255, 77, 45, 0.62);
  stroke-width: 1.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}

.map-routes path.is-selected {
  stroke: var(--runway);
  stroke-width: 2.2;
}

.map-points circle {
  fill: var(--white);
  stroke: var(--void);
  stroke-width: 1.4;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
}

.map-points circle.is-selected {
  fill: var(--runway);
}

.map-labels text {
  fill: rgba(242, 245, 239, 0.74);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  paint-order: stroke;
  pointer-events: none;
  stroke: rgba(5, 6, 8, 0.78);
  stroke-width: 3px;
}

.libraries-missing #flight-globe::after {
  position: absolute;
  top: 46%;
  left: 50%;
  width: min(420px, 82vw);
  padding: 18px;
  border: 1px solid var(--rule-strong);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  line-height: 1.6;
  text-align: center;
  background: rgba(5, 6, 8, 0.86);
  transform: translate(-50%, -50%);
  content: "Globe libraries did not load. Check the CDN scripts or serve this page with network access.";
}

.globe-shadow {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 2;
  height: 38svh;
  background: linear-gradient(180deg, transparent, rgba(5, 6, 8, 0.92) 62%, var(--void));
  pointer-events: none;
}

.globe-overlay {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(420px, 0.86fr) minmax(300px, 360px);
  gap: 48px;
  align-items: end;
  min-height: 100svh;
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 128px 32px 220px;
  pointer-events: none;
  transition:
    padding 260ms ease,
    z-index 260ms ease;
}

.title-stack {
  min-width: 0;
  max-width: 720px;
  pointer-events: auto;
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.dateline,
.drawer-label,
.control-block > span,
.control-heading span,
.section-kicker,
.stat-list h3,
.rank-row em,
.leg-drawer dt {
  margin: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.dateline,
.title-stack h1,
.title-stack p:not(.dateline) {
  text-shadow:
    0 1px 2px rgba(5, 6, 8, 0.98),
    0 16px 44px rgba(5, 6, 8, 0.9);
}

.title-stack h1 {
  margin: 6px 0 18px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 6.6rem;
  line-height: 0.9;
  font-weight: 900;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 1;
  letter-spacing: -0.018em;
  text-transform: none;
}

.title-stack p:not(.dateline) {
  max-width: 540px;
  margin: 0;
  color: rgba(242, 245, 239, 0.82);
  font-size: 1.12rem;
  line-height: 1.55;
  letter-spacing: 0.005em;
  overflow-wrap: break-word;
}

.mission-panel {
  align-self: center;
  width: 100%;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  color: var(--white);
  background: rgba(5, 6, 8, 0.46);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  pointer-events: auto;
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.vitals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-left: 1px solid var(--rule);
}

.vitals span {
  min-height: 84px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
}

.vitals strong {
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 1.28rem;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-transform: none;
}

.control-block {
  padding: 15px 0 0;
}

.control-block > span {
  display: block;
  padding: 0 0 8px;
}

.control-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 8px;
}

.sort-toggle {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--rule);
  background: rgba(242, 245, 239, 0.04);
}

.sort-toggle img {
  width: 14px;
  height: 14px;
  filter: invert(1);
  opacity: 0.62;
}

.sort-toggle[aria-pressed="true"] {
  background: var(--runway);
}

.sort-toggle[aria-pressed="true"] img {
  filter: none;
  opacity: 1;
}

.year-strip {
  flex-wrap: wrap;
  gap: 1px;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.view-switch {
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.view-switch button,
.focus-toggle {
  flex: 1;
  min-height: 40px;
  padding: 0 12px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: rgba(242, 245, 239, 0.74);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  background: rgba(242, 245, 239, 0.04);
}

.focus-toggle {
  width: 100%;
  margin-top: 1px;
  border-left: 1px solid var(--rule);
  text-align: center;
}

.year-strip button {
  min-height: 38px;
  min-width: 58px;
  padding: 0 12px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: rgba(242, 245, 239, 0.74);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  background: rgba(242, 245, 239, 0.04);
}

.year-strip button[aria-pressed="true"],
.view-switch button[aria-pressed="true"],
.focus-toggle[aria-pressed="true"],
.route-stack button[aria-pressed="true"] {
  color: var(--void);
  background: var(--runway);
}

.view-switch button:disabled {
  color: rgba(242, 245, 239, 0.28);
  cursor: not-allowed;
  background: rgba(242, 245, 239, 0.025);
}

.route-stack {
  display: grid;
  max-height: 356px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}

.route-stack button {
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 0 12px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  color: rgba(242, 245, 239, 0.78);
  background: rgba(242, 245, 239, 0.04);
  text-align: left;
}

.route-stack button span {
  display: grid;
  gap: 3px;
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-stack button b,
.route-stack button em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-stack button b {
  font-weight: 700;
}

.route-stack button em {
  color: rgba(242, 245, 239, 0.42);
  font-size: 0.62rem;
  font-style: normal;
}

.route-stack button strong {
  color: var(--sodium);
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.route-stack button[aria-pressed="true"] strong,
.route-stack button[aria-pressed="true"] em {
  color: var(--void);
}

.leg-drawer {
  position: absolute;
  right: 32px;
  bottom: 22px;
  left: 32px;
  z-index: 7;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px minmax(360px, 0.74fr);
  gap: 18px;
  align-items: stretch;
  max-width: var(--max);
  margin: 0 auto;
  color: var(--white);
  background: rgba(5, 6, 8, 0.76);
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  transition:
    opacity 260ms ease,
    transform 260ms ease;
}

.globe-shell.is-focus-mode .topbar {
  opacity: 0.28;
  transform: translateX(-50%) translateY(-18px);
}

.globe-shell.is-focus-mode .globe-overlay {
  z-index: 8;
  /* Keep the column template unchanged so nothing reflows when focus mode
     toggles — the panel stays on the right instead of jumping to the left. */
  padding: 96px 32px 86px;
}

.globe-shell.is-focus-mode .title-stack {
  position: absolute;
  right: 32px;
  bottom: 18px;
  left: 32px;
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  max-width: none;
  min-height: 52px;
  padding: 10px 14px;
  border-top: 1px solid var(--rule-strong);
  border-bottom: 1px solid var(--rule-strong);
  opacity: 0.86;
  background: rgba(5, 6, 8, 0.58);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(18px);
  transform: none;
}

.globe-shell.is-focus-mode .mission-panel {
  align-self: center;
  grid-column: 2;
  justify-self: end;
  width: 190px;
  opacity: 0.62;
  transform: none;
}

.globe-shell.is-focus-mode .leg-drawer {
  opacity: 0.16;
  pointer-events: none;
  transform: translateY(calc(100% - 12px));
}

.globe-shell.is-focus-mode .title-stack .dateline,
.globe-shell.is-focus-mode .title-stack h1,
.globe-shell.is-focus-mode .title-stack p:not(.dateline) {
  text-shadow: none;
}

.globe-shell.is-focus-mode .title-stack .dateline {
  white-space: nowrap;
}

.globe-shell.is-focus-mode .title-stack h1 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1;
}

.globe-shell.is-focus-mode .title-stack p:not(.dateline) {
  max-width: none;
  overflow: hidden;
  color: rgba(242, 245, 239, 0.66);
  font-size: 0.8rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.globe-shell.is-focus-mode .vitals {
  grid-template-columns: 1fr;
}

.globe-shell.is-focus-mode .vitals span {
  min-height: 58px;
  padding: 9px 10px;
}

.globe-shell.is-focus-mode .vitals strong {
  font-size: 1.08rem;
}

.globe-shell.is-focus-mode .control-block {
  padding-top: 10px;
}

.globe-shell.is-focus-mode .route-stack button {
  min-height: 36px;
  padding: 0 10px;
}

.globe-shell.is-focus-mode .route-stack button span {
  font-size: 0.68rem;
}

.globe-shell.is-focus-mode .route-stack button em {
  font-size: 0.56rem;
}

.globe-shell.is-focus-mode .topbar:hover,
.globe-shell.is-focus-mode .title-stack:hover,
.globe-shell.is-focus-mode .mission-panel:hover {
  opacity: 1;
  transform: none;
}

.globe-shell.is-focus-mode .topbar:hover {
  transform: translateX(-50%);
}

.drawer-copy {
  min-width: 0;
  padding: 16px 0 16px 18px;
}

.leg-drawer h2 {
  margin: 7px 0 8px;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 2.4rem;
  line-height: 0.98;
  font-weight: 600;
  font-variation-settings: "opsz" 72;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.leg-drawer h2 i {
  color: var(--runway);
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: lowercase;
}

.drawer-note {
  display: -webkit-box;
  max-width: 780px;
  margin: 0;
  overflow: hidden;
  color: rgba(242, 245, 239, 0.74);
  font-size: 0.9rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.drawer-note.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
}

.note-toggle {
  margin-top: 9px;
  padding: 0;
  color: var(--runway);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: transparent;
}

.note-toggle:hover {
  color: var(--white);
}

.drawer-carrier {
  align-self: stretch;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 16px;
  border-left: 1px solid var(--rule);
  border-right: 1px solid var(--rule);
}

.drawer-carrier img {
  position: relative;
  z-index: 2;
  width: 68px;
  height: 34px;
  padding: 5px 7px;
  border: 1px solid rgba(242, 245, 239, 0.2);
  background: rgba(242, 245, 239, 0.9);
  object-fit: contain;
  object-position: left center;
  transform-origin: left center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.drawer-carrier img:hover {
  background: rgba(242, 245, 239, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  transform: scale(1.28);
}

.drawer-carrier span {
  max-width: 100%;
  overflow: hidden;
  color: rgba(242, 245, 239, 0.62);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-carrier strong {
  color: var(--runway);
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

.leg-drawer dl {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 0;
  margin: 0;
  border-left: 1px solid var(--rule);
}

.leg-drawer dl div {
  min-width: 0;
  padding: 15px 12px;
  border-right: 1px solid var(--rule);
}

.leg-drawer dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--white);
  font-size: 0.82rem;
}

.stats-section {
  padding: 76px 32px 92px;
}

.section-kicker,
.section-header,
.stats-grid {
  width: min(100%, var(--max));
  margin-right: auto;
  margin-left: auto;
}

.section-kicker {
  justify-content: space-between;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid currentColor;
}

.section-kicker span,
.section-kicker strong {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stats-section .section-kicker {
  color: rgba(242, 245, 239, 0.56);
}

.section-header {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(320px, 0.42fr);
  gap: 48px;
  align-items: end;
  margin-top: 28px;
}

.section-header h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 0.94;
  font-weight: 600;
  font-variation-settings: "opsz" 120, "WONK" 1;
  letter-spacing: -0.015em;
  text-transform: none;
}

.stats-section {
  color: var(--white);
  background:
    linear-gradient(180deg, rgba(242, 245, 239, 0.04), transparent 16rem),
    var(--void);
}

.stats-section .section-header p {
  color: rgba(242, 245, 239, 0.58);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-top: 44px;
  border-top: 1px solid var(--rule-strong);
  border-left: 1px solid var(--rule);
}

.stat-board,
.stat-list {
  min-width: 0;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: rgba(242, 245, 239, 0.025);
}

.stat-board {
  grid-column: span 2;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-board article {
  min-height: 128px;
  padding: 16px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.stat-board span,
.stat-list h3 {
  display: block;
  color: rgba(242, 245, 239, 0.52);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.stat-board strong {
  display: block;
  margin-top: 28px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 1.72rem;
  line-height: 1;
  font-weight: 600;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.stat-list {
  padding: 16px;
}

.stat-list.wide {
  grid-column: span 2;
}

.stat-list h3 {
  margin: 0 0 14px;
}

.rank-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 12px;
  min-height: 43px;
  padding: 9px 0;
  overflow: visible;
  border-top: 1px solid rgba(242, 245, 239, 0.1);
}

.rank-row::before {
  position: absolute;
  left: 0;
  bottom: 7px;
  width: var(--w);
  height: 2px;
  background: var(--signal);
  content: "";
}

.rank-row span,
.rank-row strong,
.rank-row em {
  position: relative;
  z-index: 1;
}

.rank-row span {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  overflow: hidden;
  color: rgba(242, 245, 239, 0.86);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-row img {
  width: 30px;
  height: 18px;
  flex: 0 0 auto;
  object-fit: contain;
  object-position: left center;
}

.rank-row img.rank-logo {
  position: relative;
  z-index: 3;
  width: 38px;
  height: 22px;
  padding: 3px 4px;
  border: 1px solid rgba(242, 245, 239, 0.18);
  background: rgba(242, 245, 239, 0.9);
  transform-origin: left center;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.rank-row img.rank-logo:hover {
  background: rgba(242, 245, 239, 0.96);
  box-shadow: 0 9px 22px rgba(0, 0, 0, 0.28);
  transform: scale(1.42);
}

.rank-row img.rank-flag {
  width: 24px;
  height: 16px;
  border: 1px solid rgba(242, 245, 239, 0.28);
}

.rank-row strong {
  color: var(--runway);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.rank-row em {
  grid-column: 1 / -1;
  overflow: hidden;
  color: rgba(242, 245, 239, 0.42);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.year-bars {
  display: grid;
  gap: 12px;
}

.year-bars > div {
  display: grid;
  grid-template-columns: 58px minmax(120px, 1fr) minmax(110px, auto);
  gap: 12px;
  color: rgba(242, 245, 239, 0.74);
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

.year-bars i {
  display: block;
  height: 8px;
  overflow: hidden;
  background: rgba(242, 245, 239, 0.1);
}

.year-bars i::before {
  display: block;
  width: var(--w);
  height: 100%;
  background: var(--signal);
  content: "";
}

/* Cadence charts — flights per month / per weekday */
.chart-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 6px;
}

.chart-card {
  min-width: 0;
  margin: 0;
}

.chart-card figcaption {
  margin-bottom: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.line-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

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

.line-chart .chart-ytick {
  fill: var(--muted-strong);
  font-family: var(--font-mono);
  font-size: 10px;
  text-anchor: end;
  dominant-baseline: middle;
}

.line-chart .chart-xtick {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-anchor: middle;
}

.line-chart .chart-line {
  fill: none;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.line-chart .chart-dot {
  stroke: var(--void);
  stroke-width: 1.4;
}

.tooltip {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  display: grid;
  gap: 4px;
  max-width: 320px;
  padding: 11px 12px;
  border: 1px solid var(--rule-strong);
  color: var(--white);
  background: rgba(5, 6, 8, 0.9);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.36);
  opacity: 0;
  pointer-events: none;
  backdrop-filter: blur(16px);
  transition: opacity 120ms ease;
}

.tooltip.is-visible {
  opacity: 1;
}

.tooltip strong {
  color: var(--white);
  font-size: 0.86rem;
}

.tooltip span {
  color: rgba(242, 245, 239, 0.66);
  font-size: 0.76rem;
}

@media (max-width: 1180px) {
  .globe-overlay {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: end;
    padding-bottom: 360px;
  }

  .mission-panel {
    max-width: 610px;
  }

  .leg-drawer {
    grid-template-columns: minmax(0, 1fr) 180px;
    max-width: 780px;
  }

  .leg-drawer dl {
    grid-column: 1 / -1;
  }

  .leg-drawer a {
    min-height: 48px;
  }

  .section-header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .globe-shell {
    min-height: 100svh;
  }

  .topbar {
    position: fixed;
    top: 10px;
    left: 12px;
    right: 12px;
    display: block;
    height: 34px;
    width: calc(100vw - 24px);
    max-width: none;
    gap: 10px;
    pointer-events: none;
    transform: none;
  }

  .globe-shell.is-focus-mode .topbar {
    transform: translateY(-8px);
  }

  .globe-shell.is-focus-mode .topbar:hover {
    transform: none;
  }

  .brand span {
    display: none;
  }

  .brand {
    position: fixed;
    top: 10px;
    left: 12px;
    pointer-events: auto;
  }

  .brand img {
    width: 32px;
    height: 32px;
    padding: 7px;
  }

  .topbar nav {
    display: none;
  }

  .topbar nav a {
    min-width: 58px;
    padding: 9px 9px;
    font-size: 0.74rem;
  }

  /* Full-bleed canvas: the globe/map own the whole screen so they are
     fully draggable/zoomable. Chrome floats at the edges (see below). */
  #flight-globe {
    inset: 0 -22vw 0 -22vw;
    min-height: 0;
  }

  .flight-map {
    inset: 0 -8vw 0 -8vw;
    min-height: 0;
  }

  .map-labels text {
    font-size: 8px;
    stroke-width: 2.4px;
  }

  .map-routes path {
    stroke-width: 1px;
  }

  .map-routes path.is-selected {
    stroke-width: 1.7px;
  }

  .map-points circle {
    stroke-width: 1px;
  }

  .globe-shadow {
    /* gradient seats the bottom dock + title legibly without dimming the globe */
    height: 30svh;
  }

  /* Overlay is now a non-blocking layer: it never intercepts touches, so the
     globe behind it stays fully interactive. Text sits over it for sight only. */
  .globe-overlay {
    position: absolute;
    inset: 0;
    display: block;
    grid-template-columns: none;
    min-height: 0;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    padding: 0;
    pointer-events: none;
  }

  /* Title: compact, top-anchored, sight-only (touches pass through to globe) */
  .title-stack {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 52px);
    left: 16px;
    right: 16px;
    max-width: none;
    pointer-events: none;
  }

  .title-stack h1 {
    margin: 6px 0 8px;
    font-size: clamp(2.5rem, 13vw, 3.4rem);
  }

  .title-stack p:not(.dateline) {
    max-width: 32ch;
    font-size: 0.82rem;
    line-height: 1.45;
  }

  /* The desktop control slab is dismantled on mobile — its controls are moved
     into the bottom dock / sheets by setupMobileLayout(); the rest is hidden. */
  .mission-panel {
    display: none;
  }

  /* Vitals readout: slim, sight-only strip flowing under the title copy */
  .mobile-vitals {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    pointer-events: none;
  }

  .mobile-vitals .vitals {
    display: contents;
    border: 0;
  }

  .mobile-vitals .vitals span {
    flex: 0 0 auto;
    min-height: 0;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    padding: 5px 9px;
    border: 1px solid var(--rule);
    background: rgba(5, 6, 8, 0.42);
    backdrop-filter: blur(8px);
    color: var(--muted);
    font-size: 0.5rem;
  }

  .mobile-vitals .vitals strong {
    font-size: 0.74rem;
    color: var(--white);
  }

  /* Bottom dock: the only persistent interactive chrome over the canvas */
  .mobile-dock {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom, 0px));
    z-index: 9;
    display: flex;
    align-items: stretch;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--rule);
    background: var(--glass-strong);
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow);
    pointer-events: auto;
  }

  .mobile-dock .view-switch {
    flex: 0 0 auto;
    border: 1px solid var(--rule);
  }

  .mobile-dock .year-strip {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    flex-wrap: nowrap;
    border: 1px solid var(--rule);
    scrollbar-width: none;
  }

  .mobile-dock .year-strip::-webkit-scrollbar {
    display: none;
  }

  .mobile-dock .year-strip button {
    flex: 0 0 auto;
    min-width: 46px;
  }

  .mobile-dock .dock-flights {
    flex: 0 0 auto;
    padding: 0 14px;
    border: 1px solid var(--rule-strong);
    background: rgba(242, 245, 239, 0.06);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.02em;
  }

  /* Slide-up sheets (flight list + selected leg). Non-draggable: tap to toggle,
     so there is zero gesture arbitration with globe.gl / D3. */
  .flights-sheet,
  .leg-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 12;
    display: flex;
    flex-direction: column;
    max-height: 72svh;
    border-top: 1px solid var(--rule-strong);
    background: var(--glass-strong);
    backdrop-filter: blur(22px);
    box-shadow: 0 -26px 90px rgba(0, 0, 0, 0.55);
    transform: translateY(110%);
    transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: auto;
  }

  .globe-shell.is-sheet-open .flights-sheet,
  .globe-shell.is-leg-open .leg-sheet {
    transform: translateY(0);
  }

  .sheet-header {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--rule);
  }

  .sheet-header::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: var(--rule-strong);
    transform: translateX(-50%);
  }

  .sheet-title {
    flex: 1 1 auto;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  .sheet-close {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border: 1px solid var(--rule);
    background: rgba(242, 245, 239, 0.05);
    color: var(--white);
    font-size: 1.2rem;
    line-height: 1;
  }

  .flights-sheet .route-stack {
    flex: 1 1 auto;
    max-height: none;
    padding: 6px 12px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .leg-sheet .leg-drawer {
    position: static;
    inset: auto;
    max-width: 100%;
    max-height: calc(72svh - 52px);
    margin: 0;
    overflow-y: auto;
    border: 0;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    transform: none;
  }

  .vitals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .vitals span {
    min-height: 52px;
    padding: 8px 9px;
    font-size: 0.52rem;
  }

  .vitals strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-size: clamp(0.95rem, 5.4vw, 1.2rem);
  }

  .control-block {
    padding-top: 10px;
  }

  .control-block > span,
  .control-heading span {
    padding-left: 1px;
    font-size: 0.62rem;
  }

  .control-heading {
    padding-bottom: 6px;
  }

  .sort-toggle {
    width: 26px;
    height: 26px;
  }

  .view-switch button,
  .focus-toggle,
  .year-strip button {
    min-height: 34px;
    padding: 0 9px;
    font-size: 0.68rem;
  }

  .year-strip button {
    min-width: 50px;
  }

  .route-stack {
    max-height: 144px;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .route-stack button {
    min-height: 36px;
    padding: 0 10px;
  }

  .route-stack button span {
    font-size: 0.68rem;
  }

  .route-stack button em {
    font-size: 0.56rem;
  }

  .route-stack button strong {
    font-size: 0.66rem;
  }

  .globe-shell.is-focus-mode .globe-overlay {
    grid-template-columns: 1fr;
    min-height: 100svh;
    padding: 68px 12px 66px;
  }

  .globe-shell.is-focus-mode .title-stack {
    right: 16px;
    bottom: 10px;
    left: 16px;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    min-height: 48px;
    padding: 9px 12px;
    opacity: 0.9;
    transform: none;
  }

  .globe-shell.is-focus-mode .title-stack .dateline {
    display: none;
  }

  .globe-shell.is-focus-mode .title-stack h1 {
    font-size: 1rem;
  }

  .globe-shell.is-focus-mode .title-stack p:not(.dateline) {
    font-size: 0.72rem;
  }

  .globe-shell.is-focus-mode .mission-panel {
    position: absolute;
    top: 64px;
    right: 8px;
    width: 148px;
    max-height: calc(100svh - 144px);
    overflow-y: auto;
    opacity: 0.68;
    transform: none;
  }

  .globe-shell.is-focus-mode .vitals {
    grid-template-columns: 1fr;
  }

  .globe-shell.is-focus-mode .vitals span {
    min-height: 48px;
    padding: 7px 8px;
  }

  .globe-shell.is-focus-mode .control-block > span {
    font-size: 0.58rem;
  }

  .globe-shell.is-focus-mode .route-stack {
    max-height: 104px;
  }

  .globe-shell.is-focus-mode .leg-drawer {
    display: none;
  }

  .leg-drawer {
    right: 12px;
    bottom: 10px;
    left: 12px;
    grid-template-columns: minmax(0, 1fr) 92px;
    gap: 0;
    max-height: 238px;
    max-width: calc(100vw - 24px);
    overflow: auto;
  }

  .drawer-copy {
    padding: 11px 12px;
  }

  .leg-drawer h2 {
    margin: 5px 0 6px;
    font-size: clamp(1.38rem, 7.5vw, 1.82rem);
  }

  .leg-drawer h2 i {
    font-size: 1.02rem;
  }

  .drawer-note {
    font-size: 0.78rem;
    line-height: 1.38;
    -webkit-line-clamp: 2;
  }

  .drawer-note.is-expanded {
    max-height: 112px;
    overflow-y: auto;
  }

  .note-toggle {
    margin-top: 7px;
    font-size: 0.64rem;
  }

  .drawer-carrier {
    grid-column: 2;
    grid-row: 1;
    justify-content: flex-start;
    padding: 11px 9px;
    border-top: 0;
    border-left: 1px solid var(--rule);
    border-right: 0;
  }

  .drawer-carrier img {
    width: 68px;
    height: 34px;
  }

  .drawer-carrier img:hover {
    transform: none;
  }

  .drawer-carrier span {
    font-size: 0.66rem;
    white-space: normal;
  }

  .drawer-carrier strong {
    font-size: 0.76rem;
  }

  .leg-drawer dl {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--rule);
    border-left: 0;
  }

  .leg-drawer dl div {
    padding: 9px 10px;
  }

  .leg-drawer dd {
    font-size: 0.72rem;
  }

  .stats-section {
    padding: 44px 12px 58px;
  }

  .section-kicker {
    padding-top: 10px;
  }

  .section-header {
    margin-top: 18px;
  }

  .section-header h2 {
    font-size: clamp(2.35rem, 13vw, 3rem);
  }

  .stats-grid {
    margin-top: 26px;
  }

  .stats-grid,
  .stat-list.wide {
    grid-template-columns: 1fr;
    grid-column: span 1;
  }

  .chart-pair {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .stat-board {
    grid-column: span 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-board article {
    min-height: 88px;
    padding: 12px;
  }

  .stat-board strong {
    margin-top: 18px;
    font-size: 1.38rem;
  }

  .stat-list {
    padding: 13px 12px;
  }

  .rank-row {
    gap: 2px 10px;
    min-height: 42px;
  }

  .rank-row span {
    font-size: 0.92rem;
  }

  .rank-row img.rank-logo:hover {
    transform: none;
  }

  .year-bars > div {
    grid-template-columns: 48px minmax(90px, 1fr);
    gap: 9px;
    font-size: 0.72rem;
  }

  .year-bars strong {
    grid-column: 2;
  }
}

@media (max-width: 420px) {
  .title-stack h1 {
    font-size: clamp(2.2rem, 12vw, 2.9rem);
  }

  .mobile-vitals .vitals span {
    padding: 4px 7px;
  }

  .mobile-dock .year-strip button {
    min-width: 42px;
  }

  .drawer-carrier {
    padding-right: 7px;
    padding-left: 7px;
  }

  .drawer-carrier img {
    width: 62px;
  }
}
