:root {
  /* Colours follow branchspacex2e.com: navy ink, warm paper, orange
     accents, teal as a second accent. Filled buttons (--brand) are navy, like
     the site's selected options; --accent is its orange darkened slightly so
     it reads as text.
     The page stays light even when the device is in dark mode, like the site. */
  --bg: #f3f2ee;
  --surface: #ffffff;
  --text: #0b1533;
  --muted: #55607f;
  --line: #d3d5dc;
  --line-strong: #0b1533;
  --brand: #0b1533;
  --brand-hover: #26335e;
  --brand-text: #f7f5f2;
  --teal: #1ae0d8;
  --accent: #c93a07;
  --accent-hover: #a83005;
  --accent-text: #ffffff;
  --accent-soft: #fcede6;
  --ok: #1d7a4a;
  --ok-soft: #e8f5ee;
  --warn: #a35a00;
  --warn-soft: #fff6e8;
  --error: #c4231c;
  --shadow: 0 1px 2px rgba(11, 21, 51, .06), 0 4px 16px rgba(11, 21, 51, .05);
  --radius: 8px;
  --code-bg: #f7f5f2;
  --jt-key: #8a2a05;
  --jt-string: #1d6b3a;
  --jt-number: #2b4ba8;
  --api-bar: #55607f;
  --router-bar: #0e9c96;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { font-size: 14px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.4 Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
}
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 16px; container: page / inline-size; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* A navy bar across the top of the page, with the model picker on the left. */
.top { background: var(--brand); color: var(--brand-text); }
.top-inner { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; justify-content: flex-start; align-items: center; gap: 12px 24px; flex-wrap: wrap; }
@media (min-width: 1200px) { .top-inner { max-width: 1480px; } }
.model-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.model-pick-label { font-size: 1.1rem; font-weight: 500; color: var(--brand-text); }

.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 24px; margin: 14px 0; }
.section-title { margin: 0 0 12px; font-size: 1.2rem; font-weight: 700; }

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: .6; cursor: progress; }

button.primary {
  background: var(--brand);
  color: var(--brand-text);
  font-weight: 500;
  font-size: 1rem;
  border-radius: var(--radius);
  padding: 0 22px;
  min-height: 42px;
  transition: background .15s;
}
button.primary:hover { background: var(--brand-hover); }
button.big { min-width: 280px; }

/* ---- natural-language box: outlined like the promo-code field */
.ask-row { display: flex; gap: 12px; align-items: stretch; }
.ask-box { flex: 1; display: flex; align-items: flex-start; border: 1.5px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.ask-box:focus-within { border-color: var(--accent); }
.ask-box textarea { flex: 1; border: 0; background: transparent; resize: vertical; min-height: 42px; padding: 10px 14px; font-size: 1.05rem; font-weight: 500; }
.ask-box textarea:focus-visible { outline: none; }
.ask-box textarea::placeholder { color: var(--muted); font-weight: 400; }
.mic { color: var(--accent); width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; margin: 2px; }
.mic:hover { background: var(--accent-soft); }
.mic.listening { background: var(--brand); color: var(--brand-text); animation: pulse 1.2s infinite; }
.mic:disabled { color: var(--muted); }
@keyframes pulse { 50% { opacity: .6; } }

/* ---- waiting for the model: spinner in the button, sweeping bar on the card */
/* Both labels share one grid cell, so the button keeps the width of the wider one. */
#ask-submit { display: inline-grid; place-items: center; }
#ask-submit > span { grid-area: 1 / 1; display: inline-flex; align-items: center; gap: 8px; }
#ask-submit .btn-busy, .ask.busy #ask-submit .btn-idle { visibility: hidden; }
.ask.busy #ask-submit .btn-busy { visibility: visible; }
#ask-submit .spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .8s linear infinite; }
.ask.busy #ask-submit { opacity: 1; cursor: progress; }
.ask { position: relative; overflow: hidden; }
.ask.busy::before { content: ""; position: absolute; top: 0; left: 0; height: 4px; width: 40%; background: var(--brand); animation: sweep 1.2s ease-in-out infinite; }
.ask.busy .ask-box { background: var(--accent-soft); border-color: var(--accent); }
.ask.busy #ask-status { color: var(--accent); font-weight: 500; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes sweep { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
@media (prefers-reduced-motion: reduce) {
  #ask-submit .spinner, .ask.busy::before { animation-duration: 3s; }
}

.examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip { font-size: .82rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--surface); }
.chip:hover { border-color: var(--accent); color: var(--accent); }

.status { color: var(--muted); margin: 8px 0 0; min-height: 1.2em; }
.status .engine { display: inline-block; font-size: .78rem; font-weight: 500; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-right: 8px; }
.notes { margin: 8px 0 0; padding-left: 18px; color: var(--warn); font-size: .92rem; }

/* ---- the search widget: underlined fields with large values */
.field { min-width: 0; position: relative; }
.field label, .home label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 1px; }
.field label small { font-size: .8rem; }
.field input, .field select, .home input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  padding: 2px 0 6px;
  font-size: 1.2rem;
  font-weight: 500;
}
.field input:focus-visible, .field select:focus-visible, .home input:focus-visible { outline: none; border-bottom: 2px solid var(--accent); padding-bottom: 5px; }
.field input::placeholder, .home input::placeholder { color: var(--muted); font-weight: 400; }
.field input:disabled { color: var(--muted); opacity: .6; }
.field select, .trip-type select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(-45deg, transparent 50%, var(--muted) 50%);
  background-size: 7px 7px, 7px 7px;
  background-position: calc(100% - 13px) 55%, calc(100% - 6px) 55%;
  background-repeat: no-repeat;
  cursor: pointer;
}

.trip-type { display: inline-block; margin-bottom: 10px; }
.trip-type select { border: 0; font-size: 1.05rem; padding: 2px 30px 2px 0; }

.route { display: grid; grid-template-columns: 1fr 64px 1fr; align-items: end; }
.swap { color: var(--accent); justify-self: center; width: 34px; height: 34px; margin-bottom: 2px; display: grid; place-items: center; border-radius: 50%; }
.swap:hover { background: var(--accent-soft); }

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; margin-top: 14px; width: max(calc(50% - 32px), 340px); max-width: 100%; }
.options { display: grid; grid-template-columns: repeat(3, 1fr) 1.3fr 1.3fr auto; gap: 14px 18px; margin-top: 14px; align-items: end; }
.options .field select { font-size: 1.05rem; }
.field.check label { display: flex; gap: 10px; align-items: center; color: var(--text); font-size: .95rem; padding-bottom: 7px; margin: 0; cursor: pointer; white-space: nowrap; }
.field.check input { width: 16px; height: 16px; accent-color: var(--accent); margin: 0; border: 0; padding: 0; }

.field.filled input, .field.filled select { border-bottom-color: var(--ok); background-color: var(--ok-soft); transition: background-color .5s; }
.field.unsure input, .field.unsure select { border-bottom: 2px solid var(--warn); background-color: var(--warn-soft); }
.field.unsure label::after { content: " · please check"; color: var(--warn); font-weight: 500; }

.widget-foot { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-top: 16px; flex-wrap: wrap; }
.home { max-width: 380px; flex: 1; }
.home input { font-size: 1rem; }
.home small { display: block; margin-top: 3px; color: var(--muted); font-size: .8rem; }
.errors { color: var(--error); margin: 6px 0 0; text-align: right; }
.errors:empty { display: none; }

/* ---- results */
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.results-head .section-title { margin: 0; }
.sort { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.sort select { border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 4px 0; font-weight: 500; color: var(--text); }
.offers { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 8px; }
.offer { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; transition: border-color .15s; }
.offer:hover { border-color: var(--accent); }
.offer .airline { font-weight: 500; font-size: .95rem; }
.offer .price { font-size: 1.2rem; font-weight: 700; text-align: right; }
.offer .price small { display: block; font-size: .78rem; font-weight: 400; color: var(--muted); }
.slice { display: grid; grid-template-columns: 54px 1fr 72px auto; gap: 10px; align-items: center; grid-column: 1 / -1; }
.slice .t { white-space: nowrap; font-weight: 500; font-size: 1rem; font-variant-numeric: tabular-nums; }
.slice .t small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.slice .line { border-top: 1px solid var(--line); text-align: center; font-size: .8rem; color: var(--muted); padding-top: 4px; }
.slice .meta { font-size: .85rem; color: var(--muted); text-align: right; min-width: 120px; }


@container page (max-width: 860px) {
  .options { grid-template-columns: repeat(3, 1fr); }
  .pair { width: 100%; }
  button.big { min-width: 0; flex: 1; }
}
@container page (max-width: 640px) {
  .card { padding: 16px 14px; }
  .section-title { font-size: 1.1rem; margin-bottom: 10px; }
  .ask-row { flex-direction: column; }
  .field input, .field select { font-size: 1.1rem; }
  .route { grid-template-columns: 1fr; gap: 12px; }
  .swap { justify-self: end; margin: -10px 0 -10px; transform: rotate(90deg); }
  .pair { margin-top: 12px; gap: 0 16px; }
  .options { grid-template-columns: repeat(2, 1fr); gap: 12px 16px; margin-top: 12px; }
  .widget-foot { flex-direction: column; align-items: stretch; }
  .home { max-width: none; }
  .errors { text-align: left; }
  .slice { grid-template-columns: 60px 1fr 80px; }
  .slice .meta { grid-column: 1 / -1; text-align: left; }
}

/* ---- network inspector (desktop only) */
.net { display: none; }
@media (min-width: 1200px) {
  .page { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; max-width: 1480px; margin: 0 auto; padding: 0 16px; }
  .page > .wrap { max-width: none; margin: 0; padding: 0; }
  body.net-collapsed .page { grid-template-columns: minmax(0, 1fr) 44px; }
  .net {
    display: flex; flex-direction: column;
    position: sticky; top: 14px; margin-top: 14px;
    height: calc(100vh - 28px);
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
    overflow: hidden;
  }
}
.net-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px; border-bottom: 1px solid var(--line); }
.net-toggle { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.05rem; padding: 4px 6px; border-radius: 6px; }
.net-toggle:hover { color: var(--accent); }
.net-clear { font-size: .85rem; color: var(--muted); padding: 4px 8px; border-radius: 6px; }
.net-clear:hover { color: var(--accent); }
.net-intro { margin: 0; padding: 8px 12px; font-size: .82rem; color: var(--muted); border-bottom: 1px solid var(--line); }
.net-list { flex: 1; overflow-y: auto; padding: 8px 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.net-empty { color: var(--muted); font-size: .9rem; text-align: center; margin: 32px 12px; }
body.net-collapsed .net-head { flex-direction: column; border: 0; padding: 12px 0; }
body.net-collapsed .net-toggle { writing-mode: vertical-rl; padding: 8px 4px; }
body.net-collapsed .net-clear, body.net-collapsed .net-intro, body.net-collapsed .net-list { display: none; }
.engine-switch { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(247, 245, 242, .08); }
.engine-switch button { white-space: nowrap; padding: 7px 22px; border-radius: 999px; font-size: 1.05rem; font-weight: 500; color: rgba(247, 245, 242, .75); }
.engine-switch button:hover:not(:disabled):not([aria-checked="true"]) { color: var(--brand-text); }
/* The chosen model is teal so it stands out on the navy bar. */
.engine-switch button[aria-checked="true"] { background: var(--teal); color: var(--brand); font-weight: 600; }
.engine-switch button:disabled { opacity: .45; cursor: not-allowed; }
.model-pick-note { font-size: .85rem; color: rgba(247, 245, 242, .75); }

.net summary { cursor: pointer; list-style: none; }
.net summary::-webkit-details-marker { display: none; }
.net-group { border: 1px solid var(--line); border-radius: var(--radius); }
.net-group[open] { border-color: var(--accent); }
.net-group-head { padding: 8px 10px; }
.net-group-title { display: flex; gap: 8px; align-items: baseline; font-size: .9rem; font-weight: 500; }
.net-group-n { color: var(--accent); font-weight: 700; }
.net-group-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.net-group[open] .net-group-text { white-space: normal; }
.net-group-meta { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-size: .78rem; color: var(--muted); }
.net-engine { margin-left: auto; padding: 1px 8px; border-radius: 999px; font-weight: 500; }
.net-engine.jev, .net-engine.anthropic { background: var(--accent-soft); color: var(--accent); }
.net-engine.none { background: var(--warn-soft); color: var(--warn); }

.net-req { border-top: 1px solid var(--line); }
.net-req > summary { padding: 8px 10px; }
.net-req > summary:hover { background: var(--code-bg); }
.net-title { display: flex; gap: 8px; align-items: center; font-size: .92rem; font-weight: 600; }
.net-title::before { content: "▸"; color: var(--muted); font-size: .75rem; width: 10px; }
.net-req[open] .net-title::before { content: "▾"; }
.net-line { display: flex; gap: 8px; align-items: center; margin: 6px 0 0 18px; font-size: .84rem; }
.net-step { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--text); color: var(--surface); font-size: .7rem; font-weight: 700; flex: none; }
.net-method { font-weight: 700; font-size: .75rem; }
.net-url { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.net-status { font-weight: 700; font-size: .75rem; padding: 0 6px; border-radius: 4px; }
.net-status.ok { color: #1d7a3e; background: #e7f6ec; }
.net-status.bad { color: var(--error); background: var(--accent-soft); }
.net-time { font-variant-numeric: tabular-nums; font-weight: 500; min-width: 58px; text-align: right; }
.net-track { position: relative; height: 6px; margin: 8px 0 0 18px; background: var(--code-bg); border-radius: 3px; }
.net-bar { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.net-bar.api { background: var(--api-bar); }
.net-bar.router { background: var(--router-bar); }
.net-bar.model { background: var(--accent); }
.net-note { margin: 6px 0 0 18px; font-size: .75rem; color: var(--muted); }
.net-skipped { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); }
.net-body { padding: 2px 10px 10px; display: flex; flex-direction: column; gap: 8px; }
.net-error { color: var(--error); font-size: .82rem; }

.net-payload { border: 1px solid var(--line); border-radius: 6px; background: var(--code-bg); }
.net-payload-head { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); font-size: .78rem; }
.net-payload-title { font-weight: 700; }
.net-size { color: var(--muted); }
.net-copy { margin-left: auto; color: var(--accent); font-size: .78rem; }
.net-payload > .jt-node, .net-payload > .jt-row, .net-payload > .jt-null { padding: 6px 10px; max-height: 360px; overflow: auto; }

.jt-node, .jt-row { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .76rem; line-height: 1.55; }
.jt-row { padding-left: 14px; overflow-wrap: anywhere; }
.jt-node > summary { padding-left: 0; }
.jt-node > summary::before { content: "▸ "; color: var(--muted); }
.jt-node[open] > summary::before { content: "▾ "; }
.jt-children { padding-left: 14px; border-left: 1px dotted var(--line); margin-left: 4px; }
.jt-key { color: var(--jt-key); }
.jt-meta { color: var(--muted); }
.jt-string { color: var(--jt-string); }
.jt-number { color: var(--jt-number); }
.jt-boolean, .jt-null, .jt-undefined { color: var(--accent); }
.jt-more { color: var(--accent); font-size: .72rem; text-decoration: underline; }

/* ---- airports modal */
.link-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--accent); font-weight: 500; font-size: .92rem; padding: 2px 0; }
.link-cta:hover span { text-decoration: underline; }

.airports-dialog {
  width: min(920px, calc(100vw - 32px));
  height: min(86vh, 900px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 12px 48px rgba(0, 0, 0, .25);
  flex-direction: column;
}
.airports-dialog[open] { display: flex; }
.airports-dialog::backdrop { background: rgba(0, 0, 0, .45); }
.apt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 22px 8px; }
.apt-head h2 { margin: 0; font-size: 1.35rem; }
.apt-sub { margin: 4px 0 0; color: var(--muted); font-size: .88rem; }
.apt-metro-hint { color: var(--accent); }
.apt-close { color: var(--accent); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; flex: none; }
.apt-close:hover { background: var(--accent-soft); }
.apt-tools { display: flex; align-items: center; gap: 12px; padding: 6px 22px 8px; }
.apt-tools input { flex: 1; border: 0; border-bottom: 1px solid var(--line); background: transparent; padding: 6px 0; font-size: 1.05rem; }
.apt-tools input:focus-visible { outline: none; border-bottom: 2px solid var(--accent); padding-bottom: 5px; }
.apt-matches { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.apt-regions { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 22px 12px; border-bottom: 1px solid var(--line); }
.apt-region-link { font-size: .8rem; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.apt-region-link:hover { border-color: var(--accent); color: var(--accent); }
.apt-region-link .apt-count { font-size: .72rem; }
.apt-body { overflow-y: auto; padding: 4px 22px 22px; flex: 1; }
.apt-region { scroll-margin-top: 8px; }
.apt-region h3 { position: sticky; top: 0; background: var(--surface); margin: 0; padding: 12px 0 6px; font-size: 1rem; display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line); z-index: 1; }
.apt-count { color: var(--muted); font-weight: 400; font-size: .82rem; }
.apt-list { list-style: none; margin: 6px 0 4px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 0 18px; }
.apt-airport { display: flex; gap: 10px; align-items: baseline; padding: 4px 0; font-size: .9rem; border-bottom: 1px dotted var(--line); min-width: 0; }
.apt-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; color: var(--muted); width: 32px; flex: none; }
.apt-airport.metro .apt-code { color: var(--accent); font-weight: 700; }
.apt-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apt-city { font-weight: 500; }
.apt-name { color: var(--muted); margin-left: 6px; }
.apt-airport.metro .apt-name { font-style: italic; }
.apt-alias { color: var(--accent); margin-left: 6px; font-size: .82rem; }
.apt-empty { color: var(--muted); text-align: center; margin: 32px 0; }
@media (max-width: 640px) {
  .airports-dialog { width: 100vw; max-width: 100vw; max-height: 100dvh; height: 100dvh; border-radius: 0; margin: 0; }
  .apt-head, .apt-tools, .apt-regions, .apt-body { padding-left: 16px; padding-right: 16px; }
  .apt-list { grid-template-columns: 1fr; }
}
