/* Route map: top search toolbar, map, and results panel. */

.map-eyebrow { margin: 0 0 8px; font-size: .64rem; font-weight: 700; letter-spacing: .16em; color: #456c92; }
.aircraft-coverage { grid-column: 1 / -1; color: #6b7e91; font-size: .72rem; line-height: 1.5; }
.map-viewport-status { margin: 0; padding: 0 16px 12px; color: #6b7e91; font-size: .75rem; }
.map-viewport-status { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.dest-aircraft { display: block; color: #6b7e91; font-size: .7rem; line-height: 1.5; }
.connection-controls { margin-top: 12px; display: grid; gap: 12px; }
.connection-destination > label, .connection-date-grid label { display: grid; gap: 5px; color: #536477; font-size: .78rem; font-weight: 600; }
.connection-destination > label { display: flex; justify-content: space-between; margin-bottom: 5px; }
.connection-destination label span, .connection-date-grid label span { font-weight: 400; color: #7c8a98; }
.connection-input-row { display: flex; align-items: center; border: 1px solid #cfdae5; background: #fff; border-radius: 12px; }
.connection-input-row:focus-within { outline: 2px solid #2563eb; outline-offset: 2px; }
.connection-input-row input { width: 100%; min-width: 0; min-height: 46px; background: transparent; border: 0; padding: 10px 12px; font: inherit; color: #173358; }
.connection-input-row input:focus { outline: none; }
.connection-input-row button { border: 0; background: transparent; min-width: 44px; min-height: 44px; font-size: 1.3rem; cursor: pointer; color: #6b7e91; }
.connection-stops { display: flex; padding: 4px; gap: 3px; background: #e9eff5; border-radius: 12px; }
.connection-stops button { flex: 1; min-height: 40px; border: 0; border-radius: 9px; font: inherit; font-size: .76rem; font-weight: 600; background: transparent; color: #536477; cursor: pointer; }
.connection-stops button.is-active { background: #fff; color: #1d4ed8; box-shadow: 0 1px 5px #183b6420; }
.connection-checkbox { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: #536477; min-height: 32px; }
.connection-checkbox input { accent-color: #2563eb; width: 16px; height: 16px; }
.connection-dates summary, .map-advanced summary { cursor: pointer; padding: 11px 0; color: #173358; font-size: .8rem; font-weight: 600; }
.connection-date-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding-bottom: 8px; }
.connection-date-grid input, .connection-date-grid select { width: 100%; min-width: 0; min-height: 42px; border: 1px solid #cfdae5; border-radius: 9px; padding: 8px; font: inherit; font-size: .8rem; background: #fff; }
.map-advanced { border-top: 1px solid #e0e8f0; margin-top: 12px; }
.map-advanced summary span { font-weight: 400; color: #7c8a98; margin-left: 5px; font-size: .7rem; }
.map-connections[hidden], .map-list[hidden] { display: none; }
.map-connections { min-height: 0; overflow: auto; padding: 0 14px 14px; scrollbar-width: thin; }
#planner-status { margin: 2px 0 12px; color: #6b7e91; font-size: .75rem; line-height: 1.5; }
.connection-paths { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.connection-card { border: 1px solid #dce5ee; border-radius: 14px; overflow: hidden; background: #fff; transition: border-color .15s, box-shadow .15s; }
.connection-card.is-selected { border-color: #80a8f3; box-shadow: 0 0 0 2px #dce8fc; }
.connection-path-select { display: grid; gap: 9px; width: 100%; padding: 14px; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; }
.connection-card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; color: #173358; font-size: .82rem; }
.connection-badge { color: #6b7e91; background: #f0f4f8; padding: 3px 6px; border-radius: 5px; font-size: .62rem; font-weight: 500; }
.connection-timeline { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; font-size: .9rem; font-weight: 700; color: #173358; }
.connection-timeline i { color: #9aafc2; font-size: .72rem; font-style: normal; }
.connection-timeline .connection-via { font-size: .78rem; font-weight: 500; color: #6b7e91; }
.connection-metrics, .connection-carriers { color: #6b7e91; font-size: .7rem; line-height: 1.5; }
.connection-observed { font-size: .7rem; color: #16624a; background: #edf7f2; margin: 0 14px 10px; padding: 8px; border-radius: 7px; }
.connection-search, .connection-search-disabled { display: flex; justify-content: space-between; padding: 10px 14px; border-top: 1px solid #e8eef5; color: #1d4ed8; font-size: .76rem; font-weight: 600; text-decoration: none; }
.connection-search:hover { background: #eff5ff; }
.connection-search-disabled { color: #8795a3; }
.connection-controls button:focus-visible, .connection-path-select:focus-visible, .connection-search:focus-visible { outline: 2px solid #2563eb; outline-offset: -3px; }

@media (min-width: 900px) {
  .map-page .map-layout { grid-template-columns: 380px minmax(0,1fr); grid-template-rows: auto minmax(200px,1fr); }
  .map-page .map-controls { max-height: 54vh; overflow: auto; padding: 22px 20px 10px; }
  .map-connections { flex: 1; }
}
@media (max-width: 899px) {
  .map-connections { max-height: 48vh; }
  .connection-date-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

.map-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}

.map-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.map-nav .brand { font-weight: 700; font-size: 1.25rem; letter-spacing: -0.02em; }
.map-nav .brand span { color: var(--blue); }
.map-nav-link { font-weight: 600; color: var(--blue); }

.map-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "controls" "map" "sheet";
}

.map-controls { grid-area: controls; padding: 16px 16px 8px; }
.map-controls h1 { margin: 0 0 4px; font-size: 1.5rem; letter-spacing: -0.02em; }
.map-lede { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; }

.map-search { position: relative; display: grid; gap: 4px; }
.map-search label, .map-filters label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.map-search input, .map-filters select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}
.map-search input:focus-visible, .map-filters select:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }

.map-hub-chips {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.map-hub-chips::-webkit-scrollbar {
  display: none;
}
.hub-chips-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.hub-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
  flex-shrink: 0;
  white-space: nowrap;
}
.hub-chip:hover {
  background: var(--pale);
  border-color: var(--line-strong);
}
.hub-chip.is-active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  font-weight: 600;
}

/* Airport Picker for multi-airport cities */
.map-airport-picker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.airport-picker-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.airport-picker-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}
.airport-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.airport-chip:hover {
  background: var(--paper);
  border-color: var(--blue);
  color: var(--blue);
}
.airport-chip.is-active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}
.airport-chip.is-active .legend-swatch {
  border: 1.5px solid var(--white);
}

/* Alliance 1-Click Toggle Group */
.map-alliance-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.map-alliance-toggle::-webkit-scrollbar { display: none; }
.alliance-toggle-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  flex-shrink: 0;
}
.alliance-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
  flex-shrink: 0;
  white-space: nowrap;
}
.alliance-pill:hover {
  background: var(--pale);
  border-color: var(--line-strong);
}
.alliance-pill.is-active {
  background: #0f172a;
  color: var(--white);
  border-color: #0f172a;
  font-weight: 600;
}
.map-pending-state {
  padding: 12px 8px;
  list-style: none;
}
.map-pending-card {
  padding: 14px 16px;
  background: var(--pale);
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.88rem;
}
.map-pending-card p {
  margin: 0 0 6px;
}
.map-pending-sub {
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 10px !important;
}
.map-pending-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.map-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  margin: 4px 0 0;
  padding: 4px;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  max-height: 320px;
  overflow-y: auto;
}
.map-suggestions li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
}
.map-suggestions li[aria-selected="true"], .map-suggestions li:hover { background: var(--pale); }
.map-suggestions small { color: var(--muted); white-space: nowrap; }

.map-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; margin-top: 10px; }
.map-filters label { display: grid; gap: 4px; }

.map-legend, .map-origin-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.legend-line { display: inline-block; width: 22px; border-top: 3px solid var(--blue); }
.legend-line.dashed { border-top-style: dashed; }
.legend-tag, .status-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  font-style: normal;
  background: var(--amber-pale);
  color: #92400e;
}
.legend-swatch { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.map-canvas-wrap { grid-area: map; position: relative; min-height: 62vh; }
.map-canvas { position: absolute; inset: 0; background: #e8eef5; }
.map-globe-btn {
  position: absolute;
  top: 14px;
  right: 52px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 11px;
  background: var(--white);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: inherit;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.map-globe-btn:hover {
  background: var(--pale);
  border-color: var(--line-strong);
  color: var(--blue);
}
@media (max-width: 600px) {
  .map-globe-btn span { display: none; }
  .map-globe-btn { padding: 7px; right: 48px; }
}

.map-message {
  position: absolute;
  left: 16px;
  right: 140px; /* clear of globe btn and zoom buttons */
  top: 16px;
  z-index: 5;
  display: grid;
  gap: 2px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  font-size: 0.9rem;
}
.map-message span { color: var(--muted); }
.map-message.is-error { border-color: #fecaca; background: var(--danger-pale); }

/* Bottom sheet (mobile): pinned to the bottom of the screen over the map. */
.map-sheet {
  grid-area: sheet;
  background: var(--white);
  border-top: 1px solid var(--line);
  border-radius: 16px 16px 0 0;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.12);
}
/* Room to scroll the footer above the collapsed sheet. */
.map-page { padding-bottom: calc(52px + 24vh); }
.map-sheet-handle {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 8px 16px 10px;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line-strong); }
.map-list {
  list-style: none;
  margin: 0;
  padding: 0 8px 16px;
  max-height: 24vh;
  overflow-y: auto;
  transition: max-height 0.2s ease;
}
.map-sheet.is-expanded .map-list { max-height: 70vh; }

.map-list button {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 8px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 6px;
  background: var(--white);
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}
.map-list button:hover, .map-list button:focus-visible {
  background: var(--pale);
  border-color: var(--blue);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}
.dest-name { font-weight: 600; }
.dest-code { color: var(--muted); font-weight: 400; }
.dest-freq { font-size: 0.85rem; color: var(--muted); text-align: right; }
.dest-airlines { grid-column: 1 / -1; font-size: 0.85rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; }
.status-tag.listed { background: var(--line-light); color: var(--muted); }
.status-tag.confirmed { background: var(--success-pale); color: var(--teal-hover); }
.from-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 2px; }

/* Route sheet */
.route-sheet {
  width: min(560px, calc(100% - 32px));
  max-height: min(80vh, 720px);
  padding: 0 20px 20px;
  border: 0;
  border-radius: 16px;
  box-shadow: var(--shadow-xl);
  color: var(--ink);
}
.route-sheet::backdrop { background: rgba(15, 23, 42, 0.4); }
.route-sheet-close-row { position: sticky; top: 0; display: flex; justify-content: flex-end; padding-top: 8px; background: var(--white); }
.route-sheet-close { border: 0; background: none; font-size: 1.6rem; line-height: 1; min-width: 44px; min-height: 44px; cursor: pointer; color: var(--muted); }
.route-sheet h2 { margin: 0 0 4px; font-size: 1.3rem; }
.route-sheet .route-sub { margin: 0 0 16px; color: var(--muted); font-size: 0.9rem; }
.route-carriers { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.route-carriers li { padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 4px; }
.route-carrier-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.route-carrier-meta { font-size: 0.85rem; color: var(--muted); }
.carrier-name-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.carrier-code-pill {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--pale);
  padding: 1px 5px;
  border-radius: 4px;
}
.carrier-badge-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.op-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.70rem;
  font-weight: 600;
  vertical-align: middle;
}
.op-badge.operated {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.op-badge.codeshare {
  background: rgba(99, 102, 241, 0.12);
  color: #4338ca;
  border: 1px solid rgba(99, 102, 241, 0.3);
}
.route-aircraft-line {
  margin-top: 4px;
  font-size: 0.82rem;
  color: #0f766e;
  font-weight: 500;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.route-aircraft-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}
.wb-pill {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.70rem;
  font-weight: 700;
  background: rgba(14, 165, 233, 0.14);
  color: #0369a1;
  border: 1px solid rgba(14, 165, 233, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.route-seat-link {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
  background: var(--pale);
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  transition: all 0.15s ease;
}
.route-seat-link:hover {
  background: #eff6ff;
  border-color: var(--blue);
  color: #1d4ed8;
}
.aircraft-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}
.aircraft-pill.widebody {
  background: rgba(14, 165, 233, 0.12);
  color: #0284c7;
  border: 1px solid rgba(14, 165, 233, 0.25);
}
.dest-country {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
  background: var(--pale);
  padding: 1px 6px;
  border-radius: 4px;
}
.route-flights { margin: 0 0 16px; }
.route-flights h3 { font-size: 0.95rem; margin: 0 0 6px; }
.route-flights ul { list-style: none; margin: 0; padding: 0; font-size: 0.9rem; display: grid; gap: 4px; }
.route-flights p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.route-search-fares {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--blue);
  color: var(--white);
  text-align: center;
  font-weight: 700;
}
.route-search-fares:hover { background: var(--blue-hover); }
.route-disclaimer { margin: 10px 0 0; font-size: 0.8rem; color: var(--muted); }

.map-footer { padding: 16px; font-size: 0.8rem; color: var(--muted); border-top: 1px solid var(--line); background: var(--white); }
.map-footer p { margin: 0 0 6px; }
.map-footer a { text-decoration: underline; }
#map-data-as-of { color: var(--ink); font-weight: 600; }

@media (max-width: 599px) {
  .map-controls { padding: 12px 16px 8px; }
  .map-controls h1 { font-size: 1.2rem; }
  .map-lede { display: none; }
  .map-search label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .map-filters { margin-top: 8px; }
  .map-legend, .map-origin-legend { margin-top: 8px; font-size: 0.75rem; }
}

@media (min-width: 900px) {
  .map-page { padding-bottom: 0; }
  .map-layout {
    grid-template-columns: 360px minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "controls map" "sheet map";
    height: calc(100vh - 57px);
    min-height: 560px;
  }
  .map-controls { border-right: 1px solid var(--line); background: var(--white); }
  .map-canvas-wrap { min-height: 0; }
  .map-sheet { position: static; margin: 0; border-radius: 0; border-top: 1px solid var(--line); border-right: 1px solid var(--line); box-shadow: none; display: flex; flex-direction: column; min-height: 0; }
  .map-sheet-handle { justify-items: start; cursor: default; }
  .sheet-grip { display: none; }
  .map-list, .map-sheet.is-expanded .map-list { max-height: none; flex: 1; min-height: 0; }
  .map-message { left: 24px; right: auto; max-width: 420px; }
  .map-sheet-handle { pointer-events: none; }
}

/* FlightConnections-inspired hover popup */
.map-hover-popup .maplibregl-popup-content {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.95);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
}
.map-hover-popup .maplibregl-popup-tip {
  border-top-color: rgba(15, 23, 42, 0.95) !important;
  border-bottom-color: rgba(15, 23, 42, 0.95) !important;
}
.hover-tip {
  display: grid;
  gap: 3px;
}
.hover-tip-header {
  font-weight: 700;
  color: #fff;
}
.hover-tip-meta {
  font-size: 0.75rem;
  color: #94a3b8;
}
.hover-tip-carriers {
  font-size: 0.75rem;
  color: #38bdf8;
  font-weight: 500;
}

/* Route metrics header in detail sheet */
.route-metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
  gap: 8px;
  background: var(--pale);
  padding: 10px 14px;
  border-radius: 10px;
  margin-bottom: 14px;
  border: 1px solid var(--line-light);
}
.route-metric-item {
  display: flex;
  flex-direction: column;
}
.route-metric-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.route-metric-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.dest-dist {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 400;
}

/* 1-Click Interactive Airport Pivot & Action Bar */
.route-sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
@media (min-width: 480px) {
  .route-sheet-actions {
    flex-direction: row;
    align-items: center;
  }
}
.route-search-fares {
  flex: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 18px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.15s ease;
}
.route-search-fares:hover {
  background: #1d4ed8;
}
.route-pivot-btn {
  flex: 1;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 12px 18px;
  background: var(--white);
  color: var(--blue);
  font-weight: 600;
  border: 1.5px solid var(--blue);
  border-radius: 10px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.route-pivot-btn:hover {
  background: #eff6ff;
  border-color: #1d4ed8;
  color: #1d4ed8;
}

.hover-tip-stat {
  font-size: 0.78rem;
  color: #e2e8f0;
}
.hover-tip-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  color: #94a3b8;
}
.hover-pivot-btn {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.5);
  color: #38bdf8;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}
.hover-pivot-btn:hover {
  background: rgba(56, 189, 248, 0.35);
  color: #fff;
  border-color: #38bdf8;
}

/* Search and filter toolbar stays above both the map and its results. */
.map-page .map-layout { grid-template-areas: "controls" "map" "sheet"; }
.map-page .map-controls { background: var(--white); border-bottom: 1px solid var(--line); }
.map-page .map-sheet { position: static; border-radius: 0; box-shadow: none; }
.map-page { padding-bottom: 0; }
.map-page .map-connections { max-height: none; }
.map-page .map-list { max-height: 48vh; }
.map-page .map-sheet.is-expanded .map-list { max-height: 72vh; }
.map-page .map-search label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }

@media (min-width: 900px) {
  .map-page .map-layout {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-rows: auto minmax(420px, 1fr);
    grid-template-areas: "controls controls" "map sheet";
    height: auto;
    min-height: calc(100vh - 57px);
  }
  .map-page .map-controls {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) minmax(270px, 1fr) auto;
    align-items: end;
    gap: 10px 16px;
    padding: 16px 24px;
    max-height: none;
    overflow: visible;
    border-right: 0;
  }
  .map-controls .map-eyebrow, .map-controls h1, .map-controls .map-lede { grid-column: 1 / -1; margin: 0; }
  .map-controls .map-eyebrow { display: none; }
  .map-controls h1 { font-size: 1.2rem; }
  .map-controls .map-lede { font-size: .8rem; }
  .map-controls .map-search { grid-column: 1; grid-row: 3; }
  .map-controls .connection-controls { display: contents; }
  .connection-destination { grid-column: 2; grid-row: 3; }
  .connection-stops { grid-column: 3; grid-row: 3; }
  .connection-checkbox { grid-column: 4; grid-row: 3; margin-bottom: 6px; white-space: nowrap; }
  .map-controls .map-airport-picker { grid-column: 1 / -1; margin: 0; }
  .connection-dates { grid-column: 1 / -1; }
  .connection-date-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 820px; }
  .map-controls .map-hub-chips, .map-controls .map-advanced,
  .map-controls .map-legend, .map-controls .map-origin-legend { grid-column: 1 / -1; margin-top: 0; }
  .map-controls .map-filters { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .map-controls .map-advanced { border-top: 0; }
  .map-page .map-canvas-wrap { min-height: 62vh; }
  .map-page .map-sheet { border-left: 1px solid var(--line); border-right: 0; border-top: 0; max-height: 72vh; }
  .map-page .map-sheet-handle { padding: 16px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
  .map-page .map-list, .map-page .map-sheet.is-expanded .map-list { max-height: none; overflow: auto; }
  .map-page .map-connections { overflow: auto; }
}
@media (min-width: 900px) and (max-width: 1199px) {
  .map-page .map-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .connection-stops { grid-column: 1; grid-row: 4; }
  .connection-checkbox { grid-column: 2; grid-row: 4; }
  .map-page .map-layout { grid-template-columns: minmax(0, 1fr) 320px; }
}

