:root {
  color-scheme: light;
  --ink: #22312b;
  --muted: #647269;
  --line: #d9ded8;
  --paper: #f3efe7;
  --panel: rgba(255, 253, 249, 0.94);
  --green: #3f5e4b;
  --green-dark: #2a4336;
  --gold: #d1ad68;
  --terra: #c86d43;
  --teal: #65b8bb;
  --sage: #94ac90;
  --red: #b92b27;
  --blue: #2e6d6f;
  --shadow: 0 18px 48px rgba(34, 49, 43, 0.14);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}

.map-shell {
  position: relative;
  min-height: 100vh;
}

#map {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, #f7f4ed 0%, var(--paper) 48%, #ebe7dd 100%);
  cursor: grab;
  touch-action: none;
}

#map.map-style-domaine {
  background:
    radial-gradient(circle at 48% 43%, rgba(209, 173, 104, 0.12), transparent 36%),
    linear-gradient(180deg, #f8f4eb 0%, #f1ede2 56%, #ebe4d6 100%);
}

#map::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    repeating-linear-gradient(24deg, rgba(63, 94, 75, 0.08) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(112deg, rgba(209, 173, 104, 0.08) 0 1px, transparent 1px 46px);
  opacity: 0.42;
  pointer-events: none;
}

#map::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  pointer-events: none;
}

#map.map-style-domaine::before {
  background:
    repeating-linear-gradient(0deg, rgba(63, 94, 75, 0.035) 0 1px, transparent 1px 84px),
    repeating-linear-gradient(90deg, rgba(63, 94, 75, 0.03) 0 1px, transparent 1px 84px);
  opacity: 0.52;
}

#map.map-style-nature {
  background:
    linear-gradient(180deg, #edf2e6 0%, #f4f0e4 48%, #e5ecdd 100%);
}

#map.map-style-nature::before {
  background:
    repeating-linear-gradient(0deg, rgba(63, 94, 75, 0.06) 0 1px, transparent 1px 58px),
    repeating-linear-gradient(90deg, rgba(63, 94, 75, 0.045) 0 1px, transparent 1px 58px);
  opacity: 0.48;
}

#map.map-style-nature::after {
  background: linear-gradient(180deg, rgba(63, 94, 75, 0.05), rgba(255, 253, 249, 0.06));
  opacity: 0.36;
}

#map.map-style-plan {
  background:
    linear-gradient(90deg, rgba(63, 94, 75, 0.045) 0 1px, transparent 1px 96px),
    linear-gradient(0deg, rgba(63, 94, 75, 0.04) 0 1px, transparent 1px 96px),
    linear-gradient(180deg, #f5f2ea 0%, #edf2e8 58%, #e6ecdf 100%);
}

#map.map-style-plan::before {
  background:
    repeating-linear-gradient(35deg, rgba(34, 49, 43, 0.035) 0 1px, transparent 1px 42px);
  opacity: 0.5;
}

#map.is-dragging {
  cursor: grabbing;
}

.tile-layer,
.map-tile,
.domain-overlay,
.route-overlay,
.accuracy-circle,
.client-accuracy-circle,
.shuttle-position,
.client-position {
  position: absolute;
}

.tile-layer {
  inset: 0;
  z-index: 0;
  opacity: 0;
}

#map.map-style-plan .tile-layer {
  opacity: 0;
}

.map-tile {
  width: 256px;
  height: 256px;
  border: 0;
  user-select: none;
  -webkit-user-drag: none;
}

.domain-overlay {
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: auto;
}

.domain-feature {
  cursor: pointer;
  pointer-events: visiblePainted;
}

.domain-chemins {
  fill: none;
  stroke: #9a9386;
  stroke-width: 2.2;
  stroke-opacity: 0.92;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.domain-chemins.domain-route-route {
  stroke: #d3a63d;
  stroke-width: 5;
}

.domain-chemins.domain-priority-crazy-park {
  stroke: #c79d38;
  stroke-width: 5.4;
}

.domain-chemins.domain-route-chemin {
  stroke: #7e7466;
  stroke-width: 2.25;
}

.domain-chemins.domain-route-piste {
  stroke: #9a6a45;
  stroke-width: 2.35;
  stroke-opacity: 0.96;
  stroke-dasharray: 8 5;
}

.domain-chemins.domain-route-sentier {
  stroke: #3f7a50;
  stroke-width: 2.15;
  stroke-opacity: 0.98;
  stroke-dasharray: 1.4 5;
}

.domain-chemins.domain-route-parking {
  stroke: #6f8f92;
  stroke-width: 2.1;
  stroke-dasharray: 2 3.2;
  stroke-opacity: 0.86;
}

.domain-chemins.domain-route-casing {
  stroke: rgba(255, 253, 249, 0.92);
  stroke-width: 8.8;
  stroke-opacity: 0.96;
  stroke-dasharray: none;
}

.domain-chemins.domain-route-casing.domain-route-chemin {
  stroke-width: 4.4;
}

.domain-chemins.domain-route-casing.domain-priority-crazy-park {
  stroke-width: 8.2;
}

.domain-chemins.domain-route-casing.domain-route-piste,
.domain-chemins.domain-route-casing.domain-route-sentier,
.domain-chemins.domain-route-casing.domain-route-parking {
  stroke: rgba(255, 253, 249, 0.82);
  stroke-width: 3.8;
}

.domain-chemins.domain-route-casing.domain-route-piste {
  stroke-dasharray: 8 5;
}

.domain-chemins.domain-route-casing.domain-route-sentier {
  stroke-dasharray: 1.4 5;
}

#map.map-style-domaine .domain-chemins {
  stroke-opacity: 0.62;
}

#map.map-style-domaine .domain-chemins.domain-route-route {
  stroke: #c9a85e;
  stroke-width: 3.6;
}

#map.map-style-domaine .domain-chemins.domain-route-sentier,
#map.map-style-domaine .domain-chemins.domain-route-piste {
  stroke-opacity: 0.9;
}

#map.map-style-domaine .domain-chemins.domain-route-parking {
  stroke: #7f9d9a;
  stroke-opacity: 0.58;
}

#map.map-style-nature .domain-chemins.domain-route-route {
  stroke: #b9904e;
  stroke-width: 3.7;
}

#map.map-style-nature .domain-chemins.domain-route-chemin {
  stroke: #7d876f;
}

#map.map-style-nature .domain-chemins.domain-route-piste,
#map.map-style-nature .domain-chemins.domain-route-sentier {
  stroke: #4f7a55;
  stroke-width: 2.4;
}

#map.map-style-nature .domain-chemins.domain-route-parking {
  stroke: #548484;
  stroke-width: 2.2;
}

#map.map-style-plan .domain-chemins.domain-route-route {
  stroke: #dfbd69;
  stroke-width: 5.2;
}

#map.map-style-plan .domain-chemins.domain-route-chemin {
  stroke: #786f63;
  stroke-width: 2.35;
}

#map.map-style-plan .domain-chemins.domain-route-parking {
  stroke: #4d8184;
  stroke-width: 2.3;
}

.domain-rivieres {
  fill: none;
  stroke: var(--teal);
  stroke-width: 2.2;
  stroke-opacity: 0.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.domain-batiments {
  fill: #73847c;
  fill-opacity: 0.82;
  stroke: #405148;
  stroke-width: 0.95;
  stroke-linejoin: round;
  filter: drop-shadow(2px 3px 0 rgba(34, 49, 43, 0.18));
  vector-effect: non-scaling-stroke;
}

#map.map-style-domaine .domain-batiments {
  fill: #8a8f82;
  fill-opacity: 0.72;
  stroke: #fffdf9;
  filter: drop-shadow(1px 2px 0 rgba(34, 49, 43, 0.12));
}

#map.map-style-nature .domain-batiments {
  fill: #65786f;
  fill-opacity: 0.9;
  stroke: #314039;
  filter: drop-shadow(3px 5px 0 rgba(34, 49, 43, 0.24));
}

#map.map-style-plan .domain-batiments {
  fill: #76847d;
  fill-opacity: 0.86;
  stroke: #fffdf9;
  filter: drop-shadow(2px 3px 0 rgba(34, 49, 43, 0.16));
}

.domain-mobilhomes {
  fill: #ffd666;
  fill-opacity: 0.58;
  stroke: #8b5f00;
  stroke-width: 1.25;
  stroke-linejoin: round;
  filter: drop-shadow(1px 2px 0 rgba(34, 49, 43, 0.18));
  vector-effect: non-scaling-stroke;
}

.domain-zones-habitees {
  fill: #ffd666;
  fill-opacity: 0.22;
  stroke: #8b5f00;
  stroke-width: 1.35;
  stroke-dasharray: 5 4;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

#map.map-style-plan .domain-zones-habitees {
  fill-opacity: 0.28;
  stroke: #704b00;
}

.domain-piscines {
  fill: var(--teal);
  fill-opacity: 0.82;
  stroke: #2e6d6f;
  stroke-width: 1.15;
  vector-effect: non-scaling-stroke;
}

.domain-loisirs {
  fill: rgba(200, 109, 67, 0.24);
  stroke: var(--terra);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.domain-loisirs.domain-priority-tennis,
.domain-sports-extra.domain-priority-padel {
  fill: rgba(200, 109, 67, 0.34);
  stroke: #a94f2e;
  stroke-width: 2.4;
}

.domain-loisirs.domain-priority-pump-track {
  fill: rgba(154, 106, 69, 0.18);
  stroke: #7b5b3f;
  stroke-width: 2.1;
  stroke-dasharray: 3.5 2.5;
}

.domain-poi {
  fill: var(--gold);
  stroke: #fffdf9;
  stroke-width: 2.4;
  filter: drop-shadow(0 2px 5px rgba(34, 49, 43, 0.24));
  vector-effect: non-scaling-stroke;
}

.domain-poi.domain-priority-padel,
.domain-poi.domain-priority-cascade,
.domain-poi.domain-priority-bas-rocher {
  fill: #f0c45f;
  stroke: #fffdf9;
  stroke-width: 3.2;
  filter: drop-shadow(0 4px 9px rgba(34, 49, 43, 0.3));
}

.domain-arrets {
  fill: var(--green);
  stroke: #fffdf9;
  stroke-width: 3;
  filter: drop-shadow(0 3px 7px rgba(63, 94, 75, 0.28));
  vector-effect: non-scaling-stroke;
}

.domain-arrets-marker {
  pointer-events: visiblePainted;
  filter: drop-shadow(0 3px 7px rgba(63, 94, 75, 0.3));
}

.domain-arrets-body {
  fill: var(--green);
  stroke: #fffdf9;
  stroke-width: 2;
}

.domain-arrets-window {
  fill: #fffdf9;
  stroke: none;
}

.domain-arrets-wheel {
  fill: #15201d;
  stroke: #fffdf9;
  stroke-width: 0.8;
}

.domain-sports-extra {
  fill: rgba(200, 109, 67, 0.76);
  stroke: #fffdf9;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(148, 74, 40, 0.22));
  vector-effect: non-scaling-stroke;
}

.domain-line-feature.domain-sports-extra {
  fill: none;
  stroke: rgba(154, 106, 69, 0.82);
  stroke-width: 2.3;
  stroke-dasharray: 6 4;
  filter: none;
}

.domain-services {
  fill: #fffdf9;
  stroke: var(--teal);
  stroke-width: 2.8;
  filter: drop-shadow(0 2px 6px rgba(46, 109, 111, 0.24));
  vector-effect: non-scaling-stroke;
}

.domain-parking-marker {
  cursor: pointer;
  pointer-events: visiblePainted;
  filter: drop-shadow(0 2px 5px rgba(34, 49, 43, 0.28));
}

.domain-parking-marker-bg {
  fill: #2f70b7;
  stroke: #fffdf9;
  stroke-width: 1.8;
}

.domain-parking-marker-letter {
  fill: #fffdf9;
  font-size: 11px;
  font-weight: 950;
  pointer-events: none;
  user-select: none;
}

.domain-poi.domain-category-accueil {
  fill: var(--gold);
}

.domain-poi.domain-category-commerces {
  fill: #f0bf6a;
  stroke: #fffdf9;
}

.domain-poi.domain-category-restauration {
  fill: var(--terra);
}

.domain-poi.domain-category-sports,
.domain-sports-extra.domain-category-sports {
  fill: rgba(200, 109, 67, 0.82);
}

.domain-line-feature.domain-sports-extra.domain-category-sports {
  fill: none;
}

.domain-poi.domain-category-decouverte {
  fill: var(--sage);
}

.domain-poi.domain-category-services,
.domain-services.domain-category-services {
  stroke: var(--teal);
}

.domain-piscines.domain-category-aquatique {
  fill: var(--teal);
}

.map-label-layer {
  pointer-events: none;
}

.map-label-path {
  fill: none;
  stroke: none;
  pointer-events: none;
}

.map-label {
  paint-order: stroke;
  stroke: rgba(255, 253, 249, 0.95);
  stroke-width: 4px;
  stroke-linejoin: round;
  fill: #314039;
  font-size: 12px;
  font-weight: 850;
  text-anchor: middle;
  dominant-baseline: central;
  vector-effect: non-scaling-stroke;
  user-select: none;
}

.map-label-route {
  fill: #5d5143;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0;
}

.map-label-route-sentier,
.map-label-route-piste {
  fill: #52684c;
  font-size: 10.5px;
  font-style: italic;
}

.map-label-parking {
  fill: #22666a;
  font-size: 12px;
  font-weight: 950;
}

.map-label-point {
  fill: var(--green-dark);
  font-size: 11.5px;
}

.map-label-priority {
  fill: #263b31;
  font-size: 12.5px;
  font-weight: 950;
}

.map-label-restauration,
.map-label-commerces,
.map-label-sports {
  fill: #6f3b25;
}

.map-label-services,
.map-label-aquatique {
  fill: #255f61;
}

.route-overlay {
  inset: 0;
  z-index: 4;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.route-overlay line {
  stroke: rgba(21, 32, 29, 0.62);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 9 9;
}

.internal-route-casing,
.internal-route-path {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.internal-route-casing {
  stroke: rgba(255, 253, 249, 0.92);
  stroke-width: 10;
}

.internal-route-path {
  stroke: #cf5830;
  stroke-width: 5;
  stroke-dasharray: 12 8;
}

.accuracy-circle {
  z-index: 5;
  border: 2px solid rgba(34, 92, 143, 0.5);
  border-radius: 999px;
  background: rgba(34, 92, 143, 0.13);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.client-accuracy-circle {
  z-index: 5;
  border: 2px solid rgba(31, 138, 91, 0.46);
  border-radius: 999px;
  background: rgba(31, 138, 91, 0.12);
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.shuttle-position,
.client-position {
  z-index: 6;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.client-position {
  width: 48px;
  height: 48px;
  border: 3px solid #fff;
  border-radius: 999px;
  box-shadow: 0 8px 16px rgba(21, 32, 29, 0.26);
}

.shuttle-position {
  display: grid;
  place-items: center;
  width: 72px;
  height: 56px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.shuttle-logo {
  display: block;
  width: 72px;
  height: 56px;
  overflow: visible;
  filter: drop-shadow(0 8px 12px rgba(34, 49, 43, 0.26));
}

.shuttle-logo-shadow,
.shuttle-logo-shell,
.shuttle-logo-front,
.shuttle-logo-window,
.shuttle-logo-line,
.shuttle-logo-spark {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shuttle-logo-shadow {
  stroke: rgba(34, 49, 43, 0.22);
  stroke-width: 5;
}

.shuttle-logo-shell {
  fill: rgba(255, 253, 249, 0.98);
  stroke: var(--green-dark);
  stroke-width: 3.2;
}

.shuttle-logo-front {
  fill: rgba(46, 109, 111, 0.13);
  stroke: var(--teal);
  stroke-width: 3.2;
}

.shuttle-logo-window {
  stroke: var(--green-dark);
  stroke-width: 4;
}

.shuttle-logo-line,
.shuttle-logo-spark {
  stroke: var(--gold);
}

.shuttle-logo-line {
  stroke-width: 3.2;
}

.shuttle-logo-spark {
  stroke-width: 3;
}

.shuttle-logo-wheel {
  fill: var(--ink);
  stroke: #fffdf9;
  stroke-width: 2.6;
}

.client-position {
  border-color: #fff;
  background:
    radial-gradient(circle at center, #fff 0 5px, transparent 6px),
    radial-gradient(circle at center, #1f8a5b 0 12px, transparent 13px),
    radial-gradient(circle at center, #fff 0 18px, transparent 19px),
    var(--green);
}

.client-position::before,
.client-position::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.client-position::before {
  width: 3px;
  height: 34px;
}

.client-position::after {
  width: 34px;
  height: 3px;
}

.map-controls {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 520;
  display: grid;
  gap: 8px;
}

.layer-controls {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 510;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(720px, calc(100vw - 520px));
  gap: 6px;
  padding: 8px;
  overflow-x: auto;
  background: rgba(255, 253, 249, 0.9);
  border: 1px solid rgba(34, 49, 43, 0.08);
  border-radius: 8px;
  box-shadow: 0 14px 34px rgba(34, 49, 43, 0.12);
  backdrop-filter: blur(14px);
  transform: translateX(-50%);
  scrollbar-width: none;
}

.layer-controls::-webkit-scrollbar {
  display: none;
}

.map-control-button,
.panel-toggle,
.layer-toggle {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.96);
  box-shadow: 0 10px 24px rgba(34, 49, 43, 0.13);
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.layer-toggle {
  min-width: max-content;
  min-height: 32px;
  padding: 0 10px;
  color: var(--green-dark);
  background: rgba(255, 253, 249, 0.88);
  border-color: rgba(34, 49, 43, 0.08);
  box-shadow: none;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0;
}

.layer-toggle.is-active {
  color: #fff;
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.layer-toggle[data-layer-category="accueil"].is-active,
.layer-toggle[data-layer-category="decouverte"].is-active {
  color: #3d2f18;
  background: rgba(209, 173, 104, 0.36);
  border-color: rgba(209, 173, 104, 0.54);
}

.layer-toggle[data-layer-category="navette"].is-active {
  background: var(--green);
  border-color: var(--green);
}

.layer-toggle[data-layer-category="sports"].is-active,
.layer-toggle[data-layer-category="commerces"].is-active {
  background: var(--terra);
  border-color: var(--terra);
}

.layer-toggle[data-layer-category="services"].is-active {
  background: var(--teal);
  border-color: var(--teal);
}

.layer-toggle[data-layer-category="aquatique"].is-active {
  background: #2e6d6f;
  border-color: #2e6d6f;
}

.map-control-button {
  width: 46px;
  height: 46px;
  font-size: 1.45rem;
}

.panel {
  position: absolute;
  z-index: 500;
  display: grid;
  gap: 16px;
  width: min(380px, calc(100vw - 32px));
  padding: 18px;
  background: var(--panel);
  border: 1px solid rgba(34, 49, 43, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel-visitor {
  top: 16px;
  left: 16px;
}

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

.panel-toggle {
  min-width: 78px;
  min-height: 34px;
  padding: 0 10px;
  font-size: 0.78rem;
}

.panel-body {
  display: grid;
  gap: 16px;
}

.panel--compact {
  gap: 10px;
  width: min(270px, calc(100vw - 32px));
  padding: 12px;
}

.panel--compact .panel-body,
.panel--compact .eyebrow {
  display: none;
}

.panel--compact h1 {
  font-size: 1.12rem;
}

.panel--compact .status-row {
  min-height: 20px;
  font-size: 0.86rem;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.1;
}

.status-row,
.driver-status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
  color: var(--muted);
  font-weight: 700;
}

.driver-mode {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.status-dot {
  width: 12px;
  height: 12px;
  flex: 0 0 12px;
  border-radius: 999px;
  background: #9aa7a1;
  box-shadow: 0 0 0 4px rgba(154, 167, 161, 0.18);
}

.status-dot--online {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(31, 138, 91, 0.18);
}

.status-dot--warning {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(179, 107, 0, 0.18);
}

.status-dot--offline {
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(187, 52, 47, 0.18);
}

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

.metrics div {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(34, 49, 43, 0.08);
  border-radius: 8px;
  background: rgba(255, 253, 249, 0.78);
}

.metrics dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.metrics dd {
  margin: 3px 0 0;
  min-height: 22px;
  overflow-wrap: anywhere;
  font-size: 0.95rem;
  font-weight: 800;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

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

.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  pointer-events: none;
}

.button-primary {
  color: #fff;
  background: var(--green);
}

.button-primary:hover:not(:disabled) {
  background: var(--green-dark);
}

.button-secondary {
  color: var(--ink);
  background: #fffdf9;
  border-color: rgba(34, 49, 43, 0.1);
}

.button-secondary:hover:not(:disabled) {
  background: rgba(148, 172, 144, 0.16);
}

.button-route {
  color: #fff;
  background: var(--teal);
  text-decoration: none;
}

.button-route:hover {
  background: #2e6d6f;
}

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

.action-wide {
  grid-column: span 2;
}

.client-status {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.feature-panel {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 540;
  display: grid;
  gap: 12px;
  width: min(390px, calc(100vw - 32px));
  padding: 18px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.96);
  border: 1px solid rgba(34, 49, 43, 0.1);
  border-radius: 8px;
  box-shadow: 0 24px 54px rgba(34, 49, 43, 0.18);
  backdrop-filter: blur(16px);
}

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

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

.feature-tag {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 11px;
  border-radius: 999px;
  color: #fff;
  background: var(--green);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.feature-panel h2 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.1;
}

.feature-text {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}

.feature-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.feature-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(148, 172, 144, 0.18);
  font-size: 0.72rem;
  font-weight: 800;
}

.feature-close {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(34, 49, 43, 0.08);
  border-radius: 999px;
  color: var(--green-dark);
  background: rgba(255, 253, 249, 0.96);
  font: inherit;
  font-size: 1.2rem;
  font-weight: 900;
  cursor: pointer;
}

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

.feature-action-wide {
  grid-column: 1 / -1;
}

.feature-route-status {
  margin: -2px 0 0;
  color: var(--green-dark);
  font-size: 0.82rem;
  font-weight: 850;
  line-height: 1.35;
}

.feature-route-status.is-error {
  color: #9b3f27;
}

.driver-page {
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    linear-gradient(rgba(251, 252, 251, 0.88), rgba(251, 252, 251, 0.88)),
    url("https://tile.openstreetmap.org/13/4200/2943.png");
  background-size: 256px 256px;
}

.driver-shell {
  width: min(520px, 100%);
}

.driver-card {
  display: grid;
  gap: 18px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.driver-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

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

.token-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.token-field input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
}

@media (max-width: 900px) {
  .panel-visitor {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  .map-controls {
    top: 12px;
    right: 12px;
  }

  .layer-controls {
    top: 12px;
    right: 68px;
    left: 12px;
    justify-content: flex-start;
    max-width: none;
    max-height: 86px;
    padding: 7px;
    overflow-y: auto;
    transform: none;
  }

  .layer-toggle {
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.68rem;
  }

  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }

  .panel {
    gap: 12px;
    padding: 14px;
  }

  .button {
    min-height: 42px;
    padding: 0 8px;
    font-size: 0.78rem;
  }

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

  h1 {
    font-size: 1.45rem;
  }

  .panel--compact {
    right: 12px;
    bottom: 12px;
    left: auto;
    width: min(230px, calc(100vw - 24px));
  }

  .feature-panel {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
    max-height: min(48vh, 360px);
    overflow-y: auto;
  }

  .panel-visitor.is-feature-open {
    display: none;
  }

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

@media (max-width: 430px) {
  .layer-controls {
    right: 64px;
    gap: 5px;
    max-height: 72px;
    padding: 6px;
  }

  .layer-toggle {
    min-height: 28px;
    padding: 0 7px;
    font-size: 0.62rem;
  }

  .map-control-button {
    width: 44px;
    height: 44px;
  }
}
