
        * { margin: 0; padding: 0; box-sizing: border-box; }
        .ai-hidden { display: none !important; }
        body {
            font-family: 'DM Sans', sans-serif;
            background: #f0eeeb;
            color: #1a1a1a;
            overflow: hidden;
        }
        
        /* Scrollbars */
        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: #e0e0e0; border-radius: 3px; }
        ::-webkit-scrollbar-thumb:hover { background: #cccccc; }
        * { scrollbar-width: thin; scrollbar-color: #e0e0e0 transparent; }
        #app { display: flex; height: calc(100vh - 50px); }
        #sidebar {
            width: 300px;
            background: #fff;
            padding: 0;
            overflow-y: auto;
            border-left: 1px solid #f0f0ee;
            order: 2;
            position: relative;
        }
        #canvas-container { flex: 1; position: relative; cursor: crosshair; background: #f0eeeb; order: 1; }
        
        h1 { 
            font-family: 'DM Mono', monospace;
            font-size: 11px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 20px; 
        }
        h2 { 
            font-family: 'DM Mono', monospace;
            font-size: 11px; 
            font-weight: 600;
            margin: 0 0 14px 0; 
            color: #595959; 
            text-transform: uppercase; 
            letter-spacing: 0.1em; 
        }
        
        /* Studio Header */
        .studio-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 28px;
            height: 50px;
            background: #fff;
            border-bottom: 1px solid #f0f0ee;
            position: relative;
            z-index: 50;
        }
        .studio-logo {
            font-family: 'Outfit', 'DM Sans', sans-serif;
            font-size: 19px;
            font-weight: 500;
            letter-spacing: -0.01em;
            color: #1a1a1a;
            display: flex;
            align-items: center;
            gap: 9px;
        }
        .studio-logo-icon {
            flex-shrink: 0;
            transition: transform 0.7s cubic-bezier(0.25, 0, 0.25, 1);
        }
        .studio-logo:hover .studio-logo-icon {
            transform: rotate(90deg);
        }

        /* Arqulo spinner — shared across AI chat, render, landing */
        @keyframes arqulo-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
        @keyframes arqulo-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
        .arqulo-spin-fast { animation: arqulo-spin 1s cubic-bezier(0.45,0,0.55,1) infinite; }
        .arqulo-spin-slow { animation: arqulo-spin 2.2s linear infinite; }
        .arqulo-spin-pulse { animation: arqulo-spin 2s linear infinite, arqulo-pulse 2s ease infinite; }
        .studio-room-planner {
            display: flex; align-items: center; gap: 6px;
            font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
            color: #888; background: none; border: none;
            cursor: pointer; padding: 7px 14px; border-radius: 8px;
            text-transform: none; letter-spacing: 0;
            transition: all 0.15s;
        }
        .studio-header-right {
            display: flex; align-items: center; gap: 4px;
        }
        .studio-room-planner:hover { color: #1a1a1a; background: #f5f5f3; }
        .studio-room-planner svg { stroke: currentColor; opacity: 0.6; }
        .studio-room-planner:hover svg { opacity: 1; }
        .studio-cnc-btn .cnc-pro-badge {
            font-family: 'DM Mono', monospace;
            font-size: 9px; font-weight: 500;
            letter-spacing: .08em; color: #aaa;
            border: 1px solid rgba(0,0,0,.1);
            border-radius: 3px; padding: 1px 5px;
            margin-left: 4px; vertical-align: middle;
        }
        
        .section { 
            background: transparent; 
            border-radius: 0; 
            padding: 16px 20px; 
            margin-bottom: 0;
            border-bottom: 1px solid #ededed;
        }
        
        /* Remove number input spinners globally */
        input[type="number"]::-webkit-inner-spin-button,
        input[type="number"]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            appearance: none;
            margin: 0;
        }
        input[type="number"] {
            -moz-appearance: textfield;
        }
        
        .control-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
        .control-row label { 
            color: #8c8c8c; 
            font-size: 11px;
            font-family: 'DM Sans', sans-serif;
        }
        .control-row input[type="number"] {
            width: 70px; padding: 8px 10px; border: 1px solid #e6e6e6;
            border-radius: 0; background: #f9f9f9; color: #1a1a1a; 
            font-size: 13px;
            font-family: 'DM Mono', monospace;
            text-align: center;
        }
        .control-row input[type="number"]:focus {
            outline: none;
            border-color: #cccccc;
            background: #f5f5f5;
        }
        .control-row select {
            padding: 8px 10px; 
            padding-right: 28px;
            border: 1px solid #e6e6e6;
            border-radius: 0; 
            background-color: #f9f9f9;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
            color: #1a1a1a;
            font-family: 'DM Mono', monospace;
            font-size: 12px;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            cursor: pointer;
        }
        .control-row select:focus {
            outline: none;
            border-color: #cccccc;
            background-color: #f5f5f5;
        }
        .control-row select option {
            background: #ffffff;
            color: #1a1a1a;
            padding: 8px;
        }
        
        button {
            padding: 10px 14px; border: none; border-radius: 0;
            cursor: pointer; font-size: 10px; transition: all 0.15s;
            font-family: 'DM Mono', monospace;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-weight: 500;
        }
        button.primary { 
            background: transparent; 
            color: #262626; 
            width: 100%; 
            margin-bottom: 0;
            border: 1px solid #d9d9d9;
        }
        button.primary:hover { 
            background: #f5f5f5;
            border-color: #cccccc;
        }
        button.secondary { background: #f5f5f5; color: #666666; border: 1px solid #e6e6e6; }
        button.secondary:hover { background: #f2f2f2; color: #1a1a1a; }
        
        .module-list { margin-top: 10px; }
        
        /* Composition group */
        .composition-group {
            background: #fcfcfc;
            border: 1px solid #ebebeb;
            border-radius: 0;
            margin-bottom: 10px;
            overflow: hidden;
        }
        .composition-header {
            display: flex;
            align-items: center;
            padding: 10px 12px;
            cursor: pointer;
            background: #f9f9f9;
            border-bottom: 1px solid #ededed;
            transition: background 0.15s;
        }
        .composition-header:hover {
            background: #f5f5f5;
        }
        .composition-header.selected {
            background: #f5f5f5;
            border-bottom-color: #d9d9d9;
        }
        .composition-toggle {
            width: 16px;
            height: 16px;
            margin-right: 8px;
            color: #a6a6a6;
            transition: transform 0.2s;
        }
        .composition-group.collapsed .composition-toggle {
            transform: rotate(-90deg);
        }
        .composition-group.collapsed .composition-modules {
            display: none;
        }
        .composition-info {
            flex: 1;
        }
        .composition-name {
            font-weight: 600;
            font-size: 12px;
            margin-bottom: 2px;
        }
        .composition-meta {
            font-size: 10px;
            color: #a6a6a6;
            font-family: 'DM Mono', monospace;
        }
        .composition-modules {
            padding: 6px;
        }
        .composition-header.docked {
            border-left: 2px solid #7fb8d1;
            padding-left: 10px;
        }
        .docked-badge {
            display: inline-block;
            margin-left: 6px;
            font-size: 10px;
            opacity: 0.6;
        }
        .docked-badge.has-children {
            color: rgba(180,130,40,0.85);
        }
        
        .module-item {
            background: #f9f9f9; 
            border-radius: 0; 
            padding: 10px 12px; 
            margin-bottom: 4px;
            cursor: pointer; 
            border: 1px solid #ededed; 
            transition: all 0.15s;
            margin-left: 0;
        }
        .module-item:last-child {
            margin-bottom: 0;
        }
        .module-item:hover { 
            background: #f5f5f5; 
            border-color: #e6e6e6;
        }
        .module-item.selected { 
            border-color: #999999; 
            background: #f5f5f5;
        }
        .module-item.bridge {
            border-left: 2px solid #7fb8d1;
            background: #f3f8fc;
        }
        .module-item .module-title { 
            font-weight: 500; 
            margin-bottom: 2px;
            font-size: 11px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .module-item .module-title .badge {
            font-size: 9px;
            padding: 1px 5px;
            background: #e6f0f8;
            color: #2c72b0;
            border-radius: 2px;
            font-weight: 600;
        }
        .module-item .module-title .badge.cabinet-badge {
            background: #ede6f7;
            color: #6e46b4;
        }
        .module-item.cabinet {
            border-left: 2px solid #b396d6;
        }
        .module-item .module-dims { 
            font-size: 10px; 
            color: #999999;
            font-family: 'DM Mono', monospace;
        }
        
        .param-text-input {
            width: 100%;
            padding: 10px 12px;
            background: #f9f9f9;
            border: 1px solid #e6e6e6;
            color: #1a1a1a;
            font-size: 13px;
            border-radius: 0;
            font-family: inherit;
        }
        .param-text-input:focus {
            outline: none;
            border-color: #cccccc;
            background: #f5f5f5;
        }
        .comp-module-count {
            padding: 16px 0 8px 0;
            text-align: center;
            font-size: 11px;
            color: #a6a6a6;
        }
        .param-hint {
            font-size: 10px;
            color: #bfbfbf;
            font-style: italic;
            margin-top: 6px;
            line-height: 1.4;
        }
        
        .button-row { display: flex; gap: 8px; }
        .button-row button { flex: 1; }

        .export-section { border-bottom: none; }
        .export-buttons { flex-direction: column; gap: 6px; }
        .export-btn {
            display: flex; align-items: center; gap: 8px;
            padding: 9px 14px;
            background: #fafaf9; border: 1px solid #e5e4e2;
            font-size: 11.5px; font-weight: 500; color: #333;
            cursor: pointer; transition: all 0.15s ease;
            font-family: 'DM Sans', sans-serif;
            letter-spacing: 0.01em;
        }
        .export-btn:hover { background: #f5f4f2; border-color: #d5d4d2; }
        .export-btn:active { background: #eeedeb; }
        .export-btn:disabled { opacity: 0.5; cursor: not-allowed; }
        .export-btn svg { flex-shrink: 0; opacity: 0.6; }
        
        #info-overlay {
            position: absolute; top: 16px; left: 16px;
            background: rgba(255,255,255,0.88); padding: 8px 12px;
            border-radius: 8px; font-size: 11px; pointer-events: none;
            border: none;
            font-family: 'DM Sans', sans-serif;
            color: #bbb;
            backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
            z-index: 50;
        }
        #info-overlay .info-row { margin-bottom: 2px; }
        #info-overlay .info-label { color: #ccc; font-size: 10px; }
        #module-count, #total-width { font-family: 'DM Mono', monospace; color: #999; }

        
        /* Controls help */
        .controls-help-btn {
            position: absolute; bottom: 16px; right: 16px; z-index: 50;
            width: 28px; height: 28px; border-radius: 50%;
            background: rgba(255,255,255,0.85); border: 1px solid #e8e6e2;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer; color: #aaa;
            backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
            transition: color .15s, border-color .15s;
            padding: 0; text-transform: none;
        }
        .controls-help-btn:hover { color: #666; border-color: #ccc; }
        .controls-overlay {
            position: absolute; bottom: 52px; right: 16px; z-index: 50;
            background: rgba(255,255,255,0.92); border: 1px solid #e8e6e2;
            border-radius: 10px; padding: 10px 14px;
            backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
            font-family: 'DM Sans', sans-serif;
        }
        .controls-row {
            display: flex; align-items: center; gap: 10px;
            padding: 5px 0; font-size: 11px; color: #888;
        }
        .controls-icon { width: 22px; display: flex; align-items: center; justify-content: center; color: #bbb; flex-shrink: 0; }

        #interaction-hint {
            position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
            background: #ffffff; padding: 12px 24px;
            border-radius: 0; font-size: 11px; pointer-events: none;
            opacity: 0; transition: opacity 0.3s;
            border: 1px solid #ebebeb;
            letter-spacing: 0.02em;
            font-family: 'DM Mono', monospace;
        }
        #interaction-hint.visible { opacity: 1; }
        
        input[type="checkbox"] { 
            width: 14px; 
            height: 14px;
            accent-color: #262626;
        }
        
        .toggle-btn {
            padding: 6px 10px;
            font-size: 9px;
            background: #f9f9f9;
            border: 1px solid #ebebeb;
            border-radius: 0;
            color: #8c8c8c;
            cursor: pointer;
            transition: all 0.15s;
            font-family: 'DM Mono', monospace;
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .toggle-btn.active {
            background: #f5f5f5;
            color: #262626;
            border-color: #cccccc;
        }
        .toggle-btn:hover {
            background: #f5f5f5;
        }
        .toggle-btn.active:hover {
            background: #f2f2f2;
        }
        
        /* Material swatches */
        .material-swatches {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
        }
        .material-swatch {
            width: 36px;
            height: 36px;
            cursor: pointer;
            border: 2px solid transparent;
            transition: all 0.15s;
            position: relative;
            padding: 3px;
            background: #fafafa;
        }
        .material-swatch:hover {
            border-color: #d9d9d9;
        }
        .material-swatch.active {
            border-color: #cccccc;
        }
        .swatch-color {
            width: 100%;
            height: 100%;
        }
        .material-swatch::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            background: #f7f7f5;
            color: #404040;
            font-size: 9px;
            font-family: 'DM Mono', monospace;
            padding: 4px 8px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.15s;
            border: 1px solid #e6e6e6;
        }
        .material-swatch:hover::after {
            opacity: 1;
        }
        
        /* Config rows (Material, Details) */
        .config-rows {
            display: flex;
            flex-direction: row;
            gap: 6px;
        }
        .config-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            width: 52px;
            padding: 8px 4px 6px;
            background: transparent;
            border: 1.5px solid #ebebeb;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .config-btn:hover {
            background: #f9f9f9;
            border-color: #d1d1d1;
        }
        .config-btn.active {
            background: #f2f2f2;
            border-color: #4d4d4d;
        }
        .config-btn .swatch-mini {
            width: 26px;
            height: 26px;
            border: 1px solid #e0e0e0;
            border-radius: 4px;
        }
        .config-btn svg {
            width: 24px;
            height: 24px;
        }
        .config-btn .config-btn-label {
            font-size: 8px;
            font-family: 'DM Mono', monospace;
            color: #a6a6a6;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            line-height: 1;
            font-weight: 500;
        }
        .config-btn:hover .config-btn-label {
            color: #737373;
        }
        .config-btn.active .config-btn-label {
            color: #262626;
        }
        .detail-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 3px 0;
        }
        .detail-label {
            font-size: 10px;
            color: #8c8c8c;
        }
        .detail-input-wrap {
            display: flex;
            align-items: center;
            gap: 3px;
        }
        .detail-input-wrap input[type="number"] {
            width: 48px;
            background: #f5f5f5;
            border: 1px solid #e6e6e6;
            border-radius: 3px;
            color: #1a1a1a;
            font-family: 'DM Mono', monospace;
            font-size: 10px;
            padding: 4px 5px;
            text-align: right;
            outline: none;
            -moz-appearance: textfield;
        }
        .detail-input-wrap input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; }
        .detail-input-wrap input[type="number"]:focus { border-color: #cccccc; }
        .detail-unit {
            font-size: 9px;
            color: #bfbfbf;
            width: 18px;
        }
        
        /* Config aside panels - same style as module params */
        .config-aside-panel {
            width: 210px;
        }
        /* Details panel nav bar */
        .details-nav {
            display: flex;
            gap: 4px;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid #ededed;
        }
        .details-nav-btn {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
            padding: 6px 2px 4px;
            background: #fafafa;
            border: 1px solid #ededed;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.15s;
            color: #a6a6a6;
        }
        .details-nav-btn:hover {
            background: #f5f5f5;
            color: #808080;
        }
        .details-nav-btn.active {
            background: #f5f5f5;
            border-color: #e0e0e0;
            color: #404040;
        }
        .details-nav-btn span {
            font-size: 7px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .detail-section {
            animation: detailFadeIn 0.15s ease;
        }
        @keyframes detailFadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
        .detail-hint {
            font-size: 9px;
            color: #bfbfbf;
            margin: -4px 0 8px;
            line-height: 1.3;
        }
        .detail-sub-row {
            padding-left: 8px;
            opacity: 0.7;
        }
        .detail-sub-row .detail-label {
            font-size: 10px;
        }
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 34px;
            height: 18px;
        }
        .toggle-switch input { opacity: 0; width: 0; height: 0; }
        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0; left: 0; right: 0; bottom: 0;
            background: #f2f2f2;
            border-radius: 18px;
            transition: 0.2s;
        }
        .toggle-slider:before {
            content: "";
            position: absolute;
            height: 14px; width: 14px;
            left: 2px; bottom: 2px;
            background: #b3b3b3;
            border-radius: 50%;
            transition: 0.2s;
        }
        .toggle-switch input:checked + .toggle-slider {
            background: #e0e0e0;
        }
        .toggle-switch input:checked + .toggle-slider:before {
            transform: translateX(16px);
            background: #666666;
        }
        /* Profile cards in panels */
        .profile-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }
        .profile-card {
            background: #fafafa;
            border: 2px solid transparent;
            padding: 10px;
            cursor: pointer;
            transition: all 0.15s;
            text-align: center;
        }
        .profile-card:hover {
            border-color: #e0e0e0;
        }
        .profile-card.active {
            border-color: #cccccc;
            background: #f5f5f5;
        }
        .profile-card svg {
            width: 100%;
            height: 40px;
            margin-bottom: 6px;
        }
        .profile-card .profile-name {
            font-size: 10px;
            font-family: 'DM Mono', monospace;
            color: #808080;
            text-transform: uppercase;
        }
        /* Material grid in panel */
        .material-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 6px;
        }
        .material-section-label {
            font-size: 9px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            color: #b3b3b3;
            padding: 8px 0 4px;
            border-bottom: 1px solid #ededed;
            margin-bottom: 6px;
        }
        .material-section-label:first-child { padding-top: 0; }
        .material-card {
            background: #fafafa;
            border: 2px solid transparent;
            border-radius: 4px;
            padding: 6px;
            cursor: pointer;
            transition: all 0.15s;
            text-align: center;
        }
        .material-card:hover {
            border-color: #e0e0e0;
        }
        .material-card.active {
            border-color: #cccccc;
            background: #f5f5f5;
        }
        .material-card .mat-swatch {
            width: 100%;
            height: 36px;
            margin: 0 auto 4px;
            border: 1px solid #e6e6e6;
            border-radius: 3px;
        }
        .material-card .mat-name {
            font-size: 9px;
            font-family: 'DM Mono', monospace;
            color: #808080;
        }
        .custom-color-section {
            margin-top: 10px;
            padding-top: 10px;
            border-top: 1px solid #ededed;
        }
        .material-card .custom-remove-btn {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            background: #999999;
            border: none;
            color: #808080;
            font-size: 9px;
            line-height: 14px;
            text-align: center;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.15s;
            padding: 0;
        }
        .material-card:hover .custom-remove-btn {
            opacity: 1;
        }
        .material-card .custom-remove-btn:hover {
            background: rgba(255,60,60,0.6);
            color: #1a1a1a;
        }
        .lab-wheel-wrap {
            display: flex;
            gap: 6px;
            align-items: stretch;
            margin-bottom: 8px;
        }
        .lab-wheel-container {
            position: relative;
            width: 140px;
            height: 140px;
            flex-shrink: 0;
        }
        .lab-wheel-container canvas {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            cursor: crosshair;
        }
        .lab-wheel-cursor {
            position: absolute;
            width: 12px;
            height: 12px;
            border: 2px solid #fff;
            border-radius: 50%;
            pointer-events: none;
            transform: translate(-50%, -50%);
            box-shadow: 0 0 3px rgba(0,0,0,0.5);
        }
        .lab-lightness-wrap {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 3px;
            flex: 1;
        }
        .lab-lightness-track {
            position: relative;
            width: 18px;
            flex: 1;
            border-radius: 9px;
            border: 1px solid #e6e6e6;
            cursor: pointer;
            overflow: hidden;
        }
        .lab-lightness-track canvas {
            width: 100%;
            height: 100%;
        }
        .lab-lightness-thumb {
            position: absolute;
            left: -2px;
            right: -2px;
            height: 6px;
            border: 2px solid #fff;
            border-radius: 3px;
            pointer-events: none;
            transform: translateY(-50%);
            box-shadow: 0 0 3px rgba(0,0,0,0.5);
        }
        .lab-l-label {
            font-size: 8px;
            color: #bfbfbf;
            font-family: 'DM Mono', monospace;
        }
        .custom-color-row {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 5px;
        }
        .custom-color-row label {
            font-size: 9px;
            font-weight: 600;
            color: #a6a6a6;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            width: 28px;
            flex-shrink: 0;
        }
        .custom-color-row input[type="text"] {
            flex: 1;
            background: #f5f5f5;
            border: 1px solid #e6e6e6;
            border-radius: 3px;
            color: #1a1a1a;
            font-family: 'DM Mono', monospace;
            font-size: 10px;
            padding: 5px 6px;
            outline: none;
            min-width: 0;
        }
        .custom-color-row input[type="text"]:focus {
            border-color: #cccccc;
        }
        .custom-color-row input[type="text"]::placeholder {
            color: #d9d9d9;
        }
        .ncs-match-hint {
            font-size: 8px;
            color: #bfbfbf;
            padding: 0 0 2px 34px;
            min-height: 12px;
        }
        .btn-apply-color {
            width: 100%;
            margin-top: 4px;
            padding: 7px;
            background: #f5f5f5;
            border: 1px solid #e0e0e0;
            border-radius: 4px;
            color: #595959;
            font-size: 10px;
            font-weight: 600;
            cursor: pointer;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            transition: all 0.15s;
        }
        .btn-apply-color:hover {
            background: #f0f0f0;
            color: #262626;
            border-color: #d1d1d1;
        }
        .custom-color-preview {
            width: 100%;
            height: 20px;
            border-radius: 3px;
            border: 1px solid #e6e6e6;
            margin-top: 4px;
        }
        
        /* System selector */
        .system-section {
            padding-bottom: 12px !important;
        }
        .system-subsection {
            margin-bottom: 14px;
        }
        .system-subsection:last-child {
            margin-bottom: 0;
        }
        .subsection-label {
            display: block;
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #8c8c8c;
            margin-bottom: 10px;
            font-family: 'DM Mono', monospace;
        }
        .system-selector {
            display: flex;
            gap: 6px;
        }
        .system-option {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 7px;
            padding: 12px 6px 10px;
            cursor: pointer;
            border: 1.5px solid #ebebeb;
            border-radius: 6px;
            background: transparent;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .system-option:hover {
            background: #f9f9f9;
            border-color: #d1d1d1;
        }
        .system-option.active {
            background: #f2f2f2;
            border-color: #4d4d4d;
            box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
        }
        .system-option svg {
            width: 26px;
            height: 26px;
            stroke: #b3b3b3;
            stroke-width: 1.8;
        }
        .system-option:hover svg {
            stroke: #808080;
        }
        .system-option.active svg {
            stroke: #262626;
        }
        .system-option span {
            font-size: 9px;
            color: #a6a6a6;
            font-family: 'DM Mono', monospace;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-weight: 500;
        }
        .system-option:hover span {
            color: #737373;
        }
        .system-option.active span {
            color: #262626;
            font-weight: 500;
        }
        
        /* Style selector */
        .style-selector {
            display: flex;
            gap: 6px;
        }
        .style-option {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 10px 4px 8px;
            cursor: pointer;
            border: 1.5px solid #ebebeb;
            border-radius: 6px;
            background: transparent;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .style-option:hover {
            background: #f9f9f9;
            border-color: #d1d1d1;
        }
        .style-option.active {
            background: #f2f2f2;
            border-color: #4d4d4d;
            box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
        }
        .style-option.disabled {
            opacity: 0.3;
            pointer-events: none;
        }
        .style-option svg {
            width: 30px;
            height: 38px;
            stroke: #b3b3b3;
            stroke-width: 1.8;
        }
        .style-option:hover svg {
            stroke: #808080;
        }
        .style-option.active svg {
            stroke: #262626;
        }
        .style-option span {
            font-size: 9px;
            color: #a6a6a6;
            font-family: 'DM Mono', monospace;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-weight: 500;
        }
        .style-option:hover span {
            color: #737373;
        }
        .style-option.active span {
            color: #262626;
        }
        
        /* Base selector (cabinet/floor option) */
        .base-selector {
            display: flex;
            gap: 6px;
        }
        .base-option {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 10px 4px 8px;
            cursor: pointer;
            border: 1.5px solid #ebebeb;
            border-radius: 6px;
            background: transparent;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .base-option:hover {
            background: #f9f9f9;
            border-color: #d1d1d1;
        }
        .base-option.active {
            background: #f2f2f2;
            border-color: #4d4d4d;
            box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
        }
        .base-option svg {
            width: 30px;
            height: 30px;
            stroke: #b3b3b3;
            stroke-width: 1.8;
        }
        .base-option:hover svg {
            stroke: #808080;
        }
        .base-option.active svg {
            stroke: #262626;
        }
        .base-option span {
            font-size: 9px;
            color: #a6a6a6;
            font-family: 'DM Mono', monospace;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-weight: 500;
        }
        .base-option:hover span {
            color: #737373;
        }
        .base-option.active span {
            color: #262626;
        }
        #base-option-section {
            display: none; /* Hidden by default, shown for bookshelf */
        }
        #base-option-section.visible {
            display: block;
        }
        
        /* Constraints info */
        .constraints-info {
            padding-top: 12px;
            border-top: 1px solid #ededed;
            margin-top: 4px;
        }
        .constraints-display {
            display: flex;
            gap: 16px;
            font-size: 10px;
            font-family: 'DM Mono', monospace;
            color: #a6a6a6;
        }
        

        
        /* Combined Canvas Tools Panel */
        .canvas-tools-panel {
            position: absolute;
            bottom: 16px;
            left: 16px;
            display: flex;
            flex-direction: column;
            gap: 0;
            background: rgba(255,255,255,0.88);
            padding: 6px;
            border: none;
            border-radius: 10px;
            backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
            z-index: 100;
        }
        .tools-row {
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .tools-divider {
            height: 1px;
            background: #f0f0f0;
            margin: 8px 0;
        }
        .canvas-tool {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: grab;
            transition: all 0.15s;
            background: transparent;
            border: none;
            border-radius: 8px;
            position: relative;
        }
        .canvas-tool:hover {
            background: rgba(0,0,0,0.05);
        }
        .canvas-tool:active {
            cursor: grabbing;
        }
        .canvas-tool svg {
            width: 20px;
            height: 20px;
            stroke: #999;
            stroke-width: 1.8;
        }
        .canvas-tool:hover svg {
            stroke: #333;
        }
        /* Tooltip */
        .canvas-tool::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: calc(100% + 8px);
            left: 50%;
            transform: translateX(-50%);
            background: rgba(26,26,26,0.9);
            color: #fff;
            font-size: 10px;
            font-family: 'DM Sans', sans-serif;
            font-weight: 500;
            padding: 4px 10px;
            border-radius: 6px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.15s;
            border: none;
            z-index: 100;
        }
        .canvas-tool:hover::after {
            opacity: 1;
        }
        .canvas-tool[data-tooltip-align="right"]::after {
            left: 0;
            transform: none;
        }
        
        /* Door settings popover */
        .door-popover {
            position: absolute;
            bottom: calc(100% + 12px);
            left: 50%;
            transform: translateX(-50%);
            background: #ffffff;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            padding: 8px;
            display: none;
            flex-direction: column;
            gap: 6px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.08);
            z-index: 200;
            min-width: 160px;
        }
        .door-popover.visible {
            display: flex;
        }
        .door-popover-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }
        .door-popover-label {
            font-size: 10px;
            font-family: 'DM Sans', sans-serif;
            color: #666;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            white-space: nowrap;
        }
        .door-popover-toggle {
            display: flex;
            gap: 2px;
            background: #f2f2f2;
            border-radius: 5px;
            padding: 2px;
        }
        .door-opt {
            font-size: 10px;
            font-family: 'DM Sans', sans-serif;
            padding: 3px 8px;
            border: none;
            background: transparent;
            color: #888;
            cursor: pointer;
            border-radius: 4px;
            transition: all 0.15s;
            white-space: nowrap;
        }
        .door-opt:hover {
            color: #444;
        }
        .door-opt.active {
            background: #fff;
            color: #1a1a1a;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .door-popover-row.hidden {
            display: none;
        }
        .door-popover-input-wrap {
            display: flex;
            align-items: center;
            gap: 3px;
            background: #f2f2f2;
            border-radius: 5px;
            padding: 4px 8px;
            cursor: text;
        }
        .door-popover-input-wrap input {
            width: 40px;
            border: none;
            background: transparent;
            font-size: 11px;
            font-family: 'DM Mono', monospace;
            color: #1a1a1a;
            text-align: right;
            outline: none;
            padding: 4px 0;
            cursor: text;
        }
        .door-popover-unit {
            font-size: 9px;
            font-family: 'DM Mono', monospace;
            color: #999;
        }
        /* Hide tooltip when popover is open */
        .canvas-tool:has(.door-popover.visible)::after {
            display: none;
        }
        
        /* Module Parameters Panel - floating beside sidebar */
        .module-params-panel {
            width: 340px;
            background: #ffffff;
            border: none;
            display: none;
            flex-direction: column;
            padding: 16px;
            overflow-y: auto;
            color: #1a1a1a;
            font-family: 'DM Sans', sans-serif;
            position: fixed;
            right: 290px;
            top: 80px;
            box-shadow: -2px 0 20px rgba(0,0,0,0.08);
            z-index: 150;
            animation: panelSlideIn 0.2s ease-out;
            max-height: calc(100vh - 160px);
        }
        .module-params-panel.open {
            display: flex;
        }
        .module-params-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid #ebebeb;
        }
        .module-params-title {
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: #262626;
        }
        .panel-close-btn {
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            color: #a6a6a6;
            cursor: pointer;
            padding: 0;
            margin: -4px -4px -4px 0;
            border-radius: 4px;
            transition: all 0.15s;
        }
        .panel-close-btn:hover {
            background: #f2f2f2;
            color: #404040;
        }
        .panel-close-btn svg {
            width: 14px;
            height: 14px;
        }
        .module-params-content {
            display: flex;
            flex-direction: column;
            gap: 0;
        }
        .param-group {
            display: flex;
            flex-direction: column;
            gap: 8px;
            padding: 14px 0;
            border-bottom: 1px solid #ededed;
        }
        .param-group:first-child {
            padding-top: 0;
        }
        .param-group:last-of-type {
            border-bottom: none;
        }
        .param-group > label {
            font-size: 9px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            color: #8c8c8c;
            margin-bottom: 2px;
        }
        .param-row-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }
        .param-row-grid.small {
            grid-template-columns: repeat(2, 1fr);
            gap: 8px;
        }
        .param-row-grid.cols-3 {
            grid-template-columns: repeat(3, 1fr);
        }
        .param-field {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .param-field .param-label {
            font-size: 9px;
            color: #a6a6a6;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }
        .param-field input {
            padding: 10px 12px;
            border: 1px solid #e6e6e6;
            background: #f9f9f9;
            color: #1a1a1a;
            font-family: 'DM Mono', monospace;
            font-size: 12px;
            width: 100%;
            box-sizing: border-box;
        }
        .param-field input:focus {
            outline: none;
            border-color: #bfbfbf;
            background: #f5f5f5;
        }
        .structure-buttons {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 6px;
            margin-bottom: 8px;
        }
        .structure-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 10px 8px;
            background: #f5f5f5;
            border: 1px solid #d9d9d9;
            color: #404040;
            font-size: 10px;
            font-family: 'DM Sans', sans-serif;
            cursor: pointer;
            transition: all 0.15s;
        }
        .structure-btn:hover {
            background: #f0f0f0;
            border-color: #bfbfbf;
            color: #1a1a1a;
        }
        .structure-btn svg {
            width: 14px;
            height: 14px;
            stroke: #333333;
        }
        .advanced-details {
            border-top: 1px solid #ededed;
            padding-top: 12px;
        }
        .advanced-details summary {
            font-size: 9px;
            color: #a6a6a6;
            cursor: pointer;
            margin-bottom: 10px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }
        .advanced-details summary:hover {
            color: #666666;
        }
        .advanced-details[open] summary {
            color: #262626;
        }
        .param-toggle {
            margin-bottom: 10px;
        }
        .toggle-label {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            font-size: 11px;
            color: #666666;
        }
        .toggle-label input[type="checkbox"] {
            width: 16px;
            height: 16px;
            accent-color: #262626;
            cursor: pointer;
        }
        .toggle-text {
            font-family: 'DM Sans', sans-serif;
        }
        .plinth-settings {
            transition: opacity 0.2s, max-height 0.2s;
        }
        .plinth-settings.disabled {
            opacity: 0.3;
            pointer-events: none;
        }
        .delete-btn {
            width: 100%;
            padding: 12px;
            margin-top: 16px;
            background: transparent;
            border: 1px solid #e6b3b3;
            color: #c04040;
            font-size: 10px;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            cursor: pointer;
            transition: all 0.15s;
        }
        .delete-btn:hover {
            background: #fcf0f0;
            border-color: #d98080;
            color: #c83c3c;
        }
        
        /* Canvas Controls - floating bottom left */
        .canvas-ctrl-btn {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: transparent;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .canvas-ctrl-btn svg {
            width: 18px;
            height: 18px;
            stroke: #999;
            stroke-width: 1.8;
        }
        .canvas-ctrl-btn:hover {
            background: rgba(0,0,0,0.05);
        }
        .canvas-ctrl-btn:hover svg {
            stroke: #333;
        }
        .canvas-ctrl-btn.active {
            background: rgba(0,0,0,0.06);
        }
        .canvas-ctrl-btn.active svg {
            stroke: #1a1a1a;
        }
        .canvas-ctrl-btn:disabled {
            opacity: 0.25;
            cursor: not-allowed;
        }
        .canvas-ctrl-btn:disabled:hover {
            background: transparent;
        }
        .canvas-ctrl-btn:disabled:hover svg {
            stroke: #999;
        }
        .snap-control {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-left: 4px;
        }
        .snap-control span {
            font-size: 10px;
            color: #bbb;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-family: 'DM Sans', sans-serif;
            font-weight: 600;
        }
        .snap-control select {
            padding: 4px 22px 4px 8px;
            background-color: transparent;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23bbb' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 4px center;
            border: none;
            color: #999;
            font-family: 'DM Mono', monospace;
            font-size: 11px;
            cursor: pointer;
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
        }
        .snap-control select:focus {
            outline: none;
        }
        .snap-control select option {
            background: #ffffff;
            color: #1a1a1a;
            padding: 10px;
        }

        .drag-tool-icon {
            width: 40px;
            height: 20px;
        }
        .shelf-icon {
            background: linear-gradient(to bottom, #8B7355 0%, #6B5344 100%);
            border-radius: 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        .divider-icon {
            width: 8px;
            height: 40px;
            background: linear-gradient(to right, #8B7355 0%, #6B5344 100%);
            border-radius: 0;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        
        /* Layout presets */
        .layout-presets {
            display: flex;
            gap: 6px;
            margin-bottom: 0;
            margin-top: 8px;
        }
        .layout-preset {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 5px;
            padding: 10px 4px 8px;
            background: transparent;
            border: 1.5px solid #ebebeb;
            border-radius: 6px;
            cursor: pointer;
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .layout-preset:hover {
            background: #f9f9f9;
            border-color: #d1d1d1;
        }
        .layout-preset.active {
            background: #f2f2f2;
            border-color: #4d4d4d;
            box-shadow: 0 0 0 1px rgba(0,0,0,0.05);
        }
        .layout-preset svg {
            width: 26px;
            height: 26px;
            stroke: #b3b3b3;
            stroke-width: 2;
            fill: none;
        }
        .layout-preset:hover svg {
            stroke: #808080;
        }
        .layout-preset.active svg {
            stroke: #262626;
        }
        .layout-preset span {
            font-size: 9px;
            color: #a6a6a6;
            font-family: 'DM Mono', monospace;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            font-weight: 500;
        }
        .layout-preset:hover span {
            color: #737373;
        }
        .layout-preset.active span {
            color: #262626;
        }
        .layout-controls {
            display: none;
            flex-direction: column;
            gap: 8px;
            margin-top: 10px;
            padding: 12px;
            background: #fafafa;
            border-radius: 0;
            border: 1px solid #ededed;
        }
        .layout-controls.visible {
            display: flex;
        }
        .layout-control {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .layout-control label {
            flex: 1;
            font-size: 10px;
            color: #8c8c8c;
            font-family: 'DM Sans', sans-serif;
        }
        .layout-control input[type="range"] {
            flex: 2;
        }
        .layout-control .value {
            width: 35px;
            text-align: right;
            font-size: 11px;
            color: #1a1a1a;
            font-family: 'DM Mono', monospace;
        }
        
        .drop-indicator {
            position: absolute;
            pointer-events: none;
            z-index: 100;
        }
        .drop-indicator.shelf {
            height: 4px;
            background: #4d4d4d;
            box-shadow: 0 0 10px rgba(0,0,0,0.15);
        }
        .drop-indicator.divider {
            width: 4px;
            background: #4d4d4d;
            box-shadow: 0 0 10px rgba(0,0,0,0.15);
        }
        
        .drag-ghost {
            position: fixed;
            pointer-events: none;
            z-index: 1000;
            opacity: 0;
            transition: opacity 0.15s;
            transform: translate(-50%, -50%);
            width: 44px;
            height: 44px;
            background: rgba(255,255,255,0.97);
            border: 1px solid #e0e0e0;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .drag-ghost.visible {
            opacity: 1;
        }
        .drag-ghost svg {
            width: 24px;
            height: 24px;
            stroke: #737373;
            stroke-width: 1.5;
            fill: none;
        }
        
        /* Advanced toggle */
        .advanced-toggle {
            display: flex;
            align-items: center;
            gap: 6px;
            background: none;
            border: none;
            color: #a6a6a6;
            cursor: pointer;
            font-size: 9px;
            font-family: 'DM Mono', monospace;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            padding: 8px 0;
            width: 100%;
            margin-top: 4px;
        }
        .advanced-toggle:hover { color: #808080; }
        .advanced-toggle .arrow { transition: transform 0.2s; }
        .advanced-toggle.open .arrow { transform: rotate(90deg); }
        .advanced-content { 
            display: none; 
            padding-top: 8px; 
            border-top: 1px solid #ededed; 
            margin-top: 6px; 
        }
        .advanced-content.open { display: block; }
        .control-row.small label { font-size: 9px; }
        .control-row.small input { width: 55px; font-size: 11px; padding: 5px 6px; }
        
        /* Room button */
        .room-btn {
            width: 100%;
            padding: 10px 12px;
            font-size: 9px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            margin-bottom: 0;
        }
        .room-btn svg {
            flex-shrink: 0;
            width: 14px;
            height: 14px;
        }
        
        /* Room Planner Modal - Blueprint Light Theme */
        
        :root {
            --room-bg: #F5F3EE;
            --room-fg: #1a1a18;
            --room-border: rgba(0,0,0,0.18);
            --room-border-strong: rgba(0,0,0,0.3);
            --room-muted: #6a6a68;
            --room-accent: #1a1a1a;
            --room-accent-hover: #333;
            --room-accent-glow: rgba(26, 26, 26, 0.1);
            --room-cyan: #4a8a9a;
            --room-cyan-light: #6aaaba;
            --room-cyan-glow: rgba(74, 138, 154, 0.2);
            --room-measure: #4a8a9a;
            --room-wall: #1a1a18;
            --room-floor: #EFECE5;
            --room-grid: rgba(0,0,0,0.04);
            --room-grid-major: rgba(0,0,0,0.08);
            --room-surface: rgba(255,255,255,0.9);
            --room-surface-solid: #ffffff;
            --room-surface-hover: rgba(255,255,255,0.98);
            --room-glass: rgba(255,255,255,0.85);
            --room-glass-border: rgba(0,0,0,0.15);
            --room-shadow: 0 2px 8px rgba(0,0,0,0.08);
            --room-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
        }
        
        .room-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: var(--room-bg);
            z-index: 1000;
            flex-direction: column;
            font-family: 'DM Sans', -apple-system, sans-serif;
        }
        .room-modal.open { display: flex; }
        
        .room-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 14px 28px;
            background: var(--room-surface-solid);
            border-bottom: 1px solid #e8e6e1;
            color: var(--room-fg);
            position: relative;
            z-index: 50;
        }
        
        .room-logo {
            font-family: 'Outfit', 'DM Sans', sans-serif;
            font-size: 17px;
            font-weight: 500;
            letter-spacing: -0.01em;
            color: #1a1a1a;
            display: flex; align-items: center; gap: 9px;
        }
        .room-logo span { color: #1a1a1a; font-weight: 500; }
        
        .room-actions { display: flex; gap: 10px; }
        .room-actions button {
            background: transparent;
            color: #888;
            border: 1px solid #ddd;
            padding: 9px 18px;
            font-family: 'DM Sans', sans-serif;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
            border-radius: 8px;
        }
        .room-actions button:hover {
            background: #f5f5f5;
            color: #1a1a1a;
            border-color: #bbb;
        }
        .room-actions button.cancel-btn {
            background: transparent;
            color: #888;
            border: 1px solid #ddd;
        }
        .room-actions button.cancel-btn:hover {
            background: #f7f7f7;
            color: #1a1a1a;
            border-color: #ccc;
        }
        .room-actions button#room-apply {
            background: #1a1a1a;
            color: #fff;
            border: none;
        }
        .room-actions button#room-apply:hover {
            opacity: 0.85;
        }
        
        .room-main {
            flex: 1;
            display: flex;
            overflow: hidden;
        }
        
        .room-canvas-area {
            flex: 1;
            position: relative;
            overflow: hidden;
            cursor: grab;
            background: var(--room-bg);
        }
        .room-canvas-area:active { cursor: grabbing; }
        
        /* Blueprint grid - fine mesh with major lines */
        .grid-bg {
            position: absolute;
            inset: 0;
            background-image: 
                linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0,0,0,0.06) 1px, transparent 1px),
                linear-gradient(rgba(0,0,0,0.03) 1px, transparent 1px),
                linear-gradient(90deg, rgba(0,0,0,0.03) 1px, transparent 1px);
            background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
            pointer-events: none;
        }
        
        .room-canvas {
            position: absolute;
            transform-origin: center center;
        }
        
        /* Floor - subtle grid */
        .room-floor {
            position: absolute;
            background: var(--room-floor);
            background-image: 
                linear-gradient(rgba(90,154,170,0.08) 1px, transparent 1px),
                linear-gradient(90deg, rgba(90,154,170,0.08) 1px, transparent 1px);
            background-size: 50px 50px;
        }
        
        /* Walls - double line architectural style */
        .walls-svg {
            position: absolute;
            top: 0;
            left: 0;
            overflow: visible;
            pointer-events: none;
            filter: drop-shadow(0 3px 8px rgba(0,0,0,0.15));
        }
        .walls-svg .wall-outer {
            stroke: #1a1a1a;
            stroke-width: 2px;
            fill: none;
            vector-effect: non-scaling-stroke;
        }
        .walls-svg .wall-inner {
            stroke: #1a1a1a;
            stroke-width: 2px;
            fill: var(--room-floor);
            vector-effect: non-scaling-stroke;
        }
        .walls-svg .wall-fill {
            fill: #FAF9F6;
            stroke: none;
        }
        .wall-handle {
            position: absolute;
            background: transparent;
            z-index: 20;
        }
        .wall-handle.horizontal { height: 20px; cursor: ns-resize; margin-top: -10px; }
        .wall-handle.vertical { width: 20px; cursor: ew-resize; margin-left: -10px; }
        .wall-handle:hover ~ .walls-svg .wall-outer,
        .wall-handle:hover ~ .walls-svg .wall-inner,
        .wall-handle.dragging ~ .walls-svg .wall-outer,
        .wall-handle.dragging ~ .walls-svg .wall-inner {
            stroke: #e07850;
            stroke-width: 2.5px;
        }
        
        /* Dimension labels - clean style */
        .wall-dim {
            position: absolute;
            background: #ffffff;
            border: none;
            padding: 4px 10px;
            font-size: 10px;
            font-weight: 500;
            white-space: nowrap;
            pointer-events: none;
            z-index: 50;
            color: #1a1a1a;
            font-family: 'DM Mono', monospace;
            border-radius: 4px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.15);
        }
        
        /* Dimension lines */
        .dim-line {
            position: absolute;
            pointer-events: none;
            z-index: 45;
        }
        .dim-line.horizontal {
            height: 0;
            border-top: 1px dashed rgba(0,0,0,0.3);
        }
        .dim-line.vertical {
            width: 0;
            border-left: 1px dashed rgba(0,0,0,0.3);
        }
        
        /* Wall objects */
        .wall-object {
            position: absolute;
            background: var(--room-floor);
            border: 1px solid var(--room-cyan);
            cursor: default;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 25;
            pointer-events: none;
        }
        .wall-object .hit-zone {
            position: absolute;
            pointer-events: auto;
            cursor: move;
            z-index: 26;
        }
        .wall-object:hover { border-color: var(--room-accent); }
        .wall-object.selected {
            border-color: var(--room-accent);
            box-shadow: 0 0 12px var(--room-accent-glow);
        }
        /* Ta bort border för specifika hinder-typer */
        .wall-object.window,
        .wall-object.door,
        .wall-object.tv {
            background: transparent;
            border: none !important;
            box-shadow: none !important;
        }
        .wall-object svg {
            pointer-events: none;
        }
        
        /* Objekt dimension - streckade linjer som v1 */
        .obj-dim-line {
            position: absolute;
            pointer-events: none;
            z-index: 45;
        }
        .obj-dim-line.horizontal {
            height: 0;
            border-top: 1px dashed var(--room-muted);
        }
        .obj-dim-line.horizontal::before,
        .obj-dim-line.horizontal::after {
            content: '';
            position: absolute;
            top: -4px;
            width: 1px;
            height: 8px;
            background: var(--room-muted);
        }
        .obj-dim-line.horizontal::before { left: 0; }
        .obj-dim-line.horizontal::after { right: 0; }
        
        .obj-dim-line.vertical {
            width: 0;
            border-left: 1px dashed var(--room-muted);
        }
        .obj-dim-line.vertical::before,
        .obj-dim-line.vertical::after {
            content: '';
            position: absolute;
            left: -4px;
            width: 8px;
            height: 1px;
            background: var(--room-muted);
        }
        .obj-dim-line.vertical::before { top: 0; }
        .obj-dim-line.vertical::after { bottom: 0; }
        
        /* Objektets bredd - markerad med accent-färg */
        .obj-dim-line.object-width.horizontal {
            border-top: 2px solid var(--room-accent);
        }
        .obj-dim-line.object-width.horizontal::before,
        .obj-dim-line.object-width.horizontal::after {
            background: var(--room-accent);
            height: 10px;
            top: -5px;
        }
        .obj-dim-line.object-width.vertical {
            border-left: 2px solid var(--room-accent);
        }
        .obj-dim-line.object-width.vertical::before,
        .obj-dim-line.object-width.vertical::after {
            background: var(--room-accent);
            width: 10px;
            left: -5px;
        }
        
        .obj-dim-label {
            position: absolute;
            background: #ffffff;
            color: #666666;
            font-size: 9px;
            font-weight: 500;
            padding: 2px 6px;
            pointer-events: none;
            white-space: nowrap;
            font-family: 'DM Mono', monospace;
            z-index: 50;
            border: none;
            border-radius: 4px;
            box-shadow: 0 2px 6px rgba(0,0,0,0.15);
        }
        .obj-dim-label.object-width {
            background: #1a1a1a;
            color: #fff;
            border: none;
            font-size: 9px;
            padding: 3px 8px;
            border-radius: 4px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
        }
        
        /* Möbelzoner - refined architectural style */
        .furniture-zone {
            position: absolute;
            overflow: visible;
            background: #fff;
            background-image: 
                repeating-linear-gradient(
                    45deg,
                    transparent,
                    transparent 5px,
                    rgba(0,0,0,0.035) 5px,
                    rgba(0,0,0,0.035) 6px
                );
            border: 1.5px solid #1a1a1a;
            cursor: move;
            z-index: 15;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 9px;
            font-weight: 500;
            color: #333;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            font-family: 'DM Mono', monospace;
            user-select: none;
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .furniture-zone .zone-label {
            background: none;
            padding: 0;
            line-height: 1.3;
            color: #666;
        }
        /* L-shaped corner markers */
        .furniture-zone::before,
        .furniture-zone::after {
            content: '';
            position: absolute;
            width: 8px;
            height: 8px;
            border: 1.5px solid #1a1a1a;
            background: transparent;
            transition: all 0.15s ease;
        }
        .furniture-zone::before {
            top: -1px;
            left: -1px;
            border-right: none;
            border-bottom: none;
        }
        .furniture-zone::after {
            bottom: -1px;
            right: -1px;
            border-left: none;
            border-top: none;
        }
        .furniture-zone:hover { 
            border-color: #1a1a1a;
        }
        .furniture-zone:hover::before,
        .furniture-zone:hover::after {
            border-color: #1a1a1a;
        }
        .furniture-zone.selected {
            border-color: #1a1a1a;
            border-width: 2px;
            box-shadow: 0 0 0 3px rgba(26, 26, 26, 0.08);
        }
        .furniture-zone.selected::before,
        .furniture-zone.selected::after {
            border-color: #1a1a1a;
            border-width: 2px;
            width: 10px;
            height: 10px;
        }
        .furniture-zone.dragging {
            box-shadow: 0 4px 20px rgba(0,0,0,0.12);
            opacity: 0.9;
            z-index: 30;
        }
        .furniture-zone.drag-delete,
        .wall-object.drag-delete {
            opacity: 0.4;
            border-color: #e05555 !important;
            background: rgba(224, 85, 85, 0.1) !important;
            background-image: none !important;
        }
        
        /* Delete feedback på markerade objekt */
        .furniture-zone.will-delete,
        .wall-object.will-delete {
            opacity: 0.4;
            outline: 2px dashed #e05555;
            outline-offset: 3px;
        }
        .furniture-zone .zone-label {
            pointer-events: none;
            font-size: 9px;
            letter-spacing: 0.06em;
            background: none;
            padding: 0;
            color: #888;
        }
        .furniture-zone .zone-dims {
            font-size: 8px;
            font-weight: 400;
            margin-top: 1px;
            pointer-events: none;
            font-family: 'DM Mono', monospace;
            color: #666;
            background: rgba(255,255,255,0.92);
            padding: 1px 5px;
        }
        .furniture-zone .module-count {
            font-size: 7px;
            font-weight: 500;
            margin-top: 2px;
            pointer-events: none;
            font-family: 'DM Mono', monospace;
            color: #1a1a1a;
            background: rgba(26, 26, 26, 0.06);
            padding: 1px 5px;
            border-radius: 2px;
        }
        .furniture-zone .module-divider {
            position: absolute;
            pointer-events: none;
        }
        .furniture-zone .module-divider.vertical {
            top: 0;
            bottom: 0;
            width: 1px;
            border-left: 1px dashed rgba(208, 96, 64, 0.5);
        }
        .furniture-zone .module-divider.horizontal {
            left: 0;
            right: 0;
            height: 1px;
            border-top: 1px dashed rgba(208, 96, 64, 0.5);
        }
        .furniture-zone.selected .module-divider.vertical {
            border-left: 2px dashed rgba(208, 96, 64, 0.8);
        }
        .furniture-zone.selected .module-divider.horizontal {
            border-top: 2px dashed rgba(208, 96, 64, 0.8);
        }
        
        /* Resize handles - technical circles */
        /* Edge resize zones - invisible but activatable */
        .furniture-zone .resize-handle {
            position: absolute;
            background: transparent;
            z-index: 25;
            transition: background 0.1s ease;
        }
        /* Highlight effect when hovering edge */
        .furniture-zone .resize-handle:hover {
            background: rgba(208, 96, 64, 0.3);
        }
        .furniture-zone .resize-handle.active {
            background: rgba(208, 96, 64, 0.4);
        }
        /* Horizontal edge handles (left/right = width) */
        .furniture-zone .resize-handle.left {
            left: -2px;
            top: 0;
            width: 6px;
            height: 100%;
            cursor: ew-resize;
            border-left: 2px solid transparent;
        }
        .furniture-zone .resize-handle.left:hover,
        .furniture-zone .resize-handle.left.active {
            border-left-color: #1a1a1a;
            border-left-width: 4px;
            left: -4px;
        }
        .furniture-zone .resize-handle.right {
            right: -2px;
            top: 0;
            width: 6px;
            height: 100%;
            cursor: ew-resize;
            border-right: 2px solid transparent;
        }
        .furniture-zone .resize-handle.right:hover,
        .furniture-zone .resize-handle.right.active {
            border-right-color: #1a1a1a;
            border-right-width: 4px;
            right: -4px;
        }
        /* Vertical edge handles (top/bottom = depth) */
        .furniture-zone .resize-handle.top {
            top: -2px;
            left: 0;
            width: 100%;
            height: 6px;
            cursor: ns-resize;
            border-top: 2px solid transparent;
        }
        .furniture-zone .resize-handle.top:hover,
        .furniture-zone .resize-handle.top.active {
            border-top-color: #1a1a1a;
            border-top-width: 4px;
            top: -4px;
        }
        .furniture-zone .resize-handle.bottom {
            bottom: -2px;
            left: 0;
            width: 100%;
            height: 6px;
            cursor: ns-resize;
            border-bottom: 2px solid transparent;
        }
        .furniture-zone .resize-handle.bottom:hover,
        .furniture-zone .resize-handle.bottom.active {
            border-bottom-color: #1a1a1a;
            border-bottom-width: 4px;
            bottom: -4px;
        }
        
        .furniture-zone .delete-btn {
            position: absolute;
            top: -10px;
            right: -10px;
            width: 20px;
            height: 20px;
            background: var(--room-accent);
            border: none;
            border-radius: 50%;
            cursor: pointer;
            display: none;
            align-items: center;
            justify-content: center;
        }
        .furniture-zone:hover .delete-btn,
        .furniture-zone.selected .delete-btn { display: flex; }
        .furniture-zone .delete-btn svg {
            width: 10px;
            height: 10px;
            stroke: #fff;
            stroke-width: 2.5;
        }
        
        /* Planner filler — horizontal strip at bookshelf face */
        .planner-filler {
            position: absolute;
            z-index: 18;
            pointer-events: auto;
            cursor: pointer;
        }
        .planner-filler:hover .pf-line { opacity: 1; }
        .planner-filler:hover .pf-badge { opacity: 1; }
        .pf-line {
            position: absolute;
            background: #3B6D11;
            opacity: 0.7;
            transition: opacity 0.15s;
            border-radius: 0.5px;
        }
        .pf-tick {
            position: absolute;
            background: #3B6D11;
            opacity: 0.5;
        }
        .pf-badge {
            position: absolute;
            font-family: 'DM Mono', monospace;
            font-size: 7px; font-weight: 600; letter-spacing: 0.02em;
            color: #27500A; background: #EAF3DE;
            padding: 0 3px; border-radius: 2px;
            line-height: 1.5; white-space: nowrap;
            border: 0.5px solid #97C459;
            z-index: 2; opacity: 0.85;
            transition: opacity 0.15s;
        }
        @media (prefers-color-scheme: dark) {
            .pf-line { background: #97C459; }
            .pf-tick { background: #97C459; }
            .pf-badge { background: #27500A; color: #C0DD97; border-color: #639922; }
        }

        .room-label {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            pointer-events: none;
            z-index: 5;
            color: var(--room-cyan);
            font-family: 'DM Mono', monospace;
            opacity: 0.5;
        }
        .room-label .area { font-size: 32px; font-weight: 500; letter-spacing: 0.02em; }
        .room-label .unit { font-size: 12px; font-weight: 400; }
        
        .room-sidebar {
            width: 280px;
            background: #ffffff;
            border-left: none;
            display: flex;
            flex-direction: column;
            overflow-y: auto;
            color: #1a1a1a;
            font-family: 'DM Sans', sans-serif;
            position: relative;
        }
        
        /* Parameterpanel - floating panel */
        .room-params-panel {
            width: 200px;
            background: #ffffff;
            border: none;
            border-radius: 10px;
            display: none;
            flex-direction: column;
            padding: 16px;
            overflow-y: auto;
            color: #1a1a1a;
            font-family: 'DM Sans', sans-serif;
            position: fixed;
            right: 300px;
            top: 80px;
            box-shadow: -4px 0 20px rgba(0,0,0,0.15);
            z-index: 200;
            animation: panelSlideIn 0.2s ease-out;
            max-height: calc(100vh - 160px);
        }
        @keyframes panelSlideIn {
            from { opacity: 0; transform: translateX(20px) scale(0.95); }
            to { opacity: 1; transform: translateX(0) scale(1); }
        }
        .room-params-panel.open {
            display: flex;
        }
        
        .room-sidebar-section {
            padding: 16px 20px;
            border-bottom: 1px solid #ebebeb;
        }
        
        .room-sidebar-title {
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: #8c8c8c;
            margin-bottom: 12px;
        }
        
        .room-params-panel .room-sidebar-title {
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid #ebebeb;
            color: #1a1a1a;
        }
        
        .size-inputs {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
        }
        .size-input {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .size-input label {
            font-size: 9px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            color: #a6a6a6;
        }
        .size-input input {
            padding: 9px 12px;
            border: 1px solid #e6e6e6;
            background: #f7f7f7;
            color: #1a1a1a;
            font-family: 'DM Mono', monospace;
            font-size: 13px;
            font-weight: 500;
            text-align: center;
            width: 100%;
            transition: all 0.15s ease;
            border-radius: 6px;
        }
        .size-input input:focus {
            outline: none;
            border-color: var(--room-accent);
            background: #f5f5f5;
        }
        
        .object-palette {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .palette-item {
            width: 42px;
            height: 42px;
            border: 1px solid #e6e6e6;
            background: #f9f9f9;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: grab;
            transition: all 0.15s ease;
            padding: 0;
            border-radius: 8px;
            position: relative;
        }
        .palette-item:hover {
            border-color: #cccccc;
            background: #f5f5f5;
        }
        .palette-item span {
            display: none;
        }
        /* Tooltip on hover */
        .palette-item::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: calc(100% + 6px);
            left: 50%;
            transform: translateX(-50%);
            background: #1a1a1a;
            color: #fff;
            font-size: 9px;
            font-weight: 500;
            padding: 4px 8px;
            border-radius: 4px;
            white-space: nowrap;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.15s ease;
            font-family: 'DM Sans', sans-serif;
            letter-spacing: 0.02em;
        }
        .palette-item:hover::after {
            opacity: 1;
        }
        .palette-item:active {
            cursor: grabbing;
        }
        .palette-item svg {
            width: 18px;
            height: 18px;
            stroke: #999999;
            stroke-width: 1.5;
            fill: none;
            transition: all 0.15s ease;
        }
        .palette-item:hover svg {
            stroke: #333333;
        }
        .palette-item.furniture-type {
            border: 1.5px solid #bfbfbf;
            background: #f5f5f5;
            width: 46px;
            height: 46px;
        }
        .palette-item.furniture-type:hover {
            border-color: #1a1a1a;
            background: rgba(26, 26, 26, 0.04);
        }
        .palette-item.furniture-type::after {
            background: #1a1a1a;
            color: #fff;
        }
        .palette-item.furniture-type svg {
            stroke: #737373;
            stroke-width: 1.5;
        }
        .palette-item.furniture-type:hover svg {
            stroke: #fff;
        }
        
        .summary-grid { display: grid; gap: 4px; }
        .summary-row {
            display: flex;
            justify-content: space-between;
            font-size: 11px;
            padding: 2px 0;
            font-family: 'DM Mono', monospace;
        }
        .summary-row span:first-child { color: #a6a6a6; }
        .summary-row span:last-child { font-weight: 500; color: #1a1a1a; }
        .highlight-row {
            background: rgba(255, 255, 255, 0.05);
            margin: 6px -20px 0;
            padding: 10px 20px;
            border-left: 2px solid #1a1a1a;
        }
        .highlight-row span:last-child { color: #1a1a1a; font-weight: 600; }
        
        /* Params grid för valt objekt */
        .params-grid { display: grid; gap: 12px; }
        .param-row {
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .param-row label {
            font-size: 9px;
            color: #a6a6a6;
            text-transform: uppercase;
            font-weight: 500;
            letter-spacing: 0.06em;
            font-family: 'DM Mono', monospace;
        }
        .param-row input, .param-row select {
            padding: 10px;
            border: 1px solid #e6e6e6;
            font-size: 13px;
            font-family: 'DM Mono', monospace;
            background: #ffffff;
            color: #1a1a1a;
            border-radius: 6px;
            cursor: pointer;
            outline: none;
            box-shadow: none;
            -webkit-tap-highlight-color: transparent;
        }
        /* Style number input spinners */
        .param-row input[type="number"]::-webkit-inner-spin-button,
        .param-row input[type="number"]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            appearance: none;
            margin: 0;
        }
        .param-row input[type="number"] {
            -moz-appearance: textfield;
        }
        .param-row select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            background-color: #1a1a1a;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
            padding-right: 30px;
        }
        .param-row select:focus,
        .param-row select:active {
            outline: none;
            box-shadow: none;
            background-color: #1a1a1a;
        }
        .param-row select option {
            background: #ffffff;
            color: #1a1a1a;
        }
        .param-row input:focus {
            outline: none;
            border-color: #1a1a1a;
        }
        .param-row input[type="number"] { width: 100%; box-sizing: border-box; }
        
        .delete-object-btn {
            width: 100%;
            padding: 10px;
            margin-top: 14px;
            background: transparent;
            border: 1px solid rgba(255, 100, 100, 0.3);
            color: #ff8080;
            font-size: 10px;
            font-weight: 500;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            cursor: pointer;
            transition: all 0.15s ease;
            border-radius: 8px;
        }
        .delete-object-btn:hover {
            background: rgba(255, 100, 100, 0.15);
            border-color: #ff8080;
        }
        
        .view-controls {
            position: absolute;
            bottom: 20px;
            left: 20px;
            display: flex;
            gap: 6px;
            z-index: 100;
        }
        .view-btn {
            width: 36px;
            height: 36px;
            background: #ffffff;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.15s ease;
            border-radius: 6px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }
        .view-btn:hover { 
            background: #3a3a38;
        }
        .view-btn:hover svg { stroke: #fff; }
        .view-btn svg {
            width: 14px;
            height: 14px;
            stroke: #8c8c8c;
            stroke-width: 2;
            fill: none;
            transition: all 0.15s ease;
        }
        
        .scale-indicator {
            position: absolute;
            bottom: 20px;
            right: 300px;
            background: #ffffff;
            border: none;
            padding: 6px 12px;
            font-size: 11px;
            font-weight: 500;
            z-index: 100;
            color: #666666;
            font-family: 'DM Mono', monospace;
            border-radius: 4px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.2);
        }
        
        .room-drag-ghost {
            position: fixed;
            pointer-events: none;
            opacity: 0.85;
            z-index: 1000;
            display: none;
            background: #fff;
            background-image: 
                repeating-linear-gradient(
                    45deg,
                    transparent,
                    transparent 5px,
                    rgba(0,0,0,0.04) 5px,
                    rgba(0,0,0,0.04) 6px
                );
            border: 2px solid #1a1a1a;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            border-radius: 8px;
        }
        .room-drag-ghost svg {
            width: 40%;
            height: 40%;
            stroke: #666;
            stroke-width: 1.5;
            fill: none;
        }
        
        .room-instructions {
            padding: 16px 20px;
            background: #cccccc;
            margin-top: auto;
            font-size: 10px;
            color: #b3b3b3;
            line-height: 1.7;
            border-top: 1px solid var(--room-border);
        }
        .room-instructions strong {
            color: var(--room-accent);
            font-weight: 600;
        }

        /* ====== LIGHT THEME ENHANCEMENTS ====== */
        
        /* Sidebar gets a clean left border */
        #sidebar {
            border-left: 1px solid #f0f0ee;
            box-shadow: none;
        }
        
        /* Refined header */
        .studio-header {
            background: #fff;
            border-bottom: 1px solid #f0f0ee;
            height: 50px;
        }
        .studio-logo {
            color: #1a1a1a;
        }
        
        /* Canvas tools panel - refined floating panel */
        .canvas-tools-panel {
            background: rgba(255,255,255,0.97);
            border: 1px solid #e6e6e6;
            box-shadow: 0 4px 16px rgba(0,0,0,0.08);
            border-radius: 8px;
            padding: 6px;
        }
        .canvas-tool {
            border-radius: 6px;
        }
        .canvas-tool:hover {
            background: #f0f0f0;
        }
        .canvas-ctrl-btn {
            border-radius: 6px;
        }
        
        /* Info overlay */
        #info-overlay {
            background: rgba(255,255,255,0.88);
            border: none;
            box-shadow: none;
        }
        
        /* Interaction hint */
        #interaction-hint {
            background: rgba(255,255,255,0.96);
            border: 1px solid #ebebeb;
            box-shadow: 0 2px 12px rgba(0,0,0,0.06);
            border-radius: 8px;
            color: #1a1a1a;
        }
        
        /* Module params panel */
        .module-params-panel {
            background: #ffffff;
            border: 1px solid #ebebeb;
            box-shadow: -2px 0 24px rgba(0,0,0,0.08);
            border-radius: 8px;
        }
        .module-params-header {
            border-bottom: 1px solid #ebebeb;
        }
        .module-params-title {
            color: #1a1a1a;
        }
        
        /* Button refinement */
        button.primary {
            color: #404040;
            border: 1px solid #d9d9d9;
            border-radius: 6px;
        }
        button.primary:hover {
            background: #f5f5f5;
            border-color: #bfbfbf;
            color: #1a1a1a;
        }
        button.secondary {
            border-radius: 6px;
        }
        
        /* Room button */
        .room-btn {
            border-radius: 6px;
        }
        
        /* Input focus rings */
        .control-row input[type="number"]:focus,
        .param-field input:focus,
        .param-text-input:focus {
            border-color: #b3b3b3;
            box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
        }
        
        /* Module item selection */
        .module-item.selected {
            border-color: #999999;
            background: #f7f7f7;
        }
        
        /* Composition selected */
        .composition-header.selected {
            background: #f5f5f5;
        }
        
        /* Material swatch refinement */
        .material-swatch {
            border-radius: 4px;
            background: #fafafa;
        }
        .material-swatch.active {
            border-color: #b3b3b3;
            box-shadow: 0 0 0 2px rgba(0,0,0,0.06);
        }
        
        /* Tooltips - dark on light */
        .canvas-tool::after,
        .material-swatch::after {
            background: #f7f7f5;
            color: #404040;
            border: 1px solid #e6e6e6;
            border-radius: 4px;
            padding: 5px 10px;
        }
        
        /* Drag ghost */
        .drag-ghost {
            border-radius: 8px;
            box-shadow: 0 4px 16px rgba(0,0,0,0.1);
        }
        
        /* Toggle switch for light theme */
        .toggle-slider {
            background: #e0e0e0;
        }
        .toggle-slider:before {
            background: #b3b3b3;
        }
        .toggle-switch input:checked + .toggle-slider {
            background: #cccccc;
        }
        .toggle-switch input:checked + .toggle-slider:before {
            background: #666666;
        }
        
        /* Snap control select */
        .snap-control select {
            background-color: #f7f7f7;
            border: 1px solid #e0e0e0;
            color: #1a1a1a;
            border-radius: 6px;
        }
        .snap-control select option {
            background: #ffffff;
            color: #1a1a1a;
        }
        
        /* Control row select */
        .control-row select {
            background-color: #f9f9f9;
            border: 1px solid #e6e6e6;
            color: #1a1a1a;
            border-radius: 4px;
        }
        .control-row select option {
            background: #ffffff;
            color: #1a1a1a;
        }
        .control-row select:focus {
            border-color: #b3b3b3;
            box-shadow: 0 0 0 3px rgba(0,0,0,0.04);
        }
        
        /* Range input */
        input[type="range"] {
            accent-color: #1a1a1a;
        }
        
        /* Sections: add more whitespace */
        .section {
            padding: 20px 22px;
        }
        .system-subsection {
            margin-bottom: 18px;
        }
        
        /* Delete button */
        .delete-btn {
            border-radius: 6px;
        }
        
        /* Structure buttons */
        .structure-btn {
            border-radius: 6px;
            color: #595959;
        }
        .structure-btn:hover {
            color: #1a1a1a;
        }
        .structure-btn svg {
            stroke: #595959;
        }
        
        /* Detail inputs */
        .detail-input-wrap input[type="number"] {
            background: #f7f7f7;
            border: 1px solid #e6e6e6;
            color: #1a1a1a;
            border-radius: 4px;
        }
        .detail-input-wrap input[type="number"]:focus {
            border-color: #b3b3b3;
        }
        .detail-unit {
            color: #b3b3b3;
        }
        .detail-label {
            color: #808080;
        }
        
        /* Layout controls box */
        .layout-controls {
            background: #fafafa;
            border: 1px solid #f0f0f0;
            border-radius: 6px;
        }
        
        /* Toggle button refined */
        .toggle-btn {
            border-radius: 4px;
        }
        
        /* Profile card */
        .profile-card {
            border-radius: 6px;
        }
        .material-card {
            border-radius: 6px;
        }
        
        /* Panel close button */
        .panel-close-btn:hover {
            background: #f0f0f0;
            color: #4d4d4d;
        }
        
        /* Canvas container gets softer bg matching scene */
        #canvas-container {
            background: #e8e4de;
        }

        /* ============================================= */
        /* COMPOSITION TABBED PANEL                      */
        /* ============================================= */
        
        .comp-quick-dims {
            display: flex;
            gap: 14px;
            padding: 8px 0 10px;
            border-bottom: 1px solid #ededed;
            margin-bottom: 0;
        }
        .comp-quick-dim {
            display: flex;
            flex-direction: column;
        }
        .comp-quick-dim-label {
            font-size: 7px;
            font-weight: 600;
            letter-spacing: 1px;
            color: #b3b3b3;
            font-family: 'DM Mono', monospace;
        }
        .comp-quick-dim-value {
            font-size: 13px;
            font-family: 'DM Mono', monospace;
            color: #404040;
            font-weight: 500;
        }
        
        /* Tab bar */
        .comp-tab-bar {
            display: flex;
            border-bottom: 1px solid #ededed;
            margin: 0 -16px;
            padding: 0 8px;
            gap: 0;
        }
        .comp-tab {
            flex: 1;
            padding: 10px 2px;
            text-align: center;
            cursor: pointer;
            border-bottom: 2.5px solid transparent;
            transition: all 0.12s;
            background: transparent;
            border-top: none;
            border-left: none;
            border-right: none;
            font-family: 'DM Mono', monospace;
            font-size: 8px;
            font-weight: 700;
            letter-spacing: 0.5px;
            color: #cccccc;
            white-space: nowrap;
            overflow: hidden;
            min-width: 0;
        }
        .comp-tab:hover {
            color: #999;
        }
        .comp-tab.active {
            color: #6a8a5a;
            border-bottom-color: #6a8a5a;
        }
        .comp-tab.active.cab-zone,
        .comp-tab.active.cab-zone-color {
            color: #8a6a9a;
            border-bottom-color: #8a6a9a;
        }
        .comp-tab.highlighted {
            background: rgba(106, 138, 90, 0.06);
        }
        .comp-tab.highlighted.cab-zone {
            background: rgba(138, 106, 154, 0.06);
        }
        .comp-tab-divider {
            width: 1px;
            background: #ededed;
            margin: 5px 0;
            flex-shrink: 0;
        }
        
        /* Zone indicator */
        .zone-indicator {
            margin: 0 -16px;
            padding: 6px 16px;
            margin-bottom: 12px;
            font-size: 8px;
            font-family: 'DM Mono', monospace;
            font-weight: 600;
            letter-spacing: 0.3px;
            display: flex;
            align-items: center;
            gap: 5px;
            border-bottom: 1px solid rgba(106, 138, 90, 0.1);
            background: #f4f8f2;
            color: #6a8a5a;
        }
        .zone-indicator.cab-zone {
            background: #f9f4fc;
            color: #8a6a9a;
            border-bottom-color: rgba(138, 106, 154, 0.1);
        }
        .zone-indicator-dot {
            width: 5px;
            height: 5px;
            border-radius: 3px;
            background: #6a8a5a;
        }
        .zone-indicator.cab-zone .zone-indicator-dot {
            background: #8a6a9a;
        }
        
        /* Tab content sections */
        .comp-tab-content {
            display: none;
            animation: detailFadeIn 0.15s ease;
        }
        .comp-tab-content.active {
            display: block;
        }
        
        /* Material indicator in BUILD tab */
        .material-indicator {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 5px 8px;
            border-radius: 4px;
            background: #faf8f4;
            border: 1px solid #f0ece4;
            margin-bottom: 6px;
        }
        .material-indicator-swatch {
            width: 12px;
            height: 12px;
            border-radius: 3px;
            border: 1px solid rgba(0,0,0,0.06);
            flex-shrink: 0;
        }
        .material-indicator-label {
            font-size: 10px;
            color: #a09080;
        }
        .material-indicator-hint {
            font-size: 9px;
            color: #c4b8a4;
            margin-left: auto;
        }
        
        /* Pill selector (for profiles/styles) */
        .pill-selector {
            display: flex;
            gap: 4px;
            flex-wrap: wrap;
        }
        .pill {
            padding: 5px 11px;
            border-radius: 16px;
            font-size: 10px;
            cursor: pointer;
            font-weight: 400;
            white-space: nowrap;
            transition: all 0.12s;
            background: #f6f5f3;
            color: #8c8c8c;
            border: 1.5px solid transparent;
        }
        .pill:hover {
            background: #f0efec;
        }
        .pill.active {
            background: rgba(196, 165, 116, 0.08);
            color: #c4a574;
            border-color: rgba(196, 165, 116, 0.27);
            font-weight: 600;
        }
        .pill.active.book-zone {
            background: rgba(106, 138, 90, 0.08);
            color: #6a8a5a;
            border-color: rgba(106, 138, 90, 0.27);
        }
        .pill.active.cab-zone {
            background: rgba(138, 106, 154, 0.08);
            color: #8a6a9a;
            border-color: rgba(138, 106, 154, 0.27);
        }
        
        /* Drag door handle in DOORS tab */
        .drag-door-handle {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            width: 100%;
            padding: 10px 12px;
            margin-top: 8px;
            border: 1.5px dashed #c4c4c4;
            border-radius: 6px;
            background: #fafafa;
            font-family: 'DM Mono', monospace;
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.5px;
            color: #666;
            cursor: grab;
            transition: all 0.15s;
            user-select: none;
        }
        .drag-door-handle:hover {
            border-color: #6a8a5a;
            color: #6a8a5a;
            background: #f4f8f2;
        }
        .drag-door-handle:active {
            cursor: grabbing;
            border-color: #6a8a5a;
            background: rgba(106, 138, 90, 0.1);
        }
        
        /* Double-click tab pulse */
        @keyframes tabPulse {
            0% { box-shadow: inset 0 -2px 0 currentColor; }
            50% { box-shadow: inset 0 -2px 0 currentColor, 0 0 8px rgba(106, 138, 90, 0.4); }
            100% { box-shadow: inset 0 -2px 0 currentColor; }
        }
        .comp-tab.dblclick-pulse {
            animation: tabPulse 0.6s ease;
        }
        
        /* SmartThickness dropdowns */
        .smart-thick {
            padding: 4px 22px 4px 6px;
            border: 1px solid #e6e6e6;
            border-radius: 3px;
            font-family: 'DM Mono', monospace;
            font-size: 10px;
            color: #404040;
            background: #fff;
            appearance: none;
            -webkit-appearance: none;
            cursor: pointer;
            min-width: 56px;
            text-align: right;
            background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 10 6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0L5 5L10 0' fill='none' stroke='%23b3b3b3' stroke-width='1.5'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 6px center;
            background-size: 8px;
        }
        .smart-thick:focus {
            outline: none;
            border-color: #c4a574;
            box-shadow: 0 0 0 2px rgba(196, 165, 116, 0.12);
        }
        .smart-thick.custom-value {
            color: #b87830;
            background-color: #fdf8f0;
            border-color: #e0c89a;
        }
        /* Custom input that replaces select */
        .smart-thick-input {
            width: 52px;
            padding: 4px 6px;
            border: 1.5px solid #c4a574;
            border-radius: 3px;
            font-family: 'DM Mono', monospace;
            font-size: 10px;
            color: #404040;
            text-align: right;
            outline: none;
            box-shadow: 0 0 0 3px rgba(196, 165, 116, 0.12);
        }

        /* ═══════════════════════════════════════════════════ */
        /* NEW SIDEBAR — Muuto-inspired, 2026 Scandi-tech     */
        /* ═══════════════════════════════════════════════════ */

        /* Workspace panel */
        #sidebar-workspace {
            flex-direction: column;
            overflow-y: auto;
            overflow-x: hidden;
        }
        #sidebar-workspace .sb-workspace {
            display: flex;
            flex-direction: column;
        }

        /* Section layout */
        .sb-section { padding: 12px 20px; border-bottom: 1px solid #f0f0ee; }
        .sb-section-label {
            font-family: 'DM Sans', sans-serif; font-size: 9px; font-weight: 600;
            letter-spacing: 0.08em; text-transform: uppercase; color: #ccc; margin-bottom: 6px;
        }

        /* Param rows */
        .sb-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 0; }
        .sb-row-label { font-family: 'DM Sans', sans-serif; font-size: 12px; color: #777; }
        .sb-row-right { display: flex; align-items: center; gap: 5px; }
        .sb-input, .sb-select {
            font-family: 'DM Mono', monospace; font-size: 11px; color: #1a1a1a;
            background: #fff; padding: 5px 8px; border-radius: 6px;
            border: 1px solid #e0e0de; min-width: 54px; text-align: right;
            transition: border-color 0.15s;
        }
        .sb-input:focus, .sb-select:focus {
            outline: none; border-color: #1a1a1a;
        }
        .sb-unit { font-family: 'DM Sans', sans-serif; font-size: 10px; color: #bbb; }

        /* Pills */
        .sb-pills { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0; }
        .sb-pill {
            font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500;
            padding: 5px 12px; border-radius: 20px;
            border: 1px solid #e0e0de; color: #999; cursor: pointer;
            transition: all .15s; background: #fff;
        }
        .sb-pill:hover { border-color: #bbb; color: #555; }
        .sb-pill-a { background: #1a1a1a; border-color: #1a1a1a; color: #fff; font-weight: 500; }
        /* Built-in toggle */
        .sb-toggle-row {
            display: flex; align-items: center; gap: 8px;
            padding: 8px 10px; margin: 0 0 8px;
            background: var(--color-background-secondary, #f5f4f0);
            border-radius: 6px; cursor: pointer; user-select: none;
        }
        .sb-toggle-row input[type="checkbox"] {
            width: 14px; height: 14px; margin: 0; accent-color: #1a1a1a; cursor: pointer;
        }
        .sb-toggle-label { font-size: 11px; font-weight: 600; color: #333; letter-spacing: 0.04em; }
        .sb-toggle-desc { font-size: 10px; color: #999; margin-left: auto; }
        .sb-sub-label { font-size: 10px; font-weight: 600; color: #999; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }

        /* ── Filler style sub-row (compact pills under filler value) ── */
        .sb-filler-style-row {
            padding: 0 0 6px 4px;
            margin-top: -4px;
        }
        .sb-filler-style-row .sb-pills { gap: 4px; }
        .sb-filler-style-row .sb-pill { font-size: 10px; padding: 2px 8px; }

        /* ── Details master toggle ── */
        .sb-details-master { border-top: 1px solid #f0f0ee; border-bottom: 1px solid #f0f0ee; }
        .sb-details-toggle {
            display: flex; align-items: center; gap: 8px; width: 100%;
            padding: 14px 20px; background: none; border: none; cursor: pointer;
            font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
            color: #1a1a1a; letter-spacing: -0.01em;
            text-transform: none;
            transition: background 0.12s;
        }
        .sb-details-toggle:hover { background: rgba(0,0,0,.018); }
        .sb-details-toggle .sb-chev { color: #bbb; width: 10px; height: 10px; opacity: 1; }
        .sb-details-body { padding: 4px 0 8px; }

        /* ── Collapsible sub-items (Figma-style: title + value/add) ── */
        .sb-collapsible {
            border-bottom: 1px solid #f0f0ee;
        }
        .sb-collapsible:last-child { border-bottom: none; }
        .sb-collapsible-header {
            display: flex; align-items: center; width: 100%;
            padding: 9px 20px 9px 34px; background: none; border: none; cursor: pointer;
            text-align: left; font-family: 'DM Sans', sans-serif;
            text-transform: none; letter-spacing: 0;
            transition: background 0.1s;
        }
        .sb-collapsible-header:hover { background: rgba(0,0,0,.018); }

        .sb-collapsible-title {
            font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
            color: #555;
        }
        .sb-collapsible-badge {
            margin-left: auto; font-family: 'DM Sans', sans-serif;
            font-size: 11px; color: #bbb; font-weight: 400;
        }
        .sb-collapsible-add {
            margin-left: auto; font-family: 'DM Sans', sans-serif;
            font-size: 16px; color: #ccc; font-weight: 300; line-height: 1;
        }

        /* Inactive items (Off/None) — muted */
        .sb-inactive > .sb-collapsible-header .sb-collapsible-title {
            color: #bbb;
        }

        /* Open state */
        .sb-collapsible.sb-open > .sb-collapsible-header .sb-collapsible-title {
            color: #1a1a1a; font-weight: 600;
        }
        .sb-collapsible.sb-open > .sb-collapsible-header .sb-collapsible-badge {
            color: #999;
        }
        .sb-collapsible.sb-open > .sb-collapsible-header .sb-collapsible-add {
            color: #999;
        }

        /* ── Collapsible body ── */
        .sb-collapsible-body {
            padding: 4px 20px 12px 34px;
        }

        /* Style indicator */
        .sb-style-section { padding: 0; border-bottom: 1px solid #f0f0ee; }
        .sb-style-indicator {
            display: flex; align-items: center; gap: 12px;
            padding: 14px 18px; cursor: pointer; transition: background .15s;
        }
        .sb-style-indicator:hover { background: rgba(0,0,0,.015); }
        .sb-style-info { flex: 1; }
        .sb-style-name { font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600; color: #1a1a1a; }
        .sb-style-desc { font-family: 'DM Sans', sans-serif; font-size: 11px; color: #aaa; margin-top: 2px; }
        .sb-style-change {
            font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500; color: #1a1a1a;
            background: none; border: 1px solid #ddd; border-radius: 6px;
            padding: 5px 12px; cursor: pointer; transition: all .15s;
            text-transform: none; letter-spacing: 0;
        }
        .sb-style-change:hover { border-color: #999; background: #fafafa; }
        .sb-style-picker { padding: 10px 18px; border-bottom: 1px solid #f0f0ee; background: #fafaf9; }
        .sb-style-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
        .sb-style-card {
            padding: 10px 6px; border: 1.5px solid transparent; border-radius: 8px;
            background: #fff; cursor: pointer; text-align: center; transition: all .15s;
            text-transform: none; letter-spacing: 0;
        }
        .sb-style-card:hover { border-color: #ddd; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
        .sb-style-card-a { border-color: #1a1a1a; background: #fff; }
        .sb-style-card-name { font-family: 'DM Sans', sans-serif; font-size: 10px; font-weight: 500; color: #999; }
        .sb-style-card-a .sb-style-card-name { color: #1a1a1a; font-weight: 600; }
        .sb-style-card-custom { border-style: dashed; border-color: #ddd; }
        .sb-style-star { font-size: 9px; color: #999; margin-left: 2px; }

        /* Material dropdown */
        .sb-mat-current {
            display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer;
        }
        .sb-mat-swatch { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(0,0,0,.08); flex-shrink: 0; }
        .sb-mat-name { font-family: 'DM Sans', sans-serif; font-size: 13px; color: #1a1a1a; font-weight: 500; }
        .sb-mat-arrow { font-size: 10px; color: #ccc; margin-left: auto; }
        .sb-mat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-bottom: 10px; }
        .sb-mat-item {
            display: flex; flex-direction: column; align-items: center; gap: 4px;
            padding: 6px 4px 5px; border: 2px solid transparent; border-radius: 10px;
            background: none; cursor: pointer; transition: border-color .15s;
        }
        .sb-mat-item:hover { border-color: #e0deda; }
        .sb-mat-item-a { border-color: #1a1a1a; }
        .sb-mat-color { width: 36px; height: 36px; border-radius: 8px; border: 1px solid rgba(0,0,0,.06); }
        .sb-mat-label { font-family: 'DM Sans', sans-serif; font-size: 8.5px; color: #aaa; letter-spacing: 0.01em; text-transform: uppercase; }
        .sb-mat-divider { grid-column: 1 / -1; height: 1px; background: #eee; margin: 4px 0; }
        .sb-mat-custom-btn {
            font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500; color: #888;
            background: none; border: none; cursor: pointer; padding: 4px 0;
            text-transform: none; letter-spacing: 0;
            transition: color .15s;
        }
        .sb-mat-custom-btn:hover { color: #1a1a1a; }

        /* Dimensions compact row */
        .sb-dims-row { display: flex; gap: 8px; align-items: center; }
        .sb-dim { display: flex; align-items: center; gap: 3px; }
        .sb-dim-key {
            font-family: 'DM Sans', sans-serif; font-size: 10px;
            color: #bbb; font-weight: 600; text-transform: uppercase;
        }
        .sb-dim-unit { font-family: 'DM Sans', sans-serif; font-size: 10px; color: #ccc; }
        .sb-dim .sb-row { padding: 0; }
        .sb-dim .sb-row-label { display: none; }
        .sb-dim .sb-input { min-width: 48px; padding: 4px 6px; font-size: 12px; }

        /* Layout */
        .sb-layout-presets {
            display: flex; gap: 4px; margin-bottom: 8px;
        }
        .sb-layout-preset {
            width: 32px; height: 32px; display: flex; align-items: center;
            justify-content: center; border: 1.5px solid #eee; border-radius: 6px;
            background: none; cursor: pointer; color: #bbb;
            transition: border-color .15s, color .15s;
            padding: 0; text-transform: none;
        }
        .sb-layout-preset:hover { border-color: #ccc; color: #888; }
        .sb-layout-preset:active { border-color: #1a1a1a; color: #1a1a1a; }
        .sb-layout-preset svg { width: 18px; height: 18px; }

        .sb-layout-card {
            background: #fafaf9; border: 1px solid #f0f0ee;
            border-radius: 8px; padding: 10px 14px 6px;
        }
        .sb-slider-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
        .sb-slider-row span:first-child {
            font-family: 'DM Sans', sans-serif; font-size: 10px;
            color: #999; min-width: 48px; letter-spacing: 0.01em;
        }
        .sb-slider-row input[type=range] {
            flex: 1; -webkit-appearance: none; appearance: none;
            height: 3px; background: #e5e3df; border-radius: 2px;
            outline: none; cursor: pointer;
        }
        .sb-slider-row input[type=range]::-webkit-slider-thumb {
            -webkit-appearance: none; appearance: none;
            width: 12px; height: 12px; border-radius: 50%;
            background: #fff; border: 1.5px solid #ccc;
            cursor: pointer;
            box-shadow: 0 1px 3px rgba(0,0,0,.08);
            transition: border-color .15s, box-shadow .15s;
        }
        .sb-slider-row input[type=range]::-webkit-slider-thumb:hover {
            border-color: #999;
            box-shadow: 0 1px 4px rgba(0,0,0,.12);
        }
        .sb-slider-row input[type=range]::-webkit-slider-thumb:active {
            border-color: #666;
        }
        .sb-slider-row input[type=range]::-moz-range-thumb {
            width: 12px; height: 12px; border-radius: 50%;
            background: #fff; border: 1.5px solid #ccc;
            cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.08);
        }
        .sb-slider-row input[type=range]::-moz-range-track {
            height: 3px; background: #e5e3df; border-radius: 2px; border: none;
        }
        .sb-slider-val {
            font-family: 'DM Mono', monospace; font-size: 11px; font-weight: 500;
            color: #999; min-width: 14px; text-align: right;
        }

        /* Module list */
        .sb-comp {
            border: 1px solid #eee; border-radius: 8px;
            margin-bottom: 6px; overflow: hidden;
        }
        .sb-comp-header {
            display: flex; justify-content: space-between; align-items: center;
            padding: 10px 12px;
        }
        .sb-comp-name { font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 600; color: #1a1a1a; }
        .sb-comp-info { font-family: 'DM Sans', sans-serif; font-size: 10px; color: #bbb; }
        .sb-module { position: relative;
            padding: 8px 12px; border-top: 1px solid #f0f0ee;
            cursor: pointer; transition: background .12s;
            border-left: 3px solid transparent;
        }
        .sb-module:hover { background: rgba(0,0,0,.02); }
        .sb-module-sel {
            border-left-color: #1a1a1a; background: rgba(0,0,0,.02);
        }
        .sb-module-sel .sb-module-name { color: #1a1a1a; font-weight: 600; }
        .sb-module-all { padding: 6px 12px; }
        .sb-module-all .sb-module-name { font-size: 10px; color: #aaa; font-weight: 500; }
        .sb-module-all.sb-module-sel .sb-module-name { color: #1a1a1a; font-weight: 600; }
        .sb-module-name { font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500; color: #777; }
        .sb-module-dims { font-family: 'DM Mono', monospace; font-size: 10px; color: #bbb; margin-top: 1px; }
        .sb-module-del {
            position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
            width: 20px; height: 20px; border: none; border-radius: 4px;
            background: transparent; color: #ccc; font-size: 15px; line-height: 20px;
            cursor: pointer; opacity: 0; transition: opacity .15s, background .15s, color .15s;
            font-family: 'DM Sans', sans-serif; padding: 0; display: flex; align-items: center; justify-content: center;
        }
        .sb-module:hover .sb-module-del { opacity: 1; }
        .sb-module-del:hover { background: #fee; color: #c33; }
        .sb-bridge-tag {
            font-family: 'DM Sans', sans-serif; font-size: 9px; font-weight: 600;
            color: #888; background: #f0f0ee; padding: 2px 6px; border-radius: 4px;
            text-transform: uppercase; letter-spacing: 0.03em;
        }
        .sb-add-module {
            width: 100%; padding: 8px; border: 1.5px dashed #ddd; border-radius: 8px;
            background: none; font-family: 'DM Sans', sans-serif; font-size: 11px;
            font-weight: 500; color: #bbb; cursor: pointer; margin-top: 6px;
            text-transform: none; letter-spacing: 0;
            transition: all .15s;
        }
        .sb-add-module:hover { border-color: #999; color: #666; }

        /* Export grid */
        .sb-export-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
        .sb-export-card {
            display: flex; flex-direction: column; align-items: center; justify-content: center;
            gap: 4px; padding: 10px 6px 8px; border: 1px solid #e8e7e4; border-radius: 10px;
            background: #fff; cursor: pointer; transition: all .2s;
            font-family: 'DM Sans', sans-serif; color: #999;
        }
        .sb-export-card:hover {
            border-color: #c8c7c4; background: #fafaf8;
            box-shadow: 0 2px 8px rgba(0,0,0,0.04); color: #1a1a1a;
        }
        .sb-export-card:active { transform: scale(0.97); }
        .sb-export-card span {
            font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em;
        }


        /* Drag handle */
        .sb-drag-handle {
            display: flex; align-items: center; justify-content: center; gap: 6px;
            padding: 8px; margin: 4px 0 8px; border: 1.5px dashed #ddd; border-radius: 8px;
            font-family: 'DM Sans', sans-serif; font-size: 11px; font-weight: 500;
            color: #bbb; cursor: grab; text-transform: none; letter-spacing: 0;
            transition: all .15s;
        }
        .sb-drag-handle:hover { border-color: #999; color: #555; }

        /* Color wheel in sidebar */
        .sb-mat-wheel .lab-wheel-wrap { gap: 10px; }
        .sb-mat-wheel .lab-wheel-container { width: 220px; height: 220px; }
        .sb-mat-wheel .lab-lightness-wrap canvas { height: 200px; }
        .sb-color-inputs { margin-top: 10px; }
        .sb-color-row {
            display: flex; align-items: center; gap: 8px; padding: 4px 0;
        }
        .sb-color-row label {
            font-family: 'DM Sans', sans-serif; font-size: 10px; font-weight: 600;
            color: #bbb; min-width: 28px; text-align: right;
            text-transform: uppercase; letter-spacing: 0.03em;
        }
        .sb-color-row input[type="text"] {
            font-family: 'DM Sans', sans-serif; font-size: 12px; color: #1a1a1a;
            background: #fff; padding: 5px 8px; border-radius: 6px;
            border: 1px solid #e0e0de; flex: 1; min-width: 0;
            transition: border-color .15s;
        }
        .sb-color-row input[type="text"]:focus {
            outline: none; border-color: #1a1a1a;
        }
        .sb-ncs-hint {
            font-family: 'DM Sans', sans-serif; font-size: 10px; color: #bbb;
            min-height: 16px; padding: 2px 0;
        }
        .sb-color-footer {
            display: flex; align-items: center; gap: 10px; margin-top: 8px;
        }
        .sb-color-footer .custom-color-preview {
            width: 32px; height: 32px; border-radius: 8px;
            border: 1px solid rgba(0,0,0,.08); flex-shrink: 0;
        }
        .sb-save-color {
            flex: 1; padding: 8px 14px;
            font-family: 'DM Sans', sans-serif; font-size: 12px; font-weight: 500;
            color: #fff; background: #1a1a1a; border: none; border-radius: 8px;
            cursor: pointer; transition: background .15s;
            text-transform: none; letter-spacing: 0;
        }
        .sb-save-color:hover { background: #333; }

        /* ═══════════════════════════════════════════════════ */
        /* SETUP WIZARD (Phase 3)                              */
        /* ═══════════════════════════════════════════════════ */

        /* ── Wizard mode: clean viewport ─────────────── */
        .wz-mode .canvas-tools-panel { display: none !important; }
        .wz-mode .studio-room-planner { display: none !important; }
        .wz-mode .studio-cnc-btn { display: none !important; }
        .wz-mode .sidebar-tabs { display: none !important; }
        .wz-mode #info-overlay { display: none !important; }
        .wz-mode #view-toggle { display: none !important; }

        /* ── Wizard ────────────────────────────────── */
        .wz-wizard {
            display: flex; flex-direction: column;
            height: 100%; padding: 0;
        }
        .wz-step {
            padding: 28px 22px;
            animation: wzFadeIn .35s ease;
        }
        @keyframes wzFadeIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        /* Dot indicator */
        .wz-dots {
            display: flex; gap: 6px; margin-bottom: 16px;
        }
        .wz-dot {
            width: 6px; height: 6px; border-radius: 50%;
            background: #ddd; transition: background .2s;
        }
        .wz-dot-active { background: #1a1a1a; }

        /* Title */
        .wz-step-title {
            font-family: 'Outfit', 'DM Sans', sans-serif;
            font-size: 22px; font-weight: 600; color: #1a1a1a;
            margin-bottom: 24px; line-height: 1.25;
            letter-spacing: -0.02em;
        }

        /* Back */
        .wz-back {
            font-family: 'DM Sans', sans-serif; font-size: 11px;
            color: #aaa; background: none; border: none;
            cursor: pointer; padding: 0; margin-bottom: 16px;
            text-transform: none; letter-spacing: 0;
            transition: color .15s;
        }
        .wz-back:hover { color: #666; }

        /* ── Step 1: Type cards (vertical grid) ── */
        .wz-type-grid {
            display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px;
        }
        .wz-type-card {
            display: flex; flex-direction: column; align-items: center;
            gap: 8px; padding: 20px 8px 16px;
            border: 1.5px solid #eee; border-radius: 12px;
            background: #fff; cursor: pointer; text-align: center;
            transition: border-color .15s, background .15s, transform .15s;
            text-transform: none; letter-spacing: 0;
        }
        .wz-type-card:hover {
            border-color: #1a1a1a; background: #fafaf8;
            transform: translateY(-2px);
        }
        .wz-type-card svg {
            width: 36px; height: 48px; flex-shrink: 0;
            stroke: #bbb; transition: stroke .2s;
        }
        .wz-type-card:hover svg { stroke: #1a1a1a; }
        .wz-type-label {
            font-family: 'DM Sans', sans-serif;
            font-size: 12px; font-weight: 600; color: #333;
            line-height: 1.3;
        }
        .wz-type-desc {
            font-size: 10px; color: #aaa;
        }

        /* Selected state */
        .wz-type-card.wz-selected {
            border-color: #1a1a1a; background: #f8f7f5;
        }
        .wz-type-card.wz-selected svg { stroke: #1a1a1a; }
        .wz-style-card.wz-selected {
            border-color: #1a1a1a; background: #f8f7f5;
        }
        .wz-style-card.wz-selected .wz-style-accent { opacity: 1; }

        /* Continue button */
        .wz-continue {
            width: 100%; margin-top: 20px; padding: 13px;
            background: #1a1a1a; color: #fff; border: none; border-radius: 10px;
            font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 600;
            cursor: pointer; letter-spacing: 0.02em;
            transition: opacity .15s;
            animation: wzFadeIn .25s ease;
        }
        .wz-continue:hover { opacity: 0.85; }

        /* Disabled (coming soon) */
        .wz-option-disabled {
            opacity: 0.35; cursor: default; pointer-events: none;
        }

        /* Room planner banner */
        .wz-room-banner {
            display: flex; align-items: center; gap: 12px;
            margin-top: 20px; padding: 12px 14px;
            background: #f5f4f1; border: 1px solid #e8e6e1; border-radius: 10px;
            cursor: pointer; transition: border-color .15s, background .15s;
        }
        .wz-room-banner:hover { border-color: #ccc; background: #f0eeeb; }
        .wz-room-banner-icon {
            flex-shrink: 0; color: #999;
            transition: color .15s;
        }
        .wz-room-banner:hover .wz-room-banner-icon { color: #1a1a1a; }
        .wz-room-banner-text { display: flex; flex-direction: column; gap: 2px; }
        .wz-room-banner-title {
            font-size: 12px; font-weight: 600; color: #555;
        }
        .wz-room-banner:hover .wz-room-banner-title { color: #1a1a1a; }
        .wz-room-banner-action {
            font-size: 11px; color: #999;
        }
        .wz-room-banner:hover .wz-room-banner-action { color: #555; }

        /* ── Step 2: Style cards ── */
        .wz-style-options {
            display: flex; flex-direction: column; gap: 10px;
        }
        .wz-style-card {
            display: flex; overflow: hidden;
            border: 1.5px solid #eee; border-radius: 12px;
            background: #fff; cursor: pointer;
            transition: border-color .15s, background .15s, transform .15s;
            text-transform: none; letter-spacing: 0; text-align: left;
        }
        .wz-style-card:hover {
            border-color: #1a1a1a; background: #fafaf8;
            transform: translateY(-2px);
        }
        .wz-style-accent {
            width: 6px; flex-shrink: 0;
            opacity: 0.5; transition: opacity .2s;
        }
        .wz-style-card:hover .wz-style-accent { opacity: 0.8; }
        .wz-style-content {
            padding: 16px 18px; display: flex; flex-direction: column; gap: 4px;
        }
        .wz-style-name {
            font-family: 'Outfit', 'DM Sans', sans-serif;
            font-size: 16px; font-weight: 600; color: #1a1a1a;
            letter-spacing: -0.01em;
        }
        .wz-style-desc {
            font-size: 11px; color: #999; margin-bottom: 6px;
        }
        .wz-style-features {
            display: flex; flex-wrap: wrap; gap: 4px;
        }
        .wz-style-feat {
            font-size: 9px; font-weight: 500; letter-spacing: 0.03em;
            color: #888; background: #f2f1ee;
            padding: 3px 8px; border-radius: 4px;
        }

        /* Sidebar hidden during AI landing, visible after wizard starts */

        /* Hide old floating panels (Phase 2 cleanup) */
        #module-params-panel, #material-panel { display: none !important; }

        /* Scroll-to highlight — ambient glow, no decoration */
        .sb-highlight {
            animation: sbGlow 3s ease forwards;
            border-radius: 4px;
        }
        @keyframes sbGlow {
            0%   { background: rgba(0, 0, 0, .04); }
            8%   { background: rgba(0, 0, 0, .06); }
            50%  { background: rgba(0, 0, 0, .04); }
            100% { background: transparent; }
        }
