	        :root {
	            color-scheme: light;
            /* DeftEdge Brand Colors */
            --de-orange: #F39200;
            --de-navy: #003B5C;
            --de-light-orange: #FFB84D;
            --de-dark-navy: #002840;
            /* UI Accent (Blue) */
            --de-blue: #2563eb;
            --de-blue-dark: #1d4ed8;
            --de-blue-light: #60a5fa;

            /* Spacing Scale */
            --space-xs: 0.25rem;
            --space-sm: 0.5rem;
            --space-md: 0.75rem;
            --space-lg: 1rem;
            --space-xl: 1.25rem;
            --space-2xl: 1.5rem;
            --space-3xl: 2rem;

            /* Border Radius Scale */
            --radius-sm: 8px;
            --radius-md: 10px;
            --radius-lg: 12px;
            --radius-xl: 16px;
            --radius-2xl: 20px;
            --radius-full: 999px;

            /* Common Colors */
            --text-muted: #64748b;
            --text-secondary: #475569;
            --text-dark: #0f172a;
            --border-color: #cbd5e1;
            --border-color-light: #e2e8f0;
	            --bg-surface: #f8fafc;
	            --bg-white: #ffffff;

                /* Layout metrics */
                --enterprise-nav-height: 68px;
                --pdf-viewer-header-height: 0px;
	        }

        /* ================================
           UTILITY CLASSES
           ================================ */

        /* Display Utilities */
        .d-none { display: none !important; }
        .d-block { display: block !important; }
        .d-flex { display: flex !important; }
        .d-inline-flex { display: inline-flex !important; }

        /* Spacing Utilities */
        .p-0 { padding: 0 !important; }
        .p-sm { padding: var(--space-sm) !important; }
        .p-md { padding: var(--space-md) !important; }
        .p-lg { padding: var(--space-lg) !important; }
        .p-xl { padding: var(--space-xl) !important; }

        .m-0 { margin: 0 !important; }
        .mb-0 { margin-bottom: 0 !important; }
        .mb-sm { margin-bottom: var(--space-sm) !important; }
        .mb-md { margin-bottom: var(--space-md) !important; }
        .mb-lg { margin-bottom: var(--space-lg) !important; }
        .mb-xl { margin-bottom: var(--space-xl) !important; }
        .mt-sm { margin-top: var(--space-sm) !important; }

        /* Border Radius Utilities */
        .rounded-sm { border-radius: var(--radius-sm) !important; }
        .rounded-md { border-radius: var(--radius-md) !important; }
        .rounded-lg { border-radius: var(--radius-lg) !important; }
        .rounded-xl { border-radius: var(--radius-xl) !important; }
        .rounded-full { border-radius: var(--radius-full) !important; }

        /* Width Utilities */
        .w-full { width: 100% !important; }
        .w-auto { width: auto !important; }
        .min-w-auto { min-width: auto !important; }

        /* Text Utilities */
        .text-center { text-align: center !important; }
        .text-muted { color: var(--text-muted) !important; }
        .text-secondary { color: var(--text-secondary) !important; }
        .font-bold { font-weight: 700 !important; }
        .font-semibold { font-weight: 600 !important; }

        /* Overflow Utilities */
        .overflow-hidden { overflow: hidden !important; }
        .overflow-ellipsis {
            overflow: hidden !important;
            text-overflow: ellipsis !important;
            white-space: nowrap !important;
        }

        /* Max Width Utilities */
        .max-w-lg { max-width: 500px !important; }
        .max-w-xl { max-width: 1000px !important; }

        /* Loading Spinner */
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        .spinner-small {
            display: inline-block;
            width: 14px;
            height: 14px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            border-top-color: white;
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }
        .spinner-dark {
            border: 2px solid rgba(0, 0, 0, 0.1);
            border-top-color: var(--de-orange);
        }

        /* ================================
           BASE STYLES
           ================================ */
        body {
            font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
            background: #f5f5f5;
            color: var(--de-navy);
            margin: 0;
            padding: 0;
            min-height: 100vh;
            overflow: auto;
        }
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }
        .app-container {
            max-width: none;
            margin: 0;
            background: var(--bg-white);
            border-radius: 0;
            padding: 0;
            box-shadow: none;
            border: none;
            height: 100vh;
            display: flex;
            flex-direction: column;
            min-height: 0;
            overflow: visible;
        }
        /* In PDF viewer mode we let the page scroll, so the app container must be allowed to grow. */
        .app-container.pdf-viewer-mode {
            height: auto;
            min-height: 100vh;
        }
        h1 {
            margin-top: 0;
            font-size: 2.2rem;
            background: linear-gradient(135deg, var(--de-orange), var(--de-navy));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            font-weight: 700;
        }
        .sub {
            color: var(--text-muted);
            font-size: 0.95rem;
            margin-bottom: 2rem;
            line-height: 1.6;
        }
        .card {
            border-radius: var(--radius-xl);
            background: var(--bg-surface);
            border: 1px solid #e2e8f0;
            padding: 1.5rem 1.75rem;
            margin-bottom: 1.5rem;
        }
        .workspace-grid {
            display: grid;
            grid-template-columns: 280px 1fr 320px;
            gap: 1rem;
            align-items: start;
        }
        .workspace-col {
            min-width: 0;
        }
        .media-col .card {
            position: sticky;
            top: 1rem;
        }
        .side-col .card {
            position: sticky;
            top: 1rem;
        }
        @media (max-width: 1100px) {
            .workspace-grid {
                grid-template-columns: 1fr;
            }
            .media-col .card,
            .side-col .card {
                position: static;
            }
        }
        label {
            font-size: 0.9rem;
            margin-bottom: 0.4rem;
            display: block;
            color: #475569;
            font-weight: 500;
        }
        input[type="file"], select, button, textarea {
            width: 100%;
            padding: var(--space-md) var(--space-lg);
            margin-bottom: 0.7rem;
            background: var(--bg-white);
            border: 2px solid var(--border-color);
            color: var(--de-navy);
            border-radius: var(--radius-md);
            font-size: 0.92rem;
            transition: all 0.2s ease;
        }
        input[type="file"]:hover, select:hover {
            border-color: #94a3b8;
        }
        input[type="file"]:focus, select:focus {
            outline: none;
            border-color: var(--de-orange);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }
        button {
            cursor: pointer;
            background: linear-gradient(135deg, var(--de-blue-dark), var(--de-blue));
            border: none;
            font-weight: 600;
            letter-spacing: 0.01em;
            color: white;
            transition: all 0.2s ease;
        }
        button:hover:not(:disabled) {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
        }
        button.secondary {
            background: var(--bg-white);
            border: 2px solid var(--border-color);
            color: #475569;
        }
        button.secondary:hover:not(:disabled) {
            border-color: #94a3b8;
            background: var(--bg-surface);
        }
        button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .status {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-top: 0.5rem;
            font-weight: 500;
        }
        .flex-row {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
        }
        .flex-row > div {
            flex: 1 1 220px;
        }
        .badge {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.25rem 0.75rem;
            border-radius: var(--radius-full);
            font-size: 0.75rem;
            background: #e0f2fe;
            border: 1px solid #0ea5e9;
            color: #0c4a6e;
            margin-right: 0.4rem;
            font-weight: 600;
        }
        .badge-dot {
            width: 7px;
            height: 7px;
            border-radius: var(--radius-full);
            background: #10b981;
        }
        #codingPanel {
            display: none;
        }
        .coding-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1rem;
        }
        .coding-header-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--de-navy);
        }
        .coding-counter {
            font-size: 0.85rem;
            color: var(--text-muted);
            font-weight: 500;
        }
        .excerpt-box {
            background: linear-gradient(135deg, #fefce8 0%, #fef3c7 100%);
            border-radius: var(--radius-xl);
            padding: 1.75rem 2rem;
            border: 2px solid #fbbf24;
            margin-bottom: 1.5rem;
            box-shadow: 0 2px 8px rgba(251, 191, 36, 0.15);
        }
        .excerpt-section-label {
            font-size: 0.8rem;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #78716c;
            margin-bottom: 0.75rem;
            font-weight: 600;
        }
        .excerpt-text {
            font-size: 1.05rem;
            line-height: 1.8;
            color: #292524;
        }
        .highlight {
            background: linear-gradient(135deg, rgba(245, 166, 35, 0.25), rgba(242, 109, 33, 0.2));
            padding: 2px 6px;
            border-radius: 4px;
            border-bottom: 2px solid var(--accent-orange);
        }
        .progress-container {
            margin: 1rem 0;
        }
        .progress-bar-bg {
            height: 10px;
            background: #e2e8f0;
            border-radius: var(--radius-full);
            overflow: hidden;
            margin-bottom: 0.6rem;
        }
        .progress-bar-fill {
            height: 100%;
            background: linear-gradient(90deg, #10b981, #059669);
            width: 0%;
            transition: width 0.3s ease;
            box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
        }
        .progress-text {
            font-size: 0.85rem;
            color: #475569;
            text-align: center;
            font-weight: 500;
        }
        .codes-toolbar {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.6rem;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        .toolbar-actions {
            display: flex;
            gap: 0.4rem;
            align-items: center;
        }
        .btn-icon {
            padding: 0.4rem 0.7rem !important;
            font-size: 0.75rem !important;
            min-width: auto !important;
            border: 1px solid #374151 !important;
            background: #020617 !important;
            color: #e5e7eb !important;
        }
        .btn-danger {
            background: linear-gradient(135deg, #ef4444, #dc2626) !important;
            color: white !important;
            border: none !important;
        }
        .btn-danger:hover:not(:disabled) {
            box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4) !important;
        }
        .btn-secondary {
            background: #ffffff !important;
            color: var(--de-navy) !important;
            border: 1px solid var(--border-color-light) !important;
            border-radius: 10px !important;
            font-weight: 600 !important;
        }
        .btn-secondary:hover:not(:disabled) {
            border-color: var(--de-navy) !important;
            color: var(--de-navy) !important;
            background: #f8fafc !important;
        }
        .codes-area-label {
            font-size: 0.95rem;
            color: #475569;
            font-weight: 700;
        }
        .codes-container {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            margin-bottom: 1rem;
            min-height: 60px;
            padding: 1rem;
            background: var(--bg-white);
            border: 2px solid var(--border-color);
            border-radius: var(--radius-lg);
        }
        .code-chip {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.5rem 1rem;
            border-radius: var(--radius-full);
            font-size: 0.85rem;
            border: 2px solid var(--border-color);
            background: var(--bg-surface);
            cursor: pointer;
            transition: all 0.2s ease;
            user-select: none;
            font-weight: 500;
        }
        .code-chip:hover {
            border-color: #10b981;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
        }
        .code-chip.selected {
            background: linear-gradient(135deg, #d1fae5, #a7f3d0);
            border-color: #10b981;
            color: #065f46;
            font-weight: 600;
        }
        .code-chip span.remove {
            font-size: 1rem;
            opacity: 0.6;
            margin-left: 0.15rem;
            transition: opacity 0.15s;
        }
        .code-chip span.remove:hover {
            opacity: 1;
            color: #ef4444;
        }
        .no-codes-message {
            width: 100%;
            text-align: center;
            color: #6b7280;
            font-size: 0.85rem;
            padding: 1rem;
        }
        .help-text {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 1rem;
            text-align: center;
            line-height: 1.7;
            background: var(--bg-surface);
            padding: 1rem;
            border-radius: var(--radius-md);
            border: 1px solid #e2e8f0;
        }
        .info-banner {
            background: linear-gradient(135deg, #dbeafe, #bfdbfe);
            border: 2px solid var(--de-orange);
            border-radius: var(--radius-lg);
            padding: 1.25rem;
            margin-bottom: 1.5rem;
            color: #1e40af;
            font-size: 0.9rem;
            text-align: center;
            font-weight: 600;
        }
        .add-code-row {
            display: flex;
            gap: 0.6rem;
            margin-bottom: 0.5rem;
        }
        .add-code-row input {
            margin-bottom: 0;
        }
        .nav-buttons {
            display: flex;
            gap: 0.6rem;
            flex-wrap: wrap;
            margin-top: 0.6rem;
        }
        .nav-buttons button {
            flex: 1 1 120px;
        }
        /* Code Browser Modal */
        .modal,
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            backdrop-filter: blur(4px);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }
        /* Coded segment modal sticks to bottom */
        #codedSegmentModal {
            align-items: flex-end;
            padding: 0 0 1.5rem 0;
        }
        .modal.show {
            display: flex;
        }
        .modal-content {
            background: var(--bg-white);
            border: 2px solid var(--border-color);
            border-radius: var(--radius-2xl);
            max-width: 850px;
            width: 100%;
            max-height: 85vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 20px 50px rgba(0,0,0,0.2);
        }
        .modal-header {
            padding: 1.5rem 2rem;
            border-bottom: 2px solid #e2e8f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .modal-title {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--de-navy);
        }
        .modal-close {
            background: transparent !important;
            border: none !important;
            color: #64748b !important;
            font-size: 1.8rem;
            cursor: pointer;
            padding: 0 !important;
            width: 36px !important;
            height: 36px !important;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }
        .modal-close:hover {
            color: var(--de-navy) !important;
            background: #f1f5f9 !important;
            border-radius: var(--radius-sm);
        }
        .modal-search {
            padding: 1.25rem 2rem;
            border-bottom: 2px solid #e2e8f0;
            background: var(--bg-surface);
        }
        .modal-search input {
            margin-bottom: 0;
        }
        .modal-body {
            flex: 1;
            overflow-y: auto;
            padding: 1.5rem;
        }

        /* Scroll-mode coded segment modal */
        .scrollseg-modal-content {
            max-width: 640px;
            width: 100%;
            max-height: 85vh;
            overflow: hidden;
            margin: 0;
            border-radius: 16px 16px 0 0;
        }
        .scrollseg-modal-content .modal-header {
            flex-shrink: 0;
            padding: 1rem 1.25rem;
        }
        .scrollseg-modal-content .modal-close {
            flex-shrink: 0;
            margin-left: 0.5rem;
        }
        .scrollseg-modal-body {
            padding: 1.1rem;
            overflow-y: auto;
            overscroll-behavior: contain;
            -webkit-overflow-scrolling: touch;
        }
        .scrollseg-section-title {
            font-size: 0.72rem;
            color: var(--text-muted);
            margin-bottom: 0.35rem;
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }
        .scrollseg-excerpt-card {
            background: #fff7ed;
            border: 2px solid #fed7aa;
            border-radius: 14px;
            padding: 0.9rem 0.95rem;
        }
        .scrollseg-excerpt-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
        }
        .scrollseg-excerpt-label {
            font-size: 0.72rem;
            color: var(--text-muted);
            font-weight: 800;
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }
        .scrollseg-link-btn {
            padding: 0.35rem 0.6rem !important;
            font-size: 0.78rem !important;
            border-radius: 10px !important;
        }
        .scrollseg-excerpt {
            margin-top: 0.55rem;
            color: #0f172a;
            font-style: italic;
            line-height: 1.55;
            word-break: break-word;
        }
        .scrollseg-excerpt--collapsed {
            overflow: hidden;
            display: -webkit-box;
            -webkit-line-clamp: 4;
            -webkit-box-orient: vertical;
        }
        .scrollseg-excerpt--expanded {
            max-height: 34vh;
            overflow: auto;
        }
        .scrollseg-pill-row {
            display: flex;
            flex-wrap: wrap;
            gap: 0.45rem;
            align-items: center;
        }
        .scrollseg-search-row {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }
        .scrollseg-search-wrap {
            position: relative;
            flex: 1;
            min-width: 0;
        }
        .scrollseg-code-search {
            width: 100%;
            margin: 0;
            font-size: 0.9rem;
            padding: 0.65rem 0.85rem;
            border: 2px solid #e2e8f0;
            border-radius: var(--radius-lg);
            outline: none;
            box-sizing: border-box;
            height: 44px;
        }
        .scrollseg-code-search:focus {
            border-color: var(--de-blue);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
        }
        .scrollseg-icon-btn {
            flex: 0 0 44px;
            min-width: 44px;
            max-width: 44px;
            width: 44px;
            height: 44px;
            padding: 0 !important;
            margin: 0 !important;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-lg);
            border: 2px solid var(--border-color);
            background: var(--bg-white);
            color: #0f172a;
            font-weight: 900;
            font-size: 1.2rem;
            line-height: 1;
            cursor: pointer;
            box-sizing: border-box;
            transform: none !important;
        }
        .scrollseg-icon-btn:hover {
            border-color: var(--de-blue);
            background: #eff6ff;
            transform: none !important;
        }
        .scrollseg-suggest {
            position: absolute;
            top: calc(100% + 8px);
            left: 0;
            right: 0;
            background: var(--bg-white);
            border: 2px solid #e2e8f0;
            border-radius: 14px;
            box-shadow: 0 16px 45px rgba(0,0,0,0.16);
            overflow: auto;
            max-height: 320px;
            z-index: 1005;
        }
        .scrollseg-suggest-item {
            width: 100%;
            text-align: left;
            background: transparent;
            border: none;
            padding: 0.7rem 0.85rem;
            cursor: pointer;
            border-bottom: 1px solid #f1f5f9;
        }
        .scrollseg-suggest-item:last-child {
            border-bottom: none;
        }
        .scrollseg-suggest-item:hover,
        .scrollseg-suggest-item--active {
            background: var(--bg-surface);
        }
        .scrollseg-suggest-code {
            font-weight: 800;
            font-size: 0.9rem;
            color: #0f172a;
        }
        .scrollseg-suggest-def {
            margin-top: 0.2rem;
            font-size: 0.78rem;
            color: var(--text-muted);
            line-height: 1.35;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
        .scrollseg-actions {
            display: flex;
            gap: 0.6rem;
            align-items: center;
            margin-top: 1.05rem;
        }
        .scrollseg-danger-btn {
            width: 44px;
            height: 44px;
            padding: 0 !important;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: var(--radius-lg);
            border: 2px solid #fecaca;
            background: #fef2f2;
            color: #b91c1c;
            cursor: pointer;
        }
        .scrollseg-danger-btn:hover {
            border-color: #fca5a5;
            background: #fee2e2;
        }

        /* Ensure code pills stay compact (global button width is 100% by default) */
        .scrollseg-code-pill {
            width: auto !important;
            display: inline-flex !important;
            align-items: center;
            justify-content: center;
            max-width: 100%;
        }
        .code-browser-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .code-browser-item {
            background: var(--bg-white);
            border: 2px solid #e2e8f0;
            border-radius: var(--radius-lg);
            padding: 1.25rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .code-browser-item:hover {
            border-color: #10b981;
            background: #f0fdf4;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
        }
        .code-browser-item.selected {
            border-color: #10b981;
            background: linear-gradient(135deg, #d1fae5, #a7f3d0);
        }
        .code-browser-item-header {
            display: flex;
            justify-content: space-between;
            align-items: start;
            margin-bottom: 0.75rem;
        }
        .code-browser-item-name {
            font-weight: 700;
            font-size: 1rem;
            color: var(--de-navy);
        }
        .code-browser-item-category {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
            font-weight: 600;
        }
        .code-browser-item-definition {
            font-size: 0.9rem;
            color: #475569;
            line-height: 1.6;
        }
        .code-browser-check {
            font-size: 1.4rem;
            color: #10b981;
        }
        .no-results {
            text-align: center;
            color: var(--text-muted);
            padding: 3rem 1rem;
            font-size: 0.95rem;
        }
        /* Enterprise UI Components */

	        /* Dark Horizontal Navigation Bar - Dedoose Style */
	        .enterprise-nav {
	            background: #ffffff;
	            border-bottom: 1px solid rgba(15, 23, 42, 0.10);
	            display: flex;
	            align-items: center;
	            padding: 0 1.75rem;
	            height: var(--enterprise-nav-height, 68px);
	            box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
	            position: sticky;
	            top: 0;
	            z-index: 9998;
	        }
        .enterprise-nav-brand {
            color: var(--de-navy);
            font-size: 1.15rem;
            font-weight: 700;
            margin-right: 2rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            letter-spacing: 0.02em;
            text-shadow: none;
        }
	        .enterprise-nav-brand .brand-logo {
	            height: 46px;
	            width: auto;
	            display: block;
	            object-fit: contain;
	            background: transparent;
	            border: none;
            padding: 0;
            box-shadow: none;
            filter: none;
        }
        .enterprise-nav-brand .brand-text {
            display: inline-flex;
            align-items: baseline;
            gap: 0;
        }
        .enterprise-nav-brand .brand-de {
            color: var(--de-orange);
            font-weight: 800;
        }
        .enterprise-nav-brand .brand-coder {
            color: var(--de-navy);
            font-weight: 800;
        }
	        .enterprise-nav-tabs {
	            display: flex;
	            gap: 0.75rem;
	            flex: 1;
                align-items: center;
	        }
	        .enterprise-nav-tab {
                appearance: none;
                border: 1px solid transparent;
                background: transparent;
	            color: #475569;
	            padding: 0.7rem 1.0rem;
	            height: 48px;
	            display: inline-flex;
	            align-items: center;
	            gap: 0.65rem;
	            font-size: 0.95rem;
	            font-weight: 650;
                letter-spacing: -0.01em;
                line-height: 1;
                border-radius: 14px;
	            cursor: pointer;
	            transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
                white-space: nowrap;
	        }
            .enterprise-nav-tab:focus-visible {
                outline: 3px solid rgba(96, 165, 250, 0.55);
                outline-offset: 2px;
            }
            .enterprise-nav-tab .tab-icon {
                width: 18px;
                height: 18px;
                display: inline-flex;
                align-items: center;
                justify-content: center;
                opacity: 0.85;
                transform: translateY(-0.5px);
                flex: 0 0 auto;
            }
            .enterprise-nav-tab svg.tab-icon {
                width: 18px;
                height: 18px;
                stroke: currentColor;
                fill: none;
                stroke-width: 2;
                stroke-linecap: round;
                stroke-linejoin: round;
            }
            .enterprise-nav-tab .tab-label {
                display: inline-block;
            }
	        .enterprise-nav-tab:hover {
	            background: rgba(15, 23, 42, 0.04);
	            color: #0f172a;
                border-color: rgba(15, 23, 42, 0.08);
	        }
	        .enterprise-nav-tab.active {
	            background: rgba(243, 146, 0, 0.14);
	            color: #9a3412;
                border-color: rgba(243, 146, 0, 0.30);
                box-shadow: 0 10px 26px rgba(243, 146, 0, 0.12);
	        }
            .enterprise-nav-tab.active .tab-icon { opacity: 1; }
		        .enterprise-nav-user {
		            display: flex;
		            align-items: center;
		            gap: 1rem;
                    padding-left: 1rem;
                    margin-left: 0.75rem;
                    border-left: 1px solid rgba(15, 23, 42, 0.08);
		            color: rgba(15, 23, 42, 0.75);
		            font-size: 0.85rem;
	                white-space: nowrap;
		        }
	        .enterprise-nav-user .btn-action {
	            background: rgba(37, 99, 235, 0.06) !important;
	            border-color: rgba(15, 23, 42, 0.18) !important;
	            color: rgba(15, 23, 42, 0.92) !important;
	            padding: 0.35rem 0.55rem !important;
	        }
	        .enterprise-nav-user .btn-action:hover {
	            border-color: var(--de-blue-light) !important;
	            background: rgba(37, 99, 235, 0.12) !important;
	        }
            .enterprise-nav-menu {
                position: relative;
                display: flex;
                align-items: center;
            }
            .enterprise-nav-menu-dropdown {
                position: absolute;
                right: 0;
                top: calc(100% + 10px);
                min-width: 220px;
                background: var(--bg-white);
                border: 1px solid rgba(15, 23, 42, 0.12);
                border-radius: var(--radius-lg);
                box-shadow: 0 14px 38px rgba(2, 6, 23, 0.25);
                padding: 0.4rem;
                display: none;
                z-index: 1000;
            }
            .enterprise-nav-menu-dropdown.open {
                display: block;
            }
            .enterprise-nav-menu-dropdown button[role="menuitem"] {
                width: 100%;
                display: flex;
                align-items: center;
                gap: 0.6rem;
                padding: 0.55rem 0.7rem;
                margin: 0;
                border: none;
                background: transparent;
                color: #0f172a;
                border-radius: var(--radius-md);
                font-size: 0.9rem;
                font-weight: 650;
                text-align: left;
                cursor: pointer;
            }
            .enterprise-nav-menu-dropdown button[role="menuitem"]:hover {
                background: #f1f5f9;
            }
            .enterprise-nav-menu-dropdown button[role="menuitem"].danger {
                color: #b91c1c;
            }
            .enterprise-nav-menu-dropdown button[role="menuitem"].danger:hover {
                background: rgba(239, 68, 68, 0.1);
            }
            .enterprise-nav-menu-sep {
                height: 1px;
                background: rgba(15, 23, 42, 0.12);
                margin: 0.35rem 0.25rem;
            }
        .enterprise-nav-user-avatar {
            width: 32px;
            height: 32px;
            background: var(--de-blue);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-weight: 700;
        }

        /* Main Content Layout */
        .enterprise-layout {
            display: flex;
            min-height: calc(100vh - 60px);
            max-height: calc(100vh - 60px);
            overflow: hidden;
        }
	        .enterprise-sidebar {
	            width: 300px;
	            background: #0f2f47;
	            border-right: 1px solid #1c4a6a;
	            padding: 0;
	            overflow-y: auto;
	        }
		        .enterprise-main {
		            flex: 1;
		            background: #f5f5f5;
		            padding: 0;
		            overflow-y: auto;
		            overflow-x: visible;
		            position: relative;
                    min-height: 0;
		        }
                .app-loading {
                    min-height: calc(100vh - 60px);
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    padding: 2.5rem 1.5rem;
                    background:
                        radial-gradient(circle at 20% 20%, rgba(0, 59, 92, 0.08), transparent 55%),
                        radial-gradient(circle at 80% 10%, rgba(243, 146, 0, 0.1), transparent 60%),
                        #f5f5f5;
                }
                .app-loading-card {
                    text-align: center;
                    padding: 2.5rem 3rem;
                    border-radius: 20px;
                    background: #ffffff;
                    border: 1px solid rgba(0, 59, 92, 0.16);
                    box-shadow: 0 18px 32px rgba(0, 59, 92, 0.12);
                    max-width: 520px;
                }
                .app-loading-eyebrow {
                    font-size: 0.75rem;
                    letter-spacing: 0.28em;
                    text-transform: uppercase;
                    color: var(--de-orange);
                    font-weight: 700;
                }
                .app-loading-title {
                    margin: 0.75rem 0 0.6rem;
                    font-size: 2rem;
                    color: var(--de-navy);
                    font-weight: 700;
                }
                .app-loading-subtitle {
                    margin: 0;
                    font-size: 1.05rem;
                    color: var(--de-navy);
                    opacity: 0.75;
                }
                @media (max-width: 640px) {
                    .app-loading-card {
                        padding: 2rem 1.75rem;
                    }
                    .app-loading-title {
                        font-size: 1.6rem;
                    }
                }
                /* In PDF viewer mode we want the page to scroll (so sticky works reliably). */
                .enterprise-main.pdf-viewer-mode {
                    overflow: visible;
                }

	        /* Context Dock (left panel) */
	        .enterprise-sidebar.context-dock {
	            display: flex;
	            flex-direction: column;
	            overflow: hidden;
	        }
	        .context-dock-header {
	            padding: 0.9rem 0.9rem 0.6rem;
	            border-bottom: 1px solid rgba(255,255,255,0.12);
	            display: flex;
	            align-items: center;
	            justify-content: space-between;
	            gap: 0.75rem;
	        }
	        .context-dock-title {
	            color: #e8f0f7;
	            font-size: 0.85rem;
	            font-weight: 800;
	            letter-spacing: 0.08em;
	            text-transform: uppercase;
	            opacity: 0.9;
	        }
	        .context-dock-actions {
	            display: flex;
	            gap: 0.5rem;
	            align-items: center;
	        }
	        .context-dock-actions .btn-action {
	            background: rgba(255,255,255,0.10) !important;
	            border-color: rgba(255,255,255,0.18) !important;
	            color: #e8f0f7 !important;
	            padding: 0.35rem 0.55rem !important;
	        }
	        .context-dock-actions .btn-action:hover {
	            border-color: var(--de-orange) !important;
	            background: rgba(255,255,255,0.14) !important;
	        }
	        .context-dock-panels {
	            flex: 1;
	            overflow: auto;
	            padding: 0.9rem;
	            display: flex;
	            flex-direction: column;
	            gap: 1rem;
	        }
	        .context-dock-placeholder {
	            background: #154165;
	            border: 1px solid #1f577f;
	            border-radius: var(--radius-lg);
	            padding: 1rem;
	            color: #f4f7fb;
	        }
	        .context-dock-placeholder div[style*="color: #64748b"] {
	            color: #c7d8e5 !important;
	        }
	        .dock-icon-btn {
	            appearance: none;
	            border: 1px solid rgba(255,255,255,0.32);
	            background: rgba(255,255,255,0.16);
	            color: #ffffff;
	            width: 34px;
	            height: 34px;
	            border-radius: var(--radius-md);
	            font-size: 1.15rem;
	            font-weight: 800;
	            line-height: 1;
	            display: inline-flex;
	            align-items: center;
	            justify-content: center;
	            cursor: pointer;
	            flex: 0 0 auto;
	        }
	        .dock-icon-btn:hover {
	            border-color: rgba(255,255,255,0.5);
	            background: rgba(255,255,255,0.22);
	        }

	        /* Dock collapsed */
	        body.dock-collapsed .enterprise-sidebar {
	            width: 56px;
	        }
	        body.dock-collapsed .context-dock-title,
	        body.dock-collapsed .context-dock-panels {
	            display: none;
	        }
	        body.dock-collapsed .context-dock-header {
	            padding: 0.75rem 0.5rem;
	            justify-content: center;
	        }

	        /* Focus mode: maximize document canvas */
	        body.focus-mode .enterprise-sidebar {
	            display: none;
	        }
	        body.focus-mode .enterprise-nav {
	            padding: 0 1rem;
	        }

	        /* Sidebar Cards */
	        .sidebar-section {
	            margin-bottom: 1.5rem;
	        }
        .sidebar-section-title {
            color: #909090;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            margin-bottom: 0.75rem;
        }
        .sidebar-card {
            background: #154165;
            border: 1px solid #1f577f;
            border-radius: var(--radius-sm);
            padding: 1rem;
            margin-bottom: 0.5rem;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .sidebar-card:hover {
            background: #1a4f7b;
            border-color: var(--de-orange);
        }
        .sidebar-card-title {
            color: #f4f7fb;
            font-size: 0.9rem;
            font-weight: 600;
            margin-bottom: 0.25rem;
        }
        .sidebar-card-desc {
            color: #c7d8e5;
            font-size: 0.75rem;
        }

        /* Professional Data Table */
        .data-table-container {
            background: white;
            border-radius: var(--radius-sm);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
            overflow: hidden;
        }
        .data-table-header {
            background: var(--bg-surface);
            padding: 1.25rem 1.5rem;
            border-bottom: 2px solid #e2e8f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .data-table-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--de-navy);
        }
        .data-table-actions {
            display: flex;
            gap: 0.75rem;
        }
        .data-table-search {
            padding: 1rem 1.5rem;
            background: var(--bg-surface);
            border-bottom: 1px solid #e2e8f0;
        }
        .data-table-search input {
            width: 100%;
            padding: 0.6rem 1rem;
            border: 2px solid var(--border-color);
            border-radius: 6px;
            font-size: 0.9rem;
            margin-bottom: 0;
        }
        .data-table {
            width: 100%;
            border-collapse: collapse;
        }
        .data-table thead {
            background: #f1f5f9;
            border-bottom: 2px solid #cbd5e1;
        }
        .data-table th {
            padding: 0.85rem 1rem;
            text-align: left;
            font-size: 0.85rem;
            font-weight: 700;
            color: #475569;
            text-transform: uppercase;
            letter-spacing: 0.025em;
            cursor: pointer;
            user-select: none;
        }
        .data-table th:hover {
            background: #e2e8f0;
        }
        .data-table td {
            padding: 0.85rem 1rem;
            border-bottom: 1px solid #e2e8f0;
            font-size: 0.9rem;
            color: var(--de-navy);
        }
        .data-table tr:hover {
            background: var(--bg-surface);
        }
        .data-table-checkbox {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }
        .data-table-icon {
            font-size: 1.2rem;
        }
        .data-table-pagination {
            padding: 1rem 1.5rem;
            background: var(--bg-surface);
            border-top: 2px solid #e2e8f0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }
        .pagination-info {
            font-size: 0.85rem;
            color: var(--text-muted);
        }
        .pagination-controls {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }
        .pagination-btn {
            padding: 0.4rem 0.8rem !important;
            font-size: 0.85rem !important;
            background: white !important;
            border: 1px solid #cbd5e1 !important;
            color: #475569 !important;
            border-radius: 4px !important;
            cursor: pointer;
            margin: 0 !important;
        }
        .pagination-btn:hover:not(:disabled) {
            background: #f1f5f9 !important;
            border-color: #94a3b8 !important;
        }
        .pagination-btn:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        /* ================================
           MEDIA PAGE (VISUAL MATCH)
           ================================ */
        .media-page {
            padding: 2rem;
            display: grid;
            gap: 1.5rem;
        }
        @media (max-width: 900px) {
            .media-page {
                padding: 1.25rem;
            }
        }
        .media-card {
            background: #ffffff;
            border: 1px solid var(--border-color-light);
            border-radius: 12px;
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
            overflow: hidden;
        }
        .media-card-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--border-color-light);
            background: var(--bg-surface);
        }
        .media-card-title {
            font-size: 1rem;
            font-weight: 700;
            color: var(--text-dark);
        }
        .media-card-actions {
            display: flex;
            align-items: center;
            gap: 1rem;
            flex-wrap: wrap;
            justify-content: flex-end;
            flex: 1;
        }
        .media-search,
        .media-select select {
            height: 44px;
        }
        .media-select {
            height: 44px;
            display: inline-flex;
            align-items: center;
        }
        .media-card-body {
            padding: 1.25rem;
        }
        .media-table-body {
            padding: 0;
        }
        .media-upload-zone {
            border: 2px dashed var(--border-color);
            border-radius: 14px;
            padding: 2.5rem;
            text-align: center;
            background: #f8fafc;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .media-upload-zone:hover {
            border-color: var(--de-orange);
            background: rgba(243, 146, 0, 0.03);
        }
        .media-upload-zone svg {
            width: 48px;
            height: 48px;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
        }
        .media-upload-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-dark);
            margin-bottom: 0.35rem;
        }
        .media-upload-subtitle {
            font-size: 0.85rem;
            color: var(--text-muted);
        }
        .media-search {
            position: relative;
            flex: 1 1 360px;
            min-width: 260px;
            max-width: 520px;
        }
        .media-search svg {
            position: absolute;
            left: 12px;
            top: 50%;
            transform: translateY(-50%);
            width: 16px;
            height: 16px;
            color: var(--text-muted);
        }
        .media-search input {
            width: 100%;
            padding: 0.75rem 1rem 0.75rem 40px;
            border: 1px solid #d6e0ef;
            border-radius: 10px;
            outline: none;
            font-size: 0.875rem;
            color: var(--text-dark);
            background: #ffffff;
            line-height: 1.2;
            box-sizing: border-box;
        }
        .media-search input:focus {
            border-color: #f59e0b;
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
        }
        .media-search input::placeholder {
            color: var(--text-muted);
        }
        .media-select {
            display: inline-block;
            flex: 0 0 auto;
            min-width: 160px;
        }
        .media-select select {
            appearance: none;
            -webkit-appearance: none;
            -moz-appearance: none;
            padding: 0.75rem 40px 0.75rem 1rem;
            font-size: 0.875rem;
            border-radius: 10px;
            border: 1px solid #d6e0ef;
            background: #ffffff;
            background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
            background-repeat: no-repeat;
            background-position: right 12px center;
            color: var(--text-dark);
            cursor: pointer;
            min-width: 150px;
            line-height: 1.2;
            width: 100%;
            box-sizing: border-box;
        }
        .media-select select:focus {
            outline: none;
            border-color: #f59e0b;
            box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
        }
        .media-selection-bar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 0.75rem 1.25rem;
            border-bottom: 1px solid var(--border-color-light);
            background: #f8fafc;
        }
        .media-selection-text {
            font-size: 0.85rem;
            color: var(--text-secondary);
            font-weight: 600;
        }
        .media-btn {
            padding: 0.55rem 0.95rem;
            font-size: 0.8rem;
            font-weight: 600;
            border-radius: 10px;
            border: 1px solid var(--border-color);
            background: #ffffff;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .media-btn:hover {
            border-color: var(--de-navy);
            color: var(--de-navy);
            background: #f8fafc;
        }
        .media-btn.primary {
            background: var(--de-navy);
            border-color: var(--de-navy);
            color: #ffffff;
        }
        .media-btn.primary:hover {
            background: var(--de-dark-navy);
            border-color: var(--de-dark-navy);
        }
        .media-btn.danger-outline {
            border-color: #ef4444;
            color: #ef4444;
        }
        .media-btn.danger-outline:hover {
            background: #fee2e2;
            border-color: #dc2626;
            color: #dc2626;
        }
        .media-table-wrapper {
            overflow-x: auto;
        }
        .media-table {
            width: 100%;
            border-collapse: collapse;
        }
        .media-table th {
            text-align: left;
            padding: 1rem 1.25rem;
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.06em;
            color: var(--text-muted);
            border-bottom: 1px solid var(--border-color-light);
            background: var(--bg-surface);
            user-select: none;
            cursor: pointer;
        }
        .media-table th[data-nosort="true"] {
            cursor: default;
        }
        .media-table td {
            padding: 1rem 1.25rem;
            border-bottom: 1px solid var(--border-color-light);
            vertical-align: middle;
        }
        .media-table tr:hover td {
            background: #f8fafc;
        }
        .media-sort-indicator {
            font-size: 0.65rem;
            margin-left: 0.25rem;
            opacity: 0.7;
        }
        .media-checkbox {
            width: 18px;
            height: 18px;
            cursor: pointer;
        }
        .media-file-cell {
            display: flex;
            align-items: center;
            gap: 0.9rem;
        }
        .media-file-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
            color: #ffffff;
        }
        .media-file-icon svg {
            width: 20px;
            height: 20px;
        }
        .media-file-info {
            min-width: 0;
        }
        .media-file-name {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-dark);
            margin-bottom: 2px;
            word-break: break-word;
        }
        .media-file-meta {
            font-size: 0.75rem;
            color: var(--text-muted);
        }
        .media-status-badge {
            display: inline-flex;
            align-items: center;
            padding: 4px 12px;
            border-radius: 999px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .media-status-badge.ready {
            background: #d1fae5;
            color: #059669;
        }
        .media-status-badge.processing {
            background: #fef3c7;
            color: #b45309;
        }
        .media-status-badge.pending {
            background: #e2e8f0;
            color: #64748b;
        }
        .media-status-badge.error {
            background: #fee2e2;
            color: #dc2626;
        }
        .media-user-cell {
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }
        .media-user-avatar {
            width: 28px;
            height: 28px;
            border-radius: 999px;
            background: var(--de-navy);
            color: #ffffff;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.7rem;
            font-weight: 700;
            flex-shrink: 0;
        }
        .media-user-name {
            font-size: 0.8rem;
            color: var(--text-secondary);
            white-space: nowrap;
        }
        .media-excerpts {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-dark);
        }
        .media-date {
            font-size: 0.8rem;
            color: var(--text-muted);
            white-space: nowrap;
        }
        .media-actions-cell {
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .media-action-btn {
            padding: 6px 14px;
            font-size: 0.75rem;
            font-weight: 600;
            border-radius: 8px;
            border: 1px solid var(--border-color-light);
            background: #ffffff;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s ease;
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
        }
        .media-action-btn:hover {
            border-color: var(--de-navy);
            color: var(--de-navy);
            background: #f8fafc;
        }
        .media-action-btn.primary {
            background: var(--de-navy);
            border-color: var(--de-navy);
            color: #ffffff;
        }
        .media-action-btn.primary:hover {
            background: var(--de-dark-navy);
            border-color: var(--de-dark-navy);
        }
        .media-action-btn.danger:hover {
            border-color: #dc2626;
            color: #dc2626;
            background: #fee2e2;
        }
        .media-action-btn svg {
            width: 14px;
            height: 14px;
        }
        .media-empty {
            text-align: center;
            padding: 3rem 1rem;
            color: var(--text-muted);
        }
        .media-empty-icon {
            margin-bottom: 0.75rem;
            opacity: 0.6;
            color: #94a3b8;
            display: inline-flex;
            align-items: center;
            justify-content: center;
        }
        .media-empty-icon svg {
            width: 52px;
            height: 52px;
        }
        .media-empty-title {
            font-size: 1rem;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 0.35rem;
        }
        .media-empty-subtitle {
            font-size: 0.85rem;
        }

        .app-header {
            display: flex;
            justify-content: space-between;
            align-items: flex-start;
            margin-bottom: 1.5rem;
            padding-bottom: 1.5rem;
            border-bottom: 2px solid #e2e8f0;
        }
        .user-project-info {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }
        .user-badge, .project-badge {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            padding: 0.75rem 1rem;
            background: linear-gradient(135deg, #f8fafc, #f1f5f9);
            border: 2px solid var(--border-color);
            border-radius: var(--radius-lg);
        }
        .user-avatar, .project-icon {
            font-size: 1.5rem;
            width: 40px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-white);
            border-radius: 50%;
        }
        .user-name, .project-name {
            font-weight: 700;
            font-size: 0.9rem;
            color: var(--de-navy);
        }
        .user-role, .project-files {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }
        .quick-actions {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            margin-bottom: 1.5rem;
            padding: 1rem;
            background: var(--bg-surface);
            border-radius: var(--radius-lg);
            border: 1px solid #e2e8f0;
        }
        .btn-action {
            padding: 0.5rem 1rem !important;
            font-size: 0.85rem !important;
            background: #ffffff !important;
            border: 2px solid #cbd5e1 !important;
            color: #475569 !important;
            border-radius: 8px !important;
            margin-bottom: 0 !important;
            flex: 0 0 auto;
            width: auto !important;
        }
        .btn-action:hover {
            border-color: var(--de-blue) !important;
            background: #eff6ff !important;
        }
        .file-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 1rem;
            background: var(--bg-white);
            border: 2px solid #e2e8f0;
            border-radius: var(--radius-md);
            margin-bottom: 0.75rem;
            transition: all 0.2s;
        }
        .file-item:hover {
            border-color: var(--de-orange);
            box-shadow: 0 2px 8px rgba(59, 130, 246, 0.1);
        }
        .file-name {
            font-weight: 600;
            color: var(--de-navy);
            margin-bottom: 0.25rem;
        }
        .file-meta {
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        .file-status {
            font-weight: 600;
            font-size: 0.85rem;
        }
        .activity-item {
            padding: 0.75rem;
            border-bottom: 1px solid #e2e8f0;
        }
        .activity-time {
            font-size: 0.75rem;
            color: var(--text-muted);
            margin-bottom: 0.25rem;
        }
        .activity-content {
            font-size: 0.85rem;
            color: #475569;
        }
        .project-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1rem;
            margin-top: 1rem;
        }
        .project-card {
            background: var(--bg-white);
            border: 1px solid var(--border-color-light);
            border-radius: var(--radius-lg);
            padding: 1.25rem;
            cursor: pointer;
            transition: all 0.2s;
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
        }
        .project-card:hover {
            border-color: var(--de-navy);
            box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
            transform: translateY(-1px);
        }
        .project-card.active {
            border-color: var(--de-orange);
            background: rgba(243, 146, 0, 0.12);
        }
        .project-card-title {
            font-weight: 700;
            font-size: 1rem;
            color: var(--de-navy);
            margin-bottom: 0.5rem;
        }
        .project-card-meta {
            font-size: 0.8rem;
            color: var(--text-muted);
            margin-bottom: 0.75rem;
        }
        .project-card-stats {
            display: flex;
            gap: 1rem;
            font-size: 0.75rem;
            color: #475569;
        }
        .project-card-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
            border-top: 1px solid var(--border-color-light);
            padding-top: 0.75rem;
        }
        .project-action-btn {
            flex: 1;
            font-size: 0.85rem;
            padding: 0.45rem 0.7rem;
        }
        @media (max-width: 720px) {
            body {
                padding: 1rem;
            }
            .app-container {
                padding: 1.25rem;
            }
            .modal {
                padding: 0;
            }
            .modal-content {
                max-height: 90vh;
            }
            .scrollseg-modal-content {
                max-height: 90vh;
                width: 100%;
            }
            .scrollseg-modal-content .modal-header {
                padding: 0.875rem 1rem;
            }
            .scrollseg-modal-content .modal-title {
                font-size: 1.1rem;
            }
            .app-header {
                flex-direction: column;
                gap: 1rem;
            }
            .quick-actions {
                justify-content: center;
            }
        }

        /* Login Screen Styles */
        #loginScreen {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            width: 100vw;
            height: 100vh;
            background: linear-gradient(135deg, var(--de-dark-navy) 0%, var(--de-navy) 50%, #004a73 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            overflow: hidden;
        }
        #networkCanvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
        }
        .login-container {
            position: relative;
            z-index: 1;
            max-width: 420px;
            width: 90%;
            margin: 0 auto;
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            border-radius: var(--radius-2xl);
            padding: 2.5rem 2.5rem 2rem;
            box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }
        .login-logo {
            text-align: center;
            margin-bottom: 0.5rem;
        }
        .login-logo img {
            max-width: 220px;
            height: auto;
        }
        .login-title {
            font-size: 1.8rem;
            font-weight: 700;
            background: linear-gradient(135deg, var(--de-navy), var(--de-dark-navy));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
            text-align: center;
            margin-bottom: 0.5rem;
        }
        .login-subtitle {
            text-align: center;
            color: #64748b;
            margin-bottom: 2rem;
            font-size: 0.95rem;
            font-weight: 500;
        }
        .form-group {
            margin-bottom: 1.25rem;
        }
        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: var(--de-navy);
            font-size: 0.9rem;
        }
        .form-group input {
            width: 100%;
            padding: 0.85rem 1rem;
            border: 2px solid #e2e8f0;
            border-radius: var(--radius-md);
            font-size: 0.95rem;
            transition: all 0.2s;
            background: #fff;
        }
        .form-group input:focus {
            outline: none;
            border-color: var(--de-orange);
            box-shadow: 0 0 0 3px rgba(243, 146, 0, 0.15);
        }
        .login-btn {
            width: 100%;
            padding: 0.9rem;
            background: linear-gradient(135deg, var(--de-orange), var(--de-light-orange));
            color: var(--de-dark-navy);
            border: none;
            border-radius: var(--radius-md);
            font-weight: 700;
            font-size: 1rem;
            cursor: pointer;
            transition: all 0.2s;
            margin-top: 1rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .login-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(243, 146, 0, 0.4);
            background: linear-gradient(135deg, #e08600, var(--de-orange));
        }
        .login-btn:active {
            transform: translateY(0);
        }
        .login-btn.btn-secondary {
            background: #ffffff;
            color: var(--de-navy);
            border: 1px solid var(--border-color-light);
            box-shadow: none;
        }
        .login-btn.btn-secondary:hover {
            background: #f8fafc;
            border-color: var(--de-navy);
            box-shadow: none;
            transform: translateY(-1px);
        }
        .login-copyright {
            text-align: center;
            margin-top: 2rem;
            padding-top: 1.5rem;
            border-top: 1px solid #e2e8f0;
            color: #94a3b8;
            font-size: 0.8rem;
        }
        .error-message {
            background: linear-gradient(135deg, #fee2e2, #fecaca);
            border: 2px solid #ef4444;
            color: #991b1b;
            padding: 0.75rem 1rem;
            border-radius: var(--radius-md);
            margin-bottom: 1rem;
            font-size: 0.85rem;
            text-align: center;
        }
        .success-message {
            background: linear-gradient(135deg, #d1fae5, #a7f3d0);
            border: 2px solid #10b981;
            color: #065f46;
            padding: 0.75rem 1rem;
            border-radius: var(--radius-md);
            margin-bottom: 1rem;
            font-size: 0.85rem;
            text-align: center;
        }

        /* User Management Styles */
        .user-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1rem;
        }
        .user-table th {
            background: var(--bg-surface);
            padding: 0.75rem;
            text-align: left;
            font-weight: 600;
            font-size: 0.85rem;
            color: #475569;
            border-bottom: 2px solid #e2e8f0;
        }
        .user-table td {
            padding: 0.75rem;
            border-bottom: 1px solid #e2e8f0;
            font-size: 0.9rem;
        }
        .user-table tr:hover {
            background: var(--bg-surface);
        }
        .role-badge {
            display: inline-block;
            padding: 0.25rem 0.6rem;
            border-radius: var(--radius-full);
            font-size: 0.75rem;
            font-weight: 600;
        }
        .role-admin {
            background: linear-gradient(135deg, #fecaca, #fca5a5);
            color: #991b1b;
            border: 1px solid #ef4444;
        }
        .role-analyst {
            background: linear-gradient(135deg, #dbeafe, #bfdbfe);
            color: #1e40af;
            border: 1px solid var(--de-orange);
        }
        .role-viewer {
            background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
            color: #475569;
            border: 1px solid #94a3b8;
        }
        .status-active {
            color: #10b981;
            font-weight: 600;
        }
        .status-suspended {
            color: #ef4444;
            font-weight: 600;
        }
        .btn-small {
            padding: 0.35rem 0.65rem !important;
            font-size: 0.75rem !important;
            margin: 0 0.2rem !important;
        }
        .completion-banner {
            background: linear-gradient(135deg, #fef3c7, #fde68a);
            border: 2px solid #f59e0b;
            border-radius: var(--radius-lg);
            padding: 1rem;
            margin-bottom: 1.5rem;
            text-align: center;
        }
        .completion-stats {
            display: flex;
            justify-content: space-around;
            margin-top: 0.75rem;
            flex-wrap: wrap;
            gap: 1rem;
        }
        .completion-stat {
            text-align: center;
        }
        .completion-stat-value {
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--de-navy);
        }
        .completion-stat-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.05em;
        }

        /* Text Selection & Segmentation Styles */
        .selection-menu {
            position: absolute;
            background: white;
            border: 2px solid var(--border-color);
            border-radius: var(--radius-lg);
            box-shadow: 0 8px 24px rgba(0,0,0,0.15), 0 4px 8px rgba(0,0,0,0.1);
            z-index: 10000;
            min-width: 280px;
            max-width: 350px;
            padding: 0;
            overflow: hidden;
            animation: fadeInMenu 0.2s ease;
        }
        @keyframes fadeInMenu {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .selection-menu-header {
            background: linear-gradient(135deg, var(--de-navy), var(--de-dark-navy));
            color: white;
            padding: 0.75rem 1rem;
            font-weight: 600;
            font-size: 0.9rem;
            border-bottom: 1px solid rgba(255,255,255,0.2);
        }
        .selection-menu-actions {
            padding: 0.5rem;
        }
        .selection-menu-actions button {
            display: block;
            width: 100%;
            margin: 0.25rem 0;
            padding: 0.65rem 1rem;
            border: 1px solid #e2e8f0;
            border-radius: var(--radius-sm);
            background: white;
            color: var(--de-navy);
            font-size: 0.9rem;
            cursor: pointer;
            transition: all 0.2s ease;
            text-align: left;
        }
        .selection-menu-actions button:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
            transform: translateX(4px);
        }
        .selection-menu-actions button:active {
            transform: translateX(2px);
        }

        .text-segment {
            cursor: pointer;
            transition: all 0.2s ease;
            border-radius: 3px;
            padding: 2px 0;
            position: relative;
            display: inline;
        }
        .text-segment:hover {
            filter: brightness(0.92);
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }

        .segments-panel {
            margin-top: 1rem;
            padding: 1rem;
            background: var(--bg-surface);
            border: 1px solid #e2e8f0;
            border-radius: var(--radius-lg);
        }
        .segments-panel-header {
            font-weight: 600;
            color: var(--de-navy);
            margin-bottom: 0.75rem;
            font-size: 1rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
        .segment-item {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: var(--radius-sm);
            padding: 0.75rem;
            margin-bottom: 0.5rem;
            transition: all 0.2s ease;
        }
        .segment-item:hover {
            border-color: #cbd5e1;
            box-shadow: 0 2px 6px rgba(0,0,0,0.08);
        }
        .segment-item-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 0.5rem;
        }
        .segment-number {
            font-weight: 600;
            color: var(--de-navy);
            font-size: 0.85rem;
        }
        .segment-text {
            color: #475569;
            font-size: 0.9rem;
            margin-bottom: 0.5rem;
            font-style: italic;
            line-height: 1.5;
            border-left: 3px solid #e2e8f0;
            padding-left: 0.75rem;
        }
        .segment-codes {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 0.25rem;
        }
        .segment-codes strong {
            color: var(--de-navy);
        }
        .segment-meta {
            font-size: 0.75rem;
            color: #94a3b8;
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        .segment-actions {
            display: flex;
            gap: 0.5rem;
        }
        .segment-actions button {
            padding: 0.35rem 0.65rem;
            font-size: 0.8rem;
            border: 1px solid #e2e8f0;
            border-radius: 6px;
            background: white;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .segment-actions button:hover {
            background: #f1f5f9;
            border-color: #cbd5e1;
        }
        .segment-delete-btn {
            color: #dc2626;
        }
        .segment-delete-btn:hover {
            background: #fef2f2;
            border-color: #fecaca;
        }

        .code-selection-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 9999;
            animation: fadeIn 0.2s ease;
        }
        .code-selection-content {
            background: white;
            border-radius: var(--radius-xl);
            padding: 2rem;
            max-width: 500px;
            width: 90%;
            max-height: 80vh;
            overflow-y: auto;
            box-shadow: 0 20px 50px rgba(0,0,0,0.3);
        }
        .code-selection-title {
            font-size: 1.3rem;
            font-weight: 700;
            color: var(--de-navy);
            margin-bottom: 1rem;
        }
        .code-selection-excerpt {
            background: #f1f5f9;
            padding: 0.75rem;
            border-radius: var(--radius-sm);
            border-left: 4px solid var(--de-orange);
            margin-bottom: 1.5rem;
            font-style: italic;
            color: #475569;
            max-height: 150px;
            overflow-y: auto;
        }

        /* Smart Code Suggestion Chips */
        .suggested-code-chip {
            display: inline-block;
            padding: 0.5rem 1rem;
            background: white;
            border: 2px solid var(--de-orange);
            border-radius: var(--radius-2xl);
            color: #1e40af;
            font-size: 0.85rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .suggested-code-chip:hover {
            background: var(--de-orange);
            color: white;
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(59, 130, 246, 0.3);
        }
        .suggested-code-chip:active {
            transform: translateY(0);
        }

        /* Checkbox Code Selection */
        .scroll-code-chip-checkbox {
            display: inline-flex;
            align-items: center;
            padding: 0.5rem 0.75rem;
            background: white;
            border: 2px solid var(--border-color);
            border-radius: var(--radius-sm);
            font-size: 0.85rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .scroll-code-chip-checkbox:hover {
            border-color: var(--de-orange);
            background: #f0f9ff;
        }
        .scroll-code-chip-checkbox input:checked + span {
            color: #1e40af;
            font-weight: 700;
        }
        .scroll-code-chip-checkbox input:checked {
            accent-color: var(--de-orange);
        }

        .scroll-code-list-item:hover {
            background: var(--bg-surface);
        }

        .scroll-code-panel-header {
            display: flex;
            justify-content: space-between;
            align-items: start;
            padding: 1rem;
            border-bottom: 2px solid #e2e8f0;
            margin-bottom: 0.75rem;
        }

        .scroll-code-suggestions {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .scroll-code-search {
            margin-bottom: 0.75rem;
        }

        #codeSelectionPanel,
        #scrollModeCodePanel {
            display: none;
            position: fixed;
            background: white;
            border-radius: var(--radius-lg);
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
            border: 2px solid var(--de-orange);
            z-index: 10000;
            min-width: 400px;
        }

        /* Scroll Mode Styles */
        #excerptModePanel {
            display: block;
        }
        #documentViewerPanel,
        #scrollModePanel {
            display: none;
        }

        /* Docked layout for PDF viewer + coded segments panel */
        .docview-shell {
            height: auto;
        }
        .docview-layout {
            display: block;
            width: 100%;
            min-width: 0;
            overflow: visible;
        }
        body.coded-segments-open .docview-layout {
            display: grid;
            grid-template-columns: 340px minmax(0, 1fr);
            gap: 16px;
            align-items: start;
            width: 100%;
        }
        body.coded-segments-open .docview-main {
            min-width: 0;
            max-width: 100%;
            padding: 0;
        }
        .docview-main {
            min-width: 0;
        }
        /* Keep the docked sidebar in view while scrolling the PDF */
        .coded-segments-sidebar {
            top: 90px;
            position: sticky;
            width: 340px;
            max-height: calc(100vh - 110px);
            z-index: 100;
            background: white;
            border: 1px solid rgba(16, 185, 129, 0.35);
            border-radius: 14px;
            box-shadow: 0 10px 30px rgba(2, 6, 23, 0.18);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            transition: opacity 0.3s ease;
        }
	        /* When the PDF viewer provides its own scroll container, stick to the top of that area. */
	        .enterprise-main.pdf-viewer-mode .coded-segments-sidebar {
	            top: calc(var(--enterprise-nav-height, 68px) + var(--pdf-viewer-header-height, 0px) + 12px);
	            max-height: calc(100vh - var(--enterprise-nav-height, 68px) - var(--pdf-viewer-header-height, 0px) - 32px);
	        }
        .coded-segments-sidebar.collapsed { display: none !important; }
        .coded-segments-header {
            background: linear-gradient(135deg, #0f2f47, #154165);
            color: white;
            padding: 0.95rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
            border-bottom: 1px solid rgba(255,255,255,0.12);
        }
        .coded-segments-header-info {
            min-width: 0;
            flex: 1;
            opacity: 1;
            transition: opacity 0.2s ease;
        }
        .coded-segments-sidebar.collapsed .coded-segments-header-info {
            opacity: 0;
            pointer-events: none;
        }
        .coded-segments-header-title {
            font-size: 1rem;
            font-weight: 600;
            letter-spacing: -0.01em;
            line-height: 1.2;
        }
        .coded-segments-header-subtitle {
            font-size: 0.75rem;
            opacity: 0.85;
            margin-top: 0.2rem;
        }
        .toggle-btn {
            appearance: none;
            border: 1px solid rgba(255,255,255,0.3);
            background: rgba(255,255,255,0.15);
            color: #ffffff;
            width: 36px;
            height: 36px;
            border-radius: 8px;
            font-size: 1rem;
            font-weight: 600;
            line-height: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            flex: 0 0 auto;
            transition: all 0.2s ease;
        }
        .toggle-btn:hover {
            border-color: rgba(255,255,255,0.45);
            background: rgba(255,255,255,0.25);
            transform: scale(1.05);
        }
        .coded-segments-body {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
            background: #ffffff;
        }
        .coded-segments-sidebar.collapsed .coded-segments-body {
            display: none;
        }
        .coded-segments-filter {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 0.65rem;
            margin-bottom: 0.75rem;
        }
        .coded-segments-filter-label {
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            color: #64748b;
            margin-bottom: 0.4rem;
        }
        .coded-segments-filter-row {
            display: flex;
            gap: 0.5rem;
            align-items: center;
        }
        .coded-segments-filter-select {
            flex: 1;
            min-width: 0;
            width: auto;
            margin: 0;
            padding: 0.45rem 0.6rem;
            font-size: 0.8rem;
            border-radius: 10px;
        }
        .coded-segments-filter-clear {
            width: auto;
            margin: 0;
            padding: 0.45rem 0.6rem;
            font-size: 0.75rem;
            font-weight: 700;
            background: #e2e8f0;
            border: 1px solid #cbd5e1;
            color: #0f172a;
            border-radius: 10px;
            box-shadow: none;
        }
        .coded-segments-filter-clear:hover:not(:disabled) {
            transform: none;
            box-shadow: none;
            background: #cbd5e1;
        }
        .coded-segment-item {
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-left: 3px solid #10b981;
            padding: 0.85rem 1rem;
            border-radius: 10px;
            margin-bottom: 0.65rem;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .coded-segment-item:hover {
            border-left-color: #059669;
            border-color: #cbd5e1;
            box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
            transform: translateY(-1px);
        }
        .coded-segment-item-top {
            display: flex;
            justify-content: space-between;
            align-items: start;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
        }
        .coded-segment-item-title {
            font-weight: 600;
            color: #0f172a;
            font-size: 0.9rem;
        }
        .coded-segment-actions {
            display: inline-flex;
            gap: 0.35rem;
            align-items: center;
        }
        .coded-segment-edit {
            background: rgba(14, 116, 144, 0.08);
            border: 1px solid rgba(14, 116, 144, 0.22);
            color: #0e7490;
            padding: 0.2rem 0.5rem;
            border-radius: 10px;
            cursor: pointer;
            font-size: 0.75rem;
            line-height: 1;
            font-weight: 700;
            box-shadow: none;
        }
        .coded-segment-edit:hover {
            transform: none;
            box-shadow: none;
            background: rgba(14, 116, 144, 0.2);
        }
        .coded-segment-delete {
            background: rgba(239, 68, 68, 0.08);
            border: 1px solid rgba(239, 68, 68, 0.22);
            color: #b91c1c;
            padding: 0.2rem 0.5rem;
            border-radius: 10px;
            cursor: pointer;
            font-size: 0.75rem;
            line-height: 1;
            transition: all 0.2s ease;
        }
        .coded-segment-delete:hover {
            background: rgba(239, 68, 68, 0.28);
            border-color: rgba(239, 68, 68, 0.55);
        }
        .coded-segment-preview {
            font-size: 0.8rem;
            color: #475569;
            font-style: italic;
            margin-bottom: 0.6rem;
            line-height: 1.4;
            max-height: 4.2em;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
        }
        .coded-segment-preview.is-expanded {
            max-height: none;
            -webkit-line-clamp: unset;
        }
        .coded-segment-preview-toggle {
            background: none;
            border: none;
            color: #0ea5e9;
            font-size: 0.75rem;
            font-weight: 700;
            cursor: pointer;
            padding: 0;
            margin: -0.25rem 0 0.55rem;
            text-align: left;
        }
        .coded-segment-preview-toggle:hover {
            text-decoration: underline;
        }
        .coded-segment-codes {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
            margin-bottom: 0.4rem;
        }
        .coded-segment-code-chip {
            background: rgba(16, 185, 129, 0.12);
            border: 1px solid rgba(16, 185, 129, 0.22);
            color: #065f46;
            padding: 0.3rem 0.6rem;
            border-radius: 999px;
            font-size: 0.75rem;
            font-weight: 600;
        }
        .coded-segment-meta {
            font-size: 0.68rem;
            color: #94a3b8;
            margin-top: 0.55rem;
        }
        .coded-segments-footer {
            padding: 0.75rem;
            border-top: 1px solid #e2e8f0;
            background: #f8fafc;
        }
        .coded-segments-sidebar.collapsed .coded-segments-footer {
            display: none;
        }
        .export-btn {
            width: 100%;
            padding: 0.75rem;
            background: linear-gradient(135deg, #1d4ed8, #2563eb);
            color: white;
            border: none;
            border-radius: 10px;
            font-size: 0.9rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .export-btn.secondary {
            background: rgba(255, 255, 255, 0.08);
            color: rgba(255, 255, 255, 0.92);
            border: 1px solid rgba(255, 255, 255, 0.18);
        }
        .export-btn:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
        }
        .coded-segments-body::-webkit-scrollbar {
            width: 6px;
        }
        .coded-segments-body::-webkit-scrollbar-track {
            background: #f1f5f9;
        }
        .coded-segments-body::-webkit-scrollbar-thumb {
            background: #cbd5e1;
            border-radius: 3px;
        }
        .coded-segments-body::-webkit-scrollbar-thumb:hover {
            background: #94a3b8;
        }

        .coded-segments-empty {
            border: 2px dashed #cbd5e1;
            border-radius: 10px;
            padding: 1.5rem 1rem;
            background: #f8fafc;
            text-align: center;
        }
        .coded-segments-empty-title {
            color: #0f172a;
            font-weight: 600;
            font-size: 0.9rem;
        }
        .coded-segments-empty-sub {
            margin-top: 0.4rem;
            color: #64748b;
            font-weight: 500;
            font-size: 0.8rem;
            line-height: 1.5;
        }

        /* Collapsed opener pill (does not consume layout width). */
        .coded-segments-opener {
            display: none;
            position: fixed;
            left: 20px;
            top: 100px;
            width: 48px;
            height: 48px;
            border-radius: 8px;
            border: 1px solid rgba(2, 6, 23, 0.12);
            background: #3b82f6;
            color: white;
            font-size: 1.1rem;
            font-weight: 600;
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
            align-items: center;
            justify-content: center;
            cursor: pointer;
            z-index: 1000;
            transition: all 0.2s ease;
        }
        .coded-segments-opener:hover {
            background: #2563eb;
            box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
            transform: translateX(3px);
        }
        .coded-segments-opener::after {
            content: "▶";
            font-size: 1rem;
            font-weight: 600;
            opacity: 0.95;
        }
        body:not(.coded-segments-open) .coded-segments-opener {
            display: flex;
        }
        @media (max-width: 1100px) {
            .docview-layout {
                grid-template-columns: 1fr;
            }
            .coded-segments-sidebar {
                position: sticky;
                top: 72px;
                width: 100%;
                max-width: none;
                max-height: min(45vh, 460px);
                box-shadow: 0 12px 30px rgba(2, 6, 23, 0.10);
            }
        }
        .docview-document,
        .scroll-mode-document {
            background: #525659;
            padding: 2rem;
            border-radius: var(--radius-lg);
            border: 2px solid var(--border-color);
            max-width: none;
            margin: 0 auto;
            max-height: 70vh;
            overflow-y: auto;
        }
        .docview-paragraph,
        .scroll-mode-paragraph {
            margin: 0 auto;
            padding: 0.85rem 0;
            background: var(--bg-white);
            border-radius: 0;
            border: none;
            box-shadow: none;
            transition: background 0.2s ease;
            max-width: 100%;
        }
        .docview-paragraph + .docview-paragraph,
        .scroll-mode-paragraph + .scroll-mode-paragraph {
            border-top: 1px solid #eef2f7;
        }
        .docview-paragraph:hover,
        .scroll-mode-paragraph:hover { background: var(--bg-white); }
        .docview-paragraph-meta,
        .scroll-mode-paragraph-meta {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            margin-bottom: 0.4rem;
            padding-bottom: 0;
            border-bottom: none;
        }
        .docview-paragraph-number,
        .scroll-mode-paragraph-number {
            display: none;
        }
        .docview-priority-badge,
        .scroll-mode-priority-badge {
            font-size: 0.75rem;
            padding: 0.25rem 0.75rem;
            border-radius: var(--radius-lg);
            border: 1px solid;
            font-weight: 600;
        }
        .docview-paragraph-text,
        .scroll-mode-paragraph-text {
            color: var(--de-navy);
            user-select: text;
            cursor: text;
            font-size: 1rem;
            line-height: 1.45;
            text-align: justify;
            letter-spacing: 0;
            word-break: normal;
            hyphens: auto;
            margin: 0 auto;
            max-width: 820px;
        }

        /* Beautiful Document Formatting */
        .docview-paragraph-text h1,
        .docview-paragraph-text h2,
        .docview-paragraph-text h3,
        .docview-paragraph-text h4,
        .scroll-mode-paragraph-text h1,
        .scroll-mode-paragraph-text h2,
        .scroll-mode-paragraph-text h3,
        .scroll-mode-paragraph-text h4 {
            margin: 0 0 1rem 0;
            line-height: 1.35;
            font-weight: 700;
            text-align: left;
        }
        .docview-paragraph-text h1,
        .scroll-mode-paragraph-text h1 {
            font-size: 1.8rem;
            color: var(--de-navy);
            border-bottom: 3px solid var(--de-navy);
            padding-bottom: 0.5rem;
            margin-bottom: 1.2rem;
            letter-spacing: -0.02em;
            line-height: 1.3;
        }
        .docview-paragraph-text h2,
        .scroll-mode-paragraph-text h2 {
            font-size: 1.45rem;
            color: var(--de-navy);
            border-bottom: 2px solid #cbd5e1;
            padding-bottom: 0.4rem;
            margin-bottom: 1rem;
            letter-spacing: -0.01em;
            line-height: 1.3;
        }
        .docview-paragraph-text h3,
        .scroll-mode-paragraph-text h3 {
            font-size: 1.2rem;
            color: var(--de-navy);
            margin-bottom: 0.8rem;
            line-height: 1.25;
        }
        .docview-paragraph-text p,
        .scroll-mode-paragraph-text p {
            margin: 0 0 0.65rem 0;
            line-height: 1.4;
            text-align: justify;
        }
        .docview-paragraph-text p:last-child,
        .scroll-mode-paragraph-text p:last-child {
            margin-bottom: 0;
        }
        .docview-paragraph-text p + p,
        .scroll-mode-paragraph-text p + p {
            margin-top: 0.65rem;
        }
        .docview-paragraph-text ul,
        .docview-paragraph-text ol,
        .scroll-mode-paragraph-text ul,
        .scroll-mode-paragraph-text ol {
            margin: 0.8rem 0 1rem 1.4rem;
            line-height: 1.6;
        }
        .docview-paragraph-text li,
        .scroll-mode-paragraph-text li {
            margin-bottom: 0.45rem;
            padding-left: 0.35rem;
        }
        .docview-paragraph-text strong,
        .docview-paragraph-text b,
        .scroll-mode-paragraph-text strong,
        .scroll-mode-paragraph-text b {
            font-weight: 700;
            color: var(--de-navy);
        }
        .docview-paragraph-text em,
        .docview-paragraph-text i,
        .scroll-mode-paragraph-text em,
        .scroll-mode-paragraph-text i {
            font-style: italic;
            color: #475569;
        }
        .docview-paragraph-text table,
        .scroll-mode-paragraph-text table {
            width: 100%;
            border-collapse: collapse;
            margin: 1rem 0;
            border: 2px solid #e2e8f0;
            border-radius: var(--radius-sm);
            overflow: hidden;
        }
        .docview-paragraph-text th,
        .scroll-mode-paragraph-text th {
            background: linear-gradient(135deg, var(--de-orange), var(--de-light-orange));
            color: white;
            font-weight: 600;
            padding: 0.75rem;
            text-align: left;
        }
        .docview-paragraph-text td,
        .scroll-mode-paragraph-text td {
            padding: 0.75rem;
            border-bottom: 1px solid #e2e8f0;
        }
        .docview-paragraph-text tr:nth-child(even),
        .scroll-mode-paragraph-text tr:nth-child(even) {
            background: var(--bg-surface);
        }

        /* Type-specific styling */
        .docview-heading,
        .scroll-mode-heading {
            border-left: 4px solid var(--de-navy);
            background: #f8fbff;
        }
        .docview-list,
        .scroll-mode-list {
            border-left: 4px solid #10b981;
            background: #f6fdf8;
        }
        .docview-table,
        .scroll-mode-table {
            border-left: 4px solid #f59e0b;
            background: #fffaf1;
        }

        .docview-page-badge,
        .scroll-mode-page-badge {
            display: none;
        }

        /* PDF Pages in Scroll Mode - uses official PDF.js textLayer CSS */
        .docview-pdf-page,
        .scroll-mode-pdf-page {
            margin: 20px auto;
            background: white;
            padding: 0;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .docview-pdf-wrapper,
        .scroll-mode-pdf-wrapper {
            position: relative;
            margin: 0 auto;
        }
        .docview-pdf-page canvas,
        .scroll-mode-pdf-page canvas {
            display: block;
        }

        /* PDF.js Text Layer - essential for smooth text selection */
        .textLayer,
        .pdf-text-layer {
            position: absolute;
            left: 0;
            top: 0;
            right: 0;
            bottom: 0;
            overflow: hidden;
            /* Keep the text layer visible enough so users can start a drag */
            opacity: 0.2;
            line-height: 1.0;
            mix-blend-mode: normal;
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
            pointer-events: auto;
            z-index: 1;
        }

        .document-viewer-container,
        .pdf-page-container,
        .pdf-page-wrapper {
            user-select: none;
            -webkit-user-select: none;
            -moz-user-select: none;
            -ms-user-select: none;
        }

        .textLayer > span,
        .pdf-text-layer > span,
        .textLayer > div,
        .pdf-text-layer > div {
            color: transparent;
            position: absolute;
            white-space: pre;
            cursor: text;
            transform-origin: 0% 0%;
            user-select: text;
            -webkit-user-select: text;
            -moz-user-select: text;
            -ms-user-select: text;
            pointer-events: auto;
        }

        .textLayer .endOfContent,
        .pdf-text-layer .endOfContent {
            display: block;
            position: absolute;
            left: 0;
            top: 100%;
            right: 0;
            height: 0;
            z-index: -1;
            cursor: text;
        }

        .textLayer .endOfContent.active,
        .pdf-text-layer .endOfContent.active {
            top: 0;
            height: 100%;
        }

        .textLayer ::selection,
        .pdf-text-layer ::selection {
            background: rgba(180, 83, 9, 0.45) !important; /* darker amber */
            color: transparent;
        }
        .textLayer::-moz-selection,
        .pdf-text-layer::-moz-selection {
            background: rgba(180, 83, 9, 0.45) !important;
        }

        /* Prevent footnote references from being selectable */
        [data-is-footnote] {
            user-select: none !important;
            -webkit-user-select: none !important;
            -moz-user-select: none !important;
        }

	        /* PDF Highlight Overlays - clickable coded segments like Dedoose */
	        .pdf-highlight-overlay {
	            box-sizing: border-box;
	            border-radius: 2px;
	            pointer-events: all !important;
	            cursor: pointer;
	            transition: all 0.2s ease;
	        }
        .pdf-highlight-overlay:hover {
            opacity: 0.9;
            transform: translateY(-1px);
            box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5);
        }

        /* Hover tooltip for showing applied codes */
        .excerpt-codes-tooltip {
            position: fixed;
            background: white;
            border: 2px solid var(--de-navy);
            border-radius: var(--radius-md);
            box-shadow: 0 8px 24px rgba(0,0,0,0.2);
            padding: 0.75rem 1rem;
            z-index: 10002;
            max-width: 320px;
            min-width: 180px;
            pointer-events: none;
            animation: tooltipFadeIn 0.15s ease;
        }
        @keyframes tooltipFadeIn {
            from { opacity: 0; transform: translateY(4px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .excerpt-codes-tooltip-header {
            font-size: 0.7rem;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 0.5rem;
            padding-bottom: 0.4rem;
            border-bottom: 1px solid var(--border-color-light);
        }
        .excerpt-codes-tooltip-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
        }
        .excerpt-codes-tooltip-chip {
            background: linear-gradient(135deg, var(--de-orange) 0%, var(--de-light-orange) 100%);
            color: white;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 0.25rem 0.6rem;
            border-radius: var(--radius-full);
            white-space: nowrap;
        }
        .excerpt-codes-tooltip-footer {
            font-size: 0.65rem;
            color: var(--text-muted);
            margin-top: 0.5rem;
            padding-top: 0.4rem;
            border-top: 1px solid var(--border-color-light);
        }

        .docview-highlight,
        .scroll-mode-highlight {
            background: linear-gradient(120deg, #fef3c7 0%, #fde68a 100%);
            border-bottom: 3px solid #fbbf24;
            padding: 2px 0;
            cursor: help;
            transition: all 0.2s ease;
        }
        .docview-highlight:hover,
        .scroll-mode-highlight:hover {
            background: linear-gradient(120deg, #fde68a 0%, #fcd34d 100%);
        }

        /* Scroll Mode Code Panel (Floating) */
        .code-selection-panel,
        .docview-code-panel,
        .scroll-mode-code-panel {
            position: fixed;
            background: white;
            border: 3px solid var(--de-navy);
            border-radius: var(--radius-xl);
            box-shadow: 0 20px 60px rgba(0,0,0,0.3), 0 0 0 1px rgba(243,146,0,0.1);
            z-index: 9999;
            animation: slideInRight 0.3s ease;
            overflow: hidden;
        }
        @keyframes slideInRight {
            from { opacity: 0; transform: translateX(30px); }
            to { opacity: 1; transform: translateX(0); }
        }
        @keyframes slideDown {
            from { opacity: 0; transform: translate(-50%, -20px); }
            to { opacity: 1; transform: translate(-50%, 0); }
        }
        @keyframes slideUp {
            from { opacity: 1; transform: translate(-50%, 0); }
            to { opacity: 0; transform: translate(-50%, -20px); }
        }
        .scroll-code-panel-header {
            background: linear-gradient(135deg, var(--de-navy), var(--de-dark-navy));
            color: white;
            padding: 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.9rem;
        }
        .scroll-code-chip-checkbox:hover {
            border-color: var(--de-orange) !important;
            transform: translateX(2px);
        }
        .scroll-code-list-item:hover {
            background: white !important;
            border-color: #cbd5e1 !important;
            transform: translateX(2px);
        }
        .scroll-code-suggestions {
            padding: 1rem;
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            background: var(--bg-surface);
            border-bottom: 1px solid #e2e8f0;
        }
        .scroll-code-chip {
            padding: 0.5rem 1rem;
            background: white;
            border: 2px solid var(--de-orange);
            border-radius: var(--radius-2xl);
            color: #1e40af;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .scroll-code-chip:hover {
            background: var(--de-orange);
            color: white;
            transform: scale(1.05);
        }
        .scroll-code-search {
            padding: 0.75rem;
            border-bottom: 1px solid #e2e8f0;
        }
        .scroll-code-list {
            padding: 0.5rem;
        }
        .scroll-code-item {
            padding: 0.75rem;
            border-radius: var(--radius-sm);
            margin-bottom: 0.25rem;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .scroll-code-item:hover {
            background: #f1f5f9;
        }
        .scroll-code-view-more {
            width: 100%;
            padding: 0.75rem;
            border: none;
            background: #f1f5f9;
            color: var(--de-navy);
            font-weight: 600;
            cursor: pointer;
            border-top: 1px solid #e2e8f0;
            transition: all 0.2s ease;
        }
        .scroll-code-view-more:hover {
            background: #dbeafe;
        }

        /* Upload Drop Zone */
        .upload-drop-zone:hover {
            background: #eff6ff !important;
            border-color: #2563eb !important;
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
        }
        .upload-drop-zone:active {
            transform: translateY(0);
        }

        /* Mode Toggle Buttons */
        .mode-toggle-btn {
            padding: 0.75rem 1.5rem;
            border: 2px solid transparent;
            border-radius: var(--radius-sm);
            background: transparent;
            color: var(--text-muted);
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
            font-size: 0.9rem;
        }
        .mode-toggle-btn:hover {
            background: #f1f5f9;
            color: var(--de-navy);
        }
        .mode-toggle-btn.active {
            background: linear-gradient(135deg, var(--de-navy), var(--de-dark-navy));
            color: white;
            border-color: transparent;
        }

	        /* Beautiful Document Viewer (PDF as Images) */
        .document-viewer-header {
            margin-bottom: 0.75rem;
            max-width: none;
            padding: 0 0.85rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            flex-wrap: wrap;
        }
            /* Keep the PDF viewer header visible while scrolling the document. */
            .enterprise-main.pdf-viewer-mode .document-viewer-header {
                position: sticky;
                top: var(--enterprise-nav-height, 68px);
                z-index: 9997; /* below nav (9998), above content */
                background: rgba(245, 245, 245, 0.92);
                backdrop-filter: blur(8px);
                border-bottom: 1px solid rgba(15, 23, 42, 0.08);
                margin-bottom: 0.75rem;
                padding: 0.6rem 0.85rem;
            }
        .document-viewer-title-block {
            display: flex;
            flex-direction: column;
            gap: 0.2rem;
            min-width: 0;
            flex: 1 1 auto;
        }
        .document-viewer-title-block h2 {
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .document-viewer-toolbar {
            display: flex;
            align-items: center;
            gap: 12px;
            flex-wrap: nowrap;
            margin-left: auto;
            background: transparent;
            border: none;
            border-radius: 0;
            padding: 0;
            box-shadow: none;
        }
        .docview-pill-group {
            display: inline-flex;
            align-items: center;
            padding: 4px;
            border-radius: 999px;
            background: #e2e8f0;
            gap: 4px;
            line-height: 1;
        }
        .docview-pill {
            border: none;
            background: transparent;
            color: #334155;
            font-size: 12px;
            font-weight: 700;
            padding: 8px 14px;
            border-radius: 999px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            vertical-align: middle;
            margin: 0;
        }
        .docview-pill:hover {
            background: rgba(255, 255, 255, 0.7);
        }
        .docview-pill.active {
            background: #ffffff;
            color: var(--de-navy);
            box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
        }
        .docview-pill-actions {
            display: inline-flex;
            align-items: center;
            gap: 10px;
            flex-wrap: nowrap;
        }
        .docview-pill-action {
            background: #ffffff;
            border: 1px solid #cbd5e1;
            border-radius: 10px;
            padding: 6px 10px;
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            color: var(--de-navy);
            transition: all 0.15s ease;
            white-space: nowrap;
            margin: 0;
        }
        .docview-pill-action:hover {
            background: #f8fafc;
            border-color: #94a3b8;
        }

        @media (max-width: 900px) {
            .document-viewer-header {
                align-items: flex-start;
            }
            .document-viewer-toolbar {
                margin-left: 0;
                width: 100%;
                justify-content: flex-start;
                flex-wrap: wrap;
            }
            .docview-pill-actions {
                flex-wrap: wrap;
            }
        }

        /* Legacy floating coded segments sidebar removed. */
        .document-viewer-container {
            background: #f8fafc;
            padding: 0;
            /* Avoid nested scrolling so the coded-segments sidebar can stay in view while the page scrolls. */
            overflow: visible;
            max-height: none;
            border-radius: 8px;
        }
        body.coded-segments-open .document-viewer-container {
            padding: 0;
        }
        .pdf-page-container {
            margin: 0 auto;
            max-width: 100%;
            width: 100%;
            background: white;
            padding: 0;
            box-shadow: none;
            border-radius: 0;
        }
        .pdf-page-container {
            margin-bottom: 0;
        }
        .pdf-page-container:first-child {
            padding-top: 0;
        }
        .pdf-page-container:last-child {
            margin-bottom: 0;
            padding-bottom: 0;
        }
        .pdf-page-number {
            display: none;
        }
        .pdf-page-wrapper {
            position: relative;
            width: 100%;
            transition: transform 0.2s ease;
        }
        .pdf-page-image {
            display: block;
            width: 100%;
            height: auto;
            box-shadow: none;
            border-radius: 0;
            pointer-events: none;
        }
        /* PDF.js text layer - official CSS loaded from CDN */

        /* Excerpt Mode Enhancements */
        #selectedCodesRow span[onclick]:hover {
            transform: scale(1.05);
            box-shadow: 0 2px 8px rgba(243, 146, 0, 0.25);
            background: rgba(243, 146, 0, 0.18) !important;
        }

        #addCodeInput:focus {
            outline: 2px solid var(--de-orange);
            outline-offset: 2px;
        }

        .btn-action:disabled {
            opacity: 0.4;
            cursor: not-allowed;
        }

        /* Floating Action Bar Responsive */
        @media (max-width: 768px) {
            .floating-action-bar {
                flex-direction: column;
                gap: 0.75rem;
            }
        }

        /* ==========================================
           ANALYZE + EXPORT PAGES (Enterprise)
        ========================================== */

        .analyze-wrap {
            padding: 2rem;
            background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 100%);
            min-height: 100%;
        }
        .analyze-hero {
            border-radius: var(--radius-2xl);
            padding: 1.75rem 2rem 2.5rem;
            background:
                radial-gradient(ellipse 1000px 400px at 10% 20%, rgba(243, 146, 0, 0.25), transparent 60%),
                radial-gradient(ellipse 800px 350px at 80% 10%, rgba(59, 130, 246, 0.15), transparent 50%),
                linear-gradient(135deg, #0a1628 0%, #003B5C 50%, #004d7a 100%);
            color: white;
            border: none;
            box-shadow:
                0 4px 6px rgba(0, 0, 0, 0.1),
                0 20px 60px rgba(0, 59, 92, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
            position: relative;
            overflow: hidden;
            margin-bottom: 1.5rem;
        }
        .analyze-hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
            opacity: 0.5;
            pointer-events: none;
        }
        .analyze-hero-top {
            display: flex;
            justify-content: space-between;
            gap: 1.5rem;
            align-items: center;
            position: relative;
            z-index: 1;
        }
        .analyze-title {
            font-size: 1.6rem;
            font-weight: 900;
            letter-spacing: -0.02em;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
        }
        .analyze-subtitle {
            margin-top: 0.35rem;
            color: rgba(255,255,255,0.85);
            font-weight: 500;
            font-size: 0.95rem;
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            align-items: center;
        }
        .analyze-dot {
            opacity: 0.6;
        }
        .analyze-hero-actions {
            display: flex;
            gap: 0.75rem;
            align-items: center;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .analyze-hero-actions .btn-action {
            background: rgba(255, 255, 255, 0.1);
            backdrop-filter: blur(8px);
            border: 1px solid rgba(255, 255, 255, 0.25);
            color: white;
            font-weight: 600;
            padding: 0.6rem 1.25rem;
            border-radius: 10px;
            transition: all 0.2s ease;
        }
        .analyze-hero-actions .btn-action:hover {
            background: rgba(255, 255, 255, 0.2);
            border-color: rgba(255, 255, 255, 0.4);
            transform: translateY(-1px);
        }
        .analyze-hero-actions .login-btn {
            background: linear-gradient(135deg, #F39200 0%, #e08600 100%);
            border: none;
            box-shadow: 0 4px 15px rgba(243, 146, 0, 0.35);
            font-weight: 700;
            padding: 0.7rem 1.5rem;
            border-radius: 10px;
        }
        .analyze-hero-actions .login-btn:hover {
            background: linear-gradient(135deg, #ffa31a 0%, #F39200 100%);
            transform: translateY(-1px);
            box-shadow: 0 6px 20px rgba(243, 146, 0, 0.45);
        }
        .analyze-metrics {
            margin-top: 1rem;
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 0.75rem;
        }
        @media (max-width: 1100px) {
            .analyze-metrics {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }
        @media (max-width: 620px) {
            .analyze-wrap {
                padding: 1.25rem;
            }
            .analyze-hero-top {
                flex-direction: column;
                align-items: stretch;
            }
            .analyze-hero-actions {
                justify-content: flex-start;
            }
            .analyze-metrics {
                grid-template-columns: 1fr;
            }
        }
        .analyze-metric-card {
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: var(--radius-xl);
            padding: 0.9rem 1rem;
            backdrop-filter: blur(10px);
        }
        .analyze-metric-kicker {
            font-size: 0.78rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.75);
            font-weight: 800;
        }
        .analyze-metric-value {
            margin-top: 0.35rem;
            font-size: 1.6rem;
            font-weight: 950;
            letter-spacing: -0.02em;
        }
        .analyze-metric-meta {
            margin-top: 0.35rem;
            color: rgba(255,255,255,0.75);
            font-size: 0.85rem;
            font-weight: 600;
        }
        .analyze-metric-donut {
            display: flex;
            gap: 0.8rem;
            align-items: center;
        }
        .analyze-donut {
            flex: 0 0 auto;
            filter: drop-shadow(0 8px 18px rgba(0,0,0,0.25));
        }

        .analyze-grid {
            margin-top: 1rem;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.9rem;
            align-items: start;
        }
        @media (max-width: 980px) {
            .analyze-grid {
                grid-template-columns: 1fr;
            }
        }
        .analyze-panel {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 18px;
            padding: 1.1rem 1.1rem 1rem;
            box-shadow: 0 10px 28px rgba(2, 6, 23, 0.06);
        }
        .analyze-wide {
            grid-column: 1 / -1;
        }
        .analyze-panel-title {
            font-size: 1rem;
            font-weight: 950;
            color: #0f172a;
            letter-spacing: -0.01em;
        }
        .analyze-panel-subtitle {
            margin-top: 0.2rem;
            color: var(--text-muted);
            font-weight: 600;
            font-size: 0.86rem;
        }

        .analyze-bars {
            margin-top: 0.9rem;
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
        }
        .analyze-bar-row {
            display: grid;
            grid-template-columns: 150px 1fr 48px;
            gap: 0.65rem;
            align-items: center;
        }
        @media (max-width: 620px) {
            .analyze-bar-row {
                grid-template-columns: 120px 1fr 40px;
            }
        }
        .analyze-bar-label {
            font-weight: 800;
            color: #0f172a;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            font-size: 0.86rem;
        }
        .analyze-bar-track {
            height: 10px;
            border-radius: var(--radius-full);
            background: #eef2f7;
            overflow: hidden;
            border: 1px solid #e2e8f0;
        }
        .analyze-bar-fill {
            height: 100%;
            border-radius: var(--radius-full);
            background: linear-gradient(90deg, var(--de-orange), var(--de-light-orange));
            box-shadow: 0 8px 20px rgba(243, 146, 0, 0.25);
        }
        .analyze-bar-value {
            text-align: right;
            font-weight: 900;
            color: #0f172a;
            font-variant-numeric: tabular-nums;
        }

        .analyze-split {
            margin-top: 0.9rem;
            display: flex;
            flex-direction: column;
            gap: 0.55rem;
        }
        .analyze-split-row {
            display: grid;
            grid-template-columns: 90px 1fr 52px;
            gap: 0.65rem;
            align-items: center;
        }
        .analyze-split-label {
            font-weight: 800;
            color: #0f172a;
            font-size: 0.86rem;
        }
        .analyze-split-track {
            height: 10px;
            border-radius: var(--radius-full);
            background: #eef2f7;
            overflow: hidden;
            border: 1px solid #e2e8f0;
        }
        .analyze-split-fill {
            height: 100%;
            border-radius: var(--radius-full);
        }
        .analyze-split-value {
            text-align: right;
            font-weight: 900;
            color: #0f172a;
            font-variant-numeric: tabular-nums;
        }

        .analyze-mini-grid {
            margin-top: 0.85rem;
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.6rem;
        }
        @media (max-width: 620px) {
            .analyze-mini-grid {
                grid-template-columns: 1fr;
            }
        }
        .analyze-mini {
            border: 1px solid #e2e8f0;
            border-radius: 14px;
            padding: 0.75rem 0.8rem;
            background: linear-gradient(180deg, #ffffff, #f8fafc);
        }
        .analyze-mini-title {
            font-size: 0.75rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--text-muted);
            font-weight: 900;
        }
        .analyze-mini-value {
            margin-top: 0.35rem;
            font-size: 1.15rem;
            font-weight: 950;
            color: #0f172a;
        }
        .analyze-help {
            margin-top: 0.75rem;
            color: var(--text-muted);
            font-weight: 600;
            font-size: 0.82rem;
            line-height: 1.35;
        }
        .analyze-empty {
            margin-top: 0.85rem;
            border: 1px dashed #cbd5e1;
            border-radius: var(--radius-xl);
            padding: 1rem 1rem;
            color: var(--text-muted);
            font-weight: 650;
            background: var(--bg-surface);
        }

        .analyze-recent {
            margin-top: 0.9rem;
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.65rem;
        }
        @media (max-width: 980px) {
            .analyze-recent {
                grid-template-columns: 1fr;
            }
        }
        .analyze-recent-item {
            border: 1px solid #e2e8f0;
            border-radius: var(--radius-xl);
            padding: 0.85rem 0.9rem;
            background: white;
        }
        .analyze-recent-title {
            font-weight: 950;
            color: #0f172a;
            font-size: 0.92rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .analyze-recent-meta {
            margin-top: 0.25rem;
            color: var(--text-muted);
            font-weight: 650;
            font-size: 0.82rem;
        }
        .analyze-recent-body {
            margin-top: 0.5rem;
            color: #334155;
            font-weight: 600;
            font-size: 0.86rem;
            line-height: 1.35;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .analyze-filter-row {
            margin-top: 0.85rem;
            display: flex;
            flex-wrap: wrap;
            gap: 0.65rem;
            align-items: center;
        }
        .analyze-filter-label {
            font-size: 0.82rem;
            font-weight: 800;
            color: #0f172a;
            text-transform: uppercase;
            letter-spacing: 0.08em;
        }
        .analyze-filter-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem;
        }
        .analyze-filter-chip {
            border: 1px solid #e2e8f0;
            background: #ffffff;
            color: #0f172a;
            border-radius: 999px;
            padding: 0.35rem 0.75rem;
            font-size: 0.8rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .analyze-filter-chip:hover {
            border-color: var(--de-orange);
            color: var(--de-orange);
        }
        .analyze-filter-chip.active {
            border-color: var(--de-orange);
            background: rgba(243, 146, 0, 0.12);
            color: var(--de-orange);
        }
        .analyze-filter-empty {
            font-size: 0.85rem;
            color: var(--text-muted);
            font-weight: 600;
        }

        .analyze-heatmap {
            margin-top: 0.85rem;
            border: 1px solid #e2e8f0;
            border-radius: 16px;
            background: #f8fafc;
            overflow: auto;
            max-width: 100%;
        }
        .analyze-heatmap-grid {
            display: grid;
            gap: 2px;
            padding: 0.75rem;
            min-width: 520px;
        }
        .analyze-heatmap-label {
            font-size: 0.72rem;
            font-weight: 700;
            color: #1e293b;
            background: #f1f5f9;
            padding: 0.35rem 0.45rem;
            border-radius: 8px;
            text-align: center;
        }
        .analyze-heatmap-top {
            writing-mode: vertical-rl;
            transform: rotate(180deg);
            text-align: left;
            min-height: 120px;
        }
        .analyze-heatmap-left {
            text-align: left;
        }
        .analyze-heatmap-cell {
            min-height: 34px;
            border-radius: 8px;
            font-size: 0.75rem;
            font-weight: 800;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #0f172a;
        }
        .analyze-heatmap-cell.diag {
            border: 1px solid rgba(15, 23, 42, 0.08);
        }
        .analyze-heatmap-legend {
            margin-top: 0.6rem;
            display: flex;
            align-items: center;
            gap: 0.6rem;
            color: var(--text-muted);
            font-weight: 600;
            font-size: 0.78rem;
        }
        .analyze-heatmap-bar {
            flex: 1;
            height: 8px;
            border-radius: 999px;
            background: linear-gradient(90deg, rgba(243, 146, 0, 0.1), rgba(243, 146, 0, 0.9));
        }

        .analyze-donut-wrap {
            margin-top: 0.85rem;
            display: flex;
            gap: 1.1rem;
            align-items: center;
            flex-wrap: wrap;
        }
        .analyze-donut-chart {
            width: 170px;
            height: 170px;
            border-radius: 50%;
            position: relative;
            box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12);
        }
        .analyze-donut-chart::after {
            content: '';
            position: absolute;
            inset: 24%;
            background: #ffffff;
            border-radius: 50%;
            box-shadow: inset 0 0 0 1px #e2e8f0;
        }
        .analyze-donut-center {
            position: absolute;
            inset: 24%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            z-index: 1;
        }
        .analyze-donut-value {
            font-size: 1.3rem;
            font-weight: 900;
            color: #0f172a;
        }
        .analyze-donut-label {
            font-size: 0.72rem;
            font-weight: 700;
            color: var(--text-muted);
            letter-spacing: 0.06em;
            text-transform: uppercase;
        }
        .analyze-donut-legend {
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
            min-width: 180px;
        }
        .analyze-donut-legend-item {
            display: grid;
            grid-template-columns: 14px 1fr auto;
            gap: 0.5rem;
            align-items: center;
            font-size: 0.82rem;
            font-weight: 600;
            color: #0f172a;
        }
        .analyze-donut-swatch {
            width: 10px;
            height: 10px;
            border-radius: 50%;
        }
        .analyze-donut-count {
            color: var(--text-muted);
            font-weight: 700;
        }

        .analyze-meta-filters {
            margin-top: 0.85rem;
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.75rem;
        }
        @media (max-width: 900px) {
            .analyze-meta-filters {
                grid-template-columns: 1fr;
            }
        }
        .analyze-meta-filters label {
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
            font-size: 0.82rem;
            font-weight: 700;
            color: #0f172a;
        }
        .analyze-filter-select {
            width: 100%;
            padding: 0.55rem 0.75rem;
            border-radius: 12px;
            border: 1px solid #e2e8f0;
            background: #ffffff;
            font-size: 0.85rem;
            font-weight: 600;
            color: #0f172a;
        }
        .analyze-meta-grid {
            margin-top: 0.95rem;
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.85rem;
        }
        @media (max-width: 1100px) {
            .analyze-meta-grid {
                grid-template-columns: 1fr;
            }
        }
        .analyze-meta-card {
            border: 1px solid #e2e8f0;
            border-radius: 16px;
            padding: 0.85rem 0.9rem;
            background: #ffffff;
        }
        .analyze-meta-title {
            font-size: 0.92rem;
            font-weight: 800;
            color: #0f172a;
            margin-bottom: 0.5rem;
        }

        /* ==========================================
           ANALYZE TAB - ENTERPRISE VISUALS
        ========================================== */

        /* Summary Stats with Icons - Overlapping Hero Style */
        .analyze-summary-stats {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 1.5rem;
            margin-top: -1rem;
            margin-bottom: 2.5rem;
            position: relative;
            z-index: 5;
        }
        @media (max-width: 1100px) {
            .analyze-summary-stats {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        @media (max-width: 600px) {
            .analyze-summary-stats {
                grid-template-columns: 1fr;
                gap: 1rem;
            }
        }
        .analyze-stat-card {
            background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
            border: 1px solid rgba(226, 232, 240, 0.8);
            border-radius: 20px;
            padding: 1.75rem 1.5rem;
            text-align: center;
            box-shadow:
                0 4px 6px rgba(0, 59, 92, 0.04),
                0 10px 24px rgba(0, 59, 92, 0.08),
                0 0 0 1px rgba(255, 255, 255, 0.8) inset;
            transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
            position: relative;
            overflow: hidden;
        }
        .analyze-stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--de-navy) 0%, var(--de-orange) 100%);
            opacity: 0;
            transition: opacity 0.25s ease;
        }
        .analyze-stat-card:hover {
            transform: translateY(-4px);
            box-shadow:
                0 8px 12px rgba(0, 59, 92, 0.06),
                0 20px 40px rgba(0, 59, 92, 0.12),
                0 0 0 1px rgba(255, 255, 255, 0.9) inset;
        }
        .analyze-stat-card:hover::before {
            opacity: 1;
        }
        .analyze-stat-icon {
            width: 64px;
            height: 64px;
            margin: 0 auto 1rem;
            position: relative;
            filter: drop-shadow(0 2px 4px rgba(0, 59, 92, 0.1));
        }
        .analyze-stat-icon svg {
            width: 100%;
            height: 100%;
        }
        .analyze-stat-icon .icon-ring {
            fill: none;
            stroke: #1e293b;
            stroke-width: 3;
        }
        .analyze-stat-icon .icon-fill {
            fill: #3b82f6;
            opacity: 0.85;
        }
        .analyze-stat-icon .icon-handle {
            fill: none;
            stroke: #1e293b;
            stroke-width: 4;
            stroke-linecap: round;
        }
        .analyze-stat-value {
            font-size: 2.5rem;
            font-weight: 900;
            color: #0f172a;
            line-height: 1;
            margin-bottom: 0.5rem;
            letter-spacing: -0.02em;
        }
        .analyze-stat-label {
            font-size: 0.875rem;
            font-weight: 600;
            color: #64748b;
            line-height: 1.35;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }

        /* Gender/Comparison Cards */
        .analyze-comparison-card {
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 16px;
            padding: 1.5rem;
            box-shadow: 0 4px 15px rgba(0, 59, 92, 0.06);
        }
        .analyze-comparison-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 1.25rem;
        }
        .analyze-comparison-badge {
            width: 12px;
            height: 12px;
            background: var(--de-orange);
            border-radius: 2px;
        }
        .analyze-comparison-title {
            font-size: 1.1rem;
            font-weight: 800;
            color: #0f172a;
        }
        .analyze-comparison-body {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 2rem;
        }
        .analyze-comparison-item {
            text-align: center;
        }
        .analyze-comparison-icon {
            width: 48px;
            height: 64px;
            margin: 0 auto 0.5rem;
        }
        .analyze-comparison-icon svg {
            width: 100%;
            height: 100%;
        }
        .analyze-comparison-value {
            font-size: 1.75rem;
            font-weight: 900;
            color: #0f172a;
        }
        .analyze-comparison-label {
            font-size: 0.82rem;
            color: #64748b;
            font-weight: 600;
            margin-top: 0.75rem;
        }

        /* Enterprise Horizontal Bar Chart */
        .analyze-hbar-section {
            background: #ffffff;
            border: 1px solid #e2e8f0;
            border-radius: 16px;
            padding: 1.25rem 1.5rem;
            margin-bottom: 1.25rem;
            box-shadow: 0 4px 15px rgba(0, 59, 92, 0.06);
        }
        .analyze-hbar-header {
            border-bottom: 3px solid var(--de-orange);
            padding-bottom: 0.75rem;
            margin-bottom: 1.25rem;
        }
        .analyze-hbar-title {
            font-size: 1rem;
            font-weight: 800;
            color: #0f172a;
        }
        .analyze-hbar-subtitle {
            font-size: 0.82rem;
            color: #64748b;
            font-weight: 600;
            margin-top: 0.15rem;
        }
        .analyze-hbar-chart {
            position: relative;
        }
        .analyze-hbar-row {
            display: grid;
            grid-template-columns: 160px 1fr 50px;
            gap: 1rem;
            align-items: center;
            margin-bottom: 0.65rem;
        }
        @media (max-width: 620px) {
            .analyze-hbar-row {
                grid-template-columns: 100px 1fr 40px;
                gap: 0.5rem;
            }
        }
        .analyze-hbar-label {
            font-size: 0.88rem;
            font-weight: 700;
            color: #334155;
            text-align: right;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .analyze-hbar-bar {
            height: 28px;
            background: #003B5C;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: flex-end;
            padding-right: 0.75rem;
            min-width: 2px;
            transition: width 0.4s ease;
        }
        .analyze-hbar-bar-value {
            color: white;
            font-size: 0.8rem;
            font-weight: 800;
        }
        .analyze-hbar-value {
            font-size: 0.88rem;
            font-weight: 800;
            color: #0f172a;
            text-align: left;
        }
        .analyze-hbar-axis {
            display: flex;
            justify-content: space-between;
            margin-top: 0.5rem;
            padding-left: 160px;
            padding-right: 50px;
        }
        @media (max-width: 620px) {
            .analyze-hbar-axis {
                padding-left: 100px;
                padding-right: 40px;
            }
        }
        .analyze-hbar-axis span {
            font-size: 0.75rem;
            color: #94a3b8;
            font-weight: 600;
        }
        .analyze-hbar-gridlines {
            position: absolute;
            top: 0;
            bottom: 24px;
            left: 176px;
            right: 66px;
            display: flex;
            justify-content: space-between;
            pointer-events: none;
        }
        .analyze-hbar-gridline {
            width: 1px;
            background: #e2e8f0;
        }

        /* Stacked Horizontal Bar Chart */
        .analyze-stacked-bar {
            display: flex;
            height: 32px;
            border-radius: 4px;
            overflow: hidden;
            background: #f1f5f9;
        }
        .analyze-stacked-segment {
            display: flex;
            align-items: center;
            justify-content: center;
            min-width: 24px;
            color: white;
            font-size: 0.75rem;
            font-weight: 800;
            transition: width 0.4s ease;
        }

        /* Treemap (SDG Style) */
        .analyze-treemap {
            display: grid;
            gap: 4px;
            min-height: 320px;
        }
        .analyze-treemap-cell {
            border-radius: 8px;
            padding: 0.75rem;
            color: white;
            display: flex;
            flex-direction: column;
            justify-content: flex-end;
            min-height: 60px;
            cursor: pointer;
            transition: all 0.2s ease;
            position: relative;
            overflow: hidden;
        }
        .analyze-treemap-cell:hover {
            transform: scale(1.02);
            z-index: 2;
        }
        .analyze-treemap-value {
            font-size: 1.75rem;
            font-weight: 900;
            line-height: 1;
        }
        .analyze-treemap-label {
            font-size: 0.72rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.02em;
            margin-top: 0.25rem;
            opacity: 0.95;
            line-height: 1.2;
        }

        /* Document-Code Matrix Table */
        .analyze-matrix-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0;
            font-size: 0.85rem;
        }
        .analyze-matrix-table thead {
            position: sticky;
            top: 0;
            z-index: 2;
        }
        .analyze-matrix-table th {
            background: #f8fafc;
            border-bottom: 2px solid #e2e8f0;
            padding: 0.75rem 0.5rem;
            font-weight: 800;
            color: #0f172a;
            text-align: left;
            white-space: nowrap;
        }
        .analyze-matrix-table th:first-child {
            border-radius: 8px 0 0 0;
            position: sticky;
            left: 0;
            z-index: 3;
            background: #f8fafc;
            min-width: 200px;
        }
        .analyze-matrix-table td {
            padding: 0.6rem 0.5rem;
            border-bottom: 1px solid #f1f5f9;
            vertical-align: middle;
        }
        .analyze-matrix-table td:first-child {
            position: sticky;
            left: 0;
            background: white;
            font-weight: 700;
            color: #334155;
            z-index: 1;
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .analyze-matrix-table tbody tr:hover td {
            background: #f8fafc;
        }
        .analyze-matrix-table tbody tr:hover td:first-child {
            background: #f1f5f9;
        }
        .analyze-matrix-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            padding: 0.25rem 0.6rem;
            border-radius: 999px;
            font-size: 0.75rem;
            font-weight: 700;
            background: #dbeafe;
            color: #1e40af;
            white-space: nowrap;
        }
        .analyze-matrix-badge.highlight {
            background: var(--de-orange);
            color: white;
        }
        .analyze-matrix-scroll {
            overflow-x: auto;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            max-height: 500px;
            overflow-y: auto;
        }

        /* Line Chart Container */
        .analyze-chart-container {
            position: relative;
            height: 280px;
            padding: 1rem 0;
        }
        .analyze-chart-legend {
            display: flex;
            justify-content: center;
            gap: 1.5rem;
            margin-top: 1rem;
            flex-wrap: wrap;
        }
        .analyze-chart-legend-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.85rem;
            font-weight: 700;
            color: #334155;
        }
        .analyze-chart-legend-color {
            width: 24px;
            height: 4px;
            border-radius: 2px;
        }

        /* Section Headers with Golden Underline */
        .analyze-section-header {
            margin-bottom: 1.25rem;
        }
        .analyze-section-title {
            font-size: 1.1rem;
            font-weight: 800;
            color: #0f172a;
            padding-bottom: 0.5rem;
            border-bottom: 3px solid var(--de-orange);
            display: inline-block;
        }

        /* Two Column Layout */
        .analyze-two-col {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.25rem;
        }
        @media (max-width: 980px) {
            .analyze-two-col {
                grid-template-columns: 1fr;
            }
        }

        /* Three Column Layout */
        .analyze-three-col {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 1.25rem;
        }
        @media (max-width: 1100px) {
            .analyze-three-col {
                grid-template-columns: 1fr 1fr;
            }
        }
        @media (max-width: 720px) {
            .analyze-three-col {
                grid-template-columns: 1fr;
            }
        }

        /* Donut Chart with Center Label */
        .analyze-donut-container {
            position: relative;
            width: 200px;
            height: 200px;
            margin: 0 auto;
        }
        .analyze-donut-center-label {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }
        .analyze-donut-center-value {
            font-size: 2rem;
            font-weight: 900;
            color: #0f172a;
            line-height: 1;
        }
        .analyze-donut-center-text {
            font-size: 0.8rem;
            color: #64748b;
            font-weight: 700;
            margin-top: 0.25rem;
        }

        /* Code Frequency Pills */
        .analyze-code-pills {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
        }
        .analyze-code-pill {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.4rem 0.85rem;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            border-radius: 999px;
            font-size: 0.82rem;
            font-weight: 700;
            color: #334155;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .analyze-code-pill:hover {
            background: #e2e8f0;
            border-color: #cbd5e1;
        }
        .analyze-code-pill.active {
            background: var(--de-orange);
            border-color: var(--de-orange);
            color: white;
        }
        .analyze-code-pill-count {
            background: rgba(0,0,0,0.1);
            padding: 0.15rem 0.45rem;
            border-radius: 999px;
            font-size: 0.72rem;
        }
        .analyze-code-pill.active .analyze-code-pill-count {
            background: rgba(255,255,255,0.25);
        }

        /* ==========================================
           HOME PAGE
        ========================================== */

        .home-wrap {
            padding: 2rem;
            max-width: 1400px;
            margin: 0 auto;
        }
        .home-hero {
            position: relative;
            border-radius: 18px;
            padding: 3.5rem 2rem;
            background: linear-gradient(135deg, var(--de-dark-navy) 0%, var(--de-navy) 50%, #004a73 100%);
            color: white;
            text-align: center;
            margin-bottom: 2rem;
            box-shadow: 0 20px 50px rgba(0, 59, 92, 0.3);
            overflow: hidden;
        }
        .home-hero::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image:
                radial-gradient(circle at 20% 80%, rgba(243, 146, 0, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(243, 146, 0, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, rgba(255, 255, 255, 0.05) 0%, transparent 30%);
            pointer-events: none;
        }
        .home-hero-content {
            position: relative;
            z-index: 1;
            max-width: 900px;
            margin: 0 auto;
            text-align: center;
        }
        .home-hero-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            opacity: 0.6;
        }
        .home-title {
            font-size: 2.25rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        }
        .home-subtitle {
            font-size: 1.15rem;
            opacity: 0.9;
            font-weight: 500;
            color: rgba(255, 255, 255, 0.9);
        }
        .home-subtitle span {
            color: var(--de-orange);
            font-weight: 600;
        }
        .home-tagline {
            margin: 0.75rem auto 0;
            font-size: 0.95rem;
            line-height: 1.5;
            color: rgba(255, 255, 255, 0.82);
            max-width: 720px;
        }
        .home-resume {
            background: #f8fafc;
            border: 1px solid rgba(0, 59, 92, 0.12);
            border-radius: 16px;
            padding: 1.5rem 1.75rem;
            margin: 1.75rem 0 2.25rem;
            box-shadow: 0 16px 28px rgba(0, 59, 92, 0.12);
            position: relative;
        }
        .home-resume::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            border-radius: 16px 16px 0 0;
            background: linear-gradient(90deg, var(--de-orange), var(--de-navy));
        }
        .home-resume-empty {
            text-align: left;
        }
        .home-welcome {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--de-navy);
        }
        .home-welcome-sub {
            margin-top: 0.35rem;
            color: #52616d;
        }
        .home-overview-grid {
            margin-top: 1.25rem;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
            gap: 1rem;
        }
        .home-overview-card {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 12px;
            padding: 1rem 1.1rem;
            min-width: 0;
        }
        .home-overview-label {
            font-size: 0.72rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #94a3b8;
            margin-bottom: 0.4rem;
        }
        .home-overview-value {
            font-size: 0.98rem;
            font-weight: 600;
            color: #0f172a;
            overflow-wrap: anywhere;
            word-break: break-word;
        }
        .home-excerpt-preview {
            font-weight: 500;
            color: #1f2937;
        }
        .home-overview-meta {
            margin-top: 0.35rem;
            font-size: 0.8rem;
            color: #94a3b8;
        }
        .doc-field-card {
            background: #f8fafc;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            padding: 1rem;
            margin-bottom: 0.75rem;
        }
        .doc-field-row {
            display: grid;
            grid-template-columns: minmax(180px, 2fr) minmax(160px, 1.5fr) minmax(120px, 1fr) auto;
            gap: 0.75rem;
            align-items: center;
        }
        .doc-field-input,
        .doc-field-select,
        .doc-field-options-input {
            height: 40px;
            padding: 0.5rem 0.75rem;
            border: 1px solid #cbd5e1;
            border-radius: 6px;
            font-size: 0.9rem;
            line-height: 1.2;
            box-sizing: border-box;
            background-color: #ffffff;
        }
        .doc-field-required label {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            font-size: 0.85rem;
            color: #64748b;
            cursor: pointer;
            white-space: nowrap;
        }
        .doc-field-required-input {
            cursor: pointer;
        }
        .doc-field-remove {
            background: transparent;
            border: 1px solid #e2e8f0;
            color: #dc2626;
            padding: 0.5rem;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.9rem;
            line-height: 1;
        }
        .doc-field-options {
            margin-top: 0.75rem;
            padding-top: 0.75rem;
            border-top: 1px solid #e2e8f0;
        }
        .doc-field-options label {
            display: block;
            font-size: 0.75rem;
            color: #64748b;
            margin-bottom: 0.5rem;
        }
        @media (max-width: 900px) {
            .doc-field-row {
                grid-template-columns: 1fr;
                align-items: stretch;
            }
            .doc-field-required label {
                justify-content: flex-start;
            }
        }
        .home-resume-row {
            margin-top: 1.25rem;
            padding-top: 1rem;
            border-top: 1px solid #e2e8f0;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1rem;
        }
        .home-resume-question {
            font-weight: 500;
            color: #1f2937;
        }
        .home-resume-btn {
            background: var(--de-orange);
            color: #ffffff;
            border: none;
            border-radius: 999px;
            padding: 0.65rem 1.2rem;
            font-weight: 600;
            cursor: pointer;
        }
        .home-resume-btn:hover:not(:disabled) {
            filter: brightness(0.97);
        }
        .home-resume-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        @media (max-width: 720px) {
            .home-resume-row {
                flex-direction: column;
                align-items: flex-start;
            }
        }
        .home-stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.25rem;
            margin-bottom: 2.5rem;
        }
        .home-stat-card {
            background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
            border: 1px solid #e2e8f0;
            border-radius: 16px;
            padding: 1.75rem;
            text-align: center;
            box-shadow: 0 4px 15px rgba(0, 59, 92, 0.08);
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        .home-stat-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--de-orange), var(--de-light-orange));
            opacity: 0;
            transition: opacity 0.3s ease;
        }
        .home-stat-card:hover {
            box-shadow: 0 12px 30px rgba(0, 59, 92, 0.15);
            transform: translateY(-4px);
            border-color: var(--de-orange);
        }
        .home-stat-card:hover::before {
            opacity: 1;
        }
        .home-stat-icon {
            font-size: 2.25rem;
            margin-bottom: 0.75rem;
            display: inline-block;
            width: 60px;
            height: 60px;
            line-height: 60px;
            background: linear-gradient(135deg, rgba(243, 146, 0, 0.1), rgba(243, 146, 0, 0.05));
            border-radius: 14px;
        }
        .home-stat-value {
            font-size: 2.75rem;
            font-weight: 800;
            color: var(--de-navy);
            margin-bottom: 0.25rem;
        }
        .home-stat-label {
            font-size: 0.9rem;
            color: #64748b;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .home-quick-actions {
            margin-top: 2.5rem;
            background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
            border-radius: 18px;
            padding: 2rem;
            border: 1px solid #e2e8f0;
        }
        .home-quick-actions h3 {
            font-size: 1.1rem;
            font-weight: 700;
            margin-bottom: 1.25rem;
            color: var(--de-navy);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .home-quick-actions h3::before {
            content: '';
            width: 4px;
            height: 20px;
            background: linear-gradient(180deg, var(--de-orange), var(--de-light-orange));
            border-radius: 2px;
        }
        .home-actions-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 1rem;
        }
        .home-action-btn {
            background: white;
            border: 2px solid #e2e8f0;
            border-radius: 14px;
            padding: 1.5rem;
            text-align: left;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
            overflow: hidden;
        }
        .home-action-btn::after {
            content: '→';
            position: absolute;
            right: 1.5rem;
            top: 50%;
            transform: translateY(-50%) translateX(10px);
            opacity: 0;
            font-size: 1.25rem;
            color: var(--de-orange);
            transition: all 0.3s ease;
        }
        .home-action-btn:hover {
            border-color: var(--de-orange);
            box-shadow: 0 10px 30px rgba(243, 146, 0, 0.15);
            transform: translateY(-3px);
        }
        .home-action-btn:hover::after {
            opacity: 1;
            transform: translateY(-50%) translateX(0);
        }
        .home-action-icon {
            font-size: 2rem;
            margin-bottom: 0.75rem;
            display: inline-block;
            width: 50px;
            height: 50px;
            line-height: 50px;
            text-align: center;
            background: linear-gradient(135deg, var(--de-navy), var(--de-dark-navy));
            border-radius: 12px;
        }
        .home-action-title {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--de-navy);
            margin-bottom: 0.35rem;
        }
        .home-action-desc {
            font-size: 0.9rem;
            color: #64748b;
            line-height: 1.5;
        }
        .home-empty-state {
            text-align: center;
            padding: 5rem 2rem;
            background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
            border: 2px dashed var(--de-orange);
            border-radius: 18px;
            position: relative;
            overflow: hidden;
        }
        .home-empty-state::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-image:
                radial-gradient(circle at 10% 90%, rgba(243, 146, 0, 0.08) 0%, transparent 40%),
                radial-gradient(circle at 90% 10%, rgba(0, 59, 92, 0.05) 0%, transparent 40%);
            pointer-events: none;
        }
        .home-empty-icon {
            font-size: 4.5rem;
            margin-bottom: 1.25rem;
            opacity: 0.8;
            display: inline-block;
            width: 100px;
            height: 100px;
            line-height: 100px;
            background: linear-gradient(135deg, rgba(243, 146, 0, 0.15), rgba(243, 146, 0, 0.05));
            border-radius: 24px;
        }
        .home-empty-title {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--de-navy);
            margin-bottom: 0.75rem;
        }
        .home-empty-desc {
            font-size: 1.05rem;
            color: #64748b;
            max-width: 480px;
            margin: 0 auto;
        }

        /* ==========================================
           PROJECTS PAGE
        ========================================== */

        .projects-wrap {
            padding: 2rem;
            max-width: 1400px;
            margin: 0 auto;
        }
        .projects-hero {
            display: flex;
            justify-content: space-between;
            align-items: start;
            gap: 1rem;
            margin-bottom: 1.5rem;
        }
        .projects-title {
            font-size: 1.6rem;
            font-weight: 700;
            color: #0f172a;
            letter-spacing: -0.02em;
        }
        .projects-subtitle {
            margin-top: 0.35rem;
            color: var(--text-muted);
            font-weight: 500;
        }
        .projects-actions {
            display: flex;
            gap: 0.6rem;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .projects-empty-state {
            text-align: center;
            padding: 4rem 2rem;
            background: white;
            border: 2px dashed #e2e8f0;
            border-radius: 18px;
        }
        .projects-empty-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
        }
        .projects-empty-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: #0f172a;
        }
        .projects-empty-desc {
            color: var(--text-muted);
            margin-top: 0.5rem;
        }
        .projects-page-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
            gap: 1.25rem;
        }
        @media (max-width: 768px) {
            .projects-page-grid {
                grid-template-columns: 1fr;
            }
            .projects-wrap {
                padding: 1.25rem;
            }
        }
        .projects-page-card {
            background: white;
            border: 2px solid #e2e8f0;
            border-radius: 16px;
            padding: 1.5rem;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: column;
        }
        .projects-page-card:hover {
            border-color: var(--de-navy);
            box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
            transform: translateY(-2px);
        }
        .projects-page-card.active {
            border-color: var(--de-orange);
            background: linear-gradient(135deg, rgba(243, 146, 0, 0.06) 0%, rgba(243, 146, 0, 0.02) 100%);
        }
        .projects-page-card-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
            margin-bottom: 0.5rem;
        }
        .projects-page-card-title {
            font-weight: 700;
            font-size: 1.15rem;
            color: var(--de-navy);
        }
        .projects-page-card-badge {
            background: var(--de-orange);
            color: white;
            font-size: 0.7rem;
            font-weight: 600;
            padding: 0.25rem 0.6rem;
            border-radius: 20px;
            text-transform: uppercase;
            letter-spacing: 0.03em;
        }
        .projects-page-card-meta {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-bottom: 0.5rem;
        }
        .projects-page-card-desc {
            font-size: 0.9rem;
            color: #475569;
            margin-bottom: 0.75rem;
            line-height: 1.45;
        }
        .projects-page-card-stats {
            display: flex;
            gap: 1.5rem;
            margin-top: auto;
            padding-top: 1rem;
            border-top: 1px solid #f1f5f9;
        }
        .projects-page-stat {
            display: flex;
            flex-direction: column;
        }
        .projects-page-stat-value {
            font-size: 1.35rem;
            font-weight: 700;
            color: var(--de-navy);
        }
        .projects-page-stat-label {
            font-size: 0.75rem;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.04em;
        }
        .projects-page-card-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 1rem;
            padding-top: 1rem;
            border-top: 1px solid #f1f5f9;
            flex-wrap: wrap;
        }
        .projects-page-card-actions .btn-secondary {
            flex: 1;
            min-width: 80px;
            padding: 0.5rem 0.75rem;
            font-size: 0.85rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.35rem;
        }
        .projects-page-card-actions .btn-danger-outline {
            flex: 1;
            min-width: 80px;
            padding: 0.5rem 0.75rem;
            font-size: 0.85rem;
            background: transparent;
            border: 1px solid #fecaca;
            color: #dc2626;
            border-radius: 8px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.35rem;
            transition: all 0.15s ease;
        }
        .projects-page-card-actions .btn-danger-outline:hover {
            background: #fef2f2;
            border-color: #dc2626;
        }

        /* ==========================================
           EXPORT PAGE
        ========================================== */

        .export-wrap {
            padding: 2rem;
        }
        .export-hero {
            display: flex;
            justify-content: space-between;
            align-items: start;
            gap: 1rem;
            margin-bottom: 0.9rem;
        }
        .export-title {
            font-size: 1.4rem;
            font-weight: 700;
            color: #0f172a;
            letter-spacing: -0.02em;
        }
        .export-subtitle {
            margin-top: 0.25rem;
            color: var(--text-muted);
            font-weight: 500;
        }
        .export-actions {
            display: flex;
            gap: 0.6rem;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .export-grid {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.9rem;
            align-items: stretch;
        }
        @media (max-width: 1100px) {
            .export-grid {
                grid-template-columns: 1fr;
            }
        }
        .export-card {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 18px;
            padding: 1.15rem 1.15rem 1.05rem;
            box-shadow: 0 10px 28px rgba(2, 6, 23, 0.06);
        }
        .export-card-title {
            font-weight: 600;
            color: #0f172a;
            font-size: 1.05rem;
        }
        .export-card-desc {
            margin-top: 0.35rem;
            color: #475569;
            font-weight: 500;
            font-size: 0.9rem;
            line-height: 1.4;
        }
        .export-card-meta {
            margin-top: 0.6rem;
            color: var(--text-muted);
            font-weight: 500;
            font-size: 0.85rem;
        }

        /* ==========================================
           CODES PAGE (Enterprise)
        ========================================== */

        .codes-wrap {
            padding: 2rem;
        }
        @media (max-width: 620px) {
            .codes-wrap {
                padding: 1.25rem;
            }
        }

        .codes-hero {
            border-radius: var(--radius-2xl);
            padding: 1.4rem 1.4rem 1.2rem;
            background: #ffffff;
            color: var(--text-dark);
            border: 1px solid var(--border-color-light);
            box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
        }
        .codes-hero-top {
            display: flex;
            justify-content: space-between;
            gap: 1rem;
            align-items: start;
        }
        @media (max-width: 620px) {
            .codes-hero-top {
                flex-direction: column;
                align-items: stretch;
            }
        }
        .codes-title {
            font-size: 1.4rem;
            font-weight: 700;
            letter-spacing: -0.02em;
        }
        .codes-subtitle {
            margin-top: 0.25rem;
            color: var(--text-secondary);
            font-weight: 500;
            font-size: 0.95rem;
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            align-items: center;
        }
        .codes-dot {
            opacity: 0.6;
        }
        .codes-hero-actions {
            display: flex;
            gap: 0.6rem;
            align-items: center;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .codes-hero-actions .btn-action {
            border: 1px solid var(--border-color-light);
            background: #ffffff;
            color: var(--text-secondary);
            font-weight: 600;
            height: 40px;
            padding: 0 0.9rem;
        }
        .codes-hero-actions .btn-action:hover {
            border-color: var(--de-navy);
            color: var(--de-navy);
            background: #f8fafc;
        }
        .codes-hero-actions select.btn-action {
            padding-right: 2rem;
        }
        @media (max-width: 620px) {
            .codes-hero-actions {
                justify-content: flex-start;
            }
        }

        .codes-metrics {
            margin-top: 1rem;
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 0.75rem;
        }
        @media (max-width: 1100px) {
            .codes-metrics {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }
        @media (max-width: 620px) {
            .codes-metrics {
                grid-template-columns: 1fr;
            }
        }
        .codes-metric {
            background: #f8fafc;
            border: 1px solid var(--border-color-light);
            border-radius: var(--radius-xl);
            padding: 0.9rem 1rem;
        }
        .codes-metric-kicker {
            font-size: 0.8rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--text-muted);
            font-weight: 600;
        }
        .codes-metric-value {
            margin-top: 0.35rem;
            font-size: 1.6rem;
            font-weight: 700;
            letter-spacing: -0.02em;
        }
        .codes-metric-meta {
            margin-top: 0.35rem;
            color: var(--text-muted);
            font-size: 0.85rem;
            font-weight: 500;
        }

        .codes-grid {
            margin-top: 1rem;
            display: grid;
            grid-template-columns: 320px minmax(0, 1fr);
            gap: 0.9rem;
            align-items: start;
        }
        @media (max-width: 1180px) {
            .codes-grid {
                grid-template-columns: 320px minmax(0, 1fr);
            }
        }
        @media (max-width: 900px) {
            .codes-grid {
                grid-template-columns: 1fr;
            }
        }

        .codes-panel {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 18px;
            padding: 1.1rem 1.1rem 1rem;
            box-shadow: 0 10px 28px rgba(2, 6, 23, 0.06);
        }
        .codes-panel-title {
            font-size: 1rem;
            font-weight: 650;
            color: #0f172a;
            letter-spacing: -0.01em;
            display: flex;
            gap: 0.5rem;
            align-items: baseline;
            justify-content: space-between;
        }
        .codes-count {
            font-size: 0.8rem;
            font-weight: 650;
            color: #0f172a;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            padding: 0.2rem 0.55rem;
            border-radius: var(--radius-full);
        }

        .codes-controls input[type="text"] {
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            display: block;
            margin-bottom: 0.75rem;
            padding: 0.65rem 0.9rem;
            border: 1px solid #d6e0ef;
            border-radius: 10px;
            font-size: 0.9rem;
            color: var(--text-dark);
            background: #ffffff;
            box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
            transition: border-color 0.15s ease, box-shadow 0.15s ease;
        }
        .codes-controls input[type="text"]:focus {
            outline: none;
            border-color: var(--de-orange);
            box-shadow: 0 0 0 3px rgba(243, 146, 0, 0.12);
        }
        .codes-chip-row {
            display: flex;
            gap: 0.45rem;
            flex-wrap: wrap;
        }
        .codes-chip {
            width: auto;
            margin: 0;
            padding: 0.45rem 0.7rem;
            font-size: 0.82rem;
            border-radius: var(--radius-full);
            border: 2px solid #e2e8f0;
            background: white;
            color: #0f172a;
            font-weight: 600;
        }
        .codes-chip:hover:not(.active) {
            border-color: #cbd5e1;
            transform: translateY(-1px);
        }
        .codes-chip.active {
            border-color: var(--de-orange);
            background: rgba(243, 146, 0, 0.08);
        }

        .codes-side-card {
            margin-top: 1rem;
            border: 1px solid #e2e8f0;
            border-radius: var(--radius-xl);
            padding: 0.9rem 0.9rem 0.85rem;
            background: linear-gradient(180deg, #ffffff, #f8fafc);
        }
        .codes-side-title {
            font-weight: 650;
            color: #0f172a;
            margin-bottom: 0.65rem;
        }
        .codes-side-meta {
            margin-top: 0.65rem;
            color: var(--text-muted);
            font-weight: 650;
            font-size: 0.82rem;
            line-height: 1.35;
        }

        .codes-table-wrap {
            margin-top: 0.8rem;
            overflow: auto;
            border-radius: 14px;
            border: 1px solid #e2e8f0;
        }
        .codes-table {
            width: 100%;
            border-collapse: collapse;
            background: white;
        }
        .codes-table thead th {
            text-align: left;
            font-size: 0.78rem;
            letter-spacing: 0.06em;
            text-transform: uppercase;
            color: var(--text-muted);
            font-weight: 650;
            padding: 0.75rem 0.8rem;
            background: var(--bg-surface);
            border-bottom: 1px solid #e2e8f0;
            white-space: nowrap;
        }
        .codes-table tbody td {
            padding: 0.7rem 0.8rem;
            border-bottom: 1px solid #f1f5f9;
            vertical-align: top;
            color: #0f172a;
            font-weight: 650;
            font-size: 0.9rem;
        }
        .codes-row {
            cursor: pointer;
        }
        .codes-row:hover td {
            background: var(--bg-surface);
        }
        .codes-row.active td {
            background: rgba(243, 146, 0, 0.07);
        }

        .codes-cat-row td {
            padding: 0.7rem 0.8rem;
            background: #f8fafc;
            border-bottom: 1px solid #e2e8f0;
        }
        .codes-cat-row.drag-over td {
            background: rgba(243, 146, 0, 0.08);
        }
        .codes-cat-head {
            display: flex;
            align-items: baseline;
            justify-content: space-between;
            gap: 0.8rem;
        }
        .codes-cat-title {
            font-weight: 650;
            color: #0f172a;
        }
        .codes-cat-meta {
            color: var(--text-muted);
            font-weight: 600;
            font-size: 0.82rem;
            white-space: nowrap;
        }

        .codes-code {
            font-weight: 650;
            font-variant-numeric: tabular-nums;
        }
        .codes-def {
            color: #334155;
            font-weight: 650;
            line-height: 1.35;
        }
        .codes-cat {
            margin-top: 0.25rem;
            color: var(--text-muted);
            font-size: 0.8rem;
            font-weight: 650;
        }
        .codes-used {
            text-align: right;
            font-variant-numeric: tabular-nums;
            font-weight: 650;
        }

        .codes-actions {
            display: flex;
            gap: 0.4rem;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .codes-action-btn {
            margin: 0;
            padding: 0.35rem 0.55rem;
            font-size: 0.78rem;
            font-weight: 600;
            border-radius: 999px;
            border: 2px solid #e2e8f0;
            background: white;
            color: #0f172a;
            cursor: pointer;
        }
        .codes-action-btn:hover {
            border-color: #cbd5e1;
            transform: translateY(-1px);
        }
        .codes-action-btn.danger {
            border-color: rgba(239, 68, 68, 0.35);
            color: #ef4444;
        }
        .codes-empty {
            padding: 1.2rem 1rem;
            color: var(--text-muted);
            font-weight: 700;
        }

        .codes-badge {
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
            padding: 0.22rem 0.55rem;
            border-radius: var(--radius-full);
            font-size: 0.75rem;
            font-weight: 650;
            border: 1px solid #e2e8f0;
            background: var(--bg-surface);
            color: #0f172a;
            white-space: nowrap;
        }
        .codes-badge.unodc {
            border-color: rgba(59, 130, 246, 0.35);
            background: rgba(59, 130, 246, 0.08);
            color: #1d4ed8;
        }
        .codes-badge.custom {
            border-color: rgba(243, 146, 0, 0.35);
            background: rgba(243, 146, 0, 0.10);
            color: #b45309;
        }
        .codes-fav {
            margin-left: 0.35rem;
            color: var(--de-orange);
            font-weight: 950;
            font-size: 0.9rem;
        }

        .codes-detail {
            margin-top: 0.85rem;
        }
        .codes-detail-head {
            display: flex;
            justify-content: space-between;
            gap: 0.75rem;
            align-items: start;
            padding: 0.9rem;
            border-radius: var(--radius-xl);
            border: 1px solid #e2e8f0;
            background: linear-gradient(180deg, #ffffff, #f8fafc);
        }
        @media (max-width: 620px) {
            .codes-detail-head {
                flex-direction: column;
                align-items: stretch;
            }
        }
        .codes-detail-code {
            font-weight: 650;
            font-size: 1.15rem;
            letter-spacing: -0.01em;
            color: #0f172a;
        }
        .codes-detail-meta {
            margin-top: 0.35rem;
            display: flex;
            gap: 0.45rem;
            flex-wrap: wrap;
            align-items: center;
        }
        .codes-detail-cat {
            color: var(--text-muted);
            font-weight: 650;
            font-size: 0.85rem;
        }
        .codes-detail-actions {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .codes-detail-block {
            margin-top: 0.85rem;
            padding: 0.9rem;
            border-radius: var(--radius-xl);
            border: 1px solid #e2e8f0;
            background: white;
        }
        .codes-detail-label {
            font-size: 0.78rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--text-muted);
            font-weight: 650;
        }
        .codes-detail-text {
            margin-top: 0.35rem;
            color: #334155;
            font-weight: 650;
            line-height: 1.45;
            white-space: pre-wrap;
        }
        .codes-detail-usage {
            margin-top: 0.35rem;
            color: #0f172a;
            font-weight: 650;
        }

        /* Context Menu */
        .codes-context-menu {
            position: absolute;
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: var(--radius-md);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
            z-index: 10000;
            min-width: 180px;
            padding: 0.35rem 0;
        }
        .codes-context-item {
            padding: 0.6rem 1rem;
            cursor: pointer;
            font-size: 0.9rem;
            font-weight: 600;
            color: #0f172a;
            transition: all 0.15s ease;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .codes-context-item:hover {
            background: var(--bg-surface);
        }
        .codes-context-item.danger {
            color: #ef4444;
        }
        .codes-context-item.danger:hover {
            background: rgba(239, 68, 68, 0.08);
        }

        /* ================================
           CODE SELECTION PANEL (PDF)
           ================================ */
        .scroll-code-panel {
            background: #ffffff;
            border-radius: 18px;
            border: 2px solid var(--de-orange);
            box-shadow: 0 18px 40px rgba(2, 6, 23, 0.18);
            overflow: hidden;
        }
        .scroll-code-panel-header {
            background: linear-gradient(135deg, var(--de-navy), #00314b);
            color: #ffffff;
            padding: 0.85rem 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
        }
        .scroll-code-header-text {
            min-width: 0;
        }
        .scroll-code-title {
            font-size: 1.05rem;
            font-weight: 700;
        }
        .scroll-code-subtitle {
            margin-top: 0.25rem;
            font-size: 0.8rem;
            color: rgba(255, 255, 255, 0.8);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .scroll-code-close {
            width: 34px;
            height: 34px;
            border-radius: 999px;
            border: none;
            background: rgba(255, 255, 255, 0.18);
            color: #ffffff;
            font-size: 1.2rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .scroll-code-close:hover {
            background: rgba(255, 255, 255, 0.28);
        }
        .scroll-code-loading {
            padding: 2rem 1.25rem;
            text-align: center;
            color: var(--text-muted);
            font-weight: 600;
        }
        .scroll-code-body {
            padding: 0.85rem 0.9rem 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.85rem;
        }
        .scroll-code-section-head {
            display: flex;
            align-items: center;
            justify-content: space-between;
            font-size: 0.85rem;
            font-weight: 700;
            color: var(--de-navy);
        }
        .scroll-code-section-meta {
            font-size: 0.8rem;
            color: var(--text-muted);
            font-weight: 600;
        }
        .scroll-code-section {
            border-radius: 14px;
            border: 1px solid #c7d2fe;
            background: #eef2ff;
            padding: 0.65rem;
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
        }
        .scroll-code-list {
            max-height: 300px;
            overflow-y: auto;
            border-radius: 12px;
            border: 1px solid var(--border-color-light);
            padding: 0.4rem;
            background: #ffffff;
        }
        .scroll-code-list-item {
            display: flex;
            align-items: flex-start;
            gap: 0.6rem;
            padding: 0.65rem;
            border-radius: 10px;
            border: 1px solid #e2e8f0;
            background: #ffffff;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .scroll-code-list-item + .scroll-code-list-item {
            margin-top: 0.5rem;
        }
        .scroll-code-suggested-item {
            border-color: #c7d2fe;
            background: #ffffff;
        }
        .scroll-code-list-item:hover {
            border-color: var(--de-navy);
            box-shadow: 0 8px 16px rgba(15, 23, 42, 0.06);
        }
        .scroll-code-checkbox {
            width: 18px;
            height: 18px;
            margin-top: 0.15rem;
            flex-shrink: 0;
        }
        .scroll-code-text {
            min-width: 0;
        }
        .scroll-code-name {
            font-weight: 700;
            color: #0f172a;
            font-size: 0.9rem;
            margin-bottom: 0.2rem;
        }
        .scroll-code-def {
            font-size: 0.8rem;
            color: var(--text-muted);
            line-height: 1.3;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
        }
        .scroll-code-search input {
            width: 100%;
            padding: 0.75rem 0.85rem;
            border-radius: 10px;
            border: 1px solid var(--border-color-light);
            font-size: 0.9rem;
            outline: none;
            box-sizing: border-box;
        }
        .scroll-code-search input:focus {
            border-color: var(--de-orange);
            box-shadow: 0 0 0 3px rgba(243, 146, 0, 0.12);
        }
        .scroll-code-footer {
            display: flex;
            gap: 0.6rem;
            padding: 0.9rem 0.9rem 1rem;
            border-top: 1px solid var(--border-color-light);
            background: #ffffff;
            position: sticky;
            bottom: 0;
        }
        .scroll-code-footer-spacer {
            height: 0.2rem;
        }
        .scroll-code-apply-btn {
            flex: 1;
            padding: 0.85rem 1rem;
            border-radius: 999px;
            border: none;
            background: linear-gradient(135deg, var(--de-orange), var(--de-light-orange));
            color: var(--de-dark-navy);
            font-weight: 700;
            font-size: 0.95rem;
            cursor: pointer;
        }
        .scroll-code-cancel-btn {
            padding: 0.85rem 1.1rem;
            border-radius: 999px;
            border: 1px solid var(--border-color-light);
            background: #ffffff;
            color: var(--text-secondary);
            font-weight: 600;
            cursor: pointer;
        }
        .scroll-code-empty {
            padding: 1rem;
            text-align: center;
            color: var(--text-muted);
            font-size: 0.85rem;
        }
        .scroll-code-empty.muted {
            background: #f8fafc;
            border-radius: 10px;
        }

        /* ================================
           CUSTOM CODE CREATION (SEARCH-BASED)
           ================================ */
        .scroll-code-create-suggestion {
            background: #f0f7ff;
            border: 1px solid #bfdbfe;
            border-radius: 10px;
            padding: 0.75rem;
            margin-bottom: 0.85rem;
        }
        .scroll-code-create-content {
            display: flex;
            align-items: center;
            gap: 0.6rem;
            margin-bottom: 0.6rem;
        }
        .scroll-code-create-icon {
            font-size: 1.2rem;
        }
        .scroll-code-create-text {
            flex: 1;
            font-size: 0.85rem;
            color: var(--text-dark);
        }
        .scroll-code-create-text strong {
            color: var(--de-blue);
        }
        .scroll-code-create-btn {
            padding: 0.5rem 0.9rem;
            background: #4ade80;
            color: #ffffff;
            border: none;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.15s ease;
        }
        .scroll-code-create-btn:hover {
            background: #22c55e;
        }
        .scroll-code-create-form {
            background: #fafafa;
            border-radius: 8px;
            padding: 0.75rem;
            margin-top: 0.6rem;
        }
        .scroll-code-form-group {
            margin-bottom: 0.6rem;
        }
        .scroll-code-form-label {
            display: block;
            margin-bottom: 0.3rem;
            font-size: 0.75rem;
            font-weight: 600;
            color: var(--text-secondary);
        }
        .scroll-code-form-input,
        .scroll-code-form-textarea {
            width: 100%;
            padding: 0.5rem;
            border: 1px solid var(--border-color-light);
            border-radius: 6px;
            font-size: 0.8rem;
            box-sizing: border-box;
            font-family: inherit;
        }
        .scroll-code-form-input[readonly] {
            background: #f1f5f9;
            color: var(--text-secondary);
        }
        .scroll-code-form-textarea {
            resize: vertical;
            min-height: 60px;
        }
        .scroll-code-form-buttons {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.6rem;
        }
        .scroll-code-form-buttons button {
            flex: 1;
            padding: 0.5rem;
            border: none;
            border-radius: 6px;
            font-size: 0.8rem;
            font-weight: 600;
            cursor: pointer;
        }
        .scroll-code-form-btn-save {
            background: #4ade80;
            color: #ffffff;
        }
        .scroll-code-form-btn-save:hover {
            background: #22c55e;
        }
        .scroll-code-form-btn-save:disabled {
            background: #cbd5e1;
            cursor: not-allowed;
        }
        .scroll-code-form-btn-cancel {
            background: #e2e8f0;
            color: var(--text-dark);
        }
        .scroll-code-form-btn-cancel:hover {
            background: #cbd5e1;
        }

        /* ================================
           METADATA EXTRACTION PANEL
           ================================ */
        .meta-panel-header {
            background: linear-gradient(135deg, var(--de-navy), #00314b);
            color: #ffffff;
            padding: 0.85rem 1rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
        }
        .meta-panel-title {
            font-size: 1.05rem;
            font-weight: 700;
        }
        .meta-panel-close {
            width: 34px;
            height: 34px;
            border-radius: 999px;
            border: none;
            background: rgba(255, 255, 255, 0.18);
            color: #ffffff;
            font-size: 1.2rem;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .meta-panel-close:hover {
            background: rgba(255, 255, 255, 0.28);
        }
        .meta-panel-body {
            padding: 0.9rem 0.95rem 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.85rem;
        }
        .meta-panel-intro {
            font-size: 0.9rem;
            font-weight: 600;
            color: var(--text-secondary);
        }
        .meta-field-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }
        .meta-field-option {
            display: flex;
            gap: 0.75rem;
            align-items: flex-start;
            padding: 0.75rem;
            background: #f8fafc;
            border: 1px solid var(--border-color-light);
            border-radius: 12px;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .meta-field-option:hover {
            border-color: var(--de-navy);
            background: #f5f7fb;
        }
        .meta-field-option.active {
            border-color: var(--de-orange);
            background: rgba(243, 146, 0, 0.08);
        }
        .meta-field-radio {
            width: 18px;
            height: 18px;
            margin-top: 0.2rem;
            accent-color: var(--de-orange);
        }
        .meta-field-text {
            flex: 1;
            min-width: 0;
        }
        .meta-field-title {
            font-weight: 700;
            color: #0f172a;
            font-size: 0.9rem;
            margin-bottom: 0.2rem;
        }
        .meta-field-desc {
            font-size: 0.78rem;
            color: var(--text-muted);
        }
        .meta-custom-field {
            display: flex;
            flex-direction: column;
            gap: 0.4rem;
        }
        .meta-field-label {
            font-size: 0.85rem;
            font-weight: 600;
            color: var(--text-secondary);
        }
        .meta-text-input {
            width: 100%;
            padding: 0.75rem 0.9rem;
            border-radius: 10px;
            border: 1px solid var(--border-color-light);
            font-size: 0.9rem;
            outline: none;
            box-sizing: border-box;
        }
        .meta-text-input:focus {
            border-color: var(--de-orange);
            box-shadow: 0 0 0 3px rgba(243, 146, 0, 0.12);
        }
        .meta-panel-footer {
            display: flex;
            gap: 0.6rem;
            padding: 0.9rem 0.95rem 1rem;
            border-top: 1px solid var(--border-color-light);
            background: #ffffff;
            position: sticky;
            bottom: 0;
        }
        .meta-primary-btn {
            flex: 1;
            padding: 0.85rem 1rem;
            border-radius: 999px;
            border: none;
            background: linear-gradient(135deg, var(--de-orange), var(--de-light-orange));
            color: var(--de-dark-navy);
            font-weight: 700;
            font-size: 0.95rem;
            cursor: pointer;
        }
        .meta-primary-btn:disabled {
            opacity: 0.6;
            cursor: not-allowed;
        }
        .meta-secondary-btn {
            padding: 0.85rem 1.1rem;
            border-radius: 999px;
            border: 1px solid var(--border-color-light);
            background: #ffffff;
            color: var(--text-secondary);
            font-weight: 600;
            cursor: pointer;
        }
        .meta-loading {
            padding: 1.2rem;
            text-align: center;
            background: #f8fafc;
            border-radius: 10px;
            border: 1px solid var(--border-color-light);
            color: var(--text-muted);
            font-weight: 600;
        }
        .meta-error {
            padding: 1rem;
            background: #fef2f2;
            border: 1px solid #fecaca;
            border-radius: 10px;
            color: #dc2626;
        }
        .meta-preview {
            font-size: 1rem;
            font-weight: 600;
            color: #0f172a;
            margin-bottom: 0.6rem;
        }
        .meta-result-card {
            background: #f8fafc;
            border: 1px solid var(--border-color-light);
            border-radius: 12px;
            padding: 0.9rem;
            margin-top: 0.6rem;
        }
        .meta-result-title {
            font-weight: 700;
            color: var(--de-navy);
            font-size: 0.9rem;
            margin-bottom: 0.6rem;
        }
        .meta-result-body {
            margin-top: 0.5rem;
        }
        .meta-result-label {
            font-size: 0.8rem;
            color: var(--text-secondary);
            margin-bottom: 0.5rem;
            font-weight: 600;
        }
        .meta-field-row {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
            align-items: center;
        }
        .meta-field-key,
        .meta-field-value {
            padding: 0.5rem 0.6rem;
            border: 1px solid var(--border-color-light);
            border-radius: 8px;
            font-size: 0.85rem;
            box-sizing: border-box;
        }
        .meta-field-key {
            flex: 1;
            font-weight: 600;
        }
        .meta-field-value {
            flex: 2;
        }
        .meta-field-remove {
            padding: 0.45rem 0.6rem;
            background: #fee2e2;
            color: #dc2626;
            border: none;
            border-radius: 8px;
            cursor: pointer;
        }
        .meta-add-field-btn {
            font-size: 0.8rem;
            padding: 0.45rem 0.75rem;
            background: #e0e7ff;
            color: #4338ca;
            border: none;
            border-radius: 8px;
            cursor: pointer;
            margin-top: 0.4rem;
        }
        .meta-result-actions {
            display: flex;
            gap: 0.5rem;
            margin-top: 0.75rem;
        }
        .meta-save-btn {
            flex: 1;
            padding: 0.75rem 0.9rem;
            border-radius: 999px;
            border: none;
            background: linear-gradient(135deg, var(--de-orange), var(--de-light-orange));
            color: var(--de-dark-navy);
            font-weight: 700;
            font-size: 0.9rem;
            cursor: pointer;
        }

        /* ==========================================
           EXCERPTS MANAGER (Enterprise)
        ========================================== */

        .exmgr-wrap {
            padding: 2rem;
        }
        @media (max-width: 620px) {
            .exmgr-wrap {
                padding: 1.25rem;
            }
        }
        .exmgr-hero {
            border-radius: var(--radius-2xl);
            padding: 1.4rem 1.4rem 1.2rem;
            background:
                radial-gradient(1100px 420px at 15% 0%, rgba(255, 184, 77, 0.55), rgba(255,255,255,0) 55%),
                radial-gradient(900px 420px at 80% 20%, rgba(0, 59, 92, 0.35), rgba(255,255,255,0) 55%),
                linear-gradient(135deg, #071a2a, #003B5C);
            color: white;
            border: 1px solid rgba(255,255,255,0.12);
            box-shadow: 0 16px 50px rgba(2, 6, 23, 0.22);
        }
        .exmgr-hero-top {
            display: flex;
            justify-content: space-between;
            gap: 1rem;
            align-items: start;
        }
        @media (max-width: 620px) {
            .exmgr-hero-top {
                flex-direction: column;
                align-items: stretch;
            }
        }
        .exmgr-title {
            font-size: 1.4rem;
            font-weight: 900;
            letter-spacing: -0.02em;
        }
        .exmgr-subtitle {
            margin-top: 0.25rem;
            color: rgba(255,255,255,0.78);
            font-weight: 650;
            font-size: 0.9rem;
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            align-items: center;
        }
        .exmgr-dot {
            opacity: 0.6;
        }
        .exmgr-hero-actions {
            display: flex;
            gap: 0.6rem;
            align-items: center;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        @media (max-width: 620px) {
            .exmgr-hero-actions {
                justify-content: flex-start;
            }
        }
        .exmgr-metrics {
            margin-top: 1rem;
            display: grid;
            grid-template-columns: repeat(4, minmax(0, 1fr));
            gap: 0.75rem;
        }
        @media (max-width: 1100px) {
            .exmgr-metrics {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }
        @media (max-width: 620px) {
            .exmgr-metrics {
                grid-template-columns: 1fr;
            }
        }
        .exmgr-metric {
            background: rgba(255,255,255,0.08);
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: var(--radius-xl);
            padding: 0.9rem 1rem;
            backdrop-filter: blur(10px);
        }
        .exmgr-metric-kicker {
            font-size: 0.78rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: rgba(255,255,255,0.75);
            font-weight: 800;
        }
        .exmgr-metric-value {
            margin-top: 0.35rem;
            font-size: 1.6rem;
            font-weight: 950;
            letter-spacing: -0.02em;
        }
        .exmgr-metric-meta {
            margin-top: 0.35rem;
            color: rgba(255,255,255,0.75);
            font-size: 0.85rem;
            font-weight: 650;
        }

        .exmgr-grid {
            margin-top: 1rem;
            display: grid;
            grid-template-columns: 320px minmax(0, 1fr) 420px;
            gap: 0.9rem;
            align-items: start;
        }
        @media (max-width: 1180px) {
            .exmgr-grid {
                grid-template-columns: 320px minmax(0, 1fr);
            }
            .exmgr-grid > .exmgr-panel:last-child {
                grid-column: 1 / -1;
            }
        }
        @media (max-width: 900px) {
            .exmgr-grid {
                grid-template-columns: 1fr;
            }
        }

        .exmgr-panel {
            background: white;
            border: 1px solid #e2e8f0;
            border-radius: 18px;
            padding: 1.1rem 1.1rem 1rem;
            box-shadow: 0 10px 28px rgba(2, 6, 23, 0.06);
        }
        .exmgr-panel-title {
            font-size: 1rem;
            font-weight: 950;
            color: #0f172a;
            letter-spacing: -0.01em;
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            gap: 0.5rem;
        }
        .exmgr-count {
            font-size: 0.8rem;
            font-weight: 900;
            color: #0f172a;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            padding: 0.2rem 0.55rem;
            border-radius: var(--radius-full);
        }

        .exmgr-controls input[type="text"] {
            margin-bottom: 0.75rem;
        }

        .exmgr-list {
            margin-top: 0.85rem;
            display: flex;
            flex-direction: column;
            gap: 0.65rem;
            max-height: 70vh;
            overflow: auto;
            padding-right: 0.2rem;
        }
        .exmgr-row {
            border: 1px solid #e2e8f0;
            border-radius: var(--radius-xl);
            padding: 0.85rem 0.9rem;
            cursor: pointer;
            background: white;
            transition: transform 0.12s ease, border-color 0.12s ease, box-shadow 0.12s ease;
        }
        .exmgr-row:hover {
            transform: translateY(-1px);
            border-color: #cbd5e1;
            box-shadow: 0 10px 24px rgba(2, 6, 23, 0.07);
        }
        .exmgr-row.active {
            border-color: var(--de-orange);
            box-shadow: 0 14px 30px rgba(243, 146, 0, 0.12);
            background: rgba(243, 146, 0, 0.05);
        }
        .exmgr-row-top {
            display: flex;
            justify-content: space-between;
            gap: 0.75rem;
            align-items: baseline;
        }
        .exmgr-row-title {
            font-weight: 950;
            color: #0f172a;
            font-size: 0.95rem;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
        }
        .exmgr-row-status {
            font-size: 0.75rem;
            font-weight: 950;
            padding: 0.18rem 0.55rem;
            border-radius: var(--radius-full);
            border: 1px solid #e2e8f0;
            background: var(--bg-surface);
            color: #0f172a;
            white-space: nowrap;
        }
        .exmgr-row-status.coded {
            border-color: rgba(16, 185, 129, 0.35);
            background: rgba(16, 185, 129, 0.10);
            color: #047857;
        }
        .exmgr-row-status.pending {
            border-color: rgba(148, 163, 184, 0.65);
            background: rgba(148, 163, 184, 0.16);
            color: #334155;
        }
        .exmgr-row-status.skipped {
            border-color: rgba(245, 158, 11, 0.45);
            background: rgba(245, 158, 11, 0.12);
            color: #92400e;
        }
        .exmgr-row-meta {
            margin-top: 0.45rem;
            display: flex;
            flex-wrap: wrap;
            gap: 0.4rem;
        }
        .exmgr-pill {
            display: inline-flex;
            align-items: center;
            padding: 0.18rem 0.55rem;
            border-radius: var(--radius-full);
            border: 1px solid #e2e8f0;
            background: var(--bg-surface);
            color: #0f172a;
            font-weight: 800;
            font-size: 0.78rem;
        }
        .exmgr-pill.ghost {
            color: #475569;
            background: var(--bg-white);
        }
        .exmgr-row-snippet {
            margin-top: 0.55rem;
            color: #334155;
            font-weight: 650;
            font-size: 0.88rem;
            line-height: 1.35;
            display: -webkit-box;
            -webkit-line-clamp: 3;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }
        .exmgr-row-codes {
            margin-top: 0.6rem;
            display: flex;
            flex-wrap: wrap;
            gap: 0.35rem;
        }
        .exmgr-code {
            display: inline-flex;
            align-items: center;
            padding: 0.2rem 0.5rem;
            border-radius: var(--radius-full);
            font-size: 0.75rem;
            font-weight: 900;
            background: rgba(243, 146, 0, 0.10);
            border: 1px solid rgba(243, 146, 0, 0.25);
            color: #92400e;
        }
        .exmgr-code.more {
            background: rgba(148, 163, 184, 0.18);
            border-color: rgba(148, 163, 184, 0.35);
            color: #334155;
        }
        .exmgr-empty {
            padding: 1rem 0.2rem;
            color: var(--text-muted);
            font-weight: 700;
        }

        .exmgr-editor-head {
            display: flex;
            justify-content: space-between;
            gap: 0.8rem;
            align-items: start;
            padding: 0.9rem;
            border-radius: var(--radius-xl);
            border: 1px solid #e2e8f0;
            background: linear-gradient(180deg, #ffffff, #f8fafc);
        }
        @media (max-width: 620px) {
            .exmgr-editor-head {
                flex-direction: column;
                align-items: stretch;
            }
        }
        .exmgr-editor-title {
            font-weight: 950;
            color: #0f172a;
            font-size: 1rem;
        }
        .exmgr-editor-meta {
            margin-top: 0.35rem;
            display: flex;
            gap: 0.45rem;
            flex-wrap: wrap;
            align-items: center;
        }
        .exmgr-editor-actions {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
            justify-content: flex-end;
        }
        .exmgr-editor-text {
            margin-top: 0.85rem;
            padding: 0.9rem;
            border-radius: var(--radius-xl);
            border: 1px solid #e2e8f0;
            background: white;
            color: #0f172a;
            font-weight: 650;
            line-height: 1.55;
            white-space: pre-wrap;
            max-height: 240px;
            overflow: auto;
        }
        .exmgr-editor-block {
            margin-top: 0.85rem;
            padding: 0.9rem;
            border-radius: var(--radius-xl);
            border: 1px solid #e2e8f0;
            background: white;
        }
        .exmgr-editor-label {
            font-size: 0.78rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: var(--text-muted);
            font-weight: 950;
        }
        .exmgr-editor-codes {
            margin-top: 0.5rem;
            display: flex;
            flex-wrap: wrap;
            gap: 0.45rem;
        }
        .exmgr-code-chip {
            width: auto;
            margin: 0;
            padding: 0.45rem 0.7rem;
            border-radius: var(--radius-full);
            border: 2px solid rgba(243, 146, 0, 0.35);
            background: rgba(243, 146, 0, 0.10);
            color: #92400e;
            font-weight: 950;
            font-size: 0.82rem;
        }
        .exmgr-code-chip:hover {
            transform: translateY(-1px);
            box-shadow: 0 8px 18px rgba(243, 146, 0, 0.14);
        }
        .exmgr-add-row {
            margin-top: 0.7rem;
            display: flex;
            gap: 0.6rem;
            align-items: center;
        }
        @media (max-width: 620px) {
            .exmgr-add-row {
                flex-direction: column;
                align-items: stretch;
            }
        }
        .exmgr-add-row input {
            margin: 0;
        }
        .exmgr-editor-hint {
            margin-top: 0.65rem;
            color: var(--text-muted);
            font-weight: 650;
            font-size: 0.82rem;
            line-height: 1.35;
        }
        .exmgr-status-row {
            margin-top: 0.55rem;
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }
        .exmgr-status-btn {
            width: auto;
            margin: 0;
            padding: 0.45rem 0.8rem;
            border-radius: var(--radius-full);
            border: 2px solid #e2e8f0;
            background: var(--bg-white);
            color: #0f172a;
            font-weight: 950;
            font-size: 0.82rem;
        }
        .exmgr-status-btn.active {
            border-color: var(--de-orange);
            background: rgba(243, 146, 0, 0.08);
        }

        /* ================================
           MANAGE EXCERPTS PAGE
           ================================ */

        /* Table hover effects */
        .manage-excerpts-table tbody tr {
            transition: background-color 0.15s ease;
        }

        .manage-excerpts-table tbody tr:hover {
            background: #f8fafc !important;
        }

        .manage-excerpts-table tbody tr.selected {
            background: #fef3c7 !important;
        }

        .manage-excerpts-table tbody tr.selected:hover {
            background: #fef08a !important;
        }

        /* Bulk code modal search input focus */
        #bulkCodeSearch:focus {
            outline: 2px solid var(--de-orange);
            outline-offset: -2px;
            border-color: var(--de-orange);
        }

        /* Code filter chips hover */
        .code-filter-chip {
            transition: transform 0.1s ease, box-shadow 0.1s ease;
        }

        .code-filter-chip:hover {
            transform: translateY(-1px);
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        /* Bulk actions bar animation */
        .bulk-actions-bar {
            animation: slideDown 0.3s ease;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Checkbox styling */
        input[type="checkbox"].manage-excerpts-checkbox {
            accent-color: var(--de-orange);
            cursor: pointer;
        }

        /* Disabled button styling */
        button:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Responsive table for smaller screens */
        @media (max-width: 1200px) {
            .manage-excerpts-table th:nth-child(3),
            .manage-excerpts-table td:nth-child(3) {
                display: none;
            }
        }

        @media (max-width: 900px) {
            .manage-excerpts-table th:nth-child(2),
            .manage-excerpts-table td:nth-child(2) {
                max-width: 150px;
            }
        }
