/* Trip Builder — Plan-trip drawer body styling. Lives inside the standard
 * v2-overlay-host / v2-drawer--modal shell. Tokens from design-v2/tokens.css;
 * form grid (.v2-f-grid, .v2-field, .v2-typeahead, .v2-btn) inherited from
 * design-v2/overlays.css verbatim — no overrides that would interfere with
 * native input behaviour (date auto-advance, select arrows, etc.).
 *
 * Also styles the trips list cards (.v2-tb-card) and detail timeline
 * (.v2-tb-tl-row).
 */

/* ─── Drawer shell tweaks ────────────────────────────────────────────── */

.v2-drawer--plan-trip {
  width: min(960px, 96%);
  max-height: 94%;
}

/* The v2-typeahead UL is absolutely positioned; overlays.css only declares
 * position: relative on the airport + hotel groups. The airline group is
 * Plan-trip-only so its anchoring rule lives here. */
[data-mm-airline-group] { position: relative; }

/* Small refresh icon shown next to "Duration" + "Miles" labels. Clicking
 * forces a recompute regardless of whether the user previously edited the
 * field manually — useful when a date/time correction didn't trigger an
 * auto-recalc, or when the user explicitly wants to re-pull the value. */
.v2-pt-recalc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin: 0 0 0 4px;
  width: 18px;
  height: 18px;
  border: none;
  background: transparent;
  color: var(--ink-faint);
  cursor: pointer;
  border-radius: 5px;
  padding: 0;
  transition: color 140ms var(--ease-out), background 140ms var(--ease-out);
}
.v2-pt-recalc:hover { color: var(--navy); background: var(--paper-shade); }
.v2-pt-recalc svg { width: 11px; height: 11px; stroke-width: 2.2; }
.v2-pt-recalc.is-spinning svg { animation: v2-pt-spin 700ms linear; }

/* ─── Drawer overview / itinerary section labels ─────────────────────── */

.v2-drawer--plan-trip .v2-form-section {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.66667rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--hairline-soft);
}

/* ─── Itinerary section header ───────────────────────────────────────── */

.v2-pt-it-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 24px 0 12px;
}

/* ─── Trip action cards on main/trips.php ────────────────────────────── */

.v2-act--clickable {
  cursor: pointer;
  transition: border-color 140ms var(--ease-out), box-shadow 140ms var(--ease-out), transform 140ms var(--ease-out);
}
.v2-act--clickable:hover {
  border-color: var(--hairline-strong);
  box-shadow: var(--sh-card);
  transform: translateY(-1px);
}
.v2-act--clickable:focus-visible {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(14, 31, 59, 0.1);
}

/* Position trip actions absolutely top-right so they sit outside the
 * card's 4-column CSS grid and don't disturb the existing layout. */
.v2-act--clickable { position: relative; }
.v2-act__actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 2;
}

.v2-act__share,
.v2-act__del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 140ms var(--ease-out), background 140ms var(--ease-out), border-color 140ms var(--ease-out);
}
.v2-act__share:hover {
  color: var(--atlas-deep);
  background: var(--atlas-paper);
  border-color: var(--atlas);
}
.v2-act__share svg,
.v2-act__del svg { width: 12px; height: 12px; stroke-width: 2; }
.v2-act__del:hover {
  color: var(--orange-deep);
  background: var(--orange-paper);
  border-color: var(--orange-soft);
}

/* Pad the right side of the card body so the absolutely-positioned action
 * buttons never overlap the date pill / countdown. */
.v2-act--clickable { padding-right: 80px; }

/* ─── Share-trip drawer ──────────────────────────────────────────────── */

.v2-drawer--share-trip { width: min(640px, 96%); }

.v2-st-intro {
  font-family: 'Bricolage Grotesque', serif;
  font-style: normal;
  font-size: 0.96667rem;
  color: var(--ink-muted);
  margin: 0 0 14px;
  line-height: 1.5;
}

/* Show / hide checkboxes above the textarea — flipping any of these
 * re-renders the share text from the cached fetch without re-fetching. */
.v2-st-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  border-radius: 10px;
}
.v2-st-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
  font-family: 'Geist', sans-serif;
  font-size: 0.83333rem;
  color: var(--ink-strong);
}
.v2-st-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--orange);
  margin: 0;
}
.v2-st-toggle:hover { color: var(--orange-deep); }

.v2-st-text {
  width: 100%;
  min-height: 280px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.83333rem;
  line-height: 1.55;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink-strong);
  resize: vertical;
  white-space: pre;
  overflow-x: auto;
}
.v2-st-text:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(14,31,59,0.08);
}
.v2-st-export {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.v2-st-export .v2-btn svg { width: 16px; height: 16px; flex: 0 0 auto; }

.v2-st-passport {
  margin: 0 0 16px;
  padding: 14px 16px;
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}
.v2-st-passport__h { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.v2-st-passport__title {
  font-family: 'Bricolage Grotesque', serif;
  font-style: normal;
  font-size: 1.06667rem;
  color: var(--ink-strong);
}
.v2-st-passport__sub {
  font-family: 'Geist', sans-serif;
  font-size: 0.83333rem;
  line-height: 1.45;
  color: var(--ink-muted);
}
.v2-st-passport__stats { display: flex; flex-wrap: wrap; gap: 6px; }
.v2-st-passport__chip {
  font-family: 'Geist Mono', monospace;
  font-size: 0.66667rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--paper-shade);
  color: var(--ink-strong);
  padding: 4px 9px;
  border-radius: 999px;
}

/* ─── Delete-trip drawer ─────────────────────────────────────────────── */

.v2-drawer--delete-trip { width: min(640px, 96%); }

.v2-dt-intro {
  font-family: 'Bricolage Grotesque', serif;
  font-style: normal;
  font-size: 1.03333rem;
  color: var(--ink-muted);
  margin: 0 0 18px;
  line-height: 1.55;
}
.v2-dt-intro b { color: var(--ink-strong); font-style: normal; font-weight: 600; }

.v2-dt-actions {
  display: flex;
  gap: 8px;
  margin: 12px 0 18px;
}
.v2-dt-actions .v2-btn { font-size: 0.8rem; padding: 6px 12px; }

.v2-dt-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--paper-soft);
  padding: 4px;
}

.v2-dt-item {
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid var(--hairline-soft);
  transition: border-color 140ms var(--ease-out), background 140ms var(--ease-out);
}
.v2-dt-item:hover { border-color: var(--hairline-strong); }
.v2-dt-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  margin: 0;
}
.v2-dt-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--orange);
  flex-shrink: 0;
}
.v2-dt-item__pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.63333rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.v2-dt-item--flight .v2-dt-item__pill { background: var(--navy); color: var(--paper-soft); }
.v2-dt-item--stay   .v2-dt-item__pill { background: var(--orange-paper); color: var(--orange-deep); }

.v2-dt-item__line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  font-family: 'Geist', sans-serif;
  font-size: 0.86667rem;
  color: var(--ink-strong);
  min-width: 0;
  flex: 1 1 auto;
}
.v2-dt-item__line strong { font-family: 'Geist Mono', monospace; font-size: 0.86667rem; }
.v2-dt-item__line .meta { color: var(--ink-muted); font-size: 0.8rem; }

.v2-dt-item.is-checked { background: var(--orange-paper); border-color: var(--orange-soft); }

.v2-dt-empty {
  border: 1px dashed var(--hairline-strong);
  border-radius: 12px;
  padding: 24px;
  text-align: center;
  color: var(--ink-muted);
  font-family: 'Geist', sans-serif;
  font-size: 0.86667rem;
}

.v2-btn--danger {
  background: var(--orange-deep);
  color: var(--paper-soft);
  border-color: var(--orange-deep);
}
.v2-btn--danger:hover:not(:disabled) { background: #a83a00; border-color: #a83a00; transform: translateY(-1px); }

/* ─── Loading state ──────────────────────────────────────────────────── */

.v2-pt-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 36px 0;
  font-family: 'Geist', sans-serif;
  font-size: 0.86667rem;
  color: var(--ink-muted);
}
/* [hidden] must override display:flex (the bare browser default isn't strong
   enough vs. a class-rule). */
.v2-pt-loading[hidden] { display: none; }
.v2-pt-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--hairline);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: v2-pt-spin 700ms linear infinite;
}
@keyframes v2-pt-spin { to { transform: rotate(360deg); } }

/* ─── Overview block ────────────────────────────────────────────────── */

.v2-pt-summary {
  font-family: 'Geist Mono', monospace;
  font-size: 0.76667rem;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  padding: 9px 13px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 9px;
}

/* ─── Form section headings inside rows ─────────────────────────────── */

.v2-pt-row__sec {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
  font-size: 0.66667rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 18px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hairline-soft);
}
.v2-pt-row__sec:first-child { margin-top: 4px; }

/* ─── Itinerary list ─────────────────────────────────────────────────── */

.v2-pt-list {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ─── Row ────────────────────────────────────────────────────────────── */

.v2-pt-row {
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 0;
  overflow: visible;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out);
}
.v2-pt-row:hover { border-color: var(--hairline-strong); }
.v2-pt-row.is-dragging { opacity: 0.55; }
.v2-pt-row.is-drop-target {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-paper);
}

/* Top bar: drag handle · number · pill · summary title · close (right) */
.v2-pt-row__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--hairline-soft);
  background: var(--paper);
  border-radius: 14px 14px 0 0;
}

.v2-pt-handle {
  background: transparent;
  border: none;
  color: var(--ink-faint);
  padding: 4px;
  border-radius: 6px;
  cursor: grab;
  transition: color 140ms var(--ease-out), background 140ms var(--ease-out);
}
.v2-pt-handle:hover { color: var(--ink-strong); background: var(--paper-shade); }
.v2-pt-handle:active { cursor: grabbing; }
.v2-pt-handle svg { width: 14px; height: 14px; display: block; }

.v2-pt-row__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--paper-soft);
  border: 1.5px solid var(--hairline-strong);
  color: var(--ink-strong);
  font-family: 'Geist Mono', monospace;
  font-size: 0.73333rem;
  font-weight: 600;
  flex-shrink: 0;
}

/* ─── Row completeness dot (grey → amber → green) ────────────────────── */
.v2-pt-completeness {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--ink-faint);
  transition: color 200ms var(--ease-out);
}
.v2-pt-completeness svg { width: 9px; height: 9px; display: block; }
.v2-pt-completeness[data-mm-complete="1"] { color: var(--pace-caution); }
.v2-pt-completeness[data-mm-complete="2"] { color: var(--pace-on-track); }

.v2-pt-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.66667rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.v2-pt-pill__svg { width: 11px; height: 11px; }
.v2-pt-pill--flight { background: var(--navy); color: var(--paper-soft); }
.v2-pt-pill--stay   { background: var(--orange-paper); color: var(--orange-deep); }

.v2-pt-row__title {
  flex: 1 1 auto;
  min-width: 0;
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Close button: same shape as v2-drawer__close, pinned right */
.v2-pt-row__close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--hairline);
  background: var(--paper-soft);
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out), background 160ms var(--ease-out);
}
.v2-pt-row__close:hover {
  color: var(--orange-deep);
  border-color: var(--orange-soft);
  background: var(--orange-paper);
}
.v2-pt-row__close svg { width: 13px; height: 13px; stroke-width: 2; }

/* Body holds the form sections */
.v2-pt-row__body {
  padding: 6px 18px 18px;
  transition: opacity 160ms var(--ease-out);
}

/* Collapse / expand toggle (chevron) in the row bar */
.v2-pt-row__toggle {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto;
  transition: color 160ms var(--ease-out), background 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.v2-pt-row__toggle:hover {
  color: var(--ink-strong);
  background: var(--paper-shade);
}
.v2-pt-row__toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 220ms var(--ease-out);
}
/* When the row is collapsed the chevron points to the right (▶); when
   open it points down (▼). Default state in markup is expanded. */
.v2-pt-row.is-collapsed .v2-pt-row__toggle svg { transform: rotate(-90deg); }
.v2-pt-row.is-collapsed .v2-pt-row__body { display: none; }
.v2-pt-row.is-collapsed .v2-pt-row__bar { border-bottom: none; border-radius: 14px; }

/* The close button no longer pushes itself with margin-left:auto because the
   toggle button claims that slot first; reset to just a normal gap. */
.v2-pt-row__close { margin-left: 0; }

.v2-pt-row__error {
  margin-top: 14px;
  padding: 9px 12px;
  background: var(--orange-paper);
  border: 1px solid var(--orange-soft);
  color: var(--orange-deep);
  border-radius: 9px;
  font-family: 'Geist', sans-serif;
  font-size: 0.8rem;
}

/* ─── Lookup button (in flight # field) ──────────────────────────────── */

.v2-pt-input-action {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 6px;
}
.v2-pt-input-action input { flex: 1 1 auto; }
.v2-pt-lookup {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  color: var(--ink-strong);
  font-family: 'Geist', sans-serif;
  font-size: 0.83333rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 160ms var(--ease-out);
}
.v2-pt-lookup:hover {
  border-color: var(--ink-strong);
  background: var(--paper-soft);
}
.v2-pt-lookup.is-busy { animation: v2-pt-spin 800ms linear infinite; pointer-events: none; }
.v2-pt-lookup__svg { width: 13px; height: 13px; }

/* ─── Connector chips between rows ───────────────────────────────────── */

.v2-pt-chip {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 60px;
}
.v2-pt-chip__rule {
  flex: 1 1 auto;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--hairline) 30%, var(--hairline) 70%, transparent);
}
.v2-pt-chip__body {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-family: 'Public Sans', system-ui, sans-serif;
  font-size: 0.83333rem;
  color: var(--ink-muted);
}
.v2-pt-chip__label { color: var(--ink-strong); font-weight: 500; }
.v2-pt-chip__label b { color: var(--orange); font-family: 'Geist Mono', monospace; font-weight: 600; }
.v2-pt-chip__hint { color: var(--ink-muted); font-family: 'Geist Mono', monospace; font-size: 0.73333rem; }
.v2-pt-chip__input {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  border-radius: 8px;
  padding: 3px 8px;
}
.v2-pt-chip__input input {
  border: none;
  background: transparent;
  width: 52px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
  text-align: right;
  color: var(--ink-strong);
}
.v2-pt-chip__input input:focus { outline: none; }
.v2-pt-chip__input span { font-size: 0.73333rem; color: var(--ink-faint); }

.v2-pt-chip__ic {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--ink-faint);
}
.v2-pt-chip--layover .v2-pt-chip__ic { color: var(--orange-deep); }
.v2-pt-chip__remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid transparent;
  color: var(--ink-faint);
  cursor: pointer;
  transition: color 140ms var(--ease-out), background 140ms var(--ease-out), border-color 140ms var(--ease-out);
  margin-left: 4px;
}
.v2-pt-chip__remove:hover {
  color: var(--orange-deep);
  background: var(--paper-soft);
  border-color: var(--orange-soft);
}
.v2-pt-chip__remove svg { width: 10px; height: 10px; stroke-width: 2.5; }

/* Mismatch warning shown next to the editable layover time when the user's
 * value differs from the timezone-aware computed layover by more than 15 min. */
.v2-pt-chip__mismatch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--orange-paper);
  border: 1px solid var(--orange-soft);
  border-radius: 999px;
  padding: 3px 8px 3px 10px;
  font-family: 'Geist', sans-serif;
  font-size: 0.73333rem;
  color: var(--orange-deep);
  font-weight: 500;
}
.v2-pt-chip__mismatch svg {
  width: 11px;
  height: 11px;
  stroke-width: 2.2;
  flex-shrink: 0;
}
.v2-pt-chip__mismatch button {
  background: var(--orange-deep);
  color: var(--paper-soft);
  border: none;
  border-radius: 6px;
  padding: 3px 9px;
  font-family: 'Geist', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 140ms var(--ease-out);
}
.v2-pt-chip__mismatch button:hover { background: #a83a00; }

.v2-pt-chip--layover .v2-pt-chip__body {
  background: var(--orange-paper);
  border-radius: 999px;
  padding: 5px 12px;
}
.v2-pt-chip--gap .v2-pt-chip__body {
  background: var(--paper-shade);
  border-radius: 999px;
  padding: 5px 14px;
}
.v2-pt-chip--arrival .v2-pt-chip__body {
  color: var(--ink-faint);
  font-style: normal;
}

/* ─── Empty state + add buttons ──────────────────────────────────────── */

.v2-pt-empty {
  border: 1px dashed var(--hairline-strong);
  border-radius: 14px;
  padding: 32px 24px;
  text-align: center;
  background: var(--paper);
  margin: 4px 0 14px;
}
.v2-pt-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  color: var(--ink-muted);
}
.v2-pt-empty__svg { width: 22px; height: 22px; }
.v2-pt-empty h5 {
  font-family: 'Bricolage Grotesque', serif;
  font-style: normal;
  font-weight: 400;
  font-size: 1.13333rem;
  color: var(--ink-strong);
  margin: 0 0 4px;
}
.v2-pt-empty p {
  margin: 0;
  font-family: 'Geist', sans-serif;
  font-size: 0.86667rem;
  color: var(--ink-muted);
}

/* ─── Fixed add toolbar (sits under the header, outside the scroll body) ── */

.v2-pt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 26px;
  border-bottom: 1px solid var(--hairline);
  background: var(--paper);
  flex-shrink: 0;
}
.v2-pt-toolbar__add { display: flex; gap: 10px; }
.v2-pt-tbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--paper-soft);
  border: 1px solid var(--hairline-strong);
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  font-family: 'Geist', sans-serif;
  font-size: 0.86667rem;
  font-weight: 600;
  color: var(--ink-strong);
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.v2-pt-tbtn:hover {
  border-color: var(--orange);
  background: var(--orange-paper);
  transform: translateY(-1px);
}
.v2-pt-tbtn:active { transform: translateY(0); }
.v2-pt-tbtn__ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-strong);
  flex-shrink: 0;
}
.v2-pt-tbtn__svg { width: 17px; height: 17px; }

/* ─── Footer autosave status (edit mode) ─────────────────────────────── */

.v2-pt-foot-l { display: flex; align-items: center; min-width: 0; gap: 8px; }
.v2-pt-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: 'Geist', sans-serif;
  font-size: 0.83333rem;
  color: var(--ink-muted);
}
.v2-pt-status[hidden] { display: none; }
.v2-pt-status__spin {
  width: 13px;
  height: 13px;
  border: 2px solid var(--hairline);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: v2-pt-spin 700ms linear infinite;
  display: none;
}
.v2-pt-status__check,
.v2-pt-status__warn { width: 14px; height: 14px; display: none; flex-shrink: 0; }
.v2-pt-status__check { color: var(--orange-deep); }
.v2-pt-status__warn { color: var(--pace-ruby); }
.v2-pt-status.is-saving .v2-pt-status__spin { display: inline-block; }
.v2-pt-status.is-saved .v2-pt-status__check { display: inline-block; }
.v2-pt-status.is-error { color: var(--pace-ruby); }
.v2-pt-status.is-error .v2-pt-status__warn { display: inline-block; }

/* ─── Trips list page (Plan-trip CTA in main/trips.php uses v2-btn) ──── */

.v2-tb-list-page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.v2-tb-list-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.v2-tb-list-head h1 {
  font-family: 'Bricolage Grotesque', serif;
  font-style: normal;
  font-weight: 400;
  font-size: 2.13333rem;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink-strong);
}
.v2-tb-list-head h1 em { font-style: normal; }
.v2-tb-list-head h1 b { font-style: normal; font-weight: 600; }
.v2-tb-list-head p {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-family: 'Geist', sans-serif;
  font-size: 0.86667rem;
}

.v2-tb-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
  gap: 14px;
}

.v2-tb-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 18px 18px 16px;
  text-decoration: none;
  color: inherit;
  transition: border-color 160ms var(--ease-out), box-shadow 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.v2-tb-card:hover {
  border-color: var(--hairline-strong);
  box-shadow: var(--sh-card-hover);
  transform: translateY(-2px);
}
.v2-tb-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.v2-tb-card__name {
  font-family: 'Bricolage Grotesque', serif;
  font-style: normal;
  font-size: 1.33333rem;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--ink-strong);
  flex: 1 1 auto;
  min-width: 0;
  word-break: break-word;
  line-height: 1.2;
}
.v2-tb-card__status {
  display: inline-flex;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: 'Geist Mono', monospace;
  font-size: 0.66667rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  flex-shrink: 0;
}
.v2-tb-card__status--upcoming { background: var(--orange-paper); color: var(--orange-deep); }
.v2-tb-card__status--active   { background: var(--atlas-paper); color: var(--atlas-deep); }
.v2-tb-card__status--past     { background: var(--paper-shade); color: var(--ink-muted); }

.v2-tb-card__dates {
  font-family: 'Geist Mono', monospace;
  font-size: 0.76667rem;
  letter-spacing: 0.02em;
  color: var(--ink-muted);
}
.v2-tb-card__route {
  font-family: 'Geist Mono', monospace;
  font-size: 0.83333rem;
  color: var(--ink-strong);
  font-weight: 500;
  line-height: 1.55;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.v2-tb-card__route--empty { color: var(--ink-muted); font-style: normal; font-family: 'Geist', sans-serif; }
.v2-tb-card__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px dashed var(--hairline);
}
.v2-tb-card__chip {
  font-family: 'Geist Mono', monospace;
  font-size: 0.66667rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--paper-shade);
  color: var(--ink-strong);
  padding: 4px 9px;
  border-radius: 999px;
}

.v2-tb-list-empty {
  border: 1px dashed var(--hairline-strong);
  border-radius: 16px;
  padding: 56px 24px;
  text-align: center;
  background: var(--paper-soft);
}
.v2-tb-list-empty h2 {
  font-family: 'Bricolage Grotesque', serif;
  font-style: normal;
  font-size: 1.46667rem;
  margin: 0 0 6px;
  color: var(--ink-strong);
}
.v2-tb-list-empty p { margin: 0 0 16px; color: var(--ink-muted); font-family: 'Geist', sans-serif; }

/* ─── Trip detail timeline ───────────────────────────────────────────── */

.v2-tb-detail {
  max-width: 980px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.v2-tb-detail__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hairline);
}
.v2-tb-detail__head h1 {
  font-family: 'Bricolage Grotesque', serif;
  font-style: normal;
  font-size: 1.86667rem;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink-strong);
}
.v2-tb-detail__sub {
  margin: 4px 0 0;
  font-family: 'Geist Mono', monospace;
  font-size: 0.76667rem;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
}
.v2-tb-detail__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.v2-tb-stat {
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 14px 16px;
}
.v2-tb-stat__label {
  font-family: 'Geist Mono', monospace;
  font-size: 0.66667rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 6px;
  font-weight: 600;
}
.v2-tb-stat__value {
  font-family: 'Bricolage Grotesque', serif;
  font-style: normal;
  font-size: 1.6rem;
  color: var(--ink-strong);
  line-height: 1;
}
.v2-tb-stat__meta { font-family: 'Geist', sans-serif; font-size: 0.73333rem; color: var(--ink-muted); margin-top: 5px; }

.v2-tb-timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.v2-tb-tl-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 14px;
  background: var(--paper-soft);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  padding: 16px 18px;
}
.v2-tb-tl-row__rail {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.v2-tb-tl-row__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--paper);
  border: 1.5px solid var(--hairline-strong);
  color: var(--ink-strong);
  font-family: 'Geist Mono', monospace;
  font-size: 0.8rem;
  font-weight: 600;
}
.v2-tb-tl-row__body { display: flex; flex-direction: column; gap: 5px; }
.v2-tb-tl-row__title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.v2-tb-tl-row__title strong { font-family: 'Geist Mono', monospace; font-size: 0.93333rem; color: var(--ink-strong); }
.v2-tb-tl-row__title span { font-family: 'Geist', sans-serif; font-size: 0.86667rem; color: var(--ink-muted); }
.v2-tb-tl-row__meta { font-family: 'Geist', sans-serif; font-size: 0.8rem; color: var(--ink-muted); display: flex; flex-wrap: wrap; gap: 14px; }
.v2-tb-tl-row__meta b { color: var(--ink-strong); font-weight: 500; margin-right: 4px; }

.v2-tb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  font-family: 'Geist', sans-serif;
  font-size: 0.83333rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 140ms var(--ease-out);
}
.v2-tb-back:hover { color: var(--ink-strong); }
.v2-tb-back svg { width: 14px; height: 14px; }

.v2-tb-detail .v2-form-section {
  font-family: 'Bricolage Grotesque', serif;
  font-style: normal;
  font-weight: 400;
  font-size: 1.2rem;
  color: var(--ink-strong);
  margin: 0;
}

/* ─── Responsive ─────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .v2-drawer--plan-trip { width: 100%; max-height: 100%; border-radius: 0; }

  .v2-pt-row__bar { padding: 10px 12px; }
  .v2-pt-row__body { padding: 4px 14px 16px; }
  .v2-pt-handle { display: none; }
  .v2-pt-row__title { display: none; }

  .v2-pt-row .v2-f-grid { grid-template-columns: repeat(2, 1fr); }
  .v2-pt-row .v2-field.c4 { grid-column: span 2; }
  .v2-pt-row .v2-field.c3 { grid-column: span 2; }
  .v2-pt-row .v2-field.c2 { grid-column: span 1; }
  .v2-pt-row .v2-field.c1 { grid-column: span 1; }

  .v2-pt-chip { padding: 8px 0; }
  .v2-pt-chip__body { font-size: 0.73333rem; }

  .v2-pt-toolbar { flex-wrap: wrap; padding: 10px 14px; gap: 8px; }
  .v2-pt-toolbar__add { flex: 1; }
  .v2-pt-tbtn { flex: 1; justify-content: center; }
  .v2-pt-input-action { flex-direction: column; }
  .v2-pt-lookup { width: 100%; justify-content: center; padding: 8px 12px; }

  .v2-tb-list-page { padding: 16px; }
  .v2-tb-list-head { flex-direction: column; align-items: flex-start; gap: 12px; }
  .v2-tb-tl-row { grid-template-columns: 56px 1fr; padding: 14px; }
}

@media (max-width: 420px) {
  .v2-pt-pill span:last-child { display: none; }
  .v2-pt-row__num { width: 22px; height: 22px; font-size: 0.66667rem; }
  .v2-tb-card { padding: 14px; }
}

/* ── Aircraft section image cell ───────────────────────────────────
 * Shared by Add Flight drawer, Plan Trip flight row, and the standalone
 * Edit Flight form. Inside a 4-column v2-f-grid the cell is placed via
 * `class="v2-aircraft-img c2"` so it takes the right half + spans the
 * two rows occupied by the Aircraft (input) and Registration (input)
 * on the left.
 */
.v2-aircraft-img {
  /* Span the two grid rows that the Aircraft + Registration inputs sit on,
     but constrain our own height so the rows stay compact (otherwise the
     image's intrinsic height forces auto-row tracks to expand and pushes
     the two inputs vertically apart). align-self:start anchors the cell
     to the top, letting Grid keep the rows tight. */
  grid-row: span 2;
  align-self: start;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px 8px;
  background: var(--paper-shade, #F4F6FA);
  border: 1px solid var(--hairline, rgba(14, 31, 59, 0.08));
  border-radius: 10px;
  min-height: 96px;
  max-height: 120px;
  overflow: hidden;
}
.v2-aircraft-img__frame {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.v2-aircraft-img__frame img {
  max-width: 100%;
  max-height: 88px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}
.v2-aircraft-img__caption {
  font-family: 'Geist', sans-serif;
  font-size: 0.73333rem;
  color: var(--ink-muted);
  text-align: center;
  line-height: 1.35;
}
.v2-aircraft-img__caption a {
  color: var(--ink-muted);
  text-decoration: underline;
}
.v2-aircraft-img__placeholder {
  font-family: 'Geist', sans-serif;
  font-size: 0.83333rem;
  color: var(--ink-faint, rgba(14, 31, 59, 0.45));
  text-align: center;
  padding: 0 12px;
}
.v2-aircraft-img.is-loading .v2-aircraft-img__placeholder { opacity: 0.6; }
@media (max-width: 720px) {
  /* Narrow viewports: stack the image below the two inputs instead of
     fighting for half-width — keeps the picture readable on mobile. */
  .v2-aircraft-img { grid-row: auto; grid-column: span 2; min-height: 110px; max-height: 140px; }
  .v2-aircraft-img__frame img { max-height: 100px; }
}

/* ── Remove-segment confirmation overlay ─────────────────────────────────
   Sits above the Plan-trip drawer (z 8500) so the choice modal is never
   covered by the itinerary builder underneath it. */
.v2-overlay-host--confirm { z-index: 9400; }
.v2-overlay-host--confirm .v2-backdrop { z-index: 9405; }
.v2-overlay-host--confirm .v2-drawer { z-index: 9410; }

.v2-drawer.v2-pt-rmc {
  max-width: 480px;
  width: calc(100% - 40px);
}
.v2-pt-rmc__lead {
  font-family: 'Geist', sans-serif;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--ink-muted);
  margin: 0 0 16px;
}
.v2-pt-rmc__choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.v2-pt-rmc__opt {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease-out), background 0.15s var(--ease-out), transform 0.12s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.v2-pt-rmc__opt:hover {
  border-color: var(--orange);
  background: var(--orange-paper);
  transform: translateY(-1px);
  box-shadow: var(--sh-card);
}
.v2-pt-rmc__opt:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}
.v2-pt-rmc__opt--danger:hover {
  border-color: var(--pace-ruby);
  background: var(--pace-ruby-paper);
}
.v2-pt-rmc__opt-ic {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--paper-shade);
  color: var(--ink-strong);
}
.v2-pt-rmc__opt-ic svg { width: 20px; height: 20px; }
.v2-pt-rmc__opt--danger .v2-pt-rmc__opt-ic { color: var(--pace-ruby); }
.v2-pt-rmc__opt-b {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.v2-pt-rmc__opt-t {
  font-family: 'Geist', sans-serif;
  font-size: 0.93333rem;
  font-weight: 600;
  color: var(--ink-strong);
  line-height: 1.3;
}
.v2-pt-rmc__opt--danger .v2-pt-rmc__opt-t { color: var(--pace-ruby); }
.v2-pt-rmc__opt-m {
  font-family: 'Geist', sans-serif;
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.4;
}
.v2-pt-rmc__opt-go {
  flex: 0 0 auto;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
}
.v2-pt-rmc__opt-go svg { width: 16px; height: 16px; }
.v2-pt-rmc__opt:hover .v2-pt-rmc__opt-go { color: var(--orange); }
.v2-pt-rmc__opt--danger:hover .v2-pt-rmc__opt-go { color: var(--pace-ruby); }
/* Single-option mode (unsaved segment — nothing to delete from records) */
.v2-pt-rmc.is-single .v2-pt-rmc__opt--danger { display: none; }
