/* ============================================================
   wheredowemeet — soft, trustworthy, rounded
   Cool-neutral page, white cards, royal-blue lead accent.
   ============================================================ */

:root {
  /* Page & surfaces */
  --paper:        #f4f6fa;
  --paper-deep:   #e8ecf3;
  --card:         #ffffff;
  --card-edge:    #e6e9ef;

  /* Ink */
  --ink:          #1a2233;
  --ink-soft:     #5d6470;
  --ink-faint:    #9aa1ab;
  --rule:         #e2e6ec;
  --rule-faint:   #eef1f4;

  /* Trustworthy royal blue — leading accent */
  --blue:         #1e5fcd;
  --blue-deep:    #143f8a;
  --blue-soft:    #e0eafd;
  --blue-tint:    #f1f5ff;

  /* Subtle warm punctuation, used sparingly */
  --amber:        #d97706;
  --red:          #c8341d;

  /* Per-party tones (cohesive set, slight warmth on 2 & 3) */
  --party-0: #1e5fcd;   /* blue */
  --party-1: #0d9488;   /* teal */
  --party-2: #d97706;   /* amber */
  --party-3: #db2777;   /* rose */
  --party-4: #7c3aed;   /* violet */

  /* Effects */
  --shadow-soft:  0 2px 10px rgba(20, 30, 60, 0.05);
  --shadow-card:  0 6px 24px rgba(20, 30, 60, 0.07);
  --shadow-lift:  0 14px 36px rgba(20, 30, 60, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  color: var(--ink);
  background: var(--paper);
  font-family: "Albert Sans", "Inter", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
a:hover { color: var(--blue-deep); border-bottom-color: currentColor; }

button, input { font-family: inherit; }

/* ---- Brand bar -------------------------------------------- */
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 2rem 1rem;
  border-bottom: 3px solid var(--blue);
  background: var(--paper);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  border-bottom: 0 !important;
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
}
.brand:hover { color: var(--ink); }
.brand-mark {
  width: 14px;
  height: 14px;
  background: var(--blue);
  display: inline-block;
  border-radius: 3px;
}
.brand-name { font-weight: 700; }

.brand-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 0.96rem;
}
.brand-nav a {
  color: var(--ink-soft);
  font-weight: 500;
}
.brand-nav a:hover { color: var(--blue); }
.brand-nav a.active { color: var(--blue); border-bottom-color: var(--blue); }

/* ---- Layout ----------------------------------------------- */
main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 3.2rem 2rem 4rem;
}

/* The form sits inside a soft card so the page feels less empty. */
.search-panel {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 24px;
  box-shadow: var(--shadow-card);
  padding: 2.4rem 2.4rem 2.6rem;
  display: flex;
  flex-direction: column;
  gap: 2.2rem;
  align-items: stretch;
}

/* ---- Inputs (shared) -------------------------------------- */
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field-label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-weight: 600;
}

input[type="date"],
input[type="time"],
input[type="number"],
input[type="text"] {
  font: inherit;
  font-size: 0.98rem;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--rule);
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  min-width: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input::placeholder { color: var(--ink-faint); }
input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
input[type="date"], input[type="time"], input[type="number"] {
  font-variant-numeric: tabular-nums;
}

/* ---- Dates ------------------------------------------------ */
.dates {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.dates .field { min-width: 200px; }
.dates-sep {
  color: var(--ink-faint);
  padding-bottom: 0.7rem;
  font-size: 1.1rem;
  font-weight: 500;
}

/* ---- Parties row ------------------------------------------ */
/* The parties center on the panel; the + button is taken out of flow
   and pinned to the right so it never displaces the centering. */
.parties-row {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  justify-content: safe center;
  align-items: stretch;
  min-height: 100px;
}
.parties {
  display: flex;
  gap: 1.1rem;
  flex-wrap: nowrap;
  justify-content: center;
  /* `safe` keeps the leftmost tile from being clipped off the left edge if
     the row is briefly wider than the container mid-animation: it falls back
     to start-alignment instead of centering-and-clipping. */
  justify-content: safe center;
  align-items: stretch;
  max-width: 100%;
  /* Deliberately NOT a scroll container. overflow-x:auto here made the
     browser scroll-anchor onto the growing tile during an add and clip the
     leftmost tile off the left edge for a frame ("blink away and back").
     visible lets tiles reposition freely; nowrap still prevents wrapping. */
  overflow: visible;
}

/* ---- Party panel (expanded) ------------------------------- */
.party {
  --party-color: var(--party-0);
  position: relative;
  flex: 0 0 360px;            /* fixed expanded width — nowrap row */
  min-width: 0;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-top: 4px solid var(--party-color);
  border-radius: 16px;
  padding: 1.1rem 1.3rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin: 0;
  /* Clip horizontally so wide body content is cropped cleanly as the tile
     narrows on collapse — but keep vertical visible so the airport
     autocomplete dropdown can extend below the tile's bottom edge. */
  overflow-x: clip;
  overflow-y: visible;
  box-shadow: var(--shadow-soft);
  transition:
    flex-basis 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    max-width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    padding   0.32s cubic-bezier(0.4, 0, 0.2, 1),
    border-width 0.32s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.28s ease,
    border-color 0.18s ease,
    box-shadow 0.22s ease,
    background 0.18s ease,
    transform 0.18s ease;
}

/* Add/remove animation: a party slides in from zero-width (and back to
   zero-width when removed) so it shares space with its siblings during
   the same transition — no popping out and back. */
.party.entering,
.party.leaving {
  flex: 0 0 0 !important;
  max-width: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-left-width: 0;
  border-right-width: 0;
  opacity: 0;
  overflow: hidden;
}
.party.leaving { pointer-events: none; }

.party-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0;
  width: 100%;
  margin-bottom: 0.1rem;
}
.party-name {
  flex: 1;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--ink);
  border: 1.5px solid transparent;
  border-radius: 8px;
  padding: 0.3rem 0.4rem;
  background: transparent;
  min-width: 0;
  letter-spacing: -0.005em;
}
.party-name:hover { border-color: var(--rule); background: var(--paper); }
.party-name:focus {
  background: var(--card);
  border-color: var(--party-color);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--party-color) 18%, transparent);
}

/* Header buttons (chevron / × ) */
.collapse-toggle,
.remove-party,
.remove-origin {
  background: transparent;
  border: 0;
  color: var(--ink-faint);
  cursor: pointer;
  padding: 0.25rem 0.4rem;
  line-height: 1;
  font-size: 1.1rem;
  font-weight: 500;
  border-radius: 6px;
  transition: color 0.15s ease, background 0.15s ease;
}
.collapse-toggle:hover,
.remove-party:hover,
.remove-origin:hover { color: var(--blue); background: var(--blue-soft); }
.collapse-toggle .chevron {
  display: inline-block;
  font-size: 1.05rem;
  line-height: 1;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.collapse-toggle[aria-expanded="false"] .chevron { transform: rotate(180deg); }
.remove-origin:disabled { visibility: hidden; }
.parties.has-one-party .remove-party { display: none; }

.party-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  opacity: 1;
  /* allow-discrete lets `display` participate: the body fades out and only
     then flips to display:none, instead of vanishing the instant .collapsed
     is added. @starting-style handles the reverse (fade in on expand). */
  transition: opacity 0.16s ease, display 0.16s ease;
  transition-behavior: allow-discrete;
}
@starting-style {
  .party:not(.collapsed) .party-body { opacity: 0; }
}

/* Column headers above origin rows (matches the grid below) */
.origin-headers {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 130px 28px;
  gap: 0.5rem;
  padding: 0.1rem 0 0.45rem;
  border-bottom: 1px solid var(--rule-faint);
  margin-bottom: 0.2rem;
}

.origins { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.45rem; }
.origin {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 130px 28px;
  gap: 0.5rem;
  align-items: center;
}
.origin .airport-input { text-transform: uppercase; letter-spacing: 0.06em; }
.origin .airport-input::placeholder { text-transform: none; letter-spacing: 0; }

/* ---- Airport autocomplete (custom, works on mobile) ------- */
.airport-field {
  position: relative;
  min-width: 0;
}
.airport-field .airport-input { width: 100%; }

.airport-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  list-style: none;
  margin: 0;
  padding: 4px 0;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  max-height: 260px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.airport-suggestions[hidden] { display: none; }
.airport-suggestion {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  font-size: 0.94rem;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.airport-suggestion[aria-selected="true"],
.airport-suggestion:hover {
  background: var(--blue-tint);
}
.airport-suggestion .iata {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-weight: 600;
  color: var(--blue-deep);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.airport-suggestion .place {
  color: var(--ink-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Plus buttons — bare glyph */
.plus-button {
  background: var(--blue-tint);
  border: 2px solid rgba(30, 95, 205, 0.32);
  color: #3f63b0;
  cursor: pointer;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 400;
  line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.08s ease;
}
.plus-button:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
  background: #e3ecfd;
}
.plus-button:active:not(:disabled) { transform: translateY(1px); }
.plus-button:disabled { opacity: 0.35; cursor: not-allowed; }

.add-origin {
  align-self: flex-start;
  margin-top: 0.3rem;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem 0.4rem 0.55rem;
  font-size: 0.9rem;
  font-weight: 500;
}
.add-origin .plus-glyph { font-size: 1.25rem; line-height: 1; }

.add-party {
  position: absolute;
  top: 2px;
  bottom: 4px;
  right: 0;
  width: 56px;
  font-weight: 300;
  border-radius: 14px;
}
.add-party-icon {
  width: 26px;
  height: 26px;
  display: block;
}

.max-flight-field { margin-top: 0.7rem; }
.hours-field { display: flex; align-items: baseline; gap: 0.5rem; }
.hours-field input { width: 4.6rem; text-align: right; }
.suffix { color: var(--ink-soft); font-size: 0.92rem; }

/* ---- Collapsed party (horizontal collapse) ---------------- */
.party.collapsed {
  flex: 0 0 124px;
  max-width: 124px;
  padding: 0.7rem 0.7rem 1rem;
  cursor: pointer;
}
.party.collapsed .party-body { display: none; opacity: 0; }
.party.collapsed .party-header {
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 0.15rem;
}
.party.collapsed .party-name { display: none; }
/* Show × alongside the chevron so a stray "+" can be reverted in-place. */
.party.collapsed .remove-party {
  display: inline-flex;
  padding: 0.15rem 0.35rem;
  font-size: 1rem;
}
.party.collapsed .remove-party:hover { color: var(--red); background: #fdecea; }
.party.collapsed .collapse-toggle {
  align-self: auto;
  padding: 0.15rem 0.35rem;
}

.party-summary {
  display: none;
  opacity: 0;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
  /* Fade in slightly after the body has faded out, so the two crossfade
     rather than both being on screen at full strength. */
  transition: opacity 0.2s ease 0.1s, display 0.2s ease 0.1s;
  transition-behavior: allow-discrete;
}
.party.collapsed .party-summary {
  display: flex;
  opacity: 1;
}
@starting-style {
  .party.collapsed .party-summary { opacity: 0; }
}
.summary-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--party-color);
  letter-spacing: -0.005em;
  line-height: 1.15;
  word-break: break-word;
}
.summary-list {
  list-style: none;
  margin: 0.3rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.summary-list li {
  display: flex;
  flex-direction: column;
  gap: 0.05rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--rule-faint);
}
.summary-list li:first-child { border-top: 0; padding-top: 0; }
.summary-list .iata {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.93rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.summary-list .time {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.summary-list li.empty {
  border-top: 0; padding-top: 0;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.summary-max {
  display: block;
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--rule-faint);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
/* Self-hide when the max-flight-hours field is blank. */
.summary-max:empty { display: none; }
.summary-hint {
  margin-top: auto;
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-align: left;
  padding-top: 0.8rem;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.party.collapsed:hover {
  background: var(--blue-tint);
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}
.party.collapsed:hover .summary-hint { opacity: 1; color: var(--blue); }

/* ---- Submit ----------------------------------------------- */
.search-button {
  font: inherit;
  font-size: 1.04rem;
  font-weight: 700;
  letter-spacing: 0.005em;
  color: #fff;
  background: var(--blue);
  border: 0;
  padding: 0.95rem 1.6rem;
  cursor: pointer;
  border-radius: 14px;
  align-self: center;
  min-width: 280px;
  transition: background 0.16s ease, transform 0.08s ease, box-shadow 0.16s ease;
  box-shadow: 0 6px 18px rgba(30, 95, 205, 0.28);
}
.search-button:hover {
  background: var(--blue-deep);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(30, 95, 205, 0.35);
}
.search-button:active { transform: translateY(1px); box-shadow: 0 4px 12px rgba(30, 95, 205, 0.28); }

/* ---- Status ----------------------------------------------- */
.status {
  text-align: center;
  margin: 1.6rem auto 0;
  padding: 0.8rem 1.2rem;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 12px;
  color: var(--ink-soft);
  max-width: 620px;
  font-size: 0.98rem;
  box-shadow: var(--shadow-soft);
}
.status--error { color: var(--red); border-color: #f6c6c0; background: #fff7f5; }

/* ---- Plane loader (two planes converging on a destination) ---- */
.plane-loader {
  margin: 2.2rem auto 0;
  display: flex;
  justify-content: center;
}
.plane-loader[hidden] { display: none; }
.plane-loader__track {
  position: relative;
  width: 240px;
  height: 48px;
}
/* the two origin spots (faint) and the meeting point (blue, pulsing) */
.spot {
  position: absolute;
  top: 50%;
  width: 7px;
  height: 7px;
  margin-top: -3.5px;
  border-radius: 50%;
  background: var(--rule);
}
.spot--a { left: 4px; }
.spot--b { right: 4px; }
.spot.dest {
  left: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  background: var(--blue);
  animation: dest-pulse 1.9s ease-out infinite;
}
@keyframes dest-pulse {
  0%        { box-shadow: 0 0 0 0 rgba(30, 95, 205, 0.35); }
  70%, 100% { box-shadow: 0 0 0 13px rgba(30, 95, 205, 0); }
}
.plane {
  position: absolute;
  top: 50%;
  width: 22px;
  height: 22px;
  margin-top: -11px;
  color: var(--blue);
}
.plane svg { width: 100%; height: 100%; display: block; }
.plane--left  { left: 6px;  animation: fly-left 1.9s ease-in-out infinite; }
.plane--right { right: 6px; animation: fly-right 1.9s ease-in-out infinite; }
.plane--right svg { transform: scaleX(-1); }  /* face the centre */
@keyframes fly-left {
  0%   { transform: translateX(0);    opacity: 0; }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translateX(98px); opacity: 0; }
}
@keyframes fly-right {
  0%   { transform: translateX(0);     opacity: 0; }
  18%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translateX(-98px); opacity: 0; }
}

/* ---- Results ---------------------------------------------- */
.results {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  margin-top: 2rem;
}
.result-card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  animation: rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.result-head {
  padding: 1.2rem 1.5rem 1.1rem;
  border-bottom: 1px solid var(--rule);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}
.result-city {
  margin: 0;
  font-size: 1.36rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.012em;
}
.result-city .code {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-left: 0.5rem;
}
.result-spread {
  margin: 0;
  font-size: 0.98rem;
  color: var(--ink-soft);
}
.result-spread strong { color: var(--blue-deep); font-weight: 700; }

.result-body {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.party-trips {
  --party-color: var(--party-0);
  padding: 1rem 1.3rem 1.1rem;
  border-right: 1px solid var(--rule);
  position: relative;
}
.party-trips::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 32px;
  height: 3px;
  background: var(--party-color);
  border-radius: 0 0 3px 3px;
}
.party-trips:last-child { border-right: 0; }
.party-trips h3 {
  margin: 0.5rem 0 0.65rem;
  font-size: 0.96rem;
  color: var(--party-color);
  font-weight: 700;
}

.leg { padding: 0.5rem 0; }
.leg + .leg { border-top: 1px solid var(--rule-faint); }
.leg-label {
  font-size: 0.66rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
  margin-bottom: 0.2rem;
}
.leg-route { font-weight: 600; font-size: 0.98rem; color: var(--ink); }
.leg-route .arrow { color: var(--party-color); margin: 0 0.18em; }
.leg-times {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.98rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  margin-top: 0.12rem;
  letter-spacing: 0.02em;
}
.leg-meta {
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin-top: 0.15rem;
}

/* ---- Outbound "other options" dropdown -------------------- */
.leg-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}
.options-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.1rem 0.5rem 0.12rem;
  cursor: pointer;
  color: var(--party-color);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.options-toggle:hover {
  background: color-mix(in srgb, var(--party-color) 8%, transparent);
  border-color: var(--party-color);
}
.options-caret {
  display: inline-block;
  font-size: 0.7rem;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.options-toggle.is-open .options-caret { transform: rotate(180deg); }

.leg-options {
  margin-top: 0.5rem;
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden auto;       /* scroll if a route has many daily flights */
  max-height: 14rem;
  background: var(--paper);
}
.option-row {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.4rem 0.6rem;
  font-size: 0.82rem;
}
.option-row + .option-row { border-top: 1px solid var(--rule-faint); }
.option-row--chosen {
  background: color-mix(in srgb, var(--party-color) 10%, transparent);
}
.option-times {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  font-weight: 500;
}
.option-route {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.option-airline { color: var(--ink-soft); margin-left: auto; }
.option-badge {
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: #fff;
  background: var(--party-color);
  border-radius: 999px;
  padding: 0.08rem 0.45rem 0.12rem;
}

/* Per-party color rotation. JS sets data-party-index="0..4". */
.party[data-party-index="0"], .party-trips[data-party-index="0"] { --party-color: var(--party-0); }
.party[data-party-index="1"], .party-trips[data-party-index="1"] { --party-color: var(--party-1); }
.party[data-party-index="2"], .party-trips[data-party-index="2"] { --party-color: var(--party-2); }
.party[data-party-index="3"], .party-trips[data-party-index="3"] { --party-color: var(--party-3); }
.party[data-party-index="4"], .party-trips[data-party-index="4"] { --party-color: var(--party-4); }

/* ---- About page ------------------------------------------- */
.about {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 2rem 4rem;
}
.about h1 {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0 0 1.2rem;
  color: var(--ink);
}
.about h1::after {
  content: "";
  display: block;
  width: 56px;
  height: 4px;
  background: var(--blue);
  margin-top: 0.6rem;
  border-radius: 2px;
}
.about p {
  font-size: 1.04rem;
  line-height: 1.65;
  color: var(--ink);
  margin: 0 0 1rem;
}
.about p.placeholder { color: var(--ink-soft); font-style: italic; }

/* ---- Motion ----------------------------------------------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.results > .result-card:nth-child(1) { animation-delay: 0.02s; }
.results > .result-card:nth-child(2) { animation-delay: 0.06s; }
.results > .result-card:nth-child(3) { animation-delay: 0.1s; }
.results > .result-card:nth-child(4) { animation-delay: 0.14s; }
.results > .result-card:nth-child(5) { animation-delay: 0.18s; }
.results > .result-card:nth-child(n+6) { animation-delay: 0.22s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---- Responsive ------------------------------------------- */
@media (max-width: 760px) {
  .brand-bar { padding: 0.9rem 1.2rem 0.8rem; }
  main { padding: 2rem 1.1rem 2.4rem; }
  .search-panel { padding: 1.6rem 1.2rem 1.8rem; border-radius: 18px; }
  .parties-row { flex-direction: column; min-height: 0; gap: 0.8rem; }
  .parties { flex-direction: column; flex-wrap: nowrap; overflow-x: visible; }
  .party { max-width: none; flex-basis: auto; flex-grow: 1; }
  .add-party { position: static; width: 100%; min-height: 56px; }
  .party.collapsed { flex-basis: auto; max-width: none; padding: 0.85rem 1rem 1rem; cursor: pointer; }
  .party.collapsed .party-summary { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0.6rem 1.4rem; }
  .party.collapsed .summary-list { flex-direction: row; flex-wrap: wrap; gap: 0.4rem 1rem; margin-top: 0; }
  .party.collapsed .summary-list li { flex-direction: row; gap: 0.5rem; border-top: 0; padding-top: 0; }
  .party.collapsed .summary-max { margin: 0; padding: 0; border: 0; }
  .party.collapsed .summary-hint { display: none; }
  .party-trips { border-right: 0; border-bottom: 1px solid var(--rule); }
  .party-trips:last-child { border-bottom: 0; }
}

/* Phone-width origin rows — the airport + time inputs don't fit side by side
   in a ~300px party tile. Stack them, hide the column headers (their grid
   doesn't survive the stack), and separate each (airport, time) pair with a
   hairline so the form still reads as discrete units. */
@media (max-width: 520px) {
  .origin-headers { display: none; }

  .origins { gap: 0; }
  .origin {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "airport remove"
      "time    time";
    column-gap: 0.4rem;
    row-gap: 0.5rem;
    padding: 0.7rem 0;
    align-items: center;
  }
  .origin:first-child { padding-top: 0.2rem; }
  .origin:last-child  { padding-bottom: 0.2rem; }
  .origin + .origin   { border-top: 1px solid var(--rule-faint); }
  .origin .airport-field      { grid-area: airport; }
  .origin .earliest-departure { grid-area: time; }
  .origin .remove-origin      { grid-area: remove; }
}
