/* Flight Finder page classes on top of the Modernist tokens (modernist.css).
   Every colour, font and rule comes from the tokens; these classes only
   name the layouts the mockups drew inline. */

.muted { color: var(--color-text-muted); }
.faint { color: var(--color-text-subtle); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.tabular { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.heading { font-family: var(--font-heading); font-weight: var(--font-heading-weight); }
.kicker { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-subtle); }
.kicker-accent { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-accent); }
.spacer { flex: 1; }
.link { color: var(--color-accent); cursor: pointer; text-decoration: none; }
.link:hover, .link:focus-visible { color: var(--color-accent-700); text-decoration: underline; }
/* A link inside a sentence needs more than its colour to stand out (WCAG 1.4.1). */
:is(p, .lead, .notice, .msg, .small, .sub) .link:not(.others) { text-decoration: underline; text-underline-offset: 2px; }
html { scroll-padding-top: 72px; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 30; padding: 8px 12px; background: var(--color-text); color: var(--color-bg); font-family: var(--font-heading); font-weight: 800; font-size: 13px; text-decoration: none; }
.skip:focus { top: 8px; }
/* Section headings look like the design system's h6 but sit at h2, so
   screen readers get an outline without skipped levels. */
.section-title { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; }
.page-head h1 { font-size: 32px; margin: 0; }
.filter-label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; font-size: 12px; }
.scroll-x { overflow-x: auto; }
.meta { margin-top: 4px; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hidden { display: none !important; }
button.link { background: none; border: 0; padding: 0; font: inherit; }
.row-toggle, .sortable { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; letter-spacing: inherit; text-transform: inherit; text-align: left; cursor: pointer; }
.sortable { padding: 4px 0; user-select: none; }
.sortable.right { text-align: right; }
.sortable:hover { color: var(--color-accent); }
.sortable.on { color: var(--color-text); }
.sortable i { font-style: normal; font-size: 9px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* A feature that is shown but not ready. The tip also opens on focus, so a
   tap on a phone and a Tab from the keyboard show it, not only a mouse. */
.soon { position: relative; }
.soon .btn[aria-disabled='true'], .soon .input:disabled { opacity: 0.45; cursor: not-allowed; }
.soon:hover::after, .soon:focus-within::after {
  content: attr(data-tip); position: absolute; left: 0; bottom: calc(100% + 6px); z-index: 6; max-width: 260px; width: max-content;
  padding: 6px 10px; font-size: 12px; line-height: 1.4; background: var(--color-text); color: var(--color-bg); pointer-events: none;
}

#board.htmx-request .trips, #board.htmx-request .notice { opacity: 0.5; transition: opacity 0.2s; }
.btn.busy, .toggle.busy, .link-button.busy { cursor: progress; opacity: 0.6; }
.toast { position: fixed; right: 16px; bottom: 16px; z-index: 20; max-width: min(420px, calc(100% - 32px)); padding: 10px 14px; font-size: 13px; background: var(--color-text); color: var(--color-bg); border-left: 3px solid var(--color-accent); }
.toast:empty { display: none; }

/* — header — */
.hdr { display: flex; align-items: stretch; flex-wrap: wrap; gap: 8px 28px; padding: 0 28px; border-bottom: 2px solid var(--color-divider); background: var(--color-bg); position: sticky; top: 0; z-index: 5; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 0; margin-right: 8px; color: var(--color-text); text-decoration: none; }
.brand-mark { width: 22px; height: 22px; background: var(--color-accent); }
.brand-name { font-family: var(--font-heading); font-weight: 800; font-size: 15px; letter-spacing: 0.02em; }
.brand-home { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 3px 6px; border: 1px solid var(--color-divider); color: var(--color-text-muted); }
.navlinks { display: flex; align-items: stretch; gap: 2px; overflow-x: auto; max-width: 100%; }
.navlink { display: flex; align-items: center; padding: 18px 12px; font-family: var(--font-heading); font-weight: 800; font-size: 13px; white-space: nowrap; color: var(--color-text); text-decoration: none; }
.navlink:hover { color: var(--color-accent); }
.navlink.on { box-shadow: inset 0 -3px 0 var(--color-accent); }
/* The nav scrolls sideways on phones, which clips an outline drawn outside it. */
.navlink:focus-visible, .place-row:focus-visible { outline-offset: -3px; }
.hdr-right { display: flex; align-items: center; gap: 14px; flex: none; padding: 8px 0; }
.hdr-note { font-size: 12px; white-space: nowrap; color: var(--color-text-subtle); }
.avatar { width: 36px; height: 36px; border: 0; padding: 0; cursor: pointer; background: var(--color-neutral-300); color: var(--color-text); display: flex; align-items: center; justify-content: center; font-size: 11px; font-family: var(--font-heading); font-weight: 800; }
.avatar:hover, .menu[open] > .avatar { background: var(--color-accent); color: var(--color-bg); }
.avatar.on { box-shadow: inset 0 -3px 0 var(--color-accent); }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 220px; padding: 8px 0; display: flex; flex-direction: column; background: var(--color-bg); border: 2px solid var(--color-text); }
.menu-who { padding: 4px 14px 8px; }
.menu-head { padding: 8px 14px 4px; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-text-subtle); }
.menu-link { display: block; width: 100%; padding: 9px 14px; border: 0; background: none; font: inherit; font-size: 14px; color: var(--color-text); text-align: left; text-decoration: none; cursor: pointer; }
.menu-link:hover, .menu-link.on { background: var(--color-surface); }
.menu-link.on { box-shadow: inset 3px 0 0 var(--color-accent); }
.menu-link:focus-visible { outline-offset: -3px; }
.menu-rule { height: 1px; border: 0; margin: 6px 0; background: var(--color-divider); }
.foot { margin-top: auto; border-top: 2px solid var(--color-divider); padding: 16px 28px; display: flex; gap: 20px; flex-wrap: wrap; font-size: 11px; color: var(--color-text-subtle); }
.app { min-height: 100vh; display: flex; flex-direction: column; }
.foot-links { margin-left: auto; display: flex; gap: 16px; }
.foot .link { font-size: 11px; }
.guide { max-width: 720px; }
.guide .section-title { margin: 28px 0 8px; }
.guide p { line-height: 1.6; }
.glossary { margin: 0; }
.glossary dt { font-family: var(--font-heading); font-weight: 800; margin-top: 14px; }
.glossary dd { margin: 2px 0 0; line-height: 1.6; color: var(--color-text-muted); }

/* The kinds of trip, one tab row across every trips page. */
.subnav { display: flex; flex-wrap: wrap; gap: 0 4px; margin: 0 0 18px; border-bottom: 1px solid var(--color-divider); }
.subnav-link { padding: 10px 12px; font-family: var(--font-heading); font-weight: 800; font-size: 13px; color: var(--color-text); text-decoration: none; }
.subnav-link:hover { color: var(--color-accent); }
.subnav-link.on { box-shadow: inset 0 -3px 0 var(--color-accent); }
.subnav-link:focus-visible { outline-offset: -3px; }

/* — what's new — */
dialog.changelog { border: 0; color: var(--color-text); width: min(520px, calc(100% - 32px)); max-height: min(80vh, 720px); }
dialog.changelog[open] { display: flex; }
/* Only the entries scroll, so the title and "Got it" stay in view. */
dialog.changelog .dialog-body { overflow-y: auto; min-height: 0; }
.dialog-title { margin: 0; font-size: 20px; }
.dialog-title:focus { outline: none; }
dialog.changelog::backdrop { background: color-mix(in srgb, var(--color-neutral-900) 50%, transparent); }
.change { border-top: 2px solid var(--color-divider); padding: 12px 0 4px; }
.change:first-child { border-top: 0; padding-top: 0; }
.change-title { margin: 4px 0 6px; font-size: 16px; }
.change p { margin: 0; line-height: 1.5; }

/* — page scaffolding — */
.page { padding: 26px 28px 60px; width: 100%; }
.page-narrow { max-width: 1180px; }
.page-wide { padding: 26px 28px 60px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; }
.page-head .sub { font-size: 13px; color: var(--color-text-muted); padding-bottom: 5px; }
.lead { font-size: 13px; max-width: 760px; color: var(--color-text-subtle); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
.split > .main { min-width: 0; padding-right: 28px; }
/* The filter column scrolls on its own, so its buttons stay reachable on a short laptop screen. */
.split > aside { border-left: 2px solid var(--color-divider); padding: 0 0 40px 24px; min-width: 0; position: sticky; top: 80px; max-height: calc(100vh - 96px); overflow-y: auto; }
.filters > summary { display: none; }
.more-filters { margin-top: 14px; border-top: 1px solid var(--color-divider); }
.more-filters > summary { cursor: pointer; padding: 12px 0; font-family: var(--font-heading); font-weight: 800; font-size: 13px; }
.more-filters > .stack { padding-bottom: 4px; }
/* One column: the filters move above the list, folded, instead of after
   forty trips at the bottom of the page. */
@media (max-width: 960px) {
  .split { grid-template-columns: minmax(0, 1fr); }
  .split > .main { padding-right: 0; }
  .split > aside { border-left: 0; border-top: 2px solid var(--color-divider); padding: 20px 0 0; position: static; max-height: none; overflow: visible; }
  .split > aside:has(> .filters) { order: -1; border-top: 0; border-bottom: 2px solid var(--color-divider); padding: 0 0 12px; margin-bottom: 16px; }
  .filters > summary { display: block; cursor: pointer; padding: 10px 0; font-family: var(--font-heading); font-weight: 800; font-size: 14px; }
  .filters > summary + .section-title { display: none; }
}
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.toolbar input[type=range] { width: 150px; accent-color: var(--color-accent); }
/* Browsers give range inputs a side margin; at full width that overflows the sticky filter column and draws a useless horizontal scrollbar. */
.filter-slider { width: 100%; margin-inline: 0; accent-color: var(--color-accent); }
.filter-slider:disabled { opacity: 0.4; }
.seg a.seg-opt { color: inherit; text-decoration: none; }
.seg a.seg-opt.on, .seg-opt.on { background: var(--color-accent); color: var(--color-bg); }
.notice { padding: 14px; background: var(--color-surface); font-size: 13px; }
.notice strong { font-family: var(--font-heading); }
.msg { padding: 8px 10px; font-size: 13px; border-left: 3px solid var(--color-accent-700); background: var(--color-accent-100); }
.msg-ok { border-left-color: var(--color-neutral-700); background: var(--color-neutral-100); }
.link-button { border: 0; padding: 0; background: none; font: inherit; color: var(--color-accent); cursor: pointer; text-decoration: underline; }

/* — trip list — */
.trips { overflow-x: auto; }
.trips-inner { min-width: 790px; }
.trip-head, .trip-row { display: grid; grid-template-columns: 64px minmax(190px, 2fr) 112px minmax(146px, 1.4fr) 74px minmax(118px, 1.2fr) 28px; gap: 14px; align-items: center; }
.value { font-family: var(--font-heading); font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.value.minus { color: var(--color-text-subtle); }
.trip-head { padding: 0 14px 8px; font-size: 10px; white-space: nowrap; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-subtle); border-bottom: 2px solid var(--color-divider); }
.journeys .trip-head, .journeys .trip-row { grid-template-columns: minmax(280px, 3fr) 110px 110px minmax(150px, 1.1fr) 110px 28px; }
.stop-chain { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; }
.stop-chain .dest { font-weight: 800; }
.stop-chain .sep { color: var(--color-text-subtle); }
.tours .code { overflow-wrap: anywhere; }
.itinerary > div { padding: 2px 0; }
.itinerary-stay { padding: 4px 0 4px 14px !important; margin: 2px 0; border-left: 2px solid var(--color-accent); background: var(--color-surface); }
.itinerary-stay .link-button { margin-left: 6px; }
.chip.left-out { background: none; font: inherit; font-size: 12px; }
.tours .trip-head, .tours .trip-row { grid-template-columns: 64px minmax(240px, 2.6fr) 100px minmax(150px, 1.2fr) 70px 90px 100px 28px; }
.trip-row { padding: 14px; border-bottom: 1px solid var(--color-divider); cursor: pointer; }
.trip-row:hover, .trip.open > .trip-row { background: var(--color-surface); }
.trip.excluded .trip-row { opacity: 0.72; }

/* — trips grouped by place — */
.places-inner { min-width: 560px; }
.place-head, .place-row { display: grid; grid-template-columns: minmax(200px, 2.4fr) 64px 96px 112px minmax(96px, 1fr) 28px; gap: 14px; align-items: center; }
.place-head { padding: 0 14px 8px; font-size: 10px; white-space: nowrap; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-subtle); border-bottom: 2px solid var(--color-divider); }
.place-row { padding: 14px; border-bottom: 1px solid var(--color-divider); color: inherit; text-decoration: none; }
.place-row:hover { background: var(--color-surface); }
.place-row:hover .city { color: var(--color-accent); }
@media (max-width: 560px) {
  .places-inner { min-width: 0; }
  .place-head, .place-row { grid-template-columns: minmax(0, 1fr) 40px 60px 84px; gap: 10px; }
  .place-head > :nth-child(n+5), .place-row > :nth-child(n+5) { display: none; }
  .place-row { padding: 12px 4px; }
  .place-head { padding: 0 4px 8px; }
  .place-row .city { font-size: 17px; }
  .place-row .fare { font-size: 16px; }
  .place-row .value { font-size: 15px; }
}
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin: 0 0 14px; font-size: 13px; }
.crumbs strong { font-family: var(--font-heading); }
.crumb-sep { color: color-mix(in srgb, var(--color-text) 35%, transparent); }
.city { font-family: var(--font-heading); font-weight: 800; font-size: 19px; line-height: 1.1; }
.city a { color: inherit; text-decoration: none; }
.city a:hover { color: var(--color-accent); }
.code { font-size: 11px; letter-spacing: 0.08em; color: var(--color-text-subtle); }
.fare { font-family: var(--font-heading); font-weight: 800; font-size: 22px; line-height: 1; font-variant-numeric: tabular-nums; }
.bar { height: 8px; background: var(--color-neutral-300); position: relative; }
.bar > i { position: absolute; inset: 0; background: var(--color-accent); }
.bar.over > i { background: var(--color-neutral-500); }
.arrow { text-align: right; font-size: 18px; color: var(--color-accent); text-decoration: none; }
.arrow:hover { color: var(--color-accent-700); }
.route-map { width: 100%; height: 260px; display: block; background: var(--color-surface); }
.route-map .land { fill: var(--color-neutral-300); stroke: var(--color-surface); }
.route-map .hop { fill: none; stroke: var(--color-accent); stroke-width: 2; vector-effect: non-scaling-stroke; }
.route-map .stop { fill: var(--color-text); }
.route-map .stop.home { fill: var(--color-accent); }
.route-map .label { font-family: var(--font-heading); font-weight: 800; font-size: 11px; fill: var(--color-text); paint-order: stroke; stroke: var(--color-surface); stroke-width: 3px; }
.detail { padding: 12px 14px 20px; border-bottom: 1px solid var(--color-divider); background: color-mix(in srgb, var(--color-surface) 60%, var(--color-bg)); }
.detail-grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--color-divider); font-size: 13px; }
.kv .v { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.kv.total { border-bottom: 2px solid var(--color-divider); font-family: var(--font-heading); font-weight: 800; }
.plus { color: var(--color-accent-700); }
.minus { color: var(--color-text-muted); }
.legend-list { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 24px 0 0; }
.legend-list > div { display: flex; gap: 8px; align-items: baseline; }
.legend-list dt, .legend-list dd { margin: 0; }
.more-row { display: flex; justify-content: center; padding: 22px 0 0; }

/* — trip detail page — */
.trip-hero { display: flex; align-items: flex-start; gap: 28px; flex-wrap: wrap; border-bottom: 2px solid var(--color-divider); padding-bottom: 20px; }
.trip-hero h1 { margin: 0 0 6px; font-size: 34px; }
.trip-price.gone .big-fare { color: var(--color-text-subtle); text-decoration: line-through; text-decoration-thickness: 2px; }
.big-fare { font-family: var(--font-heading); font-weight: 800; font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 16px; margin-top: 12px; }
.hero-links button.link { border: 0; padding: 0; background: none; font: inherit; }
@media (max-width: 640px) { .hero-links { justify-content: flex-start; } }
.legs .leg { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 18px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--color-divider); }
/* The time in a city between two flights of a tour, set apart from the flights. */
.stay { display: grid; grid-template-columns: 74px minmax(0, 1fr) auto; gap: 18px; align-items: baseline; padding: 10px 12px; margin: 0 -12px; background: var(--color-surface); border-bottom: 1px solid var(--color-divider); font-size: 14px; }
@media (max-width: 640px) { .stay { grid-template-columns: 1fr; gap: 2px; } .stay .kicker { display: none; } .stay .right { text-align: left; } }
.layover { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 18px; padding: 6px 0; border-bottom: 1px solid var(--color-divider); color: var(--color-text-muted); }
.layover.long { color: var(--color-accent); font-weight: 600; }
@media (max-width: 640px) { .layover { grid-template-columns: 1fr; } .layover > div:first-child { display: none; } }
.leg-times { display: flex; align-items: baseline; gap: 12px; font-variant-numeric: tabular-nums; }
.leg-time { font-family: var(--font-heading); font-weight: 800; font-size: 24px; }
.leg-line { flex: 1; height: 2px; background: var(--color-divider); min-width: 40px; }
.leg-fare { font-family: var(--font-heading); font-weight: 800; font-size: 17px; text-align: right; }
.booking { border-top: 2px solid var(--color-divider); margin-top: 8px; }
.booking-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 84px; gap: 18px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--color-divider); }
.booking-site { font-family: var(--font-heading); font-weight: 700; font-size: 15px; }
.booking-price { font-family: var(--font-heading); font-weight: 800; font-size: 17px; text-align: right; }
.booking-go { padding: 5px 10px; font-size: 12px; text-align: center; }
.booking-legs { display: grid; gap: 4px; }
.alt-dir { display: inline-block; width: 40px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--color-text-muted); }
.booking-more > summary { cursor: pointer; padding: 10px 0; }
.booking-more > .booking { border-top: 0; margin-top: 0; }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 28px; }
.route-picker { margin: 14px 0 12px; }
.route-picker .input { width: min(280px, 100%); }
.stat { padding: 12px 0; border-bottom: 1px solid var(--color-divider); }
.stat-value { font-family: var(--font-heading); font-weight: 800; font-size: 24px; font-variant-numeric: tabular-nums; }
.panel { padding: 14px; background: var(--color-surface); }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.bars > i { flex: 1; background: var(--color-neutral-400); display: block; }
.bars > i.lo { background: var(--color-accent); }
.bars > i.dear { background: var(--color-neutral-600); }
.date-history { color: var(--color-accent); margin-bottom: 8px; }
.date-history svg { display: block; width: 100%; height: auto; max-width: 320px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 220px; border-bottom: 2px solid var(--color-divider); }
.chart > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 6px; }
.chart > div > i { width: 100%; display: block; background: var(--color-neutral-400); }
.chart > div.lo > i { background: var(--color-accent); }
.chart-labels { display: flex; gap: 6px; margin-top: 8px; }
.chart-labels > span { flex: 1; text-align: center; font-size: 11px; color: var(--color-text-muted); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.month-chips { margin: 12px 0 4px; }
.month-chips .chip.on .faint { color: inherit; opacity: 0.7; }
.trip .others { display: inline-block; margin-top: 3px; }
.chip { padding: 6px 12px; font-size: 12px; cursor: pointer; text-decoration: none; color: inherit; border: 1px solid var(--color-control-border); }
.chip:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.chip.on { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }

/* — calendar — */
.heat { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.heat-day { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--color-text-subtle); padding-bottom: 4px; }
.heat-cell { aspect-ratio: 1.6; padding: 8px; display: flex; flex-direction: column; justify-content: space-between; text-decoration: none; color: inherit; background: var(--color-surface); }
.heat-cell.tone-cheap { background: var(--color-accent-500); }
.heat-cell.tone-good { background: var(--color-accent-300); }
.heat-cell.tone-mid { background: var(--color-neutral-300); }
.heat-cell.tone-dear { background: var(--color-neutral-500); }
.heat-cell.tone-none { color: var(--color-text-subtle); }
.heat-cell.best { outline: 2px solid var(--color-text); outline-offset: -2px; }
.heat-cell .day { font-size: 11px; font-variant-numeric: tabular-nums; }
.heat-cell.past .day { text-decoration: line-through; }
.heat-cell .price { font-family: var(--font-heading); font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.heat-cell .heat-airport { font-size: 10px; letter-spacing: 0.06em; }
/* A bar, not an outline: the cheapest day already wears the outline, and the picked day is often the cheapest. */
.heat-cell[aria-current] { box-shadow: inset 0 -6px 0 var(--color-text); }
.heat-cell .price-short { display: none; }
.heat-key .key-best, .heat-key .key-picked { display: inline-block; width: 14px; height: 10px; margin: 0 6px 0 0; vertical-align: baseline; background: var(--color-surface); }
.heat-key .key-best { outline: 2px solid var(--color-text); outline-offset: -2px; }
.heat-key .key-picked { box-shadow: inset 0 -4px 0 var(--color-text); margin-left: 8px; }
.heat-cell.estimate .price { font-weight: 600; }
.returns { margin-top: 24px; padding-top: 16px; border-top: 2px solid var(--color-divider); }
.returns-head { align-items: baseline; flex-wrap: wrap; gap: 6px 12px; }
.returns-key { display: grid; gap: 4px; margin: 12px 0 0; }
.returns-key div { display: flex; gap: 10px; }
.returns-key dt { flex: 0 0 64px; font-weight: 700; color: var(--color-text); white-space: nowrap; }
.returns-key dd { margin: 0; }
.scale { display: flex; }
.scale > i { width: 22px; height: 12px; display: block; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

/* — sources — */
.src-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 24px 28px; }
.src-card { border-top: 2px solid var(--color-divider); padding-top: 16px; }
.src-title { font-family: var(--font-heading); font-weight: 800; font-size: 17px; }
.proxy-bars { height: 120px; }
.proxy-host { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-row { display: flex; justify-content: space-between; font-size: 12px; padding: 6px 0; border-bottom: 1px solid var(--color-divider); font-variant-numeric: tabular-nums; }
.spark { display: flex; align-items: flex-end; gap: 2px; height: 36px; margin-top: 14px; }
.spark > i { flex: 1; display: block; background: var(--color-neutral-400); }
.spark > i.bad { background: var(--color-accent); }
.log-row { display: grid; grid-template-columns: 78px 120px minmax(0, 1fr) auto; gap: 14px; font-size: 12px; padding: 9px 0; border-bottom: 1px solid var(--color-divider); font-variant-numeric: tabular-nums; }
.log-row .stats { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: ui-monospace, monospace; font-size: 11px; }
.state-ok { color: var(--color-neutral-700); }
.state-running { color: var(--color-accent-700); }
.state-error { color: var(--color-accent); }
.state-warn { color: var(--color-accent); font-weight: 600; }
.live-check { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--color-divider); background: var(--color-surface); }
.live-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; margin-bottom: 8px; }
.live-title { font-family: var(--font-heading); font-weight: 800; font-size: 15px; }
.live-again { margin-left: auto; padding: 4px 10px; font-size: 12px; }
.live-check.done { padding-block: 8px; }
.live-check.done .live-head { margin-bottom: 0; }
.live-details summary { cursor: pointer; }
.live-bar { height: 6px; background: var(--color-divider); overflow: hidden; margin-bottom: 8px; }
.live-bar > i { display: block; height: 100%; background: var(--color-accent); transition: width 0.6s ease; }
.live-bar.running > i { background-image: linear-gradient(90deg, transparent 0 25%, color-mix(in srgb, var(--color-bg) 35%, transparent) 50%, transparent 75%); background-size: 200% 100%; animation: live-sweep 1.2s linear infinite; }
.live-bar.failed > i { background: var(--color-neutral-500); }
@keyframes live-sweep { from { background-position: 200% 0; } to { background-position: 0 0; } }
.live-steps { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 2px; font-size: 12px; }
.live-steps li { color: var(--color-text-subtle); }
.live-steps li::before { display: inline-block; width: 16px; content: "○"; }
.live-steps li.running { color: var(--color-text); }
.live-steps li.running::before { content: "●"; color: var(--color-accent); }
.live-steps li.done::before { content: "✓"; }
.live-steps li.failed::before { content: "✕"; color: var(--color-accent); }
.live-steps li.skipped::before { content: "–"; }
@media (prefers-reduced-motion: reduce) { .live-bar.running > i { animation: none; } .live-bar > i { transition: none; } }
.trail { margin-top: 32px; border-top: 2px solid var(--color-divider); padding-top: 14px; }
.trail > summary { cursor: pointer; list-style-position: inside; }
.trail .table td, .trail .table th { font-size: 12px; }
.counters { display: flex; gap: 2px; background: var(--color-divider); margin-bottom: 18px; }
.counters > div { flex: 1; background: var(--color-bg); padding: 14px 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* — alerts — */
.rule { display: flex; align-items: center; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--color-divider); }
.rule-name { font-family: var(--font-heading); font-weight: 800; font-size: 16px; }
.toggle { width: 44px; height: 24px; background: var(--color-control-border); position: relative; cursor: pointer; flex: none; border: 0; padding: 0; }
.toggle.on { background: var(--color-accent); }
.toggle > i { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; background: var(--color-bg); }
.toggle.on > i { left: 22px; }
.note { padding: 13px 0; border-bottom: 1px solid var(--color-divider); }

/* — settings — */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), 1fr)); gap: 24px 28px; }
.settings-group { border-top: 2px solid var(--color-divider); padding-top: 16px; display: flex; flex-direction: column; gap: 4px; }
.frow { display: grid; grid-template-columns: minmax(9rem, 1fr) 2fr; gap: 12px; align-items: start; font-size: 13px; padding: 5px 0; }
.frow > span { padding-top: 8px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.frow .input { min-height: 32px; padding: 4px 8px; font-size: 13px; }
.frow textarea.input { min-height: 56px; font-family: ui-monospace, monospace; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding-top: 8px; }
.check input { accent-color: var(--color-accent); }
.checks { display: flex; flex-wrap: wrap; gap: 10px; padding-top: 6px; }
.form-actions { display: flex; gap: 8px; padding-top: 10px; }

/* — watched routes — */
.addform { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; align-items: end; }
.place-field { position: relative; grid-column: span 2; }
.suggestions { position: absolute; z-index: 20; left: 0; right: 0; top: 100%; max-height: 320px; overflow-y: auto; background: var(--color-bg); }
.suggestions:has(> *) { border: 2px solid var(--color-text); border-top: 0; }
.suggestion {
  display: grid; grid-template-columns: 1fr auto; column-gap: 8px; width: 100%; padding: 7px 10px;
  font: inherit; text-align: left; color: var(--color-text); background: none; border: 0; border-bottom: 1px solid var(--color-divider); cursor: pointer;
}
.suggestion:last-child { border-bottom: 0; }
/* Floating over the scrolling filter column, the list only made that column taller and scrolled out of view. */
aside .suggestions { position: static; }
.suggestion > span { grid-column: 1; }
.suggestion > .tag { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.suggestion:hover, .suggestion.on { background: var(--color-surface); }
.suggestion.on { box-shadow: inset 3px 0 0 var(--color-accent); }
.suggestion-name { font-weight: 600; font-size: 14px; }
.suggestion-none { padding: 8px 10px; }
@media (max-width: 480px) { .place-field { grid-column: 1 / -1; } }
.board-place { max-width: 420px; margin: 0 0 4px; }
.hide-status .link, .hide-status .link-button { color: inherit; text-decoration: underline; margin-left: 8px; }
.hide-status .hide-dismiss { text-decoration: none; font-size: 16px; line-height: 1; padding: 2px 4px; }
@media (max-width: 480px) { .toast.hide-status { left: 16px; right: 16px; bottom: 12px; max-width: none; } }
.hide-actions { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; }
.hidden-list { max-width: 640px; }

/* — feature ideas — */
.idea-form { display: grid; gap: 10px; max-width: 640px; }
.idea-form textarea.input { min-height: 72px; }
.ideas { max-width: 760px; }
.idea { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; align-items: start; padding: 14px 0; border-bottom: 1px solid var(--color-divider); }
.idea-vote { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 52px; padding: 0; font: inherit; color: var(--color-text); background: none; border: 2px solid var(--color-divider); }
button.idea-vote { cursor: pointer; }
button.idea-vote:hover { border-color: var(--color-text); }
.idea-vote.on { border-color: var(--color-accent); color: var(--color-accent); }
span.idea-vote { color: var(--color-text-subtle); border-style: dotted; }
.idea-arrow { font-size: 9px; line-height: 1; }
.idea-count { font-family: var(--font-heading); font-weight: 800; font-size: 16px; line-height: 1; font-variant-numeric: tabular-nums; }
.idea-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 15px; overflow-wrap: anywhere; }
.idea-closed .idea-title .heading { color: var(--color-text-muted); }
.idea-details { margin: 4px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.idea-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 6px; }
.idea-meta .input.idea-status { width: auto; min-height: 0; padding: 2px 6px; font-size: 11px; }

/* — picks: one card per question — */
.picks { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 28px; }
.pick { border-top: 2px solid var(--color-divider); padding-top: 14px; display: flex; flex-direction: column; min-width: 0; }
.pick-city { margin: 10px 0 2px; font-size: 24px; line-height: 1.1; }
.pick-city a { color: inherit; text-decoration: none; }
.pick-city a:hover, .pick-city a:focus-visible { color: var(--color-accent); }
.pick-price { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.pick-actions { margin-top: auto; padding-top: 14px; }

.alert-kinds { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 4px; }
/* — watchlist: one card per watched place — */
.addform { max-width: 1200px; }
.watch-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 18px; margin-bottom: 4px; }
.watches { display: flex; flex-direction: column; }
.watch { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(260px, 1.6fr) minmax(200px, 0.9fr); gap: 14px 32px; padding: 20px 0 14px; border-bottom: 2px solid var(--color-divider); }
.watch.paused > :not(.watch-foot) { opacity: 0.55; }
.watch-name { margin: 0; font-family: var(--font-heading); font-weight: 800; font-size: 20px; line-height: 1.15; }
.watch-terms { margin-top: 8px; }
.watch-price-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 2px 0 2px; }
.watch-price { font-family: var(--font-heading); font-weight: 800; font-size: 24px; color: var(--color-text); text-decoration: none; }
.watch-price::after { content: " →"; color: var(--color-accent); }
.watch-price:hover, .watch-price:focus-visible { text-decoration: underline; }
.watch-stats { display: flex; flex-wrap: wrap; gap: 4px 20px; margin: 10px 0 0; }
.watch-stats div { display: flex; gap: 6px; }
.watch-stats dt { color: var(--color-text-subtle); }
.watch-stats dd { margin: 0; }
.watch-alert-input { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.watch-alert-input .input { width: 110px; min-height: 32px; padding: 4px 8px; }
.watch-alert-input .btn { padding: 5px 10px; font-size: 13px; }
.watch-foot { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; padding-top: 10px; border-top: 1px solid var(--color-divider); }
.watch-airlines { flex: 1 1 280px; min-width: 0; }
.watch-actions { display: flex; gap: 16px; }
.watch-actions .link-button { text-decoration: none; }
.watch-actions .link-button:hover, .watch-actions .link-button:focus-visible { text-decoration: underline; }
.watch-edit-toggle { margin-top: 6px; }
.watch-edit { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; align-items: end; padding: 12px 0 2px; border-top: 1px solid var(--color-divider); }
/* The grid display would otherwise override the hidden attribute and show every card's form. */
.watch-edit[hidden] { display: none; }
.watch-edit-error, .watch-edit-note { grid-column: 1 / -1; margin: 0; }
.watch-edit-actions { display: flex; align-items: center; gap: 14px; }
@media (max-width: 860px) {
  .watch { grid-template-columns: 1fr 1fr; }
  .watch-place { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .watch { grid-template-columns: 1fr; gap: 12px; }
  .watch-foot { flex-direction: column; gap: 6px; }
  .watch-airlines { flex: none; }
}

/* — login — */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; }

/* — map — */
.shell { flex: 1; display: flex; align-items: stretch; min-height: 0; }
.side { flex: 0 0 340px; min-height: 0; border-right: 2px solid var(--color-divider); padding: 22px 22px 40px; overflow-y: auto; }
.mapwrap { flex: 1; min-width: 0; min-height: 0; position: relative; }
#map { position: relative; display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
/* Its own compositor layer, so a zoom or drag moves the drawn countries instead of repainting them. */
#mapland { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; transform-origin: 0 0; will-change: transform; }
#map:active { cursor: grabbing; }
/* Strokes shrink with the zoom through --k instead of vector-effect: non-scaling-stroke,
   which recomputes every outline on every frame and made the world map stutter. */
.land { fill: var(--color-neutral-200); stroke: var(--color-bg); stroke-width: calc(1px / var(--k, 1)); }
.land.lit { fill: var(--color-neutral-300); }
.zoomui { position: absolute; right: 16px; top: 16px; display: flex; flex-direction: column; gap: 2px; background: var(--color-divider); padding: 2px; }
.zoomui button { width: 34px; height: 34px; border: 0; background: var(--color-bg); color: var(--color-text); font-family: var(--font-heading); font-weight: 800; font-size: 16px; line-height: 1; cursor: pointer; }
.zoomui button:hover { background: var(--color-accent); color: var(--color-bg); }
.zoomui button.reset { font-size: 10px; letter-spacing: 0.06em; }
.arc { fill: none; stroke: var(--color-text); stroke-opacity: 0.35; stroke-width: calc(1.25px / var(--k, 1)); }
.arc.on { stroke: var(--color-accent); stroke-opacity: 1; stroke-width: calc(2px / var(--k, 1)); }
.pin { cursor: pointer; }
.chip-bg { fill: var(--color-bg); stroke: var(--color-text); stroke-width: 1.5; }
.pin.deal .chip-bg { fill: var(--color-accent); stroke: var(--color-accent); }
.pin.on .chip-bg { fill: var(--color-text); stroke: var(--color-text); }
.chip-t { font-family: var(--font-heading); font-weight: 800; font-size: 12px; fill: var(--color-text); dominant-baseline: middle; }
.chip-c { font-size: 10.5px; letter-spacing: 0.06em; fill: var(--color-text); dominant-baseline: middle; }
.pin.deal .chip-t, .pin.on .chip-t, .pin.deal .chip-c, .pin.on .chip-c { fill: var(--color-bg); }
.pin.on .chip-c { font-weight: 700; }
.dot { fill: var(--color-text); }
.lead-line { stroke: var(--color-text); stroke-opacity: 0.45; stroke-width: 1; }
.pin.deal .lead-line { stroke: var(--color-accent); stroke-opacity: 0.9; }
.pin.deal .dot { fill: var(--color-accent); }
.home-t { font-family: var(--font-heading); font-weight: 800; font-size: 11px; letter-spacing: 0.1em; fill: var(--color-text); }
.app.map-page { height: 100vh; height: 100dvh; overflow: hidden; }
.map-page .foot { display: none; }
.side-title { margin: 0 0 8px; font-size: 20px; }
.map-detail { position: sticky; top: -22px; z-index: 1; margin: 14px 0 6px; line-height: 1.6; }
.map-detail:empty { display: none; }
.side-row { display: grid; grid-template-columns: minmax(0, 1fr) 86px; gap: 10px; align-items: center; width: 100%; padding: 11px 8px; border: 0; border-bottom: 1px solid var(--color-divider); background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.side-row:focus-visible { outline-offset: -2px; }
.side-row:hover, .side-row.on { background: var(--color-surface); }
.side-row .l, .side-row .r, .side-row .city, .side-row .fare, .side-row .sub, .side-row .delta { display: block; }
.side-row .city { font-size: 15px; }
.side-row .fare { font-size: 17px; text-align: right; }
.side-row .sub, .side-row .delta { font-size: 11px; margin-top: 2px; }
.side-row .delta { text-align: right; }
.legend { display: flex; gap: 14px; align-items: center; font-size: 11px; color: var(--color-text-muted); padding: 10px 28px; border-top: 2px solid var(--color-divider); flex-wrap: wrap; }
.sw { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; margin-right: 5px; }

/* Phones: each trip becomes a two-line card (place and price, then dates and
   time away) instead of a 790px table that hid the price off to the side. */
@media (max-width: 640px) {
  .trips-inner { min-width: 0; }
  .trip-head { display: flex; flex-wrap: wrap; gap: 2px 16px; padding: 0 4px 8px; }
  .trip-head > span { display: none; }
  .trip-head .sortable.right { text-align: left; }
  .trip-row, .tours .trip-row { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; padding: 12px 4px; align-items: start; }
  .trip-row > :nth-child(2) { grid-area: 1 / 1; }
  .trip-row > :nth-child(3) { grid-area: 1 / 2; }
  .trip-row > :nth-child(4) { grid-area: 2 / 1; }
  .trip-row > :nth-child(5) { grid-area: 2 / 2; text-align: right; }
  .trip-row > :nth-child(1), .trip-row > :nth-child(n+6) { display: none; }
  .journeys .trip-row > :nth-child(1) { display: block; grid-area: 1 / 1; }
  .journeys .trip-row > :nth-child(2) { grid-area: 1 / 2; }
  .journeys .trip-row > :nth-child(3) { display: block; grid-area: 2 / 2; }
  .journeys .trip-row > :nth-child(5) { display: none; }
  /* A journey has no name button to open it by; the arrow is its only toggle. */
  .journeys .trip-row { grid-template-columns: minmax(0, 1fr) auto auto; }
  .journeys .trip-row > .row-toggle { display: block; grid-area: 1 / 3 / 3 / 4; align-self: center; }
  .trip-row .city { font-size: 17px; }
  .trip-row .fare { font-size: 19px; }
  .heat-cell { padding: 4px; aspect-ratio: auto; min-height: 52px; }
  .heat-cell .price { font-size: 12px; }
  .heat-cell .tiny { display: none; }
  .heat-cell .price-full { display: none; }
  .heat-cell .price-short { display: inline; }
  .heat-cell .heat-airport { font-size: 9px; letter-spacing: 0; overflow-wrap: anywhere; }
  .log-row { grid-template-columns: 78px minmax(0, 1fr); }
  .log-row .stats { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  .hdr { position: static; }
  .hdr { column-gap: 12px; }
  .navlinks { order: 3; width: 100%; justify-content: space-between; border-top: 1px solid var(--color-divider); }
  .navlink { padding: 12px 6px; }
  .hdr-note { display: none; }
  .hdr, .page, .page-wide { padding-left: 16px; padding-right: 16px; }
  .settings-grid { grid-template-columns: 1fr; }
  .frow { grid-template-columns: 1fr; }
  .shell { flex-direction: column-reverse; }
  /* On a phone the map gets the screen and the list sits under it, rather
     than squeezing the map into a strip under the list. */
  .mapwrap { flex: none; height: 62dvh; }
  .side { flex: 1; border-right: 0; border-top: 2px solid var(--color-divider); padding: 16px 16px 40px; }
  .app.map-page { height: auto; overflow: visible; }
  .map-detail { position: static; }
  .legend { padding: 10px 16px; }
  .trip-hero h1 { font-size: 26px; }
  .big-fare { font-size: 34px; }
}
