:root {
    color-scheme: dark;
    --ink: #f8fafc;
    --muted: #94a3b8;
    --line: rgba(226, 232, 240, 0.14);
    --panel: rgba(15, 23, 42, 0.78);
    --accent: #3b82f6;
    --ok: #4ade80;
    --off: #f59e0b;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    font-family: "Segoe UI", ui-sans-serif, system-ui, sans-serif;
    color: var(--ink);
    background: #0f172a;
}

#map {
    position: absolute;
    inset: 0;
}

.telemetry {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    width: min(340px, calc(100vw - 32px));
    padding: 18px 18px 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.45);
    backdrop-filter: blur(16px);
}

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

.eyebrow {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

h1 {
    margin: 2px 0 0;
    font-size: 22px;
    font-weight: 650;
    letter-spacing: -0.03em;
}

.status {
    margin: 0;
    padding: 5px 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
}

.status[data-state="live"] {
    background: rgba(74, 222, 128, 0.16);
    color: var(--ok);
}

.status[data-state="offline"] {
    background: rgba(245, 158, 11, 0.16);
    color: var(--off);
}

.imei {
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
}

.metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
    margin: 16px 0 0;
}

.metrics div {
    min-width: 0;
}

dt {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

dd {
    margin: 4px 0 0;
    font-size: 20px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.03em;
}

#ignition[data-state="on"] {
    color: var(--ok);
}

#ignition[data-state="off"] {
    color: var(--off);
}

.updated {
    margin: 16px 0 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}

.vehicle-marker {
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.65);
    }
    70% {
        box-shadow: 0 0 0 14px rgba(59, 130, 246, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .vehicle-marker {
        animation: none;
        box-shadow: 0 0 0 6px rgba(59, 130, 246, 0.35);
    }
}

@media (max-width: 640px) {
    .telemetry {
        top: auto;
        bottom: 16px;
    }

    dd {
        font-size: 18px;
    }
}
