/* Airline Inbox page styles: the pieces that belong to one screen (dashboard checklist, mail body and
   attachments, bookings route, mailboxes, upload, settings and team, layouts, reports, mail detail layout).
   Shared components live in data.css, controls.css and layout.css. Tokens only; breakpoints are
   639.98 (phone), 959.98 (drawer), 1100 (two columns), 1280 (wide). */

/* -- dashboard: greeting and get-started checklist ----------------------------------------- */
/* .greeting takes the page h1 from base.css; nothing extra is needed */
.setup-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.setup-progress {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.setup-progress svg { display: block; width: 140px; height: 6px; }
.setup-progress .track { fill: var(--seq-track); }
.setup-progress .fill { fill: var(--accent); }

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: var(--space-2);
}
.step {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  height: 100%;
  padding: var(--space-3) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: inherit;
  text-decoration: none;
}
@media (hover: hover) and (pointer: fine) {
  a.step:hover { background: var(--row-hover); border-color: var(--border-strong); text-decoration: none; }
}
.step-check {
  width: 22px;
  height: 22px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  color: transparent;
}
.step-check .i { width: 14px; height: 14px; stroke-width: 2.5; }
.step.done .step-check {
  background: var(--good-soft);
  border-color: var(--good-line);
  color: var(--good-ink);
}
.step-title {
  display: block;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: 20px;
  color: var(--ink);
}
.step-sub {
  display: block;
  margin-top: 2px;
  font-size: var(--text-xs);
  line-height: 16px;
  color: var(--muted);
}
.step.done .step-title { color: var(--muted); }

/* -- mail detail: layout, original mail, attachments --------------------------------------- */
.detail-layout { display: grid; gap: var(--space-4); min-width: 0; }
.detail-layout > * { min-width: 0; }
@media (min-width: 1100px) {
  .detail-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  /* the side column ("Where it is", attachments, history) stays in view while the form scrolls */
  .detail-layout > :last-child { position: sticky; top: calc(var(--topbar-h) + var(--space-4)); }
}

pre.mail {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  max-height: 480px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  line-height: 1.6;
  color: var(--ink-2);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
}
details > pre.mail { margin-top: var(--space-2); }

.attachments { display: flex; flex-direction: column; min-width: 0; }
.attachment {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--hairline);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}
.attachment:last-child { border-bottom: 0; }
.attachment .i { width: 14px; height: 14px; color: var(--muted); }
.attachment a { font-weight: var(--weight-medium); min-width: 0; }
.attachment .muted {
  margin-left: auto;
  padding-left: var(--space-2);
  font-size: var(--text-xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* -- bookings: route and flight -------------------------------------------------------------- */
.route {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.route .code-big { font-size: var(--text-md); color: var(--ink); }
.route .i { width: 14px; height: 14px; color: var(--muted); }

.route-hero {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding: var(--space-4) var(--space-5);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.route-hero .city {
  font-family: var(--font-mono);
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.route-hero .city-sub { font-size: var(--text-xs); color: var(--muted); }
.route-hero > div:last-child .city-sub { text-align: right; }
.route-hero .flight-path {
  position: relative;
  min-width: 40px;
  height: 0;
  border-top: 1px dashed var(--border-strong);
}
.route-hero .flight-path .i {
  position: absolute;
  left: 50%;
  top: 0;
  width: 16px;
  height: 16px;
  padding: 2px;
  box-sizing: content-box;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--surface-2);
  color: var(--muted);
}
@media (max-width: 639.98px) {
  .route-hero { padding: var(--space-3) var(--space-4); }
  .route-hero .city { font-size: var(--text-2xl); }
}

/* -- mailboxes: one card per mailbox ------------------------------------------------------- */
.mailbox-card { overflow: hidden; }
.mailbox-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
}
.mailbox-top .grow { flex: 1; min-width: 220px; }
.mailbox-top h2 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 2px;
}
.mailbox-meta { font-size: var(--text-xs); color: var(--muted); overflow-wrap: anywhere; }

.mailbox-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
  padding: var(--space-3) var(--space-5);
  border-top: 1px solid var(--hairline);
}
.mailbox-stats > div { min-width: 0; }
.mailbox-stats .stat-label { font-size: var(--text-xs); color: var(--muted); }
.mailbox-stats .stat-value {
  margin-top: 2px;
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.mailbox-error {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 var(--space-5) var(--space-4);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--critical-ink);
  background: var(--critical-soft);
  border: 1px solid var(--critical-line);
  border-radius: var(--radius-md);
}
.mailbox-error .i { margin-top: 2px; }

.mailbox-settings {
  padding: var(--space-3) var(--space-5);
  background: var(--surface-2);
  border-top: 1px solid var(--hairline);
}
.mailbox-settings[open] { padding-bottom: var(--space-4); }
.danger-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--hairline);
}
.danger-zone h3 { font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--critical-ink); margin: 0 0 2px; }
.danger-zone p { margin: 0; font-size: var(--text-xs); color: var(--muted); }

.syncing {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1-5);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  color: var(--info-ink);
}
.syncing .i { width: 14px; height: 14px; animation: spin 0.9s linear infinite; }  /* quick work: a quick spinner */

.provider-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.provider-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
}
.provider-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--ink);
}
.provider-card h3 { margin: 0; }
.provider-card p { flex: 1; margin: 0; font-size: var(--text-sm); color: var(--muted); }
.provider-card .note { font-size: var(--text-xs); color: var(--muted); }
.provider-card .btn { align-self: flex-start; }

/* -- upload: results list and how-to card --------------------------------------------------- */
.upload-results { margin-bottom: var(--space-5); }
.upload-row { align-items: flex-start; flex-wrap: wrap; }
.upload-row .pill, .upload-row .btn { margin-top: var(--space-1); }
.upload-msg { margin-top: 2px; font-size: var(--text-sm); line-height: var(--lh-base); color: var(--ink-2); overflow-wrap: anywhere; }
.upload-reasons {
  margin: var(--space-1) 0 0;
  padding-left: var(--space-4);
  font-size: var(--text-sm);
  line-height: var(--lh-base);
  color: var(--warning-ink);
}
.upload-force { margin-bottom: var(--space-4); }
.upload-force .hint { display: block; margin-top: 3px; }

.how-steps {
  display: grid;
  gap: var(--space-3);
  list-style: none;
  margin: 0 0 var(--space-4);
  padding: 0;
  counter-reset: how;
}
.how-steps li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  column-gap: var(--space-3);
  counter-increment: how;
}
.how-steps li::before {
  content: counter(how);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--accent-soft-ink);
  background: var(--accent-soft);
}
.how-steps strong { font-size: var(--text-base); color: var(--ink); }
.how-steps span { font-size: var(--text-sm); line-height: 1.5; color: var(--muted); }
.how-steps em { font-style: normal; font-weight: var(--weight-medium); color: var(--ink-2); }
.how-after { padding-top: var(--space-4); border-top: 1px solid var(--hairline); }
.how-after h3 { margin: 0 0 var(--space-2); }

.check-list.compact { gap: var(--space-2); }
.check-list.compact li {
  padding: 0;
  border: 0;
  background: none;
  align-items: center;
  font-size: var(--text-sm);
  color: var(--ink-2);
}
.check-list.compact .tick { width: 20px; height: 20px; border-radius: var(--radius-sm); }
.check-list.compact .tick .i { width: 13px; height: 13px; }

/* -- settings and team -------------------------------------------------------------------- */
/* a settings row: heading and explanation on the left, the card or form on the right (one column on phones) */
.settings-section { display: grid; gap: var(--space-4); min-width: 0; }
.settings-section + .settings-section {
  margin-top: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border);
}
.settings-intro h2 { margin-bottom: var(--space-1); }
.settings-intro p,
.settings-section > .desc p { margin: 0; font-size: var(--text-sm); color: var(--muted); }
.settings-section > .desc h2 { margin-bottom: var(--space-1); }
.settings-body { min-width: 0; }
@media (min-width: 1100px) {
  .settings-section { grid-template-columns: 280px minmax(0, 1fr); gap: var(--space-8); }
}

.person { display: flex; align-items: center; gap: var(--space-3); min-width: 0; }
.person-name { font-weight: var(--weight-semibold); color: var(--ink); overflow-wrap: anywhere; }
.role-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  list-style: none;
  margin: 0;
  padding: 0;
}
.role-list li { display: flex; align-items: flex-start; gap: var(--space-3); }
.role-list .pill { min-width: 96px; justify-content: center; }
.role-list .role-desc { padding-top: 2px; font-size: var(--text-sm); color: var(--ink-2); }

/* -- table layouts (admin): one approval form per pending layout ---------------------------- */
.layout-form { display: grid; gap: var(--space-3); margin: 0; }
.layout-form > p { margin: 0; }

/* -- Excel reports: download card beside the schedules card -------------------------------- */
.report-layout { display: grid; gap: var(--space-4); min-width: 0; }
.report-layout > * { min-width: 0; }
@media (min-width: 1100px) {
  .report-layout { grid-template-columns: minmax(0, 1fr) 380px; gap: var(--space-4); align-items: start; }
}

@media (max-width: 639.98px) {
  .mailbox-top { padding: var(--space-3) var(--space-4); }
  .mailbox-stats { padding: var(--space-3) var(--space-4); }
  .mailbox-error { margin: 0 var(--space-4) var(--space-3); }
  .mailbox-settings { padding: var(--space-3) var(--space-4); }
  .setup-progress svg { width: 110px; }
}

/* -- touch targets: on touch screens these links and link-buttons get a 44px+ hit box. The padding is taken back
      by a negative margin, so nothing moves; they have no background, so nothing shows. Fine pointers: unchanged. -- */
@media (pointer: coarse) {
  a.title, a.item-title, .link-more, td a.small, dl.kv dd a, .attachment a, .tl-title a, .auth-foot a, .linklike, a.code-link, .auth-form .hint a, .lp-footer a:not(.brand) {
    padding-block: 14px;
    margin-block: -14px;
  }
  .auth-form .hint a { padding-block: 15px; margin-block: -15px; }  /* 12px hint text: 15px reaches 44px */
  .card > details > summary { padding-block: 12px; }
}
/* Accuracy page: five KPI tiles fill each row (2 on a phone, 3+2 on tablets, 5 on wide screens); the two tables
   keep no empty min-height under a short table */
.kpis.kpis-five { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.kpis.kpis-five > .kpi { grid-column: span 2; }
.kpis.kpis-five > .kpi:nth-child(n+4) { grid-column: span 3; }
@media (min-width: 1200px) {
  .kpis.kpis-five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .kpis.kpis-five > .kpi, .kpis.kpis-five > .kpi:nth-child(n+4) { grid-column: auto; }
}
@media (max-width: 639.98px) {
  .kpis.kpis-five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis.kpis-five > .kpi, .kpis.kpis-five > .kpi:nth-child(n+4) { grid-column: auto; }
  .kpis.kpis-five > .kpi:last-child { grid-column: 1 / -1; }
}
.table-wrap.acc-wrap { min-height: 0; }
/* the two card tables: a card narrower than 760px stacks its rows as cards (the phone look), so no table scrolls
   sideways at any width. The container is the card itself (class acc-card). */
.acc-card { container-type: inline-size; }
@container (max-width: 759px) {
  .acc-card .table-wrap:has(> table) { mask-image: none; animation: none; }
  .acc-card table.cards, .acc-card table.cards tbody, .acc-card table.cards tr, .acc-card table.cards td { display: block; }
  .acc-card table.cards thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .acc-card table.cards tr { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 14px 16px; border-bottom: 1px solid var(--hairline); }
  .acc-card table.cards tbody tr:last-child { border-bottom: 0; }
  .acc-card table.cards td { min-width: 0; padding: 0; border: 0; }
  .acc-card table.cards td.card-main, .acc-card table.cards td.card-full { flex: 1 1 100%; }
  .acc-card table.cards td[data-label]::before { content: attr(data-label) " "; color: var(--muted); font-size: var(--text-xs); }
  .acc-card table.cards td[data-label] { order: 1; flex: 1 1 100%; color: var(--muted); font-size: var(--text-sm); }
  .acc-card table.cards td.nowrap { white-space: normal; overflow-wrap: anywhere; }
  /* the sticky first column of the wide table does not apply to a card */
  .acc-card table.sticky-first th:first-child, .acc-card table.sticky-first td:first-child { position: static; background: none; box-shadow: none; }
  .acc-card table.sticky-first tr.flagged > td:first-child { background: none; box-shadow: none; }
  .acc-card table.sticky-first tbody tr:hover > td:first-child, .acc-card table.sticky-first tbody tr.flagged:hover > td:first-child { background: none; }
}
/* -- platform console (round 8) -------------------------------------------------------------- */
.platform-toolbar .search-input { flex: 1 1 260px; min-width: 0; }
.platform-toolbar .search-input input { width: 100%; }
.mfa-card .mfa-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 12px; }
.mfa-card .mfa-form .field { margin: 0; }
.mfa-card .code-input { width: 10ch; max-width: 100%; letter-spacing: 0.12em; }
@media (max-width: 639.98px) {
  /* the agency name is the tap target of its card: at least 44px tall */
  .platform-table td.card-main > .platform-link { display: inline-flex; align-items: center; min-height: 44px; }
}
.person-actions summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; }
.person-actions summary::-webkit-details-marker { display: none; }
.person-action-list { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding-top: 8px; }
.person-action-list form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.per-day { margin-top: 16px; }
.per-day > summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; padding: 10px 0; font-weight: var(--weight-medium); color: var(--ink); }

/* -- account closing (round 9) ---------------------------------------------------------------- */
/* the warning callout: its paragraphs keep their own spacing, and the fields below it are clear of it */
.close-warning { margin-bottom: 20px; }
.close-warning p { margin: 0 0 8px; }
.close-warning ul { margin: 0 0 8px; }
/* a single-field form (the closing password): a normal form width, not the whole card */
.field.narrow { max-width: 360px; }
/* "What happens now": the list starts right under its heading */
.closing-what ul { margin: 0; padding-left: 1.25em; }
.closing-what li + li { margin-top: 4px; }
.danger-card { border-color: var(--critical-line); }
@media (hover: hover) and (pointer: fine) {
  .code-link:hover { text-decoration: none; }
  .code-link:hover > .code { background: var(--accent-soft); color: var(--accent-soft-ink); }
}
