@font-face {
  font-family: Manrope;
  src: url('/assets/manrope.ttf') format('truetype');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: Manrope, system-ui, sans-serif;
  background: #0c1016;
  color: #ecf1f7;
  --body: #0c1016;
  --sidebar: #10151d;
  --surface: #121923;
  --surface-soft: #161f2a;
  --line: #24303e;
  --muted: #a2aebd;
  --subtle: #8f9bab;
  --accent: #6fe3ce;
  --amber: #f4cb84;
  --radius: 16px;
  --gap: 16px;
  font-size: 100%;
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 280px; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.visually-hidden, .icon-library {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  translate: 0 -160%;
  padding: 10px 16px;
  color: var(--body);
  background: var(--accent);
  border-radius: 8px;
  font-weight: 800;
}

.skip-link:focus { translate: 0; }
.icon {
  display: block;
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.55;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.layout { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 44px;
  padding: 28px 18px 22px;
  background: var(--sidebar);
  border-right: 1px solid #202a35;
}

.brand { display: flex; align-items: center; gap: 11px; width: fit-content; margin-left: 5px; }
.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #0b2425;
  background: linear-gradient(145deg, #adf5e6, #5bd9c4 78%);
  box-shadow: 0 4px 24px #55e6c52a;
}
.brand-mark .icon { width: 24px; height: 24px; stroke-width: 1.85; }
.brand strong { display: block; font-size: 1.03rem; font-weight: 800; line-height: 1.1; }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: 0.75rem; line-height: 1; }
.nav-label { margin: 0 0 10px 12px; font-size: 0.69rem; font-weight: 800; letter-spacing: 0.14em; color: var(--subtle); text-transform: uppercase; }
.sidebar nav { display: grid; gap: 5px; }
.sidebar nav a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 46px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}
.sidebar nav a:hover, .connection:hover { color: #f4f8ff; background: #1a2430; }
.sidebar nav a[aria-current] { color: var(--accent); background: #152a2c; border-color: #264041; }
.sidebar nav a[aria-current]::before { content: ''; position: absolute; left: -1px; width: 2px; height: 23px; border-radius: 2px; background: var(--accent); }
.sidebar nav .icon { width: 18px; height: 18px; }
.sidebar-footer { margin-top: auto; }
.connection { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 9px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #141b25; }
.connection-icon { display: grid; width: 32px; height: 32px; place-items: center; color: var(--accent); background: #1c3135; border-radius: 8px; }
.connection-icon .icon { width: 16px; height: 16px; }
.connection strong, .connection small { display: block; white-space: nowrap; }
.connection strong { font-size: 0.85rem; }
.connection small { margin-top: 2px; color: var(--muted); font-size: 0.72rem; }
.read-only { display: flex; align-items: center; gap: 7px; margin: 14px 0 0 4px; color: var(--subtle); font-size: 0.76rem; }
.read-only .icon { width: 15px; height: 15px; }

main { width: 100%; max-width: 1780px; margin: 0 auto; padding: 30px 34px 34px; min-width: 0; }
.page-header { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-bottom: 24px; }
.page-header h1 { font-size: clamp(1.65rem, 3vw, 2.25rem); line-height: 1.2; font-weight: 800; letter-spacing: -0.045em; }
.page-header p { margin-top: 5px; font-size: 0.95rem; color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 10px; flex: none; }
.mode-chip, .source-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #4b3c29;
  border-radius: 8px;
  color: var(--amber);
  background: #261f17;
  padding: 7px 10px;
  white-space: nowrap;
  font-size: 0.76rem;
  font-weight: 800;
}
.state-dot { width: 6px; height: 6px; flex: none; border-radius: 50%; background: currentColor; }
.state-dot[data-source-state] { color: var(--subtle); }
.state-dot[data-source-state='fresh'] { color: var(--accent); box-shadow: 0 0 9px #6fe3ceb0; }
.state-dot[data-source-state='stale'] { color: var(--amber); }
.state-dot[data-source-state='error'] { color: #ff9a93; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 13px;
  border: 1px solid #344154;
  border-radius: 9px;
  color: #ecf1f7;
  background: var(--surface-soft);
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
}
.button .icon { width: 17px; height: 17px; color: var(--accent); }
.button:hover { background: #202c3a; }
.button[aria-disabled='true'] { color: var(--muted); cursor: progress; }
.button[aria-disabled='true'] .icon { animation: spin 1s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.notice {
  margin-bottom: 18px;
  padding: 11px 14px;
  border: 1px solid #4b3c29;
  border-radius: 9px;
  color: var(--amber);
  background: #261f17;
  font-size: 0.875rem;
}

.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.lead-grid, .lower-grid, .detail-grid { display: grid; grid-template-columns: minmax(0, 2.08fr) minmax(0, 1fr); gap: var(--gap); }
.hero {
  position: relative;
  display: grid;
  align-items: start;
  min-height: 305px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 78% 63%, #192735, #121b27 48%, #111923 76%);
}
.hero-image {
  position: absolute;
  z-index: -2;
  right: -1.5%;
  bottom: -22%;
  width: min(82%, 655px);
  height: auto;
  mask-image: linear-gradient(90deg, transparent, #000 22%), linear-gradient(0deg, #000 76%, transparent 100%);
  mask-composite: intersect;
}
.hero::after { content: ''; z-index: -1; position: absolute; inset: 0; background: linear-gradient(90deg, #111923 0%, #111923ca 17%, #11192330 41%, transparent 63%); }
.hero-copy { display: flex; flex-direction: column; width: fit-content; height: 100%; padding: 33px 30px 27px; }
.vehicle-generation { color: var(--accent); font-size: 0.79rem; font-weight: 800; letter-spacing: 0.17em; }
.vehicle-generation span { color: var(--subtle); }
.hero h2 { margin-top: 10px; font-size: clamp(2.55rem, 5vw, 3.75rem); font-weight: 800; line-height: 1; letter-spacing: -0.065em; }
.vehicle-trim { margin: 10px 0 22px; color: #b9c4d2; font-size: clamp(1.05rem, 2vw, 1.26rem); font-weight: 700; }
.vehicle-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: auto; }
.vehicle-state, .vehicle-platform { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid #314354; border-radius: 7px; color: #cbd6e2; background: #121b26e8; font-size: 0.74rem; font-weight: 800; white-space: nowrap; }
.vehicle-state .icon { height: 16px; width: 16px; color: var(--accent); }

.insight { display: flex; flex-direction: column; padding: 23px; background: radial-gradient(ellipse at 100% 0%, #1b3438 0%, #15242d 39%, #131b25 85%); border-color: #304449; }
.insight-header { display: flex; gap: 10px; align-items: center; }
.insight-header h2 { font-size: 1rem; font-weight: 800; }
.feature-icon { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 10px; border: 1px solid #35605f; color: var(--accent); background: #203e41; }
.feature-icon .icon { width: 23px; height: 23px; }
.insight-copy { margin: 25px 0 19px; }
.insight h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: -0.04em; line-height: 1.23; font-weight: 800; }
.insight-copy p { margin-top: 8px; color: #b6c2ce; font-size: 0.95rem; line-height: 1.6; }
.insight-footer { display: flex; align-items: center; gap: 7px; margin-top: auto; padding-top: 13px; border-top: 1px solid #30414a; color: #a7bfbe; font-size: 0.75rem; font-weight: 700; }
.insight-footer .icon { width: 15px; height: 15px; color: var(--accent); }

.telemetry-block { margin: 22px 0 19px; }
.section-heading, .card-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.section-heading { margin-bottom: 10px; }
.section-heading h2, .card-heading h2 { font-size: 1.12rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.025em; }
.capture-label { display: flex; align-items: center; gap: 6px; color: var(--subtle); font-size: 0.75rem; font-weight: 700; }
.capture-label .icon { width: 15px; height: 15px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.metric { min-height: 112px; padding: 13px 15px 14px; }
.metric-heading { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: var(--muted); }
.metric h3 { font-size: 0.88rem; line-height: 1.23; font-weight: 700; }
.metric-icon { display: grid; width: 32px; height: 32px; flex: none; place-items: center; border-radius: 8px; background: #1c2b34; color: var(--accent); }
.metric-icon .icon { width: 18px; height: 18px; }
.reading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.reading strong, .chart-stat strong { font-size: clamp(1.45rem, 3vw, 1.94rem); line-height: 1.05; letter-spacing: -0.05em; font-weight: 800; font-variant-numeric: tabular-nums; }
.reading span, .chart-stat span { color: var(--muted); font-size: 0.81rem; font-weight: 700; }
.metric progress { display: block; appearance: none; width: 100%; height: 4px; margin-top: 9px; border: 0; border-radius: 99px; background: #273644; }
.metric progress::-webkit-progress-bar { background: #273644; border-radius: 99px; }
.metric progress::-webkit-progress-value { border-radius: 99px; background: var(--accent); }
.metric progress::-moz-progress-bar { border-radius: 99px; background: var(--accent); }

.chart-card, .condition, .detail-card { padding: 18px 19px; }
.chart-stat { display: flex; gap: 7px; align-items: baseline; margin: 5px 0 3px; }
.chart-stat strong { font-size: 1.62rem; }
.segmented { display: flex; gap: 2px; padding: 3px; border: 1px solid #27323f; border-radius: 8px; background: #0f151e; }
.segmented button { min-height: 32px; padding: 0 9px; border: 0; border-radius: 5px; color: var(--muted); background: transparent; font-size: 0.75rem; font-weight: 800; white-space: nowrap; cursor: pointer; }
.segmented button:hover { background: #1e2b36; }
.segmented button[aria-pressed='true'] { color: var(--accent); background: #20353a; }
.chart-wrap { min-width: 0; height: 156px; }
.chart-wrap canvas { display: block; width: 100%; height: 100%; }
.condition .card-heading { min-height: 33px; }
.condition-list { list-style: none; padding: 0; margin: 8px 0 0; }
.condition-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 57px; }
.condition-list li + li { border-top: 1px solid var(--line); }
.condition-list li > span:nth-child(2) { color: #bac4d0; font-size: 0.82rem; line-height: 1.3; font-weight: 700; }
.condition-list strong { max-width: 135px; text-align: right; font-size: 0.83rem; font-weight: 800; }
.row-icon { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 8px; color: #a6b7c9; background: #1b2632; }
.row-icon .icon { width: 16px; height: 16px; }

.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-card { padding: 22px; }
.detail-list, .integration-list { margin-top: 12px; }
.detail-list > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 13px 0; }
.detail-list > div + div, .integration-list > div + div { border-top: 1px solid var(--line); }
.detail-list dt { color: var(--muted); font-size: 0.93rem; }
.detail-list dd { text-align: right; font-size: 0.94rem; font-weight: 800; }
.tire-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 15px; }
.tire-grid > div { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #161f2a; }
.tire-grid dt { color: var(--muted); font-size: 0.78rem; }
.tire-grid dd { margin-top: 6px; font-size: 1rem; font-weight: 800; }
.tire-grid dd span:first-child { color: var(--accent); font-size: 1.4rem; }
.service-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 15px; border-top: 1px solid var(--line); padding-top: 13px; font-size: 0.89rem; color: var(--muted); }
.service-line .icon { width: 16px; height: 16px; color: var(--accent); }
.service-line strong { margin-left: auto; color: #ecf1f7; }
.trip-view { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--gap); align-items: start; }
.chart-card-large .chart-wrap { height: 242px; }
table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
th, td { padding: 9px 5px; border-bottom: 1px solid var(--line); text-align: right; }
th:first-child, td:first-child { text-align: left; }
th { color: var(--muted); font-size: 0.73rem; }
tbody tr:last-child td { border-bottom: none; }
.source-chip { color: #b4c9ca; background: #19272c; border-color: #304248; }
.source-description { margin-top: 12px; color: var(--muted); line-height: 1.55; }
.integration-list > div { padding: 12px 0; }
.integration-list dt { font-size: 0.95rem; font-weight: 800; }
.integration-list dd { margin-top: 5px; color: var(--muted); font-size: 0.875rem; line-height: 1.55; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 194px minmax(0, 1fr); }
  main { padding-inline: 24px; }
  .lead-grid, .lower-grid { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
  .hero-copy { padding-inline: 23px; }
  .hero-image { bottom: -10%; width: 91%; }
  .insight { padding: 18px; }
}

@media (max-width: 920px) {
  :root { --gap: 12px; }
  .layout { grid-template-columns: 161px minmax(0, 1fr); }
  .sidebar { padding-inline: 12px; }
  main { padding-inline: 17px; }
  .hero-image { bottom: -5%; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lower-grid, .trip-view { grid-template-columns: 1fr; }
}

@media (max-width: 730px) {
  .layout { display: block; }
  .sidebar { position: relative; display: block; height: auto; padding: 13px 15px 9px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { margin: 0 0 11px; }
  .brand-mark { width: 36px; height: 36px; border-radius: 9px; }
  .brand-mark .icon { width: 20px; height: 20px; }
  .nav-label, .sidebar-footer { display: none; }
  .sidebar nav { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
  .sidebar nav a { flex-direction: column; justify-content: center; text-align: center; gap: 4px; padding: 5px 2px; min-height: 49px; font-size: clamp(0.66rem, 2.55vw, 0.82rem); }
  .sidebar nav a[aria-current]::before { display: none; }
  .sidebar nav .icon { width: 16px; height: 16px; }
  main { padding: 18px 15px 24px; }
  .page-header { margin-bottom: 17px; }
  .lead-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .hero-image { width: 95%; }
}

@media (max-width: 570px) {
  .page-header { align-items: flex-start; flex-wrap: wrap; }
  .page-header p { font-size: 0.86rem; }
  .lead-grid, .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .hero { min-height: 310px; }
  .hero-copy { padding: 20px 17px 16px; }
  .hero-image { width: min(103%, 480px); right: -1%; bottom: 3%; }
  .hero::after { background: linear-gradient(90deg, #111923b5, transparent 75%); }
  .insight { padding: 15px; }
  .insight-copy { margin: 12px 0 14px; }
  .telemetry-block { margin: 18px 0 14px; }
  .metric { min-height: 96px; padding: 10px; }
  .metric-icon { width: 27px; height: 27px; }
  .metric-icon .icon { width: 16px; height: 16px; }
  .chart-card, .condition, .detail-card { padding: 14px; }
  .chart-card-large .chart-wrap { height: 180px; }
}

@media (min-width: 921px) and (max-height: 800px) {
  main { padding-top: 20px; padding-bottom: 14px; }
  .page-header { margin-bottom: 16px; }
  .hero { min-height: 220px; }
  .hero-image { width: min(91%, 500px); bottom: -22%; }
  .hero-copy { padding-top: 23px; padding-bottom: 19px; }
  .hero h2 { font-size: clamp(2.55rem, 4vw, 3.1rem); }
  .insight { padding: 17px 20px; }
  .insight-copy { margin: 14px 0; }
  .insight-footer { padding-top: 9px; }
  .telemetry-block { margin: 16px 0 13px; }
  .metric { min-height: 94px; padding: 8px 13px; }
  .metric-icon { width: 28px; height: 28px; }
  .reading { margin-top: 4px; }
  .reading strong { font-size: 1.65rem; }
  .metric progress { margin-top: 6px; }
  .lower-grid .chart-card, .condition { padding-block: 13px; }
  .lower-grid .chart-wrap { height: 115px; }
  .condition-list li { min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  .button[aria-disabled='true'] .icon { animation: none; }
}
