/* =====================================================================
   KFZ Schaden - Rechner  –  Gestaltung
   Eigenstaendig: laedt nichts von der Kanzleiseite und nichts aus dem Netz.
   Heller Grund, weisse Karten mit feiner Linie und weichem Schatten, dunkle Schrift.
   Signalfarbe Neongelb nur als Flaeche mit dunkler Schrift (Hauptknoepfe, aktiver Schritt, Band, Marken) -
   nie als Schrift oder Linie auf hellem Grund: Fokus, Verweise und Symbole stehen in der Schriftfarbe.
   Markenschrift Montserrat (r/schrift/, SIL OFL 1.1) fuer Schriftzug, Ueberschriften, Schrittleiste und Knoepfe;
   Fliesstext, Beschriftungen, Felder und Zahlen bleiben Systemschrift bzw. Rechenschrift.
   ===================================================================== */
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 400; font-display: swap; src: url("schrift/montserrat-regular.woff") format("woff"); }
@font-face { font-family: "Montserrat"; font-style: normal; font-weight: 700; font-display: swap; src: url("schrift/montserrat-bold.woff") format("woff"); }
:root {
  color-scheme: light;
  --grund: #f3f5f8;
  --grund-2: #e8ecf1;
  --flaeche: #ffffff;
  --flaeche-stark: #f5f7fa;
  --linie: rgba(16, 24, 40, 0.10);
  --linie-stark: rgba(16, 24, 40, 0.22);
  --text: #101418;
  --text-leise: #56616f;
  --text-dunkel: #0a0c0f;
  --signal: #e8ff2a;
  --signal-tief: #d6ee00;
  --kratzer: #e8ff2a;
  --verformung: #ff9a2e;
  --stark: #ff3d52;
  --gut: #0c7240;
  --radius: 18px;
  --schrift: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --rechenschrift: "Courier New", Courier, ui-monospace, "Liberation Mono", monospace;
  /* Ergaenzungen des hellen Schemas: Markenschrift, Fehlerton mit Kontrast auf Hell, blasse Flaechen fuer Hinweise, Kartenschatten */
  --markenschrift: "Montserrat", "Avenir Next", "Century Gothic", var(--schrift);
  --fehler: #b4162c;
  --fehler-hell: #fdeef0;
  --gut-hell: #e2f4ea;
  --signal-hell: #f7fbd5;
  --schatten: 0 1px 2px rgba(16, 24, 40, 0.05), 0 14px 36px -16px rgba(16, 24, 40, 0.18);
  --kopfhoehe: 64px;
  --band: 0px;                 /* Hoehe des Bandes der Betriebsart (Testbetrieb / KI nicht erreichbar); ohne Band 0 */
  /* Nebenfarben (seit 22.11.2026): kuehle Blaufamilie zum Signalgelb - dunkle Flaechen, getoente Karten, Linien und Zeichen.
     Das Signalgelb bleibt der einzige Akzent und steht weiter nur als Flaeche mit dunkler Schrift. */
  --nacht: #0c1424;
  --nacht-2: #17233b;
  --stahl: #44608a;
  --stahl-hell: #8fa6c6;
  --eis: #e9f0f8;
  --eis-2: #d3dfee;
  --himmel: #8db8ff;
}
body.mit-band { --band: 30px; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: hidden; scroll-padding-top: 112px; }   /* Kopf 64 + Band 30 + Luft: ein Feld mit Fokus liegt nie unter dem festen Kopf */
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--grund);
  font-family: var(--schrift); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
body::before {   /* ruhender, sehr heller Lichtschein hinter der Seite, keine Dauer-Animation */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(60vw 42vh at 84% -8%, rgba(232, 255, 42, 0.17), transparent 62%),
    radial-gradient(52vw 46vh at -8% 20%, rgba(96, 132, 180, 0.09), transparent 64%),
    linear-gradient(180deg, #f9fafc 0%, #f3f5f8 48%, #eef1f5 100%);
}
h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
a { color: inherit; }
::selection { background: var(--signal); color: var(--text-dunkel); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; border-radius: 6px; }

/* ----------------------------------------------------------- Betriebsart
   Festes Band ueber dem Kopf: Testbetrieb (Signalfarbe) oder fehlender Schluessel (Rot). */
.band {
  position: fixed; top: 0; left: 0; right: 0; z-index: 60; height: var(--band); padding: 0 12px;
  display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden;
  font-size: 0.8rem; font-weight: 750; letter-spacing: 0.03em;
}
.band-test { background: var(--signal); color: var(--text-dunkel); box-shadow: inset 0 -1px 0 rgba(10, 12, 15, 0.12); }
.band-fehler { background: var(--fehler); color: #fff; }
/* Betriebsart "aus": Der Rechner ist gesperrt, es bleibt nur dieser Hinweis. */
.sperre { margin: 0; padding: 22px; border-radius: var(--radius); border: 1px solid rgba(180, 22, 44, 0.32); background: var(--fehler-hell); color: var(--fehler); text-align: center; font-weight: 750; font-size: 1.08rem; }
/* Kennzeichen fuer Platzhalterwerte: in der Ablaufliste hinter dem Wert, bei den Kacheln als Marke auf dem oberen Rand */
.ph { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 999px; font-size: 0.64rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.5; color: var(--text-dunkel); background: var(--signal); box-shadow: 0 0 0 1px rgba(10, 12, 15, 0.16); vertical-align: 1px; white-space: nowrap; }
.ph-ecke { position: absolute; top: -9px; right: 14px; margin-left: 0; }

/* ------------------------------------------------------------------ Kopf */
.kopf { position: fixed; top: var(--band); left: 0; right: 0; z-index: 50; padding: 0 22px; }
.kopf::before {   /* heller, durchscheinender Kopf; ohne backdrop-filter fast deckend, damit der Schriftzug lesbar bleibt */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--linie);
  transition: background .3s ease, box-shadow .3s ease;
}
.kopf.gerollt::before { box-shadow: 0 10px 30px -18px rgba(16, 24, 40, 0.28); }
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .kopf::before {
    background: linear-gradient(135deg, rgba(255,255,255,0.72) 0%, rgba(255,255,255,0.58) 50%, rgba(255,255,255,0.68) 100%);
    -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  }
  .kopf.gerollt::before { background: linear-gradient(135deg, rgba(255,255,255,0.93) 0%, rgba(255,255,255,0.90) 100%); }   /* traegt auch, wo der Weichzeichner nicht gezeichnet wird */
}
.kopf-innen { max-width: 1080px; margin: 0 auto; height: var(--kopfhoehe); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.marke { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.marke-zeichen { width: 30px; height: 30px; flex: none; }
.marke-schrift { font-family: var(--markenschrift); font-size: 1rem; font-weight: 400; letter-spacing: 0; white-space: nowrap; }
.marke-schrift i { font-style: normal; color: var(--text-leise); margin: 0 1px; }
.marke-schrift b { font-weight: 700; }
.kopf-hinweis { font-size: 0.78rem; color: var(--text-leise); border: 1px solid var(--linie-stark); border-radius: 999px; padding: 5px 12px; white-space: nowrap; text-decoration: none; background: rgba(255,255,255,0.6); }
a.kopf-hinweis:hover { color: var(--text); border-color: var(--text); }

/* ---------------------------------------------------------------- Buehne */
.buehne { padding: calc(var(--kopfhoehe) + var(--band) + 54px) 22px 26px; }
.buehne-innen { max-width: 1080px; margin: 0 auto; text-align: center; container-type: inline-size; }
.vorzeile { color: var(--text-leise); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; }
/* Titelzeile: Zeichen und Schriftzug fuellen genau eine Zeile. Die Groesse folgt der Breite (cqw = Hundertstel der
   Buehnenbreite, Teiler passend zur Markenschrift); r/app.js misst nach und stellt sie genau ein, auch fuer die Rueckfallschrift. */
h1 { margin-top: 12px; font-family: var(--markenschrift); font-size: clamp(1.3rem, 7.4vw, 5.2rem); font-size: calc(100cqw / 12.95); line-height: 1.05; font-weight: 400; letter-spacing: -0.02em; display: inline-flex; align-items: center; flex-wrap: nowrap; white-space: nowrap; column-gap: 0.28em; }
h1 b { font-weight: 700; }
h1 span { color: var(--text-leise); font-weight: 400; }
h1 em { font-style: normal; white-space: nowrap; }   /* Strich und zweites Wort brechen nicht auseinander */
.titel-zeichen { position: relative; top: 0.015em; width: 1em; height: 1em; flex: none; margin-right: 0.04em; }   /* Scheibe auf die Mitte der Versalien */
.schritte { list-style: none; margin: 24px 0 0; padding: 0; display: flex; justify-content: center; flex-wrap: nowrap; gap: clamp(4px, 1.7cqw, 10px); }
.schritte li { display: inline-flex; align-items: center; gap: clamp(5px, 1.9cqw, 10px); padding: 6px clamp(8px, 3cqw, 18px) 6px 6px; border-radius: 999px; border: 1px solid var(--linie); color: var(--text-leise); font-family: var(--markenschrift); font-size: 0.8rem; font-weight: 700; background: rgba(255,255,255,0.7); }
.schritte li b { width: clamp(22px, 7cqw, 26px); height: clamp(22px, 7cqw, 26px); border-radius: 50%; display: grid; place-items: center; font-size: 0.76rem; font-weight: 700; background: var(--grund-2); color: var(--text-leise); flex: none; }
.schritt-zeichen { width: clamp(20px, 6.8cqw, 27px); height: clamp(20px, 6.8cqw, 27px); flex: none; }
.schritt-zeichen.breit { width: clamp(26.7px, 9.07cqw, 36px); }   /* Zeichen im Feld 64 x 48 (3D-Wagen): gleiche Hoehe, vier Drittel der Breite */
.schritt-zeichen.breit.klein { width: clamp(22.7px, 7.71cqw, 30.6px); height: clamp(17px, 5.78cqw, 22.95px); }   /* Fahrzeugschein der ersten Pille: 15 % kleiner */
.nur-vorleser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.zeichenvorrat { position: absolute; width: 0; height: 0; overflow: hidden; }
.schritte li.aktiv { color: var(--text-dunkel); border-color: rgba(10, 12, 15, 0.16); background: var(--signal); }
.schritte li.aktiv b { background: var(--text-dunkel); color: #fff; }
.schritte li.fertig { color: var(--text); }
.schritte li.fertig b { background: var(--gut-hell); color: var(--gut); }

/* ---------------------------------------------------------------- Karten */
.rechner { max-width: 1124px; margin: 0 auto; padding: 8px 22px 70px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.karte {
  position: relative; min-width: 0; border-radius: var(--radius); border: 1px solid var(--linie);
  background: var(--flaeche);
  box-shadow: var(--schatten);
}
.karte-kopf { display: flex; align-items: center; gap: 12px; padding: 18px 22px; }
.karte-kopf h2 { font-family: var(--markenschrift); font-size: 1.1rem; font-weight: 700; letter-spacing: -0.01em; }
.nr { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex: none; font-family: var(--markenschrift); font-weight: 700; font-size: 0.86rem; background: var(--signal); color: var(--text-dunkel); box-shadow: inset 0 0 0 1px rgba(10, 12, 15, 0.14); }
.kurz { flex: 1; min-width: 0; color: var(--text-leise); font-size: 0.92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aendern { margin-left: auto; background: var(--flaeche); border: 1px solid var(--linie-stark); border-radius: 999px; padding: 5px 13px; font-size: 0.82rem; color: var(--text-leise); }
.aendern:hover { color: var(--text); border-color: var(--text); }
.karte-inhalt { padding: 2px 22px 24px; }
.karte.gesperrt { background: rgba(255,255,255,0.5); box-shadow: none; }
.karte.gesperrt .karte-inhalt, .karte.zu .karte-inhalt { display: none; }
.karte.gesperrt .karte-kopf h2 { color: #7a8491; }
.karte.gesperrt .nr { background: var(--grund-2); color: #7a8491; box-shadow: none; }
.karte.zu .nr { background: var(--gut-hell); color: var(--gut); box-shadow: none; }
.karte.zu { box-shadow: none; }

/* ---------------------------------------------------------------- Felder */
.zeile { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; align-items: end; }
.zeile-breit { grid-template-columns: 1fr; }
.feld { display: block; min-width: 0; }
.feld > span { display: block; font-size: 0.8rem; font-weight: 600; color: var(--text-leise); margin-bottom: 6px; }
.feld input, .feld select {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid rgba(16, 24, 40, 0.3); outline: none;
  background: var(--flaeche); color: var(--text); transition: border-color .15s ease, box-shadow .15s ease; -webkit-appearance: none; appearance: none;
}
.feld select { background-image: linear-gradient(45deg, transparent 50%, var(--text-leise) 50%), linear-gradient(135deg, var(--text-leise) 50%, transparent 50%); background-position: calc(100% - 19px) 21px, calc(100% - 14px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.feld select option { color: #111; }
.feld textarea {
  display: block; width: 100%; min-height: 76px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(16, 24, 40, 0.3); outline: none; resize: vertical;
  background: var(--flaeche); color: var(--text); line-height: 1.4; transition: border-color .15s ease, box-shadow .15s ease; -webkit-appearance: none; appearance: none;
}
.feld input::placeholder, .feld textarea::placeholder { color: #6b7582; opacity: 1; }
.feld input:hover, .feld select:hover, .feld textarea:hover { border-color: rgba(16, 24, 40, 0.46); }
.feld input:focus, .feld select:focus, .feld textarea:focus { border-color: var(--text); box-shadow: 0 0 0 3px rgba(16, 24, 40, 0.13); }
/* Fehlende oder falsche Angabe: Klasse falsch (Marke, Modell, Jahr) und aria-invalid (Pflichtfelder) sehen gleich aus */
.feld input.falsch, .feld select.falsch, .feld input[aria-invalid="true"], .feld select[aria-invalid="true"], .feld textarea[aria-invalid="true"] { border-color: var(--fehler); background-color: #fffafa; box-shadow: 0 0 0 3px rgba(180, 22, 44, 0.12); }
.feld input.falsch:focus, .feld select.falsch:focus, .feld input[aria-invalid="true"]:focus, .feld select[aria-invalid="true"]:focus, .feld textarea[aria-invalid="true"]:focus { border-color: var(--fehler); box-shadow: inset 0 0 0 1px var(--fehler), 0 0 0 3px rgba(180, 22, 44, 0.3); }
.doppel { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 8px; }
.meldung { margin: 6px 0 0; padding: 10px 14px; border-radius: 12px; font-size: 0.9rem; background: var(--fehler-hell); border: 1px solid rgba(180, 22, 44, 0.32); color: var(--fehler); }
.meldung.info { background: var(--signal-hell); border-color: rgba(16, 24, 40, 0.14); color: var(--text); }
.knopfzeile { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.knopfzeile-mitte { justify-content: center; margin-top: 26px; }

.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 0 24px;
  border-radius: 999px; border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--text); font-family: var(--markenschrift); font-size: 0.95rem; font-weight: 700; letter-spacing: 0;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
  transition: transform .12s ease, box-shadow .2s ease, background .2s ease, border-color .2s ease, opacity .2s ease;
}
.knopf:hover { background: var(--flaeche-stark); border-color: rgba(16, 24, 40, 0.4); }
.knopf:active { transform: scale(0.985); }
.knopf[disabled] { opacity: 0.45; cursor: not-allowed; }
.knopf-signal { background: var(--signal); color: var(--text-dunkel); border-color: rgba(10, 12, 15, 0.18); box-shadow: inset 0 1px 0 rgba(255,255,255,0.55), 0 10px 24px -12px rgba(10, 12, 15, 0.38); }
.knopf-signal:hover { background: var(--signal-tief); border-color: rgba(10, 12, 15, 0.3); box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), 0 12px 28px -12px rgba(10, 12, 15, 0.46); }
.knopf-signal[disabled] { opacity: 1; background: var(--grund-2); color: #7a8491; border-color: var(--linie); box-shadow: none; }
.knopf-gross { min-height: 58px; padding: 0 38px; font-size: 1.04rem; }
.knopf-klein { min-height: 38px; padding: 0 16px; font-size: 0.8rem; white-space: nowrap; }
.link { background: none; border: none; padding: 0; color: var(--text-leise); text-decoration: underline; text-underline-offset: 3px; }
.link:hover { color: var(--text); }

/* --------------------------------------------------------------- Ablagen */
.ablage {
  display: grid; justify-items: center; gap: 7px; text-align: center; padding: 30px 22px; border-radius: 16px; cursor: pointer;
  border: 1.5px dashed rgba(16, 24, 40, 0.3); background: var(--flaeche-stark); transition: border-color .15s ease, background .15s ease;
}
.ablage:hover, .ablage.drueber { border-color: var(--text); background: var(--signal-hell); }
.ablage svg { width: 54px; height: 54px; padding: 12px; border-radius: 50%; background: var(--signal); box-shadow: inset 0 0 0 1px rgba(10, 12, 15, 0.14); fill: none; stroke: var(--text-dunkel); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.ablage b { font-size: 1rem; }
.ablage span { color: var(--text-leise); font-size: 0.88rem; max-width: 34rem; }
.ablage em { font-style: normal; font-size: 0.86rem; font-weight: 600; color: var(--text); }
/* Fahrzeugschein: grosses Zeichen (aufgeklappt, drei Abschnitte), darunter Aufforderung und Hinweis */
.ablage-schein { padding: 26px 20px 24px; gap: 8px; }
.ablage .schein-zeichen { width: min(260px, 82%); height: auto; padding: 0; margin-bottom: 8px; border-radius: 0; background: none; box-shadow: none; fill: none; stroke: none; stroke-width: 1; stroke-linecap: butt; stroke-linejoin: miter; filter: drop-shadow(0 8px 12px rgba(16, 24, 40, 0.14)); }
.ablage-schein b { font-family: var(--markenschrift); font-size: 1.08rem; }
#fahrzeug-form { margin-top: 22px; }
.ablage.laedt { pointer-events: none; opacity: 0.7; }

.fotoliste { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.fotoliste li { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; border: 1px solid var(--linie-stark); background: var(--grund-2); }
.fotoliste img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fotoliste .nummer { position: absolute; left: 6px; bottom: 6px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: rgba(10, 12, 15, 0.72); color: #fff; font-size: 0.74rem; font-weight: 700; display: grid; place-items: center; }
.fotoliste button { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(10, 12, 15, 0.72); color: #fff; font-size: 1rem; line-height: 1; display: grid; place-items: center; }
.fotoliste button:hover { background: var(--fehler); }
.fotoliste button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px rgba(10, 12, 15, 0.72); }

/* Statusanzeige waehrend einer Pruefung: Ladezeichen, Stichwort, Angabe und laufende Zeit - alles mittig */
.fortschritt { display: grid; justify-items: center; gap: 3px; margin-top: 20px; text-align: center; color: var(--text-leise); font-size: 0.92rem; }
.fortschritt .lader { width: 46px; height: 46px; margin-bottom: 8px; }
.fortschritt b { color: var(--text); font-family: var(--markenschrift); font-size: 1rem; font-weight: 700; }
.fortschritt small { font-family: var(--rechenschrift); font-size: 0.82rem; }
/* Ladezeichen aus dem Zeichen der Seite: Scheibe und Innenkreis stehen, die Sichel laeuft um und wechselt dabei
   zwischen Weiss und der Signalfarbe; der Ring bleibt zwei Drittel seiner Zeit schwarz und wechselt dann einmal nach Hellgrau und zurueck (jeder dritte Farbwechsel der Sichel). Ein Durchgang = sieben Umdrehungen: fuenf schnell (0,75 s je Umdrehung), dann zwei
   mit halbem Tempo, dann wieder schnell. Die Uebergaenge dauern je 0,6 s und sind eine weiche S-Kurve des Tempos (zwei
   Parabelstuecke, je als cubic-bezier) - das Tempo springt nie und faellt nie unter die Haelfte. Gezaehlt wird von
   Mitte Uebergang bis Mitte Uebergang; erzeugt mit den Werten in .claude/kfz-entwurf/werkzeug/_lader_keyframes.txt. */
.lader { width: 22px; height: 22px; flex: none; display: block; overflow: visible; }
.lader-grund { fill: var(--text); animation: lader-grund 10.05s ease-in-out infinite; }
.lader-sichel { fill: #fff; transform-origin: 24px 24px; animation: lader-dreh 6.7s linear infinite, lader-farbe 3.35s ease-in-out infinite; }
@keyframes lader-dreh { 0% { transform: rotate(0deg); animation-timing-function: linear; } 47.761% { transform: rotate(1536deg); animation-timing-function: cubic-bezier(0.3333, 0.3636, 0.6667, 0.7273); } 52.239% { transform: rotate(1668deg); animation-timing-function: cubic-bezier(0.3333, 0.4286, 0.6667, 0.7143); } 56.716% { transform: rotate(1752deg); animation-timing-function: linear; } 91.045% { transform: rotate(2304deg); animation-timing-function: cubic-bezier(0.3333, 0.2857, 0.6667, 0.5714); } 95.522% { transform: rotate(2388deg); animation-timing-function: cubic-bezier(0.3333, 0.2727, 0.6667, 0.6364); } 100% { transform: rotate(2520deg); } }
@keyframes lader-farbe { 0%, 100% { fill: #fff; } 50% { fill: var(--signal); } }
@keyframes lader-grund { 0%, 66.667%, 100% { fill: var(--text); } 83.333% { fill: #b6bdc7; } }   /* Ring: zwei Drittel der Zeit schwarz, dann einmal nach Hellgrau und zurueck - hell, wenn die Sichel zum dritten Mal gelb ist */

/* ---------------------------------------------------------------- Modell */
.ki-satz { margin: 2px 0 14px; padding: 12px 15px; border-radius: 12px; background: var(--signal-hell); border: 1px solid rgba(16, 24, 40, 0.14); font-size: 0.93rem; }
.ki-satz b { color: var(--text); font-weight: 700; }
.modell-rahmen {
  position: relative; display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; border: 1px solid var(--linie);
  background: linear-gradient(180deg, #f7f8fa 0%, #eceff3 60%, #e3e7ec 100%);
}
#modell { display: block; width: 100%; max-width: 100%; height: clamp(300px, 52vh, 520px); touch-action: pan-y; cursor: grab; }
#modell:active { cursor: grabbing; }
.modell-rahmen { border-color: var(--linie-stark); }   /* Rand der hellen Buehne etwas kraeftiger */
.modell-schild { position: absolute; left: 14px; top: 60px; padding: 6px 12px; border-radius: 999px; font-size: 0.84rem; font-weight: 650; color: var(--text); background: rgba(255, 255, 255, 0.88); border: 1px solid var(--linie-stark); box-shadow: 0 4px 14px -6px rgba(16, 24, 40, 0.3); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); pointer-events: none; }
/* Die Leiste der Ansichten steht ueber der Leinwand, die Legende darunter: Nichts liegt auf dem Wagen */
.modell-ansichten { order: -1; align-self: flex-end; margin: 10px 12px 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.88); border: 1px solid var(--linie-stark); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.modell-ansichten button { border: none; background: none; color: var(--text-leise); padding: 5px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; }
.modell-ansichten button:hover { color: var(--text); background: rgba(16, 24, 40, 0.08); }
.modell-legende { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; padding: 8px 12px; font-size: 0.78rem; color: var(--text-leise); background: var(--flaeche); border-top: 1px solid var(--linie); pointer-events: none; }   /* Leiste unter der Leinwand: verdeckt kein Teil des Wagens */
.modell-legende span { display: inline-flex; align-items: center; gap: 6px; }
.pkt { width: 12px; height: 12px; border-radius: 3px; display: inline-block; box-shadow: inset 0 0 0 1px rgba(10, 12, 15, 0.5); }
.pkt-kratzer { background: var(--kratzer); }
.pkt-verformung { background: var(--verformung); }
.pkt-stark { background: var(--stark); }
.pkt-vorschlag { background: repeating-linear-gradient(45deg, #ffffff 0 3px, #5d6670 3px 6px); }
.modell-ersatz { padding: 60px 22px; text-align: center; color: var(--text-leise); }
/* Verdeckte und kleine Teile als Umschalt-Knoepfe direkt unter dem Modell */
.schnellwahl { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.schnellwahl button { min-height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--text); font-size: 0.84rem; font-weight: 600; white-space: nowrap; }
.schnellwahl button:hover { border-color: var(--text); }
.schnellwahl button.an { background: var(--stark); border-color: rgba(10, 12, 15, 0.2); color: var(--text-dunkel); }
.modell-fuss { display: flex; align-items: center; justify-content: space-between; gap: 8px 18px; flex-wrap: wrap; margin-top: 12px; }
.tipp { color: var(--text-leise); font-size: 0.86rem; }
.form-wahl { --fw: 1; display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; min-width: 0; max-width: 100%; overflow: hidden; }   /* bleibt in seiner Zeile: r/app.js verkleinert --fw, bis alles hineinpasst */
.form-wahl span { font-size: calc(0.8rem * var(--fw)); color: var(--text-leise); font-weight: 600; margin-right: 4px; }
.form-wahl button { border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--text-leise); border-radius: 999px; padding: 5px calc(13px * var(--fw)); font-size: calc(0.82rem * var(--fw)); font-weight: 600; white-space: nowrap; }
.form-wahl button:hover { color: var(--text); border-color: var(--text); }
.form-wahl button.an { color: #fff; background: var(--text); border-color: transparent; }
.zwischen { margin: 24px 0 10px; font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-leise); }

.teilliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.teilliste li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-radius: 13px; border: 1px solid var(--linie); background: var(--flaeche-stark); }
.teilliste li.vorschlag { border-style: dashed; border-color: rgba(16, 24, 40, 0.42); }
.teil-name { font-weight: 650; min-width: 0; cursor: pointer; }
.teil-name small { display: block; font-weight: 400; color: var(--text-leise); font-size: 0.8rem; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teil-name .marke-ki { display: inline-block; margin-left: 7px; padding: 1px 7px; border-radius: 999px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; background: var(--signal); color: var(--text-dunkel); box-shadow: 0 0 0 1px rgba(10, 12, 15, 0.16); vertical-align: 2px; }
.art-wahl { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--linie-stark); background: var(--flaeche); }
.art-wahl button { border: none; background: none; color: var(--text-leise); padding: 5px 11px; border-radius: 999px; font-size: 0.8rem; font-weight: 650; white-space: nowrap; }
.art-wahl button:hover { color: var(--text); }
.art-wahl button.an { box-shadow: inset 0 0 0 1px rgba(10, 12, 15, 0.18); }
.art-wahl button.an[data-art="kratzer"] { background: var(--kratzer); color: var(--text-dunkel); }
.art-wahl button.an[data-art="verformung"] { background: var(--verformung); color: var(--text-dunkel); }
.art-wahl button.an[data-art="stark"], .art-wahl button.an[data-art="bruch"] { background: var(--stark); color: var(--text-dunkel); }
.art-wahl button.an[data-wahl="stahl"], .art-wahl button.an[data-wahl="leichtmetall"] { background: var(--text); color: #fff; }   /* Felgenart: neutral, keine Schadenstufe */
.weg { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--text-leise); font-size: 1.05rem; line-height: 1; display: grid; place-items: center; }
.weg:hover { color: var(--fehler); border-color: var(--fehler); background: var(--fehler-hell); }
.leer { color: var(--text-leise); font-size: 0.92rem; padding: 6px 2px; }
.mehr-teile { margin-top: 12px; border: 1px solid var(--linie); border-radius: 13px; background: var(--flaeche-stark); }
.mehr-teile summary { padding: 12px 15px; cursor: pointer; font-size: 0.92rem; font-weight: 600; color: var(--text); list-style: none; }
.mehr-teile summary::-webkit-details-marker { display: none; }
.mehr-teile summary::before { content: "+"; display: inline-block; width: 1.1em; color: var(--text); font-weight: 800; }
.mehr-teile[open] summary::before { content: "–"; }
.teilgruppen { padding: 0 15px 15px; display: grid; gap: 12px; }
.teilgruppen h4 { margin: 0 0 6px; font-size: 0.74rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-leise); font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips button { border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: 0.84rem; }
.chips button:hover { border-color: var(--text); }

.schalterreihe { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.schalter { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 0.94rem; }
.schalter input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.schalter span { position: relative; width: 42px; height: 24px; border-radius: 999px; background: #b4bdc8; transition: background .15s ease; flex: none; }
.schalter span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, 0.35); transition: transform .15s ease, background .15s ease; }
.schalter input:checked + span { background: var(--text); }
.schalter input:checked + span::after { transform: translateX(18px); background: var(--signal); box-shadow: none; }
.schalter input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 3px; }

.wahl { display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid var(--linie-stark); background: var(--flaeche-stark); }
.wahl label { position: relative; cursor: pointer; }
.wahl input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.wahl span { display: block; padding: 9px 20px; border-radius: 999px; font-weight: 650; font-size: 0.94rem; color: var(--text-leise); }
.wahl input:checked + span { background: var(--text); color: #fff; }
.wahl input:focus-visible + span { outline: 2px solid var(--text); outline-offset: 2px; }

.ablaufliste { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 8px; }
.ablaufliste li { display: flex; align-items: flex-start; gap: 11px; color: var(--text-leise); font-size: 0.94rem; }
.ablaufliste li::before { content: ""; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid rgba(16, 24, 40, 0.2); flex: none; }
.ablaufliste .inhalt { min-width: 0; }
.ablaufliste li.laeuft { color: var(--text); }
.ablaufliste li.laeuft::before { display: none; }
.ablaufliste li .lader { width: 20px; height: 20px; margin: 1px -1px 0; }   /* etwas groesser als die Kreise; der Text bleibt in der Flucht */
.ablaufliste li.fertig::before { border-color: var(--gut); background: var(--gut) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.4l2.7 2.6L13 6.6' fill='none' stroke='%23ffffff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.ablaufliste li.entfaellt::before { border-color: rgba(16, 24, 40, 0.32); background: linear-gradient(rgba(16, 24, 40, 0.55), rgba(16, 24, 40, 0.55)) center / 8px 2px no-repeat; }
.ablaufliste li.fehler { color: var(--fehler); }
.ablaufliste li.fehler::before { border-color: var(--fehler); }
.ablaufliste small { color: var(--text-leise); margin-left: 7px; }
.ablaufliste .ph { margin-left: 7px; }

/* ------------------------------------------------------------- Uebersicht */
.uebersicht { display: grid; gap: 14px; }
.haupt { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.kachel { position: relative; border-radius: 16px; border: 1px solid var(--linie); background: var(--flaeche-stark); padding: 18px 20px; min-width: 0; }
.kachel .titel { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-leise); overflow-wrap: anywhere; }
.kachel .wert { margin-top: 6px; font-size: clamp(1.5rem, 3.2vw, 2.1rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; }
.kachel .wert small { font-size: 0.5em; font-weight: 600; color: var(--text-leise); margin-left: 4px; letter-spacing: 0; }
.kachel .neben { margin-top: 6px; color: var(--text-leise); font-size: 0.88rem; }
.kachel-haupt { background: linear-gradient(150deg, rgba(232,255,42,0.42), rgba(232,255,42,0.07) 62%), var(--flaeche); border-color: rgba(16, 24, 40, 0.16); }
.kachel-haupt .wert { font-size: clamp(2.2rem, 6vw, 3.4rem); color: var(--text); }
.einstufung { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 6px 13px; border-radius: 999px; font-weight: 750; font-size: 0.95rem; }
.einstufung.rep { background: var(--gut-hell); color: var(--gut); border: 1px solid rgba(12, 114, 64, 0.36); }
.einstufung.grenz { background: #fff1d6; color: #7c4a00; border: 1px solid rgba(124, 74, 0, 0.36); }
.grenzfall { margin-top: 10px; padding: 9px 12px; border-left: 3px solid var(--text); background: var(--signal-hell); border-radius: 0 10px 10px 0; font-size: 0.86rem; line-height: 1.45; color: var(--text); }
.einstufung.total { background: var(--fehler-hell); color: var(--fehler); border: 1px solid rgba(180, 22, 44, 0.36); }
.raster { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.raster .wert { font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
/* lange Titel (Wiederbeschaffungswert) brechen nur an der Trennstelle, nie mitten im Wort */
.raster .kachel .titel { font-size: 0.7rem; letter-spacing: 0.06em; overflow-wrap: normal; hyphens: manual; }
.alternativen { border-radius: 16px; border: 1px solid var(--linie); background: var(--flaeche-stark); padding: 6px 20px; }
.alternativen > .titel { padding: 13px 0 4px; font-size: 0.76rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-leise); }
.alt { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 0; border-top: 1px solid var(--linie); align-items: baseline; }
.alt:first-of-type { border-top: none; }
.alt .wann { font-weight: 650; }
.alt .summe { font-size: 1.3rem; font-weight: 800; white-space: nowrap; }
.alt .wie { grid-column: 1 / -1; color: var(--text-leise); font-size: 0.86rem; }
.hinweiszeile { color: var(--text-leise); font-size: 0.84rem; text-align: center; }
/* Sternchen an Reparaturkosten (*) und Restwert (**): klein, hochgestellt, leise. Die Erlaeuterung dazu steht ganz unten in
   der Uebersicht - klein und ruhig, linksbuendig (auch am Handy, wo die Kacheln mittig stehen), in lesbarer Zeilenlaenge. */
.kachel .wert .stern { font-size: 0.56em; font-weight: 600; letter-spacing: 0.02em; color: var(--text-leise); vertical-align: top; line-height: 1; position: relative; top: 0.12em; margin-left: 0.1em; }
.kachel-haupt .wert .stern { font-size: 0.42em; top: 0.2em; }
.neu { text-align: center; margin-top: 18px; font-size: 0.9rem; }

/* Schieberegler: Grundstil (Spur, Griff fuer den Daumen). Der Fokus zeigt sich als Rahmen um den ganzen Regler (allgemeine Regel
   :focus-visible), der Griff traegt bewusst weder Schatten noch Ring: Die Anpassen-Regler der Uebersicht setzen hierauf auf und
   geben dem Griff eigene Masse. */
input[type="range"] { -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 44px; margin: 0; padding: 0; border: none; border-radius: 999px; background: none; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--linie-stark); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--linie-stark); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 30px; height: 30px; margin-top: -12px; border-radius: 50%; border: 2px solid var(--text); background: var(--signal); }
input[type="range"]::-moz-range-thumb { box-sizing: border-box; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--text); background: var(--signal); }
input[type="range"]:focus-visible { outline-offset: 0; }
input[type="range"]:disabled { opacity: 0.45; cursor: not-allowed; }

/* ---------------------------------------------------------------- Dokument
   Die Blaetter des Kalkulationsdokuments (r/dokument.js). Wo sie stehen - Muster, Ansicht nach dem Kauf, Druckbogen -
   regelt r/kauf.js (Gestaltung dazu in r/kauf.css); .dokument ist der Kasten, in dem sie untereinander stehen. */
.dokument { padding: 18px; display: grid; gap: 18px; justify-items: center; }
.blatt-halter { position: relative; }
.blatt {
  width: 210mm; height: 297mm; background: #fff; color: #111; transform-origin: top left; position: absolute; left: 0; top: 0;
  box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.10), 0 3px 8px rgba(16, 24, 40, 0.08), 0 26px 60px -22px rgba(16, 24, 40, 0.38); padding: 15mm 17mm 16mm 20mm; display: flex; flex-direction: column;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif; font-size: 9.6pt; line-height: 1.38; font-variant-numeric: tabular-nums;
  /* Das Blatt uebernimmt nichts von seiner Umgebung: Es sieht ueberall gleich aus (Muster, Ansicht nach dem Kauf, Druckbogen) */
  font-weight: 400; font-style: normal; text-align: left; text-transform: none; text-indent: 0; letter-spacing: normal; word-spacing: normal; white-space: normal;
}
/* Briefkopf des Deckblatts: links Zeichen und Schriftzug mit Unterzeile, rechts klein und rechtsbuendig der Absender */
.blatt .bk { display: flex; justify-content: space-between; align-items: center; gap: 10mm; padding-bottom: 4mm; border-bottom: 0.35mm solid #111; }
.blatt .bk-marke { display: flex; align-items: center; gap: 3.6mm; min-width: 0; }
.blatt .bk svg { width: 13.5mm; height: 13.5mm; flex: none; }
.blatt .bk-schrift { display: flex; flex-direction: column; min-width: 0; }
.blatt .bk-schrift b { font-size: 15.5pt; line-height: 1.15; letter-spacing: 0.005em; white-space: nowrap; }
.blatt .bk-schrift span { margin-top: 0.9mm; font-size: 9pt; line-height: 1.2; white-space: nowrap; }
.blatt .bk .absender { flex: none; max-width: 78mm; font-size: 7.8pt; line-height: 1.4; text-align: right; color: #222; overflow-wrap: anywhere; }
.blatt .bk .absender b { color: #111; }
.blatt .bk-klein { display: flex; justify-content: space-between; font-size: 9pt; padding-bottom: 2.4mm; border-bottom: 0.3mm solid #111; }
.blatt .rumpf { flex: 1; min-height: 0; padding-top: 7mm; overflow: hidden; }
.blatt .bf { display: flex; justify-content: space-between; gap: 6mm; padding-top: 2.4mm; border-top: 0.3mm solid #111; font-size: 7.6pt; color: #333; }
.blatt .bf .seite { white-space: nowrap; }
.blatt h3.gesperrt { margin: 6mm 0 0; font-size: 15pt; letter-spacing: 0.42em; font-weight: 700; }
.blatt .nummernzeile { display: flex; justify-content: space-between; align-items: flex-end; gap: 8mm; margin-top: 2mm; }
.blatt .nummernfeld { text-align: right; }
.blatt .nummernfeld .datum { font-size: 9pt; margin-bottom: 1.4mm; }
.blatt .nummernfeld .kasten { display: inline-block; min-width: 62mm; padding: 2.6mm 5mm; background: #c9c9c9; border: 0.3mm solid #333; font-size: 13pt; font-weight: 700; text-align: center; letter-spacing: 0.02em; }
.blatt .nummernfeld .unter { font-size: 7pt; margin-top: 1mm; text-align: center; }
.blatt table.daten { width: 100%; border-collapse: collapse; margin-top: 5mm; }
.blatt table.daten td { padding: 0.6mm 0; vertical-align: top; }
.blatt table.daten td:first-child { width: 62mm; }
.blatt table.daten tr.fett td { font-weight: 700; }
.blatt h4 { margin: 6mm 0 2.4mm; font-size: 11pt; font-weight: 700; text-decoration: underline; text-underline-offset: 1mm; }
.blatt table.summen { width: 100%; border-collapse: collapse; }
.blatt table.summen td { padding: 0.75mm 0; vertical-align: top; }
.blatt table.summen td.w { width: 14mm; text-align: right; }
.blatt table.summen td.b { width: 34mm; text-align: right; white-space: nowrap; }
.blatt table.summen tr.fett td { font-weight: 700; }
.blatt table.summen td.breit { font-size: 8pt; color: #333; padding: 0 0 1.6mm; }
.blatt .absatz { margin-top: 3mm; }
.blatt .klein { font-size: 8pt; color: #333; }
.blatt .einzeiler { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Enger gesetztes Blatt: nur dort, wo sonst ein kurzer Rest allein auf ein neues Blatt muesste (r/dokument.js, fliesse) */
.blatt.dicht h3.gesperrt { margin-top: 2mm; }
.blatt.dicht h4 { margin: 3.6mm 0 1.4mm; }
.blatt.dicht table.daten { margin-top: 3mm; }
.blatt.dicht table.daten td { padding: 0.25mm 0; }
.blatt.dicht table.summen td { padding: 0.35mm 0; }
.blatt.dicht table.summen td.breit { padding: 0 0 1mm; }
.blatt.dicht .absatz { margin-top: 1.6mm; }
.blatt.dicht ul.schlicht li { margin: 0.2mm 0; }
/* Testbetrieb: Wasserzeichen quer ueber jedes Blatt (auch im Druck) */
.wasserzeichen { position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%) rotate(-36deg); font-size: 64pt; font-weight: 800; letter-spacing: 0.1em; line-height: 1; white-space: nowrap; color: rgba(214, 24, 46, 0.14); pointer-events: none; -webkit-user-select: none; user-select: none; }
/* Muster (unbezahlte Vorschau, d.muster): Wasserzeichen neutral dunkel und blass; ab dem zweiten Blatt ist der Inhalt
   unkenntlich - unscharf, nicht markierbar, nicht antippbar. Kopf- und Fusszeile bleiben stehen. Das Muster wird nie gedruckt. */
.wasserzeichen.wz-muster { font-size: 88pt; letter-spacing: 0.2em; padding-left: 0.2em; color: rgba(16, 24, 40, 0.085); }
.blatt.verdeckt .rumpf { filter: blur(1.7mm); -webkit-user-select: none; user-select: none; pointer-events: none; }
.blatt ul.schlicht { margin: 1mm 0 0; padding-left: 5mm; }
.blatt ul.schlicht li { margin: 0.6mm 0; }
.blatt pre.kalk { margin: 0; font-family: var(--rechenschrift); font-size: 8.7pt; line-height: 1.34; white-space: pre; color: #111; }
.blatt .bildseite { display: grid; grid-template-rows: 1fr 1fr; gap: 7mm; height: 100%; }
.blatt .bild { display: flex; flex-direction: column; min-height: 0; }
.blatt .bild .rahmen { flex: 1; min-height: 0; background: #f1f1f1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.blatt .bild img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.blatt .bild figcaption, .blatt .bild .unterschrift { font-size: 8.4pt; padding-top: 1.6mm; }

/* ------------------------------------------------------------------ Fuss */
.fuss { border-top: 1px solid var(--linie); padding: 22px; }
.fuss-innen { max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; color: var(--text-leise); font-size: 0.86rem; }
.fuss-marke { display: inline-flex; align-items: center; gap: 9px; }
.fuss-zeichen { width: 20px; height: 20px; flex: none; }
.fuss .marke-schrift { font-size: 0.84rem; }
.fuss nav { display: flex; gap: 20px; margin-left: auto; }
.fuss a { text-decoration: none; }
.fuss a:hover { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
/* Erlaeuterung zu den Sternchen der Uebersicht (* Reparaturkosten, ** Restwert): seit dem 22.11.2026 (spaet) ganz unten
   im Seitenfuss, Schrift 9 px. Farbe: auf dem Seitengrund derselbe Abstand wie zuvor #6a7482 auf Weiss (4,7:1) */
.sternhinweise { display: grid; gap: 4px; max-width: 1080px; margin: 16px auto 0; padding-top: 14px; border-top: 1px solid var(--linie); text-align: left; color: #646e7b; font-size: 0.5625rem; line-height: 1.5; }
.sternhinweise p { display: grid; grid-template-columns: 1.6em minmax(0, 1fr); margin: 0; }
.sternhinweise .stern { font-weight: 600; }
.kosten-knopf { border: none; background: none; padding: 4px 8px; font-size: 0.95rem; line-height: 1; color: rgba(16, 24, 40, 0.09); border-radius: 8px; }
.kosten-knopf:hover { color: rgba(16, 24, 40, 0.42); }

.kosten-fenster { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 18px; background: rgba(16, 24, 40, 0.34); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.kosten-innen { width: min(820px, 100%); max-height: 86vh; overflow: auto; border-radius: 18px; border: 1px solid var(--linie); background: var(--flaeche); padding: 20px 22px 22px; box-shadow: 0 30px 90px -20px rgba(16, 24, 40, 0.5); }
.kosten-innen header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kosten-innen h2 { font-family: var(--markenschrift); font-size: 1.06rem; font-weight: 700; }
.schliessen { border: 1px solid var(--linie-stark); background: var(--flaeche); width: 34px; height: 34px; border-radius: 50%; font-size: 1.2rem; line-height: 1; color: var(--text-leise); }
.schliessen:hover { color: var(--text); border-color: var(--text); }
.kosten-innen table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
.kosten-innen th, .kosten-innen td { padding: 7px 8px; text-align: right; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.kosten-innen th:first-child, .kosten-innen td:first-child { text-align: left; white-space: normal; }
.kosten-innen th { color: var(--text-leise); font-weight: 600; font-size: 0.76rem; letter-spacing: 0.06em; text-transform: uppercase; }
.kosten-innen tfoot td { font-weight: 800; border-bottom: none; }
.kosten-innen .zusatz { margin-top: 14px; color: var(--text-leise); font-size: 0.84rem; display: grid; gap: 4px; }
.kosten-innen .zusatz b { color: var(--text); }

/* Unterseiten (Impressum, Datenschutz) */
.text-seite { max-width: 780px; margin: 0 auto; padding: calc(var(--kopfhoehe) + 48px) 22px 70px; }
.text-seite h1 { font-size: clamp(1.9rem, 5vw, 2.8rem); font-weight: 700; margin-bottom: 22px; }
.text-seite h2 { font-family: var(--markenschrift); font-size: 1.06rem; font-weight: 700; margin: 26px 0 8px; }
.text-seite p, .text-seite li { color: #2c353f; margin: 8px 0; }
.text-seite a { color: var(--text); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.text-seite a:hover { text-decoration-thickness: 2px; }

/* ----------------------------------------------------------------- Schmal */
@media (max-width: 980px) { .raster { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 820px) {
  .haupt { grid-template-columns: 1fr; }
  .raster { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kopf-hinweis { display: none; }
}
@media (max-width: 560px) {
  .kopf { padding: 0 14px; }
  .kopf-innen { justify-content: center; }
  /* Am Handy mittig: Kennzahlen der Kalkulation, Anspruchswege, Zwischenueberschriften, Schalter */
  .kachel, .alternativen > .titel, .zwischen, .leer { text-align: center; }
  .kachel-arbeit .wert { justify-content: center; }
  .alt { text-align: center; justify-items: center; }
  .schalterreihe { justify-content: center; }
  .fuss-innen { justify-content: center; text-align: center; }
  .buehne { padding-left: 16px; padding-right: 16px; padding-top: calc(var(--kopfhoehe) + var(--band) + 34px); }
  .rechner { padding-left: 12px; padding-right: 12px; }
  .karte-kopf { padding: 16px; }
  .karte-inhalt { padding: 2px 16px 20px; }
  .zeile { grid-template-columns: 1fr; gap: 12px; margin-bottom: 12px; }
  .feld-leer { display: none; }
  .knopfzeile { justify-content: center; }
  .knopf { width: 100%; }
  .knopf-klein { width: auto; }
  .band { font-size: 0.76rem; letter-spacing: 0.01em; }
  .teilliste li { grid-template-columns: minmax(0, 1fr) auto; }
  .teilliste .art-wahl { grid-column: 1 / 2; grid-row: 2; justify-self: start; flex-wrap: wrap; border-radius: 18px; }
  .teilliste .art-wahl button { padding: 5px 9px; }
  .teilliste .weg { grid-row: 1 / 3; grid-column: 2; }
  /* Schild mit Teilname und Stufe: nie breiter als die Buehne */
  .modell-schild { top: 56px; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Knoepfe am Handy mittig: Umschalt-Knoepfe als zwei gleich breite Spalten, ein einzelner letzter ueber die ganze Breite */
  .schnellwahl { display: grid; grid-template-columns: 1fr 1fr; }
  .schnellwahl button { padding: 0 8px; font-size: 0.8rem; }
  .schnellwahl button:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .modell-fuss { flex-direction: column; align-items: stretch; text-align: center; min-width: 0; }
  .form-wahl { justify-content: center; gap: 4px; }
  .form-wahl span { margin-right: 2px; }
  .form-wahl button { padding: 5px calc(9px * var(--fw)); font-size: calc(0.78rem * var(--fw)); }
  .modell-ansichten { align-self: center; margin: 8px 8px 0; }
  .modell-ansichten button { padding: 5px 8px; font-size: 0.74rem; }
  /* Legende: kleinere Schrift, bricht bei Bedarf in zwei Zeilen */
  .modell-legende { font-size: 0.72rem; gap: 3px 12px; padding: 7px 8px; }
  .wahl { display: flex; }
  .wahl label { flex: 1; text-align: center; }
  .wahl span { padding: 9px 8px; }
  .dokument { padding: 10px; }
  .fuss nav { margin-left: 0; }
  /* Kennzahlen am Handy als Zeilen: oben die Bezeichnung, darunter links die Nebenangabe und rechts der Wert */
  .raster { grid-template-columns: 1fr; gap: 10px; }
  .raster .kachel { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; padding: 14px 16px; }
  .raster .kachel .titel { grid-column: 1 / -1; }
  .raster .kachel .wert { grid-column: 1 / -1; grid-row: 2; margin-top: 4px; }
  .raster .kachel .neben { grid-column: 1 / -1; grid-row: 3; margin-top: 2px; }
  /* Abrechnungswege untereinander: Stichwort, Summe, Zusammensetzung */
  .alt { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .lader-sichel { animation: lader-farbe 3.35s ease-in-out infinite; } }

/* ------------------------------------------------------------------ Druck
   Gedruckt wird nur das bezahlte Kalkulationsdokument, Blatt fuer Blatt im Format A4 (Regeln am Ende dieses Abschnitts). */
@page { size: A4; margin: 0; }
/* Sechs Ansichten bleiben auch am schmalen Handy in einer Zeile */
@media (max-width: 420px) {
  .modell-ansichten { gap: 2px; padding: 3px; flex-wrap: nowrap; }
  .modell-ansichten button { padding: 5px clamp(3px, 1.7vw, 8px); font-size: clamp(0.62rem, 3vw, 0.74rem); }
}
/* Der Druckbogen (.ksr-druck) ist ein Kind von <body>, das r/kauf.js anlegt: Er traegt das saubere Dokument der
   bezahlten Kalkulation in voller Groesse und liegt am Bildschirm ausserhalb des Fensters (r/kauf.css).
   - Bezahlt (body.ksr-frei): Gedruckt wird allein der Druckbogen - alles andere auf der Seite entfaellt, gleich,
     was die Seite sonst noch traegt.
   - Nicht bezahlt: Das Dokument kommt nicht aufs Papier - weder der Druckbogen noch das Muster (der Abschluss
     entfaellt im Druck ganz) noch die Werkbank (.ksr-werkbank), auf der r/kauf.js die Blaetter setzt. Die Seite
     selbst druckt ohne festen Kopf und Fenster. */
@media print {
  html, body { background: #fff !important; }
  body::before, .band, .kopf, .kosten-fenster, .rechtsfenster, .ksr-werkbank { display: none !important; }
  body:not(.ksr-frei) > .ksr-druck, body:not(.ksr-frei) .abschluss, body:not(.ksr-frei) .dokument { display: none !important; }
  body:not(.ksr-frei) .buehne { padding-top: 12mm; }
  body.ksr-frei > :not(.ksr-druck) { display: none !important; }
  body.ksr-frei > .ksr-druck { display: block !important; position: static !important; width: auto !important; height: auto !important; margin: 0 !important; padding: 0 !important; overflow: visible !important; opacity: 1 !important; visibility: visible !important; }
  .blatt-halter { width: 210mm !important; height: 296.6mm !important; page-break-after: always; break-after: page; overflow: hidden; }   /* knapp unter A4: bei genau 297 mm schiebt WebKit hinter jedes Blatt eine leere Seite */
  .blatt-halter:last-child { page-break-after: auto; break-after: auto; }
  .blatt { position: static !important; transform: none !important; box-shadow: none !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---- Anpassen-Regler der Uebersicht ---- */
/* Kleiner Knopf in den Kacheln Reparaturkosten, Wiederbeschaffungswert und Restwert: oeffnet die Einstellung in der Kachel */
.anpassen { margin-top: 12px; line-height: 1; }
.knopf-mini {
  position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--text-leise);
  font-size: 0.76rem; font-weight: 650; line-height: 1; white-space: nowrap; transition: background .2s ease, color .2s ease;
}
.knopf-mini::after { content: ""; position: absolute; inset: -8px -6px; }      /* Tippflaeche groesser als der Knopf */
.knopf-mini:hover { background: var(--flaeche-stark); color: var(--text); }
.knopf-mini[disabled] { opacity: 0.38; cursor: not-allowed; }
/* Meldung in der Kachel, deren Anpassung nicht uebernommen werden konnte (Farben: Klasse .meldung) */
.kachel .meldung { margin-top: 12px; font-size: 0.84rem; line-height: 1.4; }
/* Stichwort an einem von Hand angepassten Wert */
.angepasst { display: inline-block; padding: 0 7px; border-radius: 999px; border: 1px solid var(--linie-stark); color: var(--text); font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; line-height: 1.6; text-transform: uppercase; white-space: nowrap; vertical-align: 1px; }
/* Einstellung in der Kachel: Regler mit Namen und laufendem Wert, darunter "Uebernehmen" und "Abbrechen" */
.regler { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--linie); min-width: 0; }
.regler-felder { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px 24px; }
.regler-mehr .regler-felder { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.regler-feld { min-width: 0; }
.regler-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-size: 0.84rem; font-weight: 600; color: var(--text-leise); }
.regler-wert { font-family: var(--rechenschrift); font-size: 0.96rem; font-weight: 700; color: var(--text); white-space: nowrap; }
.regler-marke { font-size: 0.74rem; color: var(--text-leise); }
/* Regler: Der Griff ist als Flaeche 44 px gross (gut zu greifen), sichtbar ist seine Scheibe von 26 px. Die Spur endet
   deshalb 9 px vor dem Rand des Reglers (die Scheibe steht an beiden Enden genau am Spurende), und der Regler ragt
   um diese 9 px ueber die Textkante, damit Spur und Beschriftung buendig stehen. */
.regler input[type="range"] {
  -webkit-appearance: none; appearance: none; display: block; width: calc(100% + 18px); height: 44px; margin: 0 -9px; padding: 0; border: none; background: transparent;
  cursor: pointer; touch-action: pan-y;     /* waagerechtes Ziehen gehoert dem Regler, senkrechtes Wischen rollt weiter die Seite */
}
.regler input[type="range"]::-webkit-slider-runnable-track {
  height: 6px; background:
    radial-gradient(circle at 100% 50%, var(--linie-stark) 3px, transparent 3.5px) left / 12px 100% no-repeat,
    radial-gradient(circle at 0 50%, var(--linie-stark) 3px, transparent 3.5px) right / 12px 100% no-repeat,
    linear-gradient(var(--linie-stark), var(--linie-stark)) center / calc(100% - 24px) 100% no-repeat;
}
.regler input[type="range"]::-moz-range-track {
  height: 6px; background:
    radial-gradient(circle at 100% 50%, var(--linie-stark) 3px, transparent 3.5px) left / 12px 100% no-repeat,
    radial-gradient(circle at 0 50%, var(--linie-stark) 3px, transparent 3.5px) right / 12px 100% no-repeat,
    linear-gradient(var(--linie-stark), var(--linie-stark)) center / calc(100% - 24px) 100% no-repeat;
}
.regler input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; box-sizing: border-box; width: 44px; height: 44px; margin-top: -19px; border-radius: 50%;
  border: 9px solid transparent; background: var(--text); background-clip: padding-box;
}
.regler input[type="range"]::-moz-range-thumb {
  box-sizing: border-box; width: 44px; height: 44px; border-radius: 50%; border: 9px solid transparent; background: var(--text); background-clip: padding-box;
}
/* beide Knoepfe nebeneinander und gleich breit; nur wo die Kachel dafuer zu schmal ist, untereinander */
.regler-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.regler-knoepfe .knopf { flex: 1 1 92px; width: auto; min-width: 0; padding: 0 6px; font-size: 0.76rem; letter-spacing: 0; }
/* Der Restwert wird nach einer Anpassung nachgeholt: Kachel "in Arbeit"; was am Restwert haengt (Einstufung, Grenzfall,
   Anspruch), gilt solange noch nicht und ist abgeblendet */
.kachel-arbeit .wert { display: flex; align-items: center; min-height: 1.1em; }
.kachel-arbeit .lader { width: 30px; height: 30px; }
.uebersicht.in-arbeit .einstufung, .uebersicht.in-arbeit .grenzfall, .uebersicht.in-arbeit .alt { opacity: 0.4; }
@media (max-width: 560px) {
  .regler-mehr .regler-felder { grid-template-columns: minmax(0, 1fr); }
  .raster .kachel .anpassen, .raster .kachel .regler, .raster .kachel .meldung { grid-column: 1 / -1; }
  .anpassen { text-align: center; }      /* Knoepfe am Handy mittig */
}
