:root {
    --brand: #f5a800;
    --brand-primary: #1d1d1b;
    --ink: #111827;
    --ink-soft: #374151;
    --muted: #6b7280;
    --canvas: #f3f4f6;
    --panel: #f1f5f9;
    --panel-light: #fefefe;
    --navbar-surface: #f8fafc;
    --line: #e2e8f0;
    --control-line: color-mix(in srgb, var(--brand-primary) 28%, #d1d5db);
    --radius-panel: 8px;
    --radius-pill: 9999px;
    --layer-map: 0;
    --layer-toolbar: 20;
    --layer-navigation: 50;
    --layer-dialog: 70;
    --contrast-black: #000000;
    --contrast-white: #ffffff;
    --amber: #b87500;
    --blue: #2674d9;
    --cyan: #0789a6;
    --green: #21875b;
    --red: #b73535;
    --gray: #77807d;
    font-family: Figtree, "Segoe UI", system-ui, sans-serif;
    color: var(--ink);
    background: var(--canvas);
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body {
    min-width: 320px;
    margin: 0;
    background-color: var(--canvas);
    color: var(--ink);
    font-size: .875rem;
    line-height: 1.5;
}

a { color: var(--ink); text-decoration: underline; text-decoration-color: rgb(29 29 27 / 32%); text-underline-offset: .16em; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--brand-primary); }
[hidden] { display: none !important; }

.skip-link {
    position: fixed;
    z-index: 9999;
    top: .75rem;
    left: .75rem;
    transform: translateY(-180%);
    padding: .7rem 1rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--canvas);
}
.skip-link:focus { transform: translateY(0); }

.shell { min-height: calc(100dvh - 2.5rem); }
.app-navbar {
    position: sticky;
    top: 0;
    z-index: var(--layer-navigation);
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 56px;
    padding: .5rem 1rem;
    border-bottom: 1px solid var(--line);
    background: var(--navbar-surface);
}
.navbar-leading { display: flex; align-items: center; gap: 1rem; min-width: 0; flex: 1; }
.brand { min-height: 36px; display: flex; align-items: center; color: var(--brand-primary); text-decoration: none; flex: 0 0 auto; }
.brand:hover { text-decoration: none; }
.brand img { width: 132px; max-height: 36px; display: block; object-fit: contain; object-position: left center; filter: brightness(0); }
.brand-fallback { display: block; }
.brand-fallback strong { display: block; font-size: 1.1rem; font-weight: 800; letter-spacing: -.025em; }
.brand-fallback small { display: block; color: var(--muted); font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; }
.navbar-location { overflow: hidden; padding-left: 1rem; border-left: 1px solid var(--line); color: var(--ink-soft); font-size: .75rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.navigation-menu, .account-menu { position: relative; flex: 0 0 auto; }
.navigation-menu > summary, .account-menu > summary { list-style: none; cursor: pointer; }
.navigation-menu > summary::-webkit-details-marker, .account-menu > summary::-webkit-details-marker { display: none; }
.navigation-trigger { display: inline-flex; align-items: center; gap: .5rem; min-height: 40px; padding: .4rem .9rem; border: 1px solid var(--brand-primary); border-radius: var(--radius-pill); background: var(--brand-primary); color: #f8fafc; font-size: .75rem; font-weight: 700; }
.navigation-trigger svg, .account-trigger svg { width: 16px; height: 16px; flex: 0 0 auto; }
.navigation-popover, .account-popover { position: absolute; top: calc(100% + .75rem); padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--navbar-surface); box-shadow: 0 8px 24px rgb(15 23 42 / 10%); }
.navigation-popover { left: 0; width: min(420px, calc(100vw - 2rem)); max-height: calc(100dvh - 5rem); overflow-y: auto; }
.navigation-search { margin-bottom: .75rem; }
.navigation-search input { min-height: 36px; border-radius: var(--radius-pill); font-size: .8rem; }
.navigation-empty { margin: .75rem; color: var(--muted); }
.nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem; }
.nav a {
    min-height: 36px;
    display: flex;
    align-items: center;
    padding: .45rem .65rem;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--ink-soft);
    font-size: .8rem;
    font-weight: 600;
    text-decoration: none;
}
.nav a:hover { background: var(--panel); color: var(--brand-primary); text-decoration: none; }
.nav a.active { border-color: var(--control-line); background: var(--panel); color: var(--brand-primary); font-weight: 750; }
.nav-section {
    grid-column: 1 / -1;
    margin: .7rem .65rem .2rem;
    color: var(--muted);
    font-size: .65rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.account-trigger { display: inline-flex; align-items: center; gap: .5rem; min-height: 36px; padding: .3rem .65rem .3rem .3rem; border: 1px solid var(--control-line); border-radius: var(--radius-pill); color: var(--brand-primary); font-size: .75rem; font-weight: 700; }
.account-avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--panel); }
.account-popover { right: 0; width: min(290px, calc(100vw - 2rem)); }
.environment {
    display: grid;
    gap: .15rem;
    padding: .25rem;
    color: var(--muted);
    font-size: .73rem;
}
.environment strong { overflow-wrap: anywhere; color: var(--ink); }
.environment form { margin-top: .7rem; }
.environment button { width: 100%; }

.content { min-width: 0; padding: 1.25rem clamp(1rem, 2vw, 2rem) 2rem; }
.guest-content { min-height: calc(100dvh - 2.5rem); display: grid; place-items: center; padding-block: 2rem; }
.auth-card { width: min(420px, 100%); padding: 1.5rem; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 1.5rem; }
.auth-brand img { width: 176px; height: 44px; max-height: 44px; }
.auth-heading { margin-bottom: 1.25rem; }
.auth-card form { display: grid; gap: .8rem; }
.auth-card label { margin: 0 0 -.55rem; }
.auth-card button { width: 100%; margin-top: .3rem; }
.auth-card .error, .auth-card .success { margin: 0; }
.auth-link { margin: 1rem 0 0; text-align: center; font-size: .8rem; }
.topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}
.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; flex-wrap: wrap; }
.header-actions form { margin: 0; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.25; }
h2 { margin: 1.25rem 0 .75rem; font-size: 1rem; font-weight: 700; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
.eyebrow { margin-bottom: .3rem; color: var(--muted); font-size: .65rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: .8rem; }

.card, .map-panel, .connected-panel, .table-wrap {
    border: 1px solid var(--line);
    background: var(--panel-light);
}
.card { padding: 1rem; border-radius: var(--radius-panel); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .8rem; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); margin-bottom: 1.5rem; }
.metric {
    display: grid;
    min-height: 96px;
    align-content: center;
    gap: .35rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--panel-light);
}
.metric strong { font-size: clamp(1.75rem, 3vw, 2.25rem); font-weight: 750; letter-spacing: -.04em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.metric span { color: var(--muted); font-size: .78rem; font-weight: 700; }

.dashboard-filters { display: grid; grid-template-columns: minmax(180px, 1.5fr) repeat(2, minmax(85px, .5fr)) minmax(210px, 1.2fr) auto; gap: .75rem; align-items: end; margin-bottom: 1rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel-light); }
.dashboard-filters > div { min-width: 0; }
.dashboard-filters input, .dashboard-filters select { width: 100%; min-width: 0; min-height: 44px; }
.dashboard-filter-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.dashboard-filter-actions .button, .dashboard-filter-actions button { min-height: 44px; }
.dashboard-filters .field-error { margin: .3rem 0 0; color: var(--red); }
.dashboard-workspace { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .58fr); gap: 1rem; align-items: stretch; }
.map-panel { min-width: 0; overflow: hidden; padding: .75rem; border-radius: var(--radius-panel); }
.map-panel:fullscreen { width: 100vw; height: 100vh; padding: 1rem; border: 0; border-radius: 0; background: var(--canvas); }
.map-panel:fullscreen .map-operations { height: calc(100vh - 105px); min-height: 0; }
.map-toolbar, .connected-heading, .section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}
.map-toolbar h2, .connected-heading h2, .section-heading h2 { margin: 0; }
.map-controls { display: flex; align-items: center; gap: .45rem; }
.map-controls select { min-width: 190px; }
.map { min-height: 480px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel); }
.leaflet-container { position: relative; z-index: var(--layer-map); isolation: isolate; font-family: inherit; }
.leaflet-popup-content-wrapper { border-radius: var(--radius-panel); }
.map-small { min-height: 360px; }
.map-operations { min-height: 650px; }
.map-legend { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: .65rem; color: var(--muted); font-size: .72rem; }
.map-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.operation-map-icon { border: 0; background: transparent; }
.operation-map-symbol, .map-legend-symbol {
    display: inline-grid;
    place-items: center;
    border: 2px solid var(--contrast-white);
    border-radius: 50%;
    background: var(--gray);
    color: var(--contrast-white);
    box-shadow: 0 2px 8px rgb(0 0 0 / 24%);
}
.operation-map-symbol { width: 38px; height: 38px; }
.map-legend-symbol { width: 22px; height: 22px; flex: 0 0 auto; box-shadow: none; }
.operation-map-symbol svg { width: 24px; height: 24px; }
.map-legend-symbol svg { width: 14px; height: 14px; }
.operation-map-symbol svg, .map-legend-symbol svg { fill: currentColor; }
.operation-map-symbol.is-client, .map-legend-symbol.is-client { background: var(--blue); }
.operation-map-symbol.is-available, .map-legend-symbol.is-available,
.operation-map-symbol.is-service, .map-legend-symbol.is-service { background: var(--green); }
.operation-map-symbol.is-occupied, .map-legend-symbol.is-occupied { background: var(--red); }
.operation-map-symbol.is-guard, .map-legend-symbol.is-guard { background: var(--amber); }
.operation-map-symbol.is-radio, .map-legend-symbol.is-radio { background: var(--blue); }
.operation-map-symbol.is-unavailable, .map-legend-symbol.is-unavailable { background: var(--gray); }
.operation-map-symbol.is-stale, .map-legend-symbol.is-stale { background: var(--gray); }
.map-assignment { display: grid; grid-template-columns: minmax(180px, 1.2fr) minmax(180px, 1fr) auto; gap: .75rem; align-items: end; margin-top: .9rem; padding: .9rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel); }
.map-assignment p { grid-column: 1 / -1; margin: 0; }
.legend-dot { width: .62rem; height: .62rem; display: inline-block; border-radius: 50%; }
.dot-online { background: var(--green); }
.dot-available { background: var(--green); }
.dot-occupied { background: var(--red); }
.dot-guard { background: var(--amber); }
.dot-unavailable { background: var(--gray); }
.dot-current { background: var(--blue); }
.dot-stale { background: var(--gray); }
.dot-offline { background: var(--gray); }
.dot-trip { background: var(--blue); }
.connected-panel { min-width: 0; padding: .85rem; border-radius: var(--radius-panel); }
.connected-heading span {
    min-width: 2rem;
    padding: .35rem .55rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--canvas);
    text-align: center;
    font-size: .75rem;
    font-weight: 800;
}
.presence-list { display: grid; gap: .45rem; max-height: 650px; overflow: auto; padding-right: .15rem; }
.driver-card { display: grid; gap: .45rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel-light); }
.driver-card-top, .driver-card-meta { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.driver-identity { min-width: 0; display: flex; align-items: baseline; gap: .28rem; flex-wrap: wrap; }
.identity-primary { color: var(--ink); font-weight: 850; }
.identity-secondary, .identity-separator { color: var(--muted); font-size: .78rem; }
.driver-card-meta { color: var(--muted); font-size: .72rem; }
.operation-map-symbol { position: relative; }
.coverage-watch-label { padding: .2rem .4rem; border-radius: .4rem; background: #fef3c7; color: #92400e; }

.table-wrap { overflow-x: auto; border-radius: var(--radius-panel); }
table { width: 100%; border-collapse: collapse; }
th, td { padding: .65rem .75rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); font-size: .8rem; }
th { color: var(--muted); background: var(--panel); font-size: .67rem; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f8fafc; }
.compact-table th, .compact-table td { padding: .68rem .75rem; }
.compact-table td { font-size: .85rem; }
.row-title { display: block; margin-bottom: .2rem; font-weight: 850; }
.row-meta { display: block; color: var(--muted); font-size: .72rem; line-height: 1.4; word-break: break-word; }
.trip-row-active { box-shadow: inset 3px 0 0 var(--blue); }
.trip-row-latest { background: rgb(33 135 91 / 5%); }
.row-flag { display: inline-block; color: var(--green); font-size: .67rem; font-weight: 850; }
.route-cell { min-width: 190px; }
.route-point { width: 1.35rem; height: 1.35rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--canvas); font-size: .68rem; font-style: normal; font-weight: 900; }
.route-start { background: var(--green); }
.route-end { background: var(--red); }
.route-map-marker { border: 0; background: transparent; }
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .77rem; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .27rem .55rem;
    border-radius: 999px;
    color: var(--canvas);
    font-size: .7rem;
    font-weight: 850;
    white-space: nowrap;
}
.badge::before { width: .42rem; height: .42rem; border-radius: 50%; background: currentColor; content: ""; }
.badge-searching { background: var(--amber); }
.badge-stale { background: var(--gray); }
.badge-assigned { background: var(--blue); }
.badge-driver_en_route { background: var(--cyan); }
.badge-driver_arrived, .badge-in_progress, .badge-completed, .badge-enabled, .badge-online { background: var(--green); }
.badge-available, .badge-service { background: var(--green); }
.badge-occupied { background: var(--red); }
.badge-guard { background: var(--amber); }
.badge-unavailable, .badge-location-old { background: var(--gray); }
.badge-cancelled, .badge-emergency, .badge-blocked { background: var(--red); }
.badge-offline, .badge-expired, .badge-unknown { background: var(--gray); }
.status-stack { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .25rem; }

label { display: block; margin-bottom: .3rem; font-size: .75rem; font-weight: 750; }
input, select, textarea {
    width: 100%;
    min-height: 38px;
    padding: .5rem .7rem;
    border: 1px solid var(--control-line);
    border-radius: 6px;
    background: var(--panel-light);
    color: var(--ink);
}
.checkbox-row { display: flex; align-items: flex-start; gap: .6rem; margin: 0; line-height: 1.45; }
.checkbox-row input[type="checkbox"] { width: 1.1rem; height: 1.1rem; min-height: 0; flex: 0 0 auto; margin: .15rem 0 0; accent-color: var(--brand); }
.checkbox-row span { font-size: .78rem; font-weight: 700; }
textarea { resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; min-height: 0; accent-color: var(--brand-primary); }
button, .button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .45rem .9rem;
    border: 1px solid var(--brand-primary);
    border-radius: var(--radius-pill);
    background: var(--brand-primary);
    color: #f8fafc;
    font-size: .75rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}
button:disabled, .button:disabled { cursor: not-allowed; opacity: .48; }
button:disabled:hover, .button:disabled:hover { border-color: var(--ink); background: var(--ink); color: var(--canvas); }
button:hover, .button:hover { background: color-mix(in srgb, var(--brand-primary) 88%, black); border-color: var(--brand-primary); color: #f8fafc; text-decoration: none; }
.button-secondary { border-color: var(--control-line); background: var(--panel-light); color: var(--brand-primary); }
.button-secondary:hover { border-color: var(--brand-primary); background: var(--panel); color: var(--brand-primary); }
.button-danger { border-color: rgb(183 53 53 / 35%); background: transparent; color: var(--red); }
.button-danger:hover { border-color: var(--red); background: var(--red); color: var(--canvas); }
.button-compact { min-height: 32px; padding: .375rem .75rem; font-size: .75rem; }

.source-pill, .live-indicator { display: inline-flex; align-items: center; padding: .48rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); font-size: .72rem; font-weight: 750; }
.live-indicator span { width: .48rem; height: .48rem; margin-right: .4rem; border-radius: 50%; background: var(--green); }
.filter-panel { margin-bottom: 1rem; padding: .85rem; }
.quick-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }
.filter-chip { min-height: 32px; padding: .375rem .75rem; border-color: var(--control-line); background: var(--panel-light); color: var(--brand-primary); font-size: .73rem; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: .55rem; align-items: end; }
.filter-grid .field-search { grid-column: span 2; }
.filter-grid .filter-actions { grid-column: span 2; }

.coverage-layout { display: grid; grid-template-columns: minmax(280px, .48fr) minmax(0, 1.25fr); gap: 1rem; align-items: start; }
.coverage-sidebar { display: grid; gap: 1rem; }
.coverage-list-card, .coverage-form { display: grid; gap: .9rem; }
.coverage-zone-list { display: grid; gap: .35rem; }
.coverage-zone-row {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .65rem;
    padding: .6rem .7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-panel);
    background: var(--panel-light);
    text-decoration: none;
}
.coverage-zone-row:hover, .coverage-zone-row.is-selected { border-color: var(--ink); text-decoration: none; }
.coverage-zone-row span:first-child { min-width: 0; display: grid; gap: .15rem; }
.coverage-zone-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coverage-zone-row small { color: var(--muted); }
.coverage-form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.coverage-drawing-status { margin: 0; color: var(--muted); font-size: .78rem; font-weight: 700; }
.coverage-map-card { position: sticky; top: 4.5rem; min-width: 0; }
.coverage-map { min-height: min(720px, calc(100vh - 160px)); }
.coverage-map .leaflet-draw-toolbar a { color: var(--ink); }
.coverage-legend { width: 1.1rem; height: .7rem; display: inline-block; border: 2px solid; border-radius: 4px; }
.coverage-legend-active { border-color: #9b6700; background: rgb(245 168 0 / 16%); }
.coverage-legend-registration { border-color: #1f5f8b; background: rgb(75 154 199 / 14%); }
.coverage-legend-selected { border-color: var(--ink); background: rgb(245 168 0 / 22%); }

@media (max-width: 900px) {
    .coverage-layout { grid-template-columns: 1fr; }
    .coverage-map-card { position: static; }
    .coverage-map { min-height: 480px; }
}
.filter-grid-trips { grid-template-columns: minmax(280px, 2fr) minmax(160px, .7fr) 78px auto; }
.filter-grid-trips .field-search, .filter-grid-trips .filter-actions { grid-column: auto; }
.filter-actions { display: flex; align-items: center; gap: .4rem; }
.filter-status { min-height: 1.1rem; margin: .6rem 0 0; }
.filter-panel.is-loading, [aria-busy="true"] { opacity: .62; pointer-events: none; }
.pagination-bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .7rem .2rem 0; color: var(--muted); font-size: .76rem; }
.pagination-actions { display: flex; align-items: center; gap: .5rem; }
.trip-link-row { cursor: pointer; transition: background-color 120ms ease; }
.trip-link-row:hover, .trip-link-row:focus-visible { background: var(--panel); }
.trip-link-row:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: -2px; }
.trip-row-action { color: var(--ink); font-size: .74rem; font-weight: 800; white-space: nowrap; }

.notice { margin-bottom: 1rem; padding: .8rem 1rem; border: 1px solid rgb(184 117 0 / 25%); border-radius: var(--radius-panel); background: #fffbeb; }
.notice.success, .success { border-color: rgb(33 135 91 / 22%); background: #e8f2eb; color: #185e41; }
.notice.error, .error { color: var(--red); }
.empty { padding: 2rem; text-align: center; color: var(--muted); }
.detail-list { display: grid; gap: .75rem; }
.detail-label, .detail-list dt { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .68rem; font-weight: 750; letter-spacing: .07em; text-transform: uppercase; }
.detail-list dd { margin: 0; }
.master-data-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; }
.master-data-summary > div { padding: .3rem; }
.master-data-summary strong { display: block; font-size: 1rem; }
.driver-profile-card { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 1rem; align-items: center; margin-bottom: 1rem; }
.driver-profile-card h2 { margin: 0 0 .45rem; }
.driver-profile-card p { max-width: 760px; margin-bottom: .8rem; color: var(--muted); line-height: 1.55; }
.driver-profile-photo { width: 112px; height: 112px; display: block; border: 1px solid var(--line); border-radius: 50%; object-fit: cover; background: var(--panel); }
.driver-profile-photo-empty { display: grid; place-items: center; color: var(--muted); font-size: .75rem; font-weight: 800; }
.driver-profile-actions { justify-content: flex-start; }
.profile-request-guidance { max-width: 900px; }
.profile-request-guidance h2 { margin: 0 0 .55rem; }
.profile-request-guidance p { max-width: 780px; margin-bottom: .45rem; line-height: 1.55; }
.profile-request-heading { margin-top: 1.5rem; }
.section-space { margin-top: 1rem; }
.settings-form { margin-top: 1rem; }
.settings-form-narrow { max-width: 48rem; }
.settings-form h2 { margin-top: 0; }
.settings-form > button { margin-top: 1rem; }
.form-description { max-width: 72ch; }
.profile-request-actions { display: flex; min-width: 180px; flex-wrap: wrap; gap: .45rem; }
.profile-request-actions form { margin: 0; }
.rider-profile-overview { display: grid; grid-template-columns: 148px minmax(0, 1fr); gap: 1.25rem; align-items: start; margin-bottom: 1rem; }
.rider-profile-photo img, .rider-profile-photo-placeholder { width: 128px; height: 128px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); }
.rider-profile-photo img { display: block; object-fit: cover; }
.rider-profile-photo-placeholder { display: grid; place-items: center; color: var(--muted); font-size: .75rem; font-weight: 800; text-align: center; }
.rider-profile-overview .section-heading { margin-bottom: .8rem; }
.rider-profile-overview h2, .rider-admin-grid h2, .rider-privacy-card h3 { margin: 0 0 .55rem; }
.rider-detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .85rem 1rem; margin: 0; }
.rider-detail-grid > div { min-width: 0; padding-top: .65rem; border-top: 1px solid var(--line); }
.rider-detail-grid dt { margin-bottom: .22rem; color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.rider-detail-grid dd { margin: 0; overflow-wrap: anywhere; font-weight: 700; }
.rider-detail-grid-compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rider-admin-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 1rem; margin-bottom: 1.35rem; align-items: start; }
.rider-admin-grid .card { height: 100%; }
.rider-admin-grid hr { margin: 1rem 0; border: 0; border-top: 1px solid var(--line); }
.profile-action-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.profile-action-row form { margin: 0; }
.rider-profile-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1.35rem; }
.rider-profile-form > div { min-width: 0; }
.profile-form-note { display: grid; align-content: center; gap: .2rem; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel); }
.rider-profile-form-confirmation, .profile-form-actions { grid-column: 1 / -1; }
.profile-form-actions { display: flex; align-items: center; gap: .65rem; }
.rider-privacy-card { display: grid; grid-template-columns: minmax(260px, .8fr) minmax(320px, 1.2fr); gap: 1.25rem; align-items: start; }
.rider-privacy-card p { line-height: 1.55; }
.rider-privacy-form { display: grid; gap: .8rem; padding-left: 1.25rem; border-left: 1px solid var(--line); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, .75fr); gap: 1rem; }
.command-panel { margin-bottom: 1rem; }
.command-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto; gap: .75rem; align-items: end; }
.command-actions { display: flex; align-items: center; gap: .5rem; }
.location-details > div { display: grid; gap: .25rem; padding-bottom: .75rem; border-bottom: 1px solid var(--line); }
.location-details > div:last-child { border-bottom: 0; }
.location-details span { color: var(--muted); }
.history-heading { margin-top: 1.2rem; }
.trip-detail-workspace { display: grid; grid-template-columns: minmax(420px, 1fr) minmax(300px, .62fr); gap: 1rem; align-items: start; }
.trip-map-card { min-width: 0; }
.trip-map-square { width: 100%; min-height: 0; aspect-ratio: 1 / 1; }
.trip-route-status { min-height: 1.1rem; margin: .65rem 0 0; }
.trip-track-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.trip-retention-panel { min-width: 0; }
.trip-track-lock-form { display: grid; gap: .55rem; }
.trip-track-lock-form input { min-width: 0; width: 100%; }
.detail-summary > div, .trip-retention-panel p { overflow-wrap: anywhere; }
.detail-summary { grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); }
.dot-simulated-capture { background: #7b4bc4; }
.trip-detail-sidebar { min-width: 0; display: grid; gap: 1rem; }
.command-panel-compact { margin: 0; padding: .85rem; }
.command-panel-compact .section-heading { margin-bottom: .55rem; }
.command-panel-compact .command-form { grid-template-columns: 1fr; gap: .55rem; }
.command-panel-compact .command-actions { align-items: stretch; }
.command-panel-compact .command-actions button { flex: 1; }
.trip-history-panel { padding: .85rem; }
.trip-history-panel .section-heading { margin-bottom: .45rem; }
.trip-history-list { max-height: 620px; display: grid; gap: 0; overflow: auto; margin: 0; padding: 0; list-style: none; }
.trip-history-item { position: relative; display: grid; grid-template-columns: 8px minmax(0, 1fr); gap: .65rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.trip-history-item:last-child { border-bottom: 0; }
.trip-history-marker { width: 8px; height: 8px; margin-top: .3rem; border-radius: 50%; background: var(--brand); }
.trip-history-content { min-width: 0; display: grid; gap: .12rem; }
.trip-history-content strong { font-size: .82rem; }
.trip-history-meta { color: var(--muted); font-size: .7rem; }

.dispatch-form { display: grid; gap: 1rem; }
.dispatch-layout { display: grid; grid-template-columns: minmax(500px, .95fr) minmax(430px, 1.05fr); gap: 1rem; align-items: start; }
.dispatch-form-column { display: grid; gap: 1rem; min-width: 0; }
.dispatch-section { padding: 1.15rem; }
.dispatch-route-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: 1rem; }
.dispatch-point { min-width: 0; margin: 0; padding: .85rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel-light); }
.dispatch-point legend { display: flex; align-items: center; gap: .4rem; padding: 0 .3rem; font-size: .78rem; font-weight: 850; }
.dispatch-point-dot { width: .68rem; height: .68rem; display: inline-block; flex: 0 0 auto; border-radius: 50%; }
.dot-origin { background: var(--red); }
.dot-destination { background: var(--green); }
.dispatch-coordinate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .55rem; margin-top: .65rem; }
.dispatch-map-mode { width: 100%; margin-top: .7rem; }
.dispatch-driver-toolbar { display: grid; grid-template-columns: minmax(180px, 1fr) 92px auto; gap: .55rem; align-items: end; margin-bottom: .85rem; }
.dispatch-empty-state { display: grid; gap: .25rem; padding: 1rem; border: 1px dashed var(--control-line); border-radius: var(--radius-panel); color: var(--muted); }
.dispatch-candidate-table input[type="radio"] { width: 1.15rem; height: 1.15rem; accent-color: var(--brand); }
.dispatch-map-card { position: sticky; top: 4.5rem; padding: .9rem; }
.dispatch-map-toolbar { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; margin-bottom: .65rem; }
.dispatch-map-choice { border-color: var(--line); background: var(--panel); color: var(--ink); }
.dispatch-map-choice.is-active { border-color: var(--ink); background: var(--ink); color: var(--canvas); }
.dispatch-map { width: 100%; min-height: 0; height: auto; aspect-ratio: 1 / 1; cursor: crosshair; }
.dispatch-map.is-selecting-destination { cursor: cell; }
.dispatch-map-status { min-height: 1.25rem; margin: .65rem 0 0; color: var(--muted); font-size: .78rem; }
.dispatch-submit-bar { position: sticky; z-index: var(--layer-toolbar); bottom: 1rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel-light); }
.dispatch-submit-bar > div:first-child { display: grid; gap: .1rem; padding-left: .25rem; }
.dispatch-submit-bar span { color: var(--muted); font-size: .72rem; }

.user-create { max-width: 720px; margin-bottom: 1rem; }
.user-create-form { display: grid; grid-template-columns: 1fr 180px auto; gap: .6rem; align-items: end; }
.user-create-form-direct { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.user-create-form-direct > button { grid-column: 1 / -1; justify-self: start; }
.user-actions { justify-content: flex-start; align-items: flex-start; }
.user-editor > summary { list-style: none; cursor: pointer; }
.user-editor > summary::-webkit-details-marker { display: none; }
.user-editor[open] { width: 270px; max-width: 100%; }
.user-editor form { display: grid; gap: .6rem; margin-top: .75rem; }
.user-editor .error { margin: .35rem 0 0; }
.activation-code { display: flex; gap: .5rem; align-items: center; }
.activation-code input { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.operator-account-card { display: grid; gap: 1rem; }
.operator-account-card .section-heading { margin: 0; }
.operator-account-card h3, .account-security-actions h3 { margin: 0; font-size: 1rem; }
.account-email { max-width: 100%; overflow-wrap: anywhere; color: var(--muted); font-size: .8rem; }
.operator-recovery-form { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(220px, .85fr) auto; gap: .75rem; align-items: end; }
.operator-recovery-form p { margin: 0 0 .35rem; line-height: 1.5; }
.operator-recovery-form > form { display: grid; gap: .6rem; }
.activation-delivery { display: grid; grid-template-columns: minmax(220px, .65fr) minmax(300px, 1fr); gap: 1rem; align-items: center; }
.activation-delivery p { margin: .25rem 0 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.account-security-actions { display: grid; gap: .8rem; }
.account-security-actions .header-actions { justify-content: flex-start; }

.product-signature {
    min-height: 2.5rem;
    padding: .65rem 1rem;
    border-top: 1px solid var(--line);
    background: var(--panel-light);
    color: var(--muted);
    text-align: center;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .01em;
}
.product-signature span { color: var(--muted); font-weight: 650; }

.safety-alert-dialog {
    position: fixed;
    z-index: var(--layer-dialog);
    inset: 0;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgb(29 29 27 / 72%);
}
.safety-alert-dialog[hidden] { display: none; }
.safety-alert-card {
    width: min(620px, 100%);
    max-height: calc(100dvh - 2rem);
    overflow-y: auto;
    position: relative;
    z-index: 1;
    padding: clamp(1rem, 3vw, 1.5rem);
    border: 2px solid var(--red);
    border-radius: var(--radius-panel);
    background: var(--panel-light);
    color: var(--ink);
}
.safety-alert-eyebrow { margin: 0 0 .35rem; color: var(--red); font-size: .75rem; font-weight: 900; letter-spacing: .1em; }
.safety-alert-card h2 { margin: 0 0 .35rem; font-size: clamp(1.2rem, 3vw, 1.5rem); }
.safety-alert-card > p { line-height: 1.5; }
.safety-alert-details { display: grid; gap: .65rem; margin: 1rem 0; }
.safety-alert-details > div { padding-bottom: .65rem; border-bottom: 1px solid var(--line); }
.safety-alert-details dt { margin-bottom: .15rem; color: var(--muted); font-size: .7rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.safety-alert-details dd { margin: 0; overflow-wrap: anywhere; font-weight: 800; }
.safety-alert-queue { color: var(--red); font-weight: 850; }
.safety-alert-close { width: 100%; min-height: 52px; border-color: var(--red); background: var(--red); }
.safety-alert-close:hover { border-color: #8f2525; background: #8f2525; color: var(--canvas); }
.safety-alert-resolution { display: grid; gap: 1rem; margin-top: 1rem; }
.safety-alert-resolution textarea { min-height: 110px; }
.safety-alert-resolution small { display: block; margin-top: .25rem; color: var(--muted); }
.safety-alert-form-error { min-height: 1.2rem; margin: 0; color: var(--red); font-weight: 750; }

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

@media (max-width: 1180px) {
    .dashboard-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dashboard-filter-person, .dashboard-filter-state { grid-column: span 2; }
    .dashboard-filter-actions { grid-column: span 2; }
    .dispatch-layout { grid-template-columns: 1fr; }
    .dispatch-map-column { grid-row: 1; }
    .dispatch-map-card { position: static; }
    .dashboard-workspace { grid-template-columns: 1fr; }
    .presence-list { max-height: 420px; }
    .trip-detail-workspace { grid-template-columns: 1fr; }
    .trip-history-list { max-height: 440px; }
}

@media (max-width: 860px) {
    .app-navbar { gap: .5rem; padding-inline: .75rem; }
    .navbar-leading { gap: .65rem; }
    .navbar-location { display: none; }
    .navigation-popover { width: min(420px, calc(100vw - 1.5rem)); }
    .content { padding: 1rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .filter-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rider-admin-grid, .rider-privacy-card { grid-template-columns: 1fr; }
    .rider-privacy-form { padding-top: 1rem; padding-left: 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 640px) {
    .dashboard-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-filter-person, .dashboard-filter-state, .dashboard-filter-actions { grid-column: 1 / -1; }
    .dashboard-filter-actions > * { flex: 1; }
    .brand img { width: 108px; }
    .account-trigger-label { display: none; }
    .account-trigger { padding-right: .3rem; }
    .auth-card { padding: 1.25rem; }
    input, select, textarea { font-size: 1rem; }
    button, .button { min-height: 40px; }
    .topbar, .section-heading, .map-toolbar, .pagination-bar { align-items: stretch; flex-direction: column; }
    .header-actions { justify-content: flex-start; }
    .map-controls { align-items: stretch; flex-wrap: wrap; }
    .map-controls select { min-width: 0; }
    .map-operations { min-height: 480px; }
    .filter-grid, .filter-grid-trips { grid-template-columns: 1fr; }
    .filter-grid .field-search, .filter-grid .filter-actions { grid-column: auto; }
    .command-form, .user-create-form { grid-template-columns: 1fr; }
    .operator-recovery-form, .activation-delivery, .map-assignment { grid-template-columns: 1fr; }
    .driver-profile-card { grid-template-columns: 1fr; }
    .rider-profile-overview, .rider-profile-form { grid-template-columns: 1fr; }
    .rider-profile-form-confirmation, .profile-form-actions { grid-column: auto; }
    .rider-detail-grid-compact { grid-template-columns: 1fr; }
    .command-actions { align-items: stretch; flex-direction: column; }
    .dispatch-route-fields, .dispatch-coordinate-grid { grid-template-columns: 1fr; }
    .dispatch-driver-toolbar { grid-template-columns: 1fr 90px; }
    .dispatch-driver-toolbar button { grid-column: 1 / -1; }
    .dispatch-submit-bar { position: static; align-items: stretch; flex-direction: column; }
    .dispatch-submit-bar .filter-actions { display: grid; grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

@media print {
    .app-navbar, .product-signature, .skip-link { display: none; }
    .content { padding: 0; }
    .table-wrap { overflow: visible; }
}

/* Dense operational logbooks keep capture separate from refreshed results. */
.central-workspace { display:grid; grid-template-columns:minmax(300px,340px) minmax(0,1fr); gap:8px; align-items:start; }
.logbook-main { min-width:0; }
.logbook-roster { margin:8px 0; }
.central-capture { position:sticky; top:72px; padding:6px; max-height:calc(100dvh - 84px); overflow:auto; }
.central-capture h2 { margin:4px 0 8px; font-size:13px; }
.logbook-capture { display:grid; gap:6px; }
.logbook-capture .field { min-width:0; }
.logbook-capture input,.logbook-capture select,.logbook-capture textarea { width:100%; }
.central-workspace .logbook-capture input,.central-workspace .logbook-capture select,.central-workspace .logbook-capture textarea,.logbook-dialog .logbook-capture input,.logbook-dialog .logbook-capture select { min-height:28px; padding:3px 6px; font-size:12px; }
.logbook-capture label { font-size:11px; margin-bottom:2px; }
.logbook-filter { display:flex; gap:6px; align-items:end; flex-wrap:wrap; }
.logbook-filter .field { flex:0 0 auto; }
.logbook-filter #trip-date { width:132px; }
.logbook-filter #trip-unit { width:88px; }
.logbook-filter #trip-search { width:168px; }
.logbook-filter input,.logbook-filter select { min-height:28px; padding:3px 6px; font-size:12px; }
.logbook-filter label { font-size:11px; margin-bottom:2px; }
.central-workspace .filter-panel { padding:6px; margin-bottom:6px; }
.logbook-filter button { min-height:28px; padding:4px 9px; font-size:11px; white-space:nowrap; }
.central-workspace .filter-status { margin:4px 0 0; font-size:11px; }
.logbook-filter input,.logbook-filter select { width:100%; }
.logbook-filter button { margin-bottom:0; }
.logbook-table th,.logbook-table td { padding:3px 4px; font-size:11px; line-height:1.35; }
.logbook-table { min-width:900px; }
.logbook-table .row-meta { font-size:10px; margin-top:2px; }
.logbook-table th button { padding:0; border:0; border-radius:0; background:transparent; color:inherit; font:inherit; min-height:24px; text-transform:inherit; }
.logbook-table td { vertical-align:top; }
.logbook-row-actions { display:flex; gap:5px; flex-wrap:wrap; align-items:center; }
.logbook-row-actions form { margin:0; }
.logbook-row-actions { max-width:none; flex-wrap:nowrap; gap:3px; }
.logbook-row-actions .button-compact { min-height:30px; padding:4px 8px; font-size:11px; }
.logbook-row-actions .logbook-action-icon { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; min-height:32px; padding:0; border-radius:50%; flex-shrink:0; }
.logbook-action-icon svg { width:16px; height:16px; pointer-events:none; }
.logbook-col-time { width:76px; }
.logbook-col-unit { width:62px; }
.logbook-col-code { width:198px; }
.logbook-col-state { width:86px; }
.logbook-col-central { width:100px; }
.logbook-col-actions { width:245px; }
.logbook-col-customer { min-width:110px; }
.logbook-table .logbook-driver { max-width:112px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.logbook-table .unit-reference { font-size:14px; font-weight:700; color:var(--ink); text-align:center; }
.logbook-origin { display:block; width:100%; text-align:center; font-size:10px; font-weight:600; background:#e2e8f0; color:#334155; }
.logbook-origin-500 { background:#16a34a; color:#fff; }
.logbook-origin-56 { background:#2563eb; color:#fff; }
.logbook-col-time strong { display:block; text-align:center; }
.logbook-complete { background:#059669; border-color:#047857; color:#fff; }
.logbook-cancel { background:#b91c1c; border-color:#991b1b; color:#fff; }
.logbook-table .badge-in_progress,.logbook-table .badge-assigned,.logbook-table .badge-driver_en_route,.logbook-table .badge-driver_arrived { background:#dbeafe; color:#1e40af; }
.logbook-table .badge-in_progress::before,.logbook-table .badge-assigned::before { background:currentColor; }
.logbook-codes { display:flex; flex-wrap:nowrap; gap:4px; margin-bottom:5px; }
.logbook-codes .trip-code { min-height:24px; min-width:29px; padding:2px 6px; border-radius:4px; font-size:11px; line-height:18px; font-weight:500; border:1px solid #d1d5db; background:#fff; color:#374151; }
.logbook-codes .trip-code-42,.logbook-codes .trip-code-92 { background:#fef2f2; border-color:#fca5a5; color:#991b1b; }
.logbook-codes .trip-code-43_400 { background:#f5f3ff; border-color:#c4b5fd; color:#5b21b6; }
.logbook-codes .trip-code-55 { background:#f0f9ff; border-color:#7dd3fc; color:#0369a1; }
.logbook-codes .trip-code-91 { background:#fefce8; border-color:#fde047; color:#a16207; }
.logbook-codes .trip-code-42.is-active { background:#dc2626; border-color:#b91c1c; color:#fff; }
.logbook-codes .trip-code-43_400.is-active { background:#7c3aed; border-color:#5b21b6; color:#fff; }
.logbook-codes .trip-code-55.is-active { background:#0284c7; border-color:#0369a1; color:#fff; }
.logbook-codes .trip-code-90.is-active { background:#f3f4f6; border-color:#d1d5db; color:#1f2937; font-weight:600; }
.logbook-codes .trip-code-91.is-active { background:#eab308; border-color:#a16207; color:#fff; }
.logbook-codes .trip-code-92.is-active { background:#b91c1c; border-color:#7f1d1d; color:#fff; }
.logbook-table .logbook-code-42 td,.logbook-table .logbook-code-92 td { background:#fee2e2; }
.logbook-table .logbook-code-43_400 td { background:#ede9fe; }
.logbook-table .logbook-code-55 td { background:#e0f2fe; }
.logbook-table .logbook-code-91 td { background:#fef3c7; }
.logbook-code { display:inline-block; border:1px solid currentColor; padding:2px 7px; border-radius:6px; margin-bottom:5px; }
.logbook-table .logbook-code-42 td { background:#fee2e2; }
.logbook-code-42 .logbook-code { color:#b91c1c; background:#fee2e2; }
.logbook-table .logbook-code-68 td { background:#fff7ed; }
.logbook-code-68 .logbook-code { color:#9a3412; background:#ffedd5; }
.badge-pending { color:#854d0e; background:#fef9c3; }
.central-shift { display:flex; gap:12px; flex-wrap:wrap; align-items:center; padding:6px; }
.central-shift form { margin:0; }
.central-shift select { width:auto; min-width:220px; }
.central-adjuster { margin-left:auto; text-align:right; font-size:12px; }
.central-adjuster strong { display:block; font-size:18px; color:var(--ink); }
.logbook-dialog { position:fixed; inset:0 0 0 auto; margin:0; height:100dvh; max-height:100dvh; width:min(540px,100vw); max-width:100vw; border:0; border-left:1px solid var(--line); padding:0; background:var(--panel-light); color:var(--ink); }
.logbook-dialog::backdrop { background:rgb(15 23 42 / 35%); }
.logbook-dialog>header { position:sticky; top:0; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px 16px; background:var(--panel-light); border-bottom:1px solid var(--line); z-index:1; }
.logbook-dialog>header h2 { margin:0; }
.logbook-dialog [data-logbook-dialog-body] { padding:16px; }
.logbook-dialog-wide { width:min(1000px,96vw); }
.logbook-frame { border:0; width:100%; min-height:80dvh; }
[data-panel-kind=unit] .logbook-capture>.field:not(:has([data-participant-search],[data-participant-select],[name=correction_reason])),[data-panel-kind=driver] .logbook-capture>.field:not(:has([data-participant-search],[data-participant-select],[name=correction_reason])) { display:none; }
.central-units .header-actions input { width:250px; }
.central-units { padding:6px; }
.radio-bulk-actions { margin-top:8px; justify-content:flex-start; }
.central-units .section-heading { margin-bottom:6px; }
.radio-unit-grid { display:flex; flex-wrap:wrap; align-content:flex-start; gap:4px; max-height:160px; overflow-y:auto; padding:3px; scrollbar-gutter:stable; }
.radio-unit { display:inline-flex; align-items:center; justify-content:center; gap:4px; border:1px solid transparent; border-radius:999px; padding:2px 8px; font-size:11px; line-height:1.1; font-weight:700; min-height:22px; background:#f8fafc; white-space:nowrap; }
.radio-unit-choice { display:inline-flex; align-items:center; gap:2px; }
.radio-unit[aria-pressed=true] { outline:2px solid var(--ink); outline-offset:1px; }
.selected-unit-panel { padding:6px; margin-bottom:8px; border:1px solid var(--line); border-radius:4px; }
.selected-unit-panel [data-radio-select] { display:none; }
.radio-unit-tools>strong,.radio-unit-tools>span { display:block; margin:3px 0; font-size:12px; }
.radio-unit-tools .logbook-row-actions { flex-wrap:wrap; margin:4px 0; }
.radio-unit-tools .button-compact { min-height:27px; padding:3px 7px; font-size:11px; }
.radio-unit-connected { background:#16a34a; border-color:#15803d; color:#fff; }
.radio-unit-busy { background:#3b82f6; border-color:#2563eb; color:#fff; }
.radio-unit-accident { background:#dc2626; border-color:#b91c1c; color:#fff; }
.radio-unit-missing { background:#f97316; border-color:#c2410c; color:#fff; }
.radio-unit-break { background:#eab308; border-color:#ca8a04; color:#422006; }
.radio-unit-disconnected { background:#e2e8f0; border-color:#cbd5e1; color:#64748b; }
.logbook-edit-grid { display:grid; grid-template-columns:minmax(300px,560px) minmax(250px,1fr); gap:16px; align-items:start; }
.logbook-edit-grid .card { padding:18px; }
.logbook-calculator-map { height:460px; min-height:0; position:relative; z-index:0; isolation:isolate; }
.map-create-panel { padding:16px; border-top:1px solid var(--line); }
.map-create-panel[hidden] { display:none; }
.map-create-fields { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
.map-create-fields input,.map-create-fields select { width:100%; }
@media(max-width:1500px){.logbook-codes{flex-wrap:wrap;width:95px;gap:3px;margin-bottom:0;}.logbook-col-code{width:100px;}.logbook-col-actions{width:141px;}.logbook-col-actions .logbook-row-actions{flex-wrap:wrap;width:137px;}.logbook-col-state{width:96px;}.logbook-col-unit{width:80px;}}
@media(max-width:1366px){.central-workspace {grid-template-columns:minmax(280px,300px) minmax(0,1fr);}.logbook-table th,.logbook-table td{padding:2px 3px;}}
@media(max-width:720px){.central-workspace {grid-template-columns:1fr;}.central-capture{position:static;max-height:none;overflow:visible;}.central-capture .logbook-capture{grid-template-columns:repeat(2,minmax(0,1fr));}.logbook-edit-grid{grid-template-columns:1fr;}}
@media(max-width:600px){.central-capture .logbook-capture,.map-create-fields{grid-template-columns:1fr;}.central-shift{align-items:stretch;}.central-shift form{width:100%;}.central-units .section-heading{display:block;}.logbook-calculator-map{height:360px;}}
.driver-map-select { border: 0; border-radius: 6px; padding: 0; text-align: left; justify-content: flex-start; min-height: 32px; min-width: 0; flex: 1; }
.driver-map-select:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }

/* Dashboard controls share one compact bar; the global menu/account stay intact. */
.dashboard-controls { display: flex; align-items: flex-end; gap: .75rem; margin-bottom: .55rem; padding: .65rem; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--panel-light); flex-shrink: 0; }
.dashboard-filter-toggle { display: none; }
.dashboard-page .dashboard-filters { flex: 1; min-width: 0; grid-template-columns: minmax(120px, 1.2fr) minmax(55px, .4fr) minmax(55px, .4fr) minmax(160px, 1fr) minmax(150px, 1fr) auto; gap: .4rem .55rem; margin-bottom: 0; padding: 0; border: 0; background: transparent; }
.dashboard-page .dashboard-filters label { margin-bottom: .2rem; font-size: .72rem; }
.dashboard-page .dashboard-filters input, .dashboard-page .dashboard-filters select { min-height: 36px; padding: .35rem .5rem; font-size: .8rem; }
.dashboard-page .dashboard-filter-actions, .dashboard-live-actions { display: flex; flex-wrap: nowrap; gap: .35rem; }
.dashboard-page .dashboard-controls button, .dashboard-page .dashboard-controls .button { min-height: 36px; padding: .35rem .65rem; white-space: nowrap; }
.dashboard-live-actions { flex-shrink: 0; padding-left: .75rem; border-left: 1px solid var(--line); }
.dashboard-page .map-panel, .dashboard-page .connected-panel { display: flex; flex-direction: column; min-height: 0; padding: .6rem; }
.dashboard-page .map-toolbar { flex-wrap: wrap; flex-direction: row; align-items: center; gap: .4rem; margin-bottom: .45rem; }
.dashboard-page .map-heading { display: flex; align-items: center; gap: .65rem; }
.dashboard-page .live-indicator { padding: .3rem .5rem; font-size: .7rem; white-space: nowrap; }
.dashboard-page .live-indicator b { font-weight: inherit; }
.dashboard-page .live-indicator.is-delayed span { background: var(--amber); }
.dashboard-page .map-controls { flex-wrap: wrap; gap: .35rem; }
.dashboard-page .map-controls .button { padding: .3rem .55rem; }
.dashboard-page .map-operations { flex: 1; min-height: 0; }
.dashboard-page .map-legend { gap: .3rem .7rem; margin-top: .4rem; font-size: .7rem; }
.dashboard-page .operation-map-icon.is-vehicle { display: grid; place-items: center; border-radius: 50%; pointer-events: none; }
.dashboard-page .operation-map-icon.is-vehicle .operation-map-symbol { pointer-events: auto; }
.dashboard-page .operation-map-symbol.is-vehicle, .dashboard-page .map-legend-symbol.is-vehicle { width: 10px; height: 10px; border-width: 1px; box-shadow: none; }
.dashboard-page .operation-map-symbol.is-vehicle { width: 15px; height: 15px; }
.dashboard-page [data-trail-status]:empty { display: none; }
.dashboard-page [data-trail-status] { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 0; font-size: .75rem; }
.dashboard-page .map-assignment { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: .4rem; margin-top: .45rem; padding: .5rem; }
.dashboard-page .map-assignment input, .dashboard-page .map-assignment select, .dashboard-page .map-assignment button { min-height: 34px; padding: .3rem .5rem; font-size: .75rem; }
.dashboard-page .map-assignment p { font-size: .7rem; }
.dashboard-page .presence-list { flex: 1; min-height: 0; max-height: none; align-content: start; }
.dashboard-page .driver-card { position: relative; padding: .3rem .45rem; gap: .15rem; }
.dashboard-page .driver-card-meta { gap: .35rem; }
.dashboard-page .driver-card-meta > a, .dashboard-page .driver-card-meta > form { flex-shrink: 0; }
.dashboard-page .coverage-watch-label { position: absolute; inset: 0 auto 0 0; width: 4px; padding: 0; border-radius: var(--radius-panel) 0 0 var(--radius-panel); background: #d97706; }
.dashboard-page .coverage-watch-label.is-unconfirmed { background: #787f85; }
.dashboard-page .coverage-watch-label:focus-visible { outline: 2px solid var(--ink); }
.dashboard-page .coverage-watch-label .coverage-watch-text { display: none; }
.dashboard-page .coverage-watch-label:is(:hover, :focus) .coverage-watch-text { display: block; position: absolute; z-index: 2; top: 100%; left: 0; width: max-content; max-width: min(260px, 75vw); padding: .35rem .5rem; border: 1px solid var(--line); border-radius: .4rem; background: var(--panel-light); color: var(--ink); font-size: .72rem; }
.dashboard-page .driver-card.is-selected { border-color: var(--brand-primary); background: var(--panel); }
.dashboard-page .driver-card-top { flex-wrap: wrap; }
.dashboard-page .filter-status { margin-top: .4rem; }
.dashboard-page .map-panel:fullscreen .map-operations { min-height: 0; }
@media (min-width: 1001px) and (max-width: 1300px) {
    .dashboard-page .dashboard-filters { grid-template-columns: minmax(120px, 1.3fr) 60px 60px minmax(160px, 1fr); }
    .dashboard-page .dashboard-filter-person, .dashboard-page .dashboard-filter-state { grid-column: auto; }
    .dashboard-page .dashboard-filter-actions { grid-column: 3 / -1; justify-content: flex-end; }
    .dashboard-page .dashboard-filter-view { grid-column: 1 / 3; }
}
@media (max-width: 1000px) {
    .dashboard-page .dashboard-filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .dashboard-page .dashboard-filter-person, .dashboard-page .dashboard-filter-state, .dashboard-page .dashboard-filter-view, .dashboard-page .dashboard-filter-actions, .dashboard-page .dashboard-live-actions { grid-column: span 2; }
    .dashboard-page .dashboard-live-actions { justify-content: flex-end; }
}
@media (max-width: 640px) {
    .dashboard-page .dashboard-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-page .dashboard-filter-person, .dashboard-page .dashboard-filter-state, .dashboard-page .dashboard-filter-view, .dashboard-page .dashboard-filter-actions, .dashboard-page .dashboard-live-actions { grid-column: 1 / -1; }
    .dashboard-page .dashboard-filters input, .dashboard-page .dashboard-filters select { min-height: 40px; font-size: 1rem; }
    .dashboard-page .dashboard-filters button, .dashboard-page .dashboard-filters .button { min-height: 40px; }
    .dashboard-page .dashboard-live-actions { justify-content: stretch; padding-left: 0; border-left: 0; }
    .dashboard-page .dashboard-live-actions > * { flex: 1; }
    .dashboard-page .map-heading { width: 100%; justify-content: space-between; }
    .dashboard-page .map-controls { width: 100%; }
    .dashboard-page .map-controls .button { min-height: 40px; flex: 1; }
    .dashboard-page .map-assignment { grid-template-columns: 1fr; }
    .dashboard-page .map-assignment select, .dashboard-page .map-assignment button { min-height: 40px; font-size: .85rem; }
}
[data-trail-status]:empty { display: none; }

/* The dashboard fits the remaining viewport; only controls and panels scroll. */
.dashboard-viewport { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.dashboard-viewport .shell { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.dashboard-viewport .app-navbar, .dashboard-viewport .product-signature { flex-shrink: 0; }
.dashboard-viewport .content { flex: 1; min-height: 0; display: flex; padding-block: .75rem; }
.dashboard-page { flex: 1; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.dashboard-page > .notice { flex-shrink: 0; max-height: 15dvh; overflow: auto; }
.dashboard-page .dashboard-filters { max-height: 28dvh; overflow: auto; overscroll-behavior: contain; }
.dashboard-canvas { flex: 1; min-height: 0; container-type: size; }
.dashboard-page .dashboard-workspace { width: 100%; max-width: none; height: 100%; max-height: 1080px; min-height: 0; grid-template-columns: 0px minmax(0, 2fr) minmax(280px, 1fr); gap: 0; transition: grid-template-columns .75s ease; }
.dashboard-page .dashboard-workspace.has-map-workflow { grid-template-columns: minmax(280px, 1fr) minmax(0, 2fr) 0px; }
.dashboard-page .dashboard-workspace:fullscreen { width: 100vw; height: 100dvh; max-height: none; padding: .75rem; background: var(--canvas); }
.dashboard-page .map-workflow-panel { min-width: 0; min-height: 0; overflow: auto; overscroll-behavior: contain; background: var(--panel-light); border-radius: var(--radius-panel); opacity: 0; visibility: hidden; transform: translateX(-16px); transition: opacity .75s ease, transform .75s ease, visibility .75s; }
.dashboard-page .has-map-workflow .map-workflow-panel { border: 1px solid var(--line); margin-right: .6rem; opacity: 1; visibility: visible; transform: translateX(0); }
.dashboard-page .connected-panel { margin-left: .6rem; overflow: hidden; transition: opacity .75s ease, transform .75s ease, visibility .75s; }
.dashboard-page .has-map-workflow .connected-panel { padding: 0; margin: 0; border: 0; opacity: 0; visibility: hidden; transform: translateX(16px); }
.dashboard-page .map-workflow-panel > section { padding: .85rem; border: 0; }
.dashboard-page .map-toolbar, .dashboard-page .map-legend, .dashboard-page .connected-heading, .dashboard-page .filter-status { flex-shrink: 0; }
.dashboard-page .presence-list { overscroll-behavior: contain; }
.dashboard-page .filter-status { margin-bottom: 0; }
.dashboard-page .map-create-fields { grid-template-columns: minmax(0, 1fr); }
.dashboard-page .map-create-panel .header-actions { justify-content: flex-start; flex-wrap: wrap; gap: .35rem; }
.dashboard-page .map-create-panel .header-actions button { min-height: 36px; padding: .4rem .65rem; }
.dashboard-page .map-create-panel [data-map-create-help] { font-size: .85rem; }
.dashboard-page .map-create-panel input, .dashboard-page .map-create-panel select, .dashboard-page .map-create-panel textarea { min-width: 0; width: 100%; }
.dashboard-page .map-assignment { grid-template-columns: minmax(0, 1fr); margin: 0; padding: 0; border: 0; background: transparent; }
.map-selection-summary { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-panel); padding: .7rem; overflow-wrap: anywhere; }
.map-selection-summary p { margin-top: .35rem; }
[data-assignment-status]:empty, [data-map-create-status]:empty { display: none; }
@media (max-width: 700px) {
    .dashboard-viewport .content { padding: .5rem; }
    .dashboard-controls { flex-wrap: wrap; justify-content: space-between; }
    .dashboard-filter-toggle { display: block; }
    .dashboard-page .dashboard-filters { order: 1; flex: 1 0 100%; max-height: 20dvh; }
    .dashboard-page:not(.filters-open) .dashboard-filters { display: none; }
    .dashboard-page .dashboard-controls button, .dashboard-page .dashboard-controls .button { min-height: 40px; padding-inline: .5rem; font-size: .75rem; }
    .dashboard-page .dashboard-workspace, .dashboard-page .dashboard-workspace.has-map-workflow { width: 100%; grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 3fr) minmax(0, 2fr); }
    .dashboard-page .map-panel { grid-row: 1; }
    .dashboard-page .map-workflow-panel { display: none; }
    .dashboard-page .connected-panel, .dashboard-page .has-map-workflow .map-workflow-panel { grid-row: 2; margin: .5rem 0 0; }
    .dashboard-page .has-map-workflow .map-workflow-panel { display: block; }
    .dashboard-page .has-map-workflow .connected-panel { display: none; }
    .dashboard-page .map-legend { flex-wrap: nowrap; overflow: auto; overscroll-behavior: contain; }
    .dashboard-page .map-legend > span { flex-shrink: 0; }
    .dashboard-page .dashboard-workspace:fullscreen { padding: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
    .dashboard-page .dashboard-workspace, .dashboard-page .map-workflow-panel, .dashboard-page .connected-panel { transition: none; transform: none; }
}

/* Trip detail: the observed map is the primary workspace. */
.trip-detail-page { display: flex; flex-direction:column; flex:1; gap: .9rem; min-width: 0; min-height:0; }
.trip-detail-canvas { flex:1; min-height:0; container-type:size; }
.trip-detail-workspace { display:grid; grid-template-columns:minmax(0, 2fr) minmax(280px, 1fr); grid-template-rows:minmax(0,1fr); align-items:stretch; gap:.75rem; height:100%; max-height:1080px; width:100%; }
.trip-detail-sidebar { min-width:0; min-height:0; overflow:auto; overscroll-behavior:contain; display:flex; flex-direction:column; gap:.75rem; padding:2px; }
.trip-detail-sidebar > * { flex-shrink:0; }
.trip-detail-sidebar .trip-overview, .trip-detail-sidebar .command-panel { margin:0; padding:.85rem; }
.trip-overview-route { display:grid; gap:.5rem; margin:.85rem 0; }
.trip-overview-route > div { display:grid; grid-template-columns:4.5rem minmax(0,1fr); gap:.5rem; }
.trip-overview-route dt { color:var(--muted); }
.trip-overview-route dd { margin:0; overflow-wrap:anywhere; }
.trip-detail-page .trip-overview .trip-location-status { margin:0; padding-top:.65rem; border-top:1px solid var(--line); }
.trip-detail-page .trip-section-title { font-size:.9rem; margin:1rem 0 .65rem; }
.trip-detail-updated { margin:0; }
.trip-lock-feedback { margin:0; }
.trip-detail-heading { display:flex; align-items:center; flex-wrap:wrap; gap:.65rem; }
.trip-lock-feedback:empty { display:none; }
.trip-track-lock-toolbar { display:flex; margin:0; gap:.5rem; }
.trip-detail-page .trip-map-legend { flex:1; min-width:0; margin:0; gap:.35rem .65rem; font-size:.7rem; flex-wrap:nowrap; overflow-x:auto; }
.trip-detail-page .trip-map-legend > span { flex-shrink:0; }
.trip-detail-page .trip-secondary-content { padding:.65rem .85rem; }
.trip-detail-page .trip-secondary-content .detail-summary { gap:.5rem .75rem; }
.trip-detail-page .trip-secondary-content .history-heading > summary { padding-block:.4rem; min-height:32px; }
.trip-detail-page [data-trip-command-status]:empty { display:none; }
.trip-cancel-control > summary { color:var(--red); cursor:pointer; padding:.65rem 0; }
.trip-cancel-control[open] > summary { margin-bottom:.35rem; }
.trip-detail-page .trip-detail-header { margin: 0; gap: .75rem; }
.trip-detail-page .trip-detail-header h1 { margin: 0; font-size: 1.35rem; }
.trip-detail-page .trip-map-card { display:flex; flex-direction:column; min-width:0; min-height:0; margin: 0; padding: .85rem; }
.trip-detail-page .trip-map-card > :not(.trip-detail-map) { flex-shrink:0; }
.trip-map-toolbar h2 { margin:0; font-size:1rem; }
.trip-map-toolbar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.trip-map-identity { display: flex; align-items: center; gap: .4rem .8rem; flex-wrap: wrap; min-width: 0; }
.trip-map-identity > * { overflow-wrap: anywhere; }
.trip-detail-sidebar > .trip-map-identity { flex:0 0 auto; margin:0; }
.trip-map-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.trip-map-caption { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; margin: .6rem 0 .5rem; }
.trip-map-caption h2 { font-size: 1rem; margin: 0; }
.trip-map-caption p { margin: 0; }
.trip-detail-page .trip-location-status { margin: 0 0 .45rem; }
.trip-detail-page .trip-detail-map { width:100%; height:auto; flex:1; min-height:0; }
.trip-detail-page .trip-map-help, .trip-detail-page [data-trip-track-range] { margin: .4rem 0 0; }
.trip-detail-page .trip-track-actions { margin-top: .4rem; }
.trip-secondary-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:.75rem; align-items:start; }
.trip-detail-page .trip-secondary-panel { min-width: 0; margin: 0; padding: 0; }
.trip-secondary-panel > summary { cursor: pointer; padding: .85rem 1rem; font-weight: 700; min-height: 44px; }
.trip-secondary-panel > summary:hover { background: var(--panel); }
.trip-secondary-panel[open] > summary { border-bottom: 1px solid var(--line); }
.trip-secondary-content { padding: 1rem; }
.trip-secondary-content.detail-summary { gap: .8rem 1.2rem; }
.trip-secondary-content .history-heading > summary { cursor: pointer; min-height: 40px; }
.trip-secondary-content .history-heading[open] > summary { margin-bottom: .5rem; }
.trip-detail-page .trip-command-section { max-width: 720px; width: 100%; }
.trip-detail-page .command-panel { border-color: color-mix(in srgb, var(--red) 25%, var(--line)); }
.trip-detail-page [data-cancel-control] { border-top: 1px solid var(--line); margin-top: .35rem; }
@media (max-width: 900px) {
    .trip-detail-workspace { width:100%; grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,2fr) minmax(0,1fr); }
}
@media (max-width: 640px) {
    .trip-detail-page { gap: .65rem; padding: .75rem; }
    .trip-detail-page .trip-detail-header { align-items: center; flex-direction: row; flex-wrap: wrap; }
    .trip-detail-page .trip-detail-header .header-actions { gap: .4rem; flex-wrap: wrap; }
    .trip-detail-page .trip-detail-header .button, .trip-detail-page .trip-map-tools .button { min-height: 40px; }
    .trip-detail-page .trip-map-card { padding: .65rem; }
    .trip-map-identity { flex-basis: 100%; gap: .35rem .65rem; }
    .trip-map-identity > [data-trip-summary-driver] { flex-basis: 100%; }
    .trip-map-tools { width: 100%; }
    .trip-map-tools .button { flex: 1; }
    .trip-map-caption { align-items: start; flex-direction: column; gap: .15rem; }
    .trip-detail-page .trip-detail-map { height:auto; min-height:0; }
    .trip-secondary-grid { grid-template-columns: 1fr; }
    .trip-secondary-content { padding: .8rem; }
}

/* Native radio groups keep keyboard behavior while exposing common actions. */
.logbook-choice-field { margin:0; padding:0; border:0; min-width:0; }
.logbook-choice-field legend { padding:0; margin:0 0 3px; font-size:11px; font-weight:600; }
.logbook-choices { display:flex; gap:4px; flex-wrap:wrap; }
.logbook-choice { position:relative; display:inline-flex; margin:0; cursor:pointer; }
.logbook-choice input[type=radio] { position:absolute; opacity:0; width:1px; height:1px; min-height:0; padding:0; margin:0; }
.logbook-choice span { display:flex; align-items:center; min-height:32px; padding:5px 9px; border:1px solid var(--line); border-radius:18px; background:var(--panel-light); color:var(--ink); font-size:11px; font-weight:600; }
.logbook-choice input:checked+span { background:var(--ink); border-color:var(--ink); color:var(--panel-light); }
.logbook-choice input:focus-visible+span { outline:2px solid var(--brand-primary); outline-offset:2px; }
.logbook-choice input:disabled+span { opacity:.55; cursor:default; }
.logbook-filter-states { flex-basis:100%; padding-top:4px; border-top:1px solid var(--line); }
.participant-summary { display:block; font-size:12px; padding:4px 0; overflow-wrap:anywhere; }
.participant-choices { display:flex; flex-wrap:wrap; gap:6px; }
.participant-choices button { white-space:normal; overflow-wrap:anywhere; text-align:left; }
.participant-choices button[aria-pressed=true] { background:var(--ink); border-color:var(--ink); color:var(--panel-light); }
[data-panel-kind=unit] .logbook-choice-field,[data-panel-kind=driver] .logbook-choice-field { display:none; }
.radio-unit-number { font-size:inherit; font-weight:700; }
@media(pointer:coarse) { .radio-unit { min-height:32px; min-width:32px; } }
.radio-unit-tools .radio-connection-note { margin:4px 0 8px; color:var(--muted); }
@media(max-width:720px) { .central-capture .logbook-choice-field,.central-capture .participant-picker,.central-capture .logbook-capture>.header-actions,.central-capture .logbook-capture>.notice { grid-column:1 / -1; } .logbook-choice span { min-height:40px; } }
@media(max-width:600px) { .logbook-filter .field { flex:1 1 120px; } .logbook-filter #trip-unit,.logbook-filter #trip-search,.logbook-filter #trip-date { width:100%; } .central-units .header-actions input { width:100%; min-width:0; flex:1; } }

/* Keep frequent capture fields and roster controls within the working viewport. */
.logbook-topbar { margin-bottom:8px; gap:8px; }
.logbook-topbar .eyebrow { margin-bottom:0; }
.logbook-topbar h1 { font-size:20px; }
.central-capture .logbook-capture { grid-template-columns:repeat(2,minmax(0,1fr)); }
.central-capture .logbook-capture>* { grid-column:1 / -1; }
.central-capture .logbook-capture>.logbook-half-field { grid-column:auto; }
.logbook-code-choices .logbook-choices { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
.logbook-code-choices .logbook-choice span { width:100%; padding:4px 7px; }
.selected-unit-panel { padding:0; margin-bottom:6px; }
.selected-unit-panel>summary { cursor:pointer; padding:7px; font-size:12px; font-weight:600; }
.selected-unit-panel[open]>summary { border-bottom:1px solid var(--line); }
.selected-unit-panel>[data-selected-unit-tools] { padding:6px; }
.central-units .radio-roster-toolbar { display:flex; flex-flow:row wrap; align-items:center; gap:6px 10px; }
.radio-roster-toolbar h2 { font-size:13px; flex-shrink:0; }
.radio-roster-toolbar .header-actions { gap:4px; }
.radio-roster-toolbar .header-actions input { width:120px; min-height:30px; padding:4px 6px; font-size:12px; }
.radio-roster-toolbar .radio-bulk-actions { margin:0 0 0 auto; }
.radio-roster-toolbar .pagination-bar { padding:0; gap:8px; }
.radio-roster-toolbar .pagination-bar>span { white-space:nowrap; }
@media(max-width:600px) { .radio-roster-toolbar form { display:flex; flex:1 1 180px; } .radio-roster-toolbar .header-actions input { width:0; flex:1; min-width:60px; } .radio-roster-toolbar .radio-bulk-actions { margin-left:0; flex-wrap:wrap; } .radio-roster-toolbar .pagination-bar { flex-direction:row; align-items:center; flex-wrap:wrap; margin-left:auto; } }

.central-capture .logbook-capture { gap:3px; }
.central-capture .caller-suggestions:empty { display:none; }
.central-capture .logbook-choice-field legend { margin-bottom:2px; line-height:1.3; }
.central-capture .logbook-code-choices .logbook-choices { gap:2px 4px; }
.central-capture .logbook-capture textarea[name=notes] { min-height:32px; }
@media(min-width:721px) { .central-capture .logbook-choice span { min-height:30px; line-height:1.3; padding-top:4px; padding-bottom:4px; } }

@media(max-width:600px) {
    .central-workspace .logbook-capture input:not([type=hidden]):not([type=radio]),
    .central-workspace .logbook-capture select,
    .central-workspace .logbook-capture textarea,
    .central-capture .logbook-capture textarea[name=notes],
    .logbook-dialog .logbook-capture input:not([type=hidden]):not([type=radio]),
    .logbook-dialog .logbook-capture select,
    .logbook-dialog .logbook-capture textarea,
    .logbook-edit-grid .logbook-capture input:not([type=hidden]):not([type=radio]),
    .logbook-edit-grid .logbook-capture select,
    .logbook-edit-grid .logbook-capture textarea { font-size:16px; min-height:40px; }
    .logbook-capture>.header-actions>button { min-height:44px; }
}

.logbook-table tr.logbook-overdue > td { background: #fff8e7; }
