
        /* Стили из index.html */
        img:is([sizes="auto" i], [sizes^="auto," i]) { contain-intrinsic-size: 3000px 1500px }

        .comments .comment-reply-link:hover {
            color: #000
        }
        .lazy-wrapper {
            position: relative;
            overflow: hidden
        }
        .lazy-wrapper .lazy-img {
            opacity: 0;
            transition: opacity .6s ease
        }
        .lazy-wrapper.loaded .lazy-img {
            opacity: 1
        }

        :root {
            --primary-color: #000000;
            --text-primary: #000000;
            --bg-primary: #ffffff;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: Arial, sans-serif;
            background: #ffffff;
            color: #000000;
            overflow: hidden;
            height: 100vh;
        }

        #renderCanvas {
            width: 100%;
            height: 100vh;
            touch-action: none;
            position: relative;
            z-index: 1;
        }

        /* Главное меню */
        .main-menu {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            min-height: 100vh;
            background: #ffffff;
            display: none; /* Скрыто по умолчанию */
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            z-index: 2500;
            opacity: 0;
            visibility: hidden;
            transform: translateY(0);
            transition: opacity 0.35s ease-out, visibility 0.35s ease-out;
            padding-top: 80px;
            overflow-y: auto;
            pointer-events: auto;
        }

        /* Принудительное отображение для отладки */
        .main-menu.debug {
            display: flex !important;
            opacity: 1 !important;
            visibility: visible !important;
            transform: translateY(0) !important;
        }

        .main-menu.show {
            display: flex !important;
            opacity: 1 !important;
            visibility: visible !important;
            transform: translateY(0) !important;
            pointer-events: auto !important;
        }

        /* Анимация появления элементов главной страницы */
        .main-menu.show .menu-logo {
            animation: fadeInUp 0.6s ease-out 0.1s both;
        }

        .main-menu.show .menu-title {
            animation: fadeInUp 0.6s ease-out 0.2s both;
        }

        .main-menu.show .menu-subtitle {
            animation: fadeInUp 0.6s ease-out 0.3s both;
        }

        .main-menu.show .sofa-grid {
            animation: fadeInUp 0.6s ease-out 0.4s both;
        }



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

        .menu-logo {
            margin-bottom: 30px;
        }

        .menu-logo img {
            width: 120px;
            height: auto;
        }

        .menu-title {
            font-size: 32px;
            font-weight: bold;
            margin-bottom: 10px;
            color: #000000;
        }

        .menu-subtitle {
            font-size: 18px;
            margin-bottom: 40px;
            color: #666666;
        }

        .sofa-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 60px;
            max-width: 1600px;
            width: 100%;
            padding: 60px;
            margin: 0 auto;
        }

        .sofa-item {
            background: #ffffff;
            border: 2px solid transparent;
            border-radius: 12px;
            padding: 25px 15px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: visible;
            min-height: 200px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
        }

        .sofa-item:hover {
            background: #f8f8f8;
            border-color: #000000;
            transform: translateY(-8px) scale(1.05);
            box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
            z-index: 10;
        }

        .sofa-image {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 15px;
            overflow: visible;
        }

        .sofa-image img {
            width: 100%;
            height: auto;
            max-height: 140px;
            object-fit: contain;
            transition: transform 0.3s ease;
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
        }

        .sofa-item:hover .sofa-image img {
            transform: scale(1.1);
            filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
        }

        /* Кнопка "Вернуться в конфигуратор" на главной странице */
        .return-config-btn {
            position: fixed;
            top: 130px;
            right: 15px;
            background: #ffffff;
            color: #000;
            border: 1px solid #e0e0e0;
            padding: 12px 20px;
            font-size: 16px;
            font-weight: 900;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            cursor: pointer;
            border-radius: 8px;
            transition: all 0.3s ease;
            z-index: 1000;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }

        .return-config-btn:hover {
            background: rgba(0, 0, 0, 0.05);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        /* Адаптивность для мобильных устройств */
        @media (max-width: 768px) {
            .return-config-btn {
                top: 15px;
                left: 15px;
                padding: 10px 16px;
                font-size: 14px;
            }
        }

        .sofa-name {
            font-size: 18px;
            font-weight: bold;
            color: #000000;
            margin-top: auto;
            padding: 10px 0;
            background: rgba(255, 255, 255, 0.9);
            border-radius: 6px;
            transition: all 0.3s ease;
        }

        .sofa-item:hover .sofa-name {
            background: #000000;
            color: #ffffff;
            transform: scale(1.05);
        }

        /* Адаптивность для разных размеров экрана */
        @media (max-width: 1400px) {
            .sofa-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 50px;
                padding: 50px;
            }

                    /* Адаптация кнопок для больших экранов */
        .top-btn, .sidebar-btn, .bottom-btn, .screenshot-btn, .menu-btn {
            padding: 14px 24px;
            font-size: 18px;
            min-width: 160px;
        }

        .ruler-btn {
            min-width: 60px;
            min-height: 60px;
            padding: 16px;
        }

        /* Адаптация модального окна для больших экранов */
        .sofa-selection-grid {
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
                gap: 30px;
            padding: 35px;
        }

        .sofa-item-modal {
            padding: 25px;
        }

        .sofa-image-container {
            height: 110px;
        }

        .sofa-item-modal img {
            padding: 15px;
        }

        .sofa-item-modal h4 {
            font-size: 18px;
            margin: 0 0 12px 0;
        }

        .sofa-item-modal p {
            font-size: 14px;
            }
        }

        @media (max-width: 1024px) {
            .sofa-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 40px;
                padding: 40px;
            }

            .sofa-item {
                min-height: 180px;
            }

            .sofa-image img {
                max-height: 120px;
            }

                    /* Адаптация кнопок для планшетов */
        .top-btn, .sidebar-btn, .bottom-btn, .screenshot-btn, .menu-btn {
            padding: 12px 20px;
            font-size: 16px;
            min-width: 140px;
        }

        .ruler-btn {
            min-width: 50px;
            min-height: 50px;
            padding: 12px;
        }

        .top-controls {
            left: 40px;
            gap: 12px;
        }

        .right-sidebar {
            right: 15px;
            gap: 8px;
            width: 200px;
            max-width: 200px;
            align-items: stretch;
        }

        .bottom-controls {
            gap: 12px;
        }

        /* Адаптация модального окна для планшетов */
        .sofa-selection-grid {
            grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            gap: 20px;
            padding: 25px;
        }

        .sofa-item-modal {
            padding: 18px;
        }

        .sofa-image-container {
            height: 90px;
        }

        .sofa-item-modal img {
            padding: 12px;
            }
        }

        @media (max-width: 768px) {
            .sofa-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 20px;
                padding: 20px;
            }

            .sofa-item {
                min-height: 160px;
                padding: 20px 10px;
            }

            .sofa-image img {
                max-height: 100px;
            }

            .sofa-name {
                font-size: 16px;
            }

                    /* Адаптация кнопок для мобильных устройств - УЛУЧШЕНО для touch */
        .top-btn, .sidebar-btn, .bottom-btn, .screenshot-btn, .menu-btn {
            padding: 14px 18px; /* Увеличено для удобства касания */
            font-size: 15px; /* Увеличено для читаемости */
            min-width: 130px;
            min-height: 48px; /* Минимальная высота для touch-friendly */
        }

        .ruler-btn {
            min-width: 45px;
            min-height: 45px;
            padding: 10px;
        }

        .top-controls {
            top: 15px;
            left: 20px;
            gap: 10px;
            flex-direction: column;
        }

        .right-sidebar {
            top: 15px;
            right: 10px;
            gap: 6px;
            width: 200px;
            max-width: 200px;
            align-items: stretch;
        }

        .bottom-controls {
            bottom: 15px;
            gap: 10px;
            flex-wrap: wrap;
            justify-content: center;
        }

        .screenshot-btn {
            bottom: 15px;
            right: 10px;
        }

        /* 🚫 Стили для системы столкновений */
        .collision-btn {
            background: #ff4444;
            color: white;
            border: none;
            padding: 8px 12px;
            margin: 5px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: bold;
            transition: all 0.3s ease;
            width: 100%;
            text-align: center;
        }

        .collision-btn:hover {
            background: #ff6666;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(255, 68, 68, 0.3);
        }

        .collision-btn:active {
            transform: translateY(0);
        }

        .collision-btn.disabled {
            background: #cccccc;
            color: #666666;
            cursor: not-allowed;
        }

        .collision-btn.disabled:hover {
            background: #cccccc;
            transform: none;
            box-shadow: none;
        }

        /* 📷 Стили для Smart Camera System */
        .camera-toggle-btn {
            background: #007bff;
            color: white;
            border: none;
            padding: 10px 14px;
            margin: 5px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            font-weight: bold;
            transition: all 0.3s ease;
            width: 100%;
            text-align: center;
        }

        .camera-toggle-btn:hover {
            background: #0056b3;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
        }

        .camera-toggle-btn:active {
            transform: translateY(0);
        }

        .camera-toggle-btn.disabled {
            background: #cccccc;
            color: #666666;
            cursor: not-allowed;
        }

        .camera-toggle-btn.disabled:hover {
            background: #cccccc;
            transform: none;
            box-shadow: none;
        }

        .camera-btn {
            background: #17a2b8;
            color: white;
            border: none;
            padding: 8px 12px;
            margin: 3px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: bold;
            transition: all 0.3s ease;
            width: 100%;
            text-align: center;
        }

        .camera-btn:hover {
            background: #138496;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
        }

        .camera-btn:active {
            transform: translateY(0);
        }

        /* 🌐 Стили для HTML Integration System */
        .html-toggle-btn {
            background: #6f42c1;
            color: white;
            border: none;
            padding: 10px 14px;
            margin: 5px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            font-weight: bold;
            transition: all 0.3s ease;
            width: 100%;
            text-align: center;
        }

        .html-toggle-btn:hover {
            background: #5a32a3;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(111, 66, 193, 0.3);
        }

        .html-toggle-btn:active {
            transform: translateY(0);
        }

        .html-toggle-btn.disabled {
            background: #cccccc;
            color: #666666;
            cursor: not-allowed;
        }

        .html-toggle-btn.disabled:hover {
            background: #cccccc;
            transform: none;
            box-shadow: none;
        }

        .html-btn {
            background: #6c757d;
            color: white;
            border: none;
            padding: 8px 12px;
            margin: 3px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: bold;
            transition: all 0.3s ease;
            width: 100%;
            text-align: center;
        }

        .html-btn:hover {
            background: #5a6268;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
        }

        .html-btn:active {
            transform: translateY(0);
        }

        /* 📦 Стили для Asset Manager System */
        .asset-toggle-btn {
            background: #17a2b8;
            color: white;
            border: none;
            padding: 10px 14px;
            margin: 5px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            font-weight: bold;
            transition: all 0.3s ease;
            width: 100%;
            text-align: center;
        }

        .asset-toggle-btn:hover {
            background: #138496;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
        }

        .asset-toggle-btn:active {
            transform: translateY(0);
        }

        .asset-toggle-btn.disabled {
            background: #cccccc;
            color: #666666;
            cursor: not-allowed;
        }

        .asset-toggle-btn.disabled:hover {
            background: #cccccc;
            transform: none;
            box-shadow: none;
        }

        .asset-btn {
            background: #6c757d;
            color: white;
            border: none;
            padding: 8px 12px;
            margin: 3px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 12px;
            font-weight: bold;
            transition: all 0.3s ease;
            width: 100%;
            text-align: center;
        }

        .asset-btn:hover {
            background: #5a6268;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(108, 117, 125, 0.3);
        }

        .asset-btn:active {
            transform: translateY(0);
        }

        .menu-btn {
            top: 15px;
            left: 10px;
        }

        /* Адаптация модального окна для мобильных устройств */
        .sofa-selection-grid {
            grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
            gap: 15px;
            padding: 20px;
        }

        .sofa-item-modal {
            padding: 12px;
        }

        .sofa-image-container {
            height: 70px;
        }

        .sofa-item-modal img {
            padding: 8px;
        }

        .sofa-item-modal h4 {
            font-size: 13px;
            margin: 0 0 5px 0;
        }

        .sofa-item-modal p {
            font-size: 10px;
            }
        }

        @media (max-width: 480px) {
            .sofa-grid {
                grid-template-columns: 1fr;
                gap: 15px;
                padding: 15px;
            }

            .sofa-item {
                min-height: 140px;
            }

            .sofa-image img {
                max-height: 80px;
            }

                    /* Адаптация кнопок для маленьких мобильных устройств */
        .top-btn, .sidebar-btn, .bottom-btn, .screenshot-btn, .menu-btn {
            padding: 8px 12px;
            font-size: 12px;
            min-width: 100px;
        }

        .ruler-btn {
            min-width: 40px;
            min-height: 40px;
            padding: 8px;
        }

        .top-controls {
            top: 10px;
            left: 10px;
            gap: 8px;
        }

        .right-sidebar {
            top: 10px;
            right: 5px;
            gap: 5px;
            width: 200px;
            max-width: 200px;
            align-items: stretch;
        }

        .bottom-controls {
            bottom: 10px;
            gap: 8px;
        }

        .screenshot-btn {
            bottom: 10px;
            right: 5px;
        }

        .menu-btn {
            top: 10px;
            left: 10px;
        }

        /* Адаптация модального окна для маленьких экранов */
        .sofa-selection-grid {
            grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
            gap: 15px;
            padding: 20px;
        }

        .sofa-item-modal {
            padding: 12px;
        }

        .sofa-image-container {
            height: 80px;
        }

        .sofa-item-modal img {
            padding: 8px;
        }

        .sofa-item-modal h4 {
            font-size: 14px;
            margin: 0 0 6px 0;
        }

        .sofa-item-modal p {
            font-size: 11px;
            }
        }

        /* Простой интерфейс конфигуратора */
        .simple-interface {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1000;
        }

        .simple-interface * {
            pointer-events: auto;
        }

        .top-controls {
            position: absolute;
            top: 90px;
            left: 20px;
            display: flex;
            gap: 10px;
            z-index: 1001;
        }

        .top-btn {
            background: transparent;
            color: #000;
            border: 2px solid #000;
            border-radius: 8px;
            padding: 12px 20px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 140px;
            text-align: center;
        }

        .top-btn:hover {
            background: #000;
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .right-sidebar {
            position: absolute;
            top: 130px;
            right: 20px;
            display: flex !important;
            flex-direction: column;
            visibility: visible !important;
            z-index: 1000 !important;
            gap: 8px;
            z-index: 1001;
            width: 200px;
            max-width: 200px;
            align-items: stretch;
        }

        .current-sofa-title {
            position: absolute;
            top: 90px;
            right: 20px;
            background: rgba(0,0,0,0.8);
            color: #fff;
            padding: 10px 14px;
            border-radius: 8px;
            font-weight: 600;
            z-index: 1002;
        }

        .sidebar-btn {
            background: transparent;
            color: #000;
            border: 2px solid #000;
            border-radius: 8px;
            padding: 12px 20px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.3s ease;
            min-width: 160px;
            text-align: center;
        }

        .sidebar-btn:hover {
            background: #000;
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .sidebar-btn:active {
            transform: translateY(0);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        }

        .sidebar-btn:focus {
            outline: none;
            box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
        }

        .expandable-section {
            margin-top: 10px;
        }

        /* 🚫 Стили для секции системы столкновений */
        #collision-section {
            background: rgba(255, 68, 68, 0.1);
            border: 1px solid #ff4444;
            border-radius: 8px;
            padding: 10px;
            margin-top: 10px;
        }

        #collision-section .section-header {
            background: #ff4444;
            color: white;
            border-color: #ff4444;
        }

        #collision-section .section-header:hover {
            background: #ff6666;
            border-color: #ff6666;
        }

        .section-header {
            background: transparent;
            color: #000;
            border: 2px solid #000;
            border-radius: 8px;
            padding: 12px 20px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 120px;
            text-align: center;
        }

        .section-header:hover {
            background: #000;
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .section-content {
            display: flex;
            flex-direction: column;
            gap: 8px;
            margin-top: 10px;
        }

        /* Кнопки модулей всегда во всю ширину и в столбик */
        #modules-section .sidebar-btn,
        .module-dropdown-content .sidebar-btn,
        .module-item > .sidebar-btn {
            width: 100%;
            text-align: left;
            white-space: normal;
            word-break: break-word;
        }

        .color-swatch {
            width: 30px;
            height: 30px;
            cursor: pointer;
            border: 2px solid #000;
        }

        .color-swatch.active {
            border-color: #fff;
        }

        .color-label {
            font-size: 12px;
            color: #fff;
            margin-top: 5px;
            background: #000;
            padding: 4px 8px;
            border-radius: 4px;
            font-weight: normal;
        }

        .bottom-controls {
            position: absolute;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 12px;
            z-index: 1001;
        }

        .bottom-btn {
            background: transparent;
            color: #000;
            border: none;
            border-radius: 8px;
            padding: 12px 20px;
            font-size: 18px;
            font-weight: 900;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 140px;
            text-align: center;
        }

        .bottom-btn:hover {
            background: #000;
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            border: none;
            opacity: 0.8;
        }

        .bottom-btn.active {
            background: #000;
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .ruler-btn {
            background: #000;
            color: white;
            border: none;
            border-radius: 8px;
            padding: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 50px;
            min-height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .ruler-btn:hover {
            background: #333;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .ruler-btn.active {
            background: #ff6b35;
            border-color: #ff6b35;
        }

        .ruler-btn.active:hover {
            background: #e55a2b;
        }

        /* Кнопка AR */
        .ar-btn {
            background: transparent;
            color: #000;
            border: none;
            border-radius: 8px;
            padding: 12px 20px;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-left: 10px;
            font-size: 18px;
            font-weight: 900;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .ar-btn:hover {
            background: #333;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        .ar-btn.active {
            background: #00ff88;
            border-color: #00ff88;
            color: #000;
        }

        .ar-btn.active:hover {
            background: #00cc6a;
        }

        /* Стили для кнопок поворота дивана */
        .rotation-btn {
            background: #000;
            color: white;
            border: none;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            margin: 5px;
            cursor: pointer;
            font-size: 18px;
            font-weight: bold;
            transition: all 0.3s ease;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        .rotation-btn:hover {
            background: #333;
            transform: scale(1.1);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        }

        .rotation-btn:active {
            transform: scale(0.95);
        }

        /* АДАПТИВНОСТЬ КНОПОК ПОВОРОТА ДЛЯ МОБИЛЬНЫХ */
        @media (max-width: 768px) {
            .rotation-controls {
                top: 80px !important;
                left: 10px !important;
            }

            .rotation-btn {
                width: 50px !important;
                height: 50px !important;
                font-size: 28px !important;
                margin: 0 3px !important;
            }
        }

        @media (max-width: 480px) {
            .rotation-controls {
                top: 70px !important;
                left: 5px !important;
            }

            .rotation-btn {
                width: 45px !important;
                height: 45px !important;
                font-size: 24px !important;
                margin: 0 2px !important;
            }
        }

        .ar-status {
            display: inline-block;
            width: 8px;
            height: 8px;
            border-radius: 50%;
            margin-left: 8px;
            background: #666;
            transition: background 0.3s ease;
        }

        .ar-status.supported {
            background: #28a745;
        }

        .ar-status.unsupported {
            background: #dc3545;
        }

        /* Стили для AR камеры */
        #cameraVideo {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            object-fit: cover;
            z-index: 1000;
            pointer-events: none;
            background: #000;
        }

        /* AR режим активен */
        .ar-mode-active #renderCanvas {
            z-index: 1001 !important;
            background: transparent !important;
        }

        /* AR режим активен - скрываем обычный фон */
        .ar-mode-active .scene-background {
            display: none;
        }

        /* Подсказка для AR управления */
        .ar-mode-active::after {
            content: '📱 2 пальца = поворот | 🖱️ Правая кнопка мыши = поворот | 💚 Зеленая подсветка = ровное положение';
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 10px 20px;
            border-radius: 20px;
            font-size: 14px;
            z-index: 1002;
            pointer-events: none;
            animation: fadeInOut 3s ease-in-out infinite;
        }

        @keyframes fadeInOut {
            0%, 100% { opacity: 0.7; }
            50% { opacity: 1; }
        }

        /* Подсказка для AR управления */
        .ar-mode-active::after {
            content: '📱 2 пальца = поворот | 🖱️ Правая кнопка мыши = поворот | 💚 Зеленая подсветка = ровное положение';
            position: fixed;
            top: 20px;
            left: 50%;
            transform: translateX(-50%);
            background: rgba(0, 0, 0, 0.8);
            color: white;
            padding: 10px 20px;
            border-radius: 20px;
            font-size: 14px;
            z-index: 1002;
            pointer-events: none;
            animation: fadeInOut 3s ease-in-out infinite;
        }

        /* Кнопка желтого контура */
        .outline-btn {
            background: transparent;
            color: #000;
            border: none;
            border-radius: 8px;
            padding: 12px;
            cursor: pointer;
            transition: all 0.3s ease;
            margin-left: 10px;
            width: 50px;
            height: 50px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .outline-btn:hover {
            background: #333;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        }

        .outline-btn.active {
            background: #ffd700;
            border-color: #ffd700;
            color: #000;
        }

        .outline-btn.active:hover {
            background: #ffed4e;
        }

        .outline-icon {
            width: 20px;
            height: 20px;
            border: 2px dashed #ffd700;
            border-radius: 4px;
            position: relative;
        }

        .outline-btn.active .outline-icon {
            border-color: #000;
        }

        .ruler-icon {
            width: 20px;
            height: 20px;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M1 21h22v-2H1v2zM1 3h22v2H1V3zm0 6h22v2H1V9zm0 6h22v2H1v-2z'/%3E%3C/svg%3E");
            background-size: contain;
            background-repeat: no-repeat;
        }

        .screenshot-btn {
            position: absolute;
            bottom: 20px;
            right: 20px;
            background: transparent;
            color: #000;
            border: none;
            border-radius: 8px;
            padding: 12px 20px;
            font-size: 18px;
            font-weight: 900;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            cursor: pointer;
            z-index: 1001;
            transition: all 0.3s ease;
            min-width: 140px;
            text-align: center;
        }

        .screenshot-btn:hover {
            background: #000;
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .nav-buttons {
            position: absolute;
            top: 20px;
            left: 20px;
            display: flex;
            gap: 10px;
            z-index: 1001;
        }

        .menu-btn, .config-btn {
            background: transparent;
            color: #000;
            border: none;
            border-radius: 8px;
            padding: 12px 20px;
            font-size: 18px;
            font-weight: 900;
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            cursor: pointer;
            transition: all 0.3s ease;
            min-width: 140px;
            text-align: center;
        }

        .menu-btn:hover, .config-btn:hover {
            background: #000;
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        }

        .dimension-line {
            position: absolute;
            background: #000;
            color: white;
            padding: 4px 8px;
            font-size: 12px;
            font-weight: normal;
            pointer-events: none;
            z-index: 1000;
            display: none;
            border: 1px solid #000;
        }

        /* Указ с обожженными краями */
        .ukaz {
            position: absolute;
            bottom: 80px;
            left: 20px;
            background: #000;
            color: white;
            padding: 10px 15px;
            font-size: 14px;
            font-weight: normal;
            z-index: 1400;
            max-width: 300px;
            border: 2px solid #000;
            clip-path: polygon(
                0% 0%,
                95% 0%,
                100% 5%,
                100% 100%,
                5% 100%,
                0% 95%
            );
        }

        .ukaz::before {
            content: '';
            position: absolute;
            top: -2px;
            right: -2px;
            width: 20px;
            height: 20px;
            background: linear-gradient(45deg, #ff6b35, #f7931e, #ff6b35);
            animation: fire 2s infinite;
            clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
        }

        @keyframes fire {
            0%, 100% { transform: scale(1) rotate(0deg); }
            50% { transform: scale(1.2) rotate(5deg); }
        }

        .ukaz {
            display: none; /* Скрываем по умолчанию */
        }

        .ukaz.show {
            display: block; /* Показываем только когда нужно */
        }

        .ukaz.hidden {
            display: none;
        }

        /* Пунктирный контур УДАЛЕН */





        /* Splash overlay/exit: owned by ux-polish.css (no duplicate fade/scale here) */
        /* Logo reveal masks — entrance only */
        .animated-logo-overlay .mask-left {
            position: absolute;
            top: -50%;
            left: 0;
            width: 50%;
            height: 200%;
            background: #ffffff;
            animation: maskLeftShrink 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s forwards;
            z-index: 10;
        }
        .animated-logo-overlay .mask-right {
            position: absolute;
            top: -50%;
            right: 0;
            width: 50%;
            height: 200%;
            background: #ffffff;
            animation: maskRightShrink 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s forwards;
            z-index: 10;
        }
        .animated-logo-overlay .white-line-left,
        .animated-logo-overlay .white-line-right {
            position: absolute;
            top: -40px;
            width: 0;
            height: 0;
            background: linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,0.6), rgba(0,0,0,0));
            border-radius: 2px;
            z-index: 15;
            pointer-events: none;
        }
        .animated-logo-overlay .white-line-left {
            left: 50%;
            animation: whiteLineGrow 0.2s ease-out forwards, whiteLineLeftMove 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s forwards;
        }
        .animated-logo-overlay .white-line-right {
            right: 50%;
            animation: whiteLineGrow 0.2s ease-out forwards, whiteLineRightMove 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.1s forwards;
        }
        .animated-logo-overlay.splash-exiting .mask-left,
        .animated-logo-overlay.splash-exiting .mask-right,
        .animated-logo-overlay.splash-exiting .white-line-left,
        .animated-logo-overlay.splash-exiting .white-line-right,
        .animated-logo-overlay.hidden .mask-left,
        .animated-logo-overlay.hidden .mask-right,
        .animated-logo-overlay.hidden .white-line-left,
        .animated-logo-overlay.hidden .white-line-right {
            animation: none !important;
            display: none !important;
        }
        @keyframes maskLeftShrink {
            0% { width: 50%; left: 0; }
            100% { width: 0; left: 0; }
        }
        @keyframes maskRightShrink {
            0% { width: 50%; right: 0; }
            100% { width: 0; right: 0; }
        }
        @keyframes whiteLineGrow {
            0% { width: 0; height: 0; opacity: 0; }
            100% { width: 3px; height: 120%; opacity: 1; }
        }
        @keyframes whiteLineLeftMove {
            0% { left: 50%; opacity: 1; }
            100% { left: -40px; opacity: 0; }
        }
        @keyframes whiteLineRightMove {
            0% { right: 50%; opacity: 1; }
            100% { right: -40px; opacity: 0; }
        }

        /* Стили для размерных текстов */
        .dimension-text {
            position: absolute;
            background: rgba(0, 0, 0, 0.7);
            color: white;
            padding: 4px 8px;
            font-size: 12px;
            border-radius: 4px;
            pointer-events: none;
            z-index: 1000;
            display: none;
            transform: translate(-50%, -50%);
        }

        /* Стили для модального окна выбора диванов */
        .sofa-selection-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            z-index: 2000;
            -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
        }

        .sofa-selection-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 12px;
            padding: 0;
            max-width: 800px;
            width: 90%;
            max-height: 80vh;
            overflow: hidden;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
        }

        .sofa-selection-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 20px 30px;
            background: #f8f9fa;
            border-bottom: 1px solid #e9ecef;
        }

        .sofa-selection-header h3 {
            margin: 0;
            font-size: 24px;
            color: #333;
        }

        .modal-close {
            background: none;
            border: none;
            font-size: 24px;
            cursor: pointer;
            color: #666;
            padding: 5px;
            border-radius: 50%;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .modal-close:hover {
            background: #e9ecef;
            color: #333;
        }

        .sofa-selection-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 25px;
            padding: 30px;
            max-height: 60vh;
            overflow-y: auto;
        }

        .sofa-item-modal {
            background: white;
            border: 2px solid #e9ecef;
            border-radius: 12px;
            padding: 15px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: visible;
        }

        .sofa-item-modal:hover {
            border-color: #007bff;
            transform: translateY(-5px);
            box-shadow: 0 10px 20px rgba(0, 123, 255, 0.2);
        }

        .sofa-item-modal.selected {
            border-color: #28a745;
            background: #f8fff9;
        }

        .sofa-image-container {
            width: 100%;
            height: 100px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 15px;
            background: #f8f9fa;
            border-radius: 8px;
            border: 1px solid #e9ecef;
        }

        .sofa-item-modal img {
            width: 100%;
            height: 100%;
            object-fit: contain;
            border-radius: 6px;
            padding: 10px;
        }

        .sofa-item-modal h4 {
            margin: 0 0 8px 0;
            font-size: 16px;
            color: #333;
        }

        .sofa-item-modal p {
            margin: 0;
            color: #666;
            font-size: 12px;
        }

        /* Стили для выпадающего списка модулей */
        .module-dropdown {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background: transparent; /* Прозрачный фон позади панели */
            border: none; /* Без рамки у контейнера */
            box-shadow: none; /* Без тени у контейнера */
            z-index: 1500;
            min-width: 250px;
            max-height: 400px;
            overflow-y: auto;
        }

        .module-dropdown-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            background: rgba(248, 249, 250, 0.95); /* Полупрозрачная шапка */
            border: 1px solid #e9ecef;
            border-radius: 8px 8px 0 0;
        }

        .module-dropdown-header h4 {
            margin: 0;
            font-size: 16px;
            color: #333;
        }

        .dropdown-close {
            background: none;
            border: none;
            font-size: 18px;
            cursor: pointer;
            color: #666;
            padding: 5px;
            border-radius: 50%;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .dropdown-close:hover {
            background: #e9ecef;
            color: #333;
        }

        .module-dropdown-content {
            padding: 10px 0;
            display: flex;
            flex-direction: column;
            gap: 6px;
            background: rgba(255, 255, 255, 0.95); /* Легкая белая подложка только под элементы */
            border: 1px solid #e9ecef;
            border-top: none;
            border-radius: 0 0 8px 8px;
        }

        .module-item {
            padding: 12px 20px;
            cursor: pointer;
            transition: background 0.2s ease;
            border-bottom: 1px solid #f0f0f0;
        }

        .module-item:hover {
            background: #f8f9fa;
        }

        .module-item:last-child {
            border-bottom: none;
        }

        .module-item h5 {
            margin: 0 0 5px 0;
            font-size: 14px;
            color: #333;
        }

        .module-item p {
            margin: 0;
            font-size: 12px;
            color: #666;
        }

        /* Прозрачный фон за кнопками в секции "Модули текущего дивана" */
        #modules-section .module-item {
            background: transparent !important;
            border: none !important;
            padding: 0 !important;
        }

        #modules-section .module-item:hover {
            background: transparent !important;
        }

        /* 📋 СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА СПЕЦИФИКАЦИЙ */
        .modal {
            display: none;
            position: fixed !important;
            z-index: 10000 !important;
            left: 0 !important;
            top: 0 !important;
            width: 100% !important;
            height: 100% !important;
            overflow: auto !important;
            background-color: rgba(0, 0, 0, 0.6) !important;
            -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
            visibility: hidden;
            opacity: 0;
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }

        /* Принудительное отображение модального окна через inline стили */
        .modal[style*="display: flex"],
        .modal[style*="display: block"] {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            visibility: visible !important;
            opacity: 1 !important;
        }

        /* Альтернативный метод через класс show (приоритетный) */
        .modal.show {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            visibility: visible !important;
            opacity: 1 !important;
        }

        .modal-content.spec-viewer {
            background-color: #fff;
            margin: 5% auto;
            padding: 30px;
            border-radius: 15px;
            width: 80%;
            max-width: 900px;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
            animation: modalSlideIn 0.3s ease-out;
        }

        @keyframes modalSlideIn {
            from {
                transform: translateY(-50px);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .modal-content.spec-viewer h2 {
            margin: 0 0 10px 0;
            color: #333;
            font-size: 24px;
        }

        .modal-subtitle {
            color: #666;
            margin: 0 0 25px 0;
            font-size: 14px;
        }

        .close {
            color: #aaa;
            float: right;
            font-size: 32px;
            font-weight: bold;
            line-height: 1;
            cursor: pointer;
            transition: color 0.3s;
        }

        .close:hover,
        .close:focus {
            color: #000;
        }

        .spec-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .spec-item {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 15px;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
            border: 2px solid transparent;
            position: relative;
        }

        .spec-item:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            border-color: #007bff;
        }

        .spec-item[data-available="false"] {
            opacity: 0.5;
            cursor: not-allowed;
            filter: grayscale(0.5);
        }

        .spec-item[data-available="false"]:hover {
            transform: none;
            border-color: transparent;
        }

        .spec-item img {
            width: 100%;
            height: 150px;
            object-fit: cover;
            border-radius: 8px;
            background: #e9ecef;
            margin-bottom: 10px;
        }

        .spec-item h4 {
            margin: 10px 0 5px 0;
            font-size: 16px;
            color: #333;
        }

        .spec-item p {
            margin: 5px 0;
            font-size: 13px;
            color: #666;
        }

        .spec-item .status {
            display: inline-block;
            padding: 4px 10px;
            border-radius: 15px;
            font-size: 11px;
            font-weight: bold;
            margin-top: 8px;
        }

        .spec-item .status.available {
            background: #d4edda;
            color: #155724;
        }

        .spec-item .status.unavailable {
            background: #f8d7da;
            color: #721c24;
        }

        .spec-item-placeholder {
            grid-column: 1 / -1;
            text-align: center;
            padding: 40px;
            color: #999;
            font-style: italic;
        }

        /* Стили для админ-панели */
        .admin-content {
            padding: 30px;
            max-height: 80vh;
            overflow-y: auto;
        }

        .admin-header {
            margin-bottom: 30px;
            text-align: center;
        }

        .admin-header h2 {
            margin: 0;
            color: #333;
            font-size: 28px;
        }

        .admin-sections {
            display: flex;
            flex-direction: column;
            gap: 30px;
        }

        .admin-section {
            background: #f8f9fa;
            border-radius: 12px;
            padding: 25px;
            border: 1px solid #e9ecef;
        }

        .admin-section h3 {
            margin: 0 0 20px 0;
            color: #333;
            font-size: 20px;
            border-bottom: 2px solid #007bff;
            padding-bottom: 10px;
        }

        .admin-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 25px;
        }

        .admin-item {
            background: white;
            border-radius: 8px;
            padding: 20px;
            border: 1px solid #dee2e6;
        }

        .admin-item h4 {
            margin: 0 0 15px 0;
            color: #495057;
            font-size: 16px;
        }

        .admin-item input,
        .admin-item select {
            width: 100%;
            padding: 10px;
            margin-bottom: 10px;
            border: 1px solid #ced4da;
            border-radius: 6px;
            font-size: 14px;
        }

        .admin-item button {
            background: #007bff;
            color: white;
            border: none;
            padding: 10px 20px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            transition: background 0.2s ease;
        }

        .admin-item button:hover {
            background: #0056b3;
        }

        .admin-list {
            max-height: 200px;
            overflow-y: auto;
            border: 1px solid #dee2e6;
            border-radius: 6px;
            padding: 10px;
        }

        .admin-list-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 12px;
            border-bottom: 1px solid #f0f0f0;
            background: #f8f9fa;
            margin-bottom: 5px;
            border-radius: 4px;
        }

        .admin-list-item:last-child {
            border-bottom: none;
            margin-bottom: 0;
        }

        .admin-list-item .item-info {
            flex: 1;
        }

        .admin-list-item .item-name {
            font-weight: bold;
            color: #333;
        }

        .admin-list-item .item-path {
            font-size: 12px;
            color: #666;
        }

        .admin-list-item .item-actions {
            display: flex;
            gap: 5px;
        }

        .admin-list-item .btn-edit,
        .admin-list-item .btn-delete {
            padding: 4px 8px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
        }

        .admin-list-item .btn-edit {
            background: #28a745;
            color: white;
        }

        .admin-list-item .btn-delete {
            background: #dc3545;
            color: white;
        }

        .admin-list-item .btn-edit:hover {
            background: #218838;
        }

        .admin-list-item .btn-delete:hover {
            background: #c82333;
        }

        /* 🎬 Стили для Advanced Animation System */
        .animation-toggle-btn {
            background: linear-gradient(135deg, #ff6b6b, #ee5a24);
            color: white;
            border: none;
            padding: 10px 15px;
            margin: 5px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
            width: 100%;
            text-align: center;
        }

        .animation-toggle-btn:hover {
            background: linear-gradient(135deg, #ee5a24, #d63031);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
        }

        .animation-toggle-btn:active {
            transform: translateY(0);
        }

        .animation-toggle-btn.disabled {
            background: linear-gradient(135deg, #95a5a6, #7f8c8d);
            cursor: not-allowed;
            transform: none;
            box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
        }

        .animation-btn {
            background: linear-gradient(135deg, #74b9ff, #0984e3);
            color: white;
            border: none;
            padding: 8px 12px;
            margin: 3px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 2px 10px rgba(116, 185, 255, 0.3);
            width: 100%;
            text-align: center;
        }

        .animation-btn:hover {
            background: linear-gradient(135deg, #0984e3, #0652dd);
            transform: translateY(-1px);
            box-shadow: 0 4px 15px rgba(116, 185, 255, 0.4);
        }

        .animation-btn:active {
            transform: translateY(0);
        }

        .animation-btn:disabled {
            background: linear-gradient(135deg, #b2bec3, #95a5a6);
            cursor: not-allowed;
            transform: none;
            box-shadow: 0 1px 5px rgba(178, 190, 195, 0.3);
        }

        /* 🎨 Стили для Material Library System */
        .material-toggle-btn {
            background: linear-gradient(135deg, #a29bfe, #6c5ce7);
            color: white;
            border: none;
            padding: 10px 15px;
            margin: 5px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 12px;
            font-weight: 600;
            transition: all 0.3s ease;
            box-shadow: 0 4px 15px rgba(162, 155, 254, 0.3);
            width: 100%;
            text-align: center;
        }

        .material-toggle-btn:hover {
            background: linear-gradient(135deg, #6c5ce7, #5f3dc4);
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(162, 155, 254, 0.4);
        }

        .material-toggle-btn:active {
            transform: translateY(0);
        }

        .material-toggle-btn.disabled {
            background: linear-gradient(135deg, #95a5a6, #7f8c8d);
            cursor: not-allowed;
            transform: none;
            box-shadow: 0 2px 8px rgba(149, 165, 166, 0.3);
        }

        .material-btn {
            background: linear-gradient(135deg, #fd79a8, #e84393);
            color: white;
            border: none;
            padding: 8px 12px;
            margin: 3px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 11px;
            font-weight: 500;
            transition: all 0.3s ease;
            box-shadow: 0 2px 10px rgba(253, 121, 168, 0.3);
            width: 100%;
            text-align: center;
        }

        .material-btn:hover {
            background: linear-gradient(135deg, #e84393, #c44569);
            transform: translateY(-1px);
            box-shadow: 0 4px 15px rgba(253, 121, 168, 0.4);
        }

        .material-btn:active {
            transform: translateY(0);
        }

        .material-btn:disabled {
            background: linear-gradient(135deg, #b2bec3, #95a5a6);
            cursor: not-allowed;
            transform: none;
            box-shadow: 0 1px 5px rgba(178, 190, 195, 0.3);
        }

        .material-btn.preset {
            background: linear-gradient(135deg, #fdcb6e, #e17055);
            color: #000;
        }

        .material-btn.preset:hover {
            background: linear-gradient(135deg, #e17055, #d63031);
            color: white;
        }

        .material-category {
            margin: 10px 0;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 6px;
        }

        .material-category h4 {
            margin: 0 0 8px 0;
            font-size: 11px;
            color: #a29bfe;
            text-align: center;
        }

        .materials-panel {
            background: rgba(255, 255, 255, 0.95);
            -webkit-backdrop-filter: blur(10px);
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255, 255, 255, 0.3);
            border-radius: 8px;
            padding: 15px;
            margin-top: 10px;
            max-height: 500px;
            overflow-y: auto;
            overflow-x: hidden;
        }

        /* Стили для прокрутки */
        .materials-panel::-webkit-scrollbar {
            width: 8px;
        }

        .materials-panel::-webkit-scrollbar-track {
            background: rgba(45, 55, 75, 0.3);
            border-radius: 4px;
        }

        .materials-panel::-webkit-scrollbar-thumb {
            background: #5a67d8;
            border-radius: 4px;
        }

        .materials-panel::-webkit-scrollbar-thumb:hover {
            background: #a29bfe;
        }

        .materials-panel h4 {
            color: #333;
            margin: 0 0 15px 0;
            text-align: center;
            font-size: 14px;
        }

        .materials-panel h5 {
            color: #666;
            margin: 10px 0 8px 0;
            font-size: 12px;
            text-align: left;
        }

        /* Стили для вкладок материалов */
        .material-tabs {
            display: flex;
            margin-bottom: 15px;
            border-bottom: 1px solid #5a67d8;
        }

        .material-tab {
            background: transparent;
            border: none;
            padding: 8px 12px;
            margin-right: 5px;
            color: #a29bfe;
            cursor: pointer;
            font-size: 11px;
            border-bottom: 2px solid transparent;
            transition: all 0.3s ease;
        }

        .material-tab:hover {
            color: #e2e8f0;
            background: rgba(162, 155, 254, 0.1);
        }

        .material-tab.active {
            color: #e2e8f0;
            border-bottom-color: #a29bfe;
            background: rgba(162, 155, 254, 0.2);
        }

        .material-tab-content {
            position: relative;
        }

        .material-tab-pane {
            display: none;
        }

        .material-tab-pane.active {
            display: block;
        }

        /* Стили для поиска материалов */
        .material-search {
            display: flex;
            margin-bottom: 15px;
            position: relative;
        }

        .material-search input {
            flex: 1;
            padding: 8px 12px;
            border: 1px solid #5a67d8;
            border-radius: 6px;
            background: rgba(45, 55, 75, 0.8);
            color: #e2e8f0;
            font-size: 12px;
            outline: none;
        }

        .material-search input:focus {
            border-color: #a29bfe;
            box-shadow: 0 0 0 2px rgba(162, 155, 254, 0.2);
        }

        .material-search input::placeholder {
            color: #a29bfe;
        }

        .search-btn {
            position: absolute;
            right: 8px;
            top: 50%;
            transform: translateY(-50%);
            background: transparent;
            border: none;
            color: #a29bfe;
            cursor: pointer;
            font-size: 14px;
            padding: 4px;
        }

        .search-btn:hover {
            color: #e2e8f0;
        }

        /* Стили для loading overlay */
        .loading-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            z-index: 10000;
        }

        .loading-spinner {
            width: 50px;
            height: 50px;
            border: 4px solid #5a67d8;
            border-top: 4px solid #a29bfe;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }

        .loading-text {
            color: #e2e8f0;
            font-size: 18px;
            font-weight: bold;
            margin-top: 20px;
        }

        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }

        .material-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin-bottom: 8px;
        }

        .materials-panel .material-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 8px;
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 6px;
            color: #e2e8f0;
            font-size: 10px;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .materials-panel .material-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: #5a67d8;
            transform: translateY(-1px);
        }

        .materials-panel .material-btn img {
            width: 40px;
            height: 30px;
            object-fit: cover;
            border-radius: 4px;
            margin-bottom: 4px;
        }

        .materials-panel .material-btn span {
            font-size: 9px;
            text-align: center;
        }

        /* Стили для панели выбора цвета Grammy */
        .grammy-color-panel {
            margin-top: 20px;
            padding: 15px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 8px;
            border: 1px solid rgba(255, 255, 255, 0.1);
        }
        
        .grammy-color-panel h5 {
            margin: 0 0 15px 0;
            color: #333;
            font-size: 1em;
        }
        
        .grammy-color-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
            gap: 8px;
        }
        
        .grammy-color-btn {
            position: relative;
            width: 60px;
            height: 60px;
            border: 2px solid transparent;
            border-radius: 4px;
            cursor: pointer;
            overflow: hidden;
            background: #333;
            transition: all 0.2s;
            padding: 0;
        }
        
        .grammy-color-btn:hover {
            border-color: #00b894;
            transform: scale(1.05);
        }
        
        .grammy-color-btn.active {
            border-color: #00b894;
            border-width: 3px;
            box-shadow: 0 0 10px rgba(0, 184, 148, 0.5);
        }
        
        .grammy-color-btn img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .grammy-color-btn span {
            position: absolute;
            bottom: 2px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 0.7em;
            color: #fff;
            background: rgba(0, 0, 0, 0.7);
            padding: 2px 4px;
            border-radius: 2px;
        }

        /* Стили для скрытых элементов */
        .hidden {
            display: none !important;
        }
        
        /* Кнопка "Вернуться в конфигуратор" */
        .return-config-btn {
            display: none;
        }
        
        /* Простой интерфейс конфигуратора */
        .simple-interface {
            display: none;
        }
        
        /* Элементы управления поворотом */
        .rotation-controls {
            position: fixed;
            top: 90px;
            left: 20px;
            z-index: 1000;
        }
        
        /* Заголовок текущего дивана */
        .current-sofa-title {
            display: none;
        }
        
        /* Кнопка "Сменить коллекцию" */
        .sidebar-btn.change-collection-btn {
            background: #6c757d;
            margin-bottom: 10px;
        }
        
        /* Кнопка "Добавить модуль" */
        .sidebar-btn.add-module-btn {
            background: transparent;
            border: 2px solid #00b894;
            color: #00b894;
            font-weight: bold;
        }
        
        /* Панель материалов */
        .materials-panel {
            display: none;
        }
        
        /* Панель выбора цвета Grammy */
        .grammy-color-panel {
            display: none;
        }
        
        /* Overlay загрузки */
        .loading-overlay {
            display: none;
        }
        
        /* Dropdown модулей */
        .module-dropdown {
            display: none;
        }
        
        /* Информационные подсказки */
        .info-hint {
            font-size: 0.8em;
            opacity: 0.7;
        }
        
        /* Модальные окна */
        .modal-content {
            background: white;
            padding: 30px;
            border-radius: 10px;
            text-align: center;
            max-width: 500px;
        }
        
        .modal-header {
            margin: 0 0 20px 0;
            color: #333;
        }
        
        .modal-buttons {
            display: flex;
            gap: 10px;
            justify-content: center;
        }
        
        .modal-btn {
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            color: white;
        }
        
        .modal-btn-confirm {
            background: #f44336;
        }
        
        .modal-btn-cancel {
            background: #666;
        }
        
        .modal-btn-close {
            background: #000;
        }
        
        /* QR код контейнер */
        .qr-code-container {
            margin: 20px 0;
        }
        
        .qr-code-list {
            text-align: left;
            margin: 20px 0;
        }
        
        /* AR модальное окно */
        .ar-modal-content {
            width: 200px;
            height: 200px;
            background: #f0f0f0;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 2px solid #000;
        }
        
        .ar-modal-text {
            font-size: 12px;
            text-align: center;
        }

        /* 🏠 Стили для системы 3D моделей */
        .model-toggle-btn {
            background: linear-gradient(135deg, #a29bfe, #6c5ce7);
            color: white;
            border: none;
            padding: 8px 12px;
            margin: 3px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 12px;
            width: 100%;
            transition: all 0.3s ease;
        }

        .model-toggle-btn:hover {
            background: linear-gradient(135deg, #6c5ce7, #5f3dc4);
        }

        .model-toggle-btn.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .model-category {
            margin: 10px 0;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 6px;
        }

        .model-category h4 {
            margin: 0 0 8px 0;
            font-size: 11px;
            color: #a29bfe;
            text-align: center;
        }

        .model-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
            margin-bottom: 8px;
        }

        .model-btn {
            background: linear-gradient(135deg, #a29bfe, #6c5ce7);
            color: white;
            border: none;
            padding: 6px 8px;
            margin: 2px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 10px;
            transition: all 0.3s ease;
        }

        .model-btn:hover {
            background: linear-gradient(135deg, #6c5ce7, #5f3dc4);
            transform: translateY(-1px);
        }

        .performance-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 4px;
            margin-bottom: 8px;
        }

        .performance-btn {
            background: linear-gradient(135deg, #fd79a8, #e84393);
            color: white;
            border: none;
            padding: 6px 8px;
            margin: 2px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 10px;
            transition: all 0.3s ease;
        }

        .performance-btn:hover {
            background: linear-gradient(135deg, #e84393, #c44569);
        }

        .performance-btn.active {
            background: linear-gradient(135deg, #00b894, #00a085);
        }

        /* 🎮 Стили для управления камерой */
        .camera-controls {
            display: grid;
            grid-template-columns: 1fr;
            gap: 4px;
            margin-bottom: 8px;
        }

        .camera-btn {
            background: linear-gradient(135deg, #fd79a8, #e84393);
            color: white;
            border: none;
            padding: 6px 8px;
            margin: 2px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 10px;
            transition: all 0.3s ease;
        }

        .camera-btn:hover {
            background: linear-gradient(135deg, #e84393, #c44569);
            transform: translateY(-1px);
        }

        /* ⌨️ Стили для горячих клавиш */
        .hotkeys-info {
            font-size: 9px;
            line-height: 1.4;
        }

        .hotkey-item {
            margin: 3px 0;
            padding: 2px 4px;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 3px;
        }

        .key {
            background: linear-gradient(135deg, #fdcb6e, #e17055);
            color: white;
            padding: 1px 4px;
            border-radius: 2px;
            font-weight: bold;
            font-size: 8px;
        }

        /* 🚀 Стили для Performance Optimization System */
        .performance-toggle-btn {
            background: linear-gradient(135deg, #00b894, #00a085);
            color: white;
            border: none;
            padding: 8px 12px;
            margin: 3px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 12px;
            width: 100%;
            transition: all 0.3s ease;
        }

        .performance-toggle-btn:hover {
            background: linear-gradient(135deg, #00a085, #008f75);
        }

        .performance-toggle-btn.disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        .performance-category {
            margin: 10px 0;
            padding: 10px;
            background: rgba(255, 255, 255, 0.05);
            border-radius: 6px;
        }

        .performance-category h4 {
            margin: 0 0 8px 0;
            font-size: 11px;
            color: #00b894;
            text-align: center;
        }

        .optimization-modes {
            display: grid;
            grid-template-columns: 1fr;
            gap: 4px;
            margin-bottom: 8px;
        }

        .optimization-btn {
            background: linear-gradient(135deg, #74b9ff, #0984e3);
            color: white;
            border: none;
            padding: 6px 8px;
            margin: 2px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 10px;
            transition: all 0.3s ease;
        }

        .optimization-btn:hover {
            background: linear-gradient(135deg, #0984e3, #0652DD);
        }

        .optimization-btn.active {
            background: linear-gradient(135deg, #00b894, #00a085);
        }

        .metrics-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 4px;
            margin-bottom: 8px;
        }

        .metric-item {
            background: rgba(255, 255, 255, 0.1);
            padding: 8px;
            border-radius: 4px;
            text-align: center;
        }

        .metric-value {
            font-size: 1.1em;
            font-weight: bold;
            color: #00b894;
        }

        .metric-label {
            font-size: 0.8em;
            opacity: 0.8;
        }

        .performance-btn {
            background: linear-gradient(135deg, #fd79a8, #e84393);
            color: white;
            border: none;
            padding: 6px 8px;
            margin: 2px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 10px;
            transition: all 0.3s ease;
            width: 100%;
        }

        .performance-btn:hover {
            background: linear-gradient(135deg, #e84393, #c44569);
        }

        /* Стили для коллекций */
        .breadcrumbs_catalog_page {
            background: transparent;
            padding: 15px 0;
            margin-bottom: 30px;
            margin-top: 20px;
            display: flex;
            justify-content: flex-start;
            align-items: center;
            width: 100%;
        }

        .wrap_breadcrumbs {
            max-width: 1200px;
            margin: 0 auto;
            padding: 0 20px;
            white-space: nowrap;
            width: 100%;
        }

        .wrap_breadcrumbs a {
            color: #666;
            text-decoration: none;
        }

        .wrap_breadcrumbs a:hover {
            color: #000;
        }

        .breadcrumb_last {
            color: #000;
            font-weight: bold;
        }

        .catalog_catalog_page {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 30px;
            max-width: 1200px;
            margin: 0 auto;
            padding: 40px 20px 0 20px;
        }

        .item_catalog_catalog_page {
            background: #fff;
            border-radius: 12px;
            overflow: hidden;
            transition: all 0.3s ease;
            cursor: pointer;
            position: relative;
        }

        .item_catalog_catalog_page:hover {
            transform: translateY(-4px);
        }

        .img_block_item_catalog {
            width: 100%;
            height: 200px;
            overflow: hidden;
            position: relative;
        }

        .img_block_item_catalog img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.3s ease;
        }

        .item_catalog_catalog_page:hover .img_block_item_catalog img {
            transform: scale(1.05);
        }

        .title_item_catalog {
            padding: 20px;
            text-align: center;
            background: #fff;
        }

        .title_item_catalog {
            font-size: 18px;
            font-weight: bold;
            color: #000;
            margin: 0;
        }

        .title_item_catalog span {
            display: block;
            font-size: 14px;
            color: #666;
            margin-top: 5px;
            font-weight: normal;
        }

        /* Адаптивность для коллекций */
        @media (max-width: 768px) {
            .catalog_catalog_page {
                grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
                gap: 20px;
                padding: 0 15px;
            }

            .img_block_item_catalog {
                height: 150px;
            }

            .title_item_catalog {
                padding: 15px;
                font-size: 16px;
            }
        }

        @media (max-width: 480px) {
            .catalog_catalog_page {
                grid-template-columns: 1fr;
                gap: 15px;
            }
        }

        /* Стили для шапки - используем стили из темы KARAT */
        #header {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            z-index: 3000;
        }
    