        /* --- CSS RESET & VARIABLES --- */
        :root {
            --bg-dark: #0e0e10;
            /* Main Window Background */
            --bg-panel: #151518;
            /* Sidebars/Panels */
            --bg-activity: #1e1e20;
            /* Activity Bar (Leftmost) */
            --bg-editor: #0e0e10;
            /* Editor Background */
            --border: #2b2b2e;
            /* Borders */
            --accent: #007acc;
            /* VS Code Blue */
            --accent-hover: #0062a3;
            --text-main: #e2e8f0;
            /* Primary Text */
            --text-muted: #85858a;
            /* Secondary Text */
            --terminal-bg: #151518;
            --success: #89d185;
            --error: #f48771;

            --font-ui: 'Inter', system-ui, sans-serif;
            --font-code: 'JetBrains Mono', monospace;

            --title-bar-height: 42px;
            --header-height: 35px;
            /* Workspace header */
            --status-height: 22px;
            --sidebar-width: 250px;
            --activity-width: 48px;

            /* Default Dark Mode additions */
            --bg-titlebar: #1e1e1e;
            --list-hover: #2a2d2e;
            --list-active: #37373d;
            --list-active-fg: #fff;
            --bg-tab-inactive: #2d2d2d;
            --tab-border-right: #1e1e1e;
            /* Match titlebar or dark bg */
            --tab-close-hover: #4b4b4b;
            --tab-active-bg: #18181c;
            --tab-hover-bg: #34343a;
            --tab-text-active: #f4f7fb;
            --tab-pill-border: #303038;
            --tab-shadow: rgba(0, 0, 0, 0.26);
            --toolbar-chip-bg: #202027;
            --toolbar-chip-hover: #2c2c35;
            --toolbar-chip-border: #33333d;
            --toolbar-run-bg: linear-gradient(135deg, #1f9d64 0%, #147d52 100%);
            --toolbar-run-hover: linear-gradient(135deg, #27b06f 0%, #17915d 100%);
            --panel-header-bg: linear-gradient(180deg, #1a1a20 0%, #141419 100%);
            --panel-header-border: #24242d;
            --panel-chip-bg: #1b1b23;
            --panel-chip-border: #30303a;
            --panel-chip-text: #bdc5d0;
            --brand-pill-bg: #171a1f;
            --brand-pill-border: #2d3540;
            --brand-pill-text: #99a9be;
            --header-center-bg: rgba(18, 21, 27, 0.86);
            --header-center-border: #2a323d;
            --header-center-text: #d8e2f0;
            --header-subtle: #6f7f92;
            --input-bg: #3c3c3c;
            --input-fg: #cccccc;
            --button-bg: #0e639c;
            --button-fg: #ffffff;
            --modal-bg: #252526;
            --modal-border: #454545;
            --btn-sec-bg: #3c3c3c;
            --btn-sec-fg: #cccccc;
        }

        /* --- LIGHT THEME OVERRIDES --- */
        [data-theme="light"] {
            --bg-dark: #f3f3f3;
            /* Main Window Background */
            --bg-panel: #f3f3f3;
            /* Sidebars/Panels */
            --bg-activity: #e8e8e8;
            /* Activity Bar */
            --bg-editor: #ffffff;
            /* Editor Background */
            --border: #e5e5e5;
            /* Borders */
            --accent: #007acc;
            /* VS Code Blue */
            --accent-hover: #0062a3;
            --text-main: #3b3b3b;
            /* Primary Text */
            --text-muted: #6f6f6f;
            /* Secondary Text */
            --terminal-bg: #ffffff;

            --bg-titlebar: #dddddd;
            --list-hover: #e4e6f1;
            --list-active: #d6ebff;
            /* A generic light blue selection */
            --list-active-fg: #333;
            --bg-tab-inactive: #ececec;
            --tab-border-right: #e5e5e5;
            --tab-close-hover: #d0d0d0;
            --tab-active-bg: #ffffff;
            --tab-hover-bg: #e2e8f2;
            --tab-text-active: #222a35;
            --tab-pill-border: #d8dde6;
            --tab-shadow: rgba(21, 31, 52, 0.08);
            --toolbar-chip-bg: #eef2f7;
            --toolbar-chip-hover: #e3e9f2;
            --toolbar-chip-border: #d7dee9;
            --toolbar-run-bg: linear-gradient(135deg, #24925d 0%, #147847 100%);
            --toolbar-run-hover: linear-gradient(135deg, #2da76a 0%, #198856 100%);
            --panel-header-bg: linear-gradient(180deg, #f6f8fb 0%, #eef2f7 100%);
            --panel-header-border: #d8dee8;
            --panel-chip-bg: #ffffff;
            --panel-chip-border: #d7dee9;
            --panel-chip-text: #566173;
            --brand-pill-bg: #f4f7fb;
            --brand-pill-border: #d5ddea;
            --brand-pill-text: #5d6c7f;
            --header-center-bg: rgba(255, 255, 255, 0.92);
            --header-center-border: #d6ddea;
            --header-center-text: #233042;
            --header-subtle: #6c7a8f;
            --input-bg: #ffffff;
            --input-fg: #333333;
            --button-bg: #007acc;
            --button-fg: #ffffff;
            --modal-bg: #ffffff;
            --modal-border: #cecece;
            --btn-sec-bg: #e0e0e0;
            --btn-sec-fg: #333333;
            --success: #388a34;
            --error: #e51400;
        }

        /* --- TITLE BAR --- */
        .title-bar {
            height: var(--title-bar-height);
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%),
                linear-gradient(180deg, color-mix(in srgb, var(--bg-titlebar) 96%, #ffffff 1%) 0%, var(--bg-titlebar) 100%);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 0 16px 0 12px;
            font-size: 13px;
            color: var(--text-muted);
            user-select: none;
            -webkit-app-region: drag;
            /* Electron support if needed */
            flex-shrink: 0;
            position: relative;
            border-bottom: 1px solid #111;
        }

        .title-bar::after {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 2px;
            background: linear-gradient(90deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 58%, #4fe3ff 24%) 18%, transparent 52%);
            pointer-events: none;
            animation: headerScan 6s linear infinite;
            transform-origin: left center;
        }

        @keyframes headerScan {
            0% { opacity: 0.72; transform: scaleX(0.45); }
            50% { opacity: 1; transform: scaleX(0.88); }
            100% { opacity: 0.72; transform: scaleX(0.45); }
        }

        .title-bar-left,
        .title-bar-center,
        .title-bar-right {
            display: flex;
            align-items: center;
            min-width: 0;
        }

        .title-bar-left {
            gap: 12px;
            flex: 0 0 auto;
        }

        .title-bar-center {
            flex: 1 1 auto;
            max-width: 560px;
            margin: 0 auto;
            justify-content: center;
            gap: 10px;
            height: 30px;
            padding: 0 14px;
            border: 1px solid var(--header-center-border);
            background: var(--header-center-bg);
            border-radius: 10px;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.04),
                0 8px 24px -20px rgba(0, 0, 0, 0.55);
            backdrop-filter: blur(10px);
        }

        .title-bar-right {
            gap: 10px;
            flex: 0 0 auto;
        }

        .title-text {
            font-weight: 700;
            font-size: 17px;
            letter-spacing: 0.01em;
            color: var(--text-main);
        }

        .app-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            color: #007acc;
            width: 26px;
            height: 26px;
            flex-shrink: 0;
            position: relative;
        }

        .app-icon::before {
            content: '';
            position: absolute;
            inset: 1px;
            border-radius: 7px;
            background: linear-gradient(135deg, rgba(0, 122, 204, 0.22) 0%, rgba(79, 227, 255, 0.08) 100%);
            border: 1px solid rgba(0, 122, 204, 0.22);
        }

        .app-icon svg {
            position: relative;
            z-index: 1;
            width: 15px;
            height: 15px;
        }

        .brand-lockup {
            display: flex;
            flex-direction: column;
            justify-content: center;
            min-width: 0;
            line-height: 1.04;
        }

        .brand-subtitle {
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--header-subtle);
            margin-top: 4px;
        }

        .brand-pill {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            height: 26px;
            padding: 0 10px;
            border-radius: 8px;
            border: 1px solid var(--brand-pill-border);
            background: var(--brand-pill-bg);
            color: var(--brand-pill-text);
            font-size: 9px;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            white-space: nowrap;
            flex-shrink: 0;
            position: relative;
        }

        .brand-pill::before {
            content: '';
            width: 6px;
            height: 6px;
            border-radius: 999px;
            background: #2ec27e;
            box-shadow: 0 0 10px rgba(46, 194, 126, 0.7);
            margin-right: 8px;
            animation: livePulse 1.8s ease-in-out infinite;
        }

        @keyframes livePulse {
            0%, 100% { opacity: 0.55; transform: scale(0.92); }
            50% { opacity: 1; transform: scale(1.1); }
        }

        .live-indicator {
            width: 7px;
            height: 7px;
            border-radius: 999px;
            background: linear-gradient(180deg, #4fe3ff 0%, #1ea2ff 100%);
            box-shadow: 0 0 14px rgba(30, 162, 255, 0.7);
            flex: 0 0 auto;
            animation: livePulse 2.2s ease-in-out infinite;
        }

        .header-active-file {
            color: var(--header-center-text);
            font-size: 12px;
            font-weight: 600;
            letter-spacing: 0.02em;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .copyright-header {
            flex-shrink: 0;
            color: color-mix(in srgb, var(--text-muted) 72%, transparent);
            font-size: 10px;
            letter-spacing: 0.08em;
            text-transform: uppercase;
        }

        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0;
        }

        body {
            background-color: var(--bg-dark);
            color: var(--text-main);
            font-family: var(--font-ui);
            height: 100vh;
            width: 100vw;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }

        /* --- LAYOUT GRID --- */
        .workspace {
            display: flex;
            flex: 1;
            height: calc(100vh - var(--status-height) - var(--title-bar-height));
            overflow: hidden;
        }

        /* --- ACTIVITY BAR (Leftmost) --- */
        .activity-bar {
            width: var(--activity-width);
            background:
                linear-gradient(180deg, rgba(13, 17, 25, 0.96), rgba(8, 11, 17, 0.98));
            border-right: 1px solid rgba(98, 114, 140, 0.24);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 10px 0 12px;
            gap: 4px;
            flex-shrink: 0;
            position: relative;
            box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
        }

        .activity-bar::before {
            content: '';
            position: absolute;
            inset: 0 auto 0 0;
            width: 1px;
            background: linear-gradient(180deg, rgba(0, 163, 255, 0.6), rgba(0, 163, 255, 0));
            opacity: 0.7;
        }

        .activity-icon {
            width: 42px;
            height: 42px;
            display: flex;
            justify-content: center;
            align-items: center;
            cursor: pointer;
            opacity: 0.72;
            transition: transform 0.18s ease, opacity 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
            border-left: 2px solid transparent;
            border-radius: 12px;
            background: transparent;
            border: 1px solid transparent;
        }

        .activity-icon.active {
            opacity: 1;
            border-left-color: transparent;
            border-color: rgba(53, 134, 255, 0.34);
            background: linear-gradient(180deg, rgba(18, 29, 45, 0.96), rgba(11, 18, 28, 0.96));
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03), 0 0 0 1px rgba(0, 163, 255, 0.06);
        }

        .activity-icon:hover {
            opacity: 1;
            transform: translateY(-1px);
        }

        .activity-icon svg {
            width: 20px;
            height: 20px;
            fill: var(--text-muted);
        }

        .activity-icon.active svg {
            fill: #d7e7ff;
        }

        /* --- SIDEBAR (Explorer) --- */
        .sidebar {
            width: var(--sidebar-width);
            background:
                radial-gradient(circle at top left, rgba(21, 32, 49, 0.85), transparent 34%),
                linear-gradient(180deg, rgba(16, 19, 27, 0.98), rgba(11, 14, 20, 0.99));
            border-right: 1px solid rgba(98, 114, 140, 0.2);
            display: flex;
            flex-direction: column;
            transition: width 0.1s ease;
            flex-shrink: 0;
            position: relative;
            box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.03);
        }

        .sidebar::before {
            content: '';
            position: absolute;
            inset: 0 0 auto 0;
            height: 1px;
            background: linear-gradient(90deg, rgba(0, 163, 255, 0.55), rgba(0, 163, 255, 0));
            opacity: 0.65;
            pointer-events: none;
        }

        .sidebar-header {
            min-height: 48px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 14px 0 16px;
            font-size: 11px;
            font-weight: 700;
            color: rgba(190, 203, 225, 0.78);
            text-transform: uppercase;
            letter-spacing: 0.14em;
            border-bottom: 1px solid rgba(98, 114, 140, 0.14);
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(255, 255, 255, 0));
        }

        .sidebar-section-title {
            min-height: 42px;
            padding: 0 12px 0 16px;
            font-weight: 700;
            font-size: 11px;
            text-transform: uppercase;
            letter-spacing: 0.12em;
            color: rgba(227, 235, 246, 0.96);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            border-bottom: 1px solid rgba(98, 114, 140, 0.1);
        }

        .sidebar-actions {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            padding: 4px;
            border-radius: 12px;
            background: rgba(255, 255, 255, 0.02);
            border: 1px solid rgba(98, 114, 140, 0.16);
        }

        .sidebar-tool-btn {
            width: 26px;
            height: 26px;
            border-radius: 8px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: rgba(210, 220, 237, 0.82);
            background: transparent;
            border: 1px solid transparent;
            transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
        }

        .sidebar-tool-btn:hover {
            color: #eef6ff;
            background: rgba(31, 42, 59, 0.92);
            border-color: rgba(78, 121, 196, 0.3);
            transform: translateY(-1px);
        }

        .sidebar-collapse-btn {
            margin-left: auto;
        }

        #file-list {
            padding: 10px 8px 14px;
            overflow: auto;
        }

        .sidebar-item {
            min-height: 34px;
            margin: 2px 6px;
            padding: 7px 12px;
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            color: rgba(223, 231, 243, 0.9);
            display: flex;
            align-items: center;
            gap: 8px;
            overflow: hidden;
            border-radius: 12px;
            position: relative;
            border: 1px solid transparent;
            transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
        }

        .sidebar-item::before {
            content: '';
            position: absolute;
            inset: 5px auto 5px 0;
            width: 2px;
            border-radius: 999px;
            background: transparent;
            transition: background-color 0.18s ease;
        }

        .sidebar-item:hover {
            background: linear-gradient(180deg, rgba(24, 31, 43, 0.96), rgba(17, 23, 33, 0.96));
            border-color: rgba(78, 121, 196, 0.14);
            color: #f5f9ff;
        }

        .sidebar-item.active {
            background: linear-gradient(180deg, rgba(17, 38, 63, 0.98), rgba(12, 28, 48, 0.98));
            border-color: rgba(62, 139, 255, 0.32);
            color: #f7fbff;
            box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025), 0 0 0 1px rgba(0, 163, 255, 0.04);
        }

        .sidebar-item.active::before {
            background: linear-gradient(180deg, #19b8ff, #1d6bff);
        }

        .sidebar-item.selected-folder {
            background: linear-gradient(180deg, rgba(23, 28, 38, 0.96), rgba(16, 20, 29, 0.96));
            border-color: rgba(88, 115, 158, 0.22);
        }

        .sidebar-item.selected-folder::before {
            background: rgba(104, 145, 255, 0.6);
        }

        .sidebar-item[data-node-kind="folder"] {
            font-weight: 600;
            color: rgba(229, 235, 245, 0.94);
        }

        .sidebar-item[data-node-kind="folder"] .file-icon {
            opacity: 1;
        }

        #view-explorer,
        #view-search,
        #view-source-control,
        #view-shortcuts {
            display: flex;
            flex-direction: column;
            min-height: 0;
        }

        .sidebar-item[draggable="true"] {
            cursor: pointer;
        }

        .shortcut-docs {
            padding: 10px 14px;
            display: flex;
            flex-direction: column;
            gap: 8px;
        }

        .shortcut-row {
            display: flex;
            flex-direction: column;
            gap: 4px;
            padding: 8px 10px;
            border: 1px solid var(--border);
            border-radius: 6px;
            background: var(--bg-editor);
        }

        .shortcut-key {
            font-family: var(--font-code);
            font-size: 12px;
            color: var(--text-main);
        }

        .shortcut-desc {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* --- MAIN EDITOR AREA --- */
        .editor-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            min-width: 0;
            /* Fix flex overflow */
            background:
                radial-gradient(circle at top center, rgba(24, 38, 58, 0.18), transparent 28%),
                linear-gradient(180deg, rgba(12, 16, 23, 0.98), rgba(9, 12, 18, 1));
            position: relative;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
        }

        .editor-container::before {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 18%),
                radial-gradient(circle at top right, rgba(0, 163, 255, 0.05), transparent 26%);
            opacity: 0.9;
        }

        /* Tabs Header */
        .tabs-header {
            min-height: 46px;
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0)),
                linear-gradient(180deg, color-mix(in srgb, var(--bg-titlebar) 72%, transparent) 0%, transparent 100%),
                linear-gradient(180deg, rgba(15, 19, 27, 0.98), rgba(11, 14, 21, 0.98));
            display: flex;
            align-items: center;
            border-bottom: 1px solid color-mix(in srgb, var(--border) 86%, rgba(255, 255, 255, 0.05));
            overflow: hidden;
            padding: 0 8px 0 0;
            position: relative;
            z-index: 1;
            box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.02);
        }

        .tabs-strip {
            display: flex;
            align-items: center;
            min-width: 0;
            flex: 1;
            overflow-x: auto;
            background: transparent;
            gap: 7px;
            padding: 8px 10px 5px;
            scrollbar-width: none;
        }

        .tabs-strip::-webkit-scrollbar {
            display: none;
        }

        .tab {
            height: 28px;
            background:
                linear-gradient(180deg, color-mix(in srgb, var(--bg-tab-inactive) 80%, #ffffff 3%) 0%, color-mix(in srgb, var(--bg-tab-inactive) 94%, black 3%) 100%);
            color: rgba(195, 204, 219, 0.78);
            padding: 0 11px 0 13px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 12px;
            font-weight: 550;
            border: 1px solid color-mix(in srgb, var(--tab-pill-border) 88%, transparent);
            border-radius: 10px 10px 0 0;
            cursor: pointer;
            min-width: 104px;
            max-width: 210px;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.035),
                0 1px 0 rgba(0, 0, 0, 0.18);
            transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
            position: relative;
        }

        .tab:hover {
            background-color: var(--tab-hover-bg);
            color: var(--text-main);
            transform: translateY(-1px);
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.06),
                0 6px 12px -10px var(--tab-shadow);
        }

        .tab span:not(.tab-close):not(.tab-dirty-dot) {
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .tab-dirty-dot {
            color: #ffcc66;
            font-size: 10px;
            flex: 0 0 auto;
            opacity: 0.95;
        }

        .tab.active {
            background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, var(--tab-active-bg)) 0%, var(--tab-active-bg) 62%);
            color: var(--tab-text-active);
            border-color: color-mix(in srgb, var(--accent) 42%, var(--tab-pill-border));
            box-shadow:
                inset 0 2px 0 var(--accent),
                0 10px 18px -15px var(--tab-shadow);
            transform: translateY(0);
        }

        .tab.active::after {
            content: '';
            position: absolute;
            left: 12px;
            right: 12px;
            bottom: -1px;
            height: 2px;
            background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--accent) 80%, white 8%) 16%, color-mix(in srgb, var(--accent) 55%, transparent) 84%, transparent 100%);
            border-radius: 999px;
        }

        .tab-close {
            width: 18px;
            height: 18px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            font-weight: 500;
            line-height: 1;
            border-radius: 999px;
            padding: 0;
            flex-shrink: 0;
            color: var(--text-muted);
            opacity: 0;
            transition: opacity 0.12s ease, background-color 0.12s ease, color 0.12s ease;
        }

        .tab:hover .tab-close,
        .tab.active .tab-close {
            opacity: 1;
        }

        .tab-close:hover {
            background-color: var(--tab-close-hover);
            color: var(--text-main);
        }

        /* --- NOTES PANEL (Right Dock) --- */
        /* --- NOTES PANEL (Right Dock) --- */
        #notes-panel {
            width: 320px;
            /* Fixed width as requested */
            height: 100%;
            /* Full height of workspace */
            background-color: var(--bg-panel);
            border-left: 1px solid var(--border);
            display: none;
            /* Toggled via JS */
            flex-direction: column;
            flex-shrink: 0;
            z-index: 20;
            position: relative;
            /* Ensure it stays in flow */
        }

        #note-selector {
            background-color: var(--bg-panel);
            /* Ensure background matches panel */
            color: var(--text-main);
            border: 1px solid transparent;
            /* Subtle border on hover could be nice, or keep none */
            font-family: inherit;
            font-size: 11px;
            font-weight: 600;
            outline: none;
            cursor: pointer;
            max-width: 180px;
            padding: 2px 4px;
            border-radius: 3px;
        }

        #note-selector:hover {
            background-color: var(--bg-activity);
            /* Slight highlight on hover */
        }

        #note-selector option {
            background-color: var(--bg-panel);
            color: var(--text-main);
            padding: 4px;
        }

        #notes-content {
            flex: 1;
            width: 100%;
            border: none;
            outline: none;
            padding: 15px;
            background: var(--bg-editor);
            color: var(--text-main);
            font-family: var(--font-code);
            font-size: 13px;
            resize: none;
            line-height: 1.5;
        }

        .notes-content-editor:empty:before {
            content: attr(data-placeholder);
            color: var(--text-muted);
            pointer-events: none;
        }

        .notes-content-editor h1,
        .notes-content-editor h2,
        .notes-content-editor h3 {
            margin: 10px 0 6px;
        }

        .notes-content-editor ul {
            margin: 6px 0;
            padding-left: 20px;
            list-style-position: inside;
        }

        .notes-content-editor pre {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 4px;
            padding: 8px;
            white-space: pre-wrap;
        }

        .notes-toolbar {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            padding: 8px 10px;
            border-bottom: 1px solid var(--border);
            background: var(--bg-panel);
        }

        .notes-tool-btn {
            border: 1px solid var(--border);
            background: var(--input-bg);
            color: var(--text-main);
            font-size: 11px;
            line-height: 1;
            padding: 5px 8px;
            border-radius: 4px;
            cursor: pointer;
        }

        .notes-tool-btn:hover {
            border-color: var(--accent);
        }

        .notes-tool-btn.active {
            background: var(--accent);
            color: #fff;
            border-color: var(--accent);
        }

        .notes-preview {
            flex: 1;
            width: 100%;
            padding: 15px;
            overflow-y: auto;
            background: var(--bg-editor);
            color: var(--text-main);
            font-family: var(--font-code);
            font-size: 13px;
            line-height: 1.6;
            white-space: pre-wrap;
            word-break: break-word;
        }

        .notes-preview h1,
        .notes-preview h2,
        .notes-preview h3 {
            margin: 10px 0 6px;
            color: var(--text-main);
        }

        .notes-preview ul,
        .notes-preview ol {
            margin: 6px 0;
            padding-left: 20px;
            list-style-position: inside;
        }

        .notes-preview li {
            margin: 2px 0;
        }

        .notes-preview code {
            background: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 3px;
            padding: 1px 4px;
        }

        .notes-footer {
            height: 26px;
            min-height: 26px;
            border-top: 1px solid var(--border);
            padding: 0 10px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: var(--text-muted);
            font-size: 11px;
            background: var(--bg-panel);
        }

        /* Context Menu (Generic) */
        .context-menu {
            background-color: var(--bg-panel);
            border: 1px solid var(--border);
            border-radius: 4px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
            display: flex;
            flex-direction: column;
            /* Ensure vertical list */
            padding: 6px 0;
            min-width: 160px;
            /* Prevent crowding */
        }

        .menu-item {
            padding: 8px 12px;
            font-size: 12px;
            cursor: pointer;
            color: var(--text-main);
            display: block;
            text-align: left;
            white-space: nowrap;
            /* Prevent awkward wrapping */
        }

        .menu-item:hover {
            background-color: var(--bg-activity);
        }

        .menu-item.delete {
            color: #d9534f;
        }

        .menu-separator {
            height: 1px;
            background-color: var(--border);
            margin: 4px 0;
        }



        /* Adjust Main Grid to accommodate Notes panel */
        /* Currently .editor-container has flex:1 which is good. */

        .toolbar-actions {
            margin-left: auto;
            padding-right: 8px;
            display: flex;
            align-items: center;
            gap: 8px;
            padding-left: 12px;
            background: linear-gradient(90deg, transparent 0%, color-mix(in srgb, var(--bg-panel) 92%, black 8%) 16%);
        }

        .toolbar-group {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 3px;
            border: 1px solid color-mix(in srgb, var(--toolbar-chip-border) 92%, transparent);
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), color-mix(in srgb, var(--bg-panel) 88%, black 12%));
            border-radius: 12px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
        }

        .toolbar-group-run {
            border-color: color-mix(in srgb, var(--accent) 16%, var(--toolbar-chip-border));
        }

        .command-btn {
            background: transparent;
            border: 1px solid transparent;
            color: var(--text-muted);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            padding: 0;
            border-radius: 9px;
            transition: background 0.2s, border-color 0.2s, transform 0.2s, color 0.2s;
        }

        .command-btn:hover {
            background: color-mix(in srgb, var(--accent) 8%, var(--toolbar-chip-bg));
            border-color: color-mix(in srgb, var(--accent) 20%, var(--toolbar-chip-border));
            color: var(--text-main);
            transform: translateY(-1px);
        }

        .command-btn svg {
            width: 14px;
            height: 14px;
            fill: currentColor;
            stroke: currentColor;
        }

        .run-btn {
            background: var(--toolbar-run-bg);
            border: 1px solid transparent;
            color: #f5fff8;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            min-width: 74px;
            height: 28px;
            padding: 0 12px;
            border-radius: 9px;
            transition: background 0.2s, border-color 0.2s, transform 0.2s, box-shadow 0.2s, color 0.2s;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.08),
                0 10px 20px -16px rgba(20, 125, 82, 0.9);
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.02em;
        }

        .run-btn:hover {
            background: var(--toolbar-run-hover);
            transform: translateY(-1px);
            box-shadow: 0 14px 28px -18px rgba(20, 125, 82, 0.95);
        }

        .run-btn svg {
            width: 13px;
            height: 13px;
            fill: currentColor;
            stroke: currentColor;
        }

        .run-btn span {
            line-height: 1;
        }

        /* Monaco Editor Wrapper */
        .editor-workspace {
            display: flex;
            flex: 1;
            width: 100%;
            position: relative;
            min-height: 0;
            border-top: 1px solid rgba(255, 255, 255, 0.02);
            background:
                linear-gradient(180deg, rgba(7, 10, 16, 0.16), transparent 12%),
                linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0));
        }

        .editor-workspace::before {
            content: '';
            position: absolute;
            inset: 0;
            pointer-events: none;
            background: linear-gradient(180deg, rgba(0, 163, 255, 0.025), transparent 18%);
        }

        .editor-loader {
            display: none;
            position: absolute;
            top: 14px;
            right: 16px;
            z-index: 99;
            background: linear-gradient(180deg, rgba(24, 31, 43, 0.96), rgba(17, 22, 31, 0.96));
            padding: 7px 12px;
            border-radius: 11px;
            border: 1px solid rgba(76, 104, 153, 0.28);
            font-size: 11px;
            font-weight: 700;
            letter-spacing: 0.06em;
            color: #dbe9fb;
            text-transform: uppercase;
            box-shadow: 0 16px 30px -26px rgba(0, 0, 0, 0.8);
        }

        #editor {
            flex: 1;
            width: 100%;
            height: 100%;
            /* Important for Monaco */
            overflow: hidden;
            position: relative;
            z-index: 1;
        }

        .editor-split-pane {
            flex: 1;
            border-left: 1px solid rgba(92, 110, 141, 0.22);
            position: relative;
            z-index: 1;
        }

        .ace_editor {
            background: transparent !important;
            color: #d9e4f2 !important;
        }

        .ace_gutter {
            background: linear-gradient(180deg, rgba(14, 18, 25, 0.96), rgba(10, 13, 19, 0.96)) !important;
            color: rgba(128, 143, 167, 0.88) !important;
            border-right: 1px solid rgba(83, 96, 119, 0.22) !important;
            box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.025);
        }

        .ace_gutter-active-line {
            background: linear-gradient(90deg, rgba(20, 31, 48, 0.94), rgba(14, 20, 31, 0.94)) !important;
        }

        .ace_active-line,
        .ace_marker-layer .ace_active-line {
            background: linear-gradient(90deg, rgba(17, 31, 51, 0.62), rgba(12, 19, 30, 0.22) 72%, transparent) !important;
        }

        .ace_marker-layer .ace_selection {
            background: rgba(35, 101, 191, 0.32) !important;
            border: 1px solid rgba(89, 149, 233, 0.18);
        }

        .ace_marker-layer .ace_selected-word {
            border: 1px solid rgba(78, 152, 255, 0.28) !important;
            box-shadow: inset 0 0 0 1px rgba(78, 152, 255, 0.08);
        }

        .ace_indent-guide {
            background: linear-gradient(to bottom, rgba(93, 105, 127, 0.16) 0%, rgba(93, 105, 127, 0.16) 55%, transparent 55%, transparent 100%) right repeat-y !important;
        }

        .ace_cursor {
            color: #6fd4ff !important;
            border-left: 2px solid #6fd4ff !important;
            box-shadow: 0 0 10px rgba(69, 193, 255, 0.2);
        }

        .ace_scroller {
            background: transparent !important;
        }

        .ace_print-margin {
            width: 1px !important;
            background: rgba(79, 91, 112, 0.16) !important;
        }

        .ace_gutter-cell {
            padding-left: 12px !important;
            padding-right: 12px !important;
        }

        .ace_line {
            text-rendering: geometricPrecision;
        }

        .empty-state-card {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: min(620px, calc(100% - 48px));
            border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%),
                linear-gradient(135deg, color-mix(in srgb, var(--bg-panel) 94%, #0b1118 6%) 0%, color-mix(in srgb, var(--bg-panel) 98%, black 2%) 100%);
            border-radius: 18px;
            padding: 28px 28px 22px;
            text-align: left;
            z-index: 5;
            box-shadow:
                0 30px 60px -42px rgba(0, 0, 0, 0.7),
                inset 0 1px 0 rgba(255, 255, 255, 0.04);
            overflow: hidden;
        }

        .empty-state-card::before {
            content: '';
            position: absolute;
            inset: 0;
            background:
                radial-gradient(circle at top right, rgba(79, 227, 255, 0.08), transparent 34%),
                radial-gradient(circle at bottom left, rgba(0, 122, 204, 0.12), transparent 30%);
            pointer-events: none;
        }

        .empty-state-eyebrow,
        .empty-state-title,
        .empty-state-text,
        .empty-state-highlights,
        .empty-state-actions,
        .empty-state-footer {
            position: relative;
            z-index: 1;
        }

        .empty-state-eyebrow {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.16em;
            text-transform: uppercase;
            color: var(--header-subtle);
        }

        .empty-state-eyebrow::before {
            content: '';
            width: 8px;
            height: 8px;
            border-radius: 999px;
            background: linear-gradient(180deg, #4fe3ff 0%, #1ea2ff 100%);
            box-shadow: 0 0 12px rgba(30, 162, 255, 0.6);
        }

        .empty-state-title {
            margin-top: 14px;
            font-size: 30px;
            line-height: 1.08;
            font-weight: 700;
            letter-spacing: -0.03em;
            color: var(--text-main);
        }

        .empty-state-text {
            margin-top: 14px;
            max-width: 540px;
            font-size: 14px;
            line-height: 1.6;
            color: color-mix(in srgb, var(--text-muted) 88%, white 4%);
        }

        .empty-state-highlights {
            margin-top: 22px;
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 12px;
        }

        .empty-highlight {
            display: flex;
            flex-direction: column;
            gap: 6px;
            padding: 14px 15px;
            border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
            border-radius: 14px;
            background: color-mix(in srgb, var(--bg-panel) 92%, black 8%);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
        }

        .empty-highlight-label {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--header-subtle);
        }

        .empty-highlight-value {
            font-size: 16px;
            font-weight: 600;
            color: var(--text-main);
        }

        .empty-state-actions {
            margin-top: 22px;
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
        }

        .empty-state-actions .btn {
            min-height: 38px;
            border-radius: 12px;
            padding: 0 16px;
            font-weight: 600;
        }

        .empty-state-footer {
            margin-top: 18px;
            font-size: 12px;
            line-height: 1.5;
            color: color-mix(in srgb, var(--text-muted) 82%, white 3%);
        }

        .sidebar-empty-state {
            padding: 14px 18px;
            margin: 8px 12px;
            border: 1px dashed var(--border);
            border-radius: 6px;
            color: var(--text-muted);
            font-size: 12px;
            text-align: center;
            line-height: 1.4;
        }

        /* --- TERMINAL (Bottom Panel) --- */
        .terminal-panel {
            height: 350px;
            /* Increased height */
            flex-shrink: 0;
            /* Prevent shrinking */
            border-top: 1px solid var(--border);
            background-color: var(--terminal-bg);
            display: flex;
            flex-direction: column;
            overflow: hidden;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.02),
                0 -20px 40px -38px rgba(0, 0, 0, 0.8);
        }

        .terminal-shell {
            height: 100%;
            display: flex;
            flex-direction: column;
            padding: 10px 12px 12px;
            background:
                radial-gradient(circle at top right, rgba(79, 227, 255, 0.05), transparent 24%),
                linear-gradient(180deg, color-mix(in srgb, var(--terminal-bg) 94%, #0b1118 6%) 0%, color-mix(in srgb, var(--terminal-bg) 99%, black 1%) 100%);
        }

        .terminal-shell-topline {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            padding: 0 2px 8px;
        }

        .terminal-shell-label {
            font-size: 10px;
            font-weight: 700;
            letter-spacing: 0.14em;
            text-transform: uppercase;
            color: var(--header-subtle);
        }

        .terminal-shell-meta {
            font-size: 11px;
            color: color-mix(in srgb, var(--text-muted) 78%, white 4%);
            font-variant-numeric: tabular-nums;
        }

        #xterm-container {
            flex: 1;
            padding: 12px 14px 10px;
            width: 100%;
            height: 100%;
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, transparent 100%),
                color-mix(in srgb, var(--terminal-bg) 96%, black 4%);
            border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--border));
            border-radius: 16px;
            box-shadow:
                inset 0 1px 0 rgba(255, 255, 255, 0.03),
                inset 0 0 0 1px rgba(255, 255, 255, 0.01);
        }

        /* Hide scrollbar for xterm container if needed, xterm handles its own */
        .xterm-viewport::-webkit-scrollbar {
            width: 10px;
        }

        .panel-header {
            min-height: 44px;
            display: flex;
            justify-content: space-between;
            gap: 14px;
            padding: 0 14px;
            border-bottom: 1px solid var(--panel-header-border);
            align-items: center;
            background: var(--panel-header-bg);
        }

        .panel-header-left,
        .panel-header-right {
            display: flex;
            align-items: center;
        }

        .panel-header-left {
            gap: 18px;
            min-width: 0;
        }

        .panel-header-right {
            gap: 8px;
            flex-wrap: wrap;
            justify-content: flex-end;
        }

        .panel-tab {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.08em;
            cursor: pointer;
            height: 100%;
            display: flex;
            align-items: center;
            border-bottom: 2px solid transparent;
            padding-top: 1px;
        }

        .panel-tab.active {
            color: var(--text-main);
            border-bottom-color: var(--accent);
        }

        .run-badge {
            border: 1px solid var(--panel-chip-border);
            border-radius: 999px;
            padding: 5px 10px;
            font-size: 10px;
            font-weight: 600;
            letter-spacing: 0.02em;
            color: var(--panel-chip-text);
            background: var(--panel-chip-bg);
            white-space: nowrap;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
        }

        .run-badge.success {
            border-color: color-mix(in srgb, var(--success) 40%, var(--panel-chip-border));
            color: color-mix(in srgb, var(--success) 82%, white 8%);
            background: color-mix(in srgb, var(--success) 10%, var(--panel-chip-bg));
        }

        .run-badge.error {
            border-color: color-mix(in srgb, var(--error) 36%, var(--panel-chip-border));
            color: color-mix(in srgb, var(--error) 85%, white 6%);
            background: color-mix(in srgb, var(--error) 10%, var(--panel-chip-bg));
        }

        #run-badge-phase {
            min-width: 120px;
            text-align: center;
        }

        #interactive-status {
            min-width: 110px;
            text-align: center;
        }

        .panel-action-btn {
            border: 1px solid var(--panel-chip-border);
            background: var(--panel-chip-bg);
            color: var(--text-main);
            height: 30px;
            padding: 0 12px;
            border-radius: 999px;
            font-size: 11px;
            font-weight: 600;
            cursor: pointer;
            transition: background-color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
        }

        .panel-action-btn:hover {
            background: color-mix(in srgb, var(--accent) 10%, var(--panel-chip-bg));
            border-color: color-mix(in srgb, var(--accent) 28%, var(--panel-chip-border));
            transform: translateY(-1px);
        }

        #panel-activity {
            padding: 12px 14px !important;
            background:
                radial-gradient(circle at top right, rgba(79, 227, 255, 0.04), transparent 22%),
                linear-gradient(180deg, color-mix(in srgb, var(--terminal-bg) 94%, #0b1118 6%) 0%, color-mix(in srgb, var(--terminal-bg) 99%, black 1%) 100%) !important;
        }

        #activity-log-list {
            height: 100%;
            border: 1px solid color-mix(in srgb, var(--accent) 8%, var(--border));
            border-radius: 16px;
            background: color-mix(in srgb, var(--terminal-bg) 96%, black 4%);
            padding: 14px;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
            overflow-y: auto;
        }

        .activity-empty-state {
            min-height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            color: var(--text-muted);
            padding: 24px;
        }

        .activity-empty-title {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-main);
        }

        .activity-empty-text {
            margin-top: 8px;
            max-width: 360px;
            line-height: 1.6;
            font-size: 12px;
        }

        .activity-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid color-mix(in srgb, var(--border) 92%, transparent);
        }

        .activity-item:first-child {
            padding-top: 2px;
        }

        .activity-item:last-child {
            border-bottom: none;
            padding-bottom: 2px;
        }

        .activity-icon-chip {
            width: 28px;
            height: 28px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 9px;
            border: 1px solid color-mix(in srgb, var(--accent) 14%, var(--border));
            background: color-mix(in srgb, var(--bg-panel) 92%, black 8%);
            color: var(--header-center-text);
            font-size: 10px;
            font-weight: 800;
            letter-spacing: 0.08em;
            flex: 0 0 auto;
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
        }

        .activity-content {
            flex: 1;
            min-width: 0;
        }

        .activity-title-row {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 12px;
        }

        .activity-title {
            color: var(--text-main);
            font-size: 13px;
            font-weight: 600;
        }

        .activity-time {
            color: var(--text-muted);
            font-size: 10px;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            white-space: nowrap;
        }

        .activity-details {
            margin-top: 5px;
            color: color-mix(in srgb, var(--text-muted) 88%, white 3%);
            font-size: 12px;
            line-height: 1.55;
            word-break: break-word;
        }

        .activity-success .activity-icon-chip {
            border-color: color-mix(in srgb, var(--success) 32%, var(--border));
            color: color-mix(in srgb, var(--success) 86%, white 6%);
        }

        .activity-error .activity-icon-chip {
            border-color: color-mix(in srgb, var(--error) 32%, var(--border));
            color: color-mix(in srgb, var(--error) 86%, white 6%);
        }

        .activity-code .activity-icon-chip,
        .activity-github .activity-icon-chip {
            border-color: color-mix(in srgb, var(--accent) 26%, var(--border));
            color: color-mix(in srgb, var(--accent) 74%, white 10%);
        }

        .terminal-content {
            flex: 1;
            padding: 10px;
            font-family: var(--font-code);
            font-size: 13px;
            overflow-y: auto;
            white-space: pre-wrap;
            white-space: pre-wrap;
            /* Wrap long lines */
            color: var(--input-fg);
        }

        .terminal-line {
            margin-bottom: 2px;
        }

        .log-error {
            color: var(--error);
        }

        .log-success {
            color: var(--success);
        }

        .log-info {
            color: var(--text-muted);
            font-style: italic;
        }

        /* --- STATUS BAR --- */
        .status-bar {
            height: 28px;
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
                linear-gradient(90deg, rgba(11, 18, 30, 0.98), rgba(8, 12, 20, 0.98));
            color: #dce7f5;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 10px 0 12px;
            font-size: 11px;
            user-select: none;
            border-top: 1px solid rgba(81, 96, 118, 0.24);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
            position: relative;
            overflow: hidden;
            transition: background 0.18s ease, border-color 0.18s ease;
        }

        .status-left,
        .status-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .status-item {
            display: flex;
            align-items: center;
            gap: 6px;
            min-height: 22px;
            color: inherit;
        }

        .status-item svg {
            opacity: 0.92;
            flex-shrink: 0;
        }

        .status-item-primary {
            font-weight: 700;
            letter-spacing: 0.01em;
            padding-right: 8px;
        }

        .status-chip {
            padding: 0 8px;
            border-radius: 999px;
            border: 1px solid rgba(87, 101, 126, 0.22);
            background: rgba(255, 255, 255, 0.03);
            color: rgba(210, 221, 238, 0.88);
        }

        .status-dot {
            width: 6px;
            height: 6px;
            border-radius: 999px;
            background: #6cd89a;
            box-shadow: 0 0 10px rgba(108, 216, 154, 0.38);
            flex-shrink: 0;
        }

        .copyright-text {
            color: rgba(133, 149, 175, 0.62);
            font-size: 10px;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .shortcut-hint {
            font-size: 10px;
            letter-spacing: 0.04em;
            color: rgba(189, 202, 221, 0.74);
        }

        .status-bar.status-running {
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
                linear-gradient(90deg, rgba(41, 29, 6, 0.98), rgba(26, 18, 6, 0.98));
            border-top-color: rgba(197, 142, 33, 0.36);
        }

        .status-bar.status-running .status-dot {
            background: #f3b24c;
            box-shadow: 0 0 10px rgba(243, 178, 76, 0.4);
        }

        .status-bar.status-success {
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
                linear-gradient(90deg, rgba(10, 31, 21, 0.98), rgba(8, 21, 15, 0.98));
            border-top-color: rgba(53, 168, 113, 0.36);
        }

        .status-bar.status-success .status-dot {
            background: #4ee18f;
            box-shadow: 0 0 10px rgba(78, 225, 143, 0.4);
        }

        .status-bar.status-error {
            background:
                linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0)),
                linear-gradient(90deg, rgba(43, 16, 19, 0.98), rgba(25, 10, 12, 0.98));
            border-top-color: rgba(207, 90, 108, 0.34);
        }

        .status-bar.status-error .status-dot {
            background: #ff7a92;
            box-shadow: 0 0 10px rgba(255, 122, 146, 0.42);
        }

        .toast-container {
            position: fixed;
            right: 16px;
            bottom: 34px;
            z-index: 3000;
            display: flex;
            flex-direction: column;
            gap: 8px;
            pointer-events: none;
        }

        .toast {
            min-width: 220px;
            max-width: 340px;
            border: 1px solid var(--border);
            border-radius: 6px;
            padding: 8px 10px;
            font-size: 12px;
            color: var(--text-main);
            background: var(--bg-panel);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
            pointer-events: auto;
        }

        .toast.success {
            border-color: #3a5f3a;
        }

        .toast.error {
            border-color: #7a3e3e;
        }

        /* --- RESPONSIVENESS --- */
        @media (max-width: 768px) {
            .sidebar {
                display: none;
            }

            /* Hide sidebar on mobile */
            .activity-bar {
                width: 40px;
            }

            .copyright-header {
                display: none;
            }

            .title-bar-center {
                max-width: 300px;
            }

            .empty-state-card {
                width: calc(100% - 28px);
                padding: 22px 20px 18px;
            }

            .empty-state-title {
                font-size: 24px;
            }

            .empty-state-highlights {
                grid-template-columns: 1fr;
            }
        }

        /* --- MODAL --- */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .modal-content {
            background: var(--modal-bg);
            border: 1px solid var(--border);
            width: 400px;
            padding: 20px;
            border-radius: 5px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
        }

        .modal-header {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 15px;
            color: var(--text-main);
            display: flex;
            justify-content: space-between;
        }

        .form-group {
            margin-bottom: 15px;
        }

        .form-label {
            display: block;
            margin-bottom: 5px;
            font-size: 12px;
            color: var(--text-muted);
        }

        .form-input,
        .form-select {
            width: 100%;
            background: var(--input-bg);
            border: 1px solid var(--border);
            color: var(--input-fg);
            padding: 6px;
            font-family: var(--font-ui);
            font-size: 13px;
            outline: none;
        }

        .form-input:focus,
        .form-select:focus {
            border-color: var(--accent);
        }

        .modal-actions {
            display: flex;
            justify-content: flex-end;
            gap: 10px;
        }

        .btn {
            padding: 6px 12px;
            font-size: 12px;
            cursor: pointer;
            border: none;
            border-radius: 3px;
        }

        .btn-secondary {
            background: var(--btn-sec-bg);
            color: var(--btn-sec-fg);
        }

        .btn-primary {
            background: var(--accent);
            color: white;
        }

        .btn-primary:hover {
            background: var(--accent-hover);
        }

        /* --- RESIZE HANDLES --- */
        .resize-handle-vertical {
            width: 5px;
            cursor: col-resize;
            background-color: transparent;
            transition: background-color 0.2s;
            flex-shrink: 0;
            z-index: 10;
        }

        .resize-handle-vertical:hover,
        .resize-handle-vertical.active {
            background-color: var(--accent);
        }

        .resize-handle-horizontal {
            height: 5px;
            cursor: row-resize;
            background-color: transparent;
            transition: background-color 0.2s;
            flex-shrink: 0;
            z-index: 10;
        }

        .resize-handle-horizontal:hover,
        .resize-handle-horizontal.active {
            background-color: var(--accent);
        }

        body.resizing-x {
            user-select: none;
            -webkit-user-select: none;
            cursor: col-resize !important;
        }

        body.resizing-y {
            user-select: none;
            -webkit-user-select: none;
            cursor: row-resize !important;
        }

        /* --- CONTEXT MENU --- */
        .context-menu {
            display: none;
            position: absolute;
            z-index: 1000;
            background-color: var(--bg-panel);
            border: 1px solid var(--border);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
            border-radius: 4px;
            padding: 4px 0;
            min-width: 140px;
        }

        .context-menu-item {
            padding: 8px 16px;
            /* Increased padding */
            cursor: pointer;
            font-size: 13px;
            color: var(--text-main);
            display: block;
            /* Block layout for text only */
            transition: background-color 0.1s;
        }

        .context-menu-item:hover {
            background-color: var(--button-bg);
            color: white;
        }

        /* --- FILE ICONS --- */
        .tree-arrow {
            display: inline-flex;
            width: 16px;
            min-width: 16px;
            align-items: center;
            justify-content: center;
            margin-right: 2px;
            color: rgba(135, 154, 184, 0.9);
            font-size: 10px;
            line-height: 1;
            vertical-align: middle;
            transition: color 0.18s ease, transform 0.18s ease;
        }

        .sidebar-item:hover .tree-arrow,
        .sidebar-item.active .tree-arrow {
            color: #cfe5ff;
        }

        .tree-arrow-placeholder {
            color: transparent;
        }

        .node-name {
            display: inline-block;
            color: inherit;
            font-size: inherit;
            line-height: 1.2;
            vertical-align: middle;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            letter-spacing: 0.01em;
        }

        .file-icon {
            display: inline-block;
            width: 16px;
            min-width: 16px;
            height: 16px;
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
            margin-right: 6px;
            vertical-align: middle;
            opacity: 0.92;
            filter: saturate(1.05);
        }

        /* Default File */
        .icon-file {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23cccccc" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><polyline points="13 2 13 9 20 9"></polyline></svg>');
        }

        /* Folder */
        .icon-folder {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23dcb67a" stroke="%23dcb67a" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"></path></svg>');
        }

        /* C */
        .icon-c {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%235e97f6" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round"><path d="M18 9l-5-5-5 5v6l5 5 5-5"></path><text x="12" y="16" text-anchor="middle" font-size="10" fill="%235e97f6" stroke="none" font-family="monospace" font-weight="bold">C</text></svg>');
        }

        /* C++ */
        .icon-cpp {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%235e97f6" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 9l-5-5-5 5v6l5 5 5-5"></path><text x="12" y="16" text-anchor="middle" font-size="8" fill="%235e97f6" stroke="none" font-family="monospace" font-weight="bold">C++</text></svg>');
        }

        /* Python */
        .icon-python {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23d6b758" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5"></path></svg>');
        }

        /* JS */
        .icon-js {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%23d6b758" stroke="none"><path d="M3 3h18v18H3z"></path><text x="11" y="17" font-size="10" fill="black" font-family="monospace" font-weight="bold">JS</text></svg>');
        }

        /* HTML */
        .icon-html {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23e44d26" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"></polyline><polyline points="8 6 2 12 8 18"></polyline></svg>');
        }

        /* CSS */
        .icon-css {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23264de4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="4 7 4 4 20 4 20 7"></polyline><line x1="9" y1="20" x2="15" y2="20"></line><line x1="12" y1="4" x2="12" y2="20"></line></svg>');
        }

        /* Header */
        .icon-h {
            background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23a074c4" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"></path><text x="13" y="15" text-anchor="middle" font-size="9" fill="%23a074c4" stroke="none" font-weight="bold">H</text></svg>');
        }
