/* ==============================================================================
   SRISHTY PLATFORM DESIGN SYSTEM — CLEAN EDITORIAL MINIMALISM
   "Your Stories, Amplified."
   ============================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800;900&family=Merriweather:ital,wght@0,300;0,400;0,700;1,300;1,400&family=Noto+Serif+Malayalam:wght@400;600;700&family=Gayathri:wght@400;700&family=Manjari:wght@400;700&display=swap');

:root {
    /* -------------------------------------------------------------------------
       1. Brand Palette
       ------------------------------------------------------------------------- */
    --purple: #5B3FD4;
    --purple-hover: #4B32B5;
    --purple-light: #795cf0;
    --purple-dark: #4329b8;
    --purple-light-bg: #F0EDFF;
    --purple-glow: rgba(91, 63, 212, 0.12);

    --teal: #14B8A6;
    --teal-hover: #0d9488;
    --teal-light: #2dd4bf;
    --teal-glow: rgba(20, 184, 166, 0.12);

    --gold: #D4AF37;
    --gold-light: #f3cf65;
    --gold-glow: rgba(212, 175, 55, 0.12);

    /* -------------------------------------------------------------------------
       2. Light Interface Surfaces
       ------------------------------------------------------------------------- */
    --light-bg-base: #F8F8FC;
    --light-bg-surface: #FFFFFF;
    --light-bg-secondary: #F2F2F7;
    --light-text-primary: #191827;
    --light-text-secondary: #6B6A7A;
    --light-border: #E8E7EF;
    --light-border-hover: #D5D3E2;
    --light-text-disabled: #A5A4B2;

    /* -------------------------------------------------------------------------
       3. Dark Interface Surfaces (Default Platform Canvas)
       ------------------------------------------------------------------------- */
    --dark-bg-base: #111019;
    --dark-bg-surface: #191724;
    --dark-bg-elevated: #211E2E;
    --dark-text-primary: #F7F6FC;
    --dark-text-secondary: #B2AFC2;
    --dark-border: #302C40;
    --dark-border-hover: #45405A;

    /* -------------------------------------------------------------------------
       4. Active Platform Surface Mapping
       ------------------------------------------------------------------------- */
    --bg-base: var(--dark-bg-base);
    --bg-surface: var(--dark-bg-surface);
    --bg-card: var(--dark-bg-elevated);
    --bg-card-hover: #292539;
    --bg-glass: var(--dark-bg-surface);
    --border: var(--dark-border);
    --border-hover: var(--dark-border-hover);
    --border-highlight: var(--purple);

    /* -------------------------------------------------------------------------
       5. Text Hierarchy
       ------------------------------------------------------------------------- */
    --text-main: var(--dark-text-primary);
    --text-muted: var(--dark-text-secondary);
    --text-dim: #7E7B8E;
    --white: #FFFFFF;
    --white-soft: #F7F6FC;

    /* -------------------------------------------------------------------------
       6. Reader Themes (Comfortable Distraction-Free Modes)
       ------------------------------------------------------------------------- */
    --reader-dark-bg: #111019;
    --reader-dark-text: #F7F6FC;
    --reader-light-bg: #FAFAFA;
    --reader-light-text: #18181B;
    --reader-sepia-bg: #F5EEDB;
    --reader-sepia-text: #38291A;

    /* -------------------------------------------------------------------------
       7. Status Colors
       ------------------------------------------------------------------------- */
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --info: #3B82F6;

    /* -------------------------------------------------------------------------
       8. Typography Scale & Fonts
       ------------------------------------------------------------------------- */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-serif: 'Merriweather', Georgia, serif;
    --font-malayalam-serif: 'Noto Serif Malayalam', 'Merriweather', serif;
    --font-malayalam-sans: 'Gayathri', 'Manjari', sans-serif;

    /* -------------------------------------------------------------------------
       9. Spacing Scale (Based on 4px increments)
       ------------------------------------------------------------------------- */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;

    /* -------------------------------------------------------------------------
       10. Layout Dimensions & Corner Radii (Clean, Restrained)
       ------------------------------------------------------------------------- */
    --sidebar-width: 240px;
    --navbar-height: 64px;
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;

    /* -------------------------------------------------------------------------
       11. Shadows (Restrained, subtle, no heavy colored glows)
       ------------------------------------------------------------------------- */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 24px rgba(0, 0, 0, 0.35);

    /* -------------------------------------------------------------------------
       12. Transitions (Short & Snappy: 120ms - 200ms)
       ------------------------------------------------------------------------- */
    --transition-fast: 120ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 180ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    letter-spacing: -0.015em;
    font-weight: 700;
    color: var(--white);
    line-height: 1.25;
}

a {
    color: inherit;
    text-decoration: none;
}

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

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

/* Reduced Motion Preference Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Accessible focus ring */
:focus-visible {
    outline: 2px solid var(--purple);
    outline-offset: 2px;
}

/* Clean Solid Surface utilities (replacing heavy glassmorphism) */
.glass {
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition-base), transform var(--transition-base);
}

.glass-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

/* Restrained highlight tints (replacing neon glows) */
.glow-purple {
    box-shadow: 0 0 0 1px rgba(91, 63, 212, 0.4);
}

.glow-teal {
    box-shadow: 0 0 0 1px rgba(20, 184, 166, 0.4);
}

/* Standard Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==============================================================================
   BUTTONS & BADGES
   ============================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
    line-height: 1.2;
}

.btn-primary {
    background: var(--purple);
    color: var(--white);
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: var(--purple-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.btn-teal {
    background: var(--teal);
    color: #ffffff;
    font-weight: 600;
    border: 1px solid transparent;
    box-shadow: var(--shadow-sm);
}

.btn-teal:hover {
    background: var(--teal-hover);
    transform: translateY(-1px);
}

.btn-ghost {
    color: var(--text-muted);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
}

.btn-ghost:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.06);
}

.btn-sm {
    padding: 6px 14px;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    border-radius: var(--radius-md);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
    background: var(--danger);
    color: var(--white);
    border-color: var(--danger);
}

.btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    background: #ffffff;
    color: #1f1f1f;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 600;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.btn-google:hover {
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-google:active {
    transform: translateY(0);
}

.google-icon {
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 18px 0;
    color: var(--text-dim);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border);
}

.auth-divider span {
    padding: 0 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-purple {
    background: rgba(91, 63, 212, 0.15);
    color: #c4b5fd;
    border: 1px solid rgba(91, 63, 212, 0.3);
}

.badge-teal {
    background: rgba(20, 184, 166, 0.15);
    color: var(--teal-light);
    border: 1px solid rgba(20, 184, 166, 0.3);
}

.badge-gold {
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.badge-gray {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* ==============================================================================
   PUBLIC LANDING PAGE
   ============================================================================== */
#public-landing-view {
    position: relative;
    overflow-x: hidden;
}

/* Landing Navigation */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    z-index: 1000;
    transition: background-color var(--transition-base), border-color var(--transition-base);
    background: rgba(17, 16, 25, 0.95);
    border-bottom: 1px solid var(--border);
}

.landing-nav.scrolled {
    background: #111019;
    box-shadow: var(--shadow-sm);
}

.landing-nav-inner {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo-img {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
}

.brand-title {
    font-family: var(--font-heading);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--white);
}

.landing-links {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}

.landing-link {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.landing-link:hover {
    color: var(--white);
}

.landing-nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Mobile Nav Toggle */
.mobile-menu-btn {
    display: none;
    font-size: 1.35rem;
    color: var(--text-main);
    padding: 6px;
}

/* ==============================================================================
   HERO SECTION (CLEAN EDITORIAL MINIMALISM)
   ============================================================================== */
.hero-section {
    position: relative;
    padding: 100px 0 60px;
    min-height: auto;
    display: flex;
    align-items: center;
    background: var(--bg-base);
    overflow: hidden;
}

/* Disable distracting neon glows */
.hero-glow-1,
.hero-glow-2,
.stage-aura {
    display: none !important;
}

.hero-container {
    position: relative;
    z-index: 1;
    width: 100%;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 48px;
    align-items: center;
}

/* Left Column: Typography & CTAs */
.hero-left {
    text-align: left;
}

.hero-tagline-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    background: rgba(91, 63, 212, 0.12);
    border: 1px solid rgba(91, 63, 212, 0.3);
    color: #c4b5fd;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.hero-tagline-pill .dot {
    width: 6px;
    height: 6px;
    background: var(--teal);
    border-radius: 50%;
}

.hero-headline {
    font-size: clamp(2.2rem, 4.5vw, 3.2rem);
    line-height: 1.18;
    margin-bottom: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--white);
}

.hero-headline .highlight-gradient {
    color: #A78BFA;
    background: none;
    -webkit-text-fill-color: initial;
}

.hero-subtext {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 540px;
    margin-bottom: 28px;
}

.hero-ctas {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

/* Clean Editorial Trending Pill */
.hero-ambient-ribbon {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
    user-select: none;
    box-shadow: var(--shadow-sm);
    max-width: 100%;
}

.hero-ambient-ribbon:hover {
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.ribbon-glow-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--teal);
    flex-shrink: 0;
}

.ribbon-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--teal);
    background: rgba(20, 184, 166, 0.12);
    padding: 2px 7px;
    border-radius: var(--radius-xs);
}

.ribbon-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.ribbon-stat {
    font-size: 0.78rem;
    color: var(--text-dim);
    white-space: nowrap;
}

.ribbon-arrow {
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: transform var(--transition-fast);
}

.hero-ambient-ribbon:hover .ribbon-arrow {
    transform: translateX(3px);
    color: var(--teal-light);
}

/* Right Column: Clean Book Showcase */
.hero-right {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-visual-stage {
    position: relative;
    width: 100%;
    max-width: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

/* Upright Clean Book Presentation (No 3D Skew / Rotation) */
.stage-book-card {
    position: relative;
    z-index: 2;
    cursor: pointer;
}

.stage-book-wrap {
    position: relative;
    width: 210px;
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    transform: none !important;
    perspective: none !important;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    box-shadow: var(--shadow-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    overflow: hidden;
}

.stage-book-card:hover .stage-book-wrap {
    transform: translateY(-4px) !important;
    border-color: var(--border-hover);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.45) !important;
}

.stage-book-spine {
    display: none;
}

.stage-book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stage-book-glare {
    display: none;
}

/* Floating Clean Badges (Static & Refined) */
.floating-badge.badge-audio {
    position: absolute;
    top: 15px;
    left: -10px;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    animation: none !important;
}

.badge-audio .badge-icon {
    font-size: 1.1rem;
}

.badge-audio .badge-text {
    display: flex;
    flex-direction: column;
    text-align: left;
    line-height: 1.2;
}

.badge-audio strong {
    font-size: 0.8rem;
    color: var(--white);
    font-weight: 700;
}

.badge-audio small {
    font-size: 0.68rem;
    color: var(--teal);
}

/* Floating Clean Reader Info Card */
.floating-reader-card {
    position: absolute;
    bottom: 5px;
    right: -15px;
    z-index: 4;
    width: 240px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    text-align: left;
    cursor: pointer;
    transition: border-color var(--transition-base), transform var(--transition-base);
    animation: none !important;
}

.floating-reader-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

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

.reader-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    font-weight: 700;
    color: #c4b5fd;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.reader-pill .live-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--teal);
}

.rating-pill {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
}

.reader-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.reader-desc {
    font-size: 0.74rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.reader-footer {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reader-progress-track {
    flex: 1;
    height: 4px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.reader-progress-fill {
    height: 100%;
    width: 78%;
    background: var(--teal);
    border-radius: var(--radius-full);
}

.reader-count {
    font-size: 0.7rem;
    color: var(--text-dim);
    white-space: nowrap;
}

/* Mobile & Tablet Adjustments for Hero */
@media (max-width: 992px) {
    .hero-section {
        padding: 90px 0 50px;
    }
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 36px;
        text-align: center;
    }
    .hero-left {
        text-align: center;
    }
    .hero-subtext {
        margin: 0 auto 24px;
    }
    .hero-ctas {
        justify-content: center;
    }
    .hero-ambient-ribbon {
        margin: 0 auto;
    }
    .hero-visual-stage {
        padding: 10px 0;
    }
    .stage-book-wrap {
        width: 180px;
    }
    .floating-reader-card {
        right: 0;
        bottom: 0;
        width: 220px;
    }
    .floating-badge.badge-audio {
        left: 0;
    }
}

@media (max-width: 576px) {
    .hero-ambient-ribbon {
        flex-wrap: wrap;
        justify-content: center;
        border-radius: var(--radius-sm);
        padding: 8px 12px;
        gap: 6px;
    }
    .ribbon-stat {
        display: none;
    }
    .stage-book-wrap {
        width: 150px;
    }
    .floating-reader-card {
        width: 190px;
        padding: 10px 12px;
    }
    .reader-desc {
        display: none;
    }
}

/* Section Common Styling */
.section-pad {
    padding: 72px 0;
    position: relative;
}

.section-header {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 48px;
}

.section-label {
    display: inline-block;
    color: var(--teal);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.section-title {
    font-size: clamp(1.8rem, 3.5vw, 2.4rem);
    line-height: 1.25;
    margin-bottom: 14px;
    color: var(--white);
}

.section-desc {
    color: var(--text-muted);
    font-size: 0.98rem;
    line-height: 1.6;
}

/* About Section */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 16px;
    line-height: 1.3;
}

.about-text p {
    color: var(--text-muted);
    font-size: 0.98rem;
    margin-bottom: 16px;
    line-height: 1.65;
}

.about-quote-box {
    padding: 20px 24px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border-left: 3px solid var(--purple);
    border: 1px solid var(--border);
    border-left: 3px solid var(--purple);
    margin-top: 24px;
}

.about-quote-box p {
    font-style: italic;
    color: var(--white);
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.about-quote-box span {
    color: var(--teal);
    font-size: 0.85rem;
    font-weight: 600;
}

.about-pillars {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.pillar-card {
    padding: 22px 20px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: border-color var(--transition-base), transform var(--transition-base);
}

.pillar-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}

.pillar-icon {
    font-size: 1.6rem;
    margin-bottom: 12px;
    display: inline-block;
}

.pillar-card h4 {
    font-size: 1.1rem;
    margin-bottom: 6px;
}

.pillar-card p {
    font-size: 0.86rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Features Section */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.feature-card {
    padding: 28px 24px;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: border-color var(--transition-base), transform var(--transition-base);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    display: none;
}

.feature-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.feature-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: rgba(91, 63, 212, 0.12);
    border: 1px solid rgba(91, 63, 212, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 18px;
}

.feature-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    flex-grow: 1;
}

.feature-perk {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--teal-light);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* For Writers Journey */
.writers-journey {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-top: 32px;
    position: relative;
}

.step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px 16px;
    text-align: center;
    position: relative;
    transition: border-color var(--transition-base), transform var(--transition-base);
}

.step-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--purple);
    color: var(--white);
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
}

.step-card h4 {
    font-size: 1.05rem;
    margin-bottom: 8px;
}

.step-card p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.45;
}

/* Download Section */
.download-box {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 44px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.download-info h3 {
    font-size: 1.85rem;
    margin-bottom: 12px;
}

.download-info p {
    color: var(--text-muted);
    font-size: 0.98rem;
    max-width: 480px;
    margin-bottom: 22px;
    line-height: 1.6;
}

.download-badges {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    padding: 10px 18px;
    border-radius: var(--radius-md);
    color: var(--white);
    transition: background-color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.store-btn:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: var(--border-hover);
    transform: translateY(-1px);
}

.store-btn-icon {
    font-size: 1.5rem;
}

.store-btn-text small {
    display: block;
    font-size: 0.68rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.store-btn-text strong {
    font-size: 0.92rem;
    font-weight: 700;
}

.store-badge-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-style: dashed;
}

.store-badge-disabled:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.05);
}

/* Footer */
.landing-footer {
    border-top: 1px solid var(--border);
    padding: 60px 0 32px;
    background: #0c0b14;
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 40px;
    margin-bottom: 48px;
}

.footer-brand p {
    color: var(--text-muted);
    font-size: 0.9rem;
    max-width: 320px;
    margin: 14px 0 18px;
    line-height: 1.6;
}

.footer-col h5 {
    font-size: 0.95rem;
    margin-bottom: 16px;
    color: var(--white);
}

.footer-col ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col a {
    color: var(--text-muted);
    font-size: 0.88rem;
    transition: color var(--transition-fast);
}

.footer-col a:hover {
    color: var(--white);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    color: var(--text-dim);
    font-size: 0.82rem;
}

/* ==============================================================================
   LOGGED-IN PLATFORM SHELL
   ============================================================================== */
#app-view {
    display: flex;
    min-height: 100vh;
    background: var(--bg-base);
}

/* Desktop Sidebar */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 500;
    transition: transform var(--transition-smooth);
}

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

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.nav-item:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #c4b5fd;
    background: rgba(91, 63, 212, 0.12);
    border-left: 3px solid var(--purple);
    font-weight: 600;
}

.nav-item .nav-icon {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}

.sidebar-footer {
    padding: 16px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-profile-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
}

.avatar-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--purple);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
    overflow: hidden;
    flex-shrink: 0;
}

.avatar-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-meta {
    flex: 1;
    min-width: 0;
}

.user-meta .username {
    display: block;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-meta .user-role {
    display: block;
    font-size: 0.72rem;
    color: var(--teal);
    text-transform: capitalize;
}

/* App Main Content Area */
.app-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-topbar {
    height: var(--navbar-height);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 400;
}

.app-topbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--white);
}

.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-content {
    flex: 1;
    padding: 24px;
}

/* Mobile Bottom Navigation */
.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border);
    z-index: 900;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 6px 12px;
    min-height: 44px;
}

.mobile-nav-item.active {
    color: #c4b5fd;
    font-weight: 600;
}

.mobile-nav-item .icon {
    font-size: 1.15rem;
}

/* ==============================================================================
   DISCOVER VIEW & BOOK CATALOG
   ============================================================================== */
.discover-hero {
    margin-bottom: 24px;
    text-align: center;
}

.discover-hero h2 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.discover-hero p {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 16px;
    max-width: 580px;
    margin-left: auto;
    margin-right: auto;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-dim);
    font-size: 1rem;
    pointer-events: none;
}

.search-input-wrapper input {
    width: 100%;
    height: 42px;
    padding: 0 16px 0 42px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--white);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

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

.search-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.category-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.pill-btn {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    transition: background-color var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.pill-btn:hover {
    color: var(--white);
    border-color: var(--border-hover);
}

.pill-btn.active {
    background: var(--purple);
    color: var(--white);
    border-color: var(--purple);
}

.select-pill {
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    font-size: 0.82rem;
    outline: none;
    cursor: pointer;
}

.select-pill:focus {
    border-color: var(--purple);
}

/* Section Row in Discover */
.discover-section {
    margin-bottom: 36px;
}

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

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

/* Books Grid (5-6 books per row on desktop, 3-4 on tablet, 2 on mobile) */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 20px;
}

.book-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: border-color var(--transition-fast), transform var(--transition-fast);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.book-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}

.book-cover-container {
    position: relative;
    width: 100%;
    aspect-ratio: 2/3;
    background: #181628;
    overflow: hidden;
}

.book-cover-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-card:hover .book-cover-img {
    transform: none;
}

.book-badge-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 7px;
    border-radius: var(--radius-xs);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 2;
}

.book-card-info {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card-author {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-dim);
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.book-card-rating {
    color: var(--gold);
    font-weight: 600;
}

/* ==============================================================================
   MY LIBRARY VIEW
   ============================================================================== */
.library-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

.library-tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.library-tab-btn:hover {
    color: var(--white);
}

.library-tab-btn.active {
    color: #c4b5fd;
    background: rgba(91, 63, 212, 0.12);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    max-width: 440px;
    margin: 0 auto;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: var(--text-dim);
}

.empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

/* ==============================================================================
   WRITER STUDIO / MY BOOKS
   ============================================================================== */
.studio-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.studio-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

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

.stat-card .label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    display: block;
}

.stat-card .value {
    font-size: 1.6rem;
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--white);
}

/* Studio Editor View */
.editor-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 20px;
    min-height: calc(100vh - 160px);
}

.editor-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: fit-content;
    max-height: calc(100vh - 160px);
}

.editor-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.chapters-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 4px;
}

.chapter-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.chapter-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.chapter-item.active {
    background: rgba(91, 63, 212, 0.12);
    border-left: 3px solid var(--purple);
    font-weight: 600;
    color: #c4b5fd;
}

.chapter-title-text {
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.chapter-reorder-btns {
    display: flex;
    gap: 4px;
    opacity: 0.6;
}

.chapter-item:hover .chapter-reorder-btns {
    opacity: 1;
}

.editor-main-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    display: flex;
    flex-direction: column;
    padding: 24px 28px;
    position: relative;
}

.editor-top-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
    flex-wrap: wrap;
}

.editor-title-input {
    width: 100%;
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    background: transparent;
    border: none;
    outline: none;
    margin-bottom: 16px;
}

.editor-title-input::placeholder {
    color: var(--text-dim);
}

/* Quill Snow Theme Restrained Overrides */
.ql-toolbar.ql-snow {
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    background: var(--bg-surface) !important;
    padding: 8px 12px !important;
}

.ql-toolbar.ql-snow .ql-stroke {
    stroke: var(--text-muted) !important;
}

.ql-toolbar.ql-snow .ql-fill {
    fill: var(--text-muted) !important;
}

.ql-toolbar.ql-snow .ql-picker {
    color: var(--text-muted) !important;
}

.ql-toolbar.ql-snow button:hover .ql-stroke,
.ql-toolbar.ql-snow button.ql-active .ql-stroke {
    stroke: var(--purple-light) !important;
}

.ql-toolbar.ql-snow button:hover .ql-fill,
.ql-toolbar.ql-snow button.ql-active .ql-fill {
    fill: var(--purple-light) !important;
}

.ql-container.ql-snow {
    border: 1px solid var(--border) !important;
    border-top: none !important;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm) !important;
    background: var(--bg-surface) !important;
    font-family: var(--font-serif) !important;
    font-size: 1.05rem !important;
    line-height: 1.8 !important;
    min-height: 380px !important;
}

.ql-editor {
    padding: 20px 24px !important;
    color: var(--text-main) !important;
}

.ql-editor.ql-blank::before {
    color: var(--text-dim) !important;
    font-style: normal !important;
}

/* Word Count & Status Bar */
.editor-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.save-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.save-status-indicator.saved {
    color: var(--success);
}

.save-status-indicator.saving {
    color: var(--warning);
}

/* Zen Mode */
body.editor-zen-mode #app-sidebar,
body.editor-zen-mode .app-topbar,
body.editor-zen-mode .editor-sidebar {
    display: none !important;
}

body.editor-zen-mode .app-main {
    margin-left: 0 !important;
}

body.editor-zen-mode .editor-layout {
    grid-template-columns: 1fr !important;
    max-width: 800px;
    margin: 0 auto;
}

/* ==============================================================================
   READER VIEW (Comfortable distraction-free mode)
   ============================================================================== */
#reader-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    overflow-y: auto;
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Reader Themes */
#reader-view.theme-dark {
    background-color: var(--reader-dark-bg);
    color: var(--reader-dark-text);
}

#reader-view.theme-light {
    background-color: var(--reader-light-bg);
    color: var(--reader-light-text);
}

#reader-view.theme-sepia {
    background-color: var(--reader-sepia-bg);
    color: var(--reader-sepia-text);
}

.reader-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--purple);
    width: 0%;
    z-index: 2100;
    transition: width 0.1s linear;
}

.reader-header {
    position: sticky;
    top: 0;
    height: 56px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: inherit;
    z-index: 2050;
    border-bottom: 1px solid rgba(128, 128, 128, 0.15);
}

.reader-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.reader-article {
    max-width: 720px;
    margin: 48px auto 80px;
    padding: 0 24px;
    line-height: 1.85;
}

.reader-article.font-serif {
    font-family: var(--font-serif);
}

.reader-article.font-sans {
    font-family: var(--font-body);
}

.reader-chapter-title {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 28px;
    text-align: center;
}

.reader-body-content p {
    margin-bottom: 1.5em;
}

.reader-nav-footer {
    max-width: 720px;
    margin: 36px auto 60px;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(128, 128, 128, 0.15);
}

/* ==============================================================================
   MODALS & OVERLAYS
   ============================================================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(9, 8, 14, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 28px;
    position: relative;
    box-shadow: var(--shadow-lg);
    transform: scale(0.97);
    transition: transform var(--transition-fast);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 4px;
    border-radius: 50%;
    line-height: 1;
}

.modal-close-btn:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.08);
}

/* Forms in Modals */
.form-group {
    margin-bottom: 16px;
}

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

.form-control {
    width: 100%;
    height: 42px;
    padding: 0 14px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--white);
    font-family: inherit;
    font-size: 0.92rem;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-control:focus {
    border-color: var(--purple);
    background: rgba(255, 255, 255, 0.06);
}

textarea.form-control {
    height: auto;
    padding: 10px 14px;
    resize: vertical;
}

/* Phone Mockup Preview Modal */
.phone-mockup-frame {
    width: 340px;
    height: 680px;
    background: #000;
    border-radius: 36px;
    border: 8px solid #27272a;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

.phone-notch {
    width: 120px;
    height: 20px;
    background: #27272a;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 12px 12px;
    z-index: 10;
}

.phone-screen {
    flex: 1;
    background: #0F0F1E;
    overflow-y: auto;
    padding: 36px 16px 16px;
    color: #FAFAFA;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 4000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    padding: 12px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--white);
    font-size: 0.88rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: toastSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes toastSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* ==============================================================================
   RESPONSIVE DESIGN (Tablets & Phones)
   ============================================================================== */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 200px;
    }
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }
    .editor-layout {
        grid-template-columns: 220px 1fr;
    }
    .footer-top {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
    .writers-journey {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --sidebar-width: 0px;
    }
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.mobile-open {
        transform: translateX(0);
        width: 240px;
    }
    .app-main {
        margin-left: 0;
        padding-bottom: 70px;
    }
    .mobile-menu-btn {
        display: block;
    }
    .landing-links {
        display: none;
    }
    .mobile-bottom-nav {
        display: flex;
    }
    .about-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .editor-layout {
        grid-template-columns: 1fr;
    }
    .editor-sidebar {
        max-height: 220px;
    }
    .community-layout {
        grid-template-columns: 1fr;
    }
    .community-sidebar-col {
        display: none;
    }
    .writers-journey {
        grid-template-columns: 1fr 1fr;
    }
    .download-box {
        flex-direction: column;
        text-align: center;
        padding: 32px 20px;
    }
    .download-info p {
        margin: 0 auto 20px;
    }
    .download-badges {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .books-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .book-card-info {
        padding: 8px 10px;
    }
    .book-card-title {
        font-size: 0.88rem;
    }
    .book-card-author {
        font-size: 0.78rem;
    }
    .writers-journey {
        grid-template-columns: 1fr;
    }
    .about-pillars {
        grid-template-columns: 1fr;
    }
    .footer-top {
        grid-template-columns: 1fr;
    }
    .app-content {
        padding: 16px;
    }
}

/* ==============================================================================
   SHAREABLE DIRECT LINKS & QUOTE CARD STUDIO
   ============================================================================== */
.quote-card-preview-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    margin-bottom: 20px;
}

.quote-card-canvas {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.7;
    font-style: italic;
    color: var(--white);
    margin-bottom: 12px;
}

.quote-card-attribution {
    font-size: 0.85rem;
    color: var(--gold);
    font-weight: 600;
}

/* ==============================================================================
   REAL-TIME NOTIFICATION BELL & DROPDOWN
   ============================================================================== */
.notification-bell-wrapper {
    position: relative;
}

.notification-bell-btn {
    position: relative;
    color: var(--text-muted);
    font-size: 1.25rem;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.notification-bell-btn:hover {
    color: var(--white);
}

.notification-unread-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: var(--danger);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 600;
    padding: 14px;
}

.notification-dropdown.active {
    display: block;
}

.notification-dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}

.notification-dropdown-header h4 {
    font-size: 0.95rem;
}

.btn-mark-all-read {
    font-size: 0.75rem;
    color: var(--teal);
    cursor: pointer;
}

.notification-filter-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.notif-tab-btn {
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.notif-tab-btn.active {
    background: var(--purple);
    color: var(--white);
    border-color: var(--purple);
}

.notification-list {
    max-height: 280px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notification-item {
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    font-size: 0.82rem;
}

.notification-empty {
    text-align: center;
    padding: 24px 0;
    color: var(--text-dim);
    font-size: 0.85rem;
}

/* ==============================================================================
   COMMUNITY SOCIAL FEED (POSTS, POLLS, QUOTES & MILESTONES)
   ============================================================================== */
.community-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 24px;
    align-items: start;
}

.community-main-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.community-sidebar-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 80px;
}

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

.composer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.composer-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.composer-type-pill {
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.composer-type-pill:hover {
    color: var(--white);
    border-color: var(--border-hover);
}

.composer-type-pill.active {
    color: var(--white);
    background: var(--purple);
    border-color: var(--purple);
}

.composer-textarea {
    width: 100%;
    min-height: 80px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.92rem;
    line-height: 1.6;
    padding: 10px 12px;
    color: var(--text-main);
    outline: none;
    resize: vertical;
}

.composer-textarea:focus {
    border-color: var(--purple);
}

.composer-poll-builder {
    margin-top: 12px;
    padding: 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.composer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.composer-tools-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.composer-book-select {
    width: auto;
    max-width: 200px;
    padding: 4px 10px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-main);
}

.spoiler-checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 5px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    user-select: none;
}

.spoiler-checkbox-label input {
    accent-color: var(--purple);
}

.community-filter-bar {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.community-posts-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.community-post-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    transition: border-color var(--transition-fast);
}

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

.post-repost-banner {
    font-size: 0.76rem;
    color: var(--teal);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

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

.post-author-info {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.post-author-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    overflow: hidden;
    flex-shrink: 0;
}

.post-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-author-name-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.post-author-name {
    font-weight: 700;
    color: var(--white);
    font-size: 0.92rem;
}

.post-author-info:hover .post-author-name {
    color: #c4b5fd;
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #38BDF8;
    color: #090D16;
    font-size: 0.65rem;
    font-weight: 900;
}

.post-meta-sub {
    font-size: 0.75rem;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    gap: 6px;
}

.post-type-tag {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.post-type-UPDATE { background: rgba(91, 63, 212, 0.15); color: #c4b5fd; }
.post-type-QUOTE { background: rgba(212, 175, 55, 0.15); color: var(--gold-light); }
.post-type-REVIEW { background: rgba(16, 185, 129, 0.15); color: #6ee7b7; }
.post-type-OPINION { background: rgba(236, 72, 153, 0.15); color: #f9a8d4; }
.post-type-POLL { background: rgba(20, 184, 166, 0.15); color: #5eead4; }
.post-type-MILESTONE { background: rgba(251, 191, 36, 0.15); color: #fde68a; }

.post-body-text {
    font-size: 0.94rem;
    line-height: 1.65;
    color: var(--text-main);
    margin-bottom: 12px;
    white-space: pre-wrap;
    word-break: break-word;
}

.post-quote-block {
    padding: 14px 18px;
    border-left: 3px solid var(--gold);
    background: rgba(212, 175, 55, 0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 1.02rem;
    line-height: 1.7;
    color: #FEF3C7;
    margin-bottom: 12px;
}

/* Spoiler Shield (Accessible Clean Blur) */
.post-spoiler-wrapper {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin-bottom: 12px;
}

.post-spoiler-wrapper.blurred .post-spoiler-inner {
    filter: blur(8px);
    user-select: none;
    pointer-events: none;
}

.post-spoiler-overlay {
    position: absolute;
    inset: 0;
    background: rgba(17, 16, 25, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
}

.post-spoiler-wrapper:not(.blurred) .post-spoiler-overlay {
    display: none;
}

.post-spoiler-pill {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-size: 0.78rem;
    font-weight: 700;
}

/* Post Images */
.post-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.post-image-item {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

/* Interactive Poll Card inside Post */
.post-poll-box {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    margin-bottom: 12px;
}

.post-poll-question {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--white);
    margin-bottom: 10px;
}

.poll-options-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.poll-option-btn {
    position: relative;
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--white);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.88rem;
    transition: border-color var(--transition-fast);
}

.poll-option-btn:hover {
    border-color: var(--teal);
}

.poll-option-btn.voted {
    border-color: var(--teal);
    font-weight: 600;
}

.poll-option-fill {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    background: rgba(20, 184, 166, 0.25);
    z-index: 0;
    transition: width 0.3s ease;
}

.poll-option-label,
.poll-option-pct {
    position: relative;
    z-index: 1;
}

.poll-option-pct {
    font-size: 0.78rem;
    color: var(--teal-light);
    font-weight: 700;
}

.poll-footer-meta {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Linked Book Mini-Card inside Post */
.post-linked-book-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    margin-bottom: 12px;
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.post-linked-book-card:hover {
    border-color: var(--border-hover);
}

.post-linked-book-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.post-linked-book-cover {
    width: 38px;
    height: 54px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    flex-shrink: 0;
}

/* Post Action Bar */
.post-actions-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.post-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-xs);
    transition: color var(--transition-fast);
}

.post-action-btn:hover {
    color: var(--white);
}

.post-action-btn.liked {
    color: #F43F5E;
    font-weight: 600;
}

/* Inline Comments Drawer */
.post-comments-drawer {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.post-comments-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
    max-height: 240px;
    overflow-y: auto;
}

.post-comment-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}

.post-comment-input-row {
    display: flex;
    gap: 8px;
}

/* Community Sidebar Widgets */
.community-widget-card {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--white);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.top-creators-list,
.community-popular-books {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.top-creator-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.top-creator-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    cursor: pointer;
}

/* ==============================================================================
   PUBLIC AUTHOR PROFILE MODAL & FOLLOW SYSTEM
   ============================================================================== */
.author-profile-modal-content {
    max-width: 580px;
    padding: 0;
    overflow: hidden;
}

.author-profile-banner {
    height: 120px;
    background: linear-gradient(135deg, rgba(91, 63, 212, 0.3), rgba(20, 184, 166, 0.2));
    position: relative;
}

.author-profile-body {
    padding: 20px 24px;
}

.author-profile-avatar-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: -50px;
    margin-bottom: 16px;
}

.author-profile-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    border: 3px solid var(--bg-surface);
    background: var(--purple);
    overflow: hidden;
}

.author-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-profile-stats {
    display: flex;
    gap: 20px;
    margin: 16px 0;
    padding: 12px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.author-stat-item {
    display: flex;
    flex-direction: column;
}

.author-stat-val {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--white);
}

.author-stat-lbl {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ==============================================================================
   ENHANCED EXTENSIONS: AUDIO DOCK, ANALYTICS, REVISIONS, ACCESSIBILITY & FONTS
   ============================================================================== */

/* --- 1. Persistent Audio Dock Player (Clean Solid Surface) --- */
.global-audio-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: rgba(25, 23, 36, 0.98);
    border-top: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding: 10px 24px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    transition: transform var(--transition-base), opacity var(--transition-base);
}

.global-audio-player.active {
    display: flex;
}

.audio-dock-track-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    max-width: 280px;
}

.audio-dock-cover {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
}

.audio-dock-meta {
    overflow: hidden;
}

.audio-dock-title {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.audio-dock-subtitle {
    font-size: 0.74rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
}

.audio-dock-center {
    flex: 1;
    max-width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.audio-dock-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-btn-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--purple);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.audio-btn-circle:hover {
    background: var(--purple-hover);
    transform: scale(1.04);
}

.audio-btn-icon {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: color var(--transition-fast);
}

.audio-btn-icon:hover {
    color: var(--white);
}

.audio-dock-timeline {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-time-label {
    font-size: 0.72rem;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
    min-width: 32px;
}

.audio-scrubber {
    flex: 1;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.audio-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--teal);
    cursor: pointer;
    transition: transform 0.1s ease;
}

.audio-scrubber::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.audio-dock-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.audio-select-pill {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    font-size: 0.76rem;
    cursor: pointer;
    outline: none;
}

.audio-select-pill:focus {
    border-color: var(--purple);
}

@media (max-width: 768px) {
    .global-audio-player {
        padding: 8px 12px;
        bottom: 60px; /* Above mobile bottom nav */
    }
    .audio-dock-track-info {
        min-width: 120px;
        max-width: 160px;
    }
    .audio-hide-mobile {
        display: none !important;
    }
}

/* --- 2. Malayalam & Reader Typography Classes --- */
.font-sans {
    font-family: var(--font-body), sans-serif;
}

.font-serif {
    font-family: 'Merriweather', Georgia, serif;
}

.font-malayalam-serif {
    font-family: 'Noto Serif Malayalam', 'Merriweather', serif;
    line-height: 2.05 !important;
}

.font-malayalam-sans {
    font-family: 'Gayathri', 'Manjari', sans-serif;
    line-height: 1.95 !important;
}

.font-mono {
    font-family: 'SF Mono', Menlo, Consolas, monospace;
}

/* --- 3. Shimmer Skeleton Loading --- */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
}

.skeleton-shimmer {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}

.skeleton-shimmer::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 1.8s infinite;
    content: '';
}

@keyframes shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* --- 4. Spoiler Protection --- */
.spoiler-wrap {
    position: relative;
    display: inline-block;
    cursor: pointer;
    border-radius: var(--radius-xs);
    overflow: hidden;
}

.spoiler-blurred {
    filter: blur(8px);
    user-select: none;
    transition: filter 0.2s ease;
}

.spoiler-overlay-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-surface);
    border: 1px solid var(--gold);
    color: var(--gold-light);
    font-size: 0.72rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-xs);
    pointer-events: none;
    z-index: 2;
}

.spoiler-wrap.revealed .spoiler-blurred {
    filter: none;
    user-select: auto;
}

.spoiler-wrap.revealed .spoiler-overlay-badge {
    display: none;
}

/* --- 5. Find & Replace Bar --- */
.editor-find-replace-bar {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 8px 12px;
    margin-bottom: 12px;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    box-shadow: var(--shadow-sm);
}

.editor-find-replace-bar.active {
    display: flex;
}

.editor-find-replace-bar input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    color: var(--white);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    outline: none;
}

.editor-find-replace-bar input:focus {
    border-color: var(--purple);
}

/* --- 6. Chapter Scratchpad / Notes Drawer --- */
.chapter-notes-panel {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    margin-bottom: 14px;
}

.chapter-notes-panel.active {
    display: block;
}

.chapter-notes-textarea {
    width: 100%;
    min-height: 80px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    padding: 8px 10px;
    font-size: 0.86rem;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.chapter-notes-textarea:focus {
    border-color: var(--purple);
}

/* --- 7. Interactive SVG Analytics Chart --- */
.analytics-chart-container {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.analytics-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.analytics-time-pills {
    display: flex;
    gap: 6px;
}

.analytics-svg-wrap {
    width: 100%;
    height: 180px;
    overflow: visible;
}

/* --- 8. Offline Banner --- */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: #dc2626;
    color: white;
    text-align: center;
    padding: 8px 16px;
    font-size: 0.84rem;
    font-weight: 600;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: var(--shadow-sm);
}

.offline-banner.active {
    display: flex;
}


/* ==============================================================================
   COMPLEMENTARY EDITORIAL COMPONENTS
   ============================================================================== */

/* Continue Reading Banner */
.continue-reading-banner {
    padding: 18px 22px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.continue-reading-info {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.continue-cover {
    width: 44px;
    height: 66px;
    border-radius: var(--radius-xs);
    object-fit: cover;
    border: 1px solid var(--border);
    flex-shrink: 0;
}

/* Quote Card Studio */
.quote-card-studio {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.quote-canvas-preview-wrap {
    width: 100%;
    margin-bottom: 14px;
}

.quote-theme-swatches {
    display: flex;
    align-items: center;
    gap: 8px;
}

.quote-swatch {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-xs);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.quote-swatch:hover {
    transform: scale(1.1);
}

/* Share & Social Dialog */
.share-link-box {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.share-social-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* Word Goal Tracking in Studio */
.word-goal-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.word-goal-track {
    width: 70px;
    height: 4px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.word-goal-fill {
    height: 100%;
    background: var(--teal);
    border-radius: var(--radius-full);
}

.goal-pct {
    font-weight: 700;
    color: var(--teal-light);
    font-size: 0.78rem;
}

/* Zen Floating Bar */
.zen-floating-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 10px 18px;
    margin: 0 auto 16px;
    max-width: 800px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

body.editor-zen-mode .zen-floating-bar {
    display: flex;
}

.zen-bar-left, .zen-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.zen-badge {
    padding: 2px 8px;
    border-radius: var(--radius-xs);
    font-size: 0.72rem;
    font-weight: 700;
    background: rgba(91, 63, 212, 0.15);
    color: #c4b5fd;
}

/* Studio Chapter Header & Toolbar */
.editor-header-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chapter-title-input {
    width: 100%;
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    margin-bottom: 14px;
    outline: none;
}

.chapter-title-input:focus {
    border-color: var(--purple);
}

.quill-wrapper {
    position: relative;
    border-radius: var(--radius-sm);
}

.editor-bottom-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-dim);
}

.editor-stats-summary {
    display: flex;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
}

.editor-save-state {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-saved {
    color: var(--success);
}

.status-badge {
    font-size: 0.72rem;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    font-weight: 600;
}

.badge-draft {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

/* Chapter Audio Attachment Bar */
.chapter-audio-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(20, 184, 166, 0.08);
    border: 1px solid rgba(20, 184, 166, 0.25);
    margin-bottom: 14px;
}

/* Import / Export Modals */
.import-dropzone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    padding: 30px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.import-dropzone:hover {
    border-color: var(--purple);
}

.export-formats-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.export-format-card {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

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

.export-icon {
    font-size: 1.35rem;
}

.export-meta {
    flex: 1;
    text-align: left;
}

/* Author Profile Modal */
.author-banner-gradient {
    height: 100px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
}

.author-header-top {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-top: -40px;
    margin-bottom: 14px;
    gap: 12px;
    flex-wrap: wrap;
}

.author-modal-avatar {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: var(--purple);
    border: 3px solid var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    overflow: hidden;
}

.author-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-header-actions {
    display: flex;
    gap: 8px;
}

.author-identity-block h3 {
    font-size: 1.2rem;
    margin-bottom: 4px;
}

.author-modal-bio {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    margin-bottom: 14px;
}

.author-stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.author-stat-pill {
    display: flex;
    flex-direction: column;
}

.author-stat-pill strong {
    font-size: 0.98rem;
    color: var(--white);
}

.author-stat-pill span {
    font-size: 0.72rem;
    color: var(--text-dim);
}

.author-connections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.author-books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

.clickable-author-link {
    cursor: pointer;
    transition: color var(--transition-fast);
}

.clickable-author-link:hover {
    color: #c4b5fd;
}

/* Profile Own Stats Bar */
.profile-own-stats-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.profile-own-stat {
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    border: 1px solid var(--border);
    text-align: center;
}

.reader-quote-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-xs);
    font-size: 0.75rem;
    background: rgba(212, 175, 55, 0.15);
    color: var(--gold-light);
}

.tab-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.tab-btn.active {
    background: var(--purple);
    color: var(--white);
    border-color: var(--purple);
}

.tab-pane {
    display: block;
}

.bell-icon { font-size: 1.2rem; }
.author-avatar-wrap { position: relative; }
.editor-action-group { display: flex; align-items: center; gap: 8px; }
.goal-icon { font-size: 1rem; }
.poll-option-input { width: 100%; margin-bottom: 8px; }
.author-modal-pane { display: block; }


/* ==============================================================================
   STANDALONE STUDIO WIZARD SUPPORT
   ============================================================================== */
.studio-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    border: 1px solid var(--border);
}

.wizard-steps {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wizard-steps .step {
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.wizard-steps .step.active {
    background: var(--purple);
    color: var(--white);
    border-color: var(--purple);
}

.studio-container {
    max-width: 1000px;
    margin: 20px auto;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 36px;
}

.studio-section {
    display: none;
}

.studio-section.active {
    display: block;
}

.cover-upload-container {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.cover-preview-wrapper {
    width: 120px;
    aspect-ratio: 2/3;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    border: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-placeholder {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-dim);
    padding: 8px;
}

.cover-preview-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-input-custom {
    display: none;
}

.file-label-custom {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    background: var(--purple);
    color: var(--white);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: background-color var(--transition-fast);
}

.file-label-custom:hover {
    background: var(--purple-hover);
}

.cover-help-text {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 6px;
}

.studio-editor-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 20px;
}

.studio-sidebar {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Toggle Switch (Show Magazines on Profile)
   ========================================================================== */
.switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.18);
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
input:checked + .slider {
    background-color: var(--purple);
}
input:focus + .slider {
    box-shadow: 0 0 1px var(--purple);
}
input:checked + .slider:before {
    transform: translateX(22px);
}
.slider.round {
    border-radius: 26px;
}
.slider.round:before {
    border-radius: 50%;
}

/* ==========================================================================
   Modern Bento Grid Magazine Showcase
   ========================================================================== */
.bento-showcase-wrapper {
    margin-top: 12px;
}
.bento-section-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--teal-light);
    margin-bottom: 12px;
}
.bento-hero-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.25) 0%, rgba(26, 17, 56, 0.85) 100%);
    border: 1px solid rgba(141, 92, 246, 0.35);
    padding: 24px;
    margin-bottom: 16px;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.bento-hero-card:hover {
    transform: translateY(-2px);
    border-color: rgba(141, 92, 246, 0.7);
    box-shadow: 0 12px 32px rgba(108, 99, 255, 0.2);
}
.bento-hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.bento-hero-left {
    flex: 1;
}
.bento-flagship-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #FBBF24;
    background: rgba(251, 191, 36, 0.12);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 3px 8px;
    border-radius: 12px;
    margin-bottom: 10px;
}
.bento-hero-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 8px 0;
    line-height: 1.25;
}
.bento-hero-desc {
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.5;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bento-hero-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.bento-hero-right {
    flex-shrink: 0;
}
.bento-hero-cover {
    width: 85px;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
.bento-cover-placeholder {
    width: 85px;
    height: 120px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}
.bento-secondary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.bento-secondary-tile {
    background: rgba(22, 22, 36, 0.8);
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease;
}
.bento-secondary-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 92, 246, 0.6);
}
.bento-tile-badge {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    color: #A78BFA;
    margin-bottom: 8px;
}
.bento-tile-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px 0;
    line-height: 1.3;
}
.bento-tile-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 14px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.bento-tile-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-dim);
}
.bento-read-link {
    color: var(--teal-light);
    font-weight: 700;
}
.bento-empty-state {
    text-align: center;
    padding: 48px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 16px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
}
.bento-empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}
.bento-empty-state h3 {
    font-size: 1.25rem;
    margin-bottom: 6px;
    color: #fff;
}
.bento-empty-state p {
    font-size: 0.88rem;
    color: var(--text-muted);
    max-width: 440px;
    margin: 0 auto 16px auto;
}

/* ==============================================================================
   SRISHTY MAGAZINE — EDITORIAL DIGITAL NEWSSTAND (PHASE 1)
   ============================================================================== */

/* Unified Editorial Container */
.magazine-container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .magazine-container {
        padding: 0 20px;
    }
}
@media (min-width: 1024px) {
    .magazine-container {
        padding: 0 24px;
    }
}
@media (min-width: 1440px) {
    .magazine-container {
        padding: 0 32px;
    }
}

/* Magazine Sub-Navigation Header & Search */
.magazine-nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.magazine-subtabs-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.magazine-search-box {
    position: relative;
    width: 100%;
    max-width: 340px;
}
@media (max-width: 768px) {
    .magazine-search-box {
        max-width: 100%;
    }
}

/* Editorial Hero Spotlight */
.magazine-editorial-hero {
    position: relative;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(30, 26, 49, 0.95) 0%, rgba(17, 16, 25, 0.98) 100%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 30px rgba(212, 175, 55, 0.08);
    overflow: hidden;
    margin-bottom: 32px;
    padding: 32px;
}
@media (max-width: 600px) {
    .magazine-editorial-hero {
        padding: 20px 16px;
        border-radius: 14px;
    }
    .magazine-hero-cover {
        width: 170px;
        height: 230px;
    }
    .magazine-subtabs-group {
        overflow-x: auto;
        flex-wrap: nowrap;
        scrollbar-width: none;
        padding-bottom: 4px;
    }
}
@media (min-width: 1024px) {
    .magazine-editorial-hero {
        padding: 40px;
    }
}
.magazine-hero-glow {
    position: absolute;
    top: -80px;
    right: -60px;
    width: 320px;
    height: 320px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.18), transparent 70%);
    pointer-events: none;
}
.magazine-hero-layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
    position: relative;
    z-index: 1;
}
@media (min-width: 900px) {
    .magazine-hero-layout {
        flex-direction: row;
        align-items: center;
        gap: 36px;
    }
}

/* 3D Perspective Floating Magazine Cover */
.magazine-hero-cover-wrap {
    flex-shrink: 0;
    perspective: 1000px;
    display: flex;
    justify-content: center;
}
.magazine-hero-cover {
    width: 200px;
    height: 270px;
    border-radius: 12px;
    position: relative;
    transform: rotateY(-8deg) rotateX(4deg);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
    box-shadow: -10px 18px 38px rgba(0, 0, 0, 0.65), 0 0 20px rgba(212, 175, 55, 0.2);
    overflow: hidden;
    background: #1b1730;
    cursor: pointer;
}
@media (min-width: 1200px) {
    .magazine-hero-cover {
        width: 230px;
        height: 310px;
    }
}
.magazine-hero-cover:hover {
    transform: rotateY(-2deg) rotateX(1deg) translateY(-6px);
    box-shadow: -12px 24px 44px rgba(0, 0, 0, 0.75), 0 0 30px rgba(212, 175, 55, 0.35);
}
.magazine-hero-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.magazine-hero-cover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 14px;
    background: linear-gradient(90deg, rgba(255,255,255,0.3) 0%, rgba(255,255,255,0.05) 50%, rgba(0,0,0,0.35) 100%);
    z-index: 2;
    pointer-events: none;
}

/* Magazine Hero Info */
.magazine-hero-info {
    flex: 1;
    min-width: 260px;
}
.magazine-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid rgba(212, 175, 55, 0.35);
    color: var(--gold-light);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 12px;
    text-transform: uppercase;
}
.magazine-hero-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 10px 0;
    line-height: 1.25;
}
@media (min-width: 1024px) {
    .magazine-hero-title {
        font-size: 2.2rem;
    }
}
.magazine-hero-desc {
    color: var(--dark-text-secondary);
    font-size: 0.94rem;
    line-height: 1.6;
    margin: 0 0 20px 0;
    max-width: 640px;
}
.magazine-hero-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 22px;
}
.magazine-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Mood & Category Filter Chips */
.magazine-mood-pills-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 8px;
    margin-bottom: 28px;
    scrollbar-width: none;
}
.magazine-mood-pills-bar::-webkit-scrollbar {
    display: none;
}
.magazine-mood-pill {
    padding: 8px 16px;
    border-radius: 24px;
    background: var(--dark-bg-surface);
    border: 1px solid var(--dark-border);
    color: var(--dark-text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.magazine-mood-pill:hover {
    border-color: var(--purple-light);
    color: #FFFFFF;
    transform: translateY(-1px);
}
.magazine-mood-pill.active {
    background: var(--purple);
    border-color: var(--purple);
    color: #FFFFFF;
    box-shadow: 0 4px 14px rgba(91, 63, 212, 0.35);
}

/* Smart Resume Reading Ribbon */
.magazine-resume-ribbon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 22px;
    border-radius: 14px;
    background: linear-gradient(90deg, rgba(20, 184, 166, 0.15) 0%, rgba(91, 63, 212, 0.12) 100%);
    border: 1px solid rgba(20, 184, 166, 0.35);
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 14px;
}
.magazine-resume-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.magazine-resume-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(20, 184, 166, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.magazine-resume-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: #FFFFFF;
    margin: 0 0 2px 0;
}
.magazine-resume-sub {
    font-size: 0.8rem;
    color: var(--teal-light);
}

/* Section Titles */
.magazine-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}
.magazine-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}
.magazine-section-subtitle {
    font-size: 0.82rem;
    color: var(--text-dim);
}

/* Dedicated Magazine Grid */
.magazine-grid {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    gap: 22px;
    margin-bottom: 36px;
}
@media (min-width: 580px) {
    .magazine-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .magazine-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}
@media (min-width: 1400px) {
    .magazine-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 26px;
    }
}

/* Dedicated Magazine Card */
.magazine-card {
    background: var(--dark-bg-surface);
    border: 1px solid var(--dark-border);
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    position: relative;
}
.magazine-card:hover {
    transform: translateY(-6px);
    border-color: rgba(91, 63, 212, 0.6);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px rgba(91, 63, 212, 0.15);
}
.magazine-card-cover-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1.35;
    background: #181628;
    overflow: hidden;
}
.magazine-card-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.magazine-card:hover .magazine-card-cover-wrap img {
    transform: scale(1.03);
}
.magazine-card-cover-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 8px;
    background: linear-gradient(90deg, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0.25) 100%);
    z-index: 2;
    pointer-events: none;
}
.magazine-card-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 3;
    pointer-events: none;
}
.magazine-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    justify-content: space-between;
}
.magazine-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 4px 0;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.magazine-card-org {
    font-size: 0.82rem;
    color: var(--teal-light);
    margin-bottom: 8px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.magazine-card-desc {
    font-size: 0.82rem;
    color: var(--dark-text-secondary);
    line-height: 1.5;
    margin: 0 0 14px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.magazine-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.78rem;
    color: var(--text-dim);
}

/* Standout Stories & Essays 2-Column Desktop Grid */
.standout-stories-section {
    margin-bottom: 38px;
}
.standout-stories-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}
@media (min-width: 900px) {
    .standout-stories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}
.story-card {
    background: var(--dark-bg-surface);
    border: 1px solid var(--dark-border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    gap: 18px;
    cursor: pointer;
    transition: all 0.25s ease;
}
.story-card:hover {
    border-color: rgba(20, 184, 166, 0.5);
    background: var(--dark-bg-elevated);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
.story-card-thumb {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: #1f1b34;
}
.story-card-content {
    flex: 1;
    min-width: 0;
}
.story-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 0.75rem;
}
.story-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 6px 0;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.story-card-excerpt {
    font-size: 0.82rem;
    color: var(--dark-text-secondary);
    line-height: 1.5;
    margin: 0 0 10px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.story-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-dim);
}

/* =========================================================================
   PHASE 2: MAGAZINE STUDIO DESKTOP EDITORIAL WORKSPACE
   ========================================================================= */

.mag-studio-workspace {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 40px;
}

@media (min-width: 960px) {
    .mag-studio-workspace {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Studio Left Sidebar (Publication Selector & Navigation) */
.mag-studio-sidebar {
    width: 100%;
    background: var(--dark-bg-surface);
    border: 1px solid var(--dark-border);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

@media (min-width: 960px) {
    .mag-studio-sidebar {
        width: 320px;
        flex-shrink: 0;
        position: sticky;
        top: 80px;
    }
}

.mag-switcher-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.mag-switcher-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #FFFFFF;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mag-pub-group-title {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-dim);
    margin: 14px 0 8px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mag-pub-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

.mag-pub-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mag-pub-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
}

.mag-pub-item.active {
    background: rgba(91, 63, 212, 0.16);
    border-color: var(--purple);
    box-shadow: 0 4px 14px rgba(91, 63, 212, 0.2);
}

.mag-pub-thumb {
    width: 38px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    background: #1e1a33;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.mag-pub-info {
    flex: 1;
    min-width: 0;
}

.mag-pub-name {
    font-size: 0.88rem;
    font-weight: 600;
    color: #FFFFFF;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mag-pub-meta {
    font-size: 0.72rem;
    color: var(--text-dim);
    display: flex;
    gap: 8px;
    align-items: center;
}

/* Studio Left Vertical Nav */
.mag-studio-vnav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mag-vnav-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--dark-text-secondary);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.mag-vnav-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #FFFFFF;
}

.mag-vnav-btn.active {
    background: var(--purple);
    color: #FFFFFF;
    box-shadow: 0 4px 12px rgba(91, 63, 212, 0.35);
}

.mag-vnav-badge {
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 0.72rem;
    background: rgba(255, 255, 255, 0.15);
    color: #FFFFFF;
}

.mag-vnav-btn.active .mag-vnav-badge {
    background: #FFFFFF;
    color: var(--purple);
    font-weight: 700;
}

/* Studio Right Main Content */
.mag-studio-main {
    flex: 1;
    min-width: 0;
    background: var(--dark-bg-surface);
    border: 1px solid var(--dark-border);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

@media (min-width: 1024px) {
    .mag-studio-main {
        padding: 30px;
    }
}

/* Studio Publication Banner */
.mag-studio-banner {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(30, 26, 49, 0.8) 0%, rgba(17, 16, 25, 0.9) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.mag-studio-banner-cover {
    width: 80px;
    height: 108px;
    border-radius: 8px;
    object-fit: cover;
    background: #1b1730;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.mag-studio-banner-info {
    flex: 1;
    min-width: 220px;
}

.mag-studio-banner-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 6px 0;
}

.mag-studio-banner-desc {
    font-size: 0.85rem;
    color: var(--dark-text-secondary);
    line-height: 1.5;
    margin: 0 0 12px 0;
}

.mag-studio-banner-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Studio Stats Bar */
.mag-studio-stats-bar {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 28px;
}

@media (min-width: 600px) {
    .mag-studio-stats-bar {
        grid-template-columns: repeat(4, 1fr);
    }
}

.mag-stat-box {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.mag-stat-box-val {
    font-size: 1.4rem;
    font-weight: 700;
    color: #FFFFFF;
    font-family: 'Outfit', sans-serif;
}

.mag-stat-box-lbl {
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-dim);
}

/* Side-by-Side Review Queue */
.mag-review-split {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 1024px) {
    .mag-review-split {
        flex-direction: row;
        align-items: stretch;
        min-height: 520px;
    }
}

.mag-review-master {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

@media (min-width: 1024px) {
    .mag-review-master {
        width: 45%;
        max-width: 440px;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        padding-right: 20px;
    }
}

.mag-review-filter-bar {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: none;
}

.mag-review-filter-btn {
    padding: 5px 10px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid transparent;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--dark-text-secondary);
    cursor: pointer;
    white-space: nowrap;
}

.mag-review-filter-btn.active {
    background: var(--purple);
    color: #FFFFFF;
}

.mag-review-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
    padding-right: 4px;
}

.mag-submission-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mag-submission-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

.mag-submission-card.active {
    background: rgba(91, 63, 212, 0.12);
    border-color: var(--purple);
}

.mag-submission-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.mag-submission-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.mag-submission-excerpt {
    font-size: 0.8rem;
    color: var(--dark-text-secondary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0 0 8px 0;
}

.mag-submission-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    color: var(--text-dim);
}

/* Review Queue Detail/Preview Pane */
.mag-review-detail {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
}

.mag-review-body {
    overflow-y: auto;
    max-height: 380px;
    padding-right: 8px;
}

.mag-review-body-text {
    font-family: 'Merriweather', 'Noto Serif Malayalam', Georgia, serif;
    font-size: 0.94rem;
    line-height: 1.8;
    color: #e2e8f0;
    white-space: pre-wrap;
    margin-bottom: 16px;
}

.mag-review-actions-box {
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mag-review-textarea {
    width: 100%;
    min-height: 60px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--dark-border);
    border-radius: 8px;
    padding: 8px 12px;
    color: #FFFFFF;
    font-size: 0.84rem;
    font-family: inherit;
    resize: vertical;
    outline: none;
}

.mag-review-textarea:focus {
    border-color: var(--purple);
}

.mag-review-btns {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Team Management Grid */
.mag-team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}

@media (min-width: 700px) {
    .mag-team-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.mag-member-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.mag-member-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.mag-member-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #25203d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #FFFFFF;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mag-member-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.mag-member-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #FFFFFF;
    margin: 0 0 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mag-member-user {
    font-size: 0.78rem;
    color: var(--teal-light);
}


/* ==========================================================================
   PHASE 3: IMMERSIVE DESKTOP FLIPBOOK READER & TWO-PAGE SPREAD SYSTEM
   ========================================================================== */

/* Fullscreen Reader Modal Container */
.mag-flipbook-modal-overlay {
    background: rgba(5, 4, 10, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 10000;
}

.mag-flipbook-workspace {
    width: 98vw;
    height: 96vh;
    max-width: 1560px;
    max-height: 96vh;
    padding: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85);
    transition: background 0.25s ease, color 0.25s ease;
}

/* Reader Themes */
.mag-flipbook-workspace.theme-dark {
    --reader-bg: #12101f;
    --reader-page-bg: #1d1933;
    --reader-card-bg: rgba(255, 255, 255, 0.05);
    --reader-text: #e2dfed;
    --reader-text-muted: #9e97ba;
    --reader-text-heading: #ffffff;
    --reader-border: rgba(139, 92, 246, 0.22);
    --reader-spine: linear-gradient(to right, rgba(0,0,0,0.6), rgba(0,0,0,0.15) 40%, rgba(255,255,255,0.06) 50%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0.6));
    --reader-paper-shadow: 0 16px 45px rgba(0,0,0,0.6);
    background: var(--reader-bg);
    color: var(--reader-text);
    border: 1px solid var(--reader-border);
}

.mag-flipbook-workspace.theme-paper {
    --reader-bg: #ece7dc;
    --reader-page-bg: #faf7f2;
    --reader-card-bg: #f0eae0;
    --reader-text: #262320;
    --reader-text-muted: #696259;
    --reader-text-heading: #141211;
    --reader-border: rgba(0, 0, 0, 0.12);
    --reader-spine: linear-gradient(to right, rgba(0,0,0,0.22), rgba(0,0,0,0.06) 40%, rgba(255,255,255,0.7) 50%, rgba(0,0,0,0.06) 60%, rgba(0,0,0,0.22));
    --reader-paper-shadow: 0 14px 40px rgba(0,0,0,0.12);
    background: var(--reader-bg);
    color: var(--reader-text);
    border: 1px solid var(--reader-border);
}

.mag-flipbook-workspace.theme-sepia {
    --reader-bg: #ddd2bd;
    --reader-page-bg: #f4ebd7;
    --reader-card-bg: #e9ddc3;
    --reader-text: #362c20;
    --reader-text-muted: #6f5f4d;
    --reader-text-heading: #241b11;
    --reader-border: rgba(90, 60, 20, 0.16);
    --reader-spine: linear-gradient(to right, rgba(60,50,30,0.25), rgba(60,50,30,0.08) 40%, rgba(255,250,230,0.5) 50%, rgba(60,50,30,0.08) 60%, rgba(60,50,30,0.25));
    --reader-paper-shadow: 0 14px 38px rgba(60,40,10,0.15);
    background: var(--reader-bg);
    color: var(--reader-text);
    border: 1px solid var(--reader-border);
}

/* Topbar */
.mag-flipbook-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--reader-border);
    background: rgba(0, 0, 0, 0.18);
    flex-wrap: wrap;
    gap: 10px;
    user-select: none;
    z-index: 5;
}

.mag-flipbook-topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mag-flipbook-edition-meta h3 {
    margin: 2px 0 0 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--reader-text-heading);
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mag-flipbook-topbar-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mag-reader-chapter-indicator {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--reader-text-muted);
    padding: 4px 12px;
    background: var(--reader-card-bg);
    border: 1px solid var(--reader-border);
    border-radius: 20px;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mag-flipbook-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Reader Mode Toggle */
.mag-reader-mode-toggle {
    display: flex;
    background: var(--reader-card-bg);
    border: 1px solid var(--reader-border);
    border-radius: 8px;
    padding: 2px;
    gap: 2px;
}

.mag-mode-btn {
    background: transparent;
    border: none;
    padding: 4px 8px;
    font-size: 0.88rem;
    border-radius: 6px;
    cursor: pointer;
    color: var(--reader-text-muted);
    transition: all 0.2s;
}

.mag-mode-btn.active, .mag-mode-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    color: var(--reader-text-heading);
}

/* Theme Switcher Dots */
.mag-reader-theme-switcher {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--reader-card-bg);
    border: 1px solid var(--reader-border);
    border-radius: 20px;
    padding: 4px 8px;
}

.mag-theme-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
    outline: none;
}

.mag-theme-dot.theme-dot-dark { background: #161524; }
.mag-theme-dot.theme-dot-paper { background: #FAF7F2; }
.mag-theme-dot.theme-dot-sepia { background: #F4ECD8; }

.mag-theme-dot.active {
    border-color: var(--primary);
    transform: scale(1.15);
}

/* Main Viewport */
.mag-flipbook-viewport {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 28px 24px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: relative;
    outline: none;
}

/* Two-Page Spread Grid */
.mag-spread-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    min-height: 100%;
    margin: 0 auto;
    gap: 0;
    perspective: 1800px;
}

.mag-spread-page {
    flex: 1;
    min-width: 0;
    background: var(--reader-page-bg);
    color: var(--reader-text);
    border-radius: 8px;
    box-shadow: var(--reader-paper-shadow);
    padding: 40px 36px;
    position: relative;
    border: 1px solid var(--reader-border);
    display: flex;
    flex-direction: column;
}

.mag-spread-page.left-page {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.mag-spread-page.right-page {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
}

.mag-spread-spine {
    width: 28px;
    flex-shrink: 0;
    background: var(--reader-spine);
    box-shadow: inset 0 0 10px rgba(0,0,0,0.3);
    position: relative;
    z-index: 2;
}

.mag-single-page {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    background: var(--reader-page-bg);
    color: var(--reader-text);
    border-radius: 8px;
    box-shadow: var(--reader-paper-shadow);
    padding: 44px 38px;
    border: 1px solid var(--reader-border);
}

/* Bottom Bar */
.mag-flipbook-bottombar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    border-top: 1px solid var(--reader-border);
    background: rgba(0, 0, 0, 0.22);
    user-select: none;
    z-index: 5;
}

.mag-flipbook-progress-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 260px;
}

.mag-page-indicator {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--reader-text-muted);
}

.mag-reading-progress-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 2px;
    overflow: hidden;
}

.mag-reading-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #6c63ff, #00d2ff);
    transition: width 0.3s ease;
}

/* Table of Contents Drawer */
.mag-flipbook-toc-drawer {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 340px;
    background: var(--reader-page-bg);
    border-right: 1px solid var(--reader-border);
    box-shadow: 12px 0 35px rgba(0, 0, 0, 0.6);
    z-index: 20;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.mag-flipbook-toc-drawer.open {
    transform: translateX(0);
}

.mag-toc-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px;
    border-bottom: 1px solid var(--reader-border);
    background: rgba(0, 0, 0, 0.1);
}

.mag-toc-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mag-toc-item {
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    background: var(--reader-card-bg);
    border: 1px solid transparent;
    transition: all 0.2s;
    text-align: left;
}

.mag-toc-item:hover {
    border-color: rgba(139, 92, 246, 0.4);
    background: rgba(139, 92, 246, 0.1);
}

.mag-toc-item.active {
    border-color: #6c63ff;
    background: rgba(108, 99, 255, 0.15);
}

/* Discussion styling in theme-paper and theme-sepia */
.mag-flipbook-workspace.theme-paper .article-discussions-container textarea,
.mag-flipbook-workspace.theme-sepia .article-discussions-container textarea {
    background: #ffffff;
    color: #2c2925;
}

/* Responsive adjustments */
@media (max-width: 1023px) {
    .mag-spread-container {
        display: none !important;
    }
    .mag-reader-mode-toggle {
        display: none !important;
    }
    .mag-reader-btn-text {
        display: none;
    }
    .mag-flipbook-workspace {
        width: 100vw;
        height: 100vh;
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
    }
    .mag-single-page {
        padding: 24px 18px;
    }
    .mag-flipbook-toc-drawer {
        width: 290px;
    }
}
