/* Solarrechner – Optik nach Figma-Entwurf «Solarrechner – UI-Entwurf 2026», Farben aus dem Theme autosolar_bw.
 * Handy zuerst; ab 640 px breitere Karten, ab 1024 px Seitenleisten (Schritte links, Zusammenfassung rechts).
 */
:root {
  --brand: #FAAA0F;
  --brand-light: #FFD76E;
  --brand-tint: #FFF4D6;
  --coal: #323232;
  --text: #232323;
  --muted: #6F6E6A;
  --line: #CECBBD;
  --bg: #FFFFFF;
  --paper: #FAFAF6;
  --beige: #EBE6D2;
  --panel: #1E2A3A;
  --error: #C81414;
  --error-bg: #FDECEC;
  --info: #0067A3;
  --ok: #2E7D32;
  --r-s: 8px;
  --r-m: 12px;
  --r-l: 20px;
  --shadow: 0 1px 2px rgba(50, 46, 30, .06), 0 6px 18px rgba(50, 46, 30, .06);
  --font: "Helvetica Neue", "Helvetica", Arial, sans-serif;
  --font-cond: "HelveticaNeue-CondensedBold", "Helvetica-Condensed", "Helvetica Neue Condensed", "Arial Narrow", "Helvetica", Arial, sans-serif;
  --focus: 0 0 0 3px #232323, 0 0 0 5px var(--brand);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
:root { color-scheme: light; }          /* gleich wie die Shop-Seite, sonst zeichnet der Browser den iframe deckend */
html:not(.embedded) body { background: var(--paper); }
html, body { max-width: 100%; overflow-x: hidden; }   /* nichts darf seitlich überstehen, sonst lässt sich der iframe seitwärts schieben */
@supports (overflow: clip) { html, body { overflow-x: clip; } }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.45;
  color: var(--text); background: transparent;   /* im iframe scheint das Beige der Shop-Seite durch, allein weiss */
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--coal); }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; }      /* unter 16px zoomt iOS beim Antippen in die Seite hinein */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
[hidden] { display: none !important; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--brand); padding: 8px 12px; z-index: 10; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { color: var(--muted); margin: -4px 0 16px; }
.label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 20px 0 8px; }
.label.light { color: var(--brand-light); margin: 0; }

/* ---------------------------------------------------------------- Rahmen */

.shell { max-width: 1240px; margin: 0 auto; }
.side-nav, .summary-side { display: none; }
.app { max-width: 760px; margin: 0 auto; padding: 8px 16px 128px; }

.appbar { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-top: 8px; }
.appbar-title { flex: 1 1 auto; min-width: 0; }
.appbar h1 { overflow-wrap: break-word; font-family: var(--font-cond); font-weight: 700; font-size: clamp(22px, 7vw, 28px); line-height: 1.05; margin: 0 0 4px; text-transform: uppercase; letter-spacing: .02em; }
.appbar p { margin: 0; max-width: 58ch; font-size: 15px; }
.appbar-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
/* schmal: Titel und Knöpfe in einer Zeile, Untertitel darunter über die ganze Breite */
@media (max-width: 599px) {
  .appbar { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; }
  .appbar-title { display: contents; }
  .appbar h1 { grid-column: 1; grid-row: 1; margin: 0; font-size: clamp(19px, 5.6vw, 28px); overflow-wrap: normal; }
  .appbar p { grid-column: 1 / -1; grid-row: 2; margin-top: 6px; }
  .appbar-actions { grid-column: 2; grid-row: 1; gap: 6px; }
  .appbar-actions .round-btn { width: 40px; height: 40px; }
  .appbar-actions .lang select { min-height: 40px; min-width: 60px; padding-left: 10px; padding-right: 22px; }
}
@media (max-width: 339px) { .appbar #call { display: none; } }   /* Telefon steht in Schritt 1 auch im Inhalt */
.lang select { border: 1px solid var(--line); border-radius: 999px; padding: 8px 28px 8px 14px; background: var(--bg); min-height: 44px; width: auto; min-width: 72px; font-weight: 700; }
.round-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--brand-tint); color: var(--coal); cursor: pointer; flex: 0 0 auto; text-decoration: none; }
.round-btn .ic { width: 22px; height: 22px; }
.round-btn.small { width: 36px; height: 36px; background: var(--paper); border: 1px solid var(--line); }
.round-btn.small .ic { width: 18px; height: 18px; }

.banner { background: var(--brand-tint); border-left: 4px solid var(--brand); padding: 10px 12px; margin: 12px 0 0; border-radius: var(--r-s); font-size: 14px; }

/* Fortschritt */
.progress { margin: 16px 0 8px; }
.progress-head { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.progress-head strong { color: var(--text); }
.bars { list-style: none; display: flex; gap: 4px; padding: 0; margin: 0; }
.bars li { flex: 1; height: 4px; border-radius: 2px; background: rgba(50, 46, 30, .12); position: relative; }
.bars li.done, .bars li.current { background: var(--brand); }
.bars button { all: unset; position: absolute; inset: -12px 0; cursor: pointer; }
.bars button:focus-visible { box-shadow: var(--focus); }

h2 { font-family: var(--font-cond); font-weight: 700; font-size: 26px; line-height: 1.12; margin: 18px 0 14px; }
h3 { font-size: 18px; line-height: 1.25; margin: 22px 0 10px; }

/* ---------------------------------------------------------------- Bausteine */

.card { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-l); padding: 16px; margin: 14px 0; }
.card > h3:first-child { margin-top: 0; }
.card.tint { background: var(--brand-tint); border-color: var(--brand-light); }
.card.dark { background: var(--coal); border-color: var(--coal); color: #fff; }
.card.dark .muted, .card.dark p { color: var(--beige); }
.ic-box { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-m); background: var(--brand-tint); flex: 0 0 auto; }
.ic-box.small { width: 36px; height: 36px; border-radius: 10px; }
.ic-box.accent { background: var(--brand); }
.ic-box.ok { background: #E3F1E4; color: var(--ok); }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hint-box { display: flex; gap: 10px; align-items: flex-start; background: var(--brand-tint); border-radius: var(--r-m); padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.hint-box .ic { flex: 0 0 20px; width: 20px; height: 20px; }
.hint-box a { font-weight: 700; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid var(--coal); background: var(--bg); border-radius: 999px; padding: 11px 20px; min-height: 48px; cursor: pointer; font-weight: 700; text-decoration: none; }
.btn .ic { width: 20px; height: 20px; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #1a1a1a; }
.btn.primary:hover { background: var(--brand-light); border-color: var(--brand-light); }
.btn.secondary { background: var(--bg); border-color: var(--coal); border-width: 1.5px; }
.btn.secondary.on-dark { background: transparent; border-color: var(--beige); color: #fff; }
.btn.dark { background: var(--coal); border-color: var(--coal); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost.danger { color: var(--error); }
.btn.ghost.danger .ic { color: var(--error); }
.btn.block { width: 100%; }
.btn.small { padding: 6px 14px; min-height: 38px; font-size: 14px; }
.btn.round { width: 48px; height: 48px; padding: 0; border: 1.5px solid var(--line); }
.btn.round .ic { width: 22px; height: 22px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.restart-row { display: flex; justify-content: center; margin: 24px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.restart-row .btn { color: var(--muted); font-weight: 400; }
.restart-row .btn .ic { color: var(--muted); width: 18px; height: 18px; }
/* Rückmeldung beim Antippen wie in einer App */
.btn, .pick, .chip, .tab, .alt, .segmented label, .preset, .dev-main, .qty button, .node, .roof-opt, .round-btn, .num-stepper button, .seg button { transition: transform .1s var(--ease), background-color .15s, border-color .15s; }
.btn:not(:disabled):active, .pick:active, .chip:active, .tab:active, .alt:active, .segmented label:active, .preset:active,
.dev-main:active, .qty button:not(:disabled):active, .node:active, .roof-opt:active, .round-btn:active, .num-stepper button:active, .seg button:active { transform: scale(.97); }

/* Auswahl (Radio als Segment) */
.segmented { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented label { position: relative; border: 1.5px solid var(--line); background: var(--bg); border-radius: 999px; padding: 9px 14px; cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 6px; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); font-weight: 700; }
.segmented label:has(input:focus-visible) { box-shadow: var(--focus); }

fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
fieldset.compact { margin-bottom: 12px; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }

/* Felder */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 14px; font-weight: 700; }
.field small { color: var(--muted); }
input[type="number"], input[type="text"], input[type="email"], input[type="tel"], select, textarea {
  border: 1.5px solid var(--line); border-radius: var(--r-m); padding: 12px 14px; min-height: 48px; background: var(--bg); width: 100%;
}
input:focus-visible, select:focus-visible, textarea:focus-visible { border-color: var(--coal); }
[aria-invalid="true"] { border-color: var(--error) !important; }
textarea { min-height: 96px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row.three { grid-template-columns: repeat(3, 1fr); }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--coal); flex: 0 0 22px; }
.check small { display: block; font-size: 13px; }
.hint { display: block; margin-top: 6px; font-size: 13px; }
.with-icon { display: flex; align-items: center; gap: 8px; }

/* Icons */
.ic { width: 22px; height: 22px; flex: 0 0 22px; color: var(--coal); }
.ic.big { width: 36px; height: 36px; flex: 0 0 36px; }
.card.dark .ic, .btn.dark .ic, .btn.on-dark .ic { color: #fff; }

/* Toggle-Schalter (Camper-Laden) */
.toggle { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--beige); cursor: pointer; position: relative; }
.card > h3 + .toggle { border-top: 0; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle small { display: block; font-size: 13px; }
.toggle i { width: 50px; height: 30px; border-radius: 15px; background: var(--beige); position: relative; transition: background-color .2s; }
.toggle i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s var(--ease); }
.toggle:has(input:checked) i { background: var(--brand); }
.toggle:has(input:checked) i::after { transform: translateX(20px); }
.toggle:has(input:focus-visible) i { box-shadow: var(--focus); }

/* Aufklapper */
details > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 44px; font-weight: 700; }
details > summary::-webkit-details-marker { display: none; }
details .chev { margin-left: auto; transition: transform .2s var(--ease); }
details[open] > summary .chev { transform: rotate(180deg); }
details.more > summary { flex-wrap: wrap; }
details.more > summary small { flex-basis: 100%; order: 3; font-weight: 400; margin-top: -6px; }
details.more[open] > summary { margin-bottom: 12px; }

/* ---------------------------------------------------------------- Schritt 1 */

.picks { display: grid; gap: 14px; }
.pick { position: relative; display: block; border: 1.5px solid var(--line); border-radius: var(--r-l); overflow: hidden; background: var(--bg); cursor: pointer; box-shadow: var(--shadow); }
.pick input { position: absolute; opacity: 0; pointer-events: none; }
.pick img { width: 100%; height: auto; aspect-ratio: 16 / 8; object-fit: cover; object-position: center 62%; background: #F5EEDC; }
.pick-body { display: flex; align-items: center; gap: 12px; padding: 14px 16px 16px; }
.pick-text { flex: 1; min-width: 0; }
.pick-text strong { display: block; font-size: 18px; line-height: 1.25; }
.pick-text span { display: block; font-size: 14px; color: var(--muted); }
.tick { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.tick .ic { opacity: 0; width: 18px; height: 18px; }
.pick:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1.5px var(--brand), var(--shadow); background: var(--brand-tint); }
.pick:has(input:checked) .tick { background: var(--brand); border-color: var(--brand); }
.pick:has(input:checked) .tick .ic { opacity: 1; }
.pick:has(input:focus-visible) { box-shadow: var(--focus); }
.contact { display: flex; gap: 14px; align-items: flex-start; }
.contact .ic-box { background: var(--bg); }
.contact h3 { margin: 0 0 4px; font-size: 17px; }
.contact p { margin: 0 0 8px; }
.contact-links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 0; }
.contact-links a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; min-height: 44px; text-decoration: none; border-bottom: 2px solid var(--brand); }

/* ---------------------------------------------------------------- Schritt 2 */

.presets { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; }
.presets::-webkit-scrollbar { display: none; }
.preset { flex: 0 0 168px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; border: 1.5px solid var(--line); background: var(--bg); border-radius: 16px; padding: 14px; cursor: pointer; }
.preset strong { font-size: 16px; }
.preset span { font-size: 13px; color: var(--muted); }
.preset em { font-style: normal; font-weight: 700; font-size: 20px; margin-top: auto; padding-top: 4px; }
.preset.on { background: var(--coal); border-color: var(--coal); color: #fff; }
.preset.on span { color: var(--brand-light); }
.preset.on em { color: var(--brand); }

.devices { display: grid; gap: 8px; }
.dev-row { display: flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--bg); padding: 6px 10px 6px 6px; transition: border-color .6s, background-color .6s; }
.dev-row.new { border-color: var(--brand); background: var(--brand-tint); }
.dev-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; border: 0; background: none; text-align: left; padding: 6px; border-radius: 10px; cursor: pointer; }
.dev-ic { width: 44px; height: 44px; border-radius: var(--r-m); background: var(--brand-tint); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.dev-ic.big { width: 56px; height: 56px; border-radius: 16px; }
.dev-ic.big .ic { width: 28px; height: 28px; }
.dev-text { min-width: 0; }
.dev-text strong { display: block; line-height: 1.25; overflow-wrap: anywhere; }
.dev-text span { display: block; font-size: 13px; color: var(--muted); }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); flex: 0 0 auto; }
.qty button { width: 38px; height: 40px; border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; border-radius: 999px; }
.qty button .ic { width: 18px; height: 18px; }
.qty button:disabled { opacity: .35; cursor: default; }
.qty output { min-width: 18px; text-align: center; font-weight: 700; }
.empty { border: 2px dashed var(--line); border-radius: var(--r-m); padding: 16px; color: var(--muted); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 8px 16px 8px 12px; min-height: 44px; cursor: pointer; }
.chip .ic { width: 20px; height: 20px; }
.chip:hover { border-color: var(--coal); }
details.help { padding: 0 14px; background: var(--paper); }
.help-body { padding: 0 0 14px; display: grid; gap: 12px; }
.help-body ul { margin: 0; padding-left: 18px; }
.help-body li { margin-bottom: 6px; }
.plate { margin: 0; }
.plate svg { width: 100%; max-width: 360px; height: auto; display: block; }
.plate figcaption { font-size: 13px; color: var(--muted); }

/* Bottom-Sheet (Gerät bearbeiten, Alternativen) */
dialog.sheet { border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; background: var(--bg); color: var(--text); box-shadow: 0 -8px 30px rgba(0,0,0,.18); }
dialog.sheet[open] { animation: sheet-up .28s var(--ease); }
dialog.sheet::backdrop { background: rgba(35, 35, 35, .5); animation: fade .2s; }
@keyframes sheet-up { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }
.dialog { padding: 8px 20px calc(20px + env(safe-area-inset-bottom)); }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 12px; }
.sheet-head { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.sheet-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.sheet-title .muted { font-size: 13px; }
.name-input { border: 0 !important; padding: 0 !important; min-height: 0 !important; font-weight: 700; font-size: 19px !important; background: none !important; border-radius: 0 !important; }
.name-input:focus-visible { box-shadow: 0 2px 0 var(--brand); }
.slider-field { margin-bottom: 18px; }
.slider-field label { font-weight: 700; }
.val-box { display: inline-flex; align-items: center; gap: 4px; border: 1.5px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--paper); }
.val-box input { border: 0 !important; background: none !important; padding: 6px 0 !important; min-height: 40px !important; width: 64px; text-align: right; font-weight: 700; font-size: 18px; border-radius: 0 !important; }
.val-box span { font-weight: 700; }
.scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 36px; background: none; margin: 6px 0 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--beige); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--beige); }
input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--brand); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -11px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: #fff; border: 3px solid var(--brand); box-shadow: 0 2px 6px rgba(0,0,0,.18); }
input[type="range"]:focus-visible { box-shadow: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); margin: 6px 0 12px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 10px; padding: 10px 8px; min-height: 44px; cursor: pointer; }
.seg button[aria-checked="true"] { background: #fff; font-weight: 700; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.sheet-result { margin: 16px 0 18px; }
.sheet-result strong { font-size: 32px; letter-spacing: -.01em; }
.sheet-actions { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.dialog-head h2 { margin: 0; font-size: 22px; }
.alt-list { display: grid; gap: 8px; padding-bottom: 8px; }
.alt { display: grid; grid-template-columns: 56px 1fr; gap: 4px 12px; align-items: center; border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px; background: var(--bg); text-align: left; cursor: pointer; width: 100%; }
.alt .alt-total { grid-column: 2; font-weight: 700; }
.alt[aria-current="true"] { border-color: var(--brand); background: var(--brand-tint); cursor: default; }
.alt img { width: 56px; height: 56px; object-fit: contain; }

/* ---------------------------------------------------------------- Schritt 3 */

.num-stepper { display: flex; align-items: center; gap: 4px; border: 1.5px solid var(--line); border-radius: var(--r-m); background: var(--bg); padding: 4px; }
.num-stepper button { width: 40px; height: 40px; border: 0; background: var(--paper); border-radius: 10px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.num-stepper button .ic { width: 18px; height: 18px; }
.num-val { flex: 1; display: flex; align-items: baseline; justify-content: center; gap: 4px; min-width: 0; }
.num-val input { border: 0 !important; padding: 0 !important; min-height: 40px !important; flex: 0 1 auto; width: 4.2ch; min-width: 0; text-align: right; font-weight: 700; font-size: 19px; background: none !important; border-radius: 0 !important; }
.num-val span { font-weight: 700; color: var(--muted); font-size: 14px; }
.num-stepper { min-width: 0; }
.inline-num label small { display: block; font-weight: 400; color: var(--muted); }
.planner h3 { margin-top: 0; }
.dims { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0 14px; }
@media (max-width: 379px) { .dims { grid-template-columns: minmax(0, 1fr); } }
.dim label { display: block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field.vehicle label { display: flex; align-items: center; gap: 8px; }
.roof-sketch { border-radius: 16px; background: var(--bg); border: 1px solid var(--line); padding: 8px; margin: 4px 0 12px; }
.roof-sketch svg { display: block; width: 100%; height: auto; max-height: 460px; }
.roof-sketch .veh { fill: var(--paper); stroke: var(--coal); stroke-width: 1.5; }
.roof-sketch .wind { fill: #C7DCEB; }
.roof-sketch .roof { fill: rgba(255, 244, 214, .55); stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 5 4; }
.roof-sketch .panel rect { fill: var(--panel); stroke: #10161F; stroke-width: .8; }
.roof-sketch .panel path { stroke: #5A7395; stroke-width: .6; opacity: .7; }
.roof-sketch .panel text { fill: #fff; font-weight: 700; font-family: var(--font); }
.roof-sketch .obs { cursor: grab; touch-action: none; }
.roof-sketch .obs rect { fill: var(--beige); stroke: var(--coal); stroke-width: 1; }
.roof-sketch .obs rect.hatch { fill: url(#hatch); stroke: none; opacity: .7; }
.roof-sketch .obs text { fill: var(--coal); font-weight: 700; font-family: var(--font); pointer-events: none; }
.roof-sketch .obs.dragging { cursor: grabbing; }
.roof-sketch .obs.dragging rect:first-child { stroke: var(--brand); stroke-width: 2; }
.roof-sketch .dimtxt { fill: var(--coal); font-family: var(--font); }
.roof-sketch .dimtxt.front { fill: var(--muted); font-weight: 700; letter-spacing: .08em; }
.drag-hint { display: flex; align-items: center; gap: 6px; margin: 6px 4px 0; }
.drag-hint .ic { width: 16px; height: 16px; color: var(--muted); }
.roof-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; color: var(--muted); text-align: center; padding: 16px; }
.roof-empty p { margin: 0; max-width: 34ch; }
.obstacles { display: grid; gap: 8px; margin-bottom: 10px; }
.obs-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: start; border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px; background: var(--paper); }
.obs-top { display: grid; gap: 6px; }
.obs-top select { min-height: 40px; padding: 8px 10px; }
.obs-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.obs-num { display: grid; gap: 2px; font-size: 12px; color: var(--muted); }
.obs-num input { min-height: 40px; padding: 8px 10px; }
.obs-actions { display: grid; gap: 6px; }
.roof-best { margin: 14px 0 10px; }
.roof-best .big { font-size: 28px; color: #fff; }
.roof-best .accent { font-size: 20px; color: var(--brand); }
.roof-best p { margin: 4px 0 0; font-size: 14px; }
.roof-opts { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: none; }
.roof-opts::-webkit-scrollbar { display: none; }
.roof-opt { flex: 0 0 auto; display: grid; gap: 2px; text-align: left; border: 1.5px solid var(--line); border-radius: var(--r-m); background: var(--bg); padding: 10px 12px; cursor: pointer; }
.roof-opt span { font-size: 13px; color: var(--muted); }
.roof-opt.on { border-color: var(--brand); background: var(--brand-tint); }

.cards { display: grid; gap: 10px; }
.card-choice { position: relative; display: flex; gap: 12px; align-items: center; border: 1.5px solid var(--line); border-radius: var(--r-m); padding: 14px; cursor: pointer; background: var(--bg); min-height: 64px; }
.card-choice input { position: absolute; opacity: 0; pointer-events: none; }
.card-choice:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.card-choice:has(input:focus-visible) { box-shadow: var(--focus); }
.card-choice strong { display: block; }
.card-choice span { font-size: 14px; color: var(--muted); }

/* ---------------------------------------------------------------- Schritt 4 */

.loading-card { display: flex; align-items: center; gap: 4px; min-height: 120px; justify-content: center; color: var(--muted); }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px 4px; padding: 2px 16px 8px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: 0 0 auto; position: relative; display: grid; gap: 2px; align-content: start; border: 1.5px solid var(--line); background: var(--bg); border-radius: 16px; padding: 10px 14px; text-align: left; cursor: pointer; min-width: 132px; max-width: 200px; }
.tab[aria-selected="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); background: var(--brand-tint); }
.tab-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tab[aria-selected="true"] .tab-label { color: var(--text); }
.tab .price { font-weight: 700; font-size: 16px; }
.tab-sub { font-size: 12px; color: var(--muted); line-height: 1.3; }
.tab .badge { justify-self: start; margin-top: 4px; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; border-radius: 4px; padding: 2px 6px; background: var(--beige); color: var(--coal); vertical-align: middle; letter-spacing: .03em; }
.badge.sale { background: var(--brand); }
.badge.warn { background: var(--error-bg); color: var(--error); }

.schema .label { margin-top: 0; }
.nodes { display: flex; align-items: flex-start; overflow-x: auto; margin: 4px -8px 8px; padding: 4px 8px; scrollbar-width: none; }
.nodes::-webkit-scrollbar { display: none; }
.node { flex: 1 0 70px; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; background: none; border: 0; padding: 4px 2px; border-radius: var(--r-m); min-width: 70px; }
button.node { cursor: pointer; }
button.node:hover .node-ic { box-shadow: 0 0 0 2px var(--brand); }
.node-ic { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-tint); display: inline-flex; align-items: center; justify-content: center; border: 4px solid #fff; box-shadow: 0 0 0 1px var(--beige); }
.node-ic.hero { background: var(--brand); }
.node-ic .ic { width: 26px; height: 26px; }
.node-label { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.node-val { font-size: 13px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.flow { flex: 0 0 12px; height: 3px; margin-top: 30px; background: var(--brand); border-radius: 2px; position: relative; overflow: hidden; }
.flow i { position: absolute; top: -1px; width: 5px; height: 5px; border-radius: 50%; background: #fff; animation: flow 1.8s linear 3; }
.flow i:nth-child(2) { animation-delay: .6s; }
.flow i:nth-child(3) { animation-delay: 1.2s; }
@keyframes flow { from { left: -6px; } to { left: 100%; } }

.year h3 { margin-top: 0; }
.chart { position: relative; display: flex; align-items: flex-end; gap: 4px; height: 150px; padding-bottom: 22px; margin: 4px 0 12px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; }
.bar span { display: block; width: 100%; max-width: 26px; border-radius: 4px 4px 0 0; background: var(--beige); min-height: 3px; transform-origin: bottom; animation: grow .6s var(--ease) both; }
.bar.ok span { background: var(--brand); }
.bar em { position: absolute; bottom: -20px; font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); }
.bar:nth-child(2) span { animation-delay: .03s; } .bar:nth-child(3) span { animation-delay: .06s; } .bar:nth-child(4) span { animation-delay: .09s; }
.bar:nth-child(5) span { animation-delay: .12s; } .bar:nth-child(6) span { animation-delay: .15s; } .bar:nth-child(7) span { animation-delay: .18s; }
.bar:nth-child(8) span { animation-delay: .21s; } .bar:nth-child(9) span { animation-delay: .24s; } .bar:nth-child(10) span { animation-delay: .27s; }
.bar:nth-child(11) span { animation-delay: .3s; } .bar:nth-child(12) span { animation-delay: .33s; }
@keyframes grow { from { transform: scaleY(0); } }
.need { position: absolute; left: 0; right: 0; border-top: 1.5px dashed var(--coal); pointer-events: none; }
.need span { position: absolute; right: 0; bottom: 2px; font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: rgba(255,255,255,.85); padding: 0 4px; border-radius: 3px; }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.facts li { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; }
.facts .ic { width: 20px; height: 20px; flex: 0 0 20px; }

.values { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0 0 8px; }
.value { background: var(--paper); border-radius: var(--r-s); padding: 10px; }
.value dt { font-size: 12px; color: var(--muted); }
.value dd { margin: 0; font-weight: 700; }
.cable-list { margin: 0; padding-left: 18px; font-size: 14px; }

.items { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; border: 1px solid var(--line); border-radius: var(--r-m); padding: 10px; background: var(--bg); }
.item.removed { opacity: .55; }
.item img, .item .noimg { width: 64px; height: 64px; object-fit: contain; background: var(--paper); border-radius: var(--r-s); }
.item .name { font-weight: 700; }
.item .name a { text-decoration: none; }
.item .meta { font-size: 13px; color: var(--muted); }
.item .line { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.item .price { font-weight: 700; }
.item .actions { display: flex; gap: 6px; }

.notice { border-radius: var(--r-m); padding: 12px 14px; margin: 12px 0; font-size: 14px; }
.notice ul { margin: 6px 0 0; padding-left: 18px; }
.notice.warn { background: var(--brand-tint); }
.notice.error { background: var(--error-bg); color: var(--error); }
.notice.info { background: #E8F3FA; color: #0B3A57; }
.notes { font-size: 13px; color: var(--muted); }

/* ---------------------------------------------------------------- Schritt 5 */

.set-head { display: grid; grid-template-columns: 76px 1fr; gap: 4px 12px; align-items: center; }
.set-head img { grid-row: span 2; }
.set-head .price { grid-column: 2; }
.set-head img { width: 76px; height: 58px; object-fit: cover; border-radius: 10px; }
.set-head strong { display: block; }
.set-head .muted { font-size: 13px; }
.set-head .price { font-size: 18px; white-space: nowrap; }
details.positions { margin: 12px 0 0; border-top: 1px solid var(--beige); }
.summary { width: 100%; border-collapse: collapse; font-size: 15px; margin: 4px 0 6px; }
.summary td { padding: 7px 0; border-bottom: 1px solid var(--beige); vertical-align: top; }
.summary td:last-child { text-align: right; white-space: nowrap; padding-left: 10px; }
.summary .total td { font-weight: 700; font-size: 18px; border-bottom: 0; padding-top: 10px; }
.summary .discount td { color: var(--ok); }
.savings { margin: 10px 0 0; font-size: 14px; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.action-msg:empty { display: none; }
.photos legend { display: flex; align-items: center; gap: 8px; }
.photo-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0; }
.photo { position: relative; aspect-ratio: 1; border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo .round-btn { position: absolute; top: 6px; right: 6px; background: rgba(255,255,255,.95); }
.photo.add { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 2px dashed var(--line); background: var(--paper); cursor: pointer; font-size: 13px; text-align: center; padding: 6px; }
.photo.add:hover { border-color: var(--coal); }
.photo.add:has(input:focus-visible) { box-shadow: var(--focus); }
.sent { display: grid; justify-items: start; gap: 4px; }
.sent h3 { margin: 8px 0 0; }
.continue h3 { margin: 0 0 2px; color: #fff; font-size: 17px; }
.continue p { margin: 0; font-size: 14px; }
.cont-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.card.dark .cont-head .ic { color: var(--coal); }
.link-form input[type="email"] { margin-bottom: 10px; border-color: transparent; }
.link-form .row .btn { padding-left: 10px; padding-right: 10px; }
#link-msg { margin: 8px 0 0; color: var(--beige); }
#link-msg:empty { display: none; }

/* ---------------------------------------------------------------- Fusszeile */

.bottom { position: fixed; left: 0; right: 0; bottom: 0; background: #fff; transform: translateZ(0);
  border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(50, 46, 30, .08);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 10px; z-index: 5; }
.bottom-info { font-size: 12px; min-width: 0; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.bottom-info span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bottom-info strong { display: block; font-size: 18px; white-space: nowrap; color: var(--text); text-transform: none; letter-spacing: 0; }
.bottom-actions { display: flex; gap: 8px; flex: 0 0 auto; }
.bottom .btn.primary { min-width: 116px; }

.spinner { display: inline-block; width: 18px; height: 18px; border: 3px solid var(--beige); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; vertical-align: middle; margin-right: 8px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Eingebettet (iframe): «fixed» hängt am iframe statt am Bildschirm, darum klebt die Leiste am Ende des Rechners */
.embedded .bottom { position: sticky; border: 1px solid var(--line); border-radius: var(--r-l); margin-top: 20px; padding-bottom: 10px; }
.embedded .app { padding-bottom: 24px; }
/* Vollbild über der Shop-Seite (embed.js, Handy): Leiste wieder am Bildschirmrand */
.embedded.overlay body { background: var(--paper); }
.embedded.overlay .bottom { position: fixed; border-radius: 0; border-width: 1px 0 0; margin: 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.embedded.overlay .app { padding-bottom: 132px; }
.embedded.overlay #call { display: none; }
html.overlay { background: var(--paper); }       /* echtes Vollbild: sonst schwarzer Hintergrund des Browsers */      /* Platz für den Schliessen-Knopf; Telefon steht in Schritt 1 und rechts */
.round-btn.dark { background: var(--coal); }
.round-btn.dark .ic { color: #fff; }

/* Honigtopf gegen Spam-Bots: für Menschen unsichtbar */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------------------------------------------------------------- Grösser */

@media (min-width: 640px) {
  .app { padding: 16px 24px 120px; }
  .appbar h1 { font-size: 34px; }
  h2 { font-size: 30px; }
  .picks { grid-template-columns: repeat(3, 1fr); }
  .pick img { aspect-ratio: 4 / 3; }
  .cards.two { grid-template-columns: repeat(2, 1fr); }
  .help-body { grid-template-columns: 1fr 300px; align-items: start; }
  .values { grid-template-columns: repeat(3, 1fr); }
  .item { grid-template-columns: 80px 1fr; }
  .item img, .item .noimg { width: 80px; height: 80px; }
  .presets, .tabs, .roof-opts { margin: 0; padding: 2px 0 8px; flex-wrap: wrap; overflow: visible; }
  .preset { flex: 1 1 160px; }
  .tab { flex: 1 1 140px; max-width: none; }
  dialog.sheet { margin: auto; width: min(520px, 94vw); border-radius: 24px; }
  dialog.sheet .grab { display: none; }
  .alt { grid-template-columns: 56px 1fr auto; }
  .alt .alt-total { grid-column: auto; }
  .obs-nums { grid-template-columns: repeat(4, 1fr); }
  .set-head { grid-template-columns: 76px 1fr auto; }
  .set-head img { grid-row: auto; }
  .set-head .price { grid-column: auto; }
}
@media (min-width: 900px) {
  .bottom { position: sticky; border: 1px solid var(--line); border-radius: var(--r-l); margin-top: 20px; }
  .app { padding-bottom: 24px; }
}
@media (min-width: 1024px) {
  .shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 32px; padding: 24px 24px 0; align-items: start; }
  .shell.with-summary { grid-template-columns: 230px minmax(0, 1fr) 300px; }
  .app { max-width: none; padding: 0 0 24px; margin: 0; }
  .side-nav { display: block; position: sticky; top: 16px; }
  .progress { display: none; }
  .appbar h1 { display: none; }
  .side-title { font-family: var(--font-cond); font-weight: 700; font-size: 28px; text-transform: uppercase; margin: 6px 0 4px; letter-spacing: .02em; }
  .side-sub { font-size: 13px; margin: 0 0 20px; }
  .side-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
  .side-steps li > button, .side-steps li > div { all: unset; box-sizing: border-box; display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border-radius: var(--r-m); border: 2px solid transparent; }
  .side-steps li > button { cursor: pointer; }
  .side-steps li > button:hover { background: rgba(255,255,255,.7); }
  .side-steps li > button:focus-visible { box-shadow: var(--focus); }
  .side-steps li.current > div { background: #fff; border-color: var(--brand); }
  .side-steps .mark { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--beige); font-size: 12px; font-weight: 700; color: var(--muted); flex: 0 0 auto; }
  .side-steps .mark .ic { width: 16px; height: 16px; }
  .side-steps li.done .mark { background: var(--brand); }
  .side-steps li.current .mark { background: var(--coal); color: #fff; }
  .side-steps .side-text { display: grid; min-width: 0; }
  .side-steps .side-text small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-steps li.todo strong { color: var(--muted); font-weight: 400; }
  .summary-side { display: block; position: sticky; top: 16px; }
  .summary-side[hidden] { display: none !important; }
  .sum-card { background: var(--bg); border: 1px solid var(--line); border-radius: 24px; padding: 18px; display: grid; gap: 10px; }
  .sum-card img { border-radius: 16px; aspect-ratio: 16 / 10; object-fit: cover; width: 100%; height: auto; }
  .sum-card h3 { margin: 6px 0 0; }
  .sum-card p { margin: 0; }
  .sum-total { display: grid; }
  .sum-total strong { font-size: 28px; letter-spacing: -.01em; }
  .sum-card .hint-box { margin: 4px 0 0; }
  .roof-sketch svg { max-height: 520px; }
}

/* ---- Balkonkraftwerk */
.dev-main.static { cursor: default; }
.bk-designs { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
@media (max-width: 379px) { .bk-designs { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.bk-design { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; text-align: center; cursor: pointer; padding: 4px 0; }
.bk-design input { position: absolute; opacity: 0; pointer-events: none; }
.bk-design .swatch { width: 44px; height: 44px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.bk-design:has(input:checked) .swatch { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--brand); }
.bk-design:has(input:checked) { font-weight: 700; }
.bk-design:has(input:focus-visible) .swatch { box-shadow: var(--focus); }
.bk-design.off { opacity: .35; cursor: not-allowed; }
.bk-sketch .rail { fill: var(--coal); }
.bk-sketch .roof { stroke-dasharray: none; }
.bk-save .bk-chf { font-size: 34px; color: #fff; line-height: 1.1; }
.bk-save .accent { color: var(--brand); font-size: 14px; text-align: right; }
.bk-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.bk-facts div { background: rgba(255,255,255,.08); border-radius: var(--r-s); padding: 8px 10px; display: grid; gap: 2px; }
.bk-facts strong { font-size: 20px; color: #fff; }
.bk-facts span { font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--line); }
.bk-legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin: 0 0 4px; }
.bk-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.bk-legend .l-self, .bk-bar .bk-self { background: var(--brand); }
.bk-legend .l-feed { background: var(--beige); }
.bar.bk-bar .bk-total { position: relative; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden; background: var(--beige); }
.bar.bk-bar .bk-self { display: block; width: 100%; max-width: none; min-height: 0; border-radius: 0; animation: none; }
.bk-sketch .panel.photo .edge { fill: none; stroke: rgba(0,0,0,.45); stroke-width: .8; }
.bk-sketch .panel text { paint-order: stroke; stroke: rgba(0,0,0,.55); stroke-width: 3px; stroke-linejoin: round; }
.bk-opt { grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; }
.bk-opt img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; grid-row: span 2; }
.bk-opt-text { display: grid; gap: 2px; }
.embedded.hosted .bottom { z-index: 20; transition: box-shadow .2s; will-change: transform; }
.embedded.hosted .bottom.floating { box-shadow: 0 -6px 24px rgba(20,25,36,.14); }
@media (min-width: 640px) { .picks { grid-template-columns: repeat(2, 1fr); } }   /* vier Anwendungen: 2 × 2 */
.embedded.hosted .bottom { transition: box-shadow .2s, opacity .18s ease-out; }
.embedded.hosted .bottom.moving { opacity: 0; transition: opacity .08s; pointer-events: none; }
