:root {
  color-scheme: light;
  font-family: "Inter", "Segoe UI", sans-serif;
  --ink: #10263d;
  --muted: #53677b;
  --paper: #f3f7fb;
  --line: #dbe5ee;
  --brand: #055dc6;
}

* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--paper); }
[hidden] { display: none !important; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
.header { background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 68px; }
.brand { color: var(--ink); text-decoration: none; font-size: 1.3rem; font-weight: 800; }
.brand span { color: var(--brand); margin-right: .35rem; }
.mode { background: #eaf3ff; color: #174d8a; border-radius: 100px; padding: .4rem .85rem; font-size: .9rem; }
.intro {
  margin-top: 30px; border-radius: 24px; padding: clamp(28px, 5vw, 64px);
  color: white; background: linear-gradient(120deg, #092a50, #164880 66%, #2266a8);
  display: flex; justify-content: space-between; align-items: center; position: relative; overflow: hidden;
}
.intro > div:first-child { position: relative; z-index: 1; max-width: 70%; }
h1 { font-size: clamp(2.5rem, 7vw, 5rem); letter-spacing: -.065em; line-height: .97; margin: 0; }
.intro p { color: #deeefe; font-size: clamp(1rem, 2vw, 1.2rem); max-width: 29rem; margin: 1.2rem 0 0; }
.illustration { position: absolute; right: 11%; top: 50%; width: 200px; height: 200px; transform: translateY(-50%); }
.illustration::before, .illustration::after {
  content: ""; position: absolute; border: 1px solid #b2d9ff55; border-radius: 50%; inset: 0;
}
.illustration::after { inset: -35px; border-style: dashed; }
.illustration span { display: grid; height: 100%; place-items: center; font-size: 100px; color: #d8edff; transform: rotate(-28deg); }
.booking {
  position: relative; background: white; border: 1px solid var(--line); margin-top: 18px;
  border-radius: 20px; box-shadow: 0 10px 28px #0c2c4c0a; padding: 20px;
}
#search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(26rem, 2.2fr) minmax(12rem, .9fr) auto;
  gap: 12px;
  align-items: start;
}
.window-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; min-width: 0; }
.window-fields .field-note { grid-column: 1 / -1; }
.field-note { color: var(--muted); font-size: .875rem; margin: .45rem 0 0; overflow-wrap: anywhere; }
.field { min-width: 0; position: relative; }
label { display: block; font-size: .9rem; line-height: 1.2; font-weight: 650; margin-bottom: 7px; }
input, select, button { font: inherit; }
input, select {
  width: 100%; min-width: 0; height: 46px; border: 1px solid #cbd9e6; border-radius: 10px;
  padding: 0 10px; background: #f9fbfe; color: var(--ink);
}
input:focus, select:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #1974d5; outline-offset: 2px; }
.duration { display: grid; grid-template-columns: 4.5rem auto 4rem auto; gap: 4px; align-items: center; justify-content: start; }
.duration span { font-size: .85rem; color: var(--muted); }
button {
  border: none; border-radius: 10px; min-height: 46px; background: var(--brand); color: white;
  font-weight: 700; padding: 0 16px; cursor: pointer;
}
button:hover { background: #064d9e; }
button:disabled { opacity: .7; cursor: wait; }
#submit { margin-top: calc(1.08rem + 7px); }
.provider-field { grid-column: 1 / -1; display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; }
.provider-field label { margin: 0; }
.provider-field select { width: auto; max-width: 100%; }
.provider-attribution { margin: .75rem 0; }
.provider-attribution iframe { display: block; width: min(100%, 740px); height: 51px; border: 0; margin-bottom: .5rem; }
.offset:empty { display: none; }
.offset { margin-top: .6rem; }
#error { color: #9f2528; margin: 12px 0 0; }
#suggestions {
  position: absolute; top: calc(100% + 5px); left: 0; width: max(100%, 16rem);
  max-height: min(17rem, var(--suggestions-space, 40dvh)); overflow: auto;
  padding: 4px; margin: 0; list-style: none; border-radius: 11px; box-shadow: 0 8px 24px #10263d29;
  border: 1px solid var(--line); background: white; z-index: 5;
}
#suggestions.is-above { top: auto; bottom: calc(100% + 5px); }
#suggestions li { cursor: pointer; min-height: 44px; padding: 9px 10px; border-radius: 7px; overflow-wrap: anywhere; }
#suggestions li:hover, #suggestions [aria-selected="true"] { background: #eaf3ff; }
#suggestions small { display: block; color: var(--muted); }
.results { margin-top: 32px; min-height: 130px; }
.results-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem 1rem; }
h2, h3, p { margin-top: 0; }
h2 { margin-bottom: .7rem; font-size: clamp(1.35rem, 4vw, 2rem); letter-spacing: -.035em; }
#status { color: var(--muted); margin-bottom: .7rem; }
.notice { background: #fff4d9; border: 1px solid #ead7a5; padding: 12px 16px; margin-bottom: 12px; border-radius: 10px; overflow-wrap: anywhere; }
.notice p:last-child, .notice ul:last-child { margin-bottom: 0; }
.notice li + li { margin-top: .35rem; }
.flight-json { margin-top: .25rem; min-width: 0; }
.flight-json p { margin: .4rem 0; overflow-wrap: anywhere; font-size: .9rem; }
.flight-json pre {
  white-space: pre-wrap; overflow-wrap: anywhere; max-height: 24rem; overflow: auto;
  margin: .4rem 0; padding: .75rem; background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.map-disclosure { margin: 0 0 12px; }
.map-disclosure > summary { padding-block: .45rem; }
.map-hide, .map-disclosure[open] .map-show { display: none; }
.map-disclosure[open] .map-hide { display: inline; }
.trip-map {
  position: relative; z-index: 0; height: 420px; margin: 0 0 12px; overflow: hidden;
  background: #e7eef5; border: 1px solid var(--line); border-radius: 16px;
}
.map-note { margin: 0 0 12px; color: var(--ink); }
.map-note p, .map-note li { color: var(--muted); }
.map-note ul { margin: .35rem 0 0; padding-left: 1.2rem; }
.notice details > ul { margin-bottom: 0; }
.leaflet-marker-icon.map-arrow,
.leaflet-marker-icon.map-city { background: none; border: none; overflow: visible; }
.map-arrow-head {
  display: block; width: 18px; height: 18px; color: #055dc6; font-size: 16px;
  line-height: 18px; text-align: center;
}
.trip-map .map-city-button {
  position: relative; width: 14px; height: 14px; min-height: 0; padding: 0;
  border: 2px solid #fff; border-radius: 50%; background: #055dc6;
  box-shadow: 0 0 0 1px #055dc6; cursor: pointer;
}
.trip-map .map-city-button:hover { background: #064d9e; }
.map-city-name {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
  padding: 1px 6px; border-radius: 999px; background: #fff; color: var(--ink);
  font-size: .85rem; font-weight: 650; line-height: 1.3; white-space: nowrap;
  box-shadow: 0 1px 4px #10263d22;
}
.map-city-button.is-compact .map-city-name {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.card { container: flight-card / inline-size; padding: 19px 22px; margin: 0 0 12px; background: white; border: 1px solid var(--line); border-radius: 16px; overflow-wrap: anywhere; }
.card.is-highlighted { border-color: #055dc6; box-shadow: 0 0 0 3px #055dc633; }
.card h3:focus-visible { outline: 2px solid #1974d5; outline-offset: 2px; }
.card-heading { display: flex; align-items: center; justify-content: space-between; gap: .5rem 12px; flex-wrap: wrap; margin-bottom: 12px; }
.card-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.card h3 { font-size: 1.35rem; letter-spacing: -.025em; margin-bottom: 0; }
.stay { color: #03477b; background: #eaf4ff; padding: 5px 10px; border-radius: 100px; font-weight: 650; }
.flight-tables {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: .875rem;
  align-items: start;
}
.flight-table-panel { min-width: 0; }
.flight-table-heading {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  min-height: 2rem; margin-bottom: .35rem;
}
.flight-table-heading h4, .selected-trip h4 { margin: 0; font-size: 1rem; }
.flight-table-toggle {
  min-height: 2rem; padding: .3rem .65rem; color: #174d8a; background: #eaf3ff; font-size: .875rem;
}
.flight-table-toggle:hover { background: #dcecff; }
.flight-table-scroll { max-block-size: var(--six-rows-height, none); overflow: auto; }
.flight-table-scroll.is-limited { scrollbar-gutter: stable; }
.flight-table-scroll.is-expanded { max-block-size: none; }
.flight-table-scroll:focus-visible { outline: 2px solid #1974d5; outline-offset: -2px; }
.flight-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; text-align: left; }
.flight-table thead { position: sticky; inset-block-start: 0; z-index: 1; }
.flight-table th, .flight-table td { padding: .55rem clamp(.3rem, 1vw, .6rem); vertical-align: top; }
.flight-table th { background: #edf4fb; font-size: .875rem; }
.flight-table th:first-child { width: 38%; border-radius: 8px 0 0 0; }
.flight-table th:last-child { border-radius: 0 8px 0 0; }
.flight-table td { border-bottom: 1px solid var(--line); }
.flight-table tbody tr { cursor: pointer; }
.flight-table tbody tr:hover { background: #f4f8fc; }
.flight-table tbody tr:has(input:checked) { background: #eaf3ff; }
.flight-choice { display: flex; align-items: start; gap: .4rem; margin: 0; font-size: 1rem; cursor: pointer; }
.flight-choice input { flex: none; width: 1rem; height: 1rem; margin: .125rem 0 0; accent-color: var(--brand); }
.flight-table time, .selected-leg time, .flight-airline { display: block; color: var(--muted); font-size: .875rem; }
.flight-table time, .selected-leg time { font-variant-numeric: tabular-nums; }
.flight-table .flight-clock { display: block; }
.flight-airline { font-weight: 400; }
.flight-code { font-weight: 650; }
.selected-trip {
  margin: 0 0 1rem; padding: 1rem; border: 1px solid #cbdff1; border-radius: 12px; background: #f4f8fc;
}
.selected-legs { display: grid; grid-template-columns: minmax(0, 1fr); gap: .75rem 1rem; margin: .75rem 0 0; }
.selected-leg { padding: .65rem .75rem; border-radius: 8px; background: white; }
.selected-leg h5 { margin: 0 0 .2rem; color: var(--muted); font-size: .875rem; }
.selected-leg p { margin: 0 0 .5rem; font-weight: 650; }
.selected-leg-times { display: flex; flex-wrap: wrap; gap: .5rem 1rem; }
.trip-stay, .trip-warning { margin: .35rem 0 0; font-weight: 650; }
.trip-stay { color: #03477b; }
.trip-warning { color: #804a05; }
details { margin-top: .85rem; }
summary { color: var(--brand); cursor: pointer; display: list-item; width: fit-content; font-weight: 600; }
.footer { color: var(--muted); font-size: .9rem; padding-block: 18px 28px; }
.footer a { color: var(--brand); }
#directory-sync { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; margin-top: .8rem; }
#directory-sync button { background: #eaf3ff; color: #174d8a; font-size: .9rem; }
#directory-sync button:hover { background: #dcecff; }

@container flight-card (min-width: 43rem) {
  .flight-tables, .selected-legs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container flight-card (min-width: 56rem) {
  .flight-table .flight-clock { display: inline; }
}
@container flight-card (max-width: 17rem) {
  .flight-table th:first-child { width: 34%; }
  .flight-table th, .flight-table td { padding-inline: .25rem; }
}
@media (max-width: 64rem) {
  #search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .origin-field, .window-fields { grid-column: 1 / -1; }
  #suggestions { width: 100%; }
}
@media (max-width: 37.5rem) {
  .wrap { width: calc(100% - 28px); }
  .header-row { height: 54px; }
  .intro { margin-top: 12px; padding: 18px; }
  .intro > div:first-child { max-width: 100%; }
  h1 { font-size: clamp(1.85rem, 7vw, 2.5rem); line-height: 1.06; letter-spacing: -.045em; }
  .intro p { margin-top: .55rem; }
  .illustration { right: -65px; opacity: .28; }
  #search, .window-fields { grid-template-columns: minmax(0, 1fr); }
  .window-fields { row-gap: 12px; }
  .window-fields .field-note { margin-top: 0; }
  #submit { margin-top: 0; }
  .booking { padding: 16px; }
  .card { padding: 15px; }
  .trip-map { height: 280px; }
}
