*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    min-height: 100vh;
}

.container {
    width: 95%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 1.5rem 1rem 4rem;
}

header { margin-bottom: 2rem; }
header h1 { font-size: 2rem; font-weight: 800; letter-spacing: -0.03em; }
header h1 span { color: #6366f1; }
header p { color: #6b7280; margin-top: 0.4rem; font-size: 0.95rem; }

.card {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    margin-bottom: 1.25rem;
}

.card-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6366f1;
    margin-bottom: 1rem;
}

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }

.field { display: flex; flex-direction: column; gap: 0.3rem; }
.field label { font-size: 0.82rem; font-weight: 600; color: #374151; }

.field input,
.field select,
.field textarea {
    padding: 0.55rem 0.75rem;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #fafafa;
    transition: border-color 0.15s, box-shadow 0.15s;
    color: inherit;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99,102,241,.15);
    background: #fff;
}

.field textarea { resize: vertical; min-height: 88px; }

/* ── Furniture selection area ──────────────────────────── */
.furniture-block {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    margin-bottom: 1.25rem;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Side-by-side when editor is open (Grid Layout) */
.furniture-block.editor-open {
    display: grid;
    grid-template-columns: 38% 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    gap: 1rem 1.5rem;
    align-items: start;
}

/* 1. Header (Links, Zeile 1) */
.furniture-block.editor-open #furniture-header {
    grid-column: 1;
    grid-row: 1;
    margin-bottom: 0;
    padding: 0;
}
/* Repariert den Button im Header */
.furniture-block.editor-open .furniture-header.initial-center .furniture-header-right {
    width: auto;
}
.furniture-block.editor-open .furniture-header.initial-center .load-btn {
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    border-radius: 9px;
}

/* 2. Filter (Links, Zeile 2) */
.furniture-block.editor-open #filter-section {
    grid-column: 1;
    grid-row: 2;
}

/* 3. Möbel-Liste (Links, Zeile 3) */
.furniture-block.editor-open #furniture-section {
    grid-column: 1;
    grid-row: 3;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}
.furniture-block.editor-open #furniture-scroll {
    flex: 1;
    max-height: calc(70vh - 120px);
    overflow-y: auto;
}

.furniture-block.editor-open .open-editor-btn {
    display: none !important;
}

/* 4. 3D-Editor (Rechts, erstreckt sich über alle 3 Zeilen) */
.furniture-block.editor-open .placement-editor {
    grid-column: 2;
    grid-row: 1 / span 3;
    display: flex;
    flex-direction: column;
    border-top: none;
    margin-top: 0;
    padding-top: 0;
    border-left: 1px solid #e5e7eb;
    padding-left: 1.5rem;
    height: 100%;
}
.furniture-block.editor-open .placement-editor-canvas {
    flex: 1;
    min-height: 500px;
    height: auto;
}

/* extra-filters hidden by default, shown only when editor-open (narrow column) */
.extra-filters-toggle { display: none; }
#extra-filters { display: block; }
.furniture-block.editor-open .extra-filters-toggle { display: inline-flex; }
.furniture-block.editor-open #extra-filters { display: none; }

#furniture-section {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

#furniture-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 0.5rem;
    border-radius: 8px;
    scrollbar-width: thin;
    scrollbar-color: #c7d2fe #f5f3ff;
}
#furniture-scroll::-webkit-scrollbar { width: 6px; }
#furniture-scroll::-webkit-scrollbar-track { background: #f5f3ff; border-radius: 3px; }
#furniture-scroll::-webkit-scrollbar-thumb { background: #c7d2fe; border-radius: 3px; }

/* ── Buttons ──────────────────────────────────────────── */
.load-btn {
    padding: 0.65rem 1.25rem;
    background: #f5f3ff;
    color: #6366f1;
    border: 1.5px solid #c7d2fe;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.load-btn:hover:not(:disabled) { background: #ede9fe; border-color: #6366f1; }
.load-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.load-btn.icon-mode {
    padding: 0.4rem 0.7rem;
    font-size: 1.2rem;
    line-height: 1;
    border-radius: 8px;
    min-width: unset;
}

.open-editor-btn {
    padding: 0.65rem 1.25rem;
    background: #f0fdf4;
    color: #16a34a;
    border: 1.5px solid #bbf7d0;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: background 0.15s, border-color 0.15s;
}
.open-editor-btn:hover { background: #dcfce7; border-color: #4ade80; }
.open-editor-btn.is-open {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}
.open-editor-btn.is-open:hover { background: #ffedd5; border-color: #fb923c; }

.close-editor-btn {
    padding: 0.65rem 1.25rem;
    background: #fff7ed;
    color: #c2410c;
    border: 1.5px solid #fed7aa;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.close-editor-btn:hover { background: #ffedd5; border-color: #fb923c; }

.extra-filters-toggle {
    padding: 0.45rem 0.75rem;
    background: #f5f3ff;
    color: #6366f1;
    border: 1.5px solid #c7d2fe;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    align-self: center;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.extra-filters-toggle:hover { background: #ede9fe; border-color: #6366f1; }
.extra-filters-toggle.is-open { background: #ede9fe; border-color: #6366f1; }

.furniture-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.furniture-header .card-title { margin-bottom: 0; }
.furniture-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* ── Filter Section ────────────────────────────────────── */
.filter-primary-row {
    display: flex;
    align-items: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.filter-primary-row .field { 
    flex: 1 1 calc(33% - 0.75rem);
    min-width: 50px; 
}

.extra-filters-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-end;
    padding-top: 0.75rem;
}

/* Inline Filters */
.filter-inline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: 0 0 auto;
}
.filter-inline label {
    margin-bottom: 0 !important;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
}
.filter-inline .dropdown-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.85rem;
    min-width: 100px;
}

/* Range Slider Styling */
input[type=range] {
    -webkit-appearance: none;
    background: transparent;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #e5e7eb;
    border-radius: 3px;
}
input[type=range]:focus::-webkit-slider-runnable-track {
    background: #d1d5db;
}

#selection-count {
    font-size: 0.82rem;
    color: #6b7280;
}
#selection-count span {
    font-weight: 700;
    color: #6366f1;
}

#furniture-list {
    display: block;
}

.placement-editor {
    border-top: 1px solid #e5e7eb;
    margin-top: 1.2rem;
    padding-top: 1.2rem;
}

.placement-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.55rem;
}

.placement-editor-hint {
    font-size: 0.78rem;
    color: #6b7280;
    margin-bottom: 0.8rem;
}

.placement-editor-canvas {
    width: 100%;
    height: 70vh;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f1f5f9;
    overflow: hidden;
}

.placement-editor-status {
    margin-top: 0.55rem;
    font-size: 0.76rem;
    color: #4b5563;
    min-height: 1.2em;
}

.furniture-card {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: pointer;
    user-select: none;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.furniture-card:hover { border-color: #a5b4fc; box-shadow: 0 2px 8px rgba(99,102,241,.1); }
.furniture-card.selected {
    border-color: #6366f1;
    background: #f5f3ff;
    box-shadow: 0 0 0 3px rgba(99,102,241,.18);
}

.furniture-card img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.furniture-card-body { 
    padding: 0.6rem 0.8rem 0.8rem; 
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.furniture-card-name {
    font-size: 0.83rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.3;
    margin-bottom: 0.2rem;
}
.furniture-card-dims { font-size: 0.73rem; color: #6b7280; margin-bottom: 0.15rem; }
.furniture-card-price {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6366f1;
    margin-bottom: 0.5rem;
}

.select-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #9ca3af;
    margin-top: auto;
}
.furniture-card.selected .select-indicator {
    color: #6366f1;
}
.select-indicator-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid #d1d5db;
    background: #fff;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}
.furniture-card.selected .select-indicator-dot {
    background: #6366f1;
    border-color: #6366f1;
}

.generate-btn {
    width: 100%;
    padding: 0.95rem 1.5rem;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: #fff;
    border: none;
    border-radius: 11px;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 14px rgba(99,102,241,.35);
}
.generate-btn:hover:not(:disabled) { opacity: 0.92; }
.generate-btn:active:not(:disabled) { transform: scale(0.99); }
.generate-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Loading indicator ────────────────────────────────── */
#loading { display: none; text-align: center; padding: 3.5rem 1rem; }
#loading p { color: #6b7280; font-size: 0.92rem; line-height: 1.6; }

.spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #e5e7eb;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    margin: 0 auto 1.25rem;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Result ───────────────────────────────────────────── */
#result { margin-top: 0.5rem; padding-top: 1rem; }
.result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.75rem;
    max-width: 1200px;
    margin: 0.5rem auto 0;
}
.result-image img {
    width: 100%;
    max-height: calc(60vh - 5rem);
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0,0,0,.12);
    display: block;
}
.result-image p {
    font-size: 0.85rem;
    color: #4b5563;
    text-align: center;
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 768px) {
    .furniture-block.editor-open { grid-template-columns: 1fr; }
    .furniture-block.editor-open .placement-editor { grid-column: 1; border-left: none; padding-left: 0; border-top: 1px solid #e5e7eb; margin-top: 1rem; padding-top: 1rem; }

    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } 
    .result-grid { grid-template-columns: 1fr; }
    header h1 { font-size: 1.6rem; }
    .placement-editor-canvas { height: 70vh; min-height: 400px; }
}

/* ── Dynamische Button Zentrierung ────────────────────── */
.furniture-header.initial-center {
    justify-content: center;
    padding: 2rem 0;
}
.furniture-header.initial-center .furniture-header-right {
    width: 100%;
    justify-content: center;
}
.furniture-header.initial-center .load-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 12px;
}

/* ── Dropdown Slider Styling ──────────────────────────── */
.dropdown-btn {
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: #fafafa;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    font-size: 0.92rem;
    font-family: inherit;
    color: inherit;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.dropdown-btn:focus {
    outline: none;
    border-color: #6366f1;
}
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 1.25rem 1rem;
    z-index: 10;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    margin-top: 5px;
    right: 0;
}
.dropdown-content.show {
    display: block;
}

/* ── Dropdown UI Erweiterungen für Slider & Checkboxes ──────────────────────────── */
.dropdown-container {
    position: relative;
}
.apply-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.6rem;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background 0.15s;
}
.apply-btn:hover { background: #4f46e5; }

.range-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.checkbox-list {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    padding-right: 0.5rem;
}
.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    cursor: pointer;
    color: #374151;
}
.checkbox-item input {
    cursor: pointer;
    accent-color: #6366f1;
    width: 16px;
    height: 16px;
}

/* ── Multi-Range Slider Styling (Keine Vererbung) ──────────────────────────── */
.multi-range-container {
    position: relative;
    width: 100%;
    height: 6px;
    margin: 15px 0;
    background-color: #e5e7eb;
    border-radius: 3px;
}
.multi-range-track {
    position: absolute;
    height: 100%;
    background-color: #6366f1;
    border-radius: 3px;
    z-index: 1;
}

.field .multi-range-container input[type="range"] {
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
}
.field .multi-range-container input[type="range"]:focus {
    box-shadow: none;
    border: none;
}

.multi-range-container input[type="range"] {
    position: absolute;
    width: 100%;
    height: 6px;
    top: 0;
    left: 0;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
    margin: 0;
    outline: none;
}

.multi-range-container input[type="range"]::-webkit-slider-runnable-track {
    background: transparent;
    border: none;
}
.multi-range-container input[type="range"]::-moz-range-track {
    background: transparent;
    border: none;
}

.multi-range-container input[type="range"]::-webkit-slider-thumb {
    pointer-events: auto;
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    margin-top: -6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
.multi-range-container input[type="range"]::-moz-range-thumb {
    pointer-events: auto;
    height: 18px;
    width: 18px;
    border: none;
    border-radius: 50%;
    background: #6366f1;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

/* ── Refinement Selection & Animation ─────────────────── */
.selected-for-refinement {
    outline: 3px solid #6366f1;
    border-radius: 12px;
    transition: filter 0.5s ease;
}

.is-refining-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    animation: ai-glow-pulse 4s infinite alternate ease-in-out;
    width: 100%;
    display: block;
    line-height: 0;
}

.is-refining-wrapper img.selected-for-refinement {
    filter: grayscale(30%) brightness(0.6) blur(1px);
    outline: none;
}

.is-refining-wrapper::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(
        110deg,
        rgba(255, 255, 255, 0) 20%,
        rgba(255, 255, 255, 0.4) 50%,
        rgba(255, 255, 255, 0) 80%
    );
    background-size: 200% 100%;
    animation: shimmer-sweep 2.5s infinite linear;
    pointer-events: none;
    border-radius: 10px;
}

@keyframes ai-glow-pulse {
    0%   { box-shadow: 0 0 15px rgba(66, 133, 244, 0.4), 0 0 0 3px rgba(66, 133, 244, 0.7); }
    33%  { box-shadow: 0 0 25px rgba(168, 85, 247, 0.5), 0 0 0 3px rgba(168, 85, 247, 0.8); }
    66%  { box-shadow: 0 0 25px rgba(236, 72, 153, 0.4), 0 0 0 3px rgba(236, 72, 153, 0.7); }
    100% { box-shadow: 0 0 15px rgba(56, 189, 248, 0.5), 0 0 0 3px rgba(56, 189, 248, 0.8); }
}

@keyframes shimmer-sweep {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Refinement Toolbar ────────────────────────────────── */
.refinement-toolbar {
    background: #f5f3ff;
    border: 1.5px solid #c4b5fd;
    border-radius: 14px;
    padding: 1.25rem 1.5rem;
    margin-top: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}
.refinement-toolbar-label {
    font-size: 0.88rem;
    color: #4c1d95;
    margin: 0;
}
.refinement-prompt-input {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1.5px solid #c4b5fd;
    border-radius: 8px;
    font-size: 0.92rem;
    font-family: inherit;
    background: #fff;
    color: #1e1b4b;
    box-sizing: border-box;
    transition: border-color 0.15s;
}
.refinement-prompt-input:focus {
    outline: none;
    border-color: #6366f1;
}
.refinement-submit-btn {
    max-width: 220px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    font-size: 0.9rem;
    padding: 0.6rem 1.25rem;
}

/* ── Image Comparison Slider ───────────────────────────── */
.img-compare-container {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    display: block;
    width: 100%;
}
.img-compare-after {
    display: block;
    width: 100%;
    height: auto;
}
.img-compare-before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.img-compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.9);
    pointer-events: none;
    transform: translateX(-50%);
}
.img-compare-handle {
    position: absolute;
    top: 50%;
    width: 36px;
    height: 36px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    pointer-events: none;
    color: #6366f1;
    transform: translate(-50%, -50%);
}
.img-compare-slider {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: col-resize;
    margin: 0;
    -webkit-appearance: none;
    appearance: none;
    z-index: 10;
}
.img-compare-labels {
    position: absolute;
    top: 0.5rem;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 0.6rem;
    pointer-events: none;
}
.img-compare-label {
    background: rgba(0, 0, 0, 0.52);
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.18rem 0.45rem;
    border-radius: 4px;
    letter-spacing: .06em;
    text-transform: uppercase;
}

/* ── Decision Toolbar ──────────────────────────────────── */
.decision-toolbar {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}
.decision-toolbar .btn-secondary {
    padding: 0.5rem 1.1rem;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    background: #fff;
    color: #374151;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}
.decision-toolbar .btn-secondary:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}
.decision-toolbar .btn-primary {
    padding: 0.5rem 1.1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    font-family: inherit;
}
.decision-toolbar .btn-primary:hover { opacity: 0.88; }

/* ── Progressive Disclosure Styling ────────────────────── */
.border-highlight {
    border-left: 4px solid #6366f1;
}

.toggle-advanced-btn {
    width: 100%;
    padding: 1rem;
    background: transparent;
    color: #6366f1;
    border: 2px dashed #c7d2fe;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    margin-bottom: 1.25rem;
}

.toggle-advanced-btn:hover {
    background: #f5f3ff;
    border-color: #a5b4fc;
}

.toggle-advanced-btn .chevron {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.toggle-advanced-btn.is-open .chevron {
    transform: rotate(180deg);
}

.advanced-wrapper {
    animation: slideDown 0.3s ease-out forwards;
    transform-origin: top;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.color-dropdown-content {
    min-width: 260px; /* Etwas breiter für 5 Spalten */
    padding: 1rem;
    left: 0;
    right: auto;
}

.color-palette-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr); /* Jetzt 5 Spalten für mehr Farben */
    gap: 0.6rem;
}

.swatch-indicator {
    display: inline-block;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.swatch-indicator.swatch-none {
    background: linear-gradient(45deg, #fafafa 44%, #b91c1c 44%, #b91c1c 56%, #fafafa 56%);
}



.color-swatch {
    cursor: pointer;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.color-swatch input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.color-swatch .swatch {
    display: block;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch .swatch-none {
    background: linear-gradient(45deg, #fafafa 44%, #b91c1c 44%, #b91c1c 56%, #fafafa 56%);
}

.color-swatch:hover .swatch {
    transform: scale(1.12);
}

.color-swatch input[type="radio"]:checked + .swatch {
    border-color: #6366f1;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px #6366f1;
    transform: scale(1.05);
}

/* Tabs for furniture categories */
.tabs-header {
    display: flex;
    gap: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}
.tab-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.tab-btn:hover {
    color: #1e293b;
    background: #f1f5f9;
}
.tab-btn.active {
    color: #6366f1;
    background: #e0e7ff;
}
.tab-pane {
    display: none;
}
.tab-pane.active {
    display: block;
}

/* Furniture Grid inside Tabs */
.furniture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
    padding-bottom: 1rem;
    padding-right: 0.5rem;
    max-height: 600px;
    min-height: 400px;
    overflow-y: auto;
}

/* Custom Scrollbar for the grid */
.furniture-grid::-webkit-scrollbar {
    width: 6px;
}
.furniture-grid::-webkit-scrollbar-track {
    background: #f1f5f9; 
    border-radius: 4px;
}
.furniture-grid::-webkit-scrollbar-thumb {
    background: #cbd5e1; 
    border-radius: 4px;
}
.furniture-grid::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; 
}
