:root {
  color-scheme: light;
  --report-table-viewport-height: clamp(30rem, 68vh, 46rem);
  --history-table-viewport-height: clamp(30rem, 74vh, 48rem);
  --background: #f4f7f9;
  --surface: #ffffff;
  --surface-muted: #eef3f5;
  --text: #16242c;
  --text-muted: #5c6b73;
  --border: #cfdae0;
  --accent: #006b68;
  --accent-dark: #004f4d;
  --alert-background: #fde8e4;
  --alert-border: #d14b31;
  --alert-text: #641e16;
  --alert-heading: #47120c;
  --shadow: 0 12px 30px rgba(22, 36, 44, 0.08);
  --color-ink: #172033;
  --color-heading: #102d4f;
  --color-secondary: #526174;
  --color-secondary-soft: #617084;
  --color-brand: #087f8c;
  --color-brand-hover: #066c77;
  --color-control-border: #a8b4c3;
  --radius-control: 0.55rem;
  --radius-surface: 0.75rem;
  --radius-elevated: 1rem;
  --focus-ring: 0 0 0 3px rgb(8 127 140 / 30%);
  --shadow-authenticated-card: 0 0.75rem 2rem rgb(7 23 43 / 12%);
  --theme-auth-canvas: radial-gradient(circle at 15% 15%, rgb(32 178 170 / 22%), transparent 28rem), linear-gradient(145deg, #07172b 0%, #102d4f 62%, #17405f 100%);
  --theme-shell-background: rgb(7 23 43 / 90%);
  --theme-shell-border: rgb(255 255 255 / 18%);
  --theme-shell-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 12%);
  --theme-shell-text: #d7e4ea;
  --theme-shell-muted: #abc0ca;
  --theme-shell-hover: rgb(255 255 255 / 10%);
  --theme-main-text: #f3f7fa;
  --theme-content-surface: #f5f7f9;
  --theme-content-border: #cbd7de;
  --theme-outer-muted: #c4d5dc;
  --theme-outer-strong: #ffffff;
  --theme-tab-border: rgb(255 255 255 / 28%);
  --theme-eyebrow: #8ddbd5;
  --theme-login-canvas: radial-gradient(circle at 15% 15%, rgb(32 178 170 / 22%), transparent 28rem), linear-gradient(145deg, #07172b 0%, #102d4f 62%, #17405f 100%);
  --theme-login-panel: rgb(255 255 255 / 97%);
  --theme-login-panel-border: rgb(255 255 255 / 65%);
  --theme-login-panel-shadow: 0 1.5rem 4rem rgb(0 0 0 / 30%);
  --theme-header-toggle-background: rgb(255 255 255 / 10%);
  --theme-header-toggle-border: rgb(255 255 255 / 24%);
  --theme-header-toggle-text: #d7e4ea;
  --theme-header-toggle-hover: rgb(255 255 255 / 16%);
  --theme-filter-selected-outline: #f3f7fa;
}

:root[data-theme="light"] {
  --theme-auth-canvas: linear-gradient(145deg, #e8f3f3 0%, #f4f7f9 58%, #eaf0f5 100%);
  --theme-shell-background: rgb(255 255 255 / 96%);
  --theme-shell-border: #cfdae0;
  --theme-shell-shadow: 0 1px 0 rgb(22 36 44 / 5%);
  --theme-shell-text: #526174;
  --theme-shell-muted: #617084;
  --theme-shell-hover: #eef3f5;
  --theme-main-text: #16242c;
  --theme-content-surface: #ffffff;
  --theme-content-border: #cfdae0;
  --theme-outer-muted: #5c6b73;
  --theme-outer-strong: #16242c;
  --theme-tab-border: #cfdae0;
  --theme-eyebrow: #006b68;
  --theme-login-canvas: linear-gradient(145deg, #e8f3f3 0%, #f4f7f9 58%, #eaf0f5 100%);
  --theme-login-panel: #ffffff;
  --theme-login-panel-border: #cbd7de;
  --theme-login-panel-shadow: 0 1rem 3rem rgb(22 36 44 / 14%);
  --theme-header-toggle-background: #eef3f5;
  --theme-header-toggle-border: #b9c8cf;
  --theme-header-toggle-text: #23415f;
  --theme-header-toggle-hover: #e2ecef;
  --theme-filter-selected-outline: #17324a;
  --alert-background: #fff1ed;
  --alert-border: #b83b20;
  --alert-text: #7a271a;
  --alert-heading: #5c1a10;
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent-dark);
}

.page-shell {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.navigation-shell {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
  padding-block: 0.8rem;
}

.primary-navigation {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 0;
}

.primary-navigation a {
  border-radius: var(--radius-control);
  color: var(--color-secondary);
  padding: 0.45rem 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.primary-navigation a:hover,
.primary-navigation a:focus-visible {
  background: var(--surface-muted);
  color: var(--color-brand-hover);
}

.primary-navigation a.is-active {
  background: var(--color-brand);
  color: #ffffff;
}

.primary-navigation a:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.header-language-control {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  margin-left: auto;
  color: var(--border);
  font-size: 0.8rem;
  font-weight: 750;
}

.header-language-control a {
  color: var(--text-muted);
  text-decoration: none;
}

.header-language-control a:hover,
.header-language-control a:focus-visible,
.header-language-control a.is-active {
  color: var(--color-brand-hover);
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

.header-language-control a:focus-visible {
  outline: none;
  border-radius: var(--radius-control);
  box-shadow: var(--focus-ring);
}

main {
  padding-block: 3rem 4rem;
}

.page-heading {
  margin-bottom: 2rem;
}

.page-heading h1 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -0.045em;
  line-height: 1.05;
}

.eyebrow {
  margin: 0 0 0.5rem;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.intro {
  max-width: 62ch;
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: 1.05rem;
}

.alert {
  display: grid;
  gap: 0.2rem;
  margin-bottom: 1.5rem;
  border-left: 4px solid var(--alert-border);
  border-radius: 0.4rem;
  background: var(--alert-background);
  color: var(--alert-text);
  padding: 1rem 1.2rem;
}

.alert strong {
  color: var(--alert-heading);
}

.authenticated-surface,
.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-surface);
  background: var(--surface);
}

.authenticated-surface {
  box-shadow: var(--shadow-authenticated-card);
}

.report-form {
  width: min(100%, 920px);
  margin-inline: auto;
  overflow: hidden;
}

.report-form--vehicle-directory {
  overflow: visible;
}

.panel {
  box-shadow: var(--shadow);
}

.report-form-page-heading {
  width: min(100%, 920px);
  margin-bottom: 0.75rem;
  margin-right: auto;
  margin-left: auto;
}

.localized-page-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.language-control {
  display: inline-flex;
  flex: 0 0 auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  background: var(--surface);
}

.language-control-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  min-height: 2.25rem;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent-dark);
  padding: 0.35rem 0.6rem;
  font-size: 0.78rem;
  font-weight: 750;
  line-height: 1;
  text-decoration: none;
}

.language-control-option + .language-control-option {
  border-left: 1px solid var(--border);
}

.language-control-option.is-active {
  background: var(--accent);
  color: #ffffff;
}

.language-control-option:focus-visible {
  position: relative;
  z-index: 1;
  outline: 3px solid rgba(0, 107, 104, 0.35);
  outline-offset: -3px;
}

.report-form-section {
  padding: clamp(1.35rem, 3vw, 2rem);
}

.report-form-section + .report-form-section {
  border-top: 1px solid var(--border);
}

.vehicle-form-section {
  display: grid;
  grid-template-columns: minmax(14rem, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.report-form-section-heading h2,
.date-range-section legend {
  margin: 0;
  color: #263746;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

.vehicle-field input {
  min-height: 3.15rem;
  font-size: 1rem;
}

.vehicle-selector,
.vehicle-combobox {
  position: relative;
  display: grid;
  gap: 0.45rem;
}

.vehicle-options {
  position: absolute;
  z-index: 60;
  top: calc(100% + 0.25rem);
  right: 0;
  left: 0;
  max-height: min(30rem, 60vh);
  margin: 0;
  overflow-y: auto;
  border: 1px solid #9cb8c1;
  border-radius: 0.5rem;
  background: #ffffff;
  padding: 0.25rem;
  box-shadow: 0 8px 24px rgba(22, 36, 44, 0.18);
  list-style: none;
}

.vehicle-options[hidden] {
  display: none;
}

.vehicle-option {
  display: grid;
  row-gap: 3px;
  border-radius: 0.35rem;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
}

.vehicle-option:hover,
.vehicle-option.is-active {
  background: #eaf4f4;
}

.vehicle-option-primary {
  color: #16242c;
  font-weight: 750;
}

.vehicle-selector-status {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.vehicle-selector-status {
  min-height: 1.2rem;
  margin: 0;
}

.field-helper,
.field-error {
  margin: 0;
  font-size: 0.84rem;
}

.field-helper {
  color: var(--text-muted);
}

.field-error {
  min-height: 1.2rem;
  color: #a62d2d;
  font-weight: 700;
}

.field-error:not(:empty) {
  border-left: 3px solid #d45757;
  padding-left: 0.6rem;
}

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

.field-wide {
  grid-column: 1 / -1;
}

.field {
  display: grid;
  gap: 0.45rem;
  min-width: 0;
}

label {
  font-size: 0.9rem;
  font-weight: 700;
}

input {
  min-width: 0;
  width: 100%;
  min-height: 2.8rem;
  border: 1px solid var(--color-control-border);
  border-radius: var(--radius-control);
  background: #ffffff;
  color: var(--color-ink);
  font: inherit;
  padding: 0.65rem 0.75rem;
}

#route-report-form input:not([type="hidden"])::placeholder,
#live-fleet-search::placeholder {
  color: var(--color-secondary-soft);
  opacity: 1;
}

#route-report-form input:not([type="hidden"]):focus-visible,
#live-fleet-search:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

input:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(0, 107, 104, 0.35);
  outline-offset: 3px;
}

.date-range-section {
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.date-range-section legend {
  width: 100%;
  padding: 0;
}

.date-range-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.date-range-group {
  min-width: 0;
  border: 1px solid #d6e0e6;
  border-radius: 0.6rem;
  background: #f8fafb;
  padding: 1rem;
}

.date-range-group h3 {
  margin: 0 0 0.75rem;
  color: #263746;
  font-size: 0.95rem;
}

.date-range-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  min-width: 0;
}

.date-range-duration {
  margin: 1rem 0 0;
  border: 1px solid #c9dddf;
  border-radius: 0.45rem;
  background: #f2f8f8;
  padding: 0.65rem 0.8rem;
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.date-range-duration.is-invalid {
  border-color: #e2b1a7;
  background: #fff7f4;
  color: #8b3022;
}

.date-range-error {
  min-height: 1.25rem;
  margin: 0.35rem 0 0;
  color: #a62d2d;
  font-size: 0.9rem;
  font-weight: 700;
}

.date-range-error:not(:empty) {
  border-left: 3px solid #d45757;
  padding-left: 0.65rem;
}

input[aria-invalid="true"] {
  border-color: #c43d3d;
  box-shadow: 0 0 0 1px #c43d3d;
}

.advanced-settings {
  margin: 0;
  border-top: 1px solid var(--border);
  padding: 1.1rem clamp(1.35rem, 3vw, 2rem);
}

.advanced-settings summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent-dark);
  font-weight: 700;
}

.settings-grid {
  margin-top: 1.25rem;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  margin: 0;
  border-top: 1px solid var(--border);
  background: #f8fafb;
  padding: 1.1rem clamp(1.35rem, 3vw, 2rem);
  gap: 0.55rem;
}

.report-generation-cancel[hidden] {
  display: none;
}

.generate-report-button {
  min-width: 12rem;
}

.generate-report-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

button,
.primary-link,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  border-radius: var(--radius-control);
  font-weight: 750;
  text-decoration: none;
}

button,
.primary-link {
  border: 1px solid var(--color-brand);
  background: var(--color-brand);
  color: #ffffff;
  padding: 0.7rem 1.15rem;
}

button {
  cursor: pointer;
  font: inherit;
}

button:hover,
.primary-link:hover {
  border-color: var(--color-brand-hover);
  background: var(--color-brand-hover);
}

.result-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
}

.result-heading-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.secondary-action {
  border: 1px solid var(--color-control-border);
  background: #ffffff;
  color: var(--color-heading);
  padding: 0.65rem 1rem;
}

.secondary-action:hover {
  border-color: var(--color-brand);
  background: #eaf4f4;
  color: var(--color-brand-hover);
}

.secondary-action:focus-visible {
  border-color: var(--color-brand);
  background: #ffffff;
  color: var(--color-heading);
}

.secondary-action:disabled,
.secondary-action[aria-busy="true"] {
  cursor: not-allowed;
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text-muted);
  opacity: 1;
}

.secondary-action[aria-busy="true"] {
  cursor: wait;
}

.pdf-export-dialog {
  width: min(26rem, calc(100vw - 2rem));
  border: 1px solid #cbd8df;
  border-radius: 0.7rem;
  padding: 0;
  color: var(--text);
  box-shadow: 0 1rem 2.5rem rgba(20, 40, 52, 0.2);
}

.pdf-export-dialog::backdrop {
  background: rgba(22, 39, 50, 0.55);
}

.pdf-export-dialog form {
  padding: 1rem;
}

.pdf-export-dialog-heading h2 {
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}

.pdf-address-progress {
  margin-bottom: 0.75rem;
}

.pdf-address-progress p {
  margin: 0.35rem 0;
}

.pdf-address-progress progress {
  width: 100%;
}

.pdf-address-progress.is-complete [data-pdf-address-status] {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: #15803d;
  font-weight: 750;
}

.pdf-address-progress.is-complete [data-pdf-address-status]::before {
  width: 0.42rem;
  height: 0.72rem;
  border-right: 0.15rem solid currentColor;
  border-bottom: 0.15rem solid currentColor;
  content: "";
  transform: rotate(45deg);
}

.pdf-address-progress.is-complete progress {
  accent-color: #15803d;
}

.pdf-generation-progress {
  margin-bottom: 0.75rem;
  border-radius: 0.45rem;
  background: var(--surface-muted);
  padding: 0.55rem 0.65rem;
}

.pdf-generation-progress[hidden] {
  display: none;
}

.pdf-generation-progress p {
  margin: 0 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 700;
}

.pdf-generation-progress progress {
  display: block;
  width: 100%;
}

.pdf-generation-progress.is-ready progress {
  display: none;
}

.pdf-export-dialog fieldset {
  display: grid;
  gap: 0.55rem;
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  padding: 0.75rem;
}

.pdf-export-dialog legend {
  padding: 0 0.3rem;
  font-weight: 700;
}

.pdf-export-dialog label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.pdf-export-dialog input {
  width: 1rem;
  height: 1rem;
}

.pdf-export-error {
  margin: 0.65rem 0 0;
  color: #b42318;
  font-size: 0.86rem;
  font-weight: 650;
}

.pdf-export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
  margin-top: 1rem;
}

.pdf-export-submit:disabled,
.pdf-export-submit.is-busy,
.pdf-export-submit:disabled:hover,
.pdf-export-submit.is-busy:hover {
  cursor: not-allowed;
  border-color: #aebdc2;
  background: #dbe3e5;
  color: #526168;
  opacity: 1;
  box-shadow: none;
}

.pdf-export-submit.is-busy,
.pdf-export-submit.is-busy:hover {
  cursor: wait;
}

.report-kpis {
  margin-bottom: 1.25rem;
}

.report-kpi-grid {
  display: grid;
  grid-template-columns: repeat(
    auto-fit,
    minmax(min(10.5rem, 100%), 1fr)
  );
  align-items: stretch;
  gap: 0.55rem;
  margin: 0;
}

.report-kpi-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-width: 0;
  min-height: 7rem;
  height: 100%;
  padding: 0.75rem 0.8rem 0.85rem;
  text-align: center;
}

.report-kpi-card dt {
  color: #667680;
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
}

.report-kpi-card dd {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding-top: 0.35rem;
  color: var(--text);
  text-align: center;
}

.report-kpi-primary {
  max-width: 100%;
  font-size: 1.2rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.report-kpi-secondary {
  max-width: 100%;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.report-kpi-time-date,
.report-kpi-time-values {
  display: block;
}

.report-kpi-time-values {
  font-size: 0.86rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.report-kpi-card--speed .report-kpi-primary {
  color: #8a4b16;
}

.report-kpi-location-name {
  display: -webkit-box;
  overflow: hidden;
  max-width: 100%;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 720;
  line-height: 1.25;
  overflow-wrap: break-word;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

h2 {
  margin: 0 0 1rem;
  font-size: 1.15rem;
}

.panel {
  padding: 1.35rem;
}

dt {
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

dd {
  margin: 0.25rem 0 0;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.bottom-action {
  margin-top: 2rem;
  text-align: center;
}

.report-table-section {
  margin-top: 2.25rem;
  min-width: 0;
}

.report-tabs {
  display: flex;
  gap: 0.25rem;
  position: relative;
  z-index: 2;
  margin-bottom: -1px;
  padding-left: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.report-tab {
  min-height: 2.6rem;
  margin-bottom: 0;
  position: relative;
  z-index: 1;
  border: 1px solid transparent;
  border-bottom-color: var(--border);
  border-radius: 0.4rem 0.4rem 0 0;
  background: transparent;
  color: var(--text-muted);
}

.report-tab:hover {
  border-color: var(--border);
  background: var(--surface-muted);
  color: var(--text);
}

.report-tab.is-active,
.report-tab[aria-selected="true"] {
  border-color: var(--border);
  border-bottom-color: var(--surface);
  background: var(--surface);
  color: var(--accent-dark);
}

.report-tab-panel {
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  height: auto;
  margin-top: 0;
  border: 1px solid var(--border);
  border-top: 1px solid var(--border);
  border-radius: 0 0 0.65rem 0.65rem;
  background: var(--surface);
  padding: 0;
}

.report-tab-panel + .report-tab-panel {
  margin-top: 0;
}

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

.history-event-badge {
  display: inline-flex;
  align-items: center;
  min-height: 1.65rem;
  padding: 0.2rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
}

.history-event-badge--success {
  border-color: #16a34a;
  background: #f0fdf4;
  color: #15803d;
}

.history-event-badge--danger {
  border-color: #ef4444;
  background: #fef2f2;
  color: #dc2626;
}

.history-event-badge--jamming {
  border-color: #111827;
  border-width: 2px;
  background: #374151;
  color: #ffffff;
  padding: 0.3rem 0.75rem;
  font-weight: 700;
}

.history-event-badge--info {
  border-color: #3b82f6;
  background: #eff6ff;
  color: #2563eb;
}

.history-event-badge--neutral {
  border-color: #f59e0b;
  background: #fffbeb;
  color: #d97706;
}

.advanced-history-table {
  width: 2111px;
  min-width: 2111px;
  max-width: 2111px;
  table-layout: fixed;
}

.advanced-col--seq {
  width: 56px;
}

.advanced-col--time {
  width: 210px;
}

.advanced-col--event {
  width: 180px;
}

.advanced-col--coordinates {
  width: 150px;
}

.advanced-col--device-reason {
  width: 160px;
}

.advanced-col--speed,
.advanced-col--altitude,
.advanced-col--heading,
.advanced-col--gps-valid,
.advanced-col--battery {
  width: 100px;
}

.advanced-col--raw-event-text {
  width: 240px;
}

.advanced-col--engine,
.advanced-col--satellites {
  width: 90px;
}

.advanced-col--gps-connected {
  width: 120px;
}

.advanced-col--mileage,
.advanced-col--main-voltage {
  width: 110px;
}

.advanced-col--logic-state {
  width: 95px;
}

.advanced-technical-stack {
  display: grid;
  gap: 0.25rem;
}

.advanced-technical-content {
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  white-space: nowrap;
}

.advanced-technical-secondary {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.advanced-missing-value {
  color: var(--text-muted);
}

.advanced-history-toolbar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid #192a38;
  background: #263746;
}

.advanced-column-selector {
  position: relative;
  flex: 0 0 auto;
}

.advanced-column-selector-toggle {
  min-height: 2.35rem;
  padding: 0.45rem 0.75rem;
  border-color: #506476;
  background: #ffffff;
  color: var(--text);
  white-space: nowrap;
}

.advanced-column-selector-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  right: 0;
  width: min(19rem, calc(100vw - 2.5rem));
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--surface);
  box-shadow: 0 0.5rem 1.4rem rgba(22, 36, 44, 0.16);
  padding: 0.55rem;
}

.advanced-column-selector-menu[hidden],
[data-advanced-column][hidden] {
  display: none;
}

.advanced-column-selector-options {
  display: grid;
  gap: 0.15rem;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.15rem;
}

.advanced-column-selector-options label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.4rem;
  border-radius: 0.35rem;
  cursor: pointer;
}

.advanced-column-selector-options label:hover {
  background: var(--surface-muted);
}

.advanced-column-selector-options input {
  width: 1rem;
  min-height: 1rem;
  padding: 0;
}

.advanced-column-selector-options input:disabled + span {
  color: var(--text-muted);
}

.advanced-column-selector-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
}

.advanced-column-selector-actions button {
  min-height: 2.15rem;
  padding: 0.35rem 0.65rem;
}

.stop-events-section {
  margin-top: 0;
}

.route-map-section {
  margin-top: 2.25rem;
}

.route-map-loading-status {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0 0 0.65rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.route-map-loading-status progress {
  width: 3.5rem;
  height: 0.5rem;
}

.route-map-loading-status.is-ready progress,
.route-map-loading-status.is-error progress {
  display: none;
}

.route-map-loading-status.is-ready {
  background: #e8f4ec;
  color: #236b3c;
}

.route-map-loading-status.is-error {
  background: var(--alert-background);
  color: var(--alert-text);
}

.map-description,
.map-cluster-note,
.map-location-note,
.map-privacy-note {
  color: var(--text-muted);
}

.map-description {
  margin: -0.4rem 0 0;
}

.map-cluster-note,
.map-location-note,
.map-privacy-note {
  margin: 0.25rem 0 1rem;
  font-size: 0.85rem;
}

.map-cluster-note {
  margin-bottom: 0.25rem;
}

.map-location-note {
  margin-bottom: 0.25rem;
}

#route-map {
  width: 100%;
  max-width: 980px;
  height: clamp(34rem, 72vh, 44rem);
  margin-inline: auto;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-muted);
  box-shadow: var(--shadow);
}

.map-day-timeline {
  --timeline-position: 0%;
  width: 100%;
  max-width: 980px;
  margin: 0.65rem auto 0;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--surface);
  padding: 0.55rem 0.75rem 0.45rem;
  box-shadow: var(--shadow);
}

.map-day-timeline.is-disabled {
  opacity: 0.58;
}

.map-day-timeline-control {
  position: relative;
  padding-top: 1.65rem;
}

.map-day-timeline-time {
  position: absolute;
  top: 0;
  left: clamp(1.6rem, var(--timeline-position), calc(100% - 1.6rem));
  min-width: 3.2rem;
  transform: translateX(-50%);
  color: var(--color-heading);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.map-day-timeline-input-shell {
  position: relative;
  height: 2rem;
}

.map-day-timeline-track {
  position: absolute;
  top: 50%;
  right: 0.5rem;
  left: 0.5rem;
  height: 1.1rem;
  transform: translateY(-50%);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  background: var(--surface-muted);
}

.map-day-timeline-active-range {
  position: absolute;
  z-index: 1;
  top: 0.35rem;
  bottom: 0.35rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-brand) 42%, transparent);
}

.map-day-timeline-track::after {
  position: absolute;
  z-index: 2;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      to right,
      color-mix(in srgb, var(--color-secondary) 60%, transparent) 0 1px,
      transparent 1px calc(100% / 8)
    ),
    repeating-linear-gradient(
      to right,
      color-mix(in srgb, var(--color-secondary) 28%, transparent) 0 1px,
      transparent 1px calc(100% / 16)
    );
  content: "";
  pointer-events: none;
}

#map-day-timeline-input {
  position: absolute;
  z-index: 3;
  inset: 0;
  width: 100%;
  height: 2rem;
  margin: 0;
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: ew-resize;
}

#map-day-timeline-input::-webkit-slider-runnable-track {
  height: 1.1rem;
  background: transparent;
}

#map-day-timeline-input::-moz-range-track {
  height: 1.1rem;
  background: transparent;
}

#map-day-timeline-input::-webkit-slider-thumb {
  width: 1.15rem;
  height: 1.65rem;
  margin-top: -0.275rem;
  appearance: none;
  border: 2px solid var(--color-heading);
  border-radius: 0.35rem;
  background: var(--surface);
  box-shadow: 0 2px 6px rgb(7 23 43 / 28%);
}

#map-day-timeline-input::-moz-range-thumb {
  width: 1.15rem;
  height: 1.65rem;
  border: 2px solid var(--color-heading);
  border-radius: 0.35rem;
  background: var(--surface);
  box-shadow: 0 2px 6px rgb(7 23 43 / 28%);
}

#map-day-timeline-input:focus-visible {
  outline: none;
}

#map-day-timeline-input:focus-visible::-webkit-slider-thumb {
  box-shadow: var(--focus-ring);
}

#map-day-timeline-input:focus-visible::-moz-range-thumb {
  box-shadow: var(--focus-ring);
}

#map-day-timeline-input:disabled {
  cursor: not-allowed;
}

.map-day-timeline-labels {
  position: relative;
  height: 2.1rem;
  margin: 0 0.5rem;
  color: var(--color-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.map-day-timeline-label {
  display: grid;
  position: absolute;
  width: 4rem;
  transform: translateX(-50%);
  text-align: center;
}

.map-day-timeline-date-change {
  color: var(--accent-dark);
  font-size: 0.62rem;
  font-weight: 800;
}


.history-map-link {
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--accent-dark);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.history-map-link:hover,
.history-map-link:focus-visible {
  border-color: transparent;
  background: rgba(0, 107, 104, 0.07);
  color: var(--accent);
  text-decoration-thickness: 0.12em;
  transform: none;
}

.route-map-section .leaflet-control-layers {
  transition: none;
}

.route-map-section .leaflet-control-layers:hover {
  border-color: #aebcc4;
  background: #f8fbfc;
  transform: none;
}

.route-map-section .leaflet-control-layers-selector {
  width: auto;
  min-height: 0;
  padding: 0;
}

.stop-number-marker {
  display: grid !important;
  place-items: center;
  box-sizing: border-box;
  border: 3px solid #1d4ed8;
  border-radius: 50%;
  background: #60a5fa;
  color: #172a36;
  box-shadow: 0 2px 6px rgba(22, 36, 44, 0.32);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1;
}

.stop-number-marker span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  line-height: 1;
  text-align: center;
}

.stop-number-marker--selected {
  border: 3px solid #ffffff;
  background: #60a5fa;
  color: #172a36;
  box-shadow:
    0 0 0 3px #1d4ed8,
    0 3px 9px rgba(22, 36, 44, 0.38);
}

.report-point-marker {
  --report-point-fill: #60a5fa;
  --report-point-border: #1d4ed8;
  display: grid !important;
  place-items: center;
  border: 0;
  background: transparent;
}

.report-point-marker--start {
  --report-point-fill: #ef4444;
  --report-point-border: #991b1b;
}

.report-point-marker--end {
  --report-point-fill: #22c55e;
  --report-point-border: #14532d;
}

.report-point-marker--combined {
  --report-point-fill: #f59e0b;
  --report-point-border: #78350f;
}

.report-point-marker__glyph {
  display: block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--report-point-border);
  background: var(--report-point-fill);
  box-shadow: 0 1px 3px rgba(22, 36, 44, 0.3);
  pointer-events: none;
}

.report-point-marker__glyph--circle {
  border-radius: 50%;
}

.report-point-marker__glyph--directional {
  border-radius: 52% 52% 52% 4%;
  transform: rotate(calc(var(--report-point-heading) + 135deg));
  transform-origin: center;
}

.leaflet-marker-icon.report-point-marker:not(.report-point-marker--selected) {
  cursor: pointer;
  pointer-events: auto;
}

.leaflet-marker-icon.report-point-marker--selected {
  pointer-events: none !important;
}

.report-point-marker--selected::after {
  position: absolute;
  width: 28px;
  height: 28px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px #1e3a8a;
  content: "";
  pointer-events: none;
}

.route-map-popup {
  display: grid;
  gap: 0.35rem;
}

.route-map-popup p {
  margin: 0;
}

.leaflet-container .report-point-popup .report-map-popup p {
  min-height: 0;
  margin: 0;
  padding: 0;
}

.report-map-popup {
  box-sizing: border-box;
  width: 310px;
  max-width: calc(100vw - 80px);
}

.report-map-popup-title {
  padding-bottom: 0.2rem;
  border-bottom: 1px solid var(--border);
  color: #263746;
  font-size: 1rem;
}

.report-map-popup p {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.45rem;
  align-items: start;
}

.report-map-popup p > span {
  min-width: 0;
  overflow-wrap: break-word;
  word-break: normal;
  white-space: pre-line;
}

.report-map-popup-row--duration > span {
  white-space: nowrap;
}

.report-point-popup .leaflet-popup-content {
  margin: 0;
  color: #172a36;
  font-size: 0.69rem;
  line-height: 1.2;
}

.report-point-popup .leaflet-popup-content-wrapper {
  border: 1px solid #284d5d;
  border-radius: 0.35rem;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(10, 25, 35, 0.38);
  padding: 0.4rem 0.52rem 0.42rem;
}

.report-point-popup .leaflet-popup-tip {
  border-right: 1px solid #284d5d;
  border-bottom: 1px solid #284d5d;
  background: #ffffff;
  box-shadow: 2px 2px 4px rgba(10, 25, 35, 0.18);
}

.leaflet-container .report-point-popup a.leaflet-popup-close-button {
  top: 0.12rem;
  right: 0.12rem;
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  color: #60747f;
  font: 700 0.82rem/1.25rem system-ui, sans-serif;
}

.leaflet-container .report-point-popup a.leaflet-popup-close-button:hover,
.leaflet-container .report-point-popup a.leaflet-popup-close-button:focus {
  background: #edf2f4;
  color: #172a36;
}

.report-map-popup--compact {
  width: 230px;
  max-width: calc(100vw - 48px);
  row-gap: 3px;
}

.report-map-popup--compact .report-map-popup-title {
  padding: 0 1.3rem 0.16rem 0;
  border-bottom-color: #d7e0e4;
  color: #172a36;
  font-size: 0.8rem;
  font-weight: 820;
  line-height: 1.12;
}

.report-map-popup-history-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.38rem;
  align-items: baseline;
  width: 100%;
}

.report-map-popup-history-sequence {
  white-space: nowrap;
}

.report-map-popup-history-timestamp {
  min-width: 0;
  color: #102630;
  font-size: 0.76rem;
  font-weight: 780;
  line-height: 1.12;
  text-align: right;
  white-space: nowrap;
}

.report-map-popup--compact p {
  grid-template-columns: minmax(4.6rem, auto) minmax(0, 1fr);
  gap: 0.28rem;
  font-size: 0.69rem;
  line-height: 1.2;
}

.report-map-popup--compact p > strong {
  color: #60747f;
  font-weight: 650;
}

.report-map-popup--compact p > span {
  overflow-wrap: anywhere;
  color: #172a36;
  font-weight: 720;
  text-align: right;
}

.report-map-popup-row--event-success > span { color: #15803d; }
.report-map-popup-row--event-danger > span { color: #dc2626; }
.report-map-popup-row--event-jamming > span { color: #374151; }
.report-map-popup-row--event-info > span { color: #2563eb; }
.report-map-popup-row--event-neutral > span { color: #a45309; }

.advanced-seq-column,
.advanced-seq-cell {
  width: 3.5rem;
  min-width: 3.5rem;
  text-align: center;
}

.table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.table-scroll:focus-visible {
  outline: 3px solid rgba(0, 107, 104, 0.35);
  outline-offset: 3px;
}

table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.report-table-viewport {
  flex: 0 1 auto;
  height: auto;
  max-height: var(--report-table-viewport-height);
  overflow-x: auto;
  overflow-y: auto;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

#history-panel > .empty-state,
#stops-panel > .empty-state,
#advanced-history-panel > .empty-state {
  flex: 1 1 auto;
  margin: 1rem 1rem 0;
}

.history-table {
  min-width: 880px;
}

.report-data-table th,
.report-data-table td {
  padding: 0.48rem 0.62rem;
  line-height: 1.3;
  vertical-align: middle;
}

.report-data-table thead th {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom-color: #192a38;
  background: #263746;
  color: #f7fafc;
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
  box-shadow: 0 2px 0 rgba(22, 36, 44, 0.2);
  vertical-align: middle;
}

.history-table thead th,
.stop-events-table thead th {
  height: 4rem;
  padding-top: 1.2rem;
  padding-bottom: 1.2rem;
}

.report-data-table tbody .report-data-row:nth-child(even):not([hidden]) {
  background: #f6f9fb;
}

.history-record-row.is-map-selected > * {
  background: color-mix(
    in srgb,
    var(--color-brand) 7%,
    var(--surface)
  );
  box-shadow:
    inset 0 1px color-mix(in srgb, var(--color-brand) 60%, transparent),
    inset 0 -1px color-mix(in srgb, var(--color-brand) 60%, transparent);
}

.history-record-row.is-map-selected > :first-child {
  box-shadow:
    inset 3px 0 var(--color-brand),
    inset 0 1px color-mix(in srgb, var(--color-brand) 60%, transparent),
    inset 0 -1px color-mix(in srgb, var(--color-brand) 60%, transparent);
}

.history-time-column,
.history-time-cell {
  width: 9rem;
  min-width: 9rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.history-table-scroll {
  max-height: var(--history-table-viewport-height);
}

.history-event-column,
.history-event-cell {
  width: 10.5rem;
  max-width: 10.5rem;
  white-space: normal;
}

.history-table .history-event-badge {
  max-width: 100%;
  overflow-wrap: break-word;
  white-space: normal;
}

.stop-time-column,
.stop-time-cell {
  min-width: 9.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.history-time-primary,
.history-time-period,
.stop-time-primary,
.stop-time-secondary {
  display: block;
}

.history-time-cell time,
.stop-time-cell time {
  display: block;
}

.stop-events-table {
  min-width: 900px;
}

.stop-seq-column,
.stop-seq-cell {
  width: 4rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.stop-time-column,
.stop-time-cell {
  min-width: 12.5rem;
}

.stop-duration-value {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.stop-poi-cell,
.stop-address-cell {
  width: 23%;
  max-width: 18rem;
}

.history-time-period {
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.history-poi-value,
.history-speed-value {
  font-weight: 700;
}

.history-poi-cell {
  width: 13rem;
  max-width: 13rem;
  white-space: normal;
}

.history-poi-value {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: break-word;
  word-break: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.history-seq-column,
.history-seq-cell {
  width: 3.25rem;
  min-width: 3.25rem;
  text-align: center;
  vertical-align: middle;
}

.history-seq-cell {
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 650;
}

.history-placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

thead th {
  background: var(--surface-muted);
  color: var(--text);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tbody th {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:not(.report-data-row):hover {
  background: #f8fbfc;
}

.advanced-event-text-cell {
  max-width: 18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-address-cell {
  width: 16rem;
  max-width: 16rem;
  white-space: normal;
}

.history-table .history-address-cell {
  width: 14.5rem;
  max-width: 14.5rem;
}

.history-address-value {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.history-coordinate-line {
  display: block;
  white-space: nowrap;
}

.history-engine-column,
.history-engine-cell,
.history-speed-column,
.history-speed-cell {
  width: 1%;
  white-space: nowrap;
}

.history-location-column,
.history-location-cell {
  width: 1%;
}

.history-address-cell.is-loading {
  color: var(--text-muted);
  font-style: italic;
}

@media (max-width: 1400px) and (min-width: 901px) {
  .report-kpi-grid {
    grid-template-columns: repeat(3, minmax(10.5rem, 1fr));
  }

  #route-map {
    height: clamp(30rem, 64vh, 38rem);
  }
}

@media (max-height: 850px) and (min-width: 901px) {
  :root {
    --report-table-viewport-height: clamp(26rem, 62vh, 38rem);
    --history-table-viewport-height: clamp(24rem, 72vh, 40rem);
  }

  #route-map {
    height: clamp(22rem, 54vh, 32rem);
  }

  .history-table th,
  .history-table td {
    padding: 0.32rem 0.5rem;
    line-height: 1.18;
  }

  .history-table thead th {
    height: 2.8rem;
    padding-top: 0.55rem;
    padding-bottom: 0.55rem;
  }

  .history-time-period,
  .history-seq-cell {
    font-size: 0.74rem;
  }
}

.empty-state {
  margin: 0;
  border: 1px dashed var(--border);
  border-radius: 0.65rem;
  background: var(--surface);
  color: var(--text-muted);
  padding: 1.25rem;
}

@media (max-width: 900px) {
  .vehicle-form-section {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .date-range-grid {
    grid-template-columns: 1fr;
  }

  .report-kpi-grid {
    grid-template-columns: repeat(
      auto-fit,
      minmax(min(12rem, 100%), 1fr)
    );
  }

  #route-map {
    height: clamp(26rem, 62vh, 34rem);
  }

  .report-table-viewport {
    max-height: min(34rem, 65vh);
  }

}

@media (max-width: 600px) {
  .page-shell,
  .navigation-shell {
    width: min(100% - 1.25rem, 1120px);
  }

  main {
    padding-block: 2rem 3rem;
  }

  .result-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .header-content {
    align-items: center;
    gap: 0.45rem 0.75rem;
    flex-wrap: wrap;
  }

  .primary-navigation {
    order: 1;
    width: 100%;
    margin-left: 0;
    overflow-x: auto;
    padding-bottom: 0.15rem;
  }

  .primary-navigation a {
    flex: 1 0 auto;
    text-align: center;
  }

  .header-language-control {
    order: 2;
    margin-left: 0;
  }

  .header-account {
    order: 3;
    margin-left: auto;
  }

  .localized-page-heading-row {
    align-items: flex-start;
  }

  .result-heading-actions {
    width: 100%;
  }

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

  .date-range-row {
    grid-template-columns: 1fr;
  }

  .generate-report-button {
    width: 100%;
  }

  .report-kpi-grid {
    grid-template-columns: 1fr;
  }

  .field-wide {
    grid-column: auto;
  }

  .form-actions button,
  .primary-link,
  .secondary-action {
    width: 100%;
  }

  .report-tabs {
    flex-wrap: wrap;
  }

  .advanced-history-toolbar {
    align-items: center;
  }

  .advanced-column-selector {
    width: auto;
  }

  .advanced-column-selector-toggle {
    width: auto;
  }

  .advanced-column-selector-menu {
    right: auto;
    left: 0;
  }

  .report-tab {
    flex: 1 1 8rem;
  }

  #route-map {
    height: clamp(20rem, 55vh, 23.75rem);
  }

  .map-day-timeline {
    padding-inline: 0.55rem;
  }

  .map-day-timeline-label--wide {
    display: none;
  }
}


.header-account {
  display: grid;
  flex: 0 0 auto;
  justify-items: center;
  gap: 0.05rem;
}

.header-username {
  max-width: 12rem;
  overflow: hidden;
  color: var(--color-secondary-soft);
  font-size: 0.7rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-auth-action {
  margin: 0;
}

.header-auth-action button {
  min-height: auto;
  border: 0;
  background: transparent;
  color: var(--color-secondary);
  padding: 0.22rem 0.65rem 0.35rem;
  font-size: 0.88rem;
}

.header-auth-action button:hover,
.header-auth-action button:focus-visible {
  background: var(--surface-muted);
  color: var(--color-brand-hover);
}

.header-auth-action button:focus-visible {
  outline: none;
  border-radius: var(--radius-control);
  box-shadow: var(--focus-ring);
}
.live-fleet-page {
  min-width: 0;
}

.page-shell.live-page-shell {
  width: min(1320px, calc(100% - 2rem));
}

.live-fleet-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.live-fleet-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.85rem;
}

.live-fleet-heading-copy {
  min-width: 0;
}

.live-fleet-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.7rem;
}

.live-fleet-heading h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.live-fleet-heading-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 0.6rem;
}

.live-fleet-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
  margin: 0 0 1rem;
}

.live-fleet-summary-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-top: 0.3rem solid #31566b;
  border-radius: 0.6rem;
  background: var(--surface);
  padding: 0.7rem 0.8rem;
  text-align: center;
}

.live-fleet-summary-card--normal {
  border-top-color: #267447;
}

.live-fleet-summary-card--attention {
  border-top-color: #a45309;
}

.live-fleet-summary-card--action {
  border-top-color: #a82d31;
}

.live-fleet-summary-card--unavailable {
  border-top-color: #59656c;
}

.live-fleet-summary-card dt {
  font-size: 0.72rem;
  font-weight: 760;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-fleet-summary-card dd {
  margin: 0.15rem 0 0;
  font-size: 1.45rem;
  font-variant-numeric: tabular-nums;
}

.live-fleet-refresh-panel {
  display: grid;
  grid-template-columns: auto minmax(18rem, 1fr) minmax(16rem, 1.2fr);
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--surface);
  padding: 0.75rem 0.9rem;
}

.live-fleet-provider-state {
  display: grid;
  gap: 0.15rem;
}

.live-fleet-provider-state span,
.live-fleet-refresh-metadata dt {
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 720;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-fleet-provider-state strong {
  color: #173f54;
  font-size: 1rem;
}

.live-fleet-refresh-metadata {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin: 0;
}

.live-fleet-refresh-metadata dd {
  margin-top: 0.1rem;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
}

.live-fleet-page-status {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.live-fleet-page.is-stale .live-fleet-refresh-panel {
  border-color: #b8a36a;
  background: #fffdf5;
}

.live-fleet-page.is-stale .live-fleet-table-wrap {
  box-shadow: inset 0 0 0 2px rgba(164, 83, 9, 0.18);
}

.live-fleet-toolbar {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.live-fleet-view-control {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 2.75rem;
  gap: 0.25rem;
  border: 1px solid var(--border);
  border-radius: 0.55rem;
  background: var(--surface);
  padding: 0.2rem;
}

.live-fleet-view-control button {
  min-height: 2.25rem;
  border-color: transparent;
  background: transparent;
  color: #263746;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.2;
}

.live-fleet-view-control button[aria-pressed="true"] {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #ffffff;
}

.live-map-label-control {
  position: absolute;
  z-index: 1002;
  top: 4.25rem;
  right: 0.625rem;
  pointer-events: none;
}

.live-map-label-control.leaflet-control {
  position: relative;
  top: auto;
  right: auto;
  display: grid;
  gap: 2px;
  pointer-events: auto;
}

.live-map-overlay-toggle {
  width: auto;
  min-height: 26px;
  border: 0;
  border-radius: 4px;
  background: #ffffff;
  box-shadow: 0 1px 5px rgb(0 0 0 / 65%);
  color: #000000;
  padding: 0 0.36rem;
  font: 700 12px/26px system-ui, sans-serif;
  pointer-events: auto;
}

.leaflet-touch .live-map-overlay-toggle {
  min-height: 30px;
  font-size: 13px;
  line-height: 30px;
}

.live-map-overlay-toggle[aria-pressed="true"]::before {
  margin-right: 0.28rem;
  color: #18794e;
  content: "\2713";
  font-weight: 850;
}

.live-poi-popup {
  color: #263746;
  font: 700 0.78rem/1.35 system-ui, sans-serif;
}

.live-fleet-map-panel {
  position: relative;
  min-width: 0;
  margin-top: 1rem;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.live-fleet-map-panel[hidden] {
  display: none;
}

.live-fleet-map-panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0.9rem 0.55rem;
}

.live-fleet-map-panel__header h2,
.live-fleet-map-panel__header p {
  margin: 0;
}

.live-fleet-map-panel__header p,
.live-fleet-map-status {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.live-fleet-map-panel__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.live-fleet-map-status {
  margin: 0;
  padding: 0 0.9rem 0.65rem;
  font-weight: 680;
}

.live-fleet-map-viewport {
  width: 100%;
  height: clamp(26rem, 48vh, 34rem);
  max-width: 100%;
  background: #e7ecee;
}

.live-fleet-marker-icon {
  overflow: visible;
  border: 0;
  background: transparent;
}

.live-fleet-marker-shape {
  --live-marker-heading: 0deg;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  box-sizing: border-box;
  transform: translate(-50%, -50%) rotate(135deg);
  transform-origin: 50% 50%;
  border: 1px solid #ffffff;
  outline: 2px solid #172a36;
  outline-offset: 0;
  border-radius: 50% 50% 50% 0;
  background: #59656c;
  box-shadow: 0 1px 4px rgb(10 25 35 / 45%);
  opacity: 0.95;
}

.live-fleet-marker-shape--directional {
  transform:
    translate(-50%, -50%)
    rotate(calc(var(--live-marker-heading) + 135deg));
}

.live-fleet-marker-shape--action_required {
  background: #a82d31;
}

.live-fleet-marker-shape--attention {
  background: #a45309;
}

.live-fleet-marker-shape--normal {
  background: #267447;
}

.live-fleet-marker-shape--delayed {
  opacity: 0.7;
}

.live-fleet-marker-shape--stale {
  opacity: 0.48;
}

.live-fleet-marker-shape--selected {
  width: 30px;
  height: 30px;
  border-width: 2px;
  outline-width: 3px;
  box-shadow: 0 2px 5px rgb(10 25 35 / 48%);
}

.live-fleet-marker-icon--selected::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 38px;
  height: 38px;
  box-sizing: border-box;
  transform: translate(-50%, -50%);
  border: 3px solid #176b87;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
  content: "";
}

.live-fleet-map-panel .leaflet-popup-content p {
  margin: 0.35rem 0 0;
}

.live-fleet-search {
  display: grid;
  flex: 1 1 15rem;
  gap: 0.3rem;
}

.live-fleet-search input {
  min-height: 2.55rem;
}

.live-fleet-filters {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-inline-start: 0.4rem;
}

.live-fleet-filters button {
  --live-filter-color: #006b68;
  --live-filter-background: #eaf4f4;
  min-height: 2.75rem;
  border: 1px solid var(--live-filter-color);
  border-radius: 0.55rem;
  background: var(--live-filter-background);
  color: var(--live-filter-color);
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.2;
}

.live-fleet-filters button[data-live-filter="action_required"] {
  --live-filter-color: #a82d31;
  --live-filter-background: #ffe5e5;
}

.live-fleet-filters button[data-live-filter="attention"] {
  --live-filter-color: #a45309;
  --live-filter-background: #ffedd5;
}

.live-fleet-filters button[data-live-filter="normal"] {
  --live-filter-color: #267447;
  --live-filter-background: #e4f4e9;
}

.live-fleet-filters button[data-live-filter="unavailable"] {
  --live-filter-color: #59656c;
  --live-filter-background: #f1f3f4;
}

.live-fleet-filters button[data-live-filter="more_than_one_day"] {
  --live-filter-color: #6f3a7b;
  --live-filter-background: #f3e8f5;
}

.live-fleet-filters button:hover {
  border-color: var(--live-filter-color);
  background: var(--live-filter-background);
  color: var(--live-filter-color);
  box-shadow: inset 0 0 0 9999px rgb(255 255 255 / 18%);
}

.live-fleet-filters button[aria-pressed="true"] {
  outline: 2px solid var(--theme-filter-selected-outline);
  outline-offset: 2px;
}

.live-fleet-filters button[aria-pressed="true"]:focus-visible {
  outline-width: 3px;
  outline-offset: 3px;
}

.live-fleet-visible-count {
  margin: 0;
  border-left: 1px solid var(--border);
  color: var(--text-muted);
  padding-left: 0.7rem;
  font-size: 0.84rem;
  white-space: nowrap;
}

.live-fleet-visible-count strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.live-fleet-table-wrap {
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: clamp(24rem, calc(100dvh - 12rem), 44rem);
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.live-fleet-table-wrap:focus-visible {
  outline: 3px solid rgba(0, 107, 104, 0.35);
  outline-offset: 3px;
}

.live-fleet-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
}

.live-fleet-table th,
.live-fleet-table td {
  box-sizing: border-box;
  padding: 0.36rem 0.38rem;
  line-height: 1.18;
  vertical-align: middle;
  white-space: normal;
}

.live-fleet-table thead th {
  position: sticky;
  z-index: 5;
  top: 0;
  border-bottom: 1px solid #172a36;
  background: #263746;
  color: #ffffff;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.live-fleet-row {
  --live-row-background: #f3f5f6;
  --live-row-border: #59656c;
  border-left: 0.35rem solid var(--live-row-border);
  background: var(--live-row-background);
}

.live-fleet-row > :first-child {
  border-left: 0.35rem solid var(--live-row-border);
}

.live-fleet-row--action-required {
  --live-row-background: #fff0f0;
  --live-row-border: #a82d31;
}

.live-fleet-row--attention {
  --live-row-background: #fff5e8;
  --live-row-border: #a45309;
}

.live-fleet-row--normal {
  --live-row-background: #eef8f1;
  --live-row-border: #267447;
}

.live-fleet-row--unavailable {
  --live-row-background: #f1f3f4;
  --live-row-border: #59656c;
}

.live-fleet-row--more-than-one-day {
  --live-row-background: #f3e8f5;
  --live-row-border: #6f3a7b;
}

.live-fleet-row:hover {
  background: var(--live-row-background);
  box-shadow: inset 0 0 0 9999px rgba(255, 255, 255, 0.18);
}

.live-fleet-vehicle-heading,
.live-fleet-vehicle-cell {
  width: 20%;
  overflow-wrap: anywhere;
}

.live-status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #59656c;
  font-size: 0.78rem;
  font-weight: 760;
  white-space: nowrap;
}

.live-status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #77848b;
}

.live-status-indicator--live {
  color: #1f653d;
}

.live-status-indicator--live .live-status-dot {
  background: #2d8a51;
  box-shadow: 0 0 0.35rem rgba(45, 138, 81, 0.55);
}

.live-status-indicator--delayed {
  color: #8a4c0a;
}

.live-status-indicator--delayed .live-status-dot {
  background: #b56813;
}

.live-fleet-status-heading,
.live-fleet-status-cell {
  width: 17%;
  overflow-wrap: anywhere;
}

.live-fleet-delay-heading,
.live-fleet-delay-cell {
  width: 14%;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

.live-fleet-event-heading,
.live-fleet-event-cell {
  width: 20%;
  overflow-wrap: anywhere;
}

.live-fleet-telemetry-heading,
.live-fleet-telemetry-cell {
  width: 17%;
  overflow-wrap: anywhere;
}

.live-fleet-status-badge {
  display: inline-flex;
  border: 1px solid var(--live-row-border);
  border-radius: 999px;
  background: #ffffff;
  color: #263746;
  padding: 0.2rem 0.5rem;
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.live-fleet-status-reason,
.live-fleet-cell-primary,
.live-fleet-cell-secondary {
  display: block;
}

.live-fleet-status-reason,
.live-fleet-cell-secondary {
  margin-top: 0.12rem;
  color: #4f6069;
  font-size: 0.74rem;
}

.live-fleet-cell-primary {
  color: #172a36;
  font-weight: 760;
}

.live-fleet-telemetry-cell {
  font-variant-numeric: tabular-nums;
}

.live-fleet-delay-value {
  display: block;
  color: #172a36;
  font-size: 0.88rem;
  font-weight: 820;
  line-height: 1;
}

.live-fleet-event-cell {
  overflow-wrap: anywhere;
}

.live-fleet-actions-heading,
.live-fleet-actions-cell {
  width: 12%;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

.live-fleet-actions-group {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  max-width: 100%;
  vertical-align: middle;
  white-space: nowrap;
}

.live-fleet-events-button {
  display: inline-flex;
  align-items: center;
  min-height: 1.9rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.78rem;
  scroll-margin-top: 3rem;
  white-space: nowrap;
}

.live-fleet-selected-indicator {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  padding: 0;
  border: 0;
  white-space: nowrap;
}

.live-fleet-selected-indicator[hidden],
.live-events-incomplete[hidden] {
  display: none;
}

.live-fleet-row--selected {
  outline: 3px solid #176b87;
  outline-offset: -3px;
}

.live-events-drawer {
  position: fixed;
  z-index: 40;
  inset: 0 0 0 auto;
  display: flex;
  width: min(26rem, 100vw);
  max-width: 100vw;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: -0.75rem 0 2rem rgba(18, 40, 52, 0.2);
}

.live-events-drawer[hidden] {
  display: none;
}

.live-events-drawer__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid var(--border);
  padding: 1rem;
}

.live-events-drawer__header h2,
.live-events-drawer__header p {
  margin: 0;
}

.live-events-drawer__header .eyebrow {
  margin-bottom: 0.2rem;
}

.live-events-drawer__close {
  flex: 0 0 auto;
}

.live-events-drawer__selected-status,
.live-events-drawer__controls {
  padding: 0.75rem 1rem;
}

.live-events-drawer__selected-status {
  padding-bottom: 0;
}

.live-events-drawer__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.live-events-drawer__body {
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1rem;
}

.live-events-drawer__status,
.live-events-incomplete {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
}

.live-events-incomplete {
  border: 1px solid #d1b46c;
  border-radius: 0.5rem;
  background: #fff8e6;
  color: #73490b;
  padding: 0.55rem 0.65rem;
  font-weight: 700;
}

.live-events-timeline {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.live-events-item {
  border: 1px solid var(--border);
  border-left: 0.3rem solid #667781;
  border-radius: 0.55rem;
  background: #f7f9fa;
  padding: 0.7rem;
}

.live-events-item--normal {
  border-left-color: #267447;
}

.live-events-item--attention {
  border-left-color: #a45309;
  background: #fff8ed;
}

.live-events-item--action-required {
  border-left-color: #a82d31;
  background: #fff1f1;
}

.live-events-item__heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
}

.live-events-item__badge {
  flex: 0 0 auto;
  border-radius: 999px;
  background: #e5ebee;
  padding: 0.15rem 0.4rem;
  color: #314751;
  font-size: 0.7rem;
  font-weight: 800;
}

.live-events-item__time,
.live-events-item__telemetry {
  display: block;
  margin-top: 0.35rem;
  color: #4f6069;
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
}

.live-events-item__telemetry {
  margin-bottom: 0;
}

.live-fleet-status-badge--action-required {
  border-color: #a82d31;
}

.live-fleet-status-badge--attention {
  border-color: #a45309;
}

.live-fleet-status-badge--normal {
  border-color: #267447;
}

.live-fleet-status-badge--unavailable {
  border-color: #59656c;
}

.live-fleet-status-badge--more-than-one-day {
  border-color: #6f3a7b;
}

.live-fleet-message-row td {
  padding: 1.5rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 1400px) and (min-width: 901px) {
  .live-fleet-summary {
    grid-template-columns: repeat(5, minmax(8rem, 1fr));
  }

}

@media (max-height: 850px) and (min-width: 901px) {
  .live-fleet-table-wrap {
    max-height: clamp(23rem, calc(100dvh - 12rem), 40rem);
  }

  .live-fleet-table {
    font-size: 0.79rem;
  }

  .live-fleet-table th,
  .live-fleet-table td {
    padding: clamp(0.25rem, 0.65vh, 0.33rem) 0.34rem;
    line-height: 1.14;
  }

  .live-fleet-status-reason,
  .live-fleet-cell-secondary {
    margin-top: 0.08rem;
    font-size: 0.71rem;
  }

  .live-fleet-status-badge {
    padding: 0.16rem 0.42rem;
    font-size: 0.71rem;
  }

  .live-fleet-events-button {
    min-height: 1.7rem;
    padding-block: 0.18rem;
    font-size: 0.74rem;
  }

  .live-fleet-map-viewport {
    height: clamp(20rem, 46vh, 27rem);
  }
}

@media (max-width: 900px) {
  .live-fleet-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .live-fleet-summary {
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  }

  .live-fleet-refresh-panel {
    grid-template-columns: 1fr;
  }

  .live-fleet-visible-count {
    margin-bottom: 0;
  }

  .live-fleet-table-wrap {
    max-height: clamp(24rem, calc(100dvh - 11rem), 42rem);
  }

  .live-fleet-map-panel__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .live-fleet-map-panel__actions {
    justify-content: flex-start;
  }
}

@media (max-width: 600px) {
  .report-form-live-action,
  .live-fleet-heading-actions,
  .live-fleet-filters {
    width: 100%;
  }

  .security-live-action,
  .live-fleet-heading-actions > * {
    width: 100%;
  }

  .live-fleet-heading-actions {
    flex-direction: column;
  }

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

  .live-fleet-summary-card:first-child {
    grid-column: 1 / -1;
  }

  .live-fleet-refresh-metadata {
    grid-template-columns: 1fr;
  }

  .live-fleet-filters button {
    flex: 1 1 8rem;
    width: auto;
  }

  .live-fleet-filters {
    margin-inline-start: 0;
  }

  .live-fleet-view-control,
  .live-fleet-map-panel__actions {
    width: 100%;
  }

  .live-fleet-view-control button,
  .live-fleet-map-panel__actions button {
    flex: 1 1 auto;
  }

  .live-fleet-map-viewport {
    height: clamp(18rem, 48vh, 24rem);
  }

  .live-fleet-table-wrap {
    max-height: min(44rem, 72vh);
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .live-fleet-table {
    min-width: 0;
    border-collapse: separate;
  }

  .live-fleet-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .live-fleet-table tbody,
  .live-fleet-row,
  .live-fleet-row td {
    display: block;
    width: 100%;
  }

  .live-fleet-row {
    margin-bottom: 0.5rem;
    border: 1px solid var(--border);
    border-left: 0.35rem solid var(--live-row-border);
    border-radius: 0.65rem;
    overflow: hidden;
  }

  .live-fleet-row > :first-child {
    border-left: 0;
  }

  .live-fleet-row td {
    display: grid;
    grid-template-columns: minmax(7rem, 0.7fr) minmax(0, 1.3fr);
    gap: 0.65rem;
    min-width: 0;
    border-bottom: 1px solid rgba(79, 96, 105, 0.18);
    padding: 0.45rem 0.5rem;
    text-align: left;
  }

  .live-fleet-row td::before {
    grid-column: 1;
    grid-row: 1 / span 3;
    color: #465860;
    content: attr(data-label);
    font-size: 0.7rem;
    font-weight: 780;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .live-fleet-row td > * {
    grid-column: 2;
  }

  .live-fleet-row td:last-child {
    border-bottom: 0;
  }

  .live-fleet-actions-cell {
    white-space: normal;
  }

  .live-fleet-actions-group {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    white-space: normal;
  }

  .live-fleet-events-button {
    width: fit-content;
  }

  .live-events-drawer {
    width: 100vw;
    border-left: 0;
  }

  .live-events-drawer__header,
  .live-events-drawer__controls {
    position: sticky;
    z-index: 2;
    top: 0;
    background: var(--surface);
  }

  .live-events-drawer__controls {
    top: auto;
  }

  .live-fleet-message-row,
  .live-fleet-message-row td {
    display: block;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .live-fleet-page *,
  .security-live-action {
    scroll-behavior: auto;
    transition: none;
  }
}

.live-fleet-map-panel .leaflet-tooltip.live-fleet-marker-label {
  border: 1px solid #526771;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 1px 3px rgba(10, 25, 35, 0.32);
  color: #172a36;
  padding: 0.12rem 0.38rem;
  font-size: 0.7rem;
  font-weight: 780;
  line-height: 1.15;
  pointer-events: none;
  white-space: nowrap;
}

.live-fleet-map-panel .leaflet-tooltip-top.live-fleet-marker-label::before {
  border-top-color: #526771;
}

.live-fleet-map-panel .leaflet-tooltip.live-fleet-marker-label--selected {
  z-index: 1;
  border-color: #284d5d;
  background: #ffffff;
  box-shadow: 0 2px 7px rgba(10, 25, 35, 0.38);
  opacity: 1;
}

.live-fleet-map-panel .live-fleet-marker-label--selected .live-fleet-marker-label__content,
.live-fleet-map-panel .live-fleet-marker-label--selected .live-fleet-marker-label__registration,
.live-fleet-map-panel .live-fleet-marker-label--selected .live-fleet-marker-label__address {
  background: #ffffff;
}

.live-fleet-marker-label__content,
.live-fleet-marker-label__registration,
.live-fleet-marker-label__address {
  display: block;
}

.live-fleet-marker-label__registration {
  font-size: 0.82rem;
  font-weight: 820;
  line-height: 1.12;
}

.live-fleet-marker-label__address {
  max-width: 16rem;
  margin-top: 0.12rem;
  overflow: hidden;
  color: #3e5663;
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
}

.live-fleet-marker-label__address--loading,
.live-fleet-marker-label__address--unavailable {
  color: #6e7f88;
  font-style: italic;
}

.live-fleet-marker-label__last-known {
  color: #8a4a08;
  font-style: normal;
  font-weight: 740;
}

.live-fleet-marker-details {
  display: grid;
  min-width: 15rem;
  max-width: min(19rem, calc(100vw - 3rem));
  gap: 0.18rem;
  margin-top: 0.35rem;
  border-top: 1px solid #d7e0e4;
  padding-top: 0.32rem;
  white-space: normal;
}

.live-fleet-marker-detail {
  display: grid;
  grid-template-columns: minmax(4.6rem, auto) minmax(0, 1fr);
  gap: 0.5rem;
  align-items: start;
  font-size: 0.69rem;
  line-height: 1.24;
}

.live-fleet-marker-detail__key {
  color: #60747f;
  font-weight: 650;
}

.live-fleet-marker-detail__value {
  overflow-wrap: anywhere;
  color: #172a36;
  font-weight: 720;
  text-align: right;
}

.live-fleet-marker-detail--normal .live-fleet-marker-detail__value { color: #176b43; }
.live-fleet-marker-detail--attention .live-fleet-marker-detail__value { color: #9a5a08; }
.live-fleet-marker-detail--action_required .live-fleet-marker-detail__value { color: #a92d35; }
.live-fleet-marker-detail--unavailable .live-fleet-marker-detail__value,
.live-fleet-marker-detail--address-loading .live-fleet-marker-detail__value,
.live-fleet-marker-detail--address-unavailable .live-fleet-marker-detail__value { color: #60747f; }

#live-map-focus-enter,
.live-map-focus-controls button {
  display: inline-flex;
  width: auto;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  border: 1px solid #9cb0b9;
  border-radius: 0.55rem;
  background: #ffffff;
  box-shadow: none;
  color: #263746;
  padding: 0.35rem 0.65rem;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 680;
  line-height: 1.2;
}

#live-map-focus-enter {
  margin-inline-start: auto;
}

#live-map-focus-enter::before {
  width: 0.82rem;
  height: 0.82rem;
  flex: 0 0 auto;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2335515d' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 4H4v3M13 4h3v3M4 13v3h3M16 13v3h-3'/%3E%3C/svg%3E");
  content: "";
}

#live-map-focus-enter:hover,
#live-map-focus-enter:focus-visible,
.live-map-focus-controls button:hover,
.live-map-focus-controls button:focus-visible {
  border-color: #8299a3;
  background: #edf2f4;
  color: #24434f;
}

/* Hosted desktop parity: the original compact table remains primary. */
.live-fleet-heading {
  margin-bottom: 0.5rem;
}

.live-fleet-toolbar {
  align-items: center;
  margin-top: 0;
}

.live-fleet-search {
  max-width: 24rem;
}

.live-fleet-workspace {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 0.75rem;
  align-items: stretch;
  min-width: 0;
  margin-top: 0.75rem;
}

.live-fleet-workspace > * {
  min-width: 0;
}

.live-fleet-workspace .live-fleet-table-wrap {
  height: 40rem;
  max-height: 40rem;
  background: var(--surface-muted);
}

.live-fleet-workspace .live-fleet-map-panel {
  display: flex;
  height: 40rem;
  min-height: 40rem;
  flex-direction: column;
  margin-top: 0;
}

.live-map-focus-controls[hidden],
.live-map-roster[hidden] { display: none; }

.live-map-focus-controls { position: absolute; z-index: 1002; right: 0.75rem; bottom: 0.75rem; display: flex; gap: 0.4rem; }

.live-map-roster__header button { border-color: rgb(255 255 255 / 28%); background: rgb(20 34 43 / 90%); color: #ffffff; box-shadow: 0 0.2rem 0.7rem rgb(5 14 20 / 24%); }

.live-map-roster { position: absolute; z-index: 1001; top: 0.75rem; left: 0.75rem; display: flex; width: 18rem; max-width: calc(100vw - 1.5rem); max-height: min(72vh, 38rem); max-height: min(72dvh, 38rem); flex-direction: column; overflow: hidden; border: 1px solid rgb(255 255 255 / 22%); border-radius: 0.75rem; background: rgb(20 34 43 / 88%); box-shadow: 0 0.5rem 1.5rem rgb(5 14 20 / 28%); color: #ffffff; backdrop-filter: blur(8px); }

.live-map-roster--collapsed { width: auto; }

.live-map-roster__header { display: flex; align-items: center; justify-content: space-between; gap: 0.65rem; padding: 0.55rem 0.6rem; }
.live-map-roster__header > div { display: flex; align-items: baseline; gap: 0.45rem; }
.live-map-roster__eyebrow { font-size: 0.72rem; font-weight: 760; letter-spacing: 0.04em; text-transform: uppercase; }
.live-map-roster__header strong { color: #b9cbd4; font-size: 0.72rem; }
.live-map-roster__header button { min-height: 1.9rem; padding: 0.25rem 0.45rem; font-size: 0.68rem; }

.live-map-roster__search { border-top: 1px solid rgb(255 255 255 / 14%); padding: 0 0.55rem 0.5rem; }
.live-map-roster__search[hidden] { display: none; }
.live-map-roster__search input { width: 100%; min-height: 2rem; border: 1px solid rgb(255 255 255 / 28%); border-radius: 0.42rem; background: rgb(8 22 30 / 62%); color: #ffffff; padding: 0.32rem 0.5rem; font-size: 0.74rem; }
.live-map-roster__search input::placeholder { color: #b9cbd4; opacity: 1; }
.live-map-roster__search input:focus { border-color: #7dd3fc; outline: 2px solid rgb(125 211 252 / 24%); }

.live-map-roster__filters { flex: 0 0 auto; margin: 0; border-top: 1px solid rgb(255 255 255 / 14%); padding: 0.45rem 0.55rem; }
.live-map-roster__filters[hidden] { display: none; }
.live-map-roster__filters button { min-height: 1.9rem; flex: 1 1 calc(50% - 0.18rem); padding: 0.25rem 0.4rem; font-size: 0.66rem; }
.live-map-roster__filters button[aria-pressed="true"] { outline-color: #f3f7fa; }

.live-map-roster__list { min-height: 0; overflow-y: auto; border-top: 1px solid rgb(255 255 255 / 14%); padding: 0.25rem; scrollbar-color: #78909c transparent; }

.live-map-roster__row { display: grid; width: 100%; min-height: 2.25rem; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 0.42rem; border: 1px solid transparent; border-radius: 0.45rem; background: var(--live-roster-row-bg, rgb(255 255 255 / 7%)); box-shadow: none; padding: 0.34rem 0.42rem; text-align: left; }
.live-map-roster__row:hover,
.live-map-roster__row:focus-visible { border-color: rgb(255 255 255 / 34%); background: var(--live-roster-row-hover, rgb(255 255 255 / 13%)); }
.live-map-roster__row--selected { border-color: #7dd3fc; background: var(--live-roster-row-bg); box-shadow: inset 0.2rem 0 0 #7dd3fc; }
.live-map-roster__row--normal { --live-roster-row-bg: rgb(30 116 69 / 28%); --live-roster-row-hover: rgb(35 139 82 / 38%); }
.live-map-roster__row--attention { --live-roster-row-bg: rgb(174 105 13 / 30%); --live-roster-row-hover: rgb(202 126 19 / 40%); }
.live-map-roster__row--action_required { --live-roster-row-bg: rgb(157 45 54 / 32%); --live-roster-row-hover: rgb(184 53 63 / 43%); }
.live-map-roster__row--unavailable { --live-roster-row-bg: rgb(103 119 128 / 25%); --live-roster-row-hover: rgb(128 145 154 / 34%); }
.live-map-roster__row--more_than_one_day { --live-roster-row-bg: rgb(111 58 123 / 36%); --live-roster-row-hover: rgb(135 72 149 / 46%); }
.live-map-roster__identity { display: grid; min-width: 0; gap: 0; align-content: center; }
.live-map-roster__registration { overflow: hidden; font-size: 0.76rem; font-weight: 720; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.live-map-roster__unit { overflow: hidden; color: #b9cbd4; font-size: 0.61rem; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.live-map-roster__delay { color: #c6d5dc; font-size: 0.66rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.live-map-roster__empty { margin: 0; padding: 0.75rem 0.55rem; color: #c6d5dc; font-size: 0.74rem; }

body.live-map-focus-active { overflow: hidden; }
body.live-map-focus-active > .site-header,
body.live-map-focus-active > main.live-page-shell { visibility: hidden; }
.live-fleet-page--map-focus > .live-fleet-heading,
.live-fleet-page--map-focus > .live-fleet-toolbar,
.live-fleet-page--map-focus > .live-fleet-page-status,
.live-fleet-page--map-focus .live-fleet-table-wrap { display: none; }
.live-fleet-page--map-focus .live-fleet-workspace { display: block; margin: 0; }

.live-fleet-map-panel.live-fleet-map-panel--map-focus {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: none;
  box-sizing: border-box;
  flex: none;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: #172a36;
  box-shadow: none;
  isolation: isolate;
  visibility: visible;
}

.live-fleet-map-panel--map-focus .live-fleet-map-viewport,
.live-fleet-map-panel--map-focus .leaflet-container {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-width: none;
}

.live-fleet-map-panel--map-focus .live-map-focus-controls {
  z-index: 3;
}

.live-fleet-map-panel--map-focus .live-map-roster {
  z-index: 2;
}

@media (max-width: 1050px) { .live-map-roster { width: 16rem; } }

@media (max-width: 760px) {
  .live-map-focus-controls { right: 0.5rem; bottom: calc(42dvh + 1rem); }
  .live-map-roster { top: auto; right: 0.5rem; bottom: 0.5rem; left: 0.5rem; width: auto; max-width: none; max-height: 42vh; max-height: 42dvh; }
  .live-map-roster--collapsed { right: auto; width: auto; }
}

.live-fleet-workspace .live-fleet-map-viewport {
  min-height: 0;
  height: 100%;
  flex: 1 1 auto;
}

.live-fleet-view-control,
#live-map-return-list {
  display: none;
}

.live-fleet-table {
  font-size: 0.79rem;
}

.live-fleet-table th,
.live-fleet-table td {
  padding: 0.3rem 0.28rem;
  line-height: 1.14;
}

.live-fleet-status-reason,
.live-fleet-cell-secondary {
  margin-top: 0.08rem;
  font-size: 0.71rem;
  line-height: 1.15;
}

.live-fleet-row--action-required {
  --live-row-background: #ffe5e5;
}

.live-fleet-row--attention {
  --live-row-background: #ffedd5;
}

.live-fleet-row--normal {
  --live-row-background: #e4f4e9;
}

.live-fleet-row--selected > :first-child {
  border-left-width: 0.55rem;
  border-left-color: #176b87;
}

.live-fleet-events-button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

@media (max-width: 1050px) {
  .live-fleet-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .live-fleet-workspace .live-fleet-table-wrap {
    height: 32rem;
    max-height: 32rem;
  }

  .live-fleet-workspace .live-fleet-map-panel {
    height: 32rem;
    min-height: 32rem;
  }

  .live-fleet-workspace .live-fleet-map-viewport {
    min-height: 0;
    height: 100%;
  }
}

.live-fleet-vehicle-heading,
.live-fleet-vehicle-cell {
  width: 18%;
}

.live-fleet-status-heading,
.live-fleet-status-cell {
  width: 18%;
}

.live-fleet-delay-heading,
.live-fleet-delay-cell {
  width: 17%;
}

.live-fleet-telemetry-heading,
.live-fleet-telemetry-cell {
  width: 16%;
}

.live-fleet-event-heading,
.live-fleet-event-cell {
  width: 16%;
}

.live-fleet-actions-heading,
.live-fleet-actions-cell {
  width: 15%;
}

.live-fleet-workspace .live-fleet-events-button {
  min-height: 1.7rem;
  padding: 0.18rem 0.3rem;
  font-size: 0.7rem;
}

.live-fleet-workspace .live-fleet-map-panel[hidden] {
  display: none;
}


/* Authenticated app canvas: reuse the established Login identity without altering content geometry. */
body.authenticated-page {
  min-height: 100dvh;
  background: var(--theme-auth-canvas);
  background-attachment: fixed;
}

.authenticated-page > .site-header {
  border-bottom-color: var(--theme-shell-border);
  background: var(--theme-shell-background);
  box-shadow: var(--theme-shell-shadow);
  backdrop-filter: blur(12px);
}

.authenticated-page main {
  color: var(--theme-main-text);
}

.authenticated-page .primary-navigation a,
.authenticated-page .header-auth-action button {
  color: var(--theme-shell-text);
}

.authenticated-page .primary-navigation a:hover,
.authenticated-page .primary-navigation a:focus-visible,
.authenticated-page .header-auth-action button:hover,
.authenticated-page .header-auth-action button:focus-visible {
  background: var(--theme-shell-hover);
  color: var(--theme-outer-strong);
}

.authenticated-page .primary-navigation a.is-active {
  background: #087f8c;
  color: #ffffff;
}

.authenticated-page .header-language-control {
  color: var(--theme-shell-border);
}

.authenticated-page .header-language-control a,
.authenticated-page .header-username {
  color: var(--theme-shell-muted);
}

.authenticated-page .header-language-control a:hover,
.authenticated-page .header-language-control a:focus-visible,
.authenticated-page .header-language-control a.is-active {
  color: var(--theme-outer-strong);
}

.authenticated-page .authenticated-surface,
.authenticated-page .panel,
.authenticated-page .report-tab-panel,
.authenticated-page .live-fleet-table-wrap,
.authenticated-page .live-fleet-map-panel,
.authenticated-page .live-fleet-view-control {
  color: var(--text);
}

/* Large content surfaces stay light, but avoid stark white against the dark canvas. */
.authenticated-page .authenticated-surface,
.authenticated-page .panel,
.authenticated-page .report-tab-panel,
.authenticated-page .live-fleet-map-panel {
  border-color: var(--theme-content-border);
  background: var(--theme-content-surface);
}

.authenticated-page .report-tab.is-active,
.authenticated-page .report-tab[aria-selected="true"] {
  border-bottom-color: var(--theme-content-surface);
}

.authenticated-page .page-heading .eyebrow {
  color: var(--theme-eyebrow);
}

.authenticated-page .route-map-section > h2,
.authenticated-page .report-table-section > h2 {
  color: var(--theme-main-text);
}

.authenticated-page .map-description,
.authenticated-page .map-cluster-note,
.authenticated-page .map-location-note,
.authenticated-page .map-privacy-note,
.authenticated-page .live-fleet-visible-count {
  color: var(--theme-outer-muted);
}

.authenticated-page .live-fleet-visible-count {
  border-left-color: var(--theme-tab-border);
}

.authenticated-page .live-fleet-visible-count strong {
  color: var(--theme-outer-strong);
}

.authenticated-page .report-tabs {
  border-bottom-color: var(--theme-tab-border);
}

.authenticated-page .report-tab:not(.is-active):not([aria-selected="true"]) {
  border-bottom-color: var(--theme-tab-border);
  color: var(--theme-outer-muted);
}

.authenticated-page .report-tab:not(.is-active):not([aria-selected="true"]):hover {
  border-color: var(--theme-tab-border);
  background: var(--theme-shell-hover);
  color: var(--theme-outer-strong);
}

button.theme-toggle {
  display: inline-flex;
  width: auto;
  min-height: 2.25rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  border: 1px solid var(--theme-header-toggle-border);
  border-radius: var(--radius-control);
  background: var(--theme-header-toggle-background);
  box-shadow: none;
  color: var(--theme-header-toggle-text);
  padding: 0.32rem 0.55rem;
  font-size: 0.76rem;
  font-weight: 750;
  line-height: 1;
  white-space: nowrap;
}

button.theme-toggle:hover {
  border-color: var(--theme-header-toggle-border);
  background: var(--theme-header-toggle-hover);
  color: var(--theme-outer-strong);
}

button.theme-toggle:focus-visible {
  outline: 3px solid rgb(8 127 140 / 38%);
  outline-offset: 2px;
}

[data-theme-toggle-icon] {
  display: inline-grid;
  width: 1rem;
  place-items: center;
  font-size: 0.9rem;
}

button.login-theme-toggle {
  margin-right: auto;
  border-color: #a8b4c3;
  background: #f5f8fb;
  color: #23415f;
}

button.login-theme-toggle:hover {
  border-color: #8fa1ad;
  background: #eaf4f4;
  color: #123557;
}

@media (max-width: 600px) {
  .header-theme-toggle {
    order: 2;
  }
}

body.login-page { min-height: 100dvh; margin: 0; color: #172033; background: var(--theme-login-canvas); }
.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 2rem 1rem; }
.login-panel { width: min(100%, 27rem); box-sizing: border-box; padding: clamp(1.5rem, 5vw, 2.5rem); border: 1px solid var(--theme-login-panel-border); border-radius: 1rem; background: var(--theme-login-panel); box-shadow: var(--theme-login-panel-shadow); }
.login-brand, .login-language, .login-password-field { display: flex; align-items: center; }
.login-brand { gap: 0.75rem; color: #123557; font-weight: 750; }
.login-brand p { margin: 0; }
.login-brand-subtitle { color: #617084; font-size: 0.82rem; font-weight: 500; }
.login-brand-mark { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 0.7rem; color: white; background: #087f8c; }
.login-language { justify-content: flex-end; gap: 0.45rem; min-height: 2rem; font-size: 0.875rem; }
.login-language a[aria-current="true"] { color: #172033; font-weight: 700; text-decoration: none; }
.login-heading { margin: 1.25rem 0 1.5rem; }
.login-heading h1 { margin: 0 0 0.35rem; color: #102d4f; font-size: clamp(1.65rem, 5vw, 2rem); }
.login-heading p { margin: 0; color: #526174; }
.login-form { display: grid; gap: 1rem; }
.login-form .field { display: grid; gap: 0.4rem; color: #26364a; font-weight: 650; }
.login-form input { min-width: 0; width: 100%; min-height: 2.8rem; box-sizing: border-box; padding: 0.65rem 0.75rem; border: 1px solid #a8b4c3; border-radius: 0.55rem; color: #172033; background: white; font: inherit; }
.login-form input:focus-visible, .login-password-toggle:focus-visible, .login-submit:focus-visible { outline: 3px solid rgb(8 127 140 / 30%); outline-offset: 2px; }
.login-password-field { gap: 0.45rem; }
.login-password-toggle { min-height: 2.8rem; padding: 0.5rem 0.7rem; border: 1px solid #a8b4c3; border-radius: 0.55rem; color: #23415f; background: #f5f8fb; font: inherit; font-weight: 650; cursor: pointer; }
.login-submit { min-height: 2.9rem; margin-top: 0.25rem; border: 0; border-radius: 0.55rem; color: white; background: #087f8c; font: inherit; font-weight: 750; cursor: pointer; }
.login-submit:hover { background: #066c77; }
.login-submit:disabled { cursor: wait; opacity: 0.72; }
.login-error { margin: 0 0 1rem; padding: 0.75rem 0.9rem; border-left: 0.3rem solid #b42318; border-radius: 0.4rem; color: #7a271a; background: #fef3f2; }
