:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --surface: rgba(24, 27, 32, .86);
  --surface-2: #20242a;
  --line: rgba(255,255,255,.075);
  --text: #f4f6f8;
  --muted: #8d949f;
  --accent: #bcff38;
  --accent-soft: rgba(188,255,56,.13);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--bg); color: var(--text); font-family: Manrope, system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button { color: inherit; font: inherit; }
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.is-hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.ambient { position: fixed; border-radius: 50%; filter: blur(100px); pointer-events: none; opacity: .08; }
.ambient-one { width: 220px; height: 220px; background: var(--accent); top: -110px; right: -80px; }
.ambient-two { width: 250px; height: 250px; background: #4378ff; top: 42%; left: -210px; }
.app-shell { position: relative; max-width: 620px; min-height: 100vh; margin: 0 auto; padding: max(22px, env(safe-area-inset-top)) 18px calc(104px + var(--safe-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; margin: 4px 2px 26px; }
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .19em; }
h1 { margin: 0; font-size: 22px; letter-spacing: -.04em; }
h1 span { color: var(--accent); }
.icon-button { display: grid; place-items: center; width: 43px; height: 43px; padding: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.035); cursor: pointer; }
.icon-button svg { width: 19px; }
.icon-button.loading svg { animation: spin .75s linear infinite; }
.page { display: none; animation: page-in .3s ease; }
.page.active { display: block; }
.connection-row { display: flex; align-items: center; justify-content: space-between; margin: 0 2px 14px; }
.connection-row time { color: #666d77; font-size: 10px; font-weight: 600; }
.status-pill { display: inline-flex; align-items: center; gap: 7px; color: #b5bbc2; font-size: 10px; font-weight: 700; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(188,255,56,.09), 0 0 12px rgba(188,255,56,.45); }
.status-pill.offline .status-dot { background: #ffb342; box-shadow: 0 0 0 4px rgba(255,179,66,.1); }
.hero-card { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 186px; padding: 27px 17px 25px 25px; overflow: hidden; border: 1px solid rgba(255,255,255,.085); border-radius: 26px; background: radial-gradient(circle at 95% 5%, rgba(188,255,56,.095), transparent 42%), linear-gradient(145deg, #1c2025, #13161a); box-shadow: 0 22px 60px rgba(0,0,0,.24); }
.hero-card::after { position: absolute; content: ''; width: 160px; height: 160px; right: -60px; bottom: -90px; border: 1px solid rgba(188,255,56,.09); border-radius: 50%; }
.card-label { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .15em; }
.speed-value { display: flex; align-items: baseline; gap: 7px; margin: 6px 0 14px; }
.speed-value strong { font-size: clamp(52px, 15vw, 72px); line-height: 1; letter-spacing: -.075em; }
.speed-value span { color: #7f8790; font-size: 11px; font-weight: 700; }
.hero-copy p { display: flex; align-items: center; gap: 7px; margin: 0; color: #747c85; font-size: 9px; font-weight: 600; }
.hero-copy p b { color: #aeb4bb; font-size: inherit; }
.pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: pulse 1.8s ease infinite; }
.speed-ring { position: relative; flex: 0 0 122px; width: 122px; height: 122px; }
.speed-ring > svg:first-child { width: 100%; transform: rotate(135deg); }
.speed-ring circle { fill: none; stroke-width: 6; }
.ring-track { stroke: rgba(255,255,255,.055); stroke-dasharray: 315 106; }
.ring-progress { stroke: var(--accent); stroke-dasharray: 0 421; transition: stroke-dasharray .8s cubic-bezier(.2,.8,.2,1); filter: drop-shadow(0 0 5px rgba(188,255,56,.38)); }
.car-mark { position: absolute; width: 35px; inset: 44px; color: #79808a; stroke-width: 1.4; }
.fuel-mark { width: 32px; inset: 45px; color: var(--accent); opacity: .72; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin: 27px 2px 14px; }
.section-heading h3 { margin: 0; font-size: 16px; letter-spacing: -.03em; }
.section-heading > span { color: #5e656e; font-size: 9px; }
.section-heading button { padding: 0; border: 0; background: transparent; color: #79808a; font-size: 10px; cursor: pointer; }
.section-heading button span { margin-left: 3px; color: var(--accent); font-size: 17px; vertical-align: -1px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.metric-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); backdrop-filter: blur(15px); }
.metric-icon { display: grid; place-items: center; width: 30px; height: 30px; margin-bottom: 20px; border-radius: 10px; background: rgba(255,255,255,.045); color: #9aa1aa; }
.metric-icon svg { width: 15px; }
.metric-card > span { display: block; overflow: hidden; margin-bottom: 4px; color: var(--muted); font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.metric-card > strong { display: block; font-size: 18px; letter-spacing: -.04em; white-space: nowrap; }
.metric-card > strong b { font-size: 24px; }
.metric-card small { color: #858c95; font-size: 9px; font-weight: 600; letter-spacing: 0; }
.metric-card em { display: block; margin-top: 7px; color: #565d66; font-size: 8px; font-style: normal; }
.metric-fuel .metric-icon, .accent-card .metric-icon { background: var(--accent-soft); color: var(--accent); }
.progress { height: 3px; margin-top: 12px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.06); }
.progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 7px var(--accent); transition: width .7s ease; }
.trips-heading { margin-top: 28px; }
.trip-card { display: flex; align-items: center; min-height: 76px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 19px; background: rgba(22,25,29,.78); }
.trip-route { display: flex; flex-direction: column; align-items: center; margin-right: 13px; }
.trip-route i { width: 5px; height: 5px; border: 1px solid var(--accent); border-radius: 50%; }
.trip-route i:last-child { background: var(--accent); }
.trip-route span { width: 1px; height: 15px; background: rgba(188,255,56,.25); }
.trip-main { flex: 1; min-width: 0; }
.trip-main strong { display: block; font-size: 10px; }
.trip-main span { display: block; margin-top: 5px; overflow: hidden; color: #626a73; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.trip-values { text-align: right; }
.trip-values strong { display: block; font-size: 11px; }
.trip-values span { color: #5f666f; font-size: 8px; }
.counter-list { display: grid; gap: 9px; }
.counter-card { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 12px; min-height: 76px; padding: 14px 15px; border: 1px solid var(--line); border-radius: 19px; background: rgba(22,25,29,.78); }
.counter-number { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 800; }
.counter-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-width: 0; }
.counter-stat { min-width: 0; }
.counter-stat + .counter-stat { padding-left: 10px; border-left: 1px solid var(--line); }
.counter-stat span { display: block; margin-bottom: 5px; overflow: hidden; color: #626a73; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.counter-stat strong { display: block; font-size: 9px; white-space: nowrap; }
.counter-stat strong b { font-size: 14px; }
.placeholder-page { min-height: 58vh; padding: 64px 18px 20px; text-align: center; }
.placeholder-icon { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 20px; border: 1px solid rgba(188,255,56,.15); border-radius: 23px; background: var(--accent-soft); color: var(--accent); }
.placeholder-icon svg { width: 29px; }
.placeholder-page h2 { margin: 0 0 8px; font-size: 25px; }
.placeholder-page > p { max-width: 330px; margin: auto; color: var(--muted); font-size: 12px; line-height: 1.65; }
.stub-data { margin-top: 32px; padding: 5px 18px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); text-align: left; }
.stub-data span { display: flex; justify-content: space-between; padding: 15px 0; color: var(--muted); font-size: 11px; }
.stub-data span + span { border-top: 1px solid var(--line); }
.stub-data b { color: var(--text); }
.stub-data i { font-style: normal; }
.bottom-nav { position: fixed; z-index: 20; right: max(14px, calc((100vw - 620px) / 2 + 14px)); bottom: calc(12px + var(--safe-bottom)); left: max(14px, calc((100vw - 620px) / 2 + 14px)); display: grid; grid-template-columns: repeat(4, 1fr); height: 69px; padding: 7px 8px; border: 1px solid rgba(255,255,255,.09); border-radius: 23px; background: rgba(22,25,29,.92); box-shadow: 0 18px 60px rgba(0,0,0,.5); backdrop-filter: blur(22px); }
.bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 0; border: 0; border-radius: 17px; background: transparent; color: #656d76; font-size: 8px; font-weight: 600; cursor: pointer; transition: .2s ease; }
.bottom-nav svg { width: 19px; height: 19px; }
.bottom-nav button.active { background: rgba(188,255,56,.075); color: var(--accent); }
.toast { position: fixed; z-index: 30; right: 25px; bottom: calc(98px + var(--safe-bottom)); left: 25px; max-width: 450px; margin: auto; padding: 12px 15px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: #25292f; color: #d5d8dc; font-size: 10px; text-align: center; opacity: 0; pointer-events: none; transform: translateY(8px); transition: .25s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.auth-view { position: relative; z-index: 2; display: flex; flex-direction: column; justify-content: center; width: min(100%, 460px); min-height: 100vh; margin: auto; padding: max(30px, env(safe-area-inset-top)) 20px max(30px, env(safe-area-inset-bottom)); }
.auth-logo { display: flex; align-items: center; justify-content: center; gap: 11px; margin-bottom: 28px; font-size: 19px; font-weight: 800; letter-spacing: -.04em; }
.auth-logo img { width: 42px; height: 42px; border-radius: 13px; box-shadow: 0 8px 30px rgba(188,255,56,.1); }
.auth-logo span { color: var(--accent); }
.auth-card { padding: 28px 24px 24px; border: 1px solid rgba(255,255,255,.085); border-radius: 27px; background: radial-gradient(circle at 100% 0, rgba(188,255,56,.07), transparent 35%), rgba(24,27,32,.9); box-shadow: 0 28px 80px rgba(0,0,0,.3); backdrop-filter: blur(20px); }
.auth-card > h1 { margin: 6px 0 8px; font-size: 25px; }
.auth-subtitle { margin: 0 0 25px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.auth-card label { display: block; margin: 0 0 8px 2px; color: #aeb4bb; font-size: 9px; font-weight: 700; }
.auth-input { display: flex; align-items: center; height: 49px; margin-bottom: 17px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px; background: rgba(8,10,12,.45); transition: border-color .2s, box-shadow .2s; }
.auth-input:focus-within { border-color: rgba(188,255,56,.42); box-shadow: 0 0 0 3px rgba(188,255,56,.06); }
.auth-input > svg { flex: 0 0 auto; width: 17px; margin-right: 11px; color: #666e77; }
.auth-input input { width: 100%; min-width: 0; height: 100%; padding: 0; outline: 0; border: 0; background: transparent; color: var(--text); font: 500 12px Manrope, sans-serif; }
.auth-input input::placeholder { color: #4f565f; }
.auth-input button { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; background: transparent; color: #646b74; cursor: pointer; }
.auth-input button svg { width: 17px; }
.auth-error { min-height: 15px; margin: -3px 2px 8px; color: #ff7e72; font-size: 9px; line-height: 1.5; }
.auth-submit { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 49px; border: 0; border-radius: 14px; background: var(--accent); color: #11150b; font-size: 11px; font-weight: 800; cursor: pointer; box-shadow: 0 10px 28px rgba(188,255,56,.12); }
.auth-submit:disabled { cursor: wait; opacity: .65; }
.auth-submit span { font-size: 17px; }
.demo-login { margin: 17px 0 0; color: #626a73; font-size: 9px; text-align: center; }
.demo-login b { color: #9299a2; }
.logout-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; width: 100%; height: 47px; margin-top: 28px; border: 1px solid rgba(255,126,114,.18); border-radius: 14px; background: rgba(255,126,114,.06); color: #ff8b81; font-size: 10px; font-weight: 700; cursor: pointer; }
.logout-button svg { width: 17px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(188,255,56,0); } }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 370px) { .hero-card { padding-left: 20px; } .speed-ring { flex-basis: 106px; width: 106px; height: 106px; } .car-mark { width: 31px; inset: 38px; } .metric-card { padding: 15px; } }
@media (min-width: 621px) { .app-shell { border-right: 1px solid rgba(255,255,255,.04); border-left: 1px solid rgba(255,255,255,.04); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
