/* ================================
   CSS Variables & Theme
   ================================ */
:root {
    /* Colors - Light Theme */
    --bg-primary: #fafafa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f4f4f5;
    --bg-accent: #fef3c7;
    --text-primary: #18181b;
    --text-secondary: #52525b;
    --text-muted: #a1a1aa;
    --border-color: #e4e4e7;
    --accent: #dc2626;
    --accent-muted: #fecaca;
    --link: #2563eb;
    --positive: #16a34a;
    --negative: #dc2626;

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Newsreader', Georgia, serif;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Layout */
    --max-width: 680px;
    --header-height: 60px;

    /* Transitions */
    --transition: 200ms ease;
}

/* Dark Theme */
[data-theme="dark"] {
    --bg-primary: #09090b;
    --bg-secondary: #18181b;
    --bg-tertiary: #27272a;
    --bg-accent: #422006;
    --text-primary: #fafafa;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border-color: #27272a;
    --accent: #ef4444;
    --accent-muted: #450a0a;
    --link: #60a5fa;
}

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

html {
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    min-height: 100vh;
}

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

a:hover {
    text-decoration: underline;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

.hidden {
    display: none !important;
}

/* ================================
   Header
   ================================ */
.header {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.header-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1px;
    transition: opacity 150ms ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo-r {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    letter-spacing: -0.03em;
    font-style: italic;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo:hover .logo-r,
.logo:hover .logo-text {
    color: inherit;
}

.tagline {
    flex: 1;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
    opacity: 0.8;
}

.theme-toggle,
.search-toggle {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 150ms ease;
}

.theme-toggle:hover,
.search-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.about-toggle {
    width: auto;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 150ms ease;
}

.about-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-icon,
.search-icon {
    font-size: 1.1rem;
}

/* ================================
   Combined Navigation Bar
   ================================ */
.main-nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 52px; /* Below header */
    z-index: 98;
}

.nav-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-content::-webkit-scrollbar {
    display: none;
}

/* View Toggle - Segmented Control */
.view-toggle {
    display: flex;
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 3px;
    flex-shrink: 0;
}

.view-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 150ms ease;
    white-space: nowrap;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
}

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

.view-btn.active {
    color: var(--text-primary);
    background: var(--bg-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 600;
}

.alerts-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 0.6rem;
    font-weight: 700;
    color: white;
    background: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Nav Divider */
.nav-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* Category Pills */
.category-pills {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.category-pill {
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    border-radius: 6px;
    transition: all 150ms ease;
    white-space: nowrap;
    border: none;
    background: transparent;
    cursor: pointer;
}

.category-pill:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.category-pill.active {
    color: var(--accent);
    background: rgba(37, 99, 235, 0.1);
    font-weight: 600;
}

/* Sort Wrapper */
.sort-wrapper {
    margin-left: auto;
    flex-shrink: 0;
}

/* Mobile Responsive - Main Navigation */
@media (max-width: 600px) {
    .main-nav {
        top: 41px;
    }

    .nav-content {
        padding: var(--space-xs) var(--space-sm);
        gap: 6px;
    }

    .view-toggle {
        padding: 2px;
    }

    .view-btn {
        padding: 5px 10px;
        font-size: 0.75rem;
    }

    .nav-divider {
        height: 16px;
    }

    .category-pills {
        gap: 2px;
    }

    .category-pill {
        padding: 5px 8px;
        font-size: 0.7rem;
    }

    .sort-select {
        padding: 4px 20px 4px 6px;
        font-size: 0.65rem;
    }
}

@media (max-width: 400px) {
    .nav-content {
        flex-wrap: wrap;
        justify-content: center;
    }

    .view-toggle {
        order: 1;
    }

    .nav-divider {
        display: none;
    }

    .category-pills {
        order: 2;
        width: 100%;
        justify-content: center;
        padding-top: var(--space-xs);
    }

    .sort-wrapper {
        order: 1;
        margin-left: var(--space-sm);
    }
}

/* ================================
   Main Content
   ================================ */
.main-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
    min-height: calc(100vh - 200px);
}

/* ================================
   Loading & Error States
   ================================ */
.loading {
    display: block;
}

.spinner {
    display: none;
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 0%,
        var(--border-color) 50%,
        var(--bg-tertiary) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-featured {
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-xl);
    border-bottom: 1px solid var(--border-color);
}

.skeleton-category {
    height: 12px;
    width: 80px;
    margin-bottom: var(--space-sm);
}

.skeleton-headline {
    height: 36px;
    width: 100%;
    margin-bottom: var(--space-sm);
}

.skeleton-headline-2 {
    height: 36px;
    width: 70%;
    margin-bottom: var(--space-md);
}

.skeleton-text {
    height: 18px;
    width: 100%;
    margin-bottom: var(--space-sm);
}

.skeleton-text-short {
    height: 18px;
    width: 60%;
    margin-bottom: var(--space-md);
}

.skeleton-meta {
    height: 24px;
    width: 200px;
}

.skeleton-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
    border-bottom: 1px solid var(--border-color);
}

.skeleton-number {
    width: 24px;
    height: 24px;
}

.skeleton-body {
    flex: 1;
}

.skeleton-card-headline {
    height: 24px;
    width: 90%;
    margin-bottom: var(--space-sm);
}

.skeleton-card-text {
    height: 16px;
    width: 100%;
    margin-bottom: var(--space-xs);
}

.skeleton-card-meta {
    height: 20px;
    width: 150px;
    margin-top: var(--space-sm);
}

.error-state {
    text-align: center;
    padding: var(--space-2xl) 0;
    color: var(--text-secondary);
}

.retry-btn {
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    background: var(--text-primary);
    color: var(--bg-primary);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
}

/* ================================
   Featured Story
   ================================ */
.featured-section {
    margin-bottom: var(--space-lg);
}

.featured-story {
    cursor: pointer;
    padding: var(--space-lg);
    margin: 0 calc(var(--space-md) * -1);
    border-radius: 16px;
    transition: background 150ms ease, transform 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.featured-story:hover {
    background: var(--bg-secondary);
}

.featured-story:active {
    background: var(--bg-tertiary);
    transform: scale(0.995);
}

.featured-category {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.featured-headline {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: var(--space-md);
    letter-spacing: -0.02em;
}

.featured-summary {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.featured-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.probability-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
}

.probability-badge .label {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.change-indicator {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
}

.change-indicator.positive {
    color: var(--positive);
    background: rgba(22, 163, 74, 0.12);
}

.change-indicator.negative {
    color: var(--negative);
    background: rgba(220, 38, 38, 0.12);
}

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

/* ================================
   Stories Feed
   ================================ */
.stories-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Story Card */
.story-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    margin: 0 calc(var(--space-md) * -1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.story-card:hover {
    background: var(--bg-secondary);
    transform: translateX(2px);
}

.story-card:active {
    background: var(--bg-tertiary);
    transform: scale(0.995);
}

.story-number {
    flex-shrink: 0;
    width: 24px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
}

.story-body {
    flex: 1;
    min-width: 0;
}

.story-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.story-headline {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.story-excerpt {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--space-sm);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.story-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.story-probability {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.story-change {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
}

.story-change.positive {
    color: var(--positive);
    background: rgba(22, 163, 74, 0.1);
}

.story-change.negative {
    color: var(--negative);
    background: rgba(220, 38, 38, 0.1);
}

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

/* ================================
   Load More
   ================================ */
.load-more {
    padding: var(--space-xl) 0;
    text-align: center;
}

.load-more-btn {
    padding: var(--space-sm) var(--space-xl);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition);
}

.load-more-btn:hover {
    background: var(--bg-tertiary);
}

/* ================================
   Story Modal
   ================================ */
.story-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.story-detail {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 300ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.2);
}

@keyframes slideUp {
    from { transform: translateY(100%); opacity: 0.8; }
    to { transform: translateY(0); opacity: 1; }
}

.close-btn {
    position: absolute;
    top: var(--space-md);
    right: var(--space-md);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 150ms ease;
}

.close-btn:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

.story-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl) var(--space-md) var(--space-2xl);
}

.detail-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.detail-headline {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: var(--space-lg);
}

.detail-odds {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.odds-main {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.odds-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.odds-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.odds-change {
    font-size: 1rem;
    font-weight: 500;
}

.odds-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: var(--space-md);
}

.odds-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 500ms ease;
}

.detail-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat-item {
    background: var(--bg-tertiary);
    padding: var(--space-md);
    border-radius: 8px;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.detail-description {
    margin-bottom: var(--space-lg);
}

.detail-description h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.detail-description p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.detail-actions {
    display: flex;
    gap: var(--space-sm);
}

.action-btn {
    flex: 1;
    padding: 14px var(--space-md);
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 150ms ease;
}

.action-btn-primary {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.action-btn-primary:hover {
    opacity: 0.85;
    text-decoration: none;
    transform: translateY(-1px);
}

.action-btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.action-btn-secondary:hover {
    background: var(--bg-primary);
    text-decoration: none;
}

/* ================================
   Footer
   ================================ */
.footer {
    border-top: 1px solid var(--border-color);
    padding: var(--space-lg) var(--space-md);
    margin-top: var(--space-2xl);
    background: var(--bg-secondary);
}

.footer-content {
    max-width: var(--max-width);
    margin: 0 auto;
    text-align: center;
}

.footer-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: var(--space-sm);
    line-height: 1.5;
}

.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
}

.footer-links a {
    color: var(--text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 150ms ease;
}

.footer-links a:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
    text-decoration: none;
}

.footer-links .divider {
    color: var(--border-color);
}

/* ================================
   About Modal
   ================================ */
.about-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
}

.about-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
}

.about-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: var(--space-xl);
    overflow-y: auto;
    animation: scaleIn 200ms ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.about-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
}

.about-content h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-top: var(--space-lg);
    margin-bottom: var(--space-sm);
}

.about-content p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.about-content .disclaimer {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: var(--space-lg);
    padding-top: var(--space-md);
    border-top: 1px solid var(--border-color);
}

/* ================================
   Responsive
   ================================ */
@media (min-width: 640px) {
    .story-detail {
        border-radius: 16px;
        max-height: 85vh;
        margin: auto;
    }

    .story-modal {
        align-items: center;
        padding: var(--space-lg);
    }

    .featured-headline {
        font-size: 2.25rem;
    }
}

@media (max-width: 480px) {
    .tagline {
        display: none;
    }

    .header-content {
        padding: var(--space-xs) var(--space-sm);
    }

    .logo-r {
        font-size: 1.25rem;
    }

    .logo-text {
        font-size: 1.1rem;
    }

    .featured-headline {
        font-size: 1.5rem;
    }

    .story-headline {
        font-size: 1.0625rem;
    }

    .featured-story {
        padding: var(--space-md);
    }

    .story-card {
        padding: var(--space-sm) var(--space-md);
    }

    .story-number {
        width: 20px;
        font-size: 0.875rem;
    }
}

/* ================================
   Search
   ================================ */
.search-bar {
    padding: 0 var(--space-md) var(--space-md);
    display: flex;
    gap: var(--space-sm);
    animation: slideDown 200ms ease;
}

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

.search-input {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition);
}

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

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

.search-clear {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-clear:hover {
    background: var(--border-color);
}

/* ================================
   Trending Badges
   ================================ */
.trending-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-radius: 6px;
    margin-left: var(--space-sm);
}

.trending-badge.hot {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.trending-badge.rising {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.trending-badge.new {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ================================
   Source Badges
   ================================ */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 3px 8px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.02em;
    border-radius: 6px;
    margin-left: var(--space-sm);
}

.source-badge.polymarket {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.source-badge.kalshi {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.source-badge.manifold {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.source-badge.metaculus {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* Clickable source badge links */
.source-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.source-badge-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.source-badge-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.source-badge-link.polymarket {
    background: rgba(99, 102, 241, 0.12);
    color: #6366f1;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.source-badge-link.polymarket:hover {
    background: rgba(99, 102, 241, 0.25);
    border-color: rgba(99, 102, 241, 0.5);
}

.source-badge-link.kalshi {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.source-badge-link.kalshi:hover {
    background: rgba(245, 158, 11, 0.25);
    border-color: rgba(245, 158, 11, 0.5);
}

.source-badge-link.manifold {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.source-badge-link.manifold:hover {
    background: rgba(34, 197, 94, 0.25);
    border-color: rgba(34, 197, 94, 0.5);
}

.source-badge-link.metaculus {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.source-badge-link.metaculus:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: rgba(59, 130, 246, 0.5);
}

/* ================================
   Recently Resolved Section
   ================================ */
.resolved-section {
    margin-top: var(--space-2xl);
    padding-top: var(--space-xl);
    border-top: 2px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.accuracy-badge {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--positive);
    border-radius: 6px;
    color: white;
}

.accuracy-value {
    font-size: 1rem;
    font-weight: 700;
}

.accuracy-label {
    font-size: 0.75rem;
    opacity: 0.9;
}

.resolved-feed {
    display: flex;
    flex-direction: column;
}

/* Resolved Card */
.resolved-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
}

.resolved-card:last-child {
    border-bottom: none;
}

.resolved-outcome {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.resolved-outcome.correct {
    background: rgba(22, 163, 74, 0.15);
}

.resolved-outcome.incorrect {
    background: rgba(220, 38, 38, 0.15);
}

.resolved-body {
    flex: 1;
    min-width: 0;
}

.resolved-headline {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.resolved-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.resolved-result {
    font-weight: 600;
}

.resolved-result.yes {
    color: var(--positive);
}

.resolved-result.no {
    color: var(--negative);
}

.prediction-vs-result {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ================================
   Pull to Refresh
   ================================ */
.pull-refresh {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: var(--accent);
    color: white;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    animation: slideFromTop 200ms ease;
}

@keyframes slideFromTop {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.pull-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ================================
   Infinite Scroll Loading
   ================================ */
.infinite-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-xl) 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.infinite-loader .spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: var(--space-sm);
}

/* ================================
   Search Results
   ================================ */
.search-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--space-md);
}

.search-results-count {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.search-clear-results {
    font-size: 0.875rem;
    color: var(--link);
    cursor: pointer;
}

.search-clear-results:hover {
    text-decoration: underline;
}

.no-results {
    text-align: center;
    padding: var(--space-2xl) 0;
    color: var(--text-muted);
}

.no-results p {
    margin-bottom: var(--space-sm);
}

/* ================================
   Time-Based Greeting
   ================================ */
.greeting {
    font-style: normal;
    transition: opacity var(--transition);
}

/* ================================
   Toast Notifications
   ================================ */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: var(--space-sm) var(--space-lg);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
    opacity: 0;
    transition: transform 300ms ease, opacity 300ms ease;
    pointer-events: none;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* ================================
   Tweet Button & Status
   ================================ */
.action-btn-tweet {
    background: #1da1f2;
    color: white;
}

.action-btn-tweet:hover {
    background: #1a91da;
}

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

.tweet-status-badge {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    background: rgba(29, 161, 242, 0.1);
    border: 1px solid rgba(29, 161, 242, 0.3);
    border-radius: 8px;
    margin: var(--space-md) 0;
}

.tweet-status-icon {
    color: #1da1f2;
    font-weight: bold;
}

.tweet-status-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.tweet-status-link {
    margin-left: auto;
    font-size: 0.875rem;
    color: #1da1f2;
    text-decoration: none;
}

.tweet-status-link:hover {
    text-decoration: underline;
}

/* ================================
   Sort Dropdown
   ================================ */
.sort-select {
    appearance: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px 24px 5px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 12 12'%3E%3Cpath fill='%2371717a' d='M3 4.5L6 7.5L9 4.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    transition: all 150ms ease;
}

.sort-select:hover {
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

.sort-select:focus {
    outline: none;
    border-color: var(--accent);
    color: var(--text-primary);
}

/* ================================
   Intro Text
   ================================ */
.intro-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: var(--space-xs);
    line-height: 1.4;
}

/* ================================
   Stats Bar
   ================================ */
.stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) 0;
    margin-bottom: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.stats-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.stats-value {
    font-weight: 600;
    color: var(--text-secondary);
}

.stats-divider {
    color: var(--border-color);
}

/* ================================
   Cached Data Indicator
   ================================ */
.cached-indicator {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-sm) var(--space-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-accent);
    border-radius: 6px;
}

.cached-time {
    font-weight: 500;
}

/* ================================
   About Page
   ================================ */
.about-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    z-index: 200;
    overflow-y: auto;
}

.about-page-content {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md) var(--space-2xl);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-sm) var(--space-md);
    margin-bottom: var(--space-xl);
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    transition: background var(--transition), color var(--transition);
}

.back-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.about-page h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.about-intro {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-xl);
}

.about-section {
    margin-bottom: var(--space-xl);
}

.about-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

.about-section p {
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    line-height: 1.7;
}

.odds-explainer {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin: var(--space-lg) 0;
}

.odds-example {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.odds-pct {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
    min-width: 70px;
}

.odds-text {
    color: var(--text-secondary);
}

.about-list {
    list-style: none;
    padding: 0;
}

.about-list li {
    padding: var(--space-sm) 0;
    padding-left: var(--space-lg);
    color: var(--text-secondary);
    position: relative;
}

.about-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
}

.disclaimer-section {
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.disclaimer-section h2 {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.disclaimer-section p {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ================================
   Vote Row
   ================================ */
.vote-row {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-top: var(--space-sm);
    padding-top: var(--space-sm);
    border-top: 1px solid var(--border-color);
}

.vote-prompt {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-right: auto;
}

.vote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-muted);
    transition: all 150ms ease;
    cursor: pointer;
    min-width: 60px;
    min-height: 36px;
    -webkit-tap-highlight-color: transparent;
}

.vote-btn:hover {
    border-color: var(--text-muted);
    color: var(--text-secondary);
}

.vote-btn.vote-up:hover {
    border-color: var(--positive);
    color: var(--positive);
    background: rgba(22, 163, 74, 0.08);
}

.vote-btn.vote-down:hover {
    border-color: var(--negative);
    color: var(--negative);
    background: rgba(220, 38, 38, 0.08);
}

.vote-btn.vote-up:active {
    background: rgba(22, 163, 74, 0.2);
    border-color: var(--positive);
    color: var(--positive);
    transform: scale(0.95);
}

.vote-btn.vote-down:active {
    background: rgba(220, 38, 38, 0.2);
    border-color: var(--negative);
    color: var(--negative);
    transform: scale(0.95);
}

.vote-btn.voted {
    font-weight: 600;
}

.vote-btn.vote-up.voted {
    background: rgba(22, 163, 74, 0.15);
    border-color: var(--positive);
    color: var(--positive);
}

.vote-btn.vote-down.voted {
    background: rgba(220, 38, 38, 0.15);
    border-color: var(--negative);
    color: var(--negative);
}

.vote-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-right: auto;
}

.crowd-odds {
    font-weight: 600;
    color: var(--text-secondary);
}

.crowd-diff {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 4px;
    border-radius: 3px;
}

.crowd-diff.crowd-higher {
    color: var(--positive);
    background: rgba(22, 163, 74, 0.1);
}

.crowd-diff.crowd-lower {
    color: var(--negative);
    background: rgba(220, 38, 38, 0.1);
}

.vote-total {
    color: var(--text-muted);
    font-size: 0.65rem;
}

.featured-vote {
    margin-top: var(--space-md);
}

.vote-arrow {
    font-weight: 700;
}

.vote-stats {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: var(--space-xs);
}

.vote-count {
    font-weight: 500;
    color: var(--text-secondary);
}

/* Tweet badge on story cards */
.tweet-badge {
    margin-left: var(--space-sm);
}

.tweet-badge .tweet-link {
    font-size: 0.65rem;
    font-weight: 600;
    color: #1da1f2;
    text-decoration: none;
    padding: 2px 6px;
    background: rgba(29, 161, 242, 0.1);
    border-radius: 4px;
    transition: all 150ms ease;
}

.tweet-badge .tweet-link:hover {
    background: rgba(29, 161, 242, 0.2);
    text-decoration: none;
}

@media (max-width: 480px) {
    .vote-row {
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .vote-label {
        width: 100%;
        margin-bottom: 2px;
    }

    .vote-btn {
        flex: 1;
        padding: 10px 16px;
        font-size: 0.85rem;
        min-height: 40px;
    }

    .vote-stats {
        width: 100%;
        margin-left: 0;
        margin-top: 4px;
        text-align: center;
    }
}

/* ================================
   Events Feed
   ================================ */
.events-feed {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Event Card */
.event-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    margin: 0 calc(var(--space-md) * -1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 150ms ease;
    -webkit-tap-highlight-color: transparent;
}

.event-card:hover {
    background: var(--bg-secondary);
    transform: translateX(2px);
}

.event-card:active {
    background: var(--bg-tertiary);
    transform: scale(0.995);
}

.event-number {
    flex-shrink: 0;
    width: 24px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
}

.event-body {
    flex: 1;
    min-width: 0;
}

.event-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-xs);
}

.event-headline {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.event-meta {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-wrap: wrap;
    margin-bottom: var(--space-sm);
}

.event-consensus {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

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

/* Source Breakdown */
.source-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-top: var(--space-sm);
}

.source-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
}

.source-chip .source-name {
    color: var(--text-muted);
    text-transform: capitalize;
}

.source-chip .source-prob {
    font-weight: 600;
    color: var(--text-primary);
}

/* Divergence Badge */
.divergence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
}

.divergence-badge.high {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.divergence-badge.medium {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.divergence-badge.low {
    background: rgba(34, 197, 94, 0.12);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.25);
}

/* Divergence Chart (in event modal) */
.divergence-chart {
    margin-top: var(--space-md);
    padding: var(--space-md);
    background: var(--bg-tertiary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.divergence-scale {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--border-color);
}

.divergence-scale .scale-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 35px;
}

.divergence-scale .scale-label:last-child {
    text-align: right;
}

.scale-line {
    flex: 1;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    position: relative;
}

.consensus-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    cursor: help;
}

.source-positions {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.source-position-item {
    display: grid;
    grid-template-columns: 80px 1fr 50px 55px;
    align-items: center;
    gap: var(--space-sm);
}

.source-position-item .source-name {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.source-position-item .source-name.polymarket { color: #6366f1; }
.source-position-item .source-name.kalshi { color: #f59e0b; }
.source-position-item .source-name.manifold { color: #22c55e; }
.source-position-item .source-name.metaculus { color: #3b82f6; }

.position-track {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    position: relative;
}

.position-marker {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--bg-secondary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    cursor: help;
}

.position-marker.polymarket { background: #6366f1; }
.position-marker.kalshi { background: #f59e0b; }
.position-marker.manifold { background: #22c55e; }
.position-marker.metaculus { background: #3b82f6; }

.source-position-item .source-prob {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

.diff-from-consensus {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    text-align: center;
}

.diff-from-consensus.higher {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.diff-from-consensus.lower {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

/* Event Source Link */
.event-source-link {
    display: inline-block;
    margin-top: var(--space-sm);
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--link);
    text-decoration: none;
    transition: color var(--transition);
}

.event-source-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

.event-source-link.featured-link {
    font-size: 0.9rem;
    margin-top: var(--space-md);
}

/* ================================
   Featured Event
   ================================ */
.featured-event {
    cursor: pointer;
    padding: var(--space-lg);
    margin: 0 calc(var(--space-md) * -1);
    border-radius: 16px;
    transition: background 150ms ease, transform 150ms ease;
    -webkit-tap-highlight-color: transparent;
    margin-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.featured-event:hover {
    background: var(--bg-secondary);
}

.featured-event:active {
    background: var(--bg-tertiary);
    transform: scale(0.995);
}

.featured-event .event-headline {
    font-size: 1.75rem;
    margin-bottom: var(--space-md);
}

/* ================================
   Event Modal
   ================================ */
.event-modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.event-detail {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    max-height: 90vh;
    background: var(--bg-secondary);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 300ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.2);
}

.event-content {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl) var(--space-md) var(--space-2xl);
}

.event-modal-header {
    margin-bottom: var(--space-lg);
}

.event-modal-title {
    font-family: var(--font-serif);
    font-size: 1.75rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
}

.event-modal-category {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Consensus Section */
.consensus-section {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.consensus-main {
    display: flex;
    align-items: baseline;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.consensus-value {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.consensus-label {
    font-size: 1rem;
    color: var(--text-secondary);
}

.consensus-bar {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: var(--space-md);
}

.consensus-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 4px;
    transition: width 500ms ease;
}

.consensus-details {
    display: flex;
    justify-content: space-between;
    margin-top: var(--space-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Markets Breakdown */
.markets-breakdown {
    margin-bottom: var(--space-lg);
}

.markets-breakdown-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-md);
}

.market-row {
    display: flex;
    align-items: center;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--border-color);
}

.market-row:last-child {
    border-bottom: none;
}

.market-source {
    flex: 0 0 90px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.market-prob-bar {
    flex: 1;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin: 0 var(--space-md);
}

.market-prob-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 300ms ease;
}

.market-prob-fill.polymarket {
    background: #6366f1;
}

.market-prob-fill.kalshi {
    background: #f59e0b;
}

.market-prob-fill.manifold {
    background: #22c55e;
}

.market-prob-fill.metaculus {
    background: #3b82f6;
}

.market-prob {
    flex: 0 0 50px;
    text-align: right;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.market-volume {
    flex: 0 0 80px;
    text-align: right;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Wiki Signals */
.wiki-section {
    background: var(--bg-tertiary);
    border-radius: 12px;
    padding: var(--space-md);
    margin-bottom: var(--space-lg);
}

.wiki-section-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: var(--space-sm);
}

.wiki-stats {
    display: flex;
    gap: var(--space-lg);
}

.wiki-stat {
    display: flex;
    flex-direction: column;
}

.wiki-stat-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.wiki-stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.wiki-spike-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-radius: 4px;
    margin-left: var(--space-sm);
}

/* Event Modal Actions */
.event-actions {
    display: flex;
    gap: var(--space-sm);
    margin-top: var(--space-lg);
}

/* ================================
   Alerts Section (in Events View)
   ================================ */
.alerts-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.alerts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-md);
}

.alerts-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

.alert-card {
    padding: var(--space-sm);
    margin-bottom: var(--space-sm);
    background: var(--bg-tertiary);
    border-radius: 8px;
    border-left: 3px solid var(--accent);
    cursor: pointer;
    transition: background 150ms ease;
}

.alert-card:hover {
    background: var(--bg-primary);
}

.alert-card:last-child {
    margin-bottom: 0;
}

.alert-type {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.alert-type.divergence {
    color: #ef4444;
}

.alert-type.convergence {
    color: #22c55e;
}

.alert-type.big_move {
    color: #f59e0b;
}

.alert-type.wiki_spike {
    color: #3b82f6;
}

.alert-type.attention_mismatch {
    color: #8b5cf6;
}

.alert-summary {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.alert-time {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.alert-acknowledge {
    font-size: 0.7rem;
    color: var(--text-muted);
    padding: 4px 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 150ms ease;
}

.alert-acknowledge:hover {
    background: var(--bg-primary);
    color: var(--text-secondary);
}

/* ================================
   Responsive - Events
   ================================ */
@media (min-width: 640px) {
    .event-detail {
        border-radius: 16px;
        max-height: 85vh;
        margin: auto;
    }

    .event-modal {
        align-items: center;
        padding: var(--space-lg);
    }

    .featured-event .event-headline {
        font-size: 2.25rem;
    }
}

@media (max-width: 480px) {
    .view-toggle {
        padding: var(--space-xs) var(--space-sm);
    }

    .view-btn {
        padding: 6px 16px;
        font-size: 0.75rem;
    }

    .event-headline {
        font-size: 1.0625rem;
    }

    .featured-event .event-headline {
        font-size: 1.5rem;
    }

    .event-card {
        padding: var(--space-sm) var(--space-md);
    }

    .event-number {
        width: 20px;
        font-size: 0.875rem;
    }

    .source-breakdown {
        gap: 4px;
    }

    .source-chip {
        padding: 2px 6px;
        font-size: 0.65rem;
    }

    .market-source {
        flex: 0 0 70px;
        font-size: 0.7rem;
    }

    .market-volume {
        display: none;
    }
}

