/* ════════════════════════════════════════════════════════════════
   Finanzierungsrechner
   Farben kommen aus dem Designsystem (frontends/design): die Kurznamen unten
   zeigen auf --dw-Tokens, die Bürofarbe wird zur Laufzeit gesetzt. Volle Breite, Abstand über Padding. Zahlen immer tabular.
   ════════════════════════════════════════════════════════════════ */

:root {
  --red: var(--dw-brand);
  --red-deep: var(--dw-brand-strong);
  --ink: var(--dw-sand-098);
  --ink-soft: var(--dw-sand-309);
  --ink-mute: var(--dw-sand-495);
  --paper: var(--dw-sand-960);
  --paper-warm: var(--dw-sand-926);
  --white: var(--dw-gray-994);
  --line: rgb(var(--dw-sand-098-rgb) / .14);
  --line-soft: rgb(var(--dw-sand-098-rgb) / .08);
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.22, .8, .26, .99);
  --pad: clamp(1.25rem, 4vw, 3rem);
  --header-h: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { overflow-x: clip; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  font-size: 17px; line-height: 1.55;
  color: var(--ink); background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--red); color: var(--dw-on-brand); }
input::selection { background: var(--ink); color: var(--paper); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
h1, h2, h3 { font-weight: 700; font-stretch: 125%; line-height: 1.06; letter-spacing: -.025em; }
h1 em, h2 em { font-style: normal; color: var(--dw-brand-text); }
:focus-visible { outline: 3px solid var(--dw-focus-ring); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ── Header ───────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 1rem;
  min-height: var(--header-h);
  padding: .7rem var(--pad);
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; min-width: 0; }
.brand-mark { width: 32px; height: 32px; fill: var(--dw-logo-mark); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: .88rem; letter-spacing: .14em; }
.brand-text small { font-size: .66rem; letter-spacing: .04em; color: var(--ink-soft); }
.rate-mini {
  display: flex; flex-direction: column; align-items: flex-end; margin-left: auto; line-height: 1.15;
  opacity: 0; transition: opacity .25s;
}
.rate-mini.show { opacity: 1; }
.rate-mini-label { font-size: .66rem; color: var(--ink-soft); letter-spacing: .04em; }
.rate-mini-value { font-size: 1.05rem; font-weight: 800; white-space: nowrap; }
.header-cta {
  display: inline-flex; align-items: center; gap: .5rem; flex: none;
  padding: .6rem 1rem; border-radius: 2px;
  background: var(--red); color: var(--dw-on-brand);
  font-size: .9rem; font-weight: 700; letter-spacing: .03em; text-decoration: none;
}
.header-cta:hover { background: var(--red-deep); color: var(--dw-on-brand-strong); }
.header-cta svg { width: 1em; height: 1em; fill: currentColor; }
.rate-mini + .header-cta { margin-left: 0; }
.rate-mini[hidden] + .header-cta { margin-left: auto; }

/* ── Bausteine ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: 1rem 1.6rem; border: 0; border-radius: 2px; cursor: pointer;
  font-weight: 700; font-size: 1rem; letter-spacing: .02em; text-decoration: none;
  transition: background .2s, transform .25s var(--ease), box-shadow .25s var(--ease);
}
.btn svg { width: 1.05em; height: 1.05em; fill: currentColor; }
.btn-red { background: var(--red); color: var(--dw-on-brand); box-shadow: 0 10px 24px -12px rgb(var(--dw-brand-rgb) / .6); }
.btn-red:hover { background: var(--red-deep); color: var(--dw-on-brand-strong); transform: translateY(-1px); }
.btn-red:disabled { opacity: .55; cursor: wait; transform: none; }
.btn-wide { width: 100%; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem .95rem; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--white); color: var(--ink);
  font-size: .9rem; font-weight: 600; line-height: 1.2;
  transition: border-color .2s, background .2s, color .2s;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-checked="true"], .chip[aria-selected="true"] {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.chip b { font-weight: 800; }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field > span:first-child, .field > label:first-child { font-size: .8rem; font-weight: 700; letter-spacing: .02em; color: var(--ink-soft); }
/* Hauspreis ODER Haus wählen (2026-09-15): Betrag links, Auswahlfeld rechts,
   auf schmalen Schirmen untereinander. */
.haus-row { display: flex; flex-wrap: wrap; align-items: center; gap: .45rem .7rem; }
.haus-row .money { flex: 1 1 10.5rem; }
.oder { font-size: .7rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); flex: none; }
.haus-pick { position: relative; flex: 1 1 13rem; min-width: 0; }
/* Auswahlknopf im Look der Eingabefelder — öffnet das Hausauswahl-Overlay (Fabian 2026-09-18) */
.haus-wahl {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; width: 100%; cursor: pointer; text-align: left;
  padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: 2px; background: var(--white);
  font-size: 1.05rem; color: var(--ink-mute); transition: border-color .2s;
}
.haus-wahl:hover { border-color: var(--ink); }
.haus-wahl span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.haus-wahl svg { flex: none; width: 1.15em; height: 1.15em; fill: none; stroke: var(--red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.haus-wahl.has-haus { font-weight: 700; color: var(--ink); border-color: var(--ink); padding-right: 2.4rem; }
.haus-wahl.has-haus svg { display: none; }
.haus-clear {
  position: absolute; right: .35rem; top: 50%; transform: translateY(-50%);
  width: 1.7rem; height: 1.7rem; border: 0; border-radius: 50%; background: transparent; color: var(--ink-soft); cursor: pointer;
  display: grid; place-items: center;
}
.haus-clear:hover { background: var(--paper-warm); color: var(--dw-brand-text); }
.haus-clear svg { width: 14px; height: 14px; fill: currentColor; }
.field-main small b { color: var(--ink); }
.btn-link {
  display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px;
  border: 1.5px solid var(--red); color: var(--dw-brand-text); font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  text-decoration: none; transition: background .2s, color .2s;
}
.btn-link:hover { background: var(--red); color: var(--dw-on-brand); }
.btn-link svg { width: 12px; height: 12px; fill: currentColor; }
.field input[type="text"], .field input[type="email"], .field input[type="tel"] {
  width: 100%; padding: .85rem 1rem;
  border: 1.5px solid var(--line); border-radius: 2px; background: var(--white);
  font-size: 1.05rem; transition: border-color .2s;
}
.field input:focus { border-color: var(--ink); outline: none; }
.field input.invalid { border-color: var(--dw-error); }
.field small { font-size: .78rem; color: var(--ink-mute); line-height: 1.35; }
.money { position: relative; display: block; }
.money input { padding-right: 2.4rem !important; text-align: right; font-weight: 700; }
.money b { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--ink-soft); }
.money-monat input { padding-right: 7.2rem !important; }
.money-monat b { font-size: .92rem; }
.consent { display: flex; gap: .7rem; align-items: flex-start; font-size: .85rem; color: var(--ink-soft); line-height: 1.4; cursor: pointer; }
.consent input { width: 20px; height: 20px; flex: none; margin-top: .1rem; accent-color: var(--red); }
.consent a { color: var(--dw-brand-text); font-weight: 600; }
.form-error, .calc-error { color: var(--dw-error); font-weight: 600; font-size: .92rem; }

/* ── Einstieg ─────────────────────────────────────────────────── */
.start {
  display: grid; grid-template-columns: 1fr; gap: 2.5rem;
  padding: clamp(2rem, 5vw, 4.5rem) var(--pad) clamp(3rem, 6vw, 5rem);
}
.start h1 { font-size: clamp(2rem, 6.4vw, 3.6rem); max-width: 16ch; }
.lede { margin-top: 1.1rem; font-size: 1.08rem; color: var(--ink-soft); max-width: 36rem; }
.facts { list-style: none; margin-top: 1.6rem; display: grid; gap: .7rem; max-width: 36rem; }
.facts li { display: flex; gap: .7rem; align-items: flex-start; font-size: .95rem; }
.facts svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--red); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.start-form {
  display: grid; gap: 1rem; align-content: start;
  padding: clamp(1.4rem, 3vw, 2.2rem);
  background: var(--white); border: 1px solid var(--line); border-radius: 4px;
}
.form-title { font-weight: 700; font-stretch: 110%; font-size: 1.25rem; letter-spacing: -.01em; }
.form-sub { font-size: .92rem; color: var(--ink-soft); line-height: 1.45; }
.form-sub b { color: var(--ink); }
.start-forms { display: grid; gap: 1rem; align-content: start; }
.chips-mode .chip { padding: .7rem 1.1rem; }
.link-sent { justify-items: start; }
/* QNG aus → Hinweis immer sichtbar, Laptop und Handy (2026-09-24) */
/* Platz ist immer reserviert, nur die Sichtbarkeit wechselt — sonst springt
   das Layout beim Schalten (Fabian 2026-09-24). */
.qng-hint { display: block; visibility: hidden; margin-top: .25rem; font-size: .8rem; font-weight: 600; color: var(--dw-brand-text); line-height: 1.3; }
.switch:has(#i-qng:not(:checked)) .qng-hint { visibility: visible; }
.nowrap { white-space: nowrap; }
.req { font-style: normal; color: var(--dw-brand-text); font-weight: 700; }
.opt { font-style: normal; font-weight: 400; color: var(--ink-mute); }
.form-note { font-size: .85rem; color: var(--ink-soft); line-height: 1.45; }
.req-hint { display: block; margin-top: .3rem; color: var(--ink-mute); }
.form-error.is-ok { color: var(--ink-soft); font-weight: 500; }
.field-code input { font-size: 1.5rem !important; font-weight: 700; letter-spacing: .3em; font-variant-numeric: tabular-nums; max-width: 12rem; }
.link-sent .field-code, .link-sent .btn-wide { justify-self: stretch; }
.link-sent svg { width: 40px; height: 40px; fill: none; stroke: var(--red); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ── Rechner: Eingaben ────────────────────────────────────────── */
.rechner { padding: clamp(1rem, 2vw, 1.6rem) var(--pad) 7rem; display: grid; gap: clamp(1rem, 2vw, 1.4rem); }
/* Zwei Ansichten, eine Rechnung (Fabian 2026-09-18): der Schalter „Ich kenne …“ sitzt in
   der ersten Zeile der Eingaben — das einzige dunkle Element in der weißen Karte, die
   gewählte Seite in Danwood-Rot. So hoch wie das Hauptfeld daneben. */
.schalter, .rate-panel { --dw-focus-ring: var(--dw-focus-ring-inverse); }
.schalter { display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 3px; border-radius: 4px; background: var(--ink); }
.schalter button {
  display: flex; align-items: center; justify-content: center; gap: .5rem; cursor: pointer;
  padding: .62rem .8rem; border: 0; border-radius: 2px; background: transparent;
  color: rgb(var(--dw-sand-960-rgb) / .78); font-size: .95rem; font-weight: 700; line-height: 1.15; white-space: nowrap;
  transition: background .2s, color .2s;
}
.schalter button:hover { color: var(--white); background: rgb(var(--dw-sand-960-rgb) / .12); }
.schalter button[aria-checked="true"] { background: var(--red); color: var(--dw-on-brand); box-shadow: 0 6px 16px -8px rgb(var(--dw-brand-rgb) / .9); }
.schalter svg { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.solo { display: grid; gap: .9rem; padding: .9rem 1.1rem 1rem; background: var(--white); border: 1px solid var(--line); border-radius: 4px; }

.eingaben {
  display: grid; grid-template-columns: 1fr; gap: .8rem 1.4rem;
  padding: clamp(1rem, 2vw, 1.3rem) clamp(1.1rem, 2.4vw, 1.6rem);
  background: var(--white); border: 1px solid var(--line); border-radius: 4px;
}
.field-main .money input { font-size: 1.25rem !important; padding: .6rem 2.4rem .6rem .9rem !important; }
.field-main .money-monat input { padding-right: 7.2rem !important; }
.switches { display: grid; grid-template-columns: 1fr; gap: .3rem .9rem; }
.switch { display: flex; align-items: flex-start; gap: .7rem; cursor: pointer; padding: .4rem 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  flex: none; width: 46px; height: 26px; margin-top: .1rem; border-radius: 999px;
  background: rgb(var(--dw-sand-098-rgb) / .18); position: relative; transition: background .2s;
}
.switch .track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--white); transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgb(var(--dw-black-rgb) / .25);
}
.switch input:checked + .track { background: var(--red); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--dw-focus-ring); outline-offset: 3px; }
.switch-text { display: flex; flex-direction: column; line-height: 1.3; }
.switch-text b { font-size: .9rem; }
.switch-text small { font-size: .74rem; color: var(--ink-mute); }
.switch-q { display: flex; flex-direction: column; gap: .45rem; padding: .4rem 0; }
.kinder-q { grid-column: 1 / -1; }
/* Bauträger-Frage: eigene Zeile, erst im 6er-Raster neben den Kinder-Chips */
.bt-q { grid-column: 1 / -1; }
.chips-kinder .chip { padding: .45rem .85rem; font-size: .85rem; }
/* Wohneinheiten: Zähler an der Stelle, an der sonst die Schalter-Spur sitzt */
.we-q { cursor: default; }
.stepper { flex: none; display: inline-flex; align-items: center; height: 26px; margin-top: .1rem;
  border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.stepper button { width: 26px; height: 24px; display: grid; place-items: center; border: 0; background: none;
  border-radius: 999px; cursor: pointer; color: var(--ink); padding: 0; }
.stepper button:hover:not(:disabled) { background: rgb(var(--dw-sand-098-rgb) / .08); }
.stepper button:disabled { opacity: .3; cursor: default; }
.stepper button:focus-visible, .stepper input:focus-visible { outline: 3px solid var(--dw-focus-ring); outline-offset: 2px; }
.stepper svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
/* .switch input versteckt die Checkboxen — der Zähler steckt in .switch, also zurückholen */
.we-q .stepper input { position: static; opacity: 1; height: auto; width: 2.2em; border: 0; background: none; text-align: center; font: inherit; font-weight: 800;
  font-size: .95rem; font-variant-numeric: tabular-nums; color: var(--ink); padding: 0; }
.stepper.is-mehr { border-color: var(--red); }
.stepper.is-mehr input { color: var(--dw-brand-text); }
/* Unterhalb des Laptop-Rasters verhalten sich die zwei Reihen wie bisher ein Raster */
.sw-row { display: contents; }
/* Entfällt (Bauträger bzw. ohne Kinder): ausgegraut, Platz bleibt — nichts rutscht */
.is-aus { opacity: .38; cursor: not-allowed; }
.is-aus .track, .is-aus .chip { pointer-events: none; }
.is-aus .switch-text b { cursor: not-allowed; }
/* …und neutral: keine rote Spur, kein schwarzer Chip — sonst sieht es aus, als zähle es noch */
.is-aus input:checked + .track { background: rgb(var(--dw-sand-098-rgb) / .18); }
.is-aus input:checked + .track::after { transform: none; }
.is-aus .chip[aria-checked="true"] { background: transparent; color: inherit; border-color: var(--line); }

/* ── Rate ─────────────────────────────────────────────────────── */
.rate-panel {
  display: grid; grid-template-columns: 1fr; gap: 1.4rem;
  padding: clamp(1.1rem, 2vw, 1.5rem);
  background: var(--ink); color: var(--paper); border-radius: 4px;
  border-top: 4px solid var(--red);
}
.rate-label { font-size: .85rem; font-weight: 600; letter-spacing: .02em; color: rgb(var(--dw-sand-960-rgb) / .7); }
.rate-value {
  display: flex; align-items: baseline; gap: .35rem; margin-top: .2rem;
  font-size: clamp(2.8rem, 11vw, 4.2rem); font-weight: 800; font-stretch: 110%;
  line-height: 1; letter-spacing: -.035em;
}
.rate-unit { font-size: .45em; font-weight: 700; color: rgb(var(--dw-sand-960-rgb) / .8); letter-spacing: 0; }
.rate-prog { margin-top: .8rem; font-size: .98rem; font-weight: 700; color: var(--paper); display: flex; flex-wrap: wrap; gap: .3rem .7rem; align-items: baseline; }
.rate-prog span { font-weight: 500; font-size: .92rem; color: rgb(var(--dw-sand-960-rgb) / .75); }
.rate-sub { margin-top: .4rem; font-size: .86rem; color: rgb(var(--dw-sand-960-rgb) / .82); max-width: 40rem; }
.rate-sub b { color: var(--paper); font-weight: 700; }
.rate-side { display: grid; gap: .9rem; align-content: start; }
.chips-variants .chip { background: transparent; border-color: rgb(var(--dw-sand-960-rgb) / .3); color: var(--paper); }
.chips-variants .chip:hover { border-color: var(--paper); }
.chips-variants .chip[aria-selected="true"] { background: var(--paper); border-color: var(--paper); color: var(--ink); }
.chips-variants .chip small { font-weight: 500; opacity: .8; }
.chips-variants .chip[aria-selected="true"] small { opacity: .7; }
.rate-empf { font-size: .84rem; color: rgb(var(--dw-sand-960-rgb) / .85); line-height: 1.45; max-width: 44rem; }
.rate-empf b { color: var(--paper); }
.rate-badge {
  display: inline-flex; align-items: center; gap: .45rem; margin-bottom: .9rem;
  padding: .45rem .95rem; border-radius: 999px; background: var(--red); color: var(--dw-on-brand);
  font-size: .9rem; font-weight: 800; font-stretch: 110%; letter-spacing: .02em;
}
.rate-badge svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.8; stroke-linecap: round; stroke-linejoin: round; }
.chips-variants .chip.is-empf { border-color: var(--red); }
.chips-variants .chip[aria-selected="true"].is-empf { border-color: var(--paper); }
.chip-tag {
  padding: .15rem .5rem; border-radius: 999px; background: var(--red); color: var(--dw-on-brand);
  font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.3;
}

/* ── Kostentabelle (2/3) + Rate-Kasten (1/3) ───────────────────── */
.kosten-rate { display: grid; grid-template-columns: 1fr; gap: 1rem; align-items: start; }
.bedarf {
  display: grid; gap: .55rem; padding: clamp(.9rem, 1.6vw, 1.1rem) clamp(1rem, 2vw, 1.3rem);
  background: var(--white); border: 1px solid var(--line); border-radius: 4px;
}
.bedarf-head { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; align-items: baseline; }
.bedarf-head h2 { font-size: 1.05rem; }
.bedarf-head h2 small { font-size: .74rem; font-weight: 500; font-stretch: 100%; letter-spacing: 0; color: var(--ink-mute); margin-left: .5rem; }
.bedarf-head p { font-size: .8rem; color: var(--ink-soft); max-width: 60rem; }
.bedarf-note { font-size: .74rem; color: var(--ink-mute); line-height: 1.45; max-width: 70rem; }
.tbl.tbl-compact th, .tbl.tbl-compact td { padding: .3rem .6rem; font-size: .86rem; }
.tbl.tbl-compact td small { font-size: .74rem; display: inline; margin-left: .4rem; }
.tbl.tbl-compact .sub td { padding-top: .12rem; padding-bottom: .12rem; font-size: .78rem; }
.tbl-compact .plus td { color: var(--ink-soft); }
.tbl-compact .plus td:first-child { padding-left: 1.4rem; }

/* Ansicht „Welches Haus passt zu meiner Rate?“: die Tabelle liest sich von der Rate
   abwärts zum Hauspreis — die Zielzeile trägt den roten Strich des Zahlwerks. */
.tbl .sum.ziel td { background: var(--ink); color: var(--paper); border-top: 0; box-shadow: inset 0 3px 0 var(--red); }
.tbl .sum.ziel td small { color: rgb(var(--dw-sand-960-rgb) / .7); }
.tbl-compact .neg.grp td { color: var(--ink-soft); }
.bedarf-leer { padding: 1rem 1.1rem; border-radius: 4px; background: var(--paper); border: 1px solid var(--line); font-size: .95rem; line-height: 1.5; color: var(--ink-soft); max-width: 60rem; }
.bedarf-leer b { color: var(--ink); }

/* ── Overlays: Startfrage + passende Häuser ───────────────────── */
.dlg { border: 0; padding: 0; color: var(--ink); background: var(--paper); }
.dlg::backdrop { background: rgb(var(--dw-sand-098-rgb) / .62); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dlg[open] { animation: dlg-in .28s var(--ease); }
@keyframes dlg-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.dlg-start {
  margin: auto; width: min(100vw - 2rem, 58rem); border-radius: 6px; border-top: 5px solid var(--red);
  padding: clamp(1.4rem, 4vw, 2.6rem); box-shadow: 0 40px 80px -30px rgb(var(--dw-black-rgb) / .6);
}
.dlg-start h2 { font-size: clamp(1.6rem, 4.4vw, 2.5rem); outline: none; }
.dlg-start > p { margin-top: .6rem; font-size: .98rem; color: var(--ink-soft); max-width: 40rem; }
.wahl { display: grid; grid-template-columns: 1fr; gap: .8rem; margin-top: 1.5rem; }
.wahl-karte {
  display: grid; grid-template-columns: auto 1fr; gap: .2rem 1rem; align-items: center; text-align: left; cursor: pointer;
  padding: 1.2rem 1.3rem; border-radius: 4px; border: 1.5px solid var(--line); background: var(--white); color: var(--ink);
  transition: border-color .2s, background .2s, color .2s, transform .25s var(--ease);
}
.wahl-karte svg { grid-row: span 2; width: 2.6rem; height: 2.6rem; fill: none; stroke: var(--red); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.wahl-karte b { font-size: 1.2rem; font-weight: 700; font-stretch: 112%; letter-spacing: -.01em; line-height: 1.2; }
.wahl-karte small { font-size: .9rem; color: var(--ink-soft); line-height: 1.4; }
.wahl-karte:hover, .wahl-karte:focus-visible { background: var(--ink); border-color: var(--ink); color: var(--paper); transform: translateY(-2px); }
.wahl-karte:hover small, .wahl-karte:focus-visible small { color: rgb(var(--dw-sand-960-rgb) / .75); }
.wahl-karte:hover svg, .wahl-karte:focus-visible svg { stroke: var(--paper); }

/* Häuser-Overlays (passende Häuser + Hausauswahl): ein Fenster ÜBER dem Rechner, nicht
   bildschirmfüllend (Fabian 2026-09-18) — ringsum bleibt der abgedunkelte Rechner sichtbar.
   Kopf bleibt stehen, X links oben. */
.dlg-haeuser {
  --rand: clamp(1.5rem, 5vw, 5rem); --rand-y: clamp(1.5rem, 6vh, 4.5rem);
  width: calc(100vw - 2 * var(--rand)); max-width: none; height: calc(100dvh - 2 * var(--rand-y)); max-height: none;
  margin: auto; overflow-y: auto; padding: 0 var(--pad) 2.5rem;
  border-radius: 8px; border-top: 5px solid var(--red); box-shadow: 0 40px 90px -30px rgb(var(--dw-black-rgb) / .65);
}
.dlg-head {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; gap: 1rem;
  margin: 0 calc(-1 * var(--pad)) 1.2rem; padding: 1rem var(--pad);
  background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.dlg-head h2 { font-size: clamp(1.25rem, 2.4vw, 1.75rem); }
.dlg-head p { margin-top: .3rem; font-size: .88rem; color: var(--ink-soft); max-width: 62rem; }
.dlg-head p b { color: var(--ink); }
.dlg-close { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1.5px solid var(--line); background: var(--white); cursor: pointer; display: grid; place-items: center; transition: border-color .2s, background .2s, color .2s; }
.dlg-close:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.dlg-close svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.btn-haeuser { width: 100%; padding: .85rem 1.2rem; font-size: .98rem; }
.btn-haeuser svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; width: 1.25em; height: 1.25em; }
.block-preis { margin-top: .5rem !important; font-size: 1rem !important; color: var(--ink) !important; }
.block-preis b { font-size: 1.2rem; font-weight: 800; }

.haus-grid { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.haus-card { display: flex; flex-direction: column; overflow: hidden; background: var(--white); border: 1px solid var(--line); border-radius: 4px; }
.haus-img { display: block; width: 100%; aspect-ratio: 3 / 2; background: var(--paper-warm); overflow: hidden; }
.haus-img img { width: 100%; height: 100%; object-fit: cover; }
/* Spalte statt Raster: die Knöpfe sitzen in jeder Karte am Boden, auch wenn der Hausname
   zweizeilig ist — sonst springen sie in einer Reihe auf und ab (Fabian 2026-09-18: unruhig). */
.haus-body { display: flex; flex-direction: column; gap: .65rem; padding: .9rem 1rem 1rem; flex: 1; min-width: 0; }
.haus-kopf { display: flex; flex-direction: column; line-height: 1.25; }
.haus-kopf b { font-size: 1.08rem; font-weight: 700; font-stretch: 112%; letter-spacing: -.01em; }
.haus-kopf small { font-size: .8rem; color: var(--ink-mute); }
.haus-zahlen { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: .6rem 0; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
.haus-zahlen > span { display: flex; flex-direction: column; line-height: 1.2; }
.haus-zahlen small { font-size: .72rem; color: var(--ink-mute); }
.haus-zahlen b { font-size: 1.12rem; font-weight: 800; white-space: nowrap; }
.haus-luft { font-size: .82rem; color: var(--ink-soft); }
.haus-aktionen { margin-top: auto; padding-top: .2rem; }
.haus-go { background: var(--red); border-color: var(--red); color: var(--dw-on-brand); }
.haus-go:hover { background: var(--red-deep); border-color: var(--red-deep); color: var(--dw-on-brand-strong); }
.haus-link { text-decoration: none; }
.haus-link svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.haeuser-mehr { margin-top: 1.2rem; padding: .7rem 1.1rem; }
/* Hausauswahl-Overlay: Suche + Filter im stehenden Kopf */
.katalog-kopf { flex: 1; min-width: 0; }
.katalog-filter { display: grid; gap: .55rem; margin-top: .8rem; }
.katalog-filter input {
  width: 100%; max-width: 34rem; padding: .7rem 1rem; border: 1.5px solid var(--line); border-radius: 2px; background: var(--white);
  font-size: 1.02rem; transition: border-color .2s;
}
.katalog-filter input:focus { border-color: var(--ink); outline: none; }
.katalog-filter .chip { padding: .42rem .8rem; font-size: .84rem; }
.haus-zahlen-1 { grid-template-columns: 1fr; }
.haus-card.is-gewaehlt { border-color: var(--ink); box-shadow: inset 0 4px 0 var(--red); }
.katalog-leer { padding: 1rem 1.1rem; border-radius: 4px; background: var(--white); border: 1px solid var(--line); font-size: .95rem; color: var(--ink-soft); max-width: 60rem; }
.btn-red:disabled.btn-cta { cursor: not-allowed; }

/* ── Blöcke: Beschreibung + Tabelle ───────────────────────────── */
.block {
  display: grid; grid-template-columns: 1fr; gap: 1rem 2.5rem;
  padding-top: 1.6rem; border-top: 1px solid var(--line);
}
.block-desc h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.block-desc p { margin-top: .6rem; font-size: .95rem; color: var(--ink-soft); max-width: 40rem; }
.block-desc p.muted { color: var(--ink-mute); font-size: .85rem; }
.block-desc-wide p { max-width: 52rem; }
.block-tag {
  display: inline-flex; align-items: center; gap: .4rem; margin-bottom: .6rem;
  padding: .3rem .7rem; border-radius: 999px; background: var(--red); color: var(--dw-on-brand);
  font-size: .74rem; font-weight: 700; letter-spacing: .04em;
}
.block-tag svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.block.is-empf .block-desc { border-left: 3px solid var(--red); padding-left: 1rem; }

.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: 4px; min-width: 0; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th, .tbl td { padding: .75rem .9rem; text-align: right; vertical-align: top; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
.tbl th { font-size: .74rem; font-weight: 700; letter-spacing: .03em; color: var(--ink-mute); }
.tbl th:first-child, .tbl td:first-child { text-align: left; white-space: normal; min-width: 11rem; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .sum td { font-weight: 800; border-top: 2px solid var(--ink); background: var(--paper); }
.tbl .grp td { border-bottom: 0; }
.tbl .sub td { color: var(--ink-mute); font-size: .85rem; padding-top: .35rem; padding-bottom: .35rem; border-bottom: 0; }
.tbl .sub td:first-child { padding-left: 2.4rem; position: relative; }
.tbl .sub td:first-child::before { content: ""; position: absolute; left: 1.1rem; top: 0; bottom: 0; border-left: 2px solid var(--line); }
.tbl .sub .davon:not(:empty) { display: inline-block; margin-right: .5rem; padding: .05rem .4rem; border-radius: 3px; background: var(--paper); border: 1px solid var(--line); font-size: .66rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft); }
.tbl .sub + tr:not(.sub) td { border-top: 1px solid var(--line-soft); }
.tbl .neg td { color: var(--ink-soft); }
.tbl .hl td { font-weight: 800; }
.tbl td small { display: block; font-size: .78rem; color: var(--ink-mute); font-weight: 500; white-space: normal; }
.tbl .c-fine { display: none; }
.tbl tfoot td { color: var(--ink-soft); font-size: .85rem; white-space: normal; text-align: left; background: var(--paper); }
.tbl .rate-cell { font-weight: 800; }

.step-kicker { font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--dw-brand-text); }
.varianten-wahl {
  display: grid; gap: .8rem; padding: clamp(1.2rem, 2.6vw, 1.8rem);
  background: var(--white); border: 1px solid var(--line); border-radius: 4px;
}
.wahl-title { font-weight: 700; font-stretch: 110%; font-size: 1.1rem; }
.wahl-note { font-size: .9rem; color: var(--ink-soft); }
.chips-wahl .chip { padding: .7rem 1rem; }
.chips-wahl .chip.is-empf { border-color: var(--red); }
.chips-wahl .chip[aria-selected="true"].is-empf { border-color: var(--ink); }
.cta-note b { color: var(--ink-soft); }
.zinsstand { font-size: .82rem; color: var(--ink-mute); line-height: 1.5; max-width: 60rem; }
.zinsstand b { color: var(--ink-soft); }

/* ── CTA-Leiste ───────────────────────────────────────────────── */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 1rem;
  padding: .8rem var(--pad) calc(.8rem + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--white) 94%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.cta-info { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cta-haus { font-size: .85rem; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cta-rate { font-size: .78rem; color: var(--ink-soft); }
.btn-cta { margin-left: auto; flex: none; padding: .9rem 1.3rem; }
.cta-note { font-size: .85rem; color: var(--ink-mute); max-width: 44rem; }
.intern-note { display: none; font-size: .85rem; color: var(--ink-mute); max-width: 44rem; }
body.is-intern .cta-bar, body.is-intern .cta-note { display: none; }
body.is-intern .intern-note { display: block; }
body.is-intern .rechner { padding-bottom: 2rem; }
body.is-intern .site-footer { padding-bottom: 1.6rem; }

/* ── Footer ───────────────────────────────────────────────────── */
.site-footer { padding: 1.6rem var(--pad) 6.5rem; border-top: 1px solid var(--line); background: var(--paper-warm); font-size: .8rem; color: var(--ink-soft); }
.site-footer a { color: var(--ink); font-weight: 600; }
body.on-start .site-footer { padding-bottom: 1.6rem; }

/* ── Bewegung nur auf Aktion ──────────────────────────────────── */
.rate-value.bump { animation: bump .35s var(--ease); }
@keyframes bump { 0% { transform: translateY(4px); opacity: .6; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ── Breiter ──────────────────────────────────────────────────── */
@media (min-width: 640px) {
  .wahl { grid-template-columns: 1fr 1fr; }
  .wahl-karte { grid-template-columns: 1fr; align-content: start; padding: 1.5rem; }
  .wahl-karte svg { grid-row: auto; width: 3.2rem; height: 3.2rem; margin-bottom: .8rem; }
  .wahl-karte b { font-size: 1.45rem; }
  .wahl-karte small { font-size: 1.02rem; }
  .dlg-start > p { font-size: 1.08rem; }
  .haus-grid { grid-template-columns: repeat(2, 1fr); }
  .field-ansicht { grid-column: 1 / -1; }
  .field-ansicht .schalter { max-width: 26rem; }
  .switches { grid-template-columns: repeat(2, 1fr); }
  .btn-cta { padding: 1rem 1.8rem; }
  .cta-haus { font-size: .95rem; }
}
@media (min-width: 900px) {
  .start { grid-template-columns: 1.15fr 1fr; align-items: center; gap: clamp(2.5rem, 6vw, 6rem); }
  .eingaben { grid-template-columns: 2fr 1fr 1fr; }
  /* 900–1199 px: Schalter als eigene Zeile über den drei Feldern */
  .eingaben > .field.field-ansicht { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; grid-row: auto; }
  .field-ansicht .schalter { flex: 0 1 26rem; }
  /* Label / Eingabe / Hinweis der drei Felder teilen sich Zeilen, die Eingabefelder
     liegen auf einer gemeinsamen Mittellinie (Hauspreis ist bewusst größer). */
  @supports (grid-template-rows: subgrid) {
    .eingaben > .field { display: grid; grid-template-rows: subgrid; grid-row: span 3; row-gap: .35rem; }
    .eingaben > .field > span:first-child { align-self: end; }
    .eingaben > .field > .money, .eingaben > .field > .haus-row { align-self: center; }
    .eingaben > .field > small { align-self: start; }
  }
  .switches { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); }
  .kosten-rate { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
  .kosten-rate .rate-panel { position: sticky; top: 4.5rem; }
  .haus-grid { grid-template-columns: repeat(3, 1fr); }
  .block { grid-template-columns: minmax(240px, 1fr) minmax(0, 2.3fr); }
  .tbl .c-fine { display: table-cell; }
  .tbl td small.m-only { display: none; }
}
@media (min-width: 1300px) {
  .haus-grid { grid-template-columns: repeat(4, 1fr); }
  .block { grid-template-columns: minmax(280px, 1fr) minmax(0, 2.6fr); }
}
@media (max-width: 899px) {
  .tbl th.c-fine, .tbl td.c-fine { display: none; }
}
@media (max-width: 639px) {
  /* Mobil: die Rate zuerst — sie ist der Grund, warum man hier ist; die
     Eingaben folgen direkt darunter und ändern sie live. */
  .kosten-rate { display: contents; }
  .rate-panel { order: -1; }
  /* Schalter (+ Wunschrate) stehen als eigene Karte ganz oben — darunter sofort das Ergebnis. */
  .solo { order: -2; }
  .schalter button { padding: .7rem .5rem; font-size: .9rem; }
  .dlg-head { gap: .7rem; }
  /* Handy: Fenster von unten, oben bleibt ein Streifen Rechner sichtbar */
  .dlg-haeuser { --rand: .5rem; width: calc(100vw - 1rem); height: calc(100dvh - 3rem); margin: 3rem auto 0; border-radius: 12px 12px 0 0; padding-bottom: 2rem; }
  /* Handy: der Filterkopf scrollt mit weg, sonst bleibt für die Häuser kaum Platz */
  .dlg-head-katalog { position: static; flex-wrap: wrap; align-items: center; }
  /* X + Titel in einer Zeile, Text und Filter darunter über die volle Breite */
  .dlg-head-katalog .katalog-kopf { display: contents; }
  .dlg-head-katalog h2 { flex: 1; min-width: 0; }
  .dlg-head-katalog p, .dlg-head-katalog .katalog-filter { flex: 0 0 100%; margin-top: 0; }
  .dlg-head p { font-size: .8rem; }
  .tbl { font-size: .9rem; }
  .tbl th, .tbl td { padding: .6rem .6rem; }
  .tbl th:first-child, .tbl td:first-child { min-width: 7.5rem; }
  .tbl .c-5j { display: none; }
  .header-cta span { display: none; }
  .header-cta { padding: .6rem .7rem; }
  .brand-text small { display: none; }
  .brand { flex: none; }
  .rate-mini { min-width: 0; }
  .rate-mini-value { font-size: .98rem; }
  /* Sobald das kleine Zahlwerk im Kopf steht, weicht die Wortmarke (Bildmarke bleibt). */
  .site-header:has(.rate-mini.show) .brand-text { display: none; }
  .btn-cta { padding: .85rem 1rem; font-size: .95rem; }
  .btn-cta svg { display: none; }
}

/* ── Desktop: Grundschrift wächst mit der Fensterhöhe, damit Eingaben, Fragen,
   Kostentabelle und Rate den Bildschirm immer ausfüllen (14 Zoll wie großer Monitor). ── */
@media (min-width: 1200px) {
  /* Faktoren so gewählt, dass Eingaben + Kostentabelle (auch mit den zwei
     Bodenplatten-Zeilen eines gewählten Hauses) + Rate bei 1493×746 (14"-MacBook,
     Browser mit Tableiste) ohne Scrollen passen — gemessen 2026-09-16. */
  html { font-size: clamp(12.5px, 1.83vh, 24px); }
  /* Interner Link: keine Leiste unten → mehr Höhe nutzbar */
  html:has(body.is-intern) { font-size: clamp(12.5px, 1.97vh, 27px); }
  .kosten-rate { align-items: stretch; }
  .kosten-rate .rate-panel { position: static; align-content: start; }
  /* Schalter als erste Spalte derselben Zeile wie Hauspreis/Wunschrate, Grundstück, Eigenkapital */
  .eingaben { grid-template-columns: max-content 1.7fr 1fr 1fr; }
  @supports (grid-template-rows: subgrid) {
    .eingaben > .field.field-ansicht { display: grid; grid-template-rows: subgrid; grid-row: span 3; grid-column: auto; row-gap: .3rem; }
    .eingaben > .field-ansicht > .schalter { align-self: center; max-width: none; }
    .eingaben > .field-ansicht > small { align-self: start; }
  }
  .schalter button { padding: .55rem .9rem; font-size: .92rem; }
  .eingaben { padding: .9rem 1.3rem .8rem; gap: .7rem 1.3rem; }
  .eingaben > .field { row-gap: .3rem; }
  .field input[type="text"], .haus-wahl { padding: .55rem .9rem; }
  .field-main .money input { font-size: 1.2rem !important; padding: .55rem 2.3rem .55rem .9rem !important; }
  .field-main .money-monat input { padding-right: 7rem !important; }
  .kinder-q { flex-direction: row; flex-wrap: wrap; align-items: center; gap: .3rem 1.3rem; padding: .35rem 0; }
  .kinder-q .switch-text { flex: 0 1 auto; }
  /* Erklärtexte der Schalter kosten auf dem Laptop die halbe Höhe (Fabian 2026-09-16):
     hier nur die Frage, der Text wandert als Tooltip auf die Frage (app.js setzt title). */
  .kinder-q .switch-text small, .switch .switch-text small { display: none; }
  /* QNG-Hinweis (Fabian 2026-09-24): hängt frei unter der Frage und nimmt keinen
     Platz im Fluss — die Schalter der Reihe bleiben mittig auf einer Linie, beim
     Umschalten springt nichts. */
  /* unter dem Fragetext, bündig mit ihm (beginnt erst nach dem Schalter, Fabian 2026-09-24) */
  .switch-text:has(.qng-hint) { position: relative; }
  .qng-hint { position: absolute; left: 0; top: 100%; margin-top: .15rem; white-space: nowrap; font-size: .75rem; }
  .switch .switch-text b { cursor: help; text-decoration: underline dotted rgb(var(--dw-sand-098-rgb) / .35); text-underline-offset: 3px; }
  /* Zwei Reihen nach Bedeutung (Fabian 2026-09-18):
     oben   Bauträger │ Kinder + Chips · Steuerbescheide   (wer baut, wer zieht ein)
     unten  QNG · Eigenleistung · 2 Wohneinheiten │ Entwässerung · Außenanlagen */
  .switches { display: flex; flex-direction: column; gap: .15rem; margin-top: .2rem; }
  .sw-row { display: flex; align-items: center; gap: .3rem clamp(1rem, 1.6vw, 2rem); flex-wrap: wrap; }
  .sw-wer { padding-bottom: .35rem; border-bottom: 1px solid var(--line); }
  .sw-wer .bt-q { padding-right: clamp(1rem, 1.6vw, 2rem); border-right: 1px solid var(--line); }
  .sw-wer .kinder-q { grid-column: auto; }
  .sw-haus { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem 1.2rem; }
  /* Schalter mittig neben der (ggf. mehrzeiligen) Frage → alle Schalter der
     Reihe auf einer Linie (Fabian 2026-09-24) */
  .sw-haus .switch { align-items: center; }
  .sw-haus .switch .track { margin-top: 0; }
  .sw-haus .paket-erst { padding-left: 1.2rem; border-left: 1px solid var(--line); }
  .switch .switch-text b { white-space: nowrap; }
  .sw-haus .switch .switch-text b { white-space: normal; }
  .switch { padding: .35rem 0; }
  .bedarf { padding: .85rem 1.2rem 1.3rem; gap: .5rem; }
  .bedarf-head p { display: none; }
  .bedarf-note { display: none; }
  .tbl.tbl-compact th, .tbl.tbl-compact td { padding: .26rem .65rem; font-size: .88rem; }
  .tbl.tbl-compact .sub td { padding-top: .06rem; padding-bottom: .06rem; font-size: .78rem; }
  .kosten-rate .rate-panel { padding: 1.1rem 1.3rem 1.2rem; }
  .rate-value { font-size: 3.3rem; }
  .rate-empf { display: none; }
  .cta-bar { padding-top: .45rem; padding-bottom: calc(.45rem + env(safe-area-inset-bottom)); }
  .btn-cta { padding: .65rem 1.3rem; font-size: .95rem; }
}
