/* =====================================================================
   Poole Balkonstudio – Gestaltung
   Fünf Bereiche: obere Leiste · Navigation · 3D-Fläche · Auswahlbereich · untere Leiste
   Ab 2.8: ruhige Schriftskala (12 · 13 · 14 · 15 · 17 · 22), Touch-Flächen ab 44 px,
   Safe-Area, Hover nur bei Maus, Druckfeedback, Bewegung nur über transform/opacity.
   ===================================================================== */
:root {
  --ink: #15171a; --ink-2: #2d3136; --muted: #5d636a; --faint: #8e949a;
  --line: #e2e4e7; --line-2: #cfd3d8; --surface: #fff; --surface-2: #f5f6f7; --surface-3: #eceef0; --bg: #e9ebee;
  --rot: #86652f; --rot-d: #6b5124; --rot-hell: #f4eee3; --blau: #0a4fd1; --blau-hell: #e8efff;
  --gruen: #167a37; --gruen-hell: #e7f5ec; --gelb: #b86e00; --gelb-d: #9a5a00; --gelb-hell: #fff4e0;
  --kopf: #0F1519; --kopf-2: #1A232A;
  --r-sm: 4px; --r: 8px; --r-lg: 12px;
  --sh-1: 0 1px 2px rgba(15, 17, 20, .06); --sh-2: 0 6px 22px rgba(15, 17, 20, .1); --sh-3: 0 20px 60px rgba(15, 17, 20, .22);

  /* Schrift: 6 Stufen, nichts unter 12 px */
  --t-xs: 12px; --t-s: 13px; --t-m: 14px; --t-body: 15px; --t-l: 17px; --t-xl: 22px;
  --font: "Albert Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Bewegung */
  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-sheet: cubic-bezier(.32, .72, 0, 1);
  --tr: .16s ease;
  --tr-knopf: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease, transform .12s var(--ease-out);

  /* Sichere Ränder (Notch, Home-Indikator) */
  --sat: env(safe-area-inset-top, 0px); --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px); --sal: env(safe-area-inset-left, 0px);

  --navi-b: 248px; --panel-b: 400px; --oben-h: calc(60px + var(--sat)); --unten-h: calc(68px + var(--sab));
}
@font-face { font-family: 'Albert Sans'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../fonts/albert-sans-latin-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: 'Albert Sans'; font-style: normal; font-display: swap; font-weight: 100 900; src: url(../fonts/albert-sans-latin-ext-wght-normal.woff2) format('woff2-variations'); unicode-range: U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { height: 100%; overscroll-behavior: none; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: var(--t-body); line-height: 1.5; -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button, summary, select, label.schalter { touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
a { color: var(--blau); }
[hidden] { display: none !important; }
.nur-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nur-klein { display: none; }
:focus-visible { outline: 2px solid var(--blau); outline-offset: 2px; }
.leiste-oben :focus-visible, .toast :focus-visible, .tipp :focus-visible { outline-color: #fff; }
.num { font-variant-numeric: tabular-nums; }
::selection { background: var(--rot-hell); color: var(--rot-d); }

/* ---------------- Grundraster ---------------- */
.studio { display: grid; height: 100vh; height: 100dvh; grid-template-rows: var(--oben-h) minmax(0, 1fr) var(--unten-h); grid-template-columns: var(--navi-b) minmax(0, 1fr) var(--panel-b);
  grid-template-areas: "oben oben oben" "navi buehne panel" "unten unten unten"; }

/* ---------------- Buttons ---------------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--r); padding: 10px 16px; font-weight: 600; font-size: var(--t-m); cursor: pointer; background: transparent; transition: var(--tr-knopf); white-space: nowrap; line-height: 1.2; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primaer { background: var(--rot); color: #fff; }
.btn-sekundaer { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-text { color: var(--muted); padding: 8px 10px; }
.btn-klein { padding: 6px 10px; font-size: var(--t-s); }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--r); }
.btn svg, .icon { width: 18px; height: 18px; flex: 0 0 auto; display: block; }

/* ---------------- Obere Leiste ---------------- */
.leiste-oben { grid-area: oben; display: flex; align-items: center; gap: 12px; padding: var(--sat) max(14px, var(--sar)) 0 max(14px, var(--sal)); background: var(--kopf); color: #fff; min-width: 0; z-index: 40; }
.leiste-oben > a { display: flex; align-items: center; min-height: 44px; }
.leiste-oben .logo { height: 34px; width: auto; display: block; }
.leiste-oben .logo-text { font-weight: 800; font-style: italic; font-size: 20px; letter-spacing: -.02em; display: none; }
.leiste-oben .trenner { width: 1px; height: 28px; background: rgba(255, 255, 255, .16); }
.projekt { display: flex; flex-direction: column; min-width: 0; }
.projekt-name { background: transparent; border: 1px solid transparent; border-radius: var(--r-sm); color: #fff; font-weight: 600; font-size: var(--t-body); padding: 1px 6px; max-width: 280px; text-overflow: ellipsis; }
.projekt-name:focus { border-color: rgba(255, 255, 255, .5); background: rgba(255, 255, 255, .06); }
.speicherstatus { font-size: var(--t-xs); color: #aab0b6; padding-left: 7px; display: flex; align-items: center; gap: 6px; }
.speicherstatus::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4fbf73; }
.speicherstatus[data-art="speichert"]::before { background: #e0a100; }
.speicherstatus[data-art="fehler"]::before { background: var(--rot); }
.leiste-oben .spacer { flex: 1; }
.leiste-oben .btn-text, .leiste-oben .btn-icon { color: #d6d9dc; }
.modus { display: flex; background: var(--kopf-2); border-radius: 999px; padding: 3px; }
.modus button { border: 0; background: transparent; color: #aab0b6; padding: 6px 12px; border-radius: 999px; font-size: var(--t-s); font-weight: 600; cursor: pointer; transition: var(--tr-knopf); }
.modus button[aria-pressed="true"] { background: #fff; color: var(--ink); }
.varianten-wahl { background: var(--kopf-2); color: #fff; border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--r); padding: 7px 10px; font-size: var(--t-s); }

/* ---------------- Navigation ---------------- */
.navi { grid-area: navi; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; display: flex; flex-direction: column; min-height: 0; }
.navi ol { list-style: none; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; counter-reset: schritt; }
.navi-punkt { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; width: 100%; text-align: left; border: 0; background: transparent; border-radius: var(--r); padding: 7px 8px; cursor: pointer; color: var(--ink); transition: var(--tr-knopf); }
.navi-punkt[aria-current="step"] { background: var(--rot-hell); }
.navi-punkt[aria-current="step"] .navi-titel { color: var(--rot-d); }
.navi-bild { width: 44px; height: 34px; border-radius: 6px; background: var(--surface-3); overflow: hidden; border: 1px solid var(--line); }
.navi-bild svg { width: 100%; height: 100%; display: block; }
.navi-titel { font-weight: 600; font-size: var(--t-m); line-height: 1.25; }
.navi-unter { display: block; font-size: var(--t-xs); color: var(--muted); font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.status-punkt { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); flex: 0 0 auto; }
.status-punkt[data-status="ok"] { background: var(--gruen); }
.status-punkt[data-status="fehlt"] { background: var(--gelb); }
.status-punkt[data-status="pruefen"] { background: var(--blau); }
.status-punkt[data-status="konflikt"] { background: var(--rot); box-shadow: 0 0 0 3px var(--rot-hell); }
.navi-fuss { margin-top: auto; padding: 10px 12px 14px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.navi-fuss .btn { justify-content: flex-start; }
.legende { font-size: var(--t-xs); color: var(--muted); display: grid; grid-template-columns: 1fr 1fr; gap: 3px 8px; padding: 4px 4px 0; }
.legende span { display: flex; align-items: center; gap: 6px; }
.legende .status-punkt { width: 8px; height: 8px; box-shadow: none; }

/* ---------------- 3D-Fläche ---------------- */
.buehne { grid-area: buehne; position: relative; min-width: 0; min-height: 0; background: linear-gradient(180deg, #cfe3f3, #eef2ef); overflow: hidden; }
.szene { position: absolute; inset: 0; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.szene.ziehen { cursor: grabbing; }
.szene.griff-hover { cursor: move; }
.szene-canvas { display: block; }
.szene-labels { position: absolute; inset: 0; pointer-events: none; }
.szene-blasen { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.szene-blase { position: absolute; left: 0; top: 0; background: #fff; color: var(--ink); font-size: var(--t-m); font-weight: 700; padding: 6px 11px; border-radius: 14px; box-shadow: var(--sh-2); white-space: nowrap; animation: blase-auf .22s var(--ease-out); }
.szene-blase::after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; border-bottom: 0; }
@keyframes blase-auf { from { opacity: 0; translate: 0 6px; } to { opacity: 1; translate: 0 0; } }
.mass-label { position: absolute; left: 0; top: 0; background: rgba(21, 23, 26, .9); color: #fff; font-size: var(--t-xs); font-weight: 600; padding: 4px 8px; border-radius: 6px; white-space: nowrap; border: 0; }
.mass-label.klickbar { pointer-events: auto; cursor: text; background: var(--surface); color: var(--ink); box-shadow: var(--sh-2); border: 1px solid var(--line-2); transition: border-color var(--tr), color var(--tr); }
.szene-tip { position: absolute; left: 0; top: 0; background: var(--ink); color: #fff; font-size: var(--t-s); padding: 5px 9px; border-radius: 6px; pointer-events: none; white-space: nowrap; box-shadow: var(--sh-2); z-index: 5; }
.buehne-oben { position: absolute; left: 12px; right: 12px; top: 12px; display: flex; gap: 8px; align-items: flex-start; pointer-events: none; flex-wrap: wrap; }
.buehne-oben > * { pointer-events: auto; }
.bereich { display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .95); border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 12px; box-shadow: var(--sh-1); font-size: var(--t-s); max-width: 100%; min-width: 0; }
.bereich > span { flex: 0 0 auto; }
.bereich strong { font-weight: 600; }
/* die längste Option („Ebene … (alle Balkone)“) bestimmt sonst die Breite – auf kleinen Handys ragte die Auswahl samt Pfeil aus dem Bild */
.bereich select { border: 0; background: var(--surface-2); border-radius: 999px; padding: 5px 10px; font-weight: 600; min-width: 0; max-width: 100%; text-overflow: ellipsis; }
.werkzeuge { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); display: flex; gap: 2px; background: rgba(255, 255, 255, .96); border: 1px solid var(--line); border-radius: 12px; padding: 4px; box-shadow: var(--sh-2); max-width: calc(100% - 24px); overflow-x: auto; scrollbar-width: none; }
.werkzeuge::-webkit-scrollbar { display: none; }
.werkzeug { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: transparent; border-radius: 8px; padding: 6px 8px; font-size: var(--t-xs); font-weight: 600; color: var(--muted); cursor: pointer; min-width: 54px; white-space: nowrap; flex: 0 0 auto; transition: var(--tr-knopf); }
.werkzeug[aria-pressed="true"] { background: var(--ink); color: #fff; }
.werkzeug-trenner { width: 1px; background: var(--line); margin: 6px 3px; flex: 0 0 auto; }
.werkzeuge.kompakt .werkzeug { min-width: 40px; padding: 8px 9px; }
.werkzeuge.kompakt .werkzeug span { display: none; }
.haus-schalter { margin-left: auto; }
.meldung-flaeche { position: absolute; right: 12px; top: 58px; display: flex; flex-direction: column; gap: 8px; width: min(360px, calc(100% - 24px)); pointer-events: none; }
.meldung-flaeche > * { pointer-events: auto; }
/* weitere Konflikte (shell.js): ein Tipp zeigt alle im Fenster */
.meldung-mehr { align-self: flex-end; position: relative; border: 1px solid #7a0710; background: var(--rot-hell); color: #7a0710; border-radius: 999px; padding: 5px 12px; font-size: var(--t-s); font-weight: 600; cursor: pointer; box-shadow: var(--sh-1); transition: var(--tr-knopf); }
.meldung-mehr::after { content: ""; position: absolute; inset: -8px -4px; }
/* Smartphone (hoch und quer, shell.js): höchstens ein kompaktes Banner, Text auf zwei Zeilen gekürzt – ein Tipp darauf zeigt alle vollständig */
.meldung-flaeche .meldung-kompakt { margin: 0; padding: 8px 10px; gap: 6px; box-shadow: var(--sh-1); }
.meldung-text { border: 0; background: none; color: inherit; font: inherit; text-align: left; padding: 0; cursor: pointer; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.meldung-kompakt .hinweis-aktionen { flex-wrap: nowrap; align-items: center; }
.meldung-kompakt .meldung-mehr { margin-left: auto; box-shadow: none; white-space: nowrap; }
.mass-editor { position: absolute; z-index: 30; background: var(--surface); border-radius: var(--r); box-shadow: var(--sh-3); padding: 10px; display: flex; gap: 8px; align-items: center; border: 1px solid var(--line); }
.mass-editor input { width: 96px; padding: 8px 10px; border: 1px solid var(--line-2); border-radius: 6px; text-align: right; font-weight: 600; font-size: 16px; }
.lade { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; color: var(--muted); text-align: center; padding: 24px; }
.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(21, 23, 26, .12); border-top-color: var(--rot); animation: dreh .8s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }
.privat-leiste { position: absolute; left: 12px; bottom: 76px; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------------- Auswahlbereich ---------------- */
.panel { grid-area: panel; background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.panel-griff { display: none; }
.panel-kopf { padding: 14px 18px 12px; border-bottom: 1px solid var(--line); }
.brotkrumen { font-size: var(--t-xs); color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.brotkrumen button { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 0; font-size: var(--t-xs); position: relative; }
.panel-titel { font-size: var(--t-xl); font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin-top: 2px; overflow-wrap: anywhere; }
.panel-titel:focus { outline: none; }
.panel-unter { font-size: var(--t-s); color: var(--muted); }
.bearbeite { margin-top: 8px; display: inline-flex; align-items: center; gap: 8px; background: var(--blau-hell); color: #0a3b9e; border-radius: 999px; padding: 4px 10px; font-size: var(--t-s); font-weight: 600; }
.panel-inhalt { overflow-y: auto; padding: 6px 18px 24px; flex: 1; min-height: 0; overscroll-behavior: contain; }
.panel-inhalt.neu-schritt > .abschnitt, .panel-inhalt.neu-schritt > .hinweis, .panel-inhalt.neu-schritt > .empfehlung, .panel-inhalt.neu-schritt > .extras-liste { animation: schritt-ein .24s var(--ease-out) backwards; }
.panel-inhalt.neu-schritt > :nth-child(2) { animation-delay: 30ms; }
.panel-inhalt.neu-schritt > :nth-child(3) { animation-delay: 60ms; }
.panel-inhalt.neu-schritt > :nth-child(4) { animation-delay: 90ms; }
.panel-inhalt.neu-schritt > :nth-child(n+5) { animation-delay: 120ms; }
@keyframes schritt-ein { from { opacity: 0; translate: 0 8px; } }
.abschnitt { border-bottom: 1px solid var(--line); padding: 14px 0; }
.abschnitt:last-child { border-bottom: 0; }
.abschnitt-kopf { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.abschnitt-titel { font-size: var(--t-xs); letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.abschnitt-kopf .info { margin-left: auto; }
details.abschnitt > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; }
details.abschnitt > summary::-webkit-details-marker { display: none; }
details.abschnitt > summary::after { content: "+"; margin-left: auto; font-size: var(--t-xl); line-height: 1; color: var(--muted); transition: transform .2s var(--ease-out); }
details.abschnitt[open] > summary::after { transform: rotate(45deg); }
/* Zeilen mit Wert (z. B. Preisgruppen): Wert rechtsbündig direkt vor dem Plus, nicht in der Mitte */
details.abschnitt > summary:has(.num)::after { margin-left: 14px; }
details.abschnitt[open] > summary { margin-bottom: 10px; }
.text-klein { font-size: var(--t-s); color: var(--muted); line-height: 1.5; }
.info-btn { position: relative; width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--muted); font-size: var(--t-xs); font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }

/* Mindest-Trefferfläche 44 px für kleine Bedienelemente, ohne die Optik zu verändern */
.info-btn::after { content: ""; position: absolute; inset: -12px; }
button.link::after, .zeile button.link::after, .brotkrumen button::after { content: ""; position: absolute; inset: -12px -6px; }
.fortschritt-balken button::after { content: ""; position: absolute; inset: -11px -2px; }

/* Karten / Kacheln */
.karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.karten.zwei { grid-template-columns: 1fr 1fr; }
.karten.drei { grid-template-columns: repeat(3, 1fr); }
.karte { position: relative; display: flex; flex-direction: column; text-align: left; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); padding: 0; cursor: pointer; overflow: hidden; transition: var(--tr-knopf); }
.karte[aria-pressed="true"], .karte.aktiv { border-color: var(--rot); box-shadow: inset 0 0 0 1px var(--rot); }
.karte.gesperrt { opacity: .5; cursor: not-allowed; }
.karte-bild { height: 62px; background: var(--surface-3) center/cover no-repeat; border-bottom: 1px solid var(--line); display: block; }
.karte-bild svg { width: 100%; height: 100%; display: block; }
.karte-text { padding: 7px 9px 8px; display: flex; flex-direction: column; gap: 1px; }
.karte-name { font-size: var(--t-s); font-weight: 600; line-height: 1.25; }
.karte-info { font-size: var(--t-xs); color: var(--muted); line-height: 1.3; }
.karte-name, .karte-info, .material-name, .material-serie { overflow-wrap: anywhere; hyphens: auto; }
.karte-preis { font-size: var(--t-xs); font-weight: 600; margin-top: 2px; }
.karte-preis.plus { color: var(--ink); } .karte-preis.minus { color: var(--gruen); } .karte-preis.inkl { color: var(--muted); font-weight: 500; }
.karte:not(:has(.karte-bild)) .karte-name { padding-right: 24px; }
.karte .haken { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--rot); color: #fff; display: none; align-items: center; justify-content: center; font-size: var(--t-xs); }
.karte[aria-pressed="true"] .haken, .karte.aktiv .haken { display: flex; }
.karte .marke { position: absolute; left: 6px; top: 6px; background: var(--ink); color: #fff; font-size: var(--t-xs); font-weight: 700; padding: 3px 7px; border-radius: 4px; }
.karte-breit { flex-direction: row; align-items: stretch; }
.karte-breit .karte-bild { width: 92px; height: auto; min-height: 72px; border-bottom: 0; border-right: 1px solid var(--line); flex: 0 0 auto; }
.karte-breit .karte-text { padding: 9px 12px; }
.mehr-block { margin-top: 8px; }
.mehr-knopf { width: 100%; justify-content: center; margin-top: 8px; }

/* Materialkarten */
.material-liste { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.material { border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface); cursor: pointer; text-align: left; padding: 0; display: flex; flex-direction: column; position: relative; transition: var(--tr-knopf); min-width: 0; }
.material[aria-pressed="true"] { border-color: var(--rot); box-shadow: inset 0 0 0 1px var(--rot); }
.material-bild { height: 70px; background: var(--surface-3) center/cover; display: block; overflow: hidden; }
/* Gezeichnete Geländerbilder füllen das Bildfeld, statt in voller Kartenbreite über den Text zu ragen */
.material-bild svg { display: block; width: 100%; height: 100%; }
.material-text { padding: 7px 9px 9px; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.material-name { font-size: var(--t-s); font-weight: 600; line-height: 1.25; }
.material-serie { font-size: var(--t-xs); color: var(--muted); }
.eigenschaften { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.eig { font-size: var(--t-xs); line-height: 1.3; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.material .abverkauf { position: absolute; top: 6px; left: 6px; background: var(--gelb-d); color: #fff; font-size: var(--t-xs); font-weight: 700; padding: 3px 7px; border-radius: 4px; }

/* Farbfelder */
.farben { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 8px; }
.farbfeld { position: relative; display: block; width: 100%; aspect-ratio: 1; border-radius: 10px; border: 1px solid rgba(0, 0, 0, .15); cursor: pointer; padding: 0; transition: transform .12s var(--ease-out), box-shadow var(--tr); }
.farbfeld[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--rot); }
.farbfeld-name { font-size: var(--t-xs); color: var(--muted); text-align: center; margin-top: 3px; line-height: 1.2; }

/* Segmente, Chips, Schalter */
.segment { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 3px; gap: 3px; }
.segment button { flex: 1; border: 0; background: transparent; border-radius: 6px; padding: 8px 8px; font-size: var(--t-s); font-weight: 600; color: var(--muted); cursor: pointer; transition: var(--tr-knopf); }
.segment button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 7px 12px; font-size: var(--t-s); font-weight: 500; cursor: pointer; transition: var(--tr-knopf); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip:disabled, .segment button:disabled { opacity: .45; cursor: not-allowed; }   /* gesperrt (z. B. Seite schon belegt): sichtbar, nicht nur per Text */
/* lange Beschriftungen („Für alle Balkone der obersten Ebene übernehmen“) brechen im Auswahlbereich und in Fenstern um, statt rechts
   abgeschnitten über den Rand zu ragen */
.panel-inhalt .btn, .dialog-inhalt .btn, .chip { max-width: 100%; }
.panel-inhalt .btn, .dialog-inhalt .btn { white-space: normal; text-align: center; overflow-wrap: break-word; }
.chips.multi .chip[aria-pressed="true"]::before { content: "✓"; margin-right: 6px; }
.farbe-gewaehlt { margin-top: 8px; }
.schalter { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--t-m); padding: 6px 0; }
.schalter input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background-color var(--tr); flex: 0 0 auto; }
.schalter input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease-out); box-shadow: var(--sh-1); }
.schalter input:checked { background: var(--rot); }
.schalter input:checked::after { transform: translateX(16px); }
.schalter .karte-preis { white-space: nowrap; padding-left: 8px; }

/* Zahlenfelder */
.feld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; min-width: 0; }
.feld > label, .feld-label { font-size: var(--t-s); font-weight: 600; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.zahl { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; background: var(--surface); min-width: 0; }
.zahl:focus-within { border-color: var(--ink); }
.zahl:has(input:focus-visible) { outline: 2px solid var(--blau); outline-offset: 2px; }
.zahl button { width: 40px; border: 0; background: var(--surface-2); font-size: var(--t-l); cursor: pointer; color: var(--ink-2); transition: var(--tr-knopf); }
.zahl input { flex: 1; min-width: 0; border: 0; text-align: center; font-weight: 700; font-size: 16px; padding: 9px 6px; outline: none; }
.zahl .einheit { padding: 0 10px; display: flex; align-items: center; color: var(--muted); font-size: var(--t-s); background: var(--surface); }
.standardmasse { display: flex; gap: 5px; flex-wrap: wrap; }
.standardmasse button { position: relative; border: 1px dashed var(--line-2); background: var(--surface); border-radius: 6px; padding: 3px 8px; font-size: var(--t-xs); cursor: pointer; color: var(--muted); transition: var(--tr-knopf); }
.standardmasse button::after { content: ""; position: absolute; inset: -9px -3px; }
.standardmasse button[aria-pressed="true"] { border-style: solid; border-color: var(--ink); color: var(--ink); font-weight: 600; }
.eingabe, .auswahlfeld { width: 100%; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--surface); font-size: 16px; }
.eingabe:focus, .auswahlfeld:focus { border-color: var(--ink); }
.eingabe[aria-invalid="true"] { border-color: var(--rot); background: var(--rot-hell); }
.feld-fehler { color: var(--rot-d); font-weight: 600; font-size: var(--t-s); }
.schalter input[aria-invalid="true"] { outline: 2px solid var(--rot); outline-offset: 2px; }
textarea.eingabe { min-height: 80px; resize: vertical; }
.raster-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }

/* Hinweise & Konflikte */
.hinweis { border-radius: var(--r); padding: 10px 12px; font-size: var(--t-s); line-height: 1.45; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; margin: 8px 0; }
.hinweis[data-art="konflikt"] { background: var(--rot-hell); color: #7a0710; }
.hinweis[data-art="pruefen"] { background: var(--blau-hell); color: #0a3585; }
.hinweis[data-art="fehlt"] { background: var(--gelb-hell); color: #6d4100; }
.hinweis[data-art="info"] { background: var(--surface-2); }
.hinweis-aktionen { display: flex; gap: 6px; flex-wrap: wrap; }
.hinweis-aktionen .btn { background: var(--surface); border-color: currentColor; color: inherit; padding: 6px 10px; font-size: var(--t-s); }
.planungshilfe { font-size: var(--t-xs); background: var(--ink); color: #fff; padding: 4px 9px; border-radius: 999px; display: inline-block; }

/* Mini-Grundriss */
.grundriss { width: 100%; max-width: 260px; display: block; margin: 4px auto 6px; }
.grundriss .haus { fill: #d9dcdf; }
.grundriss .kante { stroke: var(--line-2); stroke-width: 6; stroke-linecap: round; cursor: pointer; }
.grundriss .kante.an { stroke: var(--ink-2); }
.grundriss .kante.aktiv { stroke: var(--rot); }
/* Trefferfläche für den Finger: unsichtbare breite Linie je Seite (rund 40 px), dazu die Beschriftungen */
.grundriss .kante-treffer { stroke: transparent; stroke-width: 36; pointer-events: stroke; cursor: pointer; }
.grundriss text[data-kante] { cursor: pointer; }
.grundriss text { font-size: 11px; fill: var(--muted); font-family: var(--font); }

/* Listen, Preiszeilen */
.zeilen { display: flex; flex-direction: column; }
.zeile { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: var(--t-m); align-items: baseline; }
.zeile:last-child { border-bottom: 0; }
.zeile .wert { font-weight: 600; white-space: nowrap; }
.zeile .klein { font-size: var(--t-xs); color: var(--muted); }
.zeile button.link { border: 0; background: none; color: var(--blau); cursor: pointer; font-size: var(--t-s); padding: 0; position: relative; }
.varianten-zeile { flex-wrap: wrap; row-gap: 6px; }
.varianten-aktionen { flex-basis: 100%; display: flex; gap: 22px; }
.marke-art { font-size: var(--t-xs); font-weight: 700; padding: 3px 7px; border-radius: 4px; background: var(--surface-2); color: var(--muted); margin-left: 6px; }
.marke-art[data-art="offen"] { background: var(--gelb-hell); color: var(--gelb-d); }
.marke-art[data-art="geschaetzt"] { background: var(--blau-hell); color: var(--blau); }

/* ---------------- Untere Leiste ---------------- */
.leiste-unten { grid-area: unten; display: flex; align-items: center; gap: 14px; padding: 0 max(16px, var(--sar)) var(--sab) max(16px, var(--sal)); background: rgba(255, 255, 255, .98); border-top: 1px solid var(--line-2); z-index: 40; min-width: 0; }
.leiste-unten > * { min-width: 0; }
.preisstatus { position: relative; display: flex; flex-direction: column; align-items: flex-start; line-height: 1.2; min-width: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer; padding: 3px 6px; margin-left: -6px; border-radius: 6px; transition: var(--tr-knopf); }
.preisstatus .k { font-size: var(--t-xs); color: var(--muted); }
.preisstatus .v { font-size: var(--t-xl); font-weight: 800; letter-spacing: -.02em; }
.preisstatus .v.geaendert { animation: preis-neu .7s var(--ease-out); }
@keyframes preis-neu { 0% { color: var(--rot-d); } 100% { color: var(--ink); } }
.preisstatus .z { font-size: var(--t-xs); color: var(--gelb-d); font-weight: 600; }
.preisstatus .z.ok { color: var(--muted); font-weight: 500; }
.preis-delta { position: absolute; right: -6px; top: 0; transform: translateX(100%); font-size: var(--t-xs); font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--ink); color: #fff; white-space: nowrap; pointer-events: none; animation: delta-auf 1.5s var(--ease-out) forwards; }
.preis-delta.minus { background: var(--gruen); }
@keyframes delta-auf { 0% { opacity: 0; translate: -6px 4px; } 14% { opacity: 1; translate: 0 0; } 78% { opacity: 1; translate: 0 0; } 100% { opacity: 0; translate: 0 -5px; } }
.leiste-unten .spacer { flex: 1; }
.schrittanzeige { font-size: var(--t-s); color: var(--muted); }

/* ---------------- Schubladen & Dialoge ---------------- */
.schublade { position: fixed; top: var(--oben-h); right: 0; bottom: var(--unten-h); width: min(480px, 100%); background: var(--surface); box-shadow: var(--sh-3); z-index: 60; display: flex; flex-direction: column; visibility: hidden; transform: translateX(105%); transition: transform .28s var(--ease-sheet), visibility 0s linear .28s; }
.schublade.offen { visibility: visible; transform: none; transition: transform .28s var(--ease-sheet), visibility 0s; }
.schublade-kopf { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.schublade-kopf h2 { font-size: var(--t-l); }
.schublade-inhalt { overflow-y: auto; padding: 8px 18px 24px; flex: 1; overscroll-behavior: contain; }
.dialog-hg { position: fixed; inset: 0; background: rgba(15, 17, 20, .45); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; animation: hg-ein .18s ease-out; }
.dialog { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3); width: min(640px, 100%); max-height: 90vh; max-height: 90dvh; display: flex; flex-direction: column; overflow: hidden; animation: dialog-ein .22s var(--ease-out); }
@keyframes hg-ein { from { opacity: 0; } }
@keyframes dialog-ein { from { opacity: 0; transform: scale(.96); } }
.dialog.breit { width: min(1100px, 100%); }
.dialog-kopf { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); gap: 12px; }
.dialog-kopf h2 { font-size: var(--t-l); min-width: 0; }
.dialog-kopf .btn-icon { flex: 0 0 auto; }   /* ein langer Titel bricht um, der Schließen-Knopf behält seine Größe */
.dialog-inhalt { padding: 16px 20px; overflow-y: auto; }
.dialog-fuss { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.vergleich { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.vergleich-spalte { border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.vergleich-spalte img { width: 100%; display: block; background: var(--surface-3); aspect-ratio: 16 / 10; object-fit: cover; }
.vergleich-spalte .zeilen { padding: 6px 12px 10px; }
/* über der Werkzeugleiste im Bild, nicht auf ihr */
/* Hinweis mittig über dem 3D-Bild (zwischen Navigation und Auswahlbereich): lange Texte brechen um, statt über das Panel zu reichen */
/* Tipps gehen durch den Hinweis hindurch auf das, was darunter liegt – nur sein Knopf ist antippbar */
.toast { position: fixed; left: calc(var(--navi-b) + (100vw - var(--navi-b) - var(--panel-b)) / 2); bottom: calc(var(--unten-h) + 84px); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-size: var(--t-m); z-index: 78; display: flex; gap: 12px; align-items: center; box-shadow: var(--sh-3); width: max-content; max-width: calc(100vw - var(--navi-b) - var(--panel-b) - 24px); animation: toast-auf .22s var(--ease-out); pointer-events: none; }
@keyframes toast-auf { from { opacity: 0; transform: translate(-50%, 8px); } }
.toast button { background: none; border: 0; color: #9fd4ff; font-weight: 700; cursor: pointer; position: relative; pointer-events: auto; }
.toast button::after { content: ""; position: absolute; inset: -12px -8px; }
/* über Sheet und Leisten, aber unter Fenstern: solange eines offen ist, ruht der Hinweis (danach erscheint er wieder, falls seine Zeit nicht um ist) */
body:has(.dialog-hg, .einstieg-hg) .toast { visibility: hidden; }
/* läge er unter dem Finger, der ihn ausgelöst hat (Tipp auf die Hauswand): oben statt unten (bausteine.js toast, o.meiden) */
.toast.oben { top: calc(var(--oben-h) + 10px); bottom: auto; }

/* ---------------- Vereinfachung: Empfehlung, Führung, Extras ---------------- */
.leiste-oben .rueckruf { color: #fff; border-color: rgba(255, 255, 255, .28); padding: 8px 12px; }
.empfehlung { display: grid; grid-template-columns: 26px 1fr auto; gap: 10px; align-items: start; background: var(--gruen-hell); border-radius: var(--r); padding: 10px 12px; }
.empfehlung-haken { width: 22px; height: 22px; border-radius: 50%; background: var(--gruen); color: #fff; display: flex; align-items: center; justify-content: center; font-size: var(--t-xs); font-weight: 700; margin-top: 1px; }
.empfehlung-text { display: flex; flex-direction: column; gap: 1px; font-size: var(--t-m); line-height: 1.35; min-width: 0; }
.empfehlung-marke { font-size: var(--t-xs); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--gruen); }
.empfehlung .klein { font-size: var(--t-s); color: var(--muted); }
button.link, .link { border: 0; background: none; color: var(--blau); cursor: pointer; font-size: var(--t-s); padding: 0; font-weight: 600; white-space: nowrap; position: relative; }
.neustart { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; font-size: var(--t-s); color: var(--muted); background: var(--surface-2); border-radius: var(--r); padding: 8px 12px; margin: 12px 0 2px; }
.anordnung { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 14px; align-items: center; }
.anordnung-bild { border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); }
.anordnung-bild svg { display: block; width: 100%; height: auto; }
.fortschritt { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.fortschritt-text { font-size: var(--t-xs); font-weight: 700; color: var(--rot-d); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
.fortschritt-balken { display: flex; gap: 4px; flex: 1; }
.fortschritt-balken button { position: relative; flex: 1; height: 6px; border-radius: 3px; border: 0; padding: 0; background: var(--line); cursor: pointer; transition: background-color var(--tr); }
.fortschritt-balken button.fertig { background: #c6a26a; }
.fortschritt-balken button.an { background: var(--rot); }
.panel-fuss { padding: 16px 0 6px; display: flex; flex-direction: column; gap: 12px; }
.panel-weiter { width: 100%; justify-content: space-between; padding: 13px 16px; font-size: var(--t-body); }
.details-schalter { font-size: var(--t-s); color: var(--ink-2); border-top: 1px solid var(--line); padding-top: 12px; }
.details-schalter .klein { color: var(--muted); font-weight: 400; }
.extras-liste { display: flex; flex-direction: column; gap: 8px; }
.extra-karte { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r); padding: 10px 12px; cursor: pointer; transition: var(--tr-knopf); }
.extra-karte[aria-pressed="true"] { border-color: var(--rot); box-shadow: inset 0 0 0 1px var(--rot); }
.extra-karte .navi-bild { width: 56px; height: 42px; }
.extra-text { display: flex; flex-direction: column; min-width: 0; }
.extra-text .klein { font-size: var(--t-s); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.extra-aktion { font-size: var(--t-s); font-weight: 700; color: var(--rot-d); }
.extras-kopf { display: flex; flex-direction: column; gap: 8px; padding: 12px 0 4px; }
.extras-reiter { display: flex; gap: 4px; flex-wrap: wrap; }
.extras-reiter button { border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: var(--t-s); font-weight: 600; cursor: pointer; color: var(--ink-2); transition: var(--tr-knopf); }
.extras-reiter button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
/* Menü fest über allem (auch über Bottom Sheet und Hinweis-Toast; es schließt bei jedem Tipp daneben, ein Dialog kommt nie dazu);
   Lage und Höhe setzt shell.js, zu wenig Platz: es rollt in sich */
.werkzeug-menue { position: fixed; z-index: 92; width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-3); padding: 6px; display: flex; flex-direction: column; overflow-y: auto; overscroll-behavior: contain; transform-origin: var(--menue-ursprung, bottom left); animation: menue-auf .16s var(--ease-out); }
@keyframes menue-auf { from { opacity: 0; transform: scale(.96); } }
.werkzeug-menue button { display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left; padding: 9px 10px; border-radius: 8px; font-size: var(--t-m); cursor: pointer; color: var(--ink); flex: 0 0 auto; }
.werkzeug-menue button[aria-disabled="true"], .werkzeug-menue button[aria-disabled="true"] svg { color: var(--faint); }
.werkzeug-menue button:focus-visible { background: var(--surface-2); outline-offset: -2px; }
.werkzeug-menue button[aria-checked="true"] { font-weight: 700; }
.werkzeug-menue button[aria-checked="true"]::after { content: "✓"; margin-left: auto; color: var(--rot-d); }
.werkzeug-menue svg { width: 18px; height: 18px; color: var(--muted); flex: 0 0 auto; }
.telefon-gross { display: block; margin: 10px 0 14px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); color: var(--ink); font-weight: 700; text-decoration: none; }

/* Einstieg mit drei Fragen – liegt über dem Auswahlbereich, die 3D-Fläche bleibt frei und sichtbar */
/* Einstieg als eigenes Fenster (Pop-up), mittig über dem Studio; leichte Abdunkelung, damit das Modell dahinter sichtbar bleibt */
.einstieg-hg { position: fixed; z-index: 85; inset: 0; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 17, 20, .32); animation: hg-ein .18s ease-out; }
.einstieg { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-3); width: min(620px, 100%); height: min(640px, 90vh); height: min(640px, 90dvh); display: flex; flex-direction: column; overflow: hidden; animation: dialog-ein .22s var(--ease-out); }
.einstieg-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 6px; }
.einstieg-kopf h2 { font-size: var(--t-xl); line-height: 1.2; letter-spacing: -.01em; }
.einstieg-punkte { display: flex; gap: 6px; padding: 8px 20px 0; }
.einstieg-punkte span { height: 5px; flex: 1; border-radius: 3px; background: var(--line); }
.einstieg-punkte span.fertig { background: #c6a26a; }
.einstieg-punkte span.an { background: var(--rot); }
.einstieg-inhalt { padding: 16px 20px 8px; overflow-y: auto; flex: 1; min-height: 0; overscroll-behavior: contain; }
.einstieg-frage { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.einstieg-frage h3 { font-size: var(--t-l); line-height: 1.3; }
.einstieg-nr { width: 30px; height: 30px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.einstieg-fuss { display: flex; gap: 10px; align-items: center; padding: 12px 20px 16px; border-top: 1px solid var(--line); }
.einstieg-fuss .spacer { flex: 1; }
.einstieg .karten.drei .karte-bild { height: 56px; }

/* Bedienhinweise */
.tipp-rahmen { position: fixed; z-index: 94; border: 3px solid var(--rot); border-radius: 12px; box-shadow: 0 0 0 4000px rgba(15, 17, 20, .3); pointer-events: none; transition: left .28s var(--ease-out), top .28s var(--ease-out), width .28s var(--ease-out), height .28s var(--ease-out); }
.tipp { position: fixed; z-index: 95; background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 16px; box-shadow: var(--sh-3); transition: left .28s var(--ease-out), top .28s var(--ease-out); }
.tipp strong { font-size: var(--t-body); }
.tipp p { font-size: var(--t-m); margin: 4px 0 10px; color: #dfe2e5; }
.tipp-fuss { display: flex; align-items: center; gap: 12px; }
.tipp-fuss .klein { font-size: var(--t-xs); color: #b4bac0; margin-right: auto; }
.tipp .link { color: #9fd4ff; }

/* ---------------- Tablet ---------------- */
@media (max-width: 1280px) { :root { --panel-b: 360px; --navi-b: 212px; } .navi-unter { display: none; } }
@media (max-width: 1080px) {
  :root { --navi-b: 70px; }
  .navi-punkt { grid-template-columns: 44px; justify-items: center; padding: 8px 4px; position: relative; }
  .navi-punkt .navi-text { display: none; }
  .navi-punkt .status-punkt { position: absolute; top: 6px; right: 8px; }
  .navi-fuss .btn span, .legende { display: none; }
  .modus button { padding: 6px 9px; }
  .leiste-oben .rueckruf span { display: none; }
  .leiste-oben .rueckruf { width: 38px; height: 38px; padding: 0; }
}
@media (max-height: 860px) and (min-width: 821px) { .navi-unter { display: none; } .navi-punkt { padding-block: 5px; } }

/* ---------------- Smartphone ---------------- */
@media (max-width: 820px) {
  :root { --oben-h: calc(52px + var(--sat)); --unten-h: calc(64px + var(--sab)); }
  .studio { grid-template-columns: minmax(0, 1fr); grid-template-rows: var(--oben-h) minmax(0, 1fr) var(--unten-h); grid-template-areas: "oben" "buehne" "unten"; }
  .leiste-oben { padding: var(--sat) max(8px, var(--sar)) 0 max(8px, var(--sal)); gap: 6px; }
  .leiste-oben .logo { height: 26px; }
  .leiste-oben .trenner, .speicherstatus, .varianten-wahl, .leiste-oben .nur-gross { display: none; }
  .projekt-name { max-width: 120px; font-size: 16px; }
  .modus { display: none; }
  .navi { position: fixed; left: 0; right: 0; top: var(--oben-h); height: 58px; z-index: 35; border: 0; border-bottom: 1px solid var(--line); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .navi::-webkit-scrollbar { display: none; }
  .navi ol { flex-direction: row; padding: 6px max(6px, var(--sar)) 6px max(6px, var(--sal)); gap: 4px; }
  .navi-punkt { grid-template-columns: auto; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; min-height: 44px; }
  .navi-punkt .navi-bild { display: none; }
  .navi-punkt .navi-text { display: block; }
  .navi-punkt .navi-titel { font-size: var(--t-s); }
  .navi-punkt .status-punkt { position: static; width: 8px; height: 8px; }
  .navi-punkt { display: flex; gap: 6px; align-items: center; }
  .navi-fuss { display: none; }
  /* 3D bleibt oben vollständig sichtbar – der Auswahlbereich ist ein ziehbares Bottom Sheet darunter
     (Höhe am body: auch der Hinweis-Toast außerhalb des Studios richtet sich danach) */
  body { --sheet-h: calc((100dvh - var(--oben-h) - var(--unten-h) - 58px) * .5); }
  body:has(.panel[data-zustand="offen"]) { --sheet-h: calc(100dvh - var(--oben-h) - var(--unten-h) - 58px - 150px); }
  body:has(.panel[data-zustand="zu"]) { --sheet-h: 64px; }
  .buehne { margin-top: 58px; margin-bottom: calc(var(--sheet-h) - 16px); transition: margin-bottom 0s linear 0s; }
  .studio:has(.panel[data-richtung="auf"]) .buehne { transition-delay: .3s; }
  .panel { position: fixed; left: 0; right: 0; bottom: var(--unten-h); height: var(--sheet-h); z-index: 45; border: 0; border-radius: 16px 16px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18); transition: height .3s var(--ease-sheet); overflow: hidden; }
  .panel.zieht { transition: none; }
  /* Bildschirmtastatur offen (Fokus in einem Textfeld, shell.js): der Auswahlbereich bekommt die ganze Höhe, Leiste unten und Schritt-Chips ruhen */
  .studio.tippt .panel { height: calc(100dvh - var(--oben-h)); bottom: 0; transition: none; }
  .studio.tippt .leiste-unten, .studio.tippt .navi, .studio.tippt .panel-unter { display: none; }
  .panel-griff { display: flex; justify-content: center; padding: 12px 0 4px; cursor: grab; touch-action: none; }
  .panel-griff span { width: 44px; height: 5px; border-radius: 999px; background: var(--line-2); }
  .panel-kopf { padding: 4px max(16px, var(--sar)) 10px max(16px, var(--sal)); touch-action: none; }
  .panel-titel { font-size: 20px; }
  .panel-inhalt { padding: 4px max(16px, var(--sar)) 24px max(16px, var(--sal)); }
  .werkzeuge { bottom: auto; top: 8px; left: max(8px, var(--sal)); right: max(8px, var(--sar)); transform: none; justify-content: flex-start; padding: 3px; }
  .buehne-oben { top: 62px; }
  .meldung-flaeche { top: 108px; }
  .werkzeug { min-width: 48px; padding: 4px 6px; min-height: 44px; }
  .werkzeug svg { width: 17px; height: 17px; }
  .leiste-unten { padding: 0 max(10px, var(--sar)) var(--sab) max(10px, var(--sal)); gap: 8px; }
  .preisstatus .v { font-size: var(--t-l); }
  .preisstatus .v::after { content: " inkl. MwSt."; font-size: var(--t-xs); font-weight: 500; letter-spacing: 0; color: var(--muted); }
  .preisstatus .k, .leiste-unten .preis-knopf { display: none; }
  .preisstatus .z { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .studio:has(.panel[data-zustand="offen"]) .werkzeuge { display: none; }
  .schrittanzeige, .leiste-unten .nur-gross { display: none; }
  .leiste-unten .nur-klein { display: inline; }
  .material-liste { grid-template-columns: 1fr 1fr; }
  .raster-2 { grid-template-columns: minmax(0, 1fr); }
  .schublade { top: var(--oben-h); bottom: 0; }
  .werkzeuge { right: auto; }
  .anordnung { grid-template-columns: 96px minmax(0, 1fr); gap: 10px; }
  .fortschritt { display: none; }
  /* Hinweis auf dem Kopf des Sheets (Griff und Titel – Tipps gehen hindurch): nie auf Schritt-Chips, Werkzeugleiste oder dem Modell,
     auch nicht nach einem Tipp ins Bild (oben) */
  .toast, .toast.oben { left: 50%; max-width: calc(100vw - 24px); top: calc(100dvh - var(--unten-h) - var(--sheet-h) + 6px); bottom: auto; }
  .studio.tippt ~ .toast { top: calc(var(--oben-h) + 6px); }   /* Tastatur offen: auf dem Kopf des Panels */
  /* Sheet zugezogen (64 px hoch): der Hinweis steht unten bündig auf dem Sheet – nie auf Preis und Leiste unten; ein langer reicht nach
     oben über den unteren Bildrand, nie bis zur Mitte des Modells */
  body:has(.studio:not(.tippt) .panel[data-zustand="zu"]) .toast { top: auto; bottom: calc(var(--unten-h) + 4px); }
  .buehne:has(.bereich:not([hidden])) .meldung-flaeche { top: 122px; }   /* Konflikte unter „Sie bearbeiten“ */
  /* Einstieg: Bottom Sheet an der Stelle des Auswahlbereichs, das Modell bleibt darüber sichtbar */
  .einstieg-hg { padding: max(12px, var(--sat)) max(12px, var(--sar)) max(12px, var(--sab)) max(12px, var(--sal)); }
  .einstieg { height: min(640px, 100%); }
  .einstieg-kopf { padding: 14px max(16px, var(--sar)) 4px max(16px, var(--sal)); }
  .einstieg-kopf h2 { font-size: var(--t-l); }
  .einstieg-inhalt, .einstieg-fuss, .einstieg-punkte { padding-left: max(16px, var(--sal)); padding-right: max(16px, var(--sar)); }
  .einstieg-frage { margin-bottom: 10px; }
  .einstieg-frage .text-klein { display: none; }
  .einstieg-fuss { padding-top: 8px; padding-bottom: 8px; }
  .einstieg .karten.drei { grid-template-columns: 1fr; }
  .einstieg .karten.drei .karte { flex-direction: row; }
  .einstieg .karten.drei .karte-bild { width: 84px; height: auto; border-bottom: 0; border-right: 1px solid var(--line); flex: 0 0 auto; }
}
/* Niedrige Smartphones (z. B. 320 × 568 oder 360 × 740 mit Browserleisten): das halbe Sheet zeigt mindestens zwei, drei Bedienzeilen */
@media (max-width: 820px) and (max-height: 760px) {
  body { --sheet-h: calc((100dvh - var(--oben-h) - var(--unten-h) - 58px) * .6); }
  /* Konflikt über dem Bild einzeilig wie quer: Text und Zahl der übrigen (der Lösungsknopf steht im Fenster – Tipp auf den Text – und im
     Schritt). Zweizeilig mit Knopf lag er bei 320 × 568 zum Teil unter dem halben Sheet und deckte das Modell fast ganz ab */
  .meldung-flaeche .meldung-kompakt { flex-direction: row; align-items: center; gap: 8px; padding: 0 6px 0 10px; }
  .meldung-text { display: block; white-space: nowrap; text-overflow: ellipsis; flex: 1; min-width: 0; padding: 11px 0; }
  .meldung-kompakt .hinweis-aktionen .btn { display: none; }
  /* offen nie kleiner als halb (sehr niedrige Fenster hochkant) */
  body:has(.panel[data-zustand="offen"]) { --sheet-h: max(calc((100dvh - var(--oben-h) - var(--unten-h) - 58px) * .6 + 60px), calc(100dvh - var(--oben-h) - var(--unten-h) - 58px - 100px)); }
  .panel-unter { display: none; }
}
@media (max-width: 420px) {
  .projekt-name { display: none; }
  /* kompaktere Materialkarten: eine ganze Reihe passt ins halbe Sheet (Bild flacher, Eigenschaften enger, aber ungekürzt) */
  .material-bild { height: 48px; }
  .material .eigenschaften { gap: 3px; margin-top: 4px; }
  .material .eig { padding: 1px 6px; }
}
/* 320 px: „Weiter“ unten nur als Pfeil (im Panel steht „Weiter: …“ ausgeschrieben) – Preis samt „inkl. MwSt.“ und offene Positionen bleiben lesbar */
@media (max-width: 340px) {
  .leiste-unten .btn-primaer[data-letzter="false"] > span { display: none; }
  .leiste-unten .btn-primaer[data-letzter="false"] { padding-inline: 12px; }
}

/* ---------------- Smartphone quer ---------------- */
/* Quer (auch große Smartphones mit Seitenleiste, z. B. 844 × 390): der Konflikt über dem Bild einzeilig – Text und Zahl der übrigen;
   die Lösungsknöpfe stehen im Fenster (Tipp auf den Text) und im Schritt */
@media (max-height: 500px) and (orientation: landscape) {
  /* Hinweis kompakter: wenig Höhe, er liegt auf dem Kopf des Auswahlbereichs (unten) */
  .toast { font-size: var(--t-s); padding: 8px 12px; line-height: 1.35; }
  .meldung-flaeche .meldung-kompakt { flex-direction: row; align-items: center; gap: 8px; padding: 0 6px 0 10px; }
  .meldung-text { display: block; white-space: nowrap; text-overflow: ellipsis; flex: 1; min-width: 0; padding: 11px 0; }
  .meldung-kompakt .hinweis-aktionen .btn { display: none; }
  .buehne:has(.bereich:not([hidden])) .meldung-flaeche { top: 72px; }   /* unter „Sie bearbeiten“ (Finger: 44 px hohe Auswahl) */
}
/* Kleine Handys quer (z. B. 568 × 320, 667 × 375, 812 × 375): für Bild und Bottom Sheet übereinander fehlt die Höhe. Der Auswahlbereich
   steht rechts neben dem Bild, die Schritt-Chips über ihm, die Leisten oben und unten sind flacher – kein Ziehen oder Einrasten
   (bausteine.js istSheet). Im Bild: Werkzeugleiste oben, Konflikt darunter, „Sie bearbeiten“ unten links; Hinweise auf dem Panelkopf. */
@media (max-width: 820px) and (max-height: 500px) and (orientation: landscape) {
  :root { --oben-h: calc(44px + var(--sat)); --unten-h: calc(52px + var(--sab)); --panel-b: min(360px, 52vw); --navi-h: 52px; }
  .studio { grid-template-columns: minmax(0, 1fr) var(--panel-b); grid-template-rows: var(--oben-h) var(--navi-h) minmax(0, 1fr) var(--unten-h);
    grid-template-areas: "oben oben" "buehne navi" "buehne panel" "unten unten"; }
  .navi { position: relative; top: auto; height: auto; z-index: 1; border-left: 1px solid var(--line); }
  .navi ol { padding: 4px max(8px, var(--sar)) 4px 8px; }
  .buehne { margin: 0; }
  .panel { position: relative; left: auto; right: auto; bottom: auto; height: auto; z-index: 1; border-radius: 0; border-left: 1px solid var(--line); box-shadow: none; transition: none; }
  .panel-griff { display: none; }
  .panel-kopf { padding: 6px max(14px, var(--sar)) 6px 14px; touch-action: auto; }
  .panel-titel { font-size: var(--t-l); }
  .bearbeite { margin-top: 4px; padding: 2px 10px; }
  .panel-inhalt { padding: 2px max(14px, var(--sar)) 16px 14px; }
  .studio:has(.panel[data-zustand="offen"]) .werkzeuge { display: flex; }
  .werkzeuge { top: 6px; }
  .buehne-oben { top: auto; bottom: 8px; left: max(8px, var(--sal)); right: 8px; }
  .bereich > span { display: none; }   /* „Sie bearbeiten: …“ steht im Kopf des Auswahlbereichs (einzeilig) */
  .bearbeite { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .meldung-flaeche, .buehne:has(.bereich:not([hidden])) .meldung-flaeche { top: 62px; left: max(8px, var(--sal)); right: 8px; width: auto; }
  .toast, .toast.oben { left: calc(100vw - var(--panel-b) / 2); max-width: calc(var(--panel-b) - 16px); top: calc(var(--oben-h) + var(--navi-h) + 4px); bottom: auto; }
  .toast > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }   /* einzeilig: liegt nur auf dem Panelkopf */
  /* Tastatur offen: der Auswahlbereich über allem */
  .studio.tippt .panel { position: fixed; inset: 0; height: auto; z-index: 50; }
  .studio.tippt ~ .toast { left: 50%; max-width: calc(100vw - 24px); top: 6px; }
}
/* Bildschirmtastatur auf Tablet bzw. großem Smartphone quer (Seitenleiste, shell.js tastaturModus): der Auswahlbereich reicht über die ganze Höhe */
@media (min-width: 821px) {
  .studio.tippt .panel { position: fixed; top: 0; right: 0; bottom: 0; width: var(--panel-b); z-index: 50; box-shadow: var(--sh-3); }
}
/* Querformat mit Seitenleiste bei wenig Höhe (z. B. 844 × 390): der Hinweis liegt wie bei kleinen Handys quer auf dem Kopf des
   Auswahlbereichs – nicht mitten über dem Modell, nicht auf Preis oder Leisten (auch nach einem Tipp ins Bild, .oben) */
@media (min-width: 821px) and (max-height: 500px) and (orientation: landscape) {
  .toast, .toast.oben { left: calc(100vw - var(--panel-b) / 2); max-width: calc(var(--panel-b) - 16px); top: calc(var(--oben-h) + 6px); bottom: auto; }
  .studio.tippt ~ .toast { top: 6px; }
}
/* Sehr wenig Höhe (Tastatur offen, quer): die Köpfe von Panel und Einstieg ruhen, das Feld mit Fokus hat den Platz */
@media (max-height: 300px) {
  .studio.tippt .panel-kopf, .studio.tippt .panel-griff { display: none; }
  .einstieg-hg:has(.einstieg-inhalt input:focus) { padding: 6px max(6px, var(--sar)) 6px max(6px, var(--sal)); }
  .einstieg:has(.einstieg-inhalt input:focus) :is(.einstieg-kopf, .einstieg-punkte, .einstieg-fuss) { display: none; }
}

/* ---------------- Touch: große Trefferflächen, 16-px-Felder ---------------- */
@media (pointer: coarse) {
  .btn { min-height: 44px; }
  .btn-icon { width: 44px; height: 44px; }
  .btn-klein { min-height: 44px; }
  .preisstatus { min-height: 44px; justify-content: center; }
  .chip, .extras-reiter button { min-height: 44px; padding-inline: 14px; }
  .segment button { min-height: 44px; }
  .standardmasse { gap: 8px; }
  .standardmasse button { min-height: 36px; padding: 0 12px; }
  .zahl button { width: 48px; min-height: 44px; }
  .zahl input { padding-block: 12px; }
  .schalter { min-height: 44px; }
  .schalter input { width: 46px; height: 28px; }
  .schalter input::after { top: 3px; left: 3px; width: 22px; height: 22px; }
  .schalter input:checked::after { transform: translateX(18px); }
  details.abschnitt > summary { min-height: 44px; }
  .mass-label.klickbar { padding: 10px 14px; }
  .brotkrumen { gap: 10px; }
  .varianten-wahl, .bereich select, .auswahlfeld, .eingabe, .projekt-name, textarea { font-size: 16px; }
  .varianten-wahl, .bereich select, .auswahlfeld { min-height: 44px; }
  .panel-weiter { min-height: 48px; }
  .werkzeug-menue button { min-height: 44px; }
}

@media (pointer: coarse) and (max-width: 1080px) { .leiste-oben .rueckruf { width: 44px; height: 44px; } }

/* ---------------- Maus: Hover nur, wo es Hover gibt ---------------- */
@media (hover: hover) and (pointer: fine) {
  .btn-primaer:hover:not(:disabled) { background: var(--rot-d); }
  .btn-sekundaer:hover:not(:disabled) { border-color: var(--ink); }
  .btn-text:hover { color: var(--ink); background: var(--surface-2); }
  .leiste-oben .btn-text:hover, .leiste-oben .btn-icon:hover:not(:disabled) { color: #fff; background: rgba(255, 255, 255, .08); }
  .leiste-oben .rueckruf:hover { background: var(--rot); border-color: var(--rot); }
  .projekt-name:hover { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .06); }
  .modus button[aria-pressed="false"]:hover { color: #fff; }
  .navi-punkt:hover { background: var(--surface-2); }
  .mass-label.klickbar:hover { border-color: var(--rot); color: var(--rot-d); }
  .werkzeug:hover { background: var(--surface-2); color: var(--ink); }
  .brotkrumen button:hover { color: var(--ink); text-decoration: underline; }
  .karte:hover:not(.gesperrt), .material:hover, .chip:hover:not(:disabled), .extra-karte:hover { border-color: var(--ink); }
  .zahl button:hover { background: var(--surface-3); }
  .standardmasse button:hover { border-color: var(--ink); color: var(--ink); }
  .preisstatus:hover { background: var(--surface-2); }
  button.link:hover { text-decoration: underline; }
  .werkzeug-menue button:hover { background: var(--surface-2); }
  .telefon-gross:hover { background: var(--surface-3); }
  .segment button:hover:not([aria-pressed="true"]):not(:disabled) { color: var(--ink); }
}

/* ---------------- Druckfeedback auf jedem Gerät ---------------- */
.btn:active:not(:disabled), .chip:active:not(:disabled), .werkzeug:active, .segment button:active:not(:disabled), .extras-reiter button:active, .standardmasse button:active,
.zahl button:active, .farbfeld:active { transform: scale(.96); }
.karte:active:not(.gesperrt), .material:active, .navi-punkt:active, .extra-karte:active, .preisstatus:active { transform: scale(.985); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .001ms !important; transition-delay: 0s !important; animation-duration: .001ms !important; animation-delay: 0s !important; }
  .spinner { animation: dreh 1.6s linear infinite !important; }
}
