/* ============================================================
   heimlich schreinerei – Möbelkonfigurator  v5.2
   style.css – Mobile-first, vollständig überarbeitet
   Keine font-family – vererbt vom iframe-Parent
   ============================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button, input, select, textarea { font: inherit; }

/* ── Design Tokens ── */
:root {
  /* Farben */
  --bg:         #f7f7f5;
  --surface:    #ffffff;
  --surface-2:  #f2f2f0;
  --border:     #e8e8e6;
  --border-2:   #d0d0ce;
  --ink:        #1a1a1a;
  --ink-60:     #737370;
  --ink-30:     #b8b8b6;
  --ink-10:     #e8e8e6;

  /* Typografie */
  --text-xs:    11px;
  --text-sm:    13px;
  --text-base:  15px;
  --text-lg:    18px;
  --text-xl:    22px;

  /* Radien */
  --r-sm:   8px;
  --r-md:   12px;
  --r-lg:   18px;
  --r-pill: 100px;

  /* Schatten */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.07), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.10), 0 4px 12px rgba(0,0,0,0.06);

  /* Layout */
  --header-h:  60px;
  --nav-h:     56px;
  --wizard-w:  380px;

  /* Transition */
  --t: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
.dark {
  --bg:         #111111;
  --surface:    #1c1c1c;
  --surface-2:  #252525;
  --border:     #303030;
  --border-2:   #404040;
  --ink:        #eeeeee;
  --ink-60:     #888888;
  --ink-30:     #555555;
  --ink-10:     #2a2a2a;
}

/* ── Base ── */
html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  font-size: var(--text-base);
  line-height: 1.5;
  transition: background var(--t), color var(--t);
}

/* ── App Shell ── */
#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

/* ═══════════════════════════════════════════
   HEADER
═══════════════════════════════════════════ */
#main-header {
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  z-index: 20;
  transition: background var(--t), border-color var(--t);
}
.header-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
}
.logo-wrap { display: flex; align-items: center; }
.logo-img  { height: 12px; width: auto; display: block; }

.header-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--ink-30);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Dark Mode Toggle */
.btn-darkmode {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-60);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t); flex-shrink: 0;
}
.btn-darkmode:hover { border-color: var(--border-2); color: var(--ink); }
.btn-darkmode svg {
  width: 14px; height: 14px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.btn-darkmode .icon-sun  { display: none; }
.btn-darkmode .icon-moon { display: block; }
.dark .btn-darkmode .icon-sun  { display: block; }
.dark .btn-darkmode .icon-moon { display: none; }

/* ═══════════════════════════════════════════
   PROGRESS NAV
═══════════════════════════════════════════ */
#progress-nav {
  height: var(--nav-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  transition: background var(--t), border-color var(--t);
}
.progress-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  gap: 0;
  max-width: 500px;
  margin: 0 auto;
}
.step-item {
  display: flex; align-items: center; gap: 7px;
  opacity: 0.3;
  transition: opacity var(--t);
  flex-shrink: 0;
}
.step-item.active    { opacity: 1; }
.step-item.completed { opacity: 0.6; }
.step-circle {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  color: var(--ink-60);
  transition: all var(--t); flex-shrink: 0;
}
.step-item.active .step-circle    { background: var(--ink); color: var(--surface); }
.step-item.completed .step-circle { background: var(--ink-30); color: var(--surface); }
.step-label {
  font-size: var(--text-xs); font-weight: 500;
  white-space: nowrap; color: var(--ink-60);
  letter-spacing: 0.02em;
}
.step-connector {
  flex: 1; height: 1px;
  background: var(--border);
  margin: 0 8px; min-width: 12px;
}

/* ═══════════════════════════════════════════
   MAIN LAYOUT – Desktop: Side-by-Side
═══════════════════════════════════════════ */
#main-layout {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

/* ── Wizard Panel ── */
#wizard-panel {
  width: var(--wizard-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: background var(--t), border-color var(--t);
}
#wizard-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px 12px;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  -webkit-overflow-scrolling: touch;
}
#wizard-content::-webkit-scrollbar { width: 3px; }
#wizard-content::-webkit-scrollbar-track { background: transparent; }
#wizard-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

#wizard-nav {
  flex-shrink: 0;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border);
  display: flex; gap: 8px; align-items: center;
  background: var(--surface);
  transition: background var(--t), border-color var(--t);
}
.detail-control { display: flex; align-items: center; flex-shrink: 0; }

/* ═══════════════════════════════════════════
   STEP CONTENT
═══════════════════════════════════════════ */
.step-title {
  font-size: var(--text-xl);
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 3px;
  line-height: 1.2;
}
.step-subtitle {
  font-size: var(--text-sm);
  color: var(--ink-60);
  margin-bottom: 20px;
}

/* ── Möbel-Typ Karten ── */
.type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.type-card {
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 0;
  cursor: pointer;
  transition: all var(--t);
  background: var(--surface);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 8px;
  text-align: center; user-select: none;
  -webkit-tap-highlight-color: transparent;
  aspect-ratio: 1 / 1; /* Quadratisch */
}
.type-card:hover  { border-color: var(--border-2); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.type-card:active { transform: scale(0.97); }
.type-card.selected {
  border-color: var(--ink);
  background: var(--ink);
  box-shadow: var(--shadow-md);
}
.type-card .type-icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
}
.type-card .type-icon svg {
  width: 100%; height: 100%;
  stroke: var(--ink-60); fill: none;
  stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke var(--t);
}
.type-card.selected .type-icon svg { stroke: rgba(255,255,255,0.9); }
/* Dark Mode: Hintergrund bei selected ist dunkel (--ink ≈ #eee) → Icon muss dunkel sein */
.dark .type-card.selected .type-icon svg { stroke: #111111; }
.type-card .type-name {
  font-size: var(--text-sm); font-weight: 500;
  color: var(--ink-60); transition: color var(--t);
}
.type-card.selected .type-name { color: rgba(255,255,255,0.85); }
/* Dark Mode: Text auf hellem Hintergrund dunkel */
.dark .type-card.selected .type-name { color: #111111; }
/* Kein Sonderfall mehr – 3 Spalten, alle gleich */

/* ── Maße ── */
.dimension-group { margin-bottom: 22px; }
.dim-label-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.dim-label { font-size: var(--text-sm); font-weight: 500; color: var(--ink-60); }
.dim-value-display { font-size: 20px; color: var(--ink); line-height: 1; font-weight: 400; }
.dim-value-display span { font-size: var(--text-xs); color: var(--ink-30); }

.dim-slider {
  width: 100%; -webkit-appearance: none; appearance: none;
  height: 3px; background: var(--border); border-radius: 3px;
  outline: none; margin-bottom: 10px; cursor: pointer;
}
.dim-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); cursor: pointer;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}
.dim-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--ink); cursor: pointer;
  border: none;
}
.dim-input-row { display: flex; gap: 8px; align-items: center; }
.dim-number-input {
  width: 80px; padding: 7px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--text-sm); font-weight: 500;
  color: var(--ink); background: var(--surface);
  outline: none; text-align: center;
  transition: border-color var(--t), background var(--t), color var(--t);
}
.dim-number-input:focus { border-color: var(--ink); }
.dim-minmax { font-size: var(--text-xs); color: var(--ink-30); }
.dim-hint {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 12px;
  font-size: var(--text-xs); color: var(--ink-60); line-height: 1.5;
  margin-top: 4px;
}

/* ── Details ── */
.detail-section { margin-bottom: 18px; }
.detail-section-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-30); margin-bottom: 2px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.detail-row {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  transition: border-color var(--t);
}
.detail-row:last-child { border-bottom: none; }
.detail-row-label { font-size: var(--text-sm); color: var(--ink-60); font-weight: 400; flex: 1; min-width: 0; }
.detail-row-sub { font-size: var(--text-xs); color: var(--ink-30); margin-top: 1px; }

/* Toggle */
.toggle { position: relative; width: 42px; height: 24px; flex-shrink: 0; }
.toggle input { opacity: 0; width: 0; height: 0; position: absolute; }
.toggle-track {
  position: absolute; inset: 0;
  background: var(--border); border-radius: 12px;
  cursor: pointer; transition: background var(--t);
}
.toggle input:checked + .toggle-track { background: var(--ink); }
.toggle-track::after {
  content: ''; position: absolute;
  top: 3px; left: 3px; width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform var(--t);
}
.toggle input:checked + .toggle-track::after { transform: translateX(18px); }

/* Stepper */
.stepper {
  display: flex; align-items: center;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  overflow: hidden; flex-shrink: 0;
}
.stepper-btn {
  width: 32px; height: 32px; border: none;
  background: var(--surface-2); color: var(--ink-60);
  cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--t); line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.stepper-btn:hover  { background: var(--border); color: var(--ink); }
.stepper-btn:active { background: var(--border-2); }
.stepper-value {
  min-width: 36px; text-align: center;
  font-size: var(--text-sm); font-weight: 600; color: var(--ink);
  border-left: 1.5px solid var(--border); border-right: 1.5px solid var(--border);
  padding: 5px 4px; background: var(--surface);
  transition: all var(--t);
}

/* Select */
.detail-select {
  padding: 6px 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--text-sm); color: var(--ink-60);
  background: var(--surface); outline: none; cursor: pointer;
  transition: border-color var(--t), background var(--t), color var(--t);
  max-width: 160px;
}
.detail-select:focus { border-color: var(--ink); color: var(--ink); }

/* Mirror-Button */
.btn-mirror-inline {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-60);
  font-size: var(--text-xs); font-weight: 500; cursor: pointer;
  transition: all var(--t); white-space: nowrap; flex-shrink: 0;
}
.btn-mirror-inline:hover { border-color: var(--ink); color: var(--ink); }
.btn-mirror-inline svg {
  width: 13px; height: 13px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round;
}

/* ── Zusammenfassung ── */
.summary-block {
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 16px; margin-bottom: 12px;
  transition: background var(--t), border-color var(--t);
}
.summary-block-title {
  font-size: 10px; font-weight: 700;
  letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-30); margin-bottom: 10px;
}
.summary-row {
  display: flex; justify-content: space-between;
  align-items: baseline; padding: 5px 0;
  border-bottom: 1px solid var(--border);
  transition: border-color var(--t);
}
.summary-row:last-child { border-bottom: none; padding-bottom: 0; }
.summary-key { font-size: var(--text-sm); color: var(--ink-60); }
.summary-val { font-size: var(--text-sm); font-weight: 500; color: var(--ink); }
.summary-note { font-size: var(--text-xs); color: var(--ink-60); line-height: 1.6; margin-top: 8px; margin-bottom: 6px; }
.notiz-textarea {
  width: 100%; min-height: 80px; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--r-sm);
  font-size: var(--text-sm); color: var(--ink);
  background: var(--surface); outline: none;
  resize: vertical; line-height: 1.55;
  transition: border-color var(--t), background var(--t);
}
.notiz-textarea:focus { border-color: var(--border-2); }
.notiz-textarea::placeholder { color: var(--ink-30); }

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn-primary {
  flex: 1; padding: 13px 16px;
  background: var(--ink); color: var(--surface);
  border: none; border-radius: var(--r-sm);
  font-size: var(--text-sm); font-weight: 500;
  cursor: pointer; transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover   { opacity: 0.88; }
.btn-primary:active  { transform: scale(0.98); }
.btn-primary:disabled { background: var(--border); color: var(--ink-30); cursor: not-allowed; }

.btn-secondary {
  padding: 13px 16px;
  background: var(--surface); color: var(--ink-60);
  border: 1.5px solid var(--border);
  border-radius: var(--r-sm);
  font-size: var(--text-sm); font-weight: 400;
  cursor: pointer; transition: all var(--t);
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover { border-color: var(--border-2); color: var(--ink); }

.btn-pdf {
  width: 100%; padding: 14px 20px;
  background: var(--ink); color: var(--surface);
  border: none; border-radius: var(--r-md);
  font-size: var(--text-base); font-weight: 500;
  cursor: pointer; transition: all var(--t);
  display: flex; align-items: center; justify-content: center;
  gap: 9px; margin-top: 8px;
}
.btn-pdf:hover  { opacity: 0.88; transform: translateY(-1px); }
.btn-pdf:active { transform: none; }
.btn-pdf svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ═══════════════════════════════════════════
   PREVIEW PANEL
═══════════════════════════════════════════ */
#preview-panel {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg); overflow: hidden; position: relative; min-height: 0;
  transition: background var(--t);
}
#preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface); flex-shrink: 0;
  transition: background var(--t), border-color var(--t);
}
#preview-label {
  font-size: var(--text-xs); font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-30);
}
#preview-controls-hint {
  font-size: var(--text-xs); color: var(--ink-30);
  display: flex; align-items: center; gap: 5px;
}
.dot { opacity: 0.4; }

#three-container { flex: 1; position: relative; overflow: hidden; min-height: 0; }
#three-container canvas { width: 100% !important; height: 100% !important; display: block; }

/* ── Preview Buttons ── */
#preview-controls-bar {
  position: absolute; bottom: 52px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 6px; z-index: 6;
  pointer-events: auto; white-space: nowrap;
}
.preview-btn {
  height: 38px; padding: 0 14px;
  background: rgba(255,255,255,0.93);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,0.10);
  border-radius: var(--r-pill);
  cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  font-size: var(--text-sm); font-weight: 500; color: #333;
  transition: all var(--t); box-shadow: var(--shadow-sm);
  -webkit-tap-highlight-color: transparent;
}
.preview-btn:hover  { background: rgba(255,255,255,1); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.preview-btn:active { transform: none; box-shadow: var(--shadow-sm); }
.preview-btn svg {
  width: 15px; height: 15px; flex-shrink: 0;
  stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.dark .preview-btn { background: rgba(35,35,35,0.93); border-color: rgba(255,255,255,0.10); color: #ccc; }
.dark .preview-btn:hover { background: rgba(45,45,45,1); }

#btn-reset-cam {
  opacity: 0;
  transition: opacity 0.4s ease, background var(--t), box-shadow var(--t), transform var(--t);
}
#btn-reset-cam.visible { opacity: 1; }

#btn-toggle-doors { display: none; }
#btn-mirror-doors { display: none; }

/* ── Maßen-Overlay ── */
#dimension-overlay {
  position: absolute; bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 12px;
  background: rgba(255,255,255,0.93);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--r-pill);
  padding: 6px 16px;
  font-size: var(--text-xs); font-weight: 500; color: #444;
  box-shadow: var(--shadow-sm);
  pointer-events: none; white-space: nowrap; z-index: 5;
}
.dark #dimension-overlay {
  background: rgba(28,28,28,0.93); border-color: rgba(255,255,255,0.08); color: #bbb;
}

/* ═══════════════════════════════════════════
   WELCOME OVERLAY
═══════════════════════════════════════════ */
#welcome-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  pointer-events: none; z-index: 4;
  opacity: 0; transition: opacity 0.5s ease;
}
#welcome-overlay.visible { opacity: 1; }
#welcome-overlay.hiding  { opacity: 0; transition: opacity 0.3s ease; }

.welcome-inner {
  max-width: 360px; width: 100%;
  background: rgba(255,255,255,0.93);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--r-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.dark .welcome-inner {
  background: rgba(28,28,28,0.95);
  border-color: rgba(255,255,255,0.08);
}
.welcome-inner h2 {
  font-size: var(--text-lg); font-weight: 600;
  color: var(--ink); line-height: 1.25; margin-bottom: 12px;
}
.welcome-inner p {
  font-size: var(--text-sm); color: var(--ink-60);
  line-height: 1.6; margin-bottom: 8px;
}
.welcome-inner p:last-child { margin-bottom: 0; }
.welcome-privacy {
  display: flex; align-items: flex-start; gap: 7px;
  text-align: left; padding-top: 10px;
  border-top: 1px solid var(--border);
  color: var(--ink-30) !important;
  font-size: var(--text-xs) !important;
  margin-top: 4px;
}
.welcome-privacy svg {
  width: 12px; height: 12px; flex-shrink: 0; margin-top: 1px;
  stroke: var(--ink-30); fill: none; stroke-width: 2; stroke-linecap: round;
}

/* ═══════════════════════════════════════════
   ANIMATIONEN
═══════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.step-enter { animation: fadeUp 0.22s cubic-bezier(0.4, 0, 0.2, 1) both; }

/* ═══════════════════════════════════════════
   TABLET (≤ 900px)
═══════════════════════════════════════════ */
@media (max-width: 900px) {
  :root { --wizard-w: 320px; }
}

/* ═══════════════════════════════════════════
   MOBILE (≤ 680px)
   Layout: Oben 3D-Canvas (40vh), unten Wizard
   Header + Progress bleiben oben
═══════════════════════════════════════════ */
@media (max-width: 680px) {
  :root {
    --header-h: 48px;
    --nav-h:    42px;
  }

  /* App: kein overflow – alles in 100dvh */
  #app { height: 100dvh; overflow: hidden; }

  /* ── Header Mobile ── */
  .header-inner { padding: 0 14px; }
  .logo-img { height: 22px; }
  .header-title span { display: none; } /* Text weg, nur Icon */
  .header-title { gap: 0; }
  .btn-darkmode { width: 30px; height: 30px; }

  /* ── Progress Mobile: nur Icons ── */
  .step-label { display: none; }
  .step-connector { min-width: 8px; margin: 0 4px; }
  .step-circle { width: 22px; height: 22px; font-size: 10px; }
  .progress-inner { padding: 0 12px; }

  /* ── Layout: Vertikal, Canvas oben ── */
  #main-layout {
    flex-direction: column;
    overflow: hidden;
  }

  /* ── Preview: zuerst (order -1), feste Höhe ── */
  #preview-panel {
    order: -1;
    flex: 0 0 38vh;
    min-height: 160px;
    border-bottom: 1px solid var(--border);
  }
  /* Preview-Header auf Mobile weg */
  #preview-header { display: none; }

  /* Canvas 100% des preview-panels */
  #three-container { flex: 1; }

  /* Buttons im Canvas: kleiner, enger */
  #preview-controls-bar { bottom: 38px; gap: 5px; }
  .preview-btn { height: 32px; padding: 0 11px; font-size: 12px; gap: 5px; }
  .preview-btn svg { width: 13px; height: 13px; }
  #dimension-overlay { display: none; }

  /* ── Wizard: füllt den Rest ── */
  #wizard-panel {
    order: 0;
    width: 100%;
    flex: 1;
    min-height: 0;
    border-right: none;
  }
  #wizard-content { padding: 10px 14px 6px; }
  #wizard-nav { padding: 8px 14px 10px; gap: 7px; }

  /* Buttons in Nav */
  .btn-primary, .btn-secondary { padding: 11px 14px; font-size: 13px; }

  /* ── Schritt-Inhalte Mobile ── */
  .step-title    { font-size: 16px; margin-bottom: 2px; }
  .step-subtitle { font-size: 12px; margin-bottom: 12px; }

  /* Typ-Karten: 3 Spalten bleiben, kompakter */
  .type-grid { gap: 6px; }
  .type-card { border-radius: var(--r-sm); }
  .type-card .type-icon { width: 32px; height: 32px; }
  .type-card .type-name { font-size: 11px; }

  /* Dimension-Gruppen: kompakter */
  .dimension-group { margin-bottom: 16px; }
  .dim-value-display { font-size: 18px; }
  .dim-hint { display: none; } /* Hint auf Mobile ausblenden – spart Platz */

  /* Detail-Rows: enger */
  .detail-row { padding: 8px 0; }
  .detail-row-label { font-size: 13px; }
  .detail-row-sub { display: none; } /* Sub-Label auf Mobile weg */
  .detail-section { margin-bottom: 14px; }

  /* Stepper: etwas kleiner */
  .stepper-btn { width: 30px; height: 30px; font-size: 15px; }
  .stepper-value { min-width: 30px; font-size: 13px; }

  /* Summary: kompakter */
  .summary-block { padding: 12px; margin-bottom: 10px; }
  .notiz-textarea { min-height: 60px; }

  /* Welcome Overlay: kleiner, passt ins Bild */
  .welcome-inner { padding: 18px 20px; max-width: 280px; }
  .welcome-inner h2 { font-size: 15px; margin-bottom: 8px; }
  .welcome-inner p { font-size: 12px; margin-bottom: 6px; line-height: 1.5; }
  .welcome-privacy { font-size: 11px !important; padding-top: 8px; }
}

/* ═══════════════════════════════════════════
   SEHR KLEIN (≤ 390px)
═══════════════════════════════════════════ */
@media (max-width: 390px) {
  :root { --header-h: 44px; --nav-h: 40px; }

  /* Canvas noch etwas kleiner um mehr Wizard-Platz zu geben */
  #preview-panel { flex: 0 0 34vh; min-height: 140px; }

  .type-card .type-icon { width: 28px; height: 28px; }
  .type-card .type-name { font-size: 10px; }
  .step-title { font-size: 15px; }
  #wizard-content { padding: 8px 12px 4px; }
  .welcome-inner { max-width: 240px; padding: 14px 16px; }
  .welcome-inner h2 { font-size: 14px; }
}
