/**
 * iShareStuff / myDraft CMS — Modern Editorial & Intelligence Magazine Design System
 * @version 4.0.0
 */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&family=JetBrains+Mono:wght@400;500&display=swap');

/* ==========================================================================
   1. Design Tokens (Dual-Theme)
   ========================================================================== */
:root {
    /* Dark Theme (Default) */
    --bg-base: #090d16;
    --bg-surface: #111827;
    --bg-surface-elevated: #1e293b;
    --bg-glass: rgba(17, 24, 39, 0.78);
    --bg-glass-card: rgba(30, 41, 59, 0.55);
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-medium: rgba(255, 255, 255, 0.16);
    --border-focus: #6366f1;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --accent-brand: #6366f1;
    --accent-brand-hover: #4f46e5;
    --accent-brand-glow: rgba(99, 102, 241, 0.25);
    
    --accent-gold: #f59e0b;
    --accent-gold-glow: rgba(245, 158, 11, 0.2);
    
    --accent-emerald: #10b981;
    --accent-emerald-glow: rgba(16, 185, 129, 0.2);

    --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.35);
    --shadow-elevated: 0 10px 30px -5px rgba(0, 0, 0, 0.5);
    --shadow-dock: 0 12px 40px -8px rgba(0, 0, 0, 0.6);

    --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', monospace;

    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-full: 9999px;
}

[data-theme="light"] {
    --bg-base: #f8fafc;
    --bg-surface: #ffffff;
    --bg-surface-elevated: #f1f5f9;
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-card: rgba(255, 255, 255, 0.7);
    
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-medium: rgba(0, 0, 0, 0.14);
    --border-focus: #4f46e5;
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --accent-brand: #4f46e5;
    --accent-brand-hover: #4338ca;
    --accent-brand-glow: rgba(79, 70, 229, 0.15);

    --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
    --shadow-elevated: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
    --shadow-dock: 0 12px 40px -8px rgba(0, 0, 0, 0.15);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        --bg-base: #f8fafc;
        --bg-surface: #ffffff;
        --bg-surface-elevated: #f1f5f9;
        --bg-glass: rgba(255, 255, 255, 0.85);
        --bg-glass-card: rgba(255, 255, 255, 0.7);
        
        --border-subtle: rgba(0, 0, 0, 0.08);
        --border-medium: rgba(0, 0, 0, 0.14);
        --border-focus: #4f46e5;
        
        --text-primary: #0f172a;
        --text-secondary: #475569;
        --text-muted: #94a3b8;
        
        --accent-brand: #4f46e5;
        --accent-brand-hover: #4338ca;
        --accent-brand-glow: rgba(79, 70, 229, 0.15);

        --shadow-subtle: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
        --shadow-elevated: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
        --shadow-dock: 0 12px 40px -8px rgba(0, 0, 0, 0.15);
    }
}

/* ==========================================================================
   2. Base Styles & Micro-Typography
   ========================================================================== */
body {
    background-color: var(--bg-base);
    color: var(--text-primary);
    font-family: var(--font-sans);
    letter-spacing: -0.015em;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.25;
}

/* ==========================================================================
   3. Reading Progress Bar
   ========================================================================== */
#reading-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-brand), var(--accent-gold));
    z-index: 1050;
    transition: width 0.1s ease-out;
}

/* ==========================================================================
   4. Sticky Glass Navigation
   ========================================================================== */
.glass-nav {
    position: sticky;
    top: 0;
    z-index: 1030;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle);
    transition: all 0.25s ease;
}

.glass-nav.is-scrolled {
    box-shadow: var(--shadow-subtle);
    border-bottom-color: var(--border-medium);
}

.brand-logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.nav-search-trigger {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    padding: 0.45rem 1.1rem;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.nav-search-trigger:hover {
    border-color: var(--accent-brand);
    color: var(--text-primary);
    box-shadow: 0 0 0 3px var(--accent-brand-glow);
}

.kbd-shortcut {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.725rem;
    padding: 0.15rem 0.4rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   5. Live Trending Ticker Bar
   ========================================================================== */
.trending-ticker-bar {
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    padding: 0.45rem 0;
    font-size: 0.825rem;
}

.ticker-pulse {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--accent-emerald);
    border-radius: 50%;
    margin-right: 6px;
    box-shadow: 0 0 0 0 var(--accent-emerald-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 var(--accent-emerald-glow); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.ticker-item-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.15s ease;
    white-space: nowrap;
}

.ticker-item-link:hover {
    color: var(--accent-brand);
}

/* ==========================================================================
   6. Editorial Cards & Grids
   ========================================================================== */
.editorial-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.editorial-card:hover {
    transform: translateY(-3px);
    border-color: var(--border-medium);
    box-shadow: var(--shadow-subtle);
}

.editorial-card-img {
    aspect-ratio: 16 / 9;
    width: 100%;
    object-fit: cover;
    background-color: var(--bg-surface-elevated);
}

.editorial-tag {
    background: rgba(99, 102, 241, 0.12);
    color: var(--accent-brand);
    border: 1px solid rgba(99, 102, 241, 0.25);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    display: inline-block;
}

.lead-story-card {
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
    box-shadow: var(--shadow-elevated);
}

/* ==========================================================================
   7. AI Summary Copilot Card
   ========================================================================== */
.ai-summary-card {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(245, 158, 11, 0.04));
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin: 1.5rem 0 2rem 0;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    color: var(--accent-brand);
    font-size: 0.95rem;
    cursor: pointer;
}

/* ==========================================================================
   8. Floating Smart Dock
   ========================================================================== */
.floating-smart-dock {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    box-shadow: var(--shadow-dock);
    z-index: 1040;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
}

.floating-smart-dock.is-visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.dock-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 0.45rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dock-btn:hover {
    color: var(--text-primary);
    background: var(--bg-surface-elevated);
}

.dock-btn.is-active {
    color: var(--accent-brand);
    background: var(--accent-brand-glow);
}

.dock-divider {
    width: 1px;
    height: 20px;
    background: var(--border-subtle);
}

/* ==========================================================================
   9. Newsletter Conversion Callout (60% Scroll)
   ========================================================================== */
.newsletter-conversion-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 3rem 0;
    box-shadow: var(--shadow-elevated);
    position: relative;
    overflow: hidden;
}

.newsletter-conversion-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-brand), var(--accent-gold));
}

/* ==========================================================================
   10. Command Palette Modal (Ctrl+K)
   ========================================================================== */
.command-palette-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.command-palette-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.command-palette-modal {
    background: var(--bg-surface);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-md);
    width: 100%;
    max-width: 640px;
    box-shadow: var(--shadow-dock);
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.command-palette-backdrop.is-open .command-palette-modal {
    transform: scale(1);
}

.command-search-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1rem 1.25rem;
    font-size: 1.1rem;
    color: var(--text-primary);
    outline: none;
    font-family: var(--font-sans);
}

.command-results-list {
    max-height: 360px;
    overflow-y: auto;
    padding: 0.5rem;
}

.command-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.command-result-item:hover, .command-result-item.is-selected {
    background: var(--bg-surface-elevated);
    color: var(--accent-brand);
}

/* ==========================================================================
   11. Toast Notifications
   ========================================================================== */
#isharestuff-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--bg-surface-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border-medium);
    border-radius: var(--radius-full);
    padding: 0.6rem 1.25rem;
    box-shadow: var(--shadow-elevated);
    font-size: 0.875rem;
    font-weight: 600;
    z-index: 3000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}

#isharestuff-toast.show {
    transform: translateY(0);
    opacity: 1;
}

/* ==========================================================================
   12. Hero Canvas & 7:5 Split Grid
   ========================================================================== */
.editorial-hero-section {
    margin-bottom: 2.5rem;
}

.lead-story-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-elevated);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.lead-story-card:hover {
    border-color: var(--border-medium);
}

.lead-img-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    width: 100%;
    overflow: hidden;
    background-color: var(--bg-surface-elevated);
}

.lead-story-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.lead-story-card:hover .lead-story-img {
    transform: scale(1.02);
}

.lead-content {
    background: linear-gradient(180deg, transparent, var(--bg-surface));
}

.lead-text {
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Trending Story Stack */
.trending-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stack-item-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    flex: 1;
}

.stack-item-card:hover {
    background: var(--bg-surface-elevated);
    border-color: var(--border-medium);
    transform: translateX(3px);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.rank-badge-1 { background: rgba(245, 158, 11, 0.15); color: var(--accent-gold); border: 1px solid rgba(245, 158, 11, 0.3); }
.rank-badge-2 { background: rgba(99, 102, 241, 0.15); color: var(--accent-brand); border: 1px solid rgba(99, 102, 241, 0.3); }
.rank-badge-3 { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid rgba(16, 185, 129, 0.3); }

/* Topic Filter Bar */
.topic-filter-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.75rem 0;
    margin: 2rem 0 1.5rem 0;
    scrollbar-width: none;
}

.topic-filter-bar::-webkit-scrollbar {
    display: none;
}

.topic-filter-pill {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    padding: 0.45rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    text-decoration: none;
}

.topic-filter-pill:hover {
    color: var(--text-primary);
    border-color: var(--border-medium);
}

.topic-filter-pill.is-active {
    background: var(--accent-brand);
    color: #ffffff;
    border-color: var(--accent-brand);
    box-shadow: 0 0 15px var(--accent-brand-glow);
}

/* ==========================================================================
   13. Live Social Proof & Floating Reaction Particles
   ========================================================================== */
.live-reader-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-emerald);
    border: 1px solid rgba(16, 185, 129, 0.25);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-full);
    font-size: 0.775rem;
    font-weight: 600;
}

.floating-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    font-size: 1.5rem;
    animation: floatUpParticle 1.2s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes floatUpParticle {
    0% {
        transform: translate(0, 0) scale(0.6);
        opacity: 1;
    }
    50% {
        transform: translate(var(--tx, 0px), -60px) scale(1.25);
        opacity: 0.95;
    }
    100% {
        transform: translate(var(--tx2, 0px), -130px) scale(0.8);
        opacity: 0;
    }
}

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-gold);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.streak-badge:hover {
    background: rgba(245, 158, 11, 0.2);
    transform: scale(1.04);
}

/* ==========================================================================
   14. Interactive AI Copilot Drawer (Slide-Out)
   ========================================================================== */
.ai-copilot-floating-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: linear-gradient(135deg, var(--accent-brand), #4338ca);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-full);
    padding: 0.65rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 8px 25px var(--accent-brand-glow);
    z-index: 1045;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-copilot-floating-btn:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 30px var(--accent-brand-glow);
}

.ai-copilot-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 2050;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ai-copilot-drawer-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.ai-copilot-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 440px;
    background: var(--bg-glass);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-left: 1px solid var(--border-medium);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5);
    z-index: 2060;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.ai-copilot-drawer-backdrop.is-open .ai-copilot-drawer {
    transform: translateX(0);
}

.ai-drawer-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-surface);
}

.ai-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-quick-chips-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.ai-quick-chip {
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    padding: 0.35rem 0.75rem;
    font-size: 0.775rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.ai-quick-chip:hover {
    background: var(--accent-brand);
    color: #ffffff;
    border-color: var(--accent-brand);
}

.ai-message-bubble {
    padding: 1rem 1.15rem;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    line-height: 1.55;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
}

.ai-message-bubble.ai-reply {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.25);
    color: var(--text-primary);
}

.ai-drawer-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-surface);
}

.ai-input-wrapper {
    display: flex;
    gap: 0.5rem;
}

.ai-prompt-input {
    flex: 1;
    background: var(--bg-surface-elevated);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    outline: none;
}

.ai-prompt-input:focus {
    border-color: var(--accent-brand);
    box-shadow: 0 0 0 2px var(--accent-brand-glow);
}

/* ==========================================================================
   15. Mobile Edge-to-Edge & Vertical Thumb-Zone Dock
   ========================================================================== */
.mobile-story-card {
    min-height: 100svh;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    padding: 1.5rem;
    padding-bottom: calc(85px + env(safe-area-inset-bottom));
}

.mobile-thumb-dock {
    position: fixed;
    right: 14px;
    bottom: calc(85px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    z-index: 1040;
}

.mobile-thumb-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(17, 24, 39, 0.82);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    color: #f8fafc;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.mobile-thumb-btn:active {
    transform: scale(0.88);
}

.mobile-thumb-btn.is-active {
    background: var(--accent-brand);
    color: #ffffff;
    border-color: var(--accent-brand);
    box-shadow: 0 0 15px var(--accent-brand-glow);
}

.mobile-thumb-badge {
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 1px;
    line-height: 1;
}

/* TTS Floating Waveform Bar */
.mobile-tts-bar {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: calc(75px + env(safe-area-inset-bottom));
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(99, 102, 241, 0.35);
    border-radius: var(--radius-full);
    padding: 0.6rem 1.15rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1035;
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.55);
    transform: translateY(140px);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-tts-bar.is-active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.waveform-bars {
    display: flex;
    align-items: center;
    gap: 3px;
    height: 20px;
}

.waveform-bar {
    width: 3px;
    background: var(--accent-brand);
    border-radius: 2px;
    height: 4px;
    transition: height 0.2s ease;
}

.mobile-tts-bar.is-playing .waveform-bar {
    animation: wavePulse 0.9s ease-in-out infinite alternate;
}

.mobile-tts-bar.is-playing .waveform-bar:nth-child(2) { animation-delay: 0.15s; }
.mobile-tts-bar.is-playing .waveform-bar:nth-child(3) { animation-delay: 0.3s; }
.mobile-tts-bar.is-playing .waveform-bar:nth-child(4) { animation-delay: 0.45s; }

@keyframes wavePulse {
    0% { height: 4px; }
    100% { height: 20px; }
}

/* PWA Install BottomSheet */
.mobile-pwa-bottomsheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 2100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    display: flex;
    align-items: flex-end;
}

.mobile-pwa-bottomsheet-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.mobile-pwa-bottomsheet {
    width: 100%;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-medium);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 1.5rem;
    padding-bottom: calc(1.5rem + env(safe-area-inset-bottom));
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.6);
}

.mobile-pwa-bottomsheet-backdrop.is-open .mobile-pwa-bottomsheet {
    transform: translateY(0);
}

/* ==========================================================================
   16. Mobile Swipe-to-Next-Story Gesture & Peek Indicator
   ========================================================================== */
.article-main-content {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    will-change: transform, opacity;
}

.swipe-peek-indicator {
    position: fixed;
    top: 45%;
    right: 16px;
    transform: translateY(-50%) translateX(140px);
    background: rgba(17, 24, 39, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(99, 102, 241, 0.45);
    border-radius: var(--radius-full);
    padding: 0.65rem 1.15rem;
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2000;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
    opacity: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.swipe-peek-indicator.is-visible {
    transform: translateY(-50%) translateX(0);
    opacity: 1;
}

#next-article-buffer {
    display: none;
}

/* ==========================================================================
   17. TSecurity (tsecurity.de) Cyber Brand Identity & SOC Theme
   ========================================================================== */
[data-tenant="tsecurity"], .is-tsecurity {
    --accent-brand: #06b6d4;
    --accent-brand-hover: #0891b2;
    --accent-brand-glow: rgba(6, 182, 212, 0.38);
    --accent-cyber-green: #10b981;
    --accent-critical-red: #ef4444;
    --bg-base: #050811;
    --bg-surface: #0a1122;
    --bg-surface-elevated: #0f1a30;
    --border-subtle: rgba(6, 182, 212, 0.16);
    --border-medium: rgba(6, 182, 212, 0.32);
}

/* Zero-Day Emergency Top Alert Bar */
.zeroday-alert-bar {
    background: linear-gradient(90deg, #991b1b 0%, #dc2626 50%, #991b1b 100%);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 800;
    padding: 0.45rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    letter-spacing: 0.04em;
    animation: alertPulse 2.2s infinite ease-in-out;
    box-shadow: 0 2px 15px rgba(220, 38, 38, 0.5);
    z-index: 1050;
}

@keyframes alertPulse {
    0%, 100% { opacity: 1; filter: brightness(1); }
    50% { opacity: 0.88; filter: brightness(1.2); }
}

/* SOC Threat Level Badge */
.soc-threat-level-badge {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.45);
    color: #f87171;
    font-family: 'JetBrains Mono', monospace, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    letter-spacing: 0.05em;
}

.soc-threat-dot {
    width: 7px;
    height: 7px;
    background: #ef4444;
    border-radius: 50%;
    animation: pulseDot 1.2s infinite;
}

/* TSecurity CVSS Score Pill */
.cvss-score-pill {
    font-family: 'JetBrains Mono', monospace, monospace;
    font-weight: 800;
    padding: 0.2rem 0.55rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
}

.cvss-score-pill.is-critical {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #fca5a5;
}

.cvss-score-pill.is-high {
    background: rgba(245, 158, 11, 0.2);
    border: 1px solid #f59e0b;
    color: #fcd34d;
}

/* SOC Radar Sweep Animation */
.soc-radar-container {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 1px solid rgba(6, 182, 212, 0.4);
    position: relative;
    overflow: hidden;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15) 0%, rgba(5, 8, 17, 0.85) 70%);
    flex-shrink: 0;
}

.soc-radar-sweep {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: conic-gradient(from 0deg at 50% 50%, rgba(6, 182, 212, 0) 0deg, rgba(6, 182, 212, 0.6) 360deg);
    border-radius: 50%;
    animation: radarSpin 3.2s linear infinite;
}

.soc-radar-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    box-shadow: 0 0 8px #ef4444;
    animation: pulseDot 1s infinite alternate;
}

@keyframes radarSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Terminal Monospace Mode */
body.terminal-mode {
    --bg-base: #000000 !important;
    --bg-surface: #040d09 !important;
    --bg-surface-elevated: #06140e !important;
    --accent-brand: #10b981 !important;
    --accent-brand-glow: rgba(16, 185, 129, 0.4) !important;
    font-family: 'JetBrains Mono', 'Courier New', monospace !important;
}

body.terminal-mode .article-title, 
body.terminal-mode h1, 
body.terminal-mode h2, 
body.terminal-mode h3 {
    font-family: 'JetBrains Mono', monospace !important;
    letter-spacing: -0.01em;
}

/* Terminal Mode FAB */
.terminal-mode-fab {
    position: fixed;
    left: 14px;
    bottom: calc(85px + env(safe-area-inset-bottom));
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    background: rgba(5, 8, 17, 0.85);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--accent-brand);
    color: var(--accent-brand);
    font-family: 'JetBrains Mono', monospace;
    font-weight: 800;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1040;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.terminal-mode-fab:active {
    transform: scale(0.9);
}

.terminal-mode-fab.is-active {
    background: #10b981;
    color: #000000;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.6);
}

/* CVE 3-Tab Accordion */
.cve-accordion-nav {
    display: flex;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-medium);
    padding-bottom: 0.5rem;
    margin-bottom: 0.75rem;
}

.cve-accordion-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.cve-accordion-btn.is-active {
    color: var(--accent-brand);
    background: rgba(6, 182, 212, 0.12);
}

.cve-accordion-pane {
    display: none;
    font-size: 0.85rem;
    line-height: 1.5;
}

.cve-accordion-pane.is-active {
    display: block;
}

/* ==========================================================================
   Universal Theme Components (Dual-Theme: Light / Dark / System)
   ========================================================================== */
.theme-modal-content {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-medium) !important;
    box-shadow: var(--shadow-elevated) !important;
}

.theme-modal-header {
    background-color: var(--bg-surface-elevated) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
}

.theme-input,
.theme-select,
.theme-textarea {
    background-color: var(--bg-surface-elevated) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-medium) !important;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.theme-input:focus,
.theme-select:focus,
.theme-textarea:focus {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border-color: var(--accent-brand) !important;
    box-shadow: 0 0 0 3px var(--accent-brand-glow) !important;
}

.theme-input::placeholder,
.theme-textarea::placeholder {
    color: var(--text-muted) !important;
}

.theme-card {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-subtle) !important;
    box-shadow: var(--shadow-subtle) !important;
}

.theme-card-subtle {
    background-color: var(--bg-surface-elevated) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-subtle) !important;
}

.theme-offcanvas {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border-color: var(--border-subtle) !important;
}

.theme-toast {
    background-color: var(--bg-surface) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-medium) !important;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

[data-theme="light"] .text-light-adaptive {
    color: var(--text-primary) !important;
}
[data-theme="dark"] .text-light-adaptive {
    color: #ffffff !important;
}

[data-theme="light"] .btn-close-adaptive {
    filter: none;
}
[data-theme="dark"] .btn-close-adaptive {
    filter: invert(1) grayscale(100%);
}
