:root {
  color-scheme: dark;
  --primary: #00e5ff;
  --primary-soft: #c6f8ff;
  --secondary: #00e676;
  --secondary-soft: #b9ffd6;
  --tertiary: #fec931;
  --tertiary-soft: #fff0bd;
  --danger: #ff7f87;
  --neutral: #0a0a0b;
  --surface: #141416;
  --surface-raised: #1e1e20;
  --surface-hover: #29292c;
  --border: #34383c;
  --border-soft: #242629;
  --text: #f4f4f5;
  --text-soft: #c7d0d3;
  --muted: #858b91;
  --sidebar-width: 236px;
  --radius: 12px;
  --shadow: 0 24px 70px rgb(0 0 0 / 35%);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--neutral);
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--neutral);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#i-grid path {
  fill: currentColor;
  stroke: none;
}

.eyebrow,
.card-kicker,
.build-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .12em;
}

.button {
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 0 18px;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.button--primary {
  background: var(--primary);
  color: #002c32;
}

.button--outlined {
  border-color: var(--border);
  background: transparent;
}

.button:hover {
  filter: brightness(1.06);
}

.icon-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
}

.icon-button svg {
  width: 20px;
  height: 20px;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgb(0 229 255 / 42%);
  border-radius: 11px;
  background:
    linear-gradient(145deg, rgb(0 229 255 / 24%), transparent 55%),
    #111315;
  box-shadow: inset 0 0 24px rgb(0 229 255 / 8%);
  color: var(--primary);
  font-size: 23px;
  font-style: italic;
  font-weight: 900;
}

.brand-mark--large {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  border-radius: 16px;
  font-size: 31px;
}

/* Login */
.login-screen {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 5%, rgb(0 229 255 / 10%), transparent 28%),
    var(--neutral);
}

.login-card {
  width: min(420px, 100%);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 38px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.login-card h1 {
  margin: 8px 0;
  font-size: 34px;
  letter-spacing: -.04em;
}

.login-copy {
  margin: 0 0 28px;
  color: var(--muted);
  line-height: 1.55;
}

.login-card label,
.modal-card label {
  display: block;
  margin: 16px 0 7px;
  color: var(--text-soft);
  font-size: 13px;
  font-weight: 650;
}

.login-card input,
.modal-card input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 0 13px;
  background: #242426;
  color: var(--text);
}

.login-card .button {
  width: 100%;
  margin-top: 22px;
}

.form-message {
  min-height: 18px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.form-message--error {
  color: #ff9ba1;
}

.preview-link {
  display: block;
  margin-top: 18px;
  color: var(--primary-soft);
  font-size: 13px;
  text-align: center;
  text-decoration: none;
}

/* Modal */
.modal-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgb(0 0 0 / 76%);
  backdrop-filter: blur(8px);
}

.modal-overlay.show {
  display: flex;
}

.modal-card {
  width: min(420px, 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.modal-heading h2 {
  margin: 6px 0 0;
  font-size: 24px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

/* App shell */
.dashboard {
  display: none;
  min-height: 100vh;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.dashboard.show {
  display: grid;
}

.sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  height: 100vh;
  min-width: 0;
  flex-direction: column;
  border-right: 1px solid var(--border);
  background: #202022;
}

.sidebar-brand {
  display: flex;
  min-height: 92px;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.brand-name,
.brand-caption,
.vehicle-summary p {
  margin: 0;
}

.brand-name {
  color: var(--primary);
  font-size: 17px;
  font-weight: 850;
  letter-spacing: -.03em;
}

.brand-caption {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sidebar-close {
  display: none;
  margin-left: auto;
}

.vehicle-summary {
  padding: 25px 18px 20px;
  text-align: center;
}

.vehicle-avatar {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 13px;
  place-items: center;
  border: 1px solid rgb(0 229 255 / 28%);
  border-radius: 14px;
  background: #101315;
  color: var(--primary);
  font-size: 23px;
  font-style: italic;
  font-weight: 900;
}

.vehicle-summary__name {
  overflow: hidden;
  color: var(--primary-soft);
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-summary__status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 8px !important;
  color: var(--muted);
  font-size: 11px;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--muted);
}

.nav-list {
  display: grid;
  gap: 2px;
  padding: 10px 0;
}

.nav-item {
  position: relative;
  display: grid;
  min-height: 50px;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border: 0;
  border-right: 2px solid transparent;
  padding: 0 17px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 650;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.nav-item svg {
  width: 20px;
  height: 20px;
}

.nav-item small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: .1em;
}

.nav-item:hover:not(:disabled),
.nav-item--active {
  background: #29292b;
  color: var(--primary-soft);
}

.nav-item--active {
  border-right-color: var(--primary-soft);
}

.nav-item:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.sidebar-footer {
  margin-top: auto;
  padding-bottom: 18px;
}

.build-label {
  padding: 12px 18px 0;
  color: var(--muted);
  font-size: 9px;
}

.sidebar-backdrop {
  display: none;
}

.main-content {
  min-width: 0;
  padding: 0 24px 24px;
  background:
    radial-gradient(circle at 80% 0, rgb(0 229 255 / 3.5%), transparent 25%),
    #111113;
}

.page-header {
  display: flex;
  min-height: 118px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}

.page-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.page-heading h1 {
  margin: 5px 0 5px;
  font-size: clamp(36px, 4vw, 48px);
  letter-spacing: -.055em;
  line-height: 1;
}

.page-heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.menu-toggle {
  display: none;
}

.header-actions,
.account-button,
.freshness-badge {
  display: flex;
  align-items: center;
}

.header-actions {
  gap: 10px;
}

.freshness-badge {
  min-height: 44px;
  gap: 9px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  cursor: pointer;
}

.freshness-badge svg {
  width: 14px;
  height: 14px;
  margin-left: 2px;
}

.freshness-badge--live .status-dot {
  background: var(--secondary);
  box-shadow: 0 0 0 4px rgb(0 230 118 / 9%);
}

.freshness-badge--preview .status-dot,
.freshness-badge--stale .status-dot {
  background: var(--tertiary);
}

.freshness-badge--offline .status-dot {
  background: var(--danger);
}

.account-wrap {
  position: relative;
}

.account-button {
  min-height: 44px;
  gap: 8px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  padding: 0 13px;
  background: var(--surface);
  color: var(--text-soft);
  cursor: pointer;
}

.account-button svg {
  width: 15px;
  height: 15px;
}

.account-button span {
  max-width: 150px;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 9px);
  right: 0;
  width: 178px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-raised);
  box-shadow: var(--shadow);
}

.account-menu button {
  width: 100%;
  min-height: 42px;
  border: 0;
  padding: 0 13px;
  background: transparent;
  color: var(--text-soft);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.account-menu button:hover {
  background: var(--surface-hover);
}

/* Overview */
.overview-grid {
  display: grid;
  grid-template-columns: minmax(500px, 1.9fr) minmax(270px, .9fr);
  gap: 20px;
  padding-top: 30px;
}

.hero-card,
.summary-card,
.data-strip {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-card {
  position: relative;
  min-height: 440px;
  overflow: hidden;
  isolation: isolate;
}

.hero-card::after {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(180deg, rgb(10 10 11 / 20%) 30%, rgb(10 10 11 / 93%) 88%),
    linear-gradient(90deg, rgb(10 10 11 / 66%), transparent 58%);
  content: "";
  pointer-events: none;
}

.hero-card__heading {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.hero-card__heading h2 {
  margin: 7px 0 4px;
  font-size: 25px;
  letter-spacing: -.035em;
}

.hero-card__heading p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.hero-card__badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.vehicle-power-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  white-space: nowrap;
}

.vehicle-power-badge--on {
  border-color: rgb(0 230 118 / 30%);
  color: var(--secondary-soft);
}

.vehicle-power-badge--on .status-dot {
  background: var(--secondary);
  box-shadow: 0 0 0 4px rgb(0 230 118 / 9%);
}

.vehicle-power-badge--off .status-dot {
  background: var(--muted);
}

.vehicle-power-badge--preview {
  border-color: rgb(254 201 49 / 36%);
  color: var(--tertiary-soft);
}

.vehicle-power-badge--preview .status-dot {
  background: var(--tertiary);
}

.source-badge,
.data-label {
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 6px 9px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
}

.source-badge--live,
.data-label--live {
  border-color: rgb(0 230 118 / 30%);
  color: var(--secondary-soft);
}

.source-badge--preview,
.data-label--preview {
  border-color: rgb(254 201 49 / 36%);
  color: var(--tertiary-soft);
}

.vehicle-hero {
  position: absolute;
  z-index: -2;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 52% center;
}

.hero-metrics {
  position: absolute;
  z-index: 2;
  right: 22px;
  bottom: 20px;
  left: 22px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgb(198 248 255 / 15%);
  padding-top: 17px;
}

.metric-block {
  min-width: 0;
  border-right: 1px solid rgb(198 248 255 / 12%);
  padding: 0 19px;
}

.metric-block:first-child {
  padding-left: 0;
}

.metric-block:last-child {
  border-right: 0;
}

.metric-block p {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 760;
  letter-spacing: .08em;
}

.metric-block strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(27px, 3vw, 36px);
  letter-spacing: -.045em;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-block:first-child strong {
  color: var(--primary-soft);
}

.metric-block small,
.summary-primary small {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.summary-stack {
  display: grid;
  gap: 20px;
}

.summary-card {
  min-height: 210px;
  padding: 23px;
}

.summary-card--battery {
  background:
    linear-gradient(135deg, rgb(0 229 255 / 6%), transparent 60%),
    var(--surface);
}

.summary-card__title,
.summary-card__title > p,
.summary-primary,
.speed-row {
  display: flex;
  align-items: center;
}

.summary-card__title {
  justify-content: space-between;
  gap: 12px;
}

.summary-card__title > p {
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
}

.summary-card__title svg {
  width: 15px;
  height: 15px;
}

.info-button {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--primary-soft);
  cursor: help;
}

.info-button svg {
  width: 19px;
  height: 19px;
}

.summary-primary {
  justify-content: space-between;
  margin-top: 23px;
  color: var(--muted);
  font-size: 12px;
}

.summary-primary strong {
  color: var(--secondary);
  font-size: 26px;
}

.progress-track {
  height: 4px;
  margin: 8px 0 17px;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-hover);
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--secondary);
  transition: width .25s ease;
}

.summary-pairs,
.drive-details {
  display: grid;
  margin: 0;
}

.summary-pairs {
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  padding-top: 15px;
}

.summary-pairs div + div {
  border-left: 1px solid var(--border-soft);
  padding-left: 18px;
}

.summary-pairs dt,
.drive-details dt {
  color: var(--muted);
  font-size: 11px;
}

.summary-pairs dd,
.drive-details dd {
  margin: 6px 0 0;
  color: var(--text);
  font-size: 17px;
  font-weight: 720;
}

.summary-pairs small {
  color: var(--muted);
  font-size: 10px;
}

.card-note {
  margin: 14px 0 0;
  color: #71767b;
  font-size: 10px;
  line-height: 1.45;
}

.speed-row {
  justify-content: space-between;
  gap: 20px;
  margin-top: 24px;
}

.speed-value strong {
  display: block;
  font-size: 48px;
  letter-spacing: -.06em;
  line-height: .9;
}

.speed-value span,
.telemetry-state span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.telemetry-state {
  text-align: right;
}

.telemetry-state strong {
  display: block;
  margin-top: 6px;
  color: var(--primary-soft);
  font-size: 12px;
}

.drive-details {
  grid-template-columns: 1fr 1fr;
  margin-top: 21px;
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.drive-details div + div {
  text-align: right;
}

.drive-details dd {
  font-size: 13px;
}

.data-strip {
  display: grid;
  grid-template-columns: .8fr 1.25fr 1fr;
  gap: 0;
  margin-top: 20px;
  overflow: hidden;
}

.data-strip > div {
  min-width: 0;
  padding: 17px 20px;
}

.data-strip > div + div {
  border-left: 1px solid var(--border-soft);
}

.data-strip strong {
  display: block;
  margin-top: 7px;
  overflow: hidden;
  color: var(--text-soft);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.footer-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
}

@media (max-width: 1100px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .summary-stack {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 820px) {
  .dashboard,
  .dashboard.show {
    display: block;
  }

  .sidebar {
    position: fixed;
    z-index: 60;
    left: 0;
    width: min(var(--sidebar-width), 86vw);
    transform: translateX(-102%);
    box-shadow: var(--shadow);
    transition: transform .2s ease;
  }

  .dashboard.nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close,
  .menu-toggle {
    display: inline-grid;
  }

  .sidebar-backdrop {
    position: fixed;
    z-index: 50;
    inset: 0;
    border: 0;
    background: rgb(0 0 0 / 65%);
  }

  .dashboard.nav-open .sidebar-backdrop {
    display: block;
  }

  .main-content {
    padding: 0 18px 22px;
  }

  .page-header {
    min-height: 104px;
  }

  .account-button span {
    display: none;
  }

  .summary-stack {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .login-card {
    padding: 28px 22px;
  }

  .main-content {
    padding-inline: 14px;
  }

  .page-header {
    align-items: flex-start;
    padding: 19px 0;
  }

  .page-heading h1 {
    font-size: 34px;
  }

  .page-heading p:last-child,
  .freshness-badge svg,
  .account-wrap {
    display: none;
  }

  .freshness-badge {
    min-height: 44px;
    padding-inline: 10px;
    white-space: nowrap;
  }

  .overview-grid {
    padding-top: 18px;
  }

  .hero-card {
    min-height: 430px;
  }

  .hero-card__heading {
    padding: 19px;
  }

  .source-badge {
    display: none;
  }

  .vehicle-hero {
    object-position: 60% center;
  }

  .hero-metrics {
    right: 17px;
    bottom: 17px;
    left: 17px;
    grid-template-columns: 1fr 1fr;
    row-gap: 15px;
  }

  .metric-block {
    padding: 0 13px;
  }

  .metric-block:nth-child(2) {
    border-right: 0;
  }

  .metric-block:last-child {
    grid-column: 1 / -1;
    border-top: 1px solid rgb(198 248 255 / 12%);
    padding: 14px 0 0;
  }

  .metric-block strong {
    font-size: 27px;
  }

  .summary-card {
    padding: 19px;
  }

  .data-strip {
    grid-template-columns: 1fr;
  }

  .data-strip > div + div {
    border-top: 1px solid var(--border-soft);
    border-left: 0;
  }

  .footer-note {
    text-align: left;
  }
}

@media (max-width: 340px) {
  .page-header {
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 16px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
