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

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: #f4f4f4;
            color: #171a20;
            overflow: hidden;
            height: 100vh;
            height: 100dvh;
        }

        /* Header */
        .header {
            background: #fff;
            padding: 12px 24px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            position: fixed;
            top: 0; /* BANNER HIDDEN - was: 40px */
            left: 0;
            right: 0;
            z-index: 100;
            box-shadow: 0 1px 3px rgba(0,0,0,0.08);
            height: 56px;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 14px;
        }

        .logo-icon {
            display: flex;
            align-items: center;
            color: #5c5e62;
        }

        .logo-icon svg {
            width: 120px;
            height: auto;
        }

        .logo-divider {
            width: 1px;
            height: 28px;
            background: #ddd;
        }

        .logo-text {
            font-size: 16px;
            font-weight: 500;
            color: #393c41;
        }

        .logo-text .subtitle {
            display: block;
            font-size: 10px;
            font-weight: 400;
            color: #5c5e62;
            letter-spacing: 0.3px;
            margin-top: 2px;
        }

        /* Visually hidden but accessible to screen readers and search engines */
        .seo-h1 {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }

        .model-select {
            padding: 8px 32px 8px 14px;
            background: #f4f4f4;
            color: #171a20;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-family: inherit;
            cursor: pointer;
            appearance: none;
            -webkit-appearance: none;
            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='%23171a20' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 10px center;
        }
        .model-select:hover { background-color: #e8e8e8; }
        .model-select:focus { outline: none; }

        /* Main Layout */
        .main-container {
            display: flex;
            height: 100vh;
            height: 100dvh;
            padding-top: 56px; /* BANNER HIDDEN - was: 96px */
        }

        /* Sidebar */
        .sidebar {
            flex: 0 0 320px;
            background: #fff;
            overflow-y: auto;
            border-right: 1px solid #e8e8e8;
            display: flex;
            flex-direction: column;
        }

        .sidebar-section {
            padding: 16px;
            border-bottom: 1px solid #f0f0f0;
        }

        .section-title {
            font-size: 10px;
            font-weight: 600;
            color: #888;
            text-transform: uppercase;
            letter-spacing: 0.8px;
            margin-bottom: 12px;
        }

        /* Tabs */
        .tabs {
            display: flex;
            border-bottom: 1px solid #e8e8e8;
            background: #fff;
        }

        .tab {
            flex: 1;
            padding: 14px 16px;
            white-space: nowrap;
            text-align: center;
            font-size: 13px;
            font-weight: 500;
            color: #666;
            cursor: pointer;
            border-bottom: 2px solid transparent;
            transition: all 0.15s;
        }

        .tab:hover {
            color: #333;
            background: #f8f8f8;
        }

        .tab.active {
            color: #3e6ae1;
            border-bottom-color: #3e6ae1;
        }

        .tab-count {
            background: #e8e8e8;
            padding: 2px 6px;
            border-radius: 8px;
            font-size: 10px;
            color: #666;
            font-weight: 500;
            margin-left: 6px;
        }

        .tab.active .tab-count {
            background: #e8f0ff;
            color: #3e6ae1;
        }

        .tab-content {
            display: none;
            flex: 1;
            overflow-y: auto;
        }

        .tab-content.active {
            display: block;
        }

        /* Upload Area */
        .upload-area {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            border: 2px dashed #d0d0d0;
            border-radius: 4px;
            padding: 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            background: #fafafa;
        }
        .upload-area:hover, .upload-area.drag-over {
            border-color: #3e6ae1;
            background: #f8faff;
        }

        .upload-icon {
            width: 36px;
            height: 36px;
            background: #e8e8e8;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 10px;
            font-size: 16px;
            color: #666;
        }

        .upload-text {
            font-size: 12px;
            font-weight: 500;
            color: #333;
        }

        .upload-hint {
            font-size: 10px;
            color: #999;
            margin-top: 4px;
        }

        input[type="file"] { display: none; }

        /* Wrap Gallery */
        .wraps-container {
            flex: 1;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
        }

        .category-title {
            font-size: 11px;
            font-weight: 600;
            color: #333;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .skin-count {
            background: #e8e8e8;
            padding: 2px 6px;
            border-radius: 8px;
            font-size: 9px;
            color: #666;
            font-weight: 500;
        }

        /* Community upload button */
        .community-upload-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 12px;
            margin: 16px;
            background: #3e6ae1;
            color: #fff;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            font-weight: 500;
            transition: background 0.2s;
        }

        .community-upload-btn:hover {
            background: #3457b1;
        }

        .skin-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }

        .skin-card {
            aspect-ratio: 1;
            border-radius: 4px;
            cursor: pointer;
            border: 2px solid transparent;
            transition: all 0.15s ease;
            background-size: cover;
            background-position: center;
            position: relative;
            overflow: hidden;
        }
        .skin-card:hover {
            border-color: #c0c0c0;
        }
        .skin-card.active {
            border-color: #3e6ae1;
        }

        .skin-card-name {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            padding: 4px;
            background: linear-gradient(transparent, rgba(0,0,0,0.7));
            color: #fff;
            font-size: 7px;
            font-weight: 500;
            text-align: center;
            text-transform: uppercase;
        }

        /* 3D Viewer */
        .viewer-panel {
            flex: 1;
            position: relative;
            background: linear-gradient(180deg, #eaecef 0%, #dcdee1 100%);
            min-width: 0;
        }

        #canvas-container {
            width: 100%;
            height: 100%;
            position: relative;
        }

        canvas { display: block; }

        #loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
            color: #666;
        }

        .spinner {
            width: 32px;
            height: 32px;
            border: 3px solid #d0d0d0;
            border-top-color: #3e6ae1;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 10px;
        }

        @keyframes spin { to { transform: rotate(360deg); } }

        /* Viewer Controls */
        .viewer-controls {
            position: absolute;
            bottom: 24px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            gap: 12px;
            background: #fff;
            padding: 12px 20px;
            border-radius: 4px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.1);
        }

        .camera-tuner {
            position: absolute;
            top: 16px;
            right: 16px;
            z-index: 60;
            width: min(360px, calc(100% - 32px));
            background: rgba(255, 255, 255, 0.96);
            border: 1px solid rgba(23, 26, 32, 0.08);
            border-radius: 8px;
            box-shadow: 0 12px 32px rgba(0,0,0,0.14);
            backdrop-filter: blur(10px);
        }

        .camera-tuner.hidden {
            display: none;
        }

        .camera-tuner-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 12px 14px 10px;
            border-bottom: 1px solid #ececec;
        }

        .camera-tuner-title {
            font-size: 13px;
            font-weight: 600;
            color: #171a20;
        }

        .camera-tuner-subtitle {
            font-size: 11px;
            color: #666;
            margin-top: 2px;
        }

        .camera-tuner-status {
            font-size: 10px;
            font-weight: 600;
            color: #3e6ae1;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            white-space: nowrap;
        }

        .camera-tuner-body {
            padding: 12px 14px 14px;
        }

        .camera-tuner-help {
            font-size: 11px;
            color: #666;
            line-height: 1.45;
            margin-bottom: 10px;
        }

        .camera-tuner-actions {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 8px;
            margin-bottom: 10px;
        }

        .camera-tuner-btn {
            border: none;
            border-radius: 6px;
            background: #f1f3f5;
            color: #171a20;
            font: inherit;
            font-size: 12px;
            font-weight: 600;
            padding: 10px 12px;
            cursor: pointer;
        }

        .camera-tuner-btn:hover {
            background: #e4e7eb;
        }

        .camera-tuner-btn.primary {
            background: #3e6ae1;
            color: #fff;
        }

        .camera-tuner-btn.primary:hover {
            background: #3457b1;
        }

        .camera-tuner-json {
            width: 100%;
            min-height: 120px;
            resize: vertical;
            border: 1px solid #d8dadd;
            border-radius: 6px;
            background: #fafbfc;
            color: #171a20;
            font: 11px/1.45 SFMono-Regular, Consolas, monospace;
            padding: 10px;
        }

        .viewer-hint {
            font-size: 13px;
            color: #5c5e62;
            padding-right: 12px;
            border-right: 1px solid #e8e8e8;
        }

        .btn {
            background: #f4f4f4;
            color: #171a20;
            border: none;
            padding: 10px 24px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 14px;
            font-family: inherit;
            font-weight: 500;
            transition: background 0.2s;
        }
        .btn:hover {
            background: #e4e4e4;
        }
        .btn.active {
            background: #e4e4e4;
        }
        .btn-primary {
            background: #3e6ae1;
            color: #fff;
        }
        .btn-primary:hover {
            background: #3457b1;
        }

        /* Image fallback view for unsupported models */
        .fallback-view {
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            padding: 40px;
            text-align: center;
        }

        .fallback-view.active {
            display: flex;
        }

        .fallback-image {
            max-width: 90%;
            max-height: 60%;
            border-radius: 12px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.15);
            margin-bottom: 24px;
        }

        .fallback-message {
            font-size: 14px;
            color: #666;
            margin-bottom: 8px;
        }

        .fallback-hint {
            font-size: 12px;
            color: #999;
        }

        /* Search */
        .search-container {
            padding: 12px 16px;
            border-bottom: 1px solid #f0f0f0;
        }
        .search-input {
            width: 100%;
            padding: 10px 12px;
            border: none;
            border-radius: 4px;
            font-size: 14px;
            font-family: inherit;
            background: #f4f4f4;
        }

        .search-input:focus {
            outline: none;
            background: #eee;
        }
        .search-input::placeholder {
            color: #888;
        }

        /* Modal */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.5);
            z-index: 200;
            align-items: center;
            justify-content: center;
        }
        .modal-overlay.active { display: flex; }
        .modal {
            background: #fff;
            border-radius: 4px;
            padding: 32px;
            max-width: 400px;
            width: 90%;
            max-height: 85vh;
            overflow-y: auto;
        }
        .modal-title {
            font-size: 20px;
            font-weight: 600;
            margin-bottom: 24px;
            color: #171a20;
        }
        .modal-code {
            background: #f4f4f4;
            color: #171a20;
            padding: 12px 16px;
            border-radius: 4px;
            font-family: 'SF Mono', Monaco, Consolas, monospace;
            font-size: 14px;
            margin: 12px 0;
        }
        .modal-buttons {
            display: flex;
            gap: 12px;
            margin-top: 24px;
        }
        .modal-buttons .btn {
            flex: 1;
        }

        /* Community Upload Modal */
        .model-checkbox-grid {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .model-upload-row {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .model-checkbox {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            background: #f4f4f4;
            border-radius: 4px;
            cursor: pointer;
            font-size: 13px;
        }
        .model-checkbox:hover { background: #e8e8e8; }
        .model-checkbox input { width: 16px; height: 16px; cursor: pointer; }
        .model-file-input {
            margin-left: 28px;
            padding: 8px;
            background: #fff;
            border: 1px dashed #ccc;
            border-radius: 4px;
            font-size: 12px;
        }
        .model-file-input.has-file {
            border-color: #3e6ae1;
            background: #f8faff;
        }

        /* Scrollbar */
        .sidebar::-webkit-scrollbar,
        .wraps-container::-webkit-scrollbar { width: 4px; }
        .sidebar::-webkit-scrollbar-track,
        .wraps-container::-webkit-scrollbar-track { background: transparent; }
        .sidebar::-webkit-scrollbar-thumb,
        .wraps-container::-webkit-scrollbar-thumb { background: #d0d0d0; border-radius: 2px; }

        /* Mobile/Desktop text toggle - default is desktop */
        .mobile-only { display: none; }
        .desktop-only { display: inline; }

        /* Mobile Responsive */
        @media (max-width: 768px) {
            body {
                overflow-y: auto;
                height: auto;
                min-height: 100vh;
            }

            .main-container {
                flex-direction: column-reverse;
                height: auto;
                min-height: calc(100vh - 48px);
                overflow: visible;
            }

            .sidebar {
                flex: 0 0 auto;
                max-height: none;
                height: auto;
                overflow-y: visible;
                border-right: none;
                border-top: 1px solid #e8e8e8;
            }

            .viewer-panel {
                flex: 0 0 auto;
                height: 60vh;
                min-height: 300px;
            }

            .header {
                padding: 10px 16px;
                height: 48px;
            }

            .main-container {
                padding-top: 48px;
            }

            .logo-icon svg { width: 80px; }
            .logo-text { display: none; }
            .logo-divider { display: none; }

            .mobile-only { display: inline; }
            .desktop-only { display: none; }

            .model-select {
                font-size: 12px;
                padding: 6px 10px;
            }

            .sidebar-section {
                padding: 12px;
            }

            .skin-grid {
                grid-template-columns: repeat(4, 1fr);
                gap: 6px;
            }

            .viewer-controls {
                bottom: 10px;
                padding: 6px 12px;
                gap: 8px;
            }

            .camera-tuner {
                top: 10px;
                right: 10px;
                left: 10px;
                width: auto;
            }

            .viewer-controls .btn {
                padding: 8px 14px;
                font-size: 13px;
            }

            .viewer-hint { display: none; }
        }

        @media (max-width: 480px) {
            /* upload modal: the vehicle list scrolls so Cancel / Submit stay on screen */
            #model-checkboxes { max-height: 34vh; overflow-y: auto; padding-right: 4px; }

            .skin-grid {
                grid-template-columns: repeat(3, 1fr);
            }
        }

        /* Loading overlay for 3D viewer */
        .viewer-loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(0,0,0,0.7);
            color: white;
            padding: 16px 24px;
            border-radius: 8px;
            font-size: 14px;
            z-index: 50;
            display: none;
        }
        .viewer-loading.active { display: flex; align-items: center; gap: 10px; }
        .viewer-loading .spinner {
            width: 18px;
            height: 18px;
            border: 2px solid rgba(255,255,255,0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        @keyframes spin { to { transform: rotate(360deg); } }

        /* Community section loading */
        .community-loading {
            padding: 20px;
            text-align: center;
            color: #888;
            font-size: 13px;
        }
        .community-loading .spinner {
            width: 20px;
            height: 20px;
            border: 2px solid #ddd;
            border-top-color: #3e6ae1;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
            margin: 0 auto 8px;
        }

        /* Drop zone for file uploads */
        .drop-zone {
            display: block;
            padding: 20px 16px;
            border: 2px dashed #ccc;
            border-radius: 8px;
            background: #fafafa;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
        }
        .drop-zone:hover {
            border-color: #999;
            background: #f0f0f0;
        }
        .drop-zone.drag-over {
            border-color: #3e6ae1;
            background: #f0f4ff;
        }
        .drop-zone.has-file {
            display: none;
        }
        .drop-zone span {
            color: #666;
            font-size: 12px;
        }
        .drop-zone input[type="file"] {
            display: none;
        }
        .file-error {
            display: none;
            color: #c00;
            font-size: 11px;
            margin-top: 6px;
        }
        .file-name {
            display: none;
            color: #2a6;
            font-size: 12px;
            padding: 8px 12px;
            background: #f0fff4;
            border: 1px solid #2a6;
            border-radius: 6px;
        }
        .file-name .remove-file {
            margin-left: 8px;
            color: #888;
            cursor: pointer;
            font-weight: bold;
        }
        .file-name .remove-file:hover {
            color: #c00;
        }

        /* Promo Banner - Tesla style */
        .promo-banner {
            background: linear-gradient(90deg, #e4c678 0%, #f2e5c2 50%, #e8d199 100%);
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1001;
            height: 40px;
            display: none; /* HIDDEN - was: flex */
            align-items: center;
            justify-content: center;
            font-size: 14px;
        }
        .promo-banner.hidden {
            display: none;
        }
        .promo-text {
            color: #000;
            font-weight: 400;
        }
        .promo-link {
            background: #000;
            color: #e2e3e3;
            text-decoration: none;
            font-size: 12px;
            font-weight: 500;
            padding: 6px 12px;
            border-radius: 4px;
            margin-left: 12px;
        }
        .promo-link:hover {
            background: #333;
        }
        .promo-close {
            position: absolute;
            right: 16px;
            background: none;
            border: none;
            color: #000;
            font-size: 16px;
            cursor: pointer;
            opacity: 0.4;
        }
        .promo-close:hover {
            opacity: 1;
        }
        @media (max-width: 600px) {
            .promo-close {
                display: none;
            }
        }

        /* ---- License plates (visualizer/lib/plates.js, docs/plates-ui.md) ----
           Plate mode swaps the sidebar to the plate panel. Only existing colours, radii and sizes. */
        .plate-link {
            float: right;
            background: none;
            border: none;
            padding: 0;
            font: inherit;
            letter-spacing: inherit;
            text-transform: inherit;
            color: #3e6ae1;
            cursor: pointer;
        }
        .plate-link:hover { color: #3457b1; }
        .sidebar.plates-mode > .sidebar-section,
        .sidebar.plates-mode .tabs,
        .sidebar.plates-mode .search-container { display: none; }

        .plate-preview {
            display: block;
            width: 100%;
            height: auto;
            aspect-ratio: 2 / 1;
            border: 1px solid #d0d0d0;
            border-radius: 12px;
            background: #fff;
        }
        .plate-preview.eu { aspect-ratio: 4.2 / 1; }

        .plate-controls {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 12px;
        }
        .plate-controls .search-input {
            flex: 1 1 auto;
            min-width: 0;
        }
        .plate-region { display: flex; flex: 0 0 auto; }
        .plate-region .btn {
            padding: 8px 14px;
            font-size: 13px;
        }
        .plate-region .btn:first-child { border-radius: 4px 0 0 4px; }
        .plate-region .btn:last-child { border-radius: 0 4px 4px 0; }
        .plate-region .btn.active { background: #e4e4e4; }
        .plate-color {
            flex: 0 0 38px;
            width: 38px;
            height: 38px;
            padding: 0;
            border: 1px solid #d0d0d0;
            border-radius: 50%;
            background: none;
            cursor: pointer;
            overflow: hidden;
        }
        .plate-color::-webkit-color-swatch-wrapper { padding: 0; }
        .plate-color::-webkit-color-swatch { border: none; border-radius: 50%; }
        .plate-color::-moz-color-swatch { border: none; border-radius: 50%; }
        .plate-note {
            display: none;
            margin-top: 12px;
            font-size: 11px;
            color: #999;
            text-align: center;
        }

        .skin-grid.plate-grid { grid-template-columns: repeat(2, 1fr); }
        .skin-grid.plate-grid.eu { grid-template-columns: 1fr; }
        .skin-card.plate-card {
            aspect-ratio: 2 / 1;
            border: 1px solid #d0d0d0;
            border-radius: 8px;
            background: #f4f4f4;
        }
        .plate-grid.eu .skin-card.plate-card { aspect-ratio: 4.2 / 1; }
        .skin-card.plate-card:hover { border-color: #c0c0c0; }
        .skin-card.plate-card.active {
            border-color: #3e6ae1;
            box-shadow: 0 0 0 1px #3e6ae1;
        }
        .plate-card img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .plate-card .skin-card-name { display: none; }

        @media (max-width: 768px) and (min-width: 481px) {
            .skin-grid.plate-grid { grid-template-columns: repeat(3, 1fr); }
            .skin-grid.plate-grid.eu { grid-template-columns: repeat(2, 1fr); }
        }
