/* autokosten.css — Aussehen „Armaturenbrett“ für „Was das Auto wirklich kostet.“ (nur diese Seite).
   Bewusst dunkel, auch bei hellem System: tiefes Blauschwarz, Bernstein und kühles Weiß als Anzeigefarben,
   Rot nur für Warnung und immer mit Wort. Kein Leuchten, kein Glas. Schriften lokal (Mona Sans, Big Shoulders Display, OFL). */

@font-face {
  font-family: "Big Shoulders Display";
  src: url("../../schrift/big-shoulders-display-var.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

/* :root:root schlägt die hellen und dunklen Vorgaben der gemeinsamen Datei, egal was das System meldet */
:root:root {
  color-scheme: dark;
  --flaeche-0: #0a1019;
  --flaeche-1: #111926;
  --flaeche-2: #1a2434;
  --brett: #060b12;
  --linie: #2b384b;
  --raster: #1e2939;
  --text-1: #eef2f6;
  --text-2: #b6c0cd;
  --text-3: #8c99aa;
  --akzent: #f2a93b;
  --akzent-text: #f6bf66;
  /* Reihenfarben gehören den Fahrzeugen, geprüft auf dem dunklen Grund und für Rot-Grün-Schwäche */
  --s1: #3585e6; --s2: #f3f5f7; --s3: #c4e455; --s4: #e05a9e;
  --s5: #62e0d2; --s6: #9aa8bb; --s7: #d7a57c; --s8: #8f7fe8;
  /* Kostengruppen */
  --g-fix: #5f7390; --g-lauf: #b3c1d3; --g-ungeplant: #f2a93b;
  --gut: #46c58c; --warn: #f2a93b; --ernst: #f2a93b; --kritisch: #ff6b5e;
  --gut-text: #63d6a2; --kritisch-text: #ff8d82;
  --q1: #1c2a3d; --q2: #2c3f57; --q3: #4a5d74; --q4: #7d6a45; --q5: #b28a3f; --q6: #d99a3d; --q7: #f2a93b;
  --mitte: #243042; --div-kalt: #3585e6; --div-warm: #f2a93b;
  --schatten: 0 1px 2px rgb(0 0 0 / .4), 0 10px 28px -14px rgb(0 0 0 / .7);
  --anzeige: "Big Shoulders Display", "Mona Sans", system-ui, sans-serif;
}

html, body { overflow-x: clip; }
html { overflow-x: clip; background: var(--flaeche-0); }
body { background: var(--flaeche-0); color: var(--text-1); }

/* Tastatur: sichtbarer Rahmen */
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
a:focus-visible, button:focus-visible, .knopf:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
.knopf:has(input:focus-visible) { outline: 2px solid var(--text-1); outline-offset: 2px; }

/* ---------- Kopf und Titel ---------- */
.a-kopf { background: var(--flaeche-0); }
.a-titel { padding: 44px 0 22px; }
.a-titel h1 { font-family: var(--anzeige); font-weight: 760; font-stretch: normal; font-size: clamp(40px, 6.2vw, 78px); line-height: .98; letter-spacing: 0; max-width: 16ch; }
.a-titel p { color: var(--text-2); }
.a-schild { border-radius: 4px; border: 1px solid var(--linie); background: var(--flaeche-1); }
.a-schild i { background: var(--akzent); border-radius: 1px; }

.ablage { border-radius: 6px; border-color: #3a4a61; }
.ablage svg { color: var(--akzent); }
.knopf { border-radius: 4px; color: #17110a; white-space: nowrap; }
.knopf.leise { color: var(--text-1); background: var(--flaeche-2); }
.knopf:active, .tabelle-knopf:active { transform: translateY(1px); }
.k-hinweis { margin: -16px 0 24px; font-size: 14px; color: var(--text-2); max-width: 100ch; }

/* ---------- Filter und Eingaben ---------- */
.k-wahl { display: inline-flex; align-items: center; gap: 6px; margin-right: 10px; }
.k-wahl select { max-width: min(100%, 320px); }
select.feld { border-radius: 4px; background: var(--flaeche-1); }
.wahl { border-radius: 4px; flex-wrap: wrap; }
.wahl button { border-radius: 3px; min-height: 40px; }
.wahl button[aria-pressed="true"] { background: var(--akzent); color: #17110a; box-shadow: none; }
.k-felder { gap: 8px 14px; margin-bottom: 14px; }
.k-feld { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--text-2); }
.k-feld input {
  width: 92px; min-height: 44px; padding: 0 10px; border-radius: 4px; border: 1px solid #3a4a61;
  background: var(--brett); color: var(--akzent-text); font: 650 22px/1 var(--anzeige); letter-spacing: .02em; text-align: right;
}
.k-feldhinweis { font-size: 13px; color: var(--text-3); }

/* ---------- Armaturenbrett ---------- */
.brett { background: var(--brett); border: 1px solid var(--linie); border-radius: 10px; padding: 18px 18px 6px; margin-bottom: 8px; }
.uhren { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px 12px; }
.uhr { margin: 0; text-align: center; min-width: 0; }
.uhr svg { display: block; width: 100%; max-width: 250px; height: auto; margin: 0 auto; overflow: visible; }
.u-bahn { fill: none; stroke: #223044; stroke-width: 8; }
.u-wert { fill: none; stroke: var(--akzent); stroke-width: 8; stroke-dasharray: 100; stroke-dashoffset: 0; animation: u-auf 1.1s cubic-bezier(.2, .7, .2, 1) both; }
.u-strich { stroke: #46566d; stroke-width: 1; }
.u-strich.gross { stroke: #9aa8bb; stroke-width: 1.6; }
.u-zeiger { stroke: var(--text-1); stroke-width: 2.4; animation: u-ein .5s .8s both; }
.u-marke { stroke: var(--brett); stroke-width: 2; animation: u-ein .5s .9s both; }
.u-skala { fill: var(--text-3); font-size: 10px; }
.u-zahl { fill: var(--text-1); font: 720 44px/1 var(--anzeige); letter-spacing: .01em; }
.u-einheit { fill: var(--text-2); font-size: 11px; }
.uhr figcaption { margin-top: -6px; padding-bottom: 12px; }
.uhr figcaption b { display: block; font-size: 15px; font-weight: 650; }
.uhr figcaption span { display: block; font-size: 12.5px; color: var(--text-3); }
@keyframes u-auf { from { stroke-dashoffset: 100; } to { stroke-dashoffset: 0; } }
@keyframes u-ein { from { opacity: 0; } to { opacity: 1; } }

.anzeigen { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); border-top: 1px solid var(--linie); margin-top: 4px; }
.anzeige { padding: 14px 16px 12px 0; min-width: 0; }
.anzeige + .anzeige { padding-left: 16px; border-left: 1px solid var(--linie); }
.an-name { margin: 0; font-size: 13px; color: var(--text-2); }
.an-wert { margin: 2px 0; font: 700 34px/1.05 var(--anzeige); letter-spacing: .01em; color: var(--akzent-text); }
.an-wert.wort { font: 650 19px/1.25 "Mona Sans", system-ui, sans-serif; color: var(--text-1); padding: 6px 0 3px; }
.an-wert i, .tm-was small i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 7px; }
.an-neben { margin: 0; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 760px) {
  .brett { padding: 12px 10px 2px; }
  .uhren { grid-template-columns: 1fr 1fr; gap: 2px 4px; }
  .uhr figcaption b { font-size: 13.5px; }
  .anzeigen { grid-template-columns: 1fr; }
  .anzeige, .anzeige + .anzeige { padding: 12px 4px; border-left: 0; }
  .anzeige + .anzeige { border-top: 1px solid var(--linie); }
}

/* ---------- Abschnitte und Karten ---------- */
.abschnitt { margin-top: 52px; }
.abschnitt > h2 { font: 720 34px/1.05 var(--anzeige); letter-spacing: .005em; margin-bottom: 8px; }
.abschnitt > h2::before { content: ""; display: block; width: 44px; height: 3px; background: var(--akzent); margin-bottom: 12px; }
.karte { border-radius: 6px; background: var(--flaeche-1); }
.gitter > .voll { grid-column: 1 / -1; }
.karte-kopf .tabelle-knopf { border-radius: 4px; min-height: 36px; }
.tipp { border-radius: 4px; background: #1d2939; border-color: #3a4a61; }
.tabelle-huelle { border-radius: 4px; }
table.daten th { background: var(--flaeche-2); }
.einsicht .status { vertical-align: baseline; }
.status.warn, .status.ernst { color: var(--warn); }
.status.gut { color: var(--gut-text); }
.status.kritisch { color: var(--kritisch-text); }
.status::before { border-radius: 2px; }
.a-fuss a { color: var(--akzent-text); }

/* ---------- Fahrzeugkarten ---------- */
.wagen-liste { display: grid; gap: 10px; }
.wagen {
  display: grid; grid-template-columns: minmax(200px, 270px) minmax(0, 1fr) minmax(240px, 340px); gap: 14px 28px; align-items: center;
  background: var(--flaeche-1); border: 1px solid var(--linie); border-left: 5px solid var(--fz); border-radius: 6px; padding: 16px 20px 16px 18px;
}
.w-kz { display: inline-block; padding: 2px 9px 1px; border-radius: 3px; background: #e9edf2; color: #0a1019; font: 700 18px/1.25 var(--anzeige); letter-spacing: .06em; }
.w-wer h3 { margin: 8px 0 2px; font-size: 17px; font-weight: 650; line-height: 1.25; }
.w-wer p { margin: 0; font-size: 13px; color: var(--text-2); }
.w-zahlen { display: flex; flex-wrap: wrap; gap: 6px 34px; margin: 0 0 12px; }
.w-zahlen dt { font-size: 12.5px; color: var(--text-2); }
.w-zahlen dd { margin: 0; font: 700 32px/1.05 var(--anzeige); letter-spacing: .01em; white-space: nowrap; }
.w-zahlen dd small { font: 500 12px/1 "Mona Sans", system-ui, sans-serif; color: var(--text-2); margin-left: 5px; letter-spacing: 0; }
.w-stapel { display: flex; gap: 2px; height: 14px; min-width: 60px; border-radius: 2px; overflow: hidden; transform-origin: 0 50%; animation: k-wachsen .8s cubic-bezier(.2, .7, .2, 1) both; }
.w-stapel i { display: block; min-width: 2px; }
.w-leg { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 8px 0 0; font-size: 12.5px; color: var(--text-2); }
.w-leg span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.w-leg i { width: 9px; height: 9px; border-radius: 2px; }
.w-lauf { min-width: 0; }
.w-titel { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 4px; font-size: 12.5px; color: var(--text-2); }
.w-titel span { color: var(--text-3); }
.w-linie { position: relative; height: 64px; border-bottom: 1px solid var(--raster); cursor: crosshair; }
.w-linie svg { display: block; width: 100%; height: 100%; overflow: visible; }
.w-linie path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.w-linie i { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; box-shadow: 0 0 0 2px var(--flaeche-1); }
.w-trend { margin: 8px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--text-2); }
@media (max-width: 1020px) {
  .wagen { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .w-wer { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .wagen { grid-template-columns: minmax(0, 1fr); padding: 14px 14px 14px 12px; }
  .w-zahlen { gap: 6px 22px; }
  .w-zahlen dd { font-size: 28px; }
}

/* ---------- Balkenliste (eigene: gestapelte Teile und Marke) ---------- */
.k-liste { display: grid; }
.k-zeile {
  display: grid; grid-template-columns: minmax(0, var(--nb, 230px)) minmax(40px, 1fr) minmax(84px, auto);
  gap: 2px 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--raster);
}
.k-zeile:first-child { border-top: 0; }
.k-name { display: flex; gap: 8px; align-items: baseline; font-size: 13px; line-height: 1.3; color: var(--text-1); overflow-wrap: anywhere; min-width: 0; }
.k-name i { flex: none; width: 9px; height: 9px; border-radius: 2px; transform: translateY(0); }
.k-name small { display: block; font-size: 12px; color: var(--text-3); }
.k-spur { position: relative; display: flex; gap: 2px; height: 16px; min-width: 0; border-left: 1px solid #46566d; }
.k-spur i { display: block; height: 100%; min-width: 2px; transform-origin: 0 50%; animation: k-wachsen .8s cubic-bezier(.2, .7, .2, 1) both; }
.k-spur i:last-of-type { border-radius: 0 2px 2px 0; }
.k-spur b { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text-1); box-shadow: 0 0 0 1px var(--flaeche-1); }
.k-wert { font-size: 13px; font-weight: 600; color: var(--text-1); text-align: right; white-space: nowrap; }
.k-wert small { display: block; font-weight: 450; font-size: 12px; color: var(--text-3); }
.k-leer { margin: 6px 0; font-size: 14px; color: var(--text-3); }
@keyframes k-wachsen { from { transform: scaleX(0); } to { transform: none; } }
@media (max-width: 620px) {
  .k-zeile { grid-template-columns: minmax(0, 1fr) auto; }
  .k-name { grid-column: 1 / -1; }
  .k-wert { white-space: normal; max-width: 46vw; }
}

/* ---------- Termine ---------- */
.termine { display: grid; }
.termin { display: grid; grid-template-columns: 130px minmax(0, 1fr) minmax(0, 1.3fr); gap: 4px 20px; align-items: start; padding: 10px 0; border-top: 1px solid var(--raster); }
.termin:first-child { border-top: 0; }
.termin .status { font-size: 13px; padding-top: 1px; }
.termin b { display: block; font-size: 14px; font-weight: 620; }
.termin small { display: block; font-size: 12.5px; color: var(--text-3); line-height: 1.4; }
.tm-was small i { width: 8px; height: 8px; margin-right: 6px; }
@media (max-width: 760px) {
  .termin { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* ---------- Tabellen ---------- */
.k-tabelle, .als-tabelle { max-width: 100%; min-width: 0; }
.k-tabelle .tabelle-huelle { max-height: 440px; }
.k-tabelle table.daten td:nth-child(n+3) { white-space: normal; min-width: 170px; }
.k-wisch { display: none; margin: 0 0 6px; font-size: 12px; color: var(--text-3); }
@media (max-width: 900px) { .k-wisch { display: block; } }

button:disabled, input:disabled, select:disabled { opacity: .45; cursor: not-allowed; }
@media (prefers-reduced-motion: reduce) {
  .u-wert, .u-zeiger, .u-marke, .k-spur i, .w-stapel { animation: none; }
}

/* Nachträge */
.a-fuss a { color: inherit; }
.a-fuss p a { color: var(--akzent-text); }
.tm-mehr { border-top: 1px solid var(--raster); }
.tm-mehr summary { display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--akzent-text); }
.tm-mehr[open] summary { margin-bottom: 2px; }
.tm-mehr .termin:first-of-type { border-top: 0; }
#d-art .k-zeile { padding: 5px 0; }
.k-wahl { max-width: 100%; min-width: 0; margin-right: 0; }
.k-wahl select { min-width: 0; flex: 1 1 auto; width: 100%; max-width: 320px; }
.uhr figcaption { margin-top: 2px; }
.a-titel h1, .abschnitt > h2 { text-wrap: balance; }

/* ---------- Excel-Vorlage: dritter Knopf im Ablagefeld und neben dem CSV-Knopf ---------- */
@media (min-width: 721px) and (max-width: 1100px) { .ablage .knoepfe { max-width: 330px; } }
#vorlage, #vorlage ~ a.knopf { margin-block: 4px; }

/* Druck: das dunkle Armaturenbrett wird hell, Farben auf weißem Papier gut lesbar */
html:root.druckt {
  color-scheme: light;
  --flaeche-0: #ffffff; --flaeche-1: #ffffff; --flaeche-2: #eef1f5; --brett: #f4f6f9;
  --linie: #c3ccd8; --raster: #e1e6ed;
  --text-1: #0a1019; --text-2: #3a4554; --text-3: #5a6576;
  --akzent: #c77d10; --akzent-text: #8a5300;
  --s1: #2a6fc9; --s2: #2b3440; --s3: #6b8f00; --s4: #c2397f;
  --s5: #11938a; --s6: #75849a; --s7: #a0703f; --s8: #6250d6;
  --g-fix: #4b5f7c; --g-lauf: #9fb0c5; --g-ungeplant: #e0901f;
  --gut: #1a8f5a; --warn: #c98500; --ernst: #c98500; --kritisch: #d03b3b;
  --gut-text: #0f7a48; --kritisch-text: #b02a2a;
  --q1: #f1f3f6; --q2: #dfe4eb; --q3: #c2ccd8; --q4: #e9c78a; --q5: #e3a94c; --q6: #d38b22; --q7: #a86508;
  --mitte: #e8ecf1; --div-kalt: #2a6fc9; --div-warm: #e0901f;
}
html.druckt .u-bahn { stroke: #e1e6ed; }
html.druckt .u-strich { stroke: #9aa8bb; }
html.druckt .u-strich.gross { stroke: #46566d; }
html.druckt .w-kz { border: 1px solid #9aa8bb; }
html.druckt .k-spur { border-left-color: #9aa8bb; }

/* Verweis auf „Datei erkennen lassen“ */
.erkennen-satz { display: block; margin-top: 6px; font-size: 14px; color: var(--text-2); }
.erkennen-satz a { color: var(--akzent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
