:root {
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --text-small: 14px;
  --text-body: 16px;
  --line-small: 20px;
  --line-body: 24px;
  --control-height: 48px;
  --page-gutter: 32px;
  --green: #1e674c;
  --green-dark: #154e39;
  --green-soft: #eaf3ee;
  --green-light: #d4e7dc;
  --brand-red: #e72a2d;
  --accent: #d52229;
  --accent-dark: #b91d23;
  --bg: #f6f7f8;
  --surface: #ffffff;
  --text: #20272d;
  --muted: #5d6872;
  --border: #dfe4e8;
  --amber: #86571b;
  --amber-soft: #fff6e6;
  --blue: #285c81;
  --blue-soft: #edf4f9;
  --red: #a33b3b;
  --red-soft: #fff0ef;
  --shadow: none;
  --radius: 12px;
  --sidebar-width: 240px;
  --header-height: 72px;
}

* { box-sizing: border-box; }
html { min-width: 320px; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + 16px); scroll-padding-bottom: 104px; }
body { margin: 0; font-family: Arial, sans-serif; font-size: var(--text-body); line-height: var(--line-body); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
img, svg { max-width: 100%; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { line-height: 36px; }
h2 { line-height: 28px; }
h3, h4 { line-height: 24px; }
h1 { font-size: 28px; letter-spacing: -.65px; }
h1[tabindex="-1"] { outline: none; }
h2 { font-size: 20px; letter-spacing: -.3px; }
h3 { font-size: 18px; }
p { margin-bottom: 16px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
h1[tabindex="-1"]:focus-visible { outline: none; }
.btn-primary:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; box-shadow: 0 0 0 2px var(--surface); }
::selection { background: var(--green-light); color: var(--green-dark); }
[hidden] { display: none !important; }
.icon { display: inline-block; width: 20px; height: 20px; min-width: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.muted { color: var(--muted); }
.mobile-only { display: none !important; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }

/* The opening portal keeps the three paths visually equivalent. */
.welcome-page { position: relative; display: flex; flex-direction: column; min-height: 100vh; background: var(--surface); }
.welcome-page::before { display: none; }
.welcome-topbar { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 24px; width: min(1200px, calc(100% - 64px)); min-height: 88px; margin: 0 auto; border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 12px; flex-shrink: 0; padding: 0; border: 0; background: transparent; color: var(--green-dark); text-align: left; }
.brand:hover { color: var(--green-dark); }
.brand-logo { display: block; width: 160px; height: auto; object-fit: contain; flex-shrink: 0; }
.brand-platform { color: var(--muted); font-size: 14px; font-weight: 400; letter-spacing: .75px; text-transform: uppercase; }
.welcome-topbar .brand-logo { width: 170px; }
.welcome-topbar .brand { gap: 12px; }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; border-radius: 9px; background: var(--green-solid, var(--green)); color: white; font-size: 23px; font-weight: 700; letter-spacing: -1.5px; }
.brand-mark .icon { width: 24px; height: 24px; stroke-width: 2; }
.brand-text { display: flex; align-items: baseline; gap: 8px; font-size: 24px; font-weight: 700; letter-spacing: -.8px; }
.brand-text small, .brand-text span { font-size: 14px; font-weight: 400; letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.welcome-topbar .brand-text { font-size: 27px; }
.welcome-topbar .brand-text span { font-size: 14px; }
.welcome-main { position: relative; z-index: 1; width: min(1200px, calc(100% - 64px)); margin: 0 auto; padding: 48px 0 32px; }
.welcome-eyebrow, .eyebrow { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; font-size: 14px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; color: var(--green); }
.welcome-eyebrow::before { content: ""; width: 24px; height: 2px; background: var(--green); }
.welcome-eyebrow { justify-content: center; color: var(--muted); font-size: 14px; }
.welcome-title { margin-bottom: 16px; font-size: 40px; letter-spacing: -1.3px; font-weight: 700; text-align: center; }
.welcome-description { max-width: 620px; margin: 0 auto 32px; font-size: 18px; line-height: 1.5; color: var(--muted); text-align: center; }
.role-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.role-card { position: relative; display: flex; flex-direction: column; align-items: flex-start; min-height: 350px; padding: 28px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); transition: border-color .18s; }
.role-card:hover { border-color: var(--border-strong, #9caea2); }
.role-card:focus-within { border-color: var(--green); }
.role-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; width: 100%; }
.role-card-number { padding-top: 4px; color: var(--muted); font-size: 14px; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.role-card-icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin-bottom: 20px; border-radius: 8px; background: var(--surface-subtle, #f5f7f6); color: var(--green); }
.role-card-icon .icon { width: 28px; height: 28px; stroke-width: 1.6; }
.role-card-title { margin-bottom: 12px; font-size: 24px; letter-spacing: -.45px; }
.role-card-subtitle { display: none; }
.role-card-description { margin-bottom: 20px; color: var(--muted); font-size: 16px; line-height: 1.5; }
.role-card-features { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; font-size: 14px; color: var(--muted); }
.role-card-features > span { display: flex; align-items: center; gap: 8px; }
.role-card-features .icon { width: 14px; height: 14px; min-width: 14px; color: var(--green); }
.role-card-link { display: inline-flex; align-items: center; justify-content: space-between; width: 100%; min-height: 48px; margin-top: auto; padding: 12px 16px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: white; font-size: 16px; font-weight: 600; transition: background .18s, border-color .18s; }
.role-card-link:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.role-card-link .icon { width: 18px; height: 18px; }
.welcome-flow { position: relative; display: flex; align-items: center; justify-content: center; gap: 24px; min-height: 64px; margin-top: 20px; padding: 20px 0; color: var(--muted); font-size: 16px; }
.welcome-flow strong { display: block; margin-bottom: 4px; font-size: 16px; font-weight: 600; color: var(--text); }
.welcome-flow svg, .welcome-flow .icon { width: 18px; height: 18px; min-width: 18px; flex-shrink: 0; color: var(--icon-muted, #779382); }
.welcome-flow p { margin-bottom: 0; }
.welcome-footer { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; width: min(1200px, calc(100% - 64px)); margin: auto auto 0; padding: 24px 0 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.welcome-footer a { font-size: 14px; }
.welcome-footer .icon { width: 14px; height: 14px; min-width: 14px; margin-right: 8px; }

/* Cabinet frame. */
.app-shell { min-height: 100vh; padding-top: var(--header-height); padding-left: var(--sidebar-width); }
.topbar { position: fixed; z-index: 30; top: 0; right: 0; left: 0; display: grid; grid-template-columns: 216px minmax(0, 1fr) auto; align-items: center; gap: 24px; height: var(--header-height); padding: 0 24px; border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar .brand { width: 100%; }
.topbar .brand { gap: 8px; }
.topbar .brand-logo { width: 160px; }
.topbar .brand-platform { font-size: 14px; letter-spacing: .75px; }
.topbar .brand-mark { width: 30px; height: 30px; font-size: 19px; border-radius: 7px; }
.topbar .brand-text { flex-direction: column; align-items: flex-start; gap: 0; font-size: 22px; line-height: 1.05; }
.topbar .brand-text span, .topbar .brand-text small { margin-top: 4px; font-size: 14px; letter-spacing: 2.1px; }
.role-switch { display: inline-flex; justify-self: start; align-items: center; gap: 4px; padding: 3px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.role-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 16px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 16px; font-weight: 600; white-space: nowrap; transition: background .15s, color .15s; }
.role-button:hover { color: var(--green); background: var(--surface-subtle, #f4f6f5); }
.role-button.active, .role-button[aria-pressed="true"] { background: var(--surface-subtle, #f0f4f1); color: var(--green); }
.role-button .icon { width: 16px; height: 16px; min-width: 16px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; min-width: 0; }
.topbar-actions .btn { font-size: 16px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex-shrink: 0; border: 1px solid var(--green-border, #d5e5dc); border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 14px; font-weight: 700; }
.sidebar { position: fixed; z-index: 25; top: var(--header-height); bottom: 0; left: 0; display: flex; flex-direction: column; width: var(--sidebar-width); padding: 28px 16px 20px; border-right: 1px solid var(--border); background: var(--surface); }
.sidebar nav { display: flex; flex-direction: column; gap: 8px; }
.sidebar-label { margin: 0 12px 16px; color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: .2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); text-align: left; font-size: 16px; font-weight: 400; transition: color .15s, background .15s; }
.nav-item:hover { background: var(--surface-hover, #f4f7f5); color: var(--text); }
.nav-item.active, .nav-item[aria-current="page"] { background: var(--green-soft); color: var(--green); font-weight: 600; }
.nav-item.active::before, .nav-item[aria-current="page"]::before { content: ""; position: absolute; top: 12px; bottom: 12px; left: 0; width: 3px; border-radius: 0 2px 2px 0; background: var(--green); }
.nav-icon { display: inline-flex; color: inherit; }
.nav-icon .icon { width: 19px; height: 19px; }
.sidebar-footer { display: flex; flex-direction: column; gap: 12px; margin-top: auto; padding: 24px 12px 0; border-top: 1px solid var(--border-subtle, #e6ebe8); color: var(--muted); font-size: 14px; }
.sidebar-footer strong { display: block; margin-bottom: 4px; color: var(--text); font-size: 14px; }
.sidebar-footer p { margin: 0; }
.sidebar-identity { display: flex; align-items: center; gap: 12px; }
.sidebar-identity > div { min-width: 0; }
.sidebar-identity strong { font-size: 14px; }
.sidebar-identity span:not(.avatar) { font-size: 14px; }
.sidebar-demo { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; }
.sidebar-demo .icon { width: 14px; height: 14px; min-width: 14px; color: var(--icon-muted, #6e8776); }
.sidebar-footer .btn { justify-content: flex-start; padding: 8px 0; font-size: 14px; }
.workspace { width: 100%; max-width: 1640px; margin: 0 auto; padding: var(--page-gutter); }
.workspace-footer { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 14px; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.page-header h1 { margin-bottom: 12px; }
.page-header .eyebrow { margin-bottom: 12px; font-size: 14px; letter-spacing: .6px; }
.page-description { margin-bottom: 0; color: var(--muted); font-size: 16px; line-height: 1.5; }
.page-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; flex-shrink: 0; padding-top: 2px; }
.bottom-nav { display: none; }
.workspace > .mobile-menu-button { display: none; }

/* Shared controls and surfaces. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--control-height); padding: 11px 15px; border: 1px solid transparent; border-radius: 8px; background: transparent; font-size: 16px; font-weight: 600; line-height: var(--line-body); text-align: center; text-decoration: none; transition: color .15s, background .15s, border-color .15s, box-shadow .15s; }
.btn:hover { text-decoration: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-dark); color: white; }
.btn-secondary { border-color: var(--border); background: var(--surface); color: var(--text); }
.btn-secondary:hover { border-color: var(--border-strong, #aabbaf); background: var(--surface-subtle, #f5f7f6); color: var(--text); }
.btn-ghost { color: var(--green); }
.btn-ghost:hover { background: var(--surface-subtle, #f5f7f6); color: var(--green-dark); }
.btn-small { min-height: 48px; padding: 12px; font-size: 14px; }
.btn-icon { width: 48px; min-height: 48px; padding: 12px; color: var(--muted); border-color: var(--border); background: var(--surface); }
.btn-icon:hover { background: var(--bg); color: var(--green); }
.btn .icon { width: 18px; height: 18px; min-width: 18px; }
.btn-danger { color: var(--red); border-color: var(--red-border, #ebd3d0); background: var(--surface); }
.btn-danger:hover { background: var(--red-soft); }
.panel { min-width: 0; margin-bottom: 24px; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px 16px; min-height: 72px; padding: 20px 24px; border-bottom: 1px solid var(--border-subtle, #e7ece9); }
.panel-header h2, .panel-header h3 { margin: 0; font-size: 20px; }
.panel-header .muted { font-size: 14px; }
.panel-body { padding: 24px; }
.panel-body > :last-child { margin-bottom: 0; }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.stats-grid:has(.stat-card:nth-child(4)) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.stat-top .stat-label { margin-bottom: 0; }
.stat-top > .icon { width: 20px; height: 20px; min-width: 20px; color: var(--icon-muted, #6a7f70); }
.stat-label { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; color: var(--muted); font-size: 16px; }
.stat-label .icon { color: var(--icon-muted, #87998e); }
.stat-value { display: block; margin-bottom: 8px; color: var(--text); font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -.7px; font-variant-numeric: tabular-nums; }
.stat-unit { display: inline-block; margin-left: 8px; color: var(--muted); font-size: 16px; font-weight: 400; letter-spacing: 0; }
.stat-trend { display: flex; align-items: center; gap: 4px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.stat-trend .icon { width: 13px; height: 13px; min-width: 13px; }
.stat-card > .muted { display: block; margin-top: 8px; font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.filters .field { flex: 1 1 160px; }
.filters .field:first-child { flex-grow: 1.5; }
.filters .btn { flex-shrink: 0; }
.list-panel > .filters { margin-bottom: 0; padding: 20px 24px; border-bottom: 1px solid var(--border-subtle, #e6ece8); }
.list-panel > .tabs { margin-bottom: 0; padding: 0 24px; }
.list-panel > .trip-grid { padding: 24px; }
.search-field { position: relative; }
.search-field > .icon { position: absolute; top: 14px; left: 14px; width: 20px; height: 20px; min-width: 20px; color: var(--icon-muted, #708779); pointer-events: none; }
.search-field .input { padding-left: 40px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: var(--space-2); }
.field-label { display: block; color: var(--text); font-size: 16px; font-weight: 600; }
.input, .select, .textarea { display: block; width: 100%; min-width: 0; min-height: var(--control-height); padding: 11px 15px; border: 1px solid var(--field-border, #d5ded8); border-radius: 8px; background: var(--surface); color: var(--text); font-size: var(--text-body); line-height: var(--line-body); transition: border-color .15s, box-shadow .15s; }
.input::placeholder, .textarea::placeholder { color: #6e7b73; opacity: 1; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--border-strong, #a6bbaf); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgb(30 103 76 / 7%); outline: 2px solid transparent; }
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--red); }
.select { padding-right: 28px; }
.textarea { min-height: 110px; resize: vertical; }
.field-error { color: var(--red); font-size: 14px; }
.field-hint { color: var(--muted); font-size: 14px; }
input[type="checkbox"], input[type="radio"] { width: 17px; height: 17px; margin: 0; accent-color: var(--green); vertical-align: middle; }
.check-label { display: flex; align-items: flex-start; gap: 12px; font-size: 16px; }
.check-label input { flex-shrink: 0; margin-top: 3px; }
.table-wrap { max-width: 100%; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--border-strong, #c6d3ca) transparent; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 16px; }
.data-table th { padding: 16px 20px; border-bottom: 1px solid var(--border); background: var(--surface-subtle, #fafbfa); color: var(--muted); font-size: 14px; font-weight: 600; white-space: nowrap; }
.data-table td { padding: 20px; border-bottom: 1px solid var(--border-subtle, #e9eeeb); vertical-align: middle; }
.data-table td > small { display: block; margin-top: 8px; font-size: 14px; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .15s; }
.data-table tbody tr:hover { background: var(--surface-hover, #f8faf8); }
.data-table tbody tr[data-trip], .data-table tbody tr[data-id] { cursor: pointer; }
.data-table .money { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.numeric { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.data-table .muted { font-size: 14px; }
.data-table .selected-row, .data-table .selected-row:hover { background: var(--green-soft); }
.data-table .selected-row td:first-child { box-shadow: inset 3px 0 var(--green); }
.route-cell { min-width: 200px; }
.route-primary { display: block; margin-bottom: 8px; color: var(--text); font-size: 16px; font-weight: 600; }
.route-primary .icon { width: 13px; height: 13px; min-width: 13px; margin: 0 4px; color: var(--icon-muted, #788b7e); }
.route-secondary { display: block; color: var(--muted); font-size: 14px; }
.status { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 8px 12px; border-radius: 5px; font-size: 14px; font-weight: 600; line-height: 1.4; white-space: nowrap; }
.status::before { content: ""; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.status-dot { display: inline-block; width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.status:has(.status-dot)::before { display: none; }
.status .icon { width: 12px; height: 12px; min-width: 12px; }
.status:has(.icon)::before { display: none; }
.status-green { background: var(--green-soft); color: var(--green); }
.status-amber { background: var(--amber-soft); color: var(--amber); }
.status-blue { background: var(--blue-soft); color: var(--blue); }
.status-gray { background: var(--neutral-soft, #eef1ef); color: var(--neutral-text, #536259); }
.status-red { background: var(--red-soft); color: var(--red); }
.tabs { display: flex; gap: 24px; max-width: 100%; margin-bottom: 24px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { position: relative; flex-shrink: 0; min-height: 52px; margin-bottom: -1px; padding: 16px 8px 16px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); font-size: 16px; white-space: nowrap; }
.tab:hover { color: var(--green); }
.tab.active, .tab[aria-selected="true"] { border-bottom-color: var(--green); color: var(--green); font-weight: 600; }
.tab .chip { margin-left: 8px; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 26px; padding: 3px 8px; border-radius: 5px; background: var(--surface-subtle, #f1f3f2); color: var(--muted); font-size: 14px; line-height: 1.5; }
.chip .icon { width: 12px; height: 12px; min-width: 12px; }

/* Trip cards and the three role-specific detail views. */
.trip-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.trip-card { min-width: 0; overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.trip-card:hover { border-color: var(--border-strong, #b2c6b9); box-shadow: var(--shadow); }
.trip-card-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 24px 24px 0; color: var(--muted); font-size: 14px; }
.trip-card-route { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding: 20px 24px 12px; color: var(--text); font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -.3px; }
.trip-card-route .icon { width: 18px; height: 18px; color: var(--icon-muted, #80978a); }
.trip-card-cargo { padding: 0 24px 16px; font-size: 16px; color: var(--muted); }
.trip-card-route .route-dots::before { display: none; }
.trip-card-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 4px 24px 24px; color: var(--muted); font-size: 16px; }
.trip-card-meta > span, .trip-card-meta > div { display: flex; align-items: center; gap: 8px; min-width: 0; }
.trip-card-meta .icon { width: 16px; height: 16px; min-width: 16px; color: var(--icon-muted, #7b8c82); }
.trip-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px; border-top: 1px solid var(--border-subtle, #e6ece8); background: var(--surface); }
.trip-card-footer strong { display: block; font-size: 20px; line-height: 1.3; letter-spacing: -.35px; font-variant-numeric: tabular-nums; }
.trip-card-footer .muted { display: block; margin-top: 4px; font-size: 14px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(260px, 1fr); align-items: start; gap: 24px; }
.detail-main, .detail-aside { min-width: 0; }
.detail-aside .panel { margin-bottom: 20px; }
.price-big { margin: 8px 0 12px; color: var(--green-dark); font-size: 32px; font-weight: 700; letter-spacing: -.8px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.detail-aside .btn { width: 100%; margin-top: 12px; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 32px; }
.info-item { min-width: 0; }
.info-label { display: block; margin-bottom: 8px; color: var(--muted); font-size: 14px; }
.info-value { display: block; font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.info-value strong { font-weight: 600; }
.info-value small { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.heading-arrow { padding: 0 4px; color: var(--icon-muted, #7b9988); font-weight: 400; }
.back-link { min-height: 48px; margin: -8px 0 16px -8px; padding: 12px 8px; font-size: 16px; }
.price-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 20px; }
.price-actions .btn { width: 100%; margin: 0; }
.price-actions + .alert { margin-top: 20px; }
.price-medium { display: block; margin-bottom: 12px; color: var(--green-dark); font-size: 24px; font-weight: 700; letter-spacing: -.6px; }
.current-step { margin-bottom: 28px; padding: 24px; border: 1px solid var(--border); border-left: 3px solid var(--green); border-radius: 8px; background: var(--surface); }
.current-step .eyebrow { margin-bottom: 12px; font-size: 14px; }
.current-step h2 { margin-bottom: 16px; font-size: 20px; }
.current-step .page-actions { flex-shrink: 1; }
.check-field { display: flex; align-items: flex-start; gap: 12px; margin: 24px 0 20px; font-size: 16px; }
.check-field input { margin-top: 2px; flex-shrink: 0; }
.current-step .check-field { width: 100%; margin: 0 0 8px; }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline-item { position: relative; display: flex; gap: 16px; padding-bottom: 24px; }
.timeline-item::before { content: ""; position: absolute; top: 24px; bottom: 0; left: 10px; width: 1px; background: var(--border-subtle, #dce6df); }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item:last-child::before { display: none; }
.timeline-dot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 21px; height: 21px; flex-shrink: 0; margin-top: 2px; border: 1px solid var(--border-strong, #c9d6cd); border-radius: 50%; background: var(--surface); color: var(--icon-muted, #6c8275); font-size: 14px; }
.timeline-dot .icon { width: 12px; height: 12px; min-width: 12px; }
.timeline-item.complete .timeline-dot { border-color: var(--green); background: var(--green-solid, var(--green)); color: white; }
.timeline-item.active .timeline-dot { border: 6px solid var(--green); background: var(--surface); box-shadow: 0 0 0 4px var(--green-soft); }
.timeline-item.active .timeline-dot .icon { display: none; }
.timeline-item.current .timeline-dot { border-color: var(--green); background: var(--green-soft); color: var(--green); font-weight: 600; box-shadow: 0 0 0 3px var(--green-soft, #f1f6f3); }
.timeline-content { flex: 1; min-width: 0; padding-top: 1px; }
.timeline-content h3 { margin-bottom: 4px; font-size: 16px; font-weight: 600; }
.timeline-content > strong { display: block; margin-bottom: 4px; font-size: 16px; font-weight: 600; }
.timeline-content > .muted { display: block; margin-bottom: 0; font-size: 14px; }
.timeline-content p, .timeline-content .muted { margin-bottom: 12px; font-size: 14px; }
.timeline-content .btn { margin-top: 4px; }
.timeline-content .file-list { margin-top: 16px; }
.map-panel { position: relative; min-height: 270px; overflow: hidden; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-subtle, #f1f3f5); }
.panel > .map-panel { border-right: 0; border-left: 0; border-radius: 0; }
.map-svg { display: block; width: 100%; height: 290px; }
.map-caption { position: absolute; right: 14px; bottom: 14px; left: 14px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 12px; padding: 12px 16px; border: 1px solid var(--green-border, #dbe5de); border-radius: 8px; background: var(--surface-translucent, rgb(255 255 255 / 97%)); font-size: 14px; }
.map-caption strong { display: block; color: var(--text); font-size: 14px; }
.map-caption .muted { font-size: 14px; }
.map-label { fill: var(--muted, #54675b); font-family: Arial, sans-serif; font-size: 14px; }
.live-dot { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); vertical-align: middle; }
.alert { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 20px; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-subtle, #fafbfa); color: var(--text); font-size: 16px; line-height: 1.5; }
.alert > .icon { margin-top: 2px; flex-shrink: 0; }
.alert p { margin: 0; }
.alert strong { display: block; margin-bottom: 4px; font-size: 16px; }
.alert-warning { border-color: var(--amber-border, #ecd8b8); background: var(--amber-soft); color: var(--amber, #795119); }
.alert-error { border-color: var(--red-border, #ecd0ca); background: var(--red-soft); color: var(--red); }
.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 260px; padding: 40px 24px; text-align: center; }
.empty-state > .icon { width: 36px; height: 36px; margin-bottom: 20px; color: var(--icon-muted, #839c8d); stroke-width: 1.25; }
.empty-state h2, .empty-state h3 { margin-bottom: 8px; font-size: 18px; }
.empty-state p { max-width: 400px; margin-bottom: 20px; color: var(--muted); font-size: 16px; }

/* Full-page forms, registration, documents. */
.stepper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 28px; border-bottom: 1px solid var(--border); }
.step { position: relative; display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 16px 4px 20px; color: var(--muted); font-size: 16px; }
.step > span:first-child, .step-number { display: flex; align-items: center; justify-content: center; width: 27px; height: 27px; flex-shrink: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--muted); font-size: 14px; }
.step.active { color: var(--green); font-weight: 600; }
.step.active::after { content: ""; position: absolute; right: 16px; bottom: -1px; left: 0; height: 2px; background: var(--green); }
.step.active > span:first-child, .step.active .step-number { border-color: var(--green); background: var(--green-solid, var(--green)); color: white; }
.step.complete { color: var(--green); }
.step.complete > span:first-child, .step.complete .step-number { border-color: var(--green-border, #cee2d4); background: var(--green-soft); color: var(--green); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.form-grid .full-width, .form-grid .span-2 { grid-column: 1 / -1; }
.form-section { margin-bottom: 28px; }
.form-section h2 { margin-bottom: 20px; font-size: 18px; }
.form-section > p { color: var(--muted); font-size: 16px; }
.form-actions { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.wizard-layout { max-width: 920px; }
.wizard-panel .form-actions { margin-top: 0; padding: 20px 24px; background: var(--surface-subtle, #fcfdfc); }
.wizard-panel .panel-body { padding: 28px; }
.wizard-panel h2 { margin-bottom: 12px; }
.wizard-panel h2 + p { margin-bottom: 24px; font-size: 16px; }
.wizard-layout > .form-hint { display: flex; align-items: center; gap: 8px; }
.wizard-layout > .form-hint .icon { width: 14px; height: 14px; min-width: 14px; }
.price-choice { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.price-option { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface); cursor: pointer; }
.price-option:hover { border-color: var(--border-strong, #a5c0af); }
.price-option.selected { border-color: var(--green); background: var(--surface-subtle, #fafcfb); box-shadow: inset 0 0 0 1px var(--green); }
.price-option > input { position: absolute; top: 18px; right: 18px; }
.price-option > .icon { width: 24px; height: 24px; margin-bottom: 4px; color: var(--green); }
.price-option > strong { font-size: 16px; }
.price-option > span { color: var(--muted); font-size: 14px; }
.estimate-panel { display: flex; align-items: center; gap: 24px; margin-bottom: 24px; padding: 24px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface-subtle, #fafbfa); }
.estimate-panel > div { flex: 1; min-width: 0; }
.estimate-panel strong { display: block; color: var(--green-dark); font-size: 20px; font-weight: 600; }
.estimate-panel p { flex: 1; margin-bottom: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.summary-list { margin: 0; }
.summary-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; padding: 16px 0; border-bottom: 1px solid var(--border-subtle, #e9eeeb); font-size: 16px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row > :first-child { color: var(--muted); }
.summary-row > :last-child { margin: 0; text-align: right; }
.summary-row.total { margin-top: 8px; border-top: 1px solid var(--border); font-size: 16px; }
.summary-row.total > :last-child { color: var(--green); font-weight: 700; }
.auth-page { min-height: 100vh; padding: 24px; }
.auth-page > .brand { margin: 0 0 32px; }
.auth-card { width: 100%; max-width: 560px; margin: 24px auto; padding: 36px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.auth-card h1 { margin-bottom: 12px; font-size: 28px; }
.auth-card > p { color: var(--muted); font-size: 16px; }
.auth-card .form-grid { margin-top: 24px; }
.auth-card .form-section { margin-top: 24px; }
.auth-card .file-row { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 12px; }
.auth-card .file-row .file-input { grid-column: 1 / -1; width: 100%; }
.auth-card .btn-primary { width: 100%; margin-top: 24px; }
.file-list { display: flex; flex-direction: column; gap: 12px; }
.file-row { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 16px; border: 1px solid var(--border-subtle, #e0e7e2); border-radius: 8px; background: var(--surface); font-size: 16px; }
.file-row > .icon { width: 22px; height: 22px; color: var(--green); }
.file-row > div { min-width: 0; flex: 1; }
.file-row strong { display: block; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.file-row .muted { display: block; margin-top: 4px; font-size: 14px; }
.file-row .btn { margin-left: auto; }
.document-preview { display: flex; align-items: center; justify-content: center; min-height: 160px; padding: 24px; border: 1px dashed var(--border-strong, #bdcfc2); border-radius: 8px; background: var(--surface-subtle, #fafbfa); color: var(--muted); text-align: center; font-size: 16px; }
.document-preview .icon { width: 36px; height: 36px; color: var(--icon-muted, #779783); }
.rating-bar { height: 6px; margin: 8px 0 16px; overflow: hidden; border-radius: 3px; background: var(--neutral-soft, #e6ede8); }
.rating-bar > span, .rating-bar > div { display: block; height: 100%; border-radius: inherit; background: var(--green); }
.rating-score { margin-bottom: 3px; font-variant-numeric: tabular-nums; }
.rating-score strong { color: var(--green-dark); font-size: 48px; line-height: 1.3; font-weight: 700; letter-spacing: -2px; }
.rating-score span { font-size: 16px; }
.person-cell { display: flex; align-items: center; gap: 12px; }
.person-cell > div { min-width: 0; }
.person-cell .avatar { width: 34px; height: 34px; }
.file-icon { display: flex; align-items: center; justify-content: center; width: 38px; height: 42px; flex-shrink: 0; border: 1px solid var(--border-subtle, #dbe7df); border-radius: 7px; background: var(--surface-subtle, #eef5f0); color: var(--green); }
.file-icon .icon { width: 20px; height: 20px; }
.control-event:last-child .alert { margin-bottom: 0; }
.link-button { min-height: 48px; display: inline-flex; align-items: center; gap: 8px; padding: 4px 0; border: 0; background: transparent; color: var(--green); font-size: 16px; font-weight: 600; }
.link-button:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 3px; }
.divider { height: 1px; margin: 24px 0; border: 0; background: var(--border); }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 4px 8px; border: 1px solid var(--border-subtle, #d7e4db); border-radius: 5px; background: var(--surface-subtle, #f2f7f3); color: var(--green); font-size: 14px; line-height: 1.4; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-top: 24px; font-size: 16px; }
.summary-block { margin-bottom: 24px; padding: 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.summary-block h3 { margin-bottom: 12px; font-size: 16px; }
.summary-block:last-child { margin-bottom: 0; }
.form-hint { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.form-error { display: block; margin-top: 8px; color: var(--red); font-size: 14px; line-height: 1.5; }
.file-input { display: block; max-width: 100%; padding: 16px; border: 1px dashed var(--border-strong, #b8cdbf); border-radius: 8px; background: var(--surface-subtle, #fafbfa); color: var(--muted); font-size: 14px; }
.file-input::file-selector-button { min-height: 48px; margin-right: 12px; padding: 12px; border: 1px solid var(--border-strong, #bfd0c4); border-radius: 6px; background: var(--surface); color: var(--green); font: inherit; cursor: pointer; }
.loading { pointer-events: none; opacity: .65; }
.notification-dot { position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 2px var(--surface); }
.offer-card { margin-bottom: 12px; padding: 20px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); }
.offer-card { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.offer-info { flex: 1; min-width: 120px; }
.offer-info > strong { display: block; margin-bottom: 8px; font-size: 16px; }
.offer-info > .muted { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.offer-info .icon { width: 12px; height: 12px; min-width: 12px; color: var(--amber, #a38746); }
.offer-price { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; }
.offer-price > strong { font-size: 18px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.offer-card > .btn { min-height: 48px; padding: 12px; font-size: 16px; }
.offer-card:last-child { margin-bottom: 0; }
.offer-card.selected { border-color: var(--border-strong, #a9c6b3); background: var(--surface-hover, #f3f8f5); }
.offer-card .person-cell { margin-bottom: 16px; }
.offer-card .price-big { font-size: 24px; }
.welcome-decoration { color: var(--green); }
.welcome-note { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.welcome-note .icon { width: 15px; height: 15px; min-width: 15px; }
.welcome-main > .auth-links { align-items: center; justify-content: center; gap: 16px 28px; margin-top: 24px; color: var(--muted); font-size: 16px; }
.welcome-main > .auth-links .link-button { font-size: 16px; }
.welcome-main > .auth-links .icon { width: 14px; height: 14px; min-width: 14px; }
.public-page { min-height: 100vh; }
.public-content { max-width: 1000px; margin: 0 auto; padding: 40px 24px; }
.public-content .welcome-footer { width: 100%; padding-bottom: 0; }
.public-content .map-svg { height: 380px; }
.modal-open { overflow: hidden; }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 16px; }
.section-title h2 { margin: 0; font-size: 18px; }
.quick-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--green); font-size: 14px; }
.quick-link:hover { background: var(--green-soft); }
.progress-track { height: 5px; overflow: hidden; border-radius: 3px; background: var(--neutral-soft, #e0e9e3); }
.progress-fill { height: 100%; border-radius: inherit; background: var(--green); }
.simulation-popup { position: fixed; z-index: 45; top: var(--header-height); right: 24px; width: 360px; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 30px rgb(24 50 34 / 12%); }
.simulation-popup h3 { margin: 0; padding: 12px; color: var(--muted); font-size: 14px; }
.simulation-popup .panel-header { min-height: 48px; padding: 0 4px; gap: 0; margin-bottom: 4px; }
.simulation-popup .panel-header h3 { font-size: 14px; }
.simulation-popup .panel-header .btn { min-height: 48px; min-width: 48px; padding: 12px; }
.simulation-item > span { flex: 1; min-width: 0; }
.simulation-item strong { display: block; font-size: 16px; font-weight: 600; }
.simulation-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.simulation-item > .icon:last-child { width: 12px; height: 12px; min-width: 12px; color: var(--icon-muted, #88a18e); }
.mobile-table-card { margin-bottom: 12px; padding: 20px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.mobile-table-card:last-child { margin-bottom: 0; }
.mobile-table-card .route-primary { font-size: 16px; }
.mobile-table-card .status { margin-top: 12px; }
.route-dots { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.route-dots::before { content: ""; width: 7px; height: 7px; border: 2px solid var(--green); border-radius: 50%; }
.currency-field { position: relative; }
.currency-field .input { padding-right: 44px; }
.currency-field > span { position: absolute; top: 12px; right: 14px; color: var(--muted); }
.contract-sheet { padding: 32px; border: 1px solid var(--border-subtle, #e5e9e6); background: var(--surface-subtle, #fdfefd); font-size: 16px; line-height: 1.8; }
.contract-sheet h2 { margin-bottom: 24px; text-align: center; font-size: 20px; }
.contract-sheet p { color: var(--text, #46554b); }
.contract-sheet .muted { font-size: 14px; }

/* Transient interactions. */
.modal-backdrop { position: fixed; z-index: 100; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; background: rgb(12 30 20 / 37%); backdrop-filter: blur(3px); }
.modal { width: 100%; max-width: 520px; max-height: calc(100dvh - 48px); overflow-y: auto; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); box-shadow: 0 18px 60px rgb(12 30 20 / 20%); animation: modal-enter .18s ease-out; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 24px 24px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 20px; }
.modal-body { padding: 24px; }
.modal-body .field { margin-bottom: 20px; }
.modal-body > :last-child { margin-bottom: 0; }
.modal-body p { color: var(--muted); font-size: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; padding: 20px 24px; border-top: 1px solid var(--border); }
.toast { position: fixed; z-index: 120; right: 24px; bottom: 24px; display: flex; align-items: center; gap: 12px; max-width: min(460px, calc(100vw - 32px)); padding: 16px 20px; border: 1px solid var(--border-strong, #c0d6c8); border-radius: 10px; background: var(--surface); color: var(--green-dark); box-shadow: 0 6px 25px rgb(16 48 30 / 14%); font-size: 14px; animation: toast-enter .2s ease-out; }
.toast .icon { flex-shrink: 0; color: var(--green); }
.simulation-menu { position: absolute; z-index: 45; top: calc(var(--header-height) - 7px); right: 72px; width: 300px; max-width: calc(100vw - 32px); padding: 8px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); box-shadow: 0 8px 30px rgb(24 50 34 / 12%); }
.simulation-menu > p, .simulation-menu > .muted { margin: 0; padding: 12px 12px 8px; font-size: 14px; }
.simulation-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 54px; padding: 12px; border: 0; border-radius: 6px; background: transparent; color: var(--text); font-size: 16px; text-align: left; }
.simulation-item:hover { background: var(--green-soft); color: var(--green); }
.simulation-item .icon { width: 17px; height: 17px; min-width: 17px; color: var(--green); }
@keyframes modal-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Responsive layouts preserve the same readable type scale. */
@media (min-width: 1440px) {
  .workspace { padding: 32px; }
  .role-card { padding: 28px; }
}

@media (min-width: 1024px) and (max-width: 1199px) {
  .topbar { gap: 16px; }
  .role-button { padding-right: 12px; padding-left: 12px; }
  .workspace { padding: 28px 24px; }
  .split-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 20px; }
  .trip-grid { grid-template-columns: 1fr; }
  .data-table th, .data-table td { padding-right: 16px; padding-left: 16px; }
  .page-header { flex-wrap: wrap; }
}

@media (max-width: 1023px) {
  :root { --header-height: 128px; }
  .welcome-topbar, .welcome-main, .welcome-footer { width: calc(100% - 48px); }
  .welcome-main { padding-top: 40px; }
  .role-grid { grid-template-columns: 1fr; gap: 20px; }
  .role-card { display: flex; min-height: 320px; padding: 28px; }
  .role-card-top { display: flex; width: 100%; }
  .role-card-number { position: static; }
  .role-card-title { padding-right: 0; }
  .role-card-description { max-width: 540px; }
  .role-card-link { width: 100%; max-width: 320px; }
  .app-shell { padding-left: 0; padding-bottom: 96px; }
  .topbar { grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: 48px 56px; gap: 8px 16px; padding: 8px 24px; }
  .topbar .brand { width: auto; }
  .topbar .brand-logo { width: 128px; }
  .topbar-actions { grid-column: 2; grid-row: 1; }
  .role-switch { grid-column: 1 / -1; grid-row: 2; width: 100%; justify-self: stretch; }
  .role-button { flex: 1; }
  .sidebar { display: none; }
  .workspace { padding: 28px 24px; }
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; }
  .mobile-only.trip-grid { display: grid !important; }
  .bottom-nav { position: fixed; z-index: 35; right: 0; bottom: 0; left: 0; display: flex; justify-content: space-around; min-height: 84px; padding: 8px 8px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }
  .bottom-nav .nav-item { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 8px; width: auto; min-width: 0; min-height: 64px; padding: 8px 3px; font-size: 14px; white-space: nowrap; text-align: center; }
  .role-carrier .bottom-nav .nav-item { font-size: 14px; }
  .bottom-nav .nav-item.active, .bottom-nav .nav-item[aria-current="page"] { background: var(--surface); }
  .bottom-nav .nav-item.active::before, .bottom-nav .nav-item[aria-current="page"]::before { inset: -8px 20% auto; width: auto; height: 3px; border-radius: 0 0 2px 2px; }
  .bottom-nav .icon { width: 22px; height: 22px; }
  .toast { bottom: 100px; }
  .app-shell.role-operator { padding-bottom: 0; }
  .app-shell.role-operator .bottom-nav { display: none; }
  .app-shell.role-operator .workspace > .mobile-menu-button { display: inline-flex; margin: -8px 0 16px -8px; padding: 8px; }
  .app-shell.menu-open .sidebar { display: flex; box-shadow: 8px 0 32px rgb(16 48 30 / 12%); }
  .app-shell.menu-open::after { content: ""; position: fixed; z-index: 24; inset: var(--header-height) 0 0; background: rgb(16 40 26 / 12%); }
  .simulation-popup { top: 64px; right: 24px; }
  .split-layout { grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 20px; }
  .page-header { flex-wrap: wrap; gap: 20px; }
  .public-content { padding: 32px 24px; }
}

@media (max-width: 767px) {
  .welcome-topbar, .welcome-main, .welcome-footer { width: calc(100% - 32px); }
  .welcome-topbar { min-height: 88px; gap: 16px; }
  .welcome-topbar .brand-logo { width: 128px; }
  .welcome-topbar .brand-platform { display: none; }
  .welcome-note { max-width: 140px; font-size: 14px; line-height: 1.4; }
  .welcome-note .icon { display: none; }
  .welcome-main { padding: 32px 0; }
  .welcome-eyebrow { margin-bottom: 16px; font-size: 14px; letter-spacing: .6px; text-align: center; }
  .welcome-eyebrow::before { display: none; }
  .welcome-title { margin-bottom: 16px; font-size: 30px; letter-spacing: -.75px; }
  .welcome-description { margin-bottom: 28px; font-size: 16px; }
  .role-grid { gap: 16px; }
  .role-card { display: flex; min-height: 300px; padding: 24px; }
  .role-card-top { display: flex; align-items: flex-start; }
  .role-card-icon { width: 44px; height: 44px; margin-bottom: 20px; }
  .role-card-icon .icon { width: 26px; height: 26px; }
  .role-card-number { position: static; font-size: 14px; }
  .role-card-title { padding-right: 0; margin-bottom: 12px; font-size: 24px; }
  .role-card-description { margin-bottom: 24px; font-size: 16px; line-height: 1.5; }
  .role-card-link { min-height: 48px; padding: 12px 16px; font-size: 16px; }
  .role-card-features { font-size: 14px; }
  .welcome-flow { flex-wrap: wrap; gap: 12px; padding: 16px 0; font-size: 14px; }
  .welcome-flow .icon { width: 16px; height: 16px; min-width: 16px; }
  .welcome-main > .auth-links { flex-direction: column; align-items: center; gap: 16px; margin-top: 24px; font-size: 14px; text-align: center; }
  .welcome-main > .auth-links .link-button { font-size: 16px; }
  .welcome-footer { justify-content: center; gap: 12px; padding: 24px 0; font-size: 14px; text-align: center; }
  .welcome-footer > span { width: 100%; }
  .topbar { padding: 8px 16px; gap: 8px 12px; }
  .topbar .brand { width: auto; }
  .topbar .brand-logo { width: 128px; }
  .topbar .brand-platform { display: none; }
  .topbar-actions { gap: 8px; }
  .topbar-actions .avatar { display: none; }
  .topbar-actions .btn { min-height: 48px; padding: 12px; font-size: 16px; }
  .topbar-actions .btn .icon { width: 18px; height: 18px; min-width: 18px; }
  .role-button { min-height: 48px; padding: 12px 8px; font-size: 16px; }
  .role-button .icon { display: none; }
  .workspace { padding: 24px 16px; }
  .page-header { gap: 20px; margin-bottom: 24px; }
  .page-header h1 { margin-bottom: 12px; font-size: 26px; line-height: 1.3; }
  .page-header .eyebrow { margin-bottom: 12px; font-size: 14px; letter-spacing: .5px; }
  .page-description { font-size: 16px; }
  .page-actions { width: 100%; padding: 0; gap: 12px; }
  .page-actions .btn-primary { width: 100%; }
  .workspace-footer { flex-wrap: wrap; gap: 8px; margin-top: 28px; font-size: 14px; }
  .stats-grid, .stats-grid:has(.stat-card:nth-child(4)) { grid-template-columns: 1fr; gap: 12px; margin-bottom: 24px; }
  .stat-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; min-height: 96px; padding: 20px; }
  .stat-top { grid-column: 1; margin-bottom: 0; align-self: end; }
  .stat-top > .icon { display: none; }
  .stat-label { grid-column: 1; margin-bottom: 0; font-size: 16px; }
  .stat-value { grid-column: 2; grid-row: 1 / 3; align-self: center; margin: 0; font-size: 26px; line-height: 1.3; }
  .stat-unit { margin-left: 8px; font-size: 16px; }
  .stat-trend, .stat-card > .muted { grid-column: 1; margin-top: 0; font-size: 14px; }
  .trip-stats.stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); overflow: hidden; }
  .trip-stats .stat-card { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; min-height: 112px; padding: 16px 8px; border: 0; border-right: 1px solid var(--border); border-radius: 0; text-align: center; }
  .trip-stats .stat-card:last-child { border-right: 0; }
  .trip-stats .stat-value { order: 1; margin: 0; font-size: 24px; line-height: 1.3; }
  .trip-stats .stat-top { display: block; order: 2; width: 100%; margin: 0; }
  .trip-stats .stat-label { display: block; margin: 0; font-size: 14px; line-height: 1.4; }
  .trip-stats .stat-trend, .trip-stats .stat-unit, .trip-stats .stat-top > .icon { display: none; }
  .panel { margin-bottom: 24px; }
  .panel-header { align-items: flex-start; min-height: 72px; padding: 20px; gap: 12px; }
  .panel-header h2, .panel-header h3 { font-size: 20px; }
  .panel-header > .muted { flex-basis: 100%; font-size: 14px; }
  .panel-header > div > .muted { display: block; margin-top: 8px; font-size: 14px; }
  .panel-header > strong { font-size: 16px; }
  .panel-body { padding: 20px; }
  .filters { gap: 16px; }
  .filters .field, .filters .field:first-child { flex: 1 1 100%; }
  .list-panel > .filters { padding: 20px; }
  .list-panel > .tabs { padding: 0 20px; }
  .list-panel > .trip-grid { padding: 20px; }
  .search-field > .icon { top: 14px; left: 14px; }
  .search-field .input { padding-left: 40px; }
  .input, .select, .textarea { min-height: 48px; font-size: 16px; }
  .trip-grid { grid-template-columns: 1fr; gap: 16px; }
  .trip-card-top { padding: 20px 20px 0; }
  .trip-card-route { padding: 20px 20px 12px; gap: 8px; font-size: 22px; }
  .trip-card-cargo { padding: 0 20px 16px; font-size: 16px; }
  .trip-card-meta { grid-template-columns: 1fr; gap: 12px; padding: 0 20px 20px; font-size: 16px; }
  .trip-card-meta .icon { width: 18px; height: 18px; min-width: 18px; }
  .trip-card-footer { flex-wrap: wrap; align-items: center; gap: 12px; padding: 20px 20px; }
  .trip-card-footer strong { font-size: 22px; }
  .trip-card-footer .btn { min-height: 48px; padding: 12px 8px; font-size: 16px; }
  .split-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .role-client .split-layout:has(> .detail-main > .panel > .map-panel) { display: flex; flex-direction: column; align-items: stretch; }
  .role-client .split-layout:has(> .detail-main > .panel > .map-panel) > .detail-main,
  .role-client .split-layout:has(> .detail-main > .panel > .map-panel) > .detail-aside { display: contents; }
  .role-client .split-layout:has(> .detail-main > .panel > .map-panel) > .detail-aside > .panel:first-child { order: -1; }
  .role-client .split-layout:has(> .detail-main > .panel > .map-panel) > .detail-aside > .panel:nth-child(2) { order: 2; }
  .detail-aside .panel { margin-bottom: 24px; }
  .price-big { font-size: 30px; }
  .price-medium { font-size: 24px; }
  .info-grid { grid-template-columns: 1fr; gap: 20px; }
  .info-label { font-size: 14px; }
  .info-value { font-size: 16px; }
  .info-value small { font-size: 14px; }
  .tabs { gap: 16px; margin-bottom: 24px; }
  .tab { min-height: 52px; padding: 16px 8px 16px; font-size: 16px; }
  .back-link { min-height: 48px; margin-bottom: 20px; font-size: 16px; }
  .map-panel { min-height: 280px; }
  .map-svg { height: 280px; }
  .map-svg text { font-size: 28px; }
  .map-caption { right: 10px; bottom: 10px; left: 10px; gap: 8px; padding: 12px; font-size: 14px; }
  .map-caption .icon { width: 18px; height: 18px; min-width: 18px; }
  .map-caption strong, .map-caption .muted { font-size: 14px; }
  .stepper { margin-bottom: 24px; }
  .step { flex-direction: column; align-items: flex-start; gap: 12px; min-height: 100px; padding: 12px 8px 16px 0; font-size: 14px; line-height: 1.5; }
  .step.active::after { right: 10px; }
  .form-grid { grid-template-columns: 1fr; gap: 20px; }
  .form-section { margin-bottom: 24px; }
  .form-section h2 { margin-bottom: 20px; font-size: 20px; }
  .form-actions { margin-top: 24px; padding-top: 20px; gap: 12px; }
  .form-actions .btn { min-height: 48px; font-size: 16px; }
  .wizard-panel .panel-body { padding: 24px 20px; }
  .wizard-panel .form-actions { padding: 20px; }
  .wizard-layout > .form-hint { align-items: flex-start; font-size: 14px; }
  .wizard-layout > .form-hint .icon { margin-top: 4px; }
  .price-choice { grid-template-columns: 1fr; gap: 16px; }
  .price-option { padding: 20px; gap: 12px; }
  .estimate-panel { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px; }
  .estimate-panel strong { font-size: 22px; }
  .estimate-panel p { font-size: 14px; }
  .summary-block { padding: 20px; }
  .summary-row { flex-wrap: wrap; gap: 8px 16px; padding: 16px 0; font-size: 16px; }
  .current-step { padding: 20px; }
  .current-step .page-actions .btn { width: 100%; }
  .alert { padding: 20px; font-size: 16px; }
  .alert strong { font-size: 16px; }
  .file-row { flex-wrap: wrap; gap: 12px; padding: 16px; }
  .file-row strong { font-size: 16px; }
  .file-row .muted { font-size: 14px; }
  .file-row .btn { min-height: 48px; padding: 12px; font-size: 16px; }
  .auth-page { padding: 0 16px 24px; }
  .auth-page .welcome-topbar { width: 100%; gap: 12px; }
  .auth-page .welcome-topbar .btn { font-size: 14px; }
  .auth-card { padding: 28px 20px; margin: 24px auto; }
  .auth-card h1 { font-size: 26px; }
  .auth-card .file-row .file-input { font-size: 14px; }
  .contract-sheet { padding: 20px; font-size: 16px; }
  .contract-sheet h2 { font-size: 20px; }
  .public-content { padding: 28px 16px; }
  .public-content .map-svg { height: 280px; }
  .public-content .welcome-footer { justify-content: flex-start; text-align: left; }
  .simulation-popup { top: 64px; right: 16px; width: 328px; }
  .simulation-item strong { font-size: 16px; }
  .simulation-item small { font-size: 14px; }
  .modal-backdrop { align-items: center; padding: 16px; }
  .modal { max-height: calc(100dvh - 32px); border-radius: 12px; }
  .modal-header { padding: 20px; }
  .modal-header h2 { font-size: 22px; }
  .modal-body { padding: 20px; }
  .modal-footer { flex-wrap: wrap; padding: 20px; gap: 12px; }
  .modal-footer .btn { min-height: 48px; padding: 12px; font-size: 16px; }
  .toast { right: 16px; bottom: 100px; left: 16px; max-width: none; padding: 16px; font-size: 16px; }
  .data-table { min-width: 760px; }
}

@media (max-width: 374px) {
  .topbar .brand-logo { width: 128px; }
  .topbar-actions .btn { padding: 12px; }
  .welcome-note { max-width: 124px; }
}

.work-history-wrap { container: work-history / inline-size; }
.secondary-table-wrap { container: secondary-table / inline-size; }
.work-history-table, .secondary-table-wrap .responsive-table { min-width: 0; width: 100%; }
@container work-history (max-width: 640px) {
  .responsive-table { display: block; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .responsive-table tbody { display: grid; gap: 16px; padding: 16px; }
  .responsive-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .responsive-table td { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; font-size: 16px; line-height: 24px; }
  .responsive-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 14px; line-height: 20px; font-weight: 400; }
  .responsive-table td:first-child, .responsive-table td.cell-actions { grid-column: 1 / -1; }
  .responsive-table td .status { white-space: normal; }
}

@container secondary-table (max-width: 800px) {
  .responsive-table { display: block; }
  .responsive-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .responsive-table tbody { display: grid; gap: 16px; padding: 16px; }
  .responsive-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
  .responsive-table td { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; font-size: 16px; line-height: 24px; }
  .responsive-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 14px; line-height: 20px; font-weight: 400; }
  .responsive-table td:first-child, .responsive-table td.cell-actions { grid-column: 1 / -1; }
  .responsive-table td .status { white-space: normal; }
  .responsive-table .selected-row { border-color: var(--green); }
  .responsive-table .selected-row td:first-child { box-shadow: none; }
  .responsive-table td.cell-actions::before { display: none; }
  .role-operator .secondary-table-wrap .responsive-table td:last-child { position: static; box-shadow: none; background: transparent; }
}

/* The carrier board keeps its first route and response action within a phone
   viewport. This scope excludes trip history and other role workspaces. */
@media (max-width: 600px) {
  .role-carrier .workspace:has(> .list-panel [data-filter="date"]) .page-description { display: none; }
  .role-carrier .workspace:has(> .list-panel [data-filter="date"]) .page-header { margin-bottom: 12px; }
  .role-carrier .list-panel:has([data-filter="date"]) > .panel-header { display: none; }
  .role-carrier .list-panel:has([data-filter="date"]) > .list-filters { grid-template-columns: minmax(0, 1fr); align-items: end; gap: 12px; }
  .role-carrier .list-panel:has([data-filter="date"]) > .list-filters > .field { grid-column: auto; min-width: 0; }
  .role-carrier .list-panel:has([data-filter="date"]) .field:has([data-filter="date"]) { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
  .role-carrier .list-panel:has([data-filter="date"]) .list-filters .input { min-width: 0; }
  .role-carrier .list-panel:has([data-filter="date"]) .trip-card-top { padding: 12px 16px 0; }
  .role-carrier .list-panel:has([data-filter="date"]) .trip-card-route { padding: 12px 16px 8px; }
  .role-carrier .list-panel:has([data-filter="date"]) .trip-card-cargo { padding: 0 16px 12px; }
  .role-carrier .list-panel:has([data-filter="date"]) .trip-card-meta { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 0 16px 12px; }
  .role-carrier .list-panel:has([data-filter="date"]) .trip-card-footer { flex-wrap: nowrap; gap: 12px; padding: 12px 16px; }
  .role-carrier .list-panel:has([data-filter="date"]) .trip-card-footer > div { flex: 1 1 0; min-width: 0; }
  .role-carrier .list-panel:has([data-filter="date"]) .trip-card-footer strong { font-size: 20px; overflow-wrap: anywhere; }
  .role-carrier .list-panel:has([data-filter="date"]) .trip-card-footer .btn { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition: none !important; }
  .btn:active:not(:disabled) { transform: none; }
}

@media print {
  .topbar, .sidebar, .bottom-nav, .page-actions, .simulation-popup, .toast { display: none !important; }
  .app-shell { padding: 0; }
  .workspace { padding: 0; }
  body { background: var(--surface); }
  .panel { box-shadow: none; break-inside: avoid; }
}
