/* ── Reset & Base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    /* Refined dark palette — inspired by modern SaaS dashboards */
    --bg-primary: #0b0d11;
    --bg-secondary: #0f1117;
    --bg-tertiary: #161820;
    --bg-card: #13151d;
    --bg-card-hover: #191c26;
    --bg-darker: #0a0c10;
    --border: #1e2130;
    --border-light: #262a3a;
    --text-primary: #e4e5ec;
    --text-secondary: #8a8d9f;
    --text-muted: #555872;
    --accent: #4f6ef7;
    --accent-light: #6b87ff;
    --accent-glow: rgba(79, 110, 247, 0.12);
    --green: #34c759;
    --green-light: #4cd964;
    --red: #ff453a;
    --yellow: #ffd60a;
    --cyan: #64d2ff;
    --purple: #bf5af2;
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --radius: 8px;
    --radius-sm: 6px;
    --transition: 150ms ease;
}

html { font-size: 14px; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.55;
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.app-layout {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* ── Sidebar ──────────────────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    z-index: 100;
}

.sidebar-header {
    height: var(--topbar-height);
    padding: 0 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
}

.logo-icon {
    color: var(--accent-light);
    display: flex;
    align-items: center;
}

.logo-icon svg {
    display: block;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    transition: all var(--transition);
    position: relative;
    font-size: 0.88rem;
    font-weight: 450;
}

.nav-item:hover { background: var(--bg-tertiary); color: var(--text-primary); }
.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-light);
    font-weight: 500;
}
.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 18px;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.nav-icon {
    width: 20px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-icon svg {
    display: block;
}

.nav-badge {
    margin-left: auto;
    background: var(--red);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
    display: none;
}

.sidebar-footer {
    padding: 12px 14px;
    border-top: 1px solid var(--border);
}

.sidebar-help-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.sidebar-help-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.sidebar-help-link svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.top-bar {
    height: var(--topbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
}

.top-bar-left { display: flex; align-items: center; gap: 16px; }
.top-bar-right { display: flex; align-items: center; gap: 16px; }

.page-title { font-size: 1.05rem; font-weight: 600; letter-spacing: -0.01em; }
.mobile-menu-btn { display: none; background: none; border: none; color: var(--text-primary); font-size: 1.3rem; }

.quick-search {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 12px;
    gap: 8px;
    width: 260px;
}

.quick-search input {
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    width: 100%;
    font-size: 0.85rem;
}

.quick-search input::placeholder { color: var(--text-muted); }
.search-icon { color: var(--text-muted); }

.notification-btn {
    position: relative;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    padding: 6px 10px;
    font-size: 1.1rem;
}

.notification-dot {
    display: none;
    position: absolute;
    top: 4px;
    right: 4px;
    width: 7px;
    height: 7px;
    background: var(--red);
    border-radius: 50%;
}

.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.content-area::-webkit-scrollbar { width: 6px; }
.content-area::-webkit-scrollbar-track { background: transparent; }
.content-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: border-color var(--transition);
}

.card:hover { border-color: var(--border-light); }

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

/* ── Stat Cards ───────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-change {
    font-size: 0.78rem;
    margin-top: 6px;
}

.stat-change.positive { color: var(--green); }
.stat-change.negative { color: var(--red); }
.stat-change.neutral { color: var(--text-muted); }

/* ── Grid Layouts ─────────────────────────────────────────────────────────── */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

/* ── Clip Cards ───────────────────────────────────────────────────────────── */
.clip-list { display: flex; flex-direction: column; gap: 12px; }

.clip-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    transition: all var(--transition);
    cursor: pointer;
}

.clip-card:hover {
    border-color: var(--accent);
    background: var(--bg-card-hover);
}

.clip-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.clip-source {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-weight: 500;
}

.clip-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    line-height: 1.4;
}

.clip-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.clip-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

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

/* ── Tags / Badges ────────────────────────────────────────────────────────── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: nowrap;
}

.tag-topic {
    background: rgba(79, 110, 247, 0.10);
    color: var(--accent-light);
}

.tag-sentiment-positive { background: rgba(52, 199, 89, 0.10); color: var(--green-light); }
.tag-sentiment-negative { background: rgba(255, 69, 58, 0.10); color: var(--red); }
.tag-sentiment-neutral { background: rgba(138, 141, 159, 0.10); color: var(--text-secondary); }

.tag-media {
    background: rgba(30, 200, 200, 0.12);
    color: var(--cyan);
}

/* ── Sentiment Indicator ──────────────────────────────────────────────────── */
.sentiment-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.sentiment-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease;
}

.sentiment-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.sentiment-positive { background: var(--green); }
.sentiment-negative { background: var(--red); }
.sentiment-neutral { background: var(--text-muted); }

/* ── Charts ───────────────────────────────────────────────────────────────── */
.chart-container {
    position: relative;
    width: 100%;
    height: 260px;
}

.chart-container-sm {
    position: relative;
    width: 100%;
    height: 200px;
}

/* ── Briefings ────────────────────────────────────────────────────────────── */
.briefing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 16px;
    transition: all var(--transition);
}

.briefing-card:hover { border-color: var(--accent); }

.briefing-date {
    font-size: 0.78rem;
    color: var(--accent-light);
    font-weight: 500;
    margin-bottom: 6px;
}

.briefing-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.briefing-summary {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.takeaway-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.takeaway-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--text-secondary);
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
}

.takeaway-bullet {
    color: var(--accent-light);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ── Alerts ───────────────────────────────────────────────────────────────── */
.alert-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all var(--transition);
}

.alert-card:hover { border-color: var(--border-light); }

.alert-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.alert-active { background: var(--green); }
.alert-inactive { background: var(--text-muted); }

.alert-info { flex: 1; min-width: 0; }
.alert-name { font-weight: 600; margin-bottom: 2px; }
.alert-query { font-size: 0.8rem; color: var(--text-muted); font-family: monospace; }

.alert-stats {
    display: flex;
    gap: 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.alert-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    transition: all var(--transition);
}

.alert-toggle:hover { border-color: var(--accent); color: var(--accent-light); }

/* ── Stakeholder Cards ────────────────────────────────────────────────────── */
.stakeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.stakeholder-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: all var(--transition);
}

.stakeholder-card:hover { border-color: var(--accent); }

.stakeholder-avatar {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.stakeholder-name {
    font-weight: 700;
    margin-bottom: 2px;
}

.stakeholder-title {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.stakeholder-stats {
    display: flex;
    justify-content: center;
    gap: 24px;
    font-size: 0.8rem;
}

.stakeholder-stat-label {
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
}

.stakeholder-stat-value {
    font-weight: 700;
    font-size: 1.1rem;
}

/* ── Search / AI ──────────────────────────────────────────────────────────── */
.search-hero {
    text-align: center;
    padding: 40px 0 32px;
}

.search-hero h2 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.search-hero p {
    color: var(--text-muted);
    margin-bottom: 24px;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 20px;
    gap: 12px;
    max-width: 640px;
    margin: 0 auto;
    transition: border-color var(--transition);
}

.search-bar:focus-within { border-color: var(--accent); }

.search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    font-size: 1rem;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar button {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    transition: background var(--transition);
}

.search-bar button:hover { background: var(--accent-light); }

.search-suggestions {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.suggestion-chip {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition);
}

.suggestion-chip:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

.ai-response {
    max-width: 720px;
    margin: 24px auto 0;
    background: var(--bg-card);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    padding: 24px;
}

.ai-response-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-light);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-response-content {
    color: var(--text-secondary);
    line-height: 1.7;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.ai-response-content strong { color: var(--text-primary); }

/* ── Filters ──────────────────────────────────────────────────────────────── */
.filters-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    outline: none;
    appearance: none;
    cursor: pointer;
}

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

/* ── Pagination ───────────────────────────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.pagination button {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    transition: all var(--transition);
}

.pagination button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-light); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button.active { background: var(--accent); color: white; border-color: var(--accent); }

.pagination-info { font-size: 0.8rem; color: var(--text-muted); margin: 0 8px; }

/* ── Modal ────────────────────────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-overlay.active { display: flex; }

.modal {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    width: 100%;
    max-width: 480px;
}

.modal h3 { margin-bottom: 20px; font-size: 1.1rem; }

.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--accent); }

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
    transition: all var(--transition);
    letter-spacing: -0.005em;
}

.btn-primary { background: var(--accent); color: white; }
.btn-primary:hover { background: var(--accent-light); }
.btn-primary:active { background: #4563d9; }
.btn-secondary { background: var(--bg-tertiary); border-color: var(--border); color: var(--text-secondary); }
.btn-secondary:hover { border-color: var(--text-muted); color: var(--text-primary); }

/* ── Empty State ──────────────────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 3rem; margin-bottom: 16px; opacity: 0.5; }
.empty-state h3 { color: var(--text-secondary); margin-bottom: 8px; }

/* ── Loading ──────────────────────────────────────────────────────────────── */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-right: 10px;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        top: 0;
        bottom: 0;
        transition: left 0.2s ease;
    }
    .sidebar.open { left: 0; }
    .mobile-menu-btn { display: block; }
    .content-area { padding: 16px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .quick-search { width: 180px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .quick-search { display: none; }
}

/* ── Intelligent Search ──────────────────────────────────────────────────── */
.lg-controls {
    margin-bottom: 28px;
}

.lg-search-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 12px;
}

.lg-search-bar {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px 6px 4px 16px;
    gap: 10px;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.lg-search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.lg-search-icon {
    color: var(--text-muted);
    font-size: 1.1rem;
    flex-shrink: 0;
}

.lg-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    outline: none;
    font-size: 1rem;
    padding: 10px 0;
}

.lg-search-bar input::placeholder { color: var(--text-muted); }

.lg-search-btn {
    background: var(--accent);
    color: white;
    border: none;
    padding: 9px 22px;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background var(--transition);
    white-space: nowrap;
}

.lg-search-btn:hover { background: var(--accent-light); }
.lg-search-btn:active { background: #4563d9; }

.lg-time-controls {
    display: flex;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.lg-time-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 9px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    border-right: 1px solid var(--border);
}

.lg-time-btn:last-child { border-right: none; }
.lg-time-btn:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.lg-time-btn.active {
    background: var(--accent);
    color: white;
}

.lg-quick-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lg-tag-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.lg-quick-tag {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all var(--transition);
}

.lg-quick-tag:hover {
    border-color: var(--accent);
    color: var(--accent-light);
}

/* Intro */
.lg-intro {
    text-align: center;
    padding: 72px 20px;
}

.lg-intro-icon {
    font-size: 2.8rem;
    color: var(--accent);
    margin-bottom: 18px;
    opacity: 0.5;
}

.lg-intro h2 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.lg-intro p {
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto;
    line-height: 1.65;
    font-size: 0.88rem;
}

/* Loading */
.lg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 80px 20px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Error */
.lg-error {
    background: rgba(255, 69, 58, 0.08);
    border: 1px solid rgba(255, 69, 58, 0.20);
    border-radius: var(--radius);
    padding: 16px 20px;
    color: var(--red);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* KPI Grid */
.lg-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 20px;
}

.lg-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 20px;
    transition: border-color var(--transition);
}

.lg-kpi-card:hover { border-color: var(--border-light); }

.lg-kpi-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.lg-kpi-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.lg-kpi-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(79, 110, 247, 0.12);
    color: var(--accent-light);
}

.lg-kpi-badge.positive {
    background: rgba(52, 199, 89, 0.12);
    color: var(--green-light);
}

.lg-kpi-badge.negative {
    background: rgba(255, 69, 58, 0.10);
    color: var(--red);
}

.lg-kpi-badge.neutral {
    background: rgba(138, 141, 159, 0.10);
    color: var(--text-secondary);
}

.lg-kpi-value {
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.lg-kpi-value.positive { color: var(--green-light); }
.lg-kpi-value.negative { color: var(--red); }
.lg-kpi-value.neutral { color: var(--text-secondary); }

.lg-kpi-comparison {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.lg-kpi-comparison .positive { color: var(--green-light); }
.lg-kpi-comparison .negative { color: var(--red); }
.lg-kpi-comparison .neutral { color: var(--text-secondary); }

.lg-kpi-comparison strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* Charts */
.lg-chart-card {
    margin-bottom: 20px;
}

.lg-chart-container {
    position: relative;
    width: 100%;
    height: 320px;
}

.lg-chart-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
}

/* Attribution */
.lg-attribution {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 20px 0 8px;
}

.lg-attribution strong {
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
    .lg-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .lg-search-row { flex-direction: column; }
    .lg-kpi-grid { grid-template-columns: 1fr 1fr; }
    .lg-chart-container { height: 240px; }
}

@media (max-width: 480px) {
    .lg-kpi-grid { grid-template-columns: 1fr; }
    .lg-time-btn { padding: 8px 10px; font-size: 0.75rem; }
}

/* ── Leaderboard ─────────────────────────────────────────────────────────── */

.lb-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 20px;
    max-width: 300px;
}

.lb-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.lb-tab:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.lb-tab.active { background: var(--accent); color: white; }

.lb-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.lb-header-text h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: -0.01em;
}

.lb-header-text p {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.lb-legend {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.lb-legend-item { display: flex; align-items: center; gap: 6px; }
.lb-legend-muted { color: var(--text-muted); }
.lb-legend-sep { color: var(--border-light); }

.lb-party-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.lb-party-d { background: #3b82f6; }
.lb-party-r { background: #ef4444; }
.lb-party-i { background: #a855f7; }

.lb-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.lb-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    max-width: 300px;
}

.lb-progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0%;
}

.lb-table-wrap {
    overflow-x: auto;
}

.lb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.lb-table thead {
    position: sticky;
    top: 0;
    z-index: 5;
}

.lb-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--border);
    background: var(--bg-secondary);
    white-space: nowrap;
}

.lb-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.lb-table tr:hover td {
    background: var(--bg-card-hover);
}

.lb-td-rank {
    color: var(--text-muted);
    font-weight: 600;
    width: 40px;
}

.lb-td-name { font-weight: 500; }
.lb-td-party { font-size: 0.82rem; color: var(--text-secondary); }
.lb-td-state { color: var(--text-muted); }
.lb-td-tone { font-weight: 700; font-family: 'SF Mono', 'Fira Code', monospace; }
.lb-td-latest { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 0.82rem; }
.lb-td-points { color: var(--text-muted); font-size: 0.82rem; }

/* ── Clips ───────────────────────────────────────────────────────────────── */
.clips-results-header {
    margin-bottom: 16px;
}

.clips-count {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.clips-read-btn {
    color: var(--accent-light);
    font-size: 0.82rem;
    font-weight: 500;
}

.clip-card:hover .clips-read-btn { text-decoration: underline; }

/* Article Modal */
.clips-article-modal {
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px 32px;
}

.clips-article-modal::-webkit-scrollbar { width: 6px; }
.clips-article-modal::-webkit-scrollbar-track { background: transparent; }
.clips-article-modal::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.clips-article-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.clips-article-title {
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
}

.clips-article-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.clips-article-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.clips-article-error {
    padding: 20px 0;
}

.clips-not-archived {
    text-align: center;
    padding: 30px 20px;
}

.clips-not-archived-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
    opacity: 0.6;
}

.clips-not-archived h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.clips-not-archived p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 440px;
    margin: 0 auto;
}

.clips-article-stats {
    display: flex;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.clips-article-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.8;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
}

.clips-article-text::-webkit-scrollbar { width: 4px; }
.clips-article-text::-webkit-scrollbar-track { background: transparent; }
.clips-article-text::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

@media (max-width: 768px) {
    .lb-header { flex-direction: column; }
    .clips-article-modal { padding: 20px; max-width: 95vw; }
    .lb-table { font-size: 0.8rem; }
    .lb-table th, .lb-table td { padding: 8px 10px; }
}

/* ── Compare Tab ──────────────────────────────────────────────────────────── */

.cmp-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 4px;
    margin-bottom: 24px;
    max-width: 420px;
}

.cmp-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
}

.cmp-tab:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.cmp-tab.active { background: var(--accent); color: white; }

.cmp-panel { /* no special styling, just container */ }

/* Controls */
.cmp-controls {
    margin-bottom: 16px;
}

.cmp-input-row {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.cmp-field { display: flex; flex-direction: column; gap: 6px; }
.cmp-field label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.cmp-field input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 0.92rem;
    transition: border-color var(--transition);
}
.cmp-field input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.cmp-field input::placeholder { color: var(--text-muted); }
.cmp-field-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

.cmp-compare-btn {
    min-width: 120px;
    white-space: nowrap;
    padding: 11px 24px;
    font-size: 0.92rem;
}

/* Quick Tags */
.cmp-quick-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.cmp-quick-tag {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.cmp-quick-tag:hover {
    border-color: var(--accent);
    color: var(--accent-light);
    background: rgba(79, 110, 247, 0.06);
}

/* Intro State */
.cmp-intro {
    text-align: center;
    padding: 60px 20px;
}

.cmp-intro-icon {
    font-size: 2.2rem;
    color: var(--accent);
    margin-bottom: 16px;
    opacity: 0.5;
}

.cmp-intro h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: -0.02em;
}

.cmp-intro p {
    color: var(--text-muted);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Loading / Progress */
.cmp-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 60px 20px;
}

.cmp-progress-bar {
    width: 100%;
    max-width: 400px;
    height: 6px;
    background: var(--bg-darker);
    border-radius: 3px;
    overflow: hidden;
}

.cmp-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

.cmp-progress-text {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Summary Cards */
.cmp-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-bottom: 24px;
}

.cmp-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: border-color var(--transition);
}

.cmp-summary-card:hover { border-color: var(--border-light); }

.cmp-summary-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.cmp-summary-entity {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cmp-summary-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--accent-light);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Chart Cards */
.cmp-chart-card {
    margin-bottom: 20px;
    padding: 24px;
}

.cmp-chart-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 16px;
}

.cmp-chart-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.cmp-chart-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.cmp-chart-wrap {
    height: 340px;
    position: relative;
}

/* Comparison Table */
.cmp-table-card {
    padding: 24px;
    margin-bottom: 20px;
}

.cmp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.cmp-table thead th {
    text-align: left;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
}

.cmp-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
}

.cmp-table tbody td:first-child {
    font-family: inherit;
    color: var(--text-primary);
}

.cmp-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.cmp-entity-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

/* Featured Insight Cards (Landing Page) */
.lg-featured-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.lg-featured-row.lg-featured-hiding {
    opacity: 0;
    transform: translateY(-8px);
}

.lg-featured-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
}

.lg-featured-badge {
    display: inline-block;
    background: var(--accent-glow);
    color: var(--accent-light);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 2px 8px;
    border-radius: 20px;
    margin-bottom: 8px;
}

.lg-featured-badge-house {
    background: rgba(52, 199, 89, 0.12);
    color: var(--green);
}

.lg-featured-header {
    margin-bottom: 12px;
}

.lg-featured-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
}

.lg-senate-preview,
.lg-house-preview {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.lg-senate-mini {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 8px;
    text-align: center;
    transition: border-color var(--transition);
}

.lg-senate-mini:hover { border-color: var(--border-light); }

.lg-senate-mini-rank {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.lg-senate-mini-name {
    font-weight: 700;
    font-size: 0.82rem;
    color: var(--text-primary);
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lg-senate-mini-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.lg-senate-mini-tone {
    font-size: 1rem;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.lg-featured-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lg-featured-link {
    display: inline-block;
    color: var(--accent-light);
    font-weight: 500;
    font-size: 0.8rem;
    text-decoration: none;
    transition: color var(--transition);
}

@media (max-width: 900px) {
    .lg-featured-row { grid-template-columns: 1fr; }
    .lg-senate-preview, .lg-house-preview { grid-template-columns: repeat(3, 1fr); }
}

.lg-featured-link:hover { color: #fff; }

.lg-featured-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive: Compare */
@media (max-width: 900px) {
    .cmp-summary-grid { grid-template-columns: repeat(2, 1fr); }
    .cmp-input-row { flex-direction: column; }
    .lg-senate-preview { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 600px) {
    .cmp-tabs { max-width: 100%; }
    .cmp-summary-grid { grid-template-columns: 1fr 1fr; }
    .cmp-chart-wrap { height: 260px; }
    .lg-senate-preview { grid-template-columns: repeat(2, 1fr); }
    .cmp-table { font-size: 0.78rem; }
    .cmp-table thead th, .cmp-table tbody td { padding: 8px 10px; }
}

/* ── Press Clips (Automated) ──────────────────────────────────────────────── */

/* Tabs */
.pc-tabs {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: 20px;
    max-width: 340px;
}

.pc-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.pc-tab:hover { color: var(--text-primary); background: var(--bg-tertiary); }
.pc-tab.active { background: var(--accent); color: white; }

/* Panels */
.pc-panel {
    animation: pcFadeIn 0.2s ease;
}

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

/* Compact Form */
.pc-form-compact {
    max-width: none;
}

.pc-form-compact .pc-subscribe-btn {
    margin-top: 4px;
}

.pc-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.pc-field {
    margin-bottom: 14px;
}

.pc-field label {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 6px;
}

.pc-field input,
.pc-field select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    outline: none;
    font-size: 0.9rem;
    transition: border-color var(--transition);
}

.pc-field input:focus,
.pc-field select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.pc-field input::placeholder { color: var(--text-muted); }

.pc-field-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.pc-optional {
    color: var(--text-muted);
    font-weight: 400;
    font-size: 0.78rem;
}

.pc-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.pc-field-row-3 {
    grid-template-columns: 1.5fr 0.75fr 0.75fr;
}

.pc-subscribe-btn {
    padding: 10px 28px;
    font-size: 0.88rem;
    border-radius: var(--radius);
}

.pc-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pc-btn-loading .spinner {
    width: 16px;
    height: 16px;
    margin-right: 0;
}

/* Success */
.pc-success {
    text-align: center;
    padding: 32px 20px;
    background: rgba(52, 199, 89, 0.06);
    border: 1px solid rgba(52, 199, 89, 0.15);
    border-radius: var(--radius);
    margin-top: 20px;
}

.pc-success-icon {
    width: 48px;
    height: 48px;
    background: var(--green);
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.pc-success h3 {
    font-size: 1.1rem;
    color: var(--green-light);
    margin-bottom: 8px;
}

.pc-success p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    max-width: 480px;
    margin: 0 auto;
}

/* Error */
.pc-form-error {
    background: rgba(255, 69, 58, 0.08);
    border: 1px solid rgba(255, 69, 58, 0.20);
    border-radius: var(--radius);
    padding: 12px 18px;
    color: var(--red);
    font-size: 0.88rem;
    margin-top: 12px;
}

/* Preview Controls */
.pc-preview-controls {
    display: flex;
    gap: 14px;
    align-items: flex-end;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.pc-preview-controls .pc-field { margin-bottom: 0; }

.pc-preview-controls .btn {
    height: 42px;
    white-space: nowrap;
}

.pc-preview-loading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 32px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.pc-preview-loading strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.pc-preview-loading p {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.pc-preview-intro {
    padding: 32px 0;
}

.pc-preview-intro p {
    color: var(--text-muted);
    font-size: 0.84rem;
}

/* Report Summary */
.pc-report-summary {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 20px;
}

.pc-summary-stats {
    display: flex;
    gap: 32px;
    margin-bottom: 12px;
}

.pc-summary-stat {
    text-align: center;
}

.pc-summary-num {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-light);
    letter-spacing: -0.5px;
}

.pc-summary-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.pc-summary-meta {
    font-size: 0.82rem;
    color: var(--text-muted);
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.pc-summary-meta strong {
    color: var(--text-secondary);
}

/* Report Items */
.pc-report-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.pc-report-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    transition: border-color var(--transition);
}

.pc-report-item:hover {
    border-color: var(--border-light);
}

.pc-report-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.pc-report-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.4;
    text-decoration: none;
    transition: color var(--transition);
}

.pc-report-title:hover {
    color: var(--accent-light);
}

.pc-mention-badge {
    flex-shrink: 0;
    background: var(--accent);
    color: white;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    white-space: nowrap;
}

.pc-mention-none {
    background: var(--bg-tertiary);
    color: var(--text-muted);
}

.pc-report-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.pc-archive-badge {
    font-size: 0.72rem;
    font-weight: 500;
}

.pc-archive-yes { color: var(--green-light); }
.pc-archive-no { color: var(--text-muted); }

/* Excerpts */
.pc-excerpts {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.pc-excerpt {
    background: var(--bg-tertiary);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.pc-highlight {
    background: rgba(79, 110, 247, 0.18);
    color: var(--accent-light);
    padding: 1px 3px;
    border-radius: 2px;
    font-weight: 600;
}

.pc-no-items {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
}

/* Manage Subscriptions */
.pc-manage-loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
    justify-content: center;
}

.pc-manage-empty {
    text-align: center;
    padding: 60px 20px;
}

.pc-sub-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 10px;
    transition: border-color var(--transition);
}

.pc-sub-card:hover { border-color: var(--border-light); }

.pc-sub-keywords {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.pc-sub-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.pc-sub-created {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.pc-unsub-btn {
    flex-shrink: 0;
}

/* ── Email Preview & View Toggle ─────────────────────────────────────── */

.pc-view-toggle {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    background: var(--bg-darker);
    border-radius: var(--radius);
    padding: 4px;
    width: fit-content;
}

.pc-view-btn {
    padding: 7px 18px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
}

.pc-view-btn:hover {
    color: var(--text-secondary);
}

.pc-view-btn.active {
    background: var(--accent);
    color: #fff;
}

/* Email Frame */
.pc-email-frame {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
}

.pc-email-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-darker);
    border-bottom: 1px solid var(--border);
}

.pc-email-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--border-light);
}

.pc-email-dot:nth-child(1) { background: #ff5f57; }
.pc-email-dot:nth-child(2) { background: #ffbd2e; }
.pc-email-dot:nth-child(3) { background: #28ca41; }

.pc-email-bar-label {
    margin-left: 10px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Email Header */
.pc-email-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pc-email-from {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.pc-email-from strong {
    color: var(--text-primary);
}

.pc-email-subject {
    font-size: 0.92rem;
    color: var(--text-secondary);
}

.pc-email-subject strong {
    color: var(--text-primary);
    font-weight: 700;
}

.pc-email-date {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Email Body */
.pc-email-body {
    padding: 24px;
}

.pc-email-summary {
    background: rgba(79, 110, 247, 0.06);
    border: 1px solid rgba(79, 110, 247, 0.12);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin-bottom: 24px;
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.pc-email-summary strong {
    color: var(--accent-light);
    font-weight: 700;
}

/* Email Article Items */
.pc-email-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.pc-email-item:last-of-type {
    border-bottom: none;
}

.pc-email-item-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
    flex-wrap: wrap;
}

.pc-email-item-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: color var(--transition);
}

.pc-email-item-title:hover {
    color: var(--accent-light);
}

.pc-email-item-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.pc-email-mention-badge {
    display: inline-block;
    background: rgba(79, 110, 247, 0.12);
    color: var(--accent-light);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    letter-spacing: 0.02em;
}

.pc-email-excerpt {
    background: var(--bg-darker);
    border-left: 3px solid var(--accent);
    padding: 10px 14px;
    margin-top: 8px;
    margin-bottom: 6px;
    font-size: 0.84rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Method Tags */
.pc-method-tag {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.pc-method-direct {
    background: rgba(52, 199, 89, 0.12);
    color: var(--green);
}

.pc-method-wayback {
    background: rgba(255, 214, 10, 0.12);
    color: var(--yellow);
}

/* Unavailable Articles */
.pc-email-item-unavailable {
    opacity: 0.6;
}

.pc-email-item-unavailable .pc-email-item-title {
    font-weight: 500;
    color: var(--text-secondary);
}

.pc-email-item-unavailable-msg {
    font-size: 0.78rem;
    font-style: italic;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 6px 12px;
    background: var(--bg-darker);
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* Tone / Sentiment Tags */
.pc-tone-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 8px;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

.pc-tone-positive {
    background: rgba(52, 199, 89, 0.10);
    color: var(--green);
}

.pc-tone-negative {
    background: rgba(255, 69, 58, 0.10);
    color: var(--red);
}

.pc-tone-mixed {
    background: rgba(255, 214, 10, 0.10);
    color: var(--yellow);
}

/* Email Footer */
.pc-email-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Responsive */
@media (max-width: 900px) {
    .pc-preview-controls { flex-direction: column; }
    .pc-preview-controls .pc-field { width: 100%; }
    .pc-field-row { grid-template-columns: 1fr; }
    .pc-field-row-3 { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    .pc-tabs { max-width: 100%; }
    .pc-tab { padding: 8px 10px; font-size: 0.78rem; }
    .pc-summary-stats { gap: 16px; }
    .pc-summary-num { font-size: 1.4rem; }
    .pc-sub-card { flex-direction: column; align-items: flex-start; gap: 12px; }
    .pc-report-item-header { flex-direction: column; }
    .pc-email-header { padding: 14px 16px; }
    .pc-email-body { padding: 16px; }
    .pc-email-item-header { flex-direction: column; align-items: flex-start; }
    .pc-view-toggle { width: 100%; }
    .pc-view-btn { flex: 1; text-align: center; }
}

/* ── About Page ──────────────────────────────────────────────────────────── */
.about-page {
    max-width: 760px;
    margin: 0 auto;
    padding: 0;
}

.about-header {
    padding: 20px 0 0;
}

.about-header-text h2 {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.about-header-text p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 560px;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 20px 0;
}

.about-stat {
    background: var(--bg-card);
    padding: 20px 16px;
    text-align: center;
}

.about-stat-num {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
}

.about-stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 2px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 20px;
}

.about-card {
    background: var(--bg-card);
    padding: 20px;
}

.about-card h3 {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
    color: var(--text-primary);
}

.about-card p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.about-contact {
    text-align: center;
    padding: 12px 0 20px;
    font-size: 0.78rem;
}

.about-contact a {
    color: var(--text-muted);
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: color var(--transition);
}

.about-contact a:hover {
    color: var(--text-secondary);
}

@media (max-width: 700px) {
    .about-grid { grid-template-columns: 1fr; }
    .about-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-accent { color: var(--accent-light); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
