        ::-webkit-scrollbar { width: 6px; height: 6px; }
        ::-webkit-scrollbar-track { background: transparent; }
        ::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 10px; }
        ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

        .iso-flag-badge {
            font-family: monospace;
            font-size: 11px;
            font-weight: 800;
            color: var(--primary-color);
            background: var(--primary-light);
            padding: 2px 6px;
            border-radius: 4px;
            border: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
            display: inline-block;
            vertical-align: middle;
        }

        /* =========================================
           INTEGRATED MASTER HEADER (MERGED WITH TARGET BAR)
           ========================================= */
        .app-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 8px 16px;
            min-height: 52px;
            background: color-mix(in srgb, var(--bg-body) 60%, var(--card-bg));
            border-bottom: 1px solid var(--border-color);
            z-index: 30;
            border-top-left-radius: 20px;
            border-top-right-radius: 20px;
            box-sizing: border-box;
            gap: 12px;
            flex-wrap: wrap;
        }
        .header-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
        .hdr-divider { width: 1px; height: 26px; background: var(--border-color); margin: 0 2px; }

        .project-info { position: relative; cursor: pointer; padding: 4px 8px; border-radius: 8px; transition: 0.2s; display: flex; flex-direction: column; justify-content: center; }
        .project-info:hover { background: rgba(255,255,255,0.05); }
        .project-info h1 { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 6px; margin: 0; color: var(--text-main); line-height: 1.3; }
        .project-info span { font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 4px; line-height: 1.2; }
        .project-dropdown { position: absolute; top: 100%; left: 0; right: auto; margin-top: 8px; width: 320px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(6px); transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1); z-index: 200; padding: 10px; }
        .project-info.open .project-dropdown { opacity: 1; visibility: visible; transform: translateY(0); }
        .proj-group { margin-bottom: 6px; }
        .proj-group-title { font-size: 11px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; padding: 4px 8px; }
        .proj-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--text-main); border-radius: 8px; transition: 0.2s; }
        .proj-item:hover { background: var(--primary-light); color: var(--primary-color); }
        
        /* Target Meta Group in Status Bar */
        .target-meta-group { 
            display: flex; 
            align-items: center; 
            gap: 6px; 
            flex-wrap: nowrap; 
        }

        .target-chip { 
            display: flex; 
            align-items: center; 
            gap: 5px; 
            padding: 2px 8px; 
            border-radius: 6px; 
            background: color-mix(in srgb, var(--text-muted) 10%, var(--card-bg)); 
            border: 1px solid var(--border-color); 
            font-size: 11px; 
            color: var(--text-muted); 
            height: 24px;
            box-sizing: border-box;
            transition: all 0.2s ease;
        }

        .target-chip.kw { 
            background: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg)); 
            border-color: color-mix(in srgb, var(--primary-color) 30%, transparent); 
            color: var(--primary-color);
            position: relative;
        }

        .target-chip.kw.clickable {
            cursor: pointer;
            user-select: none;
        }

        .target-chip.kw.clickable:hover {
            background: color-mix(in srgb, var(--primary-color) 22%, var(--card-bg));
            border-color: var(--primary-color);
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
        }

        .target-chip strong { 
            color: var(--text-main); 
            font-weight: 700; 
        }

        .target-chip.kw strong { 
            color: var(--primary-color); 
            font-size: 11.5px; 
        }

        .target-flag-img {
            width: 15px;
            height: 11px;
            border-radius: 2px;
            object-fit: cover;
            vertical-align: middle;
            box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
            display: inline-block;
        }

        .status-divider {
            width: 1px;
            height: 16px;
            background: var(--border-color);
            margin: 0 4px;
            flex-shrink: 0;
        }

        /* Keyword Navigation Dropdown Menu */
        .kw-nav-dropdown {
            position: absolute;
            bottom: calc(100% + 8px);
            left: 0;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
            backdrop-filter: blur(12px);
            -webkit-backdrop-filter: blur(12px);
            min-width: 180px;
            padding: 6px;
            display: none;
            flex-direction: column;
            gap: 4px;
            z-index: 100;
            animation: fadeInKwNav 0.15s ease-out;
        }

        .kw-nav-dropdown.open {
            display: flex;
        }

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

        .kw-nav-header {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 5px 8px 6px 8px;
            font-size: 11px;
            font-weight: 800;
            color: var(--text-main);
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 2px;
            user-select: none;
        }

        .kw-nav-item {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 6px 10px;
            border-radius: 6px;
            font-size: 11.5px;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
        }

        .kw-nav-item:hover {
            background: color-mix(in srgb, var(--primary-color) 14%, var(--card-bg));
            color: var(--primary-color);
            transform: translateX(2px);
        }

        .kw-nav-item svg {
            color: currentColor;
            flex-shrink: 0;
        }

        .header-actions { display: flex; align-items: center; gap: 8px; }
        .save-indicator { display: flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 12px; font-weight: 700; padding: 4px 8px; border-radius: 6px; transition: 0.2s; }
        .save-indicator svg { width: 15px; height: 15px; color: var(--success); }
        .save-indicator.saving { color: var(--primary-color); }
        .save-indicator.saving svg { color: var(--primary-color); }

        .btn-icon { width: 34px; height: 34px; border-radius: 8px; background: var(--card-bg); border: 1px solid transparent; color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; position: relative;}
        .btn-icon svg { width: 16px; height: 16px; }
        .btn-icon:hover, .btn-icon.active { color: var(--primary-color); background: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg)); border-color: transparent; transform: translateY(-1px); }
        
        .btn-auto-workspace { border: 1px solid transparent; color: var(--ai-color); padding: 0 14px; height: 34px; border-radius: 8px; font-size: 12.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; background: color-mix(in srgb, var(--ai-color) 12%, var(--card-bg)); box-shadow: 0 0 10px var(--ai-glow); cursor: pointer; transition: 0.2s; }
        .btn-auto-workspace svg { width: 15px; height: 15px; }
        .btn-auto-workspace:hover { background: color-mix(in srgb, var(--ai-color) 20%, var(--card-bg)); transform: translateY(-1px); }
        
        /* Professional AI Analyze Action Button - Borderless Active Tint */
        .btn-ai-analyze {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 7px;
            height: 34px;
            padding: 0 14px;
            background: color-mix(in srgb, var(--primary-color) 15%, var(--card-bg));
            color: var(--primary-color);
            border: 1px solid transparent;
            border-radius: 8px;
            box-shadow: 0 0 10px var(--primary-glow);
            font-size: 12.5px;
            font-weight: 800;
            letter-spacing: 0.2px;
            cursor: pointer;
            transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
            font-family: inherit;
            user-select: none;
            white-space: nowrap;
        }
        .btn-ai-analyze svg {
            width: 14px;
            height: 14px;
            stroke-width: 2.2;
            color: var(--primary-color);
            transition: transform 0.3s ease;
        }
        .btn-ai-analyze:hover {
            transform: translateY(-1px);
            background: color-mix(in srgb, var(--primary-color) 22%, var(--card-bg));
            border-color: transparent;
            box-shadow: 0 0 14px var(--primary-glow), 0 3px 10px rgba(0, 0, 0, 0.08);
            color: var(--primary-color);
        }
        .btn-ai-analyze:hover svg {
            transform: rotate(45deg);
        }
        .btn-ai-analyze:active {
            transform: translateY(0) scale(0.98);
            box-shadow: 0 0 6px var(--primary-glow);
        }
        .btn-ai-analyze.loading svg {
            animation: spin 0.8s linear infinite;
        }

        @keyframes spin { 100% { transform: rotate(360deg); } }
        .spin { animation: spin 1s linear infinite; }

        .toast-container { position: fixed; bottom: 20px; left: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 999999; pointer-events: none; }
        .toast { background: var(--card-bg); border-right: 4px solid var(--success); color: var(--text-main); padding: 12px 20px; border-radius: 8px; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 10px; transform: translateX(-120%); transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
        .toast.show { transform: translateX(0); }
        
        .dropdown { position: relative; }
        .dropdown-menu { position: absolute; top: 120%; left: 0; background: var(--glass-bg); backdrop-filter: blur(30px); border: 1px solid var(--glass-border); border-radius: 12px; padding: 8px; min-width: 160px; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(6px); transition: 0.2s; z-index: 50; }
        .dropdown.open .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
        .dp-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--text-main); border-radius: 8px; cursor: pointer; font-size: 12.5px; font-family: var(--font-main); white-space: nowrap;}
        .dp-item:hover { background: var(--primary-light); color: var(--primary-color); }

        /* =========================================
           MAIN LAYOUT
           ========================================= */
        .main-layout { display: flex; height: 100vh; padding: 14px 16px; gap: 16px; position: relative; box-sizing: border-box;}

        /* -----------------------------------------
           LEFT PANEL: EDITOR & CONSOLE
           ----------------------------------------- */
        .editor-container { flex: 1; display: flex; flex-direction: column; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-sm); position: relative; height: 100%;}
        
        .editor-toolbar { background: var(--bg-body); backdrop-filter: blur(25px); border-bottom: 1px solid var(--border-color); padding: 6px 14px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; z-index: 20; direction: ltr; min-height: 40px; box-sizing: border-box;}
        .tb-group { display: flex; align-items: center; gap: 2px; background: var(--bg-body); padding: 3px; border-radius: 8px; border: 1px solid var(--border-color); }
        .tb-btn { background: transparent; border: none; color: var(--text-muted); width: 30px; height: 30px; border-radius: 7px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
        .tb-btn svg { width: 15px; height: 15px; pointer-events: none;}
        .tb-btn:hover, .tb-btn.active { background: var(--card-bg); color: var(--primary-color); }
        .tb-divider { width: 1px; height: 16px; background: var(--border-color); margin: 0 4px; }

        .highlight-nav { position: absolute; top: 120px; left: 50%; transform: translateX(-50%); background: var(--glass-bg); backdrop-filter: blur(20px); border: 1px solid var(--primary-color); padding: 8px 16px; border-radius: 12px; z-index: 100; display: none; align-items: center; gap: 12px; box-shadow: 0 10px 30px rgba(244, 106, 37, 0.2); direction: rtl;}
        .hl-info { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
        .hl-term { color: var(--primary-color); }
        .hl-count { color: var(--text-muted); font-family: monospace; }
        .hl-controls { display: flex; gap: 4px; border-left: 1px solid var(--border-color); padding-left: 12px; margin-left: 4px;}
        .hl-btn { background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-main); width: 30px; height: 30px; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
        .hl-btn.text-btn { width: auto; padding: 0 10px; font-size: 12px; font-weight: 700;}
        .hl-btn:hover { background: var(--primary-light); color: var(--primary-color); border-color: var(--primary-color);}
        .hl-input { background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-main); padding: 4px 8px; border-radius: 6px; width: 120px; font-size: 13px; outline: none;}
        .hl-close { color: var(--danger); border-color: transparent; background: transparent; }
        .hl-close:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }
        mark.kw-highlight { background: rgba(245, 158, 11, 0.3); color: var(--text-main); border-radius: 3px; padding: 0 2px; transition: 0.2s;}
        mark.kw-active { background: var(--primary-color); color: white; font-weight: bold; box-shadow: 0 0 10px var(--primary-glow);}

        /* =========================================
           EDITOR WORKSPACE & LINE NUMBERS GUTTER
           ========================================= */
        .editor-workspace-wrap {
            flex: 1;
            display: flex;
            flex-direction: row;
            overflow: hidden;
            position: relative;
            background: var(--card-bg);
            min-height: 200px;
        }

        .line-numbers {
            width: 44px;
            min-width: 44px;
            background: color-mix(in srgb, var(--bg-body) 80%, var(--card-bg));
            border-right: 1px solid var(--border-color);
            padding: 30px 4px 40px 0;
            overflow: hidden;
            user-select: none;
            pointer-events: none;
            flex-shrink: 0;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
        }

        [dir="rtl"] .line-numbers,
        .line-numbers[dir="rtl"] {
            border-right: none;
            border-left: 1px solid var(--border-color);
            padding: 30px 0 40px 4px;
        }

        .ln-row {
            font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
            font-size: 11px;
            font-weight: 700;
            color: color-mix(in srgb, var(--text-muted) 55%, transparent);
            text-align: right;
            padding-right: 8px;
            line-height: 1.4;
            display: flex;
            align-items: flex-start;
            justify-content: flex-end;
            transition: color 0.15s;
            box-sizing: border-box;
        }

        [dir="rtl"] .ln-row {
            text-align: left;
            padding-right: 0;
            padding-left: 8px;
            justify-content: flex-start;
        }

        .editor-content { 
            flex: 1; 
            padding: 30px 36px 40px 36px; 
            overflow-y: auto; 
            font-family: var(--font-editor, inherit); 
            font-size: 16px; 
            line-height: 1.8; 
            color: var(--text-main); 
            outline: none;  
            position: relative;
        }

        [dir="rtl"] .editor-content,
        .editor-content[dir="rtl"] {
            padding: 30px 36px 40px 36px;
        }

        /* =========================================
           ART-ED CONTENT & HEADING BADGES ENGINE
           ========================================= */
        .art-ed {
            position: relative;
            outline: none;
        }

        .art-ed h1, .art-ed h2, .art-ed h3, .art-ed h4, .art-ed h5, .art-ed h6 {
            position: relative;
            padding-left: 36px;
            margin-top: 1.2em;
            margin-bottom: 0.6em;
            color: var(--text-main);
            font-weight: 700;
            line-height: 1.35;
        }

        [dir="rtl"] .art-ed h1,
        [dir="rtl"] .art-ed h2,
        [dir="rtl"] .art-ed h3,
        [dir="rtl"] .art-ed h4,
        [dir="rtl"] .art-ed h5,
        [dir="rtl"] .art-ed h6,
        .art-ed[dir="rtl"] h1,
        .art-ed[dir="rtl"] h2,
        .art-ed[dir="rtl"] h3,
        .art-ed[dir="rtl"] h4,
        .art-ed[dir="rtl"] h5,
        .art-ed[dir="rtl"] h6 {
            padding-left: 0;
            padding-right: 36px;
        }

        .art-ed h1 { font-size: 1.95em; }
        .art-ed h2 { font-size: 1.55em; }
        .art-ed h3 { font-size: 1.3em; }
        .art-ed h4 { font-size: 1.15em; }
        .art-ed h5 { font-size: 1.05em; }
        .art-ed h6 { font-size: 0.95em; }

        .art-ed h1:before,
        .art-ed h2:before,
        .art-ed h3:before,
        .art-ed h4:before,
        .art-ed h5:before,
        .art-ed h6:before {
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            font-size: 10px;
            font-weight: 800;
            line-height: 17px;
            height: 17px;
            padding: 0 5px;
            border-radius: 4px;
            font-family: var(--font-mono, monospace);
            letter-spacing: 0.5px;
            user-select: none;
            pointer-events: none;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border: 1px solid transparent;
            opacity: 0.9;
            transition: opacity 0.2s;
        }

        [dir="rtl"] .art-ed h1:before,
        [dir="rtl"] .art-ed h2:before,
        [dir="rtl"] .art-ed h3:before,
        [dir="rtl"] .art-ed h4:before,
        [dir="rtl"] .art-ed h5:before,
        [dir="rtl"] .art-ed h6:before,
        .art-ed[dir="rtl"] h1:before,
        .art-ed[dir="rtl"] h2:before,
        .art-ed[dir="rtl"] h3:before,
        .art-ed[dir="rtl"] h4:before,
        .art-ed[dir="rtl"] h5:before,
        .art-ed[dir="rtl"] h6:before,
        .rtlWrite .art-ed h1:before,
        .rtlWrite .art-ed h2:before,
        .rtlWrite .art-ed h3:before,
        .rtlWrite .art-ed h4:before,
        .rtlWrite .art-ed h5:before,
        .rtlWrite .art-ed h6:before {
            left: auto;
            right: 0;
        }

        .art-ed h1:hover:before,
        .art-ed h2:hover:before,
        .art-ed h3:hover:before,
        .art-ed h4:hover:before,
        .art-ed h5:hover:before,
        .art-ed h6:hover:before {
            opacity: 1;
        }

        .art-ed h1:before {
            content: "H1";
            color: #3b82f6;
            background: rgba(59, 130, 246, 0.12);
            border-color: rgba(59, 130, 246, 0.3);
        }

        .art-ed h2:before {
            content: "H2";
            color: #10b981;
            background: rgba(16, 185, 129, 0.12);
            border-color: rgba(16, 185, 129, 0.3);
        }

        .art-ed h3:before {
            content: "H3";
            color: #8b5cf6;
            background: rgba(139, 92, 246, 0.12);
            border-color: rgba(139, 92, 246, 0.3);
        }

        .art-ed h4:before {
            content: "H4";
            color: #f59e0b;
            background: rgba(245, 158, 11, 0.12);
            border-color: rgba(245, 158, 11, 0.3);
        }

        .art-ed h5:before {
            content: "H5";
            color: #ec4899;
            background: rgba(236, 72, 153, 0.12);
            border-color: rgba(236, 72, 153, 0.3);
        }

        .art-ed h6:before {
            content: "H6";
            color: #6b7280;
            background: rgba(107, 114, 128, 0.12);
            border-color: rgba(107, 114, 128, 0.3);
        }

        /* RTL Handling for Heading Badges */
        [dir="rtl"] .art-ed h1:before,
        [dir="rtl"] .art-ed h2:before,
        [dir="rtl"] .art-ed h3:before,
        [dir="rtl"] .art-ed h4:before,
        [dir="rtl"] .art-ed h5:before,
        [dir="rtl"] .art-ed h6:before,
        .art-ed[dir="rtl"] h1:before,
        .art-ed[dir="rtl"] h2:before,
        .art-ed[dir="rtl"] h3:before,
        .art-ed[dir="rtl"] h4:before,
        .art-ed[dir="rtl"] h5:before,
        .art-ed[dir="rtl"] h6:before,
        .rtlWrite .art-ed h1:before,
        .rtlWrite .art-ed h2:before,
        .rtlWrite .art-ed h3:before,
        .rtlWrite .art-ed h4:before,
        .rtlWrite .art-ed h5:before,
        .rtlWrite .art-ed h6:before {
            left: auto;
            right: -44px;
        }

        .art-ed p {
            margin-top: 0;
            margin-bottom: 1.1em;
            line-height: 1.8;
            font-size: 1em;
            cursor: text;
        }

        .art-ed blockquote {
            position: relative;
            border-left: 3px solid var(--primary-color);
            padding: 8px 16px;
            margin: 16px 0;
            background: color-mix(in srgb, var(--primary-color) 8%, var(--card-bg));
            border-radius: 0 8px 8px 0;
            font-style: italic;
            color: var(--text-main);
        }

        [dir="rtl"] .art-ed blockquote,
        .art-ed[dir="rtl"] blockquote {
            border-left: none;
            border-right: 3px solid var(--primary-color);
            border-radius: 8px 0 0 8px;
        }

        .art-ed ul, .art-ed ol {
            margin-top: 0;
            margin-bottom: 1.2em;
            padding-inline-start: 24px;
        }

        .art-ed li {
            margin-bottom: 4px;
            line-height: 1.7;
        }

        .art-ed hr {
            cursor: default;
            background: transparent;
            border: 0;
            border-top: 1px dashed var(--border-color);
            margin: 24px 0;
        }

        .art-ed mark {
            background: rgba(245, 158, 11, 0.3);
            color: var(--text-main);
            border-radius: 4px;
            padding: 2px 4px;
        }

        .art-ed a {
            color: var(--primary-color);
            text-decoration: underline;
            text-underline-offset: 3px;
        }

        .art-ed img {
            max-width: 100%;
            height: auto;
            border-radius: 10px;
            margin: 14px 0;
            box-shadow: var(--shadow-sm);
        }

        .art-ed table {
            width: 100%;
            border-collapse: collapse;
            margin: 16px 0;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--border-color);
        }

        .art-ed th {
            background: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg));
            color: var(--text-main);
            font-weight: 700;
            padding: 10px 14px;
            border: 1px solid var(--border-color);
            text-align: inherit;
        }

        .art-ed td {
            padding: 8px 14px;
            border: 1px solid var(--border-color);
            color: var(--text-main);
        }

        /* Competitor Bottom Bar & Tooltip */
        .competitor-bar { background: var(--bg-body); border-top: 1px solid var(--border-color); padding: 8px 16px; display: flex; align-items: center; justify-content: space-between; font-size: 13px; z-index: 10;}
        .comp-btn { background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-muted); padding: 6px 16px; border-radius: 8px; display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 700; transition: 0.2s; font-family: inherit;}
        .comp-btn:hover { background: var(--ai-light); color: var(--ai-color); border-color: var(--ai-color); }
        .comp-btn.success { background: var(--success-light); color: var(--success); border-color: var(--success); }
        
        .comp-tooltip { position: fixed; background: var(--glass-bg); backdrop-filter: blur(25px); border: 1px solid var(--ai-color); padding: 12px; border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 1000; display: none; max-width: 320px; font-size: 13px; line-height: 1.6; color: var(--text-main); pointer-events: none; transition: opacity 0.2s;}
        .comp-tooltip.show { display: block; animation: fadeInUp 0.2s ease;}
        .comp-tt-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-weight: 700; font-size: 11px; color: var(--text-muted); border-bottom: 1px solid var(--glass-border); padding-bottom: 4px;}
        .comp-tt-header img { width: 14px; height: 14px; border-radius: 3px; }
        @keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        /* Streaming Controls */
        .stream-controls { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); background: var(--card-bg); backdrop-filter: blur(20px); border: 1px solid var(--ai-color); padding: 10px 20px; border-radius: 30px; display: none; align-items: center; gap: 12px; z-index: 50; box-shadow: 0 10px 40px var(--ai-glow); }
        .stream-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-body); color: var(--text-main); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s; }
        .stream-btn:hover { background: var(--card-bg); color: var(--primary-color); border-color: var(--primary-color); }
        .stream-btn.danger { color: var(--danger); border-color: var(--danger); }
        .stream-btn.danger:hover { background: var(--danger-light); }
        .stream-text { font-size: 13.5px; font-weight: 700; color: var(--ai-color); display: flex; align-items: center; gap: 8px; }

        /* AI Floating Wand */
        .ai-wand-container { position: absolute; bottom: 80px; right: 30px; z-index: 60; }
        .floating-ai-btn { width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(135deg, var(--ai-color), #c084fc); color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 10px 30px var(--ai-glow); transition: 0.3s; }
        .floating-ai-btn:hover { transform: scale(1.1) rotate(15deg); }
        .floating-ai-btn[style*="pointer-events: none"] { opacity: 0.7; transform: none !important; }
        .main-ai-menu { position: absolute; bottom: 65px; right: 0; width: 300px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; padding: 8px; box-shadow: var(--shadow-lg); display: none; flex-direction: column; gap: 2px; z-index: 100; }
        .ai-wand-container.open .main-ai-menu { display: flex; animation: fadeInUp 0.2s ease; }
        .mai-section-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 4px 14px 2px; opacity: 0.7; }
        .mai-item { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; color: var(--text-main); cursor: pointer; transition: 0.2s; }
        .mai-item:hover { background: var(--ai-light); color: var(--ai-color); }
        .mai-item i { flex-shrink: 0; }
        .mai-badge { margin-right: auto; margin-left: 4px; font-size: 9.5px; font-weight: 700; padding: 2px 6px; border-radius: 4px; background: color-mix(in srgb, var(--ai-color) 15%, transparent); color: var(--ai-color); white-space: nowrap; flex-shrink: 0; letter-spacing: 0; }
        .mai-divider { height: 1px; background: var(--border-color); margin: 4px 0; }
        .mai-selection-badge { display: flex; align-items: center; gap: 6px; padding: 6px 12px; margin: 2px 0 4px; border-radius: 8px; background: color-mix(in srgb, var(--ai-color) 12%, transparent); border: 1px dashed color-mix(in srgb, var(--ai-color) 40%, transparent); color: var(--ai-color); font-size: 11px; font-weight: 700; line-height: 1.3; word-break: break-word; }


        /* Editor AI Loading state */
        #editor [data-ai-loading="true"],
        #main-editor [data-ai-loading="true"] {
            position: relative;
            border-radius: 6px;
        }
        #editor [data-ai-loading="true"]::after,
        #main-editor [data-ai-loading="true"]::after {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--ai-color) 20%, transparent), transparent);
            background-size: 200% 100%;
            animation: aiShimmer 1s infinite;
            border-radius: inherit;
            pointer-events: none;
        }
        #editor [data-ai-insert="true"],
        #main-editor [data-ai-insert="true"] {
            border-right: 3px solid var(--ai-color);
            border-radius: 0 6px 6px 0;
            padding-right: 8px;
        }
        @keyframes aiShimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }


        /* Floating Console & Panels */
        .floating-console { position: absolute; bottom: 60px; right: 20px; width: 440px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); display: none; flex-direction: column; z-index: 150; overflow: hidden; }
        .floating-console.active { display: flex; animation: fadeInUp 0.25s ease; }
        .fc-header { padding: 12px 18px; background: var(--bg-body); border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
        .fc-tabs { display: flex; gap: 8px; }
        .fc-tab { padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 800; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; gap: 6px; transition: 0.2s; }
        .fc-tab.active { background: var(--card-bg); color: var(--text-main); }
        .c-badge { padding: 2px 6px; border-radius: 4px; font-size: 10px; font-family: monospace; background: var(--border-color); color: var(--text-main); }
        .c-badge.red { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
        .c-badge.yellow { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
        .fc-close { color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; }
        .fc-close:hover { color: var(--danger); background: var(--danger-light); }
        .fc-body { max-height: 360px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
        .fc-item { display: flex; gap: 12px; padding: 12px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; font-size: 12.5px; }
        .fc-item h4 { margin: 0 0 4px; font-size: 13px; font-weight: 800; color: var(--text-main); }
        .fc-item p { margin: 0; color: var(--text-muted); line-height: 1.5; }

        /* Audit Grid */
        .audit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
        .audit-box { display: flex; flex-direction: column; gap: 6px; }
        .audit-box label { font-size: 12.5px; font-weight: 800; color: var(--text-muted); }
        .audit-input { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 10px; padding: 10px 14px; color: var(--text-main); font-size: 13.5px; outline: none; font-family: inherit; }
        .audit-input:focus { border-color: var(--primary-color); }
        .audit-char-count { font-size: 11px; font-family: monospace; font-weight: 700; color: var(--text-muted); align-self: flex-end; }
        .audit-res-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
        .audit-res-item.pro { background: rgba(16, 185, 129, 0.1); color: #10b981; }
        .audit-res-item.con { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
        .audit-res-item.sug { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }

        /* Status Bar */
        .status-bar { display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; background: var(--bg-body); border-top: 1px solid var(--border-color); font-size: 12px; font-weight: 700; color: var(--text-muted); }
        .status-left { display: flex; align-items: center; gap: 16px; }
        .status-btn { display: flex; align-items: center; gap: 6px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 6px; padding: 4px 10px; cursor: pointer; color: var(--text-main); transition: 0.2s; }
        .status-btn:hover { border-color: var(--primary-color); color: var(--primary-color); }
        .badge { background: var(--primary-light); color: var(--primary-color); padding: 2px 6px; border-radius: 4px; font-size: 10px; font-weight: 800; font-family: monospace; }
        .badge.clear { background: rgba(16, 185, 129, 0.15); color: #10b981; }

        /* -----------------------------------------
           RIGHT PANEL: RADAR & ANALYSIS
           ----------------------------------------- */
        /* -----------------------------------------
           RIGHT PANEL: UNIFIED INTELLIGENCE CONSOLE
           ----------------------------------------- */
        .analysis-panel.co-unified-console {
            width: 390px;
            display: flex;
            flex-direction: column;
            height: 100%;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 20px;
            overflow: hidden;
            box-shadow: 0 10px 35px rgba(0, 0, 0, 0.05);
            transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
        }

        .analysis-panel.co-unified-console:hover {
            border-color: color-mix(in srgb, var(--primary-color) 35%, var(--border-color));
            box-shadow: 0 14px 45px rgba(0, 0, 0, 0.09);
        }

        /* Top Section: Integrated Radar Section */
        .co-console-radar-section {
            background: transparent !important;
            border: none !important;
            border-bottom: 1px solid var(--border-color) !important;
            border-radius: 0 !important;
            padding: 14px 16px 12px;
            box-shadow: none !important;
            position: relative;
            transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        }

        /* Radar Header */
        .co-radar-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            margin-bottom: 6px;
        }

        .co-radar-title-wrap {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .co-radar-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 32px;
            height: 32px;
            border-radius: 9px;
            background: color-mix(in srgb, var(--primary-color) 12%, transparent);
            color: var(--primary-color);
            border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
        }

        .co-radar-icon svg {
            width: 16px;
            height: 16px;
            animation: radarPulseSpin 12s linear infinite;
        }

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

        .co-radar-title {
            font-size: 14px;
            font-weight: 800;
            color: var(--text-main);
            display: block;
            line-height: 1.2;
        }

        .co-radar-actions {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .co-radar-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 4px 10px;
            border-radius: 20px;
            font-size: 10.5px;
            font-weight: 800;
            line-height: 1;
            letter-spacing: 0.5px;
            transition: all 0.3s ease;
        }

        .co-radar-badge.weak {
            background: rgba(239, 68, 68, 0.12);
            color: #ef4444;
            border: 1px solid rgba(239, 68, 68, 0.3);
        }

        .co-radar-badge.fair {
            background: rgba(245, 158, 11, 0.12);
            color: #f59e0b;
            border: 1px solid rgba(245, 158, 11, 0.3);
        }

        .co-radar-badge.good {
            background: rgba(59, 130, 246, 0.12);
            color: #3b82f6;
            border: 1px solid rgba(59, 130, 246, 0.3);
        }

        .co-radar-badge.optimized {
            background: rgba(16, 185, 129, 0.12);
            color: #10b981;
            border: 1px solid rgba(16, 185, 129, 0.3);
            box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
        }

        .co-radar-badge.over {
            background: rgba(139, 92, 246, 0.12);
            color: #8b5cf6;
            border: 1px solid rgba(139, 92, 246, 0.3);
        }

        .co-radar-live-dot {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: currentColor;
            box-shadow: 0 0 6px currentColor;
            animation: pulseLiveDot 2s infinite ease-in-out;
        }

        @keyframes pulseLiveDot {
            0%, 100% { opacity: 1; transform: scale(1); }
            50% { opacity: 0.4; transform: scale(0.75); }
        }

        .toggle-radar-btn {
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            color: var(--text-muted);
            cursor: pointer;
            width: 28px;
            height: 28px;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s ease;
        }

        .toggle-radar-btn:hover {
            color: var(--text-main);
            border-color: var(--primary-color);
            background: var(--card-bg);
        }

        .toggle-radar-btn svg {
            width: 14px;
            height: 14px;
            transition: transform 0.3s ease;
        }

        .radar-score-card.compact .toggle-radar-btn svg {
            transform: rotate(180deg);
        }

        /* Collapsible Body */
        .co-radar-body-wrap {
            display: flex;
            flex-direction: column;
            gap: 10px;
            transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, transform 0.3s ease;
            max-height: 600px;
            opacity: 1;
            transform: translateY(0);
        }

        .radar-score-card.compact .co-radar-body-wrap {
            max-height: 0;
            opacity: 0;
            transform: translateY(-8px);
            overflow: hidden;
            pointer-events: none;
            margin: 0;
            padding: 0;
        }

        /* Dual-Layer Futuristic HUD Radar Visualizer */
        .co-radar-stage {
            position: relative;
            width: 100%;
            height: 250px;
            display: flex;
            align-items: center;
            justify-content: center;
            overflow: visible;
        }

        /* Layer 1: Ambient Glowing Radar Rings */
        .co-radar-ambient-bg {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 210px;
            height: 210px;
            border-radius: 50%;
            pointer-events: none;
            z-index: 0;
        }

        .co-radar-glow-disc {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 120px;
            height: 120px;
            border-radius: 50%;
            background: rgba(239, 68, 68, 0.12);
            filter: blur(25px);
            opacity: 0.5;
            transition: all 0.5s ease;
        }

        .co-radar-grid-ring {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            border-radius: 50%;
            border: 1px dashed var(--border-color);
            opacity: 0.6;
        }

        .co-radar-grid-ring.ring-1 { width: 60px; height: 60px; }
        .co-radar-grid-ring.ring-2 { width: 120px; height: 120px; }
        .co-radar-grid-ring.ring-3 { width: 180px; height: 180px; border-style: solid; opacity: 0.35; }

        .co-radar-crosshair-h {
            position: absolute;
            top: 50%;
            left: 10%;
            right: 10%;
            height: 1px;
            background: linear-gradient(90deg, transparent, var(--border-color) 30%, var(--border-color) 70%, transparent);
            opacity: 0.4;
        }

        .co-radar-crosshair-v {
            position: absolute;
            left: 50%;
            top: 10%;
            bottom: 10%;
            width: 1px;
            background: linear-gradient(180deg, transparent, var(--border-color) 30%, var(--border-color) 70%, transparent);
            opacity: 0.4;
        }

        /* Layer 2: ApexCharts Container */
        .co-apex-radar-container {
            position: relative;
            z-index: 1;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .co-apex-radar-container .apexcharts-canvas {
            margin: 0 auto;
        }

        .co-apex-radar-container .apexcharts-text,
        .co-apex-radar-container .apexcharts-text tspan {
            fill: var(--text-main) !important;
            font-weight: 800 !important;
        }

        /* Overall Score Banner Below Chart */
        .co-radar-bottom-overall {
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 2px 0 6px;
        }

        .co-core-score-badge {
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 5px 14px;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            display: flex;
            align-items: baseline;
            gap: 4px;
            transition: all 0.3s ease;
        }

        .co-core-lbl {
            font-size: 10px;
            font-weight: 800;
            color: var(--text-muted);
            letter-spacing: 0.5px;
        }

        .co-core-val {
            font-size: 18px;
            font-weight: 900;
            font-family: 'JetBrains Mono', 'Fira Code', monospace;
            color: #ef4444;
            transition: color 0.3s ease;
        }

        .co-core-max {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
        }

        /* 5-Vector Metric Cards Grid */
        .co-radar-vectors-grid {
            display: grid;
            grid-template-columns: repeat(5, 1fr);
            gap: 4px;
            width: 100%;
            padding-top: 4px;
            border-top: 1px solid var(--border-color);
        }

        .co-vector-card {
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            padding: 5px 6px;
            display: flex;
            flex-direction: column;
            gap: 4px;
            transition: all 0.2s ease;
        }

        .co-vector-card:hover {
            border-color: var(--primary-color);
            transform: translateY(-1px);
        }

        .vec-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 2px;
        }

        .vec-dot {
            width: 5px;
            height: 5px;
            border-radius: 50%;
            flex-shrink: 0;
        }

        .vec-dot.kw-dot { background: #10b981; }
        .vec-dot.seo-dot { background: #3b82f6; }
        .vec-dot.depth-dot { background: #f59e0b; }
        .vec-dot.safety-dot { background: #06b6d4; }
        .vec-dot.rank-dot { background: #8b5cf6; }

        .vec-lbl {
            font-size: 8.5px;
            font-weight: 700;
            color: var(--text-muted);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .vec-val {
            font-size: 9.5px;
            font-weight: 900;
            font-family: monospace;
            color: var(--text-main);
        }

        .vec-track {
            width: 100%;
            height: 3px;
            border-radius: 3px;
            background: color-mix(in srgb, var(--text-muted) 15%, transparent);
            overflow: hidden;
        }

        .vec-fill {
            height: 100%;
            border-radius: 3px;
            transition: width 0.4s ease;
        }

        .kw-fill { background: #10b981; }
        .seo-fill { background: #3b82f6; }
        .depth-fill { background: #f59e0b; }
        .safety-fill { background: #06b6d4; }
        .rank-fill { background: #8b5cf6; }

        /* Middle Section: Segmented Cyber Navigation Tabs */
        .co-console-tabs.ai-tabs {
            display: flex;
            background: color-mix(in srgb, var(--bg-body) 75%, var(--card-bg));
            border-bottom: 1px solid var(--border-color);
            padding: 6px 8px;
            gap: 6px;
            position: relative;
        }

        .co-console-tabs .ai-tab {
            flex: 1;
            padding: 8px 6px;
            font-size: 12px;
            font-weight: 800;
            color: var(--text-muted);
            text-align: center;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            border-radius: 10px;
            border: 1px solid transparent;
            background: transparent;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            user-select: none;
            position: relative;
        }

        .co-console-tabs .ai-tab:hover {
            color: var(--text-main);
            background: color-mix(in srgb, var(--text-main) 6%, transparent);
        }

        .co-console-tabs .ai-tab.active {
            color: var(--primary-color);
            background: color-mix(in srgb, var(--primary-color) 14%, var(--card-bg));
            border-color: transparent;
            box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08), 0 0 10px var(--primary-glow);
        }

        .co-console-tabs .tab-icon-wrap {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            border-radius: 6px;
            background: color-mix(in srgb, var(--text-muted) 10%, transparent);
            color: currentColor;
            transition: all 0.25s ease;
        }

        .co-console-tabs .tab-icon-wrap svg {
            width: 13px;
            height: 13px;
        }

        .co-console-tabs .ai-tab.active .tab-icon-wrap {
            background: color-mix(in srgb, var(--primary-color) 15%, transparent);
            color: var(--primary-color);
        }

        .co-console-tabs .tab-label {
            font-weight: 800;
            letter-spacing: 0.2px;
        }

        .co-tab-badge {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 18px;
            height: 16px;
            padding: 0 5px;
            border-radius: 10px;
            font-size: 9.5px;
            font-weight: 900;
            font-family: 'JetBrains Mono', 'Fira Code', monospace;
            background: color-mix(in srgb, var(--text-muted) 14%, transparent);
            color: var(--text-muted);
            transition: all 0.25s ease;
        }

        .co-console-tabs .ai-tab.active .co-tab-badge {
            background: color-mix(in srgb, var(--primary-color) 18%, transparent);
            color: var(--primary-color);
            border: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
        }

        /* Lower Section: Dynamic Console Panes Body */
        .co-console-body {
            flex: 1;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            background: var(--card-bg);
        }

        .tab-pane {
            display: none;
            flex-direction: column;
            flex: 1;
            overflow: hidden;
        }

        .tab-pane.active {
            display: flex;
        }

        .tools-nav.co-cyber-tools-dock {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 8px 10px;
            background: color-mix(in srgb, var(--bg-body) 60%, var(--card-bg));
            border-bottom: 1px solid var(--border-color);
            position: relative;
        }

        .t-btn-divider {
            width: 1px;
            height: 24px;
            background: var(--border-color);
            margin: 0 2px;
            flex-shrink: 0;
        }

        .t-btn {
            flex: 1;
            min-width: 44px;
            height: 38px;
            border-radius: 9px;
            background: var(--card-bg);
            border: 1px solid transparent;
            color: var(--text-muted);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 2px;
            cursor: pointer;
            transition: all 0.22s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            padding: 2px 2px;
            user-select: none;
        }

        .t-btn:hover {
            color: var(--text-main);
            background: color-mix(in srgb, var(--primary-color) 8%, var(--card-bg));
            border-color: transparent;
            transform: translateY(-1px);
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
        }

        .t-btn.active {
            background: color-mix(in srgb, var(--primary-color) 16%, var(--card-bg));
            color: var(--primary-color);
            border-color: transparent;
            box-shadow: 0 0 12px var(--primary-glow);
        }

        .t-btn.ai-special {
            color: var(--ai-color);
        }

        .t-btn.ai-special:hover {
            background: color-mix(in srgb, var(--ai-color) 8%, var(--card-bg));
            border-color: transparent;
        }

        .t-btn.ai-special.active {
            background: color-mix(in srgb, var(--ai-color) 18%, var(--card-bg));
            color: var(--ai-color);
            border-color: transparent;
            box-shadow: 0 0 12px var(--ai-glow);
        }

        .t-btn-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 16px;
            height: 16px;
        }

        .t-btn-icon svg {
            width: 14px;
            height: 14px;
        }

        .t-btn-label {
            font-size: 8.5px;
            font-weight: 800;
            line-height: 1;
            white-space: nowrap;
            letter-spacing: 0.2px;
        }

        .t-btn-pulse-dot {
            position: absolute;
            top: 3px;
            right: 3px;
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: var(--ai-color);
            box-shadow: 0 0 5px var(--ai-color);
            animation: pulseLiveDot 2s infinite ease-in-out;
        }

        .live-ai-suggestion { padding: 10px 14px; background: var(--ai-light); border-bottom: 1px solid var(--border-color); font-size: 12.5px; font-weight: 700; color: var(--ai-color); display: flex; align-items: center; gap: 8px; }
        .live-ai-suggestion.pulse { animation: pulseBg 1s ease; }
        @keyframes pulseBg { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }

        .kw-filters { padding: 10px; background: var(--bg-body); border-bottom: 1px solid var(--border-color); }
        .search-input { width: 100%; background: var(--card-bg); border: 1px solid transparent; border-radius: 8px; padding: 8px 12px; font-size: 12.5px; color: var(--text-main); outline: none; transition: 0.2s; }
        .search-input:focus { background: color-mix(in srgb, var(--primary-color) 4%, var(--card-bg)); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary-color) 25%, transparent); }
        .filter-pill { padding: 4px 12px; border-radius: 20px; font-size: 11.5px; font-weight: 700; color: var(--text-muted); background: var(--card-bg); border: 1px solid transparent; cursor: pointer; white-space: nowrap; transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); user-select: none; }
        .filter-pill:hover { color: var(--text-main); background: color-mix(in srgb, var(--text-main) 6%, var(--card-bg)); border-color: transparent; }
        .filter-pill.active { background: color-mix(in srgb, var(--primary-color) 15%, var(--card-bg)); color: var(--primary-color); border-color: transparent; box-shadow: 0 0 10px var(--primary-glow); }

        .kw-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; list-style: none; margin: 0; }
        .co-crown-item { display: flex; align-items: center; gap: 8px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 8px; cursor: pointer; transition: 0.2s; }
        .co-crown-item:hover { border-color: var(--primary-color); transform: translateX(-2px); }
        .co-crown-item.is-highlighted {
            border-color: var(--primary-color) !important;
            background: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg)) !important;
            box-shadow: 0 0 0 1px var(--primary-color), 0 4px 12px rgba(99, 102, 241, 0.15);
        }
        .co-crown-rank { width: 26px; height: 26px; border-radius: 6px; background: var(--card-bg); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; font-family: monospace; font-size: 12px; font-weight: 800; color: var(--text-muted); }
        .co-crown-rank.top10 { color: #f59e0b; border-color: rgba(245, 158, 11, 0.3); }
        .co-crown-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
        .co-crown-head { display: flex; align-items: center; justify-content: space-between; font-size: 13.5px; font-weight: 800; color: var(--text-main); }
        .co-crown-actions { display: flex; gap: 4px; }
        .co-crown-action-btn { background: transparent; border: none; color: var(--text-muted); cursor: pointer; padding: 2px; }
        .co-crown-action-btn:hover { color: var(--primary-color); }
        .co-crown-stats { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-muted); font-family: monospace; }
        .stat-label { font-size: 9.5px; text-transform: uppercase; color: var(--text-muted); display: block; font-family: sans-serif; }
        .co-crown-progress-track { width: 100%; height: 4px; background: var(--card-bg); border-radius: 4px; overflow: hidden; }
        .co-crown-progress-fill { height: 100%; border-radius: 4px; }
        .st-green { background: #10b981; }
        .st-yellow { background: #f59e0b; }
        .st-blue { background: #3b82f6; }
        .st-red { background: #ef4444; }

        /* Keyword in-editor highlight */
        mark.gr-kw-highlight {
            background-color: rgba(99, 102, 241, 0.28) !important;
            color: inherit !important;
            border-bottom: 2px solid var(--primary-color, #6366f1) !important;
            border-radius: 2px;
            padding: 0 2px;
            transition: all 0.15s ease;
            box-decoration-break: clone;
            -webkit-box-decoration-break: clone;
        }

        html[data-theme="dark"] mark.gr-kw-highlight,
        body.dark-mode mark.gr-kw-highlight,
        .dark-theme mark.gr-kw-highlight {
            background-color: rgba(129, 140, 248, 0.35) !important;
            border-bottom: 2px solid #818cf8 !important;
        }

        /* Outlines Pane */
        .outlines-filters { display: flex; gap: 6px; padding: 10px; background: var(--bg-body); border-bottom: 1px solid var(--border-color); }
        .outlines-list { flex: 1; overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
        .outline-card { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; }
        .outline-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
        .outline-rank { width: 22px; height: 22px; border-radius: 4px; background: var(--card-bg); font-family: monospace; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
        .outline-site { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
        .outline-site img { width: 14px; height: 14px; border-radius: 2px; }
        .outline-title { font-size: 13.5px; font-weight: 800; color: var(--text-main); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
        .outline-headings { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
        .heading-item { display: flex; align-items: baseline; gap: 8px; color: var(--text-muted); line-height: 1.4; }
        .h-tag { font-family: monospace; font-size: 10px; font-weight: 800; padding: 1px 4px; border-radius: 4px; }
        .tag-h1 { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
        .tag-h2 { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
        .tag-h3 { background: rgba(16, 185, 129, 0.15); color: #10b981; }

        /* Statics Pane */
        .statics-scroll-area { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 12px; }
        .statics-metrics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
        .metric-card { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 10px; }
        .metric-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
        .metric-data { display: flex; flex-direction: column; }
        .metric-lbl { font-size: 11px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; }
        .metric-val { font-size: 16px; font-weight: 900; font-family: monospace; color: var(--text-main); }

        .stat-box { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 14px; }
        .stat-box-title { font-size: 13px; font-weight: 800; color: var(--text-main); margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
        .readability-bar { width: 100%; height: 6px; background: var(--card-bg); border-radius: 4px; overflow: hidden; border: 1px solid var(--border-color); }
        .readability-fill { width: 85%; height: 100%; background: #10b981; border-radius: 4px; }

        .stat-list { display: flex; flex-direction: column; gap: 8px; }
        .stat-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: var(--card-bg); border-radius: 8px; border: 1px solid transparent;}
        .stat-num { font-size: 14px; font-weight: 700; color: #47cf73; font-family: monospace; background: rgba(71, 207, 115, 0.1); padding: 2px 8px; border-radius: 6px; }
        /* -----------------------------------------
           TOOL VIEWS: QUESTIONS, GAPS, AI PREDICT, CUSTOM
           ----------------------------------------- */
        
        /* 1. Competitor Questions */
        .q-card {
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 12px 14px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .q-card:hover {
            border-color: color-mix(in srgb, var(--primary-color) 45%, var(--border-color));
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
        }

        .q-head {
            display: flex;
            align-items: flex-start;
            gap: 8px;
        }

        .q-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            border-radius: 6px;
            background: color-mix(in srgb, var(--primary-color) 12%, transparent);
            color: var(--primary-color);
            flex-shrink: 0;
            margin-top: 1px;
        }

        .q-icon svg {
            width: 14px;
            height: 14px;
        }

        .q-text {
            font-size: 13px;
            font-weight: 800;
            color: var(--text-main);
            line-height: 1.45;
            flex: 1;
        }

        .q-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
            padding-top: 8px;
            border-top: 1px dashed color-mix(in srgb, var(--border-color) 60%, transparent);
        }

        .q-freq-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            background: color-mix(in srgb, var(--text-muted) 10%, var(--card-bg));
            border: 1px solid transparent;
            padding: 2px 8px;
            border-radius: 12px;
        }

        .q-actions {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .q-action-btn {
            background: var(--card-bg);
            border: 1px solid transparent;
            border-radius: 6px;
            padding: 4px 8px;
            font-size: 11.5px;
            font-weight: 700;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            transition: all 0.2s ease;
        }

        .q-action-btn:hover {
            color: var(--text-main);
            background: color-mix(in srgb, var(--text-main) 8%, var(--card-bg));
            border-color: transparent;
        }

        .q-action-btn.primary {
            background: color-mix(in srgb, var(--primary-color) 14%, var(--card-bg));
            color: var(--primary-color);
            border-color: transparent;
            box-shadow: 0 0 8px var(--primary-glow);
        }

        .q-action-btn.primary:hover {
            background: color-mix(in srgb, var(--primary-color) 22%, var(--card-bg));
            color: var(--primary-color);
            border-color: transparent;
        }

        /* 2. Content Gaps */
        .gaps-header-alert {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 14px;
            background: color-mix(in srgb, var(--warning) 12%, var(--card-bg));
            border: 1px solid color-mix(in srgb, var(--warning) 30%, transparent);
            border-radius: 10px;
            font-size: 12px;
            font-weight: 800;
            color: var(--warning);
            margin-bottom: 10px;
        }

        .cg-card {
            background: color-mix(in srgb, var(--ai-color) 4%, var(--bg-body));
            border: 1px solid color-mix(in srgb, var(--ai-color) 25%, var(--border-color));
            border-radius: 14px;
            padding: 14px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            transition: all 0.25s ease;
        }

        .cg-card:hover {
            border-color: var(--ai-color);
            box-shadow: 0 4px 18px rgba(139, 92, 246, 0.15);
            transform: translateY(-2px);
        }

        .cg-title-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .cg-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            border-radius: 6px;
            background: color-mix(in srgb, #ef4444 14%, transparent);
            color: #ef4444;
            flex-shrink: 0;
        }

        .cg-title {
            font-size: 13.5px;
            font-weight: 800;
            color: var(--text-main);
            line-height: 1.3;
        }

        .cg-desc {
            font-size: 12px;
            color: var(--text-muted);
            line-height: 1.55;
        }

        .cg-btn {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 8px 14px;
            border-radius: 8px;
            background: linear-gradient(135deg, var(--ai-color), #6366f1);
            color: #ffffff;
            border: none;
            font-size: 12px;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.25s ease;
            box-shadow: 0 3px 12px rgba(139, 92, 246, 0.3);
            width: 100%;
        }

        .cg-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(139, 92, 246, 0.45);
            filter: brightness(1.1);
        }

        /* 3. AI Predict & Entities */
        .ai-pred-card {
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 12px 14px;
            display: flex;
            flex-direction: column;
            gap: 8px;
            transition: all 0.25s ease;
        }

        .ai-pred-card:hover {
            border-color: color-mix(in srgb, var(--ai-color) 45%, var(--border-color));
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
        }

        .ai-pred-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 8px;
        }

        .ai-pred-title-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .ai-pred-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            border-radius: 6px;
            background: color-mix(in srgb, var(--ai-color) 12%, transparent);
            color: var(--ai-color);
            flex-shrink: 0;
        }

        .ai-pred-word {
            font-size: 13.5px;
            font-weight: 800;
            color: var(--text-main);
        }

        .ai-pred-score {
            padding: 2px 8px;
            border-radius: 12px;
            font-size: 10.5px;
            font-weight: 900;
            font-family: 'JetBrains Mono', 'Fira Code', monospace;
            background: color-mix(in srgb, var(--ai-color) 14%, var(--card-bg));
            color: var(--ai-color);
            border: 1px solid transparent;
        }

        .ai-pred-meta {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 11.5px;
            color: var(--text-muted);
        }

        .ai-pred-rank-badge {
            font-weight: 800;
            font-family: monospace;
            background: color-mix(in srgb, var(--text-muted) 10%, var(--card-bg));
            border: 1px solid transparent;
            padding: 2px 6px;
            border-radius: 6px;
        }

        .ai-pred-track {
            width: 100%;
            height: 4px;
            background: color-mix(in srgb, var(--text-muted) 15%, transparent);
            border-radius: 4px;
            overflow: hidden;
        }

        .ai-pred-fill {
            height: 100%;
            background: linear-gradient(90deg, #6366f1, var(--ai-color));
            border-radius: 4px;
            transition: width 0.4s ease;
        }

        /* 4. Custom Keywords Add Box */
        .custom-add-box {
            display: flex;
            gap: 8px;
            padding: 10px;
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            margin-bottom: 10px;
        }

        .custom-add-btn {
            background: var(--primary-color);
            color: #ffffff;
            border: none;
            border-radius: 8px;
            padding: 0 16px;
            font-size: 12px;
            font-weight: 800;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            transition: all 0.2s ease;
            white-space: nowrap;
        }

        .custom-add-btn:hover {
            filter: brightness(1.1);
            transform: translateY(-1px);
        }

        /* Density Table */
        .density-table { width: 100%; border-collapse: collapse; text-align: right; }
        .density-table th { padding: 10px; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border-color); }
        .density-table td { padding: 10px; font-size: 14px; color: var(--text-main); border-bottom: 1px solid var(--border-color); direction: ltr; text-align: left;}
        .density-badge { background: rgba(59, 130, 246, 0.15); color: #3b82f6; padding: 4px 8px; border-radius: 6px; font-weight: 700; font-size: 12px; }

        /* =========================================
           CUSTOM SELECT DROPDOWNS & WIZARD
           ========================================= */
        .custom-select { position: relative; width: 100%; user-select: none;}
        .select-trigger { background: var(--bg-body); border: 1px solid var(--border-color); padding: 12px 16px; border-radius: 12px; color: var(--text-main); font-size: 14px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: 0.2s; }
        .select-trigger:hover { border-color: var(--ai-color); }
        .custom-options { position: absolute; top: 100%; left: 0; right: 0; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 12px; margin-top: 8px; box-shadow: var(--shadow-lg); opacity: 0; visibility: hidden; transform: translateY(10px); transition: 0.2s; z-index: 200; max-height: 250px; overflow-y: auto; padding: 4px;}
        .custom-select.open .custom-options { opacity: 1; visibility: visible; transform: translateY(0); }
        .select-search-box { padding: 4px; position: sticky; top: 0; background: var(--card-bg); z-index: 2;}
        .select-search-box input { width: 100%; background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-main); padding: 8px; border-radius: 8px; outline: none; font-size: 12px;}
        .custom-option { padding: 10px 12px; cursor: pointer; transition: 0.2s; color: var(--text-main); font-size: 13px; font-weight: 600; border-radius: 8px; display: flex; align-items: center; gap: 8px;}
        .custom-option:hover { background: var(--primary-light); color: var(--primary-color); }

        /* Auto Workspace Floating Panel (V8) */
        .aw-floating-panel { position: fixed; bottom: 20px; right: 20px; width: 340px; background: var(--glass-bg); backdrop-filter: blur(20px); border: 1px solid var(--ai-color); border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); z-index: 10000; display: none; flex-direction: column; overflow: hidden; transform: translateY(20px); opacity: 0; transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
        .aw-floating-panel.active { transform: translateY(0); opacity: 1; display: flex; }
        .aw-header { padding: 12px 16px; background: rgba(139, 92, 246, 0.15); border-bottom: 1px solid rgba(139, 92, 246, 0.3); display: flex; justify-content: space-between; align-items: center; font-weight: 700; font-size: 14px; color: var(--text-main);}
        .aw-ctrl-btn { background: var(--card-bg); border: 1px solid var(--border-color); color: var(--text-main); width: 28px; height: 28px; border-radius: 6px; display: flex; align-items: center; justify-content: center; cursor: pointer; transition: 0.2s;}
        .aw-ctrl-btn:hover { background: var(--primary-light); color: var(--primary-color); border-color: var(--primary-color); }
        .aw-ctrl-btn.danger:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }
        .aw-list { max-height: 250px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px;}
        .aw-item { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-muted); transition: 0.2s;}
        .aw-item.active { border-color: var(--ai-color); color: var(--text-main); background: var(--ai-light); }
        .aw-item.done { border-color: var(--success); color: var(--success); }
        .aw-item.skipped { border-color: var(--warning); color: var(--warning); text-decoration: line-through; opacity: 0.5;}

        /* AI Wizard General */
        .ai-wizard-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); backdrop-filter: blur(10px); display: none; align-items: center; justify-content: center; z-index: 100000; opacity: 0; transition: 0.3s; }
        .ai-wizard-overlay.active { display: flex; opacity: 1; }
        .wizard-container { width: 95vw; height: 90vh; max-width: 1400px; background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 24px; display: flex; overflow: hidden; box-shadow: 0 30px 100px rgba(0,0,0,0.8); transform: scale(0.95) translateY(20px); transition: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
        .ai-wizard-overlay.active .wizard-container { transform: scale(1) translateY(0); }
        .w-sidebar { width: 280px; background: var(--bg-body); border-left: 1px solid var(--border-color); padding: 30px 20px; display: flex; flex-direction: column; }
        .w-logo { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--text-main); margin-bottom: 40px; }
        .w-logo svg { color: var(--ai-color); width: 28px; height: 28px; }
        .w-steps { display: flex; flex-direction: column; gap: 8px; flex: 1; }
        .w-step { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; color: var(--text-muted); font-size: 14px; font-weight: 700; cursor: pointer; transition: 0.2s; }
        .w-step .s-num { width: 24px; height: 24px; border-radius: 50%; background: var(--card-bg); border: 1px solid var(--border-color); display: flex; align-items: center; justify-content: center; font-size: 12px; font-family: monospace;}
        .w-step.active { background: var(--ai-light); color: var(--text-main); }
        .w-step.active .s-num { background: var(--ai-color); border-color: var(--ai-color); color: white; }
        .w-step.completed { color: var(--text-main); }
        .w-step.completed .s-num { background: var(--success); border-color: var(--success); color: white; }
        .w-content-area { flex: 1; display: flex; flex-direction: column; background: var(--card-bg); position: relative; }
        .w-header { padding: 20px 40px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
        .w-header-actions { display: flex; gap: 12px; align-items: center; }
        .w-body { flex: 1; overflow-y: auto; padding: 40px; }
        .w-pane { display: none; animation: fadeIn 0.3s ease; }
        .w-pane.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
        .w-footer { padding: 20px 40px; border-top: 1px solid var(--border-color); background: var(--bg-body); display: flex; justify-content: space-between; align-items: center; }
        .btn-outline { padding: 12px 24px; border-radius: 12px; border: 1px solid var(--border-color); background: var(--card-bg); color: var(--text-main); font-weight: 700; cursor: pointer; transition: 0.2s; font-family: inherit;}
        .btn-outline:hover { background: var(--border-color); }
        .btn-ai-primary { padding: 12px 30px; border-radius: 12px; border: none; background: linear-gradient(135deg, var(--ai-color), #c084fc); color: #fff; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 8px; box-shadow: 0 8px 20px var(--ai-glow); transition: 0.2s; font-family: inherit; font-size: 16px;}
        .btn-ai-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 25px var(--ai-glow); }
        
        .form-group { margin-bottom: 24px; }
        .form-group label { display: block; font-size: 14px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; }
        .form-control { width: 100%; background: var(--bg-body); border: 1px solid var(--border-color); padding: 14px 16px; border-radius: 12px; color: var(--text-main); font-size: 15px; outline: none; transition: 0.2s; font-family: inherit;}
        .form-control:focus { border-color: var(--ai-color); box-shadow: 0 0 0 3px var(--ai-light); }
        textarea.form-control { resize: vertical; min-height: 100px; }
        .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
        .select-card { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; transition: 0.2s; display: flex; flex-direction: column; align-items: center; gap: 8px; }
        .select-card svg { width: 24px; height: 24px; color: var(--text-muted); }
        .select-card.active { border-color: var(--ai-color); background: var(--ai-light); box-shadow: 0 4px 15px var(--ai-glow); }
        .select-card.active svg { color: var(--ai-color); }
        
        .range-wrapper { display: flex; align-items: center; gap: 16px; direction: ltr;}
        .range-slider { flex: 1; -webkit-appearance: none; background: var(--border-color); height: 6px; border-radius: 6px; outline: none; }
        .range-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--ai-color); cursor: pointer; box-shadow: 0 0 10px var(--ai-glow); }
        .range-val { width: 50px; text-align: center; font-family: monospace; font-weight: 800; font-size: 14px; color: var(--ai-color); background: var(--ai-light); padding: 4px; border-radius: 6px;}

        /* Outline Drag Drop */
        .ob-container { border: 1px solid var(--border-color); border-radius: 16px; background: var(--bg-body); overflow: hidden; }
        .ob-header { padding: 16px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
        .ob-list { padding: 16px; display: flex; flex-direction: column; gap: 4px; min-height: 200px; }
        .ob-item { display: flex; align-items: center; gap: 12px; background: var(--card-bg); border: 1px solid var(--border-color); padding: 10px 12px; border-radius: 10px; transition: transform 0.2s, box-shadow 0.2s; position:relative;}
        .ob-item.dragging { opacity: 0.5; border: 2px dashed var(--ai-color); z-index:100; }
        .ob-drag { cursor: grab; color: var(--text-muted); padding: 4px;}
        .ob-drag:active { cursor: grabbing; }
        .ob-tag-sel { background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-main); border-radius: 6px; padding: 4px 8px; font-weight: 800; font-family: monospace; outline: none; cursor: pointer;}
        .ob-tag-sel:focus { border-color: var(--primary-color);}
        .ob-input { flex: 1; background: transparent; border: none; color: var(--text-main); font-size: 14px; font-weight: 600; outline: none; }
        .ob-actions { display: flex; gap: 4px; }
        .ob-btn { width: 28px; height: 28px; border-radius: 6px; background: var(--bg-body); color: var(--text-muted); display: flex; align-items: center; justify-content: center; cursor: pointer; border: 1px solid var(--border-color); transition: 0.2s;}
        .ob-btn:hover { background: var(--primary-light); color: var(--primary-color); border-color: var(--primary-color);}
        .ob-btn.danger:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger);}
        .ob-add-between { height: 8px; margin: 2px 0; border-radius: 4px; background: transparent; cursor: pointer; transition: 0.2s; position: relative; display: flex; align-items: center; justify-content: center;}
        .ob-add-between:hover { background: var(--primary-light); }
        .ob-add-between::after { content: '+'; position: absolute; opacity: 0; color: var(--primary-color); font-weight: bold; font-size: 18px;}
        .ob-add-between:hover::after { opacity: 1; }

        /* Secondary Keywords Manager */
        .sec-kw-manager { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; margin-bottom: 16px;}
        .sec-kw-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;}
        .sec-kw-list { display: flex; flex-wrap: wrap; gap: 8px; max-height: 200px; overflow-y: auto; padding: 4px;}
        .sec-kw-item { background: var(--card-bg); border: 1px solid var(--border-color); padding: 4px 8px; border-radius: 8px; display: flex; align-items: center; gap: 6px; font-size: 12px;}
        .sec-kw-target { width: 40px; background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-main); text-align: center; border-radius: 4px; outline: none; font-family: monospace;}
        .sec-kw-del { color: var(--text-muted); cursor: pointer; }
        .sec-kw-del:hover { color: var(--danger); }

        /* FAQ Manager */
        .faq-manager { background: var(--bg-body); border: 1px solid var(--border-color); border-radius: 12px; padding: 16px; }
        .faq-list { display: flex; flex-direction: column; gap: 8px; max-height: 200px; overflow-y: auto;}
        .faq-item { background: var(--card-bg); border: 1px solid var(--border-color); padding: 10px 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 13px;}
        .faq-check { accent-color: var(--ai-color); width: 16px; height: 16px; cursor: pointer;}
        
        /* Generating Screen */
        .generating-screen { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; padding: 60px 0;}
        .orb { width: 100px; height: 100px; border-radius: 50%; background: conic-gradient(from 0deg, var(--ai-color), #c084fc, var(--ai-color)); animation: spinOrb 2s linear infinite; position: relative; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; box-shadow: 0 0 50px var(--ai-glow); }
        .orb::after { content: ''; position: absolute; inset: 4px; background: var(--card-bg); border-radius: 50%; }
        .orb svg { position: relative; z-index: 2; width: 30px; height: 30px; color: #fff; }
        @keyframes spinOrb { 100% { transform: rotate(360deg); } }
        .gen-status { font-size: 20px; font-weight: 800; color: var(--text-main); margin-bottom: 10px; }
        .gen-sub { font-size: 14px; color: var(--text-muted); font-weight: 600;}

        /* =========================================================
           ADVANCED MAIN-EDITOR & FLOATING TOOLBAR (V6 ➔ V7 INTEGRATED)
           ========================================================= */
        .editor-content-wrapper {
            flex: 1;
            display: flex;
            position: relative;
            overflow: hidden;
            background: var(--card-bg);
            border-radius: 0;
            min-height: 250px;
        }

        /* Gutter Line Numbers */
        .line-numbers {
            width: 44px;
            padding: 24px 8px 24px 0;
            text-align: right;
            font-family: 'JetBrains Mono', 'Fira Code', monospace;
            font-size: 13px;
            line-height: 1.8;
            color: color-mix(in srgb, var(--text-muted) 60%, transparent);
            background: color-mix(in srgb, var(--bg-body) 60%, var(--card-bg));
            border-right: 1px solid var(--border-color);
            user-select: none;
            overflow: hidden;
            flex-shrink: 0;
        }

        .editor.art-ed {
            flex: 1;
            padding: 24px 30px 40px 30px;
            overflow-y: auto;
            outline: none;
            font-size: 15.5px;
            line-height: 1.8;
            color: var(--text-main);
            font-family: inherit;
            position: relative;
        }
        .editor.art-ed h1 { font-size: 24px; font-weight: 800; margin: 0 0 16px; color: var(--text-main); line-height: 1.3; }
        .editor.art-ed h2 { font-size: 20px; font-weight: 700; margin: 20px 0 12px; color: var(--text-main); }
        .editor.art-ed h3 { font-size: 17px; font-weight: 700; margin: 16px 0 10px; color: var(--text-main); }
        .editor.art-ed h4 { font-size: 15px; font-weight: 700; margin: 14px 0 8px; color: var(--text-main); }
        .editor.art-ed h5, .editor.art-ed h6 { font-size: 14px; font-weight: 700; margin: 12px 0 6px; color: var(--text-muted); }
        .editor.art-ed p { margin-bottom: 14px; }
        .editor.art-ed blockquote { border-left: 3px solid var(--primary-color); padding: 8px 16px; margin: 14px 0; background: color-mix(in srgb, var(--primary-color) 8%, transparent); border-radius: 0 8px 8px 0; font-style: italic; color: var(--text-muted); }
        .editor.art-ed hr { border: none; border-top: 1px dashed var(--border-color); margin: 20px 0; }
        .editor.art-ed a { color: var(--primary-color); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
        .editor.art-ed img { max-width: 100%; border-radius: 12px; margin: 12px 0; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); }
        .editor.art-ed table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
        .editor.art-ed th, .editor.art-ed td { border: 1px solid var(--border-color); padding: 8px 12px; text-align: left; }
        .editor.art-ed th { background: color-mix(in srgb, var(--primary-color) 10%, var(--card-bg)); font-weight: 700; }

        /* =========================================================
           AUTHENTIC V6 FLOATING TOOLBAR & CARD SUBMENUS
           ========================================================= */
        .toolbar.boxbar-ed {
            position: absolute;
            z-index: 1000;
            user-select: none;
            transition: opacity 0.15s ease, transform 0.15s ease;
        }
        .toolbar.boxbar-ed.none { display: none !important; }

        .ul-boxbar-ed {
            background: var(--card-bg);
            color: var(--text-main);
            border-radius: 12px;
            border: 1px solid var(--border-color);
            box-shadow: var(--shadow-lg), 0 12px 35px rgba(0,0,0,0.35);
            padding: 6px 4px;
            margin: 0;
            list-style: none;
            width: 250px;
            display: flex;
            flex-direction: column;
            gap: 2px;
            backdrop-filter: blur(25px);
        }

        .he-boxbar-ed {
            width: 100%;
            padding: 2px 0 6px;
            border-bottom: 1px solid var(--border-color);
            margin-bottom: 4px;
        }

        .ul-top-bb-ed {
            list-style: none;
            margin: 0 auto;
            padding: 2px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: color-mix(in srgb, var(--bg-body) 60%, var(--card-bg));
            border-radius: 8px;
            gap: 2px;
        }

        .li-l-bb-ed { position: relative; }

        .item-t-bb-ed {
            background: transparent;
            border: 1px solid transparent;
            color: var(--text-muted);
            width: 28px;
            height: 28px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: 0.15s;
            font-size: 13px;
        }
        .item-t-bb-ed svg { width: 14px; height: 14px; pointer-events: none; }
        .item-t-bb-ed:hover, .item-t-bb-ed.active {
            background: color-mix(in srgb, var(--primary-color) 15%, var(--card-bg));
            color: var(--primary-color);
        }

        .li-boxbar-ed { position: relative; width: 100%; }

        .item-bb-ed {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 6px 10px;
            border-radius: 8px;
            color: var(--text-main);
            font-size: 13.5px;
            font-weight: 600;
            cursor: pointer;
            transition: 0.15s;
            background: transparent;
            border: 1px solid transparent;
            width: 100%;
            box-sizing: border-box;
        }
        .item-bb-ed:hover, .item-bb-ed.active, .li-boxbar-ed:hover > .item-bb-ed {
            background: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg));
            color: var(--primary-color);
        }
        .item-bb-ed .name-i-bb-ed {
            flex: 1;
            text-align: left;
            font-size: 13.5px;
            font-weight: 600;
            padding-left: 8px;
        }
        .item-bb-ed .icon-i-bb-ed {
            font-size: 14px;
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            background: color-mix(in srgb, var(--bg-body) 80%, var(--card-bg));
            border: 1px solid var(--border-color);
            color: var(--text-muted);
            flex-shrink: 0;
        }
        .item-bb-ed .icon-slide-ed {
            font-size: 12px;
            color: var(--text-muted);
            opacity: 0.7;
            margin-left: auto;
        }

        /* Flyout Child Menus */
        .ul-boxbar-ed.child {
            position: absolute;
            left: 100%;
            top: -6px;
            margin-left: 6px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            box-shadow: var(--shadow-lg), 0 12px 35px rgba(0,0,0,0.35);
            padding: 6px;
            display: none;
            flex-direction: column;
            gap: 2px;
            min-width: 180px;
            z-index: 1010;
            backdrop-filter: blur(25px);
        }
        .boxbar-ed.left .ul-boxbar-ed.child {
            left: auto;
            right: 100%;
            margin-left: 0;
            margin-right: 6px;
        }
        .li-boxbar-ed:hover > .ul-boxbar-ed.child,
        .li-l-bb-ed:hover > .ul-top-bb-ed.child {
            display: flex;
        }

        .ul-top-bb-ed.child {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 6px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            box-shadow: var(--shadow-lg);
            padding: 4px;
            display: none;
            flex-direction: column;
            gap: 2px;
            z-index: 1010;
        }

        .input-ed {
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            color: var(--text-main);
            padding: 8px 12px;
            border-radius: 8px;
            font-size: 12.5px;
            width: 100%;
            outline: none;
            box-sizing: border-box;
            transition: 0.2s;
        }
        .input-ed:focus { border-color: var(--primary-color); box-shadow: 0 0 0 2px var(--primary-light); }
        .title-bb-ed { font-size: 11px; font-weight: 800; text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px; }
        .li-insert-ed { padding: 4px 6px; }
        .btn-insert-ed {
            background: color-mix(in srgb, var(--primary-color) 18%, var(--card-bg));
            color: var(--primary-color);
            font-weight: 800;
            font-size: 12px;
            padding: 6px 14px;
            border-radius: 7px;
            cursor: pointer;
            text-align: center;
            transition: 0.2s;
            display: inline-block;
        }
        .btn-insert-ed:hover { background: var(--primary-color); color: #fff; }
        .box-image-ed { width: 100%; height: 90px; border-radius: 8px; border: 1px dashed var(--border-color); display: flex; align-items: center; justify-content: center; overflow: hidden; background: var(--bg-body); margin: 4px 0; }
        .img-image-ed { max-width: 100%; max-height: 100%; object-fit: contain; }

        /* Color & Emoji Dropdown Styling */
        .ul-boxbar-ed.child.color, .ul-boxbar-ed.child.emoji { width: 290px; padding: 10px; max-height: 330px; }
        .scroll-boxbar-ed { max-height: 210px; overflow-y: auto; padding-right: 4px; }
        .emoji-input { width: 100%; background: var(--bg-body); border: 1px solid var(--border-color); color: var(--text-main); padding: 6px 10px; border-radius: 8px; font-size: 12px; outline: none; margin-bottom: 8px; box-sizing: border-box;}
        .emoji-input:focus { border-color: var(--primary-color); }
        .ul-emoji-boxbar-ed { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; list-style: none; margin: 0; padding: 0; }
        .li-emoji-ed { display: flex; align-items: center; justify-content: center; font-size: 18px; height: 32px; border-radius: 6px; cursor: pointer; transition: 0.15s; }
        .li-emoji-ed:hover { background: var(--primary-light); transform: scale(1.2); }
        .color-i-t-bb-ed { width: 18px; height: 18px; border-radius: 4px; box-shadow: 0 0 2px rgba(0,0,0,0.3); }

        /* VS Code Style Find & Replace Section */
        .toggle-search-btn {
            position: absolute;
            top: 12px;
            right: 18px;
            width: 32px;
            height: 32px;
            border-radius: 8px;
            background: color-mix(in srgb, var(--card-bg) 90%, var(--bg-body));
            border: 1px solid var(--border-color);
            color: var(--text-muted);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 40;
            transition: 0.2s;
        }
        .toggle-search-btn:hover { color: var(--primary-color); border-color: var(--primary-color); background: var(--primary-light); }
        
        #find-replace-section {
            position: absolute;
            top: 10px;
            right: 58px;
            background: color-mix(in srgb, var(--card-bg) 95%, var(--bg-body));
            backdrop-filter: blur(25px);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            box-shadow: var(--shadow-lg), 0 10px 30px rgba(0,0,0,0.25);
            padding: 8px 12px;
            z-index: 50;
            display: flex;
            flex-direction: column;
            gap: 6px;
            width: 360px;
            animation: fadeIn 0.2s ease;
        }
        #find-replace-section.hidden { display: none !important; }
        .search-container, .replace-container { display: flex; align-items: center; gap: 6px; }
        .search-input-wrapper, .replace-input-wrapper { flex: 1; position: relative; }
        .search-input-wrapper input, .replace-input-wrapper input {
            width: 100%;
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            color: var(--text-main);
            padding: 5px 10px;
            border-radius: 6px;
            font-size: 12.5px;
            outline: none;
            box-sizing: border-box;
            font-family: inherit;
        }
        .search-input-wrapper input:focus, .replace-input-wrapper input:focus { border-color: var(--primary-color); }
        .search-controls, .nav-controls, .replace-controls { display: flex; align-items: center; gap: 2px; }
        .search-btn, .nav-btn, .replace-btn {
            background: transparent;
            border: 1px solid transparent;
            color: var(--text-muted);
            width: 24px;
            height: 24px;
            border-radius: 5px;
            font-size: 11px;
            font-weight: 800;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: 0.15s;
        }
        .search-btn:hover, .nav-btn:hover, .replace-btn:hover { background: var(--border-color); color: var(--text-main); }
        .search-btn.active { background: color-mix(in srgb, var(--primary-color) 20%, var(--card-bg)); color: var(--primary-color); }
        #result-count { font-size: 11px; font-family: monospace; font-weight: 700; color: var(--text-muted); padding: 0 4px; white-space: nowrap; }
        .close-btn { background: transparent; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; padding: 0 4px; }
        .close-btn:hover { color: var(--danger); }

        /* Find & Replace Match Highlighting */
        mark.gr-find-match {
            background-color: rgba(245, 158, 11, 0.35) !important;
            color: inherit !important;
            border-radius: 2px;
            padding: 1px 2px;
            margin: 0;
            outline: 1px solid rgba(245, 158, 11, 0.5);
            transition: all 0.15s ease;
            box-decoration-break: clone;
            -webkit-box-decoration-break: clone;
        }

        mark.gr-find-match.active {
            background-color: #f59e0b !important;
            color: #000000 !important;
            font-weight: 700 !important;
            box-shadow: 0 0 0 2px #d97706, 0 0 10px rgba(245, 158, 11, 0.5) !important;
            outline: none !important;
            border-radius: 3px;
        }

        html[data-theme="dark"] mark.gr-find-match,
        body.dark-mode mark.gr-find-match,
        .dark-theme mark.gr-find-match {
            background-color: rgba(251, 191, 36, 0.3) !important;
            outline: 1px solid rgba(251, 191, 36, 0.4);
        }

        html[data-theme="dark"] mark.gr-find-match.active,
        body.dark-mode mark.gr-find-match.active,
        .dark-theme mark.gr-find-match.active {
            background-color: #fbbf24 !important;
            color: #0f172a !important;
            box-shadow: 0 0 0 2px #f59e0b, 0 0 12px rgba(251, 191, 36, 0.6) !important;
        }

        /* =========================================================
           ULTRA-PREMIUM DOCKED COMPETITOR COPILOT (V7 ELEVATED)
           ========================================================= */
        .helper-plugin-dock {
            width: 100%;
            flex-shrink: 0;
            background: color-mix(in srgb, var(--card-bg) 95%, transparent);
            border-top: 1px solid color-mix(in srgb, var(--primary-color) 30%, var(--border-color));
            position: relative;
            z-index: 20;
            display: flex;
            flex-direction: column;
            box-shadow: 0 -4px 25px rgba(0, 0, 0, 0.08);
            transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .box-EHelper {
            position: relative;
            width: 100%;
            background: transparent;
            border: none;
            box-shadow: none;
            border-radius: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            user-select: none;
            height: auto;
        }

        .box-EHelper.collapsed .container-EditorHelper {
            max-height: 0 !important;
            padding-top: 0 !important;
            padding-bottom: 0 !important;
            opacity: 0 !important;
            pointer-events: none;
            transform: translateY(10px);
        }

        /* --- Plugin Header Strip --- */
        .helper-plugin-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 6px 16px;
            background: color-mix(in srgb, var(--bg-body) 70%, var(--card-bg));
            border-bottom: 1px solid var(--border-color);
            min-height: 40px;
            box-sizing: border-box;
            gap: 12px;
        }

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

        .helper-plugin-badge {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 18%, var(--card-bg)), color-mix(in srgb, #a855f7 14%, var(--card-bg)));
            border: 1px solid color-mix(in srgb, var(--primary-color) 30%, transparent);
            color: var(--primary-color);
            font-size: 11.5px;
            font-weight: 800;
            padding: 3px 10px;
            border-radius: 20px;
            letter-spacing: 0.2px;
            box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
        }

        .helper-pulse-dot {
            width: 7px;
            height: 7px;
            background: #10b981;
            border-radius: 50%;
            box-shadow: 0 0 8px #10b981;
            animation: pulse-dot-anim 2s infinite ease-in-out;
        }

        @keyframes pulse-dot-anim {
            0%, 100% { transform: scale(1); opacity: 1; }
            50% { transform: scale(1.4); opacity: 0.55; }
        }

        .helper-match-chip {
            display: inline-flex;
            align-items: center;
            font-size: 11px;
            font-weight: 700;
            color: var(--primary-color);
            background: color-mix(in srgb, var(--primary-color) 8%, var(--card-bg));
            border: 1px solid color-mix(in srgb, var(--primary-color) 20%, transparent);
            padding: 3px 10px;
            border-radius: 8px;
            max-width: 240px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .helper-header-center {
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .helper-page-indicator {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            padding: 3px 10px;
            border-radius: 8px;
            letter-spacing: 0.2px;
        }

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

        .helper-action-pill {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            color: var(--text-main);
            font-size: 11px;
            font-weight: 700;
            padding: 4px 11px;
            border-radius: 7px;
            cursor: pointer;
            transition: all 0.18s ease;
        }

        .helper-action-pill:hover {
            background: var(--border-color);
            transform: translateY(-1px);
        }

        .helper-action-pill.helper-action-primary {
            background: var(--primary-color);
            color: #fff;
            border-color: var(--primary-color);
            box-shadow: 0 2px 10px var(--primary-light);
        }

        .helper-action-pill.helper-action-primary:hover {
            opacity: 0.94;
            box-shadow: 0 4px 14px var(--primary-light);
        }

        .helper-action-pill.helper-action-ai {
            background: color-mix(in srgb, #a855f7 16%, var(--card-bg));
            border-color: color-mix(in srgb, #a855f7 35%, transparent);
            color: #c084fc;
        }

        .helper-action-pill.helper-action-ai:hover {
            background: #a855f7;
            color: #fff;
        }

        .helper-collapse-btn {
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 5px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            transition: transform 0.22s ease, color 0.15s ease, background 0.15s ease;
        }

        .helper-collapse-btn:hover {
            color: var(--text-main);
            background: var(--border-color);
        }

        .box-EHelper.collapsed .helper-collapse-btn svg {
            transform: rotate(180deg);
        }

        /* --- Drawer Content: 3-Column Executive Studio Grid --- */
        .container-EditorHelper {
            padding: 8px 14px 10px 14px;
            width: 100%;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            gap: 8px;
            max-height: 220px;
            opacity: 1;
            transform: translateY(0);
            transition: max-height 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease, padding 0.3s ease, transform 0.25s ease;
            overflow: hidden;
        }

        .copilot-studio-grid {
            display: grid;
            grid-template-columns: 240px 1fr 180px;
            gap: 10px;
            align-items: stretch;
            width: 100%;
            min-height: 120px;
        }

        /* Col 1: Competitors SERP Rail Hub */
        .copilot-competitors-hub {
            background: color-mix(in srgb, var(--bg-body) 70%, var(--card-bg));
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 7px 9px;
            display: flex;
            flex-direction: column;
            gap: 6px;
            overflow: hidden;
        }

        .copilot-hub-title {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 10.5px;
            font-weight: 800;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }

        .copilot-sites-scroll-rail {
            flex: 1;
            overflow-y: auto;
            overflow-x: hidden;
            max-height: 90px;
            padding-right: 2px;
        }

        .listSite-helper {
            display: flex;
            flex-direction: column;
            gap: 4px;
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .copilot-site-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 3px 7px;
            border-radius: 7px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            cursor: pointer;
            transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
            user-select: none;
        }

        .copilot-site-item:hover {
            background: color-mix(in srgb, var(--primary-color) 10%, var(--card-bg));
            border-color: var(--primary-color);
            transform: translateX(2px);
        }

        .copilot-site-item.active {
            background: color-mix(in srgb, var(--primary-color) 16%, var(--card-bg));
            border-color: var(--primary-color);
            box-shadow: 0 0 10px var(--primary-light);
        }

        .copilot-site-rank {
            font-size: 10px;
            font-weight: 900;
            color: var(--text-muted);
            width: 16px;
            text-align: center;
        }

        .copilot-site-icon {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            background: #fff;
            padding: 1px;
            object-fit: contain;
        }

        .copilot-site-domain {
            font-size: 11.5px;
            font-weight: 700;
            color: var(--text-main);
            flex: 1;
            margin: 0 6px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .copilot-site-score {
            font-size: 9.5px;
            font-weight: 800;
            padding: 1px 5px;
            border-radius: 5px;
            background: color-mix(in srgb, #10b981 18%, var(--card-bg));
            color: #10b981;
            border: 1px solid color-mix(in srgb, #10b981 30%, transparent);
        }

        /* Col 2: Hero Quotation Card */
        .copilot-hero-quote-card {
            background: linear-gradient(135deg, color-mix(in srgb, var(--bg-body) 60%, var(--card-bg)), var(--card-bg));
            border: 1px solid color-mix(in srgb, var(--primary-color) 30%, var(--border-color));
            border-radius: 12px;
            padding: 7px 12px;
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            position: relative;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
            overflow: hidden;
        }

        .hero-quote-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-bottom: 1px solid color-mix(in srgb, var(--border-color) 60%, transparent);
            padding-bottom: 4px;
        }

        .quote-header-title {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            font-weight: 800;
            color: var(--primary-color);
        }

        .quote-spark-icon {
            background: var(--primary-light);
            color: var(--primary-color);
            border-radius: 5px;
            padding: 2px 4px;
            display: flex;
            align-items: center;
        }

        .quote-nav-controls {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .quote-page-count {
            font-size: 10.5px;
            font-weight: 800;
            color: var(--text-muted);
            font-family: monospace;
        }

        .btn-load-EHelper {
            width: 22px;
            height: 20px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 5px;
            cursor: pointer;
            color: var(--text-main);
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s ease;
        }

        .btn-load-EHelper svg { width: 12px; height: 12px; }

        .btn-load-EHelper:hover {
            background: var(--primary-color);
            color: #fff;
            border-color: var(--primary-color);
        }

        .btn-dis-EHelper, .btn-dis-EHelper:hover {
            opacity: 0.3;
            pointer-events: none;
        }

        .hero-quote-body {
            flex: 1;
            padding: 4px 0;
            display: flex;
            align-items: center;
        }

        .listparts-helper {
            list-style: none;
            padding: 0;
            margin: 0;
            width: 100%;
        }

        .partTxt-EHelper {
            font-size: 13px;
            font-weight: 500;
            line-height: 1.5;
            color: var(--text-main);
            font-style: italic;
            cursor: pointer;
            transition: 0.15s;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        mark.copilot-kw-mark {
            background: color-mix(in srgb, var(--primary-color) 18%, transparent);
            color: var(--primary-color);
            padding: 1px 4px;
            border-radius: 4px;
            font-weight: 800;
            font-style: normal;
            border-bottom: 1.5px solid var(--primary-color);
        }

        .partTxt-EHelper:hover {
            color: var(--primary-color);
        }

        .hero-quote-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            border-top: 1px solid color-mix(in srgb, var(--border-color) 60%, transparent);
            padding-top: 4px;
        }

        .quote-footer-hint {
            font-size: 10px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .quote-quick-actions {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .btn-quote-action {
            font-size: 10.5px;
            font-weight: 700;
            padding: 2px 8px;
            border-radius: 5px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            color: var(--text-main);
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 3px;
            transition: 0.15s;
        }

        .btn-quote-action:hover {
            background: var(--border-color);
            transform: translateY(-1px);
        }

        .btn-quote-action.primary {
            background: var(--primary-color);
            color: #fff;
            border-color: var(--primary-color);
            box-shadow: 0 2px 6px var(--primary-light);
        }

        .btn-quote-action.primary:hover {
            opacity: 0.92;
        }

        .btn-quote-action.ai {
            background: color-mix(in srgb, #a855f7 16%, var(--card-bg));
            border-color: color-mix(in srgb, #a855f7 35%, transparent);
            color: #c084fc;
        }

        .btn-quote-action.ai:hover {
            background: #a855f7;
            color: #fff;
        }

        /* Col 3: Selected Competitor Profile Card */
        .copilot-source-profile {
            background: color-mix(in srgb, var(--bg-body) 70%, var(--card-bg));
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 8px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            gap: 5px;
        }

        .source-avatar-ring {
            position: relative;
            width: 38px;
            height: 38px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .source-avatar-ring .img-EHelper {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            background: #fff;
            border: 2px solid var(--border-color);
            padding: 2px;
            object-fit: contain;
        }

        .source-score-ring {
            position: absolute;
            bottom: -3px;
            right: -5px;
            background: #10b981;
            color: #fff;
            font-size: 9px;
            font-weight: 900;
            padding: 1px 4px;
            border-radius: 8px;
            border: 1.5px solid var(--card-bg);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
        }

        .source-details {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }

        .source-domain-row {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .source-domain-row .name-EHelper {
            font-size: 12px;
            font-weight: 800;
            color: var(--text-main);
            max-width: 120px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .source-verified-badge {
            color: var(--primary-color);
            display: flex;
            align-items: center;
        }

        /* State 1: Fetch Top 10 Competitors CTA Card */
        .copilot-fetch-card {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 8%, var(--card-bg)), color-mix(in srgb, #a855f7 6%, var(--card-bg)));
            border: 1px solid color-mix(in srgb, var(--primary-color) 25%, var(--border-color));
            border-radius: 12px;
            padding: 12px 18px;
            box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
            width: 100%;
            box-sizing: border-box;
        }

        .fetch-card-left {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 3px;
        }

        .fetch-card-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 10.5px;
            font-weight: 800;
            color: var(--primary-color);
            background: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg));
            padding: 2px 8px;
            border-radius: 20px;
            width: fit-content;
        }

        .fetch-card-title {
            font-size: 14px;
            font-weight: 800;
            color: var(--text-main);
            margin: 0;
            letter-spacing: 0.1px;
        }

        .fetch-card-desc {
            font-size: 12px;
            color: var(--text-muted);
            margin: 0;
            line-height: 1.4;
        }

        .fetch-card-right {
            display: flex;
            flex-direction: column;
            align-items: flex-end;
            gap: 6px;
            flex-shrink: 0;
        }

        .fetch-credit-pill {
            font-size: 10.5px;
            font-weight: 800;
            color: #f59e0b;
            background: color-mix(in srgb, #f59e0b 14%, var(--card-bg));
            border: 1px solid color-mix(in srgb, #f59e0b 25%, transparent);
            padding: 2px 8px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            gap: 4px;
        }

        .btn-fetch-competitors {
            display: inline-flex;
            align-items: center;
            gap: 7px;
            background: linear-gradient(135deg, var(--primary-color), color-mix(in srgb, #a855f7 70%, var(--primary-color)));
            color: #fff;
            border: none;
            padding: 8px 18px;
            border-radius: 8px;
            font-size: 12.5px;
            font-weight: 800;
            cursor: pointer;
            box-shadow: 0 4px 14px var(--primary-light);
            transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .btn-fetch-competitors:hover {
            transform: translateY(-1px);
            opacity: 0.95;
            box-shadow: 0 6px 18px var(--primary-light);
        }

        /* State 2: Step-by-Step Radar Progress Loader */
        .copilot-loading-card {
            display: flex;
            align-items: center;
            gap: 16px;
            background: color-mix(in srgb, var(--bg-body) 65%, var(--card-bg));
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 12px 18px;
            width: 100%;
            box-sizing: border-box;
            position: relative;
            overflow: hidden;
        }

        .loading-radar-orbit {
            position: relative;
            width: 44px;
            height: 44px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .radar-pulse-ring {
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 2px solid var(--primary-color);
            opacity: 0.8;
            animation: radarRingPulse 1.8s infinite cubic-bezier(0.2, 0.8, 0.2, 1);
        }

        .radar-pulse-ring.ring-2 {
            animation-delay: 0.6s;
        }

        @keyframes radarRingPulse {
            0% { transform: scale(0.6); opacity: 1; }
            100% { transform: scale(1.6); opacity: 0; }
        }

        .loading-progress-info {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .loading-status-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .loading-status-text {
            font-size: 13px;
            font-weight: 800;
            color: var(--text-main);
        }

        .loading-credit-badge {
            font-size: 11px;
            font-weight: 800;
            color: #10b981;
            background: color-mix(in srgb, #10b981 14%, var(--card-bg));
            padding: 2px 8px;
            border-radius: 6px;
            border: 1px solid color-mix(in srgb, #10b981 25%, transparent);
        }

        .loading-progress-track {
            width: 100%;
            height: 6px;
            background: var(--border-color);
            border-radius: 10px;
            overflow: hidden;
            position: relative;
        }

        .loading-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, var(--primary-color), #a855f7);
            border-radius: 10px;
            transition: width 0.35s ease;
        }

        .loading-sub-text {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* Keyboard Shortcuts Modal */
        .shortcuts-pop {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 90%;
            max-width: 600px;
            max-height: 80vh;
            background: var(--card-bg);
            backdrop-filter: blur(25px);
            border: 1px solid var(--border-color);
            border-radius: 18px;
            box-shadow: 0 25px 80px rgba(0,0,0,0.6);
            z-index: 100000;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            animation: fadeIn 0.25s ease;
        }
        .shortcuts-pop.none { display: none !important; }
        .shortcuts-header {
            padding: 16px 20px;
            background: var(--bg-body);
            border-bottom: 1px solid var(--border-color);
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .shortcuts-header h3 { margin: 0; font-size: 15px; font-weight: 800; color: var(--text-main); display: flex; align-items: center; gap: 8px; }
        .close-modal-btn { font-size: 22px; color: var(--text-muted); cursor: pointer; line-height: 1; }
        .close-modal-btn:hover { color: var(--danger); }
        .container-shortcut { padding: 18px 22px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
        .category-shortcut h4 { font-size: 13px; font-weight: 800; color: var(--primary-color); margin: 0 0 10px; border-bottom: 1px solid var(--border-color); padding-bottom: 4px; }
        .category-shortcut ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
        .category-shortcut li { font-size: 12.5px; color: var(--text-muted); display: flex; justify-content: space-between; }
        .shortcut-key { font-family: monospace; font-weight: 800; background: var(--bg-body); border: 1px solid var(--border-color); padding: 2px 6px; border-radius: 4px; color: var(--text-main); }

        /* ========================================================= */
        /* DOCKED COLLAPSIBLE SEO CONSOLE & SEO AUDIT DRAWERS (V6+)  */
        /* ========================================================= */
        .docked-drawer-panel {
            position: relative;
            width: 100%;
            background: var(--card-bg);
            border-top: 1px solid var(--border-color);
            flex-shrink: 0;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            transition: max-height 0.28s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.28s ease;
            z-index: 40;
        }

        .docked-drawer-panel.collapsed {
            max-height: 40px !important;
            box-shadow: none;
        }

        .docked-drawer-panel:not(.collapsed) {
            max-height: 380px;
            height: 300px;
            box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
        }

        .docked-drawer-panel.hidden-panel {
            display: none !important;
        }

        .drawer-header-strip {
            height: 40px;
            min-height: 40px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 16px;
            background: color-mix(in srgb, var(--bg-body) 70%, var(--card-bg));
            border-bottom: 1px solid var(--border-color);
            cursor: pointer;
            user-select: none;
            gap: 12px;
        }

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

        .drawer-header-badge {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            font-size: 11.5px;
            font-weight: 800;
            padding: 3px 9px;
            border-radius: 8px;
        }

        .drawer-header-badge.console {
            background: color-mix(in srgb, #3b82f6 14%, var(--card-bg));
            color: #3b82f6;
            border: 1px solid color-mix(in srgb, #3b82f6 25%, transparent);
        }

        .drawer-header-badge.audit {
            background: color-mix(in srgb, var(--primary-color) 14%, var(--card-bg));
            color: var(--primary-color);
            border: 1px solid color-mix(in srgb, var(--primary-color) 25%, transparent);
        }

        .console-category-tabs {
            display: flex;
            align-items: center;
            gap: 4px;
            background: var(--bg-body);
            padding: 2px;
            border-radius: 8px;
            border: 1px solid var(--border-color);
        }

        .cat-tab {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            padding: 3px 8px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            transition: 0.15s;
        }

        .cat-tab:hover {
            color: var(--text-main);
        }

        .cat-tab.active {
            background: var(--card-bg);
            color: var(--text-main);
            font-weight: 800;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
        }

        .console-filter-tabs {
            display: flex;
            align-items: center;
            gap: 5px;
        }

        .fc-tab {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            padding: 3px 8px;
            border-radius: 6px;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            transition: 0.15s;
        }

        .fc-tab.active {
            background: var(--primary-color);
            color: #fff;
            border-color: var(--primary-color);
            font-weight: 800;
        }

        .c-badge {
            font-size: 10px;
            font-weight: 800;
            padding: 1px 5px;
            border-radius: 10px;
            background: color-mix(in srgb, var(--text-muted) 20%, transparent);
        }

        .c-badge.red {
            background: #ef4444;
            color: #fff;
        }

        .c-badge.yellow {
            background: #f59e0b;
            color: #fff;
        }

        .c-badge.green {
            background: #10b981;
            color: #fff;
        }

        .drawer-header-center {
            display: flex;
            align-items: center;
            gap: 8px;
        }

        .drawer-center-hint {
            font-size: 11.5px;
            color: var(--text-muted);
            font-weight: 600;
        }

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

        .drawer-toggle-btn, .drawer-close-btn {
            background: transparent;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            border-radius: 6px;
            transition: 0.15s;
        }

        .drawer-toggle-btn:hover, .drawer-close-btn:hover {
            background: var(--border-color);
            color: var(--text-main);
        }

        .btn-drawer-action {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            color: var(--text-main);
            font-size: 11px;
            font-weight: 800;
            padding: 3px 8px;
            border-radius: 6px;
            cursor: pointer;
            transition: 0.15s;
        }

        .btn-drawer-action:hover {
            border-color: var(--primary-color);
            color: var(--primary-color);
        }

        .audit-score-pill {
            font-size: 10.5px;
            font-weight: 800;
            color: #10b981;
            background: color-mix(in srgb, #10b981 12%, var(--card-bg));
            border: 1px solid color-mix(in srgb, #10b981 25%, transparent);
            padding: 2px 7px;
            border-radius: 6px;
        }

        .drawer-body-wrap {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            padding: 10px 16px;
            background: var(--card-bg);
        }

        /* Diagnostic List Item Rows */
        .item-console-v7 {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 7px 12px;
            border-radius: 8px;
            margin-bottom: 5px;
            background: color-mix(in srgb, var(--bg-body) 60%, var(--card-bg));
            border: 1px solid var(--border-color);
            font-size: 12px;
            transition: 0.15s;
        }

        .item-console-v7:hover {
            border-color: color-mix(in srgb, var(--primary-color) 40%, var(--border-color));
            background: color-mix(in srgb, var(--bg-body) 85%, var(--card-bg));
        }

        .console-item-icon {
            padding-top: 2px;
            display: flex;
            align-items: center;
        }

        .console-item-content {
            flex: 1;
            display: flex;
            flex-direction: column;
            gap: 2px;
        }

        .console-item-title-row {
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .focus-pill {
            font-weight: 800;
            font-size: 10.5px;
            padding: 1px 6px;
            border-radius: 4px;
            background: var(--border-color);
            color: var(--text-main);
        }

        .console-item-msg {
            color: var(--text-main);
            font-size: 12px;
        }

        .fix-hint {
            font-size: 11px;
            color: var(--primary-color);
            font-weight: 700;
        }

        /* SEO Audit Dashboard */
        .audit-dashboard-grid {
            display: grid;
            grid-template-columns: 1fr 340px;
            gap: 14px;
            height: 100%;
        }

        .audit-box {
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 8px 12px;
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 8px;
        }

        .audit-box-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 11.5px;
            font-weight: 800;
            color: var(--text-main);
        }

        .audit-char-count {
            font-size: 10.5px;
            font-weight: 700;
            color: var(--text-muted);
        }

        .audit-input {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 6px 10px;
            font-size: 12px;
            color: var(--text-main);
            outline: none;
            font-family: inherit;
            width: 100%;
            box-sizing: border-box;
        }

        .audit-input:focus {
            border-color: var(--primary-color);
        }

        .audit-meta-goals {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            margin-top: 3px;
        }

        .goal-pill {
            font-size: 10px;
            font-weight: 700;
            padding: 1px 6px;
            border-radius: 4px;
            display: inline-flex;
            align-items: center;
            gap: 3px;
        }

        .goal-pill.passed {
            background: color-mix(in srgb, #10b981 12%, var(--card-bg));
            color: #10b981;
            border: 1px solid color-mix(in srgb, #10b981 25%, transparent);
        }

        .goal-pill.failed {
            background: color-mix(in srgb, #ef4444 12%, var(--card-bg));
            color: #ef4444;
            border: 1px solid color-mix(in srgb, #ef4444 25%, transparent);
        }

        .audit-score-card {
            display: flex;
            align-items: center;
            gap: 12px;
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 10px;
            padding: 10px;
            margin-bottom: 8px;
        }

        .audit-circle-dial {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            background: conic-gradient(#10b981 100%, var(--border-color) 0%);
            flex-shrink: 0;
            transition: background 0.4s ease;
        }

        .audit-dial-inner {
            width: 38px;
            height: 38px;
            background: var(--card-bg);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 900;
            font-size: 12px;
            color: var(--text-main);
        }

        .audit-score-details h4 {
            font-size: 12.5px;
            font-weight: 800;
            color: var(--text-main);
            margin: 0 0 2px 0;
        }

        .audit-score-details p {
            font-size: 11px;
            color: var(--text-muted);
            margin: 0;
            line-height: 1.3;
        }

        .audit-result {
            max-height: 140px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }

        .audit-res-item {
            font-size: 11.5px;
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 4px 8px;
            border-radius: 6px;
            background: var(--bg-body);
        }

        .audit-res-item.pro { color: #10b981; }
        .audit-res-item.sug { color: #f59e0b; }
        .audit-res-item.con { color: #ef4444; }

        /* Integrated Status Bar */
        .status-bar {
            height: 34px;
            min-height: 34px;
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 14px;
            background: color-mix(in srgb, var(--bg-body) 90%, var(--card-bg));
            border-top: 1px solid var(--border-color);
            font-size: 11.5px;
            color: var(--text-muted);
            flex-shrink: 0;
            user-select: none;
        }

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

        .status-stat-chip {
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .stat-num-val {
            font-weight: 800;
            color: var(--text-main);
        }

        .stat-target-val {
            color: var(--text-muted);
            font-size: 10.5px;
        }

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

        .status-btn {
            display: inline-flex;
            align-items: center;
            gap: 5px;
            padding: 3px 10px;
            border-radius: 6px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            font-weight: 800;
            font-size: 11.5px;
            cursor: pointer;
            color: var(--text-main);
            transition: 0.15s;
        }

        .status-btn:hover {
            border-color: var(--primary-color);
            transform: translateY(-1px);
        }

        .status-pill-score {
            background: color-mix(in srgb, #10b981 15%, var(--card-bg));
            color: #10b981;
            font-size: 10px;
            font-weight: 900;
            padding: 1px 5px;
            border-radius: 4px;
        }

        .status-badge-pills {
            display: flex;
            align-items: center;
            gap: 3px;
        }

        /* =========================================
           FLOATING SELECTION TOOLBAR (CLEAN PRO V7)
           ========================================= */
        #floatingMenu, .toolbar.boxbar-ed {
            position: absolute;
            z-index: 9999;
            transform-origin: center bottom;
            animation: floatMenuIn 0.18s ease forwards;
            filter: none !important;
            user-select: none;
        }

        #floatingMenu.none {
            display: none !important;
        }

        @keyframes floatMenuIn {
            0% { opacity: 0; transform: scale(0.96) translateY(4px); }
            100% { opacity: 1; transform: scale(1) translateY(0); }
        }

        .ul-boxbar-ed {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            padding: 5px;
            margin: 0;
            list-style: none;
            width: 250px;
            display: flex;
            flex-direction: column;
            gap: 2px;
            box-sizing: border-box;
            box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
            position: relative;
        }

        .he-boxbar-ed {
            width: 100%;
            position: relative;
            z-index: 10;
        }

        .he-boxbar-ed:hover,
        .he-boxbar-ed:focus-within,
        .he-boxbar-ed.active-sub {
            z-index: 3000 !important;
        }

        /* Top Format Pill Strip (Floor 1) */
        .ul-top-bb-ed {
            list-style: none;
            padding: 2px;
            margin: 0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            background: color-mix(in srgb, var(--bg-body) 70%, var(--card-bg));
            border: 1px solid var(--border-color);
            border-radius: 8px;
            gap: 2px;
            position: relative;
        }

        .t-ul-top-bb-ed {
            margin-top: 3px;
        }

        .li-l-bb-ed {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }

        .li-l-bb-ed:hover,
        .li-l-bb-ed:focus-within,
        .li-l-bb-ed.active-sub {
            z-index: 3500 !important;
        }

        .item-t-bb-ed {
            width: 28px;
            height: 28px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 6px;
            border: none;
            background: transparent;
            color: var(--text-muted);
            cursor: pointer;
            transition: background 0.12s ease, color 0.12s ease;
            padding: 0;
            position: relative;
        }

        .item-t-bb-ed svg {
            width: 14px;
            height: 14px;
            pointer-events: none;
        }

        .item-t-bb-ed:hover {
            background: color-mix(in srgb, var(--primary-color) 14%, var(--card-bg));
            color: var(--primary-color);
        }

        .item-t-bb-ed.active {
            background: var(--primary-color) !important;
            color: #ffffff !important;
        }

        .item-t-bb-ed.active svg {
            color: #ffffff !important;
        }

        .li-boxbar-ed {
            position: relative;
            width: 100%;
            z-index: 5;
        }

        .li-boxbar-ed:hover,
        .li-boxbar-ed:focus-within,
        .li-boxbar-ed.active-sub {
            z-index: 2000 !important;
        }

        /* Menu Item Rows */
        .item-bb-ed {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 6px 10px;
            border-radius: 7px;
            color: var(--text-main);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            background: transparent;
            width: 100%;
            box-sizing: border-box;
            transition: background 0.12s ease, color 0.12s ease;
            user-select: none;
        }

        .item-bb-ed svg {
            width: 14px;
            height: 14px;
            color: var(--text-muted);
        }

        .item-bb-ed .name-i-bb-ed {
            flex: 1;
            text-align: start;
            margin: 0 8px;
            font-size: 12px;
            font-weight: 600;
        }

        .item-bb-ed:hover {
            background: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg));
            color: var(--primary-color);
        }

        .item-bb-ed:hover svg {
            color: var(--primary-color);
        }

        /* Submenus & Popups Layering */
        .ul-boxbar-ed.child {
            position: absolute;
            left: 100%;
            top: 0;
            display: none;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 11px;
            box-shadow: 0 6px 22px rgba(0, 0, 0, 0.22);
            z-index: 2500 !important;
            padding: 8px;
            box-sizing: border-box;
            margin-left: 6px;
        }

        /* Invisible Hover Bridge Pseudo-Element */
        .ul-boxbar-ed.child::before {
            content: '';
            position: absolute;
            top: -10px;
            bottom: -10px;
            left: -16px;
            width: 20px;
            z-index: 10;
        }

        /* Bidirectional Submenu Positioning */
        .boxbar-ed.left .ul-boxbar-ed.child,
        .boxbar-ed[data-pop-direction="left"] .ul-boxbar-ed.child {
            left: auto;
            right: 100%;
            margin-left: 0;
            margin-right: 6px;
        }

        .boxbar-ed.left .ul-boxbar-ed.child::before,
        .boxbar-ed[data-pop-direction="left"] .ul-boxbar-ed.child::before {
            left: auto;
            right: -16px;
            width: 20px;
        }

        .boxbar-ed.left .ul-boxbar-ed.child .ul-options-ed,
        .boxbar-ed[data-pop-direction="left"] .ul-boxbar-ed.child .ul-options-ed {
            left: auto;
            right: 100%;
            margin-left: 0;
            margin-right: 6px;
        }

        .li-boxbar-ed:hover > .ul-boxbar-ed.child,
        .item-bb-ed:hover > .ul-boxbar-ed.child,
        .item-t-bb-ed:hover > .ul-boxbar-ed.child,
        .item-t-bb-ed:focus-within > .ul-boxbar-ed.child,
        .li-boxbar-ed:focus-within > .ul-boxbar-ed.child,
        .li-boxbar-ed.active-sub > .ul-boxbar-ed.child,
        .item-t-bb-ed.active-sub > .ul-boxbar-ed.child {
            display: flex !important;
            flex-direction: column;
            animation: floatMenuIn 0.15s ease forwards;
        }

        /* Top Dropdown Child (Floor 2 Shelf Row) */
        .ul-top-bb-ed.child {
            position: absolute;
            top: 34px;
            right: -4px;
            left: auto;
            width: 236px;
            background: var(--card-bg) !important;
            background-color: var(--card-bg) !important;
            border: 1px solid var(--border-color);
            border-radius: 8px;
            box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
            padding: 2px 4px;
            margin: 0;
            list-style: none;
            display: none;
            z-index: 4000 !important;
            gap: 2px;
            box-sizing: border-box;
            align-items: center;
            justify-content: space-between;
            opacity: 1 !important;
        }

        .ul-top-bb-ed.child::before {
            content: '';
            position: absolute;
            top: -12px;
            left: 0;
            right: 0;
            height: 14px;
            z-index: 10;
        }

        .line-keep-ed {
            display: none;
            width: 100%;
            height: 14px;
            position: absolute;
            left: 0;
            right: 0;
            top: 24px;
            z-index: 1400;
        }

        .item-t-bb-ed:hover > .line-keep-ed,
        .item-t-bb-ed.click:hover > .line-keep-ed {
            display: block !important;
        }

        .item-t-bb-ed:hover > .ul-top-bb-ed.child,
        .item-t-bb-ed.click:hover > .ul-top-bb-ed.child,
        .item-t-bb-ed:focus-within > .ul-top-bb-ed.child,
        .item-t-bb-ed.active-sub > .ul-top-bb-ed.child,
        .li-l-bb-ed:hover > .ul-top-bb-ed.child,
        .li-l-bb-ed:focus-within > .ul-top-bb-ed.child,
        .li-l-bb-ed.active-sub > .ul-top-bb-ed.child {
            display: flex !important;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
        }

        /* Secondary nested dropdown (Floor 3 Shelf Row) */
        .ul-top-bb-ed.child .ul-top-bb-ed.child {
            top: 34px;
            right: -4px;
            left: auto;
            width: 236px;
            background: var(--card-bg) !important;
            background-color: var(--card-bg) !important;
            z-index: 5000 !important;
            box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
            opacity: 1 !important;
        }

        .menu-pill-hint {
            font-size: 9.5px;
            font-weight: 700;
            color: var(--text-muted);
            background: color-mix(in srgb, var(--text-muted) 12%, transparent);
            padding: 1px 5px;
            border-radius: 4px;
            margin-right: 6px;
        }

        .kbd-pill {
            font-size: 9.5px;
            font-weight: 700;
            font-family: monospace;
            color: var(--text-muted);
            background: color-mix(in srgb, var(--border-color) 60%, transparent);
            border: 1px solid color-mix(in srgb, var(--border-color) 80%, transparent);
            padding: 1px 5px;
            border-radius: 4px;
            letter-spacing: -0.2px;
        }

        /* Heading Selection Badges */
        .h-badge-tag {
            font-size: 10.5px;
            font-weight: 900;
            padding: 2px 6px;
            border-radius: 4px;
            color: #fff;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            min-width: 20px;
        }

        .h2-tag { background: #10b981; }
        .h3-tag { background: #8b5cf6; }
        .h4-tag { background: #f59e0b; }
        .h5-tag { background: #ec4899; }
        .h6-tag { background: #6b7280; }

        .li-insert-ed {
            padding: 4px 0;
            width: 100%;
        }

        .title-bb-ed {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.3px;
            margin-bottom: 4px;
            padding: 0 2px;
        }

        .input-ed {
            width: 100%;
            height: 32px;
            background: color-mix(in srgb, var(--bg-body) 75%, var(--card-bg));
            border: 1px solid var(--border-color);
            color: var(--text-main);
            padding: 0 10px;
            border-radius: 6px;
            font-size: 12px;
            outline: none;
            box-sizing: border-box;
            transition: border-color 0.15s ease;
            font-family: inherit;
        }

        .input-ed:focus {
            border-color: var(--primary-color);
            background: var(--card-bg);
        }

        .box-image-ed {
            width: 100%;
            height: 100px;
            border: 1.5px dashed var(--border-color);
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: color-mix(in srgb, var(--bg-body) 50%, var(--card-bg));
            overflow: hidden;
            margin: 6px 0;
        }

        .img-image-ed {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            border-radius: 6px;
        }

        .btn-insert-ed {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            background: var(--primary-color);
            color: #ffffff;
            font-weight: 700;
            font-size: 12px;
            height: 32px;
            padding: 0 14px;
            border-radius: 6px;
            cursor: pointer;
            transition: opacity 0.15s ease;
            width: 100%;
            box-sizing: border-box;
            border: none;
        }

        .btn-insert-ed:hover {
            opacity: 0.9;
        }

        .ul-options-ed {
            list-style: none;
            padding: 4px;
            margin: 0;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 8px;
            box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
            display: none;
            position: absolute;
            left: 100%;
            top: 0;
            margin-left: 6px;
            min-width: 150px;
            z-index: 2005;
        }

        .ul-options-ed::before {
            content: '';
            position: absolute;
            top: -10px;
            bottom: -10px;
            left: -16px;
            width: 20px;
        }

        .ul-options-ed.active {
            display: block;
        }

        .item-o-ed {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 5px 8px;
            border-radius: 5px;
            font-size: 11.5px;
            color: var(--text-muted);
            cursor: pointer;
            transition: background 0.12s ease, color 0.12s ease;
        }

        .item-o-ed:hover, .item-o-ed.select {
            background: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg));
            color: var(--primary-color);
            font-weight: 700;
        }

        /* Color Palette & Emojis */
        .ul-boxbar-ed.child.color {
            bottom: -6px;
            top: auto;
            width: 325px;
            max-height: 390px;
            z-index: 2500 !important;
        }

        .ul-boxbar-ed.child.emoji {
            bottom: -6px;
            top: auto;
            width: 320px;
            max-height: 360px;
            z-index: 2500 !important;
        }

        .boxbar-ed.left .ul-boxbar-ed.child.color,
        .boxbar-ed.left .ul-boxbar-ed.child.emoji {
            left: auto;
            right: 100%;
            margin-left: 0;
            margin-right: 6px;
        }

        .color-i-t-bb-ed {
            width: 18px;
            height: 18px;
            border-radius: 50%;
            cursor: pointer;
            border: 1px solid rgba(255, 255, 255, 0.2);
            box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
            transition: transform 0.12s ease;
        }

        .color-i-t-bb-ed:hover {
            transform: scale(1.3);
            border-color: #ffffff;
        }

        .scroll-boxbar-ed {
            max-height: 220px;
            overflow-y: auto;
            padding-right: 4px;
        }

        .scroll-boxbar-ed.color {
            max-height: 260px;
        }

        .emoji-input {
            width: 100%;
            height: 30px;
            background: color-mix(in srgb, var(--bg-body) 75%, var(--card-bg));
            border: 1px solid var(--border-color);
            color: var(--text-main);
            padding: 0 8px;
            border-radius: 6px;
            font-size: 12px;
            outline: none;
            box-sizing: border-box;
            margin-bottom: 6px;
        }

        .emoji-input:focus {
            border-color: var(--primary-color);
            background: var(--card-bg);
        }

        .ul-emoji-boxbar-ed {
            display: flex;
            flex-wrap: wrap;
            gap: 3px;
            padding: 0;
            margin: 0;
            list-style: none;
        }

        .li-emoji-ed {
            cursor: pointer;
            font-size: 19px;
            width: 30px;
            height: 30px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.1s;
            user-select: none;
        }

        .li-emoji-ed:hover {
            background: color-mix(in srgb, var(--primary-color) 12%, var(--card-bg));
            transform: scale(1.25);
        }

        .title-emoji {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            padding: 4px 2px;
        }

        /* Shortcuts Guide Flyout */
        .shortcuts-boxbar {
            padding: 8px;
            z-index: 2000 !important;
        }

        .boxbar-ed.left .shortcuts-boxbar,
        .boxbar-ed[data-pop-direction="left"] .shortcuts-boxbar {
            left: auto;
            right: 100%;
            margin-left: 0;
            margin-right: 6px;
        }

        .shortcut-item-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 4px 6px;
            border-radius: 5px;
            font-size: 11.5px;
            font-weight: 600;
            color: var(--text-main);
            transition: background 0.1s;
        }

        .shortcut-item-row:hover {
            background: color-mix(in srgb, var(--primary-color) 10%, var(--card-bg));
            color: var(--primary-color);
        }

        /* Live Selection Analytics Mini-Pill */
        .sel-stat-strip {
            margin-top: 3px;
            padding: 0 2px;
        }

        .sel-stat-content {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 2px 6px;
            border-radius: 5px;
            background: color-mix(in srgb, var(--bg-body) 60%, var(--card-bg));
            border: 1px dashed var(--border-color);
            font-size: 10.5px;
            font-weight: 700;
            color: var(--text-muted);
        }

        .sel-stat-dot {
            width: 5px;
            height: 5px;
            border-radius: 50%;
            background: var(--primary-color);
        }

        /* Shortcuts Modal Dialog */
        .shortcuts-pop {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.65);
            backdrop-filter: blur(8px);
            -webkit-backdrop-filter: blur(8px);
            z-index: 100000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            box-sizing: border-box;
        }

        .shortcuts-pop.none {
            display: none !important;
        }

        .shortcuts-pop-content {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 14px;
            box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
            width: 100%;
            max-width: 880px;
            max-height: 85vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
            animation: floatMenuIn 0.18s ease forwards;
        }

        .shortcuts-pop-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 20px;
            border-bottom: 1px solid var(--border-color);
            background: color-mix(in srgb, var(--bg-body) 60%, var(--card-bg));
        }

        .shortcuts-pop-header h3 {
            margin: 0;
            font-size: 15px;
            font-weight: 800;
            color: var(--text-main);
        }

        .shortcuts-pop-header .close {
            width: 26px;
            height: 26px;
            border-radius: 6px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            border: 1px solid var(--border-color);
            background: transparent;
            color: var(--text-muted);
            font-size: 18px;
            transition: all 0.12s ease;
            line-height: 1;
        }

        .shortcuts-pop-header .close:hover {
            background: var(--danger-light, rgba(239, 68, 68, 0.15));
            color: var(--danger-color, #ef4444);
            border-color: var(--danger-color, #ef4444);
        }

        .container-shortcut {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
            gap: 14px;
            padding: 18px;
            overflow-y: auto;
        }

        .category-shortcut {
            background: color-mix(in srgb, var(--bg-body) 60%, var(--card-bg));
            border: 1px solid var(--border-color);
            border-radius: 9px;
            padding: 12px;
        }

        .category-shortcut h4 {
            margin: 0 0 8px 0;
            font-size: 12.5px;
            font-weight: 800;
            color: var(--primary-color);
            border-bottom: 1px solid var(--border-color);
            padding-bottom: 5px;
        }

        .category-shortcut ul {
            list-style: none;
            padding: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 5px;
        }

        .category-shortcut li {
            font-size: 11.5px;
            color: var(--text-main);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 6px;
        }

        .shortcut-key {
            background: color-mix(in srgb, var(--card-bg) 85%, #000);
            border: 1px solid var(--border-color);
            padding: 1px 5px;
            border-radius: 4px;
            font-family: monospace;
            font-size: 10.5px;
            font-weight: 700;
            color: var(--text-main);
        }

        /* Contextual Inspector Toolbars (Link, Image, Table, Media) */
        .context-bar {
            position: absolute;
            z-index: 6000 !important;
            display: block;
            animation: floatMenuIn 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            user-select: none;
            pointer-events: auto;
            isolation: isolate;
        }

        .context-bar.none {
            display: none !important;
        }

        .context-bar-inner {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 6px 10px;
            background: var(--card-bg, #ffffff) !important;
            background-color: var(--card-bg, #ffffff) !important;
            border: 1px solid var(--border-color, #e5e7eb) !important;
            border-radius: 10px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2) !important;
            max-width: 95vw;
            box-sizing: border-box;
            flex-wrap: wrap;
            opacity: 1 !important;
            backdrop-filter: blur(16px);
            -webkit-backdrop-filter: blur(16px);
        }

        html[data-theme="dark"] .context-bar-inner,
        body.dark-mode .context-bar-inner,
        .dark-theme .context-bar-inner {
            background: #1a1d25 !important;
            background-color: #1a1d25 !important;
            border-color: #323644 !important;
            box-shadow: 0 12px 36px rgba(0, 0, 0, 0.7), 0 2px 10px rgba(0, 0, 0, 0.4) !important;
        }

        html[data-theme="sunset"] .context-bar-inner,
        body.sunset-mode .context-bar-inner {
            background: #2d2725 !important;
            background-color: #2d2725 !important;
            border-color: #483e3c !important;
        }

        html[data-theme="light"] .context-bar-inner,
        body.light-mode .context-bar-inner {
            background: #ffffff !important;
            background-color: #ffffff !important;
            border-color: #e5e7eb !important;
        }

        .context-icon {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            color: var(--primary-color);
            width: 20px;
            height: 20px;
        }

        .context-icon svg {
            width: 15px;
            height: 15px;
        }

        .context-label {
            font-size: 11.5px;
            font-weight: 700;
            color: var(--text-main);
            margin-right: 2px;
        }

        .context-input {
            background: color-mix(in srgb, var(--bg-body, #f3f4f6) 70%, var(--card-bg, #ffffff)) !important;
            background-color: color-mix(in srgb, var(--bg-body, #f3f4f6) 70%, var(--card-bg, #ffffff)) !important;
            border: 1px solid var(--border-color, #e5e7eb) !important;
            border-radius: 6px;
            padding: 4px 8px;
            font-size: 12px;
            color: var(--text-main) !important;
            outline: none;
            min-width: 140px;
            transition: border-color 0.15s ease;
            opacity: 1 !important;
        }

        .context-input.short {
            min-width: 90px;
            max-width: 120px;
        }

        .context-input:focus {
            border-color: var(--primary-color) !important;
        }

        .context-select {
            background: color-mix(in srgb, var(--bg-body, #f3f4f6) 70%, var(--card-bg, #ffffff)) !important;
            background-color: color-mix(in srgb, var(--bg-body, #f3f4f6) 70%, var(--card-bg, #ffffff)) !important;
            border: 1px solid var(--border-color, #e5e7eb) !important;
            border-radius: 6px;
            padding: 4px 6px;
            font-size: 11.5px;
            color: var(--text-main) !important;
            outline: none;
            cursor: pointer;
            opacity: 1 !important;
        }

        .context-select:focus {
            border-color: var(--primary-color) !important;
        }

        .context-btn-group {
            display: inline-flex;
            align-items: center;
            gap: 2px;
            background: color-mix(in srgb, var(--bg-body, #f3f4f6) 60%, var(--card-bg, #ffffff)) !important;
            padding: 2px;
            border-radius: 6px;
            border: 1px solid var(--border-color, #e5e7eb) !important;
        }

        .context-btn {
            width: 26px;
            height: 26px;
            border-radius: 5px;
            border: none;
            background: transparent;
            color: var(--text-muted);
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            padding: 0 4px;
            font-size: 11.5px;
            transition: all 0.12s ease;
            gap: 3px;
        }

        .context-btn.text-btn {
            width: auto;
            padding: 2px 6px;
            font-size: 11px;
            font-weight: 700;
        }

        .context-btn svg {
            width: 13px;
            height: 13px;
            pointer-events: none;
        }

        .context-btn:hover, .context-btn.active {
            background: color-mix(in srgb, var(--primary-color) 15%, var(--card-bg, #ffffff));
            color: var(--primary-color);
        }

        .context-btn.danger {
            color: var(--danger-color, #ef4444);
        }

        .context-btn.danger:hover {
            background: var(--danger-color, #ef4444);
            color: #fff;
        }

        .context-btn.danger-hover:hover {
            background: var(--danger-light, rgba(239, 68, 68, 0.15));
            color: var(--danger-color, #ef4444);
        }

        .context-btn.close {
            font-size: 16px;
            line-height: 1;
            font-weight: 700;
            width: 22px;
            height: 22px;
        }

        .context-divider {
            width: 1px;
            height: 18px;
            background: var(--border-color);
            margin: 0 2px;
        }

        /* ── Utility ── */
        .hidden { display: none !important; }

        /* ── Search Highlight ── */
        mark.search-highlight { background: color-mix(in srgb, #facc15 60%, transparent); color: inherit; border-radius: 2px; padding: 0 1px; }
        mark.search-highlight.active-match { background: #f97316; color: #fff; box-shadow: 0 0 0 2px rgba(249,115,22,0.4); }
        mark.gr-kw-highlight { background: color-mix(in srgb, var(--primary-color) 20%, transparent); color: var(--primary-color); border-radius: 3px; padding: 0 2px; cursor: pointer; }
        mark.gr-kw-highlight:hover { background: color-mix(in srgb, var(--primary-color) 35%, transparent); }

        /* ── SEO Audit Goal Pills ── */
        .goal-pill { display: inline-flex; align-items: center; font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 20px; margin: 2px 3px 0 0; }
        .goal-pill.pass { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); border: 1px solid color-mix(in srgb, var(--success) 30%, transparent); }
        .goal-pill.fail { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); border: 1px solid color-mix(in srgb, var(--danger) 25%, transparent); }

        /* ── SEO Audit Results Area ── */
        .audit-res-item { font-size: 12.5px; padding: 8px 12px; border-radius: 8px; margin-bottom: 6px; border-left: 3px solid transparent; }
        .audit-res-item.pro { background: color-mix(in srgb, var(--success) 10%, transparent); border-color: var(--success); color: var(--success); }
        .audit-res-item.con { background: color-mix(in srgb, var(--danger) 10%, transparent); border-color: var(--danger); color: var(--danger); }
        .audit-res-item.sug { background: color-mix(in srgb, var(--warning) 10%, transparent); border-color: var(--warning); color: var(--warning); }

        /* ── SEO Console Items ── */
        .fc-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border-color); font-size: 12.5px; }
        .fc-item:last-child { border-bottom: none; }
        .fc-item h4 { font-size: 12px; font-weight: 700; color: var(--text-main); margin: 0 0 2px; }
        .fc-item p { font-size: 11.5px; color: var(--text-muted); margin: 0; line-height: 1.4; }

        /* ── AI Wand Loading State on Editor Blocks ── */
        #editor [data-ai-loading="true"] { opacity: 0.5; transition: opacity 0.2s; pointer-events: none; }
        #editor [data-ai-insert="true"] { animation: fadeSlideIn 0.35s ease; }
        @keyframes fadeSlideIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

        /* ── Onboarding / Empty State Overlay ── */
        .co-empty-workspace-overlay {
            position: absolute;
            inset: 0;
            background: color-mix(in srgb, var(--card-bg) 95%, transparent);
            backdrop-filter: blur(20px);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 24px;
            overflow-y: auto;
        }

        .co-onboarding-card {
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            border-radius: 24px;
            padding: 40px 32px;
            max-width: 820px;
            width: 100%;
            text-align: center;
            position: relative;
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
            overflow: hidden;
        }

        .co-onboarding-ambient {
            position: absolute;
            top: -50px;
            left: 50%;
            transform: translateX(-50%);
            width: 300px;
            height: 150px;
            background: radial-gradient(circle, color-mix(in srgb, var(--primary-color) 35%, transparent) 0%, transparent 70%);
            pointer-events: none;
            filter: blur(40px);
        }

        .co-onboarding-icon {
            width: 68px;
            height: 68px;
            margin: 0 auto 20px;
            border-radius: 20px;
            background: linear-gradient(135deg, color-mix(in srgb, var(--primary-color) 20%, transparent), color-mix(in srgb, var(--primary-color) 5%, transparent));
            border: 1px solid color-mix(in srgb, var(--primary-color) 40%, transparent);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--primary-color);
            box-shadow: 0 10px 25px color-mix(in srgb, var(--primary-color) 25%, transparent);
        }
        .co-onboarding-icon i, .co-onboarding-icon svg {
            width: 32px;
            height: 32px;
        }

        .co-onboarding-title {
            font-size: 22px;
            font-weight: 800;
            color: var(--text-main);
            margin: 0 0 10px;
        }

        .co-onboarding-subtitle {
            font-size: 14px;
            color: var(--text-muted);
            margin: 0 auto 32px;
            max-width: 600px;
            line-height: 1.6;
        }

        .co-steps-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 16px;
            margin-bottom: 32px;
            text-align: right;
        }
        @media (max-width: 768px) {
            .co-steps-grid {
                grid-template-columns: 1fr;
            }
        }

        .co-step-card {
            background: var(--bg-body);
            border: 1px solid var(--border-color);
            border-radius: 18px;
            padding: 20px;
            display: flex;
            flex-direction: column;
            position: relative;
            transition: all 0.25s ease;
        }
        .co-step-card:hover {
            border-color: var(--primary-color);
            transform: translateY(-2px);
            box-shadow: var(--shadow-sm);
        }
        .co-step-card.highlighted {
            border-color: color-mix(in srgb, var(--primary-color) 50%, var(--border-color));
            background: linear-gradient(180deg, color-mix(in srgb, var(--primary-color) 8%, var(--bg-body)), var(--bg-body));
        }

        .step-badge {
            align-self: flex-start;
            font-size: 10.5px;
            font-weight: 800;
            padding: 2px 8px;
            border-radius: 6px;
            background: var(--card-bg);
            color: var(--text-muted);
            border: 1px solid var(--border-color);
            margin-bottom: 12px;
        }
        .step-badge.highlight {
            background: var(--primary-color);
            color: #fff;
            border-color: var(--primary-color);
        }

        .step-icon {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            margin-bottom: 12px;
        }
        .step-icon.highlight {
            color: var(--primary-color);
            background: color-mix(in srgb, var(--primary-color) 15%, transparent);
            border-color: color-mix(in srgb, var(--primary-color) 30%, transparent);
        }
        .step-icon i, .step-icon svg {
            width: 18px;
            height: 18px;
        }

        .co-step-card h4 {
            font-size: 14px;
            font-weight: 800;
            color: var(--text-main);
            margin: 0 0 6px;
        }

        .co-step-card p {
            font-size: 12px;
            color: var(--text-muted);
            margin: 0 0 16px;
            line-height: 1.5;
            flex: 1;
        }

        .btn-step-link {
            display: inline-flex;
            align-items: center;
            justify-content: space-between;
            font-size: 12px;
            font-weight: 700;
            color: var(--text-main);
            text-decoration: none;
            padding: 8px 12px;
            border-radius: 10px;
            background: var(--card-bg);
            border: 1px solid var(--border-color);
            transition: all 0.2s ease;
        }
        .btn-step-link:hover {
            color: var(--primary-color);
            border-color: var(--primary-color);
        }
        .btn-step-link.highlight {
            background: var(--primary-color);
            color: #fff;
            border-color: var(--primary-color);
            box-shadow: 0 4px 14px color-mix(in srgb, var(--primary-color) 35%, transparent);
        }
        .btn-step-link.highlight:hover {
            filter: brightness(1.1);
            color: #fff;
        }

        .step-status {
            font-size: 11.5px;
            font-weight: 700;
            color: #10b981;
            padding: 6px 10px;
            border-radius: 8px;
            background: color-mix(in srgb, #10b981 12%, transparent);
            border: 1px solid color-mix(in srgb, #10b981 25%, transparent);
            text-align: center;
        }

        .co-onboarding-actions {
            display: flex;
            justify-content: center;
            gap: 16px;
        }

        .btn-start-workspace {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            padding: 14px 28px;
            border-radius: 14px;
            background: linear-gradient(135deg, var(--primary-color), #f97316);
            color: #ffffff;
            font-size: 15px;
            font-weight: 800;
            text-decoration: none;
            box-shadow: 0 10px 30px color-mix(in srgb, var(--primary-color) 40%, transparent);
            transition: all 0.3s ease;
        }
        .btn-start-workspace:hover {
            transform: translateY(-2px);
            box-shadow: 0 14px 38px color-mix(in srgb, var(--primary-color) 55%, transparent);
            color: #ffffff;
        }
        .btn-start-workspace i, .btn-start-workspace svg {
            width: 20px;
            height: 20px;
        }