:root {
  color-scheme: light;
  --canvas: #f3f6f9;
  --paper: #fff;
  --ink: #142b43;
  --navy: #112840;
  --secondary: #65768a;
  --muted: #687b8f;
  --line: #e2e8ef;
  --red: #c8293d;
  --red-dark: #ac1e30;
  --red-wash: #fff1f3;
  --green: #166534;
  --green-wash: #ecfdf5;
  --amber: #856026;
  --amber-wash: #fff6e6;
  --radius: 12px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: auto; scroll-padding-top: 20px; }
body { margin: 0; background: var(--canvas); color: var(--ink); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .45; }
button, input, select, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid #bd293e60;
  outline-offset: 4px;
}
button svg { pointer-events: none; }
[hidden] { display: none !important; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
a { color: inherit; }

.app-shell { width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 40px; }
.top-band { background: var(--navy); color: #fff; }
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  border-bottom: 1px solid #ffffff13;
  gap: 16px;
}
.brand { display: flex; gap: 11px; align-items: center; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; border-radius: 9px; background: var(--red); color: #fff; }
.brand-mark svg { width: 26px; height: 26px; stroke: none; }
.brand-name { font-size: 19px; font-weight: 650; letter-spacing: .5px; display: flex; gap: 7px; align-items: baseline; }
.brand-name strong { font-weight: 750; letter-spacing: 1px; }
.brand-caption { font-size: 13px; font-weight: 400; color: #b6c4d2; margin-left: 11px; padding-left: 18px; border-left: 1px solid #ffffff30; letter-spacing: 0; }

.header-actions { display: flex; align-items: center; gap: 20px; }
.header-source { font-size: 12px; display: flex; align-items: center; gap: 9px; color: #aabbd0; }
.status-dot { height: 6px; width: 6px; border-radius: 50%; background: #83b5a7; }
.header-nav { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #c7d6e6; }
.header-link { background: transparent; border: 0; padding: 4px 8px; color: #d5e2f0; border-radius: 5px; font-size: 13px; font-weight: 500; transition: background .15s, color .15s; }
.header-link:hover { color: #fff; background: #ffffff14; }
.header-link.active { color: #fff; background: #ffffff24; font-weight: 600; }
.header-divider { color: #ffffff40; }

.hero { padding-top: 31px; padding-bottom: 81px; }
.eyebrow { font-size: 10px; font-weight: 600; letter-spacing: 2.1px; color: #93adc6; margin-bottom: 12px; }
h1 { font-size: 48px; font-weight: 700; letter-spacing: -1.7px; line-height: 1.28; margin: 0 0 15px; }
h1 span { color: #fff; font-weight: 500; }
.hero-description { font-size: 14px; line-height: 1.9; color: #b7c8d9; margin: 0; }

/* Search Card */
.search-card {
  position: relative;
  margin-top: -42px;
  background: var(--paper);
  border: 1px solid #dce4ed;
  border-radius: var(--radius);
  box-shadow: 0 12px 34px #1739570d;
  padding: 23px 26px 16px;
}
.search-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-bottom: 20px;
}
.membership-control { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.membership-option {
  border: 1px solid transparent;
  background: transparent;
  white-space: nowrap;
  border-radius: 7px;
  min-height: 38px;
  padding: 0 15px;
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.membership-option > span { font-size: 10px; font-weight: 450; color: inherit; opacity: .75; margin-left: 7px; }
.membership-option.active { background: var(--navy); color: #fff; }
.membership-option:not(.active):hover { background: #f0f4f8; color: var(--ink); }

.trip-control { display: flex; border-bottom: 1px solid var(--line); gap: 21px; }
.trip-option {
  background: transparent;
  border: 0;
  padding: 10px 4px;
  font-size: 14px;
  color: var(--secondary);
  font-weight: 600;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.trip-option.active { color: var(--red); border-bottom-color: var(--red); }

.search-fields { display: flex; align-items: stretch; gap: 12px; }
.route-inputs {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr);
  flex: 1;
  min-width: 0;
  gap: 5px;
  align-items: center;
}
.place-field {
  position: relative;
  min-width: 0;
  padding: 12px 14px 10px;
  border: 1px solid var(--line);
  background: #fcfdff;
  border-radius: 8px;
  transition: border .15s, box-shadow .15s;
}
.place-field:focus-within { border-color: #768ea8; box-shadow: 0 0 0 3px #11284007; }
.place-field > label, .date-field > label {
  font-size: 11px;
  display: block;
  line-height: 1.5;
  color: var(--secondary);
  font-weight: 500;
  margin-bottom: 6px;
}
.optional-label { font-size: 10px; color: var(--muted); margin-left: 5px; }
.place-value { display: flex; align-items: center; gap: 7px; }
.place-value > input {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -.5px;
  color: var(--ink);
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  line-height: 1.3;
  min-width: 0;
  padding: 0;
}
.place-value > input::placeholder { font-size: 18px; font-weight: 400; color: #9ba8b6; letter-spacing: 0; }
.place-value > input:focus-visible { outline: none; }
.field-hint {
  font-size: 10px;
  color: var(--muted);
  display: block;
  line-height: 1.5;
  margin-top: 5px;
  min-height: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clear-button {
  width: 21px;
  height: 21px;
  flex-shrink: 0;
  border: 0;
  background: #eaf0f5;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--secondary);
}
.clear-button > svg { height: 11px; width: 11px; }
.swap-button {
  width: 28px;
  height: 28px;
  justify-self: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--secondary);
  display: grid;
  place-items: center;
}
.swap-button:hover:not(:disabled) { color: var(--red); background: var(--red-wash); }
.swap-button svg { width: 19px; height: 19px; }

.date-fields { display: flex; gap: 10px; flex-shrink: 0; }
.date-field {
  padding: 12px 14px 10px;
  background: #fcfdff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 172px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.date-field:hover { border-color: #9dafc2; background: #f8faff; }
.date-field:focus-within { border-color: #768ea8; box-shadow: 0 0 0 3px #1128400d; }
.date-field select {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  width: 100%;
  border: 0;
  background: transparent;
  line-height: 29px;
  padding: 0;
  cursor: pointer;
  min-width: 0;
  outline: none;
}
.date-field > span { font-size: 10px; color: var(--muted); margin-top: 4px; line-height: 15px; }

.search-button {
  width: 144px;
  flex-shrink: 0;
  align-self: stretch;
  border: 0;
  border-radius: 8px;
  color: white;
  background: var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s;
}
.search-button:hover:not(:disabled) { background: var(--red-dark); }
.search-button > svg { height: 20px; width: 20px; }

/* Subbar inside search card */
.search-subbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eef2f6;
}
.quick-toggles { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-pill {
  background: #f4f7fa;
  border: 1px solid #dce4ed;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 550;
  color: var(--secondary);
  transition: all .15s;
}
.filter-pill:hover { border-color: #9cafc3; color: var(--ink); }
.filter-pill[aria-pressed="true"], .filter-pill[aria-expanded="true"] {
  background: var(--red-wash);
  border-color: #eb99a4;
  color: var(--red);
}
.form-footnote-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.6;
}
.dot-sep { color: #c5d0dc; }

.more-filters-panel {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.more-filter-group { display: flex; flex-direction: column; gap: 5px; min-width: 190px; flex: 1; }
.more-filter-group label { font-size: 11px; color: var(--secondary); font-weight: 550; }
.more-filter-group select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d5e0eb;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: var(--ink);
}
.reset-subfilters-btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid #d5e0eb;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: var(--secondary);
}
.reset-subfilters-btn:hover { color: var(--ink); border-color: #9cafc3; }

.form-error {
  padding: 10px 12px;
  background: var(--red-wash);
  color: var(--red);
  margin-top: 12px;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
}

/* Autocomplete Dropdown */
.place-options {
  position: absolute;
  z-index: 30;
  left: -1px;
  right: -1px;
  top: calc(100% + 6px);
  min-width: 260px;
  max-height: min(420px, 65vh);
  overflow: auto;
  padding: 6px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 40px #142b4320;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: #a5b5c5 #f0f4f8;
  overscroll-behavior: contain;
}
.options-header {
  position: sticky;
  top: -6px;
  z-index: 2;
  display: grid;
  gap: 4px;
  padding: 12px 12px 11px;
  margin: -6px -6px 3px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  line-height: 1.6;
}
.options-header strong { font-size: 12px; font-weight: 600; color: var(--ink); }
.options-header span { font-size: 10px; color: var(--muted); }
.option-group { font-size: 10px; font-weight: 600; color: var(--secondary); padding: 10px 12px 6px; letter-spacing: .3px; }
.option-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 5px;
  font-size: 13px;
  cursor: pointer;
}
.option-item.option-airport { padding-left: 25px; font-size: 12px; color: var(--secondary); }
.option-item:hover, .option-item.highlighted { background: #f1f5f9; }
.option-item.selected { color: var(--red); background: var(--red-wash); }
.option-main { display: flex; align-items: center; gap: 9px; min-width: 0; }
.option-main svg { width: 16px; height: 16px; flex-shrink: 0; }
.option-label { font-weight: 550; line-height: 1.5; }
.option-detail { font-size: 10px; color: var(--muted); white-space: nowrap; }
.option-empty { font-size: 12px; color: var(--secondary); padding: 17px 12px; }

/* Workspace Mode Navigation */
.workspace-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 18px;
  border-bottom: 1px solid var(--line);
}
.workspace-tabs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ws-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 11px 14px;
  margin-bottom: -1px;
  font-size: 14px;
  font-weight: 600;
  color: var(--secondary);
  transition: color .15s, border-color .15s;
}
.ws-tab:hover { color: var(--ink); }
.ws-tab.active { color: var(--red); border-bottom-color: var(--red); }
.ws-tab-secondary { font-size: 13px; font-weight: 550; }
.ws-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 10px;
  background: #e7eef5;
  color: var(--secondary);
}
.ws-tab.active .ws-badge { background: var(--red-wash); color: var(--red); }
.plan-note-inline { font-size: 11px; color: var(--muted); padding-bottom: 6px; }

/* Results Section */
.results-section { padding: 26px 0 40px; min-height: 250px; }
.welcome-state {
  border-top: 1px solid var(--line);
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 32px;
  align-items: center;
}
.welcome-label { font-size: 10px; color: var(--muted); font-weight: 600; letter-spacing: 1px; }
.welcome-state h2 { font-size: 20px; font-weight: 600; margin: 8px 0 9px; letter-spacing: -.2px; }
.welcome-state p { font-size: 12px; line-height: 1.8; color: var(--secondary); margin: 0; max-width: 600px; }
.quick-origins {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  max-width: 420px;
  flex-shrink: 0;
}
.quick-origins > span { flex-basis: 100%; font-size: 10px; color: var(--muted); text-align: right; margin-bottom: 3px; }
.quick-origins button {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-size: 12px;
  padding: 7px 11px;
  color: var(--secondary);
}
.quick-origins button:hover { border-color: #9cafc3; color: var(--ink); }

.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 18px;
}
.results-eyebrow { font-size: 10px; color: var(--secondary); margin-bottom: 8px; letter-spacing: .5px; }
.results-heading h2 { font-size: 28px; font-weight: 600; letter-spacing: -.8px; margin: 0; line-height: 1.4; }
.results-heading h2 strong { font-weight: 700; color: var(--red); }
.results-subtitle { font-size: 12px; color: var(--secondary); margin: 8px 0 0; line-height: 1.9; }
.results-tools { display: flex; align-items: center; gap: 10px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.result-filter {
  border: 1px solid #d7e1eb;
  border-radius: 6px;
  background: white;
  font-size: 12px;
  padding: 9px 12px;
  color: var(--ink);
  width: 190px;
  min-height: 37px;
}
.result-sort {
  font-size: 12px;
  color: var(--ink);
  background: white;
  border: 1px solid #d7e1eb;
  border-radius: 6px;
  padding: 8px 10px;
  min-height: 37px;
}
.share-query {
  background: white;
  color: var(--secondary);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  white-space: nowrap;
  min-height: 37px;
}
.share-query:hover { border-color: #9aabbc; color: var(--ink); }
.share-query.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.query-scope {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  padding: 17px 20px;
  margin-bottom: 19px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 7px;
  align-items: start;
}
.query-scope > div { display: grid; gap: 5px; min-width: 135px; }
.query-scope > div > span { font-size: 10px; color: var(--muted); line-height: 1.6; }
.query-scope strong { font-size: 13px; font-weight: 600; line-height: 1.5; font-variant-numeric: tabular-nums; }
.query-scope small { font-size: 10px; line-height: 1.6; color: var(--secondary); font-weight: 400; }
.route-separator { font-weight: 400; color: #94a3b4; }

.roundtrip-summary {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  align-items: center;
  padding: 3px 1px 16px;
  font-size: 12px;
  color: var(--secondary);
  line-height: 1.7;
}
.roundtrip-summary strong { font-size: 15px; font-weight: 650; color: var(--ink); margin-inline: 3px; font-variant-numeric: tabular-nums; }

.result-workspace {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.destination-navigation {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding-right: 8px;
}
.navigation-heading {
  font-size: 10px;
  letter-spacing: .5px;
  color: var(--muted);
  padding: 4px 12px 10px;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}
.unmatched-navigation-heading { color: #9a743c; margin-top: 14px; }
.destination-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 9px 12px;
  border-radius: 6px;
  line-height: 1.5;
  font-size: 13px;
  color: var(--secondary);
  margin-bottom: 3px;
}
.destination-link > span:last-child { margin-left: auto; font-size: 10px; color: var(--muted); }
.destination-link:hover { background: #e7eef5; color: var(--ink); }
.unmatched-link { color: #8b6d40; }

.destination-grid { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.destination-group {
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  overflow: hidden;
  min-width: 0;
  scroll-margin-top: 20px;
}
.destination-header {
  padding: 16px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  background: #fbfcfe;
  flex-wrap: wrap;
}
.destination-title { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.destination-name { font-size: 22px; font-weight: 650; letter-spacing: -.5px; margin: 0; line-height: 1.4; }
.destination-airports { font-size: 11px; color: var(--muted); letter-spacing: .4px; }
.destination-meta-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.destination-count { font-size: 12px; color: var(--secondary); white-space: nowrap; font-weight: 550; }

.header-badge {
  font-size: 11px;
  font-weight: 550;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.badge-tier-base { background: #eef2f6; color: var(--secondary); }
.badge-tier-upgrade { background: var(--red-wash); color: var(--red); }
.badge-season-sa { background: var(--amber-wash); color: var(--amber); }
.badge-season-ws { background: var(--green-wash); color: var(--green); }

/* Complete Flight Table (Benchmark: Loong Air / HNA) */
.flight-table-heading {
  display: grid;
  grid-template-columns: minmax(135px, 1.15fr) minmax(120px, 1fr) 100px minmax(120px, 1fr) minmax(145px, 1.35fr);
  gap: 16px;
  padding: 11px 22px 8px;
  font-size: 10px;
  color: var(--muted);
}
.flight-table-heading > span:nth-child(3) { text-align: center; }
.flight-row {
  display: grid;
  grid-template-columns: minmax(135px, 1.15fr) minmax(120px, 1fr) 100px minmax(120px, 1fr) minmax(145px, 1.35fr);
  gap: 16px;
  align-items: center;
  padding: 19px 22px;
  min-width: 0;
}
.flight-row + .flight-row { border-top: 1px solid #edf1f5; }
.flight-identity { min-width: 0; }
.flight-no { font-size: 14px; font-weight: 650; letter-spacing: .35px; line-height: 1.3; }
.flight-airline { font-size: 11px; color: var(--secondary); margin-top: 5px; line-height: 1.5; }
.flight-airline.nofee-text { color: var(--green); font-weight: 550; }
.tier-tags { display: flex; gap: 4px; margin-top: 6px; flex-wrap: wrap; }
.tier-tag {
  color: var(--red);
  background: var(--red-wash);
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  font-weight: 550;
  line-height: 1.3;
}
.tier-tag-neutral {
  color: var(--secondary);
  background: #eff3f8;
}
.tier-tag-ineligible {
  color: var(--amber);
  background: var(--amber-wash);
}
.flight-row-ineligible {
  background: #fffdf9;
}
.flight-endpoint { min-width: 0; }
.flight-time {
  font-size: 25px;
  line-height: 1.05;
  font-weight: 600;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.day-offset {
  font-size: 10px;
  color: var(--red);
  margin-left: 4px;
  vertical-align: super;
  font-weight: 600;
  letter-spacing: 0;
}
.airport-label {
  font-size: 11px;
  line-height: 1.6;
  color: var(--secondary);
  margin-top: 6px;
  overflow-wrap: break-word;
}
.airport-label > span { color: var(--muted); font-size: 10px; white-space: nowrap; }
.flight-path { color: var(--muted); text-align: center; min-width: 0; }
.flight-duration { font-size: 10px; font-variant-numeric: tabular-nums; line-height: 1.4; margin-bottom: 8px; }
.flight-line { height: 1px; background: #d3dce6; margin: 6px 2px 0; position: relative; }
.flight-line:before {
  content: "";
  position: absolute;
  left: 0;
  top: -2px;
  width: 5px;
  height: 5px;
  background: white;
  border: 1px solid #b8c8d7;
  border-radius: 50%;
}
.flight-line:after {
  content: "";
  position: absolute;
  right: 0;
  top: -3px;
  width: 5px;
  height: 5px;
  border-right: 1px solid #b8c8d7;
  border-top: 1px solid #b8c8d7;
  transform: rotate(45deg);
}
.flight-stops { font-size: 11px; line-height: 1.5; margin-top: 7px; color: var(--secondary); font-weight: 500; }
.flight-stops.is-stop { color: var(--amber); }
.flight-details { display: grid; gap: 4px; font-size: 11px; color: var(--muted); line-height: 1.6; }
.flight-details .weekday-label { font-size: 12px; color: var(--ink); font-weight: 550; line-height: 1.5; }
.flight-details .elig-label { font-size: 10px; color: var(--secondary); }
.flight-details .elig-label.is-ineligible { color: var(--amber); font-weight: 550; }
.validity-label { font-size: 10px; color: var(--muted); line-height: 1.6; }

/* Compact View Modifier (Optional toggle for power users) */
.compact-mode .flight-row { padding: 11px 22px; }
.compact-mode .flight-time { font-size: 19px; }
.compact-mode .airport-label { margin-top: 2px; font-size: 10px; }
.compact-mode .flight-duration { margin-bottom: 4px; }
.compact-mode .destination-header { padding: 12px 22px; }
.compact-mode .destination-name { font-size: 18px; }

/* Roundtrip & Combinations */
.flight-leg-heading {
  font-size: 11px;
  font-weight: 600;
  margin: 0;
  padding: 12px 22px;
  background: #f4f7fa;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid #edf1f5;
  display: flex;
  justify-content: space-between;
  color: var(--ink);
}
.flight-leg-heading > span { font-weight: 400; color: var(--secondary); }
.flight-leg-heading:first-of-type { border-top: 0; }
.roundtrip-note {
  font-size: 11px;
  color: var(--secondary);
  line-height: 1.7;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  margin: 0;
  background: #fff;
}
.combination-section { border-top: 1px solid var(--line); }
.combination-section > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 11px;
  font-weight: 600;
  background: #f8fafc;
  line-height: 1.6;
}
.combination-section > summary::-webkit-details-marker { display: none; }
.combination-section > summary:after { content: "+"; margin-left: auto; font-size: 16px; color: var(--secondary); font-weight: 400; }
.combination-section[open] > summary:after { content: "−"; }
.combination-section > summary > span { font-size: 10px; font-weight: 400; color: var(--muted); }
.combinations-list { padding: 0 22px; }
.combination-row {
  display: grid;
  grid-template-columns: 1fr 20px 1fr 135px;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  font-size: 11px;
  line-height: 1.7;
  color: var(--secondary);
  border-top: 1px solid #edf1f5;
}
.combination-row:first-child { border-top: 0; }
.combination-transfer { background: #fffaf3; }
.airport-change {
  grid-column: 1 / -1;
  margin: 0;
  padding: 6px 8px;
  border-radius: 4px;
  background: #fff1dc;
  color: #8a4e12;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.6;
}
.combination-flight { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; }
.combination-flight b { font-weight: 600; color: var(--ink); font-size: 11px; }
.combination-flight time { font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 550; }
.combination-connector { color: #8a9aab; text-align: center; }
.combination-stay { text-align: right; font-size: 10px; color: var(--secondary); }
.combination-stay strong { font-weight: 600; color: var(--ink); }

.unmatched-section { display: flex; flex-direction: column; gap: 17px; margin-top: 12px; }
.unmatched-heading { padding: 6px 0 0; }
.unmatched-heading h3 { font-size: 17px; font-weight: 600; margin: 0 0 8px; }
.unmatched-heading h3 > span { font-size: 11px; font-weight: 400; color: var(--secondary); margin-left: 9px; }
.unmatched-heading p { font-size: 12px; color: var(--secondary); line-height: 1.8; margin: 0; }
.unmatched-group { border-color: #e6dfd2; }
.unmatched-count { color: #93662d; }
.unmatched-note { color: #886735; background: #fffaf1; }
.turnaround-note { color: #196b45; background: #f3fbf7; }
.unmatched-return {
  font-size: 11px;
  line-height: 1.8;
  color: #8a6b37;
  padding: 13px 22px;
  border-top: 1px solid var(--line);
  background: #fffaf2;
}

/* Pending Schedules Grid (Unscheduled Whitelist Routes) */
.pending-routes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.pending-route-card {
  background: #fff;
  border: 1px solid #e6dfd2;
  border-radius: 8px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.pending-route-card strong { font-size: 15px; font-weight: 600; }
.pending-route-card span { font-size: 11px; color: var(--secondary); }

/* Transfer & Loop Sub-controls & Timelines */
.subview-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 15px 20px;
  margin-bottom: 18px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.subview-control-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.subview-control-group label { font-size: 12px; color: var(--secondary); font-weight: 550; }
.subview-control-group select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #d5e0eb;
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: var(--ink);
}
.transfer-hub-banner {
  padding: 10px 22px;
  background: #f4f8fb;
  border-top: 1px solid #edf1f5;
  border-bottom: 1px solid #edf1f5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink);
}
.transfer-hub-banner strong { color: var(--red); }

/* Rules & About Cards */
.rules-layout { display: flex; flex-direction: column; gap: 20px; }
.rule-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 22px 24px;
}
.rule-card h3 { font-size: 18px; font-weight: 650; margin: 0 0 14px; }
.rule-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rule-table th, .rule-table td {
  text-align: left;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.rule-table th { font-size: 11px; color: var(--secondary); background: #f8fafc; font-weight: 600; }
.route-chip-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.route-pair-chip {
  background: #f8fafc;
  border: 1px solid #d5e0eb;
  border-radius: 6px;
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 550;
  color: var(--ink);
  transition: all .15s;
}
.route-pair-chip:hover {
  border-color: var(--red);
  color: var(--red);
  background: var(--red-wash);
}

.empty-state {
  border: 1px solid var(--line);
  border-radius: 9px;
  text-align: center;
  padding: 45px 20px;
  background: #fff;
}
.empty-state > svg { width: 29px; height: 29px; color: #adbdcc; margin: 0 auto 17px; stroke-width: 1.4; }
.empty-state h3 { font-size: 17px; font-weight: 600; margin: 0 0 11px; }
.empty-state p { font-size: 12px; color: var(--secondary); line-height: 1.9; margin: 0; max-width: 570px; margin-inline: auto; }
.empty-reset {
  font-size: 12px;
  color: var(--red);
  background: var(--red-wash);
  border: 0;
  padding: 10px 14px;
  border-radius: 6px;
  margin-top: 18px;
  font-weight: 600;
}
.results-endnote { text-align: center; font-size: 11px; color: var(--muted); margin: 25px 0 0; line-height: 1.8; }
.result-counter { font-size: 11px; color: var(--secondary); margin: 0 0 12px; }

.site-footer {
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  padding: 22px 0 25px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  line-height: 1.7;
}
.site-footer > span:first-child { font-weight: 600; color: var(--secondary); }

/* The result list stays complete; density changes never hide flights. */
.destination-actions { display:flex; align-items:center; justify-content:flex-end; gap:16px; flex-wrap:wrap; padding:11px 22px; border-top:1px solid var(--line); background:#fbfcfe; font-size:12px; color:var(--secondary); }
.destination-actions button { border:0; background:transparent; color:var(--red); font-size:12px; min-height:32px; padding:4px 0; }
.destination-actions button:hover { text-decoration:underline; }
.browse-all-button { margin-top:14px; padding:9px 13px; border:1px solid var(--line); border-radius:6px; background:var(--paper); color:var(--secondary); font-size:12px; }
.query-dirty { margin-top:12px; padding:10px 14px; background:var(--amber-wash); border-radius:6px; color:var(--amber); font-size:12px; line-height:1.7; }
.planning-note { margin:0 0 20px; padding:12px 16px; border-left:3px solid #b8c8d7; background:#eaf0f5; border-radius:0 6px 6px 0; color:var(--secondary); font-size:12px; line-height:1.8; }
.plan-title { margin:0; font-size:19px; font-weight:650; line-height:1.6; overflow-wrap:anywhere; }
.load-more { display:flex; justify-content:center; padding:24px; }
.body-copy { font-size:14px; color:var(--secondary); line-height:1.9; margin:12px 0 0; }
.body-copy a { color:var(--red); text-underline-offset:3px; }
.table-scroll { overflow-x:auto; max-width:100%; }
.rule-facts { display:grid; grid-template-columns:1fr 1fr; gap:18px 28px; margin:0; }
.rule-facts dt { font-size:12px; color:var(--secondary); margin-bottom:5px; }
.rule-facts dd { font-size:14px; margin:0; line-height:1.8; }
.rule-card summary { cursor:pointer; font-size:16px; font-weight:600; line-height:1.6; }
.app-notice { position:fixed; bottom:24px; left:50%; transform:translateX(-50%); width:max-content; max-width:calc(100vw - 32px); z-index:100; border-radius:8px; padding:13px 20px; color:white; background:var(--navy); box-shadow:0 8px 24px #11284025; font-size:13px; line-height:1.6; }
.flight-row > *, .query-scope > *, .results-heading > *, .view-panel { min-width:0; }
.flight-details, .flight-airline { overflow-wrap:anywhere; }
.compact-mode .flight-details { display:grid; }
.result-workspace:has(.destination-navigation[hidden]) { grid-template-columns:1fr; }
.filter-pill.active { border-color:var(--red); color:var(--red); background:var(--red-wash); }
.clear-button { width:28px; height:28px; }
.field-hint { white-space:normal; }
.results-tools button, .result-filter, .result-sort { min-height:40px; }

@media (max-width: 1200px) {
  .app-shell { padding-inline: 28px; }
  .search-fields { flex-wrap: wrap; }
  .route-inputs { flex-basis: calc(100% - 480px); }
  .search-fields:has(.return-date-field:not([hidden])) .route-inputs { flex-basis: 100%; }
  .search-fields:has(.return-date-field:not([hidden])) .date-fields { flex: 1; }
  .search-fields:has(.return-date-field:not([hidden])) .date-field { flex: 1; }
  .search-fields:has(.return-date-field:not([hidden])) .search-button { min-height: 78px; width: 180px; }
  .result-workspace { grid-template-columns: 140px minmax(0, 1fr); gap: 18px; }
  .flight-row, .flight-table-heading {
    grid-template-columns: minmax(110px, 1fr) minmax(105px, 1fr) 82px minmax(105px, 1fr) minmax(115px, 1.15fr);
    gap: 12px;
    padding-inline: 18px;
  }
  .flight-time { font-size: 24px; }
  .destination-header { padding-inline: 18px; }
}

@media (max-width: 900px) {
  .welcome-state, .results-heading { flex-direction:column; align-items:stretch; gap:20px; }
  .quick-origins { max-width:none; justify-content:flex-start; flex-shrink:1; }
  .quick-origins > span { text-align:left; }
  .results-tools { justify-content:flex-start; }
  .header-actions { gap:8px; }
  .header-source { display:none; }
  .app-shell { padding-inline: 24px; }
  .hero { padding-top: 28px; padding-bottom: 74px; }
  h1 { font-size: 40px; }
  .search-card { padding: 19px 20px 15px; }
  .route-inputs { flex-basis: 100%; flex: none; width: 100%; }
  .date-fields { flex: 1; }
  .date-field { flex: 1; }
  .search-button { min-height: 78px; width: 160px; }
  .result-workspace { grid-template-columns: 1fr; gap: 16px; }
  .destination-navigation {
    position: static;
    max-height: none;
    overflow: auto;
    display: flex;
    gap: 6px;
    align-items: center;
    padding: 0 0 6px;
    white-space: nowrap;
  }
  .navigation-heading { display: none; }
  .destination-link {
    background: #eaf0f5;
    font-size: 11px;
    padding: 7px 10px;
    margin: 0;
    flex-shrink: 0;
    border: 1px solid #e1e8ef;
  }
}

@media (max-width: 650px) {
  .hero-description { font-size:13px; }
  .brand-name { font-size:17px; gap:4px; }
  .header-nav { gap:0; }
  .header-link { font-size:11px; padding:8px 3px; }
  .header-divider { display:none; }
  .results-heading h2 { font-size:25px; }
  .result-filter { width:100%; flex-basis:100%; }
  .result-sort { flex:1; min-width:0; }
  .results-tools { gap:8px; }
  .result-workspace { gap:14px; }
  .destination-name { font-size:20px; }
  .rule-facts { grid-template-columns:1fr; gap:14px; }
  .rule-card { padding:18px 16px; }
  .rule-table { min-width:620px; }
  .site-footer { flex-direction:column; gap:6px; }
  .header-actions { flex-shrink:0; }
  .destination-actions { padding-inline:16px; gap:12px; justify-content:flex-start; }
  .plan-title { font-size:17px; }
  .workspace-tabs { gap:0; }
  .ws-tab { font-size:13px; padding:11px 10px; }
  .ws-tab-secondary { display:none; }
  .query-scope { gap:14px; padding:14px; }
  .query-scope > div { min-width:120px; }
  .compact-mode .flight-row { padding:12px 16px; }
  .compact-mode .flight-details { display:flex; }
  .app-shell { padding-inline: 16px; }
  .site-header { min-height: 70px; }
  .brand-caption, .header-source { display: none; }
  .hero { padding-top: 24px; padding-bottom: 62px; }
  h1 { font-size: 30px; }
  .search-card { margin-top: -35px; padding: 15px 14px 13px; border-radius: 10px; }
  .search-topline { flex-direction: column; align-items: stretch; gap: 12px; padding-bottom: 14px; }
  .membership-control { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .membership-option { font-size: 12px; padding-inline: 8px; min-height: 36px; background: #f3f6f9; border-radius: 6px; }
  .membership-option > span { display: none; }
  .trip-control { align-self: flex-end; gap: 22px; }
  .date-fields { width: 100%; flex-basis: 100%; gap: 8px; }
  .date-field { min-width: 0; padding: 10px 12px 9px; }
  .search-button, .search-fields:has(.return-date-field:not([hidden])) .search-button {
    width: 100%;
    min-height: 45px;
    font-size: 13px;
  }
  .flight-table-heading { display: none; }
  .flight-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 86px minmax(0, 1fr);
    gap: 11px 12px;
    padding: 15px 16px;
  }
  .flight-identity { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .flight-endpoint:nth-of-type(4) { text-align: right; }
  .flight-details {
    grid-column: 1 / -1;
    display: flex;
    gap: 7px 13px;
    flex-wrap: wrap;
    font-size: 10px;
    border-top: 1px dashed var(--line);
    padding-top: 9px;
  }
  .combination-row { grid-template-columns: 1fr 17px 1fr; gap: 6px; }
  .combination-stay { grid-column: 1 / -1; text-align: left; }
}
