: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: #fff1ed;
  --alert-border: #b83b20;
  --shadow: 0 12px 30px rgba(22, 36, 44, 0.08);
}

* {
  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;
}

.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;
}

.brand {
  color: var(--text);
  font-size: 1.2rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  text-decoration: none;
}

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

.primary-navigation a {
  border-radius: 0.45rem;
  color: var(--text-muted);
  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(--accent-dark);
}

.primary-navigation a.is-active {
  background: #dceeed;
  color: var(--accent-dark);
}

.header-language-control {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 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(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}

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);
  padding: 1rem 1.2rem;
}

.report-form,
.panel {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface);
}

.report-form {
  width: min(100%, 920px);
  margin-inline: auto;
  box-shadow: 0 4px 14px rgba(22, 36, 44, 0.05);
  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;
  gap: 0.12rem;
  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 #aebcc4;
  border-radius: 0.4rem;
  background: #ffffff;
  color: var(--text);
  font: inherit;
  padding: 0.65rem 0.75rem;
}

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: 0.4rem;
  font-weight: 750;
  text-decoration: none;
}

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

button {
  cursor: pointer;
  font: inherit;
}

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

.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 #7f9ba5;
  background: #ffffff;
  color: var(--accent-dark);
  padding: 0.65rem 1rem;
}

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

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

.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%;
  border: 1px solid #d6e0e6;
  border-radius: 0.55rem;
  background: #ffffff;
  padding: 0.75rem 0.8rem 0.85rem;
  box-shadow: none;
  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-border);
}

.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(32rem, 68vh, 40.625rem);
  margin-inline: auto;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--surface-muted);
  box-shadow: var(--shadow);
}

.map-point-navigator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  border: 1px solid #cbd8df;
  border-radius: 0.65rem;
  background: #f8fbfc;
  padding: 0.65rem;
}

.map-point-navigator[hidden] {
  display: none;
}

.map-point-navigator output {
  flex: 1 1 auto;
  min-width: 9rem;
  color: #263746;
  font-size: 0.9rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.map-point-navigator button {
  min-width: 8.5rem;
  min-height: 2.4rem;
  border-color: #9cb8c1;
  background: #ffffff;
  color: #1d4f5a;
  padding: 0.45rem 0.85rem;
}

.map-point-navigator button:disabled {
  cursor: not-allowed;
  border-color: #d8e1e5;
  background: #f1f4f5;
  color: #819099;
  opacity: 1;
}

.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: 2px solid #263746;
  border-radius: 50%;
  background: #ffffff;
  color: #263746;
  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: #006b68;
  color: #ffffff;
  box-shadow:
    0 0 0 3px #263746,
    0 3px 9px rgba(22, 36, 44, 0.38);
}

.marker-cluster div {
  font-weight: 800;
  text-align: center;
}

.marker-cluster {
  filter: drop-shadow(0 2px 3px rgba(22, 36, 44, 0.22));
}

.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;
}

.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;
}

.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.55rem 0.75rem 0.6rem;
  line-height: 1.2;
}

.report-point-popup .leaflet-popup-close-button {
  width: 28px;
  height: 28px;
  line-height: 28px;
}

.report-map-popup--compact {
  width: 280px;
  max-width: calc(100vw - 64px);
  gap: 0.18rem;
}

.report-map-popup--compact .report-map-popup-title {
  padding-bottom: 0.1rem;
  font-size: 0.92rem;
}

.report-map-popup--compact p {
  grid-template-columns: 5.5rem minmax(0, 1fr);
  gap: 0.3rem;
  line-height: 1.25;
}

.report-map-popup--compact p > span {
  overflow-wrap: anywhere;
}

.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-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(26rem, 58vh, 34rem);
  }
}

@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(20rem, 48vh, 28rem);
  }

  .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(24rem, 58vh, 31.25rem);
  }

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

}

@media (max-width: 600px) {
  .page-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;
  }

  .brand {
    margin-right: auto;
  }

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

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

  .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-point-navigator {
    gap: 0.4rem;
    padding: 0.5rem;
  }

  .map-point-navigator output {
    min-width: 0;
  }

  .map-point-navigator button {
    min-width: 0;
    width: auto;
    padding-inline: 0.55rem;
  }
}


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

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

.header-auth-action button:hover,
.header-auth-action button:focus-visible {
  background: var(--surface-muted);
  color: var(--accent-dark);
}
.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-fleet-map-panel {
  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: 29px;
  height: 29px;
  border-width: 2px;
  outline-width: 3px;
  box-shadow: 0 2px 5px rgb(10 25 35 / 48%);
}

.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 {
  min-height: 2.75rem;
  border-color: #9cb0b9;
  border-radius: 0.55rem;
  background: #ffffff;
  color: #263746;
  padding: 0.35rem 0.65rem;
  font-size: 0.82rem;
  line-height: 1.2;
}

.live-fleet-filters button:hover {
  border-color: var(--accent);
  background: #eaf4f4;
  color: var(--accent-dark);
}

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

.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: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-weight: 780;
}

.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-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-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-map-focus-enter {
  display: inline-flex;
  width: auto;
  min-height: 2rem;
  align-items: center;
  justify-content: center;
  gap: 0.32rem;
  border-color: #b4c1c7;
  background: #f5f7f8;
  box-shadow: none;
  color: #35515d;
  padding: 0.28rem 0.58rem;
  font-size: 0.76rem;
  font-weight: 680;
}

#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 {
  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; top: 0.75rem; right: 0.75rem; display: flex; gap: 0.4rem; }

.live-map-focus-controls button,
.live-map-roster 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__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: 0.62rem minmax(0, 1fr) auto; align-items: center; gap: 0.42rem; border: 1px solid transparent; border-radius: 0.45rem; background: transparent; 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: rgb(255 255 255 / 10%); }
.live-map-roster__row--selected { border-color: #7dd3fc; background: rgb(14 116 144 / 45%); box-shadow: inset 0.2rem 0 0 #7dd3fc; }
.live-map-roster__status { width: 0.55rem; height: 0.55rem; border: 1px solid rgb(255 255 255 / 75%); border-radius: 50%; background: #59656c; }
.live-map-roster__row--normal .live-map-roster__status { background: #39a963; }
.live-map-roster__row--attention .live-map-roster__status { background: #e69a33; }
.live-map-roster__row--action_required .live-map-roster__status { background: #dc555b; }
.live-map-roster__registration { overflow: hidden; font-size: 0.76rem; font-weight: 720; 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 { top: 0.5rem; right: 0.5rem; }
  .live-map-focus-controls button { min-height: 2.25rem; padding: 0.35rem 0.5rem; font-size: 0.72rem; }
  .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;
}


body.login-page { min-height: 100dvh; margin: 0; color: #172033; background: radial-gradient(circle at 15% 15%, rgb(32 178 170 / 22%), transparent 28rem), linear-gradient(145deg, #07172b 0%, #102d4f 62%, #17405f 100%); }
.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 rgb(255 255 255 / 65%); border-radius: 1rem; background: rgb(255 255 255 / 97%); box-shadow: 0 1.5rem 4rem rgb(0 0 0 / 30%); }
.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; }


/* Route report result: clearer hierarchy around the existing map and tables. */
.result-heading {
  align-items: flex-end;
  margin-bottom: 1.35rem;
}

.result-heading-copy {
  min-width: 0;
}

.result-heading .result-heading-copy h1 {
  max-width: none;
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  letter-spacing: -0.035em;
}

.result-report-identity {
  display: flex;
  align-items: baseline;
  gap: 0.42rem;
  max-width: 70ch;
  margin: 0.55rem 0 0;
  color: var(--text-muted);
  font-size: 0.96rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.result-report-identity strong {
  color: var(--text);
  font-weight: 760;
}

.result-heading-actions .secondary-action {
  width: auto;
  min-height: 2.35rem;
  padding: 0.45rem 0.78rem;
  font-size: 0.84rem;
}

.report-kpis {
  margin-bottom: 0;
}

.report-kpi-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.65rem;
}

.report-kpi-card {
  min-height: 6rem;
  border-radius: 0.65rem;
  padding: 0.75rem 0.8rem;
}

.report-kpi-card--locations {
  grid-column: 1 / -1;
  min-height: 0;
  grid-template-columns: minmax(10rem, 0.24fr) minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: center;
  gap: 1rem;
  background: #f8fafb;
  text-align: left;
}

.report-kpi-card--locations dt {
  text-align: left;
}

.report-kpi-card--locations dd {
  align-items: flex-start;
  gap: 0.15rem;
  padding-top: 0;
  text-align: left;
}

.report-kpi-location-name {
  width: 100%;
  font-size: 0.84rem;
  -webkit-line-clamp: 1;
  line-clamp: 1;
}

.report-kpi-location-more {
  display: inline-flex;
  border-radius: 999px;
  background: #e2ebef;
  color: var(--text-muted);
  padding: 0.08rem 0.42rem;
  font-size: 0.72rem;
  font-weight: 750;
}

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

.route-map-heading-row {
  display: flex;
  position: relative;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 0.8rem;
}

.route-map-heading-row h2 {
  margin-bottom: 0.25rem;
  font-size: 1.28rem;
}

.map-description {
  max-width: 62ch;
  margin: 0;
  font-size: 0.92rem;
}

.route-map-help {
  position: relative;
  flex: 0 0 auto;
}

.route-map-help summary {
  border-radius: 0.4rem;
  color: var(--accent-dark);
  padding: 0.28rem 0.45rem;
  font-size: 0.82rem;
  font-weight: 720;
  cursor: pointer;
}

.route-map-help[open] summary {
  background: #eaf4f4;
}

.route-map-help-content {
  position: absolute;
  z-index: 500;
  top: calc(100% + 0.35rem);
  right: 0;
  width: min(26rem, calc(100vw - 2rem));
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--surface);
  box-shadow: 0 0.65rem 1.6rem rgba(22, 36, 44, 0.16);
  padding: 0.8rem 0.9rem;
}

.route-map-help-content p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

.route-map-help-content p + p {
  margin-top: 0.55rem;
}

.route-map-loading-status {
  margin-bottom: 0.5rem;
}

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

#route-map {
  max-width: none;
  height: clamp(34rem, 70vh, 44rem);
  border-radius: 0.8rem;
  box-shadow: 0 0.7rem 1.8rem rgba(22, 36, 44, 0.11);
}

.map-point-navigator {
  display: grid;
  gap: 0;
  margin-top: 0.55rem;
  padding: 0;
  overflow: hidden;
  border-color: #b9cbd3;
  background: var(--surface);
  box-shadow: 0 0.25rem 0.8rem rgba(22, 36, 44, 0.06);
}

.map-point-navigator-primary {
  display: grid;
  grid-template-columns: minmax(7.5rem, auto) minmax(10rem, 1fr) minmax(7.5rem, auto);
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 0.65rem;
}

.map-point-navigator-secondary {
  display: flex;
  min-height: 2.65rem;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  border-top: 1px solid #dce5e9;
  background: #f8fafb;
  padding: 0.42rem 0.65rem;
}

.map-point-navigator output {
  min-width: 0;
}

.map-point-navigator-secondary output {
  flex: 1 1 auto;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  text-align: left;
}

.map-point-navigator-secondary output[hidden] {
  display: none;
}

.map-point-navigator button {
  display: inline-flex;
  width: auto;
  min-width: 7.5rem;
  min-height: 2.3rem;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  font-size: 0.82rem;
}

#map-point-next-location {
  margin-left: auto;
  border-color: transparent;
  background: transparent;
}

#map-point-next-location:hover,
#map-point-next-location:focus-visible {
  border-color: #9cb8c1;
  background: #ffffff;
}

.report-table-section {
  margin-top: 1.8rem;
}

.report-table-section > h2 {
  margin-bottom: 0.65rem;
}

.report-tabs {
  gap: 0.35rem;
  padding-left: 0;
}

.report-tab {
  min-height: 2.7rem;
  border-radius: 0.5rem 0.5rem 0 0;
  padding-inline: 1rem;
}

.report-tab.is-active,
.report-tab[aria-selected="true"] {
  border-top-color: var(--accent);
  border-top-width: 3px;
  color: var(--accent-dark);
  font-weight: 780;
}

.report-data-table tbody .report-data-row {
  transition: background-color 120ms ease, box-shadow 120ms ease;
}

.report-data-table tbody .report-data-row:hover {
  background: #eef6f6;
}

.report-data-table tbody .report-data-row.is-map-selected,
.report-data-table tbody .report-data-row.is-map-selected:nth-child(even) {
  background: #dceeed;
  box-shadow: inset 0.25rem 0 0 var(--accent);
}

.report-data-table tbody .report-data-row.is-map-selected th,
.report-data-table tbody .report-data-row.is-map-selected td {
  border-bottom-color: #b8d5d3;
}

@media (max-width: 900px) {
  .report-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-kpi-card--locations {
    grid-column: 1 / -1;
  }

  #route-map {
    height: clamp(28rem, 65vh, 36rem);
  }
}

@media (max-width: 600px) {
  .result-heading {
    gap: 0.85rem;
  }

  .result-report-identity {
    align-items: flex-start;
    flex-wrap: wrap;
    font-size: 0.88rem;
  }

  .result-heading-actions .secondary-action {
    flex: 1 1 8rem;
  }

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

  .report-kpi-card--locations {
    grid-column: auto;
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .route-map-heading-row {
    gap: 0.6rem;
  }

  .route-map-help-content {
    right: 0;
    width: min(22rem, calc(100vw - 1.25rem));
  }

  #route-map {
    height: clamp(24rem, 60vh, 31rem);
  }

  .map-point-navigator-primary {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.35rem;
    padding: 0.45rem;
  }

  .map-point-navigator button {
    min-width: 0;
    padding-inline: 0.5rem;
  }

  .map-point-navigator-primary button span[data-i18n-key] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .map-point-navigator-secondary {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }

  #map-point-next-location {
    align-self: flex-end;
  }
}
