:root {
  color-scheme: light;
  --bg: #f3f4ef;
  --bg-elevated: #fafbf7;
  --surface: #ffffff;
  --surface-2: #f7f8f4;
  --surface-3: #ecefe8;
  --text: #17201d;
  --text-soft: #64706b;
  --text-faint: #8c9692;
  --line: #dfe4dc;
  --line-strong: #cdd4ca;
  --primary: #214f3e;
  --primary-strong: #173a2e;
  --primary-soft: #e0ede4;
  --brand-bg: #173a2e;
  --accent: #acd95f;
  --accent-strong: #85bc33;
  --fuel: #dd8d31;
  --fuel-soft: #fff1de;
  --service: #397bb8;
  --service-soft: #e8f3fc;
  --expense: #8055b5;
  --expense-soft: #f1eafb;
  --danger: #b8473d;
  --danger-soft: #fae9e7;
  --warning: #9c6a20;
  --warning-soft: #fff4d9;
  --shadow-sm: 0 1px 2px rgb(24 39 33 / 5%), 0 6px 18px rgb(24 39 33 / 4%);
  --shadow-md: 0 16px 44px rgb(24 39 33 / 12%), 0 4px 14px rgb(24 39 33 / 7%);
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --sidebar-width: 248px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --font-body: Inter, Aptos, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: Inter, Aptos, var(--font-body);
}

html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #121714;
  --bg-elevated: #171d19;
  --surface: #1d2420;
  --surface-2: #222a25;
  --surface-3: #2b342e;
  --text: #eff3ef;
  --text-soft: #a6b1ab;
  --text-faint: #7f8a84;
  --line: #313b35;
  --line-strong: #435047;
  --primary: #8ac7a9;
  --primary-strong: #b5e0c9;
  --primary-soft: #263d31;
  --brand-bg: #173a2e;
  --accent: #b4df68;
  --accent-strong: #c4ec80;
  --fuel-soft: #3c2d1e;
  --service-soft: #203547;
  --expense-soft: #352a43;
  --danger-soft: #432724;
  --warning-soft: #3c321f;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / 18%), 0 8px 24px rgb(0 0 0 / 12%);
  --shadow-md: 0 18px 50px rgb(0 0 0 / 35%);
}

@media (prefers-color-scheme: dark) {
  html[data-theme='auto'] {
    color-scheme: dark;
    --bg: #121714;
    --bg-elevated: #171d19;
    --surface: #1d2420;
    --surface-2: #222a25;
    --surface-3: #2b342e;
    --text: #eff3ef;
    --text-soft: #a6b1ab;
    --text-faint: #7f8a84;
    --line: #313b35;
    --line-strong: #435047;
    --primary: #8ac7a9;
    --primary-strong: #b5e0c9;
    --primary-soft: #263d31;
    --brand-bg: #173a2e;
    --accent: #b4df68;
    --accent-strong: #c4ec80;
    --fuel-soft: #3c2d1e;
    --service-soft: #203547;
    --expense-soft: #352a43;
    --danger-soft: #432724;
    --warning-soft: #3c321f;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 18%), 0 8px 24px rgb(0 0 0 / 12%);
    --shadow-md: 0 18px 50px rgb(0 0 0 / 35%);
  }

  html[data-theme='auto'] .sidebar {
    background: rgb(23 29 25 / 88%);
  }

  html[data-theme='auto'] .topbar {
    background: rgb(18 23 20 / 78%);
  }

  html[data-theme='auto'] .bottom-nav {
    background: rgb(23 29 25 / 94%);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  text-rendering: optimizeLegibility;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 82% -10%, rgb(172 217 95 / 10%), transparent 34rem),
    var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select,
input[type='color'],
input[type='file'] {
  cursor: pointer;
}

button {
  border: 0;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(133 188 51 / 38%);
  outline-offset: 2px;
}

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.035em;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  line-height: 1.2;
}

h3 {
  margin-bottom: 0;
  font-size: 1.05rem;
}

small {
  color: var(--text-soft);
}

svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
}

[hidden] {
  display: none !important;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.noscript {
  margin: 2rem;
  padding: 1rem;
  border: 1px solid var(--danger);
  border-radius: var(--radius);
  background: var(--danger-soft);
}

.app-shell {
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 28px 20px 22px;
  border-right: 1px solid var(--line);
  background: rgb(250 251 247 / 86%);
  backdrop-filter: blur(18px);
}

html[data-theme='dark'] .sidebar {
  background: rgb(23 29 25 / 88%);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 11px;
  background: var(--brand-bg);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 8%);
}

.brand-mark svg {
  width: 19px;
  height: 19px;
}

.brand-mark.large {
  width: 58px;
  height: 58px;
  border-radius: 18px;
}

.brand-mark.large svg {
  width: 30px;
  height: 30px;
}

.side-nav {
  display: grid;
  gap: 5px;
  margin-top: 44px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 45px;
  padding: 0 13px;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  font-weight: 600;
  text-align: left;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.nav-item:hover {
  background: var(--surface-2);
  color: var(--text);
}

.nav-item:active {
  transform: scale(0.98);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

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

.sidebar-foot {
  display: grid;
  gap: 18px;
  margin-top: auto;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 4px;
}

.privacy-note div {
  display: grid;
  gap: 1px;
}

.privacy-note strong {
  font-size: 0.79rem;
}

.privacy-note small {
  font-size: 0.7rem;
}

.status-dot {
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent-strong);
  box-shadow: 0 0 0 4px rgb(172 217 95 / 14%);
}

.main-shell {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  min-height: 94px;
  align-items: center;
  gap: 24px;
  padding: 18px clamp(24px, 4vw, 58px);
  border-bottom: 1px solid transparent;
  background: rgb(243 244 239 / 78%);
  backdrop-filter: blur(18px);
}

html[data-theme='dark'] .topbar {
  background: rgb(18 23 20 / 78%);
}

.mobile-brand {
  display: none;
}

.page-heading {
  flex: 1;
}

.eyebrow,
.section-kicker {
  margin-bottom: 2px;
  color: var(--text-soft);
  font-size: 0.71rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.network-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 600;
}

.network-status > span:first-child {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-strong);
}

.network-status.offline > span:first-child {
  background: var(--fuel);
}

.network-status.not-ready > span:first-child {
  background: var(--service);
}

.vehicle-switcher {
  display: flex;
  height: 42px;
  align-items: center;
  gap: 6px;
  padding: 0 4px 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  touch-action: pan-y;
  user-select: none;
}

.vehicle-switcher[data-swipe-enabled='true'] {
  cursor: ew-resize;
}

.vehicle-switcher.switching-next {
  animation: vehicle-switch-next 240ms ease both;
}

.vehicle-switcher.switching-previous {
  animation: vehicle-switch-previous 240ms ease both;
}

@keyframes vehicle-switch-next {
  45% { opacity: 0.48; transform: translateX(-8px); }
  46% { transform: translateX(8px); }
}

@keyframes vehicle-switch-previous {
  45% { opacity: 0.48; transform: translateX(8px); }
  46% { transform: translateX(-8px); }
}

.vehicle-switcher svg {
  width: 17px;
  color: var(--primary);
}

.vehicle-switcher select {
  max-width: 180px;
  height: 38px;
  border: 0;
  outline: 0;
  background: transparent;
  font-weight: 600;
}

main {
  max-width: 1500px;
  margin: 0 auto;
  padding: 24px clamp(24px, 4vw, 58px) 70px;
}

main:focus {
  outline: none;
}

.view {
  display: none;
  animation: view-in 220ms ease both;
}

.view.active {
  display: block;
}

@keyframes view-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:active {
  transform: translateY(0) scale(0.985);
}

.button svg {
  width: 17px;
  height: 17px;
}

.button.primary {
  background: var(--brand-bg);
  color: #f5fff8;
  box-shadow: 0 7px 16px rgb(23 58 46 / 18%);
}

.button.primary:hover {
  box-shadow: 0 9px 22px rgb(23 58 46 / 24%);
}

.button.subtle {
  border-color: var(--line);
  background: var(--surface);
  color: var(--text);
}

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

.button.wide {
  width: 100%;
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-soft);
}

.icon-button:hover {
  background: var(--surface-3);
  color: var(--text);
}

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

.section-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.section-toolbar .section-kicker {
  margin-bottom: 5px;
}

.welcome-card {
  position: relative;
  display: grid;
  min-height: 430px;
  overflow: hidden;
  place-items: center;
  padding: 48px 24px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 20%, rgb(172 217 95 / 24%), transparent 20rem),
    linear-gradient(135deg, var(--surface), var(--bg-elevated));
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.welcome-card::before,
.welcome-card::after {
  position: absolute;
  width: 220px;
  height: 220px;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: '';
}

.welcome-card::before {
  top: -80px;
  right: -50px;
}

.welcome-card::after {
  bottom: -125px;
  left: -50px;
}

.welcome-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
}

.welcome-icon {
  display: grid;
  width: 78px;
  height: 78px;
  margin: 0 auto 24px;
  place-items: center;
  border-radius: 25px;
  background: var(--brand-bg);
  color: var(--accent);
  transform: rotate(-3deg);
  box-shadow: 0 18px 38px rgb(23 58 46 / 22%);
}

.welcome-icon svg {
  width: 40px;
  height: 40px;
}

.welcome-card h2 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 6vw, 3.2rem);
  line-height: 1.05;
}

.welcome-card p:not(.eyebrow) {
  max-width: 480px;
  margin: 0 auto 24px;
  color: var(--text-soft);
  font-size: 1rem;
}

.welcome-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
}

.hero-card {
  position: relative;
  display: grid;
  min-height: 255px;
  overflow: hidden;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  border-radius: var(--radius-lg);
  background: var(--brand-bg);
  color: #f5fff8;
  box-shadow: 0 20px 44px rgb(23 58 46 / 18%);
}

.hero-card::after {
  position: absolute;
  top: -110px;
  right: -40px;
  width: 340px;
  height: 340px;
  border: 1px solid rgb(255 255 255 / 9%);
  border-radius: 50%;
  box-shadow: 0 0 0 45px rgb(255 255 255 / 2%), 0 0 0 90px rgb(255 255 255 / 1.5%);
  content: '';
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 46px);
}

.hero-content .eyebrow {
  color: rgb(239 255 247 / 62%);
}

.hero-content h2 {
  max-width: 580px;
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.25rem);
  line-height: 1.03;
}

.hero-content > p:not(.eyebrow) {
  max-width: 520px;
  margin-bottom: 24px;
  color: rgb(239 255 247 / 68%);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.hero-actions .button.primary {
  background: var(--accent);
  color: #173a2e;
  box-shadow: none;
}

.hero-actions .button.subtle {
  border-color: rgb(255 255 255 / 15%);
  background: rgb(255 255 255 / 8%);
  color: #f5fff8;
}

.hero-vehicle {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 34px 24px 0;
}

.odometer-dial {
  position: relative;
  display: grid;
  width: 190px;
  height: 190px;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 13%);
  border-radius: 50%;
  background: rgb(255 255 255 / 5%);
  box-shadow: inset 0 0 0 16px rgb(255 255 255 / 2%);
}

.odometer-dial::before {
  position: absolute;
  inset: 13px;
  border: 8px solid rgb(255 255 255 / 10%);
  border-top-color: var(--accent);
  border-right-color: var(--accent);
  border-radius: 50%;
  content: '';
  transform: rotate(34deg);
}

.dial-content {
  position: relative;
  z-index: 1;
  display: grid;
  text-align: center;
}

.dial-content strong {
  font-family: var(--font-display);
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.dial-content small {
  color: rgb(239 255 247 / 60%);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.metric-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.metric-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 15px;
  color: var(--text-soft);
  font-size: 0.76rem;
  font-weight: 600;
}

.metric-icon {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 9px;
}

.metric-icon svg {
  width: 16px;
  height: 16px;
}

.metric-icon.fuel { background: var(--fuel-soft); color: var(--fuel); }
.metric-icon.service { background: var(--service-soft); color: var(--service); }
.metric-icon.expense { background: var(--expense-soft); color: var(--expense); }
.metric-icon.primary { background: var(--primary-soft); color: var(--primary); }

.metric-value {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.4vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.045em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-foot {
  display: block;
  margin-top: 3px;
  color: var(--text-faint);
  font-size: 0.7rem;
}

.dashboard-grid,
.reports-grid,
.garage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.panel-head h3 {
  margin-bottom: 3px;
}

.panel-head p,
.panel-head small {
  margin-bottom: 0;
  color: var(--text-soft);
  font-size: 0.73rem;
}

.text-button {
  padding: 3px;
  background: transparent;
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
}

.timeline-list {
  display: grid;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px 4px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.timeline-item:last-child {
  border-bottom: 0;
}

button.timeline-item:hover {
  padding-right: 8px;
  padding-left: 8px;
  border-radius: 12px;
  background: var(--surface-2);
}

.record-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 13px;
}

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

.record-icon.fuel { background: var(--fuel-soft); color: var(--fuel); }
.record-icon.service { background: var(--service-soft); color: var(--service); }
.record-icon.expense { background: var(--expense-soft); color: var(--expense); }

.timeline-copy {
  min-width: 0;
}

.timeline-copy strong,
.timeline-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.timeline-copy strong {
  font-size: 0.88rem;
}

.timeline-copy small {
  margin-top: 2px;
  font-size: 0.7rem;
}

.timeline-amount {
  text-align: right;
}

.timeline-amount strong,
.timeline-amount small {
  display: block;
}

.timeline-amount strong {
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.timeline-amount small {
  font-size: 0.67rem;
}

.reminder-list {
  display: grid;
  gap: 10px;
}

.reminder-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  padding: 13px;
  border-radius: 13px;
  background: var(--surface-2);
}

.reminder-item.due {
  background: var(--warning-soft);
}

.reminder-dot {
  width: 9px;
  height: 9px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--service);
  box-shadow: 0 0 0 4px rgb(57 123 184 / 12%);
}

.reminder-item.due .reminder-dot {
  background: var(--fuel);
  box-shadow: 0 0 0 4px rgb(221 141 49 / 14%);
}

.reminder-item strong,
.reminder-item small {
  display: block;
}

.reminder-item strong {
  font-size: 0.82rem;
}

.reminder-item small {
  margin-top: 2px;
  font-size: 0.69rem;
}

.empty-inline {
  display: grid;
  min-height: 180px;
  place-items: center;
  padding: 24px;
  color: var(--text-soft);
  text-align: center;
}

.empty-inline .record-icon {
  margin: 0 auto 12px;
}

.empty-inline strong,
.empty-inline small {
  display: block;
}

.empty-inline strong {
  color: var(--text);
}

.empty-inline small {
  max-width: 300px;
  margin: 4px auto 13px;
}

.filter-row {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 7px;
  margin-bottom: 16px;
}

.filter-chip {
  min-height: 37px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.77rem;
  font-weight: 700;
}

.filter-chip.active {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.search-field {
  min-width: 230px;
  margin-left: auto;
}

.search-field input {
  width: 100%;
  min-height: 39px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  background: var(--surface);
}

.search-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgb(47 125 93 / 10%);
}

.logbook-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.logbook-group {
  padding: 4px 22px 13px;
}

.logbook-group + .logbook-group {
  border-top: 7px solid var(--surface-2);
}

.logbook-date {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 4px 6px;
}

.logbook-date strong {
  font-family: var(--font-display);
  font-size: 0.83rem;
}

.logbook-date span {
  color: var(--text-soft);
  font-size: 0.68rem;
}

.period-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.period-control button {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.73rem;
  font-weight: 700;
}

.period-control button.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.report-summary .metric-card {
  padding: 18px;
}

.report-summary .metric-head {
  margin-bottom: 10px;
}

.reports-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.chart-panel.wide {
  grid-column: 1 / -1;
}

.chart-area {
  min-height: 230px;
}

.chart-frame {
  --chart-axis-font-size: 12px;

  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.chart-frame svg {
  display: block;
  max-width: 100%;
}

.chart-overview-note {
  display: block;
  margin-top: 7px;
  color: var(--text-faint);
  font-size: 0.62rem;
}

.bar-chart {
  display: grid;
  width: 100%;
  height: 230px;
  grid-template-columns: 78px minmax(0, 1fr);
  grid-template-rows: 180px 30px;
  column-gap: 10px;
  padding-top: 20px;
}

.bar-plot {
  position: relative;
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-items: stretch;
  gap: clamp(4px, 1vw, 12px);
}

.bar-y-axis {
  position: relative;
  grid-column: 1;
  grid-row: 1;
}

.bar-y-axis-label {
  position: absolute;
  right: 0;
  color: var(--text-faint);
  font-size: var(--chart-axis-font-size);
  line-height: 1;
  transform: translateY(-50%);
  white-space: nowrap;
}

.bar-y-axis-sizer {
  display: grid;
  width: max-content;
  height: 0;
  overflow: hidden;
  font-size: var(--chart-axis-font-size);
  line-height: 1;
  visibility: hidden;
  white-space: nowrap;
}

.bar-grid-line {
  position: absolute;
  z-index: 0;
  right: 0;
  left: 0;
  border-top: 1px solid var(--line);
  pointer-events: none;
}

.bar-chart.dense .bar-plot {
  gap: 0;
}

.bar-column {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  outline: 0;
  text-align: center;
}

.bar-chart.dense .bar-stack {
  width: calc(100% - 1px);
  margin-inline: auto;
  border-radius: 4px 4px 1px 1px;
}

.bar-column:hover .bar-stack,
.bar-column:focus .bar-stack {
  filter: brightness(1.12);
  transform: translateY(-3px);
}

.bar-stack {
  display: flex;
  min-height: 3px;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 7px 7px 3px 3px;
  background: var(--surface-3);
  transition: height 320ms ease, filter 160ms ease, transform 160ms ease;
}

.bar-segment.fuel { background: var(--fuel); }
.bar-segment.service { background: var(--service); }
.bar-segment.expense { background: var(--expense); }

.bar-axis {
  position: relative;
  grid-column: 2;
  grid-row: 2;
  height: 20px;
}

.bar-axis-label {
  position: absolute;
  top: 7px;
  color: var(--text-faint);
  font-size: var(--chart-axis-font-size);
  line-height: 1;
  transform: translateX(-50%);
  white-space: nowrap;
}

.bar-axis-label.first { transform: none; }
.bar-axis-label.last { transform: translateX(-100%); }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.legend-context {
  margin-left: auto;
  color: var(--text-faint);
  font-size: 0.64rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
  font-size: 0.68rem;
}

.legend-item i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.line-chart {
  width: 100%;
  height: 230px;
  overflow: visible;
}

.line-chart text {
  fill: var(--text-faint);
  font-family: var(--font-body);
  font-size: var(--chart-axis-font-size);
}

.line-chart .grid-line {
  stroke: var(--line);
  stroke-width: 1;
}

.line-chart .area {
  fill: url(#efficiencyGradient);
}

.line-chart .line {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.line-chart .point {
  fill: var(--surface);
  stroke: var(--primary);
  stroke-width: 3;
}

.fuel-economy-legend {
  margin-bottom: 8px;
}

.fuel-economy-chart {
  height: 250px;
}

.fuel-economy-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.fuel-economy-point,
.chart-point {
  fill: var(--surface);
  stroke-width: 3;
}

.chart-point {
  cursor: pointer;
  outline: 0;
  transform-box: fill-box;
  transform-origin: center;
  transition: filter 140ms ease, transform 140ms ease;
}

.chart-point:hover,
.chart-point:focus {
  filter: brightness(1.18);
  transform: scale(1.4);
}

.fuel-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.fuel-stat {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.fuel-stat > span,
.fuel-stat strong,
.fuel-stat small {
  display: block;
}

.fuel-stat > span {
  color: var(--text-soft);
  font-size: 0.67rem;
  font-weight: 650;
}

.fuel-stat strong {
  overflow: hidden;
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 1.5vw, 1.2rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fuel-stat small {
  margin-top: 4px;
  font-size: 0.62rem;
}

.economy-range {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.economy-range > div {
  min-width: 0;
}

.economy-range > div:nth-child(2) {
  padding: 0 16px;
  border-right: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: center;
}

.economy-range > div:last-child {
  text-align: right;
}

.economy-range span,
.economy-range strong {
  display: block;
}

.economy-range span {
  color: var(--text-soft);
  font-size: 0.64rem;
}

.economy-range strong {
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.economy-range .average strong {
  color: var(--fuel);
  font-size: 1.08rem;
}

.report-range-foot {
  margin-top: 16px;
  color: var(--text-faint);
  font-size: 0.65rem;
  text-align: center;
}

.station-economy-block {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.station-chart-legend {
  margin-bottom: 8px;
}

.station-economy-chart {
  width: 100%;
  min-width: 0;
  height: 260px;
}

.station-series-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.station-series-point {
  fill: var(--surface);
  stroke-width: 3;
}

.station-chart-empty {
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.station-summary-disclosure {
  min-width: 0;
}

.station-summary-toggle {
  display: flex;
  min-height: 54px;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-2);
  cursor: pointer;
  list-style: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.station-summary-toggle::-webkit-details-marker {
  display: none;
}

.station-summary-toggle:hover,
.station-summary-toggle:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-3);
  outline: 0;
}

.station-summary-toggle > span:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.station-summary-toggle strong {
  font-size: 0.76rem;
}

.station-summary-toggle small {
  overflow: hidden;
  color: var(--text-soft);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-summary-action {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 700;
}

.station-summary-action i {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentcolor;
  border-bottom: 2px solid currentcolor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 160ms ease;
}

.station-summary-disclosure .when-open {
  display: none;
}

.station-summary-disclosure[open] .when-closed {
  display: none;
}

.station-summary-disclosure[open] .when-open {
  display: inline;
}

.station-summary-disclosure[open] .station-summary-action i {
  transform: translateY(2px) rotate(225deg);
}

.station-summary-content {
  padding-top: 12px;
}

.station-summary-disclosure:not([open]) > .station-summary-content {
  display: none;
}

.station-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.station-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) repeat(3, minmax(110px, 0.8fr));
  align-items: center;
  gap: 16px;
  padding: 13px 15px;
  border-top: 1px solid var(--line);
}

.station-row:first-child {
  border-top: 0;
}

.station-row > div:not(.station-name) {
  text-align: right;
}

.station-row strong,
.station-row small {
  display: block;
}

.station-row strong {
  font-size: 0.76rem;
}

.station-row small {
  margin-top: 3px;
  font-size: 0.61rem;
}

.station-name {
  min-width: 0;
}

.station-name strong,
.station-name small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-header {
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.station-header span:not(:first-child) {
  text-align: right;
}

.odometer-legend {
  margin-bottom: 6px;
}

.odometer-chart {
  width: 100%;
  min-width: 0;
  height: 250px;
}

.odometer-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.odometer-point {
  fill: var(--surface);
  stroke: var(--point-color, var(--primary));
  stroke-width: 3;
}

.odometer-point.dense-point:not(.marker) {
  fill: transparent;
  stroke: transparent;
}

.odometer-point.dense-point:not(.marker):hover,
.odometer-point.dense-point:not(.marker):focus {
  fill: var(--surface);
  stroke: var(--point-color, var(--primary));
}

[data-chart-tooltip] {
  cursor: pointer;
}

.legend-item[data-chart-tooltip],
.category-row[data-chart-tooltip],
.donut[data-chart-tooltip] {
  border-radius: 7px;
  outline: 0;
}

.legend-item[data-chart-tooltip]:focus,
.category-row[data-chart-tooltip]:focus,
.donut[data-chart-tooltip]:focus {
  box-shadow: 0 0 0 3px rgb(47 125 93 / 18%);
}

.chart-tooltip {
  position: fixed;
  z-index: 400;
  max-width: min(320px, calc(100vw - 16px));
  padding: 9px 11px;
  border: 1px solid rgb(255 255 255 / 12%);
  border-radius: 10px;
  background: #101a16;
  box-shadow: 0 10px 30px rgb(0 0 0 / 25%);
  color: #f7faf8;
  font-size: 0.7rem;
  font-weight: 650;
  line-height: 1.45;
  pointer-events: none;
}

.chart-tooltip[hidden] {
  display: none;
}

.breakdown-layout {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 230px;
}

.donut {
  position: relative;
  width: 140px;
  height: 140px;
  border-radius: 50%;
}

.donut::after {
  position: absolute;
  inset: 24px;
  display: block;
  border-radius: 50%;
  background: var(--surface);
  content: '';
}

.donut-center {
  position: absolute;
  z-index: 1;
  inset: 38px;
  display: grid;
  place-content: center;
  text-align: center;
}

.donut-center strong {
  font-family: var(--font-display);
  font-size: 0.9rem;
}

.donut-center small {
  font-size: 0.58rem;
  text-transform: uppercase;
}

.category-bars {
  display: grid;
  gap: 12px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(70px, 110px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  font-size: 0.7rem;
}

.category-row > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.category-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--service);
}

.category-row:nth-child(2n) .category-fill { background: var(--expense); }
.category-row:nth-child(3n) .category-fill { background: var(--fuel); }

.method-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.7rem;
}

.method-note svg {
  width: 16px;
  flex: 0 0 auto;
  margin-top: 1px;
  color: var(--primary);
}

.garage-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  align-items: start;
}

.vehicle-list {
  display: grid;
  gap: 10px;
}

.vehicle-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}

.vehicle-card:hover {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.vehicle-avatar {
  display: grid;
  width: 49px;
  height: 49px;
  place-items: center;
  border-radius: 15px;
  color: #fff;
}

.vehicle-avatar svg {
  width: 24px;
  height: 24px;
}

.vehicle-details {
  min-width: 0;
}

.vehicle-details strong,
.vehicle-details small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vehicle-details small {
  margin-top: 2px;
  font-size: 0.7rem;
}

.vehicle-stat {
  text-align: right;
}

.vehicle-stat strong,
.vehicle-stat small {
  display: block;
}

.vehicle-stat strong {
  font-family: var(--font-display);
  font-size: 0.84rem;
}

.vehicle-stat small {
  font-size: 0.62rem;
  text-transform: uppercase;
}

.settings-stack {
  display: grid;
  gap: 16px;
}

.settings-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.settings-card h3 {
  margin-bottom: 5px;
}

.settings-card > p {
  margin-bottom: 17px;
  color: var(--text-soft);
  font-size: 0.72rem;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 11px 0;
  border-top: 1px solid var(--line);
}

.settings-row:first-of-type {
  border-top: 0;
}

.settings-row label,
.settings-row > div:first-child {
  min-width: 0;
}

.settings-row strong,
.settings-row small {
  display: block;
}

.settings-row strong {
  font-size: 0.8rem;
}

.settings-row small {
  font-size: 0.66rem;
}

.settings-row select {
  max-width: 145px;
  min-height: 36px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.data-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.data-actions .button {
  min-width: 0;
  font-size: 0.72rem;
}

.data-actions .project-link {
  grid-column: 1 / -1;
  text-decoration: none;
}

.storage-status {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 0.67rem;
  font-weight: 600;
}

.storage-status svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.storage-status span {
  min-width: 0;
  flex: 1;
}

.storage-status .text-button {
  flex: 0 0 auto;
}

.storage-protection-note {
  margin: 8px 2px 0;
  color: var(--text-soft);
  font-size: 0.67rem;
  line-height: 1.5;
}

.danger-zone {
  color: var(--danger);
}

.modal {
  width: min(670px, calc(100vw - 28px));
  max-height: min(900px, calc(100dvh - 28px));
  padding: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 22px;
  outline: 0;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.modal::backdrop {
  background: rgb(9 18 14 / 52%);
  backdrop-filter: blur(4px);
}

.modal > form,
.modal:not(.action-modal) {
  padding: 24px;
}

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

.modal-head .eyebrow {
  margin-bottom: 3px;
}

.modal h2 {
  font-size: 1.45rem;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 20px;
  padding: 4px;
  border-radius: 13px;
  background: var(--surface-2);
}

.segmented-control button {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.77rem;
  font-weight: 700;
}

.segmented-control button.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.segmented-control button svg {
  width: 16px;
  height: 16px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.contents {
  display: contents;
}

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field.full,
.form-divider.full,
.check-row.full {
  grid-column: 1 / -1;
}

.field > span,
.attachment-field > span {
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 700;
}

.field > span small,
.attachment-field > span small {
  margin-left: 3px;
  font-size: 0.63rem;
  font-weight: 500;
}

.field-hint {
  margin-top: -2px;
  color: var(--text-faint);
  font-size: 0.62rem;
  line-height: 1.35;
}

.calculated-value {
  display: block;
  min-height: 18px;
  margin-top: -1px;
  color: var(--text-faint);
  font-size: 0.63rem;
  line-height: 1.4;
}

.calculated-value.ready {
  color: var(--primary);
  font-weight: 700;
}

.field input:not([type='color']):not([type='file']),
.field select,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: 0;
  background: var(--surface-2);
  transition: border 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.field textarea {
  min-height: 84px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgb(47 125 93 / 11%);
}

.suggestion-chips {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 0 2px;
  scrollbar-width: none;
}

.suggestion-chips::-webkit-scrollbar {
  display: none;
}

.suggestion-chips button {
  min-height: 29px;
  flex: 0 0 auto;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-soft);
  font-size: 0.64rem;
  font-weight: 700;
}

.suggestion-chips button:hover,
.suggestion-chips button.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.field input:user-invalid,
.field select:user-invalid {
  border-color: var(--danger);
}

.color-field input {
  width: 100%;
  height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}

.check-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.check-card {
  position: relative;
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-2);
  cursor: pointer;
}

.check-card input {
  position: absolute;
  opacity: 0;
}

.check-card > span {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: transparent;
}

.check-card > span svg {
  width: 14px;
  height: 14px;
}

.check-card input:checked + span {
  border-color: var(--primary);
  background: var(--brand-bg);
  color: #fff;
}

.check-card:has(input:focus-visible) {
  outline: 3px solid rgb(133 188 51 / 38%);
  outline-offset: 2px;
}

.check-card div {
  min-width: 0;
}

.check-card strong,
.check-card small {
  display: block;
}

.check-card strong {
  font-size: 0.72rem;
}

.check-card small {
  overflow: hidden;
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.form-divider {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 3px;
  color: var(--text-soft);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
}

.form-divider::after {
  height: 1px;
  flex: 1;
  background: var(--line);
  content: '';
}

.form-divider small {
  order: 2;
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: none;
}

.file-drop {
  display: inline-flex;
  width: max-content;
  min-height: 40px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.7rem;
  font-weight: 700;
}

.file-drop input {
  position: absolute;
  width: 1px;
  opacity: 0;
}

.file-drop svg {
  width: 15px;
  height: 15px;
}

.attachment-preview {
  position: relative;
  width: 112px;
  height: 76px;
  margin-top: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.attachment-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attachment-preview button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: rgb(0 0 0 / 64%);
  color: white;
}

.attachment-preview button svg {
  width: 13px;
  height: 13px;
}

.form-error {
  margin: 16px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.72rem;
  font-weight: 600;
}

.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.action-spacer {
  flex: 1;
}

.compact-modal {
  width: min(570px, calc(100vw - 28px));
}

.import-review {
  display: grid;
  gap: 12px;
}

.import-counts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.import-count {
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
}

.import-count strong,
.import-count small {
  display: block;
}

.import-count strong {
  font-family: var(--font-display);
  font-size: 1.3rem;
}

.import-count small {
  font-size: 0.63rem;
  text-transform: uppercase;
}

.import-warning {
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 0.7rem;
}

.action-modal {
  width: min(600px, calc(100vw - 28px));
  padding: 24px;
}

.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.action-grid > button {
  display: flex;
  min-height: 165px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--surface-2);
  text-align: left;
}

.action-grid > button:hover {
  border-color: var(--line-strong);
  background: var(--surface-3);
  transform: translateY(-2px);
}

.action-grid strong,
.action-grid small {
  display: block;
}

.action-grid strong {
  margin-top: 18px;
  font-size: 0.82rem;
}

.action-grid small {
  margin-top: 3px;
  font-size: 0.65rem;
}

.action-icon {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 13px;
}

.action-icon.fuel { background: var(--fuel-soft); color: var(--fuel); }
.action-icon.service { background: var(--service-soft); color: var(--service); }
.action-icon.expense { background: var(--expense-soft); color: var(--expense); }

.loading-screen {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 16px;
  background: var(--bg);
  transition: opacity 220ms ease;
}

.loading-screen p {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.loading-screen.leaving {
  pointer-events: none;
  opacity: 0;
}

.toast-region {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: grid;
  width: min(360px, calc(100vw - 28px));
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-md);
  font-size: 0.75rem;
  font-weight: 600;
  animation: toast-in 220ms ease both;
}

.toast::before {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--accent-strong);
  content: '';
}

.toast.error::before {
  background: var(--danger);
}

.toast.leaving {
  animation: toast-out 180ms ease both;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
}

@keyframes toast-out {
  to { opacity: 0; transform: translateY(6px); }
}

.bottom-nav,
.mobile-fab {
  display: none;
}

@media (max-width: 1100px) {
  :root { --sidebar-width: 218px; }
  .network-status { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr); }
}

@media (max-width: 840px) {
  body { padding-bottom: calc(82px + var(--safe-bottom)); }
  .sidebar { display: none; }
  .main-shell { margin-left: 0; }
  .topbar {
    min-height: 72px;
    gap: 12px;
    padding: 12px 17px;
  }
  .mobile-brand { display: flex; flex: 1; align-items: center; gap: 9px; }
  .mobile-brand .brand-mark { width: 34px; height: 34px; }
  .mobile-brand strong { font-family: var(--font-display); font-size: 0.92rem; }
  .page-heading { display: none; }
  .topbar-actions { gap: 6px; }
  .vehicle-switcher { max-width: 175px; }
  .vehicle-switcher select { max-width: 128px; font-size: 0.75rem; }
  .install-button span { display: none; }
  .install-button { width: 42px; padding: 0; }
  main { padding: 17px 15px 25px; }
  .hero-card { grid-template-columns: minmax(0, 1fr); }
  .hero-content { padding: 30px 25px 18px; }
  .hero-content h2 { font-size: clamp(1.9rem, 9vw, 2.8rem); }
  .hero-vehicle { justify-content: flex-start; padding: 0 25px 30px; }
  .odometer-dial { width: 128px; height: 128px; }
  .odometer-dial::before { inset: 9px; border-width: 6px; }
  .dial-content strong { font-size: 1.25rem; }
  .metric-grid { gap: 10px; margin-top: 10px; }
  .metric-card { padding: 16px; }
  .metric-value { font-size: 1.3rem; }
  .dashboard-grid,
  .reports-grid,
  .garage-grid { grid-template-columns: 1fr; gap: 10px; margin-top: 10px; }
  .chart-panel.wide { grid-column: auto; }
  .report-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .fuel-overview-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-toolbar { align-items: center; margin-bottom: 18px; }
  .section-toolbar h2 { font-size: 1.35rem; }
  .desktop-action { display: none; }
  .filter-row { overflow-x: auto; overflow-y: hidden; margin-right: 0; padding: 0 1px 2px; overscroll-behavior-inline: contain; scrollbar-width: none; }
  .filter-row::-webkit-scrollbar { display: none; }
  .filter-chip { flex: 0 0 auto; }
  .search-field { min-width: 210px; flex: 0 0 auto; }
  .reports-toolbar { align-items: flex-start; flex-direction: column; }
  .bottom-nav {
    position: fixed;
    z-index: 30;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: calc(68px + var(--safe-bottom));
    grid-template-columns: repeat(2, 1fr) 62px repeat(2, 1fr);
    align-items: start;
    padding: 6px 8px var(--safe-bottom);
    border-top: 1px solid var(--line);
    background: rgb(250 251 247 / 94%);
    box-shadow: 0 -8px 30px rgb(24 39 33 / 7%);
    backdrop-filter: blur(20px);
  }
  html[data-theme='dark'] .bottom-nav { background: rgb(23 29 25 / 94%); }
  .bottom-nav .nav-item {
    display: flex;
    min-width: 0;
    min-height: 55px;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    padding: 0 3px;
    border-radius: 9px;
    font-size: 0.62rem;
    text-align: center;
  }
  .bottom-nav .nav-item.active { background: transparent; color: var(--primary); }
  .bottom-nav .nav-item svg { width: 20px; height: 20px; }
  .mobile-fab {
    position: fixed;
    z-index: 35;
    bottom: calc(33px + var(--safe-bottom));
    left: 50%;
    display: grid;
    width: 56px;
    height: 56px;
    place-items: center;
    border: 5px solid var(--bg-elevated);
    border-radius: 50%;
    background: var(--brand-bg);
    color: var(--accent);
    box-shadow: 0 9px 20px rgb(23 58 46 / 28%);
    transform: translateX(-50%);
  }
  .mobile-fab:active { transform: translateX(-50%) scale(0.96); }
  .mobile-fab svg { width: 23px; height: 23px; }
  .toast-region { right: 14px; bottom: calc(84px + var(--safe-bottom)); }
}

@media (max-width: 560px) {
  .topbar { padding-right: 12px; padding-left: 12px; }
  .mobile-brand strong { display: none; }
  .vehicle-switcher { max-width: 155px; }
  .vehicle-switcher select { max-width: 110px; }
  main { padding-right: 12px; padding-left: 12px; }
  .welcome-card { min-height: calc(100dvh - 190px); padding: 35px 18px; border-radius: 22px; }
  .welcome-card h2 { font-size: 2.25rem; }
  .welcome-actions { flex-direction: column; }
  .welcome-actions .button { width: 100%; }
  .hero-card { border-radius: 20px; }
  .hero-content { padding: 26px 20px 17px; }
  .hero-vehicle { padding: 0 20px 24px; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric-card { padding: 14px; }
  .metric-head { margin-bottom: 10px; font-size: 0.67rem; }
  .metric-value { font-size: 1.17rem; }
  .panel { padding: 17px; }
  .timeline-item { gap: 10px; }
  .record-icon { width: 38px; height: 38px; border-radius: 11px; }
  .timeline-amount strong { font-size: 0.82rem; }
  .section-toolbar .button { min-width: 42px; padding: 0 11px; }
  .section-toolbar .button svg + span { display: none; }
  .report-summary .metric-card { padding: 14px; }
  .reports-grid { grid-template-columns: minmax(0, 1fr); }
  .chart-frame { --chart-axis-font-size: 14px; }
  .bar-chart { grid-template-columns: max-content minmax(0, 1fr); column-gap: 6px; }
  .chart-overview-note { font-size: 0.65rem; }
  .station-economy-chart { height: 250px; }
  .legend-context { width: 100%; margin-left: 0; }
  .legend-context.axis-unit-context { width: auto; margin-left: auto; }
  .station-summary-toggle { padding: 11px 12px; }
  .station-summary-action { font-size: 0.65rem; }
  .station-table { overflow: visible; border: 0; }
  .station-header { display: none; }
  .station-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px 16px;
    margin-top: 8px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-2);
  }
  .station-row:first-child + .station-row { margin-top: 0; border-top: 1px solid var(--line); }
  .station-name { grid-column: 1 / -1; padding-bottom: 9px; border-bottom: 1px solid var(--line); }
  .station-row > div:not(.station-name) { text-align: left; }
  .station-row > div:not(.station-name)::before { display: block; margin-bottom: 3px; color: var(--text-faint); content: attr(data-label); font-size: 0.57rem; font-weight: 700; text-transform: uppercase; }
  .station-row > div:last-child { grid-column: 1 / -1; }
  .breakdown-layout { grid-template-columns: 1fr; justify-items: center; }
  .category-bars { width: 100%; }
  .garage-grid { grid-template-columns: minmax(0, 1fr); }
  .vehicle-card { padding: 12px; }
  .vehicle-stat { display: none; }
  .data-actions { grid-template-columns: 1fr; }
  .modal {
    width: 100vw;
    max-width: none;
    max-height: calc(100dvh - 12px);
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 22px 22px 0 0;
  }
  .modal > form,
  .modal:not(.action-modal) { padding: 19px 16px calc(18px + var(--safe-bottom)); }
  .action-modal { padding: 19px 16px calc(18px + var(--safe-bottom)); }
  .form-grid { grid-template-columns: 1fr; gap: 13px; }
  .field.full,
  .form-divider.full,
  .check-row.full { grid-column: auto; }
  .check-row { grid-template-columns: 1fr; }
  .segmented-control button { gap: 5px; font-size: 0.7rem; }
  .modal-actions { position: sticky; bottom: calc(-18px - var(--safe-bottom)); margin-right: -16px; margin-left: -16px; padding: 14px 16px calc(14px + var(--safe-bottom)); background: var(--surface); }
  .modal-actions .button { padding: 0 13px; }
  .modal-actions.stacked-mobile { position: static; display: grid; margin: 20px 0 0; padding: 16px 0 0; }
  .modal-actions.stacked-mobile .button { width: 100%; }
  .action-grid { grid-template-columns: 1fr; }
  .action-grid > button { min-height: 90px; flex-flow: row wrap; align-items: center; justify-content: flex-start; gap: 0 12px; }
  .action-grid strong { margin-top: 0; }
  .action-grid small { width: calc(100% - 55px); margin-left: 55px; margin-top: -15px; }
}

@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;
  }
}
