/* Wengerter Hausplaner
   Das Haus als Modell auf der Bühne, Konfiguration in der Spalte rechts.
   Markenauftritt nach wengerter-bau.de: Bitter für Überschriften, Plus Jakarta Sans für Text,
   Rot #E73A3A für Auswahl und Preis, warmes Beige als Fläche, Grün für „inklusive“. */
:root {
  /* Wengerter-Markenfarben (wengerter-bau.de): Rot, warmes Beige, Anthrazit */
  --paper: #FAF6EF;
  --sheet: #FFFFFF;
  --stage: #EFEBE3;
  --ink: #333333;
  --head: #3F3F3F;
  --muted: #59595F;
  --line: #E6E6E7;
  --line-strong: #CFCFD2;
  --panel: #F5F1EA;
  --wine: #E73A3A;
  --wine-dark: #C92E2E;
  --wine-soft: #FDEDEC;
  --vine: #2B6E2C;
  --vine-soft: #E9F2E6;
  --focus: #2F5D8A;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Bitter', Georgia, serif;
  --panel-w: clamp(400px, 33vw, 520px);
  --r: 4px;
  --float: 0 1px 2px rgba(51, 51, 51, .08), 0 8px 28px rgba(51, 51, 51, .12);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h2, h3 { margin: 0; font-weight: 700; }

/* ---------- Gerüst */
.app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--panel-w);
  grid-template-rows: auto auto minmax(0, 1fr);
  grid-template-areas: "strip strip" "top top" "stage panel";
  height: 100vh;
  height: 100dvh;
}
body[data-step="plaene"] .app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "strip" "top" "panel"; }
body[data-step="plaene"] .stage { display: none; }

.top {
  grid-area: top;
  z-index: 10;
  display: flex; align-items: stretch; justify-content: space-between; gap: 24px;
  background: var(--paper);
  border-bottom: 1.5px solid var(--ink);
  padding: 0 0 0 24px;
}
.brand { display: flex; align-items: baseline; gap: 14px; padding: 14px 0; }
.wordmark {
  font-size: 30px; font-weight: 800; font-stretch: 125%;
  letter-spacing: -0.02em; line-height: 1;
}
.brand-sub { color: var(--muted); font-stretch: 85%; }

/* Preis als Schriftfeld */
.pricebox {
  display: grid;
  grid-template-columns: auto auto auto;
  border-left: 1.5px solid var(--ink);
  position: relative;
}
.pb-cell {
  display: flex; flex-direction: column; justify-content: center;
  padding: 8px 18px;
  border-left: 1px solid var(--line);
  min-width: 110px;
}
.pb-cell:first-child { border-left: 0; }
.pb-label { font-size: 12px; color: var(--muted); font-stretch: 85%; }
.pb-total { background: var(--sheet); min-width: 230px; }
.pb-total strong {
  font-size: 30px; font-weight: 700; font-stretch: 112%; line-height: 1.1;
  color: var(--wine); letter-spacing: -0.01em;
}
.pb-delta {
  position: absolute; right: 12px; top: calc(100% + 10px); z-index: 30;
  background: var(--ink); color: #fff; font-weight: 600;
  padding: 6px 12px; min-width: 0; border: 0; border-radius: 999px;
  box-shadow: var(--float);
}
.pb-delta.down { background: var(--vine); }
@keyframes flash { from { background: var(--wine-soft); } to { background: transparent; } }
.flash { animation: flash 1.2s ease-out; }

/* ---------- Bühne */
.stage {
  grid-area: stage;
  position: relative; overflow: hidden; min-height: 0;
  background: var(--stage);
}
.stage-canvas { position: absolute; inset: 0; }
.stage-canvas canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.stage-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.room-label {
  position: absolute; left: 0; top: 0;
  display: flex; flex-direction: column; align-items: center;
  padding: 3px 9px 4px; border-radius: 8px;
  background: rgba(255, 255, 255, .9); color: var(--ink);
  box-shadow: 0 1px 2px rgba(28, 35, 41, .14);
  font-size: 12px; line-height: 1.2; white-space: nowrap;
  transition: opacity .2s, background-color .15s, color .15s;
}
.room-label b { font-weight: 600; }
.room-label span { font-size: 11px; color: var(--muted); font-stretch: 88%; }
.room-label.is-hl { background: var(--wine); color: #fff; }
.room-label.is-hl span { color: rgba(255, 255, 255, .8); }

.stage-plan {
  position: absolute; inset: 0; z-index: 1;
  display: grid; place-items: center;
  padding: 24px 24px 84px 120px;
  background: var(--sheet);
}
.stage-plan .pv-plan { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 0; }
.stage-plan svg { display: block; flex: 1; min-height: 0; max-width: 100%; height: 100%; width: auto; }
.pv-dir { display: block; text-align: center; font-size: 12px; color: var(--muted); font-stretch: 85%; }
.pv-plan [data-room] { transition: fill-opacity .15s; }
.pv-plan [data-room].hl { fill: var(--wine-soft) !important; }

.stage-ui { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.stage-ui > * { pointer-events: auto; }

/* Geschosswahl als kleiner Hausschnitt: Dach = ganzes Haus, darunter DG, OG, EG */
.section-ctl {
  position: absolute; left: 22px; top: 22px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  width: 76px; padding: 10px 8px 8px;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 14px; box-shadow: var(--float);
}
.sec {
  width: 56px; height: 30px; padding: 0; cursor: pointer;
  border: 1.5px solid var(--ink); background: var(--sheet); border-radius: 3px;
  font-size: 12px; font-weight: 700; font-stretch: 112%;
  transition: background-color .15s, color .15s;
}
.sec:hover { background: var(--wine-soft); }
.sec[aria-pressed="true"] { background: var(--ink); color: #fff; }
.sec-roof {
  position: relative; width: 66px; height: 34px; border: 0; border-radius: 0;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  display: flex; align-items: flex-end; justify-content: center;
}
.sec-roof::before {
  content: ""; position: absolute; inset: 0;
  background: var(--sheet);
  clip-path: polygon(50% 5px, calc(100% - 3.2px) calc(100% - 1.5px), 3.2px calc(100% - 1.5px));
  transition: background-color .15s;
}
.sec-roof span { position: relative; font-size: 11px; font-weight: 700; font-stretch: 100%; padding-bottom: 4px; line-height: 1; }
.sec-roof:hover { background: var(--ink); }
.sec-roof:hover::before { background: var(--wine-soft); }
.sec-roof[aria-pressed="true"]::before { background: var(--ink); }
.sec-ground { width: 70px; height: 2px; background: var(--ink); margin-top: 3px; border-radius: 1px; }

.stage-bar {
  position: absolute; right: 22px; bottom: 22px;
  display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end;
}
.seg {
  display: flex; padding: 4px; gap: 2px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: 999px; box-shadow: var(--float);
}
.seg button {
  border: 0; background: none; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; color: var(--muted);
  transition: background-color .15s, color .15s;
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.stage-caption {
  position: absolute; left: 22px; bottom: 22px; margin: 0;
  display: flex; flex-direction: column;
  pointer-events: none;
}
.stage-caption strong { font-size: 26px; font-stretch: 118%; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stage-caption span { color: var(--muted); font-size: 13.5px; }
.seg-tools { position: absolute; left: 116px; top: 22px; }
.seg-tools button[aria-pressed="true"] { background: var(--wine); }
.stage-hint {
  position: absolute; right: 22px; top: 20px; margin: 0; max-width: 300px; text-align: right;
  font-size: 12.5px; color: var(--muted); font-stretch: 88%;
  pointer-events: none;
}
body:has(.seg-tools) .stage-hint { left: 118px; right: auto; top: 72px; text-align: left; max-width: 340px; }

/* Bearbeitungsfeld zum angeklickten Bauteil */
.pop {
  position: absolute; z-index: 5;
  padding: 16px 16px 14px; border-radius: 14px;
  background: rgba(255, 255, 255, .97); box-shadow: var(--float), 0 0 0 1px rgba(28, 35, 41, .06);
  max-height: calc(100% - 24px); overflow-y: auto;
  font-size: 14px;
}
.pop h4 { margin: 0 28px 2px 0; font-size: 16px; font-weight: 700; font-stretch: 108%; }
.pop-sub { margin: 0 0 8px; color: var(--muted); font-size: 12.5px; line-height: 1.4; }
.pop-label { margin: 12px 0 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.pop-close {
  position: absolute; right: 10px; top: 10px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; background: var(--panel); cursor: pointer; font-size: 17px; line-height: 1;
}
.pop-close:hover { background: var(--line); }
.pop-opts { display: flex; flex-direction: column; gap: 4px; }
.pop-opt {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet);
  cursor: pointer; text-align: left; font-size: 13.5px;
}
.pop-opt span { display: flex; align-items: center; }
.pop-opt small { color: var(--muted); white-space: nowrap; }
.pop-opt:hover { border-color: var(--line-strong); }
.pop-opt.is-on { border-color: var(--wine); background: var(--wine-soft); color: var(--wine); font-weight: 600; }
.pop-opt .swatch { margin-right: 8px; }
.pop-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pop-sw {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 2px; border: 1px solid transparent; border-radius: 8px; background: none; cursor: pointer;
}
.pop-sw span { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18); }
.pop-sw small { font-size: 11px; line-height: 1.2; text-align: center; color: var(--muted); }
.pop-sw:hover { background: var(--panel); }
.pop-sw.is-on { border-color: var(--wine); background: var(--wine-soft); }
.pop-sw.is-on small { color: var(--wine); font-weight: 600; }
.pop-price { margin: 12px 0 0; font-size: 13px; }
.pop-price strong { color: var(--wine); }
.pop-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.pop-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.pop-seg button {
  padding: 8px 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--sheet);
  font-size: 13px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pop-seg button:hover:not(:disabled) { border-color: var(--line-strong); }
.pop-seg button.is-on { border-color: var(--wine); background: var(--wine-soft); color: var(--wine); font-weight: 600; cursor: default; }
.pop-actions .btn { padding: 7px 12px; font-size: 13px; }

body.no-webgl .stage-canvas, body.no-webgl .stage-labels { display: none; }

/* ---------- Konfigurationsspalte */
.panel {
  grid-area: panel;
  display: flex; flex-direction: column; min-height: 0;
  background: var(--sheet);
  border-left: 1px solid var(--line);
}
body[data-step="plaene"] .panel { border-left: 0; background: var(--paper); }

.steps { border-bottom: 1px solid var(--line); padding: 12px 16px; flex: none; }
.steps ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
body[data-step="plaene"] .steps ol { max-width: 1320px; margin-inline: auto; }
.step {
  display: flex; align-items: center; gap: 8px;
  padding: 4px; border: 0; border-radius: 999px; background: none; cursor: pointer;
  color: var(--muted);
}
.step:hover { background: var(--panel); color: var(--ink); }
.step-no {
  flex: none; width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 1.5px solid var(--line-strong); border-radius: 50%;
  font-size: 12px; font-weight: 700;
}
.step.is-done .step-no { border-color: var(--ink); color: var(--ink); }
.step-title { display: none; font-weight: 600; font-size: 13.5px; white-space: nowrap; padding-right: 8px; }
.step.is-active { background: var(--wine-soft); color: var(--wine); }
.step.is-active .step-no { background: var(--wine); border-color: var(--wine); color: #fff; }
.step.is-active .step-title { display: inline; }
body[data-step="plaene"] .step-title { display: inline; }

.content { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 26px 0; overscroll-behavior: contain; }
body[data-step="plaene"] .content { padding-inline: max(26px, calc((100% - 1320px) / 2)); }
.content-head { margin-bottom: 22px; }
.content-kicker { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
.content-head h2 { font-size: 32px; font-stretch: 118%; letter-spacing: -0.02em; line-height: 1.1; }
.content-head p:last-child { margin: 4px 0 0; color: var(--muted); }

.group { margin: 0 0 28px; }
.group h3 { font-size: 15px; margin-bottom: 10px; }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 12px 14px;
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s, background-color .15s;
}
.choice:hover { border-color: var(--line-strong); background: #FAFBF9; }
.choice.is-on { background: var(--wine-soft); border-color: var(--wine); box-shadow: inset 0 0 0 0.5px var(--wine); }
.choice-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.choice-label { font-weight: 600; }
.choice.is-on .choice-label { color: var(--wine); }
.choice-desc { display: block; color: var(--muted); font-size: 13.5px; margin-top: 2px; max-width: 64ch; }
/* Vorschaubild links neben der Option */
.choices.has-thumbs .choice { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; }
.choice-thumb { display: block; width: 48px; height: 48px; color: var(--ink); }
.choice-thumb svg { display: block; width: 100%; height: 100%; }
.choice.is-on .choice-thumb { color: var(--wine); }
.choice-main { display: block; min-width: 0; }
.choice-sel { display: none; }
.stage-grip { display: none; }
.ptag { white-space: nowrap; font-weight: 600; }
.ptag small { font-weight: 400; color: var(--muted); margin-left: 4px; }
.ptag.incl { color: var(--vine); font-weight: 500; }
.ptag.minus { color: var(--vine); }

.toggle {
  position: relative;   /* das unsichtbare Kontrollkästchen bleibt in seiner Zeile, sonst springt der Fokus */
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
  padding: 14px; background: var(--sheet);
  border: 1px solid var(--line); border-radius: var(--r);
  cursor: pointer;
}
.toggle:has(input:checked) { border-color: var(--wine); background: var(--wine-soft); }
.toggle input { position: absolute; left: 14px; top: 50%; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle-track {
  width: 40px; height: 22px; border-radius: 11px; background: var(--line-strong); position: relative;
  transition: background .15s;
}
.toggle-track::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  transition: transform .15s;
}
.toggle input:checked + .toggle-track { background: var(--wine); }
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--focus); outline-offset: 2px; }
.toggle.is-disabled { opacity: .55; cursor: not-allowed; }

.counter {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 14px; background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r);
}
.counter output { font-size: 22px; font-weight: 700; min-width: 1.5ch; text-align: center; }
.cnt-btn {
  width: 36px; height: 36px; border: 1px solid var(--ink); border-radius: 50%; background: var(--sheet); cursor: pointer; font-size: 18px;
}
.cnt-btn:hover:not(:disabled) { background: var(--panel); }
.cnt-btn:disabled { opacity: .3; cursor: default; }

.fields { display: grid; grid-template-columns: 1fr; gap: 12px; }
.fields label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.fields input {
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--sheet); color: var(--ink); font-size: 15px;
}
.fields input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 3px rgba(47, 93, 138, .18); }

.house-facts {
  display: grid; grid-template-columns: repeat(3, 1fr);
  border: 1px solid var(--line); border-radius: var(--r);
  margin: 0 0 28px;
}
.house-facts div { padding: 12px 14px; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.house-facts div:first-child { border-left: 0; }
.house-facts strong { font-size: 17px; font-stretch: 112%; }
.house-facts span { font-size: 12.5px; color: var(--muted); line-height: 1.35; }

/* Grundrissvarianten */
.variants { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.variant {
  display: flex; text-align: left; cursor: pointer; padding: 0; overflow: hidden;
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--r);
  transition: border-color .15s, background-color .15s;
}
.variant:hover { border-color: var(--line-strong); }
.variant.is-on { border-color: var(--wine); box-shadow: inset 0 0 0 0.5px var(--wine); background: var(--wine-soft); }
.variant.is-on .choice-label { color: var(--wine); }
.variant.is-disabled { opacity: .55; cursor: not-allowed; }
.variant.is-disabled .choice-desc { color: var(--wine); }
.variant-plan { flex: none; width: 116px; display: grid; place-items: center; padding: 8px; background: var(--sheet); border-right: 1px solid var(--line); }
.variant-plan svg { display: block; width: 100%; height: auto; max-height: 190px; }
.variant-body { padding: 12px 14px; flex: 1; min-width: 0; }
.variant-meta { display: block; font-size: 12.5px; color: var(--muted); margin-top: 6px; font-stretch: 88%; }

table { border-collapse: collapse; width: 100%; }
.rooms { font-size: 14px; }
.rooms th, .rooms td { padding: 7px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.rooms thead th { font-size: 12px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--ink); }
.rooms tbody th { font-weight: 600; }
.rooms tfoot th, .rooms tfoot td { border-bottom: 0; border-top: 1px solid var(--ink); font-weight: 600; }
.rooms tbody tr { transition: background-color .12s; }
.rooms tbody tr:hover, .rooms tbody tr.hl { background: var(--wine-soft); }
.rooms select { padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--sheet); max-width: 150px; font-size: 13.5px; }
.rooms small { display: block; font-size: 11.5px; color: var(--muted); }
.num { text-align: right !important; white-space: nowrap; }
.swatch { display: inline-block; width: 11px; height: 11px; margin-right: 8px; border: 1px solid rgba(0,0,0,.25); border-radius: 3px; vertical-align: -1px; }
.muted { color: var(--muted); }
.note { font-size: 13px; color: var(--muted); max-width: 72ch; margin: 10px 0 0; }

.pager {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; justify-content: space-between; gap: 10px;
  margin: 32px -26px 0; padding: 14px 26px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid var(--line);
}
body[data-step="plaene"] .pager { position: static; background: none; backdrop-filter: none; margin: 32px 0 0; padding: 18px 0 40px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border: 1px solid var(--ink); border-radius: 999px; background: var(--sheet);
  cursor: pointer; font-weight: 600; font-size: 14px; text-decoration: none;
}
.btn:hover { background: var(--panel); }
.btn-primary { background: var(--wine); border-color: var(--wine); color: #fff; }
.btn-primary:hover { background: #64192F; }
.btn-quiet { border-color: transparent; background: none; color: var(--muted); }

/* ---------- Zusammenfassung und Pläne */
.summary { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 36px; margin-bottom: 36px; }
.offer-table th, .offer-table td { padding: 6px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400; vertical-align: top; }
.offer-table td { padding-left: 16px; }
.offer-table small { display: block; color: var(--muted); font-size: 12.5px; }
.offer-base th { font-weight: 600 !important; }
.offer-cat th { padding-top: 16px; font-weight: 700 !important; border-bottom: 1px solid var(--ink); font-size: 13px; }
.offer-table tfoot th, .offer-table tfoot td { border-top: 2px solid var(--ink); border-bottom: 0; font-weight: 700; font-size: 18px; padding-top: 10px; }
.offer-table tfoot td { color: var(--wine); }
.summary h3 { margin-bottom: 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }

.trades { border-top: 1.5px solid var(--ink); padding-top: 14px; }
.trade-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.trade-tab {
  padding: 8px 12px; background: none; border: 1px solid var(--line); cursor: pointer; font-size: 13.5px; font-weight: 500;
}
.trade-tab:hover { border-color: var(--ink); }
.trade-tab.is-on { background: var(--ink); border-color: var(--ink); color: #fff; }
.trade-bar { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 10px; color: var(--muted); }
.sheet-frame { background: #D9DCD7; padding: 18px; overflow-x: auto; }

/* Planblatt */
.sheet {
  background: var(--sheet); color: var(--ink);
  display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px;
  padding: 18px; border: 1px solid var(--ink);
  min-width: 980px;
}
.sheet-main { display: flex; flex-direction: column; justify-content: space-between; gap: 12px; min-width: 0; }
.sheet-notes { margin: 0; font-size: 11px; font-stretch: 88%; color: var(--muted); max-width: 90ch; border-top: 1px solid var(--line); padding-top: 6px; }
.sheet-plans { display: flex; gap: 6px; align-items: flex-start; justify-content: space-around; min-width: 0; }
.plan { margin: 0; flex: 1; min-width: 0; }
.plan svg { display: block; width: 100%; height: auto; max-height: 640px; margin-inline: auto; }
.plan-single { flex: 1.2; }
.plan figcaption { text-align: center; font-family: var(--serif); font-weight: 700; margin-top: 4px; font-size: 14px; }
.sheet-side { display: flex; flex-direction: column; gap: 14px; border-left: 1px solid var(--ink); padding-left: 16px; min-width: 0; }
.sheet-lv { flex: 1; }
.legend { list-style: none; margin: 0 0 10px; padding: 0 0 10px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 11.5px; border-bottom: 1px solid var(--line); }
.legend li { display: flex; align-items: center; gap: 5px; }
.legend .sw svg { display: block; }
.lv { font-size: 11px; font-stretch: 88%; line-height: 1.3; }
.lv th { text-align: left; font-weight: 600; border-bottom: 1px solid var(--ink); padding: 3px 4px; }
.lv td { padding: 3px 4px; border-bottom: 1px solid #E3E5E1; vertical-align: top; }
.lv tfoot td { border-top: 1px solid var(--ink); font-weight: 700; border-bottom: 0; }
.sheet-lvmain { border-top: 1px solid var(--line); padding-top: 6px; }
.lv-title { margin: 0 0 4px; font-size: 12px; font-weight: 700; }
.lv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.lv-note { font-size: 11px; font-stretch: 88%; color: var(--muted); margin: 8px 0 0; line-height: 1.35; }
.lv-note.warn { color: var(--wine); font-weight: 600; }
.titleblock { margin: 0; border: 1.5px solid var(--ink); font-size: 11.5px; }
.titleblock > div { border-top: 1px solid var(--ink); padding: 4px 8px; }
.titleblock > div:first-child { border-top: 0; }
.titleblock dt { font-size: 9.5px; color: var(--muted); }
.titleblock dd { margin: 0; font-weight: 600; }
.tb-firm { display: flex; justify-content: space-between; align-items: baseline; background: var(--ink); color: #fff; }
.tb-firm strong { font-size: 18px; font-stretch: 125%; font-weight: 800; letter-spacing: -0.02em; }
.tb-firm span { font-size: 10.5px; opacity: .8; }
.tb-row { display: grid; grid-template-columns: 1fr 1fr; padding: 0 !important; }
.tb-row > div { padding: 4px 8px; }
.tb-row > div + div { border-left: 1px solid var(--ink); }

#print-root { display: none; }


/* ---------- Wengerter-Markenauftritt */
h2, h3, .wordmark, .type-name, .stage-caption strong, .pb-total strong, .pop h4 { font-family: var(--serif); color: var(--head); }
body { font-size: 14.5px; }
.topstrip {
  grid-area: strip; display: flex; justify-content: space-between; gap: 16px;
  padding: 6px 24px; background: var(--paper); font-size: 12.5px; color: var(--ink);
}
.topstrip a { color: inherit; text-decoration: none; font-weight: 600; }
.topstrip a:hover { color: var(--wine); }
.top { background: var(--sheet); border-bottom: 1px solid var(--line); box-shadow: 0 1px 0 rgba(51, 51, 51, .03); }
.brand { align-items: center; gap: 12px; padding: 10px 0; }
.logo { width: 42px; height: 38px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.wordmark { font-size: 24px; font-weight: 800; font-stretch: normal; letter-spacing: 0; }
.brand-sub { font-size: 12px; font-stretch: normal; color: var(--wine); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.pricebox { border-left: 1px solid var(--line); }
.pb-cell { border-left-color: var(--line); }
.pb-total { background: var(--paper); }
.pb-total strong { font-size: 28px; font-weight: 700; font-stretch: normal; color: var(--wine); }
.pb-label { font-stretch: normal; }
.pb-delta { border-radius: 0; }

/* Schritt-Kopf mit roter Linie wie auf der Website */
.content-kicker { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.content-kicker::before { content: ""; width: 32px; height: 2px; background: var(--wine); }
.content-head h2 { font-size: 30px; font-weight: 700; font-stretch: normal; letter-spacing: 0; line-height: 1.15; margin-top: 6px; }
.group h3 { font-family: var(--serif); font-size: 17px; }

.btn { border-radius: 0; text-transform: uppercase; letter-spacing: .06em; font-size: 12.5px; font-weight: 700; padding: 12px 18px; border-color: var(--wine); color: var(--wine); background: var(--sheet); }
.btn:hover { background: var(--wine-soft); }
.btn-primary { background: var(--wine); color: #fff; }
.btn-primary:hover { background: var(--wine-dark); }
.btn-quiet { border-color: transparent; color: var(--muted); background: none; }
.choice, .toggle, .counter, .variant, .house-facts, .pop-opt { border-radius: var(--r); }
.step.is-active { background: var(--wine-soft); }

/* Gruppe im Modell zeigen */
.group h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.look {
  border: 0; background: none; cursor: pointer; padding: 2px 0;
  font-family: var(--font); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--wine);
  display: inline-flex; align-items: center; gap: 6px;
}
.look::before { content: ""; width: 14px; height: 9px; border: 1.5px solid currentColor; border-radius: 50% / 60%; box-sizing: border-box; background: radial-gradient(circle, currentColor 0 2px, transparent 2.5px); }
.look:hover { text-decoration: underline; }

/* Haustyp-Karte im ersten Schritt */
.type-card { background: var(--paper); padding: 20px 20px 16px; margin: 0 0 28px; border-radius: var(--r); }
.tag { display: inline-block; padding: 5px 10px; background: var(--vine-soft); color: var(--vine); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-radius: 2px; }
.type-name { font-size: 26px; font-weight: 700; margin: 10px 0 4px; }
.type-claim { margin: 0 0 14px; color: var(--muted); }
.type-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin: 0 0 14px; }
.type-facts div { padding: 7px 0; border-top: 1px solid var(--line-strong); }
.type-facts dt { font-size: 11.5px; color: var(--muted); }
.type-facts dd { margin: 0; font-weight: 600; font-size: 13.5px; }
.chips { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0 0 6px; }
.chips li { display: flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--sheet); border: 1px solid var(--line-strong); border-radius: 999px; font-size: 12.5px; }
.chips li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--wine); box-shadow: 0 0 0 3px var(--wine-soft); }
.type-card .note a, .summary .note a { color: var(--wine); font-weight: 600; }

/* Bühne: warmer Hintergrund, Bedienelemente eckig wie auf der Website */
.seg, .section-ctl, .pop { border-radius: 2px; }
.seg button { border-radius: 0; font-weight: 600; }
.seg button[aria-pressed="true"] { background: var(--head); }
.seg-tools button[aria-pressed="true"] { background: var(--wine); }
.sec { border-color: var(--head); }
.sec[aria-pressed="true"] { background: var(--wine); border-color: var(--wine); }
.sec-roof { background: var(--head); }
.sec-roof[aria-pressed="true"]::before { background: var(--wine); }
.sec-roof[aria-pressed="true"] { background: var(--wine); }
.room-label { border-radius: 2px; }
.tb-firm { background: var(--head) !important; }
.trade-tab { border-radius: 0; }
.trade-tab.is-on { background: var(--wine); border-color: var(--wine); }

/* ---------- Schmal */
@media (max-width: 1100px) {
  :root { --panel-w: 380px; }
  body:not([data-step="plaene"]) .step.is-active .step-title { display: none; }
  .brand-sub { display: none; }
  .summary { grid-template-columns: 1fr; }
  .stage-hint { display: none; }
  .stage-caption { bottom: 74px; }
  .house-facts { grid-template-columns: 1fr; }
  .house-facts div { border-left: 0; border-top: 1px solid var(--line); }
  .house-facts div:first-child { border-top: 0; }
}
@media (max-width: 760px) {
  body { font-size: 14.5px; }
  .topstrip span { display: none; }
  .type-facts { grid-template-columns: 1fr; }
  .app { display: block; height: auto; padding-bottom: 72px; }
  .top { padding: 0 16px; }
  .brand { padding: 12px 0; }
  .wordmark { font-size: 24px; }
  .pricebox {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    grid-template-columns: 1fr auto; background: var(--sheet);
    border-left: 0; border-top: 1.5px solid var(--ink);
  }
  .pricebox .pb-cell:nth-child(2), .pricebox .pb-cell:nth-child(3) { display: none; }
  .pricebox { grid-template-columns: 1fr; min-height: 60px; padding-right: 168px; }
  .pb-total { min-width: 0; }
  .pb-total strong { font-size: 24px; }
  .pb-delta { top: auto; bottom: calc(100% + 8px); }
  /* Bühne bleibt beim Scrollen oben stehen, damit jede Änderung im Modell sichtbar ist; Höhe per Griff (--stage-h) */
  .stage { position: sticky; top: 0; z-index: 8; height: 42svh; height: var(--stage-h, 42svh); }
  .stage-grip {
    display: block; position: absolute; left: 50%; bottom: 0; z-index: 7; transform: translateX(-50%);
    width: 72px; height: 22px; padding: 0; border: 0; background: none; cursor: ns-resize; touch-action: none;
  }
  .stage-grip::before {
    content: ""; position: absolute; left: 18px; right: 18px; top: 13px; height: 4px; border-radius: 2px;
    background: var(--ink); opacity: .35;
  }
  .steps { top: var(--stage-h, 42svh); }
  .section-ctl { left: 12px; top: 12px; transform: scale(.82); transform-origin: top left; }
  /* Bedienleisten in einer Zeile, seitlich wischbar statt umbrechen und überdecken */
  .stage-bar {
    right: 0; bottom: 18px; left: 0; padding: 0 10px 4px;
    flex-wrap: nowrap; justify-content: flex-start; gap: 6px;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .stage-bar::-webkit-scrollbar { display: none; }
  .stage-bar .seg { flex: none; }
  .stage-bar .seg-mode { order: -1; }     /* 3D/Grundriss vorne, nicht aus dem Bild gewischt */
  .seg button { padding: 8px 11px; font-size: 13px; white-space: nowrap; }
  .topstrip { padding: 5px 16px; font-size: 12px; }
  .stage-caption { left: auto; right: 14px; top: 12px; bottom: auto; text-align: right; }
  .stage-caption strong { font-size: 18px; }
  .stage-caption span { font-size: 12px; }
  .stage-plan { padding: 64px 12px 64px 90px; }
  .seg-tools { left: 10px; right: 10px; top: auto; bottom: 68px; justify-content: space-between; }
  .seg-tools button { flex: 1; padding: 8px 4px; }
  body:has(.seg-tools) .stage-hint { display: none; }
  /* Bearbeitungsfeld als Blatt am unteren Rand der Bühne, groß genug zum Tippen */
  /* Bearbeitungsfeld unter der Bühne (über der Optionsliste), damit das Modell frei bleibt */
  .pop {
    position: fixed; left: 8px !important; right: 8px; width: auto !important;
    top: calc(var(--stage-h, 42svh) + 8px) !important; bottom: 72px !important; max-height: none;
    z-index: 6; padding: 14px 14px 12px;
  }
  .pop-opt, .pop-seg button { min-height: 42px; }
  .pop-close { width: 34px; height: 34px; right: 8px; top: 8px; }
  .room-label { padding: 2px 6px; font-size: 10.5px; border-radius: 6px; }
  .room-label span { display: none; }
  .panel { border-left: 0; border-top: 1px solid var(--line); }
  .steps { overflow-x: auto; padding: 10px 12px; position: sticky; z-index: 5; background: var(--sheet); }
  .content { overflow: visible; padding: 20px 16px 0; }
  .content-head h2 { font-size: 26px; }
  .variant-plan { width: 96px; }
  .rooms th, .rooms td { padding: 7px 3px; }
  .rooms select { max-width: 120px; }
  .sheet-frame { padding: 8px; margin-inline: -16px; }
  /* Zurück/Weiter in der Preisleiste: eine Zeile statt zwei */
  .pager {
    position: fixed; right: 0; bottom: 0; z-index: 21; margin: 0; width: 168px; height: 60px;
    padding: 8px 12px 8px 0; gap: 6px; align-items: center; justify-content: flex-end;
    background: none; backdrop-filter: none; -webkit-backdrop-filter: none; border: 0;
  }
  .pager .btn { min-height: 44px; padding-block: 0; }
  .pager .btn-primary { flex: 1; }
  .pager .btn-back { width: 44px; padding: 0; flex: none; }
  .pager .btn-back span, .pager .btn-next { display: none; }
  .pager .btn-back::before { content: "‹"; font-size: 24px; line-height: 1; margin-top: -3px; }
  .pager .btn-primary::after { content: "›"; font-size: 20px; line-height: 1; margin-top: -2px; }
  body[data-step="plaene"] .pager { width: auto; height: auto; }
  body[data-step="plaene"] .pager .btn-back span, body[data-step="plaene"] .pager .btn-next { display: inline; }
  body[data-step="plaene"] .pager .btn-back { width: auto; padding: 0 18px; }
  body[data-step="plaene"] .pager .btn-back::before { content: none; }
  /* Material- und Bauteilgruppen als wischbare Kachelreihe; Beschreibung der Auswahl darunter */
  .choices-row {
    flex-direction: row; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none;
    margin-inline: -16px; padding: 2px 16px 4px; scroll-padding-inline: 16px;
  }
  .choices-row::-webkit-scrollbar { display: none; }
  .choices.choices-row .choice { flex: 0 0 128px; grid-template-columns: 1fr; gap: 8px; align-items: start; padding: 10px; scroll-snap-align: start; }
  .choices-row .choice-thumb { width: 56px; height: 56px; }
  .choices-row .choice-head { flex-direction: column; align-items: flex-start; gap: 2px; }
  .choices-row .choice-label { font-size: 13px; line-height: 1.25; }
  .choices-row .ptag { font-size: 12.5px; }
  .choices-row .ptag small { display: block; margin: 0; }
  .choices-row .choice-desc { display: none; }
  .choice-sel { display: block; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .flash { animation: none; }
  .toggle-track, .toggle-track::after, .choice, .variant, .sec, .seg button, .room-label { transition: none; }
}

/* ---------- Druck: A3 quer, Grundrisse im Maßstab 1:100 */
@page { size: A3 landscape; margin: 9mm; }
@media print {
  body { background: #fff; font-size: 10pt; }
  body.printing .app { display: none; }
  body.printing #print-root { display: block; }
  body:not(.printing) .top, body:not(.printing) .steps, body:not(.printing) .stage, body:not(.printing) .pager { display: none; }
  .sheet {
    width: 402mm; height: 278mm; min-width: 0; overflow: hidden;
    grid-template-columns: 1fr 112mm; gap: 6mm; padding: 6mm; border: 0.4mm solid #000;
    page-break-after: always; break-after: page;
  }
  .sheet:last-child { page-break-after: auto; break-after: auto; }
  .sheet-plans { justify-content: space-evenly; gap: 2mm; }
  .plan { flex: none; }
  .plan svg { width: calc(var(--w) * 1mm); max-height: none; }
  .lv { font-size: 7.4pt; }
  .lv-title { font-size: 8pt; }
  .lv-cols { gap: 6mm; }
  .lv-note, .sheet-notes { font-size: 7.4pt; }
  .legend { font-size: 7.6pt; }
  .titleblock { font-size: 8pt; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
