/* Trips: airport boxes, the traveler's start page, trip names and confirmations, team trip forms, approvals and the
   phone layout of trip lists. Colors come from the tokens in app.css; selected states are solid fills. */

/* ---------- airport boxes ---------- */
.ap { position: relative; display: grid; gap: 4px; min-inline-size: 0; }
.ap-name { position: absolute; inset-block-start: calc(100% + 2px); inset-inline: 0; font-size: 13px; line-height: 16px; font-weight: 500; color: var(--ink-muted); text-transform: none; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.ap-name:empty { display: none; }
/* the place name under a picked airport takes its own room, so it never sits on the label below it */
.ap:has(> .ap-name:not(:empty)) { padding-block-end: 20px; }
/* The name sits in the space reserved under the box, not below it. */
.ap:has(> .ap-name:not(:empty)) > .ap-name { inset-block-start: auto; inset-block-end: 0; }
:is(.fields, .grid2, .grid3, .grid4, .ap-row):has(.ap-name:not(:empty)) { align-items: start; }
.ap-row, .ft-dialog2 .grid3, .ft-dialog2 .grid2 { padding-block-end: 14px; }
.ap-list { position: absolute; inset-block-start: 42px; inset-inline-start: 0; z-index: 70; inline-size: max(100%, min(380px, calc(100vw - 32px))); max-block-size: 320px; overflow-y: auto;
  margin: 0; padding: 4px 0; list-style: none; background: var(--ground); color: var(--ink); box-shadow: var(--shadow-card), 0 0 0 1px var(--line-strong); }
.ap-list li { display: grid; grid-template-columns: 48px 1fr; gap: 0 10px; padding: 9px 12px; cursor: pointer; text-transform: none; letter-spacing: 0; }
.ap-list li:hover { background: var(--band); }
.ap-list li[aria-selected="true"] { background: var(--red); color: var(--on-red); }
.ap-code { grid-row: span 2; font: 600 15px/1.3 var(--mono); }
.ap-place { font-size: 15px; font-weight: 600; }
.ap-full { font-size: 12px; color: var(--ink-muted); }
.ap-list li[aria-selected="true"] .ap-full { color: var(--on-red); }
.ap-row label { min-inline-size: min(220px, 100%); flex: 0 1 240px; }
.ap-row > .btn { margin-block-start: 22px; }
.ap-quick { display: flex; flex-wrap: wrap; gap: 6px; }
input, select, textarea { scroll-margin-block: 110px 40px; }

/* ---------- the traveler's start page ---------- */
.home { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: start; margin-block-end: 44px; }
.home > :only-child { grid-column: 1 / -1; }
.home-next { display: grid; gap: 16px; padding: 22px 24px; background: var(--ground-alt); }
.home-next-head { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.home-next-head .lbl { display: block; margin-block-end: 6px; }
.next-name { font-size: 24px; line-height: 1.2; text-transform: none; }
.next-facts { font-size: 16px; }
.next-todo ul { margin: 6px 0 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.home-needs { display: grid; gap: 12px; align-content: start; }
.needs-list { list-style: none; margin: 0; padding: 0; display: grid; }
.needs-list li { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 14px 0; border-block-end: 1px solid var(--line); }
.needs-list li > div { display: grid; gap: 2px; min-inline-size: 0; }
.needs-list .btn { flex: none; }
.plan-head { margin-block-end: 20px; }
.plan-title { font-size: 26px; }

/* confirmation numbers people read out at a counter */
.confs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.conf { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 12px 14px; background: var(--ground); }
.conf .lbl { grid-column: 1 / -1; }
.conf-code { font-size: 22px; font-weight: 600; letter-spacing: 0; }
.conf-inline { font-weight: 600; }
.panel .conf { background: var(--ground-alt); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------- trip names, lists and team trips ---------- */
.trip-title { font-size: 28px; text-wrap: balance; }
.trip-name { font-weight: 600; }
.chip.soon { background: var(--band); color: var(--warn); font-weight: 500; }
.sub-big { display: block; margin-block-start: 4px; font-size: 13px; font-weight: 600; color: var(--ink-muted); }
table.req-list { table-layout: fixed; min-inline-size: 980px; }
table.req-list th:nth-child(1) { inline-size: 31%; } table.req-list th:nth-child(2) { inline-size: 12%; } table.req-list th:nth-child(3) { inline-size: 6%; }
table.req-list th:nth-child(4) { inline-size: 8%; } table.req-list th:nth-child(5) { inline-size: 19%; } table.req-list th:nth-child(6) { inline-size: 9%; }
table.req-list th:nth-child(7) { inline-size: 7%; } table.req-list th:nth-child(8) { inline-size: 8%; }
table.req-list .status { white-space: normal; }
.count-inline { margin-inline-start: 6px; font-weight: 600; letter-spacing: 0; }
.req-tools { display: flex; align-items: center; gap: 8px; margin-block-end: 24px; max-inline-size: 420px; }
.req-tools label { flex: 1; }
.req-tools input { inline-size: 100%; }
.req-actions { align-items: start; }
.push-end { margin-inline-start: auto; }
fieldset.namepick { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; min-inline-size: 0; }
fieldset.namepick legend { display: inline-flex; align-items: center; gap: 6px; padding: 0; margin-block-end: 8px; font-size: 12px; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--ink-muted); }
fieldset.namepick .check { padding: 4px 10px 4px 6px; background: var(--band); }
.billing-pick { margin-block-start: 4px; }
.billing-kv { margin-block-start: 6px; }
.billing-set { gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.show-sm { display: none; }
.cell-acts .actions { flex-wrap: wrap; justify-content: flex-start; }
.cell-why { min-inline-size: 220px; max-inline-size: 380px; }
table.approvals td { vertical-align: top; }
.callout details { margin-block-start: 4px; }
.callout details ul { margin-block-start: 6px; }

/* ---------- dialogs with a form ---------- */
.ft-dialog2 { padding: 0; border: 0; inline-size: min(720px, 100vw - 24px); max-block-size: calc(100vh - 40px); overflow-y: auto; background: var(--ground); color: var(--ink); box-shadow: var(--shadow-card); }
.ft-dialog2::backdrop { background: rgba(0, 0, 0, 0.5); }
.ft-dialog2 .dialog { gap: 18px; }
.ft-dialog2 .kv { font-size: 15px; }
.dlg-table { font-size: 14px; }
.dlg-table td { vertical-align: top; }
.dlg-err:empty { display: none; }
.book-list { list-style: none; margin: 0; padding: 0; display: grid; }
.book-list li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-block-end: 1px solid var(--line); }
.book-list .lost { color: var(--critical); }

/* ---------- phones: trip lists stack, so the status is never cut off ---------- */
@media (max-width: 720px) {
  .home { grid-template-columns: 1fr; gap: 28px; }
  .home-next { padding: 18px 16px; }
  .next-name { font-size: 20px; }
  .trip-title { font-size: 22px; }
  .grid3 { grid-template-columns: 1fr; }
  .show-sm { display: block; }
  table.stack-sm { min-inline-size: 0; }
  table.stack-sm thead { display: none; }
  table.stack-sm, table.stack-sm tbody { display: block; }
  table.stack-sm tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 4px; border-block-end: 1px solid var(--line); }
  table.stack-sm td { display: block; padding: 0; border: 0; min-inline-size: 0; }
  table.stack-sm td.hide-sm, table.stack-sm td.cell-team { display: none; }
  table.stack-sm td.cell-name, table.stack-sm td.cell-why, table.stack-sm td.cell-acts { grid-column: 1 / -1; }
  table.stack-sm td.num { text-align: start; }
  table.stack-sm td.cell-cost { text-align: end; }
  table.stack-sm td.cell-status { grid-column: 1 / -1; }
  table.stack-sm .status { white-space: normal; }
  table.stack-sm td.cell-why { max-inline-size: none; min-inline-size: 0; }
  .needs-list li { flex-wrap: wrap; }
  .push-end { margin-inline-start: 0; }
  .ap-row > .btn { margin-block-start: 0; }
  .conf-code { font-size: 20px; }
}

/* help tips never block a click on the box under them */
[role="tooltip"] { pointer-events: none; }

/* ---------- usability pass: trips, booking and approvals ---------- */
/* the trips after the next one, one per line */
.next-later ul { margin: 6px 0 0; }
.next-later li { font-size: 15px; }
/* what's booked now and what's paid back later, in the Book my part dialog */
.book-sums { margin-block-start: 10px; grid-template-columns: max-content minmax(0, 1fr); }
/* Approve and Deny side by side, on their own row under the approval fields */
.decide-form { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; }
.decide-form label { flex: 0 1 180px; }
.decide-form .decide-note { flex: 1 1 240px; }
.decide-form .decide-btns { flex: 1 1 100%; }
.undo-row { align-items: center; }
/* the person's email under their name in the traveler picker */
.picker td.who { min-inline-size: 180px; }
/* Costs by category (team.js byCategory): the person's name on their first row, a line above each new person. */
.cost-view { margin-block: 8px 0; }
.cost-view h2 { margin: 0; }
.cat-group h2 .sw { display: inline-block; inline-size: 12px; block-size: 12px; margin-inline-end: 8px; vertical-align: middle; }
table.by-cat tbody tr.first td { border-block-start: 2px solid var(--line-strong); }
table.by-cat tbody tr.first:first-child td { border-block-start: 0; }
table.by-cat td:first-child { white-space: nowrap; }
table.by-cat td:nth-child(2) .small { margin-block-start: 4px; color: var(--ink-muted); }

/* ---------- a booked item's details: tickets, extras, airline changes, reviews ---------- */
dl.facts.item-facts { margin-block-start: 6px; font-size: 13px; gap: 4px 14px; }
.callout.sched { margin-block-start: 8px; }
.item-tools { margin-block-start: 4px; gap: 4px 14px; }
.reviews { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.reviews strong { font-variant-numeric: tabular-nums; margin-inline-end: 6px; }
