.flight-route-builder,
.booking-route-map {
  --route-surface: color-mix(in srgb, var(--bg-panel) 88%, transparent);
  --route-raised: color-mix(in srgb, var(--bg-elevated) 84%, transparent);
  --route-line: color-mix(in srgb, var(--border-light) 78%, transparent);
  --route-shadow: 0 18px 34px color-mix(in srgb, var(--shadow-primary) 14%, transparent);
  --route-accent-soft: color-mix(in srgb, var(--accent-primary) 12%, transparent);
  --route-map-ocean-fill: #dbeaf6;
  --route-map-pin-fill: #101820;
  --route-map-pin-hole: #ffffff;
  --route-map-pin-badge-bg: #101820;
  --route-map-pin-badge-text: #ffffff;
  display: grid;
  gap: 1rem;
}

.flight-route-builder__header,
.booking-route-map__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.flight-route-builder__eyebrow,
.booking-route-map__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-tertiary);
}

.flight-route-builder__header h3,
.booking-route-map__header h3 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
  color: var(--text-primary);
}

.flight-route-builder__header p,
.booking-route-map__header p {
  margin: 0.4rem 0 0;
  max-width: 60ch;
  color: var(--text-secondary);
  line-height: 1.6;
}

.flight-route-builder__toolbar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.flight-route-builder__stats,
.booking-route-map__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.flight-route-builder__stats span,
.booking-route-map__summary span {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 2.2rem;
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--route-line);
  background: var(--route-raised);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-white) 10%, transparent);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
}

.flight-route-builder__map-shell,
.booking-route-map__map-shell {
  display: grid;
  gap: 0.8rem;
}

.flight-route-builder__map,
.booking-route-map__map {
  min-height: 420px;
  border-radius: 24px;
  border: 1px solid var(--route-line);
  background: var(--route-map-ocean-fill);
  overflow: hidden;
  box-shadow: var(--route-shadow);
}

.booking-route-map__map {
  min-height: 340px;
}

.flight-route-builder__status {
  min-height: 1.4rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

.flight-route-builder__pins-shell,
.booking-route-map__pins-shell {
  display: grid;
  gap: 0.8rem;
  padding: 1rem 1.05rem;
  border-radius: 22px;
  border: 1px solid var(--route-line);
  background: color-mix(in srgb, var(--route-surface) 92%, transparent);
  box-shadow: var(--route-shadow);
}

.flight-route-builder__pins-head,
.booking-route-map__pins-head {
  display: grid;
  gap: 0.22rem;
}

.flight-route-builder__pins-head strong,
.booking-route-map__pins-head strong {
  color: var(--text-primary);
  font-size: 0.96rem;
}

.flight-route-builder__pins-head span,
.booking-route-map__pins-head span {
  color: var(--text-secondary);
  font-size: 0.86rem;
  line-height: 1.5;
}

.flight-route-builder__empty,
.booking-route-map__empty {
  margin: 0;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px dashed color-mix(in srgb, var(--accent-primary) 22%, var(--route-line) 78%);
  background: var(--route-accent-soft);
  color: var(--text-secondary);
  line-height: 1.6;
}

.flight-route-builder__pins,
.booking-route-map__pins {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.flight-route-builder__pin,
.booking-route-map__pin {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 0.9rem;
  border-radius: 18px;
  border: 1px solid var(--route-line);
  background: var(--route-raised);
}

.booking-route-map__pin {
  grid-template-columns: auto minmax(0, 1fr);
}

.flight-route-builder__pin-order,
.booking-route-map__pin-order {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
  color: var(--text-white);
  font-size: 0.82rem;
  font-weight: 800;
  box-shadow: 0 12px 22px color-mix(in srgb, var(--shadow-secondary) 28%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

button.flight-route-builder__pin-order {
  appearance: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

button.flight-route-builder__pin-order:hover,
button.flight-route-builder__pin-order:focus-visible {
  transform: translateY(-1px);
  filter: brightness(1.03);
  outline: none;
  box-shadow:
    0 12px 22px color-mix(in srgb, var(--shadow-secondary) 28%, transparent),
    0 0 0 3px color-mix(in srgb, var(--accent-primary) 18%, transparent);
}

button.flight-route-builder__pin-order:active {
  transform: translateY(0);
}

.flight-route-builder__pin-main,
.booking-route-map__pin-main {
  min-width: 0;
  display: grid;
  gap: 0.24rem;
}

.flight-route-builder__pin-input {
  width: 100%;
  min-height: 2.7rem;
  padding: 0.7rem 0.85rem;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 16%, var(--route-line) 84%);
  background: color-mix(in srgb, var(--bg-input) 92%, transparent);
  color: var(--text-primary);
  font: inherit;
}

.flight-route-builder__pin-input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--accent-primary) 42%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-primary) 16%, transparent);
}

.flight-route-builder__pin-name,
.booking-route-map__pin-name {
  font-weight: 700;
  color: var(--text-primary);
}

.flight-route-builder__pin-meta,
.booking-route-map__pin-meta {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.5;
}

.flight-route-builder__pin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.flight-route-map-btn {
  min-height: 2.3rem;
  padding: 0.55rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--route-line);
  background: color-mix(in srgb, var(--bg-input) 90%, transparent);
  color: var(--text-primary);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.flight-route-map-btn:hover,
.flight-route-map-btn:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent-primary) 32%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-input) 88%);
  outline: none;
}

.flight-route-map-btn[disabled] {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

.flight-route-map-btn--danger {
  color: var(--notify-error);
  border-color: color-mix(in srgb, var(--notify-error) 24%, var(--route-line) 76%);
}

.flight-route-marker {
  display: grid;
  justify-items: center;
  align-items: start;
  width: 38px;
  height: 54px;
  background: transparent;
  border: none;
}

.flight-route-marker.leaflet-div-icon {
  background: transparent;
  border: none;
}

.flight-route-marker__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.38rem;
  margin-bottom: -0.18rem;
  border-radius: 999px;
  background: var(--route-map-pin-badge-bg);
  color: var(--route-map-pin-badge-text);
  font-size: 0.73rem;
  font-weight: 800;
  line-height: 1;
  box-shadow:
    0 8px 18px color-mix(in srgb, var(--shadow-primary) 18%, transparent),
    0 0 0 3px color-mix(in srgb, var(--route-map-ocean-fill) 92%, transparent);
}

.flight-route-marker__icon {
  display: block;
  width: 32px;
  height: 44px;
  color: var(--route-map-pin-fill);
  filter: drop-shadow(0 10px 18px color-mix(in srgb, var(--shadow-primary) 20%, transparent));
}

.flight-route-marker__icon path {
  fill: currentColor;
  stroke: var(--route-map-pin-hole);
  stroke-width: 1.35;
  paint-order: stroke fill;
}

.flight-route-marker__icon circle {
  fill: var(--route-map-pin-hole);
}

.flight-route-popup {
  display: grid;
  gap: 0.2rem;
}

.flight-route-popup strong {
  color: var(--text-primary);
  font-size: 0.92rem;
}

.flight-route-popup span {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
}

body.flight-route-reset-modal-open {
  overflow: hidden;
}

.flight-route-reset-modal[hidden] {
  display: none;
}

.flight-route-reset-modal {
  position: fixed;
  inset: 0;
  z-index: 10020;
  display: grid;
  place-items: center;
  padding: clamp(1rem, 3.5vw, 2.25rem);
  background:
    radial-gradient(circle at top, color-mix(in srgb, var(--accent-primary) 12%, transparent) 0%, transparent 42%),
    color-mix(in srgb, var(--text-dark) 72%, transparent);
  backdrop-filter: blur(12px) saturate(1.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.flight-route-reset-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.flight-route-reset-modal__backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  cursor: pointer;
}

.flight-route-reset-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(640px, 100%);
  max-height: min(88vh, 760px);
  overflow: auto;
  display: grid;
  gap: 1rem;
  padding: clamp(1.35rem, 3.2vw, 2rem);
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--border-soft) 84%, transparent);
  background:
    radial-gradient(circle at top right, color-mix(in srgb, var(--accent-primary) 16%, transparent) 0%, transparent 34%),
    radial-gradient(circle at bottom left, color-mix(in srgb, var(--accent-secondary) 12%, transparent) 0%, transparent 28%),
    linear-gradient(145deg, color-mix(in srgb, var(--bg-panel) 98%, transparent) 0%, color-mix(in srgb, var(--bg-elevated) 88%, transparent) 100%);
  box-shadow: 0 40px 92px color-mix(in srgb, var(--shadow-primary) 34%, transparent);
  transform: translateY(16px) scale(0.98);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  isolation: isolate;
}

.flight-route-reset-modal.is-open .flight-route-reset-modal__dialog {
  transform: translateY(0) scale(1);
}

.flight-route-reset-modal__dialog::after {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--accent-primary), var(--accent-secondary), transparent);
  opacity: 0.8;
  pointer-events: none;
}

.flight-route-reset-modal__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid color-mix(in srgb, var(--border-soft) 80%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-input) 88%, transparent);
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: 0 12px 24px color-mix(in srgb, var(--shadow-primary) 16%, transparent);
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.flight-route-reset-modal__close:hover,
.flight-route-reset-modal__close:focus-visible {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent-primary) 34%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 12%, var(--bg-input) 88%);
  outline: none;
}

.flight-route-reset-modal__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.42rem 0.78rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent-primary) 32%, transparent);
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  color: var(--accent-primary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--text-white) 14%, transparent);
}

.flight-route-reset-modal__badge::before {
  content: "";
  width: 1.2rem;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}

.flight-route-reset-modal__header {
  display: grid;
  gap: 0.55rem;
  padding-right: 2.75rem;
}

.flight-route-reset-modal__title {
  margin: 0;
  color: var(--text-primary);
  font-size: clamp(1.45rem, 2.2vw, 1.9rem);
  line-height: 1.1;
}

.flight-route-reset-modal__message {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.97rem;
  line-height: 1.65;
}

.flight-route-reset-modal__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.flight-route-reset-modal__summary-item {
  display: grid;
  gap: 0.28rem;
  padding: 0.92rem 0.98rem;
  border-radius: 18px;
  border: 1px solid var(--route-line);
  background: color-mix(in srgb, var(--bg-panel) 92%, transparent);
}

.flight-route-reset-modal__summary-item span {
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.flight-route-reset-modal__summary-item strong {
  color: var(--text-primary);
  font-size: 0.96rem;
  line-height: 1.45;
}

.flight-route-reset-modal__note {
  margin: 0;
  padding: 0.88rem 0.96rem;
  border-radius: 16px;
  border: 1px dashed color-mix(in srgb, var(--accent-primary) 22%, var(--route-line) 78%);
  background: color-mix(in srgb, var(--accent-primary) 10%, transparent);
  color: var(--text-secondary);
  line-height: 1.55;
}

.flight-route-reset-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
}

.flight-route-reset-modal__button {
  min-width: 11.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.flight-route-reset-modal__button--ghost {
  background: color-mix(in srgb, var(--bg-input) 84%, transparent);
}

.flight-route-reset-modal__button--ghost:hover,
.flight-route-reset-modal__button--ghost:focus-visible {
  border-color: color-mix(in srgb, var(--accent-primary) 24%, transparent);
  background: color-mix(in srgb, var(--bg-input) 78%, var(--accent-primary) 10%);
}

.flight-route-reset-modal__button--danger {
  border-color: color-mix(in srgb, var(--notify-error) 36%, transparent);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--notify-error) 74%, var(--bg-input) 26%),
      color-mix(in srgb, var(--notify-error) 58%, var(--bg-input) 42%));
  color: var(--text-white);
  box-shadow: 0 16px 28px color-mix(in srgb, var(--notify-error) 24%, transparent);
}

.flight-route-reset-modal__button--danger:hover,
.flight-route-reset-modal__button--danger:focus-visible {
  border-color: color-mix(in srgb, var(--notify-error) 58%, transparent);
  background:
    linear-gradient(135deg,
      color-mix(in srgb, var(--notify-error) 82%, var(--bg-input) 18%),
      color-mix(in srgb, var(--notify-error) 66%, var(--bg-input) 34%));
}

.flight-route-builder .leaflet-control-zoom,
.booking-route-map .leaflet-control-zoom {
  border: none;
  box-shadow: 0 14px 30px color-mix(in srgb, var(--shadow-primary) 18%, transparent);
}

.flight-route-builder .leaflet-control-zoom a,
.booking-route-map .leaflet-control-zoom a {
  width: 36px;
  height: 36px;
  line-height: 34px;
  border: 1px solid var(--route-line);
  background: color-mix(in srgb, var(--bg-panel) 94%, transparent);
  color: var(--text-primary);
}

.flight-route-builder .leaflet-control-zoom a:hover,
.booking-route-map .leaflet-control-zoom a:hover {
  background: color-mix(in srgb, var(--accent-primary) 10%, var(--bg-panel) 90%);
  color: var(--accent-primary);
}

.flight-route-builder .leaflet-control-attribution,
.booking-route-map .leaflet-control-attribution {
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--route-line);
  border-radius: 12px 0 0 0;
  background: color-mix(in srgb, var(--bg-panel) 92%, transparent);
  color: var(--text-secondary);
  font-size: 0.68rem;
  line-height: 1.35;
  backdrop-filter: blur(10px);
}

.flight-route-builder .leaflet-control-attribution a,
.booking-route-map .leaflet-control-attribution a {
  color: var(--text-primary);
}

.flight-route-builder .leaflet-tile-pane,
.booking-route-map .leaflet-tile-pane {
  filter: saturate(1.04) contrast(1.02);
}

.flight-route-builder[data-theme-mode="light"] .leaflet-tile-pane,
.booking-route-map[data-theme-mode="light"] .leaflet-tile-pane {
  filter: saturate(1.12) contrast(1.06) brightness(1.01);
}

.flight-route-builder[data-theme-mode="dark"] .leaflet-tile-pane,
.booking-route-map[data-theme-mode="dark"] .leaflet-tile-pane {
  filter: saturate(0.96) contrast(1.08);
}

.flight-route-builder .leaflet-interactive,
.booking-route-map .leaflet-interactive {
  transition:
    fill 0.16s ease,
    fill-opacity 0.16s ease,
    stroke 0.16s ease,
    stroke-width 0.16s ease,
    opacity 0.16s ease;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.flight-route-builder .leaflet-popup-content-wrapper,
.booking-route-map .leaflet-popup-content-wrapper {
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg-panel) 96%, transparent);
  color: var(--text-primary);
  box-shadow: 0 18px 34px color-mix(in srgb, var(--shadow-primary) 18%, transparent);
}

.flight-route-builder .leaflet-popup-content,
.booking-route-map .leaflet-popup-content {
  margin: 0;
  padding: 0.85rem 0.95rem;
}

.flight-route-builder .leaflet-popup-tip,
.booking-route-map .leaflet-popup-tip {
  background: color-mix(in srgb, var(--bg-panel) 96%, transparent);
}

@media (max-width: 900px) {
  .flight-route-builder__pin,
  .booking-route-map__pin {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .flight-route-builder__pin-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .flight-route-builder__map,
  .booking-route-map__map {
    min-height: 320px;
    border-radius: 20px;
  }

  .flight-route-builder__pins-shell,
  .booking-route-map__pins-shell {
    padding: 0.9rem;
    border-radius: 18px;
  }

  .flight-route-reset-modal__dialog {
    width: min(560px, 100%);
    padding: 1.2rem;
    border-radius: 22px;
  }

  .flight-route-reset-modal__summary {
    grid-template-columns: 1fr;
  }

  .flight-route-reset-modal__button {
    min-width: 100%;
  }
}
