        * { margin: 0; padding: 0; box-sizing: border-box; }
        body { font-family: 'Segoe UI', Arial, sans-serif; background: #0f1117; color: #e0e0e0; overflow: hidden; height: 100vh; }

        /* Nav bar */
        .nav-bar { position: fixed; top: 0; left: 0; right: 0; height: 36px; background: #13151c; border-bottom: 1px solid #2a2d3a; display: flex; align-items: center; padding: 0 16px; z-index: 2000; gap: 12px; }
        .nav-bar a { color: #94a3b8; text-decoration: none; font-size: 12px; transition: color 0.15s; }
        .nav-bar a:hover { color: #00d4ff; }
        .nav-bar .nav-sep { color: #94a3b8; font-size: 11px; }
        .nav-bar .nav-current { color: #e0e0e0; font-size: 12px; font-weight: 600; }

        /* Layout */
        .app { display: grid; grid-template-columns: 220px 1fr 260px; grid-template-rows: 48px 1fr 44px; height: calc(100vh - 36px); margin-top: 36px; gap: 6px; padding: 6px; }

        /* Header */
        .header { grid-column: 1 / -1; background: #1a1d27; border-radius: 6px; border: 1px solid #2a2d3a; padding: 0 16px; display: flex; align-items: center; justify-content: space-between; }
        .header h1 { font-size: 15px; color: #c084fc; font-weight: 600; }
        .header-stats { display: flex; gap: 16px; font-size: 12px; color: #94a3b8; }
        .header-stats span { color: #fff; font-weight: 600; }
        .save-status { font-size: 12px; padding: 3px 10px; border-radius: 12px; }
        .save-status.saved { background: #00ff8822; color: #00ff88; }
        .save-status.unsaved { background: #ff333322; color: #ff3333; }
        .save-status.loading { background: #a855f722; color: #c084fc; }

        /* Panels */
        .panel { background: #1a1d27; border-radius: 6px; border: 1px solid #2a2d3a; display: flex; flex-direction: column; overflow: hidden; }
        .panel-header { padding: 8px 12px; border-bottom: 1px solid #2a2d3a; font-size: 12px; font-weight: 600; color: #c084fc; flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; }

        /* Image list */
        .image-list { flex: 1; overflow-y: auto; }
        .image-item { padding: 6px 12px; cursor: pointer; font-size: 11px; border-bottom: 1px solid #1f222e; display: flex; align-items: center; gap: 8px; transition: background 0.15s; }
        .image-item:hover { background: #22253a; }
        .image-item.active { background: #a855f722; border-left: 3px solid #a855f7; }
        .image-item .dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
        .image-item .dot.labeled { background: #00ff88; }
        .image-item .dot.unlabeled { background: #444; }
        .image-item .image-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
        .image-item .img-del { color: #94a3b8; font-size: 12px; padding: 2px 6px; border-radius: 4px; border: 1px solid transparent; }
        .image-item .img-del:hover { color: #ff8080; border-color: #ff444433; background: #ff444411; }

        /* Canvas area */
        .canvas-area { flex: 1; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #111318; }
        .canvas-area canvas { max-width: 100%; max-height: 100%; }
        .canvas-info { position: absolute; bottom: 8px; left: 8px; font-size: 11px; color: #94a3b8; pointer-events: none; }
        .empty-state { color: #94a3b8; font-size: 14px; position: absolute; pointer-events: none; }

        /* Right panel */
        .annotation-list { flex: 1; overflow-y: auto; }
        .ann-item { padding: 6px 10px; font-size: 11px; border-bottom: 1px solid #1f222e; display: flex; align-items: center; gap: 8px; }
        .ann-item .ann-color { width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0; }
        .ann-item .ann-label { flex: 1; }
        .ann-item .ann-pts { color: #94a3b8; font-size: 10px; }
        .ann-item .ann-del { cursor: pointer; color: #94a3b8; font-size: 14px; }
        .ann-item .ann-del:hover { color: #ff8080; }

        /* Class selector */
        .class-selector { padding: 8px 10px; border-top: 1px solid #2a2d3a; flex-shrink: 0; }
        .class-selector label { font-size: 11px; color: #94a3b8; display: block; margin-bottom: 4px; }
        .class-buttons { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
        .class-btn { padding: 3px 8px; border: 1px solid #333; background: transparent; color: #ccc; border-radius: 4px; cursor: pointer; font-size: 10px; transition: all 0.15s; }
        .class-btn:hover { border-color: #c084fc; }
        .class-btn.active { background: #a855f733; border-color: #c084fc; color: #fff; }

        /* Add class input */
        .add-class-row { display: flex; gap: 4px; margin-top: 4px; }
        .add-class-row input { flex: 1; padding: 3px 6px; background: #0f1117; border: 1px solid #333; border-radius: 4px; color: #ccc; font-size: 11px; outline: none; }
        .add-class-row input:focus { border-color: #c084fc; }
        .add-class-row button { padding: 3px 8px; background: #a855f722; border: 1px solid #a855f7; color: #c084fc; border-radius: 4px; cursor: pointer; font-size: 10px; }
        .add-class-row button:hover { background: #a855f744; }

        /* Toolbar */
        .toolbar { grid-column: 1 / -1; background: #1a1d27; border-radius: 6px; border: 1px solid #2a2d3a; padding: 0 12px; display: flex; align-items: center; gap: 6px; }
        .toolbar .sep { width: 1px; height: 20px; background: #2a2d3a; margin: 0 4px; }
        .tb-btn { padding: 4px 10px; border: 1px solid #333; background: transparent; color: #ccc; border-radius: 4px; cursor: pointer; font-size: 11px; transition: all 0.15s; }
        .tb-btn:hover { border-color: #c084fc; color: #fff; }
        .tb-btn.active { background: #a855f733; border-color: #c084fc; color: #fff; }
        .tb-btn.accept { border-color: #00ff88; color: #00ff88; }
        .tb-btn.accept:hover { background: #00ff8822; }
        .tb-btn.reject { border-color: #ff8080; color: #ff8080; }
        .tb-btn.reject:hover { background: #ff444422; }
        .tb-btn.save { border-color: #00d4ff; color: #00d4ff; }
        .tb-btn.save:hover { background: #00d4ff22; }
        .tb-btn:disabled { opacity: 0.3; cursor: default; }
        .tb-btn.auto-on { background: #00ff8833; border-color: #00ff88; color: #00ff88; animation: pulse 2s infinite; }
        @keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(0,255,136,0.3); } 50% { box-shadow: 0 0 8px 2px rgba(0,255,136,0.15); } }
        .tb-label { font-size: 11px; color: #94a3b8; }
        .tb-nav { font-size: 12px; color: #ccc; }
        .active-class-indicator { display: inline-block; padding: 2px 10px; border-radius: 4px; font-size: 11px; font-weight: 600; margin-left: 8px; }

        /* Score badge */
        .score-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #a855f722; color: #c084fc; }

        /* Camera modal */
        .modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 3000; align-items: center; justify-content: center; }
        .modal-overlay.show { display: flex; }
        .modal { background: #1a1d27; border: 1px solid #2a2d3a; border-radius: 10px; padding: 24px; width: 460px; max-width: 90vw; }
        .modal h2 { font-size: 15px; color: #c084fc; margin-bottom: 16px; }
        .modal label { font-size: 12px; color: #94a3b8; display: block; margin-bottom: 4px; margin-top: 10px; }
        .modal input, .modal select { width: 100%; padding: 6px 10px; background: #0f1117; border: 1px solid #333; border-radius: 4px; color: #ccc; font-size: 12px; outline: none; }
        .modal input:focus { border-color: #c084fc; }
        .modal-actions { display: flex; gap: 8px; margin-top: 16px; justify-content: flex-end; }
        .modal-btn { padding: 6px 16px; border-radius: 4px; cursor: pointer; font-size: 12px; border: 1px solid #333; background: transparent; color: #ccc; }
        .modal-btn:hover { border-color: #c084fc; color: #fff; }
        .modal-btn.primary { background: #a855f733; border-color: #c084fc; color: #c084fc; }
        .modal-btn.primary:hover { background: #a855f755; }
        .cam-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
        .cam-status.connected { background: #00ff8822; color: #00ff88; }
        .cam-status.disconnected { background: #ff333322; color: #ff3333; }
        .cam-live-bar { display: none; background: #ff444418; border: 1px solid #ff444444; border-radius: 4px; padding: 2px 10px; align-items: center; gap: 6px; font-size: 11px; }
        .cam-live-bar.show { display: flex; }
        .cam-live-dot { width: 8px; height: 8px; border-radius: 50%; background: #ff4444; animation: blink 1s infinite; }
        @keyframes blink { 50% { opacity: 0.3; } }

        /* Scrollbar */
        ::-webkit-scrollbar { width: 4px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: #333; border-radius: 2px; }

        /* Responsive: the three-column workbench collapses before the document
           is ever allowed to scroll sideways. */
        @media (max-width: 1024px) {
            .app { grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr auto auto; }
            .app > div:nth-of-type(4) { grid-column: 1 / -1; max-height: 240px; overflow: auto; }
        }
        @media (max-width: 760px) {
            body { overflow: auto; height: auto; }
            .app {
                grid-template-columns: 1fr;
                grid-template-rows: none;
                grid-auto-rows: auto;
                height: auto;
                min-height: calc(100vh - 36px);
            }
            .app > div:nth-of-type(2) { max-height: 200px; overflow: auto; }
            .app > div:nth-of-type(3) { min-height: 55vh; }
            .app > div:nth-of-type(4) { max-height: none; }
            .header { flex-wrap: wrap; gap: 6px; padding: 8px 12px; }
            .header-stats { flex-wrap: wrap; gap: 12px; }
        }
        .nav-bar { overflow-x: auto; }
        .toolbar { overflow-x: auto; }
