/* FCV Data Mentions Dashboard Design System */

:root {
    --font-primary: 'Inter', sans-serif;
    --font-secondary: 'Inter', sans-serif;
    
    /* Transition Timings */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* Layout Dimensions */
    --header-height: 80px;
    --sidebar-width: 340px;
    
    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;
}

/* Dark Mode Tokens (Default) */
[data-theme="dark"] {
    --bg-app: #080d19;
    --bg-workspace: #0b1121;
    --bg-surface: rgba(14, 26, 50, 0.7);
    --bg-surface-solid: #0e1a32;
    --bg-surface-hover: rgba(22, 38, 70, 0.8);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-color-focus: rgba(0, 113, 188, 0.5);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-primary: #009FDA;       /* Official World Bank Light Blue */
    --accent-secondary: #0071BC;     /* Official World Bank Royal Blue */
    --accent-gradient: linear-gradient(135deg, #0071BC 0%, #009FDA 100%);
    --bg-glass-card: rgba(14, 26, 50, 0.4);
    
    --success: #10b981;
    --info: #0071BC;
    --warning: #f59e0b;
    --danger: #ef4444;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.3);
    --glow-primary: 0 0 12px rgba(0, 159, 218, 0.3);
}

/* Light Mode Tokens */
[data-theme="light"] {
    --bg-app: #f8fafc;
    --bg-workspace: #ffffff;
    --bg-surface: rgba(241, 245, 249, 0.85);
    --bg-surface-solid: #ffffff;
    --bg-surface-hover: rgba(226, 232, 240, 0.9);
    --border-color: rgba(0, 34, 68, 0.08);
    --border-color-focus: rgba(0, 113, 188, 0.5);
    
    --text-primary: #002244;         /* Official World Bank Deep Navy */
    --text-secondary: #334155;
    --text-muted: #64748b;
    
    --accent-primary: #0071BC;       /* Official World Bank Royal Blue */
    --accent-secondary: #009FDA;     /* Official World Bank Light Blue */
    --accent-gradient: linear-gradient(135deg, #002244 0%, #0071BC 100%);
    --bg-glass-card: rgba(255, 255, 255, 0.6);
    
    --success: #059669;
    --info: #0071BC;
    --warning: #d97706;
    --danger: #dc2626;
    
    --shadow-sm: 0 2px 8px rgba(0, 34, 68, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 34, 68, 0.08);
    --shadow-lg: 0 16px 40px rgba(0, 34, 68, 0.12);
    --glow-primary: 0 0 12px rgba(0, 113, 188, 0.2);
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: var(--bg-app);
    color: var(--text-primary);
    line-height: 1.5;
    overflow: hidden;
    height: 100vh;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    font-weight: 700;
}

/* CSS Scrollbar Styles */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* App Container Layout */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
}

/* Top App Header styling */
.app-header {
    height: var(--header-height);
    background-color: var(--bg-surface-solid);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 10;
    box-shadow: var(--shadow-sm);
    transition: background-color var(--transition-normal), border-color var(--transition-normal);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--glow-primary);
}

.logo-icon i {
    width: 22px;
    height: 22px;
}

.logo-text h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-text .subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Quick Stats Bar */
.quick-stats {
    display: flex;
    gap: 2rem;
}

.quick-stat-card {
    display: flex;
    flex-direction: column;
}

.q-label {
    font-size: 0.65rem;
    font-family: var(--font-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.q-val {
    font-size: 1.15rem;
    font-weight: 700;
}

.text-success {
    color: var(--success) !important;
}
.text-info {
    color: var(--info) !important;
}
.text-warning {
    color: var(--warning) !important;
}

/* Icons & Buttons */
.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.icon-btn:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

/* Toggle Sun/Moon visibility depending on data-theme */
[data-theme="dark"] .sun-icon,
[data-theme="light"] .moon-icon {
    display: none;
}

/* Workspace Layout */
.workspace {
    display: flex;
    flex: 1;
    overflow: hidden;
    background-color: var(--bg-workspace);
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    background-color: var(--bg-surface-solid);
    overflow-y: auto;
    padding: 1.5rem;
    gap: 1.25rem;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.sidebar-section-title i {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
}

.sidebar-section-title h2 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.document-title-section {
    margin-top: 1rem;
}

/* Controls inside Sidebar */
.search-box-container {
    position: relative;
    width: 100%;
}

.search-box-container input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--bg-workspace);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    outline: none;
    transition: all var(--transition-fast);
}

.search-box-container input:focus {
    border-color: var(--accent-primary);
    box-shadow: var(--glow-primary);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    flex: 1;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.filter-group select {
    padding: 0.65rem;
    background: var(--bg-workspace);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-primary);
    font-size: 0.85rem;
    cursor: pointer;
    transition: border var(--transition-fast);
}

.filter-group select:focus {
    border-color: var(--accent-primary);
}

.filter-row {
    display: flex;
    gap: 0.75rem;
}

/* Document Selector List */
.document-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-right: 2px;
}

.doc-card {
    padding: 0.85rem;
    background: var(--bg-glass-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.doc-card:hover {
    background: var(--bg-surface-hover);
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateX(2px);
}

.doc-card.active {
    background: var(--bg-surface-hover);
    border-color: var(--accent-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.doc-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-card-category {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.25rem;
    font-size: 0.7rem;
}

.doc-card-badge {
    padding: 1px 6px;
    background: rgba(99, 102, 241, 0.15);
    color: var(--accent-primary);
    border-radius: var(--radius-full);
    font-weight: 700;
}

.doc-card-name {
    color: var(--text-muted);
    font-family: monospace;
    font-size: 0.65rem;
}

/* Loading Placeholder styling */
.loading-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    gap: 1rem;
    color: var(--text-muted);
    text-align: center;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-primary);
    border-radius: var(--radius-full);
    animation: spin 1s linear infinite;
}

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

/* Content Panel styling */
.content-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* View Tabs */
.view-tabs {
    height: 52px;
    background: var(--bg-surface-solid);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    padding: 0 1.5rem;
    gap: 0.5rem;
    align-items: flex-end;
}

.tab-btn {
    padding: 0.65rem 1.25rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-family: var(--font-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    outline: none;
}

.tab-btn i {
    width: 16px;
    height: 16px;
}

.tab-btn:hover {
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-primary);
    border-bottom-color: var(--accent-primary);
}

/* Tab Content container */
.tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.tab-content.active {
    display: block;
}

/* Dashboard Banner */
.dashboard-banner {
    display: flex;
    gap: 1.25rem;
    background: linear-gradient(135deg, rgba(0, 113, 188, 0.08) 0%, rgba(0, 159, 218, 0.08) 100%);
    border: 1px solid rgba(0, 113, 188, 0.15);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.banner-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: rgba(0, 113, 188, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.banner-text h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.banner-text p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Metrics Cards Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.metric-card {
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    color: white;
}

.bg-gradient-indigo {
    background: linear-gradient(135deg, #002244 0%, #003a70 100%);
}

.bg-gradient-violet {
    background: linear-gradient(135deg, #0071BC 0%, #005a96 100%);
}

.bg-gradient-cyan {
    background: linear-gradient(135deg, #009FDA 0%, #007fae 100%);
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    opacity: 0.85;
}

.metric-title {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-header i {
    width: 18px;
    height: 18px;
}

.metric-value {
    font-size: 2.25rem;
    font-weight: 800;
    margin: 0.5rem 0 0.25rem 0;
}

.metric-desc {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* Charts Layout Grid */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.chart-card {
    background-color: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.chart-full-width {
    grid-column: span 2;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.chart-header i {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

.chart-container-wrapper {
    position: relative;
    height: 240px;
    width: 100%;
}

.long-chart {
    height: 300px;
}

/* Master Table View */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}

.table-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.table-actions {
    display: flex;
    gap: 0.75rem;
}

.action-btn {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-fast);
    outline: none;
    border: 1px solid transparent;
}

.action-btn.outline {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-primary);
}

.action-btn.outline:hover {
    background: var(--bg-surface-hover);
    border-color: var(--accent-primary);
}

.action-btn.link {
    background: transparent;
    color: var(--text-muted);
    border: none;
    padding: 0.5rem;
}

.action-btn.link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

.action-btn i {
    width: 14px;
    height: 14px;
}

/* Main Data Table */
.table-wrapper {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.85rem;
}

.data-table th {
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border-color);
    font-family: var(--font-secondary);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: top;
    color: var(--text-primary);
}

.data-table tbody tr {
    transition: background-color var(--transition-fast);
}

.data-table tbody tr:hover {
    background-color: var(--bg-surface-hover);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.page-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.page-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    text-transform: capitalize;
}

.badge-named {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

.badge-descriptive {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
}

.badge-vague {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* Blank State */
.blank-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8rem 2rem;
    color: var(--text-muted);
    text-align: center;
    gap: 1rem;
}

.blank-icon {
    width: 64px;
    height: 64px;
    color: var(--border-color-focus);
}

.blank-state h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
}

.blank-state p {
    font-size: 0.85rem;
    max-width: 320px;
}

/* Document Deep Dive Panel styling */
.dive-detail-container {
    animation: fadeIn var(--transition-normal);
}

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

.dive-doc-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.dive-doc-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    background: var(--border-color);
    color: var(--text-secondary);
    padding: 3px 10px;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
}

.dive-doc-title {
    font-size: 1.5rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dive-doc-meta {
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.dive-doc-meta code {
    font-family: monospace;
    background: var(--bg-surface);
    padding: 1px 6px;
    border-radius: 4px;
}

.dive-doc-meta span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.dive-doc-meta i {
    width: 14px;
    height: 14px;
}

/* Stats Summary Row inside Deep Dive */
.dive-stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.d-stat {
    padding: 1rem;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.d-stat-lbl {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.d-stat-val {
    font-size: 1.5rem;
    font-weight: 700;
}

.dive-section-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.dive-section-header i {
    width: 18px;
    height: 18px;
    color: var(--accent-primary);
}

.dive-section-header h3 {
    font-size: 1rem;
}

/* Mentions Inventory Cards */
.dive-mentions-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.mention-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: border-color var(--transition-fast);
}

.mention-card:hover {
    border-color: rgba(99, 102, 241, 0.3);
}

.mention-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.mention-card-entity {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.mention-correction {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.mention-correction .original {
    text-decoration: line-through;
    opacity: 0.8;
}

.mention-correction .corrected-label {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success);
    padding: 1px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-weight: 700;
}

.mention-card-meta {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.page-badge {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.mention-card-body {
    background: var(--bg-workspace);
    padding: 1rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border-color-focus);
}

.mention-card-body p {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.6;
}

.mention-card-body mark {
    background: rgba(245, 158, 11, 0.25);
    color: var(--warning);
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: 600;
}

.mention-card-footer {
    display: flex;
    gap: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border-color);
    padding-top: 0.75rem;
}

.mention-card-footer span {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.mention-card-footer span strong {
    color: var(--text-primary);
}

.hidden {
    display: none !important;
}

/* Animations */
.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .5; }
}

/* Word Cloud Styles */
.word-cloud-wrapper {
    width: 100%;
    height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.word-cloud-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 0.65rem 1rem;
    padding: 0.5rem;
}

.word-cloud-tag {
    cursor: pointer;
    font-family: var(--font-secondary);
    transition: all var(--transition-fast);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    user-select: none;
    text-align: center;
}

.word-cloud-tag:hover {
    transform: scale(1.12);
    background: var(--bg-surface-hover);
    color: var(--accent-primary) !important;
    box-shadow: var(--shadow-sm);
}

.word-cloud-tag.active-filter {
    background: var(--accent-primary);
    color: white !important;
    box-shadow: var(--glow-primary);
}

/* Document Deep-Dive Split Workspace Styles */
.dive-workspace-split {
    display: flex;
    gap: 1.5rem;
    height: calc(100vh - 200px);
    min-height: 520px;
    margin-top: 1rem;
    overflow: hidden;
}

.dive-view-pane {
    flex: 1.3;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    min-height: 0;
}

.dive-inventory-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    min-height: 0;
    padding-right: 4px;
}

.page-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    background: var(--bg-surface-solid);
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
    font-weight: 500;
}

.icon-btn-sm {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.icon-btn-sm:hover:not(:disabled) {
    background: var(--bg-surface-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

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

.pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
}

.fallback-text-viewer {
    padding: 1.5rem;
    overflow-y: auto;
    font-family: var(--font-primary);
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    height: 100%;
    background: var(--bg-workspace);
}

.fallback-text-viewer mark.selected-highlight {
    background-color: rgba(0, 159, 218, 0.25);
    border-bottom: 2px solid var(--accent-primary);
    padding: 1px 4px;
    border-radius: 4px;
    color: inherit;
    font-weight: 700;
}

.fallback-text-viewer mark.other-mention-highlight {
    background-color: rgba(0, 113, 188, 0.1);
    border-bottom: 1px dashed var(--accent-secondary);
    padding: 1px 3px;
    border-radius: 3px;
    color: inherit;
    cursor: pointer;
}

.fallback-text-viewer mark.other-mention-highlight:hover {
    background-color: rgba(0, 113, 188, 0.2);
    border-bottom-style: solid;
}
