/* GPS monitor — animacja z projektu aigps (mapa Leaflet + telemetria) */

.hero-visual,
.gps-monitor {
  --primary: var(--accent);
  --primary-dark: var(--gradient-end);
  --primary-light: var(--accent);
  --primary-glow: var(--accent-glow);
  --primary-subtle-strong: var(--accent-dim);
  --border-strong: var(--accent-border-strong);
  --text-dim: var(--text-muted);
  --shadow-glow: 0 0 60px var(--accent-glow);
  --font: var(--font-sans);
}

[data-theme="light"] .hero-visual,
[data-theme="light"] .gps-monitor {
  --titlebar-bg: #ececee;
  --titlebar-border: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .hero-visual,
[data-theme="dark"] .gps-monitor {
  --titlebar-bg: #2c2c2e;
  --titlebar-border: rgba(255, 255, 255, 0.08);
  --primary-light: #818cf8;
}

/* ─── GPS monitor visualization ─── */

.hero-visual {
  overflow: visible;
}

.gps-monitor {
  position: relative;
  margin: 36px 72px 48px 56px;
}

.gps-monitor-glow {
  position: absolute;
  inset: -15%;
  background: radial-gradient(ellipse 70% 60% at 50% 50%, var(--primary-glow), transparent 65%);
  pointer-events: none;
}

.gps-monitor-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  box-shadow: var(--shadow), var(--shadow-glow);
  overflow: visible;
  animation: gps-float 5s ease-in-out infinite;
}

@keyframes gps-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.gps-titlebar {
  position: relative;
  z-index: 4;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--titlebar-bg);
  border-bottom: 1px solid var(--titlebar-border);
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
}

.titlebar-traffic {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
}

.traffic-light {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 0.5px solid rgba(0, 0, 0, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.traffic-close { background: #ff5f57; }
.traffic-minimize { background: #febc2e; }
.traffic-maximize { background: #28c840; }

.titlebar-title {
  justify-self: center;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.titlebar-live {
  display: flex;
  align-items: center;
  gap: 6px;
  justify-self: end;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--success);
  white-space: nowrap;
}

@keyframes live-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.gps-monitor-body {
  position: relative;
  height: 360px;
  overflow: visible;
}

.gps-map-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--bg-elevated);
  overflow: hidden;
  border-radius: 0 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px);
}

.gps-leaflet-map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--bg-elevated);
  border-radius: inherit;
  overflow: hidden;
}

.gps-leaflet-map .leaflet-container {
  border-radius: inherit;
}

.gps-leaflet-map .leaflet-control-attribution {
  font-size: 9px;
  margin: 0 !important;
  padding: 2px 6px !important;
  background: rgba(255, 255, 255, 0.85) !important;
  border-radius: 4px 0 0 0;
}

[data-theme="dark"] .gps-leaflet-map .leaflet-control-attribution {
  background: rgba(15, 23, 42, 0.85) !important;
  color: var(--text-muted) !important;
}

.gps-map-fallback {
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.gps-route-toast {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 12;
  width: min(100% - 20px, 320px);
  pointer-events: none;
  opacity: 0;
  transform: translateX(-50%) translateY(-10px) scale(0.94);
  filter: drop-shadow(0 10px 28px rgba(15, 23, 42, 0.2));
}

.gps-route-toast.is-visible {
  animation: gpsRouteToastShow 3.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes gpsRouteToastShow {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.94);
  }
  14% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  80% {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-6px) scale(0.97);
  }
}

.gps-route-toast-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0.85rem 0.65rem 0.7rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.6) inset,
    0 12px 32px rgba(15, 23, 42, 0.14);
}

[data-theme="dark"] .gps-route-toast-card {
  background: rgba(30, 41, 59, 0.94);
  border-color: rgba(129, 140, 248, 0.28);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 12px 36px rgba(0, 0, 0, 0.45);
}

.gps-route-toast[data-type='stop'] .gps-route-toast-card {
  border-left: 3px solid #ff9800;
}

.gps-route-toast[data-type='parking'] .gps-route-toast-card {
  border-left: 3px solid var(--primary);
}

.gps-route-toast-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.08);
}

.gps-route-toast[data-type='stop'] .gps-route-toast-icon {
  background: rgba(255, 152, 0, 0.12);
}

.gps-route-toast[data-type='parking'] .gps-route-toast-icon {
  background: rgba(99, 102, 241, 0.12);
}

.gps-route-toast-icon img {
  display: block;
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.gps-route-toast-content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.gps-route-toast-badge {
  align-self: flex-start;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.3;
}

.gps-route-toast[data-type='stop'] .gps-route-toast-badge {
  color: #c2410c;
  background: rgba(255, 152, 0, 0.18);
}

.gps-route-toast[data-type='parking'] .gps-route-toast-badge {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.14);
}

[data-theme="dark"] .gps-route-toast[data-type='stop'] .gps-route-toast-badge {
  color: #fdba74;
  background: rgba(255, 152, 0, 0.22);
}

[data-theme="dark"] .gps-route-toast[data-type='parking'] .gps-route-toast-badge {
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.28);
}

.gps-route-toast-title {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.gps-route-toast-message {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-muted);
}

.map-vehicle-wrap {
  background: none !important;
  border: none !important;
  overflow: visible !important;
}

.leaflet-marker-icon.map-vehicle-wrap {
  overflow: visible !important;
}

.map-vehicle-marker {
  position: relative;
  width: 22px;
  height: 22px;
  overflow: visible;
}

.marker-label {
  display: none;
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  margin-top: 12px;
  padding: 3px 6px;
  line-height: 1.15;
  text-align: center;
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 7px;
  box-shadow:
    0 2px 10px rgba(15, 23, 42, 0.16),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
  backdrop-filter: blur(10px) saturate(1.1);
}

[data-theme="dark"] .marker-label {
  background: rgba(22, 30, 48, 0.94);
  border-color: rgba(148, 163, 184, 0.28);
  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}

.marker-label-name {
  font-size: 9px;
  font-weight: 400;
  color: #1f2937;
  font-family: var(--font);
}

[data-theme="dark"] .marker-label-name {
  color: #fff;
}

.marker-label .eu-plate--marker {
  border-width: 1.5px;
  border-radius: 4px;
  box-shadow: none;
}

.marker-label .eu-plate--marker .eu-plate-band {
  width: 11px;
  padding: 2px 1px;
  border-right-width: 1.5px;
}

.marker-label .eu-plate--marker .eu-plate-stars {
  width: 7px;
  height: 4px;
}

.marker-label .eu-plate--marker .eu-plate-code {
  font-size: 0.28rem;
}

.marker-label .eu-plate--marker .eu-plate-number {
  padding: 2px 5px 2px 4px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #111827 !important;
  background: #fff;
  font-family: var(--font);
}

@keyframes radarPulse {
  0% {
    box-shadow:
      0 0 0 0 rgba(156, 163, 175, 0.7),
      0 0 0 0 rgba(156, 163, 175, 0.5),
      0 0 0 0 rgba(156, 163, 175, 0.3);
  }
  50% {
    box-shadow:
      0 0 0 15px rgba(156, 163, 175, 0),
      0 0 0 30px rgba(156, 163, 175, 0),
      0 0 0 45px rgba(156, 163, 175, 0);
  }
  100% {
    box-shadow:
      0 0 0 30px rgba(156, 163, 175, 0),
      0 0 0 60px rgba(156, 163, 175, 0),
      0 0 0 90px rgba(156, 163, 175, 0);
  }
}

.marker-icon-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  transform-origin: center center;
  will-change: transform;
}

.marker-icon-container.selected-marker::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-49%, 35%);
  width: 75px;
  height: 75px;
  border-radius: 9999px;
  background-color: rgba(156, 163, 175, 0.55);
  z-index: -1;
  pointer-events: none;
  animation: radarPulse 2s ease-out infinite;
}

body.radar-disabled .marker-icon-container.selected-marker::after {
  display: none;
}

.marker-icon-inner {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
}

.marker-border {
  position: absolute;
  inset: 0;
  background-image: url('assets/images/gps_marker_border.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center center;
  pointer-events: none;
}

.marker-fill {
  position: absolute;
  inset: 0;
  background-color: #ff9800;
  mask-image: url('assets/images/gps_marker.png');
  -webkit-mask-image: url('assets/images/gps_marker.png');
  mask-size: contain;
  -webkit-mask-size: contain;
  mask-repeat: no-repeat;
  -webkit-mask-repeat: no-repeat;
  mask-position: center center;
  -webkit-mask-position: center center;
}

.marker-fill[data-ignition-active='false'] {
  background-color: var(--primary);
}

.leaflet-marker-icon.route-event-marker {
  background: none !important;
  border: none !important;
}

.route-event-marker img {
  display: block;
  filter: drop-shadow(0 1px 4px rgba(15, 23, 42, 0.35));
  pointer-events: none;
}

/* Floating telemetry chips (around monitor) */

.gps-floats {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}

.float-chip-group {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 12px 14px;
  box-sizing: border-box;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow), 0 10px 36px rgba(99, 102, 241, 0.14);
  backdrop-filter: blur(14px) saturate(1.15);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  overflow: hidden;
  animation: chip-float 5s ease-in-out infinite;
  pointer-events: auto;
}

[data-theme="dark"] .float-chip-group {
  background: rgba(26, 34, 54, 0.92);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

@keyframes chip-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.float-chip-group small,
.chip-group-metric small,
.chip-group-section small,
.chip-group-loc small,
.chip-info-row small,
.chip-info-sync small {
  display: block;
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.float-chip-group strong,
.chip-group-metric strong,
.chip-group-section strong,
.chip-group-loc strong,
.chip-info-row strong,
.chip-info-sync strong {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.chip-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  flex-shrink: 0;
}

.chip-icon svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  shape-rendering: geometricPrecision;
}

.chip-icon-cyan {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
}

.chip-unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 2px;
}

.chip-icon-road {
  background: linear-gradient(135deg, #64748b, #475569);
}

.chip-icon-fuel {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.chip-group-divider {
  height: 1px;
  margin: 10px 0;
  background: var(--border);
  opacity: 0.85;
}

/* Kafelek 1 — prędkość, przebieg, obroty, silnik, kontrolki */
.float-chip-group-drive {
  top: 6%;
  left: -118px;
  min-width: 152px;
  padding: 10px 12px;
  animation-delay: 0s;
}

.float-chip-group-drive .chip-group-metric {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
}

.float-chip-group-drive .chip-group-metric:first-child {
  padding-top: 0;
}

.float-chip-group-drive .chip-group-metric + .chip-group-metric {
  border-top: 1px solid var(--border);
  margin-top: 1px;
  padding-top: 6px;
}

.float-chip-group-drive .chip-group-metric .chip-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
}

.float-chip-group-drive .chip-group-metric .chip-icon svg {
  width: 20px;
  height: 20px;
}

.float-chip-group-drive .chip-group-metric > div {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding-top: 3px;
}

.float-chip-group-drive .chip-group-value {
  display: flex;
  align-items: baseline;
  flex-wrap: nowrap;
  gap: 2px;
  min-height: calc(0.88rem * 1.2);
}

.float-chip-group-drive .chip-group-metric small {
  font-size: 0.58rem;
  margin-bottom: 3px;
  line-height: 1.25;
}

.float-chip-group-drive .chip-group-metric strong {
  font-size: 0.88rem;
  line-height: 1.2;
}

.float-chip-group-drive .chip-unit {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-muted);
}

.float-chip-group-drive .chip-group-divider {
  margin: 6px 0;
}

.float-chip-group-drive .float-chip-controls-title {
  font-size: 0.56rem;
}

.float-chip-group-drive .float-chip-controls-row {
  gap: 10px;
}

.float-chip-group-drive .chip-group-controls .ind-icon {
  width: 24px;
  height: 20px;
}

.chip-group-metric {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}

/* Kafelek 2 — silnik, paliwo, AdBlue, kontrolki */
.float-chip-group-status {
  bottom: -24px;
  right: 108px;
  min-width: 188px;
  animation-delay: -1.2s;
}

.chip-group-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chip-group-levels {
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}

.chip-group-controls {
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

.float-chip-group-drive .chip-group-controls {
  padding-top: 0;
  gap: 4px;
}

/* Kafelek 3 — pojazd, jazda, aktualizacja, lokalizacja */
.float-chip-group-info {
  top: -14px;
  right: -96px;
  width: 232px;
  min-width: 232px;
  max-width: 232px;
  z-index: 7;
  animation-delay: -2.4s;
}

.float-chip-group-info .chip-group-divider {
  margin: 8px 0;
}

.gps-panel-top,
.chip-info-head {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.float-chip-group-info .gps-panel-meta {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 4px;
}

.float-chip-group-info .gps-panel-meta .chip-info-row + .chip-info-row {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

/* Desktop: wrapper przezroczysty — kafelki dalej pozycjonowane osobno */
.gps-panel-metrics {
  display: contents;
}

.chip-info-head-divider {
  flex: 0 0 1px;
  align-self: stretch;
  width: 1px;
  margin: 2px 0;
  background: var(--border);
  opacity: 0.85;
}

.chip-info-vehicle {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 0 0 auto;
  min-width: 0;
}

.chip-info-vehicle .swiss-plate {
  height: 24px;
  grid-template-columns: 17px 1fr;
  border-width: 1.5px;
  border-radius: 3px;
}

.chip-info-vehicle .swiss-plate__stripe {
  width: 17px;
  min-height: 24px;
  background-size: 12px 18px;
}

.chip-info-vehicle .swiss-plate__body {
  padding: 0 6px 0 5px;
  gap: 3px;
  font-size: 0.72rem;
}

.chip-icon-vehicle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
}

.chip-icon-vehicle img {
  display: block;
  height: 28px;
  width: auto;
  max-width: 72px;
  aspect-ratio: 399 / 163;
  object-fit: contain;
  object-position: center;
  filter: brightness(0) saturate(100%) invert(24%) sepia(12%) saturate(1200%) hue-rotate(186deg)
    brightness(0.95);
}

[data-theme="dark"] .chip-icon-vehicle img {
  filter: brightness(0) saturate(100%) invert(88%) sepia(6%) saturate(400%) hue-rotate(186deg)
    brightness(1.05);
}

.gps-panel-top .float-chip-status,
.chip-info-head .float-chip-status {
  display: inline-flex;
  flex: 1 1 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 4px;
  min-width: 0;
  margin-left: 6px;
  text-align: center;
}

.gps-panel-top .chip-status-line,
.chip-info-head .chip-status-line {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: center;
  gap: 5px;
  padding: 0 4px;
  white-space: nowrap;
}

.gps-panel-top .chip-icon-ignition,
.chip-info-head .chip-icon-ignition {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
}

.gps-panel-top .chip-icon-ignition img,
.chip-info-head .chip-icon-ignition img {
  display: block;
  width: 22px;
  height: 22px;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(65%) sepia(95%) saturate(3000%) hue-rotate(15deg)
    brightness(1.15);
}

.gps-panel-top .chip-icon-ignition.is-off img,
.chip-info-head .chip-icon-ignition.is-off img {
  filter: brightness(0) saturate(0%) invert(63%) sepia(0%) saturate(0%) hue-rotate(0deg)
    brightness(1);
}

.chip-status-label {
  font-size: 0.7rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--text);
}

.chip-status-time {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Szwajcarska tablica rejestracyjna */
.swiss-plate {
  display: grid;
  grid-template-columns: 22px 1fr;
  grid-template-rows: 1fr;
  align-items: stretch;
  width: max-content;
  max-width: 100%;
  height: 28px;
  border: 2px solid #111827;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.swiss-plate__stripe {
  grid-column: 1;
  grid-row: 1;
  width: 22px;
  min-height: 28px;
  background-color: #d52b1e !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 30'%3E%3Cpath fill='%23fff' d='M8 6h6v11H8V6zM3.5 11.5h15v4h-15v-4z'/%3E%3Ctext x='11' y='26' text-anchor='middle' fill='%23fff' font-size='7' font-weight='700' font-family='Arial,sans-serif'%3ECH%3C/text%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 15px 22px;
  border-right: 2px solid #111827;
}

.swiss-plate__body {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  padding: 0 9px 0 7px;
  font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  color: #111827;
  background: #fff;
  white-space: nowrap;
}

.swiss-plate__canton {
  font-weight: 800;
  letter-spacing: 0.05em;
}

.swiss-plate__digits {
  font-weight: 700;
  letter-spacing: 0.07em;
  font-variant-numeric: tabular-nums;
}

[data-theme="dark"] .swiss-plate {
  background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .swiss-plate__body {
  color: #111827;
  background: #fff;
}

.chip-info-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}

.chip-info-row-body {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-align: right;
}

.chip-icon-sync {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
}

.chip-icon-loc {
  background: linear-gradient(135deg, #f97316, #ea580c);
}

.float-chip-group-info .chip-info-row small {
  margin-bottom: 2px;
}

.float-chip-level-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.float-chip-level-head strong {
  font-size: 0.82rem;
}

.float-chip-bar {
  height: 5px;
  border-radius: 100px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.float-chip-bar-fill {
  display: block;
  height: 100%;
  border-radius: 100px;
  transition: width 0.5s ease;
}

.float-chip-bar-fuel {
  background: linear-gradient(90deg, #eab308, #f97316);
}

.float-chip-bar-adblue {
  background: linear-gradient(90deg, var(--primary), #38bdf8);
}

.float-chip-controls-title {
  display: block;
  margin: 0 0 2px;
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  white-space: nowrap;
}

.float-chip-controls-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.gps-indicators-set {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.gps-indicators-set[hidden] {
  display: none !important;
}

.gps-indicators-parking .ind-icon-handbrake.ind-on {
  width: 32px;
  height: 28px;
  opacity: 1;
  filter: none;
}

.chip-group-controls .ind {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
}

.chip-group-controls .ind[hidden] {
  display: none !important;
}

.chip-group-controls .ind-icon {
  display: block;
  width: 28px;
  height: 24px;
  object-fit: contain;
  opacity: 0.28;
  filter: grayscale(1);
}

.chip-group-controls .ind-icon.ind-on {
  opacity: 1;
  filter: none;
}

.chip-group-controls .ind-icon-lights.ind-on {
  filter: brightness(0) saturate(100%) invert(58%) sepia(69%) saturate(500%) hue-rotate(86deg) brightness(95%) contrast(92%);
}

.float-chip-addr {
  display: block;
  font-size: 0.72rem !important;
  font-weight: 600 !important;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#gps-speed.gps-speed-pulse {
  display: inline-block;
  animation: chip-speed-pulse 0.4s ease;
}

@keyframes chip-speed-pulse {
  50% { color: var(--primary); transform: scale(1.05); }
}

@media (prefers-reduced-motion: reduce) {
  .float-chip-group {
    animation: none;
  }

  #gps-speed.gps-speed-pulse {
    animation: none;
  }

  .marker-icon-container.selected-marker::after {
    animation: none;
    box-shadow: 0 0 0 12px rgba(156, 163, 175, 0.25);
  }
}
@media (max-width: 1024px) {
  .gps-monitor {
    margin: 12px auto 32px;
    max-width: 520px;
  }
}

/* Desktop: ramka panelu tylko na mobile; info bez obrysu, kafelki nie obcinane */
@media (min-width: 769px) {
  .gps-floats {
    background: transparent;
    border: none;
    padding: 0;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .float-chip-group-info {
    border: none;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(12px) saturate(1.12);
    -webkit-backdrop-filter: blur(12px) saturate(1.12);
  }

  [data-theme="dark"] .float-chip-group-info {
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.38);
  }
}

/* Mobile: mapa u góry, jeden kafelek pod spodem */
@media (max-width: 768px) {
  .gps-monitor {
    margin: 16px auto 24px;
    max-width: min(100%, 520px);
  }

  .gps-monitor-frame {
    overflow: hidden;
    animation: none;
  }

  .gps-monitor-body {
    display: flex;
    flex-direction: column;
    height: auto;
    overflow: hidden;
  }

  .gps-map-wrap {
    flex: 0 0 auto;
    height: min(52vw, 240px);
    min-height: 200px;
    border-radius: 0;
  }

  .gps-floats {
    position: static;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 14px 14px;
    margin: 0;
    pointer-events: auto;
    background: rgba(255, 255, 255, 0.92);
    border-top: 1px solid var(--border-strong);
    border-radius: 0 0 calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px);
    overflow: hidden;
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
  }

  [data-theme="dark"] .gps-floats {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .float-chip-group {
    position: static;
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    animation: none;
  }

  [data-theme="dark"] .float-chip-group {
    background: transparent;
    box-shadow: none;
  }

  /* Sekcja 1: 2 kolumny — pojazd + driving (stack) | update + location */
  .float-chip-group-info {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 0;
    row-gap: 0;
    align-items: center;
  }

  .float-chip-group-info .gps-panel-meta {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
  }

  .gps-panel-top {
    display: contents;
  }

  .chip-info-vehicle {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    justify-self: start;
    gap: 5px;
    min-width: 0;
    padding-right: 10px;
    border-right: none;
  }

  .chip-info-vehicle .chip-icon-vehicle img {
    height: 24px;
  }

  .gps-panel-top .chip-info-head-divider {
    display: none;
  }

  .gps-panel-top .float-chip-status {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
    align-self: start;
    flex: none;
    width: auto;
    margin: 0;
    padding: 6px 10px 0 0;
    text-align: center;
    white-space: nowrap;
    border-top: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }

  .gps-panel-meta {
    grid-column: 2;
    grid-row: 1 / span 2;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0 0 0 10px;
    border: none;
    align-self: center;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
  }

  .gps-panel-meta .chip-info-row {
    padding: 0;
    width: 100%;
    justify-content: flex-end;
  }

  .gps-panel-meta .chip-info-row + .chip-info-row {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
  }

  .gps-panel-meta .chip-info-row-body {
    text-align: right;
    min-width: 0;
    overflow: visible;
  }

  .gps-panel-meta .float-chip-addr {
    text-align: right;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }

  .gps-panel-meta .chip-icon {
    flex-shrink: 0;
  }

  /* Sekcja 2: 3 kolumny — speed/mileage | rpm/fuel | poziomy */
  .gps-panel-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 8px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .gps-panel-metrics .float-chip-group-drive,
  .gps-panel-metrics .float-chip-group-status {
    display: contents;
  }

  .float-chip-group-drive .chip-group-divider {
    display: none;
  }

  .float-chip-group-drive .chip-group-metric {
    padding: 0;
    margin: 0;
    align-self: start;
  }

  .float-chip-group-drive .chip-group-metric + .chip-group-metric {
    border-top: none;
    margin: 0;
    padding: 0;
  }

  .float-chip-group-drive .chip-group-metric:nth-child(1) {
    grid-column: 1;
    grid-row: 1;
  }

  .float-chip-group-drive .chip-group-metric:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .float-chip-group-drive .chip-group-metric:nth-child(3) {
    grid-column: 1;
    grid-row: 2;
  }

  .float-chip-group-drive .chip-group-metric:nth-child(4) {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
  }

  .gps-panel-metrics .chip-group-levels {
    display: contents;
  }

  .gps-panel-metrics .float-chip-level:nth-child(1) {
    grid-column: 3;
    grid-row: 1;
    align-self: center;
    width: 100%;
  }

  .gps-panel-metrics .float-chip-level:nth-child(2) {
    grid-column: 3;
    grid-row: 2;
    align-self: center;
    width: 100%;
  }

  .gps-panel-metrics .float-chip-level-head {
    text-align: left;
  }

  /* Kontrolki — na dole, wyśrodkowane */
  .float-chip-group-drive .chip-group-controls {
    grid-column: 1 / -1;
    grid-row: 3;
    align-self: start;
    width: 100%;
    padding-top: 10px;
    margin-top: 2px;
    border-top: 1px solid var(--border);
  }

  .gps-panel-metrics .chip-group-controls .float-chip-controls-title {
    text-align: center;
    font-size: 0.56rem;
  }

  .gps-panel-metrics .chip-group-controls .float-chip-controls-row {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .float-chip-group strong,
  .chip-group-metric strong {
    font-size: 0.88rem;
  }
}
