:root {
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
  --ink: #172939;
  --canvas: #eff3f6;
  --surface: #fff;
  --subtle: #f6f9fb;
  --muted: #506478;
  --line: #d6e0e9;
  --line-soft: #e9eff4;
  --header: #102540;
  --header-hover: #193450;
  --header-active: #24425d;
  --header-ink: #f1f4f0;
  --header-muted: #c3d2df;
  --signal: #cf634f;
  --primary: var(--signal);
  --primary-hover: #db755f;
  --primary-ink: #0c1216;
  --action-text: #235a84;
  --focus: #235a84;
  --selected: #e4edf6;
  --table-head: #eaf0f6;
  --table-text: #365066;
  --row-alt: #f7fafc;
  --row-hover: #e9f1f8;
  --danger: #982f3d;
  --warning: #774c13;
  --radius: 8px;
  --dropdown-arrow: linear-gradient(45deg, transparent 39%, var(--muted) 40% 60%, transparent 61%),
    linear-gradient(135deg, transparent 39%, var(--muted) 40% 60%, transparent 61%);
  --dropdown-arrow-width: 10px;
  --dropdown-arrow-half: 5px;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
button, select, input, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

.app-shell { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100dvh; min-height: 0; overflow: hidden; }
.app-header { display: flex; align-items: stretch; gap: 20px; min-height: 44px; padding-inline: 12px; background: var(--header); color: var(--header-ink); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; white-space: nowrap; }
.brand-name { display: block; width: 116px; height: auto; }
.brand-mark { display: block; flex: none; width: 27px; height: auto; }
.navigation, .account-actions { display: flex; align-items: stretch; gap: 2px; }
.account-actions { margin-left: auto; }
.nav-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 34px; padding: 0 10px; color: var(--header-muted); background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; font-size: 13px; font-weight: 620; text-decoration: none; white-space: nowrap; }
.nav-button:hover { color: var(--header-ink); background: var(--header-hover); }
.nav-button[aria-current] { color: var(--header-ink); background: var(--header-active); border-bottom-color: var(--signal); }
.nav-button[aria-current] .icon { color: var(--signal); }
.nav-button .icon { width: 15px; }
.nav-button .icon-catalog { width: 14px; height: 14px; }
.nav-button :is(.icon-truck, .icon-pin, .icon-order) { height: 15px; }
.app-header :focus-visible { outline-color: var(--signal); outline-offset: -3px; }

.workspace { min-width: 0; min-height: 0; overflow: auto; }
#trips-view { height: 100%; }
.canvas { height: 100%; min-height: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px 12px; }
.view-heading { display: flex; flex: none; justify-content: space-between; align-items: center; gap: 8px; min-height: 34px; }
.catalog-heading-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-left: auto; }
#catalog-title { align-self: center; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(22px, 2vw, 28px); line-height: 1.12; letter-spacing: -.035em; font-weight: 720; }
.button { min-height: 34px; display: inline-flex; gap: 7px; align-items: center; justify-content: center; padding: 0 12px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; color: inherit; font-size: 13px; line-height: 1.2; font-weight: 650; }
.button:not(:disabled):hover { background: var(--subtle); }
.button.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }
.button.primary:not(:disabled):hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.view-heading > .button { white-space: nowrap; }
.text-button { background: transparent; border-color: transparent; color: var(--action-text); }

.icon { display: inline-block; position: relative; width: 17px; height: 17px; flex: none; color: currentColor; }
.icon-plus::before, .icon-plus::after { content: ''; background: currentColor; border-radius: 1px; position: absolute; }
.icon-plus::before { height: 2px; width: 13px; left: 2px; top: 7px; }
.icon-plus::after { height: 13px; width: 2px; left: 7.5px; top: 1.5px; }
.icon-search::before { content: ''; width: 9px; height: 9px; border: 1.6px solid currentColor; border-radius: 50%; position: absolute; left: 0; top: 0; }
.icon-search::after { content: ''; width: 6px; height: 1.6px; background: currentColor; border-radius: 1px; position: absolute; transform: rotate(45deg); left: 10px; top: 12px; }
.icon-upload { border: 1.7px solid currentColor; border-top: 0; height: 8px; margin-top: 9px; border-radius: 0 0 3px 3px; }
.icon-upload::before { content: ''; position: absolute; width: 6px; height: 6px; left: 4px; top: -8px; border: solid currentColor; border-width: 1.7px 0 0 1.7px; transform: rotate(45deg); }
.icon-upload::after { content: ''; position: absolute; width: 1.7px; height: 10px; left: 6px; top: -7px; background: currentColor; }

.icon-excel { width: 18px; height: 18px; color: #147346; }
.icon-excel::before {
  content: '';
  position: absolute;
  inset: 1px 0 1px 5px;
  border: 1px solid currentColor;
  border-radius: 2px;
  background:
    linear-gradient(currentColor, currentColor) 62% 3px / 1px 9px no-repeat,
    linear-gradient(currentColor, currentColor) center 5px / 9px 1px no-repeat,
    linear-gradient(currentColor, currentColor) center 9px / 9px 1px no-repeat;
}
.icon-excel::after {
  content: 'X';
  position: absolute;
  top: 4px;
  left: 0;
  display: grid;
  place-items: center;
  width: 10px;
  height: 11px;
  border-radius: 2px;
  background: #147346;
  color: white;
  font: 750 8px / 1 'Segoe UI', sans-serif;
}

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 7px #14263809; }
.timezone { color: var(--muted); font-size: 13px; }
.status-filters { display: flex; gap: 3px; align-items: center; padding: 0 18px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tab-button { display: flex; gap: 6px; align-items: center; min-height: 34px; padding: 0 9px; border: 0; border-bottom: 2px solid transparent; background: none; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.tab-button:hover { color: var(--action-text); background: var(--subtle); }
.tab-button[aria-pressed="true"] { color: var(--action-text); border-color: var(--primary); }
.tab-button:focus-visible { outline-offset: -4px; }
.tab-button[data-alert="late"] { color: var(--danger); }
.tab-button[data-alert="unassigned"] { color: var(--warning); }
.tab-button[data-alert="late"][aria-pressed="true"] { border-color: var(--danger); }
.tab-button[data-alert="unassigned"][aria-pressed="true"] { border-color: var(--warning); }
.tab-button[data-alert="late"] .tab-count { background: #f9e6e9; color: var(--danger); }
.tab-button[data-alert="unassigned"] .tab-count { background: #f5e9cb; color: var(--warning); }
.tab-count { background: var(--table-head); padding: 1px 6px 2px; border-radius: 10px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.tab-button[aria-pressed="true"]:not([data-alert]) .tab-count { background: var(--selected); color: var(--action-text); }
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 6px 10px; }
.search { display: flex; align-items: center; gap: 9px; width: min(100%, 333px); height: 38px; border: 1px solid var(--line); border-radius: 8px; padding: 0 11px; color: var(--muted); background: #fff; }
.search:focus-within { outline: 2px solid var(--focus); outline-offset: -1px; }
.search input { border: 0; outline: 0; width: 100%; color: var(--ink); min-width: 0; background: transparent; font-size: 14px; }
.search input::placeholder { color: var(--muted); opacity: 1; }
.select { min-height: 38px; max-width: 210px; padding: 0 24px 0 10px; background-color: #fff; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.table-scroll { overflow-x: auto; }
.data-panel { display: flex; flex: 1; min-height: 0; flex-direction: column; }
.data-panel > :is(.status-filters, .toolbar, .panel-footer, .account-message) { flex: none; }
.data-panel > .table-scroll { flex: 1; min-height: 0; overflow: auto; }
.data-panel table { border-collapse: separate; border-spacing: 0; }
.data-panel th { position: sticky; top: 0; z-index: 1; }
.data-panel tbody tr:nth-child(even) td { background: var(--row-alt); }
.data-panel .panel-footer { border-top: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; text-align: left; }

.catalog-table { min-width: max(100%, 445px); }
.catalog-table td:not(.catalog-action, .empty) { max-width: 290px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.catalog-table.wrap-cells td:not(.catalog-action, .empty),
.trip-table.wrap-cells td:not(.empty), .trip-table.wrap-cells .trip-id { white-space: pre-wrap; overflow-wrap: anywhere; text-overflow: clip; }
.catalog-table td.catalog-action, .catalog-table th.catalog-action { position: sticky; right: 0; width: 1%; white-space: nowrap; border-left: 1px solid var(--line-soft); }
.catalog-table td.catalog-action { z-index: 1; }
.catalog-table th.catalog-action { z-index: 3; }
.catalog-action .button { min-height: 27px; }
th { padding: 7px 10px; background: var(--table-head); color: var(--table-text); font-size: 13px; font-weight: 650; white-space: nowrap; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 19px; }
th:last-child, td:last-child { padding-right: 19px; }
td { padding: 5px 10px; height: 33px; border-bottom: 1px solid var(--line-soft); font-size: 13px; vertical-align: middle; }
.trip-table tbody td[data-cell-value], .catalog-table tbody td[data-cell-value] { cursor: cell; user-select: none; }
.cell-title, .cell-subtitle { display: block; line-height: 1.33; }
.cell-title { font-weight: 640; color: var(--ink); }
.cell-subtitle { font-size: 13px; color: var(--muted); margin-top: 2px; }
.trip-id { font-variant-numeric: tabular-nums; white-space: nowrap; }
.trip-id { color: var(--action-text); background: transparent; padding: 0; border: 0; text-align: left; }
.trip-id:hover { text-decoration: underline; }
.pill { display: inline-flex; gap: 6px; align-items: center; border-radius: 30px; padding: 4px 8px; white-space: nowrap; background: #edf2f6; color: #465b6e; font-size: 13px; font-weight: 650; }
.pill::before { content: ''; background: currentColor; width: 6px; height: 6px; border-radius: 50%; flex: none; }
.pill-prepared { background: #eeeafa; color: #625089; }
.pill-loading { background: #fdf0da; color: #815519; }
.pill-transit { background: #e5eff8; color: #244c7a; }
.pill-delivered { background: #e2f1e8; color: #246044; }
.pill-closed { background: #e8eef3; color: #43576a; }
.empty { padding: 30px 19px; min-height: 100px; text-align: center; color: var(--muted); }
.panel-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 34px; padding: 3px 10px; color: var(--muted); font-size: 13px; }
.pagination { display: flex; align-items: center; gap: 5px; }
.pagination .button { min-height: 31px; min-width: 32px; padding: 0 8px; font-weight: 560; }
.pagination .button[aria-current] { background: var(--selected); color: var(--action-text); border-color: #c4d7e8; }

.journal-frame { height: 100%; min-height: 0; display: flex; flex-direction: column; background: var(--surface); }
.journal-command { display: flex; flex: none; align-items: center; gap: 8px; min-height: 44px; padding: 5px 10px; background: var(--subtle); border-bottom: 1px solid var(--line); }
.journal-command h1 { margin-right: 4px; font-size: 18px; letter-spacing: -.025em; }
.journal-command .button { min-height: 29px; padding: 0 8px; gap: 4px; font-size: 12px; white-space: nowrap; }
.journal-command .search { width: min(34%, 320px); min-width: 0; height: 30px; padding: 0 7px; gap: 5px; }
.journal-command .search input { font-size: 12px; }
#visit-customer { min-width: 0; max-width: 190px; min-height: 30px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: var(--surface); font-size: 12px; }
.visit-trip-scope { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); background: var(--subtle); font-size: 12px; }
.visit-trip-scope p { font-weight: 650; }
.journal-command .timezone { margin-left: auto; font-size: 11px; }
.icon-button { width: 30px; min-height: 29px; padding: 0; flex: none; font-size: 17px; }
.journal-command .icon-button { padding: 0; font-size: 18px; }
.journal-frame .status-filters { flex: none; padding: 0 6px; }
.journal-frame .tab-button { min-height: 31px; padding-inline: 7px; gap: 4px; font-size: 12px; }
.journal-frame .tab-count { padding: 1px 4px; font-size: 10px; }
.trip-journal .tab-button[data-alert="unassigned"] { margin-left: 5px; }
.journal-frame > .table-scroll { overflow: auto; overscroll-behavior: contain; flex: 1; min-height: 0; }
.journal-frame > .table-scroll:focus-visible { outline-offset: -2px; }
.trip-table { width: max-content; min-width: 100%; }
.trip-table :is(th, td) { width: 152px; min-width: 90px; max-width: 190px; white-space: nowrap; }
:is(.trip-table, .catalog-table) { border-collapse: separate; border-spacing: 0; }
:is(.trip-table, .catalog-table) :is(th, td) { padding: 3px 7px; border-right: 1px solid var(--line-soft); }
.catalog-table :is(th, td):last-child { border-right: 0; }
:is(.trip-table, .catalog-table) th { position: sticky; top: 0; z-index: 2; height: 30px; font-size: 12px; }
:is(.trip-table, .catalog-table) td { height: 28px; font-size: 12px; background: var(--surface); }
.trip-table td { overflow: hidden; text-overflow: ellipsis; }
:is(.trip-table, .catalog-table) tr:nth-child(even) td { background: var(--row-alt); }
:is(.trip-table, .catalog-table) td[data-cell-value]:hover { background: var(--row-hover); }
.trip-table .trip-col-code { width: 108px; }
.trip-table .trip-col-boolean { width: 108px; }
.trip-table .trip-col-number { width: 120px; }
.trip-table .trip-col-datetime { width: 202px; max-width: 212px; font-variant-numeric: tabular-nums; }
.trip-table :is(.trip-col-wide, .trip-col-party) { width: 212px; max-width: 230px; }
.column-pinned { position: sticky; inset-inline-start: var(--pinned-inset); }
td.column-pinned { z-index: 1; }
:is(.trip-table, .catalog-table) th.column-pinned { z-index: 4; }
:is(.trip-table, .catalog-table) .column-pin-edge { border-inline-end-color: var(--line); }
.trip-table .trip-id { font-weight: 650; display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.trip-table .trip-overdue { color: var(--danger); font-weight: 620; }
:is(.trip-table, .catalog-table) tbody td[data-cell-value].selected-cell { background: #dceff8; }
:is(.trip-table, .catalog-table) tbody td[data-cell-value].active-cell { box-shadow: inset 0 0 0 2px var(--action-text); }
:is(.trip-table, .catalog-table)[role="grid"]:focus-visible { outline-offset: -2px; }
.trip-table .pill { padding: 2px 6px; font-size: 11px; }
.trip-table .empty { padding: 14px 8px; text-align: left; white-space: normal; }
.trip-column-heading { display: flex; align-items: center; justify-content: space-between; gap: 3px; }
.column-label, .column-sort { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.column-sort { border: 0; padding: 0; color: inherit; background: transparent; font: inherit; white-space: nowrap; }
.column-filter-trigger { display: grid; place-items: center; flex: none; width: 22px; height: 22px; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--muted); }
.column-filter-trigger:is(:hover, :focus-visible, [aria-expanded="true"]) { background: var(--selected); color: var(--action-text); }
.column-filter-trigger.is-filtered { background: var(--selected); border-color: #86bdbe; color: var(--action-text); }
.icon-filter { width: 11px; height: 10px; background: currentColor; clip-path: polygon(0 0, 100% 0, 65% 54%, 65% 83%, 35% 100%, 35% 54%); }
.journal-frame .panel-footer { flex: none; min-height: 29px; padding: 2px 8px; font-size: 12px; border-top: 1px solid var(--line); }
.journal-frame .pagination .button { min-height: 24px; min-width: 25px; }

.column-filter {
  position: fixed; inset: auto; margin: 0; width: min(384px, calc(100vw - 16px)); padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: #fff; box-shadow: 0 8px 25px #14263830;
}
.column-filter form {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; max-height: calc(100dvh - 18px);
  padding: 12px; overflow: auto;
}
.column-filter form > :not(.column-filter-values) { flex: none; }
.column-filter form > strong { overflow-wrap: anywhere; }
.column-filter .field input, .column-filter-search { min-height: 34px; min-width: 0; width: 100%; }
.column-filter-search {
  padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface);
  color: var(--ink); font: inherit;
}
.column-filter-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.column-filter-values { display: flex; flex-direction: column; min-height: 0; border: 1px solid var(--line); border-radius: 5px; }
.column-filter-list { min-height: 0; max-height: min(264px, 44dvh); overflow: hidden auto; overscroll-behavior: contain; }
.column-filter-option { display: flex; align-items: flex-start; gap: 8px; min-height: 30px; padding: 6px 8px; cursor: pointer; font-size: 13px; line-height: 1.35; }
.column-filter-option:is(:hover, :focus-within) { background: var(--selected); }
.column-filter-option input { flex: none; margin: 2px 0 0; }
.column-filter-option span { min-width: 0; overflow-wrap: anywhere; }
.column-filter-all { flex: none; border-bottom: 1px solid var(--line); background: var(--subtle); font-weight: 600; }
.column-filter-empty { margin: 6px 7px; color: var(--muted); font-size: 13px; }
.column-filter-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.column-filter-actions .button { min-height: 34px; }
th[data-width-column] { padding-right: 9px; }
[data-resize-column] {
  position: absolute; z-index: 1; inset: 0 0 0 auto; width: 8px; cursor: col-resize; touch-action: none; user-select: none;
}
[data-resize-column]::before {
  content: ''; position: absolute; inset: 4px 1px 4px auto; width: 1px; background-color: var(--line);
}
[data-resize-column]:is(:hover, :focus-visible, .is-resizing)::before { width: 2px; background-color: var(--focus); }
[data-resize-column]:focus-visible { outline-offset: -2px; }
:is(.trip-table, .catalog-table, table[data-card-table]).column-widths-set {
  width: var(--resized-table-width); min-width: 0; table-layout: fixed;
}
.column-widths-set td:not(.empty, .card-empty, .field-cell) { overflow: hidden; text-overflow: ellipsis; }
.column-settings { width: min(480px, calc(100% - 18px)); max-height: min(650px, calc(100dvh - 20px)); padding: 0; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); }
.column-settings[open] { display: flex; flex-direction: column; }
.column-settings::backdrop { background: #10254073; }
.column-settings :is(header, footer) { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--subtle); }
.column-settings header { justify-content: space-between; border-bottom: 1px solid var(--line); }
.column-settings h2 { font-size: 16px; }
.column-settings-option { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
.column-settings-option input { accent-color: var(--primary); }
.column-settings footer { justify-content: space-between; border-top: 1px solid var(--line); }
.column-settings footer .button { min-height: 31px; }
.column-settings ol { list-style: none; margin: 0; padding: 4px 12px; overflow: auto; }
.column-settings li { display: flex; align-items: center; gap: 5px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.column-settings li label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 13px; }
.column-settings li input { accent-color: var(--primary); }
.column-settings li .icon-button { min-height: 26px; }
.column-pin-button { color: var(--muted); }
.column-pin-button[aria-pressed="true"], .column-pin-button[aria-pressed="true"]:hover {
  background: var(--selected); border-color: var(--focus); color: var(--action-text);
}

.drawer { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(100%, 544px); height: 100dvh; max-height: none; max-width: none; padding: 0; border: 0; background: #fff; color: var(--ink); box-shadow: -12px 0 42px #10223535; }
.drawer:has(.trip-detail) { width: min(100%, 710px); }
.drawer[open] { display: flex; flex-direction: column; }
.drawer::backdrop { background: #10254073; }
.drawer-header { padding: 24px 25px 16px; display: flex; justify-content: space-between; gap: 10px; }
.drawer-header h2 { font-size: 27px; letter-spacing: -.04em; }
.drawer-header p { margin-top: 5px; color: var(--muted); font-size: 14px; }
.close-button { align-self: start; width: 35px; min-height: 35px; padding: 0; font-size: 22px; font-weight: 400; }
.drawer-nav { display: flex; padding: 0 17px; border-bottom: 1px solid var(--line); }
.drawer-content { overflow-y: auto; flex: 1 1 auto; padding: 20px 25px; }
.drawer-footer { padding: 13px 25px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; background: var(--subtle); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 15px; margin: 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.facts dd { margin: 0; font-size: 15px; font-weight: 620; overflow-wrap: anywhere; }
.history-list { margin: 0; padding: 0; list-style: none; }
.history-list li { padding: 10px 0; border-bottom: 1px solid var(--line); line-height: 1.35; }
.history-list time { display: block; margin-top: 3px; color: var(--muted); font-size: 13px; }
.history-list small { color: var(--muted); font-size: 12px; }
.fields { display: grid; gap: 13px; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.field { display: grid; gap: 5px; font-size: 14px; font-weight: 620; min-width: 0; }
.field :is(input, select, textarea) { min-width: 0; max-width: none; min-height: 37px; width: 100%; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background-color: #fff; color: var(--ink); font-size: 14px; font-weight: 400; }
select {
  appearance: none; background-image: var(--dropdown-arrow); background-repeat: no-repeat;
  background-position: right 12px center, right 7px center; background-size: var(--dropdown-arrow-half) var(--dropdown-arrow-half);
}
.field select { padding-right: 24px; }
.field textarea { resize: vertical; }
.field input[type="file"] { padding: 11px; }
.catalog-picker-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px; }
.catalog-picker-toggle { min-width: 34px; padding: 0; }
.catalog-picker-toggle::before {
  content: ''; display: block; width: var(--dropdown-arrow-width); height: var(--dropdown-arrow-half);
  background-image: var(--dropdown-arrow); background-repeat: no-repeat;
  background-position: left center, right center; background-size: var(--dropdown-arrow-half) var(--dropdown-arrow-half);
}
.catalog-picker-popup {
  position: fixed; inset: auto; margin: 0; padding: 3px; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); font-weight: 400;
  box-shadow: 0 5px 18px rgb(19 37 59 / 14%);
}
.catalog-picker-popup:popover-open { display: flex; flex-direction: column; }
.catalog-picker-list { min-height: 0; max-height: 185px; overflow: auto; overscroll-behavior: contain; }
.catalog-picker-list [role="option"] { padding: 6px 8px; border-radius: 4px; cursor: pointer; overflow-wrap: anywhere; }
.catalog-picker-list [role="option"]:is(.is-active, :hover, [aria-selected="true"]) { background: var(--selected); color: var(--action-text); }
.catalog-picker-list small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; }
.catalog-picker-status { flex: none; padding: 4px 8px; color: var(--muted); font-size: 12px; }
.catalog-picker-add { flex: none; justify-content: start; width: 100%; white-space: normal; text-align: start; }
.catalog-add-dialog form { min-height: 0; overflow: auto; padding: 12px; }
.catalog-add-dialog footer { justify-content: flex-end; }
.requisite-group { min-width: 0; margin: 0 0 10px; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 8px; }
.requisite-group legend { padding: 0 4px; font-size: 14px; font-weight: 650; }
.requisite-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.trip-detail summary { margin-bottom: 10px; cursor: pointer; color: var(--action-text); font-weight: 650; }
.form-message { margin-top: 12px; color: var(--danger); font-size: 14px; line-height: 1.4; }
.form-message.is-success { color: var(--action-text); }
.form-message:empty { display: none; }

.drawer.trip-card { inset: 0; width: 100%; background: var(--canvas); }
.trip-card[open] { animation: none; }
.trip-card .drawer-header {
  flex: none; align-items: center; justify-content: flex-start; gap: 10px; padding: 8px clamp(12px, 1.5vw, 24px);
  background: var(--surface); border-bottom: 1px solid var(--line-soft);
}
.trip-card .drawer-heading { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.trip-card .drawer-heading h2 { font-size: 19px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.trip-card .drawer-heading h2:focus { outline: none; }
.trip-card .drawer-heading p { margin: 0; font-size: 11px; white-space: nowrap; }
.trip-card .card-back { flex: none; border-color: transparent; color: var(--action-text); }
.trip-card .card-commands { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; margin-left: auto; }
.trip-card .button { min-height: 30px; padding: 0 10px; font-size: 12px; border-radius: 6px; }
.trip-card .drawer-content { padding: 10px clamp(10px, 1.5vw, 24px) 16px; }
.trip-card :is(#card-main, .card-workarea) { width: min(100%, 1680px); margin-inline: auto; }
.trip-card .drawer-footer { flex: none; padding: 8px clamp(12px, 1.5vw, 24px); background: var(--surface); }
.trip-card .drawer-footer .form-message { flex: 1 1 180px; margin: 0; color: var(--muted); }
.trip-card .drawer-footer .form-message.is-success { color: var(--action-text); }
.trip-card .drawer-footer .form-message.is-error { color: var(--danger); }
.trip-card .drawer-nav { flex: none; gap: 4px; overflow-x: auto; background: var(--surface); padding: 0 clamp(10px, 1.5vw, 24px); }
.trip-card .tab-button { min-height: 33px; padding: 0 9px; font-size: 12px; white-space: nowrap; }
.trip-card .tab-button:focus-visible { outline-offset: -3px; }
.trip-card .card-section-nav { background: transparent; border-color: var(--line); padding: 0; margin: 8px 0 10px; }
.card-overview {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.16fr) minmax(0, 1fr);
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px;
}
.card-fact-group { min-width: 0; padding: 9px 13px 10px; }
.card-fact-group + .card-fact-group { border-inline-start: 1px solid var(--line-soft); }
.card-fact-group h3 {
  margin-bottom: 6px; padding-bottom: 5px; border-bottom: 1px solid var(--line-soft); font-size: 13px; color: var(--ink);
}
.card-overview .requisite-fields { gap: 3px 12px; }
.card-edit-fields .field { gap: 1px; font-size: 11px; font-weight: 600; color: var(--muted); align-content: start; }
.card-edit-fields :is(.field, .catalog-picker) > label { color: var(--muted); }
.card-field-readonly strong {
  min-height: 28px; padding: 5px 5px 4px; color: var(--ink); font-size: 12px; font-weight: 550; overflow-wrap: anywhere;
}
:is(.card-edit-fields, .card-section-form) .field :is(input, select, textarea) {
  min-height: 28px; padding: 4px 5px; border: 1px solid transparent; border-radius: 4px;
  background-color: transparent; color: var(--ink); font-size: 12px; line-height: 1.35; text-overflow: ellipsis;
}
:is(.card-edit-fields, .card-section-form) .field :is(input, textarea)::placeholder { color: var(--muted); opacity: 1; }
:is(.card-edit-fields, .card-section-form) .field :is(input, select, textarea):hover,
:is(.card-edit-fields, .card-section-form) .field .card-date-control:hover .card-date-value {
  border-color: var(--line); background-color: var(--subtle);
}
:is(.card-edit-fields, .card-section-form) .field :is(input, select, textarea):focus {
  outline: 1px solid var(--focus); outline-offset: -1px; border-color: var(--focus); background-color: var(--surface);
}
:is(.card-edit-fields, .card-section-form) .field select {
  padding-right: 20px;
}
:is(.card-edit-fields, .card-section-form) .field select:has(option[value=""]:checked) { color: var(--muted); }
.card-edit-fields .field textarea { field-sizing: content; min-height: 28px; max-height: 92px; resize: none; }
.visit-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.trip-card .visit-workarea { max-width: 1120px; }
.visit-overview .trip-id { margin-inline-start: 4px; }
:is(.card-edit-fields, .card-section-form) .catalog-picker-control { position: relative; display: block; }
:is(.card-edit-fields, .card-section-form) .catalog-picker-control input { padding-right: 24px; }
:is(.card-edit-fields, .card-section-form) .catalog-picker-toggle {
  position: absolute; top: 1px; right: 1px; width: 23px; min-width: 0; min-height: 26px;
  padding: 0; border-color: transparent; background: transparent; color: var(--muted);
}
.card-date-control { display: grid; align-items: center; min-width: 0; }
.card-date-control > * { grid-area: 1 / 1; }
.card-date-value {
  pointer-events: none; min-height: 28px; padding: 4px 5px; border: 1px solid transparent; border-radius: 4px;
  color: var(--ink); font-size: 12px; font-weight: 400; line-height: 1.45; font-variant-numeric: tabular-nums;
}
.card-date-value.is-empty { color: var(--muted); }
.card-date-control:not(:focus-within) input { opacity: 0; cursor: text; }
.card-date-control:focus-within .card-date-value { visibility: hidden; }
.card-overview .field { line-height: 1.2; }
.card-overview .field :is(input, select, textarea, strong, .card-date-value) { min-height: 26px; padding-block: 3px; }
.card-overview .catalog-picker-toggle { min-height: 24px; }
.catalog-picker-hint { color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-tables { display: grid; gap: 8px; }
.card-table { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.card-table-heading { min-height: 36px; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 4px 8px 4px 12px; }
.card-table-heading h3 { font-size: 13px; }
.card-table-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px; }
.card-table-scroll { max-height: max(195px, 50dvh); overflow: auto; border-radius: 0 0 8px 8px; }
.card-table-scroll:focus-visible { outline-offset: -2px; }
.card-table-scroll table { width: 100%; border-collapse: separate; border-spacing: 0; text-align: left; font-size: 12px; line-height: 1.28; }
.card-table-scroll :is(th, td) { min-width: 62px; padding: 6px 7px; border-top: 1px solid var(--line-soft); vertical-align: top; }
.card-table-scroll .row-index { min-width: 31px; width: 31px; color: var(--muted); font-variant-numeric: tabular-nums; }
.card-table-scroll th { position: sticky; top: 0; z-index: 1; background: var(--table-head); color: var(--table-text); font-size: 11px; font-weight: 650; white-space: normal; vertical-align: bottom; }
.card-table-scroll tr:nth-child(even) td { background: var(--row-alt); }
.card-table-scroll td { height: 29px; border-bottom: 0; font-size: inherit; overflow-wrap: anywhere; }
.card-table-cargo table, .card-table-route table { min-width: 1090px; }
.attachment-hint { margin: 0; padding: 2px 12px 8px; font-size: 12px; color: var(--muted); }
.attachment-feedback { padding-inline: 12px; font-size: 12px; }
.attachment-feedback :is(p, ul) { margin: 2px 0 8px; }
.attachment-feedback [data-file-status]:empty { margin: 0; }
.attachment-feedback [data-file-status] { color: var(--muted); overflow-wrap: anywhere; }
.attachment-feedback :is([data-file-error], [data-file-failures]) { color: var(--danger); overflow-wrap: anywhere; }
.attachment-feedback ul { padding-inline-start: 18px; }
.attachment-feedback .button { margin-bottom: 8px; }
.attachment-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.attachment-actions a { text-decoration: none; }
.attachment-actions .attachment-icon-action { padding: 0; border-color: transparent; background: transparent; color: var(--action-text); }
.attachment-icon-action svg { display: block; width: 19px; height: 19px; }
.attachment-selection-count { padding-inline: 4px; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.card-attachments .attachment-check { width: 36px; min-width: 36px; text-align: center; }
.attachment-check input { width: 16px; height: 16px; margin: 0; vertical-align: middle; accent-color: var(--action-text); }
.card-attachments .attachment-name { width: 40%; }
.card-attachments .attachment-size { white-space: nowrap; }
.card-attachments .attachment-remove { color: var(--danger); }
.attachment-preview {
  width: min(1120px, calc(100vw - 24px)); height: calc(100dvh - 32px); max-width: none; max-height: none;
  padding: 0; overflow: hidden; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px;
}
.attachment-preview[open] { display: flex; flex-direction: column; }
.attachment-preview::backdrop { background: rgb(16 37 64 / .48); }
.attachment-preview-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.attachment-preview-header h2 { flex: 1 1 260px; min-width: 0; font-size: 16px; overflow-wrap: anywhere; }
.attachment-preview-content { position: relative; flex: 1; min-height: 0; background: var(--canvas); }
.attachment-preview-content [data-preview-status] { position: absolute; z-index: 1; inset: 0 0 auto; }
.attachment-preview-body { display: grid; place-items: center; width: 100%; height: 100%; }
.attachment-preview-body iframe { width: 100%; height: 100%; border: 0; }
.attachment-preview-body img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.container-import {
  width: min(1460px, calc(100vw - 24px)); max-width: none; height: min(750px, calc(100dvh - 24px)); max-height: none;
  margin: auto; padding: 0; border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); background: var(--surface); overflow: hidden;
}
.container-import[open], .container-import-form { display: flex; flex-direction: column; }
.container-import::backdrop { background: rgb(16 37 64 / .42); }
.container-import-header, .container-import-footer {
  display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 16px;
}
.container-import-header { border-bottom: 1px solid var(--line); }
.container-import-header h2 { font-size: 19px; }
.container-import-header h2:focus { outline: none; }
.container-import-header p, .container-grid-heading p { color: var(--muted); font-size: 12px; }
.container-import-form { flex: 1; min-height: 0; }
.container-import-body { flex: 1; min-height: 0; overflow: auto; padding: 14px 16px; }
.container-import-settings {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(205px, 100%), 1fr)); gap: 10px;
  padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--subtle);
}
.container-import-check { display: flex; align-items: center; gap: 7px; font-size: 13px; min-height: 30px; }
.container-grid-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 7px 12px; margin: 14px 0 8px; }
.container-grid-heading h3, #container-results-title { font-size: 14px; }
.container-grid-heading p { flex: 1 1 320px; }
.container-grid-actions { display: flex; align-items: center; gap: 6px; }
.container-grid-scroll { max-height: 46dvh; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.container-grid { width: 100%; border-spacing: 0; table-layout: fixed; min-width: 1810px; font-size: 12px; }
.container-grid :is(th, td) { border-bottom: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); padding: 0; }
.container-grid th { background: var(--table-head); color: var(--table-text); padding: 5px; }
.container-grid thead th { position: sticky; top: 0; z-index: 1; text-align: left; }
.container-grid tr > th:first-child { width: 38px; position: sticky; left: 0; text-align: center; }
.container-grid thead th:first-child { z-index: 2; }
.container-grid textarea {
  display: block; width: 100%; min-height: 29px; padding: 5px 6px; border: 0; border-radius: 0; resize: none;
  color: var(--ink); background: transparent; font-size: 12px; line-height: 1.4;
}
.container-grid textarea:focus { position: relative; z-index: 1; outline-offset: -2px; }
.container-grid tr:nth-child(even) td { background: var(--row-alt); }
.container-grid tr.has-error > :is(th, td) { background: #fff0f0; }
.container-grid tr.has-error > th, .container-import-errors { color: var(--danger); }
.container-import-errors { margin: 10px 0 0; padding-left: 20px; font-size: 13px; }
.container-import-footer { justify-content: flex-end; flex-wrap: wrap; border-top: 1px solid var(--line); }
.container-import-footer .form-message { flex: 1 1 220px; margin: 0; color: var(--muted); }
.container-import-footer .form-message.is-error { color: var(--danger); }
.container-import [data-result-table] { margin-top: 8px; }
@media print {
  body:has(#attachment-preview[open] img) > :not(#attachment-preview) { display: none !important; }
  #attachment-preview[open]:has(img) {
    position: static; display: block; width: 100%; height: auto; margin: 0; border: 0; overflow: visible;
  }
  #attachment-preview[open]:has(img)::backdrop { display: none; }
  .attachment-preview:has(img) :is(.attachment-preview-header, [data-preview-status]) { display: none; }
  .attachment-preview:has(img) .attachment-preview-body { height: auto; background: white; }
  .attachment-preview:has(img) img { width: auto; height: auto; max-width: 100%; max-height: 90vh; }
}
.cargo-order-cell { display: flex; align-items: start; gap: 3px; min-width: 170px; }
.cargo-order-cell .catalog-picker { flex: 1; }
.card-section-form .cargo-order-cell .button[data-edit-cargo-order] { width: 27px; min-width: 27px; padding: 0; }
.order-overview { grid-template-columns: minmax(0, 1fr); }
.trip-card .order-workarea { display: grid; gap: 8px; max-width: 1280px; }
.order-header-fields {
  display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); gap: 4px 12px;
}
.order-span-two { grid-column: span 2; min-width: 0; }
.trip-card .order-tabs { margin: 0; }
.order-details { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
.order-wide-field { grid-column: 1 / -1; }
.order-check { display: flex; align-items: center; gap: 6px; min-height: 26px; align-self: end; color: var(--muted); font-size: 12px; }
.order-check input { flex: none; accent-color: var(--primary); }
.order-flags { display: flex; flex-wrap: wrap; align-self: end; gap: 2px 12px; }
.order-cargo-fields { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(0, 2fr); gap: 4px 12px; }
#order-card-forwarder [data-instruction-slot]:not(:empty) { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.order-documents table { min-width: 810px; }
.order-documents .field-cell:nth-child(3) { min-width: 125px; }
.order-documents .field-cell:nth-child(n + 5) { min-width: 160px; }
.order-links :is(th, td):is(:first-child, :nth-child(n + 4)) { white-space: nowrap; }
.order-links :is(th, td):is(:nth-child(2), :nth-child(3)) { min-width: 140px; }
.card-table-scroll .card-empty, .card-empty { padding: 17px 10px; text-align: center; color: var(--muted); font-size: 13px; }
.card-total { display: inline-block; min-width: min(315px, 100%); padding: 8px 10px; margin-bottom: 8px; }
.card-panel-body { padding: 8px 12px 10px; border-top: 1px solid var(--line-soft); }
.card-comment textarea { min-height: 106px; max-height: min(420px, 60dvh); field-sizing: content; resize: none; }
.card-comment textarea:focus { border-color: var(--focus); outline: 1px solid var(--focus); outline-offset: -1px; }
.trip-card .history-list { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding-inline: 10px; font-size: 13px; }
.trip-card .history-list li:last-child { border-bottom: 0; }
.trip-card .history-list time { font-size: 11px; }
.card-other { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 8px; }
.card-section-form .card-table-scroll { max-height: min(310px, 50dvh); }
.card-section-form .field-cell { min-width: 96px; padding: 3px 5px; }
.card-section-form .field-cell:has(.catalog-picker) { min-width: 176px; }
.card-section-form .field-cell:has(.card-date-control) { min-width: 150px; }
.card-section-form :is(th, td):last-child { min-width: 36px; width: 36px; padding: 3px 4px; }
:is(.trip-table, .catalog-table, [data-card-table]).column-widths-set :is(th, td) {
  width: auto; min-width: 0; max-width: none;
}
.card-section-form .column-widths-set .field-cell { min-width: 0; }
.card-section-form [data-remove-row] { min-height: 28px; padding: 0 6px; border-color: transparent; background: transparent; color: var(--muted); }
.card-section-form [data-remove-row]:is(:hover, :focus-visible) { color: var(--danger); background: var(--subtle); }
.card-row-actions { display: flex; gap: 2px; }
.card-section-form .card-row-actions [data-trip-visit] { min-height: 28px; padding: 0 6px; }

@media (max-width: 860px) {
  .card-overview { grid-template-columns: minmax(0, 1fr); }
  .order-header-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-cargo-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-fact-group + .card-fact-group { border-inline-start: 0; border-block-start: 1px solid var(--line); }
}
@media (max-width: 760px) {
  .trip-card .drawer-header { flex-wrap: wrap; gap: 7px; }
  .trip-card .drawer-heading h2 { font-size: 17px; }
  .trip-card .card-commands { justify-content: flex-start; flex-basis: 100%; margin-left: 0; }
  .card-other { grid-template-columns: minmax(0, 1fr); }
}
.import-hint { margin: 9px 0 0; font-size: 13px; color: var(--muted); line-height: 1.4; }
.import-preview { margin-top: 15px; line-height: 1.45; }
.import-preview li { padding: 6px 0; font-size: 14px; overflow-wrap: anywhere; }
.import-preview ul { margin: 5px 0 0; padding-left: 20px; }
.toast { position: fixed; right: 22px; bottom: 20px; z-index: 5; max-width: min(440px, calc(100% - 44px)); padding: 12px 17px; color: #fff; background: var(--header); border-radius: 10px; box-shadow: 0 5px 25px #10223526; font-size: 14px; }
.toast.error { background: #853a2b; }

@media (max-width: 1170px) {
  .status-filters { gap: 2px; padding-inline: 10px; }
  .status-filters .tab-button { padding-inline: 5px; font-size: 13px; }
}
@media (max-width: 810px) {
  .canvas { padding: 7px 8px 8px; }
  .view-heading { min-height: 32px; }
}
@media (max-width: 540px) {
  .view-heading { flex-wrap: wrap; align-items: start; }
  .view-heading > .button { padding: 0 8px; }
  .journal-command { flex-wrap: wrap; gap: 4px; }
  .journal-command .search { flex: 1 1 100%; order: 1; width: 100%; }
  .journal-command .timezone { display: none; }
  .journal-command #open-columns { margin-left: auto; }
  .toolbar { padding-inline: 8px; }
  .status-filters { padding-inline: 7px; }
  .toolbar .search { width: 100%; }
  .toolbar .select { max-width: 48%; }
  .drawer-header, .drawer-content, .drawer-footer { padding-inline: 15px; }
  .drawer-nav { overflow-x: auto; }
  .requisite-fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .drawer[open] { animation: drawer-in .16s ease-out; }
  @keyframes drawer-in { from { transform: translateX(16px); opacity: .7; } to { transform: translateX(0); opacity: 1; } }
}

.account-page {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(0, 1fr);
  min-height: 100dvh;
  background: var(--canvas);
}
.login-scene {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(23px, 5vh, 65px);
  min-width: 0;
  min-height: 580px;
  overflow: hidden;
  padding: clamp(25px, 4.5vw, 78px);
  background: var(--header);
  color: var(--header-ink);
}
.scene-media { position: absolute; z-index: -2; inset: 0; }
.scene-photo { display: block; width: 100%; height: 100%; object-fit: cover; }
.scene-terminal { object-position: 53% center; }
.scene-road { object-position: 51% center; }
.scene-delivery { object-position: 63% center; }
.login-scene::after {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, #0b1e34f5 0%, #0b1e34b5 26%, #0b1e3433 51%, #0b1e3499 70%, #0b1e34fa 100%);
}
.login-brand .brand-mark { width: 36px; }
.login-brand .brand-name { width: 155px; }
.scene-intro h2 {
  font-size: clamp(39px, 5vw, 82px);
  line-height: 1.03;
  letter-spacing: -.055em;
  overflow-wrap: anywhere;
}
.scene-intro p { max-width: 36ch; margin-top: 10px; color: #f1f4f0; font-size: clamp(16px, 1.5vw, 21px); line-height: 1.42; }
.scene-route { width: 100%; max-width: 620px; margin-top: auto; }
.route-stages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.route-stage {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  min-height: 46px;
  padding: 4px 4px 4px 0;
  border: 0;
  border-top: 2px solid #e2eaf0ac;
  background: transparent;
  color: var(--header-ink);
  text-align: start;
  font-size: 14px;
  font-weight: 650;
}
.route-stage::before { content: ''; width: 7px; height: 7px; flex: none; border: 1px solid currentColor; border-radius: 50%; }
.route-stage:hover { border-color: var(--header-ink); }
.route-stage[aria-pressed="true"] { border-color: var(--signal); }
.route-stage[aria-pressed="true"]::before { background: var(--signal); border-color: var(--signal); }
.route-stage:focus-visible { outline-color: var(--signal); outline-offset: 2px; }
.route-description { min-height: 2.8em; color: #e7eef5; font-size: 14px; line-height: 1.4; }
.login-workspace {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: clamp(22px, 3vw, 64px);
}
.login-panel {
  width: min(100%, 540px);
  padding: clamp(24px, 4vw, 48px);
  border-radius: 12px;
  box-shadow: 0 16px 44px #1025400e;
}
.login-panel h1 { font-size: clamp(23px, 4vw, 30px); }
.login-form { display: grid; gap: 15px; margin-top: 22px; }
.login-form .field input, .login-form .button { min-height: 44px; font-size: 16px; }
.login-form .field input { border-color: #8a9fb4; }
.login-form .button { margin-top: 4px; }
@media (prefers-reduced-motion: no-preference) {
  .scene-photo:not([hidden]) { animation: scene-in .24s ease-out; }
  @keyframes scene-in { from { opacity: .6; } to { opacity: 1; } }
}
@media (max-width: 900px) {
  .account-page { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-scene { min-height: clamp(300px, 43vh, 390px); padding: 14px clamp(16px, 5vw, 42px); gap: 15px; }
  .login-brand .brand-mark { width: 28px; }
  .login-brand .brand-name { width: 116px; }
  .scene-intro h2 { font-size: clamp(31px, 6vw, 49px); }
  .scene-intro p { margin-top: 5px; font-size: 14px; }
  .route-description { min-height: 2.8em; font-size: 13px; }
  .login-workspace { padding: 18px clamp(14px, 4vw, 34px) 26px; }
}
.account-message { color: var(--ink); font-size: 13px; line-height: 1.4; }
.account-message:empty { display: none; }
.login-panel .account-message { margin-top: 12px; color: var(--danger); }
.admin-form { display: flex; flex: none; flex-wrap: wrap; align-items: end; gap: 8px; padding: 10px 12px; background: var(--subtle); }
.admin-form .field { flex: 0 1 240px; }
.admin-form .field input { min-height: 34px; }
.data-panel .account-message { padding: 7px 12px; border-top: 1px solid var(--line-soft); }
.admin-table { min-width: 450px; }
.admin-table .button { min-height: 27px; font-size: 12px; }
.admin-row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; }
.audit-filters .field { flex: 0 1 160px; }
.audit-filters .field:has([name="action"]) { flex-basis: 240px; }
.audit-table { min-width: 820px; }
.audit-table td:last-child { white-space: pre-line; overflow-wrap: anywhere; }
.role-settings { width: min(650px, calc(100% - 18px)); }
.role-settings form { min-height: 0; overflow: auto; padding: 12px; }
.role-settings fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
.role-settings .field { max-width: 240px; }
.role-settings table { min-width: 430px; }
.role-settings :is(th, td):not(:first-child) { text-align: center; }
.role-settings input[type="checkbox"] { accent-color: var(--primary); }
.role-settings .role-note { color: var(--muted); font-size: 13px; }
.role-settings footer { justify-content: flex-end; }

@media (max-width: 620px) {
  .app-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 5px; padding-inline: 8px; }
  .app-header .brand { min-height: 41px; }
  .app-header .brand-name { width: 102px; }
  .navigation { grid-column: 1 / -1; grid-row: 2; margin-inline: -8px; padding-inline: 8px; border-top: 1px solid #ffffff18; overflow-x: auto; }
  .navigation .nav-button { padding-inline: 7px; gap: 5px; }
  .account-actions { grid-column: 2; grid-row: 1; }
  .account-actions .nav-button { padding-inline: 6px; font-size: 12px; }
  .admin-form .field { flex: 1 1 140px; }
}
