/* ========== L6 Konfigurator v2.0.0 - Global Styles ========== */
* {
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}

body {
  overscroll-behavior: none;
  margin: 0;
  -webkit-font-smoothing: antialiased;
  font-family: 'Roboto', 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ========== Design System Variables (M3 Material Design 3) ========== */
:root {
  --g50: #FAFAFA;
  --g100: #F5F5F5;
  --g200: #E5E5E5;
  --g300: #D4D4D4;
  --g400: #A3A3A3;
  --g500: #737373;
  --g600: #525252;
  --g700: #404040;
  --g800: #262626;
  --g900: #171717;
  --red-accent: #E02020;
  --surface: #F2F0ED;
  /* M3 tokens */
  --md-sys-color-primary: #1a1a1a;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #E8E8E8;
  --md-sys-color-on-primary-container: #1a1a1a;
  --md-sys-color-secondary-container: #F0F0F0;
  --md-sys-color-on-secondary-container: #525252;
  --md-sys-color-surface: #FFFBFE;
  --md-sys-color-surface-variant: #E7E0EC;
  --md-sys-color-on-surface: #1C1B1F;
  --md-sys-color-on-surface-variant: #49454F;
  --md-sys-color-outline: #CAC4D0;
  --md-sys-color-outline-variant: #CAC4D0;
  --md-sys-shape-corner-small: 8px;
  --md-sys-shape-corner-medium: 12px;
  --md-sys-shape-corner-large: 16px;
  --md-sys-shape-corner-full: 100px;
  --button-radius: 100px;
  --card-radius-small: 8px;
  --card-radius: 12px;
  --card-radius-large: 16px;
}

/* ========== Canvas & Viewport ========== */
#canvas3d {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

/* ========== Arrow Buttons in Viewport ========== */
.arr-btn {
  position: absolute;
  pointer-events: auto;
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transform: translate(-50%, -50%);
  transition: transform 0.12s, opacity 0.12s;
  opacity: 0;
}

.arr-btn.visible {
  display: flex;
  opacity: 1;
}

.arr-btn:active {
  transform: translate(-50%, -50%) scale(0.88) !important;
}

.arr-add {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a1a1a;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.arr-add svg line {
  stroke: #fff;
}

@media (max-width: 767px) {
  .arr-add {
    width: 30px;
    height: 30px;
  }
  .arr-add svg {
    width: 16px;
    height: 16px;
  }
}

.arr-del {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #fff;
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ========== App Layout ========== */
.app-layout {
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) {
  .app-layout {
    flex-direction: row;
    height: calc(100vh - 48px - 72px);
    height: calc(100dvh - 48px - 72px);
  }
}

@media (max-width: 767px) {
  .app-layout {
    height: calc(100vh - 48px - 50px);
    height: calc(100dvh - 48px - 50px);
    height: calc(100svh - 48px - 50px);
    overflow: hidden;
  }
}

/* ========== Viewport Area ========== */
.viewport-area {
  display: flex;
  flex-direction: row;
  position: relative;
  background: var(--surface);
  overflow: hidden;
}

@media (min-width: 768px) {
  .viewport-area {
    flex: 1;
    height: auto;
  }
}

@media (max-width: 767px) {
  .viewport-area {
    flex-shrink: 0;
    height: 45vh;
    flex-direction: column;
    transition: height 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  }
  /* Shrink viewport when panel is open to give more room */
  .app-layout.panel-active .viewport-area {
    height: 36vh;
  }
}

/* ========== Viewport Canvas Container ========== */
#viewport {
  position: relative;
  flex: 1;
  background: var(--surface);
  overflow: hidden;
}

/* ========== M3 Navigation Rail (Desktop Toolbar) ========== */
.toolbar-v {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
  padding: 16px 0;
  background: var(--md-sys-color-surface);
  border-left: none;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .toolbar-v {
    width: 56px;
    min-width: 56px;
    flex-direction: column;
    background: var(--md-sys-color-surface);
    box-shadow: -1px 0 3px rgba(0,0,0,0.05);
  }
}

@media (max-width: 767px) {
  .toolbar-v {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 36px;
    flex-direction: row;
    border-left: none;
    border-bottom: 1px solid rgba(0,0,0,0.06);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 3px 6px;
    gap: 2px;
    justify-content: center;
  }
}

/* ========== M3 Icon Buttons (Toolbar) ========== */
.tbv-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: var(--md-sys-shape-corner-full);
  color: var(--md-sys-color-on-surface-variant);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  flex-shrink: 0;
  position: relative;
}

/* i.07: hover only on devices with actual hover (prevents sticky touch highlights) */
@media (hover: hover) {
  .tbv-btn:hover {
    background: rgba(28, 27, 31, 0.08);
    color: var(--md-sys-color-on-surface);
  }
}

/* i.07: clear focus background for mouse/touch clicks */
.tbv-btn:focus:not(:focus-visible) {
  background: transparent;
  outline: none;
}

.tbv-btn.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

.tbv-btn[disabled] {
  opacity: 0.3;
  cursor: default;
}

.tbv-btn[disabled]:hover {
  background: transparent;
  color: var(--g500);
}

@media (max-width: 767px) {
  .tbv-btn {
    width: 28px;
    height: 28px;
    font-size: 10px;
    border-radius: 6px;
  }
  .tbv-btn svg {
    width: 13px;
    height: 13px;
  }
}

/* ========== Toolbar Separator ========== */
.tbv-sep {
  flex-shrink: 0;
  background: var(--g200);
}

@media (min-width: 768px) {
  .tbv-sep {
    width: 20px;
    height: 1px;
    margin: 4px 0;
  }
}

@media (max-width: 767px) {
  .tbv-sep {
    width: 1px;
    height: 12px;
    margin: 0 3px;
  }
}

/* ========== Property Panel ========== */
.property-panel {
  display: none;
  flex-direction: column;
  background: #fff;
  overflow: hidden;
}

.property-panel.open {
  display: flex;
}

@media (min-width: 768px) {
  .property-panel {
    width: 380px;
    flex-shrink: 0;
    border-left: none;
    box-shadow: -2px 0 8px rgba(0,0,0,0.08);
    background: var(--md-sys-color-surface);
  }
}

@media (max-width: 767px) {
  .property-panel {
    flex: 1;
    min-height: 0;
    border-top: none;
    border-radius: 28px 28px 0 0;
    margin-top: -12px;
    position: relative;
    z-index: 5;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.1);
    background: var(--md-sys-color-surface);
  }
}

/* ========== M3 Icon Button (Panel Close) ========== */
.panel-close {
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: var(--md-sys-shape-corner-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--md-sys-color-on-surface-variant);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  flex-shrink: 0;
  margin-left: auto;
}

.panel-close:hover {
  background: rgba(28, 27, 31, 0.08);
  color: var(--md-sys-color-on-surface);
}

/* ========== Bottom Sheet Grab Handle (mobile) ========== */
.sheet-handle {
  display: none;
}

@media (max-width: 767px) {
  .sheet-handle {
    display: flex;
    justify-content: center;
    padding: 12px 0 8px;
    flex-shrink: 0;
    cursor: grab;
  }
  .sheet-handle::after {
    content: '';
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: var(--md-sys-color-outline-variant);
    opacity: 0.4;
    transition: all 0.2s;
  }
  .sheet-handle:active::after {
    background: var(--md-sys-color-on-surface-variant);
    opacity: 0.6;
  }
}

/* ========== M3 Tab Bar ========== */
.tab-bar {
  display: flex;
  flex-direction: row;
  align-items: center;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  padding: 0 16px;
  gap: 0;
  flex-shrink: 0;
  background: var(--md-sys-color-surface);
}

.tab-btn {
  padding: 12px 16px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  position: relative;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  min-height: 48px;
  letter-spacing: 0.1px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-btn:hover {
  color: var(--md-sys-color-on-surface);
  background: rgba(28, 27, 31, 0.08);
}

.tab-btn.active {
  color: var(--md-sys-color-primary);
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: var(--md-sys-color-primary);
  border-radius: 3px 3px 0 0;
  animation: tab-slide 0.25s cubic-bezier(0.2, 0, 0, 1);
}

@keyframes tab-slide {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

.tab-module-info {
  font-size: 10px;
  font-weight: 500;
  color: var(--g400);
  margin-right: 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ========== Tab Content ========== */
.tab-content-wrap {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.tab-pane {
  display: none;
  overflow-y: auto;
  padding: 16px 20px;
  flex: 1;
  min-height: 0;
}

@media (max-width: 767px) {
  .tab-pane {
    padding: 6px 12px;
  }
}

.tab-pane.active {
  display: flex;
  flex-direction: column;
}

/* ========== Oberfläche Sections (always visible) ========== */
.ob-section {
  display: block;
  padding: 10px 0;
}

.ob-section:first-child {
  padding-top: 0;
}

.ob-section + .ob-section {
  border-top: 1px solid var(--md-sys-color-outline-variant);
  padding-top: 12px;
}

/* M3 Active section indicator */
.ob-section.has-selection {
  border-left: 3px solid var(--md-sys-color-primary);
  padding-left: 12px;
  margin-left: -3px;
}

@media (max-width: 767px) {
  .ob-section.has-selection {
    padding-left: 8px;
  }
}

@media (max-width: 767px) {
  .ob-section {
    padding: 3px 0;
  }
  /* Enable scrolling in tab panes on mobile when content overflows */
  .tab-pane.active {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ========== Collapsible Sections (v19+v20) ========== */
.section-body {
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
  opacity: 1;
}

.ob-section.collapsed .section-body {
  max-height: 0;
  opacity: 0;
  margin: 0;
}

.ob-section.collapsed {
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 8px 12px;
  margin: 4px 0;
}

@media (max-width: 767px) {
  .ob-section.collapsed {
    padding: 6px 10px;
  }
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s;
}

.ob-section.collapsed .section-header {
  margin-bottom: 0;
}

.section-expand {
  display: none;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--g300);
  border-radius: 5px;
  background: #fff;
  cursor: pointer;
  color: var(--g500);
  font-size: 14px;
  font-weight: 300;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.ob-section.collapsed .section-expand {
  display: flex;
}

.section-expand:hover {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
  transform: scale(1.1);
}

.section-expand:active {
  transform: scale(0.9);
}

/* ========== M3 Section Label (Label Large) ========== */
.section-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.5px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 8px;
  line-height: 16px;
}

@media (max-width: 767px) {
  .section-label {
    font-size: 9px;
    margin-bottom: 2px;
    letter-spacing: 0.8px;
  }
}

/* M3 Section status badge */
.section-status {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: var(--md-sys-shape-corner-small);
  margin-left: 8px;
  text-transform: none;
  letter-spacing: 0.1px;
  height: 20px;
}

.section-status.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
}

.section-status.inactive {
  background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface-variant);
}

.scope-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: var(--md-sys-shape-corner-small);
  background: transparent;
  border: 1px solid var(--md-sys-color-outline);
  color: var(--md-sys-color-on-surface);
  margin-left: 8px;
  height: 24px;
  letter-spacing: 0.1px;
}

/* ========== M3 Filter Chips (Material Pills) ========== */
.mat-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  margin-bottom: 8px;
}

.mat-pill {
  padding: 6px 10px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-surface);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.1px;
  line-height: 20px;
  height: 32px;
  display: inline-flex;
  align-items: center;
}

.mat-pill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: currentColor;
  opacity: 0;
  transition: opacity 0.2s;
}

.mat-pill:hover::before {
  opacity: 0.08;
}

.mat-pill:active::before {
  opacity: 0.12;
}

.mat-pill:hover {
  border-color: var(--md-sys-color-on-surface);
}

.mat-pill:active {
  transform: scale(0.97);
}

.mat-pill.selected {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  border-color: transparent;
  font-weight: 600;
}

/* Price hint — hidden v10.1+ */
.pill-price {
  display: none;
  font-size: 9px;
  font-weight: 400;
  color: var(--g400);
  margin-left: 2px;
}

.mat-pill.selected .pill-price {
  color: rgba(255,255,255,0.6);
}

@media (max-width: 767px) {
  .pill-price {
    font-size: 8px;
  }
}

.mat-pill.no-shelf-pill {
  color: var(--md-sys-color-on-surface-variant);
  border-style: dashed;
}

.mat-pill.no-shelf-pill.selected {
  background: var(--md-sys-color-on-surface-variant);
  color: var(--md-sys-color-surface);
  border-style: solid;
  border-color: transparent;
}

@media (max-width: 767px) {
  .mat-pill {
    padding: 4px 12px;
    font-size: 11px;
    height: 28px;
    border-radius: var(--md-sys-shape-corner-small);
  }
  .mat-pills {
    gap: 6px;
    margin-bottom: 4px;
  }
}

/* ========== Color Swatches ========== */
.swatches-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.swatch-dot {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

.swatch-dot:hover {
  transform: scale(1.08);
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.swatch-dot:active {
  transform: scale(0.92);
}

.swatch-dot.selected {
  border-color: var(--md-sys-color-primary);
  box-shadow: 0 0 0 2px var(--md-sys-color-surface), 0 0 0 4px var(--md-sys-color-primary);
}

/* Light-colored swatches need visible border */
.swatch-dot.swatch-light {
  border: 1.5px solid #ccc;
}

.swatch-dot.swatch-light.selected {
  border-color: #1a1a1a;
}

@media (max-width: 767px) {
  .swatches-row {
    gap: 6px;
    margin-bottom: 2px;
  }
  .swatch-dot {
    width: 26px;
    height: 26px;
  }
  .swatch-dot.selected {
    box-shadow: 0 0 0 1.5px #fff, 0 0 0 2.5px #1a1a1a;
  }
}

/* ========== Swatch Grid (labeled swatches) ========== */
.swatches-grid {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.swatch-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  border-radius: var(--md-sys-shape-corner-medium);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  min-width: 48px;
  position: relative;
}

.swatch-item:hover {
  background: rgba(28, 27, 31, 0.08);
}

.swatch-item:active {
  transform: scale(0.95);
}

.swatch-item.selected {
  background: var(--md-sys-color-secondary-container);
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.swatch-label {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  line-height: 16px;
  white-space: nowrap;
  max-width: 56px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: capitalize;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.swatch-item.selected .swatch-label {
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 600;
}

@media (max-width: 767px) {
  .swatches-grid {
    gap: 0px;
    margin-bottom: 1px;
  }
  .swatch-item {
    padding: 2px 3px;
    min-width: 36px;
    border-radius: 6px;
  }
  .swatch-dot {
    width: 22px;
    height: 22px;
  }
  .swatch-label {
    font-size: 7px;
    max-width: 40px;
  }
}

/* Apply-all inline button (legacy) */
.apply-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border: 1px solid var(--g200);
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: 9px;
  color: var(--g400);
  transition: all 0.15s;
  flex-shrink: 0;
  margin-left: 6px;
  white-space: nowrap;
}

.apply-all-btn:hover {
  background: var(--g100);
  color: #1a1a1a;
  border-color: var(--g300);
}

/* M3 Filled Tonal Button (Apply-all) */
.apply-all-btn-wide {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 8px 16px;
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  background: var(--md-sys-color-secondary-container);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-secondary-container);
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  margin-top: 8px;
  height: 36px;
  letter-spacing: 0.1px;
  position: relative;
  overflow: hidden;
}

.apply-all-btn-wide:hover {
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

.apply-all-btn-wide:active {
  transform: scale(0.98);
}

@media (max-width: 767px) {
  .apply-all-btn-wide {
    padding: 3px 8px;
    font-size: 8px;
    margin-top: 1px;
  }
}

/* ========== M3 Segmented Button (Height Toggle) ========== */
.segmented {
  display: flex;
  gap: 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  margin-bottom: 12px;
  overflow: hidden;
}

.seg-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  border-right: 1px solid var(--md-sys-color-outline);
  background: transparent;
  border-radius: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  letter-spacing: 0.1px;
}

.seg-btn:last-child {
  border-right: none;
}

.seg-btn:hover {
  background: rgba(28, 27, 31, 0.08);
}

.seg-btn.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 600;
  box-shadow: none;
}

@media (max-width: 767px) {
  .segmented { margin-bottom: 6px; }
  .seg-btn { padding: 8px 12px; font-size: 12px; min-height: 36px; }
}

/* (No-shelf pill is handled via .mat-pill.no-shelf-pill above) */

/* ========== M3 Quick Actions (Outlined Buttons) ========== */
.quick-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.quick-btn {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-primary);
  cursor: pointer;
  text-align: center;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  letter-spacing: 0.1px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quick-btn:hover {
  background: rgba(28, 27, 31, 0.08);
}

.quick-btn:active {
  transform: scale(0.97);
}

@media (max-width: 767px) {
  .quick-actions { gap: 6px; margin-bottom: 8px; }
  .quick-btn { padding: 6px 10px; font-size: 11px; height: 32px; }
}

/* ========== M3 Filled Card (Module Summary) ========== */
.module-summary {
  background: var(--md-sys-color-secondary-container);
  border-radius: var(--md-sys-shape-corner-medium);
  padding: 12px 16px;
  margin-bottom: 8px;
  border: none;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--g600);
  padding: 2px 0;
}

.summary-value {
  font-weight: 600;
  color: #1a1a1a;
}

.summary-label {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--g400);
  margin-bottom: 4px;
}

.summary-text {
  font-size: 11px;
  color: var(--g600);
  line-height: 1.5;
}

@media (max-width: 767px) {
  .module-summary { padding: 8px 10px; border-radius: 6px; }
  .summary-row { font-size: 10px; padding: 2px 0; }
}

/* ========== Dividers ========== */
.pp-divider {
  height: 1px;
  background: var(--g200);
  margin: 8px 0;
}

@media (max-width: 767px) {
  .pp-divider { margin: 6px 0; }
}

/* ========== M3 Body Small (Hint Text) ========== */
.hint-text {
  font-size: 12px;
  color: var(--md-sys-color-on-surface-variant);
  margin-bottom: 8px;
  letter-spacing: 0.4px;
  line-height: 16px;
}

@media (max-width: 767px) {
  .hint-text { font-size: 11px; margin-bottom: 4px; }
}

/* (Config code section hidden in v2.0.0 mobile — elements kept in DOM for WC integration) */

/* ========== Animation: Selection Pulse ========== */
@keyframes swatch-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

.swatch-item.selected .swatch-dot {
  animation: swatch-pulse 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* i.02 C3: First-use connector highlight */
@keyframes connector-highlight-pulse {
  0% { box-shadow: 0 0 0 0 rgba(212, 98, 43, 0.4); }
  70% { box-shadow: 0 0 0 8px rgba(212, 98, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(212, 98, 43, 0); }
}
.connector-highlight {
  animation: connector-highlight-pulse 1.5s ease 0.5s 2;
  border-radius: 8px;
  padding: 8px;
  margin: -8px;
}

/* i.02 B4: Fade-in animation for swatches grid on material switch */
@keyframes swatches-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
.swatches-grid {
  animation: swatches-fade-in 0.2s ease-out;
}

/* ========== Animation: Panel Fade-in ========== */
@keyframes panel-fadein {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 767px) {
  .property-panel.open .tab-content-wrap {
    animation: panel-fadein 0.25s ease-out;
  }
}

/* ========== Animation: Shake ========== */
@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  20%, 60% {
    transform: translateX(-4px);
  }
  40%, 80% {
    transform: translateX(4px);
  }
}

.shake {
  animation: shake 0.4s ease-in-out;
  border-color: var(--red-accent) !important;
}

/* ========== Dimension Labels ========== */
.dim-label {
  position: absolute;
  pointer-events: none;
  z-index: 8;
  background: rgba(30, 30, 30, 0.78);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  backdrop-filter: blur(4px);
  transform: translate(-50%, -50%);
}

.dim-label.total {
  background: rgba(0, 0, 0, 0.85);
  font-size: 13px;
  padding: 3px 10px;
}

@media (max-width: 767px) {
  .dim-label {
    font-size: 9px;
    padding: 1px 5px;
  }
  .dim-label.total {
    font-size: 10px;
    padding: 2px 7px;
  }
}

#dims-overlay {
  overflow: hidden;
}

#dims-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 7;
}

/* ========== Height Dialog ========== */
.height-dialog {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.height-dialog.open {
  opacity: 1;
  pointer-events: auto;
}

.height-dialog-box {
  background: var(--md-sys-color-surface);
  width: 100%;
  max-width: 400px;
  padding: 24px 24px 28px;
  border-radius: 28px 28px 0 0;
  transform: translateY(20px);
  transition: transform 0.4s cubic-bezier(0.05, 0.7, 0.1, 1);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.15);
}

.height-dialog.open .height-dialog-box {
  transform: translateY(0);
}

@media (min-width: 768px) {
  .height-dialog {
    align-items: center;
  }
  .height-dialog-box {
    max-width: 360px;
    padding: 28px 32px 32px;
    border-radius: 12px;
  }
}

.height-dialog-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #999;
  margin-bottom: 16px;
}

.height-dialog-choices {
  display: flex;
  gap: 0;
  width: 100%;
}

.height-choice {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 8px;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  background: #fff;
  transition: all 0.15s;
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

.height-choice:first-child {
  border-right: none;
  border-radius: 6px 0 0 6px;
}

.height-choice:last-child {
  border-radius: 0 6px 6px 0;
}

.height-choice:hover {
  background: #f8f8f8;
}

.height-choice:active {
  transform: scale(0.97);
}

.height-choice .h-icon {
  width: 24px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.height-choice .h-bar {
  background: #ccc;
  width: 100%;
  border-radius: 2px;
}

.height-choice.active {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}

.height-choice.active .h-bar {
  background: #fff;
}

.height-dialog-cancel {
  margin-top: 12px;
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 12px;
  color: #999;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
  border-radius: 6px;
  transition: all 0.15s;
}

.height-dialog-cancel:hover {
  color: #333;
  background: #f5f5f5;
}

/* ========== Modal Overlay ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-content {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

/* ========== M3 Bottom App Bar ========== */
#bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 72px;
  background: var(--md-sys-color-surface);
  box-shadow: 0 -2px 4px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 40;
}

/* ========== Bottom Bar - Price Section ========== */
.bottom-bar-price {
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
}

#price-lines {
  font-size: 12px;
  color: var(--g400);
}

@media (max-width: 767px) {
  #price-lines {
    display: none;
  }
}

.price-total-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

#price-total {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.5px;
}

.price-vat {
  font-size: 10px;
  color: var(--g400);
}

@media (max-width: 767px) {
  .price-vat {
    font-size: 9px;
  }
}

/* ========== Bottom Bar - Actions Section ========== */
.bottom-bar-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ========== M3 Buttons ========== */
.btn-primary {
  padding: 10px 24px;
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  border: none;
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  flex-shrink: 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 1px 3px 1px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.3);
}

.btn-primary:hover {
  box-shadow: 0 2px 6px 2px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.3);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-secondary {
  padding: 10px 24px;
  background: transparent;
  color: var(--md-sys-color-primary);
  border: 1px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-full);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.1px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  flex-shrink: 0;
  height: 40px;
  display: inline-flex;
  align-items: center;
}

.btn-secondary:hover {
  background: rgba(28, 27, 31, 0.08);
}

.btn-secondary:active {
  transform: scale(0.98);
}

/* ========== BOM Modal ========== */
#bom-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

#bom-modal.open {
  display: flex;
}


/* ========== v10.1.4: Panel Body (no header, no tabs) ========== */
.panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px 16px;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 767px) {
  .panel-body { padding: 10px 14px 14px; }
}

/* ========== v10.1.4: Shelf Status Indicator ========== */
.shelf-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0 2px;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface);
}
.shelf-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1.5px solid var(--md-sys-color-outline);
  flex-shrink: 0;
}
.shelf-status-dot.active { border-color: transparent; }

/* ========== i.07: Material Info Button & Popup ========== */
.mat-info-btn {
  width: 18px; height: 18px; border-radius: 50%;
  border: 1.5px solid var(--md-sys-color-outline);
  background: transparent; cursor: pointer;
  font-size: 11px; font-weight: 600; line-height: 1;
  color: var(--md-sys-color-on-surface-variant);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.mat-info-btn:hover { background: var(--md-sys-color-surface-variant); }
.mat-info-popup {
  display: none;
  background: var(--md-sys-color-surface);
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: 10px;
  padding: 14px 16px 12px;
  margin-bottom: 8px;
  position: relative;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  animation: matInfoIn 0.2s ease;
}
.mat-info-popup.open { display: block; }
@keyframes matInfoIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.mat-info-close {
  position: absolute; top: 8px; right: 10px;
  width: 22px; height: 22px; border: none; background: transparent;
  cursor: pointer; font-size: 16px; color: var(--md-sys-color-on-surface-variant);
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; transition: background 0.15s;
}
.mat-info-close:hover { background: var(--md-sys-color-surface-variant); }
.mat-info-title {
  font-size: 13px; font-weight: 600; margin-bottom: 8px;
  color: var(--md-sys-color-on-surface);
}
.mat-info-table {
  width: 100%; font-size: 11px; line-height: 1.5;
  border-collapse: collapse;
}
.mat-info-table td {
  padding: 3px 0; vertical-align: top;
}
.mat-info-table td:first-child {
  color: var(--md-sys-color-on-surface-variant);
  width: 90px; font-weight: 500; padding-right: 8px;
}
.mat-info-table td:last-child {
  color: var(--md-sys-color-on-surface);
}
.mat-info-color-desc {
  font-size: 11px; line-height: 1.5;
  color: var(--md-sys-color-on-surface);
}
.mat-info-color-desc p {
  margin: 0 0 6px;
}
.mat-info-color-desc p:last-child {
  margin-bottom: 0;
}
[data-theme="dark"] .mat-info-popup {
  box-shadow: 0 4px 16px rgba(0,0,0,0.30);
}

/* ========== v10.1.4: Apply Scope Buttons ========== */
.apply-scope-btns {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--md-sys-color-outline-variant);
}
.scope-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 6px;
  border: 1.5px solid var(--md-sys-color-outline-variant);
  border-radius: var(--md-sys-shape-corner-small);
  background: var(--md-sys-color-surface);
  font-size: 11px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.scope-btn:hover {
  background: var(--md-sys-color-primary-container);
  border-color: var(--md-sys-color-primary);
  color: var(--md-sys-color-primary);
}
.scope-btn svg { flex-shrink: 0; }
@media (max-width: 767px) {
  .scope-btn { padding: 6px 4px; font-size: 10px; }
}

/* ========== v10.1.4: Bottom bar z-index fix ========== */
#bottom-bar {
  z-index: 50 !important;
}

/* ========== v10.1.5: M3 Labeled Toggle Switch ========== */
.m3-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0 6px;
  min-height: 48px;
  user-select: none;
}
.m3-switch-label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.1px;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.45;
  transition: opacity 0.2s ease, color 0.2s ease, font-weight 0.15s ease;
  cursor: pointer;
  white-space: nowrap;
  padding: 8px 2px;
  min-width: 36px;
  text-align: center;
}
.m3-switch-label.active {
  color: var(--md-sys-color-on-surface);
  opacity: 1;
  font-weight: 600;
}
.m3-switch-track {
  position: relative;
  width: 52px;
  height: 32px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 16px;
  border: 2px solid var(--md-sys-color-outline);
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.m3-switch-track::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: 24px;
}
.m3-switch-track.on {
  background: var(--md-sys-color-primary);
  border-color: var(--md-sys-color-primary);
}
.m3-switch-thumb {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 16px;
  height: 16px;
  background: var(--md-sys-color-outline);
  border-radius: 50%;
  transform: translateY(-50%);
  transition: left 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              width 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              height 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.25s ease;
  pointer-events: none;
}
.m3-switch-track.on .m3-switch-thumb {
  left: calc(100% - 20px);
  width: 24px;
  height: 24px;
  background: var(--md-sys-color-on-primary);
}
.m3-switch-track:hover .m3-switch-thumb {
  width: 20px;
  height: 20px;
  left: 2px;
}
.m3-switch-track.on:hover .m3-switch-thumb {
  left: calc(100% - 22px);
}
.m3-switch-track:active .m3-switch-thumb {
  width: 28px;
  height: 28px;
  left: 0px;
}
.m3-switch-track.on:active .m3-switch-thumb {
  left: calc(100% - 28px);
}
@media (max-width: 767px) {
  .m3-switch { gap: 8px; padding: 2px 0 4px; }
  .m3-switch-label { font-size: 12px; min-width: 32px; }
}

/* ========== Touch Feedback (v20) ========== */
@media (max-width: 767px) {
  .mat-pill:active,
  .swatch-item:active,
  .quick-btn:active,
  .seg-btn:active {
    transition: transform 0.05s;
  }

  /* Subtle gradient top border on bottom bar */
  #bottom-bar::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 0;
    right: 0;
    height: 8px;
    background: linear-gradient(to top, rgba(0,0,0,0.04), transparent);
    pointer-events: none;
  }
}

/* Tab focus/accessibility */
.tab-btn:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: -2px;
  border-radius: 4px;
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 767px) {
  #bottom-bar {
    height: 50px;
    padding: 0 12px;
  }

  #price-total {
    font-size: 18px;
  }

  .btn-primary {
    padding: 8px 16px;
    font-size: 10px;
    letter-spacing: 0.8px;
  }

  .btn-secondary {
    padding: 8px 14px;
    font-size: 10px;
    letter-spacing: 0.8px;
  }

  .bottom-bar-actions {
    gap: 8px;
  }
}

/* ========== v10.21: + Sign Hover Effects ========== */
.arr-add:hover {
  transform: translate(-50%, -50%) scale(1.15);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

/* ========== v10.22: "Hier klicken" Callout ========== */
#hint { display: none !important; }
.callout-hint {
  position: absolute;
  pointer-events: none;
  z-index: 12;
  background: #E02020;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 24px;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  opacity: 0;
  transition: opacity 0.4s ease;
  box-shadow: 0 4px 12px rgba(224, 32, 32, 0.35);
  letter-spacing: 0.3px;
  display: none;
}
.callout-hint.visible {
  display: block;
  opacity: 1;
}
.callout-hint::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid #E02020;
}
@media (max-width: 767px) {
  .callout-hint { font-size: 11px; padding: 6px 14px; border-radius: 20px; }
  .callout-hint::after { bottom: -6px; border-width: 6px; }
}

/* ========== v10.24: Delete Buttons ========== */
.arr-del-group {
  position: absolute;
  pointer-events: auto;
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 4px;
  z-index: 5;
  transform: translate(-50%, -50%);
}
.arr-del-group.visible {
  display: flex;
}
.arr-del-pill {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 5px 12px;
  background: #fff;
  border: 1.5px solid #e0e0e0;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  line-height: 1;
}
.arr-del-pill:hover {
  background: #fff0f0;
  border-color: #E02020;
  color: #E02020;
  box-shadow: 0 2px 12px rgba(224,32,32,0.2);
}
.arr-del-pill:active {
  transform: scale(0.95);
}
.arr-del-single {
  padding: 5px 8px;
  color: #E02020;
  font-weight: 700;
  font-size: 14px;
}
@media (max-width: 767px) {
  .arr-del-pill { font-size: 10px; padding: 4px 8px; border-radius: 16px; }
  .arr-del-single { padding: 4px 6px; font-size: 12px; }
  .arr-del-group { gap: 3px; }
}

/* ========== v10.25: Height Thumbnails ========== */
.m3-switch { display: none !important; }
.height-thumbs {
  display: flex;
  gap: 12px;
  padding: 4px 0 8px;
  align-items: flex-end;
}
.height-thumb {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 2px solid var(--md-sys-color-outline);
  border-radius: var(--md-sys-shape-corner-medium);
  background: var(--md-sys-color-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--md-sys-color-on-surface-variant);
  font-size: 12px;
  font-weight: 500;
}
.height-thumb:hover {
  border-color: var(--md-sys-color-on-surface);
  background: rgba(0,0,0,0.03);
}
.height-thumb.active {
  border-color: var(--md-sys-color-primary);
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
  font-weight: 600;
}
.height-thumb:active {
  transform: scale(0.96);
}
.height-thumb svg {
  display: block;
}
@media (max-width: 767px) {
  .height-thumbs { gap: 8px; padding: 2px 0 6px; }
  .height-thumb { padding: 6px 10px; gap: 4px; font-size: 11px; }
  .height-thumb svg { width: 40px; height: auto; }
}

/* ========== v10.31: 50/50 Layout (disabled for i.03 bottom-sheet) ========== */
/* Replaced by i.03 P2-B bottom-sheet layout below */

/* ========== v10.31: FlexCube-Style Section Tabs ========== */
.section-tabs {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 8px 16px;
  background: var(--md-sys-color-surface);
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.section-tab {
  flex: 0 0 auto;
  padding: 8px 20px;
  border: none;
  background: var(--md-sys-color-secondary-container);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  transition: all 0.25s ease;
  border-radius: 24px;
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.section-tab.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.section-tab.active::before {
  content: '\2713';
  font-size: 12px;
  font-weight: 700;
}
.section-tab:hover:not(.active) {
  background: var(--md-sys-color-primary-container);
}
@media (max-width: 767px) {
  .section-tabs { padding: 6px 10px; gap: 6px; }
  .section-tab { padding: 6px 16px; font-size: 12px; min-height: 32px; border-radius: 20px; }
}
/* Section visible (scroll-to behavior) */
#section-farbe { display: block; }
/* Scroll anchor spacing */
#section-farbe { scroll-margin-top: 4px; }
.panel-body { scroll-behavior: smooth; }

/* ========== v10.32: Dynamic + Buttons Everywhere ========== */
/* Hide old static + buttons — replaced by dynamic ones */
#arr-up, #arr-left, #arr-right { display: none !important; }
/* Dynamic container */
#arr-dynamic {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}
/* Dynamic + buttons */
.arr-dyn-plus {
  position: absolute;
  pointer-events: auto;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1a1a1a;
  border: 2px solid rgba(255,255,255,0.5);
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  cursor: pointer;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  padding: 0;
}
@media (hover: hover) {
  .arr-dyn-plus:hover {
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  }
}
.arr-dyn-plus svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
@media (max-width: 767px) {
  .arr-dyn-plus {
    width: 30px;
    height: 30px;
  }
  .arr-dyn-plus svg {
    width: 16px;
    height: 16px;
  }
}

/* ========== v10.33: Delete Button Repositioning ========== */
/* Override group display — show as separate positioned elements */
.arr-del-group {
  display: none !important;
}
.arr-del-group.visible {
  display: contents !important;
}
.arr-del-pill {
  position: absolute;
  pointer-events: auto;
  z-index: 5;
  transform: translate(-50%, -50%);
  display: none;
}
.arr-del-group.visible .arr-del-pill {
  display: flex;
}
/* Single ✕ (module delete): top-right corner */
.arr-del-single {
  z-index: 6;
}

/* ========== v10.34: Scope Pills (FlexCube-style) ========== */
.scope-pills {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
  overflow-x: auto;
  flex-wrap: nowrap;
  -webkit-overflow-scrolling: touch;
}
.scope-pill {
  flex: 0 0 auto;
  padding: 6px 14px;
  border: none;
  background: var(--md-sys-color-secondary-container);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  border-radius: 20px;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.scope-pill.active {
  background: var(--md-sys-color-primary);
  color: var(--md-sys-color-on-primary);
  font-weight: 600;
}
.scope-pill:hover:not(.active) {
  background: var(--md-sys-color-primary-container);
}
@media (max-width: 767px) {
  .scope-pills { gap: 3px; }
  .scope-pill { padding: 5px 10px; font-size: 11px; }
}
/* Hide old scope buttons */
.apply-scope-btns { display: none !important; }

/* ========== v10.35: Mobile Polish ========== */
@media (max-width: 767px) {
  .section-tabs { padding: 4px 8px; gap: 4px; }
  .section-tab { padding: 5px 14px; font-size: 11px; min-height: 28px; }
  .callout-hint { font-size: 10px; padding: 5px 12px; border-radius: 18px; }
  .callout-hint::after { bottom: -6px; border-width: 6px; }
  .arr-del-pill { padding: 3px 8px; font-size: 9px; border-radius: 14px; }
  .arr-del-single { padding: 3px 5px; font-size: 11px; }
  .height-thumb { min-width: 60px; padding: 5px 8px; }
  .height-thumb svg { width: 40px; height: auto; }
  .scope-pill { padding: 4px 9px; font-size: 10px; }
}
/* ========== v10.35: Visual Polish ========== */
.section-tab { transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; }
@keyframes callout-pulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
}
.callout-hint.visible { animation: callout-pulse 2s ease-in-out 0.5s 3; }
.arr-del-single { border-color: #E02020; background: #FFF5F5; }
.height-thumb.active { box-shadow: 0 0 0 2px var(--md-sys-color-primary); }
.height-thumb:not(.active) { opacity: 0.65; }
.height-thumb:not(.active):hover { opacity: 1; }
.arr-dyn-plus { box-shadow: 0 2px 10px rgba(0,0,0,0.25), 0 0 0 1px rgba(255,255,255,0.1); }
.scope-pill.active { box-shadow: 0 1px 4px rgba(0,0,0,0.15); }
#section-farbe { border-top: none; padding-top: 0; margin-top: 0; }
/* ========== v10.35: Dark Mode ========== */
[data-theme="dark"] .section-tab.active { background: #e0e0e0; color: #1a1a1a; }
[data-theme="dark"] .section-tab.active::before { color: #1a1a1a; }
[data-theme="dark"] .callout-hint { box-shadow: 0 4px 12px rgba(224,32,32,0.5); }
[data-theme="dark"] .arr-del-pill { background: #2a2a2a; border-color: #444; color: #ccc; }
[data-theme="dark"] .arr-del-pill:hover { background: #3a2020; border-color: #E02020; color: #E02020; }
[data-theme="dark"] .arr-del-single { background: #2a1515; border-color: #E02020; }
[data-theme="dark"] .scope-pill { background: #333; color: #aaa; }
[data-theme="dark"] .scope-pill.active { background: #e0e0e0; color: #1a1a1a; }
[data-theme="dark"] #section-farbe { border-top: none; }
[data-theme="dark"] .arr-dyn-plus { background: #333; border-color: rgba(255,255,255,0.3); }
@media (hover: hover) { [data-theme="dark"] .arr-dyn-plus:hover { background: #555; } }

/* ========== v10.36: Color Swatch Enlargement ========== */
.swatch-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.swatch-dot.selected {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #D4622B;
}
/* Checkmark badge on selected swatch */
.swatch-dot.selected::after {
  content: '✓';
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: #D4622B;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fff;
}
/* Light swatches: same orange ring */
.swatch-dot.swatch-light.selected {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px #D4622B;
}
/* Dark mode: slightly brighter orange */
[data-theme="dark"] .swatch-dot.selected {
  box-shadow: 0 0 0 3px #2a2a2a, 0 0 0 5px #E07830;
}
[data-theme="dark"] .swatch-dot.selected::after {
  background: #E07830;
  border-color: #2a2a2a;
}
@media (max-width: 767px) {
  .swatch-dot {
    width: 30px;
    height: 30px;
  }
  .swatch-dot.selected::after {
    width: 14px;
    height: 14px;
    font-size: 8px;
  }
}

/* ========== v10.37: Connector Swatches (Gestell-like) ========== */
/* Swatches grid with increased gap for connector section */
.swatches-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
/* Section label for connectors (clean, semi-bold) */
.section-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 8px;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 6px;
}
.scope-badge {
  font-size: 10px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant);
  padding: 2px 6px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 8px;
}
/* Card-like background for connector section (subtle) */
.connector-section {
  padding: 12px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 12px;
  margin-bottom: 12px;
}
[data-theme="dark"] .connector-section {
  background: rgba(255, 255, 255, 0.05);
}
/* Connector dots: same 36px as color swatches */
.connector-section .swatch-dot {
  width: 36px;
  height: 36px;
}
@media (max-width: 767px) {
  .swatches-grid {
    gap: 5px;
  }
  .section-label {
    font-size: 12px;
    margin-bottom: 6px;
  }
  .scope-badge {
    font-size: 9px;
    padding: 1px 5px;
  }
  .connector-section {
    padding: 10px;
    margin-bottom: 10px;
  }
}

/* ========== v10.38: Material Cards Transform ========== */
/* Material pills become card-like tiles */
.mat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.mat-pill {
  flex: 0 0 auto;
  min-width: 70px;
  height: auto;
  padding: 10px;
  border: 2px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: border-color 0.2s ease, background 0.2s ease;
  font-size: 12px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  text-align: center;
  position: relative;
}
/* Color preview circle inside material pill */
.mat-pill::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--md-sys-color-primary);
  flex-shrink: 0;
}
/* i.02 B1: Selected state with fill + checkmark */
.mat-pill.selected {
  border-color: #D4622B;
  border-width: 2px;
  background: #D4622B;
  color: #fff;
  font-weight: 600;
}
.mat-pill.selected::before {
  content: '✓';
  width: auto;
  height: auto;
  border-radius: 0;
  background: none;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
/* No-shelf pill: dashed border */
.mat-pill[data-mat="none"] {
  border: 2px dashed var(--md-sys-color-outline-variant);
}
/* Hover effect */
.mat-pill:not(.selected):hover {
  border-color: var(--md-sys-color-outline);
}
/* Dark mode */
[data-theme="dark"] .mat-pill {
  background: #2a2a2a;
  border-color: #444;
  color: #aaa;
}
[data-theme="dark"] .mat-pill.selected {
  border-color: #E07830;
  background: #E07830;
  color: #1a1a1a;
}
[data-theme="dark"] .mat-pill.selected::before {
  color: #1a1a1a;
}
[data-theme="dark"] .mat-pill[data-mat="none"] {
  border-color: #555;
}
@media (max-width: 767px) {
  .mat-pills {
    gap: 6px;
  }
  .mat-pill {
    min-width: 60px;
    padding: 8px;
    font-size: 11px;
  }
  .mat-pill::before {
    width: 6px;
    height: 6px;
  }
}

/* ========== v10.39: Section Headers Refinement ========== */
.section-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 12px;
  color: var(--md-sys-color-on-surface);
  display: flex;
  align-items: center;
  gap: 8px;
}
.scope-badge {
  font-size: 10px;
  font-weight: 400;
  color: var(--md-sys-color-on-surface-variant);
  padding: 3px 8px;
  background: var(--md-sys-color-surface-variant);
  border-radius: 10px;
}
/* Panel spacing consistency */
.pp-divider {
  margin: 12px 0;
}
.panel-body {
  padding: 12px 16px;
}
/* Consistent spacing in sections */
#section-farbe {
  padding-bottom: 8px;
}
[data-theme="dark"] .section-label {
  color: #e0e0e0;
}
[data-theme="dark"] .scope-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #aaa;
}
@media (max-width: 767px) {
  .section-label {
    font-size: 13px;
    margin-bottom: 10px;
  }
  .scope-badge {
    font-size: 9px;
    padding: 2px 6px;
  }
  .pp-divider {
    margin: 10px 0;
  }
  .panel-body {
    padding: 10px 14px;
  }
}

/* ========== v10.40: Smooth Transitions & Animations ========== */
/* Swatch transitions */
.swatch-dot {
  transition: all 0.2s ease;
}
.swatch-dot.selected {
  transform: scale(1.05);
}
/* Material pill transitions */
.mat-pill {
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.mat-pill:active {
  transform: scale(0.98);
}
/* Scope pill transitions */
.scope-pill {
  transition: all 0.2s ease;
}
.scope-pill.active {
  transform: scale(1.02);
}
/* Tab transitions */
.section-tab {
  transition: all 0.2s ease;
}
.section-tab:active {
  transform: scale(0.98);
}
/* Smooth panel scrolling */
.panel-body {
  scroll-behavior: smooth;
}
/* Dynamic button transitions */
.arr-dyn-plus {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.arr-dyn-plus:active {
  transform: translate(-50%, -50%) scale(0.95);
}
/* Delete button transitions */
.arr-del-pill {
  transition: all 0.15s ease;
}
.arr-del-pill:active {
  transform: translate(-50%, -50%) scale(0.95);
}
/* Dark mode: same smooth transitions */
[data-theme="dark"] .swatch-dot,
[data-theme="dark"] .mat-pill,
[data-theme="dark"] .scope-pill,
[data-theme="dark"] .section-tab {
  transition: all 0.2s ease;
}
@media (max-width: 767px) {
  /* Slightly faster animations on mobile */
  .swatch-dot,
  .mat-pill,
  .scope-pill,
  .section-tab {
    transition: all 0.15s ease;
  }
}

/* ========== v10.41: Height Control Segmented Buttons ========== */
/* Container: horizontal flex row, pill-style background */
.height-thumbs {
  display: flex;
  flex-direction: row;
  gap: 0;
  background: #f0f0f0;
  border-radius: 24px;
  padding: 3px;
  width: fit-content;
  margin-bottom: 12px;
}
/* Individual button: segmented style */
.height-thumb {
  padding: 8px 20px;
  border-radius: 22px;
  border: none;
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  background: transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
/* Hide SVG thumbnails in height buttons */
.height-thumb svg {
  display: none;
}
/* Active state: white background with subtle shadow */
.height-thumb.active {
  background: #ffffff;
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: scale(1.02);
}
.height-thumb.active:hover {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
/* Hover state for inactive buttons */
.height-thumb:not(.active):hover {
  color: var(--md-sys-color-on-surface);
}
/* Dark mode */
[data-theme="dark"] .height-thumbs {
  background: #2a2a2a;
}
[data-theme="dark"] .height-thumb {
  color: #bbb; /* i.02 D5: improved contrast */
}
[data-theme="dark"] .height-thumb.active {
  background: #444;
  color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}
/* Mobile: smaller buttons */
@media (max-width: 767px) {
  .height-thumbs {
    gap: 0;
    padding: 2px;
    border-radius: 20px;
  }
  .height-thumb {
    padding: 6px 16px;
    font-size: 12px;
    border-radius: 18px;
  }
}

/* ========== v10.42: Panel Header ========== */
.panel-header {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  background: var(--md-sys-color-surface);
  flex-shrink: 0;
}
.panel-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--md-sys-color-on-surface);
}
.panel-subtitle {
  font-size: 11px;
  color: var(--md-sys-color-on-surface-variant);
}
.panel-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--md-sys-color-on-surface-variant);
  transition: all 0.2s ease;
}
.panel-close:hover {
  background: var(--md-sys-color-surface-variant);
  color: var(--md-sys-color-on-surface);
}
.panel-close:active {
  transform: scale(0.95);
}
/* Dark mode */
[data-theme="dark"] .panel-header {
  border-bottom-color: #444;
  background: #1a1a1a;
}
[data-theme="dark"] .panel-title {
  color: #e0e0e0;
}
[data-theme="dark"] .panel-subtitle {
  color: #bbb; /* i.02 D5 */
}
[data-theme="dark"] .panel-close {
  color: #bbb; /* i.02 D5 */
}
[data-theme="dark"] .panel-close:hover {
  background: #333;
  color: #ccc;
}
/* Mobile */
@media (max-width: 767px) {
  .panel-header {
    padding: 8px 14px;
  }
  .panel-title {
    font-size: 13px;
  }
  .panel-close {
    width: 24px;
    height: 24px;
    font-size: 18px;
  }
}

/* ========== v10.43: Section Tab Underline ========== */
/* Tab container reference border */
.section-tabs {
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 0;
  scroll-behavior: smooth;
}
/* Individual tab with relative positioning */
.section-tab {
  position: relative;
  padding: 10px 12px;
  border-radius: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  transition: all 0.3s ease;
  flex-shrink: 0;
  white-space: nowrap;
}
/* Active tab: orange underline indicator */
.section-tab.active {
  color: var(--md-sys-color-on-surface);
  font-weight: 600;
}
.section-tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 2px;
  background: #D4622B;
  border-radius: 1px;
  transition: all 0.3s ease;
}
/* Hover state */
.section-tab:not(.active):hover {
  color: var(--md-sys-color-on-surface);
}
/* Dark mode */
[data-theme="dark"] .section-tabs {
  border-bottom-color: #444;
}
[data-theme="dark"] .section-tab {
  color: #bbb; /* i.02 D5 */
}
[data-theme="dark"] .section-tab.active {
  color: #e0e0e0;
}
[data-theme="dark"] .section-tab.active::after {
  background: #E07830;
}
/* Mobile */
@media (max-width: 767px) {
  .section-tab {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* ========== v10.44: Delete Buttons Frosted Glass Style ========== */
/* Delete pill button (frosted glass) */
.arr-del-pill {
  padding: 2px 8px;
  font-size: 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.arr-del-pill:hover {
  border-color: #d32f2f;
  color: #d32f2f;
  transform: scale(1.08);
  background: rgba(255, 255, 255, 0.95);
}
.arr-del-pill:active {
  transform: scale(0.95);
}
/* Single delete circle button */
.arr-del-single {
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}
.arr-del-single:hover {
  color: #d32f2f;
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.95);
}
.arr-del-single:active {
  transform: scale(0.9);
}
/* Dark mode */
[data-theme="dark"] .arr-del-pill {
  background: rgba(30, 30, 30, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
  color: #bbb; /* i.02 D5 */
}
[data-theme="dark"] .arr-del-pill:hover {
  background: rgba(30, 30, 30, 0.95);
  border-color: #e07830;
  color: #e07830;
}
[data-theme="dark"] .arr-del-single {
  background: rgba(30, 30, 30, 0.85);
  color: #bbb; /* i.02 D5 */
}
[data-theme="dark"] .arr-del-single:hover {
  background: rgba(30, 30, 30, 0.95);
  color: #e07830;
}
/* Mobile: even smaller */
@media (max-width: 767px) {
  .arr-del-pill {
    padding: 1px 6px;
    font-size: 9px;
    border-radius: 10px;
  }
  .arr-del-single {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
}

/* ========== i.06: Delete Button — Simple circle ✕ at top-left of module ========== */
#arr-x.arr-del-circle {
  position: absolute;
  z-index: 10;
  pointer-events: auto;
  display: none;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 1px 6px rgba(0,0,0,0.15);
  color: #999;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  transform: translate(-50%, -50%);
}
#arr-x.arr-del-circle.visible {
  display: flex;
}
@media (hover: hover) {
  #arr-x.arr-del-circle:hover {
    color: #d32f2f;
    background: rgba(255, 255, 255, 0.98);
    transform: translate(-50%, -50%) scale(1.1);
  }
}
#arr-x.arr-del-circle:active {
  color: #c62828;
  transform: translate(-50%, -50%) scale(0.92);
}
#arr-x.arr-del-circle:focus {
  outline: none;
}
/* Dark mode */
[data-theme="dark"] #arr-x.arr-del-circle {
  background: rgba(40, 40, 40, 0.92);
  color: #aaa;
  box-shadow: 0 1px 6px rgba(0,0,0,0.3);
}
@media (hover: hover) {
  [data-theme="dark"] #arr-x.arr-del-circle:hover {
    color: #e07830;
    background: rgba(40, 40, 40, 0.98);
  }
}
/* Mobile: slightly smaller */
@media (max-width: 767px) {
  #arr-x.arr-del-circle {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
}

/* ========== v10.45: Plus Button Frosted Glass & Pulse ========== */
/* Keyframe animation: subtle pulse on first appearance */
@keyframes pulse-add {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
/* Plus button: frosted glass with glow */
.arr-dyn-plus {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  background: rgba(30, 30, 30, 0.85);
  backdrop-filter: blur(4px);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  flex-shrink: 0;
  animation: pulse-add 0.4s ease-out;
}
.arr-dyn-plus svg {
  width: 20px;
  height: 20px;
  stroke: #ffffff;
  stroke-width: 2;
  fill: none;
}
@media (hover: hover) {
  .arr-dyn-plus:hover {
    transform: translate(-50%, -50%) scale(1.2);
    border-color: #ffffff;
    background: rgba(30, 30, 30, 0.95);
    box-shadow: 0 0 16px rgba(212, 98, 43, 0.4);
  }
}
.arr-dyn-plus:active {
  transform: translate(-50%, -50%) scale(0.95);
}
/* Dark mode: lighter background */
[data-theme="dark"] .arr-dyn-plus {
  background: rgba(60, 60, 60, 0.85);
  border-color: rgba(255, 255, 255, 0.5);
}
@media (hover: hover) {
  [data-theme="dark"] .arr-dyn-plus:hover {
    background: rgba(60, 60, 60, 0.95);
    border-color: rgba(255, 255, 255, 0.8);
    box-shadow: 0 0 16px rgba(224, 120, 48, 0.3);
  }
}
/* Mobile: slightly smaller */
@media (max-width: 767px) {
  .arr-dyn-plus {
    width: 32px;
    height: 32px;
  }
  .arr-dyn-plus svg {
    width: 18px;
    height: 18px;
  }
}

/* ========== v10.46: Bottom Bar Refinement ========== */
/* Container: cleaner layout with price and actions */
#bottom-bar {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  height: 64px;
  padding: 0 20px;
  background: var(--md-sys-color-surface);
  border-top: 1px solid var(--md-sys-color-outline-variant);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  box-sizing: border-box;
}

/* Price section: left side, flex column */
.bottom-bar-price {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* Total price: large, bold, matching FlexCube style */
.price-total {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--md-sys-color-on-surface);
  font-variant-numeric: tabular-nums;
}

/* VAT label: smaller, muted */
.price-vat {
  font-size: 10px;
  color: var(--md-sys-color-on-surface-variant);
  font-weight: 400;
}

/* Actions section: right side, flex row with gap */
.bottom-bar-actions {
  display: flex;
  flex-direction: row;
  gap: 8px;
}

/* Primary button: orange, solid fill */
.btn-primary {
  background: #D4622B;
  color: #ffffff;
  border-radius: 24px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  background: #B85425;
}

.btn-primary:active {
  transform: scale(0.97);
}

/* Secondary button: outlined orange */
.btn-secondary {
  background: transparent;
  border: 1.5px solid #D4622B;
  color: #D4622B;
  border-radius: 24px;
  padding: 10px 24px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-secondary:hover {
  background: rgba(212, 98, 43, 0.08);
}

.btn-secondary:active {
  transform: scale(0.97);
}

/* Dark mode */
[data-theme="dark"] #bottom-bar {
  background: #1a1a1a;
  border-top-color: #333;
}

[data-theme="dark"] .price-total {
  color: #e0e0e0;
}

[data-theme="dark"] .price-vat {
  color: #aaa; /* i.02 D5 */
}

[data-theme="dark"] .btn-primary {
  background: #D4622B;
  color: #ffffff;
}

[data-theme="dark"] .btn-primary:hover {
  background: #B85425;
}

[data-theme="dark"] .btn-secondary {
  border-color: #D4622B;
  color: #D4622B;
}

[data-theme="dark"] .btn-secondary:hover {
  background: rgba(212, 98, 43, 0.12);
}

/* Mobile: responsive adjustments */
@media (max-width: 767px) {
  #bottom-bar {
    height: 56px;
    padding: 0 12px;
    flex-direction: row;
  }

  .bottom-bar-price {
    gap: 1px;
  }

  .price-total {
    font-size: 16px;
  }

  .price-vat {
    font-size: 9px;
  }

  .bottom-bar-actions {
    gap: 6px;
  }

  .btn-primary, .btn-secondary {
    padding: 8px 16px;
    font-size: 11px;
  }
}

/* ========== v10.47: Typography Fine-tuning ========== */
/* Global: font family and text rendering */
/* v2.8.19: follow the theme's own --font choice (Design → Anpassen →
   Typografie, l6-theme v1.3.7+) so the configurator panel switches fonts
   along with the rest of the site instead of always showing Inter — the
   var() fallback keeps this exact previous stack if --font isn't defined
   (older theme, or the configurator embedded outside this theme). */
body {
  font-family: var(--font, 'Inter', system-ui, -apple-system, sans-serif);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Section labels */
.section-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

/* Panel title */
.panel-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

/* Scope pills and badges */
.scope-pill, .scope-badge {
  font-size: 11px;
  font-weight: 500;
}

/* Material pills */
.mat-pill {
  font-size: 12px;
  font-weight: 500;
}

/* Swatch labels */
.swatch-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
}

/* Section tabs: inactive 500, active 600 */
.section-tab {
  font-size: 13px;
  font-weight: 500;
}

.section-tab.active {
  font-weight: 600;
}

/* Callout hints */
.callout-hint {
  font-size: 11px;
  font-weight: 600;
}

/* Price: tabular numbers for alignment */
.price-total, .price-vat {
  font-variant-numeric: tabular-nums;
}

/* Dark mode: inherits text colors */
[data-theme="dark"] .swatch-label {
  color: #aaa; /* i.02 D5 */
}

/* Mobile: reduce font sizes by 1-2px */
@media (max-width: 767px) {
  .section-label {
    font-size: 12px;
  }

  .panel-title {
    font-size: 14px;
  }

  .scope-pill, .scope-badge {
    font-size: 10px;
  }

  .mat-pill {
    font-size: 11px;
  }

  .swatch-label {
    font-size: 9px;
  }

  .section-tab {
    font-size: 12px;
  }

  .callout-hint {
    font-size: 10px;
  }
}

/* ========== v10.48: Microinteractions ========== */
/* Material pills: smooth interaction */
.mat-pill {
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

.mat-pill:active {
  transform: scale(0.95);
}

/* Scope pills: quick interaction */
.scope-pill {
  transition: all 0.15s ease;
}

.scope-pill:active {
  transform: scale(0.95);
}

/* Section tabs: include transform transition */
.section-tab {
  transition: all 0.3s ease;
}

/* Primary and secondary buttons */
.btn-primary, .btn-secondary {
  transition: all 0.2s ease;
}

.btn-primary:active, .btn-secondary:active {
  transform: scale(0.97);
}

/* Panel close button interaction */
.panel-close:active {
  transform: scale(0.9);
}

/* Delete pill interaction */
.arr-del-pill {
  transition: all 0.15s ease;
}

/* Keyframes: subtle panel fade-in */
@keyframes panel-fade-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Panel body animation on load */
.panel-body {
  animation: panel-fade-in 0.2s ease;
}

/* Dark mode: same interactions */
[data-theme="dark"] .mat-pill {
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
}

[data-theme="dark"] .scope-pill {
  transition: all 0.15s ease;
}

[data-theme="dark"] .section-tab {
  transition: all 0.3s ease;
}

[data-theme="dark"] .btn-primary, [data-theme="dark"] .btn-secondary {
  transition: all 0.2s ease;
}

[data-theme="dark"] .panel-body {
  animation: panel-fade-in 0.2s ease;
}

/* ========== v10.49: Mobile Final Polish ========== */
@media (max-width: 767px) {
  /* Section tabs: tighter spacing */
  .section-tabs {
    padding: 4px 8px;
    gap: 4px;
    border-bottom: 1px solid var(--md-sys-color-outline-variant);
  }

  .section-tab {
    padding: 5px 12px;
    font-size: 11px;
    min-height: 28px;
  }

  /* Panel body: extra bottom padding for fixed bottom bar */
  .panel-body {
    padding: 8px 12px 80px;
  }

  .panel-header {
    padding: 8px 12px;
  }

  .panel-title {
    font-size: 13px;
  }

  /* Scope pills: compact */
  .scope-pills {
    gap: 3px;
  }

  .scope-pill {
    padding: 4px 8px;
    font-size: 10px;
  }

  /* Swatches: tight grid */
  .swatches-grid {
    gap: 1px;
  }

  .swatch-item {
    padding: 3px 4px;
    min-width: 38px;
  }

  .swatch-dot {
    width: 28px;
    height: 28px;
  }

  .swatch-label {
    font-size: 8px;
  }

  /* Material pills: compact */
  .mat-pills {
    gap: 4px;
  }

  .mat-pill {
    padding: 6px 8px;
    min-width: 56px;
    font-size: 10px;
  }

  /* Height thumbs: tight spacing */
  .height-thumbs {
    gap: 0;
    padding: 2px;
  }

  .height-thumb {
    padding: 5px 14px;
    font-size: 11px;
  }

  /* Bottom bar: compact */
  #bottom-bar {
    height: 56px;
    padding: 0 12px;
  }

  .price-total {
    font-size: 16px;
  }

  .btn-primary, .btn-secondary {
    padding: 8px 16px;
    font-size: 11px;
  }

  /* Plus button: smaller */
  .arr-dyn-plus {
    width: 28px;
    height: 28px;
  }

  /* Delete pill: even tighter */
  .arr-del-pill {
    padding: 2px 6px;
    font-size: 8px;
  }

  .arr-del-single {
    width: 20px;
    height: 20px;
    font-size: 10px;
  }
}

/* ========== v10.50: Dark Mode Comprehensive Pass ========== */
[data-theme="dark"] {
  /* Panel header */
  --panel-header-bg: #1a1a1a;
  --panel-header-border: #333;
}

[data-theme="dark"] .panel-header {
  background: #1a1a1a;
  border-color: #333;
}

[data-theme="dark"] .panel-title {
  color: #e0e0e0;
}

/* Section tabs: complete dark styling */
[data-theme="dark"] .section-tab {
  background: #2a2a2a;
  color: #bbb; /* i.02 D5 */
}

[data-theme="dark"] .section-tab.active {
  background: #e0e0e0;
  color: #1a1a1a;
}

[data-theme="dark"] .section-tab.active::after {
  background: #E07830;
}

[data-theme="dark"] .section-tab.active::before {
  color: #1a1a1a;
}

/* Material pills: dark styling */
[data-theme="dark"] .mat-pill {
  background: #2a2a2a;
  border-color: #444;
  color: #ccc;
}

[data-theme="dark"] .mat-pill.selected {
  border-color: #E07830;
}

/* No-shelf pills */
[data-theme="dark"] .mat-pill.no-shelf-pill {
  border-color: #555;
}

[data-theme="dark"] .mat-pill.no-shelf-pill.selected {
  border-color: #E07830;
}

/* Swatch styling: dark mode */
[data-theme="dark"] .swatch-dot.selected {
  box-shadow: 0 0 8px rgba(224, 120, 48, 0.5);
}

[data-theme="dark"] .swatch-dot.selected::after {
  background: #E07830;
}

[data-theme="dark"] .swatch-item.selected {
  background: #333;
}

[data-theme="dark"] .swatch-label {
  color: #aaa; /* i.02 D5 */
}

/* Scope pills: dark mode */
[data-theme="dark"] .scope-pill {
  background: #333;
  color: #aaa;
}

[data-theme="dark"] .scope-pill:active {
  background: #e0e0e0;
  color: #1a1a1a;
}

/* Height thumbs: dark styling */
[data-theme="dark"] .height-thumbs {
  background: #2a2a2a;
}

[data-theme="dark"] .height-thumb {
  color: #aaa;
}

[data-theme="dark"] .height-thumb.active {
  background: #444;
  color: #e0e0e0;
}

/* Bottom bar: dark */
[data-theme="dark"] #bottom-bar {
  background: #1a1a1a;
  border-color: #333;
}

[data-theme="dark"] .price-total {
  color: #e0e0e0;
}

[data-theme="dark"] .price-vat {
  color: #aaa; /* i.02 D5 */
}

/* Buttons: dark mode */
[data-theme="dark"] .btn-primary {
  background: #D4622B;
  color: #fff;
}

[data-theme="dark"] .btn-secondary {
  border-color: #D4622B;
  color: #D4622B;
}

/* Dividers and separators */
[data-theme="dark"] .pp-divider {
  background: #333;
}

/* Section labels */
[data-theme="dark"] .section-label {
  color: #aaa;
}

/* Connector sections */
[data-theme="dark"] .connector-section {
  background: #222;
  border-color: #333;
}

/* ========== v10.51: Viewport/Panel Smooth Transition ========== */
/* App layout: smooth flex transitions when panel opens/closes */
.app-layout {
  transition: flex 0.3s ease;
}

/* Property panel: smooth transform and opacity transitions */
.property-panel {
  transition: transform 0.3s cubic-bezier(0.2, 0, 0, 1), opacity 0.3s ease;
}

/* Panel open state: visible and in position */
.property-panel.open {
  transform: translateY(0);
  opacity: 1;
}

/* Panel closed state: slide up slightly and fade */
.property-panel:not(.open) {
  transform: translateY(8px);
  opacity: 0;
  pointer-events: none;
}

/* Viewport area: smooth flex resize when panel appears */
.viewport-area {
  transition: flex 0.3s ease;
}

/* Desktop: panel slides in from right smoothly */
@media (min-width: 768px) {
  .property-panel {
    transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.3s ease;
  }

  .property-panel.open {
    transform: translateX(0);
    opacity: 1;
  }

  .property-panel:not(.open) {
    transform: translateX(16px);
    opacity: 0;
    pointer-events: none;
  }

  /* Add subtle shadow on panel edge for depth */
  .property-panel.open {
    box-shadow: -8px 0 16px rgba(0, 0, 0, 0.1);
  }
}

/* Mobile: bottom sheet slides up smoothly */
@media (max-width: 767px) {
  .property-panel {
    transition: transform 0.3s cubic-bezier(0.2, 0, 0.2, 1), opacity 0.3s ease;
    transform: translateY(100%);
  }

  .property-panel.open {
    transform: translateY(0);
    opacity: 1;
  }

  .property-panel:not(.open) {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
  }

  /* Bottom sheet shadow */
  .property-panel.open {
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  }
}

/* Dark mode: same transitions with darker shadow */
[data-theme="dark"] .property-panel.open {
  box-shadow: -8px 0 16px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .property-panel.open {
  @media (max-width: 767px) {
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.4);
  }
}

/* ========== v10.52: Toolbar Visual Integration ========== */
/* Toolbar container: clean icon-button strip with subtle blur */
.toolbar-v {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-radius: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  align-items: center;
  justify-content: flex-start;
}

/* Toolbar buttons: 36px square, clean style */
.tbv-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: #555;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 18px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent; /* i.07: no tap flash on iOS/Chrome */
}

/* Button hover: subtle background (only on devices with hover) */
@media (hover: hover) {
  .tbv-btn:hover {
    background: rgba(0, 0, 0, 0.06);
  }
}

/* i.07: Clear focus background on non-keyboard focus (mouse/touch click) */
.tbv-btn:focus:not(:focus-visible) {
  background: transparent;
  outline: none;
}

/* Button active (toggle state): secondary container background */
.tbv-btn.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-primary);
}

/* Button focus: outline */
.tbv-btn:focus-visible {
  outline: 2px solid #D4622B;
  outline-offset: 2px;
}

/* Separator: thin line between button groups */
.tbv-sep {
  width: 24px;
  height: 1px;
  background: #e5e5e5;
  margin: 2px 8px;
  flex-shrink: 0;
}

/* Mobile: horizontal toolbar with smaller buttons */
@media (max-width: 767px) {
  .toolbar-v {
    flex-direction: row;
    gap: 4px;
    padding: 6px 8px;
    border-radius: 0;
  }

  .tbv-btn {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    font-size: 16px;
  }

  .tbv-sep {
    width: 1px;
    height: 20px;
    margin: 0 2px;
  }
}

/* Dark mode: darker background and lighter buttons */
[data-theme="dark"] .toolbar-v {
  background: rgba(30, 30, 30, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .tbv-btn {
  color: #aaa;
}

[data-theme="dark"] .tbv-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .tbv-btn.active {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-primary);
}

[data-theme="dark"] .tbv-sep {
  background: #444;
}

/* ========== v10.53: Loading + Hint Refinement ========== */
/* Loading overlay: clean white background — :not(.hidden) preserves Tailwind .hidden */
#loading-overlay:not(.hidden) {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  gap: 16px;
}
/* Ensure hidden class always works (ID specificity guard) */
#loading-overlay.hidden {
  display: none !important;
}

/* Loading spinner container */
#loading-spinner {
  width: 48px;
  height: 48px;
}

/* Loading bar: orange fill */
#loading-bar {
  width: 240px;
  height: 4px;
  background: #f0f0f0;
  border-radius: 2px;
  overflow: hidden;
}

#loading-bar::after {
  content: '';
  display: block;
  height: 100%;
  background: #D4622B;
  width: 30%;
  animation: loading-progress 1.5s ease-in-out infinite;
}

@keyframes loading-progress {
  0% { width: 0%; }
  50% { width: 80%; }
  100% { width: 100%; }
}

/* Loading percentage */
#loading-pct {
  font-size: 11px;
  font-weight: 500;
  color: #666;
}

/* Hint container: rounded pill with backdrop blur */
#hint {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
}

#hint span {
  display: inline-block;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  color: #ffffff;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Callout hint: orange badge */
.callout-hint {
  display: inline-block;
  background: #D4622B;
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(212, 98, 43, 0.4);
  position: relative;
}

/* Callout arrow (if present) */
.callout-hint::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 16px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 6px solid #D4622B;
}

/* Dark mode: adjust hint styling */
[data-theme="dark"] #loading-overlay:not(.hidden) {
  background: #1a1a1a;
}

[data-theme="dark"] #loading-bar {
  background: #333;
}

[data-theme="dark"] #loading-pct {
  color: #aaa; /* i.02 D5 */
}

[data-theme="dark"] #hint span {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  color: #e0e0e0;
}

[data-theme="dark"] .callout-hint {
  background: #D4622B;
  color: #ffffff;
}

[data-theme="dark"] .callout-hint::after {
  border-top-color: #D4622B;
}

/* ========== v10.54: Config Code + BOM Modal Polish ========== */
/* Modal overlay: subtle backdrop blur */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

/* Modal content: centered card */
.modal-content {
  background: var(--md-sys-color-surface);
  border-radius: 16px;
  max-width: 480px;
  width: 90%;
  padding: 24px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  max-height: 90vh;
  overflow-y: auto;
}

/* Modal heading */
.modal-content h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--md-sys-color-on-surface);
  margin: 0 0 16px 0;
  letter-spacing: -0.3px;
}

/* BOM table: clean styling */
.bom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin: 12px 0;
}

.bom-table thead {
  background: #f5f5f5;
  border-bottom: 1px solid #e0e0e0;
}

.bom-table th {
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: #333;
}

.bom-table td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0f0f0;
}

.bom-table tbody tr:nth-child(even) {
  background: #fafafa;
}

.bom-table tbody tr:hover {
  background: #f5f5f5;
}

/* Config code input: clean style */
.config-code-input {
  width: 100%;
  border-radius: 8px;
  border: 1.5px solid var(--md-sys-color-outline);
  padding: 8px 12px;
  font-size: 13px;
  font-family: 'Courier New', monospace;
  color: var(--md-sys-color-on-surface);
  background: var(--md-sys-color-surface);
  box-sizing: border-box;
  transition: border-color 0.2s ease;
}

.config-code-input:focus {
  outline: none;
  border-color: #D4622B;
  box-shadow: 0 0 0 3px rgba(212, 98, 43, 0.1);
}

/* Config code buttons: primary/secondary */
.config-code-buttons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  justify-content: flex-end;
}

.config-code-buttons .btn-primary,
.config-code-buttons .btn-secondary {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 20px;
}

/* Mobile: full-width modal as bottom sheet */
@media (max-width: 767px) {
  .modal-content {
    border-radius: 16px 16px 0 0;
    max-width: 100%;
    width: 100%;
    margin-top: auto;
    max-height: 80vh;
    padding: 20px;
  }

  .modal-content h2 {
    font-size: 16px;
  }

  .bom-table {
    font-size: 12px;
  }

  .bom-table th,
  .bom-table td {
    padding: 8px 10px;
  }

  .config-code-buttons {
    flex-direction: column;
  }

  .config-code-buttons .btn-primary,
  .config-code-buttons .btn-secondary {
    width: 100%;
  }
}

/* Dark mode: modal styling */
[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .modal-content {
  background: #1a1a1a;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  border: 1px solid #333;
}

[data-theme="dark"] .modal-content h2 {
  color: #e0e0e0;
}

[data-theme="dark"] .bom-table thead {
  background: #2a2a2a;
  border-bottom-color: #444;
}

[data-theme="dark"] .bom-table th {
  color: #aaa;
}

[data-theme="dark"] .bom-table td {
  color: #ccc;
  border-bottom-color: #333;
}

[data-theme="dark"] .bom-table tbody tr:nth-child(even) {
  background: #222;
}

[data-theme="dark"] .bom-table tbody tr:hover {
  background: #2a2a2a;
}

[data-theme="dark"] .config-code-input {
  background: #2a2a2a;
  color: #e0e0e0;
  border-color: #444;
}

[data-theme="dark"] .config-code-input:focus {
  border-color: #D4622B;
  box-shadow: 0 0 0 3px rgba(212, 98, 43, 0.2);
}

/* ========== v10.55: Final Comprehensive Visual Audit ========== */
/* Global box-sizing: reinforce */
* {
  box-sizing: border-box;
}

/* Text selection: custom orange highlight */
::selection {
  background: rgba(212, 98, 43, 0.2);
  color: inherit;
}

[data-theme="dark"] ::selection {
  background: rgba(212, 98, 43, 0.3);
  color: inherit;
}

/* Focus visible: clear orange outline */
*:focus-visible {
  outline: 2px solid #D4622B;
  outline-offset: 2px;
  border-radius: 4px;
}

/* Scrollbar styling: thin and clean */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Firefox scrollbar */
* {
  scrollbar-color: #ccc transparent;
  scrollbar-width: thin;
}

/* Dark mode scrollbar */
[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #555;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #777;
}

[data-theme="dark"] * {
  scrollbar-color: #555 transparent;
}

/* Property panel: subtle left border on desktop */
@media (min-width: 768px) {
  .property-panel {
    border-left: 1px solid var(--md-sys-color-outline-variant);
  }

  [data-theme="dark"] .property-panel {
    border-left-color: #333;
  }
}

/* Header: consistent with panel styling */
header {
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
  transition: all 0.2s ease;
}

[data-theme="dark"] header {
  border-bottom-color: #333;
}

/* Height dialog: polish */
.height-dialog {
  border-radius: 16px;
  background: var(--md-sys-color-surface);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  padding: 20px;
}

.height-dialog h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 16px 0;
  color: var(--md-sys-color-on-surface);
}

/* Height choice items: interactive hover states */
.height-choice {
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: transparent;
  border: 1px solid transparent;
}

.height-choice:hover {
  background: rgba(0, 0, 0, 0.04);
}

.height-choice.selected {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* Dialog buttons: hover states */
.height-dialog .btn-primary,
.height-dialog .btn-secondary {
  transition: all 0.2s ease;
}

.height-dialog .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(212, 98, 43, 0.2);
}

.height-dialog .btn-secondary:hover {
  transform: translateY(-1px);
}

/* Dark mode: height dialog */
[data-theme="dark"] .height-dialog {
  background: #1a1a1a;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  border: 1px solid #333;
}

[data-theme="dark"] .height-dialog h3 {
  color: #e0e0e0;
}

[data-theme="dark"] .height-choice {
  color: #aaa;
}

[data-theme="dark"] .height-choice:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .height-choice.selected {
  background: var(--md-sys-color-secondary-container);
  color: var(--md-sys-color-on-secondary-container);
}

/* Print media: hide interactive elements */
@media print {
  .toolbar-v,
  #bottom-bar,
  .panel-close,
  .arr-del-pill,
  .arr-del-single {
    display: none !important;
  }

  .property-panel {
    position: static;
    border: none;
    width: 100%;
    max-width: 100%;
  }

  .app-layout {
    flex-direction: column;
  }

  .viewport-area {
    flex: 1;
  }

  /* Print: show full panel content */
  .property-panel {
    padding: 16px;
    box-shadow: none;
    transform: none !important;
    opacity: 1 !important;
    pointer-events: auto !important;
  }

  /* Print-friendly colors */
  * {
    box-shadow: none !important;
  }
}

/* Reduced motion: disable all animations */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Maintain visibility but no animation */
  .property-panel {
    transition: none;
  }

  .app-layout {
    transition: none;
  }

  .viewport-area {
    transition: none;
  }

  .btn-primary, .btn-secondary {
    transition: none;
  }

  .tbv-btn {
    transition: none;
  }

  .section-tab {
    transition: none;
  }

  .mat-pill {
    transition: none;
  }

  .scope-pill {
    transition: none;
  }

  .panel-body {
    animation: none;
  }
}

/* Contrast and accessibility: ensure proper text contrast */
@media (prefers-contrast: more) {
  .tbv-btn {
    color: #333;
  }

  [data-theme="dark"] .tbv-btn {
    color: #ccc;
  }

  .swatch-label {
    font-weight: 600;
  }

  .scope-pill {
    font-weight: 600;
  }
}

/* Ensure proper line height for readability */
body {
  line-height: 1.5;
}

p, li, td, th {
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
}

/* ========== v10.56: Visual Fixes ========== */

/* Callout: restore v10.22 red pill with aura + pulse (v10.53 broke position) */
#callout-hint.callout-hint {
  position: absolute !important;
  pointer-events: none;
  z-index: 12;
  background: #E02020 !important;
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 18px;
  border-radius: 24px;
  white-space: nowrap;
  width: auto !important;
  max-width: 220px;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 20px rgba(224, 32, 32, 0.5), 0 0 40px rgba(224, 32, 32, 0.25), 0 4px 12px rgba(224, 32, 32, 0.35);
  letter-spacing: 0.3px;
}
#callout-hint.callout-hint::after {
  display: none !important;
}
@keyframes callout-glow {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
    box-shadow: 0 0 20px rgba(224, 32, 32, 0.5), 0 0 40px rgba(224, 32, 32, 0.25), 0 4px 12px rgba(224, 32, 32, 0.35);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.04);
    box-shadow: 0 0 28px rgba(224, 32, 32, 0.65), 0 0 56px rgba(224, 32, 32, 0.35), 0 6px 16px rgba(224, 32, 32, 0.4);
  }
}
#callout-hint.callout-hint.visible {
  display: block;
  opacity: 1;
  animation: callout-glow 2.5s ease-in-out infinite;
}

/* Hide price itemized list — show only total */
#price-lines { display: none !important; }

/* Section tabs: outline + orange checkmark (like swatch selection) */
.section-tab.active {
  background: transparent !important;
  color: var(--md-sys-color-on-surface) !important;
  border: 2px solid #D4622B !important;
  font-weight: 600;
}
.section-tab.active::before {
  content: '\2713' !important;
  color: #D4622B !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  margin-right: 4px;
}
.section-tab.active::after {
  display: none !important;
}
[data-theme="dark"] .section-tab.active {
  background: transparent !important;
  color: #e0e0e0 !important;
  border-color: #D4622B !important;
}
[data-theme="dark"] .section-tab.active::before {
  color: #D4622B !important;
}

/* Bottom bar: high z-index on all devices */
#bottom-bar {
  z-index: 9990 !important;
  position: fixed !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
}
@media (max-width: 767px) {
  #bottom-bar {
    z-index: 9990 !important;
  }
}

/* ========== i.03: Panel Collapse + Bottom Sheet ========== */
/* Panel hidden by default, shown via .open class */
.property-panel { display: none; flex-direction: column; }
.property-panel.open { display: flex; }
/* Show close button */
.panel-close { display: flex !important; cursor: pointer; }
/* Mobile: viewport always full height (dolly zoom instead of resize) */
@media (max-width: 767px) {
  .viewport-area {
    height: 100% !important;
    flex: 1 !important;
  }
}

/* ========== i.03 P2-B: Bottom Sheet (Mobile) ========== */
/* Sheet handle styling */
/* ========== i.07: Fixed panel — no drag, fade in/out ========== */
@media (max-width: 767px) {
  /* i.03: Hide redundant tabs + header on mobile */
  .section-tabs { display: none !important; }
  .panel-header { display: none !important; }

  .property-panel {
    position: fixed !important;
    bottom: 56px !important; /* i.07: above price bar */
    left: 0 !important;
    right: 0 !important;
    z-index: 500;
    border-radius: 0;
    /* i.07: semi-transparent glassmorphism (same as HUD controls) */
    background: rgba(255,255,255,0.30) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.10);
    overflow: hidden;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
  }
  .property-panel.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .property-panel.open .panel-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
}

/* Desktop: side panel */
@media (min-width: 768px) {
  .property-panel.open {
    width: 380px;
    flex-shrink: 0;
    max-height: none;
    border-radius: 0;
    position: relative !important;
  }
}

/* Dark mode panel */
[data-theme="dark"] .property-panel.open {
  box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
}

/* ========== HUD Controls (Mobile only) ========== */
.hud-control {
  position: absolute;
  z-index: 15;
  background: var(--md-sys-color-surface);
  border: none;
  border-radius: 10px;
  padding: 0 3px 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  box-shadow: 0 1px 8px rgba(0,0,0,0.06), 0 0 0 0.5px rgba(0,0,0,0.04);
}
.hud-height { left: 4px; top: 36px; }
.hud-connectors { right: 0; top: 36px; border-top: none; border-right: none; }
.hud-label { font-size: 8px; font-weight: 600; color: #999; letter-spacing: 0.3px; text-align: center; line-height: 1.2; padding: 5px 4px 0; }
/* i.07: vertical stack for both HUDs */
.hud-toggle { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.hud-dots { display: flex; flex-direction: column; gap: 5px; align-items: center; }
/* v2.5.17: V4.2 proportional height buttons with text inside */
.hud-shape {
  width: 38px;
  border: 2px solid rgba(0,0,0,0.15);
  border-radius: 5px;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #999;
  letter-spacing: -0.2px;
}
.hud-shape[data-hud-height="tall"] { height: 38px; } /* square = 40cm */
.hud-shape[data-hud-height="short"] { height: 19px; } /* half-height = 20cm */
.hud-shape .cm { font-size: 7px; opacity: 0.7; }
.hud-shape.active {
  border-color: #D4622B;
  background: #D4622B;
  color: #fff;
}
/* v2.5.17: Checkmark badge on active height (like connector dots) */
.hud-shape.active::after {
  content: '✓';
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 14px;
  height: 14px;
  background: #D4622B;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #fff;
  line-height: 1;
}
/* i.07: Connector dots with checkmark like swatches */
.hud-dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.12);
  position: relative;
}
.hud-dot.active {
  border-color: #D4622B;
  box-shadow: 0 0 0 2px rgba(212,98,43,0.25);
}
.hud-dot.active::after {
  content: '✓';
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 13px;
  height: 13px;
  background: #D4622B;
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #fff;
}
@media (min-width: 768px) { .hud-control:not(.hud-configcode) { display: none !important; } }

/* v2.5.18: Config Code HUD */
.hud-configcode {
  right: 44px;
  top: 4px;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 8px;
  pointer-events: auto;
}
.hud-configcode .hud-label {
  padding: 0;
  font-size: 7px;
  line-height: 1.15;
  white-space: nowrap;
}
.hud-code-input {
  width: 110px;
  height: 26px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 5px;
  background: rgba(255,255,255,0.7);
  font-size: 11px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-weight: 500;
  padding: 0 6px;
  color: #333;
  outline: none;
  transition: border-color 0.2s;
}
.hud-code-input:focus {
  border-color: #D4622B;
  box-shadow: 0 0 0 2px rgba(212,98,43,0.12);
}
.hud-code-input::placeholder { color: #bbb; font-family: inherit; }
.hud-code-buttons {
  display: flex;
  gap: 3px;
}
.hud-code-btn {
  width: 26px;
  height: 26px;
  border: 1.5px solid rgba(0,0,0,0.12);
  border-radius: 5px;
  background: rgba(255,255,255,0.7);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  color: #666;
}
.hud-code-btn:hover {
  border-color: #D4622B;
  color: #D4622B;
  background: rgba(212,98,43,0.06);
}
.hud-code-gen { color: #D4622B; }
[data-theme="dark"] .hud-code-input {
  background: rgba(40,40,40,0.8);
  border-color: rgba(255,255,255,0.12);
  color: #e0e0e0;
}
[data-theme="dark"] .hud-code-input::placeholder { color: #666; }
[data-theme="dark"] .hud-code-btn {
  background: rgba(40,40,40,0.8);
  border-color: rgba(255,255,255,0.12);
  color: #aaa;
}
[data-theme="dark"] .hud-code-btn:hover {
  border-color: #D4622B;
  color: #D4622B;
}
/* Desktop: position next to toolbar */
@media (min-width: 768px) {
  .hud-configcode { right: 44px; top: 4px; }
}
/* Mobile: position top-center */
@media (max-width: 767px) {
  .hud-configcode {
    right: auto;
    left: 50%;
    top: 4px;
    transform: translateX(-50%);
  }
  .hud-code-input { width: 90px; font-size: 10px; }
}

/* ========== v2.5.6: UI Redesign ========== */

/* --- 1) MOBILE: Close button top-right in control panel --- */
@media (max-width: 767px) {
  .panel-header {
    display: flex !important;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding: 6px 10px 0;
    border-bottom: none;
    background: transparent;
  }
  .panel-header .panel-title {
    display: none;
  }
  .panel-header .panel-close {
    display: flex !important;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0,0,0,0.08);
    color: #555;
    font-size: 18px;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: background 0.15s;
  }
  .panel-header .panel-close:hover {
    background: rgba(0,0,0,0.15);
  }
}

/* --- 2) MOBILE: HUD background matches bottom-bar / control panel --- */
@media (max-width: 767px) {
  .hud-control {
    background: var(--md-sys-color-surface) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 1px 8px rgba(0,0,0,0.08), 0 0 0 0.5px rgba(0,0,0,0.04);
  }
  [data-theme="dark"] .hud-control {
    background: rgba(30,30,30,0.85) !important;
  }
}

/* --- 4) DESKTOP: Remove panel header, always show panel --- */
@media (min-width: 768px) {
  .panel-header {
    display: none !important;
  }
  /* Always show panel — override display:none default */
  .property-panel {
    display: flex !important;
    flex-direction: column;
    width: 25vw !important;
    min-width: 280px;
    max-width: 420px;
    flex-shrink: 0;
    /* Glassmorphism like mobile panel */
    background: rgba(255,255,255,0.30) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-left: 1px solid rgba(255,255,255,0.4);
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
  }
  [data-theme="dark"] .property-panel {
    background: rgba(30,30,30,0.30) !important;
    border-left-color: rgba(255,255,255,0.1);
  }
  /* Toolbar: same glass transparency */
  .toolbar-v {
    background: rgba(255,255,255,0.30) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: none;
  }
  [data-theme="dark"] .toolbar-v {
    background: rgba(30,30,30,0.30) !important;
  }
}

/* --- 5) v2.5.10: mat-info-overlay no longer used — info is inline in panel --- */
#mat-info-overlay {
  display: none !important;
}

/* --- 6) v2.5.11: Mobile toolbar scrollable so help button is reachable --- */
@media (max-width: 767px) {
  .toolbar-v {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;           /* Firefox */
    -ms-overflow-style: none;        /* IE/Edge */
  }
  .toolbar-v::-webkit-scrollbar {
    display: none;                   /* Chrome/Safari */
  }
}

/* --- 6) MOBILE & DESKTOP: Remove Row / Remove Column buttons --- */
.arr-del-row,
.arr-del-col {
  position: absolute;
  pointer-events: auto;
  z-index: 6;
  display: none;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  font-size: 10px;
  font-weight: 500;
  color: var(--md-sys-color-on-surface-variant);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  transform: translate(-50%, -50%);
  line-height: 1;
}
.arr-del-row.visible,
.arr-del-col.visible {
  display: flex;
}
.arr-del-row:hover,
.arr-del-col:hover {
  border-color: #d32f2f;
  color: #d32f2f;
  background: rgba(255, 255, 255, 0.95);
  transform: translate(-50%, -50%) scale(1.05);
}
.arr-del-row:active,
.arr-del-col:active {
  transform: translate(-50%, -50%) scale(0.95);
}
/* Dark mode */
[data-theme="dark"] .arr-del-row,
[data-theme="dark"] .arr-del-col {
  background: rgba(30, 30, 30, 0.85);
  border-color: rgba(255, 255, 255, 0.2);
  color: #bbb;
}
[data-theme="dark"] .arr-del-row:hover,
[data-theme="dark"] .arr-del-col:hover {
  background: rgba(30, 30, 30, 0.95);
  border-color: #e07830;
  color: #e07830;
}
@media (max-width: 767px) {
  .arr-del-row,
  .arr-del-col {
    padding: 2px 7px;
    font-size: 9px;
    border-radius: 10px;
  }
}

/* ========== v2.5.7: UI Polish ========== */

/* --- 1) MOBILE: Smaller close button, same height as scope-pills --- */
@media (max-width: 767px) {
  .panel-header {
    position: absolute !important;
    top: 6px;
    right: 8px;
    z-index: 10;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
  }
  .panel-header .panel-close {
    width: 20px !important;
    height: 20px !important;
    font-size: 13px !important;
    border-radius: 50%;
    background: rgba(0,0,0,0.10) !important;
    line-height: 1;
  }
}

/* --- 2) MOBILE: HUD sizing --- */
@media (max-width: 767px) {
  .hud-control {
    box-sizing: border-box;
  }
  /* Connectors HUD keeps equal width */
  .hud-connectors {
    min-width: 44px;
    padding-left: 6px !important;
    padding-right: 6px !important;
  }
}

/* --- 3) Delete buttons: relative to single-delete (✕), no overlap with + buttons --- */
.arr-del-row,
.arr-del-col {
  /* v2.5.7: override — don't center-transform, position is set by JS relative to arr-x */
  transform: translate(-50%, -50%);
}


/* ============================================================
   v2.7 — UI/UX-Verbesserungen (Usability, A11y, Mobile)
   ============================================================ */

/* ---- Tastatur-Fokus: sichtbare Fokusringe (A11y) ---- */
.tbv-btn:focus-visible,
.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.mat-pill:focus-visible,
.scope-pill:focus-visible,
.hud-dot:focus-visible,
.height-thumb:focus-visible,
.arr-btn:focus-visible,
.swatch-item:focus-visible {
  outline: 2px solid #1a73e8;
  outline-offset: 2px;
}
.tbv-btn:focus:not(:focus-visible) { outline: none; }

/* ---- Mobile: Touch-Ziele mind. 44x44 px (Apple HIG / WCAG 2.5.8) ---- */
@media (max-width: 767px) {
  .tbv-btn { min-width: 40px; min-height: 40px; }
  .hud-dot { min-width: 30px; min-height: 30px; }
  .arr-btn, .arr-del-circle { min-width: 40px; min-height: 40px; }
  .bottom-bar-actions .btn-primary,
  .bottom-bar-actions .btn-secondary { min-height: 44px; }
  .scope-pill, .mat-pill { min-height: 34px; }
}

/* ---- iPhone Notch / Home-Indicator: Safe-Area beruecksichtigen ---- */
.bottom-bar {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 0px);
}
@supports (padding: env(safe-area-inset-left)) {
  .toolbar-v { padding-right: env(safe-area-inset-right, 0px); }
}

/* ---- Reduzierte Bewegung respektieren (prefers-reduced-motion) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Panel-Scrollbar dezenter (Desktop) ---- */
@media (min-width: 768px) {
  .panel-body { scrollbar-width: thin; scrollbar-color: #d0d0d0 transparent; }
  .panel-body::-webkit-scrollbar { width: 6px; }
  .panel-body::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 3px; }
  .panel-body::-webkit-scrollbar-track { background: transparent; }
}

/* ---- Preiszeilen: bessere Lesbarkeit ---- */
.price-lines { font-variant-numeric: tabular-nums; }
.price-total { font-variant-numeric: tabular-nums; }

/* ---- 3D-Canvas: kein versehentliches Browser-Panning/Zoomen ---- */
#canvas3d { touch-action: none; -webkit-user-select: none; user-select: none; }

/* ---- Buttons: konsistenter Cursor + disabled-Zustand (nur Konfigurator) ---- */
.l6-configurator-wrap button, .app-layout button, .bottom-bar button { cursor: pointer; }

/* ========== v2.8.12: Aufbau-Animation Mode ========== */
/* Reduziert die UI auf ausschliesslich die Animation: Play/Pause, der
   Scrub-Slider (v2.8.14) und "Zurück zum Konfigurator" — Bearbeitungs-
   Panel, Preisleiste, Pfeil-Overlay, Hinweistext, HUD und übrige
   Symbolleisten-Buttons werden währenddessen ausgeblendet. */
#btn-back-to-configurator {
  display: none;
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 15;
}
@media (max-width: 767px) {
  #btn-back-to-configurator {
    top: 44px;
    left: 10px;
    padding: 8px 16px;
    font-size: 13px;
  }
}
body.l6-anim-active #btn-back-to-configurator {
  display: inline-flex;
}
body.l6-anim-active #property-panel,
body.l6-anim-active #bottom-bar,
body.l6-anim-active #arrows,
body.l6-anim-active #hint,
body.l6-anim-active .hud-control {
  display: none !important;
}
body.l6-anim-active #viewport-toolbar .tbv-btn:not(.tbv-anim-keep),
body.l6-anim-active #viewport-toolbar .tbv-sep:not(.tbv-anim-keep) {
  display: none !important;
}

/* v2.8.14: Scrub-Slider, nur im Aufbau-Animation-Modus sichtbar */
#anim-scrub-wrap {
  display: none;
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 20px;
  z-index: 15;
}
body.l6-anim-active #anim-scrub-wrap {
  display: block;
}
#anim-scrub {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.15);
  outline: none;
  cursor: pointer;
  margin: 0;
}
#anim-scrub::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #D4622B;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
#anim-scrub::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #D4622B;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}
.l6-configurator-wrap button:disabled, .app-layout button:disabled, .bottom-bar button:disabled { cursor: not-allowed; }
