:root {
    --bg: #f4f6f8;
    --surface: #ffffff;
    --surface-soft: #eef4f2;
    --ink: #17212b;
    --muted: #607080;
    --line: #d9e1e7;
    --accent: #0d766e;
    --accent-strong: #075e59;
    --warning: #915f00;
    --warning-bg: #fff4d8;
    --danger: #b3261e;
    --radius: 8px;
    --shadow: 0 12px 32px rgba(22, 36, 52, 0.08);
    --shadow-soft: 0 6px 18px rgba(22, 36, 52, 0.08);
    --text: var(--ink);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.45;
}

/* Passenger counting management and analysis */
.module-grid.passenger-config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.passenger-config-grid .panel { height: 100%; }
.stacked-form { display: grid; gap: 12px; }
.stacked-form label { display: grid; gap: 5px; }
.passenger-assignment-form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
.passenger-assignment-form button { min-height: 44px; }
.passenger-share-card { display: grid; grid-template-columns: minmax(0,1fr) 180px; gap: 24px; align-items: center; border: 2px solid var(--accent); }
.passenger-share-card img { width: 180px; height: 180px; padding: 8px; background: #fff; }
.copy-field { display: flex; gap: 8px; }.copy-field input { flex: 1; }
.passenger-management table small,.passenger-report table small { display: block; color: var(--muted); }
.passenger-transcription-grid input { min-width: 94px; }.passenger-transcription-grid td:last-child input { min-width: 220px; }
.module-grid.passenger-chart-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
.passenger-bar-chart { min-width: 0; }
.passenger-bar-row { display: grid; grid-template-columns: minmax(80px,140px) minmax(100px,1fr) 48px; gap: 9px; align-items: center; margin: 9px 0; }
.passenger-bar-row > span { overflow: hidden; color: var(--muted); font-size: .8rem; text-overflow: ellipsis; white-space: nowrap; }.passenger-bar-row > div { height: 12px; overflow: hidden; border-radius: 99px; background: #e5ecec; }.passenger-bar-row i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }.passenger-bar-row strong { text-align: right; }
.passenger-metrics article small { display: block; color: var(--muted); font-size: .75rem; }
.status-pill.submitted { background: #e6f0ff; color: #225a91; }.status-pill.draft { background: #eee; color: #555; }.status-pill.rejected { background: #ffe8e5; color: #8d211b; }
@media (max-width: 900px) { .passenger-assignment-form { grid-template-columns: repeat(2,minmax(0,1fr)); }.module-grid.passenger-chart-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .module-grid.passenger-config-grid,.passenger-assignment-form,.passenger-share-card { grid-template-columns: 1fr; }.passenger-share-card img { width: 150px; height: 150px; }.copy-field { flex-direction: column; } }

.public-map-body {
    background: #eef4f2;
}

.dispatch-display-body {
    background: #07131d;
    color: #f4fbff;
}

.dispatch-display { min-height: 100vh; padding: clamp(20px, 3vw, 48px); }
.dispatch-display-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; border-bottom: 2px solid #274655; padding-bottom: 24px; }
.dispatch-display-header p { margin: 0 0 4px; color: #7fc8c2; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; }
.dispatch-display-header h1 { margin: 0; font-size: clamp(2.3rem, 5vw, 5.3rem); line-height: .95; }
.dispatch-display-header strong { display: block; margin-top: 12px; font-size: clamp(1rem, 2vw, 1.8rem); color: #b9ced9; }
.dispatch-clock { text-align: right; color: #b9ced9; font-size: 1rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.dispatch-clock time { display: block; color: #fff; font-size: clamp(2rem, 4vw, 4.4rem); letter-spacing: -.05em; }
.dispatch-display-board { margin-top: 28px; }
.dispatch-display-head, .dispatch-display-row { display: grid; grid-template-columns: 1fr 2fr 1fr 1.4fr .7fr; gap: 22px; align-items: center; }
.dispatch-display-head { padding: 0 20px 12px; color: #93aebc; font-size: clamp(.8rem, 1.25vw, 1.1rem); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.dispatch-display-row { margin-bottom: 12px; padding: clamp(16px, 2vw, 28px) 20px; background: #102631; border: 2px solid #1b3a48; border-radius: 14px; font-size: clamp(1.15rem, 2.1vw, 2.35rem); }
.dispatch-display-row.is-signed-on { border-color: #147c67; background: #0d342f; }
.dispatch-display-row.is-late { border-color: #e24b43; background: #471d24; }
.dispatch-bus { color: #80e4d4; font-size: 1.25em; }.dispatch-bus.is-offsite { color: #b9ced9; font-size: .8em; }.dispatch-display-row.is-offsite-takeover { border-style: dashed; }.dispatch-driver strong { display: block; }.dispatch-driver small { display: block; margin-top: 5px; color: #b9ced9; font-size: .55em; font-weight: 600; }.dispatch-countdown { color: #ffe08a; white-space: nowrap; }.dispatch-sign-on { text-align: center; font-size: 1.55em; }.dispatch-sign-on b { color: #71e7b7; }.dispatch-sign-on i { color: #8198a5; font-style: normal; }.is-late .dispatch-sign-on b { color: #ff7770; }.dispatch-display-empty { padding: 48px 20px; border: 2px dashed #274655; color: #b9ced9; font-size: 1.4rem; text-align: center; }.dispatch-display footer { margin-top: 26px; color: #93aebc; font-size: .95rem; text-align: right; }

@media (max-width: 760px) { .dispatch-display-header { align-items: flex-start; flex-direction: column; }.dispatch-clock { text-align: left; }.dispatch-display-head { display: none; }.dispatch-display-row { grid-template-columns: 1fr 1fr; }.dispatch-sign-on { grid-column: 2; grid-row: 1; }.dispatch-countdown { grid-column: 1 / -1; }.dispatch-driver { grid-column: 1 / -1; } }

a {
    color: inherit;
    text-decoration: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(13, 118, 110, 0.34);
    outline-offset: 3px;
}

.app-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: #10202a;
    color: #f7fbfc;
    padding: 24px 18px;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 28px;
}

.mobile-shell-bar,
.mobile-nav-close,
.mobile-nav-backdrop {
    display: none;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--accent);
    font-weight: 800;
}

.brand small,
.nav-list small {
    display: block;
    color: #a9bac5;
}

.nav-list {
    display: grid;
    gap: 8px;
}

.nav-list a {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    color: #e4edf1;
}

.nav-list a:hover,
.nav-list a.active {
    background: rgba(255, 255, 255, 0.1);
}

.module-navigation {
    display: grid;
    gap: 10px;
    margin: -8px 0 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--line);
}

.module-breadcrumb,
.module-navigation-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.module-breadcrumb {
    color: var(--muted);
    font-size: 0.82rem;
}

.module-breadcrumb a {
    color: inherit;
}

.module-navigation-links {
    overflow-x: auto;
    padding: 2px 0;
    scrollbar-width: thin;
}

.module-navigation-links a {
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--ink);
    font-size: 0.88rem;
    font-weight: 700;
}

.module-navigation-links a:hover,
.module-navigation-links a.active {
    border-color: var(--accent);
    background: var(--accent);
    color: #fff;
}

.related-surface-mark {
    margin-left: 3px;
    font-size: 0.78em;
}

.main-panel {
    min-width: 0;
    padding: 28px;
}

.public-map-page {
    min-height: 100vh;
    padding: 18px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 22px;
}

.topbar h1,
.section-heading h2 {
    margin: 0;
    line-height: 1.1;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
}

.user-tools {
    display: flex;
    gap: 10px;
    align-items: center;
}

.button,
button {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    padding: 10px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.button.ghost {
    background: #e6edf0;
    color: var(--ink);
}

.button.primary {
    background: var(--accent-strong);
}

.button.small {
    padding: 7px 10px;
    font-size: 0.84rem;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 6px;
}

.button.danger,
button.danger {
    background: var(--danger);
}

.button[disabled],
button[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.compact-button {
    padding: 8px 11px;
    white-space: nowrap;
}

.notice {
    padding: 12px 14px;
    border-radius: 8px;
    margin-bottom: 18px;
}

.notice.warning {
    background: var(--warning-bg);
    color: var(--warning);
    border: 1px solid #f0d28a;
}

.notice.success {
    background: #e2f5ef;
    color: #075e59;
    border: 1px solid #9ed8c8;
}

.metric-grid,
.module-grid,
.split-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.metric,
.module-card,
.panel,
.form-card,
.status-list,
.timeline-board article {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.metric {
    padding: 16px;
}

.metric span,
.module-card span {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    margin: 4px 0;
    font-size: 1.35rem;
}

.metric small,
.module-card p,
.section-heading p,
.panel p,
.hint {
    color: var(--muted);
}

.section-band,
.work-surface,
.public-map-shell {
    margin-top: 22px;
}

.module-spacer {
    margin-top: 14px;
}

.stop-times-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: end;
}

.stop-times-filter label {
    display: grid;
    gap: 6px;
    min-width: min(100%, 220px);
}

.stop-times-filter label:first-child {
    flex: 1 1 360px;
}

.stop-times-table-wrap {
    overflow-x: auto;
}

.stop-times-table {
    width: 100%;
    min-width: 1040px;
}

.stop-times-table td {
    vertical-align: top;
}

.stop-times-table td strong,
.stop-times-table td small {
    display: block;
}

.stop-times-table td small {
    margin-top: 4px;
    color: var(--muted);
}

.stop-time-primary {
    font-size: 1.1rem;
    color: var(--accent-strong);
    font-variant-numeric: tabular-nums;
}

.section-heading {
    margin-bottom: 14px;
}

.module-card,
.panel,
.timeline-board article {
    padding: 16px;
}

.module-card strong {
    display: block;
    margin: 6px 0 8px;
}

.actionable-card {
    display: grid;
    gap: 8px;
    align-content: start;
}

.active-admin-card {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px rgba(24, 107, 92, 0.18), var(--shadow);
}

.active-admin-card strong {
    color: var(--accent);
}

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

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

.configuration-columns {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.configuration-collapsible {
    overflow: hidden;
}

.configuration-collapsible > summary {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
    cursor: pointer;
    list-style: none;
    padding: 2px;
}

.configuration-collapsible > summary::-webkit-details-marker {
    display: none;
}

.configuration-collapsible > summary::after {
    content: '+';
    flex: 0 0 auto;
    color: var(--accent);
    font-size: 1.3rem;
    font-weight: 700;
}

.configuration-collapsible[open] > summary::after {
    content: '−';
}

.configuration-collapsible > summary strong {
    color: var(--accent-strong);
}

.configuration-collapsible > summary span {
    flex: 1;
    color: var(--muted);
    font-size: 0.9rem;
    text-align: right;
}

.configuration-collapsible-body {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.configuration-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

@media (max-width: 760px) {
    .configuration-collapsible > summary {
        align-items: flex-start;
    }

    .configuration-collapsible > summary span {
        text-align: left;
    }
}

.status-list {
    overflow: hidden;
}

.status-row {
    display: grid;
    grid-template-columns: auto 160px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 13px 16px;
    border-top: 1px solid var(--line);
}

.status-row:first-child {
    border-top: 0;
}

.operations-dashboard {
    display: grid;
    gap: 18px;
}

.operations-hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    padding: clamp(22px, 3vw, 34px);
    border-radius: 12px;
    background: linear-gradient(135deg, #0a5e58, #123846);
    color: #fff;
    box-shadow: var(--shadow);
}

.operations-hero.is-empty {
    background: linear-gradient(135deg, #344550, #17212b);
}

.operations-hero .eyebrow {
    color: #a9e3dc;
}

.operations-hero h2 {
    max-width: 780px;
    margin: 0 0 8px;
    font-size: clamp(1.75rem, 3vw, 2.65rem);
    line-height: 1.06;
}

.operations-hero p:not(.eyebrow) {
    margin: 0;
    color: #d4e6e9;
}

.operations-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 0 0 auto;
}

.operations-hero .button.primary {
    background: #fff;
    color: #075e59;
}

.operations-hero .button.ghost {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
}

.operations-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.operations-metric {
    display: grid;
    gap: 3px;
    padding: 16px;
    border: 1px solid var(--line);
    border-left: 4px solid #87a39f;
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.operations-metric.needs-attention {
    border-left-color: #c07b00;
    background: #fffaf0;
}

.operations-metric span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.operations-metric strong {
    font-size: 1.85rem;
    line-height: 1;
}

.operations-metric small {
    color: var(--muted);
}

.operations-dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.6fr);
    gap: 14px;
    align-items: stretch;
}

.operations-dashboard-grid.secondary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.operations-priority-panel,
.service-day-card {
    height: 100%;
}

.operations-action-list,
.operations-schedule-list,
.operations-event-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.operations-action {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafb;
}

.operations-action-marker {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #78908d;
}

.operations-action.warning .operations-action-marker { background: #c07b00; }
.operations-action.danger .operations-action-marker { background: var(--danger); }

.operations-action strong,
.operations-action small {
    display: block;
}

.operations-action small {
    margin-top: 2px;
    color: var(--muted);
}

.operations-clear-state {
    margin-top: 14px;
    padding: 24px;
    border: 1px solid #a9d8ca;
    border-radius: 8px;
    background: #edf9f5;
    color: #075e59;
}

.operations-clear-state p {
    margin-bottom: 0;
}

.service-day-card {
    display: grid;
    gap: 10px;
    align-content: start;
    background: #eef4f2;
}

.service-day-date {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    line-height: 1.05;
}

.service-day-card > span,
.service-day-card > small {
    color: var(--muted);
}

.service-day-card .button {
    justify-self: start;
    margin-top: 8px;
}

.operations-schedule-list article {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}

.operations-schedule-list article:first-child {
    border-top: 0;
}

.operations-schedule-list strong,
.operations-schedule-list small {
    display: block;
}

.operations-schedule-list small {
    color: var(--muted);
}

.status-chip {
    display: inline-flex;
    padding: 5px 8px;
    border-radius: 999px;
    background: #e2f5ef;
    color: #075e59;
    font-size: 0.76rem;
    font-weight: 800;
}

.status-chip.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.operations-event-list a {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 11px 0;
    border-top: 1px solid var(--line);
}

.operations-event-list a:first-child {
    border-top: 0;
}

.operations-event-list strong,
.operations-event-list small {
    display: block;
}

.operations-event-list small,
.operations-event-list time {
    color: var(--muted);
}

.operations-event-list time {
    text-align: right;
}

.platform-attention {
    padding: 0;
}

.platform-attention summary {
    padding: 14px 16px;
    cursor: pointer;
    color: var(--warning);
    font-weight: 800;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
}

.dot.ok {
    background: var(--accent);
}

.auth-panel {
    display: grid;
    place-items: start center;
    padding-top: 40px;
}

.form-card {
    width: min(100%, 420px);
    padding: 22px;
}

label {
    display: grid;
    gap: 7px;
    margin: 14px 0;
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 11px 12px;
    font: inherit;
    background: #fff;
}

textarea {
    resize: vertical;
}

.form-grid {
    display: grid;
    gap: 12px;
}

.form-grid h3,
.panel h3 {
    margin-top: 0;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.form-grid-mini {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.form-section {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfd;
}

.form-section legend {
    padding: 0 6px;
    color: var(--accent-strong);
    font-weight: 800;
}

.form-section label,
.timetable-maker-panel label {
    margin: 0;
}

.timetable-maker-panel .hint {
    margin-top: 0;
}

.check-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.check-row input {
    width: auto;
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 130px auto;
    gap: 8px;
    align-items: center;
}

.admin-import-form {
    grid-template-columns: minmax(0, 1fr) auto;
    margin-top: 12px;
}

.inline-form.vertical {
    grid-template-columns: 1fr;
}

.ops-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 14px;
}

.map-placeholder {
    min-height: 460px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(90deg, rgba(13, 118, 110, 0.08) 1px, transparent 1px),
        linear-gradient(rgba(13, 118, 110, 0.08) 1px, transparent 1px),
        #f7fbfb;
    background-size: 32px 32px;
    display: grid;
    place-items: center;
    text-align: center;
    color: var(--muted);
}

.map-placeholder span {
    display: block;
    color: var(--ink);
    font-weight: 800;
}

.map-placeholder.public {
    min-height: 560px;
}

.map-panel {
    min-height: 460px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.map-panel.public {
    min-height: 560px;
}

.osm-map {
    width: 100%;
    min-height: 460px;
    height: 100%;
    background: #edf2f3;
}

.osm-map.public {
    min-height: 560px;
}

.leaflet-container {
    font: inherit;
}

.occ-exception-marker-wrap {
  background: transparent;
  border: 0;
}

.occ-exception-marker-badge {
  align-items: center;
  background: #d97706;
  border: 2px solid #fff;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.35);
  color: #fff;
  display: inline-flex;
  font-size: 0.72rem;
  font-weight: 800;
  height: 22px;
  justify-content: center;
  min-width: 22px;
  padding: 0 5px;
}

.occ-exception-marker-badge.is-high,
.occ-exception-marker-badge.is-critical {
  background: #b91c1c;
}

.occ-exception-marker-badge.is-info {
  background: #0369a1;
}

.traccar-exception-card[data-severity="high"],
.traccar-exception-card[data-severity="critical"] {
  border-inline-start: 4px solid #b91c1c;
}

.traccar-exception-card[data-severity="warning"] {
  border-inline-start: 4px solid #d97706;
}

.public-map-note {
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.92rem;
}

.public-map-embed {
    margin-top: 14px;
}

.public-map-embed textarea {
    min-height: 92px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.86rem;
}

.public-map-embed-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.public-map-toolbar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    color: var(--muted);
}

.public-map-shell.is-embedded {
    margin-top: 0;
}

.public-map-body.is-embedded .public-map-page {
    padding: 0;
}

.public-map-body.is-embedded .public-map-toolbar,
.public-map-body.is-embedded .split-grid,
.public-map-body.is-embedded .public-map-note {
    padding-inline: 12px;
}

.public-map-body.is-embedded .map-panel.public,
.public-map-body.is-embedded .osm-map.public {
    min-height: 520px;
    border-radius: 0;
    border-inline: 0;
}

.timeline-board {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.timeline-board span {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--accent-strong);
    font-weight: 800;
    margin-bottom: 12px;
}

.event-hero {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.event-hero h2 {
    margin: 8px 0 4px;
    font-size: 1.55rem;
}

.event-hero p {
    margin: 0;
    color: var(--muted);
}

.event-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.event-ops-grid,
.event-registers {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.text-link {
    color: var(--accent-strong);
    font-weight: 800;
}

.planning-shell {
    display: grid;
    gap: 14px;
}

.planning-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.planning-stat,
.tool-card,
.draft-card,
.run-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.planning-stat {
    padding: 15px;
}

.planning-stat span,
.draft-card span,
.run-card header span {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.planning-stat strong {
    display: block;
    margin: 4px 0;
    font-size: 1.4rem;
}

.planning-stat small,
.draft-card small,
.tool-card p,
.publish-card p {
    color: var(--muted);
}

.event-readiness-panel {
    display: grid;
    gap: 14px;
}

.readiness-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.readiness-grid article {
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fbfb;
}

.readiness-grid span {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.readiness-grid strong {
    display: block;
    margin: 3px 0;
    font-size: 1.2rem;
}

.readiness-grid small {
    color: var(--muted);
}

.shift-block-board {
    display: grid;
    gap: 12px;
}

.shift-board-day-selector {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.shift-board-day-selector strong,
.shift-board-day-selector span {
    display: block;
}

.shift-board-day-selector strong {
    color: var(--accent);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shift-board-day-selector span {
    color: var(--muted);
    font-size: 0.84rem;
}

.shift-block-board__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.shift-block-board__header h3 {
    margin: 0;
}

.shift-block-board__header span,
.shift-block-unscheduled span {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.shift-block-timeline {
    min-width: 0;
    overflow-x: auto;
    padding-bottom: 4px;
}

.shift-block-axis {
    position: relative;
    min-width: 720px;
    height: 28px;
    margin-left: 132px;
    border-bottom: 1px solid var(--line);
}

.shift-block-axis span {
    position: absolute;
    bottom: 6px;
    transform: translateX(-50%);
    color: var(--muted);
    font-size: 0.72rem;
}

.shift-block-row {
    display: grid;
    grid-template-columns: 120px minmax(720px, 1fr);
    gap: 12px;
    align-items: center;
    min-width: 864px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.shift-block-row__label {
    min-width: 0;
}

.shift-block-row__label strong,
.shift-block-row__label span {
    display: block;
}

.shift-block-row__label span {
    color: var(--muted);
    font-size: 0.78rem;
}

.shift-block-row__track {
    position: relative;
    height: 86px;
    border-radius: var(--radius);
    background: repeating-linear-gradient(
        to right,
        #eef4f5 0,
        #eef4f5 1px,
        #fbfdfd 1px,
        #fbfdfd 72px
    );
}

.shift-block {
    position: absolute;
    top: 7px;
    bottom: 7px;
    min-width: 96px;
    overflow: hidden;
    padding: 7px 10px;
    border: 1px solid rgba(15, 76, 92, 0.2);
    border-radius: 7px;
    background: #d9eff4;
    box-shadow: var(--shadow-soft);
    color: var(--text);
    white-space: nowrap;
}

.shift-block strong,
.shift-block span,
.shift-block small,
.shift-block em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shift-block span,
.shift-block small,
.shift-block em {
    color: rgba(31, 42, 46, 0.74);
    font-size: 0.72rem;
}

.shift-block em {
    font-style: normal;
}

.shift-block__chips {
    display: flex !important;
    gap: 4px;
    margin-top: 2px;
}

.shift-block__chip {
    display: inline-flex;
    width: fit-content;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--muted);
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
}

.shift-block__chip--warning {
    background: #fff2c2;
    color: #7a5a00;
}

.shift-block__chip--danger {
    background: #ffe0dd;
    color: #a12f24;
}

.shift-block--conductor {
    background: #e3f1d7;
}

.shift-block--customer {
    background: #fff1c6;
}

.shift-block--operations {
    background: #e8e3ff;
}

.shift-block--mixed {
    background: #f4dfeb;
}

.shift-block-unscheduled {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.shift-block-unscheduled strong {
    padding: 6px 9px;
    border: 1px dashed var(--line);
    border-radius: 999px;
    background: #fff;
    font-size: 0.82rem;
}

.shift-block-unallocated {
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.shift-block-unallocated summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 800;
}

.shift-block-unallocated__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.shift-block-unallocated__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.shift-block-unallocated__item strong,
.shift-block-unallocated__item span,
.shift-block-unallocated__item small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.shift-block-unallocated__item span,
.shift-block-unallocated__item small {
    color: var(--muted);
    font-size: 0.76rem;
}

.shift-block-unallocated__item select {
    grid-column: 1 / -1;
}

.shift-block-editor {
    border-top: 1px solid var(--line);
    padding-top: 8px;
}

.shift-block-editor summary {
    cursor: pointer;
    color: var(--accent);
    font-weight: 800;
}

.shift-block-editor__grid {
    display: grid;
    gap: 10px;
    margin-top: 10px;
}

.shift-block-edit-form {
    display: grid;
    grid-template-columns: 86px minmax(120px, 1fr) 130px 170px 170px 90px minmax(140px, 1fr) minmax(140px, 1fr) auto;
    gap: 8px;
    align-items: end;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfdfd;
}

.shift-block-edit-form label {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.shift-block-edit-form label span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.planning-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #e7eef2;
}

.planning-tabs button {
    flex: 1 1 150px;
    min-height: 42px;
    background: transparent;
    color: var(--ink);
}

.planning-tabs button.active {
    background: var(--surface);
    color: var(--accent-strong);
    box-shadow: 0 5px 16px rgba(22, 36, 52, 0.08);
}

.scheduling-control-centre {
    display: grid;
    gap: 18px;
}

.scheduling-hero {
    margin: 0;
}

.scheduling-hero .eyebrow {
    margin-bottom: 5px;
}

.scheduling-summary {
    margin: 0;
}

.planning-stat.needs-attention {
    border-color: #e3b04e;
    background: #fffaf0;
}

.scheduling-hub {
    display: grid;
    gap: 14px;
}

.scheduling-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #dfe7eb;
    scrollbar-width: thin;
}

.scheduling-tabs button {
    min-width: max-content;
    min-height: 44px;
    flex: 1 0 auto;
    background: transparent;
    color: var(--ink);
}

.scheduling-tabs button.active {
    background: var(--surface);
    color: var(--accent-strong);
    box-shadow: var(--shadow-soft);
}

.scheduling-panel {
    display: none;
}

.scheduling-panel.active {
    display: block;
}

.scheduling-panel[hidden] {
    display: none !important;
}

.schedule-work-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.schedule-work-card {
    display: grid;
    grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1.25fr);
    gap: 18px;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.schedule-work-card__identity span {
    color: var(--accent);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.schedule-work-card__identity h3 {
    margin: 4px 0;
}

.schedule-work-card__identity p {
    margin: 0;
    color: var(--muted);
}

.schedule-work-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 7px;
}

.scheduling-empty-state {
    margin-top: 14px;
    text-align: center;
}

.workflow-panel-narrow {
    width: min(100%, 620px);
    margin: 0 auto;
}

.workflow-panel-narrow.wide {
    width: min(100%, 900px);
}

.workflow-panel-narrow .panel > h2,
.scheduling-panel > .panel-heading h2,
.scheduling-panel .split-grid h2 {
    margin: 0;
    font-size: 1.2rem;
}

.planning-panel {
    display: none;
}

.planning-panel.active {
    display: block;
}

.route-command-strip {
    display: grid;
    gap: 10px;
    margin: 14px 0;
}

.route-quick-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.route-quick-stats div {
    display: grid;
    gap: 2px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7fafb;
}

.route-quick-stats strong {
    color: var(--accent-strong);
    font-size: 1.25rem;
}

.route-quick-stats span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.route-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #e7eef2;
}

.route-tabs button {
    flex: 1 1 145px;
    min-height: 42px;
    background: transparent;
    color: var(--ink);
}

.route-tabs button.active {
    background: var(--surface);
    color: var(--accent-strong);
    box-shadow: 0 5px 16px rgba(22, 36, 52, 0.08);
}

.route-tab-panel {
    display: none;
}

.route-tab-panel.active {
    display: block;
}

.route-workbench > .route-tab-panel[data-route-panel="versions"].active,
.route-workbench > .route-tab-panel[data-route-panel="stops"].active,
.route-workbench > .route-tab-panel[data-route-panel="integrations"].active {
    grid-column: 1 / -1;
}

.route-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 14px;
}

.route-builder-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 420px;
    gap: 14px;
    align-items: stretch;
}

.route-builder-map-panel {
    position: relative;
    min-height: 620px;
}

.route-builder-map-panel .osm-map {
    min-height: 620px;
}

.map-action-strip {
    position: absolute;
    z-index: 500;
    left: 12px;
    top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-width: calc(100% - 24px);
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 18px rgba(22, 36, 52, 0.12);
}

.toolbar-toggle {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin: 0;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f5f8fa;
    font-size: 0.84rem;
    font-weight: 700;
}

.toolbar-toggle input {
    width: auto;
    margin: 0;
}

.map-status-strip {
    position: absolute;
    z-index: 500;
    right: 12px;
    bottom: 12px;
    display: grid;
    gap: 8px;
    max-width: min(360px, calc(100% - 24px));
}

.map-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 9px 11px;
    border: 1px solid rgba(7, 94, 89, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--accent-strong);
    font-size: 0.83rem;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(22, 36, 52, 0.1);
}

.map-status-pill.subtle {
    color: var(--muted);
}

.route-builder-panel {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.route-draft-form {
    display: grid;
    gap: 12px;
}

.route-draft-form .form-grid,
.temporary-stop-form .form-grid {
    display: grid;
    gap: 8px;
}

.layer-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7fafb;
}

.layer-row {
    display: grid;
    gap: 3px;
}

.layer-row strong {
    font-size: 0.92rem;
}

.layer-row small {
    color: var(--muted);
}

.stop-picker label {
    margin: 0;
}

.stop-search-results {
    display: grid;
    gap: 6px;
    max-height: 190px;
    overflow: auto;
    margin-top: 8px;
}

.stop-result-button {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fafb;
    color: var(--ink);
    text-align: left;
}

.empty-inline-state {
    padding: 10px 12px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    background: #fbfcfd;
    color: var(--muted);
    font-size: 0.9rem;
}

.stop-result-button small {
    color: var(--muted);
    font-weight: 700;
}

.stop-bank-selector {
    display: grid;
    gap: 12px;
}

.stop-bank-selector-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 12px;
    align-items: stretch;
}

.stop-bank-map {
    min-height: 360px;
}

.stop-bank-selector-sidebar {
    display: grid;
    align-content: start;
    gap: 10px;
}

.stop-bank-form {
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfd;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

.stop-bank-form.is-stop-bank-active {
    border-color: rgba(13, 118, 110, 0.4);
    background: #f5fbfa;
    box-shadow: 0 0 0 2px rgba(13, 118, 110, 0.08);
}

.stop-bank-search-panel {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7fafb;
}

.temporary-stop-form {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f8fbfa;
}

.stop-sequence-panel {
    display: grid;
    gap: 8px;
    min-height: 150px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f7fafb;
}

.stop-sequence-panel h3 {
    margin: 0;
    font-size: 0.96rem;
}

.stop-sequence-panel small {
    color: var(--muted);
}

.stop-sequence-list {
    display: grid;
    gap: 7px;
    max-height: 240px;
    overflow: auto;
    margin: 0;
    padding: 0;
    list-style: none;
}

.stop-sequence-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.stop-sequence-item .sequence-number {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
}

.stop-sequence-item strong,
.stop-result-button strong {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stop-sequence-item span {
    display: grid;
    min-width: 0;
}

.stop-sequence-item small {
    color: var(--muted);
}

.stop-sequence-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 5px;
}

.stop-sequence-control {
    min-height: 30px;
    padding: 5px 8px;
    background: #e7edf0;
    color: var(--ink);
    font-size: 0.74rem;
}

.stop-sequence-control:disabled {
    opacity: 0.45;
}

.stop-remove-button {
    color: var(--danger);
}

.route-builder-marker {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(22, 36, 52, 0.2);
}

.route-builder-marker.temp {
    background: var(--warning);
}

.leaflet-div-icon.route-builder-div-icon {
    border: 0;
    background: transparent;
}

.route-canvas {
    min-height: 560px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(13, 118, 110, 0.09) 1px, transparent 1px),
        linear-gradient(rgba(13, 118, 110, 0.09) 1px, transparent 1px),
        #f8fbfa;
    background-size: 34px 34px;
    box-shadow: var(--shadow);
}

.route-map-grid {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 560px;
}

.map-node {
    position: absolute;
    z-index: 2;
    display: grid;
    place-items: center;
    min-width: 78px;
    min-height: 38px;
    padding: 8px 10px;
    border: 2px solid var(--accent-strong);
    border-radius: 8px;
    background: var(--surface);
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 800;
    text-align: center;
}

.node-a { left: 12%; top: 65%; }
.node-b { left: 34%; top: 42%; }
.node-c { left: 58%; top: 26%; }
.node-d { left: 74%; top: 56%; }

.map-path {
    position: absolute;
    z-index: 1;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
    transform-origin: left center;
}

.path-one {
    left: 21%;
    top: 66%;
    width: 26%;
    transform: rotate(-35deg);
}

.path-two {
    left: 42%;
    top: 44%;
    width: 27%;
    transform: rotate(-28deg);
}

.path-three {
    left: 65%;
    top: 34%;
    width: 24%;
    transform: rotate(52deg);
}

.builder-panel {
    display: grid;
    gap: 12px;
    align-content: start;
}

.panel-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.panel-heading h2,
.publish-layout h2 {
    margin: 0;
    font-size: 1.08rem;
}

.draft-list,
.run-board {
    display: grid;
    gap: 10px;
}

.draft-card,
.run-card,
.tool-card {
    padding: 14px;
}

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

.draft-card strong {
    display: block;
    margin-top: 3px;
}

.draft-card dl,
.run-card dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
}

.draft-card dt,
.run-card dt {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
}

.draft-card dd,
.run-card dd {
    margin: 0;
    font-weight: 800;
}

.route-tools-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.tool-card h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.tool-card p {
    margin: 0;
}

.run-board {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.run-card header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.run-card dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.duty-table {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.duty-row {
    display: grid;
    grid-template-columns: 90px 1fr 110px 110px 1.5fr;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
}

.duty-row:first-child {
    border-top: 0;
}

.allocation-duty-table .duty-row {
    grid-template-columns: 90px 1fr 110px 110px 90px 1.35fr;
}

.stop-geofence-link-table .duty-row {
    grid-template-columns: minmax(190px, 1.2fr) 130px minmax(280px, 1.4fr) 100px;
}

.timing-point-mapping-gap-table .duty-row {
    grid-template-columns: minmax(190px, 1fr) minmax(210px, 1.15fr) minmax(300px, 1.5fr) 100px;
}

.stop-geofence-link-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.stop-geofence-link-form select {
    min-width: 0;
    width: 100%;
}

.dispatch-planning-steps {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.dispatch-planning-steps a {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 2px 10px;
    align-items: center;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: inherit;
    background: #f7fafb;
    text-decoration: none;
}

.dispatch-planning-steps a > span {
    display: grid;
    grid-row: 1 / span 2;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: #fff;
    background: var(--accent-strong);
    font-weight: 900;
}

.dispatch-planning-steps small {
    color: var(--muted);
}

.dispatch-planning-steps .is-current {
    border-color: var(--accent);
    background: #edf8f5;
}

.dispatch-create-job > summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    cursor: pointer;
}

.dispatch-create-job > summary span {
    color: var(--muted);
    font-size: .86rem;
}

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

.dispatch-allocation-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    scroll-margin-top: 22px;
}

.dispatch-allocation-card:target {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.dispatch-allocation-card.is-signed-on {
    border-color: #3a9b78;
    box-shadow: inset 4px 0 0 #3a9b78;
    background: #f3fbf8;
}

.dispatch-allocation-card header {
    display: grid;
    gap: 5px;
}

.dispatch-allocation-card header > div {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dispatch-allocation-card header > strong {
    font-size: 1.05rem;
}

.dispatch-allocation-card header > small,
.dispatch-card-controls small {
    color: var(--muted);
}

.dispatch-card-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    font-size: .82rem;
    font-weight: 800;
}

.dispatch-card-controls {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
}

.dispatch-card-controls form {
    padding: 12px;
    border-radius: 10px;
    background: #f6f8f9;
}

.dispatch-card-controls label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
}

.dispatch-signed-on-label {
    color: #17694f !important;
    font-weight: 800;
}

.dispatch-bus-cleared-label {
    color: #a5322b !important;
    font-weight: 900;
}

.dispatch-sign-on-heading {
    align-items: flex-start;
}

.dispatch-sign-on-date-panel {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 16px;
}

.dispatch-sign-on-date-panel form {
    display: flex;
    align-items: end;
    gap: 10px;
}

.dispatch-sign-on-date-panel label {
    display: grid;
    gap: 5px;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 800;
}

.dispatch-sign-on-metrics .metric.is-positive {
    border-color: #70b99f;
    background: #f1fbf7;
}

.dispatch-sign-on-metrics .metric.is-positive strong {
    color: #17694f;
}

.dispatch-sign-on-metrics .metric.is-alert {
    border-color: #e6a19b;
    background: #fff6f5;
}

.dispatch-sign-on-metrics .metric.is-alert strong {
    color: #a5322b;
}

.dispatch-sign-on-board {
    overflow: hidden;
    padding: 0;
}

.dispatch-sign-on-board > h3 {
    margin: 18px 18px 8px;
}

.dispatch-sign-on-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.05fr) minmax(160px, 1fr) 110px minmax(170px, .9fr) minmax(230px, 1.25fr) 84px;
    gap: 15px;
    align-items: center;
    min-width: 0;
    padding: 17px 18px;
    border-top: 1px solid var(--line);
    border-left: 6px solid #c64e46;
    background: #fff8f7;
    transition: background-color .15s ease, border-color .15s ease;
}

.dispatch-sign-on-row:first-child {
    border-top: 0;
}

.dispatch-sign-on-row.is-signed-on {
    border-left-color: #258261;
    background: #f1fbf7;
}

.dispatch-sign-on-row.has-no-staff,
.dispatch-sign-on-row.has-no-bus {
    box-shadow: inset 0 -2px 0 #efbd57;
}

.dispatch-sign-on-head {
    padding-top: 12px;
    padding-bottom: 12px;
    border-left-color: transparent;
    color: var(--muted);
    background: #f1f5f6;
    font-size: .73rem;
    font-weight: 900;
    letter-spacing: .07em;
    text-transform: uppercase;
}

.dispatch-sign-on-shift,
.dispatch-sign-on-person,
.dispatch-sign-on-time,
.dispatch-sign-on-bus,
.dispatch-sign-on-action {
    min-width: 0;
}

.dispatch-sign-on-shift strong,
.dispatch-sign-on-person strong,
.dispatch-sign-on-time strong {
    display: block;
}

.dispatch-sign-on-shift strong {
    color: var(--ink);
    font-size: 1.06rem;
}

.dispatch-sign-on-time strong {
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}

.dispatch-sign-on-shift span,
.dispatch-sign-on-shift small,
.dispatch-sign-on-person small,
.dispatch-sign-on-time small,
.dispatch-sign-on-bus small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    line-height: 1.25;
}

.dispatch-sign-on-toggle {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 9px;
    align-items: center;
    min-width: 0;
    cursor: pointer;
}

.dispatch-sign-on-toggle input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.dispatch-sign-on-check {
    position: relative;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border: 2px solid #b7463f;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(12, 34, 44, .12);
}

.dispatch-sign-on-check::after {
    content: "";
    width: 13px;
    height: 7px;
    border-bottom: 3px solid #fff;
    border-left: 3px solid #fff;
    opacity: 0;
    transform: translateY(-2px) rotate(-45deg);
}

.dispatch-sign-on-toggle input:checked + .dispatch-sign-on-check {
    border-color: #258261;
    background: #258261;
}

.dispatch-sign-on-toggle input:checked + .dispatch-sign-on-check::after {
    opacity: 1;
}

.dispatch-sign-on-toggle input:focus-visible + .dispatch-sign-on-check {
    outline: 3px solid rgba(31, 120, 143, .35);
    outline-offset: 2px;
}

.dispatch-sign-on-toggle input:disabled + .dispatch-sign-on-check {
    cursor: not-allowed;
    opacity: .45;
}

.dispatch-sign-on-state {
    color: #a5322b;
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .025em;
}

.dispatch-sign-on-state .when-on {
    display: none;
}

.dispatch-sign-on-toggle input:checked ~ .dispatch-sign-on-state {
    color: #17694f;
}

.dispatch-sign-on-toggle input:checked ~ .dispatch-sign-on-state .when-off {
    display: none;
}

.dispatch-sign-on-toggle input:checked ~ .dispatch-sign-on-state .when-on {
    display: inline;
}

.dispatch-sign-on-bus input {
    width: 100%;
    min-width: 0;
    border-width: 2px;
    background: #fff;
    font-weight: 800;
}

.dispatch-sign-on-bus .has-allocation {
    color: #17694f;
    font-weight: 800;
}

.dispatch-sign-on-bus .no-allocation {
    color: #a5322b;
    font-weight: 900;
    text-transform: uppercase;
}

.dispatch-sign-on-action {
    display: flex;
    justify-content: flex-end;
}

.dispatch-trip-date-form {
    justify-content: center;
}

.dispatch-trip-table {
    overflow: hidden;
}

.dispatch-trip-row {
    display: grid;
    grid-template-columns: 82px minmax(230px, 1.5fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(210px, .9fr);
    gap: 16px;
    align-items: center;
    padding: 16px 18px;
    border-top: 1px solid var(--line);
}

.dispatch-trip-row:first-child {
    border-top: 0;
}

.dispatch-trip-head {
    color: var(--muted);
    background: #f4f8f9;
    font-size: .76rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.dispatch-trip-time {
    font-size: 1.35rem;
    font-variant-numeric: tabular-nums;
}

.dispatch-trip-service strong,
.dispatch-trip-person strong,
.dispatch-trip-vehicle strong {
    display: block;
}

.dispatch-trip-service small,
.dispatch-trip-person small,
.dispatch-trip-vehicle small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
}

.dispatch-trip-vehicle .status-pill {
    margin-top: 8px;
}

.dispatch-trip-actions {
    display: grid;
    justify-items: start;
    gap: 8px;
}

.dispatch-trip-edit-link {
    display: inline-block;
    margin-top: 7px;
    font-size: .82rem;
    font-weight: 800;
}

.shift-component-list article[id^="duty-"] {
    scroll-margin-top: 24px;
}

.shift-component-list article[id^="duty-"]:target {
    outline: 3px solid #d89a20;
    outline-offset: 3px;
}

.dispatch-trip-override {
    width: 100%;
}

.dispatch-trip-override summary {
    color: var(--accent-strong);
    cursor: pointer;
    font-size: .82rem;
    font-weight: 800;
}

.dispatch-trip-override form {
    display: grid;
    gap: 8px;
    margin-top: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.dispatch-trip-override label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: .75rem;
    font-weight: 800;
}

.dispatch-trip-override select,
.dispatch-trip-override textarea {
    min-width: 0;
    width: 100%;
}

.dispatch-trip-row.has-changeover {
    box-shadow: inset 4px 0 0 #d89a20;
    background: #fffaf0;
}

.dispatch-trip-row.is-cancelled {
    background: #fff5f4;
    color: var(--muted);
}

.dispatch-trip-row.is-cancelled .dispatch-trip-service > strong,
.dispatch-trip-row.is-cancelled .dispatch-trip-time {
    text-decoration: line-through;
}

@media (max-width: 920px) {
    .dispatch-planning-steps,
    .dispatch-allocation-grid,
    .dispatch-card-controls { grid-template-columns: 1fr; }
    .dispatch-trip-head { display: none; }
    .dispatch-trip-row { grid-template-columns: 72px 1fr; align-items: start; }
    .dispatch-trip-person, .dispatch-trip-vehicle, .dispatch-trip-actions { grid-column: 2; }
    .dispatch-trip-actions { display: flex; align-items: center; flex-wrap: wrap; }
    .dispatch-sign-on-date-panel { align-items: stretch; flex-wrap: wrap; }
    .dispatch-sign-on-head { display: none; }
    .dispatch-sign-on-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 20px;
        padding: 18px;
    }
    .dispatch-sign-on-row > [data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 5px;
        color: var(--muted);
        font-size: .68rem;
        font-weight: 900;
        letter-spacing: .06em;
        text-transform: uppercase;
    }
    .dispatch-sign-on-action { align-self: end; }
}

@media (max-width: 620px) {
    .dispatch-sign-on-date-panel,
    .dispatch-sign-on-date-panel form {
        display: grid;
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }

    .dispatch-sign-on-date-panel form {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .dispatch-sign-on-date-panel form label {
        grid-column: 1 / -1;
    }

    .dispatch-sign-on-row {
        grid-template-columns: 1fr;
    }

    .dispatch-sign-on-action {
        justify-content: stretch;
    }

    .dispatch-sign-on-action .button {
        width: 100%;
    }
}

.component-table .duty-row {
    grid-template-columns: 58px 105px minmax(150px, 1.2fr) minmax(150px, 1fr) minmax(120px, 0.8fr);
}

.component-table .duty-row > span:last-child {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    flex-wrap: wrap;
}

.shift-component-list > article {
    align-items: stretch;
}

.duty-head {
    background: #e9eef2;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.compact-table {
    margin-top: 12px;
    box-shadow: none;
}

.gtfs-import-table .duty-row {
    grid-template-columns: 80px 140px 90px minmax(0, 1fr) 170px;
}

.timetable-grid-panel {
    min-width: 0;
}

.timetable-stop-picker {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fafb;
}

.timetable-builder-controls,
.timetable-grid-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.timetable-builder-controls details {
    flex: 1 1 620px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #f8fafb;
}

.timetable-builder-controls .timetable-builder-stop-control {
    flex-basis: 320px;
}

.timetable-builder-stop-control .timetable-stop-picker {
    margin-top: 10px;
}

.timetable-builder-controls summary {
    cursor: pointer;
    font-weight: 850;
}

.timetable-grid-toolbar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius) var(--radius) 0 0;
    background: #fff;
}

.timetable-stop-search-field {
    position: relative;
}

.timetable-stop-search-field .stop-search-results {
    max-height: 240px;
}

.timetable-stop-map-selector {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.timetable-stop-map-selector summary {
    cursor: pointer;
    font-weight: 850;
}

.timetable-stop-map {
    min-height: 420px;
    margin-top: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.timetable-grid-scroll {
    overflow: auto;
    max-height: 72vh;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.timetable-grid {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.88rem;
}

.timetable-grid th,
.timetable-grid td {
    min-width: 108px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    padding: 0;
    text-align: center;
    vertical-align: middle;
}

.timetable-grid thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #0caf55;
    color: #03160b;
    font-weight: 900;
}

.timetable-grid thead th small {
    display: block;
    color: rgba(3, 22, 11, 0.72);
    font-size: 0.68rem;
}

.timetable-grid tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    min-width: 270px;
    max-width: 270px;
    padding: 7px 10px;
    background: #fff;
    text-align: left;
    font-weight: 800;
    white-space: normal;
}

.timetable-grid tbody th small {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
}

.timetable-grid__corner {
    left: 0;
    z-index: 3 !important;
    min-width: 270px;
    padding: 7px 10px !important;
    text-align: left !important;
}

.timetable-grid tbody tr:nth-child(odd) td {
    background: #0caf55;
}

.timetable-grid tbody tr:nth-child(even) td {
    background: #ffffff;
}

.timetable-grid td.is-empty {
    color: var(--muted);
    background: #f5f7f8 !important;
}

.timetable-cell-form {
    display: grid;
    grid-template-columns: minmax(64px, 1fr) auto;
    gap: 4px;
    align-items: center;
    padding: 3px;
}

.timetable-grid-time {
    width: calc(100% - 8px);
    margin: 4px;
    min-height: 32px;
    border: 0;
    border-radius: 4px;
    padding: 5px 4px;
    background: rgba(255, 255, 255, 0.78);
    color: #07120b;
    text-align: center;
    font-weight: 800;
}

.timetable-grid td.is-terminus {
    box-shadow: inset 0 -4px 0 #0a5d2b;
}

.terminus-label {
    display: block;
    padding: 0 4px 3px;
    color: #063f1e;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
}

.timetable-row-movers {
    display: inline-flex;
    gap: 4px;
    margin-top: 5px;
}

.timetable-cell-form .button {
    min-height: 30px;
    padding: 5px 7px;
    background: rgba(255, 255, 255, 0.86);
}

.validation-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 14px 118px;
    border-top: 1px solid var(--line);
}

.validation-pill {
    display: inline-flex;
    max-width: 100%;
    border-radius: 8px;
    padding: 5px 8px;
    background: #e8eef3;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.validation-pill.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.validation-pill.error {
    background: #fde7e5;
    color: var(--danger);
}

.publish-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 14px;
}

.status-list.inline {
    margin-top: 12px;
    box-shadow: none;
}

.publish-card {
    display: grid;
    gap: 12px;
    align-content: start;
}

.action-stack {
    display: grid;
    gap: 10px;
    align-content: start;
}

.action-stack .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
}

.driver-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.driver-action-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(210px, 1fr));
    gap: 12px;
}

.driver-self-service {
    --driver-maroon: #781b2d;
    --driver-maroon-dark: #4d0f1c;
    --driver-maroon-soft: #f8e8ec;
    --driver-coral: #d85c4a;
    --driver-cream: #fff5d8;
    --driver-muted-cell: #dddddd;
    --driver-ink: #003f43;
    min-height: 100vh;
    margin: 0;
    color: var(--driver-ink);
    display: flex;
    flex-direction: column;
}

.driver-self-service > .driver-service-header { order: 1; }
.driver-self-service > .driver-calendar-toolbar { order: 2; }
.driver-self-service > .driver-calendar-intro { order: 3; }
.driver-self-service > .driver-calendar { order: 4; }
.driver-self-service > .driver-workday-panel { order: 5; }
.driver-self-service > .driver-main-actions { order: 6; }

/* The selected-date panel now owns the self-service tabs and forms. */
.driver-self-service > .driver-view-menu,
.driver-self-service > .driver-self-service-forms {
    display: none;
}

.driver-calendar-intro {
    order: 3;
    margin: 0;
    padding: 14px 16px 0;
    background: #f9fbfb;
    color: rgba(0, 63, 67, 0.72);
    font-weight: 700;
}

.driver-standalone-shell {
    margin: 0;
    background: #f9fbfb;
}

.driver-standalone-notice {
    margin: 12px;
}

.driver-self-service .button,
.driver-self-service button {
    background: var(--driver-maroon);
}

.driver-self-service .button.ghost {
    background: var(--driver-maroon-soft);
    color: var(--driver-maroon-dark);
}

.driver-self-service .button.danger,
.driver-self-service button.danger {
    background: #9d1d20;
}

.driver-service-header {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) auto;
    align-items: center;
    min-height: 76px;
    background: var(--driver-maroon-dark);
    color: #fff;
}

.driver-service-brand,
.driver-service-title,
.driver-service-user {
    min-width: 0;
    padding: 16px 20px;
}

.driver-service-brand {
    display: flex;
    gap: 12px;
    align-items: center;
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.35rem;
}

.driver-service-mark {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 3px solid #fff;
    border-radius: 50%;
    font-weight: 900;
}

.driver-service-title {
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.25rem;
    font-weight: 800;
}

.driver-service-user {
    justify-self: end;
    color: rgba(255, 255, 255, 0.72);
    font-size: 1.05rem;
    font-weight: 800;
    text-align: right;
}

.driver-calendar-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    background: var(--driver-maroon);
}

.driver-views-title,
.driver-display-mode,
.driver-period-label,
.driver-period-nav {
    min-height: 44px;
    border-radius: 4px;
    font-weight: 800;
}

.driver-views-title {
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    background: #f1f7f6;
    color: var(--driver-ink);
}

.driver-display-mode {
    display: inline-flex;
    align-items: center;
    padding: 0 18px;
    border: 1px solid rgba(255, 255, 255, 0.38);
    color: #fff;
}

.driver-display-mode.active {
    background: var(--driver-coral);
    border-color: var(--driver-coral);
}

.driver-period-label {
    display: inline-flex;
    align-items: center;
    min-width: 220px;
    padding: 0 14px;
    background: #fff;
    color: var(--driver-ink);
}

.driver-period-nav {
    display: inline-grid;
    place-items: center;
    width: 44px;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 50%;
    color: #fff;
    font-size: 1.25rem;
}

.driver-view-menu {
    display: grid;
    grid-template-columns: repeat(5, minmax(160px, 1fr));
    gap: 12px 28px;
    padding: 12px 16px;
    background: #e6f0ef;
}

.driver-view-menu span {
    display: flex;
    align-items: center;
    min-height: 48px;
    overflow: hidden;
    border-radius: 4px;
    background: #fff;
    color: var(--driver-ink);
    font-weight: 800;
}

.driver-view-menu strong {
    display: grid;
    place-items: center;
    align-self: stretch;
    min-width: 48px;
    margin-right: 12px;
    background: #f7f7f7;
    color: var(--driver-ink);
    font-style: italic;
}

.driver-view-menu .active strong,
.driver-view-menu .active {
    background: var(--driver-maroon-dark);
    color: #fff;
}

.driver-view-menu .needs-action {
    box-shadow: inset 0 0 0 2px #d88900;
}

.driver-self-service-forms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    padding: 16px;
    background: #e6f0ef;
}

.driver-self-service-card {
    display: grid;
    gap: 12px;
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: 0 8px 18px rgba(22, 36, 52, 0.08);
}

.driver-self-service-card h2 {
    margin: 0;
}

.driver-self-service-card .simple-list {
    margin-top: 0;
}

.driver-main-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(220px, 1fr));
    gap: 22px;
    padding: 22px 16px;
    background: #e6f0ef;
}

.driver-main-action {
    min-width: 0;
    background: #fff;
    box-shadow: 0 8px 18px rgba(22, 36, 52, 0.08);
}

.driver-main-action summary {
    display: flex;
    gap: 16px;
    align-items: center;
    min-height: 74px;
    padding: 16px 18px;
    background: var(--driver-maroon-dark);
    color: #fff;
    cursor: pointer;
    list-style: none;
}

.driver-main-action summary::-webkit-details-marker {
    display: none;
}

.driver-main-action.urgent summary {
    background: var(--driver-coral);
}

.driver-action-icon {
    display: grid;
    place-items: center;
    width: 50px;
    height: 42px;
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 900;
}

.driver-main-action summary strong {
    overflow: hidden;
    font-size: 1.05rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-main-action-body {
    padding: 16px;
    border: 1px solid rgba(77, 15, 28, 0.16);
    border-top: 0;
}

.driver-main-action-body p {
    margin-top: 0;
}

.driver-main-action-body label:first-of-type {
    margin-top: 0;
}

.driver-main-action.precheck-action[open] {
    grid-column: span 2;
}

.precheck-checklist {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
}

.precheck-checklist-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(170px, auto);
    gap: 10px;
    align-items: center;
    padding: 8px 10px;
    border: 1px solid rgba(77, 15, 28, 0.12);
    border-radius: 6px;
    background: #f9fbfb;
}

.precheck-checklist-row span {
    min-width: 0;
    font-size: 0.9rem;
}

.precheck-result-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(78px, 1fr));
    gap: 8px;
}

.precheck-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 6px 10px;
    border: 2px solid #cdd8d5;
    border-radius: 6px;
    background: #fff;
    color: #33423f;
    font-weight: 800;
    cursor: pointer;
}

.precheck-result input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.precheck-result-mark {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
}

.precheck-result.good .precheck-result-mark {
    background: #e7f6ed;
    color: #14833b;
}

.precheck-result.defect .precheck-result-mark {
    background: #fdeceb;
    color: #b3261e;
}

.precheck-result:has(input:checked) {
    box-shadow: 0 0 0 3px rgba(20, 131, 59, 0.12);
}

.precheck-result.good:has(input:checked) {
    border-color: #14833b;
    background: #f0fbf4;
    color: #0f6b30;
}

.precheck-result.defect:has(input:checked) {
    border-color: #b3261e;
    background: #fff4f3;
    color: #8d1d17;
    box-shadow: 0 0 0 3px rgba(179, 38, 30, 0.14);
}

.precheck-result:focus-within {
    outline: 3px solid rgba(19, 95, 166, 0.28);
    outline-offset: 2px;
}

.driver-calendar {
    display: grid;
    gap: 4px;
    padding: 16px 0;
    overflow-x: auto;
    background: #f9fbfb;
}

.driver-calendar-head,
.driver-calendar-week {
    display: grid;
    grid-template-columns: 52px repeat(7, minmax(150px, 1fr));
    gap: 4px;
    min-width: 1120px;
    padding: 0 6px;
}

.driver-calendar-head {
    align-items: end;
    color: var(--driver-ink);
    font-weight: 900;
    text-align: right;
}

.driver-calendar-head span,
.driver-week-number {
    display: grid;
    place-items: center;
}

.driver-calendar-day {
    position: relative;
    display: grid;
    align-content: space-between;
    min-height: 124px;
    padding: 38px 12px 12px;
    border: 1px solid #0c8b93;
    border-radius: 4px;
    background: var(--driver-muted-cell);
    color: var(--driver-ink);
}

.driver-calendar-day.has-duty {
    background: var(--driver-cream);
}

.driver-calendar-day.selected {
    border-color: #d88900;
    box-shadow: inset 0 0 0 1px #d88900;
}

.driver-calendar-day.other-month {
    opacity: 0.5;
}

.driver-date-number {
    position: absolute;
    top: 8px;
    right: 12px;
    font-size: 1.45rem;
    font-weight: 900;
}

.driver-mobile-weekday {
    display: none;
}

.driver-calendar-day strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-calendar-day small {
    color: rgba(0, 63, 67, 0.55);
    font-weight: 800;
}

.driver-calendar-day.has-availability {
    box-shadow: inset 0 0 0 2px #238b74;
}

.driver-calendar-day.has-unavailability {
    box-shadow: inset 0 0 0 2px #b3261e;
}

.driver-calendar-day.selected.has-availability,
.driver-calendar-day.selected.has-unavailability {
    box-shadow: inset 0 0 0 2px #d88900, 0 0 0 2px rgba(216, 137, 0, 0.22);
}

.driver-calendar-flags {
    display: block;
    overflow: hidden;
    color: rgba(0, 63, 67, 0.7);
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-week-number {
    border: 1px solid #0c8b93;
    border-radius: 4px;
    background: #fff;
    font-weight: 900;
}

.driver-workday-panel {
    margin-top: 18px;
    border-left: 4px solid var(--driver-maroon-dark);
    background: #fff;
    box-shadow: 0 10px 24px rgba(22, 36, 52, 0.12);
}

.driver-selected-date-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
    background: var(--driver-cream);
    border-bottom: 1px solid rgba(77, 15, 28, 0.14);
}

.driver-selected-date-bar > div {
    display: grid;
    gap: 3px;
}

.driver-selected-date-kicker {
    color: rgba(0, 63, 67, 0.62);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.driver-selected-date-bar strong {
    color: #000;
    font-size: 1.2rem;
}

.driver-selected-date-hint {
    color: rgba(0, 63, 67, 0.72);
    font-weight: 800;
    text-align: right;
}

.driver-workday-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 0 0 12px;
    background: var(--driver-maroon-dark);
}

.driver-workday-tabs button {
    min-height: 48px;
    padding: 14px 22px;
    border: 0;
    border-radius: 4px 4px 0 0;
    background: rgba(255, 255, 255, 0.62);
    color: #fff;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.driver-workday-tabs button:hover,
.driver-workday-tabs button:focus-visible {
    background: rgba(255, 255, 255, 0.82);
    color: var(--driver-ink);
}

.driver-workday-tabs button.active {
    background: #fff;
    color: var(--driver-ink);
}

.driver-tab-panel {
    min-width: 0;
}

.driver-tab-panel[hidden] {
    display: none;
}

.driver-tab-empty,
.driver-tab-heading,
.driver-date-notice,
.driver-date-form,
.driver-date-list {
    margin: 16px;
}

.driver-tab-empty {
    display: grid;
    gap: 8px;
    padding: 22px;
    border: 1px dashed rgba(0, 63, 67, 0.25);
    background: #f9fbfb;
}

.driver-tab-empty span,
.driver-tab-heading p {
    color: rgba(0, 63, 67, 0.72);
}

.driver-tab-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.driver-tab-heading h3,
.driver-tab-heading p {
    margin: 0;
}

.driver-tab-heading p {
    margin-top: 4px;
}

.driver-date-notice {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-left: 4px solid #238b74;
    background: #edf8f3;
}

.driver-date-notice.warning {
    border-left-color: #b3261e;
    background: #fff1ef;
}

.driver-date-form {
    padding: 16px;
    border: 1px solid rgba(0, 63, 67, 0.14);
    border-radius: 6px;
    background: #f9fbfb;
}

.driver-date-list {
    margin-top: 0;
}

.driver-date-list article {
    align-items: center;
}

.driver-date-list article form {
    margin-left: auto;
}

.driver-report-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 16px;
}

.driver-report-scope-note {
    margin: 0 16px 16px;
}

.driver-run-sheet-scope {
    margin: 0 0 16px;
}

.driver-report-back {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 4px;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 900;
}

.driver-workday {
    padding: 16px;
    border: 1px solid var(--line);
    border-top: 0;
}

.driver-workday header {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: flex-start;
    padding: 12px 16px;
    background: var(--driver-cream);
}

.driver-workday h3,
.driver-workday p {
    margin: 0;
}

.driver-workday-meta {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
    margin: 14px 0;
}

.driver-workday-meta dt {
    font-weight: 800;
}

.driver-workday-meta dd {
    margin: 0;
    font-weight: 900;
}

.driver-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 999px;
    background: #e8edf1;
    color: var(--driver-ink);
    font-weight: 900;
}

.driver-status.planned {
    background: #fff1c6;
    color: #915f00;
}

.driver-status.confirmed,
.driver-status.signed_on,
.driver-status.completed {
    background: #e5f8e7;
    color: #08721d;
}

.driver-assignment-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.driver-assignment-actions form {
    margin: 0;
}

.driver-work-rows {
    display: grid;
    gap: 4px;
}

.driver-generic-job-summary {
    display: grid;
    gap: 6px;
    padding: 16px;
    border-left: 5px solid #0c8b93;
    border-radius: 6px;
    background: #edf8f7;
}

.driver-generic-job-summary strong {
    font-size: 1.05rem;
    color: #075e59;
}

.driver-generic-job-summary span,
.driver-generic-job-summary p {
    margin: 0;
    color: var(--muted);
}

.driver-work-row {
    background: var(--driver-cream);
}

.driver-work-row summary {
    display: grid;
    grid-template-columns: 116px minmax(120px, 1fr) 52px minmax(220px, 2fr) minmax(140px, 1fr) 80px;
    gap: 12px;
    align-items: center;
    min-height: 64px;
    cursor: pointer;
    list-style: none;
}

.driver-work-row summary::-webkit-details-marker {
    display: none;
}

.driver-time-band {
    align-self: stretch;
    display: grid;
    place-items: center end;
    padding: 0 14px;
    background: var(--driver-coral);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 900;
}

.driver-location,
.driver-activity strong,
.driver-route-detail,
.driver-duration {
    font-weight: 900;
}

.driver-work-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 38px;
    border-radius: 7px;
    background: #111;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 900;
}

.driver-work-icon.break { background: #2f2421; }
.driver-work-icon.sign { background: #111; }
.driver-work-icon.travel { background: #222; }
.driver-work-icon.activity { background: #394047; }
.driver-work-icon.bus { background: #111; }

.driver-activity {
    display: grid;
    min-width: 0;
}

.driver-activity small,
.driver-route-detail small {
    display: block;
    overflow: hidden;
    color: rgba(0, 63, 67, 0.62);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.driver-stop-detail {
    display: grid;
    gap: 4px;
    padding: 8px 12px 12px 180px;
    border-top: 1px solid rgba(0, 63, 67, 0.28);
}

.driver-stop-detail div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 80px;
    gap: 10px;
    padding: 7px 10px;
    background: rgba(255, 255, 255, 0.56);
}

.driver-stop-detail strong {
    text-align: right;
}

.urgent-panel {
    border-color: #f0c4c0;
}

.action-button {
    min-height: 90px;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.action-button.urgent {
    background: var(--danger);
    color: #fff;
}

.action-button.muted {
    background: #e9eef2;
    color: #4d5d6c;
}

.empty-state {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 28px;
}

.simple-list {
    display: grid;
    gap: 8px;
}

.simple-list article {
    display: grid;
    gap: 3px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.incident-workboard,
.incident-case,
.incident-case-main,
.incident-case-aside {
    display: grid;
    gap: 14px;
}

.incident-workboard-header,
.incident-case-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.incident-workboard-header h2,
.incident-workboard-header p,
.incident-case-header h2,
.incident-case-header p,
.incident-capture summary span {
    margin: 0;
}

.incident-case-actions,
.incident-form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.incident-dashboard-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.incident-dashboard-action {
    display: grid;
    gap: 7px;
    min-height: 142px;
    padding: 17px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
}

.incident-dashboard-action:hover,
.incident-metric-link:hover {
    border-color: #91bdb2;
    background: #f4faf8;
}

.incident-dashboard-action.primary-action {
    border-color: #82b8aa;
    background: #eef8f5;
}

.incident-dashboard-action span {
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.incident-dashboard-action strong {
    font-size: 1.03rem;
}

.incident-dashboard-action p {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

.incident-metric-link {
    color: inherit;
    text-decoration: none;
}

.incident-dashboard-queue {
    display: grid;
}

.incident-dashboard-queue > a {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 13px 2px;
    border-top: 1px solid var(--line);
    color: inherit;
    text-decoration: none;
}

.incident-dashboard-queue > a:first-child {
    border-top: 0;
}

.incident-dashboard-queue > a:hover strong {
    color: var(--accent);
}

.incident-dashboard-queue > a > div:first-child {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.incident-dashboard-queue small {
    color: var(--muted);
}

.incident-queue-status {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
    align-items: center;
}

.incident-capture > summary {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    cursor: pointer;
}

.incident-capture > summary span {
    color: var(--muted);
    font-size: 0.86rem;
}

.incident-capture-grid,
.incident-edit-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-top: 16px;
}

.incident-wide-field {
    grid-column: span 2;
}

.incident-handover-field {
    grid-column: span 3;
    align-self: center;
}

.incident-filter-grid {
    display: grid;
    grid-template-columns: minmax(240px, 1.5fr) repeat(4, minmax(130px, 0.7fr));
    gap: 10px;
    align-items: end;
}

.incident-filter-grid label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
}

.incident-filter-search {
    grid-column: span 2;
}

.incident-register {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.incident-register-row {
    display: grid;
    grid-template-columns: 130px minmax(220px, 1.5fr) minmax(180px, 1fr) minmax(140px, 0.75fr) minmax(170px, 0.8fr);
    gap: 12px;
    align-items: center;
    padding: 13px 14px;
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: inherit;
    text-decoration: none;
}

.incident-register-row:hover {
    background: #f4faf8;
}

.incident-register-row:first-child {
    border-top: 0;
}

.incident-register-row > span {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.incident-register-row small {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.incident-register-head {
    background: #eef4f5;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.incident-register-head:hover {
    background: #eef4f5;
}

.incident-case-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(330px, 0.75fr);
    gap: 14px;
    align-items: start;
}

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

.incident-update-form {
    margin-top: 12px;
}

.incident-timeline {
    display: grid;
    gap: 0;
}

.incident-timeline article {
    display: grid;
    grid-template-columns: 16px minmax(0, 1fr);
    gap: 10px;
    padding: 0 0 18px;
}

.incident-timeline article:not(:last-child) .incident-timeline-marker::after {
    content: '';
    position: absolute;
    top: 12px;
    bottom: -24px;
    left: 5px;
    width: 2px;
    background: var(--line);
}

.incident-timeline-marker {
    position: relative;
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border: 3px solid #cde3de;
    border-radius: 50%;
    background: var(--accent);
}

.incident-timeline p {
    margin: 5px 0;
    color: var(--text);
}

.incident-timeline small {
    color: var(--muted);
}

.incident-origin-card dl {
    display: grid;
    gap: 0;
    margin: 0;
}

.incident-origin-card dl div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 10px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
}

.incident-origin-card dt {
    color: var(--muted);
    font-weight: 800;
}

.incident-origin-card dd {
    margin: 0;
}

.command-block {
    display: block;
    width: 100%;
    overflow-x: auto;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: #f8fafc;
    color: var(--text);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.86rem;
    white-space: nowrap;
}

.staff-surface {
    display: grid;
    gap: 18px;
}

.staff-shell-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.staff-shell-header h1 {
    margin: 0 0 6px;
}

.staff-command-strip,
.staff-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.staff-directory-layout,
.staff-page-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
    gap: 18px;
    align-items: start;
}

.staff-page-main,
.staff-page-aside {
    display: grid;
    gap: 18px;
}

.staff-directory-list,
.staff-function-grid {
    display: grid;
    gap: 12px;
}

.staff-directory-card,
.staff-function-card {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfd;
}

.staff-calendar-panel {
    overflow: hidden;
    padding: 0;
}

.staff-calendar-panel > .panel-heading {
    margin: 0;
    padding: 20px 22px;
    background: linear-gradient(135deg, #063d43, #0c6f73);
    color: #fff;
}

.staff-calendar-panel > .panel-heading .hint,
.staff-calendar-panel > .panel-heading .eyebrow {
    color: rgba(255, 255, 255, 0.76);
}

.staff-calendar-controls,
.bulk-staff-picker-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.staff-calendar-controls strong {
    min-width: 150px;
    text-align: center;
    font-size: 1.08rem;
}

.staff-calendar-controls .button {
    border-color: rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.1rem;
}

.staff-calendar-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 1px;
    align-items: stretch;
    border-bottom: 1px solid var(--line);
    background: var(--line);
}

.staff-calendar-summary > article {
    display: grid;
    min-width: 145px;
    padding: 13px 18px;
    background: #fff;
}

.staff-calendar-summary > article strong { font-size: 1.45rem; color: #063d43; }
.staff-calendar-summary > article span { color: var(--muted); font-size: 0.76rem; font-weight: 700; text-transform: uppercase; }
.staff-calendar-legend { display: flex; flex: 1; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: flex-end; padding: 12px 18px; background: #fff; }
.staff-calendar-legend span { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.staff-calendar-legend i { width: 10px; height: 10px; border-radius: 50%; background: #2176ae; }
.staff-calendar-legend .legend-conductor i { background: #8b5cf6; }
.staff-calendar-legend .legend-customer_service i { background: #d97706; }
.staff-calendar-legend .legend-operations i { background: #168267; }
.staff-calendar-legend .legend-mixed i { background: #c24170; }

.staff-calendar {
    overflow-x: auto;
}

.staff-calendar-head,
.staff-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(150px, 1fr));
    min-width: 1050px;
}

.staff-calendar-head span {
    padding: 10px;
    border-bottom: 1px solid var(--line);
    background: #f4f7f8;
    color: var(--muted);
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
}

.staff-calendar-day {
    min-height: 165px;
    padding: 8px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: #f8fafb;
}

.staff-calendar-day.other-month { opacity: 0.48; }
.staff-calendar-day.has-jobs { background: #fff; }
.staff-calendar-day.is-today { box-shadow: inset 0 0 0 2px #ed9b2d; }
.staff-calendar-day > header { display: flex; align-items: center; gap: 6px; min-height: 28px; margin-bottom: 7px; }
.staff-calendar-day > header > span { display: none; }
.staff-calendar-day > header time { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 900; }
.staff-calendar-day.is-today > header time { background: #ed9b2d; color: #17212b; }
.staff-calendar-day > header b { margin-left: auto; padding: 2px 7px; border-radius: 999px; background: #e9f3f2; color: #075e59; font-size: 0.7rem; }
.staff-calendar-jobs { display: grid; gap: 6px; }
.staff-calendar-job { --job-color: #2176ae; display: grid; gap: 5px; padding: 7px; border-left: 4px solid var(--job-color); border-radius: 5px; background: color-mix(in srgb, var(--job-color) 8%, white); box-shadow: 0 1px 3px rgba(23, 33, 43, 0.08); font-size: 0.75rem; }
.staff-calendar-job.job-conductor { --job-color: #8b5cf6; }
.staff-calendar-job.job-customer_service { --job-color: #d97706; }
.staff-calendar-job.job-operations { --job-color: #168267; }
.staff-calendar-job.job-mixed { --job-color: #c24170; }
.staff-calendar-job-top { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.staff-calendar-job-top strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-calendar-job-top time { font-variant-numeric: tabular-nums; font-weight: 900; color: var(--job-color); }
.staff-calendar-avatar { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--job-color); color: #fff; font-size: 0.62rem; font-weight: 900; }
.staff-calendar-job-detail { display: flex; align-items: center; gap: 6px; padding-left: 30px; color: var(--muted); }
.staff-calendar-job-detail > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-dot { flex: 0 0 auto; width: 7px; height: 7px; margin-left: auto; border-radius: 50%; background: #94a3b8; }
.status-dot.status-confirmed,
.status-dot.status-signed_on,
.status-dot.status-completed { background: #168267; }
.status-dot.status-unallocated { background: #dc2626; }
.status-dot.status-planned { background: #ed9b2d; }

.bulk-staff-picker {
    display: grid;
    gap: 7px;
    max-height: 310px;
    padding: 10px;
    overflow-y: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfd;
}

@media (max-width: 760px) {
    .staff-calendar-summary > article { min-width: calc(33.333% - 1px); padding: 10px; }
    .staff-calendar-legend { justify-content: flex-start; }
    .staff-calendar-head { display: none; }
    .staff-calendar-grid { display: grid; grid-template-columns: 1fr; min-width: 0; }
    .staff-calendar-day { min-height: 0; }
    .staff-calendar-day:not(.has-jobs) { display: none; }
    .staff-calendar-day > header > span { display: inline; font-weight: 800; color: var(--muted); }
}

.staff-directory-card h3,
.staff-directory-card p,
.staff-function-card strong,
.staff-function-card span {
    margin: 0;
}

.staff-directory-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 0.86rem;
}

.staff-directory-actions {
    display: flex;
    justify-content: flex-start;
}

.staff-function-card {
    color: inherit;
    text-decoration: none;
}

.staff-function-card strong {
    color: var(--accent-strong);
}

.staff-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
    gap: 18px;
    align-items: start;
}

.staff-create-panel,
.staff-card,
.staff-surface .panel {
    min-width: 0;
}

.staff-login-fields {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    background: #f8fbfc;
}

.staff-login-fields summary {
    cursor: pointer;
    color: var(--accent-strong);
    font-weight: 800;
}

.checkbox-line {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    min-height: 42px;
    color: var(--muted);
    font-weight: 700;
}

.checkbox-line input {
    width: auto;
}

.condition-code-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 12px;
}

.qualification-type-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.qualification-manager-list {
    display: grid;
    gap: 8px;
    margin-top: 14px;
}

.qualification-manager-list form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) 150px auto auto minmax(140px, 0.8fr) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfd;
}

.qualification-type-list span,
.status-pill {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    border-radius: 999px;
    background: #e8f3f1;
    color: var(--accent-strong);
    padding: 6px 10px;
    font-size: 0.82rem;
    font-weight: 800;
}

.qualification-type-list small {
    color: var(--muted);
    font-weight: 700;
}

.staff-list {
    display: grid;
    gap: 18px;
}

.staff-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.staff-card-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: #f8fbfc;
}

.staff-card-header h2,
.staff-card-header p,
.staff-side-panels h3,
.staff-qualifications h3 {
    margin: 0;
}

.staff-card-header p {
    color: var(--muted);
}

.staff-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.status-pill.active,
.status-pill.ok {
    background: #dff5ea;
    color: #18633d;
}

.status-pill.inactive,
.status-pill.neutral {
    background: #eef2f5;
    color: var(--muted);
}

.status-pill.unavailable,
.status-pill.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

.status-pill.danger {
    background: #fde7e5;
    color: var(--danger);
}

.staff-card-body {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    gap: 18px;
    padding: 18px;
}

.staff-profile-form,
.staff-side-panels,
.staff-side-panels section,
.staff-qualifications {
    display: grid;
    gap: 12px;
}

.staff-profile-form textarea {
    min-height: 92px;
}

.compact-history {
    display: grid;
    gap: 8px;
}

.compact-history div {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
}

.compact-history span,
.compact-history small {
    color: var(--muted);
}

.staff-qualifications {
    padding: 18px;
    border-top: 1px solid var(--line);
}

.staff-qualification-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(120px, 0.75fr) 140px 150px auto auto;
    align-items: end;
}

.staff-training-form {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(140px, 0.8fr) minmax(130px, 0.75fr) 130px 140px 140px minmax(130px, 0.75fr) minmax(140px, 0.8fr) auto;
    align-items: end;
}

.qualification-table {
    display: grid;
    gap: 8px;
}

.qualification-table form:not(.staff-delete-form) {
    display: grid;
    grid-template-columns: minmax(140px, 1fr) minmax(160px, 1fr) minmax(110px, 0.75fr) 130px 140px 140px auto auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfd;
}

.staff-qualifications .qualification-table .staff-training-form,
.staff-qualifications .qualification-table form[action*="/training/"]:not(.staff-delete-form) {
    grid-template-columns: minmax(160px, 1fr) minmax(140px, 0.8fr) minmax(130px, 0.75fr) 130px 135px 135px minmax(120px, 0.75fr) minmax(140px, 0.8fr) auto;
}

.staff-delete-form {
    display: grid;
    grid-template-columns: minmax(160px, 1fr) repeat(4, minmax(110px, 0.75fr)) auto;
    gap: 8px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fbfcfd;
    justify-self: start;
    width: 100%;
}

.staff-delete-form span {
    color: var(--muted);
    font-weight: 700;
}

.staff-page-aside .compact-history a {
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: none;
}

.staff-merge-zone {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    gap: 20px;
    border-color: #9eb7d0;
    background: #f7fbff;
}

.staff-merge-zone h3,
.staff-merge-zone p {
    margin: 0;
}

.staff-merge-zone p {
    margin-top: 6px;
}

.staff-merge-form {
    display: grid;
    gap: 10px;
}

.staff-merge-form > label:not(.checkbox-line) {
    display: grid;
    gap: 6px;
    font-weight: 800;
}

.staff-danger-zone {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-color: #d89a9a;
    background: #fff8f8;
}

.staff-danger-zone h3,
.staff-danger-zone p {
    margin: 0;
}

.staff-danger-zone p {
    margin-top: 4px;
}

@media (max-width: 720px) {
    .staff-merge-zone {
        grid-template-columns: 1fr;
    }

    .staff-danger-zone {
        align-items: stretch;
        flex-direction: column;
    }
}

.dot.neutral {
    background: var(--muted);
}

.dot.warning {
    background: var(--warning);
}

.dot.danger {
    background: var(--danger);
}

.simple-list article:first-child {
    border-top: 0;
}

.simple-list span,
.simple-list small {
    color: var(--muted);
}

.run-sheets-screen {
    display: grid;
    gap: 16px;
}

.runsheet-pages {
    display: grid;
    gap: 18px;
}

.runsheet-page {
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 10mm;
    background: #fff;
    color: #111;
    border: 1px solid #cfd7df;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-rows: auto auto auto 1fr auto;
    gap: 8px;
    font-family: Arial, Helvetica, sans-serif;
}

.runsheet-header {
    background: #111;
    color: #fff;
    padding: 8px 10px;
    text-align: center;
}

.runsheet-header h3 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0;
    text-transform: uppercase;
}

.runsheet-header > strong {
    display: block;
    font-size: 10px;
    letter-spacing: 0.08em;
    margin-bottom: 3px;
}

.runsheet-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    font-size: 12px;
    border-bottom: 2px solid #111;
    padding-bottom: 6px;
}

.runsheet-instructions {
    background: #edf1f4;
    border: 1px solid #c6cdd3;
    display: grid;
    gap: 2px;
    padding: 8px 10px;
    font-size: 12px;
    line-height: 1.25;
}

.runsheet-instructions strong {
    font-size: 13px;
}

.runsheet-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-content: start;
}

.runsheet-column {
    display: grid;
    gap: 6px;
    align-content: start;
}

.runsheet-block {
    border: 1.5px solid #111;
    padding: 5px 6px;
    break-inside: avoid;
    background: #fff;
}

.runsheet-block.break {
    background: #e3e5e8;
}

.runsheet-block.travel {
    background: #e8f1fb;
    color: #184b7a;
    font-style: italic;
}

.runsheet-block.ops {
    background: #f4f6f7;
}

.runsheet-block.relief {
    background: #fff1c8;
    border-width: 2px;
}

.runsheet-block.empty {
    min-height: 90px;
}

.runsheet-block-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: baseline;
    font-size: 12px;
    text-transform: uppercase;
}

.runsheet-block-head span {
    font-size: 10px;
    white-space: nowrap;
}

.runsheet-pax {
    font-size: 12px;
    margin: 4px 0;
}

.runsheet-service-meta {
    min-height: 12px;
    color: #384651;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-top: 2px;
    text-transform: uppercase;
}

.shift-sheet-grid .duty-row {
    grid-template-columns: 34px 88px minmax(160px, 1.2fr) minmax(90px, 0.55fr) minmax(160px, 1fr) minmax(104px, 0.6fr);
}

.runsheet-stops {
    display: grid;
    gap: 1px;
    margin: 0;
}

.runsheet-stops div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 42px;
    gap: 8px;
    align-items: baseline;
    min-height: 16px;
}

.runsheet-stops dt,
.runsheet-stops dd {
    margin: 0;
    font-size: 11px;
    line-height: 1.15;
}

.runsheet-stops dd {
    text-align: right;
    font-weight: 700;
}

.runsheet-note {
    display: grid;
    gap: 2px;
    font-size: 11px;
    line-height: 1.2;
    margin-top: 4px;
}

.runsheet-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 6px;
    border-top: 2px solid #111;
    padding-top: 6px;
    font-size: 10px;
    text-transform: uppercase;
}

@media print {
    @page {
        size: A4 portrait;
        margin: 0;
    }

    body {
        background: #fff;
    }

    .sidebar,
    .topbar,
    .no-print {
        display: none !important;
    }

    .app-shell,
    .main-panel,
    .work-surface,
    .run-sheets-screen,
    .runsheet-pages {
        display: block;
        padding: 0;
        margin: 0;
        background: #fff;
        box-shadow: none;
        border: 0;
    }

    .runsheet-page {
        width: 210mm;
        min-height: 297mm;
        margin: 0;
        border: 0;
        box-shadow: none;
        page-break-after: always;
        break-after: page;
    }

    .runsheet-page:last-child {
        page-break-after: auto;
        break-after: auto;
    }
}

@media (max-width: 980px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        z-index: 1002;
        inset: 0 auto 0 0;
        width: min(86vw, 330px);
        height: 100dvh;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform 0.2s ease;
        box-shadow: 18px 0 42px rgba(0, 0, 0, 0.24);
    }

    .mobile-nav-open {
        overflow: hidden;
    }

    .mobile-nav-open .sidebar {
        transform: translateX(0);
    }

    .mobile-nav-backdrop {
        position: fixed;
        z-index: 1001;
        inset: 0;
        width: 100%;
        height: 100%;
        border: 0;
        border-radius: 0;
        background: rgba(4, 14, 20, 0.58);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;
    }

    .mobile-nav-open .mobile-nav-backdrop {
        display: block;
        opacity: 1;
        pointer-events: auto;
    }

    .mobile-nav-close {
        display: grid;
        place-items: center;
        width: 42px;
        height: 42px;
        flex: 0 0 auto;
        padding: 0;
        background: rgba(255, 255, 255, 0.1);
        font-size: 1.7rem;
        line-height: 1;
    }

    .mobile-shell-bar {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        align-items: center;
        margin: -10px -10px 20px;
        padding: 10px;
        border-bottom: 1px solid var(--line);
        background: rgba(244, 246, 248, 0.96);
    }

    .mobile-nav-toggle,
    .mobile-shell-brand {
        display: inline-flex;
        gap: 9px;
        align-items: center;
    }

    .mobile-nav-toggle {
        min-height: 44px;
        background: #10202a;
    }

    .mobile-nav-icon {
        display: grid;
        gap: 4px;
        width: 20px;
    }

    .mobile-nav-icon i {
        display: block;
        height: 2px;
        border-radius: 999px;
        background: currentColor;
    }

    .mobile-shell-brand .brand-mark {
        width: 36px;
        height: 36px;
    }

    .nav-list,
    .metric-grid,
    .module-grid,
    .route-quick-stats,
    .split-grid,
    .configuration-columns,
    .timeline-board,
    .planning-summary,
    .readiness-grid,
    .route-workbench,
    .route-builder-workspace,
    .stop-bank-selector-layout,
    .route-tools-grid,
    .run-board,
    .publish-layout,
    .driver-actions,
    .driver-action-grid,
    .driver-service-header,
    .driver-workday-meta,
    .staff-directory-layout,
    .staff-page-grid,
    .staff-grid,
    .staff-card-body,
    .form-row,
    .inline-form,
    .form-grid-mini,
    .event-ops-grid,
    .event-registers,
    .ops-layout,
    .operations-metrics,
    .operations-dashboard-grid,
    .operations-dashboard-grid.secondary-grid,
    .schedule-work-card,
    .shift-block-edit-form,
    .incident-dashboard-actions,
    .incident-capture-grid,
    .incident-edit-grid,
    .incident-filter-grid,
    .incident-case-layout {
        grid-template-columns: 1fr;
    }

    .incident-wide-field,
    .incident-handover-field,
    .incident-filter-search {
        grid-column: auto;
    }

    .incident-register {
        overflow-x: auto;
    }

    .incident-register-row {
        min-width: 860px;
    }

    .incident-dashboard-queue > a {
        align-items: flex-start;
        flex-direction: column;
    }

    .incident-queue-status {
        justify-content: flex-start;
    }

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

    .operations-hero-actions {
        width: 100%;
    }

    .operations-hero-actions .button {
        flex: 1 1 180px;
        text-align: center;
    }

    .schedule-work-card__actions {
        justify-content: flex-start;
    }

    .nav-list {
        grid-template-columns: 1fr;
    }

    .driver-service-user {
        justify-self: stretch;
        text-align: left;
    }

    .driver-view-menu {
        grid-template-columns: 1fr;
    }

    .driver-main-actions {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .driver-main-action.precheck-action[open] {
        grid-column: auto;
    }

    .precheck-checklist-row {
        grid-template-columns: 1fr;
    }

    .driver-calendar-head,
    .driver-calendar-week {
        grid-template-columns: 44px repeat(7, minmax(116px, 1fr));
        min-width: 860px;
    }

    .driver-calendar-day {
        min-height: 104px;
    }

    .driver-work-row summary {
        grid-template-columns: 82px 1fr;
        padding-right: 10px;
    }

    .driver-time-band {
        grid-row: span 3;
    }

    .driver-stop-detail {
        padding-left: 94px;
    }

    .shift-block-board__header {
        display: grid;
    }

    .shift-board-day-selector {
        align-items: flex-start;
    }

    .route-canvas,
    .route-map-grid,
    .map-panel,
    .osm-map,
    .route-builder-map-panel,
    .route-builder-map-panel .osm-map {
        min-height: 430px;
    }

    .route-builder-panel {
        order: -1;
    }

    .map-status-strip {
        left: 12px;
        right: 12px;
        max-width: none;
    }

    .duty-row {
        grid-template-columns: 1fr 1fr;
    }

    .stop-geofence-link-table .duty-row,
    .timing-point-mapping-gap-table .duty-row {
        grid-template-columns: 1fr;
    }

    .validation-strip {
        padding: 10px 12px 14px;
    }

    .duty-head {
        display: none;
    }

    .topbar,
    .event-hero,
    .public-map-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .staff-qualification-form,
    .qualification-manager-list form,
    .qualification-table form:not(.staff-delete-form) {
        grid-template-columns: 1fr 1fr;
    }

    .staff-command-strip,
    .staff-subnav {
        width: 100%;
    }
}

@media (max-width: 640px) {
    .main-panel {
        padding: 18px;
    }

    .topbar h1 {
        font-size: 1.65rem;
    }

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

    .operations-metric {
        padding: 13px;
    }

    .operations-metric strong {
        font-size: 1.55rem;
    }

    .operations-schedule-list article {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .operations-schedule-list .status-chip {
        grid-column: 1 / -1;
        justify-self: start;
        grid-row: 2;
    }

    .operations-event-list a {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .operations-event-list time {
        text-align: left;
    }

    .scheduling-tabs {
        margin-inline: -18px;
        padding-inline: 18px;
        border-inline: 0;
        border-radius: 0;
    }

    .schedule-work-card__actions .button {
        flex: 1 1 calc(50% - 8px);
        text-align: center;
    }
    .driver-self-service {
        margin: 0;
    }

    .driver-service-header {
        grid-template-columns: minmax(0, 1fr) auto;
        min-height: 68px;
    }

    .driver-service-brand {
        border-right: 0;
        font-size: 1.1rem;
    }

    .driver-service-mark {
        width: 34px;
        height: 34px;
        border-width: 2px;
    }

    .driver-service-title {
        display: none;
    }

    .driver-calendar-toolbar {
        justify-content: center;
        padding: 12px;
        background: var(--driver-cream);
        border-bottom: 3px solid var(--driver-maroon-dark);
    }

    .driver-views-title,
    .driver-display-mode,
    .driver-period-nav {
        display: none;
    }

    .driver-period-label {
        justify-content: center;
        min-width: 0;
        background: transparent;
        font-size: 1.25rem;
    }

    .driver-view-menu,
    .driver-self-service-forms,
    .driver-main-actions {
        padding: 12px;
    }

    .driver-calendar-intro {
        padding: 12px;
        font-size: 0.9rem;
    }

    .driver-self-service-forms {
        grid-template-columns: 1fr;
    }

    .driver-main-action summary {
        min-height: 62px;
        padding: 12px 14px;
    }

    .driver-calendar {
        gap: 0;
        overflow: visible;
        padding: 0;
        background: #fff;
    }

    .driver-calendar-head {
        display: none;
    }

    .driver-calendar-week {
        display: block;
        min-width: 0;
        padding: 0;
    }

    .driver-week-number {
        display: none;
    }

    .driver-calendar-day {
        display: grid;
        grid-template-columns: 78px minmax(0, 1fr) 28px;
        gap: 0 10px;
        align-items: center;
        min-height: 82px;
        padding: 10px 12px 10px 0;
        border: 0;
        border-bottom: 1px solid #c9c9c9;
        border-radius: 0;
        background: #fff;
    }

    .driver-calendar-day::after {
        content: "\22EE";
        grid-column: 3;
        grid-row: 1 / span 2;
        color: var(--driver-maroon-dark);
        font-size: 1.45rem;
        font-weight: 900;
        line-height: 1;
        text-align: center;
    }

    .driver-calendar-day.has-duty,
    .driver-calendar-day.selected {
        background: #fff;
        box-shadow: none;
    }

    .driver-calendar-day.selected .driver-date-number,
    .driver-calendar-day.selected .driver-mobile-weekday {
        color: #d88900;
    }

    .driver-mobile-weekday {
        display: block;
        grid-column: 1;
        grid-row: 1;
        color: var(--driver-ink);
        font-size: 1rem;
        font-weight: 900;
        text-align: center;
    }

    .driver-date-number {
        position: static;
        grid-column: 1;
        grid-row: 2;
        color: var(--driver-ink);
        font-size: 1.45rem;
        line-height: 1;
        text-align: center;
    }

    .driver-calendar-day strong {
        grid-column: 2;
        grid-row: 1 / span 2;
        padding: 16px 22px;
        background: var(--driver-cream);
        color: #000;
        font-size: 1.2rem;
    }

    .driver-calendar-day:not(.has-duty) strong {
        background: var(--driver-muted-cell);
        color: var(--driver-ink);
    }

    .driver-calendar-day small {
        z-index: 1;
        grid-column: 2;
        grid-row: 1 / span 2;
        justify-self: end;
        margin-right: 22px;
        font-size: 0;
    }

    .driver-calendar-day.has-duty small::after {
        content: "A";
        color: #bababa;
        font-size: 1rem;
        font-weight: 900;
    }

    .driver-workday-panel {
        margin: 14px 0 0;
        border-left: 0;
    }

    .driver-selected-date-bar {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
        padding: 14px 12px;
    }

    .driver-selected-date-hint {
        text-align: left;
        font-size: 0.85rem;
    }

    .driver-workday-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .driver-workday-tabs button {
        flex: 0 0 auto;
        padding: 12px 14px;
        white-space: nowrap;
    }

    .driver-calendar-flags {
        display: none;
    }

    .driver-tab-empty,
    .driver-tab-heading,
    .driver-date-notice,
    .driver-date-form,
    .driver-date-list {
        margin: 12px;
    }

    .driver-workday {
        padding: 12px;
    }

    .driver-workday header {
        display: grid;
    }

    .staff-card-header {
        display: grid;
    }

    .staff-badges {
        justify-content: flex-start;
    }

    .staff-qualification-form,
    .qualification-manager-list form,
    .qualification-table form:not(.staff-delete-form),
    .staff-delete-form {
        grid-template-columns: 1fr;
    }
}
/* Shared people, roster and competency task pages. */
.context-tabs {
    display: flex;
    gap: .45rem;
    overflow-x: auto;
    padding: .2rem 0 .65rem;
    border-bottom: 1px solid var(--border, #d7dee8);
}

.context-tabs a {
    flex: 0 0 auto;
    padding: .65rem .85rem;
    border-radius: .65rem .65rem 0 0;
    background: #eef2f6;
    color: #334155;
    text-decoration: none;
    font-weight: 700;
}

.context-tabs a.active { background: #176b4d; color: #fff; }
.shared-roster-filters { display: grid; grid-template-columns: repeat(5, minmax(9rem, 1fr)) auto; gap: .75rem; align-items: end; }
.shared-roster-filters label { display: grid; gap: .3rem; }
.shared-roster-table td { vertical-align: top; min-width: 9rem; }
.shared-roster-table td:first-child { min-width: 13rem; }
.shared-roster-table .pill { display: block; margin: 0 0 .35rem; }
.roster-offer { border-top: 1px solid #dbe3ea; margin-top: .55rem; padding-top: .55rem; }
.roster-offer form { display: inline-flex; margin: .35rem .3rem 0 0; }
.check-row { display: flex !important; align-items: flex-start; gap: .65rem; }
.check-row input { width: auto; margin-top: .2rem; }
.check-row span { display: grid; gap: .1rem; }
.pill-row { display: flex; flex-wrap: wrap; gap: .5rem; }

@media (max-width: 900px) {
    .shared-roster-filters { grid-template-columns: 1fr 1fr; }
    .shared-roster-filters button { grid-column: 1 / -1; }
    .shared-roster-table table, .shared-roster-table tbody, .shared-roster-table tr, .shared-roster-table td { display: block; width: 100%; }
    .shared-roster-table thead { display: none; }
    .shared-roster-table tr { border: 1px solid #d7dee8; border-radius: .8rem; margin-bottom: .8rem; padding: .75rem; background: #fff; }
    .shared-roster-table td { border: 0; min-width: 0; padding: .35rem 0; }
    .shared-roster-table td::before { content: attr(data-label); display: block; color: #64748b; font-size: .75rem; font-weight: 800; text-transform: uppercase; }
    .shared-roster-table td:nth-child(1)::before { content: "Date / activity"; }
    .shared-roster-table td:nth-child(2)::before { content: "Section"; }
    .shared-roster-table td:nth-child(3)::before { content: "Role"; }
    .shared-roster-table td:nth-child(4)::before { content: "Time"; }
    .shared-roster-table td:nth-child(5)::before { content: "People"; }
    .shared-roster-table td:nth-child(6)::before { content: "Vacancies"; }
}

@media (max-width: 560px) {
    .shared-roster-filters { grid-template-columns: 1fr; }
}
