/* flights.css: the Flight Finder's own theme. The page is a trial of a standalone app, so it does
   not use site.css or the lacquer: it takes its look from airport wayfinding instead.
   Signage yellow on sign charcoal, a terminal-concrete ground. Atkinson Hyperlegible (a face drawn
   for legibility) for the interface, B612 Mono (drawn for Airbus cockpit displays) for codes,
   prices, dates and times, and Aeronautical (condensed capitals after the old aviation posters)
   for the name on the sign and nothing else.
   Radius rule: square everywhere; the only round things are the stop dots, as on a route map.
   Borders are ink rules, never grey boxes. No shadows.
   Icons are Lucide (ISC), kept as a sprite at the top of flights.html and drawn at the text's size
   in currentColor, beside words and never in place of them. Step numbers and leg names are
   gate-sign labels: ink blocks with ground-coloured type. */

:root {
  color-scheme: light;
  --ground: #eef0ec;
  --ink: #141618;
  --ink-2: #4a4f52;
  --rule: #b9bdb6;
  --panel: #ffffff;
  --sign: #ffc20e;
  --on-sign: #141618;
  --bad: #a3271b;
  --ui: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --data: "B612 Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --sign-face: "Aeronautical", "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}
/* The name on the sign. One weight, subset to Latin-1; supplied by Adrian. */
@font-face {
  font-family: "Aeronautical";
  font-weight: 400;
  font-display: swap;
  src: url("fonts/aeronautical.woff2") format("woff2");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --ground: #141618;
    --ink: #eceee9;
    --ink-2: #a9aea9;
    --rule: #3a3f42;
    --panel: #1c1f21;
    --bad: #ff8a7a;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #141618; --ink: #eceee9; --ink-2: #a9aea9; --rule: #3a3f42; --panel: #1c1f21; --bad: #ff8a7a;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 1rem/1.5 var(--ui); }
h1, h2, h3, p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--sign); outline-offset: 2px; box-shadow: 0 0 0 5px var(--ink); }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--sign); color: var(--on-sign); padding: .5rem 1rem; z-index: 2; }
.skip:focus { left: 1rem; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.i { width: 1.15em; height: 1.15em; flex: none; vertical-align: -.2em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* The sign */
.sign {
  display: grid; grid-template-columns: auto 1fr; column-gap: 1rem; align-items: center;
  background: var(--sign); color: var(--on-sign);
  padding: 1.25rem clamp(1rem, 4vw, 2.5rem);
  border-bottom: 4px solid var(--on-sign);
}
.sign-mark { grid-row: span 2; width: 3.25rem; height: 3.25rem; fill: var(--on-sign); }
.sign h1 { font-family: var(--sign-face); font-size: clamp(2.2rem, 5.4vw, 3.6rem); line-height: 1; font-weight: 400; letter-spacing: .02em; }
.sign p { font-size: 1.05rem; }

/* Two columns: the trip on the left, the board on the right */
.layout {
  display: grid; grid-template-columns: minmax(0, 34rem) minmax(0, 1fr); gap: 0 clamp(1.5rem, 3vw, 3rem);
  padding: 0 clamp(1rem, 4vw, 2.5rem) 2rem; max-width: 96rem; outline: none;
}
@media (max-width: 1180px) { .layout { grid-template-columns: minmax(0, 1fr); } #trip { max-width: 44rem; } }
#trip h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 700; margin: 1.5rem 0 .75rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
#trip h2:first-child { border-top: 0; padding-top: 0; }
.step { display: inline-grid; place-items: center; width: 1.65rem; height: 1.65rem; background: var(--ink); color: var(--ground); font: 700 .95rem/1 var(--data); }

/* Controls */
input[type="text"], input[type="date"], input[type="number"], select {
  background: var(--panel); border: 1px solid var(--ink); border-radius: 0; padding: .35rem .5rem; min-height: 2.25rem;
}
input[type="date"] { font-family: var(--data); font-size: .9rem; }
input::placeholder { color: var(--ink-2); }
.btn { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--ink); border-radius: 0; background: transparent; padding: .3rem .8rem; min-height: 2.25rem; cursor: pointer; }
.btn:hover { background: var(--ink); color: var(--ground); }
.btn-go {
  background: var(--sign); color: var(--on-sign); border: 2px solid var(--on-sign);
  font-weight: 700; font-size: 1.15rem; padding: .6rem 1.75rem; min-height: 3rem;
}
.btn-go:hover { background: var(--on-sign); color: var(--sign); border-color: var(--sign); }
.btn[aria-disabled="true"] { opacity: .55; cursor: progress; }
.btn-plain { border: 0; background: none; text-decoration: underline; color: var(--ink-2); min-height: 2.25rem; padding: .3rem .4rem; cursor: pointer; }
.btn-plain:hover { color: var(--bad); }
.check { display: inline-flex; gap: .5rem; align-items: center; min-height: 2.25rem; cursor: pointer; }
.check input { width: 1.15rem; height: 1.15rem; margin: 0; accent-color: var(--ink); }
.hint { color: var(--ink-2); font-size: .92rem; margin-top: .6rem; }
.note, .plan { display: flex; gap: .6rem; align-items: baseline; margin-top: 1rem; padding: .6rem .75rem; border: 1px solid var(--ink); background: var(--panel); font-size: .95rem; }
.note .i, .plan .i { transform: translateY(.15em); }

/* Kinds of trip and of dates: one row of square tabs, the chosen one inked */
.modes { border: 0; padding: 0; margin: 0 0 .9rem; display: flex; flex-wrap: wrap; min-width: 0; }
.modes label { position: relative; display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--ink); margin: 0 -1px -1px 0; padding: .45rem .8rem; cursor: pointer; min-height: 2.5rem; }
.modes input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.modes label:has(input:checked) { background: var(--ink); color: var(--ground); font-weight: 700; }
.modes label:has(input:focus-visible) { outline: 3px solid var(--sign); outline-offset: 2px; z-index: 1; }
.modes label:hover:not(:has(input:checked)) { background: var(--panel); }

/* Route strip: a line through every stop, a dot at each, a plane on the line for each flight */
.route { list-style: none; margin: 0; padding: 0; }
.stop { position: relative; padding: 0 0 .9rem 2.6rem; }
.stop::before { content: ""; position: absolute; left: calc(.875rem - 2px); top: 1rem; bottom: -.2rem; width: 4px; background: var(--ink); }
.stop:last-child::before { display: none; }
.stop-dot { position: absolute; left: 0; top: .05rem; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--sign); border: 3px solid var(--ink); color: var(--on-sign); display: grid; place-items: center; z-index: 1; }
.stop-dot .i { width: .95rem; height: .95rem; stroke-width: 2.5; }
.stop-row { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: end; }
.stop-place { flex: 1 1 14rem; display: grid; gap: .15rem; }
.stop-place input { width: 100%; }
.stop-name { font-weight: 700; }
.stop-drive { display: grid; gap: .15rem; }
.stop-drive > span { display: inline-flex; align-items: center; gap: .35rem; }
.aps-head { margin-top: .6rem; font-size: .88rem; color: var(--ink-2); }
.aps { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .3rem 0 0; }
.aps:empty { display: none; }
.ap { display: inline-flex; align-items: center; gap: .3rem; font-family: var(--data); font-size: .82rem; border: 1px solid var(--ink); border-radius: 0; background: var(--panel); padding: .2rem .45rem; min-height: 2rem; cursor: pointer; }
.ap b { font-weight: 700; margin-right: .2em; }
.ap .i { color: var(--ink-2); }
.ap[aria-pressed="false"] { text-decoration: line-through; color: var(--ink-2); border-style: dashed; background: transparent; }
.ap-msg { font-size: .9rem; color: var(--ink-2); }
.ap-msg.bad { color: var(--bad); }
.stay, .stay-note { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .6rem; color: var(--ink-2); font-size: .95rem; }
.stay select { min-height: 2rem; padding: .15rem .3rem; }
.stay-note { flex-wrap: nowrap; align-items: baseline; }
.stay-note .i { transform: translateY(.15em); }
.leg-tag { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .5rem; margin-top: .9rem; font-size: .95rem; }
.leg-tag b { background: var(--ink); color: var(--ground); padding: .05rem .45rem; font-weight: 700; }
.leg-plane { position: absolute; left: -2.6rem; top: -.1rem; width: 1.75rem; height: 1.75rem; display: grid; place-items: center; background: var(--ground); z-index: 1; }
.leg-plane .i { width: 1.2rem; height: 1.2rem; transform: rotate(135deg); }
.stop.end { padding-bottom: 0; }
.stop.end .stop-name { display: block; padding-top: .15rem; }
.stop.end .stay-note { margin-top: .1rem; }
.route-foot { display: flex; flex-wrap: wrap; gap: .75rem 1.25rem; align-items: center; padding: .5rem 0 0 2.6rem; }
.route-foot .hint { flex-basis: 100%; margin-top: -.5rem; }
/* Anything that can be left as it is says so, in the quiet ink */
.opt { font-weight: 400; font-size: .88rem; color: var(--ink-2); }

/* Fields: a label over each control, in as many columns as fit */
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .75rem 1rem; align-items: end; margin-top: .75rem; }
.field { display: grid; gap: .2rem; min-width: 0; }
.field > span:first-child { font-weight: 700; font-size: .92rem; }
.field input, .field select { width: 100%; min-width: 0; }
.field-wide { grid-column: span 2; }
.money { display: flex; align-items: center; gap: .3rem; }
.field-check { align-self: end; }
#trip > .hint[data-show] { margin-top: 0; }
.go { padding: 1.25rem 0 0; }
.saved-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: .5rem; }
.saved-row select, .saved-row input { flex: 1 1 12rem; }

/* The board */
.board { padding-top: 1.5rem; outline: none; container-type: inline-size; }
.board h2 { font-size: 1.6rem; font-weight: 700; border-bottom: 4px solid var(--ink); padding-bottom: .4rem; }
#summary { margin: .6rem 0 0; max-width: 70ch; }
#checked { margin-top: .25rem; }
.problems { margin-top: .75rem; border: 1px solid var(--bad); padding: .4rem .75rem; max-width: 70ch; }
.problems summary { display: flex; align-items: center; gap: .5rem; min-height: 2rem; color: var(--bad); font-weight: 700; cursor: pointer; list-style: none; }
.problems summary::-webkit-details-marker { display: none; }
.problems .chev { margin-left: auto; transition: transform .15s; }
.problems[open] .chev { transform: rotate(180deg); }
.problems ul { margin: .25rem 0 .4rem; padding-left: 1.25rem; font-size: .9rem; color: var(--ink-2); }
.trips { list-style: none; margin: .5rem 0 0; padding: 0; }
.trip { border-bottom: 1px solid var(--rule); padding: 1rem 0; display: grid; grid-template-columns: 8.5rem minmax(0, 1fr); gap: .25rem 1.25rem; }
.trip:first-child { border-top: 1px solid var(--rule); }
.price { font-family: var(--data); font-weight: 700; font-size: 1.6rem; line-height: 1; padding: .35rem .4rem; display: inline-block; }
.trip:first-child .price { background: var(--sign); color: var(--on-sign); }
.sum { font-family: var(--data); font-size: .85rem; color: var(--ink-2); margin-top: .35rem; }
.kind { display: flex; align-items: center; gap: .3rem; font-size: .85rem; color: var(--ink-2); margin-top: .15rem; }
.legs { min-width: 0; }
/* A flight: its name, day, airports and price on one line, the drive at each end under them */
.leg { display: grid; grid-template-columns: 5.75rem 7.25rem minmax(0, 1fr) auto; grid-template-areas: "name day codes price" ". drv drv drv"; gap: .1rem .75rem; align-items: baseline; padding: .2rem 0; }
.leg-name { grid-area: name; }
.leg-day { grid-area: day; }
.codes { grid-area: codes; }
.leg-price { grid-area: price; }
.drv { grid-area: drv; }
.leg-name { display: inline-flex; align-items: center; gap: .35rem; justify-self: start; background: var(--ink); color: var(--ground); font-weight: 700; font-size: .9rem; padding: .05rem .45rem; }
.leg-day, .codes, .leg-price { font-family: var(--data); font-size: .95rem; white-space: nowrap; }
.codes { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .1rem .35rem; white-space: normal; }
.codes .i { color: var(--ink-2); }
.leg-price { font-weight: 700; }
.drv { display: inline-flex; align-items: baseline; gap: .35rem; color: var(--ink-2); font-size: .88rem; }
.drv .i { transform: translateY(.15em); }
.stay-line { display: flex; align-items: center; gap: .4rem; color: var(--ink-2); font-size: .88rem; padding: .1rem 0 .1rem 6.5rem; }
.trip .more { grid-column: 2; justify-self: start; margin-top: .6rem; }
.more .i { transition: transform .15s; }
.more[aria-expanded="true"] .i { transform: rotate(180deg); }
.detail { margin: .35rem 0 .9rem; padding-left: 6.5rem; color: var(--ink-2); font-size: .92rem; }
.fl { width: 100%; border-collapse: collapse; font-size: .9rem; color: var(--ink); }
.fl th { text-align: left; font-size: .8rem; font-weight: 700; color: var(--ink-2); padding: .15rem .75rem .25rem 0; border-bottom: 1px solid var(--ink); }
.fl td { padding: .35rem .75rem .35rem 0; border-bottom: 1px solid var(--rule); vertical-align: baseline; }
.fl td.mono { font-family: var(--data); white-space: nowrap; }
.fl td.num, .fl th:last-child { text-align: right; padding-right: 0; }
.fl td.none { font-family: var(--ui); color: var(--ink-2); white-space: normal; text-align: left; }
.detail > .hint { margin: 0 0 .35rem; }
.detail .link { display: inline-flex; align-items: center; gap: .35rem; font-weight: 700; padding: .4rem 0; color: var(--ink); min-height: 24px; }
.fine { color: var(--ink-2); font-size: .88rem; margin-top: 1.25rem; max-width: 65ch; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem; padding: 1.25rem clamp(1rem, 4vw, 2.5rem) 2rem; border-top: 1px solid var(--rule); color: var(--ink-2); font-size: .92rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.foot a { min-height: 1.5rem; display: inline-block; }

/* A narrow board: the price over the flights, and each flight on three lines */
@container (max-width: 44rem) {
  .trip { grid-template-columns: minmax(0, 1fr); }
  .trip .more { grid-column: 1; }
  .total { display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .75rem; margin-bottom: .35rem; }
  .total .sum, .total .kind { margin-top: 0; }
}
@container (max-width: 34rem) {
  .leg { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "name day price" "codes codes codes" "drv drv drv"; padding: .4rem 0 .2rem; }
  .stay-line, .detail { padding-left: 0; }
  .fl td.mono:nth-child(2) { white-space: normal; }
}
@media (max-width: 420px) { .field-wide { grid-column: 1 / -1; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
