:root {
  color-scheme: dark;
  --paper: #000;
  --white: #1c1c21;
  --ink: #f3f3f6;
  --muted: #a3a3af;
  --line: #303037;
  --navy: #161619;
  --blue: #ff681e;
  --orange: #ff681e;
  --green: #75ce85;
  --red: #ff453a;
  --radius: 14px;
  background: var(--paper);
  font-size: 14px;
}
body {
  background: var(--paper);
}
html {
  scroll-padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
button,
.button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 550;
  border-radius: 9px;
}
button:not(.secondary):not(.quiet):not(.active):not(.danger):not(.car-tile):not(
    .compact-schedule
  ):not(.summary-car) {
  color: #17100b;
}
.secondary {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}
.quiet {
  color: var(--muted);
  background: transparent;
  padding: 7px 8px;
}
.danger {
  color: var(--red);
  background: #3a2020;
  border-color: #63322d;
}
:focus-visible {
  outline-color: var(--orange);
}
.shell {
  display: block;
  min-height: 100dvh;
}
.workspace {
  max-width: 1180px;
  padding: 16px 28px calc(24px + env(safe-area-inset-bottom));
  margin: 0 auto;
}
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.app-header .brand {
  font-size: 22px;
  gap: 9px;
  letter-spacing: -0.6px;
}
.app-header .brand img {
  width: 32px;
  height: 24px;
}
.header-profile {
  width: 44px;
  height: 44px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: #292930;
  color: var(--ink);
  border: 1px solid #484851;
  font-size: 14px;
}
.header-profile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.header-profile[aria-current='page'] {
  border-color: var(--orange);
}
.navigation-status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
body[data-tab] .page-head {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
  margin: 0 0 12px;
}
.page-head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
#page-title-slot {
  flex-shrink: 0;
}
#page-title-slot h1 {
  display: block;
}
#profile-button-slot {
  flex-shrink: 0;
}
.garage-summary-link {
  line-height: 1.3;
}
.page-head h1 {
  font-size: 28px;
  letter-spacing: -0.7px;
  margin: 0;
}
.page-head p {
  font-size: 13px;
  margin-top: 5px;
  line-height: 1.4;
}
.car-switcher {
  width: 100%;
  min-width: 0;
  margin-bottom: 12px;
}
.car-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 3px 3px 10px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #414149 transparent;
}
.car-tile {
  position: relative;
  flex: 0 0 204px;
  width: 204px;
  height: 116px;
  padding: 0;
  border: 2px solid #393940;
  border-radius: var(--radius);
  background: #27272e;
  color: #fff;
  overflow: hidden;
  scroll-snap-align: start;
  text-align: left;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}
.car-tile:hover {
  filter: none;
  border-color: #73737e;
}
.car-tile[aria-pressed='true'] {
  border-color: var(--orange);
}
.car-tile.is-pending {
  box-shadow: 0 0 0 2px #ff681e30;
}
.car-tile.is-pending .car-selected {
  border: 2px solid #17100b55;
  border-top-color: #17100b;
  color: transparent;
  animation: car-loading 850ms linear infinite;
}
@keyframes car-loading {
  to {
    transform: rotate(360deg);
  }
}
#car-view {
  opacity: 1;
  transition: opacity 150ms ease;
}
#car-view.is-changing {
  opacity: 0.65;
}
@media (prefers-reduced-motion: reduce) {
  .car-tile,
  #car-view {
    transition: none;
  }
  .car-tile.is-pending .car-selected {
    animation: none;
  }
}
.car-tile > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.car-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, #3b3b45, #1c1c23);
  color: #a2a2b0;
  padding-bottom: 30px;
}
.car-placeholder svg {
  width: 105px;
}
.car-tile-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, #0004 48%, #000e 100%);
}
.car-tile-caption {
  position: absolute;
  left: 13px;
  right: 10px;
  bottom: 11px;
  display: grid;
  gap: 3px;
}
.car-tile-caption strong {
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: -0.3px;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.car-tile-caption small {
  color: #e0e0e6;
  font-size: 12px;
}
.car-selected {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  background: var(--orange);
  color: #15100b;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
}
.add-car-tile {
  flex-basis: 132px;
  width: 132px;
  background: #161619;
  color: var(--muted);
  border: 1px dashed #474750;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}
.add-car-tile > span {
  color: var(--orange);
  font-size: 30px;
  font-weight: 400;
  line-height: 1;
}
.add-car-tile strong {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 500;
}
.car-context {
  display: flex;
  gap: 22px;
  align-items: center;
  flex-wrap: wrap;
  padding: 4px 0 10px;
  border-bottom: 1px solid var(--line);
}
.car-context-title {
  flex: 1;
  min-width: 150px;
}
.car-context h2 {
  font-size: 22px;
  letter-spacing: -0.4px;
  margin: 0 0 5px;
}
.car-health {
  color: var(--green);
  font-size: 12px;
}
.car-health.warning {
  color: var(--orange);
}
.inline-mileage {
  display: grid;
  justify-items: end;
}
.inline-mileage > span,
.inline-mileage > small {
  color: var(--muted);
  font-size: 11px;
}
.inline-mileage .mileage-value {
  color: var(--ink);
  font-size: 23px;
  font-weight: 600;
  padding: 1px 0;
  min-height: 32px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}
.mileage-value svg {
  width: 14px;
  color: var(--muted);
}
.inline-mileage .mileage-input {
  width: 170px;
  margin: 3px 0;
  padding: 6px 9px;
  min-height: 36px;
}
.inline-mileage .inline-error {
  color: var(--red);
  max-width: 230px;
}
.car-sections {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: 8px 0 12px;
}
.car-sections button {
  padding: 7px 10px;
  font-size: 12px;
}
.car-sections button.active {
  background: #2b2b32;
  color: var(--ink);
}
.page-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.page-actions h2 {
  font-size: 20px;
  margin: 0;
}
.page-actions h2:empty {
  display: none;
}
.dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 12px;
}
.metric {
  height: 144px;
  display: grid;
  grid-template-rows: 18px minmax(0, 1fr) 32px;
  gap: 4px;
  min-width: 0;
  padding: 11px 14px;
  background: var(--white);
  border: 0;
  border-radius: var(--radius);
}
.metric > span {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}
.metric > strong {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 28px;
  letter-spacing: -0.5px;
  font-weight: 600;
  margin: 0;
  min-height: 0;
  overflow: auto;
  align-content: center;
  line-height: 1.1;
  row-gap: 0;
}
.metric > strong > span {
  display: block;
}
.metric small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}
.metric > small:last-child {
  display: block;
  min-height: 0;
  overflow: auto;
}
.metric > strong > small {
  font-size: 14px;
  font-weight: 400;
}
.metric-cost {
  font-variant-numeric: tabular-nums;
}
.compact-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 12px;
}
.quick-add {
  min-width: 104px;
  background: var(--paper);
  color: var(--orange);
  border: 1px solid var(--orange);
}
.quick-add:hover {
  background: #ff681e14;
}
.overview-columns {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
  align-items: stretch;
  grid-auto-rows: 1fr;
}
.overview-panel {
  min-width: 0;
  background: var(--white);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.overview-panel .section-title {
  margin: 0 0 8px;
  flex-wrap: wrap;
}
.section-title h2 {
  font-size: 16px;
}
.section-title .quiet {
  font-size: 12px;
  padding: 4px 0;
  min-height: 26px;
}
.overview-panel .empty {
  padding: 18px 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.overview-panel .empty h2 {
  font-size: 17px;
}
.overview-panel .empty p {
  margin: 6px 0 12px;
  font-size: 13px;
}
.compact-schedule {
  display: grid;
  justify-content: stretch;
  align-items: stretch;
  width: 100%;
  gap: 7px;
  padding: 12px 0;
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  text-align: left;
}
.compact-schedule:first-of-type {
  border-top: 0;
  padding-top: 0;
}
.compact-schedule > span:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 10px;
}
.compact-schedule strong {
  font-size: 14px;
  font-weight: 550;
}
.compact-schedule small {
  color: var(--green);
  font-size: 12px;
}
.compact-schedule.warning small {
  color: var(--orange);
}
.compact-schedule.overdue small {
  color: var(--red);
}
.service-track {
  --progress-color: var(--green);
  appearance: none;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 3px;
  background: #3a3a43;
  overflow: hidden;
}
.service-track::-webkit-progress-value {
  height: 100%;
  display: block;
  background: var(--progress-color);
  border-radius: inherit;
}
.service-track::-webkit-progress-bar {
  background: #3a3a43;
  border-radius: 3px;
}
.service-track::-moz-progress-bar {
  background: var(--progress-color);
  border-radius: 3px;
}
.compact-schedule.warning .service-track {
  --progress-color: var(--orange);
}
.compact-schedule.overdue .service-track {
  --progress-color: var(--red);
}
.service-interval {
  color: var(--muted);
  font-size: 11px;
  font-weight: 400;
}
.category-total {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 27px;
  font-weight: 600;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.category-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 9px 0;
}
.category-row > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.category-row strong {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.category-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted);
}
.category-dot.fuel {
  background: var(--green);
}
.category-dot.maintenance {
  background: #35bee4;
}
.overview-panel > .hint {
  margin: 12px 0 0;
  font-size: 11px;
}
.recent-records {
  margin-top: 16px;
}
.compact-record {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.compact-record:first-of-type {
  border-top: 0;
}
.compact-record > div {
  flex: 1;
  min-width: 0;
}
.compact-record h3 {
  font-size: 14px;
  margin: 0 0 4px;
  font-weight: 550;
}
.compact-record p {
  color: var(--muted);
  font-size: 12px;
  margin: 2px 0 0;
  line-height: 1.35;
}
.record-glyph {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: var(--muted);
  background: #2c2c33;
  flex: 0 0 auto;
}
.record-glyph.fuel {
  color: var(--green);
  background: #203025;
}
.record-glyph.maintenance {
  color: #35bee4;
  background: #193039;
}
.record-amount {
  display: grid;
  gap: 3px;
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.compact-record .quiet {
  font-size: 12px;
}
.summary-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 15px;
}
.summary-controls .active {
  background: var(--orange);
  color: #17100b;
}
.summary-controls > span {
  color: var(--muted);
  margin-left: 9px;
}
.summary-total {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}
.summary-total .hint {
  margin: 0;
}
.summary-total > strong {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-size: 34px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.summary-total > small {
  font-size: 12px;
  color: var(--muted);
}
.summary-car {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  text-align: left;
  border: 0;
  border-radius: 0;
  border-top: 1px solid var(--line);
  padding: 12px 0;
  background: transparent;
  color: var(--ink);
}
.summary-car > span {
  flex: 1;
}
.summary-car small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 3px;
}
.summary-car strong {
  display: grid;
  text-align: right;
  gap: 3px;
  font-variant-numeric: tabular-nums;
}
.cabinet-footer {
  color: var(--muted);
  font-size: 11px;
  margin-top: 20px;
}
.card,
.ledger,
.strip {
  background: var(--white);
}
.card {
  padding: 18px;
}
.row {
  padding: 10px 14px;
  gap: 8px;
}
.row h3 {
  font-size: 15px;
  margin: 0 0 4px;
}
.row p {
  margin: 2px 0;
  line-height: 1.35;
}
.row .date {
  min-width: 78px;
}
#page-content .ledger {
  display: grid;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  overflow: visible;
}
#page-content .ledger > .row {
  margin: 0;
  background: var(--white);
  border: 0;
  border-radius: 12px;
}
.clickable-row {
  position: relative;
  isolation: isolate;
  cursor: pointer;
}
.clickable-row > button.row-opener {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  filter: none;
}
.clickable-row > button.row-opener:hover {
  background: #ffffff06;
}
.clickable-row > button.row-opener:active {
  background: #ffffff0b;
}
.clickable-row > button.row-opener:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: -2px;
}
.clickable-row > .actions,
.clickable-row > .row-direct-action {
  position: relative;
  z-index: 2;
}
.clickable-row > .actions {
  cursor: default;
  pointer-events: none;
}
.clickable-row > .actions > button,
.clickable-row > .actions > a {
  pointer-events: auto;
}
.documents .clickable-row h3 {
  margin: 8px 0 4px;
}
.documents .card {
  padding: 12px;
}
.documents img {
  height: 140px;
}
.documents .card .actions {
  margin-top: 8px;
}
.documents .clickable-row p {
  margin: 2px 0 8px;
  line-height: 1.35;
}
.empty {
  padding: 25px 18px;
  background: var(--white);
  border-color: var(--line);
}
.empty h2 {
  font-size: 20px;
}
.empty p {
  margin-bottom: 16px;
}
.filters {
  gap: 10px;
  margin-bottom: 15px;
}
.filters input,
.filters select {
  min-width: 0;
}
input,
select,
textarea {
  background: #141417;
  border-color: #484851;
  color: var(--ink);
}
.operation select,
.operation input {
  background: #141417;
}
.operation {
  background: #141417;
}
dialog {
  background: #1c1c21;
  color: var(--ink);
}
dialog::backdrop {
  background: #0009;
}
.error {
  background: #351e1c;
  color: var(--red);
}
.loading {
  padding: 40px 20px;
}
#notice:not(:empty) {
  bottom: calc(20px + env(safe-area-inset-bottom));
  background: #303038;
  border: 1px solid #4a4a54;
  padding: 12px 18px;
  font-size: 13px;
}
.profile {
  max-width: 760px;
  margin: 0 auto;
  gap: 16px;
}
@media (max-width: 760px) {
  .workspace {
    padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
  }
  .app-header {
    margin-bottom: 10px;
  }
  .app-header .brand {
    font-size: 20px;
  }
  .sync-label {
    font-size: 11px;
  }
  body[data-tab] .page-head {
    display: flex;
    margin-bottom: 12px;
  }
  .page-head h1 {
    font-size: clamp(20px, 5vw, 27px);
  }
  .page-head-actions {
    gap: 8px;
  }
  .garage-summary-link {
    font-size: 11px;
    padding: 7px 8px;
    min-height: 44px;
  }
  .compact-quick-actions {
    flex-wrap: nowrap;
  }
  .compact-quick-actions .quick-add {
    flex: 1;
    min-width: 0;
    padding-inline: 8px;
  }
  .car-strip {
    gap: 10px;
  }
  .car-tile {
    flex-basis: 172px;
    width: 172px;
    height: 104px;
  }
  .car-tile-caption strong {
    font-size: 18px;
  }
  .add-car-tile {
    flex-basis: 108px;
    width: 108px;
  }
  .add-car-tile strong {
    font-size: 12px;
  }
  .car-context {
    gap: 12px;
    padding-bottom: 12px;
  }
  .car-context-title {
    min-width: 115px;
  }
  .car-context h2 {
    font-size: 19px;
  }
  .inline-mileage .mileage-value {
    font-size: 21px;
  }
  .car-sections {
    gap: 2px;
  }
  .car-sections button {
    font-size: 12px;
    padding: 7px 9px;
  }
  .dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .metric {
    padding: 10px 12px;
    grid-template-rows: 30px minmax(0, 1fr) 28px;
  }
  .metric > strong {
    font-size: 25px;
  }
  .metric:last-child {
    grid-column: 1/-1;
  }
  .overview-columns {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .overview-panel {
    padding: 12px;
  }
  .compact-record {
    flex-wrap: wrap;
    gap: 8px;
  }
  .compact-record > div {
    min-width: 125px;
  }
  .compact-record .record-amount {
    max-width: 130px;
    overflow-wrap: anywhere;
  }
  .row .grow {
    min-width: 0;
  }
  .row .actions {
    flex-wrap: wrap;
  }
  #page-content .row .actions {
    width: auto;
    padding-top: 0;
  }
  .page-actions h2 {
    font-size: 18px;
  }
  .filters.expense-period label {
    flex: 1;
    min-width: 120px;
  }
  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (pointer: coarse) {
  button,
  .button {
    min-height: 44px;
  }
  input,
  select,
  textarea {
    font-size: 16px;
  }
  .car-sections button,
  .compact-record .quiet {
    min-height: 44px;
  }
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

.verified-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #75ce85;
  font-size: 12px;
  font-weight: 600;
  margin: 0;
  margin-inline-start: 6px;
  vertical-align: middle;
}
.connection-cars {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin: 14px 0;
}
.connection-cars label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}
.connection-cars input {
  width: 20px;
  height: 20px;
}
.connection-cars small {
  display: block;
  color: var(--muted);
}
.connection-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding: 12px 0;
}
.connection-row p {
  margin: 4px 0;
}
.handover-vehicle {
  padding: 14px;
  border: 1px solid #38383e;
  border-radius: 12px;
  margin: 14px 0;
}
.handover-vehicle p {
  margin-bottom: 0;
}
.handover-records {
  margin: 14px 0;
}
.handover-records summary {
  cursor: pointer;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.handover-records article {
  padding: 12px 0;
  border-top: 1px solid #38383e;
}
.visit-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.service-brand-glyph {
  position: relative;
  overflow: hidden;
}
.service-record-logo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
  background: #1c1c21;
}
.compact-record .verified-badge {
  font-size: 11px;
}
