.jet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(20rem, 27rem);
  height: calc(100svh - var(--topbar));
}

.jet__globe {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: var(--hero-bg);
}

.jet__still {
  width: min(86%, calc(86svh - var(--topbar)));
  height: auto;
}

.jet__canvas {
  position: absolute;
  inset: 0;
  cursor: grab;
}

.jet__canvas:active {
  cursor: grabbing;
}

.jet__globe.has-globe .jet__still {
  visibility: hidden;
}

.legend {
  position: absolute;
  bottom: 1rem;
  left: var(--margin);
  display: none;
  gap: 0.35rem;
  margin: 0;
  padding: 0.7rem 0.9rem;
  border-radius: 0.5rem;
  background: rgb(5 7 10 / 0.72);
  color: var(--hero-ink);
  font-size: 0.8125rem;
  list-style: none;
  pointer-events: none;
}

.jet__globe.has-globe .legend {
  display: grid;
}

.legend__item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.legend__mark {
  flex: none;
  width: 1.25rem;
  display: grid;
  place-items: center;
}

.legend__mark::before {
  content: "";
  display: block;
}

.legend__mark--latest::before {
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--arc);
}

.legend__mark--earlier::before {
  width: 100%;
  height: 1.5px;
  background: var(--arc-dim);
}

.legend__mark--point::before {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--arc-dim);
}

.legend__mark--airborne::before {
  width: 0.7rem;
  height: 0.7rem;
  border: 2px solid var(--arc);
  border-radius: 50%;
}

.jet__fallback {
  position: absolute;
  inset: auto var(--margin) 1rem;
  color: var(--hero-ink);
  font-size: var(--step-small);
  text-align: center;
  opacity: 0.8;
}

.jet__panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.75rem var(--margin) 2rem;
  border-left: 1px solid var(--raised);
}

.jet__eyebrow {
  color: var(--muted);
  font-size: var(--step-small);
}

.jet__panel h1 {
  font-size: var(--step-head);
  line-height: 1.1;
}

.jet__latest {
  margin-top: 0.5rem;
  color: var(--muted);
}

.jet__note {
  margin-top: 1.5rem;
  color: var(--muted);
}

.totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
  margin: 1.5rem 0 0;
  padding: 1.25rem 0;
  border-block: 1px solid var(--raised);
  list-style: none;
}

.totals__value {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.totals__unit {
  color: var(--muted);
  font-size: var(--step-small);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.chips[hidden] {
  display: none;
}

.chip {
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--raised);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--step-small);
  cursor: pointer;
  transition:
    background-color 150ms var(--ease-out),
    border-color 150ms var(--ease-out);
}

.chip:hover {
  border-color: var(--muted);
}

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

.chip__count {
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.chip[aria-pressed="true"] .chip__count {
  opacity: 1;
}

.flights {
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.flight {
  position: relative;
  padding: 0.85rem 0 0.85rem 0.9rem;
  border-bottom: 1px solid var(--raised);
}

.flight.is-latest::before {
  content: "";
  position: absolute;
  inset: 0.85rem auto 0.85rem 0;
  width: 3px;
  border-radius: 2px;
  background: var(--arc);
}

.flight__meta {
  display: flex;
  gap: 0.75rem;
  color: var(--muted);
  font-size: var(--step-small);
}

.flight__tail {
  font-family: var(--font-code);
  font-size: 0.8125rem;
}

.flight__route {
  font-weight: 600;
}

.flight__show {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.flight__show:hover,
.flight__show:focus-visible {
  color: var(--accent);
}

.flight:has(.flight__show) {
  cursor: pointer;
}

.flight.is-selected {
  background: var(--surface);
}

.jet-tip {
  font-family: var(--font);
  font-size: var(--step-small);
  line-height: 1.4;
}

.jet-tip p:first-child {
  font-weight: 600;
}

.flight__note {
  font-size: var(--step-small);
}

.flight__detail {
  color: var(--muted);
  font-size: var(--step-small);
  font-variant-numeric: tabular-nums;
}

.flight__source {
  position: absolute;
  top: 0.85rem;
  right: 0;
  color: var(--muted);
  font-size: var(--step-small);
}

.flight__source:hover,
.flight__source:focus-visible,
.jet__credit a:hover,
.jet__credit a:focus-visible {
  color: var(--ink);
}

.flights__more {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: var(--step-small);
  font-variant-numeric: tabular-nums;
}

.flights__more[hidden] {
  display: none;
}

.jet__credit {
  margin-top: 1.5rem;
  color: var(--muted);
  font-size: var(--step-small);
}

@media (max-width: 56rem) {
  .jet {
    display: block;
    height: auto;
  }

  .jet__globe {
    height: 55svh;
  }

  .jet__still {
    width: min(88vw, 49svh);
  }

  .jet__panel {
    overflow: visible;
    border-left: 0;
  }

  .jet__globe.has-globe .legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.9rem;
    right: var(--margin);
    bottom: 0.6rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.75rem;
  }

  .legend__mark {
    width: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chip {
    transition: none;
  }

  .legend__mark--airborne::before {
    width: 0.55rem;
    height: 0.55rem;
    border: 0;
    background: var(--arc);
  }
}
