/* Tankbuch – Designsystem v4 „Werkstatt“
   Hell, kantig, kontrastreich: Schiefer + Signalrot, sichtbare Rahmen, harte Schatten,
   DIN-artige Überschriften, Zahlen in Festbreitenschrift. Keine externen Schriften. */

/* ------------------------------------------------------------------ Tokens */

:root {
  color-scheme: light;

  --bg:         #eef1f5;
  --surface:    #ffffff;
  --surface-2:  #f8fafc;
  --surface-3:  #e9edf1;
  --ink:        #0f172a;   /* Rahmen, harte Schatten, Balken */
  --text:       #0f172a;
  --text-2:     #334155;
  --muted:      #475569;
  --line-soft:  #dbe1e8;

  --accent:      #dc2626;
  --accent-hi:   #ef4444;
  --accent-ink:  #ffffff;
  --accent-text: #b91c1c;
  --accent-soft: #fee2e2;

  --side-bg:    #0f172a;
  --side-text:  #e2e8f0;
  --side-muted: #94a3b8;
  --side-line:  #1e293b;

  --link:       #1d4ed8;
  --ring:       #1d4ed8;

  --ok:          #166534;
  --ok-bg:       #dcfce7;
  --danger:      #b91c1c;
  --danger-bg:   #fef2f2;
  --info:        #1d4ed8;
  --info-bg:     #dbeafe;

  --chart-1:    #1d4ed8;
  --chart-2:    #7c3aed;

  --bw: 2px;                                  /* Rahmenstärke */
  --hard:    4px 4px 0 var(--ink);            /* harter Schatten */
  --hard-lg: 7px 7px 0 var(--ink);

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;

  --font:    system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Bahnschrift", "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Arial Narrow", system-ui, sans-serif;
  --mono:    "Cascadia Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --side-w: 248px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #070b14; --surface: #0f172a; --surface-2: #162036; --surface-3: #1e293b;
  --ink: #e2e8f0; --text: #f1f5f9; --text-2: #cbd5e1; --muted: #94a3b8; --line-soft: #253146;
  --accent: #dc2626; --accent-hi: #ef4444; --accent-ink: #ffffff; --accent-text: #fca5a5; --accent-soft: #3b1113;
  --side-bg: #020617; --side-line: #172033;
  --link: #93c5fd; --ring: #93c5fd;
  --ok: #86efac; --ok-bg: #0d2a1a; --danger: #fca5a5; --danger-bg: #2a1012; --info: #93c5fd; --info-bg: #10203c;
  --chart-1: #60a5fa; --chart-2: #c4b5fd;
  --hard: 4px 4px 0 #000; --hard-lg: 7px 7px 0 #000;
}

/* -------------------------------------------------------------------- Basis */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--font);
  min-height: 100vh; min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--display); font-weight: 700; line-height: 1.1;
  text-transform: uppercase; letter-spacing: .02em; text-wrap: balance;
}
p { margin: 0 0 var(--s-3); }
p:last-child { margin-bottom: 0; }

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2.5px; }

:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }

.ic { flex: none; display: inline-block; vertical-align: -.2em; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.warn  { color: var(--accent-text); }
.num   { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.mt    { margin-top: var(--s-3); }
.hidden-field { display: none; }
.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;
}
.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100; padding: 12px 18px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; border: var(--bw) solid var(--ink);
}
.skip-link:focus { top: 12px; }

/* Mono-Etikett: kleine Großbuchstaben-Beschriftung */
.metric-label, .kpi-label, .totals-eyebrow, .table th, .card-head > .muted, .page-head-sub,
.t-stack td[data-label]::before, .chart, .pill, .car-tag, .photo-credit {
  font-family: var(--mono);
}

/* ---------------------------------------------------------- Kopf / Seitenleiste */

.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--side-bg); color: var(--side-text);
  border-bottom: var(--bw) solid var(--ink);
}
.topbar-inner { display: flex; align-items: center; gap: var(--s-3); height: 60px; }

.brand {
  display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
  font: 700 1.25rem/1 var(--display); text-transform: uppercase; letter-spacing: .06em;
}
.brand-mark {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px;
  background: var(--accent); color: #fff; border: var(--bw) solid #fff;
}
.brand-mark.big { width: 60px; height: 60px; border-color: var(--ink); box-shadow: var(--hard); }

.mainnav { display: none; }
.side-cta { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: var(--s-1); }

.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px; padding: 0;
  border: var(--bw) solid transparent; background: transparent; color: var(--side-text); cursor: pointer;
  transition: background .12s, border-color .12s;
}
.icon-btn:hover { background: var(--side-line); border-color: var(--side-muted); }
.icon-btn-label { display: none; }

.theme-toggle .ic-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .ic-sun { display: inline-block; }
:root[data-theme="dark"] .theme-toggle .ic-moon { display: none; }

/* ------------------------------------------------------------------- Menüs */

.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px;
  border: var(--bw) solid var(--ink); background: var(--surface); color: var(--text);
  font-size: .9rem; font-weight: 700; white-space: nowrap;
  transition: background .12s;
}
.menu > summary:hover { background: var(--surface-3); }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary .ic-chev { transition: transform .15s; }
.menu[open] > summary .ic-chev { transform: rotate(180deg); }
.menu-label { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; }
.topbar .menu > summary { background: transparent; color: var(--side-text); border-color: var(--side-muted); }
.topbar .menu > summary:hover { background: var(--side-line); }

.menu-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50;
  min-width: 230px; padding: var(--s-2);
  background: var(--surface); color: var(--text);
  border: var(--bw) solid var(--ink); box-shadow: var(--hard);
}
.menu-panel.wide { min-width: min(310px, calc(100vw - 48px)); padding: var(--s-4); }
.menu-panel a {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px;
  color: var(--text); font-size: .94rem; font-weight: 600; text-decoration: none;
}
.menu-panel a:hover { background: var(--surface-3); }
.menu-panel a.current { background: var(--ink); color: var(--surface); }
.align-right { margin-left: auto; }

@keyframes rise { from { opacity: 0; transform: translateY(6px); } }

/* ------------------------------------------------------------------ Flashes */

.flash {
  display: flex; align-items: flex-start; gap: 10px;
  margin: var(--s-4) 0; padding: 13px 15px;
  border: var(--bw) solid var(--ink); border-left-width: 10px;
  background: var(--surface); font-size: .95rem; font-weight: 600;
  box-shadow: var(--hard); animation: rise .2s ease-out;
}
.flash .ic { margin-top: 2px; }
.flash-success { border-left-color: #16a34a; background: var(--ok-bg); }
.flash-success .ic { color: var(--ok); }
.flash-error   { border-left-color: var(--accent); background: var(--danger-bg); }
.flash-error .ic { color: var(--danger); }
.flash-info    { border-left-color: #2563eb; background: var(--info-bg); }
.flash-info .ic { color: var(--info); }

/* ------------------------------------------------------------------- Karten */

.card {
  background: var(--surface);
  border: var(--bw) solid var(--ink);
  padding: var(--s-5);
  margin-bottom: var(--s-5);
}
.card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-5);
  padding: var(--s-3) var(--s-5); min-height: 56px;
  border-bottom: var(--bw) solid var(--ink); background: var(--surface-2);
}
.card-head h2 { margin: 0; font-size: 1.2rem; }
.card-head > .muted { font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; }
.card-head > :last-child:not(:first-child) { margin-left: auto; }
h3.sub { margin: 0 0 var(--s-2); font-size: 1rem; color: var(--text); }
.sep { border: none; border-top: var(--bw) dashed var(--line-soft); margin: var(--s-5) 0; }

.page-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3);
  flex-wrap: wrap; margin: var(--s-6) 0 var(--s-5);
}
.page-head h1 { margin: 0; font-size: clamp(2rem, 7vw, 3rem); letter-spacing: .01em; }
.page-head-sub {
  display: inline-block; margin: 0 0 6px; padding: 3px 8px;
  background: var(--ink); color: var(--surface);
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
}
.page-head .btn-row { margin-left: auto; }

/* ----------------------------------------------------------------- Buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 18px;
  border: var(--bw) solid var(--ink); border-radius: 0;
  font: 700 .95rem/1.2 var(--font); letter-spacing: .01em;
  cursor: pointer; white-space: nowrap; text-decoration: none;
  background: var(--surface); color: var(--text);
  box-shadow: var(--hard);
  transition: transform .1s, box-shadow .1s, background .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); background: var(--surface-3); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-hi); }
.btn-ghost { background: var(--surface); }
.btn-danger { background: var(--ink); color: var(--surface); }
.btn-danger:hover { background: var(--accent); color: #fff; }
.btn-sm { min-height: 40px; padding: 0 13px; font-size: .86rem; box-shadow: 3px 3px 0 var(--ink); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.form-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-bottom: var(--s-6); }
:root[data-theme="dark"] .btn, :root[data-theme="dark"] .btn:hover { box-shadow: var(--hard); }

.link-sm {
  font-size: .82rem; font-weight: 700; display: inline-flex; align-items: center; gap: 5px; min-height: 32px;
  color: var(--text); text-decoration: underline;
}
.back-link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; margin: var(--s-4) 0 var(--s-2);
  color: var(--text); font: 700 .78rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em;
  text-decoration: none;
}
.back-link:hover { color: var(--accent-text); }

/* --------------------------------------------------------------- Formulare */

label > span {
  display: block; margin-bottom: 6px; color: var(--text);
  font: 700 .74rem/1.3 var(--mono); text-transform: uppercase; letter-spacing: .08em;
}
label > small, .field-hint { display: block; margin-top: 6px; font-size: .84rem; color: var(--muted); line-height: 1.45; }
label > small.is-live { color: var(--ok); font-weight: 700; }
label > small.warn { color: var(--danger); font-weight: 700; }

input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=file], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 13px;
  background: var(--surface); color: var(--text);
  border: var(--bw) solid var(--ink); border-radius: 0;
  font: inherit; font-size: 1rem;
  transition: box-shadow .1s, background .1s;
}
input::placeholder { color: var(--muted); opacity: .7; }
input:focus, select:focus, textarea:focus { outline: none; box-shadow: 4px 4px 0 var(--ring); }
input:disabled, input[readonly] { background: var(--surface-3); color: var(--muted); }
input[type=file] { padding: 8px; font-size: .9rem; }
select {
  appearance: none; -webkit-appearance: none; padding-right: 40px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: right 18px center, right 12px center; background-size: 6px 6px; background-repeat: no-repeat;
}

.field-unit { position: relative; display: block; font: inherit; text-transform: none; letter-spacing: 0; margin: 0; }
.field-unit > input { padding-right: 64px; font-family: var(--mono); font-weight: 700; font-size: 1.05rem; }
.field-unit > i {
  position: absolute; right: var(--bw); top: var(--bw); bottom: var(--bw); display: grid; place-items: center;
  min-width: 52px; padding: 0 8px; border-left: var(--bw) solid var(--ink); background: var(--surface-3);
  font: 700 .74rem/1 var(--mono); font-style: normal; text-transform: uppercase; color: var(--text-2); pointer-events: none;
}

.stack { display: grid; gap: var(--s-4); }
.stack.tight { gap: var(--s-3); }
.grid-2, .grid-3 { display: grid; gap: var(--s-4); margin-bottom: var(--s-4); }
.grid-2:last-child, .grid-3:last-child { margin-bottom: 0; }
.inline-form { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: flex-start; }
.inline-form input, .inline-form select { flex: 1 1 210px; width: auto; }
.inline-form.tight { gap: 6px; margin-top: 6px; }

.check { display: flex; align-items: flex-start; gap: 12px; font-size: .95rem; cursor: pointer; }
.check input[type=checkbox] { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.check > span { margin: 0; color: var(--text); font: inherit; text-transform: none; letter-spacing: 0; }
.check > span > strong { font-family: var(--display); font-size: 1.1rem; text-transform: uppercase; letter-spacing: .03em; }
.check > span > small { display: block; color: var(--muted); font-size: .86rem; margin-top: 3px; line-height: 1.45; }
.big-check { padding: var(--s-4); border: var(--bw) solid var(--ink); background: var(--surface-2); }
.big-check:has(input:checked) { background: var(--accent-soft); }

.check input.switch {
  appearance: none; -webkit-appearance: none; width: 54px; height: 30px; margin: 0;
  background: var(--surface); border: var(--bw) solid var(--ink); position: relative; cursor: pointer;
}
.check input.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px;
  background: var(--ink); transition: transform .14s;
}
.check input.switch:checked { background: var(--accent); }
.check input.switch:checked::after { transform: translateX(24px); background: #fff; }

.checks { border: var(--bw) solid var(--ink); padding: var(--s-3); margin: 0; }
.checks legend { padding: 0 6px; font: 700 .72rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.checks .check { min-height: 40px; align-items: center; }
.checks .check input { margin-top: 0; }

.code-input { letter-spacing: .35em; font: 700 1.4rem/1 var(--mono); text-align: center; }

.copybox { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.copybox > .muted { flex: 1 0 100%; }
.copybox input { flex: 1 1 200px; font: .8rem var(--mono); background: var(--surface-2); color: var(--text); }
.copybox.tight { margin-top: 6px; max-width: 400px; }
.copybox.tight input { font-size: .74rem; min-height: 38px; padding: 5px 8px; }

.photo-field { display: block; }
.photo-drop {
  display: flex; align-items: center; gap: 12px; min-height: 76px; padding: 12px 14px; margin: 0;
  border: var(--bw) dashed var(--ink); background: var(--surface-2); cursor: pointer;
  font: inherit; text-transform: none; letter-spacing: 0;
}
.photo-drop:hover { background: var(--surface-3); }
.photo-field:focus-within .photo-drop { box-shadow: 4px 4px 0 var(--ring); }
.photo-drop .photo-ic {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none; margin: 0;
  background: var(--ink); color: var(--surface); overflow: hidden;
}
.photo-drop .photo-ic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-drop > span:last-child { margin: 0; font: inherit; text-transform: none; letter-spacing: 0; }
.photo-drop strong { display: block; font-size: .94rem; }
.photo-drop em { display: block; font-style: normal; font-size: .82rem; color: var(--muted); overflow-wrap: anywhere; }
.photo-field.has-file .photo-drop { border-style: solid; background: var(--ok-bg); }
.photo-field input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; min-height: 0; padding: 0; border: 0; }

/* ------------------------------------------------------------------- Farben */

.color-field { border: var(--bw) solid var(--ink); padding: var(--s-3) var(--s-4) var(--s-4); margin: 0 0 var(--s-4); }
.color-field legend { padding: 0 6px; font: 700 .74rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.swatch { position: relative; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px; }
.swatch input[type=radio] { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.swatch > span { display: block; width: 32px; height: 32px; margin: 0; background: var(--sw); border: var(--bw) solid var(--ink); }
.swatch input[type=radio]:checked + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }
.swatch input[type=radio]:focus-visible + span { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--ring); }
.swatch-custom input[type=radio] { pointer-events: none; }
.swatch-custom input[type=color] { width: 32px; height: 32px; padding: 0; border: var(--bw) solid var(--ink); background: none; cursor: pointer; min-height: 0; }
.swatch-custom input[type=radio]:checked ~ input[type=color] { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }
.swatch-custom input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.swatch-custom input[type=color]::-webkit-color-swatch { border: none; }

/* -------------------------------------------------------------- Kennzeichen */

.plate {
  display: inline-flex; align-items: stretch; height: 26px; vertical-align: middle;
  background: #fff; color: #111; border: 2px solid #111; border-radius: 3px; overflow: hidden;
  font: 700 .86rem/1 var(--mono); letter-spacing: .04em;
}
.plate::before { content: ""; width: 9px; background: #1d4fbf; }
.plate > span { display: grid; place-items: center; padding: 0 7px; }

/* ----------------------------------------------------------- Fahrzeug-Fotos */

.car-photo { position: relative; display: block; margin: 0; background: var(--surface-3); overflow: hidden; }
.car-photo .car-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.car-photo .car-sketch {
  display: grid; place-items: center; width: 100%; height: 100%; padding: var(--s-5);
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 24px 24px, var(--surface-2);
}
.car-photo .car-sketch svg { max-width: 100%; height: auto; }
.car-tag {
  position: absolute; left: 0; bottom: 0; padding: 6px 10px;
  background: var(--ink); color: var(--surface);
  font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
}
.photo-credit { margin: 0; padding: 6px 10px; font-size: .68rem; color: var(--muted); background: var(--surface-2); border-top: var(--bw) solid var(--ink); }
.photo-credit a { color: inherit; }

/* -------------------------------------------------------------- Auto-Kacheln */

.car-grid { display: grid; gap: var(--s-6); margin-bottom: var(--s-8); }
.car-tile {
  display: flex; flex-direction: column; color: var(--text); text-decoration: none;
  background: var(--surface); border: var(--bw) solid var(--ink); box-shadow: var(--hard-lg);
  transition: transform .12s, box-shadow .12s;
}
.car-tile:hover { transform: translate(-3px, -3px); box-shadow: 10px 10px 0 var(--accent); }
.car-tile:active { transform: translate(3px, 3px); box-shadow: 3px 3px 0 var(--ink); }
.car-tile .car-photo { aspect-ratio: 16 / 10; border-bottom: var(--bw) solid var(--ink); }
.car-tile .car-img { transition: transform .35s ease-out; }
.car-tile:hover .car-img { transform: scale(1.04); }
.car-tile-go {
  position: absolute; top: 0; right: 0; display: grid; place-items: center; width: 44px; height: 44px;
  background: var(--accent); color: #fff; border-left: var(--bw) solid var(--ink); border-bottom: var(--bw) solid var(--ink);
}
.car-tile-go .ic { transform: rotate(-90deg); }
.car-tile-body { padding: var(--s-4) var(--s-4) 0; display: flex; flex-direction: column; gap: var(--s-4); flex: 1; }
.car-tile-body h3 { margin: 0; font-size: 1.6rem; }
.car-tile-sub { margin: 8px 0 0; display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; color: var(--muted); font-size: .86rem; }

.tile-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr); margin: auto calc(var(--s-4) * -1) 0;
  border-top: var(--bw) solid var(--ink);
}
.tile-metrics > div { min-width: 0; padding: 12px 10px 12px var(--s-4); }
.tile-metrics > div + div { border-left: var(--bw) solid var(--ink); padding-left: 12px; }
.tile-metrics > div:first-child { background: var(--ink); color: var(--surface); }
.tile-metrics > div:first-child .metric-label { color: inherit; opacity: .75; }
.metric-value { display: block; font: 700 1rem/1.2 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-label { display: block; margin-top: 4px; color: var(--muted); font-size: .64rem; font-weight: 700; line-height: 1.3; text-transform: uppercase; letter-spacing: .06em; }

/* ------------------------------------------------------------- Gesamtkosten */

.card.totals-box { padding: 0; box-shadow: var(--hard-lg); }
.totals-top .card-head { margin: 0; }
.totals-main { display: grid; gap: var(--s-5); padding: var(--s-5); }
.totals-eyebrow { display: block; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.totals-value {
  display: block; margin-top: 4px; font: 700 clamp(2.8rem, 13vw, 5rem)/1 var(--mono);
  letter-spacing: -.05em; font-variant-numeric: tabular-nums;
}
.totals-value small { font-size: .42em; letter-spacing: -.02em; color: var(--accent-text); }
.totals-stats { display: grid; grid-template-columns: repeat(2, 1fr); border: var(--bw) solid var(--ink); align-self: end; }
.totals-stats > div { padding: 10px 12px; border-right: var(--bw) solid var(--ink); border-bottom: var(--bw) solid var(--ink); }
.totals-stats > div:nth-child(2n) { border-right: none; }
.totals-stats > div:nth-last-child(-n+2) { border-bottom: none; }
.totals-per-car { border-top: var(--bw) solid var(--ink); padding: 0 var(--s-5); }

.segmented {
  display: flex; margin: 0; border-bottom: var(--bw) solid var(--ink);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.segmented::-webkit-scrollbar { display: none; }
.segmented a {
  flex: 1 0 auto; display: grid; place-items: center; min-height: 46px; padding: 0 14px;
  color: var(--text); text-decoration: none; white-space: nowrap;
  font: 700 .74rem/1 var(--mono); text-transform: uppercase; letter-spacing: .08em;
  border-right: var(--bw) solid var(--ink); transition: background .12s;
}
.segmented a:last-child { border-right: none; }
.segmented a:hover { background: var(--surface-3); }
.segmented a[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }

.share-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; padding: 14px 0; }
.share-row + .share-row { border-top: var(--bw) dashed var(--line-soft); }
.share-name { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-name a { color: var(--text); text-decoration: none; }
.share-name a:hover { text-decoration: underline; }
.share-cost { font: 700 1rem var(--mono); }
.share-bar { grid-column: 1 / -1; height: 14px; border: var(--bw) solid var(--ink); background: var(--surface-2); }
.share-bar > i { display: block; height: 100%; min-width: 4px; background: var(--car, var(--accent)); border-right: var(--bw) solid var(--ink); }
.share-meta { grid-column: 1 / -1; color: var(--muted); font: .78rem var(--mono); }

/* ----------------------------------------------------------------- Kennzahlen */

.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-4); margin-bottom: var(--s-5); }
.kpi {
  background: var(--surface); border: var(--bw) solid var(--ink); padding: var(--s-4);
  display: flex; flex-direction: column; justify-content: flex-end; min-width: 0;
}
.kpi-value { display: block; font: 700 1.35rem/1.15 var(--mono); letter-spacing: -.03em; white-space: nowrap; }
.kpi-value small { font-size: .7rem; letter-spacing: 0; color: var(--muted); }
.kpi-label { display: block; margin-top: 6px; color: var(--muted); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }

.kpi-hero { grid-column: 1 / -1; padding: var(--s-5); background: var(--ink); color: var(--surface); box-shadow: 7px 7px 0 var(--accent); }
.kpi-hero .kpi-label { margin: 0 0 6px; color: inherit; opacity: .75; }
.kpi-hero .kpi-value { font-size: clamp(3rem, 14vw, 4.6rem); letter-spacing: -.06em; }
.kpi-hero .kpi-value small { font-size: .9rem; color: inherit; opacity: .75; }
.kpi-hero .muted { color: inherit; opacity: .75; }

.spread { margin-top: var(--s-5); }
.spread-track { position: relative; height: 12px; border: var(--bw) solid currentColor; background: linear-gradient(90deg, #22c55e, #facc15, #ef4444); }
.spread-dot { position: absolute; top: 50%; width: 10px; height: 28px; background: var(--surface); border: var(--bw) solid var(--ink); outline: 2px solid var(--surface); transform: translate(-50%, -50%); }
.spread-legend { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; font: 700 .64rem var(--mono); text-transform: uppercase; letter-spacing: .08em; opacity: .9; }
.spread-legend b { display: block; font-size: 1.05rem; letter-spacing: -.02em; }
.spread-legend > :nth-child(2) { text-align: center; }
.spread-legend > :last-child { text-align: right; }

.facts { display: grid; grid-template-columns: 1fr; gap: 0; margin: 0 0 var(--s-4); }
.facts > div { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 11px 0; border-bottom: var(--bw) dashed var(--line-soft); }
.facts dt { color: var(--text-2); font-size: .92rem; }
.facts dd { margin: 0; font: 700 .95rem var(--mono); text-align: right; white-space: nowrap; }

/* -------------------------------------------------------------- Auto-Header */

.card.car-header { display: grid; gap: 0; padding: 0; box-shadow: var(--hard-lg); }
.car-header-media { display: flex; flex-direction: column; border-bottom: var(--bw) solid var(--ink); min-width: 0; }
.car-header-media .car-photo { aspect-ratio: 16 / 10; flex: 1; }
.car-header-info { padding: var(--s-5); display: flex; flex-direction: column; }
.car-header-info h1 { margin: 0 0 var(--s-3); font-size: clamp(2.1rem, 8vw, 3.4rem); }
.car-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 var(--s-3); padding: 0; list-style: none; }
.car-meta li:not(.is-plate) {
  padding: 3px 8px; border: var(--bw) solid var(--ink);
  font: 700 .7rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em;
}
.car-meta li.is-plate { margin-right: 4px; }
.odometer { display: inline-flex; align-items: stretch; margin: var(--s-3) 0 0; border: var(--bw) solid var(--ink); align-self: flex-start; }
.odometer b { padding: 8px 12px; background: var(--ink); color: var(--surface); font: 700 1.6rem/1 var(--mono); letter-spacing: .06em; }
.odometer span { display: grid; place-items: center; padding: 0 10px; font: 700 .66rem/1.2 var(--mono); text-transform: uppercase; letter-spacing: .08em; }
.car-header-actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-5); }

.car-form { display: block; }
.card.sketch-preview-card { padding: 0; text-align: center; }
.sketch-preview-card .car-photo { aspect-ratio: 16 / 10; }
#sketch-preview { display: grid; place-items: center; padding: var(--s-5);
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 24px 24px, var(--surface-2); }
#sketch-preview svg { max-width: 100%; height: auto; }
.sketch-preview-card > p { margin: 0; padding: 10px 14px; border-top: var(--bw) solid var(--ink); }

/* --------------------------------------------------------------- Tabellen */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text); padding: 0 10px 10px; border-bottom: var(--bw) solid var(--ink); white-space: nowrap;
}
.table th.num { text-align: right; }
.table td { padding: 13px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background: var(--surface-2); }
.table.compact td { padding: 9px; }
.table td:first-child, .table th:first-child { padding-left: 0; }
.table td:last-child, .table th:last-child { padding-right: 0; }
.table .t-strong { font-weight: 700; }
.table td a:not(.pill):not(.btn):not(.link-sm) { color: var(--text); font-weight: 700; text-decoration: none; }
.table td a:not(.pill):not(.btn):not(.link-sm):hover { text-decoration: underline; }
.table + p, .table + .sub { margin-top: var(--s-4); }
.cell-pills { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }

.dot { display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px; border: var(--bw) solid var(--ink); }

.pill {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px;
  font-size: .64rem; font-weight: 700; letter-spacing: .08em; line-height: 1.5; text-transform: uppercase;
  background: var(--surface); color: var(--text); border: var(--bw) solid var(--ink);
  vertical-align: middle; white-space: nowrap; text-decoration: none;
}
.pill-tg { background: var(--info-bg); }
.pill-ok { background: var(--ok-bg); }
.pill-link { background: var(--ink); color: var(--surface); }
.pill-link:hover { background: var(--accent); color: #fff; }

.filterbar {
  display: flex; gap: var(--s-3); margin: 0 -16px var(--s-5); padding: 2px 16px 6px;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filterbar::-webkit-scrollbar { display: none; }
.card .filterbar { margin: 0; padding: 0 0 4px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; flex: none; min-height: 42px; padding: 0 14px;
  font-size: .9rem; font-weight: 700; text-decoration: none;
  background: var(--surface); border: var(--bw) solid var(--ink); color: var(--text);
  box-shadow: 3px 3px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.chip:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.chip-on { background: var(--ink); color: var(--surface); box-shadow: 3px 3px 0 var(--accent); }
.chip-on:hover { box-shadow: 4px 4px 0 var(--accent); }
.chip-on .dot { border-color: var(--surface); }
:root[data-theme="dark"] .chip { box-shadow: 3px 3px 0 #000; }

/* --------------------------------------------------------------- Diagramme */

.chart {
  --h: 210px;
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px;
  margin: var(--s-6) 0 0; font-size: .68rem; font-weight: 700; color: var(--muted);
}
.chart-y { position: relative; height: var(--h); }
.chart-y span { position: absolute; right: 0; transform: translateY(50%); white-space: nowrap; }
.chart-y .sizer { position: static; display: block; visibility: hidden; transform: none; }
.chart-y .chart-unit { top: -22px; right: auto; left: 0; transform: none; color: var(--text); text-transform: uppercase; letter-spacing: .06em; }
.chart-plot { position: relative; height: var(--h); border-left: var(--bw) solid var(--ink); border-bottom: var(--bw) solid var(--ink); }
.chart-grid i { position: absolute; left: 0; right: 0; border-top: 1px dashed var(--line-soft); }
.chart-grid i:first-child { border: none; }
.chart-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.chart-plot svg path[stroke-width] { stroke-width: 3; stroke-linejoin: miter; stroke-linecap: square; }

.chart-pt {
  position: absolute; width: 11px; height: 11px; z-index: 1;
  background: var(--surface); border: var(--bw) solid var(--c); transform: translate(-50%, 50%); cursor: pointer;
}
.chart-pt::before { content: ""; position: absolute; inset: -12px -8px; }
.chart-pt:hover { background: var(--c); z-index: 3; }
.chart-dense .chart-pt { width: 6px; height: 6px; border-width: 0; background: var(--c); }

.chart-pt:hover::after, .bar:hover::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 10px);
  transform: translateX(-50%); z-index: 5; pointer-events: none;
  padding: 6px 10px; white-space: nowrap;
  background: var(--ink); color: var(--surface); font: 700 .76rem/1.3 var(--mono);
  box-shadow: 3px 3px 0 var(--accent);
}
.tip-l:hover::after { left: -4px; transform: none; }
.tip-r:hover::after { left: auto; right: -4px; transform: none; }

.chart-x { grid-column: 2; position: relative; height: 26px; }
.chart-x span { position: absolute; top: 9px; transform: translateX(-50%); white-space: nowrap; }
.chart-x span.first { transform: none; }
.chart-x span.last { transform: translateX(-100%); }

.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 3%; padding: 0 1.5%; }
.bar-col { flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar { position: relative; display: block; width: 100%; max-width: 40px; min-height: 3px; background: var(--ink); cursor: pointer; transition: background .1s; }
.bar:hover { background: var(--accent); }
.bar-zero { background: var(--line-soft); }
.chart-x-bars { display: flex; gap: 3%; padding: 0 1.5%; height: auto; min-height: 26px; }
.chart-x-bars span { position: static; transform: none; flex: 1 1 0; text-align: center; padding-top: 9px; line-height: 1.25; min-width: 0; text-transform: uppercase; }
.chart-x-bars small { display: block; font-size: 1em; opacity: .7; }

.chart-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: .9rem; border: var(--bw) dashed var(--ink); }
.chart-row { display: grid; gap: 0 var(--s-5); }
.chart-row > .card { min-width: 0; }

/* ----------------------------------------------------------------- Zustände */

.empty-state { text-align: center; padding: var(--s-10) var(--s-5); box-shadow: var(--hard-lg); }
.empty-icon { display: grid; place-items: center; width: 72px; height: 72px; margin: 0 auto var(--s-5); background: var(--accent); color: #fff; border: var(--bw) solid var(--ink); box-shadow: var(--hard); }
.empty-state h2 { margin: 0 0 10px; font-size: 1.7rem; }
.empty-state p { color: var(--muted); max-width: 46ch; margin: 0 auto var(--s-5); }
.error-code { font: 700 5rem/1 var(--mono); letter-spacing: -.06em; margin: 0 0 8px; }

.danger-zone {
  margin-top: var(--s-8);
  background: repeating-linear-gradient(-45deg, var(--danger-bg) 0 14px, var(--surface) 14px 28px);
}
.danger-zone h2 { margin: 0 0 6px; font-size: 1.2rem; color: var(--danger); }
.danger-zone p { color: var(--text); font-size: .92rem; margin: 0 0 var(--s-3); }

/* -------------------------------------------------------------- Anmeldung */

.auth-shell { min-height: calc(100dvh - 70px); display: grid; place-items: center; padding: var(--s-6) 0; }
body:has(.auth-shell) {
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 32px 32px,
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 32px 32px, var(--bg);
}
.auth-card {
  width: min(440px, 100%); background: var(--surface);
  border: var(--bw) solid var(--ink); box-shadow: 10px 10px 0 var(--accent);
  padding: var(--s-8) var(--s-6); animation: rise .25s ease-out;
}
.auth-head { margin-bottom: var(--s-6); }
.auth-head .brand-mark { margin: 0 0 var(--s-5); }
.auth-head h1 { margin: 0 0 8px; font-size: 2.6rem; }
.auth-head p { margin: 0; color: var(--muted); font-size: .96rem; }
.auth-alt { margin: var(--s-5) 0 0; font-size: .92rem; color: var(--muted); }
.auth-note { margin: var(--s-4) 0 0; padding-top: var(--s-4); border-top: var(--bw) dashed var(--line-soft); font-size: .84rem; color: var(--muted); }

/* ---------------------------------------------------------------- 2FA-Setup */

.steps { margin: 0; padding: 0; list-style: none; counter-reset: step; display: grid; gap: var(--s-6); }
.steps li { counter-increment: step; position: relative; padding-left: 56px; }
.steps li::before {
  content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: -2px;
  display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--ink); color: var(--surface); font: 700 1rem var(--mono);
}
.steps li strong { display: block; margin-bottom: 4px; font: 700 1.15rem var(--display); text-transform: uppercase; letter-spacing: .03em; }
.steps li p { margin: 0 0 10px; color: var(--muted); font-size: .92rem; }
.qr-box { display: inline-block; padding: 12px; background: #fff; border: var(--bw) solid var(--ink); box-shadow: var(--hard); }
.qr-box img { display: block; width: 220px; height: 220px; image-rendering: pixelated; }
.secret-code { font: 700 1.05rem var(--mono); letter-spacing: .1em; word-break: break-all; background: var(--surface-2); border: var(--bw) solid var(--ink); padding: 12px 14px; margin: 0 0 6px; }
.codes-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: var(--s-4) 0; }
.codes-grid code { background: var(--surface-2); border: var(--bw) solid var(--ink); padding: 12px; text-align: center; font-size: 1rem; font-weight: 700; letter-spacing: .07em; }
code { background: var(--surface-3); padding: 1px 5px; font: .86em var(--mono); word-break: break-all; }

/* ------------------------------------------------------------------- Tabbar */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: var(--side-bg); border-top: var(--bw) solid var(--ink);
  padding: 0 4px env(safe-area-inset-bottom);
}
.tabbar a {
  display: grid; justify-items: center; gap: 4px; min-height: 60px; padding: 10px 2px 8px;
  color: var(--side-muted); text-decoration: none;
  font: 700 .6rem/1 var(--mono); text-transform: uppercase; letter-spacing: .06em;
}
.tabbar a[aria-current="page"] { color: #fff; box-shadow: inset 0 4px 0 var(--accent); }
.tabbar .tab-primary { color: #fff; padding-top: 0; box-shadow: none !important; }
.tabbar .tab-primary .tab-fab {
  display: grid; place-items: center; width: 56px; height: 56px; margin-top: -22px;
  background: var(--accent); color: #fff; border: var(--bw) solid #fff; box-shadow: 4px 4px 0 #000;
  transition: transform .1s, box-shadow .1s;
}
.tabbar .tab-primary:active .tab-fab { transform: translate(3px, 3px); box-shadow: 1px 1px 0 #000; }

.foot { padding: var(--s-6) 0 112px; color: var(--muted); font: 700 .68rem var(--mono); text-transform: uppercase; letter-spacing: .1em; text-align: center; }
.foot-plain { padding-bottom: var(--s-6); }

/* ---------------------------------------- Tabellen als Karten (schmale Displays) */

@media (max-width: 699px) {
  .t-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
  .t-stack, .t-stack tbody { display: block; }
  .t-stack tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 16px 0; border-bottom: var(--bw) dashed var(--line-soft); }
  .t-stack.cols-2 tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .t-stack tr:first-child { padding-top: 0; }
  .t-stack tr:last-child { border-bottom: none; padding-bottom: 0; }
  .t-stack tbody tr:hover { background: none; }
  .t-stack td, .t-stack.compact td { display: block; padding: 0; border: none; text-align: left; min-width: 0; }
  .t-stack td[data-label]::before { content: attr(data-label); display: block; margin-bottom: 2px; font-size: .62rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
  .t-stack td.t-head { grid-column: 1 / -1; font-weight: 700; }
  .t-stack td.t-head.with-sum { grid-column: 1 / -2; }
  .t-stack td.t-sum { grid-column: -2 / -1; grid-row: 1; text-align: right; font-size: 1.1rem; align-self: start; }
  .t-stack td.t-wide, .t-stack td.t-end { grid-column: 1 / -1; }
  .t-stack td.t-end.t-right { grid-column: -2 / -1; text-align: right; align-self: end; }
  .t-stack td.t-wide.with-end { grid-column: 1 / -2; }
  .t-stack td:empty { display: none; }
}

/* ------------------------------------------------------------- Breakpoints */

@media (max-width: 440px) {
  .menu-label { max-width: 11ch; }
  .topbar-inner:has(.menu) .brand-text { display: none; }
}
@media (max-width: 560px) {
  .card { padding: var(--s-4); }
  .card-head { margin: calc(var(--s-4) * -1) calc(var(--s-4) * -1) var(--s-4); padding-inline: var(--s-4); }
  .totals-top .card-head { margin: 0; }
  .auth-card { padding: var(--s-6) var(--s-5); box-shadow: 6px 6px 0 var(--accent); }
}
@media (max-width: 979px) {
  .hide-mobile { display: none !important; }
  .form-actions .btn { flex: 1 1 auto; }
}

@media (min-width: 620px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .codes-grid { grid-template-columns: repeat(4, 1fr); }
  .facts { grid-template-columns: 1fr 1fr; column-gap: var(--s-8); }
  .car-grid { grid-template-columns: repeat(2, 1fr); }
  .totals-main { grid-template-columns: 1fr auto; align-items: end; }
  .totals-stats { grid-template-columns: repeat(4, auto); }
  .totals-stats > div { border-bottom: none; border-right: var(--bw) solid var(--ink) !important; }
  .totals-stats > div:last-child { border-right: none !important; }
  .share-row { grid-template-columns: minmax(0, 1.2fr) minmax(80px, 2fr) auto; align-items: center; gap: 6px 16px; }
  .share-bar { grid-column: auto; }
  .share-cost { min-width: 9ch; text-align: right; }
}

/* Ab hier: feste Seitenleiste statt Kopfzeile, keine untere Leiste mehr */
@media (min-width: 980px) {
  body:has(.topbar) { padding-left: var(--side-w); }
  .topbar { position: fixed; inset: 0 auto 0 0; width: var(--side-w); border-bottom: none; border-right: var(--bw) solid var(--ink); overflow-y: auto; }
  .topbar .topbar-inner { flex-direction: column; align-items: stretch; gap: 0; height: 100%; width: 100%; margin: 0; padding: var(--s-5) 0 var(--s-4); }
  .brand { padding: 0 var(--s-5) var(--s-5); font-size: 1.5rem; }
  .brand-mark { width: 44px; height: 44px; }

  .mainnav { display: flex; flex-direction: column; border-top: 1px solid var(--side-line); }
  .mainnav a {
    display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0 var(--s-5);
    color: var(--side-muted); text-decoration: none; border-bottom: 1px solid var(--side-line);
    border-left: 6px solid transparent;
    font: 700 1.05rem/1 var(--display); text-transform: uppercase; letter-spacing: .06em;
    transition: background .12s, color .12s;
  }
  .mainnav a:hover { background: var(--side-line); color: #fff; }
  .mainnav a[aria-current="page"] { background: #fff; color: #0f172a; border-left-color: var(--accent); }

  .side-cta { display: block; padding: var(--s-5); }
  .side-cta .btn { width: 100%; min-height: 52px; border-color: #fff; box-shadow: 4px 4px 0 #000; font-size: 1rem; }

  .topbar-right { margin: auto 0 0; flex-direction: column; align-items: stretch; gap: 0; border-top: 1px solid var(--side-line); }
  .topbar .menu > summary { width: 100%; min-height: 52px; padding: 0 var(--s-5); border: none; border-bottom: 1px solid var(--side-line); justify-content: space-between; }
  .topbar .menu-panel { top: auto; bottom: calc(100% + 4px); left: var(--s-3); right: var(--s-3); min-width: 0; }
  .icon-btn { width: 100%; height: 48px; display: flex; align-items: center; justify-content: flex-start; gap: 12px; padding: 0 var(--s-5); border: none; font: 600 .9rem var(--font); color: var(--side-muted); text-decoration: none; }
  .icon-btn:hover { color: #fff; }
  .icon-btn-label { display: inline; }

  .tabbar { display: none; }
  .foot { padding-bottom: var(--s-8); }
  .wrap { width: min(1180px, 100% - 64px); }
  .card { padding: var(--s-6); }
  .card-head { margin: calc(var(--s-6) * -1) calc(var(--s-6) * -1) var(--s-6); padding-inline: var(--s-6); }
  .totals-top .card-head { margin: 0; }
  .totals-main { padding: var(--s-6); }
  .totals-per-car { padding: 0 var(--s-6); }

  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .chart-row { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: repeat(4, 1fr); }
  .kpi-hero { grid-column: span 2; grid-row: span 2; }
  .card.car-header { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  .car-header-media { border-bottom: none; border-right: var(--bw) solid var(--ink); }
  .car-header-info { padding: var(--s-8); justify-content: center; }
  .car-form { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: var(--s-5); align-items: start; }
  .car-form > .sketch-preview-card { position: sticky; top: var(--s-5); }
  .car-form > .form-actions { grid-column: 2; }
  .share-row { grid-template-columns: minmax(0, 1fr) minmax(120px, 1.4fr) auto; }
  .share-meta { grid-column: 1 / -1; margin-top: -2px; }
  .form-narrow { max-width: 800px; }
}
@media (min-width: 1280px) {
  .car-grid { grid-template-columns: repeat(3, 1fr); }
}

@media print {
  .topbar, .tabbar, .foot, .btn, .skip-link { display: none !important; }
  body { background: #fff; color: #000; padding: 0 !important; }
  .card { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
