/* UI-Umsetzung 25.11.2026: Stile dieses Bereichs. Gemeinsame Regeln (Breite, Schrift, Kopfzeile, Tabellen) stehen in styles.css. */
/* Rechnerseiten: /kostenrechner/, /depot-ladeleistungsrechner/, /depot-ladeplan/, /fahrzeugfinder/. Jede Regel nennt am Ende den Befund. */

/* Seitenkopf: Überschrift läuft über die ganze Inhaltsbreite; der vorhandene Hinweis steht rechts neben dem Einleitungstext. */
@media screen and (min-width:1051px){
.page-intro{display:grid;grid-template-columns:minmax(0,var(--measure)) minmax(0,1fr);column-gap:clamp(40px,5vw,80px);grid-auto-flow:row dense;align-items:start}
.page-intro>*{grid-column:1/-1;min-width:0}
.page-intro h1,.plan-intro h1{max-width:none;text-wrap:pretty}
.page-intro>.lead{grid-column:1;max-width:var(--measure)}
.page-intro>.notice{grid-column:2;max-width:var(--measure);margin:6px 0 0}
.page-intro>.cost-guide{margin-top:14px}
} /* M4 */

/* Erklärtext unter dem Rechner: ganze Abschnitte in zwei Spalten, gemeinsame linke Kante mit Kopf und Rechner, Zeilen höchstens --measure. */
.tool-notes{padding-top:10px;padding-bottom:55px}
.tool-notes .tool-notes-grid{max-width:none;padding:0}
.tool-notes-col{min-width:0;container-type:inline-size}
.tool-notes-grid :is(p,ul,ol,h2){max-width:var(--measure)}
.tool-notes-col>.tool-note:first-child>h2:first-child{margin-top:0}
.tool-notes .tool-note.sources{margin-top:40px}
.tool-notes .sources p{max-width:32rem}
@media screen and (min-width:1000px){
.tool-notes-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:clamp(40px,4.5vw,72px);align-items:start}
} /* M6 */
@media screen and (max-width:999px){.tool-notes-col+.tool-notes-col>.tool-note:first-child>h2:first-child{margin-top:40px}} /* M6 */

/* Herkunftstabelle des Kostenrechners: in schmaler Spalte (Handy, 1024) je Zeile ein Block statt 976 px seitlich scrollen. */
@container (max-width:560px){
.cost-origins,.cost-origins tbody,.cost-origins tr,.cost-origins th,.cost-origins td{display:block;width:auto!important;min-width:0!important}
.cost-origins{table-layout:auto!important}
.cost-origins caption{display:block;position:static}
.cost-origins thead{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
.cost-origins tbody tr{padding:16px 18px;border-bottom:1px solid var(--line)}
.cost-origins tbody tr:last-child{border-bottom:0}
.prose .cost-origins tbody th,.prose .cost-origins td{padding:0;border:0;width:auto}
.prose .cost-origins tbody th{font-size:.95rem;margin-bottom:4px}
.prose .cost-origins td[data-label]::before{content:attr(data-label) ": ";font-weight:600;color:var(--muted)}
.prose .cost-origins td+td{margin-top:6px}
} /* H7 */

/* Mitlaufende Kästen: unter der Sprungleiste; zu hohe Kästen laufen nicht angeschnitten mit (Klasse setzt das Skript). */
.tool-sticky{scroll-margin-top:calc(var(--sticky-top,0px) + 16px)}
#result-heading,#plan-output-title,#depot-result-title{scroll-margin-top:calc(var(--sticky-top,0px) + 16px)}
@media screen and (min-width:761px){.result-panel.tool-sticky{position:sticky;top:calc(var(--sticky-top,0px) + 24px)}}
@media screen and (min-width:761px){.finder-grid>#finder-form{position:sticky;top:calc(var(--sticky-top,0px) + 24px);align-self:start}}
.tool-sticky.is-tall{position:static!important} /* Ziel 7, D-11 */

/* Depot-Ladeplan: Auswertung am Desktop rechts neben dem Formular und mitlaufend. */
.plan-grid{margin-bottom:60px}
.plan-output{background:#fff;border:1px solid var(--line,#d8e0dc);border-radius:18px;padding:30px}
.plan-output>*{max-width:var(--measure)}
.plan-output>#plan-result{max-width:none}
.plan-output>h2{margin:0 0 14px}
@media screen and (min-width:1150px){
.plan-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(28px,3vw,48px);align-items:start}
.plan-grid>.plan-input,.plan-grid>.plan-output{margin-bottom:0;min-width:0}
.plan-grid>.plan-output{position:sticky;top:calc(var(--sticky-top,0px) + 24px)}
.plan-grid>.plan-output{padding:26px 24px}
.plan-output .plan-table table{min-width:0}
.plan-output .plan-table :is(th,td){padding:12px 10px}
.plan-output .plan-table tbody th{min-width:120px}
.plan-output .plan-verdict dd{font-size:1.4rem}
} /* M6 */
@media screen and (max-width:1149px){.plan-output{margin-top:8px}}
@media screen and (max-width:760px){.plan-output{padding:22px}}
@media screen and (max-width:520px){.plan-output{padding:18px}}
/* Breite Ergebnistabellen: erste Spalte bleibt beim seitlichen Scrollen stehen. */
.plan-table :is(th,td):first-child{position:sticky;left:0;z-index:1;background:#fff;box-shadow:1px 0 0 #d8e3dd}
.plan-table thead :is(th,td):first-child{background:#e5efe8} /* H7 */

/* Fahrzeugfinder: Formular schmal links, Ergebnisliste breit rechts in zwei Spalten. */
@media screen and (min-width:1280px){
.finder-grid{grid-template-columns:minmax(0,1fr) minmax(0,1.6fr)}
.finder-group ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:36px;padding-left:18px}
.finder-group li{margin:8px 0}
} /* H1, M6 */

/* Fahrzeugfinder, Umbau 29.11.2026: Herkunft eines belegten Verbrauchs aus der Adresse und Link in den Fahrzeugvergleich. */
.finder-source{margin:14px 0 18px;padding:12px 14px;background:var(--sage);border-radius:5px;font-size:.82rem;line-height:1.5;overflow-wrap:anywhere}
.finder-source strong{display:block}
.finder-compare{display:flex;flex-wrap:wrap;align-items:center;gap:10px 16px;margin:16px 0 14px;font-size:.85rem;line-height:1.5}
.finder-compare .button{flex:none;max-width:100%;min-height:44px;white-space:normal;text-align:left}
.finder-compare span{flex:1 1 16rem;min-width:0;color:var(--muted)}
/* Nachbesserung 30.11.2026: Hinweis unter dem Formular, wenn ein Wert aus der Adresse nicht übernommen wurde. */
.finder-address{margin:14px 0 0;padding:10px 12px;border-left:3px solid #b08a2e;background:#fbf6ea;border-radius:0 5px 5px 0;font-size:.82rem;line-height:1.5;color:var(--ink)}

/* Kleinste Schrift 12 px auf diesen Seiten (Einheiten, Hinweise, Rubrikzeilen, Ergebniszeilen); nur Werte darunter werden angehoben. */
main .eyebrow,.result-panel .eyebrow,.field-hint,.cost-field .field-hint,.result-note,.result-breakdown>div{font-size:.75rem}
@media(max-width:760px){.input-grid label,.input-with-unit>span,.result-panel .eyebrow{font-size:.75rem}}
@media(max-width:390px){.cost-components{font-size:.75rem}} /* Ziel 7, M9 */

/* Tippflächen am Handy mindestens 44 px hoch. */
.cost-export .button{min-height:44px}
.finder-class,.finder-check{min-height:44px}
@media(max-width:760px){.plan-intro>p:last-child a{display:inline-flex;align-items:center;min-height:44px}} /* Ziel 7, M8 */

/* Druck: das Raster wird zur Spalte, mitlaufende Kästen stehen still. */
@media print{
.plan-grid{display:block}
.plan-output{border:0;padding:0;position:static!important}
.tool-sticky{position:static!important}
.plan-table :is(th,td):first-child{position:static;box-shadow:none}
} /* Ziel 8 */

/* Depot-Ladeplan: Fahrzeugfelder zweispaltig, wenn das Formular schmal ist (neben der Auswertung); sonst abgeschnittene Uhrzeiten. */
.plan-input{container-type:inline-size}
@container (min-width:480px) and (max-width:800px){.plan-vehicle .plan-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.plan-vehicle .plan-fields>label:first-child{grid-column:1/-1}} /* M6 */

/* V3 (30.11.2026): Kurzergebnis des Kostenrechners am Handy. Es ist das letzte Element des Formulars und haftet am unteren
   Fensterrand, solange das Formular durchs Fenster läuft; am Formularende bleibt es direkt über dem ausführlichen Ergebnis stehen.
   Felder und Fehlermeldungen, die der Browser oder das Skript in den Blick rollt, halten Abstand zur Leiste (scroll-margin).
   Würde die Leiste die erste Eingabe verdecken (kleine Fenster beim Aufruf), setzt das Skript is-waiting: die Leiste tritt zurück,
   bis die Eingabe frei steht. --sticky-bottom: Höhe einer festen Leiste am unteren Rand (App). Ab 761 px steht das Ergebnis neben
   dem Formular: keine Leiste. Kasten und Formularkopf rücken am Handy etwas zusammen, damit die erste Eingabe über der Leiste steht.
   Nachbesserung 01.12.2026: Am Desktop bleibt der Seitenkopf wie auf den anderen Werkzeugseiten. Am Handy steht die Einleitung
   (Erklärsatz, einmal im HTML) unter der Unterzeile vor Kasten und Formular statt dahinter (styles.css: order 2), in 15 px statt
   16 px, damit die erste Eingabe bei 360 × 800 im ersten Bildschirm bleibt (gemessen 01.12.2026). Muster: .atlas-intro>.lead in
   styles.css. Bei 390 × 844 liegt die erste Eingabe damit unten im Fenster: die Leiste tritt beim Aufruf zurück (is-waiting). */
.cost-quick{display:none}
@media screen and (max-width:760px){
.cost-quick{position:sticky;bottom:var(--sticky-bottom,0px);z-index:5;display:flex;align-items:center;justify-content:space-between;gap:8px;margin:18px -23px -23px;padding:3px 6px 3px 14px;background:var(--green);color:#fff;border-radius:0 0 var(--radius) var(--radius);box-shadow:0 -6px 16px rgba(23,46,40,.18)}
.cost-quick.is-waiting{visibility:hidden}
.cost-quick-values{display:flex;flex-direction:column;min-width:0;margin:0;font-size:.8125rem;line-height:1.35}
.cost-quick-row{white-space:nowrap}
.cost-quick-values strong{color:var(--lime);font-size:.875rem}
.cost-quick-problem{margin:0;font-size:.8125rem;line-height:1.35}
.cost-quick-link{display:inline-flex;align-items:center;gap:.3em;flex:none;min-height:44px;padding:0 10px;border:1px solid #ffffff59;border-radius:6px;color:var(--lime);font-size:.8125rem;font-weight:700;text-decoration:none;white-space:nowrap}
.cost-quick-link:focus-visible{outline:3px solid var(--lime);outline-offset:-3px}
#cost-form :is(input,.field-error){scroll-margin-bottom:calc(var(--sticky-bottom,0px) + 76px)}
.tool-start>.page-intro.cost-intro>.lead{order:0;margin:0 18px 12px;font-size:.9375rem;line-height:1.45}
.tool-start>.cost-intro>.notice{padding:14px 16px}
#cost-form>.section-heading{margin-bottom:16px}
}
@media print{.cost-quick{display:none!important}}
