/* ─── App Shell ─── */
        .app-shell {
            display: flex;
            width: 100vw;
            height: 100vh;
            height: 100dvh;
            position: fixed;
            top: 0; left: 0;
            overflow: hidden;
        }

        /* ─── Sidebar (tablet+) ─── */
        .sidebar {
            width: 64px;
            background: #0f0f1a;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 12px 0;
            gap: 6px;
            z-index: 50;
            border-right: 1px solid rgba(255,255,255,0.08);
            flex-shrink: 0;
        }

        .sidebar-top {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            flex: 1;
        }

        .sidebar-bottom {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding-bottom: 8px;
        }

        .sidebar-btn {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            border: none;
            background: transparent;
            color: #888;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            position: relative;
            padding: 0;
        }

        .sidebar-btn:hover {
            background: rgba(133,54,4,0.2);
            color: #e87040;
        }

        .sidebar-btn.active {
            background: rgba(133,54,4,0.35);
            color: #e87040;
            box-shadow: 0 0 0 1px rgba(133,54,4,0.5);
        }

        .sidebar-btn .tooltip {
            position: absolute;
            left: 54px;
            background: #1e1e2e;
            color: #fff;
            font-size: 11px;
            padding: 4px 8px;
            border-radius: 5px;
            white-space: nowrap;
            pointer-events: none;
            opacity: 0;
            transition: opacity 0.2s;
            z-index: 200;
            border: 1px solid rgba(255,255,255,0.1);
        }

        .sidebar-btn:hover .tooltip {
            opacity: 1;
        }

        .sidebar-divider {
            width: 32px;
            height: 1px;
            background: rgba(255,255,255,0.1);
            margin: 4px 0;
        }

        /* Model thumbnail inside sidebar btn */
        .model-thumb {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            object-fit: cover;
            border: 2px solid transparent;
            transition: border-color 0.2s;
        }

        .sidebar-btn.active .model-thumb {
            border-color: #e87040;
        }

        /* ─── Main Area ─── */
        .main-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            position: relative;
        }

        /* ─── Sticky Header ─── */
        .sticky-header {
            position: relative;
            background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
            padding: 10px 16px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            z-index: 40;
            border-bottom: 1px solid rgba(255,255,255,0.08);
            flex-shrink: 0;
        }

        .header-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }

        /* Hamburger (phones only) */
        .hamburger-btn {
            display: none;
            width: 38px;
            height: 38px;
            background: rgba(133,54,4,0.2);
            border: 1px solid rgba(133,54,4,0.4);
            border-radius: 8px;
            color: #e87040;
            font-size: 16px;
            cursor: pointer;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .back-arrow {
            color: #e87040;
            font-size: 20px;
            text-decoration: none;
            transition: color 0.2s;
        }

        .back-arrow:hover { color: #ff9966; }

        .model-name {
            font-size: 1.15rem;
            color: #f0f0f0;
            font-weight: 600;
            letter-spacing: 0.3px;
        }

        .header-right {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /*.info-icon {
            color: #e87040;
            font-size: 22px;
            cursor: pointer;
            transition: color 0.2s;
        } */

        .info-icon:hover { color: #ff9966; }

        /* ─── Canvas Container ─── */
        .canvas-container {
            flex: 1;
            position: relative;
            width: 100%;
            background: #4B6474;
            overflow: hidden;
        }

        .canvas-container.fullscreen {
            position: fixed;
            top: 0; left: 0;
            width: 100vw;
            height: 100vh;
            z-index: 9999;
        }

        .canvas-container.fullscreen .exit-fullscreen-btn { display: flex; }
        .canvas-container.fullscreen .fullscreen-tools { display: flex; }

        /* ─── Loading Overlay ─── */
        .loading-overlay {
            position: absolute;
            inset: 0;
            background: rgba(15,15,26,0.92);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            z-index: 1000;
            transition: opacity 0.5s ease-out;
        }

        .loading-overlay.hidden {
            opacity: 0;
            pointer-events: none;
        }

        .loading-spinner {
            width: 56px;
            height: 56px;
            border: 4px solid rgba(255,255,255,0.1);
            border-top: 4px solid #e87040;
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 18px;
        }

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

        .loading-text {
            font-size: 16px;
            color: #e87040;
            font-weight: 600;
            margin-bottom: 16px;
        }

        .progress-container {
            width: 200px;
            height: 6px;
            background: rgba(255,255,255,0.1);
            border-radius: 10px;
            overflow: hidden;
            margin-bottom: 8px;
        }

        .progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #853604, #e87040);
            width: 0%;
            transition: width 0.3s ease;
            border-radius: 10px;
        }

        .progress-text {
            font-size: 13px;
            color: #aaa;
        }

        /* ─── Model Viewer ─── */
        .model-wrapper {
            position: absolute;
            inset: 0;
        }

        model-viewer {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            z-index: 2;
            border: none;
            --poster-color: transparent;
            background: #000;
        }

        #drawing-canvas {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            z-index: 1;
            cursor: crosshair;
            background: transparent;
            opacity: 0.8;
        }

        .copyright {
            position: absolute;
            right: 12px;
            bottom: 28px;
            z-index: 10;
            font-size: 11px;
            color: #fff;
            background: rgba(0,0,0,0.45);
            padding: 2px 6px;
            border-radius: 3px;
            pointer-events: none;
        }

        /* ─── Exit Fullscreen Button ─── */
        .exit-fullscreen-btn {
            display: none;
            position: absolute;
            top: 16px;
            right: 16px;
            z-index: 10002;
            background: rgba(156,39,176,0.9);
            color: white;
            border: none;
            padding: 10px 16px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 14px;
            gap: 6px;
            align-items: center;
            box-shadow: 0 4px 12px rgba(0,0,0,0.4);
            transition: background 0.2s;
        }

        .exit-fullscreen-btn:hover { background: rgba(123,31,162,0.95); }

        /* ─── Fullscreen Tools ─── */
        .fullscreen-tools {
            display: none;
            position: absolute;
            bottom: 20px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10001;
            background: rgba(15,15,26,0.92);
            backdrop-filter: blur(12px);
            padding: 10px 16px 12px;
            border-radius: 12px;
            box-shadow: 0 4px 24px rgba(0,0,0,0.5);
            flex-direction: column;
            align-items: center;
            gap: 8px;
            min-width: 300px;
            border: 1px solid rgba(255,255,255,0.1);
        }

        .fullscreen-tools-row {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        /* ─── Animation Progress Bar ─── */
        .anim-progress-wrapper {
            width: 100%;
            padding: 5px 14px 3px;
            background: #0f0f1a;
            border-bottom: 1px solid rgba(255,255,255,0.06);
            display: flex;
            align-items: center;
            gap: 10px;
            flex-shrink: 0;
        }

        .anim-time-label {
            font-size: 11px;
            color: #888;
            white-space: nowrap;
            min-width: 36px;
            font-variant-numeric: tabular-nums;
        }

        .anim-progress-track {
            flex: 1;
            height: 5px;
            background: rgba(255,255,255,0.12);
            border-radius: 10px;
            position: relative;
            cursor: pointer;
        }

        .anim-progress-fill {
            height: 100%;
            width: 0%;
            background: linear-gradient(90deg, #2196F3, #42a5f5);
            border-radius: 10px;
            pointer-events: none;
        }

        .anim-progress-thumb {
            width: 13px;
            height: 13px;
            background: #42a5f5;
            border: 2px solid #fff;
            border-radius: 50%;
            position: absolute;
            top: 50%;
            left: 0%;
            transform: translate(-50%, -50%);
            box-shadow: 0 1px 4px rgba(0,0,0,0.4);
            cursor: grab;
            transition: box-shadow 0.1s;
        }

        .anim-progress-thumb:active { cursor: grabbing; }

        .anim-progress-wrapper-fs {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        /* ─── Canvas Toolbar ─── */
        .canvas-toolbar {
            display: flex;
            align-items: center;
            justify-content: flex-end;
            gap: 8px;
            padding: 8px 14px;
            background: #0f0f1a;
            border-top: 1px solid rgba(255,255,255,0.06);
            flex-shrink: 0;
            flex-wrap: wrap;
        }

        /* Generic buttons reset */
        button {
            cursor: pointer;
            border: none;
            font-family: inherit;
        }

        .tool-btn {
            width: 38px;
            height: 38px;
            border-radius: 8px;
            background: #1e1e2e;
            color: #bbb;
            font-size: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            border: 1px solid rgba(255,255,255,0.08);
            padding: 0;
        }

        .tool-btn:hover { background: #2a2a3e; color: #fff; }
        .tool-btn.active { background: rgba(76,175,80,0.25); color: #4CAF50; border-color: rgba(76,175,80,0.4); }
        .tool-btn.clear { background: rgba(244,67,54,0.2); color: #f44336; border-color: rgba(244,67,54,0.3); }
        .tool-btn.clear:hover { background: rgba(244,67,54,0.35); }
        .tool-btn.animation-control { background: rgba(33,150,243,0.2); color: #2196F3; border-color: rgba(33,150,243,0.3); }
        .tool-btn.animation-control:hover { background: rgba(33,150,243,0.35); }
        .tool-btn.animation-control.selected { background: rgba(33,150,243,0.4); box-shadow: inset 0 0 5px rgba(0,0,0,0.3); }
        .tool-btn.fullscreen-control { background: rgba(156,39,176,0.2); color: #CE93D8; border-color: rgba(156,39,176,0.3); }
        .tool-btn.fullscreen-control:hover { background: rgba(156,39,176,0.35); }
        .tool-btn.capture-btn { background: rgba(255,152,0,0.2); color: #FFB74D; border-color: rgba(255,152,0,0.3); }
        .tool-btn.capture-btn:hover { background: rgba(255,152,0,0.35); }
        .tool-btn.model-mode { background: rgba(117,117,117,0.2); color: #aaa; border-color: rgba(117,117,117,0.3); }
        .tool-btn.marker-mode { background: rgba(255,152,0,0.2); color: #FFB74D; border-color: rgba(255,152,0,0.3); }

        .toggle-text-btn {
            height: 38px;
            padding: 0 12px;
            border-radius: 8px;
            font-size: 12px;
            font-weight: 600;
            background: rgba(117,117,117,0.2);
            color: #aaa;
            border: 1px solid rgba(117,117,117,0.3);
            transition: all 0.2s;
            white-space: nowrap;
        }

        .toggle-text-btn.marker-mode { background: rgba(255,152,0,0.2); color: #FFB74D; border-color: rgba(255,152,0,0.3); }

        input[type="color"] {
            width: 38px;
            height: 38px;
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 8px;
            padding: 2px;
            background: #1e1e2e;
            cursor: pointer;
        }

        /* ─── Info Modal ───
        .info-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.6);
            z-index: 500;
            overflow-y: auto;
        }

        .info-modal.active {
            display: flex;
            justify-content: center;
            align-items: flex-start;
            padding: 20px;
        }

        .info-content {
            background: #1a1a2e;
            border-radius: 12px;
            max-width: 800px;
            width: 100%;
            margin: 20px auto;
            padding: 28px;
            position: relative;
            box-shadow: 0 8px 40px rgba(0,0,0,0.5);
            border: 1px solid rgba(255,255,255,0.1);
        }

        .close-modal {
            position: absolute;
            top: 12px;
            right: 14px;
            font-size: 28px;
            color: #e87040;
            cursor: pointer;
            background: none;
            border: none;
            line-height: 1;
        }

        .info-content h2 { color: #e87040; margin-bottom: 24px; font-size: 1.6rem; }
        .info-content h3 { color: #64b5f6; margin-bottom: 12px; font-size: 1.2rem; }
        .info-content h4 { color: #888; margin: 16px 0 8px; font-size: 0.95rem; }

        .info-content p {
            line-height: 1.8;
            color: #ccc;
            margin-bottom: 14px;
            text-align: justify;
        }

        .info-content ul { margin-left: 22px; margin-bottom: 14px; }
        .info-content li { line-height: 1.8; color: #ccc; margin-bottom: 8px; }

        .info-section {
            margin-bottom: 32px;
            padding-bottom: 24px;
            border-bottom: 1px solid rgba(255,255,255,0.08);
        }

        .info-section:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

        .organelle {
            margin-bottom: 14px;
            padding: 12px;
            border: 1px solid rgba(255,255,255,0.08);
            border-radius: 8px;
            background: rgba(255,255,255,0.02);
        }

        .info-image, .info-video {
            width: 100%;
            max-width: 580px;
            height: auto;
            border-radius: 8px;
            margin: 16px auto;
            display: block;
            box-shadow: 0 4px 16px rgba(0,0,0,0.3);
        } */

        /* ─── Video Modal ─── 
        .video-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.85);
            z-index: 600;
            align-items: center;
            justify-content: center;
        }

        .video-modal.active { display: flex; }

        .video-modal-content {
            background: #0f0f1a;
            border-radius: 14px;
            width: 90%;
            max-width: 860px;
            padding: 20px;
            position: relative;
            border: 1px solid rgba(255,255,255,0.1);
            box-shadow: 0 12px 48px rgba(0,0,0,0.7);
        }

        .video-modal-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 14px;
        }

        .video-modal-title {
            color: #f0f0f0;
            font-size: 1rem;
            font-weight: 600;
        }

        .video-close-btn {
            background: none;
            border: none;
            color: #e87040;
            font-size: 22px;
            cursor: pointer;
            line-height: 1;
        }

        .video-iframe-wrap {
            position: relative;
            padding-bottom: 56.25%;
            height: 0;
            overflow: hidden;
            border-radius: 8px;
            background: #000;
        }

        .video-iframe-wrap iframe {
            position: absolute;
            top: 0; left: 0;
            width: 100%;
            height: 100%;
            border: none;
        }*/

        /* ─── Mobile Drawer ─── */
        .mobile-drawer-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            z-index: 300;
        }

        .mobile-drawer-overlay.active { display: block; }

        .mobile-drawer {
            position: fixed;
            top: 0;
            left: -240px;
            width: 220px;
            height: 100%;
            background: #0f0f1a;
            z-index: 400;
            transition: left 0.3s ease;
            display: flex;
            flex-direction: column;
            border-right: 1px solid rgba(255,255,255,0.08);
        }

        .mobile-drawer.open { left: 0; }

        .mobile-drawer-header {
            padding: 18px 16px 12px;
            border-bottom: 1px solid rgba(255,255,255,0.08);
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .mobile-drawer-title {
            color: #e87040;
            font-size: 0.9rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .drawer-close {
            background: none;
            border: none;
            color: #888;
            font-size: 18px;
            cursor: pointer;
        }

        .mobile-drawer-body {
            flex: 1;
            overflow-y: auto;
            padding: 12px 8px;
            display: flex;
            flex-direction: column;
            gap: 6px;
        }

        .mobile-drawer-footer {
            padding: 12px 8px;
            border-top: 1px solid rgba(255,255,255,0.08);
        }

        .drawer-model-btn {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 10px;
            border-radius: 10px;
            background: transparent;
            border: 1px solid transparent;
            color: #ccc;
            cursor: pointer;
            transition: all 0.2s;
            text-align: left;
        }

        .drawer-model-btn:hover {
            background: rgba(133,54,4,0.15);
            border-color: rgba(133,54,4,0.3);
            color: #e87040;
        }

        .drawer-model-btn.active {
            background: rgba(133,54,4,0.25);
            border-color: rgba(133,54,4,0.5);
            color: #e87040;
        }

        .drawer-model-icon {
            width: 38px;
            height: 38px;
            border-radius: 8px;
            object-fit: cover;
            flex-shrink: 0;
            background: rgba(255,255,255,0.05);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            color: #888;
        }

        .drawer-model-icon img {
            width: 100%;
            height: 100%;
            border-radius: 8px;
            object-fit: cover;
        }

        .drawer-model-label {
            font-size: 13px;
            font-weight: 500;
        }

        .drawer-video-btn {
            width: 100%;
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 10px 10px;
            border-radius: 10px;
            background: rgba(229,57,53,0.15);
            border: 1px solid rgba(229,57,53,0.3);
            color: #ef9a9a;
            cursor: pointer;
            transition: all 0.2s;
        }

        .drawer-video-btn:hover {
            background: rgba(229,57,53,0.25);
        }

        /* ─── Capture Toast ─── */
        .capture-toast {
            position: fixed;
            bottom: 80px;
            left: 50%;
            transform: translateX(-50%) translateY(20px);
            background: rgba(76,175,80,0.95);
            color: #fff;
            padding: 8px 18px;
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.3s, transform 0.3s;
            z-index: 9999;
            white-space: nowrap;
        }

        .capture-toast.show {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }

        /* ─── Responsive ─── */
        @media (max-width: 767px) {
            .sidebar { display: none; }
            .hamburger-btn { display: flex; }

            .canvas-toolbar {
                gap: 6px;
                padding: 6px 10px;
                justify-content: center;
            }

            .tool-btn {
                width: 34px;
                height: 34px;
                font-size: 14px;
            }

            input[type="color"] {
                width: 34px;
                height: 34px;
            }

            .toggle-text-btn {
                height: 34px;
                padding: 0 8px;
                font-size: 11px;
            }
        }

        @media (min-width: 768px) {
            .hamburger-btn { display: none; }
            .mobile-drawer, .mobile-drawer-overlay { display: none !important; }
        }