/* Hallmark · redesign (app-scope, kein Marketing-Macrostructure) · genre: modern-minimal
 * tone: soft-premium · anchor: tenant-accent (variabel, siehe :root-Override in index.ejs)
 * ============================================================
   DACH Terrassen Systeme – 3D-Konfigurator
   Standalone Fullscreen-App. Desktop-first, tauglich auf
   Tablet/Laptop, vereinfacht (aber stabil) auf dem Handy.

   REDESIGN-LEITPLANKEN (Sept. 2026)
   ------------------------------------------------------------
   Die Akzentfarbe kommt pro Tenant aus der DB (--accent, siehe
   index.ejs) und kann JEDE Farbe sein – nicht nur Gold. Deshalb:
   - Neutrale Flaechen bleiben hue-neutral (kaum Chroma), nie auf
     "warmes Gold" gestimmt. Die einzige Farbe im System ist --accent.
   - --accent ist ein SIGNAL, keine Flaeche: aktiver Zustand, ein CTA
     pro Bildschirm, Fokusring. Nicht mehr "Gradient ueber die ganze
     Topbar" oder "jede Karte kriegt eine goldene Kante".
   - Getoente Zustaende (aktiv/hover) laufen ueber color-mix() mit der
     ECHTEN Tenant-Farbe – vorher stand hier ein hart codiertes
     Creme (#fff8ec), das bei einem nicht-goldenen Tenant nicht mehr
     zur eigenen Akzentfarbe passte.
   - Karten/Kacheln/Chips haben im Ruhezustand KEINEN Rahmen mehr
     (nur dezenter Hover-Tint) – vorher hatte JEDES Element immer
     einen Rahmen, aktiv oder nicht. Das war die "alles eingerahmt"-
     Unruhe, die die Seitenleiste unruhig wirken liess.
   ============================================================ */

/* ---------- Fonts (selbst gehostet, gleiche Dateien wie Marketing/Backend –
   selber Origin, kein Zusatzrequest, DSGVO-konform). Nur latin + latin-ext,
   analog tokens.css. DM Sans traegt den Fliesstext; DM Serif Display ist der
   Ausreisser (2+1-Regel) fuer genau zwei Rollen: Marken-Wortmarke in der
   Topbar und den grossen Produktnamen im Modell-Feld/der Sumbar. */
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(/fonts/dmsans-latin-ext.woff2) format('woff2');
  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;
}
@font-face {
  font-family: 'DM Sans'; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(/fonts/dmsans-latin.woff2) format('woff2');
  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: 'DM Serif Display'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/dmserifdisplay-latin-ext.woff2) format('woff2');
  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;
}
@font-face {
  font-family: 'DM Serif Display'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(/fonts/dmserifdisplay-latin.woff2) format('woff2');
  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;
}

:root {
  /* ---- Neutrale Flaechen (fast chromafrei, funktioniert mit jeder --accent) ---- */
  --paper:    #FDFCFA;   /* Panel-, Karten-, Eingabeflaechen */
  --stone:    #F6F4F0;   /* App-Untergrund, Hover-Flaeche */
  --stone-2:  #EBE8E1;   /* tiefer abgesetzt: Slider-Bahn, Trennlinien-Fuellung */
  --ink:      #201E1A;
  --ink-soft: #4A473F;
  --muted:    #75705F;
  --line:     #E7E2D8;   /* Haarlinie */
  --line-2:   #D3CCBB;   /* kraeftigere Kante (Hover/Fokus-Nachbarschaft) */

  /* ---- Akzent: kommt vom Tenant, hier nur der Fallback (Cwik-Demo-Gold).
     index.ejs ueberschreibt --accent + --accent-grad-* je Tenant. */
  --accent:        #C08C28;
  --accent-grad-1: #C08C28;
  --accent-grad-2: #CB982F;
  --accent-grad-3: #E3B04B;
  --accent-ink:    #fff;   /* Text auf Flaechen in --accent */

  /* Getoente Ableitungen. Erste Deklaration ist der Fallback fuer Browser
     ohne color-mix() – zweite gewinnt ueberall sonst (siehe Kommentar oben). */
  --accent-wash:        var(--stone);
  --accent-wash:        color-mix(in oklch, var(--accent) 9%, var(--paper));
  --accent-wash-strong: var(--stone-2);
  --accent-wash-strong: color-mix(in oklch, var(--accent) 16%, var(--paper));
  --accent-ring:        rgba(192, 140, 40, 0.35);
  --accent-ring:        color-mix(in oklch, var(--accent) 40%, transparent);
  --accent-hover:       var(--accent);
  --accent-hover:       color-mix(in oklch, var(--accent) 84%, black);

  /* ---- Typografie ---- */
  --font-body: 'DM Sans', system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: 'DM Serif Display', Georgia, serif;
  --text-2xs: 0.6875rem;  /* 11px */
  --text-xs:  0.75rem;    /* 12px */
  --text-sm:  0.8125rem;  /* 13px */
  --text-md:  0.9375rem;  /* 15px – Standardgroesse fuer Optionen/Labels */
  --text-lg:  1.0625rem;  /* 17px */
  --text-xl:  1.375rem;   /* 22px */
  --text-2xl: 1.75rem;    /* 28px – Wortmarke/Produktname (Serif) */

  /* ---- Abstands-Skala (4pt-Basis, App-tauglich verkuerzt) ---- */
  --space-3xs: 0.125rem;
  --space-2xs: 0.25rem;
  --space-xs:  0.5rem;
  --space-sm:  0.75rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;

  /* ---- Radien ---- */
  --radius-sm:   8px;    /* Chips, Eingabefelder */
  --radius:      12px;   /* Karten, Popover */
  --radius-lg:   18px;   /* Panel-Bogen, Sheets */
  --radius-pill: 999px;  /* Badges, Stepper-Kreise, HUD */
  --radius-btn:  10px;   /* Buttons – bewusst KEINE volle Pille mehr */

  /* ---- Schatten: ein Whisper- und ein Hairline-Schatten, sonst nichts.
     Vorher standen hier 12px/34px-Schatten auf fast jeder Flaeche – das
     macht Papier schwer. Schatten bleiben den wirklich schwebenden
     Elementen vorbehalten (HUD, Popover, Sumbar, mobiles Blatt). */
  --shadow-sm: 0 1px 2px rgba(32, 30, 26, 0.06), 0 1px 1px rgba(32, 30, 26, 0.04);
  --shadow-md: 0 10px 28px rgba(32, 30, 26, 0.12);

  /* ---- Bewegung ---- */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in:  cubic-bezier(0.7, 0, 0.84, 0);
  --dur-micro: 120ms;
  --dur-short: 200ms;
  --dur-long:  320ms;

  /* ---- Ebenen (App-eigene Werte statt generischer 6er-Skala: dieses
     UI braucht Popover/Sheet-Feingranularitaet, die eine Marketing-
     Seite nicht hat). ---- */
  --z-panel:   10;
  --z-topbar:  20;
  --z-popover: 30;
  --z-sheet-backdrop: 50;
  --z-sheet:   60;
  --z-tooltip: 70;

  --panel-w: 376px;
  --topbar-h: 62px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  overflow-x: clip;
  max-width: 100%;
}

body.k3-body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font: inherit; cursor: pointer; color: inherit; }
a { color: inherit; }

:focus-visible { outline: none; }

/* ---------- App-Grid ---------- */
.k3-app {
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-columns: minmax(0, 1fr);
  height: 100dvh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* ---------- Topbar ----------
   War eine volle Gold-Gradient-Flaeche mit weisser Schrift – bei jeder
   Tenant-Farbe kraeftig, unabhaengig davon, ob sie zur Marke passt. Jetzt
   eine ruhige Papierleiste; die Akzentfarbe lebt nur noch im Schritt-
   Indikator, nicht mehr auf der ganzen Flaeche. */
.k3-topbar {
  display: flex;
  align-items: stretch;
  gap: var(--space-xs);
  background: var(--paper);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  padding-left: var(--space-md);
  z-index: var(--z-topbar);
  min-width: 0;
  max-width: 100%;
}

.k3-brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  text-decoration: none;
  color: var(--ink);
  padding-right: var(--space-sm);
  flex: 0 0 auto;
}
.k3-brand img { height: 30px; width: auto; display: block; }
.k3-brand b { font-family: var(--font-display); font-weight: 400; font-size: var(--text-lg); letter-spacing: -0.005em; }
.k3-brand span { font-size: var(--text-xs); color: var(--muted); font-weight: 500; }
.k3-brand-txt { display: flex; flex-direction: column; line-height: 1.15; }

/* ---------- Schritt-Indikator ----------
   Nummerierte Kreise statt bunter Text-Pills: der Kreis traegt die Farbe
   (Umriss -> gefuellt bei erledigt/aktiv), das Label bleibt neutral. Das
   liest sich als Fortschritt, nicht als drei gleich laute Tabs. */
.k3-tabs {
  display: flex;
  align-items: stretch;
  gap: var(--space-2xs);
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.k3-tabs::-webkit-scrollbar { display: none; }

.k3-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  background: transparent;
  border: none;
  color: var(--muted);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 0 var(--space-md);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.k3-tab .k3-tab-ico { width: 17px; height: 17px; opacity: 0.85; }
.k3-tab .k3-tab-num {
  display: none;
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line-2);
  background: var(--paper); color: var(--muted);
  font-size: var(--text-2xs); font-weight: 700; font-variant-numeric: tabular-nums;
  align-items: center; justify-content: center;
  transition: background var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.k3-tab:hover { color: var(--ink-soft); }
.k3-tab:focus-visible { color: var(--ink); box-shadow: inset 0 0 0 2px var(--accent-ring); border-radius: 6px; }
.k3-tab.is-active { color: var(--ink); border-bottom-color: var(--accent); }
.k3-tab.is-active .k3-tab-ico { opacity: 1; }
.k3-tab.is-done { color: var(--ink-soft); }

.k3-topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  padding: 0 var(--space-sm);
  flex: 0 0 auto;
}
.k3-lang { position: relative; }
.k3-lang-btn {
  display: inline-flex; align-items: center; gap: 0.3rem;
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  border-radius: var(--radius-pill); padding: 0.32rem 0.6rem; font-weight: 700; font-size: var(--text-xs);
  transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}
.k3-lang-btn:hover { background: var(--stone); border-color: var(--line-2); }
.k3-lang-btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-lang-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--paper); color: var(--ink); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); border: 1px solid var(--line); overflow: hidden;
  min-width: 88px; display: none; z-index: var(--z-popover);
}
.k3-lang.is-open .k3-lang-menu { display: block; }
.k3-lang-menu a { display: block; padding: 0.5rem 0.8rem; text-decoration: none; font-weight: 600; font-size: var(--text-sm); }
.k3-lang-menu a:hover, .k3-lang-menu a.is-active { background: var(--stone); color: var(--accent); }

.k3-exit {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  background: transparent; border: 1px solid var(--line); color: var(--ink-soft);
  border-radius: var(--radius-pill); padding: 0.4rem 0.8rem; font-weight: 700; font-size: var(--text-xs);
  text-decoration: none; transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}
.k3-exit:hover { background: var(--stone); border-color: var(--line-2); }
.k3-exit:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-exit svg { width: 15px; height: 15px; }

/* ---------- Main split ---------- */
.k3-main {
  display: grid;
  grid-template-columns: var(--panel-w) minmax(0, 1fr);
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

/* ---------- Panel ---------- */
.k3-panel {
  background: var(--paper);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  z-index: var(--z-panel);
}
.k3-panel-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: var(--space-lg) var(--space-lg) var(--space-xl);
}
.k3-tabpanel { display: none; }
.k3-tabpanel.is-active { display: block; animation: k3fade var(--dur-long) var(--ease-out); }
@keyframes k3fade { from { opacity: 0; } to { opacity: 1; } }

.k3-group { margin-bottom: var(--space-xl); }
.k3-group:last-child { margin-bottom: var(--space-sm); }
.k3-group > h2 {
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--space-sm);
}

.k3-panel-lead { color: var(--muted); font-size: var(--text-sm); margin-bottom: var(--space-lg); }

/* Product chips */
.k3-chips { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); }
.k3-chip {
  border: 1px solid transparent; background: var(--stone); border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-sm); font-size: var(--text-sm); font-weight: 600; text-align: left;
  transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
  color: var(--ink-soft);
}
.k3-chip:hover { background: var(--stone-2); }
.k3-chip:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-chip.is-active { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); }

/* Option cards (mount / roof / …) – Ruhezustand ohne Rahmen, nur Flaeche;
   der Rahmen erscheint erst, wenn etwas ausgewaehlt ist. Das nimmt der
   Liste die "jedes Feld ist eine eigene Box"-Unruhe. */
.k3-cards { display: grid; gap: var(--space-xs); }
.k3-card {
  display: grid; grid-template-columns: 38px 1fr; gap: var(--space-sm); align-items: center;
  border: 1px solid transparent; background: var(--stone); border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md); text-align: left;
  transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}
.k3-card:hover { background: var(--stone-2); }
.k3-card:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-card.is-active { border-color: var(--accent); background: var(--accent-wash); }
.k3-card:disabled { opacity: 0.4; cursor: not-allowed; }
/* Icon-Badge: direkt auf dem <svg> ueber Padding + Hintergrund erzeugt –
   kein zusaetzliches Markup noetig. Neutral in Ruhe, akzentfarben aktiv. */
.k3-card .k3-card-ico {
  width: 38px; height: 38px; box-sizing: border-box; padding: 8px; border-radius: var(--radius-sm);
  background: var(--stone-2); color: var(--ink-soft);
  transition: background var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.k3-card.is-active .k3-card-ico { background: var(--accent-wash-strong); color: var(--accent); }
.k3-card strong { display: block; font-size: var(--text-md); font-weight: 600; }
.k3-card span { display: block; font-size: var(--text-xs); color: var(--muted); margin-top: 0.1rem; }
/* Kurze Werte (Torbreiten) als Chips im Raster: eine Zahl braucht kein
   Symbol und keine Unterzeile. */
.k3-cards-chips { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.k3-card-chip {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 44px; padding: 0.45rem 0.4rem; text-align: center; border-radius: var(--radius-sm);
}
.k3-card-chip strong { font-size: var(--text-sm); font-variant-numeric: tabular-nums; }
.k3-card-chip span { font-size: var(--text-2xs); margin-top: 0; line-height: 1.2; }

/* Material tiles (Art der Hauswand) */
.k3-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); }
.k3-tile {
  display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0;
  border: 1px solid transparent; background: var(--stone); border-radius: var(--radius);
  padding: var(--space-xs) var(--space-xs) var(--space-sm); text-align: left;
  transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}
.k3-tile:hover { background: var(--stone-2); }
.k3-tile:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-tile.is-active { border-color: var(--accent); background: var(--accent-wash); }
.k3-tile-img {
  display: block; width: 100%; aspect-ratio: 16 / 10; border-radius: 7px;
  background: var(--stone-2) center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.10);
}
.k3-tile-lbl { font-size: var(--text-sm); font-weight: 600; line-height: 1.25; color: var(--ink-soft); }
.k3-tile.is-active .k3-tile-lbl { color: var(--ink); }

/* Ihr Haus im Bild: zugeklapptes Extra am Ende von Schritt 2.
   Gestrichelt und ohne Akzentfarbe – es gehoert nicht zum Angebot. */
.k3-extra { border: 1px dashed var(--line); border-radius: var(--radius); padding: 0.55rem 0.8rem; margin: var(--space-md) 0 var(--space-lg); }
.k3-extra[hidden] { display: none; }
.k3-extra summary { list-style: none; display: flex; align-items: center; gap: 0.65rem; cursor: pointer; min-height: 40px; }
.k3-extra summary::-webkit-details-marker { display: none; }
.k3-extra summary::after { content: "+"; margin-left: 0.2rem; font-size: 1.1rem; font-weight: 600; color: var(--muted); line-height: 1; }
.k3-extra[open] summary::after { content: "–"; }
.k3-extra[open] summary { margin-bottom: 0.4rem; }
.k3-extra-ico { width: 28px; height: 21px; flex: 0 0 auto; fill: none; stroke: var(--muted); stroke-width: 1.7; stroke-linejoin: round; stroke-linecap: round; }
.k3-extra-txt { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.k3-extra-txt strong { font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); }
.k3-extra-txt span { font-size: var(--text-xs); color: var(--muted); }
.k3-extra-tag { font-size: var(--text-xs); color: var(--muted); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 0.1rem 0.5rem; }
.k3-extra .k3-subhead:first-of-type { margin-top: 0.2rem; }

/* Dachform des Hauses: drei kleine Schalter mit Silhouette */
.k3-house { grid-template-columns: repeat(3, 1fr); }
.k3-house .k3-chip {
  display: flex; flex-direction: column; align-items: center; gap: 0.2rem;
  padding: 0.5rem 0.3rem 0.45rem; text-align: center; font-size: var(--text-xs);
}
.k3-house svg {
  width: 34px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linejoin: round; stroke-linecap: round; opacity: 0.7;
}
.k3-house .k3-chip.is-active svg { opacity: 1; color: var(--accent); }

/* Unter-Einstellung eines Zubehoer-Chips (z. B. Anzahl LED-Spots) */
.k3-acc-sub {
  border-left: 2px solid var(--accent);
  padding: var(--space-3xs) var(--space-3xs) var(--space-3xs) var(--space-md);
  margin: -0.1rem 0 var(--space-2xs) var(--space-2xs);
}
.k3-acc-sub .k3-dim-val input { width: 62px; }

/* Zahl-Stepper mit großen, gut klickbaren +/- Tasten (touch-freundlich) */
.k3-stepper { display: inline-flex; align-items: center; gap: var(--space-xs); }
.k3-stepper input {
  width: 48px; text-align: center; font: inherit; font-weight: 700; color: var(--accent);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.3rem 0.2rem;
  -moz-appearance: textfield; appearance: textfield; background: var(--paper);
}
.k3-stepper input::-webkit-outer-spin-button,
.k3-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.k3-step-btn {
  width: 38px; height: 38px; flex: 0 0 auto; border-radius: var(--radius-sm);
  border: none; background: var(--accent-wash-strong); color: var(--accent);
  font-size: 1.4rem; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.k3-step-btn:hover { background: var(--accent); color: var(--accent-ink); }
.k3-step-btn:active { transform: scale(0.96); }
.k3-step-btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-step-btn:disabled { opacity: 0.4; cursor: default; }

/* Colour swatches */
.k3-swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-xs); }
.k3-swatch {
  border: 1px solid transparent; background: var(--stone); border-radius: var(--radius-sm);
  padding: var(--space-2xs); display: flex; flex-direction: column; align-items: center; gap: var(--space-2xs);
  font-size: var(--text-2xs); color: var(--muted); font-weight: 600; text-align: center;
  transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}
.k3-swatch:hover { background: var(--stone-2); }
.k3-swatch:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-swatch .sw { width: 100%; height: 26px; border-radius: 6px; background: var(--sw, #ccc); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.k3-swatch .sw-multi { background: conic-gradient(from 210deg, #6b8e23, #b8860b, #2f4f4f, #8b0000, #6b8e23); }
.k3-swatch.is-active { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); }

/* Dimension sliders */
.k3-dim-row { margin-bottom: var(--space-md); }
.k3-dim-row:last-child { margin-bottom: 0; }
.k3-dim-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: var(--space-2xs); }
.k3-dim-head label { font-size: var(--text-sm); font-weight: 600; }
.k3-dim-val { font-variant-numeric: tabular-nums; }
.k3-dim-val input {
  width: 74px; text-align: right; font: inherit; font-weight: 700; color: var(--accent);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.25rem 0.4rem; background: var(--paper);
  /* Ohne die Browser-Pfeile: verstellt wird mit dem Regler oder per Eingabe */
  -moz-appearance: textfield; appearance: textfield;
}
.k3-dim-val input::-webkit-outer-spin-button,
.k3-dim-val input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.k3-dim-val input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-dim-unit { color: var(--muted); font-size: var(--text-xs); margin-left: 0.2rem; }
input[type="range"].k3-range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent) var(--fill, 40%), var(--stone-2) var(--fill, 40%));
  outline: none;
}
input[type="range"].k3-range::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--paper); border: 2.5px solid var(--accent); box-shadow: var(--shadow-sm); cursor: pointer;
  transition: transform var(--dur-micro) var(--ease-out);
}
input[type="range"].k3-range:active::-webkit-slider-thumb { transform: scale(1.12); }
input[type="range"].k3-range::-moz-range-thumb {
  width: 18px; height: 18px; border-radius: 50%; background: var(--paper); border: 2.5px solid var(--accent); cursor: pointer;
}
input[type="range"].k3-range:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); border-radius: 999px; }

/* Accessory chips – im Ruhezustand ohne Rahmen (nur Flaeche), wie die
   Karten oben; erst bei Auswahl wird die Akzentfarbe sichtbar. */
.k3-acc { display: grid; gap: var(--space-2xs); }
.k3-acc-chip {
  display: flex; align-items: center; gap: var(--space-sm); border: 1px solid transparent;
  background: var(--stone); border-radius: var(--radius-sm); padding: var(--space-sm) var(--space-md);
  font-size: var(--text-md); font-weight: 600;
  transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}
.k3-acc-chip:hover { background: var(--stone-2); }
.k3-acc-chip:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-acc-chip.is-active { border-color: var(--accent); background: var(--accent-wash); }
.k3-acc-chip input { width: 18px; height: 18px; accent-color: var(--accent); }

/* Fields */
.k3-field { display: block; margin-bottom: var(--space-md); }
.k3-field > span { display: block; font-size: var(--text-xs); font-weight: 600; margin-bottom: var(--space-2xs); color: var(--ink-soft); }
.k3-field input[type="text"],
.k3-field input[type="email"],
.k3-field input[type="tel"],
.k3-field textarea {
  width: 100%; font: inherit; font-size: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.6rem 0.7rem; background: var(--paper); color: var(--ink); resize: vertical;
}
.k3-field input:focus-visible, .k3-field textarea:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-note { font-size: var(--text-xs); color: var(--muted); margin-top: var(--space-2xs); }
.k3-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.k3-check { display: flex; gap: var(--space-xs); align-items: flex-start; font-size: var(--text-sm); margin: var(--space-xs) 0 var(--space-md); }
.k3-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); flex: 0 0 auto; }
.k3-check a { color: var(--accent); font-weight: 600; }

/* Photos */
.k3-photo-btn {
  display: inline-flex; align-items: center; gap: var(--space-xs); border: 1px dashed var(--line-2);
  background: var(--stone); border-radius: var(--radius-sm); padding: 0.7rem 1rem; font-weight: 600; color: var(--ink-soft);
  transition: border-color var(--dur-short) var(--ease-out), background var(--dur-short) var(--ease-out);
}
.k3-photo-btn:hover { border-color: var(--accent); background: var(--accent-wash); }
.k3-photo-btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: var(--space-xs); margin-top: var(--space-md); }
.k3-thumb { position: relative; aspect-ratio: 1; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow-sm); }
.k3-thumb img { width: 100%; height: 100%; object-fit: cover; }
.k3-thumb button { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: rgba(20,18,14,0.62); color: #fff; border: none; font-size: 1rem; line-height: 1; display: flex; align-items: center; justify-content: center; }

/* Summary list (request tab) */
.k3-sum { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: var(--space-lg); }
.k3-sum div { display: flex; justify-content: space-between; gap: var(--space-md); padding: 0.55rem 0.85rem; font-size: var(--text-sm); }
.k3-sum div:nth-child(odd) { background: var(--stone); }
.k3-sum dt { color: var(--muted); }
.k3-sum dd { font-weight: 700; text-align: right; }

/* Panel nav */
.k3-panel-nav {
  flex: 0 0 auto; display: flex; gap: var(--space-sm); padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--line); background: var(--paper);
}
/* "Powered by" als leise Fusszeile unter den Knoepfen – Teil des Panels,
   nicht der Buehne. Die Leiste darueber rueckt dafuer unten etwas zusammen. */
.k3-panel-nav:has(+ .k3-credit) { padding-bottom: var(--space-xs); }
.k3-credit {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center; gap: 0.35rem;
  padding: 0 var(--space-lg) var(--space-sm); background: var(--paper);
  font-size: 0.68rem; letter-spacing: 0.02em; color: var(--muted); text-decoration: none;
  transition: color var(--dur-short) var(--ease-out);
}
.k3-credit b { font-weight: 700; color: var(--ink-soft); transition: color var(--dur-short) var(--ease-out); }
.k3-credit svg { opacity: 0.7; }
.k3-credit:hover, .k3-credit:hover b { color: var(--ink); }
.k3-credit:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.k3-status { padding: 0 var(--space-lg) var(--space-md); font-size: var(--text-sm); }
.k3-status.is-err { color: #a1341f; }
.k3-status.is-ok { color: #2f7d4f; }

/* ---------- Buttons ----------
   Kein voller Pillenbutton mehr fuer die Primaeraktion (das las sich
   zusammen mit dem Gradient wie 2019er-SaaS) – ein ruhiges, abgerundetes
   Rechteck in Volltonfarbe. Pillenform bleibt Chips/Badges vorbehalten. */
.k3-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs);
  border: none; border-radius: var(--radius-btn); padding: 0.72rem 1.15rem; font-weight: 700; font-size: var(--text-md);
  transition: background var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-short) var(--ease-out);
}
.k3-btn:active { transform: translateY(1px); }
.k3-btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-btn-gold { background: var(--accent); color: var(--accent-ink); }
.k3-btn-gold:hover { background: var(--accent-hover); }
.k3-btn-gold:disabled { opacity: 0.55; cursor: default; }
.k3-btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.k3-btn-ghost:hover { background: var(--stone); border-color: var(--line-2); }
.k3-btn-block { width: 100%; }
.k3-flex-grow { flex: 1 1 auto; }
/* Zweiter Anfrage-Knopf in der Navigationsleiste: nur mobil, am Desktop
   sitzt der Knopf in der Zusammenfassung auf der Bühne. */
.k3-nav-request { display: none; }

/* ---------- Stage (3D) ---------- */
.k3-stage { position: relative; min-height: 0; min-width: 0; overflow: hidden; background: linear-gradient(#bcd3e6, #e9eef2); }
#k3Canvas { display: block; width: 100%; height: 100%; touch-action: none; }

.k3-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: var(--space-sm);
  background: linear-gradient(#bcd3e6, #e9eef2); color: var(--ink-soft); font-weight: 600; z-index: 5;
}
.k3-spinner { width: 40px; height: 40px; border-radius: 50%; border: 3.5px solid rgba(255,255,255,0.5); border-top-color: var(--accent); animation: k3spin 0.85s linear infinite; }
@keyframes k3spin { to { transform: rotate(360deg); } }

/* Dimension labels overlay */
.k3-dims { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.k3-dim {
  position: absolute; transform: translate(-50%, -50%); white-space: nowrap;
  background: rgba(24,22,18,0.82); color: #fff; font-size: var(--text-xs); font-weight: 700;
  padding: 0.12rem 0.42rem; border-radius: 6px; font-variant-numeric: tabular-nums;
  box-shadow: var(--shadow-sm); will-change: left, top;
}

/* HUD */
.k3-hud { position: absolute; top: var(--space-md); right: var(--space-md); display: flex; flex-direction: column; gap: var(--space-xs); align-items: flex-end; z-index: 6; }
.k3-hud-row { display: flex; gap: var(--space-3xs); background: rgba(253,252,250,0.92); border-radius: var(--radius-pill); padding: var(--space-3xs); box-shadow: var(--shadow-sm); backdrop-filter: blur(6px); }
.k3-hud-btn {
  width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; color: var(--ink-soft);
  display: flex; align-items: center; justify-content: center;
  transition: background var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out);
}
.k3-hud-btn svg { width: 18px; height: 18px; }
.k3-hud-btn:hover { background: var(--stone); }
.k3-hud-btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-hud-btn.is-active { background: var(--accent); color: var(--accent-ink); }

/* Kurzer Aufmerksamkeits-Impuls auf die Tag/Nacht-Umschaltung – z. B. wenn beim
   ersten Aktivieren der LED-Beleuchtung automatisch auf Nacht gewechselt wird.
   So sehen (auch unerfahrene) Nutzer, wo sich die Ansicht umstellen lässt. */
@keyframes k3attention {
  0%   { box-shadow: 0 0 0 0 var(--accent-ring), var(--shadow-sm); }
  70%  { box-shadow: 0 0 0 15px rgba(0,0,0,0), var(--shadow-sm); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0), var(--shadow-sm); }
}
.k3-hud-row.k3-attention { animation: k3attention 1.15s var(--ease-out) 3; }
.k3-hud-row.k3-attention .k3-hud-btn.is-active { animation: k3attentionBtn 1.15s var(--ease-out) 3; }
@keyframes k3attentionBtn {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .k3-hud-row.k3-attention { animation: none; box-shadow: 0 0 0 3px var(--accent-ring), var(--shadow-sm); }
  .k3-hud-row.k3-attention .k3-hud-btn.is-active { animation: none; }
}

.k3-busy { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: rgba(233,238,242,.45); backdrop-filter: grayscale(1) blur(1px); opacity: 0; pointer-events: none; transition: opacity .15s; }
.k3-busy.is-on { opacity: 1; transition-delay: .12s; }
.k3-spin { width: 38px; height: 38px; border-radius: 50%; border: 3px solid rgba(0,0,0,.15); border-top-color: #1d1d1d; animation: k3spin .8s linear infinite; }
@keyframes k3spin { to { transform: rotate(360deg); } }
/* Bedienhinweis mitten auf der Buehne: er steht nur bis zur ersten
   Bedienung bzw. 8 s (configurator3d.js, hideHint) – am unteren Rand lag
   er halb unter der Preisleiste und fiel niemandem auf. */
.k3-hint {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: rgba(24,22,18,0.78); color: #fff; font-size: var(--text-sm); font-weight: 500;
  padding: 0.6rem 1.1rem; border-radius: var(--radius-pill);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18); backdrop-filter: blur(6px);
  display: flex; align-items: center; gap: var(--space-2xs); z-index: 6; opacity: 1; transition: opacity 0.6s; pointer-events: none;
}
.k3-hint.is-hidden { opacity: 0; }
.k3-hint { width: max-content; max-width: calc(100% - 2 * var(--space-md)); text-align: center; }

/* ---------- Pitch-Tour (nur Demo der Startseite) ----------
   Standbild fuer die Ueberblendung: liegt ueber Szene und Maßen, unter
   HUD und Leiste. Es erscheint sofort und verschwindet weich. */
.k3-tour-fade { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 5; pointer-events: none; opacity: 0; }
.k3-tour-fade.is-on { opacity: 1; }
.k3-tour-fade.is-fading { transition: opacity .9s var(--ease-out); }
.k3-touring .k3-hint { opacity: 0; }

.k3-tour-cap {
  position: absolute; left: var(--space-md); bottom: 5.4rem; z-index: 6; max-width: min(30rem, calc(100% - 2 * var(--space-md)));
  display: flex; flex-direction: column; gap: 0.2rem;
  background: rgba(24,22,18,0.8); color: #fff; border-radius: var(--radius-lg); padding: 0.75rem 1rem 0.7rem;
  box-shadow: var(--shadow-md); backdrop-filter: blur(6px); pointer-events: none;
  opacity: 0; transform: translateY(8px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
}
.k3-tour-cap.is-on { opacity: 1; transform: none; }
.k3-tour-label { font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-grad-3); }
.k3-tour-label:empty { display: none; }
.k3-tour-text { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.25; }
.k3-tour-take { font-size: 0.72rem; opacity: 0.62; margin-top: 0.25rem; }
/* Auf dem Handy verdeckt die Einblendung das Modell – dort gar nicht zeigen. */
@media (max-width: 720px), (pointer: coarse) { .k3-tour-cap { display: none; } }

.k3-hud-btn.k3-hud-pill { width: auto; padding: 0 0.85rem 0 0.7rem; gap: 0.4rem; border-radius: var(--radius-pill); font-size: var(--text-xs); font-weight: 600; color: var(--ink); }
.k3-hud-btn.k3-hud-pill svg { width: 14px; height: 14px; }

/* Bedienelement, das die Tour gerade benutzt, leuchtet kurz auf. */
@keyframes k3tourPulse {
  0%   { box-shadow: 0 0 0 0 var(--accent-ring); }
  60%  { box-shadow: 0 0 0 10px rgba(0,0,0,0); }
  100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); }
}
.k3-tour-pulse { animation: k3tourPulse 1.3s var(--ease-out) 2; }
.k3-hint svg { width: 18px; height: 18px; flex: none; }

/* Summary bar (bottom overlay) */
.k3-sumbar {
  position: absolute; left: var(--space-md); right: var(--space-md); bottom: var(--space-md); z-index: 6;
  display: flex; align-items: center; gap: var(--space-md); flex-wrap: wrap;
  background: rgba(253,252,250,0.95); border-radius: var(--radius-lg); padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-md); backdrop-filter: blur(8px);
}
.k3-sumbar-info { display: flex; align-items: center; gap: var(--space-sm); flex: 1 1 auto; min-width: 0; flex-wrap: wrap; }
.k3-sumbar-info .k3-sb {
  display: inline-flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-sm); color: var(--ink-soft); white-space: nowrap;
}
.k3-sumbar-info .k3-sb b { font-weight: 700; font-family: var(--font-display); font-size: var(--text-lg); color: var(--ink); }
.k3-sb-dot { width: 14px; height: 14px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.15); }
.k3-sumbar .k3-btn { flex: 0 0 auto; }
/* Mit Richtpreis: eine Zeile – Angaben links (duerfen umbrechen), Preis
   und Anfrage rechts. Sonst rutschte die Schaltflaeche in eine zweite Zeile. */
.k3-sumbar:has(.k3-sumbar-preis:not([hidden])) { flex-wrap: nowrap; }
.k3-sumbar:has(.k3-sumbar-preis:not([hidden])) .k3-sumbar-info { flex: 1 1 0; }

/* ---------- Richtpreis ----------
   Drei Stellen, ein Ton: eine Schaetzung, kein Preisschild. Der Betrag
   steht gross, das Wort „unverbindlich“ steht immer direkt daneben –
   nie ein Warenkorb, nie „jetzt kaufen“. */
.k3-sumbar-preis {
  display: grid; grid-template-columns: auto; justify-items: end; gap: 0.05rem;
  padding: 0 var(--space-xs) 0 var(--space-md); border-left: 1px solid var(--line);
  font-variant-numeric: tabular-nums; line-height: 1.15;
}
.k3-sumbar-preis[hidden] { display: none; }
.k3-sumbar-preis-lbl, .k3-panel-preis-lbl {
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.k3-sumbar-preis-wert { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; color: var(--ink); white-space: nowrap; }
.k3-sumbar-preis-hint, .k3-panel-preis-hint { font-size: var(--text-2xs); color: var(--muted); white-space: nowrap; }
/* Mit Positionen auf Anfrage wird der Hinweis lang: dann umbrechen statt
   die Schaltflaeche aus der Leiste zu schieben. */
.k3-sumbar-preis-hint { white-space: normal; max-width: 13.5rem; text-align: right; line-height: 1.3; }
.k3-sumbar-preis.is-anfrage .k3-sumbar-preis-wert { font-size: var(--text-lg); }

/* Handy: Zeile ueber den Schaltflaechen (die Leiste unter dem Bild fehlt dort) */
.k3-panel-preis { display: none; }

.k3-preis {
  border: 1px solid var(--line); border-radius: var(--radius); padding: var(--space-md) var(--space-md) var(--space-sm);
  background: linear-gradient(180deg, var(--accent-wash), var(--paper) 70%);
}
.k3-preis[hidden] { display: none; }
.k3-preis h2 { margin-bottom: 0.15rem; }
.k3-preis-lead { font-size: var(--text-xs); color: var(--muted); margin: 0 0 var(--space-sm); }
.k3-preis-zeilen, .k3-preis-summen { margin: 0; display: grid; }
.k3-preis-zeilen div, .k3-preis-summen div {
  display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-md);
  padding: 0.32rem 0; font-size: var(--text-sm); font-variant-numeric: tabular-nums;
}
.k3-preis-zeilen div + div { border-top: 1px dashed var(--line); }
.k3-preis-zeilen dt { color: var(--ink-soft); }
.k3-preis-zeilen dd, .k3-preis-summen dd { margin: 0; text-align: right; white-space: nowrap; font-weight: 600; }
.k3-preis-zeilen .is-anfrage dd { color: var(--muted); font-weight: 500; font-style: italic; }
.k3-preis-summen { margin-top: 0.35rem; padding-top: 0.4rem; border-top: 1px solid var(--line-2); }
.k3-preis-summen dt { color: var(--muted); }
.k3-preis-summen .is-summe { padding-top: 0.5rem; }
.k3-preis-summen .is-summe dt { color: var(--ink); font-weight: 700; }
.k3-preis-summen .is-summe dd { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; color: var(--ink); }
.k3-preis-note { font-size: var(--text-xs); color: var(--muted); line-height: 1.45; margin: var(--space-sm) 0 0; }

/* ---------- Mobile / Tablet portrait ---------- */

@media (max-width: 900px) {
  :root { --topbar-h: 54px; }
  .k3-app { grid-template-rows: var(--topbar-h) 1fr; height: 100dvh; }
  /* nur die Unterzeile – der Name selbst steht auch in einem span */
  .k3-brand-txt > span { display: none; }
  .k3-tab { font-size: var(--text-sm); padding: 0 0.65rem; }
  .k3-tab .k3-tab-lbl { display: none; }
  .k3-tab .k3-tab-num { display: inline-flex; }
  .k3-tab.is-active .k3-tab-lbl { display: inline; }
  .k3-exit .k3-exit-lbl { display: none; }

  .k3-main {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 46dvh 1fr;
  }
  .k3-stage { order: -1; }
  /* Panel liegt als abgerundetes Blatt ueber der Buehnenkante – liest sich
     als bewusst gestaltete mobile Ebene statt als blosser Split-Screen. */
  .k3-panel {
    border-right: none; border-top: none; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    margin-top: -14px; box-shadow: 0 -8px 24px rgba(32,30,26,0.10); position: relative;
  }
  .k3-panel-scroll { padding: var(--space-md) var(--space-md) var(--space-lg); }

  /* Mobil sitzt "Angebot anfragen" neben "Weiter" in der Navigationsleiste;
     die Zusammenfassung auf der Buehne entfaellt, die Buehne bleibt frei. */
  .k3-sumbar { display: none; }
  /* Richtpreis ueber den Schaltflaechen: eine Zeile, Betrag rechts */
  .k3-panel-preis:not([hidden]) {
    /* Betrag nie umbrechen („ca.“ allein in einer Zeile); der Hinweis darf es */
    display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: var(--space-sm);
    align-items: baseline; padding: 0.5rem var(--space-md) 0.1rem; border-top: 1px solid var(--line);
    background: var(--paper); font-variant-numeric: tabular-nums;
  }
  .k3-panel-preis-lbl { grid-row: 1; grid-column: 1; }
  .k3-panel-preis-wert { grid-row: 1 / span 2; grid-column: 2; justify-self: end; align-self: center;
    font-family: var(--font-display); font-size: var(--text-lg); font-weight: 600; color: var(--ink); white-space: nowrap; }
  .k3-panel-preis-hint { grid-row: 2; grid-column: 1; white-space: normal; }
  .k3-panel-preis + .k3-panel-nav { border-top: none; padding-top: 0.35rem; }
  .k3-nav-request { display: inline-flex; flex: 0 0 auto; padding-left: 0.9rem; padding-right: 0.9rem; }
  .k3-nav-request[hidden] { display: none; }
  .k3-nav-send:not([hidden]) { display: inline-flex; }
  /* Schritt 3: das Modell bleibt als Bild oben, das Formular bekommt Platz */
  /* clip statt hidden: auch Fokus und Sprungmarken duerfen den Rahmen nicht verschieben */
  .k3-main { transition: grid-template-rows .35s var(--ease-out); overflow: clip; }
  .k3-app.is-step-request .k3-main { grid-template-rows: 25dvh 1fr; }
  .k3-panel-nav { padding: var(--space-sm) var(--space-md); gap: var(--space-xs); }
  .k3-panel-nav:has(+ .k3-credit) { padding-bottom: 0.3rem; }
  .k3-credit { padding: 0 var(--space-md) calc(0.35rem + env(safe-area-inset-bottom, 0px)); font-size: 0.64rem; }
  #k3Back { padding-left: 0.8rem; padding-right: 0.8rem; }
  #k3Back span { display: none; }
  .k3-sumbar-info { display: none; }
  .k3-hud { top: var(--space-sm); right: var(--space-sm); }
  .k3-hud-btn { width: 33px; height: 33px; }
  /* Hinweis knapp ueber dem Bedienfeld, das 14 px in die Buehne ragt */
  .k3-hint { line-height: 1.3; font-size: var(--text-xs); padding: 0.45rem 0.9rem; }

  /* Kopfzeile: der Betrieb mit Namen, rechts Sprache und Zurueck */
  .k3-brand { flex: 1 1 auto; min-width: 0; }
  .k3-brand-txt { min-width: 0; }
  .k3-brand-txt b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--text-md); }
  .k3-brand img { height: 26px; }

  /* Schritte als Fortschrittsleiste oben im Bedienfeld (schritteJeGeraet) */
  .k3-panel > .k3-tabs {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px;
    padding: 12px var(--space-md) 6px; overflow: visible; flex: 0 0 auto;
    border-bottom: 1px solid var(--line); border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--paper);
  }
  .k3-panel > .k3-tabs .k3-tab {
    flex-direction: column; justify-content: flex-start; gap: 4px; min-height: 48px;
    padding: 0 2px 8px; font-size: 0.7rem; line-height: 1.15; white-space: normal; text-align: center;
    border-bottom: 3px solid var(--line); border-radius: 0;
  }
  .k3-panel > .k3-tabs .k3-tab .k3-tab-ico { display: none; }
  .k3-panel > .k3-tabs .k3-tab .k3-tab-lbl { display: inline; }
  .k3-panel > .k3-tabs .k3-tab.is-active { border-bottom-color: var(--accent); }
  .k3-panel > .k3-tabs .k3-tab.is-done { border-bottom-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
  .k3-panel > .k3-tabs .k3-tab.is-active .k3-tab-num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .k3-chips { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 460px) {
  .k3-chips { grid-template-columns: 1fr; }
  .k3-main { grid-template-rows: 42dvh 1fr; }
}

.k3-nav-send { display: none; }

/* Entwurf teilen: Knopf unter der Zusammenfassung, Bestaetigung als Toast */
.k3-share-btn { margin-top: var(--space-sm); gap: var(--space-xs); }
.k3-toast {
  position: absolute; left: 50%; top: var(--space-md); transform: translate(-50%, -8px); z-index: 7;
  max-width: calc(100% - 2 * var(--space-md)); width: max-content;
  background: rgba(24, 22, 18, 0.88); color: #fff; font-size: var(--text-sm); line-height: 1.35;
  padding: 0.55rem 0.9rem; border-radius: var(--radius-pill); box-shadow: var(--shadow-md);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease-out), transform .25s var(--ease-out);
}
.k3-toast.is-in { opacity: 1; transform: translate(-50%, 0); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .k3-main { transition: none; }
  .k3-tabpanel.is-active { animation: none; }
  .k3-spinner { animation-duration: 2s; }
}

/* ── Language suggestion banner ── */
.lang-suggest {
  background: var(--ink); color: #fff;
  overflow: hidden; max-height: 0;
  transition: max-height 0.4s var(--ease-in-out, ease);
}
.lang-suggest.is-visible { max-height: 80px; }
.lang-suggest-inner {
  display: flex; align-items: center; gap: var(--space-md);
  max-width: 1180px; margin: 0 auto; padding: 0.65rem var(--space-lg);
}
.lang-suggest-flag {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent);
  color: var(--accent-ink); font-weight: 800; font-size: var(--text-xs);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.lang-suggest-text { flex: 1; font-size: var(--text-md); font-weight: 500; margin: 0; }
.lang-suggest-btn {
  display: inline-flex; align-items: center; gap: var(--space-2xs);
  padding: 0.4rem 1rem; border-radius: var(--radius-pill); background: var(--accent);
  color: var(--accent-ink); font-weight: 700; font-size: var(--text-sm); text-decoration: none;
  white-space: nowrap; transition: transform 0.18s var(--ease-out), box-shadow 0.18s var(--ease-out);
}
.lang-suggest-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.lang-suggest-close {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; background: none;
  border: 1px solid rgba(255,255,255,0.2); border-radius: 50%;
  color: rgba(255,255,255,0.7); cursor: pointer; flex-shrink: 0;
  transition: border-color 0.2s, color 0.2s;
}
.lang-suggest-close:hover { border-color: rgba(255,255,255,0.5); color: #fff; }
@media (max-width: 600px) {
  .lang-suggest-inner { flex-wrap: wrap; gap: var(--space-xs); }
  .lang-suggest-text { flex-basis: calc(100% - 72px); font-size: var(--text-sm); }
  .lang-suggest-btn { margin-left: 36px; font-size: var(--text-xs); }
}

/* ══════════════════════════════════════════════════════════════
   Seitenwahl: Dropdowns im Panel + Popover direkt am 3D-Modell
   ══════════════════════════════════════════════════════════════ */
.k3-side-rows { display: flex; flex-direction: column; gap: var(--space-xs); }
.k3-side-row { display: flex; align-items: center; gap: var(--space-md); }
.k3-side-row > span { flex: 0 0 5.5rem; font-size: var(--text-md); font-weight: 600; color: var(--ink-soft); }
.k3-side-row select {
  flex: 1; font: inherit; font-size: var(--text-md); color: var(--ink);
  padding: 0.5rem 0.6rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); cursor: pointer;
}
.k3-side-row select:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-side-row select:disabled { background: var(--stone-2); color: var(--muted); cursor: not-allowed; }

/* Popover erscheint an der angeklickten Seite in der 3D-Ansicht */
/* Hinweis unter einer Kartengruppe (k3.v.<option>.hint) */
.k3-vhint { margin: var(--space-xs) 2px 0; font-size: var(--text-xs); line-height: 1.45; color: var(--muted); }

.k3-sidepop {
  position: absolute; z-index: 6; min-width: 176px;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md); padding: var(--space-2xs); display: flex; flex-direction: column; gap: 0.1rem;
}
.k3-sidepop-head {
  font-size: var(--text-2xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted); padding: 0.4rem 0.6rem 0.3rem;
}
.k3-sidepop-opt {
  font: inherit; font-size: var(--text-md); text-align: left; color: var(--ink);
  background: none; border: 0; border-radius: var(--radius-sm);
  padding: 0.5rem 0.6rem; cursor: pointer;
}
.k3-sidepop-opt:hover { background: var(--stone); }
.k3-sidepop-opt:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-sidepop-opt.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.k3-sidepop-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); }
.k3-sidepop-sub { margin-top: 0.45rem; border-top: 1px solid var(--line); padding-top: 0.7rem; }

/* Maß-Schilder lassen sich antippen (openDimSheet) */
.k3-dims .k3-dim { pointer-events: auto; cursor: pointer; }
.k3-dims .k3-dim:hover { background: rgba(24,22,18,0.95); }
.is-orbiting .k3-dims .k3-dim { pointer-events: none; }
.k3-masssheet { display: flex; flex-direction: column; gap: 0.6rem; padding: 0.3rem 0.4rem 0.5rem; min-width: 240px; }
.k3-mass-reihe { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; }
.k3-mass-btn {
  width: 52px; height: 52px; flex: 0 0 auto; border: 0; border-radius: var(--radius);
  background: var(--accent-wash-strong); color: var(--accent); font: inherit; font-size: 1.6rem; font-weight: 700; cursor: pointer;
}
.k3-mass-btn:active { transform: scale(0.96); }
.k3-mass-wert { display: inline-flex; align-items: baseline; gap: 0.3rem; font-weight: 700; }
.k3-mass-wert input {
  width: 5.2ch; font: inherit; font-size: 1.7rem; text-align: center; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 0.2rem 0.3rem; background: var(--paper);
  -moz-appearance: textfield; appearance: textfield;
}
.k3-mass-wert input::-webkit-outer-spin-button, .k3-mass-wert input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.k3-mass-wert span { color: var(--muted); font-size: var(--text-md); }
.k3-mass-bereich { margin: 0; font-size: var(--text-xs); color: var(--muted); text-align: center; }

/* Handy: Auswahlblatt von unten (placePopover, SHEET_MQ) */
.k3-sheet-bd {
  position: fixed; inset: 0; z-index: 60; background: rgba(24, 22, 18, 0.32);
  opacity: 0; transition: opacity .2s var(--ease-out);
}
.k3-sheet-bd.is-in { opacity: 1; }
.k3-sidepop.is-sheet {
  position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 61; min-width: 0;
  max-height: 72vh; overflow-y: auto; overscroll-behavior: contain;
  border: 0; border-radius: 18px 18px 0 0; gap: 0.15rem;
  padding: 0.5rem 0.75rem calc(0.9rem + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18);
  transform: translateY(100%); transition: transform .26s var(--ease-out);
}
.k3-sidepop.is-sheet.is-in { transform: none; }
.k3-sidepop.is-sheet::before {
  content: ""; display: block; width: 38px; height: 4px; border-radius: 2px; margin: 0.15rem auto 0.35rem;
  background: var(--line);
}
.is-sheet .k3-sidepop-head { font-size: var(--text-xs); padding: 0.2rem 0.3rem 0.5rem; }
.is-sheet .k3-sidepop-opt { font-size: 1rem; padding: 0.85rem 0.9rem; min-height: 50px; border-radius: var(--radius); }
.k3-sidepop-x {
  flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 50%; display: grid; place-items: center;
  background: var(--stone); color: var(--ink); cursor: pointer;
}
.k3-sidepop-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
@media (prefers-reduced-motion: reduce) { .k3-sidepop.is-sheet, .k3-sheet-bd { transition: none; } }

/* ══════════════════════════════════════════════════════════
   Modellauswahl als Auswahlfeld mit Vorschaubild
   ══════════════════════════════════════════════════════════ */
.k3-mdl { position: relative; }

.k3-mdl-btn {
  display: flex; align-items: center; gap: var(--space-sm); width: 100%;
  border: 1px solid var(--line); background: var(--paper);
  border-radius: var(--radius); padding: 0.5rem 0.6rem; text-align: left;
  transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out);
}
.k3-mdl-btn:hover { border-color: var(--line-2); }
.k3-mdl-btn:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-mdl.is-open .k3-mdl-btn { border-color: var(--accent); }

.k3-mdl-thumb {
  flex: none; width: 56px; height: 44px; object-fit: cover;
  border-radius: 7px; background: var(--stone-2); display: block;
}
.k3-mdl-cur { flex: 1 1 auto; min-width: 0; }
.k3-mdl-cur strong {
  /* Der Name wird nie abgeschnitten: mehrere Woerter brechen um, ein
     einzelnes zu langes Wort („Doppelstabmattenzaun“) macht die Schrift
     etwas kleiner (configurator3d.js, passeModellnamenAn). */
  display: block; font-family: var(--font-display); font-weight: 400; font-size: var(--text-lg); color: var(--ink);
  line-height: 1.2;
}
.k3-mdl-cur span {
  display: block; font-size: var(--text-xs); color: var(--muted); margin-top: 0.05rem;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.k3-mdl-caret {
  flex: none; width: 20px; height: 20px; color: var(--muted);
  transition: transform 0.18s var(--ease-out);
}
.k3-mdl.is-open .k3-mdl-caret { transform: rotate(180deg); }

.k3-mdl-pop {
  position: absolute; z-index: var(--z-popover); top: calc(100% + 6px); left: 0; right: 0;
  display: flex; flex-direction: column; max-height: 420px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-md); overflow: hidden;
}
.k3-mdl-find {
  display: flex; align-items: center; gap: var(--space-xs); flex: none;
  padding: 0.55rem 0.7rem; border-bottom: 1px solid var(--line); background: var(--stone);
}
.k3-mdl-find svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.k3-mdl-find input {
  flex: 1 1 auto; min-width: 0; border: 0; background: none; font: inherit;
  font-size: var(--text-md); color: var(--ink); outline: none;
}
.k3-mdl-find input::-webkit-search-cancel-button { cursor: pointer; }

.k3-mdl-list { overflow-y: auto; padding: var(--space-2xs); overscroll-behavior: contain; }
.k3-mdl-sec + .k3-mdl-sec { margin-top: var(--space-3xs); }
.k3-mdl-sechead {
  position: sticky; top: 0; z-index: 1; background: var(--paper);
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); padding: 0.5rem 0.5rem 0.3rem;
}
.k3-mdl-opt {
  display: flex; align-items: center; gap: var(--space-sm); width: 100%;
  border: 1px solid transparent; background: none; border-radius: var(--radius-sm);
  padding: 0.3rem 0.4rem; text-align: left; font: inherit; font-size: var(--text-md);
  font-weight: 600; color: var(--ink-soft); cursor: pointer;
}
.k3-mdl-opt .k3-mdl-thumb { width: 58px; height: 44px; }
.k3-mdl-opt span { min-width: 0; line-height: 1.25; overflow-wrap: break-word; }
.k3-mdl-opt:hover, .k3-mdl-opt.is-cursor { background: var(--stone); }
.k3-mdl-opt:focus-visible { box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-mdl-opt.is-active {
  border-color: var(--accent); background: var(--accent-wash); color: var(--ink); font-weight: 700;
}
.k3-mdl-empty { flex: none; padding: 0.9rem 0.8rem; font-size: var(--text-sm); color: var(--muted); text-align: center; }

@media (max-width: 900px) {
  .k3-mdl.is-open .k3-mdl-pop {
    position: fixed; z-index: var(--z-sheet);
    top: auto; left: 0.7rem; right: 0.7rem; bottom: 0.7rem;
    max-height: min(72dvh, 560px) !important;
    border-radius: var(--radius-lg);
    box-shadow: 0 -8px 40px rgba(24,22,18,0.28);
  }
  .k3-mdl.is-open::after {
    content: ""; position: fixed; inset: 0; z-index: var(--z-sheet-backdrop);
    background: rgba(24, 22, 18, 0.4);
  }
  .k3-mdl-opt { padding: 0.5rem 0.45rem; font-size: var(--text-lg); }
  .k3-mdl-opt .k3-mdl-thumb { width: 70px; height: 53px; }
}

.k3-subhead {
  font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--muted); margin: 0.9rem 0 0.45rem;
}
.k3-subhead:first-child { margin-top: 0; }

.k3-sublabel {
  display: block; font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-xs);
}
.k3-chips-sm { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); margin-bottom: var(--space-lg); }
.k3-chips-sm .k3-chip { padding: 0.45rem 0.6rem; font-size: var(--text-sm); }
/* Farbfeld statt Symbol (Sichtschutzstreifen) – mit angedeuteter Flechtung */
.k3-card .k3-card-ico.k3-card-sw,
.k3-card.is-active .k3-card-ico.k3-card-sw,
.k3-card:hover .k3-card-ico.k3-card-sw { background: repeating-linear-gradient(90deg, rgba(255,255,255,0.18) 0 4px, rgba(0,0,0,0.14) 4px 8px), var(--sw); box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
/* Feste Hoehen: acht kurze Werte – vier je Zeile statt einer langen Liste. */
#k3SizesH { grid-template-columns: repeat(4, minmax(0, 1fr)); }
#k3SizesH .k3-chip { padding: 0.45rem 0.3rem; text-align: center; }

.k3-dim-range {
  display: block; font-size: var(--text-xs); color: var(--muted);
  margin-top: 0.25rem; font-variant-numeric: tabular-nums;
}
/* Was das Mass bedeutet (Zaun: „4 Felder à 2,52 m + 1 gekürztes“) –
   direkt unter dem Bereich, in der Schriftfarbe statt grau. */
.k3-dim-hint {
  display: block; font-size: var(--text-xs); color: var(--ink-2, var(--ink));
  margin-top: 0.15rem; font-variant-numeric: tabular-nums; line-height: 1.35;
}
.k3-dim-hint[hidden] { display: none; }

/* Regler hinter ihrer Option (Zaun links und rechts beim Torprodukt): sie
   gehoeren zu deren Abschnitt – ohne eigene Ueberschrift, enger angesetzt. */
.k3-vgroup:not([hidden]) + .k3-vregler { margin-top: calc(var(--space-md) - var(--space-xl)); }
.k3-vregler:not([hidden]) + .k3-vregler { margin-top: calc(var(--space-sm) - var(--space-xl)); }

.k3-specs { display: flex; flex-wrap: wrap; gap: 0.1rem var(--space-md); margin-top: var(--space-2xs); }
.k3-specs > span { display: inline-flex; align-items: baseline; gap: 0.25rem; font-size: var(--text-xs); color: var(--muted); }
.k3-specs i { font-style: normal; opacity: 0.75; }
.k3-specs b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }

.k3-swatch .sw-anodised {
  background: linear-gradient(115deg, var(--sw) 0%, #ffffff 22%, var(--sw) 46%, #d6dadb 68%, var(--sw) 100%);
}
.k3-swatch .sw-wood-oak,
.k3-swatch .sw-wood-pine {
  background:
    repeating-linear-gradient(96deg, rgba(0,0,0,0.14) 0 1px, rgba(0,0,0,0) 1px 4px),
    repeating-linear-gradient(92deg, rgba(255,255,255,0.16) 0 2px, rgba(0,0,0,0) 2px 7px),
    var(--sw);
}

/* Feuerverzinkt: matter Metallglanz mit Zinkblumen. */
.k3-swatch .sw-galvanised {
  background:
    radial-gradient(circle at 30% 35%, rgba(255,255,255,0.55) 0 18%, rgba(255,255,255,0) 19%),
    radial-gradient(circle at 70% 65%, rgba(0,0,0,0.12) 0 22%, rgba(0,0,0,0) 23%),
    linear-gradient(125deg, var(--sw) 0%, #e3e6e7 40%, var(--sw) 72%, #9aa0a3 100%);
}
/* Holz (Impraegnierung): Maserung ueber dem Farbton. */
.k3-swatch .sw-wood-board {
  background:
    repeating-linear-gradient(178deg, rgba(0,0,0,0.13) 0 1px, rgba(0,0,0,0) 1px 5px),
    repeating-linear-gradient(181deg, rgba(255,255,255,0.14) 0 2px, rgba(0,0,0,0) 2px 9px),
    var(--sw);
}

/* Materialliste (Zaun) unter der Zusammenfassung */
.k3-bom { border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 0.95rem 0.7rem; margin: calc(-1 * var(--space-sm)) 0 var(--space-lg); }
.k3-bom h3 { font-size: var(--text-sm); margin: 0; }
.k3-bom summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; cursor: pointer; min-height: 28px; }
.k3-bom summary::-webkit-details-marker { display: none; }
.k3-bom summary::after { content: "+"; font-size: 1.15rem; font-weight: 600; color: var(--accent); line-height: 1; }
.k3-bom[open] summary::after { content: "–"; }
.k3-bom[open] summary { margin-bottom: 0.45rem; }
.k3-bom ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.k3-bom li { font-size: var(--text-sm); padding-left: 0.95rem; position: relative; font-variant-numeric: tabular-nums; }
.k3-bom li::before { content: ""; position: absolute; left: 0.1rem; top: 0.55em; width: 0.38rem; height: 0.38rem; border-radius: 2px; background: var(--accent); }
.k3-bom .k3-note { margin-top: 0.55rem; }

.k3-acc-chip[hidden] { display: none; }

/* 3D Interaktiver Hover-Tooltip */
.k3-3d-tooltip {
  position: absolute;
  z-index: var(--z-tooltip);
  pointer-events: none;
  background: rgba(20, 18, 14, 0.92);
  color: #fff;
  border: 1px solid color-mix(in oklch, var(--accent) 55%, transparent);
  box-shadow: var(--shadow-md);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.32rem 0.7rem;
  border-radius: var(--radius-pill);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
  white-space: nowrap;
}
.k3-3d-tooltip.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Bedingte Werte ----------
   Ein Wert, der erst unter anderen Umstaenden gilt (ungleiche Fluegel nur
   beim Stabil-Tor): gestrichelt, mit Hinweis „nur bei …“. Ein Klick stellt
   die Umstaende her (optionWaehlen in configurator3d.js). */
.k3-card.is-bedingt { background: transparent; border: 1px dashed var(--line-2); }
.k3-card.is-bedingt:hover { background: var(--stone); }
.k3-card.is-bedingt .k3-card-ico { background: var(--stone); opacity: 0.7; }
.k3-card .k3-card-bedingt { color: var(--ink-soft); font-style: italic; }

/* ---------- Mehrere Exemplare einer Option (Tore im Zaun) ----------
   Je Tor eine Zeile – Name und Lage, Klick zeigt es im Bild, × entfernt
   es –, darunter je Torart ein Knopf zum Hinzufuegen. */
.k3-liste { display: grid; gap: var(--space-xs); }
.k3-liste:empty { display: none; }
.k3-liste-leer { font-size: var(--text-sm); color: var(--muted); margin-bottom: var(--space-sm); }
.k3-liste-leer[hidden] { display: none; }
.k3-liste-zeile {
  display: grid; grid-template-columns: 1fr auto; align-items: stretch;
  border: 1px solid var(--accent); background: var(--accent-wash); border-radius: var(--radius);
}
.k3-liste-name {
  display: grid; grid-template-columns: 38px 1fr; gap: var(--space-sm); align-items: center;
  padding: var(--space-sm) var(--space-md); text-align: left; background: none; border: 0; border-radius: var(--radius) 0 0 var(--radius);
}
.k3-liste-name:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-ring); }
.k3-liste-name .k3-card-ico {
  width: 38px; height: 38px; box-sizing: border-box; padding: 8px; border-radius: var(--radius-sm);
  background: var(--accent-wash-strong); color: var(--accent);
}
.k3-liste-name strong { display: block; font-size: var(--text-md); font-weight: 600; }
.k3-liste-name span span { display: block; font-size: var(--text-xs); color: var(--muted); margin-top: 0.1rem; }
.k3-liste-weg {
  width: 44px; display: grid; place-items: center; background: none; border: 0;
  border-left: 1px solid var(--line); border-radius: 0 var(--radius) var(--radius) 0; color: var(--ink-soft);
}
.k3-liste-weg svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.k3-liste-weg:hover { background: var(--accent-wash-strong); color: var(--ink); }
.k3-liste-weg:focus-visible { box-shadow: inset 0 0 0 2px var(--accent-ring); }
/* Mehrere Tore: nur das gerade eingestellte ist hervorgehoben
   (configurator3d.js, Block EXEMPLARE) */
.k3-liste[data-exemplar] .k3-liste-zeile:not(.is-aktiv) { border-color: var(--line); background: var(--paper); }
.k3-liste[data-exemplar] .k3-liste-zeile:not(.is-aktiv) .k3-card-ico { background: var(--stone); color: var(--ink-soft); }

/* Leiste „Einstellungen für: Gartentor 1 · Gartentor 2“ */
.k3-exwahl { display: grid; gap: var(--space-2xs); margin: var(--space-md) 0 var(--space-sm); }
.k3-exwahl-lbl { font-size: var(--text-xs); font-weight: 600; color: var(--muted); }
.k3-exwahl-knoepfe { display: flex; flex-wrap: wrap; gap: var(--space-2xs); }
.k3-exwahl-btn {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink-soft);
  border-radius: var(--radius-btn, var(--radius-sm)); padding: 0.45rem 0.8rem; font: inherit; font-size: var(--text-sm); font-weight: 600; cursor: pointer;
}
.k3-exwahl-btn:hover { border-color: var(--line-2); color: var(--ink); }
.k3-exwahl-btn.is-active { border-color: var(--accent); background: var(--accent-wash); color: var(--ink); }
.k3-exwahl-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-ring); }
.k3-liste + .k3-liste-neu { margin-top: var(--space-sm); }
.k3-liste-add { background: transparent; border: 1px dashed var(--line-2); }
.k3-liste-add:hover { background: var(--stone); border-color: var(--accent); }
.k3-liste-add strong span { display: inline; font-size: inherit; color: inherit; margin: 0; }
.k3-liste-plus { color: var(--accent); font-weight: 700; }

/* ---------- Freier Grundriss (Zaun nach Grundriss) ----------
   Plan von oben in der Seitenleiste: Ecken ziehen, „+“ setzt eine Ecke
   ein, darunter die Seiten als Zahlen. Gebaut vom Zaunmotor. */
#k3GrundrissGroup { margin-bottom: var(--space-md); }
.k3-gr-vorlagen { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); margin-bottom: var(--space-xs); }
.k3-gr-vorlagen .k3-chip { padding: var(--space-2xs) var(--space-xs); text-align: center; }
.k3-gr-flaeche {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--paper);
  overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
}
.k3-gr-flaeche svg { display: block; width: 100%; height: 260px; }
.k3-gr-gitter line { stroke: var(--line); stroke-width: 1; opacity: 0.55; }
.k3-gr-masstab path { fill: none; stroke: var(--ink-soft); stroke-width: 1.5; }
.k3-gr-masstab text { fill: var(--ink-soft); font-size: 10px; }
.k3-gr-zaun { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.k3-gr-zaun.is-zu { fill: var(--accent-wash); }
.k3-gr-tor { stroke: var(--accent); stroke-width: 7; stroke-linecap: butt; }
.k3-gr-seite {
  fill: var(--ink); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums;
  paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; pointer-events: none;
}
.k3-gr-plus { cursor: copy; }
.k3-gr-plus circle { fill: var(--paper); stroke: var(--ink-soft); stroke-width: 1.5; }
.k3-gr-plus path { stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.k3-gr-plus:hover circle { stroke: var(--accent); fill: var(--accent-wash); }
.k3-gr-ecke { cursor: grab; }
.k3-gr-ecke circle { fill: var(--paper); stroke: var(--ink); stroke-width: 2; }
.k3-gr-ecke text { fill: var(--ink); font-size: 10px; font-weight: 700; pointer-events: none; }
.k3-gr-ecke:hover circle, .k3-gr-ecke.is-wahl circle { fill: var(--accent); stroke: var(--accent); }
.k3-gr-ecke.is-wahl text, .k3-gr-ecke:hover text { fill: var(--accent-ink); }
.k3-gr-leiste { display: flex; justify-content: space-between; align-items: center; gap: var(--space-xs); margin-top: var(--space-xs); min-height: 32px; }
.k3-gr-zu { display: flex; align-items: center; gap: var(--space-2xs); font-size: var(--text-sm); font-weight: 600; cursor: pointer; }
.k3-gr-zu input { width: 18px; height: 18px; accent-color: var(--accent); }
.k3-gr-weg {
  border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius-sm);
  padding: var(--space-2xs) var(--space-xs); font-size: var(--text-xs); font-weight: 600; color: var(--ink-soft);
}
.k3-gr-weg:hover { border-color: var(--accent); color: var(--ink); }
.k3-gr-seiten { display: grid; gap: var(--space-2xs); margin-top: var(--space-sm); }
.k3-gr-zeile { display: grid; grid-template-columns: 28px auto 1fr; align-items: center; gap: var(--space-xs); }
.k3-gr-name {
  width: 24px; height: 24px; border-radius: 50%; background: var(--stone); display: grid; place-items: center;
  font-size: var(--text-xs); font-weight: 700; color: var(--ink);
}
.k3-gr-zeile .k3-dim-val input { width: 88px; }
.k3-gr-winkel { font-size: var(--text-xs); color: var(--muted); text-align: right; }
.k3-gr-summe { margin-top: var(--space-xs); font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); }
.k3-gr-ecke.is-falsch circle { fill: #fbe4e1; stroke: #c2412d; stroke-width: 2.5; }
.k3-gr-ecke.is-falsch text { fill: #9b2c1b; }
.k3-gr-winkel.is-falsch { color: #b23a26; font-weight: 700; }
.k3-gr-fehler {
  margin: var(--space-xs) 0 0; padding: var(--space-2xs) var(--space-xs); border-radius: var(--radius-sm);
  background: #fbe4e1; color: #8f2a19; font-size: var(--text-xs); font-weight: 600; line-height: 1.45;
}
/* Vorschau-Modell (nur Admin) in der Modellauswahl */
.k3-mdl-vorschau {
  margin-left: auto; font-style: normal; font-size: var(--text-2xs); font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--accent-ink); background: var(--accent-wash); border-radius: var(--radius-pill);
  padding: 2px 8px; white-space: nowrap;
}

/* ---------- Block mit Zeilen (Katalog: gruppe) ----------
   Torprodukt „Neben dem Tor“: je Seite eine Zeile – Name, Umschalter
   Zaun | Hecke | Frei, bei Zaun darunter die Laenge mit −/+. */
.k3-vgruppe .k3-vzeile { display: grid; grid-template-columns: 56px 1fr; align-items: center; gap: var(--space-xs); margin-top: var(--space-sm); }
.k3-vgruppe h2 + .k3-vzeile { margin-top: 0; }
.k3-vzeile-name { font-size: var(--text-sm); font-weight: 700; color: var(--ink); }
.k3-seg {
  display: flex; gap: 2px; padding: 3px; background: var(--stone); border-radius: var(--radius-sm);
}
.k3-seg .k3-seg-btn {
  flex: 1 1 0; min-width: 0; display: block; padding: 0.45rem 0.3rem; border: 1px solid transparent;
  background: transparent; border-radius: calc(var(--radius-sm) - 2px); text-align: center; box-shadow: none;
}
.k3-seg .k3-seg-btn strong { display: block; font-size: var(--text-sm); font-weight: 600; color: var(--ink-soft); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.k3-seg .k3-seg-btn:hover { background: var(--stone-2); }
.k3-seg .k3-seg-btn.is-active { background: var(--paper); border-color: var(--accent); box-shadow: var(--shadow-sm); }
.k3-seg .k3-seg-btn.is-active strong { color: var(--ink); }
.k3-seg .k3-seg-btn[hidden] { display: none; }
.k3-vgruppe .k3-vregler.is-kompakt { margin: var(--space-2xs) 0 0 calc(56px + var(--space-xs)); }
.k3-kompakt { display: flex; align-items: center; gap: var(--space-2xs); flex-wrap: wrap; }
.k3-kompakt-btn {
  width: 30px; height: 30px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--paper);
  font-size: 1.05rem; font-weight: 700; line-height: 1; color: var(--ink);
}
.k3-kompakt-btn:hover { border-color: var(--accent); }
.k3-kompakt .k3-dim-val input { width: 70px; }
.k3-kompakt .k3-dim-hint { flex-basis: 100%; margin-top: 2px; }
/* −/+ neben den Massen (Zaunlaenge …): dieselben Knoepfe wie am Regler */
.k3-dim-head { align-items: center; }
.k3-dim-stepper { display: flex; align-items: center; gap: var(--space-2xs); }
