@font-face {
  font-family: "Geist";
  src: url("/fonts/geist-latin-wght-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-400: #94a3b8;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --controls-top: 7rem;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 280px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: #cbd5e1;
  color: var(--slate-900);
}

button,
a {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

.tracking-shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 620px;
  overflow: hidden;
  background: #cbd5e1;
}

.map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: #dbe2e9;
}

.topbar {
  position: absolute;
  z-index: 20;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  right: max(12px, env(safe-area-inset-right));
  display: flex;
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  color: #fff;
  border: 1px solid rgb(255 255 255 / 20%);
  border-radius: 16px;
  background: rgb(2 6 23 / 92%);
  box-shadow: 0 20px 42px rgb(15 23 42 / 28%);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  display: flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 16%);
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.brand-copy > strong {
  color: #fff;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
}

.brand-copy > span {
  margin-top: 2px;
  color: var(--slate-400);
  font-size: 9px;
  line-height: 1.3;
}

.topbar > .brand {
  flex: 1 1 auto;
}

.brand-copy > .brand-shared {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 5px;
  margin-top: 4px;
  color: #93c5fd;
  font-size: 10px;
  font-weight: 560;
}

.brand-shared > b {
  max-width: 46%;
  overflow: hidden;
  color: #bfdbfe;
  font-weight: 680;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-shared > i {
  width: 3px;
  height: 3px;
  flex: 0 0 3px;
  border-radius: 50%;
  background: #64748b;
}

.brand-shared > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border-radius: 999px;
  color: #6ee7b7;
  background: rgb(52 211 153 / 10%);
  box-shadow: inset 0 0 0 1px rgb(52 211 153 / 20%);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-badge > i {
  position: relative;
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
}

.live-badge > i > i {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #34d399;
  animation: live-ping 1.6s cubic-bezier(0, 0, 0.2, 1) infinite;
}


.map-message {
  position: absolute;
  z-index: 12;
  top: var(--controls-top);
  left: max(12px, env(safe-area-inset-left));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid rgb(255 255 255 / 80%);
  border-radius: 999px;
  background: rgb(255 255 255 / 94%);
  color: var(--slate-600);
  box-shadow: 0 10px 25px rgb(15 23 42 / 15%);
  font-size: 12px;
  font-weight: 550;
  backdrop-filter: blur(12px);
}

.map-error {
  right: 76px;
  max-width: 340px;
  align-items: flex-start;
  border-color: #fde68a;
  border-radius: 12px;
  background: rgb(255 251 235 / 96%);
  color: #78350f;
}

.map-error .icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  margin-top: 1px;
}

.map-error strong,
.map-error p {
  display: block;
  margin: 0;
}

.map-error strong {
  font-size: 12px;
}

.map-error p {
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.45;
}

.map-error a {
  display: inline-block;
  margin-top: 6px;
  color: inherit;
  font-size: 12px;
  font-weight: 650;
  text-underline-offset: 2px;
}

.map-control,
.zoom-controls {
  position: absolute;
  z-index: 15;
  right: max(12px, env(safe-area-inset-right));
  border: 1px solid rgb(255 255 255 / 82%);
  border-radius: 12px;
  background: rgb(255 255 255 / 95%);
  color: var(--slate-700);
  box-shadow: 0 10px 25px rgb(15 23 42 / 17%);
  backdrop-filter: blur(12px);
}

.recenter-button {
  top: var(--controls-top);
  display: flex;
  width: 42px;
  height: 42px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.map-control svg,
.zoom-controls svg {
  width: 19px;
  height: 19px;
}

.zoom-controls {
  top: calc(var(--controls-top) + 52px);
  overflow: hidden;
}

.zoom-controls button {
  display: flex;
  width: 40px;
  height: 39px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: inherit;
}

.zoom-controls > span {
  display: block;
  height: 1px;
  background: var(--slate-200);
}

.map-control:hover,
.zoom-controls button:hover {
  color: var(--blue-600);
  background: var(--blue-50);
}

.map-control:focus-visible,
.zoom-controls button:focus-visible,
.refresh-button:focus-visible {
  position: relative;
  outline: 3px solid rgb(37 99 235 / 40%);
  outline-offset: 2px;
}

.vehicle-card {
  position: absolute;
  z-index: 20;
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  max-height: calc(100dvh - 116px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgb(255 255 255 / 86%);
  border-radius: 18px;
  background: rgb(255 255 255 / 96%);
  box-shadow: 0 24px 55px rgb(15 23 42 / 26%);
  backdrop-filter: blur(18px);
  scrollbar-width: thin;
}

.vehicle-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--slate-100);
}

.vehicle-heading {
  min-width: 0;
}

.vehicle-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.vehicle-title-row h1 {
  margin: 0;
  color: var(--slate-950);
  font-size: clamp(20px, 6vw, 24px);
  font-weight: 760;
  line-height: 1.1;
  letter-spacing: -0.025em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  box-shadow: inset 0 0 0 1px #e2e8f0;
}

.status-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-moving {
  color: #047857;
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px #a7f3d0;
}

.status-moving i {
  background: #34d399;
}

.status-idling {
  color: #b45309;
  background: #fffbeb;
  box-shadow: inset 0 0 0 1px #fde68a;
}

.status-idling i {
  background: #fbbf24;
}

.status-stopped,
.status-unknown {
  color: var(--slate-700);
  background: var(--slate-100);
}

.status-stopped i,
.status-unknown i {
  background: var(--slate-400);
}

.coordinate-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 7px 0 0;
  color: var(--slate-500);
  font-size: 12px;
}

.coordinate-line svg {
  width: 15px;
  height: 15px;
  color: var(--blue-600);
}

.refresh-button {
  display: flex;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #fff;
  color: var(--slate-600);
  transition: color 150ms ease, background 150ms ease;
}

.refresh-button:hover {
  color: var(--blue-700);
  background: var(--blue-50);
}

.refresh-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.refresh-button svg {
  width: 17px;
  height: 17px;
}

.refresh-button.is-refreshing svg {
  animation: spin 0.8s linear infinite;
}

.destination-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--blue-100);
  background: rgb(239 246 255 / 82%);
}

.destination-icon {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--blue-600);
  color: #fff;
}

.destination-icon svg {
  width: 17px;
  height: 17px;
}

.destination-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.destination-copy span,
.eta-copy span {
  color: var(--blue-600);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.destination-copy strong {
  overflow: hidden;
  margin-top: 2px;
  color: var(--slate-900);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eta-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.eta-copy span {
  color: var(--slate-500);
}

.eta-copy strong {
  margin-top: 2px;
  color: var(--blue-700);
  font-size: 15px;
}

.eta-copy small {
  margin-top: 1px;
  color: var(--slate-500);
  font-size: 9px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--slate-100);
}

.metric {
  min-width: 0;
  padding: 13px 12px;
}

.metric + .metric {
  border-left: 1px solid var(--slate-100);
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--slate-400);
  font-size: 9px;
  font-weight: 650;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metric-label svg {
  width: 14px;
  height: 14px;
}

.metric > strong {
  display: block;
  overflow: hidden;
  margin-top: 7px;
  color: var(--slate-900);
  font-size: clamp(17px, 5vw, 20px);
  font-weight: 730;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric > strong small {
  color: var(--slate-400);
  font-size: 10px;
  font-weight: 550;
}

.update-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px;
  color: var(--slate-400);
  font-size: 11px;
}

.update-row p {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--slate-500);
}

.update-row p span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.update-row svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.update-meta {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.update-meta > i {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--slate-300);
}

.update-meta strong {
  color: var(--slate-600);
  font-weight: 650;
}

.cache-warning {
  padding: 10px 16px;
  border-top: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 11px;
  line-height: 1.4;
}

.legal-footer {
  padding: 9px 16px 10px;
  border-top: 1px solid var(--slate-100);
  color: var(--slate-400);
  font-size: 8px;
  line-height: 1.4;
  letter-spacing: 0.035em;
  text-align: center;
}

.legal-footer strong {
  color: var(--slate-600);
  font-weight: 680;
}

.secure-pill {
  position: absolute;
  z-index: 10;
  top: var(--controls-top);
  right: 74px;
  display: none;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgb(255 255 255 / 90%);
  color: var(--slate-600);
  box-shadow: 0 8px 20px rgb(15 23 42 / 15%);
  font-size: 11px;
  font-weight: 550;
  backdrop-filter: blur(10px);
}

.secure-pill svg {
  width: 15px;
  height: 15px;
  color: #059669;
}

.state-shell {
  position: relative;
  display: flex;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: max(48px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(48px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  background: var(--slate-950);
  color: #fff;
}

.state-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.25;
  background-image: radial-gradient(circle at 1px 1px, #64748b 1px, transparent 0);
  background-size: 24px 24px;
}

.state-vehicle {
  position: absolute;
  right: -90px;
  bottom: -70px;
  width: min(430px, 100vw);
  opacity: 0.22;
  filter: blur(1px);
  pointer-events: none;
}

.state-card {
  position: relative;
  z-index: 1;
  width: min(100%, 448px);
  padding: 24px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 18px;
  background: rgb(255 255 255 / 5%);
  box-shadow: 0 25px 70px rgb(0 0 0 / 36%);
  backdrop-filter: blur(20px);
}

.state-brand {
  margin-bottom: 28px;
}

.state-icon {
  display: flex;
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: rgb(96 165 250 / 10%);
  color: #93c5fd;
}

.state-icon.is-error {
  background: rgb(251 191 36 / 10%);
  color: #fcd34d;
}

.state-icon svg {
  width: 24px;
  height: 24px;
}

.state-card h1 {
  margin: 20px 0 0;
  color: #fff;
  font-size: 24px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

.state-card > p {
  margin: 8px 0 0;
  color: var(--slate-300);
  font-size: 14px;
  line-height: 1.7;
}

.state-vehicle-row {
  margin-top: 24px;
  padding: 12px 16px;
  border: 1px solid rgb(255 255 255 / 10%);
  border-radius: 12px;
  background: rgb(0 0 0 / 10%);
}

.state-vehicle-row span {
  display: block;
  color: var(--slate-500);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.state-vehicle-row strong {
  display: block;
  margin-top: 4px;
  font-size: 15px;
}

.state-card .state-security {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 24px;
  color: var(--slate-500);
  font-size: 11px;
  line-height: 1.4;
}

.state-security svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.state-card .state-legal-footer {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgb(255 255 255 / 9%);
  color: var(--slate-500);
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
}

.state-legal-footer strong {
  color: var(--slate-400);
  font-weight: 650;
}

.spinner {
  display: block;
  width: 24px;
  height: 24px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.spinner-small {
  width: 15px;
  height: 15px;
  color: var(--blue-600);
}

.noscript {
  position: fixed;
  inset: 20px;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  border-radius: 16px;
  background: var(--slate-950);
  color: #fff;
  text-align: center;
}

.vehicle-marker {
  width: 64px;
  aspect-ratio: 256 / 146;
  pointer-events: none;
  transition: width 160ms ease-out;
}

.vehicle-marker img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 8px rgb(15 23 42 / 32%));
  transform-origin: center;
  transition: transform 350ms ease-out;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes live-ping {
  75%, 100% {
    transform: scale(2.5);
    opacity: 0;
  }
}

@media (min-width: 640px) {
  .topbar {
    top: max(20px, env(safe-area-inset-top));
    right: max(20px, env(safe-area-inset-right));
    left: max(20px, env(safe-area-inset-left));
    gap: 16px;
    padding: 9px 16px;
  }

  .brand-copy > strong {
    font-size: 16px;
  }

  .brand-copy > span {
    font-size: 10px;
  }


  .map-message {
    left: max(20px, env(safe-area-inset-left));
  }

  .map-control,
  .zoom-controls {
    right: max(20px, env(safe-area-inset-right));
  }

  .vehicle-card {
    right: auto;
    bottom: max(20px, env(safe-area-inset-bottom));
    left: max(20px, env(safe-area-inset-left));
    width: 390px;
    border-radius: 18px;
  }

  .vehicle-summary {
    padding: 18px 20px;
  }

  .destination-row,
  .update-row,
  .cache-warning,
  .legal-footer {
    padding-right: 20px;
    padding-left: 20px;
  }

  .metric {
    padding: 14px 16px;
  }

  .secure-pill {
    display: flex;
    right: 76px;
  }

  .state-card {
    padding: 32px;
  }

  .state-vehicle {
    opacity: 0.3;
  }
}

@media (min-width: 1024px) {
  .topbar {
    right: max(24px, env(safe-area-inset-right));
    left: max(24px, env(safe-area-inset-left));
  }

  .vehicle-card {
    left: max(24px, env(safe-area-inset-left));
  }

  .map-control,
  .zoom-controls {
    right: max(24px, env(safe-area-inset-right));
  }
}

@media (max-width: 359px) {
  .topbar {
    align-items: stretch;
  }

  .brand {
    gap: 7px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand-copy > strong {
    font-size: 12px;
  }

  .brand-copy > span {
    font-size: 8px;
  }


  .metric {
    padding-right: 8px;
    padding-left: 8px;
  }

  .metric-label {
    gap: 3px;
    font-size: 8px;
  }

  .update-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .update-meta {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-height: 700px) {
  .vehicle-summary {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .destination-row {
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .metric {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .update-row {
    padding-top: 8px;
    padding-bottom: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
