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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0f;
  color: #e0e0e0;
  overflow: hidden;
  height: 100vh;
}

#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header — single bar with all controls */
#header {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 10px 20px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  z-index: 1000;
  flex-shrink: 0;
}

#header-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

#mobile-controls-bar {
  display: none;
}

#mobile-map-btn {
  display: none;
}

#mobile-controls-panel {
  display: contents;
}

#mobile-controls-toggle {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  color: #1a1d23;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
}

#mobile-controls-toggle:hover {
  border-color: #999;
}

#header-filters-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding-top: 2px;
  flex-wrap: wrap;
}

#header-filters-row #cal-dest-filter {
  flex: 0 0 240px;
  width: 240px;
}

#filter-inputs-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

#header-filters-row #cal-max-price {
  flex: 0 0 96px;
  width: 96px;
}

#header-right {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}

/* Origin selector */
#origin-select-wrapper {
  width: 240px;
  flex: 0 0 240px;
}

#origin-select {
  width: 100%;
  padding: 8px 36px 8px 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #1a1d23;
  font-size: 13px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #6b7280 50%),
    linear-gradient(135deg, #6b7280 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 3px),
    calc(100% - 11px) calc(50% - 3px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

#origin-select:focus {
  border-color: #999;
}

#origin-select:disabled {
  color: #6b7280;
  cursor: wait;
}

.scrollable-select-native {
  display: none;
}

.scrollable-select {
  position: relative;
  width: 100%;
}

.scrollable-select-button {
  width: 100%;
  position: relative;
  padding: 10px 36px 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  color: #1a1d23;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  outline: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-sizing: border-box;
}

.scrollable-select-button::placeholder {
  color: #6b7280;
}

.scrollable-select-button::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #6b7280;
  border-bottom: 2px solid #6b7280;
  transform: translateY(-60%) rotate(45deg);
  pointer-events: none;
}

.scrollable-select-button:hover:not(:disabled),
.scrollable-select-button.is-open {
  border-color: #999;
}

.scrollable-select-button:disabled,
.scrollable-select-button.is-disabled {
  color: #6b7280;
  cursor: wait;
}

.scrollable-select-button.is-placeholder {
  color: #6b7280;
}

.scrollable-select-label {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#origin-select-wrapper .scrollable-select-button,
#add-favorite .scrollable-select-button {
  padding: 8px 36px 8px 12px;
  border-radius: 8px;
  background: #ffffff;
  font-size: 13px;
}

#scrollable-select-menu {
  position: fixed;
  z-index: 4200;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 16px 36px rgba(31, 55, 33, 0.18);
  overflow-y: auto;
  padding: 4px 0;
}

#scrollable-select-menu.hidden {
  display: none;
}

.scrollable-select-search {
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid #e5e7eb;
  font-size: 13px;
  outline: none;
  background: #fff;
  color: #1a1d23;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 1;
}

.scrollable-select-search:focus {
  border-bottom-color: #1a7a4c;
}

.scrollable-select-option {
  width: 100%;
  padding: 10px 12px;
  border: none;
  background: #fff;
  color: #1a1d23;
  text-align: left;
  font-size: 13px;
  cursor: pointer;
}

.scrollable-select-option:hover,
.scrollable-select-option.is-selected {
  background: #e8f5ee;
}

.scrollable-select-option.is-placeholder {
  color: #6b7280;
}

.specific-dest-loader {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 80px 0;
}

.specific-dest-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e5e7eb;
  border-top-color: #1a7a4c;
  border-radius: 50%;
  animation: specific-dest-spin 0.7s linear infinite;
}

@keyframes specific-dest-spin {
  to { transform: rotate(360deg); }
}

.scrollable-select-group-label {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.scrollable-select-divider {
  height: 1px;
  margin: 4px 0;
  background: #e8f5ee;
}

/* Airline filter */
#airline-filter-wrapper {
  position: relative;
}

#airline-filter-btn {
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #1a1d23;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

#airline-filter-btn:hover {
  border-color: #999;
}

#airline-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  min-width: 240px;
  max-height: 350px;
  overflow-y: auto;
  z-index: 2000;
  margin-top: 4px;
  padding: 6px 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#airline-dropdown.hidden {
  display: none;
}

#airline-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  cursor: pointer;
  font-size: 13px;
  color: #1a1d23;
}

#airline-list label:hover {
  background: #f0f0ea;
}

#airline-list input[type="checkbox"] {
  accent-color: #1a7a4c;
}


/* Map button */
#map-btn {
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #1a1d23;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

#map-btn:hover {
  border-color: #999;
}

#map-btn:disabled {
  color: #9ca3af;
  border-color: #e5e7eb;
  cursor: default;
}

/* Filters dropdown */
#filters-wrapper {
  position: relative;
}

#filters-btn {
  padding: 8px 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #1a1d23;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

#filters-btn:hover {
  border-color: #999;
}

#filters-btn.has-active {
  background: #1a7a4c;
  border-color: #1a7a4c;
  color: #fff;
}

#active-filters-badge {
  display: none !important;
}

#active-filters-badge.hidden {
  display: none;
}

#filters-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 6px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  z-index: 2000;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  min-width: 420px;
}

#filters-dropdown.hidden {
  display: none;
}

.filter-section {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0ea;
}

.filter-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-label {
  font-size: 13px;
  font-weight: 600;
  color: #1a1d23;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  cursor: pointer;
}

.filter-label input[type="checkbox"] {
  accent-color: #1a7a4c;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #666;
  margin-top: 6px;
}

.mode-row-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: #1a1d23;
}

.coming-soon-tag {
  display: inline-flex;
  align-items: center;
  background: #fff4d6;
  color: #8a6d1b;
  border: 1px solid #e6c87a;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
  white-space: nowrap;
}

.new-tag {
  display: inline-flex;
  align-items: center;
  background: #e8f5ee;
  color: #1a7a4c;
  border: 1px solid #a8d5b9;
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.4;
  white-space: nowrap;
}

.switch input[type="checkbox"]:disabled + .slider {
  opacity: 0.55;
  cursor: not-allowed;
}

.info-tip {
  position: relative;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ece9e3;
  color: #6d675d;
  font-size: 11px;
  font-weight: 700;
  cursor: help;
  user-select: none;
}

.info-tip::before,
.info-tip::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 2600;
}

.info-tip::before {
  content: '';
  top: calc(100% + 2px);
  transform: translateX(-50%) translateY(4px);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #f7fbf4;
  filter: drop-shadow(0 -1px 0 #d7e5d6);
}

.info-tip::after {
  content: attr(data-tooltip);
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: min(280px, calc(100vw - 40px));
  padding: 10px 12px;
  border: 1px solid #d7e5d6;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdf9 0%, #f3f8ef 100%);
  color: #244028;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 14px 28px rgba(35, 64, 40, 0.14);
}

.info-tip:hover,
.info-tip:focus {
  background: #dfeadf;
  color: #1a7a4c;
  outline: none;
}

.info-tip:hover::before,
.info-tip:hover::after,
.info-tip:focus::before,
.info-tip:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.filter-row input[type="number"] {
  width: 70px;
  padding: 6px 8px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 13px;
  background: #ffffff;
  color: #1a1d23;
  text-align: center;
  outline: none;
}

.filter-row input[type="number"]:focus {
  border-color: #999;
}

/* Price filter in header */
#cal-max-price {
  width: 96px;
  padding: 7px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: #1a1d23;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

#cal-max-price:focus {
  border-color: #999;
}

#cal-max-price::-webkit-outer-spin-button,
#cal-max-price::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#cal-max-trip-time {
  width: 120px;
  padding: 7px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: #1a1d23;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

#cal-max-trip-time:focus {
  border-color: #999;
}

#cal-max-trip-time.hidden {
  display: none;
}

#cal-max-layover {
  width: 130px;
  padding: 7px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: #1a1d23;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

#cal-max-layover:focus {
  border-color: #999;
}

#cal-max-layover.hidden {
  display: none;
}

/* Segment toggle (One Way / Round Trip) */
.segment-toggle {
  display: flex;
  background: #f0eeea;
  border-radius: 24px;
  padding: 3px;
  gap: 2px;
}

.segment-btn {
  padding: 6px 18px;
  border: none;
  border-radius: 22px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: #888;
  transition: all 0.2s;
}

.segment-btn.active {
  background: #1a7a4c;
  color: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

.segment-btn:hover:not(.active) {
  color: #1a1d23;
}

.segment-btn.is-disabled {
  opacity: 0.45;
  cursor: default;
}

.segment-btn.is-disabled:hover:not(.active) {
  color: #888;
}

/* Toggle switch */
.toggle-row {
  justify-content: space-between;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch input:disabled + .slider {
  opacity: 0.55;
  cursor: default;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 24px;
  transition: 0.2s;
}

.slider::before {
  content: '';
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: #1a7a4c;
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.daytrip-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
  font-size: 13px;
  color: #666;
  transition: opacity 0.2s;
}

.daytrip-inline.disabled {
  opacity: 0.35;
  pointer-events: none;
}

#daytrip-min-hours {
  width: 50px;
}

/* Day trip flight cards */
.cal-flight-pair {
  margin-bottom: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}

.cal-flight-pair .cal-flight {
  margin-bottom: 0;
  border-radius: 0;
}

.cal-flight-pair .cal-flight:first-child {
  border-radius: 8px 8px 0 0;
}

.cal-flight-pair .cal-flight:last-child {
  border-radius: 0 0 8px 8px;
}

.cal-layover {
  padding: 3px 10px;
  font-size: 11px;
  color: #888;
  background: #f0eee8;
  text-align: center;
}

.cal-pair-duration {
  padding: 2px 10px 0;
  font-size: 11px;
  color: #888;
  background: #f0eee8;
  text-align: right;
}

.cal-pair-total {
  padding: 2px 10px 4px;
  font-size: 12px;
  font-weight: 700;
  color: #1a7a4c;
  background: #f0eee8;
  text-align: right;
}

/* Specific destination select */
.scrollable-select[data-select-id="specific-dest-select"] {
  flex: 0 0 240px;
  width: 240px;
}

.scrollable-select[data-select-id="specific-dest-select"] .scrollable-select-button {
  padding: 8px 36px 8px 12px;
  border-radius: 8px;
}

#specific-dest-select.hidden,
.scrollable-select[data-select-id="specific-dest-select"].hidden {
  display: none;
}

#cal-dest-filter.hidden {
  display: none;
}

/* Settings button */
#settings-btn {
  padding: 0 12px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #1a1d23;
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  height: 33px;
}

#settings-btn:hover {
  border-color: #999;
}

#help-btn {
  padding: 0 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #1a1d23;
  cursor: pointer;
  height: 33px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#help-btn svg {
  width: 18px;
  height: 18px;
}

#help-btn:hover {
  border-color: #999;
}

/* Settings modal */
#settings-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
}

#settings-modal.hidden {
  display: none;
}

#settings-content {
  background: #fff;
  border-radius: 16px;
  width: 420px;
  max-height: 80vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
}

#settings-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
}

#settings-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
}

#settings-close:hover {
  color: #1a1d23;
}

#settings-body {
  padding: 20px;
  overflow-y: auto;
}

#settings-body h3 {
  font-size: 14px;
  font-weight: 700;
  color: #1a1d23;
  margin-bottom: 4px;
}

#help-modal {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
}

#help-modal.hidden {
  display: none;
}

#help-content {
  background: #fff;
  border-radius: 16px;
  width: 420px;
  max-height: 80vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

#help-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: #222;
}

#help-close {
  background: none;
  border: none;
  font-size: 20px;
  color: #999;
  cursor: pointer;
  padding: 4px 8px;
}

#help-close:hover {
  color: #1a1d23;
}

#help-body {
  padding: 20px;
  overflow-y: auto;
}

.help-section {
  margin-bottom: 20px;
}

.help-section:last-child {
  margin-bottom: 0;
}

.help-section h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #1e7d32;
  margin-bottom: 8px;
}

.help-section p {
  font-size: 14px;
  color: #444;
  line-height: 1.5;
  margin-bottom: 6px;
}

.help-section p:last-child {
  margin-bottom: 0;
}

.settings-preferences {
  margin-bottom: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid #eee;
}

.settings-preference-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
}

.settings-preference-row + .settings-preference-row {
  border-top: 1px solid #f1efea;
}

.settings-preference-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.settings-preference-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: #1a1d23;
  margin-bottom: 0;
}

.settings-segment-toggle {
  flex: 0 0 auto;
}

.settings-hint {
  font-size: 12px;
  color: #999;
  margin-bottom: 12px;
}

/* Favorites list */
#favorites-list {
  list-style: none;
  margin-bottom: 12px;
}

#favorites-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #f6f7f9;
  border: 1px solid #eee;
  border-radius: 8px;
  margin-bottom: 6px;
  cursor: grab;
  font-size: 14px;
  color: #1a1d23;
}

#favorites-list li:active {
  cursor: grabbing;
  background: #eef2ff;
  border-color: #c5d4f7;
}

#favorites-list li .fav-drag {
  color: #ccc;
  font-size: 16px;
  cursor: grab;
}

#favorites-list li .fav-label {
  flex: 1;
  font-weight: 600;
}

#favorites-list li .fav-city {
  color: #999;
  font-weight: 400;
  font-size: 13px;
}

#favorites-list li .fav-remove {
  background: none;
  border: none;
  color: #ccc;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
}

#favorites-list li .fav-remove:hover {
  color: #e53e3e;
}

#favorites-list .empty-msg {
  color: #ccc;
  font-size: 13px;
  padding: 8px 0;
  font-style: italic;
}

/* Add favorite */
#add-favorite select,
#add-favorite .scrollable-select-button {
  width: 100%;
  padding: 8px 36px 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  background: #ffffff;
  color: #1a1d23;
}

/* Settings actions */
#settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #eee;
}

#settings-cancel {
  padding: 8px 20px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
}

#settings-cancel:hover {
  border-color: #999;
  color: #1a1d23;
}

#settings-save {
  padding: 8px 20px;
  background: #1a7a4c;
  border: 1px solid #1a7a4c;
  border-radius: 8px;
  font-size: 13px;
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

#settings-save:hover {
  background: #166b29;
}

/* Flex origin modal */
#flex-origin-modal {
  position: fixed;
  inset: 0;
  z-index: 3100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
}

#flex-origin-modal.hidden {
  display: none;
}

#flex-origin-content {
  width: min(560px, calc(100vw - 32px));
  height: min(82vh, 720px);
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#flex-origin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #eee;
}

#flex-mode-toggle {
  display: inline-flex;
  margin-bottom: 10px;
}

#flex-origin-header p {
  font-size: 13px;
  line-height: 1.45;
  color: #7b7b7b;
}

#flex-origin-close {
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 20px;
  padding: 4px 8px;
}

#flex-origin-close:hover {
  color: #1a1d23;
}

#flex-origin-form {
  padding: 18px 20px 10px;
  border-bottom: 1px solid #f0f0ea;
}

#flex-origin-form.hidden {
  display: none;
}

.flex-origin-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
}

#flex-destination-origin-field {
  margin-bottom: 12px;
}

#flex-destination-origin-field.hidden {
  display: none;
}

.flex-origin-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.flex-origin-query-field {
  position: relative;
}

.flex-origin-field span {
  font-size: 12px;
  font-weight: 600;
  color: #5e5c56;
}

.flex-origin-field input,
.flex-origin-field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  color: #1a1d23;
  font-size: 14px;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

.flex-origin-field input:focus,
.flex-origin-field select:focus {
  border-color: #9eb89f;
  background: #fff;
}

.flex-origin-field input::-webkit-outer-spin-button,
.flex-origin-field input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.flex-origin-distance-input {
  position: relative;
}

.flex-origin-distance-input span {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #8b887f;
  pointer-events: none;
}

.flex-origin-distance-input input {
  padding-right: 34px;
}

#flex-origin-suggestions {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(31, 55, 33, 0.14);
  overflow: hidden;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
}

#flex-origin-suggestions.hidden {
  display: none;
}

.flex-origin-suggestion {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid #edf2eb;
  background: #fff;
  color: #2e3a2f;
  text-align: left;
  cursor: pointer;
}

.flex-origin-suggestion:last-child {
  border-bottom: none;
}

.flex-origin-suggestion:hover {
  background: #f5faf4;
}

.flex-origin-suggestion-primary {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #233127;
  margin-bottom: 2px;
}

.flex-origin-suggestion-secondary {
  display: block;
  font-size: 12px;
  line-height: 1.4;
  color: #768073;
}

.flex-origin-suggestion-empty {
  padding: 10px 12px;
  font-size: 12px;
  color: #7b7b7b;
  background: #fff;
}

#flex-origin-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

#flex-origin-search {
  padding: 9px 16px;
  background: #1a7a4c;
  border: 1px solid #1a7a4c;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#flex-origin-search:hover {
  background: #166b29;
}

#flex-origin-search:disabled {
  opacity: 0.65;
  cursor: wait;
}

#flex-origin-results {
  padding: 16px 20px 20px;
  min-height: 220px;
  overflow-y: auto;
}

.flex-origin-empty,
.flex-origin-error {
  font-size: 13px;
  line-height: 1.5;
  color: #7b7b7b;
}

.flex-origin-error {
  color: #b42318;
}

.flex-origin-summary {
  margin-bottom: 12px;
}

.flex-origin-summary strong {
  display: block;
  font-size: 14px;
  color: #233127;
  margin-bottom: 4px;
}

.flex-origin-summary p {
  font-size: 12px;
  color: #7b7b7b;
  line-height: 1.45;
}

.flex-origin-match-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flex-origin-match {
  min-width: 180px;
  flex: 1 1 220px;
  padding: 12px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #f5faf4;
  color: #233127;
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.flex-origin-match:hover {
  border-color: #98b799;
  box-shadow: 0 10px 24px rgba(30, 125, 50, 0.12);
  transform: translateY(-1px);
}

.flex-origin-match.is-static {
  cursor: default;
  transform: none;
}

.flex-origin-match.is-static:hover {
  border-color: #e5e7eb;
  box-shadow: none;
  transform: none;
}

.flex-origin-match-code {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.flex-origin-match-code strong {
  font-size: 16px;
  font-weight: 700;
}

.flex-origin-match-distance {
  font-size: 12px;
  font-weight: 700;
  color: #1a7a4c;
}

.flex-origin-match-location {
  font-size: 13px;
  line-height: 1.4;
  color: #455246;
}

.flex-origin-match-meta {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #1a7a4c;
}

#flex-origin-destination-picker {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #edf2eb;
}

#flex-origin-destination-picker label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #5e5c56;
}

#flex-origin-destination-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  color: #1a1d23;
  font-size: 14px;
  outline: none;
}

#flex-origin-destination-select:focus {
  border-color: #9eb89f;
  background: #fff;
}

.flex-origin-destination-note {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #7b7b7b;
}

.flex-origin-destination-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

#flex-origin-go,
#flex-destination-go {
  padding: 9px 18px;
  background: #1a7a4c;
  border: 1px solid #1a7a4c;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

#flex-origin-go:hover:not(:disabled),
#flex-destination-go:hover:not(:disabled) {
  background: #166b29;
}

#flex-origin-go:disabled,
#flex-destination-go:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Map modal — popup overlay */
#map-modal {
  position: fixed;
  inset: 40px;
  background: #f6f7f9;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  overflow: hidden;
}

#map-modal.hidden {
  display: none;
}

/* Backdrop */
#map-modal::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: -1;
}

#map-modal-header {
  background: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}

#map-modal-header h2 {
  font-size: 16px;
  font-weight: 700;
  color: #222;
}

#map-modal-close {
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #6b7280;
  font-size: 13px;
  cursor: pointer;
}

#map-modal-close:hover {
  border-color: #999;
  color: #222;
}

#map-modal-body {
  flex: 1;
  position: relative;
  display: flex;
}

/* Map */
#map {
  flex: 1;
  z-index: 1;
}

.leaflet-container {
  background: #e8e6e0;
}

.leaflet-container a:focus,
path.leaflet-interactive:focus {
  outline: none !important;
}

#map-route-popover {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(760px, calc(100% - 56px));
  max-height: min(540px, calc(100% - 56px));
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,0.97);
  border: 1px solid #e3ddd2;
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.22);
  backdrop-filter: blur(14px);
  z-index: 450;
  overflow: hidden;
}

#map-route-popover.hidden {
  display: none;
}

#map-route-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #ece6dc;
}

#map-route-popover-route {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1a1d23;
}

#map-route-popover-travel-time {
  margin-top: 4px;
  font-size: 12px;
  color: #6b7280;
}

#map-route-popover-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #ddd5c8;
  border-radius: 10px;
  background: #f8f5ef;
  color: #6b7280;
  font-size: 14px;
  cursor: pointer;
  flex: 0 0 auto;
}

#map-route-popover-close:hover {
  border-color: #999;
  color: #1a1d23;
}

#map-route-popover-body {
  padding: 0 18px 18px;
  overflow-y: auto;
}

.map-route-popover-subtitle {
  margin: 14px 0 10px;
  font-size: 12px;
  color: #7a746b;
}

.map-route-calendar-label {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: #6b7280;
}

.map-route-calendar-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scroll-snap-type: x proximity;
}

.map-route-day-card {
  min-width: 184px;
  max-width: 184px;
  flex: 0 0 auto;
  padding: 12px;
  border: 1px solid #ebe4d8;
  border-radius: 14px;
  background: #f6f7f9;
  scroll-snap-align: start;
}

.map-route-day-label {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #5f594f;
}

.map-route-day-flights {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.map-route-flight-row {
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid #ece5da;
  background: #fff;
}

.map-route-flight-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.map-route-flight-time {
  font-size: 12px;
  font-weight: 700;
  color: #1a1d23;
}

.map-route-flight-price {
  font-size: 12px;
  font-weight: 800;
  color: #1a7a4c;
  white-space: nowrap;
}

.map-route-flight-meta {
  margin-top: 5px;
  font-size: 11px;
  color: #7a746b;
}

.map-route-day-empty,
.map-route-empty {
  font-size: 12px;
  color: #aca396;
}

.map-route-empty {
  padding: 28px 18px;
  border: 1px dashed #ddd3c5;
  border-radius: 14px;
  background: #faf8f3;
  text-align: center;
}

/* Sidebar (inside map modal) */
#sidebar {
  width: 320px;
  background: #fff;
  border-left: 1px solid #e5e7eb;
  display: flex;
  flex-direction: column;
}

#sidebar-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #e5e7eb;
}

#sidebar-header h2 {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  margin-bottom: 2px;
}

#route-count {
  font-size: 12px;
  color: #999;
}

#dest-search {
  width: 100%;
  margin-top: 8px;
  padding: 7px 10px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #1a1d23;
  font-size: 13px;
  outline: none;
}

#dest-search:focus {
  border-color: #999;
}

#dest-list {
  list-style: none;
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}

#dest-list li {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 1px solid #f0eeea;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#dest-list li:hover {
  background: #f0f0ea;
}

#dest-list li.selected {
  background: #e6f4ea;
  border-left: 3px solid #1a7a4c;
}

#dest-list li .dest-info {
  display: flex;
  flex-direction: column;
}

#dest-list li .dest-city {
  font-size: 14px;
  font-weight: 600;
  color: #222;
}

#dest-list li .dest-code {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

#dest-list li .dest-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.badge-domestic {
  background: #e6f4ea;
  color: #1a7a4c;
}

.badge-international {
  background: #e8f0fe;
  color: #1a5fb4;
}

/* Route detail panel (inside map modal) */
#route-detail {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 24px;
  z-index: 2010;
  min-width: 300px;
  max-width: 450px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

#route-detail.hidden {
  display: none;
}

#detail-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: #888;
  font-size: 18px;
  cursor: pointer;
}

#detail-close:hover {
  color: #222;
}

#detail-city {
  font-size: 18px;
  font-weight: 700;
  color: #222;
  margin-bottom: 4px;
}

#detail-code {
  font-size: 13px;
  color: #999;
  margin-bottom: 8px;
}

#detail-flights {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
}

#detail-airlines {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#detail-airlines .airline-tag {
  font-size: 12px;
  padding: 3px 10px;
  background: #e8f0fe;
  color: #1a5fb4;
  border-radius: 12px;
}

/* Loading */
#loading {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 15, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 3000;
}

#loading.hidden {
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #2a2a3a;
  border-top-color: #5b8def;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading p {
  margin-top: 12px;
  color: #888;
  font-size: 14px;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #3a3a5a;
  border-radius: 3px;
}

/* Data freshness indicator */
#data-freshness {
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}


/* Calendar view (main content) */
#calendar-view {
  flex: 1;
  background: #f6f7f9;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #1a1d23;
}

#route-summary {
  padding: 8px 24px 0;
  font-size: 13px;
  color: #999;
  flex-shrink: 0;
}

/* Dest filter in header */
#cal-dest-filter {
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  width: 160px;
  outline: none;
  background: #ffffff;
  color: #1a1d23;
}

#cal-dest-filter:focus {
  border-color: #999;
}

#cal-filters {
  display: flex;
  gap: 8px;
  align-items: center;
}

#cal-dest-filter {
  padding: 7px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  width: 260px;
  outline: none;
  background: #fff;
  color: #1a1d23;
}

#cal-dest-filter:focus {
  border-color: #999;
}

#cal-week-select {
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: #1a1d23;
  cursor: pointer;
  outline: none;
}

/* Date picker */
#cal-date-picker {
  position: relative;
}

#cal-date-btn {
  padding: 8px 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  font-size: 13px;
  background: #ffffff;
  color: #1a1d23;
  cursor: pointer;
  white-space: nowrap;
}

#cal-date-btn:hover {
  border-color: #999;
}

/* ---------- Desktop: neutralize mobile-only wrappers so layout matches original ---------- */
@media (min-width: 769px) {
  /* Hide full-screen sheet chrome that only appears on mobile */
  .mobile-sheet-header,
  .mobile-sheet-cta,
  .mobile-sheet-card-icon,
  .mobile-sheet-card-chevron,
  .mobile-sheet-tool-icon,
  .origin-details,
  #mobile-sheet-close,
  #mobile-sheet-reset,
  #mobile-sheet-search {
    display: none;
  }

  /* Collapse wrappers so their children flow into the desktop header naturally */
  .mobile-sheet-body,
  .mobile-sheet-button-row,
  .mobile-sheet-card.filter-card {
    display: contents;
  }

  /* The "FILTERS" label becomes an invisible flex-break forcing the filter
     inputs below it to wrap onto a second row (mimicking the original
     #header-filters-row placement). */
  .mobile-sheet-label.mobile-sheet-section-label {
    display: block;
    flex-basis: 100%;
    width: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
    visibility: hidden;
    order: 9;
  }
  .mobile-sheet-label:not(.mobile-sheet-section-label) {
    display: none;
  }

  /* Restore the original left-to-right order of the main header row.
     My HTML moved trip-mode above cal-date-picker; `order` puts them back. */
  #origin-select-wrapper { order: 1; }
  #cal-date-picker       { order: 2; }
  #trip-mode-toggle      { order: 3; }
  #filters-wrapper       { order: 4; }
  #map-btn               { order: 5; }
  #settings-btn          { order: 6; }
  #help-btn              { order: 7; }
  #header-right          { order: 8; }

  /* Row 2: filter inputs after the flex-break (order 9). */
  #cal-dest-filter                                        { order: 10; flex: 0 0 240px; width: 240px; }
  .scrollable-select[data-select-id="specific-dest-select"] { order: 10; flex: 0 0 240px; width: 240px; }
  #cal-max-price                                          { order: 11; flex: 0 0 96px; width: 96px; }
  #filter-inputs-row                                      { order: 12; }

  /* #settings-btn originally held a single gear emoji at font-size:20px.
     Now it holds a "Settings" text label, so reset the font-size on desktop. */
  #settings-btn {
    font-size: 13px;
    height: auto;
    padding: 8px 14px;
    line-height: 1.2;
  }

  /* The travel-dates button shows only the compact fallback text */
  .mobile-sheet-travel-dates > .mobile-sheet-label,
  .mobile-sheet-travel-dates > .travel-dates-row,
  .mobile-sheet-travel-dates > .travel-dates-gowild-label {
    display: none;
  }

  .mobile-sheet-travel-dates > .travel-dates-fallback {
    display: inline;
  }
}

#trip-mode-toggle {
  flex: 0 0 auto;
}

#cal-date-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #dfe6dd;
  border-radius: 16px;
  padding: 10px 12px 12px;
  z-index: 2000;
  box-shadow: 0 18px 42px rgba(35, 58, 33, 0.12);
  min-width: 360px;
}

#cal-date-dropdown.hidden {
  display: none;
}

#cal-date-grid {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

.cal-picker-nav {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 8px;
  padding: 4px 2px 12px;
}

.cal-picker-title {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: #2b3848;
}

.cal-picker-nav-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #97aa97;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.cal-picker-nav-btn:hover:not(:disabled) {
  background: #eef6eb;
  color: #365b35;
}

.cal-picker-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.cal-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  padding: 4px 0 0;
}

.cal-date-cell {
  min-height: 44px;
  padding: 6px 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  border: 1px solid transparent;
  border-radius: 0;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, color 0.15s ease, border-radius 0.15s ease;
}

.cal-date-cell.available {
  background: #fff;
  color: #2c3947;
}

.cal-date-cell.available:hover {
  background: #f1f7ee;
}

.cal-date-cell.selected {
  background: #e3f1df;
  color: #2f4a2e;
}

.cal-date-cell.available.is-past {
  color: #a0aab4;
  font-weight: 400;
}

.cal-date-cell.available.is-past.selected {
  background: #eaeaea;
  color: #8a939c;
}

.cal-date-cell.unavailable {
  color: #d7dee7;
  cursor: default;
}

.cal-date-cell.range-start,
.cal-date-cell.range-end {
  background: #a8d6a1;
  color: #234321;
  border-radius: 12px;
  font-weight: 700;
}

.cal-date-cell.day-header {
  min-height: auto;
  padding: 0 0 10px;
  font-weight: 600;
  color: #a7b4c2;
  font-size: 11px;
  text-transform: none;
  cursor: default;
  border: none;
  background: transparent;
}

.cal-date-day-number {
  display: block;
  font-size: 15px;
  line-height: 1;
  font-weight: 600;
}

.cal-date-cell.outside-month {
  color: #cfd8e2;
}

#cal-date-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  border-top: 1px solid #e8efe5;
  padding-top: 10px;
}

#cal-date-actions button {
  padding: 5px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  background: #fff;
  color: #6b7280;
}

#cal-date-actions button:hover {
  border-color: #999;
}

#cal-date-apply {
  background: #1a7a4c !important;
  color: #fff !important;
  border-color: #1a7a4c !important;
}

#cal-max-price {
  width: 96px;
  padding: 7px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 13px;
  background: #fff;
  color: #1a1d23;
  outline: none;
  appearance: textfield;
  -moz-appearance: textfield;
}

@media (max-width: 700px) {
  .flex-origin-fields {
    grid-template-columns: 1fr;
  }

  #flex-origin-content {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }
}

#cal-max-price:focus {
  border-color: #999;
}

#cal-max-price::-webkit-outer-spin-button,
#cal-max-price::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

#calendar-info {
  font-size: 12px;
  color: #999;
  margin-left: auto;
}

#calendar-grid {
  flex: 1;
  overflow: auto;
  padding: 20px 24px 20px 24px;
  transition: opacity 0.18s ease;
}

#calendar-grid.is-loading {
  opacity: 0.52;
  pointer-events: none;
}

#calendar-grid-inner {
  min-width: max-content;
  padding-bottom: 8px;
}

#calendar-grid-inner.focused-mode {
  min-width: 0;
}

#calendar-grid-inner.roundtrip-return-mode {
  min-width: max-content;
}

.roundtrip-selection-summary {
  position: sticky;
  top: 0;
  left: 0;
  z-index: 3;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  width: calc(100vw - 48px);
  max-width: calc(100vw - 48px);
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 20px rgba(31, 55, 33, 0.08);
  backdrop-filter: blur(10px);
}

.roundtrip-selection-header {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.roundtrip-selection-meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.roundtrip-back-btn {
  padding: 6px 10px;
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  background: #fff;
  color: #355235;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
}

.roundtrip-back-btn:hover {
  border-color: #1a7a4c;
  color: #1a7a4c;
}

.roundtrip-selection-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: #1a7a4c;
}

.roundtrip-selection-route {
  font-size: 14px;
  font-weight: 800;
  color: #1f2a1f;
  line-height: 1.2;
}

.roundtrip-selection-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.roundtrip-summary-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid #e8f5ee;
  border-radius: 12px;
  background: #f8fbf7;
  flex: 0 1 280px;
}

.roundtrip-summary-card.is-placeholder {
  background: #fcfcfa;
}

.roundtrip-summary-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  color: #6f7b6f;
}

.roundtrip-summary-card strong {
  font-size: 13px;
  line-height: 1.25;
  color: #1f2a1f;
}

.roundtrip-summary-card span:last-child {
  font-size: 11px;
  line-height: 1.35;
  color: #647064;
}

/* Destination sections */
.dest-section {
  margin-bottom: 24px;
  padding-bottom: 4px;
}

.dest-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  padding: 0 10px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid #1a1d23;
  position: sticky;
  left: 0;
  width: 100vw;
  max-width: calc(100vw - 48px);
  background: #f6f7f9;
  z-index: 3;
}

/* Extend the sticky header's background upward to cover the scroll
   container's padding-top, which otherwise exposes scrolled cards
   above the pinned header. */
.dest-header::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 24px;
  background: #f6f7f9;
  pointer-events: none;
}

.dest-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.dest-code {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1a1d23;
}

.dest-focus-btn {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9d4ca;
  border-radius: 8px;
  background: #fff;
  color: #6a645a;
  cursor: pointer;
  flex: 0 0 auto;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.dest-focus-btn:hover {
  border-color: #1a7a4c;
  color: #1a7a4c;
  transform: translateY(-1px);
}

.dest-focus-btn.is-focused {
  background: #1a7a4c;
  border-color: #1a7a4c;
  color: #fff;
}

.dest-focus-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dest-name {
  font-size: 0.9rem;
  color: #666;
  font-weight: 400;
  margin-left: 0;
}

.gowild-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: #16a34a;
  background: #ecfdf5;
  border: 1.5px solid #16a34a;
  border-radius: 6px;
  padding: 2px;
  line-height: 1;
  flex-shrink: 0;
  cursor: help;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18), 0 0 10px rgba(22, 163, 74, 0.55);
  animation: gowild-glow 2s ease-in-out infinite;
}

.gowild-badge svg {
  width: 14px;
  height: 14px;
  display: block;
}

/* Hover/focus tooltip on the dest-level paw — matches the day-level tooltip */
.gowild-badge::before,
.gowild-badge::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 2600;
}

.gowild-badge::before {
  content: '';
  top: calc(100% + 2px);
  transform: translateX(-50%) translateY(4px);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #f7fbf4;
  filter: drop-shadow(0 -1px 0 #bfe3c3);
}

.gowild-badge::after {
  content: attr(data-tooltip);
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: min(240px, calc(100vw - 40px));
  padding: 10px 12px;
  border: 1px solid #bfe3c3;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdf9 0%, #f0f9ec 100%);
  color: #1e5930;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 14px 28px rgba(22, 163, 74, 0.22);
}

.gowild-badge:hover::before,
.gowild-badge:hover::after,
.gowild-badge:focus::before,
.gowild-badge:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

@keyframes gowild-glow {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18), 0 0 8px rgba(22, 163, 74, 0.45);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.28), 0 0 14px rgba(22, 163, 74, 0.75);
  }
}

.gowild-day-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  color: #16a34a;
  background: #ecfdf5;
  border: 1.5px solid #16a34a;
  border-radius: 5px;
  padding: 2px;
  line-height: 1;
  flex-shrink: 0;
  cursor: help;
  vertical-align: middle;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.15), 0 0 8px rgba(22, 163, 74, 0.5);
  animation: gowild-glow 2s ease-in-out infinite;
}

.gowild-day-badge svg {
  width: 12px;
  height: 12px;
  display: block;
}

.gowild-day-badge::before,
.gowild-day-badge::after {
  position: absolute;
  left: 50%;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s ease;
  z-index: 2600;
}

.gowild-day-badge::before {
  content: '';
  top: calc(100% + 2px);
  transform: translateX(-50%) translateY(4px);
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 6px solid #f7fbf4;
  filter: drop-shadow(0 -1px 0 #bfe3c3);
}

.gowild-day-badge::after {
  content: attr(data-tooltip);
  top: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  width: max-content;
  max-width: min(240px, calc(100vw - 40px));
  padding: 10px 12px;
  border: 1px solid #bfe3c3;
  border-radius: 12px;
  background: linear-gradient(180deg, #fbfdf9 0%, #f0f9ec 100%);
  color: #1e5930;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  text-align: left;
  white-space: normal;
  box-shadow: 0 14px 28px rgba(22, 163, 74, 0.22);
}

.gowild-day-badge:hover::before,
.gowild-day-badge:hover::after,
.gowild-day-badge:focus::before,
.gowild-day-badge:focus::after {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.day-card.has-gowild {
  box-shadow: 0 0 0 1.5px rgba(22, 163, 74, 0.35), 0 2px 6px rgba(22, 163, 74, 0.12);
}

.day-card.has-gowild-layover {
  box-shadow: 0 0 0 1.5px rgba(217, 119, 6, 0.35), 0 2px 6px rgba(217, 119, 6, 0.12);
}

/* Layover (amber) variants of the GoWild paw badges */
.gowild-badge.layover {
  color: #b45309;
  background: #fff7ed;
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.18), 0 0 10px rgba(217, 119, 6, 0.55);
  animation: gowild-glow-layover 2s ease-in-out infinite;
}

.gowild-day-badge.layover {
  color: #b45309;
  background: #fff7ed;
  border-color: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.15), 0 0 8px rgba(217, 119, 6, 0.5);
  animation: gowild-glow-layover 2s ease-in-out infinite;
}

/* International (blue) variants — direct/layover can't be inferred for intl */
.gowild-badge.international {
  color: #1e40af;
  background: #dbeafe;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18), 0 0 10px rgba(59, 130, 246, 0.55);
  animation: gowild-glow-international 2s ease-in-out infinite;
}

.gowild-day-badge.international {
  color: #1e40af;
  background: #dbeafe;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15), 0 0 8px rgba(59, 130, 246, 0.5);
  animation: gowild-glow-international 2s ease-in-out infinite;
}

@keyframes gowild-glow-international {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18), 0 0 8px rgba(59, 130, 246, 0.45);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.28), 0 0 14px rgba(59, 130, 246, 0.75);
  }
}

.day-card.has-gowild-international {
  box-shadow: 0 0 0 1.5px rgba(59, 130, 246, 0.35), 0 2px 6px rgba(59, 130, 246, 0.12);
}

.gowild-day-badge.layover::before,
.gowild-badge.layover::before {
  border-bottom-color: #fdf5e8;
  filter: drop-shadow(0 -1px 0 #e8cfa3);
}

.gowild-day-badge.layover::after,
.gowild-badge.layover::after {
  border-color: #e8cfa3;
  background: linear-gradient(180deg, #fdfaf2 0%, #fcefd6 100%);
  color: #7c4a0a;
  box-shadow: 0 14px 28px rgba(217, 119, 6, 0.22);
}

.gowild-day-badge.international::before,
.gowild-badge.international::before {
  border-bottom-color: #eff6ff;
  filter: drop-shadow(0 -1px 0 #bfdbfe);
}

.gowild-day-badge.international::after,
.gowild-badge.international::after {
  border-color: #bfdbfe;
  background: linear-gradient(180deg, #f5faff 0%, #dbeafe 100%);
  color: #1e3a8a;
  box-shadow: 0 14px 28px rgba(59, 130, 246, 0.22);
}

@keyframes gowild-glow-layover {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.18), 0 0 8px rgba(217, 119, 6, 0.45);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.28), 0 0 14px rgba(217, 119, 6, 0.75);
  }
}

.dest-focus-hint {
  font-size: 11px;
  color: #6a645a;
  background: #ebe7de;
  border-radius: 999px;
  padding: 4px 8px;
}

.dest-best {
  font-size: 14px;
  color: #1a7a4c;
  font-weight: 700;
  margin-left: 8px;
}

.dest-collapse-toggle {
  display: none;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 5px 10px;
  border: 1px solid #d9d4ca;
  border-radius: 999px;
  background: #fff;
  color: #5f594f;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.dest-collapse-toggle-text {
  line-height: 1;
}

.dest-collapse-toggle-icon {
  font-size: 12px;
  line-height: 1;
}

.day-cards {
  display: flex;
  gap: 12px;
  padding-bottom: 8px;
}

.day-cards.day-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 180px);
  gap: 14px;
  justify-content: flex-start;
  padding-bottom: 0;
}

.day-card {
  background: #fff;
  border-radius: 12px;
  flex: 0 0 180px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1), 0 0 0 1px rgba(0,0,0,0.04);
}

.day-card.is-past {
  opacity: 0.45;
}

.day-card.is-past .day-label {
  font-weight: 400;
}

.day-cards.day-cards-grid .day-card {
  width: 180px;
  min-height: 164px;
}

.day-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
  color: #1a1d23;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.cal-flight {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  margin-bottom: 6px;
  border-radius: 6px;
  transition: transform 0.1s ease;
}

.cal-flight:hover {
  transform: scale(1.02);
  cursor: pointer;
}

.cal-flight .cal-left {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.cal-flight .cal-time {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.cal-flight .cal-time-pair {
  display: flex;
  flex-direction: column;
  gap: 1px;
  white-space: normal;
}

.cal-flight .cal-time-line {
  display: block;
  line-height: 1.1;
  white-space: nowrap;
}

.cal-flight .cal-time-depart {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1f1f1f;
}

.cal-flight .cal-time-arrive {
  margin-top: 1px;
  font-size: 0.74rem;
  font-weight: 500;
  color: #6e695f;
}

.cal-flight .cal-num {
  font-size: 0.7rem;
  color: #666;
  margin-top: 1px;
}

.cal-flight .cal-price {
  font-size: 0.95rem;
  font-weight: 800;
}

.cal-flight .cal-price-miles {
  font-size: 0.85rem;
  font-weight: 700;
  width: 100%;
  text-align: center;
  padding: 2px 0;
}

.cal-flight .cal-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  margin-left: 12px;
  flex: 0 0 auto;
}

.cal-flight-roundtrip {
  align-items: stretch;
}

.cal-flight-roundtrip .cal-right {
  justify-content: space-between;
  gap: 0;
}

.cal-rt-meta,
.cal-secondary-price {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
}

.cal-rt-meta {
  margin-top: 4px;
  color: #466247;
}

.cal-secondary-price {
  color: #355235;
}

.cal-rt-meta.is-empty,
.cal-secondary-price.is-empty {
  color: #8e8a80;
}

.cal-flight.price-neutral {
  background: linear-gradient(to right, #fff 30%, #f2efe8);
}

.cal-flight.price-neutral .cal-price {
  color: #5f594f;
}

.cal-flight.price-neutral .cal-num {
  color: #7b756b;
}

.cal-flight.is-selected-outbound,
.cal-flight.is-selected-return {
  box-shadow: 0 0 0 2px #1a7a4c inset;
}

.cal-flight.is-selected-return {
  background: linear-gradient(to right, #f3fbf1 25%, #dcefd8) !important;
}

/* Gradient price tints — covers the whole row */
.cal-flight.price-low,
.cal-flight-pair.price-low .cal-flight {
  background: linear-gradient(to right, #fff 30%, #d4edda);
}
.cal-flight.price-low .cal-price,
.cal-flight-pair.price-low .cal-price { color: #1a7a4c; }
.cal-flight.price-low .cal-num,
.cal-flight-pair.price-low .cal-num { color: #1a7a4c; }

.cal-flight.price-mid,
.cal-flight-pair.price-mid .cal-flight {
  background: linear-gradient(to right, #fff 30%, #ffecd2);
}
.cal-flight.price-mid .cal-price,
.cal-flight-pair.price-mid .cal-price { color: #b36b00; }
.cal-flight.price-mid .cal-num,
.cal-flight-pair.price-mid .cal-num { color: #b36b00; }

.cal-flight.price-high,
.cal-flight-pair.price-high .cal-flight {
  background: linear-gradient(to right, #fff 30%, #f8d7da);
}
.cal-flight.price-high .cal-price,
.cal-flight-pair.price-high .cal-price { color: #c0392b; }
.cal-flight.price-high .cal-num,
.cal-flight-pair.price-high .cal-num { color: #c0392b; }

[data-sd-role="outbound"] { cursor: pointer; }
[data-sd-role="outbound"]:hover { outline: 2px solid #1a7a4c; outline-offset: -1px; border-radius: 4px; }

.roundtrip-summary-back { background: none; border: none; color: #1a7a4c; cursor: pointer; font-size: 13px; padding: 4px 0; text-decoration: underline; }
.roundtrip-summary-back:hover { color: #155d24; }

.cal-no-flights {
  color: #ccc;
  font-size: 12px;
  padding: 6px 0;
}

/* GoWild flight card where we only know the fare (no scanned itinerary times) */
.cal-flight.cal-flight-layover-only {
  align-items: center;
}

.cal-layover-label {
  font-size: 13px;
  font-weight: 700;
  color: #b45309;
  letter-spacing: 0.2px;
}

/* Small always-visible legend explaining the paw colors — shown above the
   destination list whenever GoWild data is loaded. position:relative + z-index
   keep it above the .dest-header::before bg-extender pseudo-element. */
#gowild-legend {
  box-sizing: content-box;
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 24px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 22px;
  color: #6b7280;
  flex: 0 0 auto;
  height: 22px;
}

#gowild-legend.hidden {
  display: none;
}

.gowild-legend-label {
  font-weight: 600;
  color: #555;
  margin-right: 2px;
}

.gowild-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.gowild-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  flex-shrink: 0;
}

.gowild-legend-dot.direct {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.18);
}

.gowild-legend-dot.layover {
  background: #d97706;
  box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.18);
}

.gowild-legend-dot.international {
  background: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.18);
}

.cal-flight-layover-only .cal-num {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

.roundtrip-empty-state {
  padding: 18px 20px;
  border: 1px dashed #e5e7eb;
  border-radius: 14px;
  background: #fcfcfa;
  font-size: 13px;
  color: #7c786f;
}

#calendar-grid-inner.focused-mode .dest-section {
  margin-bottom: 0;
}

#calendar-grid-inner.focused-mode .dest-header {
  width: auto;
  max-width: none;
  left: auto;
  top: 0;
}

#calendar-grid-inner.roundtrip-return-mode .dest-header {
  position: sticky;
  left: 0;
  top: auto;
  width: 100vw;
  max-width: calc(100vw - 48px);
}

#calendar-grid-inner.roundtrip-return-mode .dest-section {
  min-width: max-content;
}

/* Responsive */
@media (max-width: 768px) {
  #sidebar {
    width: 100%;
    height: 40vh;
    top: auto;
    bottom: 0;
    border-left: none;
    border-top: 1px solid #2a2a3a;
  }

  #header h1 {
    display: none;
  }

  #origin-select-wrapper,
  #origin-select {
    width: 200px;
    min-width: 200px;
  }

  #header-main,
  #header-filters-row {
    gap: 8px;
  }

  #header-filters-row #cal-dest-filter {
    flex: 1 1 220px;
    width: auto;
  }

  .dest-header {
    gap: 8px;
    flex-wrap: wrap;
  }

  #map-route-popover {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: 60%;
    transform: none;
  }

  .dest-best {
    width: 100%;
    margin-left: 0;
  }

  .day-cards.day-cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .roundtrip-selection-header {
    flex-wrap: wrap;
  }

  .roundtrip-selection-route {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  :root {
    --mobile-viewport-height: 100svh;
    --mobile-sheet-top: calc(10px + env(safe-area-inset-top));
    --mobile-sheet-height: min(75dvh, calc(100dvh - (22px + env(safe-area-inset-top) + env(safe-area-inset-bottom))));
    --mobile-toolbar-clearance: calc(120px + env(safe-area-inset-bottom));
  }

  html {
    height: auto;
    min-height: var(--mobile-viewport-height);
    background: #f6f7f9;
  }

  body,
  #app {
    background: #f6f7f9;
    min-height: var(--mobile-viewport-height);
    height: auto;
  }

  body {
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #app {
    display: flex;
    flex-direction: column;
    overflow: visible;
  }

  #header {
    padding: calc(10px + env(safe-area-inset-top)) 12px 8px;
    gap: 10px;
  }

  /* ============================================================
     Design tokens matching the redesign reference
     ============================================================ */
  #mobile-controls-bar,
  #header.mobile-controls-open #mobile-controls-panel {
    --ms-bg: #f6f7f9;
    --ms-card: #ffffff;
    --ms-primary: #1a7a4c;
    --ms-primary-light: #e8f5ee;
    --ms-text: #1a1d23;
    --ms-text-secondary: #6b7280;
    --ms-border: #e5e7eb;
    --ms-radius: 14px;
    --ms-radius-sm: 10px;
    --ms-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  }

  /* --- Collapsed mobile summary bar --- */
  #mobile-controls-bar {
    display: flex;
    align-items: stretch;
    gap: 10px;
  }

  .mobile-summary-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    min-height: 60px;
    background: var(--ms-card);
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
    text-align: left;
    cursor: pointer;
  }

  .mobile-summary-card:active { transform: scale(0.99); }

  .mobile-summary-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: var(--ms-primary-light);
    color: var(--ms-primary);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-summary-icon svg { width: 20px; height: 20px; }

  .mobile-summary-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .mobile-summary-route {
    font-size: 15px;
    font-weight: 700;
    color: var(--ms-text);
    letter-spacing: -0.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .mobile-summary-route .muted {
    color: var(--ms-text-secondary);
    font-weight: 600;
  }

  .mobile-summary-meta {
    font-size: 12.5px;
    color: var(--ms-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #mobile-summary-help {
    flex-shrink: 0;
    width: 56px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--ms-card);
    border: 1px solid var(--ms-border);
    border-radius: var(--ms-radius);
    color: var(--ms-text-secondary);
    cursor: pointer;
    box-shadow: var(--ms-shadow-sm);
  }
  #mobile-summary-help svg { width: 20px; height: 20px; }
  #mobile-summary-help:active { transform: scale(0.97); }

  /* --- Expanded full-screen sheet --- */
  #mobile-controls-panel {
    display: none;
  }

  #header.mobile-controls-open #mobile-controls-panel {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--ms-bg);
    z-index: 3200;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-font-smoothing: antialiased;
  }

  #header.mobile-controls-open #mobile-controls-bar {
    visibility: hidden;
  }

  /* Sticky top header: Close | Title | Reset */
  .mobile-sheet-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(16px + env(safe-area-inset-top)) 20px 16px;
    background: var(--ms-card);
    border-bottom: 1px solid var(--ms-border);
  }

  #mobile-sheet-close {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    background: none;
    border: none;
    color: var(--ms-text);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
  }
  #mobile-sheet-close svg { width: 20px; height: 20px; }

  .mobile-sheet-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    letter-spacing: -0.2px;
    color: var(--ms-text);
  }

  #mobile-sheet-reset {
    padding: 6px 0;
    background: none;
    border: none;
    color: var(--ms-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
  }

  /* Scrollable body */
  .mobile-sheet-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 100px;
  }

  .mobile-sheet-body #header-main {
    display: block;
    width: 100%;
  }

  /* Origin card */
  #origin-select-wrapper.origin-card {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    flex: 0 0 auto;
    padding: 16px 18px;
    background: var(--ms-card);
    border: none;
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
    margin-bottom: 16px;
  }

  .mobile-sheet-card-icon.origin-pin {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--ms-primary-light);
    color: var(--ms-primary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-sheet-card-icon.origin-pin svg { width: 20px; height: 20px; }

  /* Visible origin display: DEN big + "Denver, CO, US" small */
  #origin-select-wrapper.origin-card .origin-details {
    flex: 1;
    min-width: 0;
  }

  #origin-select-wrapper.origin-card .origin-code {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.3px;
    line-height: 1.2;
    color: var(--ms-text);
  }

  #origin-select-wrapper.origin-card .origin-name {
    font-size: 13px;
    color: var(--ms-text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* The scrollable-select wrapper sits behind the origin-details display so
     the whole card acts as a tap target. When the input receives focus the
     details are hidden and the input becomes a normal-looking search field. */
  #origin-select-wrapper.origin-card > .scrollable-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  #origin-select-wrapper.origin-card .scrollable-select-button {
    width: 100%;
    height: 100%;
    border: none;
    background: transparent;
    /* Reserve space for the pin icon (42px + 14px gap + 18px outer padding)
       and the chevron on the right so the cursor lines up with the "DEN"
       text, not the far-left edge of the card. */
    padding: 0 40px 0 74px;
    font-size: 16px;
    font-weight: 600;
    color: transparent;
    caret-color: var(--ms-text);
    min-height: 0;
    text-align: left;
    box-shadow: none;
  }

  #origin-select-wrapper.origin-card .scrollable-select-button::placeholder {
    color: transparent;
  }

  /* While the user is searching (input focused, dropdown open), swap to a
     normal visible search field and hide the static DEN / Denver, CO, US
     display. The `.is-searching` class is toggled in JS (focus/blur) because
     `:focus` can be flaky across some browsers when the field is inside an
     absolutely-positioned overlay. */
  #origin-select-wrapper.origin-card.is-searching .scrollable-select-button {
    color: var(--ms-text);
  }

  #origin-select-wrapper.origin-card.is-searching .scrollable-select-button::placeholder {
    color: #b0b5bf;
  }

  #origin-select-wrapper.origin-card.is-searching .origin-details {
    visibility: hidden;
  }

  /* Before scrollable-select enhancement runs */
  #origin-select-wrapper.origin-card #origin-select:not(.scrollable-select-native) {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
  }

  .mobile-sheet-card-chevron {
    color: var(--ms-text-secondary);
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  .mobile-sheet-card-chevron svg { width: 18px; height: 18px; }

  /* Trip mode toggle */
  .mobile-sheet-body #trip-mode-toggle {
    display: flex;
    width: 100%;
    padding: 4px;
    background: var(--ms-card);
    border: none;
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
    margin-bottom: 16px;
  }

  .mobile-sheet-body #trip-mode-toggle .segment-btn {
    flex: 1 1 0;
    padding: 11px 0;
    font-size: 14px;
    font-weight: 600;
    border: none;
    background: transparent;
    color: var(--ms-text-secondary);
    border-radius: var(--ms-radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
  }

  .mobile-sheet-body #trip-mode-toggle .segment-btn.active {
    background: var(--ms-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,122,76,0.3);
  }

  /* Travel dates card — use ID+class selector to override global #cal-date-btn */
  #cal-date-btn.mobile-sheet-travel-dates {
    width: 100%;
    display: block;
    padding: 14px 18px;
    background: var(--ms-card);
    border: none;
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
    overflow: hidden;
    text-align: left;
    cursor: pointer;
    color: inherit;
    margin-bottom: 16px;
    font-size: inherit;
  }

  .mobile-sheet-travel-dates .travel-dates-fallback { display: none; }
  .mobile-sheet-travel-dates > .mobile-sheet-label { display: none; }
  .mobile-sheet-travel-dates .travel-dates-gowild-label { display: none; }

  /* GoWild mode: replace the date range layout with a single centered label. */
  .mobile-sheet-travel-dates.is-gowild-mode .travel-dates-row { display: none; }
  .mobile-sheet-travel-dates.is-gowild-mode .travel-dates-gowild-label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--ms-primary);
    letter-spacing: -0.1px;
  }

  .mobile-sheet-travel-dates .travel-dates-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
  }

  /* Each date stack: WEEKDAY (small) / DAY (big) / MONTH YEAR (small), centered */
  .travel-dates-end {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
  }

  .travel-dates-weekday {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--ms-text-secondary);
    line-height: 1.8;
  }

  .travel-dates-day {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.1;
    color: var(--ms-text);
  }

  .travel-dates-month {
    font-size: 12px;
    font-weight: 500;
    color: var(--ms-text-secondary);
    line-height: 1.6;
  }

  /* Center column: arrow on top, "X days" caption underneath */
  .travel-dates-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    color: #9ca3af;
  }

  .travel-dates-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
  }
  .travel-dates-arrow svg {
    width: 42px;
    height: 18px;
    stroke-width: 2;
  }

  .travel-dates-duration {
    font-size: 12px;
    font-weight: 600;
    color: var(--ms-primary);
    white-space: nowrap;
  }

  /* Section labels (Filters) */
  .mobile-sheet-section-label {
    display: block;
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--ms-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* Combined filter group: two rows in one card */
  .mobile-sheet-card.filter-card {
    background: var(--ms-card);
    border: none;
    border-radius: var(--ms-radius) var(--ms-radius) 0 0;
    box-shadow: var(--ms-shadow-sm);
    margin: 0;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 0;
    border-bottom: 1px solid var(--ms-border);
  }
  .mobile-sheet-card.filter-card + .mobile-sheet-card.filter-card {
    border-radius: 0 0 var(--ms-radius) var(--ms-radius);
    border-bottom: none;
    margin-bottom: 16px;
  }

  .mobile-sheet-card-icon.filter-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--ms-bg);
    color: var(--ms-text-secondary);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-sheet-card-icon.filter-icon svg { width: 16px; height: 16px; }

  .mobile-sheet-card.filter-card input[type="text"] {
    flex: 1 1 auto;
    border: none;
    background: transparent;
    font-size: 15px;
    font-family: inherit;
    color: var(--ms-text);
    padding: 0;
    outline: none;
    min-height: 0;
  }
  .mobile-sheet-card.filter-card input[type="text"]::placeholder {
    color: #b0b5bf;
  }

  .mobile-sheet-card.filter-card #cal-dest-filter,
  .mobile-sheet-card.filter-card #cal-max-price {
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    width: 100%;
  }

  /* 3-button Map / Mode / Settings row */
  .mobile-sheet-button-row {
    display: flex;
    gap: 10px;
    width: 100%;
    margin-bottom: 16px;
  }

  .mobile-sheet-button-row #filters-wrapper {
    position: relative;
    flex: 1;
    display: flex;
  }

  .mobile-sheet-button-row #filters-wrapper #filters-btn {
    flex: 1;
  }

  /* High specificity so global #map-btn / #filters-btn / #settings-btn
     rules don't leak font-size / padding / background into the mobile sheet */
  #map-btn.mobile-sheet-tool-btn,
  #filters-btn.mobile-sheet-tool-btn,
  #settings-btn.mobile-sheet-tool-btn,
  .mobile-sheet-tool-btn {
    flex: 1;
    width: 100%;
    min-height: 0;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 14px;
    background: var(--ms-card);
    border: none;
    border-radius: var(--ms-radius);
    box-shadow: var(--ms-shadow-sm);
    color: var(--ms-text);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    line-height: 1.2;
    cursor: pointer;
    white-space: normal;
    text-align: center;
    transition: transform 0.15s;
  }
  .mobile-sheet-tool-btn:active { transform: scale(0.97); }

  #filters-btn.mobile-sheet-tool-btn.has-active {
    background: #1e7d32;
    color: #fff;
  }

  .mobile-sheet-tool-btn > span:not(.mobile-sheet-tool-icon) {
    font-size: 13px;
    font-weight: 600;
    color: var(--ms-text);
  }

  .mobile-sheet-tool-icon {
    color: var(--ms-text-secondary);
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  .mobile-sheet-tool-icon svg { width: 18px; height: 18px; }

  /* Active filters badge */
  .mobile-sheet-button-row #active-filters-badge:not(.hidden) {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 10px;
    background: var(--ms-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Sticky Search Flights CTA */
  .mobile-sheet-cta {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 20px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    background: linear-gradient(to top, var(--ms-bg) 60%, transparent);
    z-index: 3201;
  }

  #mobile-sheet-search {
    width: 100%;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--ms-primary);
    color: #fff;
    border: none;
    border-radius: var(--ms-radius);
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    letter-spacing: -0.2px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(26,122,76,0.35);
    transition: transform 0.15s;
  }
  #mobile-sheet-search svg { width: 20px; height: 20px; }
  #mobile-sheet-search:active { transform: scale(0.98); }

  /* Footer data freshness */
  .mobile-sheet-body #header-right {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 4px 2px 0;
    font-size: 11px;
    color: var(--ms-text-secondary);
  }

  /* Hide legacy #header-filters-row remnants just in case */
  #header-filters-row {
    display: none;
  }

  #filter-inputs-row {
    display: none;
  }

  /* Input font sizes prevent iOS zoom */
  #cal-dest-filter,
  #cal-max-price,
  #cal-max-trip-time,
  #cal-max-layover,
  #daytrip-min-hours,
  .filter-row input[type="number"],
  .flex-origin-field input,
  .flex-origin-field select,
  #origin-select-wrapper .scrollable-select-button,
  #add-favorite .scrollable-select-button {
    font-size: 16px;
  }

  /* On mobile show a tighter legend with smaller padding */
  #gowild-legend {
    padding: 2px 14px 6px;
    font-size: 12px;
    line-height: 22px;
    gap: 14px;
    height: 22px;
  }

  #header-filters-row #cal-dest-filter,
  #header-filters-row .scrollable-select[data-select-id="specific-dest-select"],
  #header-filters-row #cal-max-price {
    width: 100%;
    flex: 0 0 auto;
  }

  #filter-inputs-row {
    display: flex;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  #filter-inputs-row #cal-max-price,
  #filter-inputs-row #cal-max-trip-time,
  #filter-inputs-row #cal-max-layover {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
  }

  #filters-dropdown {
    position: fixed;
    left: 12px;
    right: 12px;
    top: var(--mobile-sheet-top);
    bottom: auto;
    margin-top: 0;
    min-width: 0;
    height: var(--mobile-sheet-height);
    max-height: var(--mobile-sheet-height);
    overflow-y: auto;
    z-index: 3300;
    padding: 14px;
    border-radius: 22px;
    box-shadow: 0 24px 56px rgba(22, 38, 24, 0.22);
  }

  #filters-dropdown .toggle-row {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 12px;
  }

  #filters-dropdown .mode-row-label {
    order: 0;
  }

  #filters-dropdown .switch {
    order: 1;
    margin-left: auto;
  }

  .daytrip-inline {
    order: 2;
    width: 100%;
    margin-left: 0;
  }

  #cal-date-dropdown {
    position: fixed;
    top: var(--mobile-sheet-top);
    left: 12px;
    right: 12px;
    bottom: auto;
    margin-top: 0;
    min-width: 0;
    height: var(--mobile-sheet-height);
    max-height: var(--mobile-sheet-height);
    padding: 12px;
    z-index: 3300;
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #cal-date-grid {
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
  }

  .cal-picker-nav {
    padding: 2px 0 10px;
  }

  .cal-date-cell {
    min-height: 42px;
    font-size: 12px;
  }

  #cal-date-actions {
    position: sticky;
    bottom: 0;
    background: #fff;
    padding-top: 12px;
  }

  #settings-modal,
  #help-modal,
  #flex-origin-modal {
    align-items: flex-start;
    padding: var(--mobile-sheet-top) 12px 12px;
  }

  #settings-content,
  #help-content,
  #flex-origin-content {
    width: 100%;
    max-width: none;
    height: var(--mobile-sheet-height);
    max-height: var(--mobile-sheet-height);
    border-radius: 22px;
  }

  #settings-body,
  #flex-origin-form,
  #flex-origin-results {
    padding-left: 16px;
    padding-right: 16px;
  }

  #settings-header,
  #flex-origin-header {
    padding: 16px 16px 12px;
  }

  #settings-actions {
    position: sticky;
    bottom: 0;
    margin: 18px -16px 0;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
    background: #fff;
  }

  .settings-preference-row {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .settings-segment-toggle {
    width: 100%;
  }

  .settings-segment-toggle .segment-btn {
    flex: 1 1 0;
  }

  .flex-origin-fields {
    grid-template-columns: 1fr;
  }

  #flex-origin-content {
    height: min(88dvh, 860px);
  }

  #flex-origin-suggestions {
    max-height: 240px;
  }

  .flex-origin-match-list {
    flex-direction: column;
  }

  .flex-origin-match {
    width: 100%;
    min-width: 0;
    flex: 0 0 auto;
  }

  #flex-origin-actions,
  .flex-origin-destination-actions {
    display: block;
  }

  #flex-origin-search,
  #flex-origin-go,
  #flex-destination-go {
    width: 100%;
  }

  #map-modal {
    inset: 0;
    border-radius: 0;
  }

  #map-modal-header {
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
  }

  #map-modal-body {
    min-height: 0;
  }

  #map {
    min-height: 46vh;
  }

  #map-route-popover {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    max-height: min(58dvh, 520px);
    transform: none;
    border-radius: 22px 22px 0 0;
    border-bottom: none;
  }

  #map-route-popover-header {
    padding: 14px 16px 10px;
  }

  #map-route-popover-body {
    padding: 0 16px calc(16px + env(safe-area-inset-bottom));
    max-height: 44vh;
  }

  #calendar-view {
    min-height: 0;
    flex: 1 0 auto;
    overflow: visible;
  }

  #route-summary {
    padding: 10px 14px 2px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    line-height: 1.4;
  }

  #calendar-grid {
    flex: 0 0 auto;
    padding: 4px 14px var(--mobile-toolbar-clearance);
    overflow: visible;
    scroll-padding-bottom: var(--mobile-toolbar-clearance);
  }

  #calendar-grid-inner,
  #calendar-grid-inner.focused-mode,
  #calendar-grid-inner.roundtrip-return-mode {
    min-width: 0;
    width: 100%;
    min-height: 100%;
  }

  .roundtrip-selection-summary {
    width: auto;
    max-width: none;
    left: auto;
    top: 0;
    margin-bottom: 10px;
    padding: 10px;
  }

  .roundtrip-selection-header {
    flex-wrap: wrap;
    margin-bottom: 6px;
  }

  .roundtrip-selection-route {
    font-size: 15px;
  }

  .roundtrip-selection-cards {
    flex-direction: column;
  }

  .roundtrip-summary-card {
    width: 100%;
    flex: 0 0 auto;
  }

  .dest-section {
    margin-bottom: 18px;
  }

  .dest-header,
  #calendar-grid-inner.focused-mode .dest-header,
  #calendar-grid-inner.roundtrip-return-mode .dest-header {
    position: sticky;
    top: 0;
    left: auto;
    width: auto;
    max-width: none;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 6px 2px 8px;
    background: #f6f7f9;
    z-index: 2;
  }

  .dest-header.is-collapsible {
    cursor: pointer;
  }

  .dest-header.is-collapsible .dest-best {
    width: auto;
    margin-left: 0;
  }

  .dest-best {
    width: 100%;
    margin-left: 0;
  }

  .dest-collapse-toggle {
    display: inline-flex;
  }

  .day-cards,
  .day-cards.day-cards-grid {
    display: flex;
    flex-direction: row;
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x proximity;
  }

  .day-cards.is-mobile-expanded {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 7px;
    overflow-x: visible;
    scroll-snap-type: none;
    padding-bottom: 12px;
  }

  .day-card,
  .day-cards.day-cards-grid .day-card {
    width: min(92px, calc(100vw - 196px));
    flex: 0 0 min(92px, calc(100vw - 196px));
    min-height: 0;
    padding: 4px;
    scroll-snap-align: start;
  }

  .day-cards.is-mobile-expanded .day-card {
    width: auto;
    flex: none;
    scroll-snap-align: none;
  }

  #calendar-grid-inner.roundtrip-return-mode .dest-section {
    min-width: 0;
  }

  .day-label {
    margin-bottom: 6px;
    font-size: 0.7rem;
    padding: 0 2px;
  }

  .cal-flight {
    min-height: 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
    width: 100%;
    margin-bottom: 4px;
    padding: 6px 5px 7px;
  }

  .cal-flight .cal-left,
  .cal-flight .cal-right {
    width: 100%;
  }

  .cal-flight .cal-right {
    align-items: flex-start;
    margin-left: 0;
    gap: 2px;
  }

  .cal-flight-roundtrip .cal-right {
    justify-content: flex-start;
    gap: 2px;
  }

  .cal-flight .cal-time-depart {
    font-size: 0.86rem;
  }

  .cal-flight .cal-time-arrive {
    font-size: 0.7rem;
  }

  .cal-flight .cal-num {
    font-size: 0.68rem;
  }

  .cal-flight .cal-price {
    font-size: 0.92rem;
  }

  .day-card .cal-flight:last-child {
    margin-bottom: 0;
  }

  #scrollable-select-menu.is-mobile-sheet {
    left: 12px !important;
    right: 12px !important;
    bottom: auto !important;
    width: auto !important;
    padding: 8px 0;
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(22, 38, 24, 0.2);
    overscroll-behavior: contain;
  }

  #scrollable-select-menu.is-mobile-sheet .scrollable-select-option {
    padding: 14px 16px;
    font-size: 15px;
  }
}

#app-toast {
  position: fixed;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #1a1d23;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  max-width: 320px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  pointer-events: none;
}
#app-toast.app-toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
