/* Shared rhythm and interaction rules. The audit grid is never loaded here. */
:root { --header-height: 72px; }
/* Workspace identity lives only in the sidebar footer. */
.topbar { grid-template-columns: minmax(156px, 1fr) auto; grid-template-rows: 1fr; gap: 24px; padding: 0 24px; }
.topbar .brand { width: auto; min-height: 48px; justify-self: start; }

/* Keep operational explanations readable instead of styling them as footnotes. */
:is(.onboard-note, .alert:not(.alert-warning):not(.alert-error)) {
  padding: 16px;
  gap: 12px;
  border: 1px solid var(--notice-border, #a5bfd0);
  border-inline-start: 4px solid var(--blue);
  background: var(--blue-soft);
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
}
:is(.onboard-note, .alert:not(.alert-warning):not(.alert-error)) > .icon { color: var(--blue); }
:is(.onboard-note, .alert:not(.alert-warning):not(.alert-error)) :is(p, .muted) { color: var(--text); font-size: inherit; line-height: inherit; }
.topbar-actions { grid-column: 2; grid-row: 1; gap: 12px; }
.header-search { display: flex; align-items: center; gap: 12px; min-height: 48px; width: 320px; padding: 11px 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); color: var(--muted); cursor: pointer; font: inherit; text-align: left; }
.header-search kbd { margin-left: auto; white-space: nowrap; }
.header-search:hover { border-color: var(--green); background: var(--surface); }
kbd { display: inline-block; border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: var(--surface-subtle, #f5f7f6); color: var(--muted); font: 14px/20px Arial, sans-serif; }
.topbar-actions .header-shortcuts, .topbar-actions .header-menu { width: 48px; padding: 11px; }
.topbar-actions .header-menu { display: none; }
.sidebar { overflow-y: auto; }
.sidebar nav { margin-bottom: 24px; }
.sidebar-footer { gap: 8px; padding: 16px 0 0; }
.sidebar-identity { width: 100%; min-height: 64px; padding: 8px; border: 0; border-radius: 8px; background: transparent; color: var(--text); text-align: left; cursor: pointer; }
.sidebar-identity:hover { background: var(--green-light); }
.sidebar-identity-text { min-width: 0; overflow-wrap: anywhere; }
.sidebar-identity-text > span { display: block; color: var(--muted); }
.sidebar-footer .btn { padding: 11px 8px; }
.sidebar-dismiss { display: none; }
.staff-entry-content { max-width: 1120px; padding: 32px; margin: 0 auto; }
.command-dialog { width: min(680px, 100%); max-width: 680px; }
.command-dialog .modal-body { padding: 16px 24px; }
.command-search-field { margin-bottom: 16px; }
.command-group + .command-group { margin-top: 16px; }
.command-group h3 { color: var(--muted); font-size: 14px; line-height: 20px; margin: 0 8px 8px; }
.command-item { display: flex; align-items: center; width: 100%; gap: 16px; padding: 12px 8px; border: 0; border-radius: 8px; background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.command-item:hover, .command-item:focus-visible { background: var(--green-soft, #eaf3ee); }
.command-item > span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.command-item strong { display: block; font-size: 16px; line-height: 24px; font-weight: 600; }
.command-item small { display: block; color: var(--muted); font-size: 14px; line-height: 20px; margin-top: 4px; }
.command-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: 0 0 40px; border: 1px solid var(--border); border-radius: 8px; color: var(--green); }
.command-empty { padding: 24px 8px; }
.command-empty p { color: var(--muted); margin-top: 8px; }
.command-key-hint { color: var(--muted); font-size: 14px; line-height: 24px; margin-right: auto; }
.shortcut-list { margin: 0; }
.shortcut-list > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.shortcut-list > div:last-child { border: 0; }
.shortcut-list dd { margin: 0; white-space: nowrap; }
.file-row { flex-wrap: wrap; }
.skip-link { position: fixed; z-index: 200; top: 8px; left: 16px; transform: translateY(-150%); padding: 12px 16px; border-radius: 8px; background: var(--green-solid-dark, var(--green-dark)); color: white; }
.skip-link:focus { transform: translateY(0); }
.input:focus-visible, .select:focus-visible, .textarea:focus-visible, summary:focus-visible { outline: 3px solid var(--green); outline-offset: 3px; }
.input::placeholder, .textarea::placeholder, .heading-arrow { color: var(--muted); }
.timeline-dot { color: var(--green); }
.welcome-title { line-height: 48px; }
.welcome-description { line-height: 28px; }
.role-card-title { line-height: 32px; }
.eyebrow, .muted, .info-label, .form-hint, .stat-trend, .role-card-features, .workspace-footer, .sidebar-footer, .sidebar-label, .status, .tracking-map-eyebrow, .tracking-connection { line-height: 20px; }
.page-description, p.muted { line-height: 24px; }
.btn, .btn-small, .topbar-actions .btn, .modal-footer .btn, .file-row .btn, .trip-card-footer .btn, .role-card-link { min-height: 48px; padding-top: 11px; padding-bottom: 11px; line-height: 24px; }
.btn-icon { padding: 11px; }
.btn-small { font-size: 14px; }
.stat-value { line-height: 40px; }
.role-button { padding-top: 12px; padding-bottom: 12px; line-height: 24px; }
.tracking-map-toolbar strong { line-height: 24px; }
.tracking-connection { padding: 7px 11px; }
.tracking-map .leaflet-popup-content { line-height: 20px; }
.tracking-map .leaflet-popup-close-button { width: 48px; height: 48px; line-height: 48px; }
.tracking-map .leaflet-popup-content { margin-right: 48px; }
.incident-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.trip-timeline-details { margin-top: 16px; border-top: 1px solid var(--border); }
.trip-timeline-details > summary { min-height: 48px; padding: 12px 0; color: var(--green-dark); font-weight: 600; cursor: pointer; }
.trip-timeline-details .timeline { margin-top: 16px; }
.carrier-working-layout .current-step { padding: 0 0 16px; border: 0; background: transparent; }
.carrier-working-layout .current-step .eyebrow { margin-bottom: 8px; }
.carrier-working-layout .current-step h2 { margin-bottom: 16px; }
.wizard-panel { overflow: visible; }
.wizard-panel .panel-body { padding: 24px; }
.wizard-panel .form-actions { position: sticky; z-index: 12; bottom: 0; padding: 16px 24px; background: var(--surface); border-radius: 0 0 12px 12px; box-shadow: 0 -4px 16px rgb(23 34 29 / 5%); }
#request-form { scroll-margin-bottom: 100px; }
.modal { display: flex; flex-direction: column; overflow: hidden; }
.modal-header, .modal-footer { flex-shrink: 0; }
#modal-form { display: flex; flex-direction: column; min-height: 0; }
.modal-body { overflow-y: auto; overscroll-behavior: contain; }
.modal-footer { background: var(--surface); }
.toast { pointer-events: none; }
body:has(.onboarding-page) .toast, body:has(#request-form) .toast { top: calc(var(--header-height) + 16px); bottom: auto; }
.company-document-list { display: grid; gap: 12px; }
.page-header, .form-grid, .info-grid { gap: 24px; }
.page-actions { padding-top: 0; }
.role-card { padding: 32px; }
.panel-body { padding: 24px; }
.panel-header { padding: 16px 24px; }
.list-panel > .filters { padding: 16px 24px; }
.stat-card { padding: 24px; }
.trip-card-top, .trip-card-footer { padding: 16px 24px; }
.trip-card-footer { flex-wrap: wrap; gap: 12px; }
.trip-card-footer > div { flex: 1 1 140px; }
.role-carrier .trip-card { display: flex; flex-direction: column; }
.role-carrier .trip-card-footer { margin-top: auto; }
.modal-body .field { margin-bottom: 24px; }
.modal-footer { padding: 16px 24px; }
@media (min-width: 1200px) {
  .operator-trip-table th, .operator-trip-table td { padding: 16px; }
}

@media (max-width: 767px) {
  :root { --page-gutter: 16px; }
  .topbar { grid-template-columns: 128px minmax(0, 1fr); gap: 12px; padding: 0 16px; }
  .topbar-actions { width: 100%; gap: 8px; }
  .workspace { padding: 24px var(--page-gutter); }
  .role-card { padding: 24px; }
  .page-header { gap: 16px; }
  .page-header h1 { margin-bottom: 8px; font-size: 24px; line-height: 32px; letter-spacing: -.4px; }
  .role-client .page-header .eyebrow, .role-carrier .page-header .eyebrow { display: none; }
  .workspace:has(> .list-panel) .page-description { font-size: 14px; line-height: 20px; }
  .workspace:has(> .list-panel) .page-header { margin-bottom: 16px; }
  .trip-stats.stats-grid { margin-bottom: 16px; }
  .trip-stats .stat-card { min-height: 88px; padding: 12px 8px; gap: 4px; }
  .trip-stats .stat-value { font-size: 24px; line-height: 32px; }
  .trip-stats .stat-label { line-height: 20px; }
  .panel-header, .panel-body { padding: 16px; }
  .panel-header { min-height: 60px; gap: 12px; }
  .panel-header > div > .muted { margin-top: 4px; }
  .list-panel > .panel-header > .muted { display: none; }
  .list-panel > .filters, .list-panel > .trip-grid { padding: 16px; }
  .list-panel > .tabs { padding: 0 16px; }
  .list-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
  .list-filters .field { grid-column: 1 / -1; }
  .list-filters .filter-date { grid-column: auto; }
  .filter-date label { font-size: 14px; line-height: 20px; }
  .filter-date .input { min-width: 0; padding-left: 8px; padding-right: 4px; }
  .role-client .client-trip-layout > .detail-aside > .panel:first-child { order: 0 !important; }
  .role-client .client-trip-layout.needs-price-decision > .detail-aside > .panel:first-child { order: -1 !important; }
  .carrier-working-layout .panel { margin-bottom: 16px; }
  .carrier-open-layout .info-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .carrier-open-layout .info-item:first-child, .carrier-open-layout .info-item:nth-child(4) { grid-column: 1 / -1; }
  .incident-actions { align-items: stretch; }
  .incident-actions > .btn { width: 100%; }
  .trip-card-route { padding: 16px 16px 12px; font-size: 20px; line-height: 28px; }
  .trip-card-cargo { padding: 0 16px 16px; }
  .trip-card-meta { padding: 0 16px 16px; gap: 8px; }
  .trip-card-footer { padding: 16px; }
  .wizard-panel .panel-body { padding: 24px 16px; }
  .wizard-panel .form-actions { padding: 16px; }
  .role-client .wizard-panel .form-actions, .role-carrier .wizard-panel .form-actions { bottom: 84px; }
  .form-actions .btn { flex: 1; }
  .wizard-panel .form-actions .btn-primary { white-space: nowrap; }
  .step { min-height: 96px; line-height: 20px; gap: 8px; }
  .back-link { margin-bottom: 16px; }
  .modal-header, .modal-body, .modal-footer { padding: 16px; }
  .modal-header h2 { font-size: 20px; line-height: 28px; }
  .modal-footer { gap: 12px; }
  .modal-footer .btn-primary { flex: 1; }
  .file-row:has(> div > strong) { display: grid; grid-template-columns: 40px minmax(0, 1fr) 48px; align-items: start; gap: 12px; }
  .file-row:has(> div > strong) > .file-icon { grid-column: 1; }
  .file-row:has(> div > strong) > div { grid-column: 2 / -1; min-width: 0; }
  .file-row:has(> div > strong) > .btn { grid-row: 2; grid-column: 1 / -1; margin: 0; }
  .file-row:has(> div > strong) > .btn:has(+ .btn) { grid-column: 1 / 3; }
  .file-row:has(> div > strong) > .btn + .btn { grid-column: 3; }
  .welcome-title { font-size: 28px; line-height: 36px; }
  .welcome-description { line-height: 24px; }
  .welcome-main > .auth-links { gap: 8px; }

  .responsive-table { display: block; width: 100%; min-width: 0; }
  .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.cell-actions::before { display: none; }
  .responsive-table .btn { max-width: 100%; }
  .responsive-table td .status { white-space: normal; }
}

@media (max-width: 1199px) {
  .operator-trip-table { display: block; width: 100%; min-width: 0; }
  .operator-trip-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .operator-trip-table tbody { display: grid; gap: 16px; padding: 16px; }
  .operator-trip-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); }
  .operator-trip-table td { display: block; min-width: 0; padding: 0; border: 0; white-space: normal; overflow-wrap: anywhere; font-size: 16px; line-height: 24px; }
  .operator-trip-table td::before { content: attr(data-label); display: block; margin-bottom: 4px; color: var(--muted); font-size: 14px; line-height: 20px; font-weight: 400; }
  .operator-trip-table td:first-child, .operator-trip-table td.cell-actions { grid-column: 1 / -1; }
  .operator-trip-table td.cell-actions::before { display: none; }
  .operator-trip-table .btn { max-width: 100%; }
  .operator-trip-table td .status { white-space: normal; }
  .role-operator .list-panel .operator-trip-table td:last-child { position: static; box-shadow: none; }
  .operator-trip-table td.numeric { text-align: left; }
}

/* Document actions adapt to their column, including dialogs and split views. */
.file-list { container-type: inline-size; }
@container (max-width: 600px) {
  .file-row:has(> div > strong) { display: grid; grid-template-columns: 40px minmax(0, 1fr) 48px; align-items: start; gap: 12px; }
  .file-row:has(> div > strong) > .file-icon { grid-column: 1; }
  .file-row:has(> div > strong) > div { grid-column: 2 / -1; min-width: 0; }
  .file-row:has(> div > strong) > .btn { grid-row: 2; grid-column: 1 / -1; margin: 0; }
  .file-row:has(> div > strong) > .btn:has(+ .btn) { grid-column: 1 / 3; }
  .file-row:has(> div > strong) > .btn + .btn { grid-column: 3; }
}

@media (max-width: 1023px) {
  .topbar { grid-template-columns: minmax(128px, 1fr) auto; gap: 16px; }
  .topbar-actions { gap: 8px; }
  .header-search { width: 240px; }
  .topbar-actions .header-shortcuts { display: none; }
  .topbar-actions .header-menu { display: inline-flex; }
  .app-shell.menu-open::after { display: none; }
  .sidebar-dismiss { display: block; position: fixed; z-index: 24; inset: var(--header-height) 0 0; border: 0; padding: 0; background: rgb(16 40 26 / 18%); }
  .menu-open .sidebar { z-index: 40; width: 280px; bottom: 0; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (max-width: 767px) {
  .topbar { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 0 16px; }
  .topbar .brand { min-width: 0; max-width: 100%; }
  .topbar .brand-logo { width: 104px; max-width: 100%; }
  .header-search { width: 48px; padding: 11px; justify-content: center; }
  .header-search > span, .header-search kbd, .header-quick > span { display: none; }
  .topbar-actions .header-quick { width: 48px; padding: 11px; }
  .staff-entry-content { padding: 24px 16px; }
  .command-dialog .modal-body { padding: 16px; }
  .command-dialog .modal-footer { padding: 12px 16px; }
  .command-key-hint { font-size: 14px; line-height: 24px; }
}

.header-search > span { white-space: nowrap; }
.header-search .header-search-short { display: none; }
.command-dialog .modal-footer { display: flex; flex-direction: row; flex-wrap: nowrap; align-items: center; gap: 12px; }
.command-key-hint { min-width: 0; }
.command-dialog .modal-footer .btn { width: 48px; min-width: 48px; padding: 11px; flex: 0 0 48px; }
@media (min-width: 768px) and (max-width: 1023px) {
  .header-search { width: 200px; }
  .header-search .header-search-full { display: none; }
  .header-search .header-search-short { display: inline; }
}

/* A clear public entry: registration first, returning users have their own action. */
.identity-entry .welcome-main { max-width: 960px; padding-top: 40px; }
.identity-entry .welcome-title { margin-bottom: 12px; }
.identity-entry .welcome-description { margin-bottom: 32px; }
.identity-entry .role-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.identity-entry .role-card { display: grid; grid-template-rows: subgrid; grid-row: span 7; align-items: start; min-height: 0; padding: 32px; }
.identity-entry .role-card-icon { margin-bottom: 20px; }
.identity-entry .role-card-title { font-size: 28px; line-height: 36px; margin-bottom: 12px; }
.entry-intent { font-size: 18px; line-height: 28px; margin: 0 0 8px; }
.identity-entry .role-card-description { margin-bottom: 24px; }
.identity-entry .role-card-link { gap: 16px; margin-top: 0; }
.entry-signin { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; width: 100%; margin-top: 8px; color: var(--muted); }
.entry-signin .link-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 8px; }
.entry-company-signin { justify-self: center; min-height: 48px; padding: 8px; text-align: center; }
.identity-entry .welcome-footer { padding-top: 16px; padding-bottom: 16px; }
.identity-entry .staff-entry-link { white-space: normal; text-align: right; }

/* Short summaries leave the viewport available for the working list or map. */
.stats-grid.compact-stats { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; padding: 12px 0; margin-bottom: 24px; border: solid var(--border); border-width: 1px 0; border-radius: 0; background: transparent; }
.compact-stats .stat-card { display: flex; flex: 1 1 0; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; min-height: 32px; padding: 0 24px; border: 0; border-right: 1px solid var(--border); border-radius: 0; box-shadow: none; background: transparent; text-align: left; }
.compact-stats .stat-card:first-child { padding-left: 0; }
.compact-stats .stat-card:last-child { border-right: 0; padding-right: 0; }
/* The base label keeps a bottom margin for tall cards; in the compact row it would push the label above the value. */
.compact-stats .stat-label { margin: 0; font-size: 16px; line-height: 24px; color: var(--muted); }
.stats-grid.compact-stats:not(.control-scopes) .stat-card { align-items: baseline; }
.compact-stats .stat-value { align-self: auto; width: auto; text-align: left; margin: 0; font-size: 24px; line-height: 32px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.payment-stats .stat-card:first-child { flex: 2 1 0; }
.payment-stats .stat-card:first-child .stat-value { min-width: 0; text-align: right; white-space: normal; overflow-wrap: anywhere; }
.stats-grid.compact-stats.control-scopes { flex-wrap: wrap; gap: 8px; border: 0; padding: 0; margin-bottom: 16px; }
.control-scopes.compact-stats .stat-card { flex: 0 0 auto; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 8px; min-height: 48px; padding: 11px 16px; border: 1px solid var(--border); border-radius: 8px; font: inherit; cursor: pointer; }
.control-scopes .stat-card:hover { background: var(--green-soft, #eaf3ee); }
.control-scopes .stat-card[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft, #eaf3ee); }
.control-scopes .stat-card .stat-label, .control-scopes .stat-card .stat-value { order: initial; align-self: auto; margin: 0; font-size: 16px; line-height: 24px; white-space: nowrap; }
.control-scopes .stat-card[aria-pressed="true"] .stat-label { color: var(--green); }
.control-scopes .stat-card:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.control-scopes .stat-card[data-scope="attention"] .stat-value { color: var(--amber, #865b08); }
.control-scope-short { display: none; }
.control-trip-list { --control-columns: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1.1fr) 24px; }
.control-filters { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 12px 16px; padding: 16px; border-bottom: 1px solid var(--border); }
.control-filters .field { min-width: 0; margin: 0; }
.control-filters .input, .control-filters .select { min-width: 0; width: 100%; }
.control-priority { display: none; white-space: nowrap; }
.control-priority[aria-pressed="true"] { border-color: var(--green); color: var(--green); background: var(--green-soft, #eaf3ee); }
.control-results { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px; min-height: 48px; border-bottom: 1px solid var(--border); }
.control-result-count { color: var(--muted); font-size: 14px; line-height: 20px; }
.control-result-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.control-result-actions .btn { padding: 8px; font-size: 14px; }
.control-columns { display: none; }
.control-column { display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 0; border: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.control-column .icon { flex: 0 0 16px; width: 16px; height: 16px; }
.control-column:hover, .control-column[aria-pressed="true"] { color: var(--green); }
.control-column:focus-visible { outline: 2px solid var(--green); outline-offset: -2px; border-radius: 4px; }
.control-trip-item + .control-trip-item { border-top: 1px solid var(--border); }
.control-trip-toggle { display: grid; grid-template-columns: var(--control-columns); align-items: start; gap: 16px; width: 100%; min-height: 88px; padding: 16px; border: 0; background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.control-trip-toggle:hover { background: var(--surface-hover, #f7faf8); }
.control-trip-toggle[aria-expanded="true"] { background: var(--green-soft, #eaf3ee); }
.control-trip-toggle:focus-visible { outline: 2px solid var(--green); outline-offset: -4px; }
.control-trip-toggle > span:not(.control-row-chevron) { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.control-row-label { color: var(--muted); font-size: 14px; line-height: 20px; }
.control-row-route strong { font-size: 18px; line-height: 26px; }
.control-row-status .status { max-width: 100%; white-space: normal; }
.control-row-arrival > span:last-child { font-variant-numeric: tabular-nums; }
.control-row-chevron { display: flex; align-self: center; color: var(--green); transform: rotate(90deg); }
.control-trip-toggle[aria-expanded="true"] .control-row-chevron { transform: rotate(-90deg); }
.control-trip-incident { display: inline-flex; align-items: center; gap: 4px; color: var(--amber, #865b08); font-size: 14px; line-height: 20px; }
.control-trip-detail { padding: 16px; border-top: 1px solid var(--border); }
.control-trip-facts { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.control-trip-facts .info-grid { flex: 1; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.control-trip-facts > .btn { flex-shrink: 0; }
.control-trip-facts .info-value { overflow-wrap: anywhere; }
.control-map-panel { min-width: 0; }
@media (min-width: 1200px) {
  .control-filters { grid-template-columns: minmax(0, 1fr) minmax(160px, 220px) auto; }
  .control-sort-field, #control-direction, .control-direction-only { display: none; }
  .control-priority { display: inline-flex; }
  .control-columns { display: grid; grid-template-columns: var(--control-columns); gap: 16px; padding: 0 16px; border-bottom: 1px solid var(--border); background: var(--surface-hover, #f7faf8); }
  .control-row-status > .control-row-label, .control-row-driver > .control-row-label { display: none; }
}
@media (max-width: 1199px) {
  .control-trip-toggle { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 24px; gap: 12px 16px; }
  .control-row-route { grid-column: 1 / 3; }
  .control-row-chevron { grid-column: 3; grid-row: 1; }
  .control-row-status { grid-column: 1; grid-row: 2; }
  .control-row-arrival { grid-column: 2 / 4; grid-row: 2; }
  .control-row-driver { grid-column: 1 / -1; grid-row: 3; }
  .control-trip-facts { flex-direction: column; align-items: stretch; }
  .control-trip-facts > .btn { align-self: flex-start; }
}
@media (max-width: 767px) {
  .control-scopes.compact-stats .stat-card { padding: 11px 12px; }
  .control-scope-full { display: none; }
  .control-scope-short { display: inline; }
  .control-scopes .stat-card .stat-label, .control-scopes .stat-card .stat-value { font-size: 14px; }
  .control-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .control-search { grid-column: 1 / -1; }
  .control-filters .select { padding-left: 8px; padding-right: 24px; }
  .control-row-status { grid-column: 1 / -1; }
  .control-trip-toggle > .control-row-status { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
  .control-row-status > .control-row-label { display: none; }
  .control-row-driver { grid-column: 1; grid-row: 3; }
  .control-row-arrival { grid-column: 2 / 4; grid-row: 3; }
  .control-trip-facts .info-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 767px) {
  .identity-entry .welcome-topbar { width: calc(100% - 32px); gap: 16px; min-height: 80px; }
  .identity-entry .brand-logo { width: 128px; }
  .identity-entry .staff-entry-link { font-size: 14px; line-height: 20px; gap: 4px; padding: 8px 0 8px 8px; }
  .identity-entry .staff-entry-link svg { flex: 0 0 20px; width: 20px; }
  .identity-entry .welcome-main { width: calc(100% - 32px); padding-top: 24px; padding-bottom: 16px; }
  .identity-entry .welcome-description { margin-bottom: 24px; }
  .identity-entry .role-grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .identity-entry .role-card { display: grid; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: none; grid-row: auto; align-items: center; gap: 12px; padding: 20px; }
  .identity-entry .role-card-title { font-size: 24px; line-height: 32px; margin: 0; }
  .identity-entry .role-card-icon { margin: 0; }
  .identity-entry .role-card-description { display: none; }
  .entry-intent { grid-column: 1 / -1; font-size: 16px; line-height: 24px; margin: 0; }
  .identity-entry .role-card-link, .entry-signin, .entry-company-signin { grid-column: 1 / -1; margin: 0; }
  .stats-grid.compact-stats { padding: 12px 0; margin-bottom: 16px; }
  .compact-stats .stat-card { flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 4px; min-height: 0; padding: 0 12px; }
  .compact-stats .stat-label { font-size: 14px; line-height: 20px; }
  .compact-stats .stat-value { order: -1; }
  .stats-grid.payment-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 12px; }
  .payment-stats .stat-card { flex-direction: row; align-items: center; justify-content: space-between; }
  .payment-stats .stat-card:first-child { grid-column: 1 / -1; padding: 0 0 12px; border-right: 0; border-bottom: 1px solid var(--border); }
  .payment-stats .stat-card:nth-child(2) { padding-left: 0; }
  .payment-stats .stat-value { order: 0; }
}

/* Board card (12.10.2026): dates, own offer and price per kilometre support the carrier's first assessment. */
.board-card-dates { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 24px 12px; color: var(--text); font-size: 16px; }
.board-card-dates strong { font-weight: 600; }
.board-card-note { margin: 0 24px 16px; color: var(--muted); font-size: 14px; }
.board-card-offer { display: flex; align-items: center; gap: 8px; margin: 0 24px 16px; padding: 8px 12px; border: 1px solid var(--green-border); border-radius: 8px; background: var(--green-soft); color: var(--green-dark); font-size: 14px; }
.board-card-offer .icon { width: 16px; height: 16px; flex-shrink: 0; }
.trip-card-footer small { display: block; margin-top: 4px; font-size: 14px; }
.trip-steps-list { display: grid; gap: 8px; margin: 0; padding-left: 24px; line-height: 1.5; }
.starget-contact .info-grid { margin-top: 12px; }
@media (max-width: 767px) {
  .board-card-dates { padding: 0 20px 12px; }
  .board-card-note, .board-card-offer { margin-left: 20px; margin-right: 20px; }
}
@media (max-width: 600px) {
  .role-carrier .list-panel:has([data-filter="date"]) > .list-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .role-carrier .list-panel:has([data-filter="date"]) > .list-filters > .field:not(.board-filter) { grid-column: 1 / -1; }
  .role-carrier .list-panel:has([data-filter="date"]) .board-filter .select { padding-left: 8px; padding-right: 28px; }
  .board-card-dates { padding: 0 16px 12px; }
  .board-card-note, .board-card-offer { margin-left: 16px; margin-right: 16px; }
}

/* Manager pricing panel: each carrier offer shows its state and margin under the carrier name. */
.pricing-offers-title { margin: 24px 0 8px; font-size: 16px; }
.pricing-offers .summary-row > span > small { display: block; margin-top: 4px; font-size: 14px; }
/* The trip number on the board card sits close to the route it labels. */
.board-card .trip-card-route { padding-top: 8px; }

/* A status message inside an action row aligns with the buttons instead of keeping its standalone margin. */
.form-actions > .alert { margin: 0; }
@media (max-width: 767px) {
  .form-actions:has(> .alert) { flex-wrap: wrap; }
  .form-actions > .alert { flex: 1 1 100%; }
}
/* Trip numbers never break at the hyphen. */
.trip-card-top .route-secondary { white-space: nowrap; }
@media (max-width: 600px) {
  /* Short tab sets share the row instead of hiding the last tab behind a scroll. */
  .list-panel > .tabs:not(:has(> :nth-child(4))) { gap: 0; }
  .list-panel > .tabs:not(:has(> :nth-child(4))) > .tab { flex: 1 1 auto; padding-inline: 6px; text-align: center; }
  /* Driver filters keep the count next to its label. */
  .driver-tabs .btn { justify-content: flex-start; gap: 6px; }
  .driver-tab-label { white-space: nowrap; }
  .driver-tab-count { min-width: 0; }
}
/* In the card layout a numeric cell aligns with the other fields of the card (same container conditions as styles.css). */
@container secondary-table (max-width: 800px) { .responsive-table td.numeric { text-align: left; } }
@container work-history (max-width: 640px) { .responsive-table td.numeric { text-align: left; } }
