:root {
  --ink: #151815;
  --ink2: #30362f;
  --ink3: #687268;
  --ink4: #9aa39a;
  --paper: #f6f8f4;
  --paper2: #e9eeeb;
  --paper3: #d8e0dc;
  --white: #fcfdf9;
  --rule: 1px solid #d2dbd6;
  --rule-strong: 2px solid var(--ink);
  --shadow-soft: 0 16px 38px rgba(14, 15, 17, 0.06);
  --shadow-pop: 0 24px 60px rgba(14, 15, 17, 0.14);
  --blue: #1a5fb4;
  --blue-bg: rgba(26, 95, 180, 0.09);
  --blue-bdr: rgba(26, 95, 180, 0.24);
  --green: #1a7f5a;
  --green-bg: rgba(26, 127, 90, 0.1);
  --green-bdr: rgba(26, 127, 90, 0.24);
  --amber: #c8780a;
  --amber-bg: rgba(200, 120, 10, 0.11);
  --amber-bdr: rgba(200, 120, 10, 0.26);
  --red: #c0352a;
  --red-bg: rgba(192, 53, 42, 0.1);
  --red-bdr: rgba(192, 53, 42, 0.24);
  --purple: #7b3fbe;
  --purple-bg: rgba(123, 63, 190, 0.1);
  --purple-bdr: rgba(123, 63, 190, 0.24);
  --rail-w: 220px;
  --rail-w-collapsed: 68px;
  --topbar-h: 58px;
  --mobile-topbar-h: 68px;
  --mobile-policy-h: 92px;
  --radius-card: 8px;
  --duration: 160ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body.mobile-drawer-open {
  overflow: hidden;
}

a {
  color: inherit;
}

.skip-link {
  position: absolute;
  left: 14px;
  top: 12px;
  z-index: 120;
  padding: 10px 14px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  transform: translateY(-140%);
  transition: transform var(--duration) var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

button,
input,
textarea {
  font: inherit;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hidden {
  display: none !important;
}

.btn,
.nav-item,
.rail-toggle,
.slice-focus-btn,
.map-slice-btn,
.rs-toggle,
.col-toggle-btn,
.row-expand,
.rail-mini,
.lang-button {
  transition:
    background-color var(--duration) var(--ease),
    color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease),
    transform var(--duration) var(--ease),
    opacity var(--duration) var(--ease);
}

.btn:focus-visible,
.nav-item:focus-visible,
.rail-toggle:focus-visible,
.slice-focus-btn:focus-visible,
.map-slice-btn:focus-visible,
.rs-toggle:focus-visible,
.row-expand:focus-visible,
.rail-mini:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(26, 95, 180, 0.35);
  outline-offset: 2px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: var(--topbar-h);
  padding: 10px 18px;
  background: var(--ink);
  color: var(--white);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition:
    transform 260ms var(--ease),
    opacity 220ms var(--ease),
    box-shadow 220ms var(--ease);
}

body.app-scrolled .topbar {
  box-shadow: 0 10px 30px rgba(14, 15, 17, 0.16);
}

body.topbar-dormant:not(.at-top) .topbar {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}

.topbar-left,
.topbar-right,
.tb-actions,
.tb-chips {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-left {
  min-width: 0;
  flex: 1 1 auto;
}

.topbar-right {
  flex: 0 0 auto;
}

.tb-wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: inherit;
  cursor: pointer;
}

.tb-wordmark:hover {
  background: rgba(255, 255, 255, 0.14);
}

.tb-wordmark:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.58);
  outline-offset: 2px;
}

.tb-divider {
  width: 1px;
  align-self: stretch;
  background: rgba(255, 255, 255, 0.14);
}

.tb-route-group {
  min-width: 0;
}

.tb-kicker,
.tb-total-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.64);
}

.tb-route {
  margin-top: 2px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 34vw;
}

.tb-chip,
.status-pill,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: var(--rule);
  white-space: nowrap;
}

.tb-chip {
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.tb-total {
  text-align: right;
  min-width: 88px;
}

.tb-total strong {
  display: block;
  margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
}

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  background: var(--paper2);
  border: 1px solid #cbc4b9;
  border-radius: 999px;
}

.topbar .lang-toggle {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.24);
}

.mobile-drawer-toggle,
.mobile-policy-chrome,
.mobile-drawer,
.mobile-drawer-backdrop {
  display: none;
}

.mobile-policy-chrome[hidden],
.mobile-drawer[hidden],
.mobile-drawer-backdrop[hidden] {
  display: none !important;
}

.mobile-policy-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: var(--rule);
  border-radius: 8px;
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

.mobile-policy-cell {
  min-width: 0;
  padding: 10px 12px;
  border-right: var(--rule);
  background: var(--white);
}

.mobile-policy-cell:last-child {
  border-right: 0;
}

.mobile-policy-cell.is-amber {
  box-shadow: inset 0 3px 0 0 var(--amber);
}

.mobile-policy-cell.is-red {
  box-shadow: inset 0 3px 0 0 var(--red);
}

.mobile-policy-cell.is-blue {
  box-shadow: inset 0 3px 0 0 var(--blue);
}

.mobile-policy-label {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink4);
}

.mobile-policy-value {
  display: block;
  margin-top: 6px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--ink);
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
}

.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(14, 15, 17, 0.28);
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(88vw, 360px);
  background: var(--white);
  border-left: var(--rule-strong);
  box-shadow: var(--shadow-pop);
  transform: translateX(100%);
  transition: transform var(--duration) var(--ease);
}

body.mobile-drawer-open .mobile-drawer {
  transform: translateX(0);
}

.mobile-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 12px;
  border-bottom: var(--rule);
}

.mobile-drawer-head strong {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 800;
}

.mobile-drawer-body {
  height: calc(100% - 58px);
  overflow-y: auto;
  padding-bottom: 20px;
}

.mobile-drawer-section {
  padding: 14px;
  border-bottom: var(--rule);
}

.mobile-drawer-section:last-child {
  border-bottom: 0;
}

.mobile-drawer-actions {
  display: grid;
  gap: 8px;
}

.mobile-lang-toggle {
  margin-top: 4px;
}

.mobile-map-card,
.mobile-map-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
}

.mobile-map-card {
  border-top: var(--rule);
}

.mobile-map-summary {
  min-width: 0;
}

.mobile-map-summary strong {
  display: block;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 800;
}

.mobile-map-toolbar {
  border-top: var(--rule);
  border-bottom: var(--rule);
  background: var(--paper2);
}

.mobile-map-open-link {
  flex: 0 0 auto;
}

.lang-button {
  min-width: 46px;
  background: var(--white);
  color: var(--ink);
  border-color: #c3bbae;
  font-weight: 700;
}

.lang-button:hover:not(:disabled),
.lang-button:focus-visible {
  background: var(--paper2);
  color: var(--ink);
  border-color: #b6ad9f;
}

.lang-button.is-active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.topbar .lang-button {
  background: rgba(255, 255, 255, 0.24);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.46);
}

.topbar .lang-button:hover:not(:disabled),
.topbar .lang-button:focus-visible {
  background: rgba(255, 255, 255, 0.34);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.58);
}

.topbar .lang-button.is-active {
  background: var(--white);
  color: var(--ink);
  border-color: var(--white);
}

.page-shell {
  width: min(1440px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 20px 0 80px;
}

.zone {
  margin-bottom: 22px;
  scroll-margin-top: calc(var(--topbar-h) + 18px);
}

.zh {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: var(--rule-strong);
}

.zh-title {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
}

.zh-meta {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ink3);
  letter-spacing: 0.03em;
}

.zone-intake {
  margin-bottom: 24px;
}

.intake-card,
.itin-right,
.slice,
.policy-strip,
.deadline,
.fare-wrap,
.rule-sections,
.export-card,
.success-banner,
.warning-banner,
.booking-placeholder,
.empty-panel {
  background: var(--white);
  border: var(--rule);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
}

.intake-card {
  padding: 14px;
}

.intake-copy {
  max-width: 78ch;
  margin-bottom: 14px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink2);
}

.intake-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.intake-input,
.rules-search,
textarea,
input[type="file"] {
  width: 100%;
  border: var(--rule);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink);
}

.intake-input,
.rules-search {
  min-height: 42px;
  padding: 0 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.intake-input::placeholder,
.rules-search::placeholder,
textarea::placeholder {
  color: var(--ink4);
}

textarea {
  min-height: 160px;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 4px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  text-decoration: none;
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  transform: translateY(-1px);
  background: var(--ink2);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  padding: 7px 12px;
}

.btn-primary {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.btn-ghost,
.btn-quiet {
  background: transparent;
  color: var(--ink2);
  border: var(--rule);
}

.btn-ghost:hover:not(:disabled),
.btn-quiet:hover:not(:disabled) {
  background: var(--paper2);
  color: var(--ink);
}

.topbar .btn-ghost {
  color: rgba(255, 255, 255, 0.82);
  border-color: rgba(255, 255, 255, 0.16);
}

.topbar .btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.btn-quiet {
  padding: 6px 10px;
}

.btn-pill {
  border-radius: 999px;
}

.intake-actions,
.manual-head,
.manual-actions,
.policy-strip,
.fare-bar,
.fare-summary-row,
.coverage-head,
.tax-row,
.export-head,
.followup-grid,
.truth-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.intake-actions {
  margin-bottom: 12px;
}

.intake-action-group,
.review-actions,
.export-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.turnstile-wrap {
  margin-bottom: 12px;
}

.manual-panel {
  margin-top: 12px;
  padding-top: 12px;
  border-top: var(--rule);
}

.manual-copy,
.meta-copy,
.muted,
.empty-state,
small {
  color: var(--ink3);
  line-height: 1.5;
}

.meta-copy,
.muted,
.empty-state,
small {
  font-size: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 14px;
}

.field span {
  font-size: 12px;
  font-weight: 600;
}

.intake-status {
  margin-top: 14px;
}

.results.hidden {
  display: none;
}

.results {
  opacity: 0;
  transform: translateY(12px);
}

.results.results-ready {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 240ms var(--ease),
    transform 240ms var(--ease);
}

.workspace-grid {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.content-well {
  min-width: 0;
  width: 100%;
}

.rail {
  position: sticky;
  top: calc(var(--topbar-h) + 18px);
  align-self: start;
  max-height: calc(100vh - var(--topbar-h) - 32px);
  background: var(--white);
  border: var(--rule);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-soft);
  overflow: auto;
  overscroll-behavior: contain;
  z-index: 30;
}

.rail-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  border: 0;
  border-bottom: var(--rule);
  background: var(--paper2);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink2);
}

.rail-toggle-icon {
  font-size: 13px;
}

.rail-block {
  position: relative;
  border-bottom: var(--rule);
}

.rail-block:last-child {
  border-bottom: 0;
}

.rail-mini {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--ink2);
}

.rail-mini-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: var(--rule);
  background: var(--paper2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.rail-flyout {
  padding: 12px;
}

.rail-label {
  margin-bottom: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink4);
}

.rail-body-output {
  min-width: 0;
}

.rail-stack {
  display: grid;
  gap: 8px;
}

.rail-kv {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.rail-kv strong,
.parse-note,
.coverage-codes,
.deadline-date,
.tb-total strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.parse-card {
  display: grid;
  gap: 10px;
}

.parse-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.parse-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(26, 127, 90, 0.38);
  animation: pulse 1.8s infinite;
}

.parse-status {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 600;
}

.parse-note {
  font-size: 10px;
  line-height: 1.55;
  color: var(--ink3);
}

.rail-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  border: var(--rule);
  border-radius: 6px;
  overflow: hidden;
}

.rail-metric {
  min-height: 64px;
  padding: 10px;
  border-right: var(--rule);
  border-bottom: var(--rule);
  background: var(--paper);
  min-width: 0;
}

.rail-metric:nth-child(2n) {
  border-right: 0;
}

.rail-metric:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.rail-metric.is-total {
  grid-column: 1 / -1;
  background: var(--blue-bg);
}

.rail-metric-label {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  color: var(--ink4);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.rail-metric-value {
  display: block;
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  text-wrap: balance;
}

.rail-metric-value.is-compact {
  font-size: 12px;
}

.rail-metric-value.is-tight {
  font-size: 11px;
}

.rail-policy-stack {
  display: grid;
  gap: 8px;
}

.rail-policy-card {
  padding: 10px;
  border-radius: 6px;
  border: var(--rule);
}

.rail-policy-label {
  display: block;
  margin-bottom: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink4);
}

.rail-policy-headline {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  min-height: 16px;
}

.rail-policy-detail {
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--ink2);
  display: -webkit-box;
  min-height: 32px;
  max-height: 32px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rail-policy-card.is-change {
  background: var(--amber-bg);
  border-color: var(--amber-bdr);
}

.rail-policy-card.is-refund {
  background: var(--red-bg);
  border-color: var(--red-bdr);
}

.rail-policy-card.is-change .rail-policy-headline {
  color: var(--amber);
}

.rail-policy-card.is-refund .rail-policy-headline {
  color: #c93d31;
}

.rail-policy-card.is-deadline {
  background: var(--blue-bg);
  border-color: var(--blue-bdr);
}

.rail-policy-card.is-deadline .rail-policy-headline {
  color: var(--blue);
}

.rail-risk-card {
  display: grid;
  gap: 8px;
}

.rail-risk-banner {
  padding: 10px;
  border-radius: 6px;
  background: var(--green-bg);
  border: 1px solid var(--green-bdr);
}

.rail-risk-banner.has-issues {
  background: var(--amber-bg);
  border-color: var(--amber-bdr);
}

.rail-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--paper2);
}

.nav-item.active {
  background: var(--ink);
  color: var(--white);
}

body.rail-collapsed .workspace-grid {
  grid-template-columns: var(--rail-w-collapsed) minmax(0, 1fr);
}

body.rail-collapsed .rail-toggle {
  justify-content: center;
}

body.rail-collapsed .rail-toggle-label {
  display: none;
}

body.rail-collapsed .rail-mini {
  display: flex;
}

body.rail-collapsed .rail-flyout {
  display: none;
  position: absolute;
  left: calc(100% + 12px);
  top: 8px;
  width: 280px;
  border: var(--rule);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow-pop);
  z-index: 150;
}

body.rail-collapsed .rail-block:hover .rail-flyout,
body.rail-collapsed .rail-block:focus-within .rail-flyout,
body.rail-collapsed .rail-block.preview-open .rail-flyout {
  display: block;
}

.status-pill {
  min-width: 96px;
  justify-content: center;
}

.status-idle {
  color: var(--ink3);
  background: var(--paper2);
}

.status-loading,
.status-link_fallback_required,
.status-draft_json_only {
  color: var(--amber);
  background: var(--amber-bg);
  border-color: var(--amber-bdr);
}

.status-verified {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-bdr);
}

.status-needs_review {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-bdr);
}

.chip {
  background: var(--paper);
  color: var(--ink2);
}

.chip-code,
.chip-carrier {
  background: var(--blue-bg);
  color: var(--blue);
  border-color: var(--blue-bdr);
}

.chip-cabin {
  background: rgba(26, 127, 90, 0.08);
  color: var(--green);
  border-color: rgba(26, 127, 90, 0.2);
}

.chip-booking,
.chip-neutral {
  background: var(--paper3);
  color: var(--ink2);
  border-color: var(--paper3);
}

.chip-warning {
  background: var(--amber-bg);
  color: var(--amber);
  border-color: var(--amber-bdr);
}

.chip-blocking {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-bdr);
}

.chip-info {
  background: var(--paper2);
  color: var(--ink3);
}

.chip-provider {
  background: var(--green-bg);
  color: var(--green);
  border-color: var(--green-bdr);
}

.itin-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  align-items: start;
  width: 100%;
}

.itin-left,
#itinerary-output {
  width: 100%;
  min-width: 0;
}

.itin-left-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.itin-left-title,
.map-panel-label,
.export-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink3);
}

.itin-focused-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--white);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.slice-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  width: 100%;
}

.slice {
  overflow: hidden;
  width: 100%;
}

.slice.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(26, 95, 180, 0.12);
}

.slice-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: var(--rule);
  background: var(--paper2);
}

.slice-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink4);
}

.slice-route {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 8px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.slice-route-origin-wrap,
.slice-route-destination {
  white-space: nowrap;
}

.slice-date {
  margin-left: auto;
  display: grid;
  justify-items: end;
  gap: 2px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ink3);
}

.slice-date-line {
  display: block;
  white-space: nowrap;
}

.slice-date-subline {
  color: var(--ink4);
}

.slice-focus-btn,
.map-slice-btn,
.col-toggle-btn {
  padding: 6px 12px;
  border-radius: 4px;
  border: var(--rule);
  background: var(--white);
  color: var(--ink2);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
}

.slice-focus-btn:hover,
.map-slice-btn:hover,
.col-toggle-btn:hover {
  background: var(--paper2);
}

.slice-focus-btn.is-active,
.map-slice-btn.active {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
}

.seatmap-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  padding: 4px 9px;
  border: var(--rule);
  border-radius: 4px;
  background: var(--white);
  color: var(--ink2);
  cursor: pointer;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  transition:
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.seatmap-trigger:hover,
.seatmap-trigger:focus-visible {
  background: var(--blue-bg);
  border-color: var(--blue-bdr);
  color: var(--blue);
}

.seatmap-open-link {
  align-items: center;
  background: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 4px;
  color: var(--white);
  display: inline-flex;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
  min-height: 28px;
  padding: 4px 10px;
  text-decoration: none;
  text-transform: uppercase;
}

.seatmap-open-link:hover,
.seatmap-open-link:focus-visible {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  outline: none;
}

.tl-row[data-seatmap-row] {
  cursor: pointer;
  border-radius: 6px;
}

.tl-row[data-seatmap-row]:hover {
  background: rgba(26, 95, 180, 0.035);
}

.tl-row[data-seatmap-row]:focus-visible {
  outline: 2px solid rgba(26, 95, 180, 0.35);
  outline-offset: 2px;
}

.seatmap-panel {
  --seat-size: 30px;
  --seat-first-size: var(--seat-size);
  --seat-aisle: 28px;
  --seat-window-rail: 10px;
  margin-top: 16px;
  border: var(--rule);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.seatmap-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: var(--rule);
  background: var(--paper2);
}

.seatmap-head-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}

.seatmap-label,
.seatmap-toolbar-label,
.seatmap-cabin-name,
.seatmap-metric span,
.seatmap-detail-head span,
.seatmap-detail-list span {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink3);
}

.seatmap-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
}

.seatmap-head-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.seatmap-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: var(--rule);
}

.seatmap-metric {
  display: grid;
  gap: 3px;
  padding: 9px 12px;
  border-right: var(--rule);
}

.seatmap-metric:last-child {
  border-right: 0;
}

.seatmap-metric strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  color: var(--ink);
}

.seatmap-empty {
  padding: 24px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  color: var(--ink3);
}

.seatmap-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 0;
  align-items: start;
}

.seatmap-board {
  min-width: 0;
  border-right: var(--rule);
}

.seatmap-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 42px;
  padding: 9px 12px;
  border-bottom: var(--rule);
  background: var(--paper);
}

.seatmap-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.seatmap-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  color: var(--ink3);
}

.seatmap-legend i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid transparent;
}

.legend-available {
  background: var(--paper3);
  border-color: var(--ink4) !important;
}

.legend-unavailable {
  background: var(--ink3);
  border-color: var(--ink2) !important;
}

.legend-paid {
  background: var(--amber-bg);
  border-color: var(--amber-bdr) !important;
}

.legend-exit {
  background: var(--green-bg);
  border-color: var(--green-bdr) !important;
}

.seatmap-scroll {
  overflow-x: auto;
  padding: 18px 14px 22px;
}

.seatmap-scroll::-webkit-scrollbar {
  height: 4px;
}

.seatmap-scroll::-webkit-scrollbar-thumb {
  background: var(--paper3);
  border-radius: 2px;
}

.seatmap-fuselage {
  width: fit-content;
  min-width: min-content;
  margin: 0 auto;
}

.seatmap-cabin {
  margin-bottom: 18px;
}

.seatmap-cabin:last-child {
  margin-bottom: 0;
}

.seatmap-cabin-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--paper3);
}

.seatmap-cabin-count {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  color: var(--ink4);
}

.seatmap-cabin-layout {
  padding: 1px 5px;
  border: var(--rule);
  border-radius: 3px;
  color: var(--ink3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
}

.seatmap-row {
  display: flex;
  align-items: center;
  min-height: 36px;
}

.seatmap-row-columns {
  min-height: 28px;
  padding-top: 4px;
}

.seatmap-row-num {
  width: 24px;
  padding-right: 6px;
  flex: 0 0 24px;
  text-align: right;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink4);
}

.seatmap-col {
  display: inline-flex;
  width: var(--seat-size);
  height: 18px;
  margin: 0 2px;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
  color: var(--ink4);
}

.seatmap-window-rail {
  display: inline-flex;
  align-self: stretch;
  width: var(--seat-window-rail);
  flex: 0 0 var(--seat-window-rail);
  margin: 2px 5px;
  border-left: 1px solid var(--blue-bdr);
  border-right: 1px solid var(--blue-bdr);
  background: var(--blue-bg);
}

.seatmap-window-rail-label {
  height: 18px;
  align-self: center;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  margin-bottom: 0;
  border-radius: 999px;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 8px;
  font-weight: 700;
}

.seatmap-aisle {
  width: var(--seat-aisle);
  flex: 0 0 var(--seat-aisle);
  align-self: stretch;
  margin: 2px 4px;
  border-left: 1px dashed var(--paper3);
  border-right: 1px dashed var(--paper3);
  background: var(--paper);
  position: relative;
}

.seatmap-aisle::before {
  content: "";
  position: absolute;
  inset: 3px 50%;
  border-left: 1px solid var(--paper3);
}

.seatmap-aisle-head {
  height: 18px;
  align-self: center;
  margin-top: 0;
  margin-bottom: 0;
}

.seatmap-exit-bar {
  margin: 6px 0;
  padding: 4px 8px;
  border-top: 1px solid var(--green-bdr);
  border-bottom: 1px solid var(--green-bdr);
  border-radius: 3px;
  background: var(--green-bg);
  color: var(--green);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

.seatmap-seat {
  width: var(--seat-size);
  height: var(--seat-size);
  margin: 2px;
  border: 1px solid var(--ink4);
  border-radius: 4px;
  background: var(--paper3);
  color: var(--ink3);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--seat-size);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 8px;
  font-weight: 600;
  transition:
    transform var(--duration) var(--ease),
    background-color var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.seatmap-seat:hover:not(:disabled),
.seatmap-seat:focus-visible:not(:disabled) {
  transform: scale(1.08);
  background: var(--blue-bg);
  border-color: var(--blue-bdr);
  color: var(--blue);
  outline: none;
}

.seatmap-seat.is-unavailable,
.seatmap-seat.is-unknown,
.seatmap-seat:disabled {
  background: var(--ink3);
  border-color: var(--ink2);
  color: var(--ink4);
  cursor: not-allowed;
}

.seatmap-seat.is-paid {
  background: var(--amber-bg);
  border-color: var(--amber-bdr);
  color: var(--amber);
}

.seatmap-seat.is-exit {
  background: var(--green-bg);
  border-color: var(--green-bdr);
  color: var(--green);
}

.seatmap-seat.is-extra:not(.is-exit) {
  background: var(--amber-bg);
  border-color: var(--amber-bdr);
  color: var(--amber);
}

.seatmap-seat.is-window:not(:disabled) {
  box-shadow: inset 0 -2px 0 rgba(26, 95, 180, 0.22);
}

.seatmap-seat.is-business:not(:disabled) {
  background: var(--blue-bg);
  border-color: var(--blue-bdr);
  color: var(--blue);
}

.seatmap-seat.is-first:not(:disabled) {
  width: var(--seat-first-size);
  height: var(--seat-first-size);
  flex-basis: var(--seat-first-size);
  background: var(--purple-bg);
  border-color: var(--purple-bdr);
  color: var(--purple);
}

.seatmap-seat.is-recline-restricted {
  border-style: dashed;
}

.seatmap-seat.is-focused:not(:disabled) {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
  box-shadow: 0 0 0 2px rgba(26, 95, 180, 0.18);
}

.seatmap-seat-none {
  visibility: hidden;
  pointer-events: none;
}

.seatmap-detail {
  position: sticky;
  top: calc(var(--topbar-h) + 14px);
  display: grid;
  gap: 0;
}

.seatmap-detail-card {
  border-bottom: var(--rule);
}

.seatmap-detail-card:last-child {
  border-bottom: 0;
}

.seatmap-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 10px 12px;
  border-bottom: var(--rule);
  background: var(--paper);
}

.seatmap-detail-head strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ink3);
}

.seatmap-detail-body,
.seatmap-summary {
  padding: 12px;
}

.seatmap-detail-empty {
  padding: 12px 0;
  text-align: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--ink4);
}

.seatmap-detail-seat {
  margin-bottom: 4px;
  color: var(--blue);
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.seatmap-detail-class {
  margin-bottom: 12px;
  color: var(--ink3);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.seatmap-detail-list {
  border: var(--rule);
  border-radius: 4px;
  overflow: hidden;
}

.seatmap-detail-list div,
.seatmap-summary-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 7px 9px;
  border-bottom: var(--rule);
}

.seatmap-detail-list div:last-child,
.seatmap-summary-row:last-child {
  border-bottom: 0;
}

.seatmap-detail-list strong,
.seatmap-summary-row strong,
.seatmap-summary-row em {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  color: var(--ink);
  font-style: normal;
}

.seatmap-summary-row span {
  color: var(--ink2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
}

.seatmap-summary-row em {
  margin-left: 0;
  color: var(--ink4);
}

.tl {
  position: relative;
  --tl-pad-x: 14px;
  --tl-time-col-w: 92px;
  --tl-dot-col-w: 20px;
  --tl-gap: 10px;
  padding: 12px 14px 14px;
}

.tl-spine {
  position: absolute;
  left: calc(
    var(--tl-pad-x) + var(--tl-time-col-w) + var(--tl-gap) + (var(--tl-dot-col-w) / 2)
  );
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: var(--paper3);
}

.tl-row {
  position: relative;
  display: grid;
  grid-template-columns: var(--tl-time-col-w) var(--tl-dot-col-w) minmax(0, 1fr);
  gap: var(--tl-gap);
  align-items: start;
}

.tl-row + .tl-row {
  margin-top: 12px;
}

.tl-time-col {
  display: grid;
  justify-items: end;
  gap: 4px;
  padding-top: 2px;
  padding-right: 6px;
  text-align: right;
}

.tl-depart,
.tl-arrival {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.tl-depart {
  color: var(--ink2);
}

.tl-dur {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  color: var(--ink4);
  line-height: 1;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.tl-dot-col {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.tl-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid var(--white);
  background: var(--blue);
}

.tl-dot.is-purple {
  background: var(--purple);
}

.tl-body {
  min-width: 0;
}

.tl-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}

.tl-route {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 700;
}

.tl-airport-code {
  position: relative;
  display: inline-flex;
  cursor: help;
  text-decoration: underline dotted transparent;
  text-underline-offset: 0.12em;
  outline: none;
}

.tl-airport-code:hover,
.tl-airport-code:focus-visible {
  text-decoration-color: currentColor;
}

.tl-airport-code::after {
  content: attr(data-airport-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
  padding: 6px 8px;
  border: var(--rule);
  border-radius: 4px;
  background: var(--ink);
  color: var(--white);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  z-index: 4;
}

.tl-airport-code:hover::after,
.tl-airport-code:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.tl-arrival {
  margin-top: 4px;
  color: var(--ink2);
}

.tl-depart-label,
.tl-arrival-label {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink4);
}

.tl-depart-time,
.tl-arrival-time {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--ink2) 24%, transparent);
  text-underline-offset: 0.12em;
}

.tl-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.tl-airline {
  margin-top: 5px;
  font-size: 10px;
  color: var(--ink3);
}

.airline-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 7px;
  border: var(--rule);
  background: var(--white);
  overflow: hidden;
  flex: 0 0 auto;
}

.airline-mark img {
  position: absolute;
  inset: 4px;
  width: 36px;
  height: 36px;
  object-fit: contain;
  opacity: 0;
}

.airline-mark.is-loaded img {
  opacity: 1;
}

.airline-mark-fallback {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink3);
}

.tl-layover {
  position: relative;
  z-index: 1;
  margin: 10px 0 4px calc(var(--tl-time-col-w) + var(--tl-dot-col-w) + (var(--tl-gap) * 2));
  padding: 6px 10px;
  border: var(--rule);
  border-radius: 4px;
  background: var(--paper2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ink3);
}

.tl-layover.is-tight {
  color: var(--amber);
  border-color: var(--amber-bdr);
  background: var(--amber-bg);
}

.itin-right {
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
  overflow: hidden;
}

.map-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: var(--rule);
  background: var(--paper2);
}

.map-panel-title {
  margin-top: 2px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.map-open-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

.map-open-link:hover {
  text-decoration: underline;
}

.map-slice-selectors {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: var(--rule);
  background: var(--paper);
}

.map-active-label {
  padding: 10px 14px;
  border-bottom: var(--rule);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ink3);
}

.map-svg-wrap {
  padding: 12px;
  background:
    linear-gradient(to right, transparent calc(25% - 0.5px), var(--paper3) calc(25% - 0.5px), var(--paper3) calc(25% + 0.5px), transparent calc(25% + 0.5px)),
    linear-gradient(to right, transparent calc(75% - 0.5px), var(--paper3) calc(75% - 0.5px), var(--paper3) calc(75% + 0.5px), transparent calc(75% + 0.5px)),
    linear-gradient(to bottom, transparent calc(33.333% - 0.5px), var(--paper3) calc(33.333% - 0.5px), var(--paper3) calc(33.333% + 0.5px), transparent calc(33.333% + 0.5px)),
    linear-gradient(to bottom, transparent calc(66.666% - 0.5px), var(--paper3) calc(66.666% - 0.5px), var(--paper3) calc(66.666% + 0.5px), transparent calc(66.666% + 0.5px)),
    var(--white);
}

.map-svg {
  width: 100%;
  height: auto;
  display: block;
}

.map-embed-wrap {
  border-top: var(--rule);
  background: var(--paper2);
  padding: 8px;
}

.route-map-iframe {
  width: 100%;
  min-height: 360px;
  border: var(--rule);
  border-radius: 6px;
  background: var(--white);
}

.map-fare-coverage {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: var(--rule);
}

.coverage-card {
  padding: 12px;
  border-right: var(--rule);
}

.coverage-card:last-child {
  border-right: 0;
}

.coverage-head {
  margin-bottom: 8px;
}

.coverage-swatch {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #1a5fb4;
}

.coverage-swatch.is-purple {
  background: #7b3fbe;
}

.coverage-name,
.coverage-codes,
.cov-leg-route {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.coverage-name {
  font-size: 10px;
  font-weight: 600;
}

.coverage-codes {
  font-size: 9px;
  color: var(--ink4);
}

.coverage-legs {
  display: grid;
  gap: 6px;
}

.coverage-leg {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
}

.coverage-route {
  font-size: 12px;
  line-height: 1.6;
  color: var(--ink2);
}

.policy-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: var(--rule-strong);
  border-radius: 7px 7px 0 0;
  overflow: hidden;
  box-shadow: none;
}

.ps-cell {
  position: relative;
  min-height: 190px;
  padding: 14px;
  border-right: var(--rule);
}

.ps-cell:last-child {
  border-right: 0;
}

.ps-cell::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
}

.ps-cell.ps-amber::before {
  background: var(--amber);
}

.ps-cell.ps-red::before {
  background: var(--red);
}

.ps-cell.ps-blue::before {
  background: var(--blue);
}

.ps-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink4);
  text-transform: uppercase;
}

.ps-value {
  margin-top: 10px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 0.95;
  min-height: 22px;
}

.ps-value.amber {
  color: var(--amber);
}

.ps-value.red {
  color: var(--red);
}

.ps-value.blue {
  color: var(--blue);
}

.ps-desc {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink2);
}

.ps-desc.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ps-toggle {
  margin-top: 8px;
  align-self: flex-start;
}

.ps-toggle.col-toggle-btn {
  background: var(--paper2);
}

.ps-toggle.col-toggle-btn:hover {
  background: var(--white);
}

.ps-src {
  margin-top: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ink4);
}

.deadline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  border-top: 0;
  border-radius: 0 0 7px 7px;
  background: var(--amber-bg);
  border-color: var(--amber-bdr);
  box-shadow: none;
}

.deadline-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.deadline-title {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.deadline-sub {
  margin-top: 3px;
  font-size: 12px;
  color: var(--ink2);
}

.deadline-sub.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.deadline-toggle {
  flex: 0 0 auto;
}

.deadline-date {
  padding: 6px 10px;
  border-radius: 4px;
  background: var(--white);
  border: 1px solid var(--amber-bdr);
  font-size: 10px;
  font-weight: 600;
}

.fare-wrap {
  overflow: hidden;
}

.provider-validation-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: var(--rule);
  background: var(--paper);
}

.provider-validation-card strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.provider-validation-card p {
  max-width: 56ch;
  margin: 0;
  color: var(--ink2);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

.provider-validation-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.provider-validation-kicker {
  color: var(--ink3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.provider-validation-card.is-verified {
  background: var(--green-bg);
}

.provider-validation-card.is-response,
.provider-validation-card.is-matrix {
  background: var(--amber-bg);
}

.provider-validation-card.is-unavailable,
.provider-validation-card.is-manual {
  background: var(--paper2);
}

.fare-source-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: var(--rule);
  background: var(--paper2);
}

.fare-source-text {
  color: var(--ink2);
  font-size: 12px;
  line-height: 1.35;
}

.fare-bar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: var(--white);
}

.fbar-cell {
  padding: 14px;
  border-right: var(--rule);
}

.fbar-cell:last-child {
  border-right: 0;
}

.fbar-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ink4);
  text-transform: uppercase;
}

.fbar-val {
  margin-top: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 20px;
  font-weight: 600;
}

.fbar-val.hi {
  color: var(--blue);
}

.fbar-sub {
  margin-top: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ink4);
}

.col-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-top: var(--rule);
  background: var(--paper2);
}

.col-label {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ink4);
}

.col-body[hidden] {
  display: none;
}

.tax-wrap,
.token-wrap {
  border-top: var(--rule);
}

.tax-head-row,
.token-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: var(--rule);
  background: var(--paper2);
}

.tax-head-row-title,
.token-head-title {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

table.tax {
  width: 100%;
  border-collapse: collapse;
}

table.tax th,
table.tax td {
  padding: 12px 16px;
  border-bottom: var(--rule);
  text-align: left;
  font-size: 12px;
}

table.tax th,
table.tax tfoot td {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink4);
}

table.tax td:last-child,
table.tax th:last-child {
  text-align: right;
}

.token-scroll {
  overflow-x: auto;
  padding: 14px 16px;
  background: var(--ink);
}

.tok-row {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 6px;
  min-width: 100%;
}

.tok,
.tcode {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.tk-city {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
}

.tk-carrier {
  background: rgba(26, 95, 180, 0.2);
  color: #b6d2f2;
}

.tk-amount {
  background: rgba(26, 127, 90, 0.22);
  color: #c5f1e1;
}

.tk-keyword,
.tcode {
  background: rgba(200, 120, 10, 0.2);
  color: #ffd8a1;
}

.tcode {
  background: rgba(200, 120, 10, 0.14);
  color: #7a4706;
  box-shadow: inset 0 0 0 1px rgba(200, 120, 10, 0.26);
}

.tk-tax {
  background: rgba(123, 63, 190, 0.2);
  color: #dec3ff;
}

.tk-text {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.72);
}

.token-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px;
  background: var(--ink);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.scan-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  border: var(--rule);
  border-radius: 6px;
  background: var(--paper2);
  font-size: 12px;
  color: var(--ink2);
}

.scan-hint.is-hidden {
  display: none;
}

.scan-hint-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: var(--rule);
  background: var(--white);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
}

.rules-search-row {
  margin-bottom: 12px;
}

.rule-sections,
.truth-sections {
  display: grid;
  gap: 10px;
}

.rs,
.truth-section {
  overflow: hidden;
  border: var(--rule);
  border-radius: 6px;
  background: var(--white);
}

.rs-toggle,
.truth-section-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border: 0;
  background: var(--paper2);
  cursor: pointer;
  text-align: left;
}

.rs-toggle:hover,
.truth-section-toggle:hover {
  background: var(--paper3);
}

.truth-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.rs-name,
.truth-section-header strong {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

.rs-count,
.truth-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 7px;
  border-radius: 3px;
  background: var(--paper3);
  color: var(--ink4);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 9px;
}

.truth-section-arrow,
.rs-arrow {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  color: var(--ink3);
}

.truth-section-body,
.rs-body {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: var(--paper);
}

.truth-table-empty {
  padding: 14px;
  border: var(--rule);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink3);
}

.truth-row {
  position: relative;
  padding: 14px 16px 14px 20px;
  border: var(--rule);
  border-radius: 6px;
  background: var(--white);
  transition:
    border-color var(--duration) var(--ease),
    background-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.truth-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 6px 0 0 6px;
  background: var(--blue);
}

.truth-row.scope-tone-a::before {
  background: var(--blue);
}

.truth-row.scope-tone-b::before {
  background: var(--purple);
}

.truth-row.scope-tone-c::before {
  background: var(--amber);
}

.truth-row.scope-tone-d::before {
  background: var(--green);
}

.truth-row.is-priority {
  border-color: rgba(26, 95, 180, 0.22);
  background: linear-gradient(180deg, rgba(26, 95, 180, 0.04), rgba(255, 255, 255, 0) 48%), var(--white);
  box-shadow: 0 10px 24px rgba(14, 15, 17, 0.045);
}

.truth-row.is-secondary {
  background: rgba(255, 255, 255, 0.82);
}

.truth-row.is-secondary .truth-source,
.truth-row.is-secondary .truth-note {
  color: var(--ink2);
}

.truth-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.truth-concern-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 4px;
  border: var(--rule);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
}

.truth-concern-integrity,
.truth-concern-risk {
  background: var(--blue-bg);
  border-color: var(--blue-bdr);
  color: var(--blue);
}

.truth-concern-rule {
  background: var(--amber-bg);
  border-color: var(--amber-bdr);
  color: var(--amber);
}

.truth-scope {
  margin-left: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  color: var(--ink4);
  letter-spacing: 0.03em;
}

.confidence-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.confidence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--paper3);
}

.confidence-dot.is-on,
.confidence-high .confidence-dot,
.confidence-medium .confidence-dot.is-on,
.confidence-low .confidence-dot.is-on {
  background: var(--green);
}

.confidence-medium .confidence-dot:nth-child(3),
.confidence-low .confidence-dot:nth-child(2),
.confidence-low .confidence-dot:nth-child(3) {
  background: var(--paper3);
}

.truth-value {
  margin-top: 12px;
  max-width: 92ch;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.72;
  color: var(--ink);
  letter-spacing: 0;
  text-wrap: pretty;
}

.truth-value p {
  margin: 0;
}

.truth-value p + p {
  margin-top: 10px;
}

.truth-value.is-truncated,
.truth-note.is-truncated {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.truth-value.is-truncated {
  -webkit-line-clamp: 2;
}

.truth-note.is-truncated {
  -webkit-line-clamp: 1;
}

.truth-meta {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 10px;
  color: var(--ink3);
}

.truth-source,
.truth-note {
  display: block;
  font-style: normal;
  line-height: 1.5;
}

.row-expand {
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
}

.row-expand:hover {
  color: var(--ink);
}

mark {
  background: rgba(200, 120, 10, 0.22);
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}

.translated-with-hint,
.truth-value[data-original-text],
.truth-source[data-original-text],
.truth-note[data-original-text],
.tax-name[data-original-text] {
  position: relative;
  cursor: help;
}

.truth-value[data-original-text]::after,
.truth-source[data-original-text]::after,
.truth-note[data-original-text]::after,
.tax-name[data-original-text]::after {
  content: attr(data-original-text);
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: min(520px, 90vw);
  padding: 10px 12px;
  border-radius: 6px;
  border: 1px solid var(--paper3);
  background: var(--ink);
  color: var(--white);
  font-size: 11px;
  line-height: 1.55;
  box-shadow: var(--shadow-pop);
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
  white-space: normal;
}

.truth-value[data-original-text]:hover::after,
.truth-source[data-original-text]:hover::after,
.truth-note[data-original-text]:hover::after,
.tax-name[data-original-text]:hover::after,
.truth-value[data-original-text]:focus-visible::after,
.truth-source[data-original-text]:focus-visible::after,
.truth-note[data-original-text]:focus-visible::after,
.tax-name[data-original-text]:focus-visible::after {
  opacity: 1;
  transform: translateY(0);
}

.followup-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.success-banner,
.warning-banner,
.booking-placeholder {
  padding: 14px;
}

.booking-phase-row,
.discrepancy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.phase-pill {
  background: var(--paper2);
  color: var(--ink3);
}

.success-banner {
  background: var(--green-bg);
  border-color: var(--green-bdr);
}

.warning-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--amber-bg);
  border-color: var(--amber-bdr);
}

.discrepancy-card {
  padding: 14px;
  border: var(--rule);
  border-radius: 6px;
  background: var(--white);
  margin-bottom: 10px;
}

.discrepancy-card.warning {
  border-color: var(--amber-bdr);
  background: rgba(200, 120, 10, 0.04);
}

.discrepancy-card.blocking {
  border-color: var(--red-bdr);
  background: rgba(192, 53, 42, 0.04);
}

.discrepancy-card.info {
  border-color: var(--paper3);
}

.booking-placeholder {
  border-style: dashed;
}

.export-card {
  overflow: hidden;
}

.export-head {
  padding: 12px 14px;
  border-bottom: var(--rule);
  background: var(--paper2);
}

.export-title-group {
  display: grid;
  gap: 6px;
}

.export-summary {
  max-width: 64ch;
  color: var(--ink2);
  font-size: 13px;
  line-height: 1.6;
}

.export-detail[hidden] {
  display: none;
}

.code-view {
  background: var(--ink);
  color: var(--white);
  max-height: 420px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.code-lines {
  padding: 10px 0;
}

.code-line {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 14px;
  padding: 0 14px;
}

.code-line-number {
  color: rgba(255, 255, 255, 0.36);
  text-align: right;
}

.code-line-content {
  white-space: pre-wrap;
  word-break: break-word;
  padding-bottom: 3px;
}

.empty-state,
.empty-panel {
  padding: 14px;
}

.matrix-attempt,
.state-card {
  padding: 14px;
  border: var(--rule);
  border-radius: 6px;
  background: var(--white);
}

.matrix-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.matrix-summary-grid .matrix-attempt {
  padding: 10px;
  border-radius: 4px;
  box-shadow: none;
}

.matrix-attempt-summary {
  background: var(--paper2);
}

.segment-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.matrix-subtle {
  margin-top: 6px;
  color: var(--ink3);
  font-size: 11px;
  line-height: 1.55;
}

.slice-title {
  margin-top: 8px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  font-weight: 800;
}

body.intake-compact .zone-intake .zh {
  margin-bottom: 10px;
}

body.intake-compact .intake-card {
  padding: 10px 12px 12px;
}

body.intake-compact .intake-actions {
  margin-bottom: 8px;
}

body.intake-compact .intake-copy,
body.intake-compact .intake-row,
body.intake-compact .manual-copy {
  display: none;
}

body.intake-compact .manual-panel {
  display: none;
}

body.intake-compact #matrix-link-output {
  margin-top: 6px;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(26, 127, 90, 0.38);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(26, 127, 90, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(26, 127, 90, 0);
  }
}

@media (max-width: 1180px) {
  .topbar {
    flex-wrap: wrap;
  }

  .tb-route {
    max-width: 48vw;
  }

  .itin-split {
    grid-template-columns: 1fr;
  }

  .itin-right {
    position: static;
  }

  .seatmap-workspace {
    grid-template-columns: 1fr;
  }

  .seatmap-board {
    border-right: 0;
    border-bottom: var(--rule);
  }

  .seatmap-detail {
    position: static;
  }

  body:not(.rail-collapsed) .workspace-grid {
    grid-template-columns: var(--rail-w-collapsed) minmax(0, 1fr);
  }

  body:not(.rail-collapsed) .rail-toggle-label {
    display: none;
  }
}

@media (max-width: 980px) {
  .page-shell {
    width: min(calc(100% - 24px), 1400px);
  }

  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    min-height: auto;
    z-index: auto;
  }

  .rail-mini {
    display: none !important;
  }

  .rail-flyout {
    display: block !important;
    position: static !important;
    width: auto !important;
    box-shadow: none !important;
  }

  .followup-grid,
  .policy-strip,
  .fare-bar {
    grid-template-columns: 1fr;
  }

  .ps-cell,
  .fbar-cell {
    border-right: 0;
    border-bottom: var(--rule);
  }

  .ps-cell:last-child,
  .fbar-cell:last-child {
    border-bottom: 0;
  }
}

@media (max-width: 720px) {
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: var(--mobile-topbar-h);
    padding: 10px 12px;
  }

  .topbar-left {
    display: grid;
    gap: 6px;
    min-width: 0;
  }

  .topbar-right {
    display: grid;
    grid-template-columns: auto auto;
    align-items: center;
    gap: 8px;
  }

  .tb-wordmark,
  .tb-divider,
  .tb-kicker,
  .tb-actions,
  #header-trip-type,
  #header-passenger-count,
  #header-component-count {
    display: none;
  }

  .tb-route {
    max-width: 100%;
    margin-top: 0;
    font-size: 1rem;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.05;
  }

  .tb-chips {
    gap: 0;
  }

  #header-status-pill {
    min-width: 84px;
  }

  .tb-total {
    min-width: 72px;
  }

  .tb-total-label {
    font-size: 8px;
  }

  .mobile-drawer-toggle {
    display: none;
    min-width: 0;
    padding-inline: 10px;
  }

  body.results-visible .mobile-drawer-toggle {
    display: inline-flex;
  }

  .page-shell {
    width: calc(100% - 12px);
    padding: 10px 0 72px;
  }

  body.intake-compact .zone-intake {
    display: none;
  }

  .zone {
    scroll-margin-top: calc(var(--mobile-topbar-h) + 18px);
  }

  .mobile-policy-chrome {
    display: none !important;
  }

  #results-rail {
    display: none;
  }

  body.rail-collapsed .workspace-grid,
  body:not(.rail-collapsed) .workspace-grid,
  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .content-well {
    min-width: 0;
  }

  .intake-row {
    flex-direction: column;
  }

  .intake-actions,
  .manual-head,
  .manual-actions,
  .export-head,
  .provider-validation-card,
  .provider-validation-side {
    flex-direction: column;
    align-items: flex-start;
  }

  .provider-validation-card p {
    text-align: left;
  }

  .intake-copy,
  .export-summary {
    font-size: 13px;
  }

  .followup-grid,
  .fare-bar,
  .policy-strip {
    grid-template-columns: 1fr;
  }

  .ps-cell,
  .fbar-cell {
    border-right: 0;
    border-bottom: var(--rule);
  }

  .ps-cell:last-child,
  .fbar-cell:last-child {
    border-bottom: 0;
  }

  .policy-strip {
    border-radius: 8px 8px 0 0;
  }

  .deadline {
    align-items: flex-start;
    flex-direction: column;
  }

  .deadline-head {
    width: 100%;
  }
  .slice-head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .slice-date {
    margin-left: 0;
    width: 100%;
    justify-items: start;
  }

  .itin-left-head {
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }

  .itin-focused-pill {
    font-size: 9px;
    padding: 5px 10px;
    max-width: 100%;
  }

  .zh {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
  }

  .zh-title {
    font-size: 16px;
  }

  .zh-meta {
    margin-left: 0;
    width: 100%;
    font-size: 9px;
    letter-spacing: 0.02em;
  }

  .itin-right {
    position: static;
    margin-top: 12px;
  }

  .map-panel-head .map-open-link {
    display: none;
  }

  .route-map-iframe {
    min-height: 280px;
  }

  .tl {
    --tl-pad-x: 12px;
    --tl-time-col-w: 70px;
    --tl-dot-col-w: 18px;
    --tl-gap: 8px;
    padding-inline: var(--tl-pad-x);
  }

  .tl-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .tl-spine,
  .tl-dot-col {
    display: none;
  }

  .tl-time-col {
    display: grid;
    justify-items: start;
    gap: 4px;
    text-align: left;
  }

  .tl-arrival {
    justify-content: flex-start;
  }

  .tl-depart {
    justify-content: flex-start;
  }

  .tl-topline {
    gap: 2px 10px;
  }

  .tl-layover {
    margin-left: 0;
  }

  .seatmap-panel {
    --seat-size: 28px;
    --seat-first-size: var(--seat-size);
    --seat-aisle: 24px;
    --seat-window-rail: 9px;
    margin-top: 12px;
  }

  .seatmap-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .seatmap-head-meta {
    justify-content: flex-start;
  }

  .seatmap-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .seatmap-metric {
    border-bottom: var(--rule);
  }

  .seatmap-metric:nth-child(2n) {
    border-right: 0;
  }

  .seatmap-metric:nth-last-child(1) {
    grid-column: span 2;
    border-bottom: 0;
  }

  .seatmap-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .seatmap-scroll {
    padding: 14px 10px 18px;
  }

  .mobile-drawer {
    display: block;
  }

  .mobile-drawer-backdrop {
    display: block;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .results {
    opacity: 1;
    transform: none;
  }

  .results.results-ready {
    transition: none;
  }

  .parse-pulse {
    animation: none !important;
  }

  body.topbar-dormant:not(.at-top) .topbar {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
}
