/* ==========================================================================
   CLAB3D 3D-Schilder- & Typenschild-Designer CSS
   Basiert auf konfigurator.css Design System (Farben, Typo, Cards, Buttons)
   ========================================================================== */

/* App Main Container & Expansive 2-Column Desktop Grid */
.c3d-app-main {
  max-width: min(97vw, 2400px);
  margin: 0 auto;
  padding: 1.25rem 2rem 3.5rem;
  width: 100%;
  box-sizing: border-box;
}

.c3d-app-grid {
  display: grid;
  grid-template-columns: minmax(580px, 1.35fr) minmax(520px, 600px);
  gap: 2rem;
  align-items: start;
}

@media (min-width: 1750px) {
  .c3d-app-grid {
    grid-template-columns: minmax(660px, 1.45fr) minmax(560px, 640px);
    gap: 2.5rem;
  }
}

@media (max-width: 1200px) {
  .c3d-app-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.c3d-col-viewport {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: sticky;
  top: 1rem;
}

/* ==========================================================================
   INTERACTIVE SPLIT-SCREEN 2D/3D STUDIO WORKSPACE
   ========================================================================== */

.c3d-studio-workspace {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

/* Studio Top Toolbar & Mode Switcher */
.c3d-studio-mode-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  background: var(--c3d-surface, #ffffff);
  border: 1px solid var(--c3d-border, #e2e8f0);
  border-radius: var(--c3d-radius, 12px);
  padding: 0.45rem 0.65rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex-wrap: wrap;
}

.c3d-mode-btn-group,
.c3d-quick-insert-group,
.c3d-studio-toggles-group {
  display: flex;
  align-items: center;
  gap: 4px;
}

.c3d-mode-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 5px 11px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--c3d-text-muted, #64748b);
  cursor: pointer;
  transition: all var(--c3d-transition-fast, 0.18s ease);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.c3d-mode-btn:hover {
  color: var(--c3d-text-main, #0f172a);
  background: rgba(2, 132, 199, 0.06);
}

.c3d-mode-btn.active {
  background: var(--c3d-blue, #0284c7);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

.c3d-studio-action-btn {
  background: rgba(2, 132, 199, 0.08);
  border: 1px solid rgba(2, 132, 199, 0.25);
  color: var(--c3d-blue, #0284c7);
  border-radius: 7px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.c3d-studio-action-btn:hover {
  background: var(--c3d-blue, #0284c7);
  color: #ffffff;
  transform: translateY(-1px);
}

.c3d-studio-icon-btn {
  background: var(--c3d-bg, #f8fafc);
  border: 1px solid var(--c3d-border, #e2e8f0);
  border-radius: 7px;
  padding: 4px 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--c3d-text-muted, #64748b);
  cursor: pointer;
  transition: all 0.15s ease;
}

.c3d-studio-icon-btn:hover {
  color: var(--c3d-text-main, #0f172a);
  border-color: #cbd5e1;
}

.c3d-studio-icon-btn.active {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

.c3d-toggle-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding-inline: 9px;
  min-width: auto;
  white-space: nowrap;
}

.c3d-toggle-label {
  font-size: 0.67rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.c3d-toggle-pill:not(.active) {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.28);
  color: #dc2626;
}

/* Studio Split Container */
.c3d-studio-split {
  width: 100%;
  position: relative;
  border-radius: var(--c3d-radius, 12px);
  overflow: hidden;
  border: 1px solid var(--c3d-border, #e2e8f0);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
}

/* Mode: Split (Side-by-Side on desktop) */
.c3d-studio-split[data-studio-mode="split"] {
  display: grid;
  grid-template-columns: 1fr 1fr;
  height: 560px;
  min-height: 480px;
}

@media (max-width: 1024px) {
  .c3d-studio-split[data-studio-mode="split"] {
    grid-template-columns: 1fr;
    grid-template-rows: 380px 380px;
    height: auto;
  }
}

/* Mode: 2D Only */
.c3d-studio-split[data-studio-mode="2d"] {
  display: block;
  height: 600px;
}

.c3d-studio-split[data-studio-mode="2d"] .c3d-2d-canvas-box {
  display: flex;
  width: 100%;
  height: 100%;
}

.c3d-studio-split[data-studio-mode="2d"] .c3d-3d-canvas-box {
  display: none !important;
}

/* Mode: 3D Only */
.c3d-studio-split[data-studio-mode="3d"] {
  display: block;
  height: 600px;
}

.c3d-studio-split[data-studio-mode="3d"] .c3d-3d-canvas-box {
  display: block;
  width: 100%;
  height: 100%;
}

.c3d-studio-split[data-studio-mode="3d"] .c3d-2d-canvas-box {
  display: none !important;
}

/* Left: 2D Interactive Canvas Box */
.c3d-2d-canvas-box {
  position: relative;
  background: radial-gradient(circle at 50% 50%, #0f172a 0%, #0b1120 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  user-select: none;
}

/* Floating Formatting Bar (Canva/PowerPoint style) */
.c3d-canvas-floating-bar {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 30;
  pointer-events: none;
  display: flex;
  justify-content: center;
}

.c3d-floating-bar-content {
  pointer-events: auto;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 9px;
  padding: 5px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  color: #f8fafc;
  max-width: 98%;
  flex-wrap: wrap;
}

.c3d-floating-bar-content .f-group {
  display: flex;
  align-items: center;
  gap: 3px;
}

.c3d-floating-bar-content .f-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 3px;
}

.c3d-f-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
}

.c3d-f-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.c3d-f-btn:disabled,
.c3d-f-btn:disabled:hover {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(255, 255, 255, 0.08);
}

.c3d-f-btn.active {
  background: var(--c3d-blue, #0284c7);
  border-color: var(--c3d-blue, #0284c7);
  color: #ffffff;
}

.c3d-f-btn.danger:hover {
  background: #ef4444;
  border-color: #ef4444;
}

.c3d-f-input {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f8fafc;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 0.75rem;
  font-family: inherit;
  outline: none;
}

.c3d-f-input:focus {
  border-color: var(--c3d-blue, #0284c7);
}

.c3d-float-format-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.c3d-float-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.c3d-float-row-sub {
  width: 100%;
}

.c3d-f-input-full {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 9px;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(56, 189, 248, 0.4);
  border-radius: 6px;
  color: #f8fafc;
  font-weight: 500;
  transition: all 0.15s ease;
}

.c3d-f-input-full:focus {
  border-color: #38bdf8;
  background: rgba(0, 0, 0, 0.75);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.c3d-f-select {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #f8fafc;
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  max-width: 220px;
  height: 26px;
  transition: border-color 0.15s ease;
}

.c3d-f-select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.c3d-f-select option {
  background: #0f172a;
  color: #f8fafc;
}

/* 2D Stage and SVG */
.c3d-2d-stage {
  flex: 1;
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: default;
}

.c3d-svg-canvas {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 14px 32px rgba(0, 0, 0, 0.6));
}

/* Feinpositionierung: schmale Leiste am linken Canvas-Rand */
.c3d-nudge-panel {
  position: absolute;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 26;
  width: 76px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 7px 6px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  color: #e2e8f0;
  user-select: none;
}

.c3d-nudge-panel[hidden] {
  display: none;
}

.c3d-nudge-head {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.c3d-nudge-field {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.64rem;
  font-weight: 700;
  color: #cbd5e1;
}

.c3d-nudge-field input {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 4px;
  color: #f8fafc;
  padding: 3px 4px;
  font: inherit;
  font-size: 0.66rem;
  text-align: right;
  outline: none;
}

.c3d-nudge-field input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.35);
}

.c3d-nudge-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  margin-top: 2px;
}

.c3d-nudge-btn {
  height: 21px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 4px;
  color: #e2e8f0;
  font-size: 0.72rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.c3d-nudge-btn:hover {
  background: rgba(56, 189, 248, 0.2);
  border-color: rgba(56, 189, 248, 0.45);
  color: #ffffff;
}

.c3d-nudge-up { grid-column: 2; }
.c3d-nudge-left { grid-column: 1; grid-row: 2; }
.c3d-nudge-down { grid-column: 2; grid-row: 2; }
.c3d-nudge-right { grid-column: 3; grid-row: 2; }

.c3d-nudge-hint {
  text-align: center;
  font-size: 0.56rem;
  color: #64748b;
}

.c3d-2d-view-badge {
  position: absolute;
  bottom: 8px;
  left: 10px;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.65rem;
  color: #a9b8ca;
  font-weight: 600;
  pointer-events: none;
}

/* Right: 3D Viewport Box */
.c3d-3d-canvas-box {
  position: relative;
  background: radial-gradient(circle at 50% 40%, #f8fafc 0%, #f1f5f9 65%, #e2e8f0 100%);
  display: flex;
  overflow: hidden;
  cursor: grab;
}

.c3d-3d-canvas-box:active {
  cursor: grabbing;
}

.c3d-3d-canvas-box canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

.c3d-col-controls {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Templates Grid */
.c3d-templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.c3d-template-card {
  background: var(--c3d-surface);
  border: 1.5px solid var(--c3d-border);
  border-radius: var(--c3d-radius);
  padding: 0.75rem 0.65rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.c3d-template-card:hover {
  border-color: var(--c3d-blue);
  background: var(--c3d-surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
}

.c3d-template-card.active {
  border-color: var(--c3d-blue);
  background: rgba(2, 132, 199, 0.08);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

.c3d-template-icon {
  font-size: 1.5rem;
  line-height: 1;
}

.c3d-template-title {
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--c3d-text-main);
  line-height: 1.25;
}

.c3d-template-sub {
  font-size: 0.7rem;
  color: var(--c3d-text-muted);
}

/* Color Swatches Grid */
.c3d-color-swatches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.c3d-color-swatch-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 2px solid var(--c3d-border);
  cursor: pointer;
  position: relative;
  transition: all var(--c3d-transition-fast);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c3d-color-swatch-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.c3d-color-swatch-btn.active {
  border-color: #0284c7;
  box-shadow: 0 0 0 2.5px #0284c7, 0 4px 12px rgba(2, 132, 199, 0.35);
  transform: scale(1.08);
  z-index: 3;
}

.c3d-color-swatch-btn.active::after {
  content: '✓';
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 900;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

/* If swatch is white/light, checkmark is dark */
.c3d-color-swatch-btn.light.active::after {
  color: #0f172a;
  text-shadow: none;
}

.c3d-color-swatch-btn.disabled,
.c3d-color-swatch-btn:disabled {
  opacity: 0.32;
  filter: grayscale(85%);
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
  position: relative;
  border-style: dashed;
}

.c3d-color-swatch-btn.disabled::after,
.c3d-color-swatch-btn:disabled::after {
  content: '✕';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
  color: #ef4444;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
}

/* Color Combination Preview Bar */
.c3d-color-combo-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  background: var(--c3d-surface);
  border: 1px solid var(--c3d-border);
  border-radius: var(--c3d-radius);
  margin-top: 0.75rem;
  font-size: 0.8rem;
}

.c3d-combo-sample-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-weight: 700;
  font-size: 0.82rem;
  border: 1.5px solid rgba(0,0,0,0.15);
  box-shadow: 0 2px 6px rgba(0,0,0,0.06);
}

/* Text Lines Rows */
.c3d-sign-line-card {
  background: var(--c3d-surface);
  border: 1px solid var(--c3d-border);
  border-radius: var(--c3d-radius);
  padding: 0.65rem 0.75rem;
  margin-bottom: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: border-color var(--c3d-transition-fast);
}

.c3d-sign-line-card:hover {
  border-color: #cbd5e1;
}

.c3d-sign-line-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.c3d-sign-line-number {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c3d-blue);
  text-transform: uppercase;
}

.c3d-sign-line-controls {
  display: grid;
  grid-template-columns: 1fr 85px 105px;
  gap: 0.45rem;
  align-items: center;
}

.c3d-sign-line-y-slider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  color: var(--c3d-text-muted);
}

.c3d-sign-line-y-slider input[type="range"] {
  flex: 1;
  height: 4px;
  accent-color: var(--c3d-blue);
}

/* Segmented Control for Shape & Hole Pattern */
.c3d-seg-control {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 0.35rem;
  background: var(--c3d-bg);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--c3d-border);
}

.c3d-seg-btn {
  background: transparent;
  border: none;
  padding: 0.45rem 0.35rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--c3d-text-muted);
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
  text-align: center;
  line-height: 1.2;
}

.c3d-seg-btn:hover {
  color: var(--c3d-text-main);
  background: rgba(255, 255, 255, 0.5);
}

.c3d-seg-btn.active {
  background: var(--c3d-surface);
  color: var(--c3d-blue);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* Material ASA Highlighting Pill */
.c3d-asa-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(37, 99, 235, 0.12));
  border: 1px solid rgba(2, 132, 199, 0.3);
  padding: 0.35rem 0.65rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #0369a1;
}

.c3d-asa-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0284c7;
  box-shadow: 0 0 6px #0284c7;
}

/* Plate Capacity Card Styling */
.c3d-capacity-box {
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #ffffff;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
  border: 1px solid rgba(56, 189, 248, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.c3d-capacity-text-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.c3d-capacity-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  color: #a9b8ca;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.c3d-capacity-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: #38bdf8;
  font-family: 'Space Grotesk', sans-serif;
}

.c3d-capacity-badge {
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #e0f2fe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

/* Dimension Badges on 3D Viewport */
.c3d-dim-hud {
  position: absolute;
  bottom: 50px;
  left: 12px;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 5px 9px;
  color: #f8fafc;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  pointer-events: none;
  display: flex;
  gap: 8px;
  align-items: center;
  z-index: 10;
}

/* Floating Camera Controls Overlay HUD */
.c3d-camera-presets {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  gap: 6px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 4px;
  z-index: 10;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.c3d-cam-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #a9b8ca;
  font-family: inherit;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  user-select: none;
}

.c3d-cam-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
}

.c3d-cam-btn.active {
  background: var(--c3d-blue, #0284c7);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
}

/* Manufacturing & Quality Profiles Grid */
.c3d-profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.c3d-profile-card {
  background: var(--c3d-surface);
  border: 1.5px solid var(--c3d-border);
  border-radius: var(--c3d-radius);
  padding: 0.65rem 0.6rem;
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.c3d-profile-card:hover {
  border-color: var(--c3d-blue);
  background: var(--c3d-surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
}

.c3d-profile-card.active {
  border-color: var(--c3d-blue);
  background: rgba(2, 132, 199, 0.08);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

.c3d-profile-header {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.78rem;
  color: var(--c3d-text-main);
}

.c3d-profile-desc {
  font-size: 0.68rem;
  color: var(--c3d-text-muted);
  line-height: 1.25;
}

.c3d-profile-specs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--c3d-blue);
  background: rgba(2, 132, 199, 0.1);
  padding: 2px 5px;
  border-radius: 4px;
  margin-top: 2px;
  align-self: flex-start;
}

/* Design Toolbox */
.c3d-design-toolbox {
  background: var(--c3d-surface);
  border: 1px solid var(--c3d-border);
  border-radius: var(--c3d-radius);
  padding: 0.75rem;
  margin-bottom: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.c3d-tool-card {
  border-bottom: 1px solid var(--c3d-border);
  padding-bottom: 0.65rem;
}

.c3d-tool-card:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.c3d-tool-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}

.c3d-tool-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c3d-text-main);
}

/* Symbol Picker Grid */
.c3d-symbol-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
  gap: 0.35rem;
  margin-top: 0.35rem;
}

.c3d-symbol-btn {
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c3d-bg);
  border: 1px solid var(--c3d-border);
  border-radius: 6px;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
}

.c3d-symbol-btn:hover {
  background: #ffffff;
  border-color: var(--c3d-blue);
  transform: scale(1.08);
}

.c3d-symbol-btn.active {
  background: rgba(2, 132, 199, 0.12);
  border-color: var(--c3d-blue);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

/* ==========================================================================
   MODERN STUDIO TABS & EXPANSIVE STEP NAVIGATION
   ========================================================================== */
.c3d-studio-tabs {
  display: flex;
  background: var(--c3d-bg);
  padding: 5px;
  border-radius: 12px;
  border: 1px solid var(--c3d-border);
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.c3d-studio-tabs::-webkit-scrollbar {
  display: none;
}

.c3d-studio-tab {
  flex: 1;
  min-width: 90px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 0.65rem 0.5rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9px;
  color: var(--c3d-text-muted);
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
  white-space: nowrap;
}

.c3d-studio-tab:hover {
  color: var(--c3d-text-main);
  background: rgba(255, 255, 255, 0.6);
}

.c3d-studio-tab.active {
  background: var(--c3d-surface);
  color: var(--c3d-blue);
  border-color: rgba(2, 132, 199, 0.25);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.12);
  font-weight: 700;
}

.c3d-studio-tab .c3d-tab-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.c3d-studio-tab .c3d-tab-text {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: -0.2px;
}

/* Tab Panels */
.c3d-tab-panel {
  display: none;
  animation: c3dFadeIn 0.2s ease-out forwards;
}

.c3d-tab-panel.active {
  display: block;
}

@keyframes c3dFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Studio Section Card */
.c3d-studio-card {
  background: var(--c3d-surface);
  border: 1px solid var(--c3d-border);
  border-radius: var(--c3d-radius);
  padding: 1.15rem;
  margin-bottom: 1rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.c3d-studio-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c3d-border);
}

.c3d-studio-card-title {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--c3d-text-main);
  font-family: 'Space Grotesk', sans-serif;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.c3d-studio-card-sub {
  font-size: 0.72rem;
  color: var(--c3d-text-muted);
}

/* Next / Previous Flow Buttons */
.c3d-step-nav-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--c3d-border);
}

.c3d-next-step-btn {
  background: var(--c3d-blue);
  color: #ffffff;
  border: none;
  padding: 0.65rem 1.2rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.c3d-next-step-btn:hover {
  background: var(--c3d-blue-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.25);
}

/* Text Alignment Buttons & Key-Value Mode */
.c3d-align-btn-group {
  display: inline-flex;
  background: var(--c3d-bg);
  border: 1px solid var(--c3d-border);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.c3d-align-btn {
  background: transparent;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--c3d-text-muted);
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.c3d-align-btn:hover {
  color: var(--c3d-text-main);
  background: rgba(255, 255, 255, 0.5);
}

.c3d-align-btn.active {
  background: var(--c3d-surface);
  color: var(--c3d-blue);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 3D Model Click-to-Select Pulse Animation */
.c3d-sign-line-card.focused-from-3d {
  animation: c3dLineFocusPulse 1.6s ease-out;
  border-color: #0284c7 !important;
  background: rgba(2, 132, 199, 0.06) !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.3) !important;
}

@keyframes c3dLineFocusPulse {
  0% { transform: scale(1.02); box-shadow: 0 0 0 5px rgba(2, 132, 199, 0.45); }
  50% { transform: scale(1.01); box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.3); }
  100% { transform: scale(1); }
}

/* Floating 3D Interaction HUD */
.c3d-hud-interactive-hint {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  padding: 5px 12px;
  color: #f8fafc;
  font-size: 0.72rem;
  font-weight: 600;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: opacity 0.3s ease;
}

.c3d-hud-interactive-hint span.icon {
  font-size: 0.85rem;
}

/* Official Symbol Categories */
.c3d-symbol-category-pills {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  margin-bottom: 0.65rem;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.c3d-symbol-category-pills::-webkit-scrollbar {
  display: none;
}

.c3d-symbol-cat-btn {
  background: var(--c3d-bg);
  border: 1px solid var(--c3d-border);
  border-radius: 14px;
  padding: 3px 10px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--c3d-text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--c3d-transition-fast);
}

.c3d-symbol-cat-btn:hover {
  color: var(--c3d-text-main);
  background: #ffffff;
}

.c3d-symbol-cat-btn.active {
  background: var(--c3d-blue);
  color: #ffffff;
  border-color: var(--c3d-blue);
}

/* ==========================================================================
   SHAPE SELECTION GRID (6 GEOMETRIC BASE SHAPES)
   ========================================================================== */
.c3d-shape-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 0.85rem;
}

@media (max-width: 640px) {
  .c3d-shape-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.c3d-shape-btn {
  background: var(--c3d-surface);
  border: 1.5px solid var(--c3d-border);
  border-radius: var(--c3d-radius);
  padding: 0.65rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
  text-align: center;
}

.c3d-shape-btn:hover {
  border-color: var(--c3d-blue);
  background: var(--c3d-surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.12);
}

.c3d-shape-btn.active {
  border-color: var(--c3d-blue);
  background: rgba(2, 132, 199, 0.08);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.25);
}

.c3d-shape-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.c3d-shape-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--c3d-text-main);
}

.c3d-shape-sub {
  font-size: 0.65rem;
  color: var(--c3d-text-muted);
}

/* ==========================================================================
   2D SVG CANVAS INTERACTIVE OVERLAYS & CONTROLS
   ========================================================================== */
.c3d-canvas-obj {
  cursor: move;
  pointer-events: auto;
  user-select: none;
}

.c3d-canvas-obj:hover {
  filter: drop-shadow(0 0 3px rgba(56, 189, 248, 0.6));
}

.c3d-canvas-obj.is-selected-obj text {
  stroke: rgba(248, 113, 113, 0.72);
  stroke-width: 0.22;
  paint-order: stroke fill;
}

.c3d-selection-box {
  fill: none;
  stroke: rgba(248, 113, 113, 0.55);
  stroke-width: 0.35;
  stroke-dasharray: 2 2;
  pointer-events: none;
  transition: stroke 0.15s ease;
}

.c3d-selection-box.is-colliding {
  fill: rgba(239, 68, 68, 0.035);
  stroke: rgba(239, 68, 68, 0.9);
  stroke-width: 0.6;
  stroke-dasharray: 2.5 1.5;
  animation: c3dCollisionPulse 0.9s ease-in-out infinite alternate;
}

@keyframes c3dCollisionPulse {
  0% { stroke: #ef4444; fill: rgba(239, 68, 68, 0.15); filter: drop-shadow(0 0 4px rgba(239, 68, 68, 0.4)); }
  100% { stroke: #dc2626; fill: rgba(239, 68, 68, 0.32); filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8)); }
}

.c3d-handle {
  fill: rgba(255, 255, 255, 0.82);
  stroke: rgba(248, 113, 113, 0.9);
  stroke-width: 0.55;
  cursor: pointer;
  transition: fill 0.1s ease;
}

.c3d-handle:hover {
  fill: #fecaca;
  stroke: #ef4444;
}

.c3d-rotation-pin {
  stroke: rgba(248, 113, 113, 0.55);
  stroke-width: 0.4;
  stroke-dasharray: 1.2 1.5;
}

.c3d-rotation-handle {
  fill: rgba(248, 113, 113, 0.8);
  stroke: rgba(255, 255, 255, 0.85);
  stroke-width: 0.45;
  cursor: grab;
  transition: fill 0.15s ease;
}

.c3d-rotation-handle:active {
  cursor: grabbing;
  fill: #dc2626;
}

/* Smart Guides & Equal Spacing Indicators */
.c3d-smart-guide {
  stroke: #38bdf8;
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
  pointer-events: none;
}

.c3d-smart-guide.axis-center {
  stroke: #e879f9;
  stroke-width: 1.5;
  stroke-dasharray: 5 2;
}

.c3d-equal-spacing-line {
  stroke: #f59e0b;
  stroke-width: 1.4;
  pointer-events: none;
}

.c3d-spacing-text {
  fill: #f59e0b;
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  text-anchor: middle;
  pointer-events: none;
}

.c3d-hole-keepout {
  fill: rgba(148, 163, 184, 0.04);
  stroke: rgba(148, 163, 184, 0.4);
  stroke-width: 0.5;
  stroke-dasharray: 2 2;
  pointer-events: none;
}

.c3d-hole-countersink {
  fill: rgba(2, 132, 199, 0.04);
  stroke: rgba(2, 132, 199, 0.65);
  stroke-width: 0.6;
  stroke-dasharray: 1.5 1.5;
  pointer-events: none;
}

/* ==========================================================================
   TAB 3: ELEMENTS LIST & MANAGER / LEGENDE
   ========================================================================== */
.c3d-elements-actions {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.c3d-elements-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 2px;
}

.c3d-element-card {
  background: var(--c3d-surface);
  border: 1.5px solid var(--c3d-border);
  border-radius: var(--c3d-radius);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
}

.c3d-element-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.c3d-element-card:hover {
  border-color: var(--c3d-blue);
  background: var(--c3d-surface-hover);
}

.c3d-element-card.active {
  border-color: var(--c3d-blue);
  background: rgba(2, 132, 199, 0.05);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.18);
}

.c3d-elem-color-pill {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.2);
  display: inline-block;
  flex-shrink: 0;
}

.c3d-element-card:hover {
  border-color: var(--c3d-blue);
  background: var(--c3d-surface-hover);
}

.c3d-element-card.active {
  border-color: var(--c3d-blue);
  background: rgba(2, 132, 199, 0.08);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.c3d-elem-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1;
}

.c3d-elem-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  flex-shrink: 0;
}

.c3d-elem-badge.type-text { background: rgba(56, 189, 248, 0.18); color: #0284c7; }
.c3d-elem-badge.type-line { background: rgba(245, 158, 11, 0.18); color: #d97706; }
.c3d-elem-badge.type-icon { background: rgba(168, 85, 247, 0.18); color: #9333ea; }

.c3d-elem-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--c3d-text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.c3d-elem-coords {
  font-size: 0.68rem;
  color: var(--c3d-text-muted);
  font-family: 'JetBrains Mono', monospace;
  margin-left: auto;
  flex-shrink: 0;
}

.c3d-elem-del-btn {
  background: transparent;
  border: none;
  color: var(--c3d-text-muted);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.c3d-elem-del-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.c3d-elements-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--c3d-text-muted);
  border: 1.5px dashed var(--c3d-border);
  border-radius: var(--c3d-radius);
  font-size: 0.78rem;
}

/* ==========================================================================
   ICON LIBRARY MODAL (FULL VEKTOR-BIBLIOTHEK)
   ========================================================================== */
.c3d-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: c3dFadeIn 0.2s ease-out;
}

.c3d-modal-card {
  background: var(--c3d-surface);
  border: 1px solid var(--c3d-border);
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
  overflow: hidden;
}

.c3d-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--c3d-border);
}

.c3d-modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--c3d-text-main);
  font-family: 'Space Grotesk', sans-serif;
}

.c3d-modal-close-btn,
.c3d-modal-close {
  background: transparent;
  border: none;
  font-size: 1.2rem;
  color: var(--c3d-text-muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.c3d-modal-close-btn:hover,
.c3d-modal-close:hover {
  background: var(--c3d-bg);
  color: var(--c3d-text-main);
}

.c3d-modal-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  overflow-y: auto;
  flex: 1;
}

.c3d-modal-search-row {
  display: flex;
  gap: 0.5rem;
}

.c3d-modal-search-input {
  flex: 1;
  background: var(--c3d-bg);
  border: 1.5px solid var(--c3d-border);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  font-size: 0.82rem;
  color: var(--c3d-text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.c3d-modal-search-input:focus {
  border-color: var(--c3d-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

.c3d-modal-cat-filter {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.c3d-modal-cat-btn {
  background: var(--c3d-bg);
  border: 1px solid var(--c3d-border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--c3d-text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.c3d-modal-cat-btn:hover {
  color: var(--c3d-text-main);
  background: #ffffff;
}

.c3d-modal-cat-btn.active {
  background: var(--c3d-blue);
  color: #ffffff;
  border-color: var(--c3d-blue);
}

.c3d-icon-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(95px, 1fr));
  gap: 0.65rem;
  padding: 4px;
}

.c3d-icon-card {
  background: var(--c3d-bg);
  border: 1.5px solid var(--c3d-border);
  border-radius: 10px;
  padding: 0.75rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: center;
}

.c3d-icon-card:hover {
  border-color: var(--c3d-blue);
  background: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.18);
}

.c3d-icon-svg-wrap {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c3d-icon-svg-wrap svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.c3d-icon-card-title {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--c3d-text-main);
  line-height: 1.2;
}

/* ==========================================================================
   PRÄGUNGS- & FERTIGUNGSVERFAHREN (RELIEF, GRAVUR, UPSIDE-DOWN)
   ========================================================================== */
.c3d-emboss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.c3d-emboss-btn {
  background: var(--c3d-bg);
  border: 1.5px solid var(--c3d-border);
  border-radius: 8px;
  padding: 0.65rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
  text-align: left;
}

.c3d-emboss-btn:hover {
  border-color: #a9b8ca;
  background: #ffffff;
}

.c3d-emboss-btn.active {
  border-color: var(--c3d-blue);
  background: rgba(2, 132, 199, 0.05);
  box-shadow: 0 0 0 1px var(--c3d-blue);
}

.c3d-emboss-btn .emboss-icon {
  font-size: 1.15rem;
  margin-bottom: 2px;
}

.c3d-emboss-btn .emboss-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--c3d-text-main);
}

.c3d-emboss-btn .emboss-sub {
  font-size: 0.68rem;
  color: var(--c3d-text-muted);
  line-height: 1.25;
}

/* ==========================================================================
   INTELLIGENTES FARB- & LOGO-EMPFEHLUNGS-BANNER
   ========================================================================== */
.c3d-rec-banner {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.12), rgba(99, 102, 241, 0.1));
  border: 1px solid rgba(2, 132, 199, 0.35);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  animation: c3dFadeIn 0.25s ease;
}

.c3d-rec-banner.warning {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(245, 158, 11, 0.1));
  border-color: rgba(239, 68, 68, 0.4);
}

.c3d-rec-banner.hidden {
  display: none !important;
}

.c3d-rec-banner-content {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.c3d-rec-banner-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.c3d-rec-banner-text {
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--c3d-text-main);
}

.c3d-rec-banner-text strong {
  font-weight: 700;
}

.c3d-rec-banner-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

.c3d-rec-banner-close {
  background: none;
  border: none;
  color: var(--c3d-text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
}

.c3d-rec-banner-close:hover {
  color: var(--c3d-text-main);
}

/* ==========================================================================
   IN-TAB ICON PICKER (TAB 3)
   ========================================================================== */
.c3d-tab-icon-picker {
  background: var(--c3d-bg);
  border: 1px solid var(--c3d-border);
  border-radius: 8px;
  padding: 0.75rem;
  margin-bottom: 0.75rem;
}

.c3d-tab-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 0.4rem;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 0.5rem;
  padding-right: 2px;
}

.c3d-tab-icon-item {
  background: #ffffff;
  border: 1px solid var(--c3d-border);
  border-radius: 6px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 6px;
  color: var(--c3d-text-main);
  transition: all var(--c3d-transition-fast);
}

.c3d-tab-icon-item:hover {
  border-color: var(--c3d-blue);
  color: var(--c3d-blue);
  transform: translateY(-2px);
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.2);
}

.c3d-tab-icon-item svg {
  width: 100%;
  height: 100%;
  max-height: 32px;
  fill: currentColor;
}



/* ==========================================================================
   COMPACT STUDIO LAYOUT (2026-10)
   Ziel: ruhiger CAD-Arbeitsbereich – Stage links fix, Inspector rechts mit
   eigenem Scrollbereich, kompakte Karten statt langer Textblöcke.
   ========================================================================== */

/* Fehlende Design-Token-Aliase: ohne diese bleiben Karten eckig und Titel
   erben die Body-Farbe statt der Überschriftenfarbe. */
:root {
  --c3d-text-main: var(--c3d-text-primary);
  --c3d-text-secondary: var(--c3d-text-body);
  --c3d-radius: 12px;
  --c3d-transition-fast: 0.18s ease;
  --c3d-surface-hover: rgba(148, 163, 184, 0.07);
}

.c3d-app-main { padding: 1rem 1.5rem 2rem; }

@media (min-width: 1201px) {
  .c3d-app-grid {
    grid-template-columns: minmax(560px, 1.4fr) minmax(480px, 580px);
    gap: 1.5rem;
  }
}

@media (min-width: 1750px) {
  .c3d-app-grid {
    grid-template-columns: minmax(660px, 1.5fr) minmax(520px, 620px);
    gap: 1.75rem;
  }
}

.c3d-col-viewport { gap: 0.75rem; }

/* Stage-Höhe: kompakt genug, dass Preis + Stage ohne Scrollen sichtbar sind */
.c3d-studio-split[data-studio-mode="split"] { height: 500px; min-height: 420px; }
.c3d-studio-split[data-studio-mode="2d"],
.c3d-studio-split[data-studio-mode="3d"] { height: 540px; }

/* --- Toolbar -------------------------------------------------------------- */
.c3d-studio-mode-bar {
  padding: 0.25rem 0.4rem;
  gap: 0.4rem;
  flex-wrap: nowrap;
}

.c3d-mode-btn { padding: 4px 10px; font-size: 0.71rem; letter-spacing: 0.01em; }
.c3d-studio-action-btn { padding: 3px 8px; font-size: 0.7rem; }
.c3d-studio-icon-btn { padding: 3px 7px; min-width: 27px; font-size: 0.76rem; }
.c3d-studio-toggles-group { margin-left: auto; }

.c3d-toolbar-sep {
  width: 1px;
  height: 16px;
  background: var(--c3d-border);
  flex: 0 0 auto;
}

/* --- Preis- & Kapazitätskarte -------------------------------------------- */
.c3d-price-card {
  padding: 0.75rem 0.9rem !important;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.c3d-price-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.c3d-price-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--c3d-text-primary);
  font-family: 'Space Grotesk', sans-serif;
}

.c3d-price-flag {
  font-size: 0.66rem;
  font-weight: 700;
  color: #34d399;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(16, 185, 129, 0.28);
  padding: 1px 6px;
  border-radius: 4px;
}

.c3d-capacity-inline {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(56, 189, 248, 0.07);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 6px;
  padding: 2px 8px;
  white-space: nowrap;
}

.c3d-capacity-inline .c3d-capacity-value {
  font-size: 0.7rem;
  font-weight: 700;
  color: #7dd3fc;
  font-family: inherit;
}

.c3d-capacity-inline .c3d-capacity-badge {
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--c3d-text-muted);
  background: none;
  border: none;
  border-left: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 0;
  padding: 0 0 0 0.45rem;
}

.c3d-price-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.85rem;
  font-size: 0.68rem;
  color: var(--c3d-text-muted);
  border-top: 1px solid var(--c3d-border);
  border-bottom: 1px solid var(--c3d-border);
  padding: 0.3rem 0;
}

.c3d-price-specs em {
  font-style: normal;
  color: var(--c3d-text-light);
}

.c3d-price-specs strong {
  font-weight: 700;
  color: var(--c3d-text-primary);
}

.c3d-price-lines {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  font-size: 0.76rem;
}

.c3d-price-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--c3d-text-muted);
}

.c3d-price-row > span:last-child { font-variant-numeric: tabular-nums; }
.c3d-price-row-extra { color: #7dd3fc; font-weight: 600; }
.c3d-price-row-discount { color: #34d399; font-weight: 600; }

.c3d-price-total {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-top: 1px solid var(--c3d-border);
  padding-top: 0.45rem;
}

.c3d-price-total-meta > div:first-child {
  font-size: 0.72rem;
  color: var(--c3d-text-muted);
}

.c3d-price-total-meta > div:first-child strong {
  color: var(--c3d-text-primary);
  font-weight: 700;
}

.c3d-price-total-meta #calc-vat-notice {
  font-size: 0.64rem;
  color: var(--c3d-text-light);
}

.c3d-price-total-sum { text-align: right; }

#calc-gross-total {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.42rem;
  font-weight: 800;
  line-height: 1.05;
  color: var(--c3d-text-primary);
}

.c3d-price-total-sum > div:last-child {
  font-size: 0.66rem;
  color: var(--c3d-text-muted);
}

/* --- Inspector-Spalte: Tabs fest, Inhalt scrollt ------------------------- */
.c3d-col-controls {
  gap: 0.6rem;
  max-height: calc(100vh - 6.5rem);
  overflow: hidden;
  position: sticky;
  top: 1rem;
}

.c3d-studio-tabs { flex: 0 0 auto; padding: 4px; gap: 3px; }

.c3d-studio-tab {
  flex-direction: row;
  gap: 5px;
  padding: 0.45rem 0.4rem;
  min-width: 0;
  border-radius: 8px;
}

.c3d-studio-tab .c3d-tab-icon { font-size: 0.95rem; }
.c3d-studio-tab .c3d-tab-text { font-size: 0.72rem; letter-spacing: 0; }

.c3d-tab-panel.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 3px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.c3d-tab-panel.active::-webkit-scrollbar { width: 6px; }
.c3d-tab-panel.active::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}
.c3d-tab-panel.active::-webkit-scrollbar-track { background: transparent; }

/* --- Karten dichter ------------------------------------------------------ */
.c3d-studio-card {
  padding: 0.8rem 0.85rem;
  margin-bottom: 0.65rem;
  border-radius: var(--c3d-radius);
}

.c3d-studio-card-header {
  margin-bottom: 0.55rem;
  padding-bottom: 0.35rem;
}

.c3d-studio-card-title { font-size: 0.82rem; gap: 0.35rem; }
.c3d-studio-card-sub { font-size: 0.66rem; }

/* --- Vorlagen & Profile -------------------------------------------------- */
.c3d-templates-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.c3d-template-card {
  flex-direction: row;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.45rem;
  text-align: left;
  border-width: 1px;
  border-radius: 8px;
}

.c3d-template-card:hover { transform: none; }
.c3d-template-icon { font-size: 0.95rem; }
.c3d-template-title { font-size: 0.68rem; line-height: 1.2; }
.c3d-template-sub { display: none; }

.c3d-profiles-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 0;
}

.c3d-profile-card {
  padding: 0.4rem 0.5rem;
  gap: 0.1rem;
  border-width: 1px;
  border-radius: 8px;
}

.c3d-profile-header { font-size: 0.72rem; gap: 0.3rem; }
.c3d-profile-specs { font-size: 0.64rem; }

/* --- Grundformen & Maße -------------------------------------------------- */
.c3d-shape-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.25rem;
  margin-bottom: 0.6rem;
}

.c3d-shape-btn {
  padding: 0.38rem 0.1rem;
  gap: 0.1rem;
  border-width: 1px;
  border-radius: 8px;
}

.c3d-shape-btn:hover { transform: none; }
.c3d-shape-icon { font-size: 1rem; }
.c3d-shape-title { font-size: 0.62rem; font-weight: 700; }
.c3d-shape-sub { display: none; }

.c3d-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
}

.c3d-field-hint {
  font-size: 0.63rem;
  font-weight: 600;
  color: #7dd3fc;
}

.c3d-field-block { margin-bottom: 0.6rem; }

.c3d-dim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.7rem;
}

.c3d-dim-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.c3d-dim-field-wide { grid-column: 1 / -1; margin-top: 0.5rem; }
.c3d-dim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.c3d-dim-head .c3d-label { margin: 0; font-size: 0.67rem; }
.c3d-dim-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
}

.c3d-input-mini {
  width: 54px;
  height: 24px;
  padding: 0 6px !important;
  text-align: right;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 22px;
  font-variant-numeric: tabular-nums;
}

.c3d-dim-unit {
  display: inline-flex;
  align-items: center;
  height: 24px;
  font-size: 0.62rem;
  line-height: 1;
  color: var(--c3d-text-light);
}

.c3d-dim-badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: #7dd3fc;
  font-variant-numeric: tabular-nums;
}

/* --- Schalter-Zeilen ----------------------------------------------------- */
.c3d-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding: 0.35rem 0.6rem;
  margin-top: 0.4rem;
  border: 1px solid var(--c3d-border);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.04);
}

.c3d-toggle-row-flat {
  margin-top: 0.5rem;
  padding: 0.1rem 0;
  border: none;
  background: none;
}

.c3d-toggle-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.c3d-toggle-title {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--c3d-text-primary);
  line-height: 1.25;
}

.c3d-toggle-hint {
  font-size: 0.64rem;
  color: var(--c3d-text-muted);
  line-height: 1.3;
}

.c3d-toggle-box {
  border: 1px solid var(--c3d-border);
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.04);
  padding: 0.1rem 0.6rem 0.1rem;
  margin-bottom: 0.6rem;
}

.c3d-toggle-box .c3d-toggle-row { border: none; background: none; padding: 0.25rem 0; margin: 0; }

/* --- Farben & Finish ----------------------------------------------------- */
.c3d-swatch-block { margin-top: 0.65rem; }
.c3d-swatch-block .c3d-label { display: block; margin-bottom: 0.2rem; }

.c3d-subsection {
  margin-top: 0.75rem;
  padding-top: 0.6rem;
  border-top: 1px solid var(--c3d-border);
}

.c3d-subsection .c3d-label { display: block; margin-bottom: 0.3rem; }

.c3d-emboss-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.c3d-emboss-btn {
  padding: 0.4rem 0.3rem;
  align-items: center;
  text-align: center;
  gap: 0.05rem;
  border-width: 1px;
  border-radius: 8px;
}

.c3d-emboss-btn .emboss-icon { font-size: 0.95rem; margin: 0; }
.c3d-emboss-btn .emboss-title { font-size: 0.7rem; }
.c3d-emboss-btn .emboss-desc { font-size: 0.61rem; }

.c3d-inline-hint {
  font-size: 0.68rem;
  color: #7dd3fc;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 6px;
  padding: 4px 8px;
  margin-top: 0.15rem;
  line-height: 1.35;
}

/* --- Elemente hinzufügen ------------------------------------------------- */
.c3d-add-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem;
}

.c3d-add-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  padding: 0.5rem 0.25rem;
  border: 1px solid var(--c3d-border);
  border-radius: 8px;
  background: var(--c3d-bg);
  color: var(--c3d-text-body);
  font-family: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
}

.c3d-add-tile:hover {
  border-color: var(--c3d-blue);
  color: var(--c3d-blue);
  background: rgba(56, 189, 248, 0.06);
}

.c3d-add-tile-primary {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.1);
  color: #7dd3fc;
}

.c3d-add-icon {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1rem;
  line-height: 1;
  font-weight: 800;
}

/* --- Stückzahl & Rabatt -------------------------------------------------- */
.c3d-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.c3d-qty-stepper { display: inline-flex; align-items: center; gap: 0.25rem; }

.c3d-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid var(--c3d-border);
  background: var(--c3d-bg);
  color: var(--c3d-text-body);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: all var(--c3d-transition-fast);
}

.c3d-qty-btn:hover { border-color: var(--c3d-blue); color: var(--c3d-blue); }

.c3d-qty-input {
  width: 56px;
  padding: 3px 4px;
  text-align: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.c3d-discount-chips {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.c3d-discount-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 0.25rem 0.15rem;
  border: 1px solid var(--c3d-border);
  border-radius: 6px;
  background: var(--c3d-bg);
}

.c3d-discount-chip em {
  font-style: normal;
  font-size: 0.6rem;
  color: var(--c3d-text-muted);
}

.c3d-discount-chip strong { font-size: 0.72rem; color: #34d399; }

/* --- Anfrageformular ----------------------------------------------------- */
.c3d-inquiry-form { display: flex; flex-direction: column; gap: 0.5rem; }
.c3d-inquiry-form .c3d-label { margin-bottom: 0.15rem; }

/* --- Schritt-Navigation bleibt beim Scrollen sichtbar -------------------- */
.c3d-step-nav-footer {
  position: sticky;
  bottom: 0;
  margin-top: 0.6rem;
  padding: 0.5rem 0 0.35rem;
  background: var(--c3d-bg);
  border-top: 1px solid var(--c3d-border);
  z-index: 3;
}

.c3d-step-nav-footer .c3d-btn-sm,
.c3d-step-nav-footer .c3d-next-step-btn {
  padding: 0.45rem 0.8rem;
  font-size: 0.74rem;
}

/* --- Segmented Controls dichter ------------------------------------------ */
.c3d-seg-control { padding: 2px; gap: 2px; border-radius: 7px; }
.c3d-seg-btn { padding: 0.32rem 0.3rem; font-size: 0.7rem; border-radius: 5px; }

/* --- Hinweisbanner (Senkung) --------------------------------------------- */
.c3d-alert-banner {
  background: rgba(239, 68, 68, 0.1) !important;
  border: 1px solid rgba(239, 68, 68, 0.32) !important;
  color: #fca5a5 !important;
  border-radius: 6px !important;
  padding: 0.45rem 0.55rem !important;
  margin-top: 0.4rem !important;
  animation: none;
}

.c3d-btn-danger {
  background: #dc2626;
  color: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 2px 8px;
  margin-top: 0.35rem;
  cursor: pointer;
  border-radius: 5px;
}

/* --- Schmalere Screens: natürlicher Fluss -------------------------------- */
@media (max-width: 1200px) {
  .c3d-col-controls {
    max-height: none;
    overflow: visible;
    position: static;
  }

  .c3d-tab-panel.active {
    display: block;
    overflow: visible;
    padding-right: 0;
  }

  .c3d-step-nav-footer { position: static; background: none; }
  .c3d-studio-mode-bar { flex-wrap: wrap; }
}

@media (max-width: 640px) {
  .c3d-app-main { padding: 0.75rem 0.75rem 1.5rem; }
  .c3d-studio-split[data-studio-mode="split"] { height: auto; min-height: 0; }
  .c3d-studio-split[data-studio-mode="2d"],
  .c3d-studio-split[data-studio-mode="3d"] { height: 420px; }

  .c3d-templates-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .c3d-shape-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c3d-dim-grid { grid-template-columns: 1fr; }
  .c3d-capacity-inline { margin-left: 0; }
  .c3d-tab-text { display: none; }
  .c3d-studio-tab .c3d-tab-icon { font-size: 1.1rem; }
}

/* --- Schalter (waren ohne jedes Styling: nur ein 13px-Stummel) ----------- */
.c3d-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  width: 38px;
  height: 22px;
  cursor: pointer;
  margin: 0;
}

.c3d-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.c3d-slider-round {
  position: absolute;
  inset: 0;
  display: block;
  background: rgba(148, 163, 184, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  transition: background 0.18s ease, border-color 0.18s ease;
}

.c3d-slider-round::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 50%;
  background: #cbd5e1;
  transition: transform 0.18s ease, background 0.18s ease;
}

.c3d-switch input:checked + .c3d-slider-round {
  background: var(--c3d-blue);
  border-color: var(--c3d-blue);
}

.c3d-switch input:checked + .c3d-slider-round::before {
  transform: translate(16px, -50%);
  background: #04121f;
}

.c3d-switch input:focus-visible + .c3d-slider-round {
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.35);
}

.c3d-switch input:disabled + .c3d-slider-round { opacity: 0.45; cursor: not-allowed; }

/* --- Canvas-Overlays im schmaleren 2D-Feld kompakt ---------------------- */
.c3d-canvas-floating-bar {
  max-width: calc(100% - 16px);
  right: auto;
}

.c3d-floating-bar-content {
  flex-wrap: wrap;
  gap: 4px 6px;
}

#float-format-empty { flex-wrap: wrap; gap: 4px 6px !important; }

.c3d-camera-presets { padding: 3px; gap: 3px; }
.c3d-cam-btn { padding: 4px 7px; font-size: 0.68rem; gap: 3px; }

.c3d-dim-hud {
  max-width: calc(100% - 24px);
  flex-wrap: wrap;
  gap: 2px 6px;
  font-size: 0.66rem;
  line-height: 1.3;
  padding: 4px 7px;
  bottom: 44px;
}

.c3d-2d-view-badge { font-size: 0.64rem; padding: 3px 7px; }

/* --- Farbpalette mit lesbaren Namen ------------------------------------- */
.c3d-color-swatches-grid {
  grid-template-columns: repeat(auto-fill, minmax(58px, 72px));
  gap: 0.4rem;
  justify-content: start;
}

.c3d-swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.c3d-swatch-item .c3d-color-swatch-btn { width: 100%; }

.c3d-swatch-name {
  font-size: 0.6rem;
  line-height: 1.15;
  color: var(--c3d-text-muted);
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.c3d-swatch-name.active { color: var(--c3d-blue); font-weight: 700; }

.c3d-combo-sample-badge {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.c3d-color-combo-preview {
  padding: 0.45rem 0.65rem;
  margin-top: 0.2rem;
  font-size: 0.72rem;
}

/* --- Leiste im 2D-Canvas einzeilig halten ------------------------------ */
.c3d-floating-bar-content .c3d-f-btn {
  padding: 3px 6px;
  font-size: 0.68rem;
}

#float-format-empty { gap: 5px !important; flex-wrap: nowrap !important; }
#float-format-empty > span:first-child { font-size: 0.66rem !important; white-space: nowrap; }
#float-format-empty .f-divider { display: none; }

/* --- Buttons in der Canvas-Leiste nie umbrechen ------------------------- */
.c3d-floating-bar-content .c3d-f-btn { white-space: nowrap; }

/* --- Segmented Controls: aktiver Zustand klarer ------------------------ */
.c3d-seg-btn { color: var(--c3d-text-body); }

.c3d-seg-btn:hover {
  color: var(--c3d-text-primary);
  background: rgba(148, 163, 184, 0.1);
}

.c3d-seg-btn.active {
  background: rgba(56, 189, 248, 0.16);
  color: #7dd3fc;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(56, 189, 248, 0.45);
}

/* Aktive Farbkachel nicht über die Beschriftung skalieren */
.c3d-swatch-item .c3d-color-swatch-btn.active { transform: none; }
.c3d-swatch-item .c3d-color-swatch-btn:hover { transform: scale(1.04); z-index: 1; }
.c3d-swatch-name { margin-top: 2px; }

/* Stage passt sich der Fensterhöhe an, damit Werkzeugleiste, Vorschau und
   Preis ohne Scrollen zusammen sichtbar bleiben */
@media (min-width: 1201px) {
  .c3d-studio-split[data-studio-mode="split"] {
    height: clamp(420px, calc(100vh - 460px), 540px);
    min-height: 0;
  }
}

/* Grundform-Icons: einheitliche Linien statt gemischter Emoji-Glyphen */
.c3d-shape-btn .shape-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--c3d-text-body);
}

.c3d-shape-btn .shape-icon svg { width: 18px; height: 18px; display: block; }
.c3d-shape-btn.active .shape-icon { color: var(--c3d-blue); }

/* --- Kleben / Magnet: Unterauswahl und Rückseiten-Vorschau ---------------- */
#seg-adhesive-type .c3d-seg-btn {
  white-space: normal;
  line-height: 1.2;
  min-height: 30px;
}

.c3d-magnet-preview-shell {
  background: #0b1120;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 0.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.c3d-magnet-preview-svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 155px;
}

.c3d-magnet-status {
  margin-top: 0.35rem;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: #7dd3fc;
}

.c3d-magnet-specs {
  margin-top: 0.1rem;
  text-align: center;
  font-size: 0.64rem;
  color: var(--c3d-text-muted);
}

#alert-magnet-thickness .c3d-btn-danger {
  margin-top: 0.4rem;
}
