/* ============================================================
   RedLab Media Analytics — Global Styles
   ============================================================ */

:root {
    --color-primary: #BA0000;
    --color-primary-hover: #960000;
    --color-primary-light: #FDE8E8;
    --color-success: #10B981;
    --color-success-light: #D1FAE5;
    --color-danger: #EF4444;
    --color-danger-light: #FEE2E2;
    --color-warning: #F59E0B;
    --color-warning-light: #FEF3C7;
    --color-info: #6366F1;
    --color-bg: #F3F4F6;
    --color-surface: #FFFFFF;
    --color-border: #E5E7EB;
    --color-text: #111827;
    --color-text-secondary: #6B7280;
    --color-text-muted: #9CA3AF;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --transition: 0.15s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; }
a:hover { color: var(--color-primary-hover); }

img { max-width: 100%; display: block; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    border: 1px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}
.btn:hover { opacity: 0.9; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); color: #fff; }
.btn-outline { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn-outline:hover { background: var(--color-bg); color: var(--color-text); }
.btn-danger { background: var(--color-danger); color: #fff; }
.btn-success { background: var(--color-success); color: #fff; }
.btn-warning { background: var(--color-warning); color: #fff; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 24px; font-size: 15px; }
.btn-icon { padding: 6px; border: none; background: none; cursor: pointer; color: var(--color-text-secondary); }
.btn-icon:hover { color: var(--color-primary); }

/* ── Cards ── */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    height: fit-content;
}

/* ── Stat Cards ── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
}
.stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}
.stat-sub {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--color-text);
}
.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 9px 12px;
    font-size: 13px;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    color: var(--color-text);
    transition: border-color var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--color-text-muted); margin-top: 4px; }
#filterSearch { cursor: text; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
th {
    text-align: left;
    padding: 10px 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    border-bottom: 2px solid var(--color-border);
    white-space: nowrap;
}
td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--color-border);
    vertical-align: middle;
}
tr:hover td { background: #F9FAFB; }

/* ── Badges ── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    border-radius: 99px;
    white-space: nowrap;
}
.badge-positive { background: var(--color-success-light); color: #065F46; }
.badge-negative { background: var(--color-danger-light); color: #991B1B; }
.badge-neutral { background: var(--color-warning-light); color: #92400E; }
.badge-info { background: #EEF2FF; color: #4338CA; }
.badge-default { background: #F3F4F6; color: var(--color-text-secondary); }

/* ── Flash Messages (login page) ── */
.flash-container { padding: 0 24px; margin-bottom: 8px; }
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 8px;
    animation: flashIn 0.3s ease;
}
.flash-success { background: var(--color-success-light); color: #065F46; }
.flash-error { background: var(--color-danger-light); color: #991B1B; }
.flash-info { background: #EEF2FF; color: #4338CA; }
.flash-close {
    background: none; border: none; font-size: 18px;
    cursor: pointer; opacity: 0.5; color: inherit;
}
.flash-close:hover { opacity: 1; }

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

/* ── Utilities ── */
.text-muted { color: var(--color-text-secondary); }
.text-sm { font-size: 12px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.gap-1 { gap: 8px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.hidden { display: none; }

/* ── Section Headers ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-title {
    font-size: 16px;
    font-weight: 600;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--color-text-muted);
}
.empty-state svg { margin: 0 auto 12px; opacity: 0.3; }
.empty-state p { font-size: 14px; }

/* ── Chart Containers ── */
.chart-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}
.chart-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 16px;
}
.chart-container {
    position: relative;
    width: 100%;
    min-height: 250px;
}

/* ── Keyword Chips ── */
.keyword-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 99px;
}
.keyword-chip-remove {
    background: none; border: none; cursor: pointer;
    font-size: 14px; color: var(--color-primary); opacity: 0.6;
    padding: 0; line-height: 1;
}
.keyword-chip-remove:hover { opacity: 1; }
.exclusion-chip {
    background: var(--color-danger-light);
    color: var(--color-danger);
}
.exclusion-chip .keyword-chip-remove { color: var(--color-danger); }

/* Bigram alias items */
.bigram-alias-list { display: flex; flex-direction: column; gap: 8px; }
.bigram-alias-item {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    padding: 8px 10px;
}
.bigram-alias-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}
.bigram-alias-label { cursor: pointer; }
.bigram-alias-label:hover { text-decoration: underline; text-underline-offset: 2px; }
.bigram-alias-actions { display: flex; gap: 6px; }
.keyword-chip-sm { font-size: 11px; padding: 1px 8px; }
.mb-05 { margin-bottom: 4px; }

/* Keyword suggestions dropdown */
.keyword-suggestions {
    position: absolute;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    margin-top: 4px;
    box-shadow: var(--shadow-md);
    max-height: 160px;
    overflow-y: auto;
    width: 280px;
    z-index: 100;
}
.sug-item {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
}
.sug-item:hover { background: var(--color-bg); }

/* Keyword syntax guide */
.kw-syntax-guide {
    background: var(--color-bg);
    border-radius: var(--radius);
    padding: 12px 16px;
    margin-top: 12px;
}
.kw-syntax-guide summary {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    cursor: pointer;
    user-select: none;
}
.kw-syntax-guide summary:hover { color: var(--color-text); }
.kw-syntax-table {
    width: 100%;
    margin-top: 8px;
    font-size: 12px;
    border-collapse: collapse;
}
.kw-syntax-table td {
    padding: 4px 8px;
    vertical-align: top;
    border-bottom: 1px solid var(--color-border);
}
.kw-syntax-table tr:last-child td { border-bottom: none; }
.kw-syntax-table code,
.kw-stats-table code {
    font-size: 11px;
    background: var(--color-surface);
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid var(--color-border);
    white-space: nowrap;
}

/* Keyword stats table */
.kw-stats-table {
    width: 100%;
    font-size: 13px;
    border-collapse: collapse;
}
.kw-stats-table th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--color-text-muted);
    padding: 6px 8px;
    border-bottom: 2px solid var(--color-border);
}
.kw-stats-table th:last-child { text-align: right; }
.kw-stats-table td {
    padding: 8px;
    border-bottom: 1px solid var(--color-border);
}
.kw-stats-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.kw-stats-table tr:last-child td { border-bottom: none; }


/* ============================================================
   UI Components
   ============================================================ */

/* ── Loading Overlay ── */
.rl-loading {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.rl-loading.active { opacity: 1; visibility: visible; }
.rl-loading-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    width: 360px;
}
.rl-loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: rl-spin 0.7s linear infinite;
    margin: 0 auto 16px;
}
@keyframes rl-spin { to { transform: rotate(360deg); } }
.export-spin { animation: rl-spin 0.8s linear infinite; vertical-align: middle; }
#exportPptx.disabled { opacity: 0.6; pointer-events: none; cursor: not-allowed; }
.rl-loading-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text);
}
.rl-loading-progress {
    width: 100%; height: 6px;
    background: var(--color-border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 12px;
    display: none;
}
.rl-loading-progress-bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}
.rl-loading-detail {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 8px;
}
.rl-loading-detail:empty { display: none; }

/* ── Modal ── */
.rl-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
}
.rl-modal-overlay.active { opacity: 1; visibility: visible; }
.rl-modal {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    width: 100%; max-width: 480px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    transform: scale(0.95) translateY(8px);
    transition: transform 0.2s ease;
}
.rl-modal-overlay.active .rl-modal { transform: scale(1) translateY(0); }
.rl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}
.rl-modal-title { font-size: 16px; font-weight: 600; }
.rl-modal-close {
    background: none; border: none;
    font-size: 22px; color: var(--color-text-muted);
    cursor: pointer; padding: 0; line-height: 1;
}
.rl-modal-close:hover { color: var(--color-text); }
.rl-modal-body {
    padding: 16px 24px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-text-secondary);
}
.rl-modal-body .form-group:last-child { margin-bottom: 0; }
.rl-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 4px 24px 20px;
}

/* ── Toast ── */
.rl-toast-container {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 11000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
}
.rl-toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--color-surface);
    border-radius: 10px;
    padding: 14px 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    border-left: 4px solid var(--color-info);
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.rl-toast.active { transform: translateX(0); opacity: 1; }
.rl-toast.leaving { transform: translateX(120%); opacity: 0; }
.rl-toast-success { border-left-color: var(--color-success); }
.rl-toast-success .rl-toast-icon { color: var(--color-success); }
.rl-toast-error { border-left-color: var(--color-danger); }
.rl-toast-error .rl-toast-icon { color: var(--color-danger); }
.rl-toast-warning { border-left-color: var(--color-warning); }
.rl-toast-warning .rl-toast-icon { color: var(--color-warning); }
.rl-toast-info .rl-toast-icon { color: var(--color-info); }
.rl-toast-icon { flex-shrink: 0; margin-top: 1px; }
.rl-toast-content { flex: 1; min-width: 0; }
.rl-toast-title { font-size: 13px; font-weight: 600; color: var(--color-text); margin-bottom: 2px; }
.rl-toast-message { font-size: 13px; color: var(--color-text-secondary); }
.rl-toast-items {
    margin: 4px 0 0;
    padding-left: 16px;
    font-size: 12px;
    color: var(--color-text-secondary);
    list-style: disc;
}
.rl-toast-items li { margin-bottom: 2px; }
.rl-toast-close {
    background: none; border: none;
    font-size: 18px; color: var(--color-text-muted);
    cursor: pointer; padding: 0; line-height: 1; flex-shrink: 0;
}
.rl-toast-close:hover { color: var(--color-text); }

/* ── Custom Dropdown ── */
select.rl-select { display: none; }
.rl-dropdown { position: relative; width: 100%; }
.rl-dropdown-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px;
    font-size: 13px;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    cursor: pointer;
    transition: border-color var(--transition);
}
.rl-dropdown-trigger:hover { border-color: var(--color-primary); background-color: var(--color-bg); color: var(--color-primary); }
.rl-dropdown.open .rl-dropdown-trigger {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}
.rl-dropdown-value.placeholder { color: var(--color-text-muted); }
.rl-dropdown-chevron { transition: transform 0.2s; opacity: 0.5; display: flex; }
.rl-dropdown.open .rl-dropdown-chevron { transform: rotate(180deg); }
.rl-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    z-index: 500;
    max-height: 240px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: all 0.15s ease;
}
.rl-dropdown.open .rl-dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.rl-dropdown-search {
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid var(--color-border);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    flex-shrink: 0;
}
.rl-dropdown-options { overflow-y: auto; flex: 1; }
.rl-dropdown-option {
    padding: 8px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
}
.rl-dropdown-option:hover { background: var(--color-bg); }
.rl-dropdown-option.selected { color: var(--color-primary); font-weight: 500; }
.rl-dropdown-empty {
    padding: 12px;
    text-align: center;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* ── File Input ── */
.rl-file-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.rl-file-wrap input[type="file"] {
    position: absolute;
    width: 1px; height: 1px;
    opacity: 0;
    overflow: hidden;
}
.rl-file-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    color: var(--color-text);
}
.rl-file-label:hover {
    background: var(--color-bg);
    border-color: var(--color-primary);
    color: var(--color-primary);
}
.rl-file-name {
    font-size: 13px;
    color: var(--color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.rl-file-name.has-file { color: var(--color-text); font-weight: 500; }

/* ── Dropdown in filter bar ── */
.filter-bar .rl-dropdown { width: auto; min-width: 160px; }

/* (tweet card dropdown styles moved to app.css .tweet-action-select) */

/* ============================================================
   Overview Page (intric_web-inspired 2-column layout)
   ============================================================ */

/* Header */
.overview-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    background: var(--color-surface);
    border-radius: var(--radius);
    padding: 16px 20px;
}
.overview-info { flex: 1; min-width: 0; }
.overview-title { font-size: 24px; font-weight: 600; color: var(--color-text); margin: 0; }
.overview-keywords {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--color-text-secondary);
}
.overview-keywords strong { font-weight: 600; }
.overview-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* Sentiment Score Pie */
.presence-pie-wrap {
    position: relative;
    width: 96px; height: 96px;
    flex-shrink: 0;
}
.presence-pie {
    width: 96px; height: 96px;
    border-radius: 50%;
    background: conic-gradient(#e5e7eb 0deg, #e5e7eb 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
}
.presence-pie::before {
    content: '';
    position: absolute;
    width: 50%; height: 50%;
    background: white;
    border-radius: 50%;
    z-index: 1;
}
.presence-number {
    position: relative;
    z-index: 2;
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}
.presence-number.sentiment-positive { color: var(--color-success); }
.presence-number.sentiment-negative { color: var(--color-danger); }
.presence-number.sentiment-neutral { color: var(--color-warning); }

/* 2-Column Grid */
.overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* Column gap */
.overview-col { display: flex; flex-direction: column; gap: 20px; }

/* Card wrapper (white bg, border, rounded) */
.ov-card {
    background: var(--color-surface);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Card header (icon + text, bottom border) */
.ov-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    border-bottom: 1px solid #eee;
}
.ov-card-header svg { opacity: 0.5; }

/* Source distribution table */
.source-dist-table {
    width: 100%; border-collapse: collapse; font-size: 13px;
}
.source-dist-table th {
    text-align: left; padding: 10px 20px; font-weight: 600;
    color: var(--color-text-muted); font-size: 11px; text-transform: uppercase;
    letter-spacing: 0.5px; border-bottom: 1px solid #eee;
}
.source-dist-table td { padding: 10px 20px; border-bottom: 1px solid #f5f5f5; }
.source-dist-table tr:last-child td { border-bottom: none; }
.source-dist-name { display: flex; align-items: center; gap: 8px; }
.source-pct-bar {
    display: flex; align-items: center; gap: 8px;
}
.source-pct-fill {
    width: 100px; height: 6px; border-radius: 3px;
    background: var(--color-border);
    position: relative; overflow: hidden;
}
.source-pct-fill::after {
    content: ''; position: absolute; top: 0; left: 0; height: 100%;
    width: var(--pct); border-radius: 3px;
    background: var(--color-primary);
}
.source-pct-bar span { font-size: 12px; color: var(--color-text-muted); white-space: nowrap; }

/* Tabs */
.ov-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
}
.ov-tab {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: all var(--transition);
}
.ov-tab:hover { color: var(--color-text); }
.ov-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

/* Tab panes */
.ov-tab-pane { display: none; }
.ov-tab-pane.active { display: block; }

/* Mention card in overview */
.ov-mention {
    display: flex;
    gap: 10px;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    transition: background var(--transition);
}
.ov-mention.clickable { cursor: pointer; }
.ov-mention.clickable:hover { background: #fafafa; }

/* Unified avatar: initials as fallback, img overlays on top */
.ov-avatar {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
.ov-avatar span {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
    line-height: 1;
}
.ov-avatar img {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: var(--color-bg);
}
.ov-avatar[role="button"] { cursor: pointer; }

.ov-mention-body { flex: 1; min-width: 0; }
.ov-mention-meta { font-size: 12px; color: var(--color-text-secondary); margin-bottom: 4px; }
.ov-mention-meta strong { font-size: 13px; color: var(--color-text); margin-right: 3px; }
.ov-mention-text {
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text);
    margin-bottom: 8px;
}

/* Engagement row */
.ov-mention-engagement {
    font-size: 12px;
    color: #555;
    display: flex;
    gap: 20px;
}
.ov-mention-engagement span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Show More link */
.ov-show-more { padding: 12px 20px; }
.ov-empty { padding: 20px; font-size: 13px; color: var(--color-text-muted); }

/* Profile cards (Top Public Mentions / Profiles) */
.ov-profile {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
}
.ov-profile:last-of-type { border-bottom: none; }

.ov-profile-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}
.ov-profile-left strong {
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
}
.ov-profile-left strong:hover { text-decoration: underline; }

.ov-profile-right {
    display: flex;
    flex-shrink: 0;
}
.ov-profile-rate {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 120px;
}
.ov-profile-rate svg { color: #ccc; flex-shrink: 0; }
.ov-rate-detail { display: flex; flex-direction: column; line-height: 1.3; }
.ov-rate-val { font-size: 15px; font-weight: 600; }
.ov-rate-label { font-size: 9px; font-weight: 600; color: #888; letter-spacing: 0.3px; }

/* Summary Stats Grid (like intric_web col-right-single content) */
.ov-summary-grid {
    display: flex;
    padding: 16px 20px;
    gap: 0;
}
.ov-summary-col {
    flex: 1;
    text-align: center;
}
.ov-summary-val { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.ov-summary-label { font-size: 11px; color: var(--color-text-muted); }

/* Chart wrapper */
.ov-chart-wrap {
    padding: 16px 20px;
    height: 200px;
}

@media (max-width: 1024px) {
    .overview-grid { grid-template-columns: 1fr; }
    .overview-header { flex-wrap: wrap; }
    .overview-actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 600px) {
    .ov-summary-grid { flex-wrap: wrap; }
    .ov-summary-col { min-width: 33%; }
    .ov-author-right { gap: 14px; }
}


/* ============================================================
   Mentions Page (intric_web-inspired, full width)
   ============================================================ */

/* Chart controls */
.mention-chart-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
}
.chart-mode-group {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.chart-mode-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    background: var(--color-surface);
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition);
}
.chart-mode-btn + .chart-mode-btn { border-left: 1px solid var(--color-border); }
.chart-mode-btn:hover { background: var(--color-bg); }
.chart-mode-btn.active {
    background: var(--color-primary);
    color: #fff;
}

/* Filter bar */
.mention-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    flex-wrap: wrap;
    scroll-margin-top: 72px;
}
.mention-filter-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.mention-filter-title {
    font-size: 15px;
    font-weight: 600;
}
.mention-sort-group {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}
.sort-btn {
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 500;
    background: var(--color-surface);
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition);
    white-space: nowrap;
}
.sort-btn + .sort-btn { border-left: 1px solid var(--color-border); }
.sort-btn:hover { background: var(--color-bg); }
.sort-btn.active {
    background: var(--color-primary);
    color: #fff;
}

.mention-filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
}
.filter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* Sentiment toggle buttons */
.sentiment-toggle {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid var(--color-border);
    border-radius: 99px;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--color-text-secondary);
    user-select: none;
}
.sentiment-toggle input { display: none; }
.sentiment-toggle:hover { background: var(--color-bg); }
.sentiment-toggle.positive.active,
.sentiment-toggle.positive:has(input:checked) {
    background: var(--color-success-light);
    color: #059669;
    border-color: var(--color-success);
}
.sentiment-toggle.negative.active,
.sentiment-toggle.negative:has(input:checked) {
    background: var(--color-danger-light);
    color: #DC2626;
    border-color: var(--color-danger);
}
.sentiment-toggle.neutral.active,
.sentiment-toggle.neutral:has(input:checked) {
    background: var(--color-warning-light);
    color: #D97706;
    border-color: var(--color-warning);
}

/* Chart interval toggle (same style as chart-mode-group) */
.chart-interval-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    background: var(--color-surface);
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition);
}
.chart-interval-btn + .chart-interval-btn { border-left: 1px solid var(--color-border); }
.chart-interval-btn:hover { background: var(--color-bg); }
.chart-interval-btn.active {
    background: var(--color-primary);
    color: #fff;
}
.chart-interval-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}


.author-filter-banner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; margin-bottom: 12px;
    background: var(--color-primary-bg, #eff6ff); border: 1px solid var(--color-primary, #2563EB);
    border-radius: 8px; font-size: 0.85rem; color: var(--color-text);
}
.author-filter-banner strong { color: var(--color-primary, #2563EB); }

/* Extra filters row — unified 36px height for all controls */
.mention-extra-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.mention-extra-filters .form-input {
    width: auto;
    min-width: 140px;
    height: 36px;
    padding: 0 10px;
    font-size: 13px;
    box-sizing: border-box;
    color: var(--color-text-secondary);
    cursor: pointer;
}
.mention-extra-filters .form-input:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: var(--color-bg);
}
.mention-extra-filters .rl-dropdown { width: auto; min-width: 160px; }
.mention-extra-filters .rl-dropdown .rl-dropdown-trigger {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    box-sizing: border-box;
}
.mention-stats-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.mention-stats-badges {
    display: flex;
    gap: 6px;
    align-items: center;
}
.mention-stats-pagination .custom-pagination {
    margin-bottom: 0;
}

/* Pagination */
.custom-pagination {
    display: flex;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0 0 12px;
}
.custom-pagination .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    transition: all var(--transition);
}
.custom-pagination .page-link:hover:not(.disabled):not(.active) {
    background: var(--color-bg);
    color: var(--color-primary);
    border-color: var(--color-primary);
}
.custom-pagination .page-link.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}
.custom-pagination .page-link.disabled {
    color: var(--color-text-muted);
    opacity: 0.5;
    pointer-events: none;
    border-color: transparent;
}

@media (max-width: 768px) {
    .mention-filter-bar { flex-direction: column; align-items: flex-start; }
    .mention-filter-right { flex-wrap: wrap; }
    .mention-stats-pagination { flex-wrap: wrap; gap: 8px; }
}

/* ============================================================
   Analytics Dashboard
   ============================================================ */

/* KPI stat cards with icons */
.an-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}
.an-stat {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 14px;
}
.an-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.an-stat-icon svg { opacity: 0.9; }
.an-stat-icon.mentions { background: #DBEAFE; color: #2563EB; }
.an-stat-icon.views { background: #D1FAE5; color: #059669; }
.an-stat-icon.engagement { background: #FDE68A; color: #D97706; }
.an-stat-icon.sentiment { background: #EDE9FE; color: #7C3AED; }
.an-stat-body { flex: 1; min-width: 0; }
.an-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.an-stat-value {
    font-size: 26px;
    font-weight: 700;
    line-height: 1.2;
}
.an-stat-sub {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-top: 2px;
    display: flex;
    gap: 10px;
}
.an-stat-sub .positive { color: var(--color-success); }
.an-stat-sub .negative { color: var(--color-danger); }

/* Chart section cards */
.an-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    height: fit-content;
    min-width: 0;
    overflow: hidden;
}
.an-grid-2 > .an-card,
.an-grid-3-1 > .an-card,
.an-grid-1-3 > .an-card,
.an-grid-stack > .an-card { margin-bottom: 0; }
.an-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--color-border);
}
.an-card-title {
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}
.an-card-title svg { color: var(--color-text-muted); }
.an-card-body { padding: 20px; }
.an-card-body.no-pad { padding: 0; }
.an-card-body.h-main { height: 360px; }
.an-card-body.h-chart { height: 280px; }
.an-card-body.h-hashtags { height: 500px; }
.an-card-body.h-topics { height: 500px; }

/* Wordcloud tooltip */
.wc-tooltip {
    display: none;
    position: absolute;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: Inter, sans-serif;
    font-size: 12px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
}
.wc-tooltip-label {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 2px;
}
.wc-tooltip-value {
    font-size: 12px;
    color: rgba(255,255,255,0.8);
}

/* ── Custom Tooltip (reusable) ── */
#globalTip {
    display: none;
    position: fixed;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: Inter, sans-serif;
    font-size: 12px;
    white-space: nowrap;
    line-height: 1.5;
    z-index: 9999;
    pointer-events: none;
}

/* ── Authors Page ── */
.author-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    margin-bottom: 8px;
    flex-wrap: nowrap;
}
.author-filter-left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.author-filter-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
}
.author-filter-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}
.author-filter-right .mention-sort-group {
    flex-shrink: 0;
}
.author-filter-right .form-input {
    min-width: 0;
}
.author-filter-right input[type="date"] {
    width: 130px;
    flex-shrink: 0;
}
#authorSearch { cursor: text; }

.author-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 12px;
}
.author-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    transition: border-color var(--transition);
}
.author-card:hover { border-color: var(--color-primary); }
.author-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 14px;
}
.author-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 50%;
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
}
.author-avatar img {
    position: absolute;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--color-bg);
}
.author-info { min-width: 0; }
.author-name {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.author-name a { color: inherit; text-decoration: none; }
.author-name a:hover { text-decoration: underline; }
.author-handle {
    font-size: 12px;
    color: var(--color-text-secondary);
}
.author-location {
    font-size: 11px;
    color: var(--color-text-muted);
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
}
.author-card-stats {
    display: flex;
    gap: 6px;
}
.author-stat {
    flex: 1;
    text-align: center;
    padding: 8px 4px;
    background: var(--color-bg);
    border-radius: var(--radius);
}
.author-stat-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-text);
}
.author-stat-label {
    font-size: 10px;
    color: var(--color-text-muted);
    margin-top: 2px;
}
.author-card { position: relative; }
.author-card-actions {
    position: absolute;
    top: 12px; right: 12px;
    opacity: 0;
    transition: opacity 0.15s;
}
.author-card:hover .author-card-actions { opacity: 1; }
.author-card-actions .btn svg { margin-right: 4px; }

@media (max-width: 768px) {
    .author-grid { grid-template-columns: 1fr; }
    .author-filter-bar { flex-direction: column; align-items: flex-start; }
}

/* Analytics grid */
.an-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.an-grid-3-1 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}
.an-grid-1-3 {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 16px;
    margin-bottom: 16px;
}
.an-grid-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Date filter bar */
.an-filter-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    padding: 10px 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    flex-wrap: wrap;
}
.an-filter-bar .form-input {
    width: auto;
    min-width: 140px;
    height: 36px;
    padding: 0 10px;
    font-size: 12px;
    font-size: 13px;
    box-sizing: border-box;
    color: var(--color-text-secondary);
    cursor: pointer;
}
.an-filter-bar .form-input:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    background-color: var(--color-bg);
}
.an-filter-bar .rl-dropdown { width: auto; min-width: 110px; }
.an-filter-bar .rl-dropdown .rl-dropdown-trigger {
    height: 36px;
    padding: 0 12px;
    font-size: 13px;
    box-sizing: border-box;
}
.an-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-right: 4px;
}
.an-filter-sep {
    color: var(--color-text-muted);
    font-size: 12px;
}
.an-filter-range {
    font-size: 11px;
    color: var(--color-text-muted);
    background: var(--color-bg);
    padding: 4px 8px;
    border-radius: var(--radius);
    white-space: nowrap;
}
.an-filter-spacer { flex: 1; }
.an-quick-btns {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.an-quick-btn {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    background: var(--color-surface);
    border: none;
    cursor: pointer;
    color: var(--color-text-secondary);
    transition: all var(--transition);
}
.an-quick-btn + .an-quick-btn { border-left: 1px solid var(--color-border); }
.an-quick-btn:hover { background: var(--color-bg); }
.an-quick-btn.active {
    background: var(--color-primary);
    color: #fff;
}

/* Author list in analytics */
.an-author-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}
.an-author-item:last-child { border-bottom: none; }
.an-author-item:hover { background: #F9FAFB; }
.an-author-rank {
    width: 24px;
    font-size: 12px;
    font-weight: 700;
    color: var(--color-text-muted);
    text-align: center;
    flex-shrink: 0;
}
.an-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--color-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
}
.an-author-avatar span {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
}
.an-author-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    background: var(--color-bg);
}
.an-author-info { flex: 1; min-width: 0; }
.an-author-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.an-author-name a {
    color: var(--color-text);
    text-decoration: none;
}
.an-author-name a:hover {
    text-decoration: underline;
}
.an-author-handle {
    font-size: 11px;
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.an-author-location {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.an-author-stats {
    display: flex;
    gap: 24px;
    flex-shrink: 0;
}
.an-author-stat {
    text-align: right;
    width: 90px;
    flex-shrink: 0;
}
.an-author-stat:last-child {
    width: 60px;
}
.an-author-stat-val {
    font-size: 13px;
    font-weight: 600;
}
.an-author-stat-label {
    font-size: 10px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Top tweet rows in analytics */
.an-tweet-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 20px;
    border-bottom: 1px solid var(--color-border);
    transition: background var(--transition);
}
.an-tweet-item:last-child { border-bottom: none; }
.an-tweet-item:hover { background: #F9FAFB; }
.an-tweet-body { flex: 1; min-width: 0; }
.an-tweet-meta {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.an-tweet-meta strong {
    color: var(--color-text);
}
.an-tweet-text {
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 6px;
}
.an-tweet-engagement {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--color-text-muted);
}
.an-tweet-engagement span {
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Sentiment meter card */
.an-meter-card { margin-bottom: 20px; }
.an-meter-card .an-card-body { padding: 16px 20px; }

/* Sentiment stat value color classes */
.an-stat-value.sentiment-positive { color: var(--color-success); }
.an-stat-value.sentiment-negative { color: var(--color-danger); }
.an-stat-value.sentiment-neutral { color: var(--color-warning); }
.sentiment-positive { color: var(--color-success); }
.sentiment-negative { color: var(--color-danger); }
.sentiment-neutral { color: var(--color-warning); }

/* Sentiment dots */
.an-sentiment-dot.positive { background: var(--color-success); }
.an-sentiment-dot.negative { background: var(--color-danger); }
.an-sentiment-dot.neutral { background: var(--color-warning); }

/* Author avatar clickable */
.an-author-avatar[role="button"] { cursor: pointer; }

/* Button variants */
.btn-outline-danger { color: var(--color-danger); border-color: var(--color-danger); }
.btn-outline-danger:hover { background: var(--color-danger); color: #fff; }

/* Form: color input */
.form-color {
    width: 50px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    cursor: pointer;
}

/* Layout: narrow form container */
.form-narrow { max-width: 600px; }

/* Layout: keyword input flex */
.keyword-input-group { position: relative; }

/* Project list grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

/* Project card link */
.project-card {
    text-decoration: none;
    color: inherit;
    border-left: 4px solid var(--color-primary);
}
.project-card-title {
    font-size: 15px;
    font-weight: 600;
}

/* Danger zone */
.card-danger { border-color: var(--color-danger); }
.card-danger .section-title { color: var(--color-danger); }

/* Summary columns color */
.ov-summary-col.positive { color: var(--color-success); }
.ov-summary-col.negative { color: var(--color-danger); }

/* Mention chart wrapper */
.mention-chart-wrap {
    height: 320px;
    padding: 0 16px 16px;
}

/* Sentiment meter (horizontal bar) */
.an-sentiment-meter {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}
.an-sentiment-meter .positive { background: var(--color-success); }
.an-sentiment-meter .negative { background: var(--color-danger); }
.an-sentiment-meter .neutral { background: var(--color-warning); }

.an-sentiment-legend {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    font-size: 12px;
}
.an-sentiment-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.an-sentiment-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.an-sentiment-legend-item .value {
    font-weight: 600;
}

/* Keyword bar chart (CSS-only horizontal bars) */
.an-keyword-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 20px;
}
.an-keyword-name {
    width: auto;
    font-size: 12px;
    font-weight: 500;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-shrink: 0;
}
.an-keyword-bar-wrap {
    flex: 1;
    height: 20px;
    background: var(--color-bg);
    border-radius: 4px;
    overflow: hidden;
}
.an-keyword-bar {
    height: 100%;
    background: var(--color-primary);
    border-radius: 4px;
    transition: width 0.5s ease;
    min-width: 2px;
}
.an-keyword-count {
    width: auto;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

/* Loading spinner for async sections */
.an-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--color-text-muted);
    font-size: 13px;
}

@media (max-width: 1024px) {
    .an-stats { grid-template-columns: repeat(2, 1fr); }
    .an-grid-2, .an-grid-3-1, .an-grid-1-3 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .an-stats { grid-template-columns: 1fr; }
    .an-filter-bar { flex-direction: column; align-items: stretch; }
    .an-quick-btns { margin-left: 0; }
}
