/* =========================================================
   MyGarage – Komponenten
   ========================================================= */

/* ---------- Topbar (iOS Large Title) ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: var(--safe-top);
  background: var(--topbar-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid transparent;
  transition: border-color var(--dur) var(--ease);
}

/* Trennlinie erscheint erst beim Scrollen */
.topbar.is-scrolled {
  border-bottom-color: var(--separator);
}

.topbar__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-2) max(var(--space-4), var(--safe-left)) var(--space-3)
           max(var(--space-4), var(--safe-right));
}

.topbar__title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* ---------- Tabbar ---------- */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  justify-content: space-around;
  align-items: stretch;
  gap: var(--space-1);
  height: calc(var(--tabbar-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: var(--tabbar-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid var(--separator);
}

.tabbar__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-tertiary);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.tabbar__item:active {
  transform: scale(0.92);
}

.tabbar__icon {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tabbar__item.is-active {
  color: var(--accent);
}

.tabbar__label {
  line-height: 1;
}

/* ---------- Karten / Listen (iOS grouped) ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.list {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.list__row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 52px;
  padding: var(--space-3) var(--space-4);
  color: var(--text);
  position: relative;
  transition: background var(--dur-fast) var(--ease);
}

.list__row + .list__row::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--space-4);
  right: 0;
  height: 0.5px;
  background: var(--separator);
}

.list__row:active {
  background: var(--surface-pressed);
}

.list__row-label {
  flex: 1;
  font-size: 1rem;
}

.list__row-value {
  color: var(--text-secondary);
  font-size: 1rem;
}

.list__row-chevron {
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  flex-shrink: 0;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-5);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.btn:active { transform: scale(0.97); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-contrast);
}

.btn--primary:active { background: var(--accent-pressed); }

.btn--full { width: 100%; }

/* Runder Icon-Button (z.B. Plus in der Topbar) */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--accent);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.icon-btn:active {
  transform: scale(0.9);
  background: var(--surface-pressed);
}

.icon-btn svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Empty State ---------- */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--space-4);
  padding: clamp(48px, 18vh, 120px) var(--space-6) var(--space-6);
}

.empty__icon {
  width: 84px;
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-tertiary);
}

.empty__icon svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.empty__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.empty__text {
  max-width: 30ch;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* ---------- Segmented Control (iOS) ---------- */
.segmented {
  display: flex;
  padding: 2px;
  background: var(--bg-elevated-2);
  border-radius: var(--radius-md);
  gap: 2px;
}

.segmented__option {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-radius: calc(var(--radius-md) - 3px);
  transition: background var(--dur-fast) var(--ease);
}

.segmented__option.is-active {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-height) + var(--safe-bottom) + var(--space-4));
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
  padding: 0 var(--space-4);
}

.toast {
  max-width: 90%;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-2);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ---------- Footer-Hinweis (dezent) ---------- */
.hint {
  color: var(--text-tertiary);
  font-size: 0.78rem;
  text-align: center;
  padding: var(--space-5) var(--space-4) 0;
  line-height: 1.5;
}
.hint--left {
  text-align: left;
  padding: var(--space-2) var(--space-1) 0;
}

/* =========================================================
   Schritt 2 – Fahrzeugverwaltung
   ========================================================= */

/* ---------- Topbar-Modi ---------- */
.topbar__left {
  display: flex;
  align-items: center;
}

/* Large-Title (Tabs) */
.topbar[data-mode="large"] .topbar__left { display: none; }

/* Navbar (Unterseiten) */
.topbar[data-mode="nav"] .topbar__inner {
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  position: relative;
}
.topbar[data-mode="nav"] .topbar__title {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.0625rem;
  font-weight: 600;
  max-width: 52%;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar[data-mode="nav"] .topbar__left,
.topbar[data-mode="nav"] .topbar__actions { z-index: 1; }

/* ---------- Text-Buttons (Topbar) ---------- */
.text-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.0625rem;
  font-weight: 400;
  padding: var(--space-2) 0;
}
.text-btn--strong { font-weight: 600; }
.text-btn:active { opacity: 0.5; }

/* ---------- Zurück-Button ---------- */
.nav-back {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  color: var(--accent);
  font-size: 1.0625rem;
  margin-left: -6px;
}
.nav-back svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.nav-back:active { opacity: 0.5; }

/* ---------- Formular ---------- */
.form-list { margin-top: var(--space-2); }

.form-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 48px;
  padding: var(--space-2) var(--space-4);
  position: relative;
}
.form-row + .form-row::before {
  content: "";
  position: absolute;
  top: 0;
  left: var(--space-4);
  right: 0;
  height: 0.5px;
  background: var(--separator);
}
.form-row__label {
  flex: 0 0 38%;
  font-size: 1rem;
}
.form-row__field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}
.form-row__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  text-align: right;
}
.form-row__input::placeholder { color: var(--text-tertiary); }
.form-row__input.is-invalid::placeholder { color: var(--danger); }
.form-row__input[type="date"] { text-align: right; }
.form-row__unit { color: var(--text-secondary); font-size: 1rem; }

.form-row--textarea { padding: var(--space-3) var(--space-4); }
.form-row__textarea {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  min-height: 92px;
}
.form-row__textarea::placeholder { color: var(--text-tertiary); }

/* ---------- Stat-Kacheln ---------- */
.stat-row {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.stat {
  flex: 1;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-3);
  text-align: center;
}
.stat__value {
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.stat__label {
  margin-top: 2px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* ---------- Fahrzeugliste / -karte ---------- */
.vehicle-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.vehicle-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-lg);
  color: var(--text);
  transition: background var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.vehicle-card:active {
  background: var(--surface-pressed);
  transform: scale(0.99);
}
.vehicle-card__icon {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--bg-elevated-2);
  color: var(--accent);
}
.vehicle-card__icon svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vehicle-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.vehicle-card__name {
  font-size: 1.0625rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vehicle-card__meta {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vehicle-card__mileage {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- Fahrzeug-Detail ---------- */
.detail-loading { min-height: 40vh; }

.detail-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2);
  padding: var(--space-6) var(--space-4) var(--space-2);
}
.detail-hero__icon {
  width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--accent);
}
.detail-hero__icon svg {
  width: 44px;
  height: 44px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.detail-hero__title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.detail-hero__subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.detail-notes {
  padding: var(--space-4);
  font-size: 1rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-actions { margin-top: var(--space-8); }

.btn--destructive {
  background: var(--surface);
  color: var(--danger);
}
.btn--destructive:active { background: var(--surface-pressed); }

/* ---------- Action-Sheet ---------- */
.sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: var(--space-3);
  padding-bottom: calc(var(--space-3) + var(--safe-bottom));
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.sheet-overlay.is-visible { opacity: 1; }

.sheet {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transform: translateY(24px);
  transition: transform var(--dur) var(--ease);
}
.sheet-overlay.is-visible .sheet { transform: translateY(0); }

.sheet__group {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.sheet__header {
  padding: var(--space-4);
  text-align: center;
  border-bottom: 0.5px solid var(--separator);
}
.sheet__title { font-weight: 600; font-size: 0.95rem; }
.sheet__message {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.sheet__btn {
  width: 100%;
  border: none;
  background: transparent;
  color: var(--accent);
  font-size: 1.125rem;
  font-weight: 400;
  padding: var(--space-4);
}
.sheet__btn:active { background: var(--surface-pressed); }
.sheet__btn + .sheet__btn { border-top: 0.5px solid var(--separator); }
.sheet__btn--destructive { color: var(--danger); }
.sheet__btn--cancel { font-weight: 600; }
/* Zweizeilige Option (optionSheet): Label + kleiner Untertitel */
.sheet__btn-sub {
  display: block;
  margin-top: 3px;
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* Eingabefeld im Sheet (promptSheet) */
.sheet__field {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-bottom: 0.5px solid var(--separator);
}
.sheet__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 600;
  text-align: center;
}
.sheet__input:focus { outline: none; }
.sheet__unit {
  color: var(--text-secondary);
  font-size: 1.05rem;
  font-weight: 600;
}

/* Aufschlüsselungs-Liste im Sheet (infoSheet) */
.sheet__list {
  max-height: 50vh;
  overflow-y: auto;
}
.sheet__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}
.sheet__row + .sheet__row { border-top: 0.5px solid var(--separator); }
.sheet__row-label {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.95rem;
  color: var(--text);
  min-width: 0;
}
.sheet__row-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.sheet__row-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.sheet__row--total .sheet__row-label,
.sheet__row--total .sheet__row-value {
  font-weight: 700;
  color: var(--text);
}
.sheet__note {
  padding: var(--space-3) var(--space-4);
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  border-top: 0.5px solid var(--separator);
}

/* =========================================================
   Schritt 3 – Historie / Timeline
   ========================================================= */

/* ---------- Sektionskopf mit Aktion ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-6) var(--space-1) var(--space-2);
}
.section-title--inline { margin: 0; }
.section-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
}
.section-action svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.section-action:active { opacity: 0.5; }

/* ---------- Timeline ---------- */
.timeline { margin-top: var(--space-2); }

.tl-item {
  display: flex;
  gap: var(--space-3);
  position: relative;
  padding-bottom: var(--space-3);
  color: var(--text);
}
.tl-node {
  position: relative;
  flex: 0 0 34px;
  display: flex;
  justify-content: center;
}
/* Verbindungslinie zwischen den Punkten */
.tl-item:not(:last-child) .tl-node::before {
  content: "";
  position: absolute;
  top: 34px;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  background: var(--separator);
}
.tl-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 3px var(--bg);
}
.tl-dot svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tl-card {
  flex: 1;
  min-width: 0;
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: background var(--dur-fast) var(--ease);
}
.tl-item:active .tl-card { background: var(--surface-pressed); }
.tl-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-2);
}
.tl-type { font-weight: 600; font-size: 1rem; }
.tl-cost {
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 600;
  flex-shrink: 0;
}
.tl-meta { font-size: 0.82rem; color: var(--text-secondary); }
.tl-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tl-photos {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--text-tertiary);
  margin-top: 4px;
}
.tl-photos svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl-empty {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}
.tl-tasks {
  font-size: 0.82rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Wartungs-Checkliste (Durchgeführte Arbeiten) ---------- */
.task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.task-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.task-chip__check {
  width: 15px;
  height: 15px;
  margin-left: -2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}
.task-chip:active { transform: scale(0.95); }
.task-chip.is-active {
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.task-chip.is-active .task-chip__check { opacity: 1; color: var(--accent); }
.task-chips--view .task-chip { cursor: default; }

/* ---------- Datei-Anhänge (PDF & Co.) ---------- */
.file-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.file-list:empty { display: none; }
.file-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: none;
  border-radius: var(--radius-md);
  color: var(--text);
  text-align: left;
}
.file-row--action { transition: background var(--dur-fast) var(--ease); }
.file-row--action:active { background: var(--surface-pressed); }
.file-row__icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated-2);
  color: var(--accent);
}
.file-row__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.file-row__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.file-row__name {
  font-size: 0.95rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-row__meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.file-row__remove {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: var(--bg-elevated-2);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.file-row__remove svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
}
.file-row__open {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  color: var(--text-tertiary);
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Timeline: Foto- und Datei-Indikatoren nebeneinander */
.tl-attach {
  display: inline-flex;
  gap: var(--space-3);
}

/* ---------- Typ-Auswahl (Formular) ---------- */
.type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.type-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: var(--space-3) var(--space-1);
  border: none;
  background: var(--surface);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.type-chip__icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-elevated-2);
  color: var(--type-color);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.type-chip__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.type-chip__label {
  font-size: 0.68rem;
  font-weight: 500;
  text-align: center;
  line-height: 1.1;
}
.type-chip:active { transform: scale(0.95); }
.type-chip.is-active {
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--type-color);
}
.type-chip.is-active .type-chip__icon {
  background: var(--type-color);
  color: #fff;
}

/* ---------- Fotos ---------- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.photo-grid--view {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
}
.photo-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--surface);
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.photo-thumb--view { border: none; padding: 0; }
.photo-thumb--view:active { opacity: 0.85; }
.photo-thumb__remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.photo-thumb__remove svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}
.photo-add {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 1.5px dashed var(--separator-strong);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.75rem;
}
.photo-add svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.photo-add:active { background: var(--surface); }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  padding-top: calc(var(--space-4) + var(--safe-top));
  padding-bottom: calc(var(--space-4) + var(--safe-bottom));
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.lightbox.is-visible { opacity: 1; }
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* =========================================================
   Fälligkeiten (TÜV / Service) & Erinnerung
   ========================================================= */

/* ---------- Fälligkeits-Karten (Fahrzeug-Detail) ---------- */
.due-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-4);
}
.due-card {
  --state-color: var(--success);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  position: relative;
  overflow: hidden;
}
.due-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--state-color);
}
.due-card--ok { --state-color: #30D158; }
.due-card--soon { --state-color: #FF9F0A; }
.due-card--expired { --state-color: #FF453A; }

.due-card__icon {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-pressed);
  color: var(--state-color);
}
.due-card__icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.due-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.due-card__label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
}
.due-card__value { font-size: 1.05rem; font-weight: 700; }
.due-card__sub { font-size: 0.82rem; color: var(--text-secondary); }
.due-card__sub--alert { color: var(--state-color); font-weight: 600; }

.due-card__btn {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--surface-pressed);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-fast) var(--ease);
}
.due-card__btn:active { transform: scale(0.9); }
.due-card__btn svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Tank-Monitor ---------- */
.fuel-card {
  --fuel-color: #FFD60A;
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.fuel-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.fuel-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-pressed);
  color: var(--fuel-color);
}
.fuel-card__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.fuel-card__main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.fuel-card__value {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.1;
}
.fuel-card__label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.fuel-card__stats {
  display: flex;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 0.5px solid var(--separator);
}
.fuel-card__stat {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fuel-card__stat-value {
  font-size: 0.98rem;
  font-weight: 600;
}
.fuel-card__stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

/* ---------- Reifen-Karte ---------- */
.tire-card {
  --tire-color: #64D2FF;
  margin-top: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.tire-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.tire-card__icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-pressed);
  color: var(--tire-color);
}
.tire-card__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tire-card__title {
  font-size: 0.9rem;
  font-weight: 600;
}
.tire-card__rows {
  display: flex;
  flex-direction: column;
}
.tire-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-3) 0;
  border-top: 0.5px solid var(--separator);
}
.tire-card__row--active {
  --tire-color: #64D2FF;
}
.tire-card__set {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.tire-card__row--active .tire-card__set {
  color: var(--text);
  font-weight: 600;
}
.tire-card__badge {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--tire-color);
  background: var(--surface-pressed);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}
.tire-card__km {
  font-size: 1.05rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tire-card__row--active .tire-card__km {
  color: var(--tire-color);
}
.tire-card__hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0;
}
.tire-card__btn {
  margin-top: var(--space-1);
}

/* ---------- Schnellwahl-Chips (Formular) ---------- */
.due-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
}
.due-chip {
  border: none;
  background: var(--surface);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.due-chip.is-active { background: var(--accent); color: #fff; }
.due-chip:active { transform: scale(0.95); }

/* ---------- Warn-Badge (Garage-Karte) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 4px;
  margin-top: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.badge--soon { background: rgba(255, 159, 10, 0.18); color: #FF9F0A; }
.badge--expired { background: rgba(255, 69, 58, 0.18); color: #FF453A; }

/* ---------- Fahrzeug-Gesundheit (Ampel-Leiste) ---------- */
.health {
  --health-color: #30D158;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: 6px;
}
.health--ok { --health-color: #30D158; }
.health--soon { --health-color: #FF9F0A; }
.health--expired { --health-color: #FF453A; }
.health__track {
  flex: 1;
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-2);
  overflow: hidden;
}
.health__fill {
  display: block;
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--health-color);
  transition: width var(--dur) var(--ease), background var(--dur) var(--ease);
}
.health__value {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--health-color);
  flex-shrink: 0;
  min-width: 30px;
  text-align: right;
}

/* =========================================================
   Schritt 4 – Dashboard (Übersicht pro Fahrzeug)
   ========================================================= */

/* ---------- KPI-Raster ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
  margin-top: var(--space-2);
}
.kpi {
  --kpi-color: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-lg);
}
.kpi__icon {
  width: 34px;
  height: 34px;
  margin-bottom: var(--space-2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: color-mix(in srgb, var(--kpi-color) 16%, transparent);
  color: var(--kpi-color);
}
.kpi__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.kpi__value {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.kpi__label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* Antippbare KPI-Kachel (z. B. Kilometerstand schnell aktualisieren) */
.kpi--action {
  position: relative;
  text-align: left;
  font-family: inherit;
  border: none;
  color: var(--text);
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}
.kpi--action:active {
  transform: scale(0.98);
  background: var(--surface-pressed);
}
.kpi__edit {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-elevated-2);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi__edit svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Eingefärbte Info-Werte (Aktivität) ---------- */
.list__row-value--soon { color: #FF9F0A; font-weight: 600; }
.list__row-value--expired { color: #FF453A; font-weight: 600; }

/* ---------- Fahrzeug-Foto: Picker (Formular) ---------- */
.vehicle-photo-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) 0 var(--space-2);
}
.vehicle-photo {
  position: relative;
  width: 112px;
  height: 112px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--accent);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--dur-fast) var(--ease);
}
.vehicle-photo:active { transform: scale(0.96); }
.vehicle-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.vehicle-photo__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.vehicle-photo__placeholder svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Kamera-Badge auf gesetztem Foto */
.vehicle-photo__edit {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 3px var(--bg);
}
.vehicle-photo__edit svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.vehicle-photo__hint {
  font-size: 0.9rem;
  color: var(--accent);
  font-weight: 500;
}
.vehicle-photo__remove { color: var(--danger); }

/* ---------- Fahrzeug-Foto: Anzeige (Karte & Detail) ---------- */
.vehicle-card__icon--photo {
  background: none;
  overflow: hidden;
}
.vehicle-card__icon--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}
.detail-hero__icon--photo {
  overflow: hidden;
  background: var(--surface);
}
.detail-hero__icon--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =========================================================
   Schritt 5 – Statistik
   ========================================================= */

/* ---------- Fahrzeug-Auswahl (horizontal scrollbar) ---------- */
.scope-scroller {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  scrollbar-width: none;
  margin: var(--space-4) calc(-1 * max(var(--space-4), var(--safe-left)))
          var(--space-1);
  padding: 0 max(var(--space-4), var(--safe-left));
}
.scope-scroller::-webkit-scrollbar { display: none; }
.scope-chip {
  flex: 0 0 auto;
  border: none;
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.scope-chip:active { transform: scale(0.95); }
.scope-chip.is-active { background: var(--accent); color: var(--accent-contrast); }

/* ---------- Diagramm-Karten ---------- */
.chart-card { padding: var(--space-4); margin-top: var(--space-2); }
.chart-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: var(--space-4) var(--space-2);
}

/* ---------- Balkendiagramm (Kostenverteilung) ---------- */
.bar-chart {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.bar-row__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}
.bar-row__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.95rem;
  font-weight: 500;
}
.bar-row__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bar-row__value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.bar-row__track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--bg-elevated-2);
  overflow: hidden;
}
.bar-row__fill {
  height: 100%;
  border-radius: var(--radius-pill);
  transition: width var(--dur) var(--ease);
}

/* ---------- Säulendiagramm (Ausgaben pro Jahr) ---------- */
.col-chart {
  display: flex;
  align-items: flex-end;
  gap: var(--space-3);
  min-height: 180px;
  overflow-x: auto;
  scrollbar-width: none;
}
.col-chart::-webkit-scrollbar { display: none; }
.col {
  flex: 1 1 0;
  min-width: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  height: 180px;
  justify-content: flex-end;
}
.col__value {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}
.col__bar-wrap {
  flex: 1;
  width: 60%;
  max-width: 40px;
  display: flex;
  align-items: flex-end;
}
.col__bar {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 55%, transparent));
  min-height: 4px;
  transition: height var(--dur) var(--ease);
}
.col__label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ---------- Button-Icon ---------- */
.btn__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* =========================================================
   Foto-Cropper (Freiform-Zuschnitt)
   ========================================================= */
.cropper {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: #000;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}
.cropper.is-visible { opacity: 1; }
.cropper__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
}
.cropper__bar--top { padding-top: calc(var(--space-3) + var(--safe-top)); }
.cropper__hint {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
}
.cropper__btn {
  border: none;
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 1.0625rem;
  padding: var(--space-2);
}
.cropper__btn:active { opacity: 0.6; }
.cropper__btn--strong { font-weight: 600; color: var(--accent); }
.cropper__stage {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: var(--space-4);
  padding-bottom: calc(var(--space-4) + var(--safe-bottom));
}
.cropper__imgwrap {
  position: relative;
  touch-action: none;
  user-select: none;
}
.cropper__img {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
  user-select: none;
}
.cropper__frame {
  position: absolute;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55);
  touch-action: none;
  cursor: move;
}
.cropper__handle {
  position: absolute;
  width: 26px;
  height: 26px;
  touch-action: none;
}
.cropper__handle::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2.5px solid #fff;
}
.cropper__handle[data-h="nw"] { top: -13px; left: -13px; cursor: nwse-resize; }
.cropper__handle[data-h="nw"]::after { top: 5px; left: 5px; border-right: none; border-bottom: none; }
.cropper__handle[data-h="ne"] { top: -13px; right: -13px; cursor: nesw-resize; }
.cropper__handle[data-h="ne"]::after { top: 5px; right: 5px; border-left: none; border-bottom: none; }
.cropper__handle[data-h="sw"] { bottom: -13px; left: -13px; cursor: nesw-resize; }
.cropper__handle[data-h="sw"]::after { bottom: 5px; left: 5px; border-right: none; border-top: none; }
.cropper__handle[data-h="se"] { bottom: -13px; right: -13px; cursor: nwse-resize; }
.cropper__handle[data-h="se"]::after { bottom: 5px; right: 5px; border-left: none; border-top: none; }
