:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --navy: #10264a;
  --ink: #172c4c;
  --muted: #536781;
  --blue: #2457cd;
  --border: #d9e2ef;
  --paper: #f3f6fb;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.wrap { width: min(70rem, calc(100% - 3rem)); margin-inline: auto; }
.site-header, .hero { background: var(--navy); color: white; }
.site-header { border-bottom: 1px solid #ffffff24; }
.header-inner { display: flex; justify-content: space-between; align-items: center; min-height: 3.6rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-size: .96rem; font-weight: 700; }
.brand-mark { border-radius: .3rem; }
.demo { font-size: .8rem; color: #ffe7af; }
.hero { background: linear-gradient(110deg, #10264a 20%, #1c4082 100%); padding-block: 2.8rem 2.1rem; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(2.3rem, 5vw, 3.65rem); letter-spacing: -.035em; line-height: 1.12; margin-bottom: 1.45rem; }
form {
  display: grid; grid-template-columns: 2.45fr 1fr .67fr 1.05fr; gap: .8rem 1rem; align-items: end;
  background: white; color: var(--ink); border-radius: 1rem; padding: 1.1rem 1.25rem;
  box-shadow: 0 10px 32px #081c4538;
}
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.trip-type { grid-column: 1 / -1; display: flex; gap: .4rem; padding: 0; margin: 0; border: 0; }
.trip-type label { display: flex; align-items: center; gap: .4rem; min-height: 48px; padding: 0 .66rem; cursor: pointer; border-radius: .55rem; background: #edf3ff; }
.trip-type input { min-height: auto; width: 1rem; height: 1rem; margin: 0; padding: 0; accent-color: var(--blue); }
.date-fields { display: grid; gap: .65rem; min-width: 0; }
form.is-round-trip { grid-template-columns: minmax(0, 2.05fr) minmax(18rem, 2.15fr) minmax(5rem, .65fr) minmax(7.2rem, 1fr); }
.is-round-trip .date-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.route-fields { display: grid; grid-template-columns: 1fr auto 1fr; gap: .55rem; align-items: end; min-width: 0; }
.field { display: grid; gap: .32rem; min-width: 0; }
label { font-size: .85rem; font-weight: 650; }
button, input, select { font: inherit; font-size: max(1rem, 1em); border-radius: .55rem; min-height: 48px; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid #2464eb; outline-offset: 2px;
}
input, select { color: var(--ink); width: 100%; min-width: 0; border: 1px solid #8596af; background: #fff; padding: .5rem .7rem; }
#origin, #destination { text-transform: uppercase; font-weight: 650; letter-spacing: .09em; }
#origin::placeholder, #destination::placeholder { color: #667c9a; font-weight: 500; }
.swap { color: var(--blue); background: #edf3ff; border: 0; min-width: 48px; padding: 0; font-size: 1.34rem; }
.primary { background: var(--blue); color: white; font-weight: 700; border: 0; padding-inline: .9rem; }
.primary:hover:not(:disabled) { background: #1845ad; }
.primary:disabled { opacity: .65; cursor: progress; }
.form-hint { grid-column: 1 / -1; color: var(--muted); font-size: .8rem; }
.results { padding-block: 1.65rem 3rem; }
.results-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: .8rem; }
h2 { font-size: 1.5rem; letter-spacing: -.025em; }
.summary { margin-top: .2rem; color: var(--muted); font-size: .92rem; }
.filters { display: flex; gap: .25rem; }
.filters button { background: transparent; border: 0; padding: 0 .7rem; font-size: .85rem; color: var(--muted); }
.filters button[aria-pressed="true"] { background: #e1eaff; color: #1748b5; font-weight: 700; }
.sources { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 1rem 0; }
.sources li { border: 1px solid var(--border); border-radius: .4rem; color: var(--muted); background: #fff; padding: .28rem .65rem; font-size: .8rem; }
.sources li[data-status="error"], .sources li[data-status="partial"] { color: #854105; background: #fff6e9; border-color: #f2d9b8; }
.notice { color: #763c09; background: #fff5e5; padding: .7rem .9rem; border-radius: .45rem; margin-block: .65rem; font-size: .9rem; }
.flight-list { display: grid; gap: .75rem; margin-top: 1rem; }
.flight-card { background: #fff; border: 1px solid var(--border); border-radius: .85rem; overflow: hidden; }
.flight-main { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem 1.5rem; padding: 1rem 1.25rem; }
.flight-ids { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .65rem; font-size: .86rem; font-weight: 700; }
.direction + .direction { border-top: 1px solid #e8edf5; margin-top: .7rem; padding-top: .7rem; }
.direction-label { color: var(--muted); font-size: .78rem; }
.special { background: #fff0d5; color: #854102; border-radius: .3rem; padding: .12rem .42rem; font-size: .76rem; }
.times { display: flex; align-items: center; gap: clamp(.55rem, 2.3vw, 1.4rem); margin-top: .6rem; }
.clock { font-size: clamp(1.4rem, 3.8vw, 2rem); font-variant-numeric: tabular-nums; font-weight: 720; line-height: 1.1; }
.airport { color: var(--muted); font-size: .83rem; }
.connector { text-align: center; min-width: 4rem; color: var(--muted); font-size: .75rem; }
.connector-line { border-top: 1px solid #91a6c5; margin-block: .22rem; position: relative; }
.connector-line::after { content: ""; position: absolute; right: 0; top: -4px; width: 6px; height: 6px; border-top: 1px solid #91a6c5; border-right: 1px solid #91a6c5; transform: rotate(45deg); }
.fare { text-align: end; align-self: center; white-space: nowrap; }
.price { font-variant-numeric: tabular-nums; color: #1748b5; font-size: clamp(1.2rem, 3.9vw, 1.9rem); line-height: 1.16; font-weight: 780; }
.fare-meta { color: var(--muted); font-size: .76rem; margin-top: .33rem; }
.flight-detail { border-top: 1px solid #e8edf5; padding-inline: 1.25rem; color: var(--muted); font-size: .85rem; }
.flight-detail summary { cursor: pointer; display: list-item; padding-block: .78rem; min-height: 48px; }
.flight-detail ol { margin: 0 0 .9rem; padding-inline-start: 1.35rem; }
.flight-detail li + li { margin-top: .3rem; }
.more { display: block; margin: 1rem auto 0; padding-inline: .85rem; background: #e1eaff; color: #1748b5; border: 0; font-weight: 700; }
@media (max-width: 900px) {
  form, form.is-round-trip { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .route-fields, .primary { grid-column: 1 / -1; }
  .is-round-trip .date-fields { grid-column: 1 / -1; }
  .is-round-trip .primary { grid-column: auto; }
  .hero { padding-block: 1.85rem 1.35rem; }
}
@media (max-width: 460px) {
  .wrap { width: calc(100% - 1.5rem); }
  form { gap: .7rem; padding: .9rem; }
  .flight-main { padding-inline: .85rem; column-gap: .5rem; }
  .flight-detail { padding-inline: .85rem; }
  .connector { min-width: 3rem; }
}
