/* ========================================
   Beedy News — Canadian Bill Tracker
   Clean, newspaper-inspired design
   ======================================== */

:root {
    --bg: #F8F9FA;
    --bg-card: #FFFFFF;
    --bg-dark: #0F172A;
    --bg-section: #F1F3F5;
    --border: #DEE2E6;
    --accent: #DC2626;
    --accent-dark: #991B1B;
    --blue: #2563EB;
    --green: #16A34A;
    --gold: #D97706;
    --purple: #7C3AED;
    --text: #1A1A1A;
    --text-light: #6B7280;
    --text-muted: #9CA3AF;
    --font-display: 'Merriweather', serif;
    --font-body: 'Inter', sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --radius: 12px;
}

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

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

/* ========== Header ========== */
.header {
    background: var(--bg-dark);
    color: white;
    padding: 16px 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-shield {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 0 6px rgba(220, 38, 38, 0.4));
    transition: transform 0.3s;
}

.logo:hover .logo-shield {
    transform: scale(1.1);
}

.logo-beedy { color: var(--accent); }
.logo-news { color: white; }

.header-tagline {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.6);
    flex: 1;
    text-align: center;
}

.btn-lang {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.btn-lang:hover { background: rgba(255,255,255,0.25); }

/* ========== Hero ========== */
.hero {
    position: relative;
    color: white;
    padding: 72px 24px 56px;
    text-align: center;
    border-bottom: 4px solid var(--accent);
    overflow: hidden;
    background: #0F172A;
}

.hero-video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    opacity: 0.35;
    z-index: 0;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    line-height: 1.3;
    margin-bottom: 16px;
    font-weight: 900;
}

.hero p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    max-width: 600px;
    margin: 0 auto 32px;
    line-height: 1.7;
}

.transparency-badge {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    max-width: 650px;
    margin: 0 auto 24px;
    line-height: 1.6;
    text-align: left;
}

.transparency-badge strong { color: #D97706; }

.data-freshness {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 0.8rem;
    color: #92400E;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-disclaimer {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 0.75rem;
    color: #166534;
    margin-top: 12px;
    text-align: center;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    flex-wrap: wrap;
}

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

.stat-icon { font-size: 1.4rem; }
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.6); font-weight: 600; }

/* ========== Main Feed ========== */
.main {
    max-width: 1000px;
    margin: 0 auto;
    padding: 32px 24px;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.feed-header h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
}

.feed-filters {
    display: flex;
    gap: 6px;
}

.filter-btn {
    padding: 6px 16px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s;
}

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

/* Bills section */
main.main {
    position: relative;
}

/* Bill Cards */
.bills-feed {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bill-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: var(--shadow-sm);
}

.bill-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.bill-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 12px;
}

.bill-number {
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 1rem;
    color: var(--accent);
    background: #FEF2F2;
    padding: 4px 12px;
    border-radius: 6px;
    white-space: nowrap;
}

.bill-type {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 20px;
}

.type-gov { background: #EFF6FF; color: var(--blue); }
.type-private { background: #F5F3FF; color: var(--purple); }

.bill-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text);
}

.bill-status {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.bill-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.bill-meta span { display: flex; align-items: center; gap: 4px; }

.bill-ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--green);
    background: #F0FDF4;
    padding: 2px 10px;
    border-radius: 20px;
    margin-left: auto;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

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

/* ========== Modal ========== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.hidden { display: none; }

.modal-backdrop {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6);
}

.modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalIn 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 12px; right: 16px;
    background: none; border: none;
    font-size: 1.8rem;
    color: var(--text-muted);
    cursor: pointer;
}

.modal-close:hover { color: var(--text); }

/* Modal content sections */
.modal-bill-number {
    color: var(--accent);
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 8px;
}

.modal-bill-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.3;
}

.ai-section {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
}

.ai-section h3 {
    color: var(--green);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

.ai-field-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ai-field-value {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text);
}

.eli5-box {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 10px;
    padding: 16px;
    margin-top: 12px;
}

.eli5-box .ai-field-label { color: var(--gold); }

.detail-section {
    margin: 16px 0;
    padding: 16px 0;
    border-top: 1px solid var(--border);
}

.detail-section h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.detail-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.detail-tag {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: #F3F4F6;
    color: var(--text-light);
}

.detail-tag.has-tip {
    cursor: help;
    border-bottom: 1px dashed rgba(0,0,0,0.2);
    transition: background 0.2s;
}

.detail-tag.has-tip:hover {
    background: #E5E7EB;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    font-size: 0.85rem;
}

.detail-grid dt { color: var(--text-muted); font-weight: 600; }
.detail-grid dd { color: var(--text); }

/* ========== Legislative Flowchart ========== */
.bill-flowchart {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 16px;
    overflow-x: auto;
}

.flow-pipeline {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
    row-gap: 6px;
}

.flow-step {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    position: relative;
    cursor: help;
}

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

.flow-label {
    font-size: 0.7rem;
    font-weight: 600;
}

.flow-arrow {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin: 0 3px;
}

/* Done steps */
.flow-done .flow-dot {
    background: var(--green);
}
.flow-done .flow-label {
    color: var(--green);
}

/* Current step */
.flow-current .flow-dot {
    background: var(--accent);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
    animation: pulse-dot 1.5s ease-in-out infinite;
}
.flow-current .flow-label {
    color: var(--accent);
    font-weight: 800;
}

@keyframes pulse-dot {
    0%, 100% { box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2); }
    50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0.1); }
}

/* Pending steps */
.flow-pending .flow-dot {
    background: var(--border);
}
.flow-pending .flow-label {
    color: var(--text-muted);
}

/* Tooltip — rendered via JS as position:fixed overlay, escapes all containers */
.flow-tooltip {
    display: none;
}

/* The actual visible tooltip is #flow-tooltip-popup, created by JS */
#flow-tooltip-popup {
    position: fixed;
    z-index: 99999;
    background: var(--bg-dark, #1a1a2e);
    color: white;
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.5;
    padding: 10px 14px;
    border-radius: 8px;
    width: 280px;
    white-space: normal;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    pointer-events: none;
    display: none;
}

#flow-tooltip-popup::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--bg-dark, #1a1a2e);
}

/* When tooltip is below the step, arrow points up */
#flow-tooltip-popup.flow-tip-below::after {
    top: auto;
    bottom: 100%;
    border-top-color: transparent;
    border-bottom-color: var(--bg-dark, #1a1a2e);
}

/* Next step callout */
.flow-next {
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-light);
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.flow-next strong {
    color: var(--accent);
}

.flow-complete {
    color: var(--green);
    font-weight: 600;
}

/* ========== Law Search Section ========== */
.law-search-section {
    background: var(--bg-section);
    border-top: 4px solid var(--gold);
    padding-bottom: 40px;
}

.law-search-header {
    margin-bottom: 20px;
}

.law-search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.law-alpha {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
}

.law-alpha-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s;
}

.law-alpha-btn:hover, .law-alpha-btn.active {
    background: var(--gold);
    color: white;
    border-color: var(--gold);
}

.law-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.law-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.law-card:hover {
    border-color: var(--gold);
    box-shadow: 0 3px 12px rgba(0,0,0,0.06);
}

.law-card-info {
    flex: 1;
}

.law-card-code {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--gold);
    background: #FFFBEB;
    padding: 2px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 4px;
}

.law-card-name {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
}

.law-card-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--green);
    background: #F0FDF4;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Law Modal */
.law-modal-code {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--gold);
    background: #FFFBEB;
    padding: 4px 12px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 8px;
}

.law-modal-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 16px;
}

.law-provisions-list {
    list-style: none;
    padding: 0;
}

.law-provisions-list li {
    padding: 8px 0 8px 24px;
    position: relative;
    line-height: 1.5;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.law-provisions-list li:last-child { border-bottom: none; }

.law-provisions-list li::before {
    content: '§';
    position: absolute;
    left: 4px;
    color: var(--gold);
    font-weight: 700;
}

/* ========== Insufficient Data Notice ========== */
.insufficient-data-notice {
    background: #FFFBEB;
    border: 2px solid #FDE68A;
    border-radius: 12px;
    padding: 20px;
    margin: 16px 0;
    text-align: center;
}

.insufficient-data-notice h3 {
    font-size: 1rem;
    color: #92400E;
    margin-bottom: 8px;
}

.insufficient-data-notice p {
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

/* ========== Search Bar ========== */
#search-section {
    background: var(--bg-section);
    border-radius: 0;
    border-top: 1px solid var(--border);
    padding-top: 24px;
    padding-bottom: 24px;
}

.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.search-input {
    flex: 1;
    padding: 14px 20px;
    font-size: 1.05rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-family: var(--font-body);
    background: white;
    outline: none;
    transition: border-color 0.2s;
}

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

.search-btn {
    padding: 14px 20px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.search-btn:hover { background: var(--accent-dark); }

.search-filters {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
}

.filter-group label { font-weight: 600; white-space: nowrap; }

.date-input, .select-input {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    background: white;
    outline: none;
}

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

.select-input { min-width: 160px; }

/* Province badges */
.province-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.prov-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: #F3F4F6;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.prov-badge:hover { border-color: var(--accent); color: var(--accent); }
.prov-badge.active { background: var(--accent); color: white; }

/* ========== Section Hero Banners ========== */
.section-hero {
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 4px;
}

.section-hero-content {
    padding: 28px 28px 24px;
}

.section-hero h2 {
    font-family: var(--font-display);
    font-size: 1.4rem;
    margin-bottom: 4px;
    color: white;
}

.section-hero-sub {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    margin: 0;
}

.section-hero-news {
    background: linear-gradient(135deg, #1E293B 0%, #334155 50%, #0F172A 100%);
    border-left: 4px solid var(--accent);
}

.section-hero-bills {
    background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 50%, #0F172A 100%);
    border-left: 4px solid var(--blue);
}

.section-hero-watchlist {
    background: linear-gradient(135deg, rgba(66,32,6,0.9), rgba(69,26,3,0.85)), url('../assets/watchlist-bg.jpg') center/cover;
    border-left: 4px solid var(--gold);
    transition: all 0.3s ease;
}

.section-hero-watchlist .section-hero-content {
    transition: padding 0.3s ease;
}

/* Collapsed state — empty watchlist */
.watchlist-section.collapsed .section-hero-watchlist .section-hero-content {
    padding: 12px 28px;
}

.watchlist-section.collapsed .section-hero-watchlist h2 {
    font-size: 1rem;
}

.watchlist-section.collapsed .section-hero-watchlist .section-hero-sub {
    display: none;
}

.watchlist-section.collapsed #watchlist-feed,
.watchlist-section.collapsed #watchlist-empty,
.watchlist-section.collapsed #clear-watchlist-btn {
    display: none !important;
}

/* Expanded state */
.watchlist-section:not(.collapsed) .section-hero-watchlist .section-hero-content {
    padding: 28px 28px 24px;
}

.section-hero-bills h2 { color: white; }

/* News section */
#news-section {
    position: relative;
}

/* ========== News Feed ========== */
.news-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    transition: all 0.25s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.news-card:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.news-source {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.source-cbc { color: var(--accent); }
.source-rc { color: var(--blue); }

.news-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 6px;
}

.news-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.level-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.level-federal { background: #EFF6FF; color: var(--blue); }
.level-provincial { background: #FDF4FF; color: #A855F7; }

/* ========== Trump / US-Canada Section ========== */
.trump-section {
    background: linear-gradient(135deg, #0F172A 0%, #1C1917 50%, #292524 100%);
    border-top: 4px solid var(--accent);
    border-bottom: 4px solid var(--accent);
    margin: 0 auto;
    max-width: 100%;
    padding: 32px 24px;
    position: relative;
    overflow: hidden;
}

.trump-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('../assets/trump-hero.jpg') center/cover no-repeat;
    opacity: 0.15;
    pointer-events: none;
}

.trump-section .trump-header {
    max-width: 1000px;
    margin: 0 auto 24px;
}

.trump-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}

.trump-title-row h2 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: white;
}

.trump-badge {
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 1px;
    background: var(--accent);
    color: white;
    padding: 4px 12px;
    border-radius: 4px;
    animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.trump-subtitle {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    line-height: 1.6;
    max-width: 700px;
}

.trump-feed {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
}

.trump-card {
    background: rgba(255,255,255,0.95);
    border: 2px solid rgba(254,202,202,0.6);
    border-radius: var(--radius);
    padding: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.trump-card:hover {
    border-color: var(--accent);
    box-shadow: 0 4px 24px rgba(220, 38, 38, 0.25);
    transform: translateY(-3px);
    background: white;
}

.trump-card-source {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.trump-card h4 {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
}

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

.trump-card-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.trump-card-cta {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent);
    background: #FEF2F2;
    padding: 3px 10px;
    border-radius: 20px;
}

/* Trump Modal */
.trump-modal-content {
    max-width: 780px;
    border-top: 4px solid var(--accent);
    background: linear-gradient(to bottom, white 0%, #FAFAF8 100%);
}

.trump-modal-header {
    margin-bottom: 20px;
}

.trump-modal-source {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.trump-modal-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
}

.trump-modal-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Truth Rating */
.truth-rating {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.truth-true { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }
.truth-partial { background: #FFFBEB; color: #92400E; border: 1px solid #FDE68A; }
.truth-misleading { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.truth-exaggerated { background: #FFF7ED; color: #9A3412; border: 1px solid #FED7AA; }
.truth-missing { background: #EFF6FF; color: #1E40AF; border: 1px solid #BFDBFE; }

/* Spin Sections */
.spin-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 12px 0;
}

.spin-card {
    border-radius: 10px;
    padding: 14px;
    font-size: 0.9rem;
    line-height: 1.6;
}

.spin-card-label {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.spin-liberal {
    background: #FEF2F2;
    border: 1px solid #FECACA;
}
.spin-liberal .spin-card-label { color: var(--accent); }

.spin-conservative {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
}
.spin-conservative .spin-card-label { color: var(--blue); }

.spin-media {
    background: #F5F3FF;
    border: 1px solid #DDD6FE;
    grid-column: 1 / -1;
}
.spin-media .spin-card-label { color: var(--purple); }

/* Spin check items */
.spin-check-list {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}

.spin-check-list li {
    padding: 8px 12px;
    background: #FFFBEB;
    border-left: 3px solid var(--gold);
    margin-bottom: 6px;
    border-radius: 0 6px 6px 0;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* Facts section in trump modal */
.trump-facts-section {
    background: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.trump-facts-section h3 {
    color: var(--green);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.trump-facts-list {
    list-style: none;
    padding: 0;
}

.trump-facts-list li {
    padding: 6px 0 6px 24px;
    position: relative;
    line-height: 1.5;
    font-size: 0.9rem;
}

.trump-facts-list li::before {
    content: '✓';
    position: absolute;
    left: 2px;
    color: var(--green);
    font-weight: 700;
}

/* Impact & Watch sections */
.trump-impact-section {
    background: #FFF7ED;
    border: 1px solid #FED7AA;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.trump-impact-section h3 {
    color: #9A3412;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.trump-watch-section {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 12px;
    padding: 16px;
    margin: 12px 0;
}

.trump-watch-section h3 {
    color: var(--blue);
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
}

@media (max-width: 768px) {
    .spin-grid { grid-template-columns: 1fr; }
    .trump-feed { grid-template-columns: 1fr; }
    .trump-modal-title { font-size: 1.1rem; }
}

/* ========== Media Accountability ========== */
.media-warning-inline {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    background: #FEF2F2;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 8px;
}

.retraction-link {
    display: inline-block;
    margin-left: 8px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--blue);
    text-decoration: none;
    padding: 2px 8px;
    background: #EFF6FF;
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: all 0.2s;
    vertical-align: middle;
}

.retraction-link:hover {
    border-color: var(--blue);
}

/* ========== Professor Corrections ========== */
.professor-summary {
    background: #F9FAFB;
    border-radius: 10px;
    padding: 16px;
    margin: 12px 0;
}

.professor-summary h3 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.professor-summary p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text);
}

.professor-corrections-section {
    background: #FFFBEB;
    border: 2px solid #FDE68A;
    border-radius: 12px;
    padding: 18px;
    margin: 16px 0;
}

.professor-corrections-section h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #92400E;
    margin-bottom: 4px;
}

.professor-subtitle {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-bottom: 14px;
    font-style: italic;
}

.professor-correction {
    background: white;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
    border-left: 4px solid var(--gold);
}

.professor-correction:last-child { margin-bottom: 0; }

.correction-para-num {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.correction-quote {
    font-style: italic;
    color: var(--text-light);
    font-size: 0.9rem;
    padding: 8px 12px;
    background: #F9FAFB;
    border-radius: 6px;
    margin-bottom: 8px;
    line-height: 1.5;
    border-left: 3px solid var(--border);
}

.correction-problem {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #991B1B;
    margin-bottom: 6px;
}

.correction-label-bad {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--accent);
    display: block;
    margin-bottom: 2px;
}

.correction-fix {
    font-size: 0.85rem;
    line-height: 1.5;
    color: #166534;
}

.correction-label-good {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--green);
    display: block;
    margin-bottom: 2px;
}

/* ========== News Analysis Modal ========== */
.news-modal-source {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.news-modal-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 6px;
}

.news-modal-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.news-ai-section {
    background: #EFF6FF;
    border-color: #BFDBFE;
}

.news-ai-section h3 {
    color: var(--blue);
}

.key-facts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.key-facts-list li {
    padding: 6px 0 6px 24px;
    position: relative;
    line-height: 1.5;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.key-facts-list li:last-child { border-bottom: none; }

.key-facts-list li::before {
    content: '→';
    position: absolute;
    left: 4px;
    color: var(--blue);
    font-weight: 700;
}

.related-bills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.related-bill-tag {
    font-size: 0.8rem;
    font-weight: 600;
    background: #FEF2F2;
    color: var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid #FECACA;
}

.read-original-btn {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 20px;
    background: var(--bg-dark);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.read-original-btn:hover { background: #1E293B; }

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.news-ai-badge {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--blue);
    background: #EFF6FF;
    padding: 2px 8px;
    border-radius: 20px;
}

/* ========== Translation Badges ========== */
.translated-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    color: #F59E0B;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.2);
    padding: 3px 10px;
    border-radius: 20px;
    margin: 4px 0;
}

.needs-translation-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 600;
    color: #3B82F6;
    background: rgba(59, 130, 246, 0.08);
    border: 1px dashed rgba(59, 130, 246, 0.3);
    padding: 3px 10px;
    border-radius: 20px;
    margin: 4px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.needs-translation-badge:hover {
    background: rgba(59, 130, 246, 0.15);
    border-style: solid;
}

/* ========== Section Navigation ========== */
.section-nav {
    background: var(--bg-dark);
    position: sticky;
    top: 56px;
    z-index: 99;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.section-nav-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.section-nav-inner::-webkit-scrollbar { display: none; }

.nav-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s;
    position: relative;
}

.nav-tab:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.05);
}

.nav-tab.active {
    color: white;
    border-bottom-color: var(--accent);
}

.nav-tab-icon { font-size: 1rem; }

.watchlist-count {
    position: absolute;
    top: 6px;
    right: 8px;
    background: var(--accent);
    color: white;
    font-size: 0.6rem;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Law Search Overhaul ========== */
.law-hero-banner {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(146, 64, 14, 0.75)),
                url('../assets/law-search-hero.jpg') center/cover no-repeat;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 24px;
}

.law-hero-overlay {
    padding: 40px 32px;
    text-align: center;
}

.law-hero-overlay h2 {
    font-family: var(--font-display);
    font-size: 1.8rem;
    color: white;
    margin-bottom: 8px;
}

.law-hero-sub {
    font-size: 0.95rem;
    color: rgba(255,255,255,0.7);
    margin-bottom: 20px;
}

.law-search-input-hero {
    max-width: 500px;
    border: 2px solid rgba(255,255,255,0.3) !important;
    background: rgba(255,255,255,0.95) !important;
    font-size: 1.05rem;
}

.law-search-btn-hero {
    background: var(--gold) !important;
}

.law-search-btn-hero:hover {
    background: #B45309 !important;
}

/* Law Categories */
.law-categories {
    margin-bottom: 24px;
}

.law-cat-title, .law-alpha-title {
    font-family: var(--font-display);
    font-size: 1rem;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.law-cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.law-cat-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 16px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    font-family: var(--font-body);
    box-shadow: var(--shadow-sm);
}

.law-cat-card:hover {
    border-color: var(--gold);
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.law-cat-card.active {
    border-color: var(--gold);
    background: #FFFBEB;
    box-shadow: 0 0 0 2px rgba(217, 119, 6, 0.2);
}

.law-cat-icon {
    font-size: 1.4rem;
    margin-bottom: 6px;
}

/* Image-based category cards */
.law-cat-has-img {
    padding: 0 !important;
    overflow: hidden;
    position: relative;
    min-height: 110px;
}

.law-cat-img {
    width: 100%;
    height: 110px;
    display: block;
    transition: transform 0.3s;
    background-size: cover;
    background-position: center;
}

.law-cat-has-img:hover .law-cat-img {
    transform: scale(1.08);
}

.law-cat-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    background: linear-gradient(transparent, rgba(0,0,0,0.75));
    display: flex;
    flex-direction: column;
}

.law-cat-has-img .law-cat-name {
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.law-cat-has-img .law-cat-desc {
    color: rgba(255,255,255,0.7);
}

.law-cat-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.law-cat-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Law Results Header */
.law-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.law-results-header h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text);
}

.law-back-btn {
    padding: 6px 14px;
    border: 1px solid var(--border);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    transition: all 0.2s;
    font-family: var(--font-body);
}

.law-back-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.law-alpha-section {
    margin-bottom: 16px;
}

.law-results-group-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-light);
    padding: 8px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}

/* ========== News Card Enhancements ========== */
.news-truth-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: auto;
}

.truth-pill-true { background: #F0FDF4; color: #166534; }
.truth-pill-partial { background: #FFFBEB; color: #92400E; }
.truth-pill-misleading { background: #FEF2F2; color: #991B1B; }
.truth-pill-unknown { background: #F3F4F6; color: var(--text-muted); }

/* Bias Distribution Bar */
.bias-bar {
    display: flex;
    height: 4px;
    border-radius: 2px;
    overflow: hidden;
    margin: 6px 0 0;
    background: var(--border);
}

.bias-bar .bias-liberal { background: #DC2626; }
.bias-bar .bias-neutral { background: #9CA3AF; }
.bias-bar .bias-conservative { background: #2563EB; }

/* ========== Bill Status Badges ========== */
.bill-status-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
    text-transform: uppercase;
}

.badge-new { background: #F0FDF4; color: var(--green); }
.badge-passed { background: #EFF6FF; color: var(--blue); }
.badge-defeated { background: #FEF2F2; color: var(--accent); }

/* Bill Watchlist Star */
.bill-star {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.3;
    transition: all 0.2s;
    z-index: 2;
    padding: 4px;
}

.bill-star:hover { opacity: 0.7; transform: scale(1.2); }
.bill-star.starred { opacity: 1; }

.bill-card { position: relative; }

/* ========== Watchlist Section ========== */
.watchlist-section {
    border-top: 3px solid var(--gold);
    background: linear-gradient(135deg, #FFFBEB 0%, #FAFAF8 100%);
}

.watchlist-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
}

.watchlist-empty-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 12px;
    opacity: 0.4;
}

.watchlist-empty p {
    font-size: 0.9rem;
    max-width: 400px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ========== Footer ========== */
.footer {
    background: var(--bg-dark);
    color: rgba(255,255,255,0.5);
    padding: 40px 24px;
    margin-top: 0;
    font-size: 0.8rem;
    line-height: 1.8;
    text-align: center;
    border-top: 4px solid var(--accent);
}

.footer a { color: rgba(255,255,255,0.7); }
.footer-copy { margin-top: 8px; color: rgba(255,255,255,0.3); }

/* ========== AI Chat Panel ========== */
.chat-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-dark);
    color: white;
    border: 2px solid rgba(220,38,38,0.3);
    border-radius: 50px;
    padding: 14px 22px;
    cursor: pointer;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.chat-toggle:hover {
    border-color: var(--accent);
    box-shadow: 0 6px 32px rgba(220,38,38,0.2);
    transform: translateY(-2px);
}

.chat-toggle-icon { font-size: 1.2rem; }
.chat-toggle-label { font-size: 0.85rem; font-weight: 600; }

.chat-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 420px;
    height: 600px;
    max-height: calc(100vh - 100px);
    background: #0F172A;
    border: 1px solid #1E293B;
    border-radius: 16px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 48px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: chatSlideIn 0.3s ease;
}

.chat-panel.hidden { display: none; }

@keyframes chatSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: linear-gradient(135deg, #1E293B, #0F172A), url('../assets/chat-header-bg.jpg') center/cover;
    background-blend-mode: overlay;
    border-bottom: 1px solid #1E293B;
    flex-shrink: 0;
    cursor: grab;
    user-select: none;
}

.chat-header:active { cursor: grabbing; }

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

.chat-header-icon { font-size: 1.4rem; }

.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(220,38,38,0.3);
    box-shadow: 0 0 12px rgba(220,38,38,0.15);
}

.chat-header-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
}

.chat-header-sub {
    font-size: 0.68rem;
    color: #64748B;
}

.chat-header-actions { display: flex; gap: 4px; }

.chat-header-btn {
    background: none;
    border: 1px solid transparent;
    color: #64748B;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: all 0.2s;
}

.chat-header-btn:hover {
    color: white;
    background: rgba(255,255,255,0.05);
    border-color: #2A3444;
}

/* Messages area */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: #1E293B; border-radius: 2px; }

.chat-welcome {
    text-align: center;
    padding: 20px 10px;
}

.chat-welcome-icon { font-size: 2.5rem; margin-bottom: 12px; }

.chat-welcome-video {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 12px;
    border: 3px solid rgba(220,38,38,0.3);
    box-shadow: 0 0 20px rgba(220,38,38,0.15);
}

.chat-welcome-title {
    font-size: 1rem;
    font-weight: 700;
    color: white;
    margin-bottom: 6px;
}

.chat-welcome-text {
    font-size: 0.8rem;
    color: #64748B;
    line-height: 1.5;
    max-width: 320px;
    margin: 0 auto 16px;
}

.chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

.chat-suggestion {
    background: rgba(255,255,255,0.05);
    border: 1px solid #1E293B;
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.72rem;
    color: #94A3B8;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.chat-suggestion:hover {
    border-color: var(--accent);
    color: white;
    background: rgba(220,38,38,0.1);
}

/* Message bubbles */
.chat-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.85rem;
    line-height: 1.6;
    animation: msgFadeIn 0.2s ease;
}

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

.chat-msg-user {
    background: var(--accent);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.chat-msg-ai {
    background: #1E293B;
    color: #E2E8F0;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    white-space: pre-wrap;
}

.chat-msg-ai p { margin: 0 0 8px; }
.chat-msg-ai p:last-child { margin-bottom: 0; }
.chat-msg-ai ul, .chat-msg-ai ol { margin: 4px 0 8px 16px; }
.chat-msg-ai li { margin-bottom: 2px; }
.chat-msg-ai strong { color: white; }

.chat-msg-context {
    background: rgba(217,119,6,0.1);
    border: 1px solid rgba(217,119,6,0.2);
    color: #D97706;
    align-self: center;
    font-size: 0.72rem;
    padding: 6px 14px;
    border-radius: 20px;
    text-align: center;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
}

.chat-typing-dot {
    width: 8px;
    height: 8px;
    background: #475569;
    border-radius: 50%;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.chat-typing-dot:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* Voice conversation button */
.chat-voice-btn {
    background: #1E293B;
    border: 2px solid #2A3444;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-voice-btn:hover { border-color: var(--accent); }

.voice-btn-active {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    animation: voicePulse 2s ease-in-out infinite;
}

@keyframes voicePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.3); }
    50% { box-shadow: 0 0 0 10px rgba(220,38,38,0); }
}

/* Voice status bar */
.chat-voice-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(90deg, #0A0F1C, #1E293B);
    border-top: 1px solid #1E293B;
}

.voice-status-text {
    font-size: 0.72rem;
    color: #64748B;
    flex: 1;
}

.voice-stop-btn {
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.3);
    color: var(--accent);
    border-radius: 14px;
    padding: 3px 12px;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.voice-stop-btn:hover { background: rgba(239,68,68,0.2); }

/* Audio wave visualization */
.voice-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 20px;
}

.voice-wave span {
    display: block;
    width: 3px;
    background: #475569;
    border-radius: 2px;
    height: 6px;
    transition: height 0.15s, background 0.2s;
}

.voice-wave-idle span { height: 4px; background: var(--green); animation: waveIdle 1.5s ease-in-out infinite; }
.voice-wave-idle span:nth-child(2) { animation-delay: 0.2s; }
.voice-wave-idle span:nth-child(3) { animation-delay: 0.4s; }
.voice-wave-idle span:nth-child(4) { animation-delay: 0.6s; }
.voice-wave-idle span:nth-child(5) { animation-delay: 0.8s; }

@keyframes waveIdle {
    0%, 100% { height: 4px; }
    50% { height: 8px; }
}

.voice-wave-active span { background: var(--accent); animation: waveActive 0.4s ease-in-out infinite; }
.voice-wave-active span:nth-child(1) { animation-delay: 0s; }
.voice-wave-active span:nth-child(2) { animation-delay: 0.1s; }
.voice-wave-active span:nth-child(3) { animation-delay: 0.05s; }
.voice-wave-active span:nth-child(4) { animation-delay: 0.15s; }
.voice-wave-active span:nth-child(5) { animation-delay: 0.08s; }

@keyframes waveActive {
    0%, 100% { height: 4px; }
    50% { height: 18px; }
}

.voice-wave-thinking span { background: var(--gold); animation: waveThinking 0.8s ease-in-out infinite; }
.voice-wave-thinking span:nth-child(odd) { animation-delay: 0.4s; }

@keyframes waveThinking {
    0%, 100% { height: 4px; opacity: 0.5; }
    50% { height: 10px; opacity: 1; }
}

.voice-wave-prof span { background: var(--blue); animation: waveActive 0.5s ease-in-out infinite; }
.voice-wave-prof span:nth-child(1) { animation-delay: 0.1s; }
.voice-wave-prof span:nth-child(2) { animation-delay: 0s; }
.voice-wave-prof span:nth-child(3) { animation-delay: 0.2s; }
.voice-wave-prof span:nth-child(4) { animation-delay: 0.05s; }
.voice-wave-prof span:nth-child(5) { animation-delay: 0.15s; }

/* Old voice bar (kept for compat) */
.chat-voice-bar {
    display: flex;
    gap: 4px;
    padding: 6px 14px 0;
    background: #0A0F1C;
    border-top: 1px solid #1E293B;
}

.chat-listen-toggle, .chat-tts-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid #1E293B;
    border-radius: 14px;
    background: none;
    color: #475569;
    font-size: 0.65rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.chat-listen-toggle:hover, .chat-tts-toggle:hover { border-color: #3A4A5A; color: #94A3B8; }
.chat-listen-on { border-color: var(--green) !important; color: var(--green) !important; background: rgba(16,185,129,0.1); }
.chat-tts-on { border-color: var(--blue) !important; color: var(--blue) !important; background: rgba(37,99,235,0.1); }

.chat-listen-icon { font-size: 0.75rem; }
.chat-listen-label { font-size: 0.6rem; }

/* Mic button */
.chat-mic {
    background: #1E293B;
    border: 1px solid #2A3444;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-mic:hover { border-color: var(--accent); }

.chat-mic-active {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    animation: micPulse 1s ease-in-out infinite;
}

.chat-mic-transcribing {
    background: var(--gold) !important;
    border-color: var(--gold) !important;
    animation: none;
}

@keyframes micPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0.4); }
    50% { box-shadow: 0 0 0 8px rgba(220,38,38,0); }
}

/* Play button on AI messages */
.chat-play-btn {
    display: inline-block;
    background: none;
    border: 1px solid #2A3444;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 6px;
    color: #64748B;
    transition: all 0.2s;
    float: right;
}

.chat-play-btn:hover { border-color: var(--blue); color: var(--blue); }

/* Input area */
.chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid #1E293B;
    background: #0A0F1C;
    flex-shrink: 0;
}

.chat-input {
    flex: 1;
    background: #1E293B;
    border: 2px solid #2A3444;
    border-radius: 12px;
    padding: 12px 16px;
    color: white;
    font-size: 0.9rem;
    font-family: var(--font-body);
    resize: none;
    outline: none;
    max-height: 120px;
    line-height: 1.4;
    transition: border-color 0.3s;
}

.chat-input:focus { border-color: var(--accent); box-shadow: 0 0 12px rgba(220,38,38,0.15); }

.chat-input::placeholder { color: #64748B; }

/* Pulse the input when chat first opens */
.chat-input-pulse {
    animation: inputPulse 2s ease-in-out 3;
}

@keyframes inputPulse {
    0%, 100% { border-color: #2A3444; }
    50% { border-color: var(--accent); box-shadow: 0 0 12px rgba(220,38,38,0.2); }
}

.chat-send {
    background: var(--accent);
    border: none;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-send:hover { background: var(--accent-dark); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

/* Disclaimer at bottom of chat */
.chat-disclaimer {
    font-size: 0.6rem;
    color: #475569;
    text-align: center;
    padding: 4px 14px 8px;
    background: #0A0F1C;
}

/* ========== Civic Action Cards (in chat) ========== */
.chat-action-card {
    background: linear-gradient(135deg, #1E293B, #0F172A);
    border: 1px solid #2A3444;
    border-radius: 12px;
    padding: 14px;
    margin: 4px 0;
    align-self: stretch;
    animation: msgFadeIn 0.2s ease;
}

.action-card-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.action-card-input-row {
    display: flex;
    gap: 6px;
}

.action-input {
    flex: 1;
    background: #0A0F1C;
    border: 1px solid #2A3444;
    border-radius: 8px;
    padding: 8px 12px;
    color: white;
    font-size: 0.82rem;
    font-family: var(--font-body);
    outline: none;
}

.action-input:focus { border-color: var(--accent); }
.action-input::placeholder { color: #475569; }

.action-btn {
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.action-btn:hover { background: var(--accent-dark); }

.action-btn-full {
    display: block;
    width: 100%;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 10px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    font-family: var(--font-body);
    margin-top: 10px;
    transition: background 0.2s;
}

.action-btn-full:hover { background: var(--accent-dark); }

.action-loading { color: #64748B; font-size: 0.78rem; padding: 8px 0; }
.action-error { color: var(--accent); font-size: 0.78rem; padding: 8px 0; }
.action-success { color: var(--green); font-size: 0.78rem; padding: 8px 0; }

/* MP Card */
.mp-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0,0,0,0.2);
    border-radius: 10px;
    padding: 12px;
    margin: 10px 0;
}

.mp-photo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #2A3444;
}

.mp-name { font-size: 0.9rem; font-weight: 700; color: white; }
.mp-detail { font-size: 0.72rem; color: #64748B; }
.mp-email { font-size: 0.72rem; color: var(--blue); margin-top: 2px; }

/* Letter Draft */
.letter-recipient {
    font-size: 0.72rem;
    color: #64748B;
    margin-bottom: 8px;
}

.letter-subject {
    margin-bottom: 6px;
    font-weight: 600;
}

.action-textarea {
    width: 100%;
    background: #0A0F1C;
    border: 1px solid #2A3444;
    border-radius: 8px;
    padding: 10px 12px;
    color: white;
    font-size: 0.8rem;
    font-family: var(--font-body);
    outline: none;
    resize: vertical;
    line-height: 1.5;
    min-height: 120px;
}

.action-textarea:focus { border-color: var(--accent); }

.letter-from-row {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}

.letter-actions {
    display: flex;
    gap: 6px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.action-btn-send {
    background: var(--green);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 9px 16px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: var(--font-body);
    transition: background 0.2s;
}

.action-btn-send:hover { background: #059669; }

.action-btn-secondary {
    background: rgba(255,255,255,0.05);
    border: 1px solid #2A3444;
    border-radius: 8px;
    color: #94A3B8;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-body);
    transition: all 0.2s;
}

.action-btn-secondary:hover { border-color: #3A4A5A; color: white; }

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .header-tagline { display: none; }
    .hero h1 { font-size: 1.6rem; }
    .hero p { font-size: 0.95rem; }
    .hero-stats { gap: 16px; }
    .bill-card { padding: 18px; }
    .bill-title { font-size: 1rem; }
    .modal-content { padding: 24px 18px; }
    .modal-bill-title { font-size: 1.1rem; }
    .detail-grid { grid-template-columns: 1fr; }

    .nav-tab { padding: 10px 14px; font-size: 0.78rem; }
    .nav-tab-label { display: none; }
    .nav-tab-icon { font-size: 1.2rem; }
    .section-nav { top: 52px; }

    .law-hero-overlay { padding: 28px 18px; }
    .law-hero-overlay h2 { font-size: 1.3rem; }
    .law-cat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .law-cat-card {
    cursor: pointer; padding: 10px 12px; }
    .law-cat-icon { font-size: 1.1rem; }
    .law-cat-name { font-size: 0.78rem; }
    .law-cat-desc { display: none; }

    .news-feed { grid-template-columns: 1fr; }

    .chat-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 80px);
        bottom: 8px;
        right: 8px;
        border-radius: 12px;
    }
    .chat-toggle-label { display: none; }
    .chat-toggle { padding: 14px 16px; border-radius: 50%; }
}

/* Analyzed/Pending badges */
.badge-analyzed { display:inline-block; background:rgba(0,200,100,0.15); color:#00c864; border:1px solid rgba(0,200,100,0.3); padding:2px 8px; border-radius:10px; font-size:10px; font-weight:600; }
.badge-pending { display:inline-block; background:rgba(255,170,0,0.15); color:#ffaa00; border:1px solid rgba(255,170,0,0.3); padding:2px 8px; border-radius:10px; font-size:10px; font-weight:600; }
