/* ShadCN-inspired dark theme */
:root {
  --background: hsl(224 71% 4%);
  --foreground: hsl(213 31% 91%);
  --card: hsl(224 71% 6%);
  --card-foreground: hsl(213 31% 91%);
  --popover: hsl(224 71% 6%);
  --primary: hsl(210 40% 98%);
  --primary-foreground: hsl(222.2 47.4% 11.2%);
  --secondary: hsl(222 47% 11%);
  --secondary-foreground: hsl(210 40% 98%);
  --muted: hsl(223 47% 11%);
  --muted-foreground: hsl(215 20% 65%);
  --accent: hsl(216 34% 17%);
  --accent-foreground: hsl(210 40% 98%);
  --destructive: hsl(0 62% 50%);
  --destructive-foreground: hsl(210 40% 98%);
  --border: hsl(216 34% 17%);
  --input: hsl(216 34% 17%);
  --ring: hsl(212 26% 83%);
  --radius: 0.75rem;
  --outbound: hsl(199 89% 48%);
  --inbound: hsl(280 65% 60%);
  --success: hsl(142 71% 45%);
  --layout-gap: 1rem;
  --sidebar-width: 380px;
  --card-badge-overhang: 0.75rem;
  --airline-logo-halo: hsl(220 20% 10%);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--background);
  color: var(--foreground);
  line-height: 1.5;
  min-height: 100vh;
}

.app {
  max-width: 1600px;
  margin: 0 auto;
  padding: var(--layout-gap);
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  column-gap: var(--layout-gap);
  row-gap: var(--layout-gap);
  align-items: start;
}

.app-span-full {
  grid-column: 1 / -1;
}

/* Header */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--layout-gap);
  flex-wrap: wrap;
  margin-bottom: 0;
}

.header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
}

.subtitle {
  color: var(--muted-foreground);
  font-size: 0.875rem;
  margin-top: 0.25rem;
}

.header-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
  font-family: inherit;
  white-space: nowrap;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover:not(:disabled) {
  background: hsl(210 40% 92%);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}

.btn-outline:hover:not(:disabled) {
  background: var(--accent);
}

.btn-ghost {
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  padding: 0.375rem 0.5rem;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--accent);
  color: var(--foreground);
}

.btn-destructive {
  background: transparent;
  border-color: hsl(0 62% 40%);
  color: hsl(0 62% 65%);
}

.btn-destructive:hover:not(:disabled) {
  background: hsl(0 62% 20%);
}

.btn-sm {
  padding: 0.25rem 0.625rem;
  font-size: 0.8125rem;
}

.btn-icon {
  padding: 0.375rem;
}

.btn-file {
  cursor: pointer;
}

/* Summary bar — mirrors main column split (routes | sidebar) */
.summary-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--sidebar-width);
  gap: var(--layout-gap);
  margin: 0;
}

.summary-stats-main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--layout-gap);
  min-width: 0;
}

.summary-stat--sidebar {
  min-width: 0;
}

.summary-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.875rem 1rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.summary-stat--metric .summary-value {
  line-height: 1.35;
  word-break: break-word;
}

.summary-stat--link {
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.summary-stat--link:hover {
  border-color: hsl(199 89% 42% / 0.55);
  background: hsl(220 20% 8%);
}

.summary-stat--link:focus-visible {
  outline: 2px solid hsl(199 89% 48%);
  outline-offset: 2px;
}

.summary-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.summary-value {
  font-size: 1.125rem;
  font-weight: 600;
}

.summary-value.highlight {
  color: var(--success);
}

.summary-subvalue {
  display: block;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  margin-top: 0.125rem;
  min-height: 1em;
}

/* Main content columns are direct grid children of .app */
.routes-panel {
  grid-column: 1;
  min-width: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  gap: var(--layout-gap);
}

#routes-list {
  display: flex;
  flex-direction: column;
  gap: var(--layout-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Badge is absolute (overhangs card top). Inter-card gap absorbs it — no extra margin (misaligns vs filters). */

.route-card-badge {
  position: absolute;
  left: 1.25rem;
  top: 0;
  transform: translateY(-50%);
  display: block;
  width: fit-content;
  padding: 0.25rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: calc(var(--radius) - 2px);
  box-shadow: 0 2px 8px hsl(224 71% 4% / 0.35);
  pointer-events: none;
  z-index: 14;
}

.route-card-badge.gf-tag-optimal {
  background: hsl(199 89% 48%);
  color: hsl(224 71% 4%);
}
/* Empty state */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted-foreground);
}

.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h2 {
  color: var(--foreground);
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.empty-state p {
  margin-bottom: 0;
  font-size: 0.875rem;
}

.empty-state.hidden {
  display: none;
}

.route-card {
  background: hsl(220 20% 10%);
  border: 1px solid hsl(220 14% 18%);
  border-radius: var(--radius);
  overflow: visible;
  transition: border-color 0.15s, box-shadow 0.15s;
  flex: 0 0 auto;
}

.route-card:hover {
  border-color: hsl(220 14% 26%);
}

.route-card.is-open {
  border-color: hsl(212 26% 32%);
  box-shadow: 0 8px 32px hsl(224 71% 4% / 0.45);
}

.route-card.is-open .gf-card-head-sticky {
  position: sticky;
  top: 0;
  z-index: 12;
  padding-bottom: 0.75rem;
  border-top-left-radius: calc(var(--radius) - 1px);
  border-top-right-radius: calc(var(--radius) - 1px);
  background: hsl(220 20% 10% / 0.96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid hsl(220 14% 18%);
}

/* Open + badge: keep base top padding (closed already looks right); badge sits in margin overhang */
.route-card.is-open:has(.route-card-badge) .gf-card-head-sticky {
  padding-top: calc(1.125rem + var(--card-badge-overhang) * 0.35);
}

.route-card.is-best-cost {
  border-color: hsl(199 89% 42% / 0.55);
}

.gf-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: visible;
  border-radius: inherit;
}

.gf-card-head-sticky {
  display: flex;
  flex-direction: column;
  padding: 1.125rem 1.25rem 0;
}

.gf-card-head-meta {
  padding: 0.625rem 1.25rem 0.75rem;
  cursor: pointer;
}

.gf-card-header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.gf-route-notes {
  margin-top: 0.625rem;
  margin-bottom: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}

.gf-card-summary {
  flex: 1;
  min-width: 0;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.gf-price-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem 0.875rem;
  flex-wrap: wrap;
}

.gf-route-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--foreground);
  letter-spacing: -0.015em;
}

.gf-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 0.375rem;
}

.gf-tag-optimal {
  background: hsl(199 89% 48%);
  color: hsl(224 71% 4%);
}

.gf-price {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--foreground);
}

.gf-price-net {
  font-size: 0.8125rem;
  font-weight: 500;
  color: hsl(199 70% 58%);
  margin-top: 0.2rem;
  line-height: 1.3;
}

.gf-price-alt {
  font-size: 0.875rem;
  font-weight: 600;
  color: hsl(38 92% 50%);
  line-height: 1.2;
  white-space: nowrap;
}

/** Google reference fare — same scale as main price, muted (not bag orange). */
.gf-price-google {
  font-size: 2rem;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.gf-price-alt--sub {
  font-size: 0.8125rem;
  font-weight: 500;
  margin-top: 0.1rem;
}

.gf-price-block {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gf-price-block .gf-price-row-inline {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.gf-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.625rem;
}

.gf-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: hsl(215 20% 72%);
  background: hsl(220 16% 16%);
  border: 1px solid hsl(220 14% 22%);
  border-radius: 9999px;
}

.gf-pill-warn {
  color: hsl(0 75% 72%);
  background: hsl(0 55% 14%);
  border-color: hsl(0 50% 28%);
}

.gf-pill-plus {
  color: hsl(142 65% 68%);
  background: hsl(142 40% 12%);
  border-color: hsl(142 35% 26%);
}

.gf-pill-story {
  color: hsl(262 75% 88%);
  background: hsl(262 48% 22%);
  border-color: hsl(262 40% 36%);
  font-weight: 600;
}

.gf-pill-highlight {
  color: hsl(199 75% 72%);
  background: hsl(199 45% 16%);
  border-color: hsl(199 40% 30%);
  font-weight: 500;
}

.gf-card-toolbar {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  flex-shrink: 0;
}

.gf-card-toolbar .gf-book-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  height: 2rem;
  min-height: 2rem;
  padding: 0 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  line-height: 1;
  border-radius: calc(var(--radius) - 2px);
  box-sizing: border-box;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.gf-icon-btn,
.gf-chevron {
  display: none;
}

/* Leg rows */
.gf-legs {
  cursor: pointer;
  padding: 0 0.75rem 0.875rem;
}

.gf-leg {
  display: grid;
  grid-template-columns: auto minmax(4.25rem, 0.55fr) minmax(20rem, 4fr) minmax(4.25rem, 0.55fr);
  align-items: center;
  gap: 0.625rem 0.875rem;
  padding: 0.75rem 0.5rem;
  border-radius: calc(var(--radius) - 2px);
  transition: background 0.12s;
}

.gf-legs:hover .gf-leg {
  background: hsl(220 16% 13% / 0.6);
}

.gf-leg-divider {
  height: 1px;
  margin: 0.375rem 0.5rem;
  background: hsl(220 14% 18%);
}

.gf-airline-logos {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  align-self: start;
  margin-top: 0.2rem;
}

.gf-airline-logos .gf-airline-logo {
  position: relative;
  z-index: 1;
  margin-top: 0;
  transition: z-index 0s;
}

.gf-airline-logos .gf-airline-logo + .gf-airline-logo {
  margin-top: -0.625rem;
}

.gf-airline-logos .gf-airline-logo:hover {
  z-index: 2;
}

.gf-airline-logo {
  width: 2rem;
  height: 2rem;
  border-radius: calc(var(--radius) - 2px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  flex-shrink: 0;
  align-self: start;
  margin-top: 0.2rem;
  box-shadow: 0 0 0 2px var(--airline-logo-halo);
}

.gf-open-leg-panel .gf-airline-logo {
  --airline-logo-halo: hsl(220 16% 11%);
}

.gf-airline-logo--svg {
  background: hsl(220 20% 14%);
  border: 1px solid hsl(220 14% 22%);
  padding: 0.25rem;
  overflow: hidden;
}

.gf-airline-logo--svg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.gf-airline-train svg {
  width: 1.125rem;
  height: 1.125rem;
}

.gf-leg-end {
  min-width: 0;
}

.gf-leg-time {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--foreground);
}

.gf-leg-city {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
  margin-top: 0.125rem;
}

.gf-leg-date {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 0.125rem;
}

.gf-leg-arrive {
  text-align: right;
}

.gf-leg-mid {
  min-width: 0;
  padding: 0 0.25rem;
  cursor: default;
  overflow: visible;
}

.gf-leg-meta {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-align: center;
  margin-bottom: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gf-timeline-v2 {
  width: 100%;
  min-width: 18rem;
  padding-top: 0.125rem;
}

.gf-track-grid {
  display: grid;
  grid-template-rows: auto auto;
  column-gap: 0.25rem;
  row-gap: 0.3rem;
  width: 100%;
  align-items: center;
}

.gf-track-cell {
  min-width: 0;
}

.gf-track-bar-cell {
  align-self: end;
}

.gf-track-node-cell {
  align-self: start;
}

.gf-track-node-start {
  justify-self: start;
}

.gf-track-node-center {
  justify-self: center;
}

.gf-track-node-end {
  justify-self: end;
}

.gf-track-grid .gf-node {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: hsl(199 89% 58%);
  letter-spacing: 0.04em;
  line-height: 1;
  white-space: nowrap;
}

.gf-track-grid .gf-node-layover {
  color: hsl(215 16% 52%);
}

.gf-bar-part {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  min-width: 1.5rem;
  padding: 0;
  outline: none;
  width: 100%;
}

.gf-bar-plane,
.gf-bar-train {
  display: flex;
  color: hsl(210 20% 78%);
  line-height: 0;
}

.gf-bar-icon-spacer {
  display: flex;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.gf-bar-line-wrap {
  position: relative;
  display: block;
  width: 100%;
}

.gf-bar-line {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: hsl(210 20% 82%);
  transition: background 0.12s;
}

.gf-bar-layover .gf-bar-line {
  background: hsl(215 12% 38%);
}

.gf-bar-part:hover .gf-bar-line,
.gf-bar-part:focus-visible .gf-bar-line {
  background: hsl(24 92% 54%);
}

.gf-bar-line-wrap .gf-bar-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  padding: 0.45rem 0.65rem;
  font-size: 0.6875rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--foreground);
  background: hsl(220 18% 18%);
  border: 1px solid hsl(220 14% 28%);
  border-radius: 0.375rem;
  box-shadow: 0 4px 16px hsl(224 71% 4% / 0.45);
  white-space: nowrap;
  max-width: 16rem;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  transition: opacity 0.12s;
}

.gf-bar-line-wrap .gf-bar-tip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: hsl(220 18% 18%);
}

.gf-bar-part:hover .gf-bar-tip,
.gf-bar-part:focus-visible .gf-bar-tip {
  opacity: 1;
}

.gf-track-nodes {
  display: none;
}

.gf-timeline-empty {
  text-align: center;
  color: var(--muted-foreground);
  font-size: 0.75rem;
  padding: 0.25rem 0;
}

.gf-leg-actions,
.gf-leg-book,
.gf-pin-btn,
.gf-timeline,
.gf-track,
.gf-track-integrated,
.gf-track-seg,
.gf-track-plane,
.gf-codes,
.gf-code {
  display: none;
}

.gf-leg-empty {
  padding: 1rem;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

@media (max-width: 768px) {
  .app {
    grid-template-columns: 1fr;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
  }

  .header h1 {
    font-size: 1.375rem;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }

  .summary-bar {
    grid-template-columns: 1fr;
  }

  .summary-stat {
    padding: 0.75rem 0.875rem;
  }

  .summary-value {
    font-size: 0.9375rem;
  }

  .sort-controls.filters-sort {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .sort-controls.filters-sort .sort-btn {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    justify-content: center;
  }

  .route-card.is-open .gf-card-head-sticky {
    padding-bottom: 0.625rem;
  }

  .gf-card-head-sticky {
    padding: 1rem 1rem 0;
  }

  .route-card.is-open:has(.route-card-badge) .gf-card-head-sticky {
    padding-top: calc(1rem + var(--card-badge-overhang) * 0.35);
  }

  .gf-card-head-meta {
    padding: 0.625rem 1rem 0.625rem;
  }

  .gf-card-header-top {
    flex-direction: column;
    gap: 0.75rem;
  }

  .route-actions-header {
    width: 100%;
    flex-wrap: wrap;
  }

  .route-actions-header .btn {
    flex: 1 1 calc(50% - 0.125rem);
    justify-content: center;
    min-width: 0;
  }

  .route-actions-header .btn-icon {
    flex: 0 0 auto;
  }

  .gf-pills {
    gap: 0.375rem;
  }

  .gf-pill {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
  }

  .gf-leg {
    grid-template-columns: auto 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .gf-leg-mid {
    grid-column: 1 / -1;
    order: 3;
    padding-top: 0.5rem;
  }

  .gf-leg-arrive {
    text-align: right;
  }

  .gf-price {
    font-size: 1.625rem;
  }

  .gf-price-google {
    font-size: 1.625rem;
  }

  .gf-route-title {
    font-size: 1rem;
  }

  .route-body {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .toast-container {
    left: 1rem;
    right: 1rem;
    bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  .toast {
    max-width: none;
  }
}

/* Legacy badge styles (summary bar etc.) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  font-size: 0.6875rem;
  font-weight: 500;
  border-radius: 9999px;
  background: var(--secondary);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.badge.best {
  background: hsl(142 71% 15%);
  color: hsl(142 71% 55%);
  border-color: hsl(142 71% 30%);
}

.badge.luggage-yes {
  color: hsl(199 89% 60%);
}

.badge.luggage-no {
  color: hsl(38 92% 60%);
}

.route-stats {
  display: none;
}

.route-stat {
  min-width: 70px;
}

.route-stat.duration-stat {
  min-width: 120px;
  max-width: 160px;
}

.route-stat-label {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.route-stat-value {
  font-size: 0.9375rem;
  font-weight: 600;
}

.route-stat-value.cost {
  color: var(--success);
}

.duration-layover {
  display: block;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-top: 0.125rem;
}

.section-duration .duration-layover {
  display: inline;
  font-size: 0.75rem;
  margin-top: 0;
  margin-left: 0.25rem;
}

.route-actions-header {
  display: flex;
  gap: 0.25rem;
  flex-shrink: 0;
}

.route-body {
  display: none;
  padding: 0 1.25rem 1.25rem;
}

.route-card.is-open .route-body {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding-top: 0.25rem;
}

.route-card.is-open .gf-legs {
  display: none;
}

/* Date variation swiper */
.date-variations-panel {
  margin: 0 -0.25rem;
  padding-bottom: 0.25rem;
}

.date-variations-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.75rem;
  margin-bottom: 0.75rem;
}

.date-variations-title {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.date-variations-hint {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  opacity: 0.85;
}

.date-variations-swiper {
  overflow: hidden;
  margin: 0 -0.25rem;
  padding: 0.25rem 0.25rem 0.5rem;
}

.date-variations-swiper .swiper-slide {
  width: auto;
  height: auto;
}

.date-variation-card {
  position: relative;
  width: 9.5rem;
  min-height: 6.5rem;
  padding: 0.65rem 0.75rem 0.7rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--border);
  background: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.date-variation-card.is-current {
  border-color: hsl(199 89% 48% / 0.65);
  box-shadow: 0 0 0 1px hsl(199 89% 48% / 0.25);
  background: hsl(199 89% 48% / 0.08);
}

.date-variation-card.is-cheapest {
  border-color: hsl(142 71% 45% / 0.45);
}

.dvc-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.45rem;
  font-size: 0.625rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: hsl(199 89% 58%);
  line-height: 1;
}

.dvc-badge--best {
  color: hsl(142 71% 50%);
}

.dvc-dates {
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.25;
  padding-right: 2.5rem;
}

.dvc-trip {
  font-size: 0.6875rem;
  color: var(--muted-foreground);
}

.dvc-price {
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.15rem;
}

.dvc-delta {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
}

.dvc-delta--up {
  color: hsl(38 92% 60%);
}

.dvc-delta--down {
  color: hsl(142 71% 50%);
}

.route-meta {
  display: none;
}

/* Checkbox */
.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.checkbox-wrap input[type="checkbox"] {
  appearance: none;
  width: 1rem;
  height: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  background: var(--input);
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.checkbox-wrap input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-wrap input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 0px;
  width: 5px;
  height: 9px;
  border: solid var(--primary-foreground);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.route-notes {
  width: 100%;
  margin-top: 0.75rem;
  padding: 0.875rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--foreground);
  background: hsl(215 28% 17% / 0.5);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.flight-details {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 0;
  padding: 0;
}

.flight-detail {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  margin: 0;
}

.flight-detail-wide {
  grid-column: span 2;
}

.flight-detail dt {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.flight-detail dd {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
}

.flight-detail dd.flight-cost {
  color: var(--success);
  font-weight: 600;
}

.empty-leg {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  margin: 0;
}

.sort-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  flex-shrink: 0;
}

.sidebar-column,
.map-column {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  gap: var(--layout-gap);
  min-width: 0;
  position: sticky;
  top: var(--layout-gap);
  align-self: start;
}

.filters-fab,
.filters-backdrop {
  display: none;
}

@media (max-width: 1100px) {
  .app {
    grid-template-columns: 1fr;
    padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  }

  .sidebar-column,
  .map-column {
    display: contents;
  }

  .map-panel {
    display: none !important;
  }

  .filters-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    margin: 0;
    max-height: min(88vh, 100dvh);
    overflow-y: auto;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
    padding-bottom: calc(var(--layout-gap) + env(safe-area-inset-bottom, 0px));
    transform: translateY(100%);
    visibility: hidden;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), visibility 0.28s;
    box-shadow: 0 -12px 40px hsl(0 0% 0% / 0.45);
  }

  body.filters-drawer-open .filters-panel {
    transform: translateY(0);
    visibility: visible;
  }

  .filters-close-btn {
    display: inline-flex;
  }

  .filters-fab {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: fixed;
    right: 1rem;
    bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
    z-index: 250;
    padding: 0.75rem 1.125rem;
    border: 1px solid hsl(199 89% 42% / 0.45);
    border-radius: 9999px;
    background: hsl(199 89% 48%);
    color: hsl(224 71% 4%);
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px hsl(199 89% 20% / 0.45), 0 2px 8px hsl(0 0% 0% / 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
  }

  .filters-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 28px hsl(199 89% 20% / 0.5), 0 4px 12px hsl(0 0% 0% / 0.35);
  }

  .filters-fab:active {
    transform: translateY(0);
  }

  .filters-fab-badge {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: hsl(38 92% 55%);
    border: 2px solid hsl(199 89% 48%);
  }

  .filters-fab-badge:not([hidden]) {
    display: block;
  }

  .filters-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 290;
    background: hsl(224 71% 4% / 0.72);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s, visibility 0.25s;
  }

  body.filters-drawer-open .filters-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  body.filters-drawer-open {
    overflow: hidden;
  }

  .summary-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }

  .summary-stats-main {
    display: contents;
  }

  .summary-stat--sidebar {
    grid-column: auto;
  }

  .filters-panel {
    padding: 1.25rem 1.25rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }

  .filters-panel-header {
    margin-bottom: 1.25rem;
  }

  .filters-heading {
    font-size: 1.125rem;
  }

  .filters-close-btn {
    min-width: 3rem;
    min-height: 3rem;
    padding: 0.625rem;
  }

  .filter-option {
    min-height: 3rem;
    padding: 0.625rem 0;
    gap: 0.75rem;
    font-size: 1rem;
  }

  .filter-option input[type="checkbox"] {
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 0.375rem;
  }

  .filter-option input[type="checkbox"]::before {
    width: 0.5625rem;
    height: 0.375rem;
  }

  .filter-hint {
    padding-left: 2.125rem;
    font-size: 0.8125rem;
  }

  .filter-label,
  .layover-range-readout {
    font-size: 0.9375rem;
  }

  .dual-range-slider {
    height: 2.75rem;
    margin-top: 0.5rem;
  }

  .dual-range-slider input[type="range"] {
    height: 2.75rem;
  }

  .dual-range-slider input[type="range"]::-webkit-slider-thumb {
    width: 1.5rem;
    height: 1.5rem;
    margin-top: -0.625rem;
  }

  .dual-range-slider input[type="range"]::-moz-range-thumb {
    width: 1.5rem;
    height: 1.5rem;
  }

  .sort-controls.filters-sort {
    flex-direction: column;
    align-items: stretch;
    gap: 0.625rem;
    padding-top: 1.25rem;
  }

  .sort-controls.filters-sort .sort-label {
    font-size: 0.9375rem;
    margin-bottom: 0.125rem;
  }

  .sort-controls.filters-sort .sort-btn {
    flex: 1 1 auto;
    width: 100%;
    min-height: 3rem;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    justify-content: center;
  }

  .filters-fab {
    min-height: 3.25rem;
    padding: 0.875rem 1.375rem;
    font-size: 1rem;
  }

  .filters-fab svg {
    width: 1.375rem;
    height: 1.375rem;
  }
}

.sort-controls.routes-sort {
  padding: 0;
}

.map-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
}

.map-header h2 {
  font-size: 0.875rem;
  font-weight: 600;
}

.sort-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.sort-btn.is-active,
.filter-btn.is-active {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.sort-btn.is-active:hover:not(:disabled),
.filter-btn.is-active:hover:not(:disabled) {
  background: hsl(210 40% 88%);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.filters-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--layout-gap);
  flex-shrink: 0;
}

.filters-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: var(--layout-gap);
}

.filters-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem 0.625rem;
  min-width: 0;
}

.filters-routes-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.filters-heading {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0;
}

.filters-close-btn {
  display: none;
  flex-shrink: 0;
}

.filters-list {
  list-style: none;
  margin: 0 0 var(--layout-gap);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--layout-gap);
}

.filter-item {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.filter-option input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  border: 1px solid hsl(220 14% 28%);
  border-radius: 0.3rem;
  background: hsl(220 20% 10%);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.filter-option input[type="checkbox"]::before {
  content: '';
  width: 0.5rem;
  height: 0.3125rem;
  border: 2px solid transparent;
  border-bottom-color: hsl(224 71% 4%);
  border-left-color: hsl(224 71% 4%);
  transform: rotate(-45deg) scale(0);
  transform-origin: center;
  transition: transform 0.12s ease;
  margin-top: -0.125rem;
}

.filter-option input[type="checkbox"]:checked {
  background: hsl(199 89% 48%);
  border-color: hsl(199 89% 48%);
}

.filter-option input[type="checkbox"]:checked::before {
  transform: rotate(-45deg) scale(1);
}

.filter-option input[type="checkbox"]:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px hsl(199 89% 48% / 0.35);
}

.filter-hint {
  margin: 0;
  padding-left: 1.625rem;
  font-size: 0.6875rem;
  color: var(--muted-foreground);
  line-height: 1.4;
}

.filter-label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.layover-range-readout {
  font-size: 0.8125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dual-range-slider {
  position: relative;
  height: 2rem;
  margin-top: 0.25rem;
  padding: 0 0.125rem;
}

.dual-range-slider::before {
  content: '';
  position: absolute;
  left: 0.125rem;
  right: 0.125rem;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  background: var(--border);
  border-radius: 2px;
  pointer-events: none;
  z-index: 0;
}

.dual-range-fill {
  position: absolute;
  top: 50%;
  height: 4px;
  transform: translateY(-50%);
  background: hsl(199 89% 48%);
  border-radius: 2px;
  pointer-events: none;
  z-index: 1;
}

.dual-range-slider input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  width: 100%;
  height: 2rem;
  margin: 0;
  padding: 0;
  background: transparent;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
  z-index: 2;
}

.dual-range-slider input[type="range"]::-webkit-slider-runnable-track {
  height: 4px;
  background: transparent;
  border: none;
}

.dual-range-slider input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: hsl(199 89% 48%);
  border: 2px solid var(--card);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.4);
  margin-top: -6px;
  pointer-events: auto;
  cursor: grab;
  position: relative;
  z-index: 2;
}

.dual-range-slider input[type="range"]::-moz-range-track {
  height: 4px;
  background: transparent;
  border: none;
}

.dual-range-slider input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: hsl(199 89% 48%);
  border: 2px solid var(--card);
  box-shadow: 0 1px 4px rgb(0 0 0 / 0.4);
  pointer-events: auto;
  cursor: grab;
}

.dual-range-slider input[type="range"]:first-of-type {
  z-index: 3;
}

.dual-range-slider input[type="range"]:last-of-type {
  z-index: 2;
}

.sort-controls.filters-sort {
  padding: var(--layout-gap) 0 0;
  border-top: 1px solid var(--border);
  justify-content: flex-start;
  flex-wrap: wrap;
}

.map-footer {
  padding: 0.5rem 1rem 0.75rem;
  border-top: 1px solid var(--border);
  font-size: 0.6875rem;
  line-height: 1.45;
  color: var(--muted-foreground);
}

.map-footer strong {
  color: var(--foreground);
  font-weight: 600;
}

.map-footer-detail {
  opacity: 0.85;
}

.map-footer:empty {
  display: none;
  padding: 0;
  border: none;
}

.routes-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--layout-gap);
  flex-wrap: wrap;
  padding: 0.5rem 0.25rem;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Form fields */
.field-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.625rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field label {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 500;
}

.field input,
.field select {
  background: var(--input);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  color: var(--foreground);
  padding: 0.4375rem 0.625rem;
  font-size: 0.8125rem;
  font-family: inherit;
  width: 100%;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--ring);
  box-shadow: 0 0 0 2px hsl(212 26% 83% / 0.15);
}

.field input::placeholder {
  color: hsl(215 20% 45%);
}

.field-wide {
  grid-column: span 2;
}

@media (max-width: 600px) {
  .field-wide {
    grid-column: span 1;
  }
}

/* Open leg — Google Flights detail layout */
.gf-open-leg {
  margin: 0;
}

.gf-open-leg + .gf-open-leg {
  padding-top: 1.25rem;
  border-top: 1px solid hsl(220 14% 20%);
}

.gf-open-leg-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}

.gf-open-leg-heading {
  min-width: 0;
}

.gf-open-leg-title {
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--foreground);
  margin: 0;
}

.gf-open-leg-duration {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.gf-open-leg-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin-top: 0.125rem;
}

.gf-open-leg-cost {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--success);
}

.gf-open-leg-panel {
  background: hsl(220 16% 11%);
  border: 1px solid hsl(220 14% 16%);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.gf-open-empty {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.gf-segment {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  isolation: isolate;
}

.gf-segment.is-map-highlight::before {
  content: '';
  position: absolute;
  inset: -0.5rem;
  background: hsl(199 89% 48% / 0.08);
  border: 1px solid hsl(199 89% 48% / 0.18);
  border-radius: calc(var(--radius) - 2px);
  pointer-events: none;
  z-index: -1;
}

.gf-segment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.gf-segment-airline {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-width: 0;
}

.gf-segment-airline-text {
  min-width: 0;
}

.gf-segment-airline-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--foreground);
}

.gf-segment-flight-duration {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.gf-segment-subrow {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 0.75rem;
  margin-top: 0.125rem;
}

.gf-learn-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 0.4375rem 0.875rem;
  font-size: 0.8125rem;
  font-weight: 500;
  font-family: inherit;
  color: var(--foreground);
  background: hsl(220 14% 16%);
  border: 1px solid hsl(220 14% 20%);
  border-radius: 9999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.gf-learn-more:hover {
  background: hsl(220 14% 20%);
  border-color: hsl(220 14% 26%);
  text-decoration: none;
}

.gf-segment-timeline {
  display: grid;
  grid-template-columns: 1.125rem 1fr;
  gap: 0 1rem;
  align-items: stretch;
}

.gf-timeline-rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.35rem 0;
}

.gf-timeline-dot {
  width: 0.625rem;
  height: 0.625rem;
  border-radius: 50%;
  border: 2px solid hsl(215 16% 46%);
  background: transparent;
  flex-shrink: 0;
}

.gf-timeline-connector {
  flex: 1;
  width: 2px;
  min-height: 3.5rem;
  background: hsl(215 16% 32%);
  margin: 0.25rem 0;
}

.gf-timeline-events {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2rem;
  min-height: 100%;
}

.gf-timeline-event {
  display: grid;
  grid-template-columns: minmax(88px, auto) 1fr;
  gap: 1rem 1.25rem;
  align-items: start;
}

.gf-timeline-when {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.gf-segment-time {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--foreground);
}

.gf-segment-date {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.gf-timeline-where {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  text-align: left;
}

.gf-segment-city {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--foreground);
}

.gf-segment-airport {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  line-height: 1.35;
}

.gf-segment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding-top: 0.125rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.gf-segment-cost {
  font-size: 0.8125rem;
  color: hsl(152 55% 48%);
  font-weight: 600;
}

.gf-layover-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  background: hsl(220 16% 8%);
  border-radius: 0.625rem;
}

.gf-layover-icon {
  flex-shrink: 0;
  color: var(--muted-foreground);
}

.gf-layover-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.gf-layover-duration {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 0.125rem;
}

@media (max-width: 640px) {
  .gf-timeline-event {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .gf-open-leg-header {
    flex-direction: column;
    align-items: stretch;
  }

  .gf-learn-more {
    align-self: flex-start;
  }
}

/* Legacy flight section (unused in open state) */
.flight-section {
  margin-bottom: 0;
}

.section-header,
.section-title,
.section-dot,
.section-duration {
  display: none;
}

.flight-row {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 0;
}

.flight-row-header,
.flight-details,
.layover-row-header,
.layover-badge {
  display: none;
}

.layover-row {
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
}

.empty-leg {
  color: var(--muted-foreground);
  font-size: 0.8125rem;
  margin: 0;
}

.gf-card-toolbar .booking-link {
  height: 2rem;
  min-height: 2rem;
  padding: 0 0.875rem;
  font-size: 0.8125rem;
  line-height: 1;
  box-sizing: border-box;
}

.booking-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--outbound);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.35rem 0.625rem;
  border-radius: calc(var(--radius) - 2px);
  border: 1px solid hsl(199 89% 48% / 0.35);
  background: hsl(199 89% 48% / 0.08);
  transition: background 0.15s, border-color 0.15s;
  cursor: pointer;
}

.booking-link-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.booking-link:hover {
  background: hsl(199 89% 48% / 0.18);
  border-color: hsl(199 89% 48% / 0.55);
  text-decoration: none;
}

.booking-link:hover .booking-link-icon {
  transform: translate(1px, -1px);
  transition: transform 0.15s;
}

.booking-link-compact {
  font-size: 0.6875rem;
  padding: 0.125rem 0.375rem;
}

.booking-link-route {
  font-size: 0.8125rem;
}

.booking-link-leg {
  font-size: 0.6875rem;
  margin-left: 0.25rem;
  vertical-align: middle;
}

.route-booking-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}

.route-preview-links {
  margin-top: 0.25rem;
}

/* Layover segment row */
.layover-row {
  background: hsl(220 16% 11%);
  border: 1px dashed hsl(220 14% 26%);
  border-radius: var(--radius);
  padding: 0.75rem 0.875rem;
  margin-bottom: 0.5rem;
}

.layover-row-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.layover-row .flight-index {
  color: hsl(215 16% 52%);
}

.layover-badge {
  display: none;
}

/* Map panel */
.map-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.map-hint {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

#map {
  height: 420px;
  width: 100%;
  background: hsl(224 71% 8%);
}

.map-legend {
  padding: 0.625rem 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.legend-line {
  width: 20px;
  height: 3px;
  border-radius: 2px;
}

.legend-line.outbound {
  background: var(--outbound);
}

.legend-line.inbound {
  background: var(--inbound);
}

/* Leaflet dark overrides */
.leaflet-container {
  background: hsl(224 71% 8%);
  font-family: inherit;
}

.leaflet-popup-content-wrapper {
  background: var(--card);
  color: var(--foreground);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.leaflet-popup-tip {
  background: var(--card);
}

.leaflet-bar a {
  background: var(--card) !important;
  color: var(--foreground) !important;
  border-color: var(--border) !important;
}

.leaflet-bar a:hover {
  background: var(--accent) !important;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  box-shadow: 0 8px 24px hsl(0 0% 0% / 0.4);
  animation: slideIn 0.25s ease;
  max-width: 320px;
}

.toast.success {
  border-color: hsl(142 71% 35%);
}

.toast.error {
  border-color: hsl(0 62% 40%);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: hsl(216 34% 25%);
}
