:root {
    --bg-deep: #000000;
    --bg-card: #121212;
    --bg-elevated: #1a1a1a;
    --bg-muted: #242424;
    --border-soft: rgba(255, 255, 255, 0.07);
    --text-primary: #ffffff;
    --text-secondary: #9a9a9a;
    --text-muted: #6b6b6b;
    --accent: #c5e17a;
    --accent-hover: #d4ec96;
    --accent-dark: #0a0a0a;
    --accent-soft: rgba(197, 225, 122, 0.12);
    --accent-glow: rgba(197, 225, 122, 0.25);
    --danger-soft: rgba(255, 95, 95, 0.12);
    --success-soft: rgba(197, 225, 122, 0.15);
    --font-display: 'Vazirmatn', sans-serif;
    --font-body: 'Vazirmatn', sans-serif;
    --radius-sm: 0.75rem;
    --radius-md: 1rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.75rem;
    --radius-pill: 999px;
    --shadow-soft: 0 24px 80px rgba(0, 0, 0, 0.55);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
    --gold: var(--accent);
    --gold-hover: var(--accent-hover);
    --gold-soft: var(--accent-soft);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9375rem;
    line-height: 1.65;
    padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

body.article-page {
    padding-bottom: calc(7rem + env(safe-area-inset-bottom, 0px));
}

h1, h2, h3, h4, h5, h6, .brand-mark {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.text-accent { color: var(--accent) !important; }

/* ── Navbar ── */
.site-nav {
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-soft);
    padding-block: 0.85rem;
}

.site-nav .container {
    align-items: center;
}

@media (min-width: 992px) {
    .site-nav .navbar-collapse {
        display: flex !important;
        flex-grow: 1;
        align-items: center;
        justify-content: space-between;
        gap: 2.5rem;
        margin-inline-start: 2.5rem;
    }

    .site-nav .site-nav-main {
        flex-direction: row;
        gap: 0.35rem;
    }

    .site-nav .site-nav-actions {
        flex-direction: row;
        margin-inline-start: auto;
    }
}

.navbar-brand.brand-mark,
.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0;
    margin: 0;
    margin-inline-end: 0;
    flex-shrink: 0;
    line-height: 1;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

.navbar-brand.brand-mark:hover,
.site-brand:hover {
    color: var(--text-primary);
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-link:hover, .nav-link.active { color: var(--text-primary) !important; }

.nav-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: border-color 0.2s, background 0.2s;
}

.nav-icon-btn:hover {
    border-color: var(--accent-glow);
    color: var(--accent);
}

.user-pill {
    background: var(--accent-soft);
    color: var(--accent) !important;
    border-radius: var(--radius-pill);
    padding: 0.4rem 1rem !important;
}

/* ── Buttons ── */
.btn-gold, .btn-accent {
    background: var(--accent);
    border: none;
    color: var(--accent-dark);
    font-weight: 700;
    border-radius: var(--radius-pill);
    padding: 0.65rem 1.5rem;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.btn-gold:hover, .btn-accent:hover {
    background: var(--accent-hover);
    color: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-outline-gold, .btn-outline-accent {
    border: 1px solid rgba(197, 225, 122, 0.35);
    color: var(--accent);
    background: transparent;
    border-radius: var(--radius-pill);
    font-weight: 600;
}

.btn-outline-gold:hover, .btn-outline-accent:hover {
    background: var(--accent-soft);
    border-color: var(--accent);
    color: var(--accent-hover);
}

.btn-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.btn-circle-lg {
    width: 64px;
    height: 64px;
    font-size: 1.25rem;
}

/* ── Cards ── */
.glass-card, .card-dark {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.card-dark {
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    overflow: hidden;
}

.card-dark:hover {
    transform: translateY(-3px);
    border-color: rgba(197, 225, 122, 0.2);
    box-shadow: var(--shadow-soft);
}

.card-cover {
    aspect-ratio: 3/4;
    object-fit: cover;
    width: 100%;
    filter: grayscale(20%);
    transition: filter 0.3s;
}

.card-dark:hover .card-cover { filter: grayscale(0%); }

/* ── Category chips (catalog / home) ── */
.category-rail {
    position: relative;
}

.category-rail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0.5rem;
    width: 2.5rem;
    background: linear-gradient(to left, transparent, var(--bg-base));
    pointer-events: none;
    z-index: 1;
}

.category-scroll {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 0.25rem 0 0.75rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.category-scroll::-webkit-scrollbar { display: none; }

.category-chip {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 148px;
    padding: 0.7rem 1rem;
    border-radius: 1rem;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    text-decoration: none;
    scroll-snap-align: start;
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.category-chip:hover {
    color: var(--text-primary);
    border-color: rgba(197, 225, 122, 0.28);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.category-chip.active {
    background: linear-gradient(145deg, rgba(197, 225, 122, 0.18), rgba(197, 225, 122, 0.06));
    border-color: rgba(197, 225, 122, 0.55);
    color: var(--text-primary);
    box-shadow: 0 0 0 1px rgba(197, 225, 122, 0.15), 0 10px 28px rgba(197, 225, 122, 0.12);
}

.category-chip-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.05rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.category-chip.active .category-chip-icon {
    background: rgba(197, 225, 122, 0.16);
    border-color: rgba(197, 225, 122, 0.35);
    color: var(--accent);
}

.category-chip-body {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.category-chip-name {
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.category-chip-count {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.category-chip.active .category-chip-count {
    color: rgba(197, 225, 122, 0.85);
}

/* ── Hero / Explore ── */
.explore-header {
    padding: 2rem 0 1.5rem;
}

.explore-title {
    font-size: clamp(1.35rem, 3.5vw, 1.85rem);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.35rem;
}

.explore-subtitle {
    color: var(--text-secondary);
    font-size: 0.875rem;
    max-width: 640px;
}

.home-intro {
    padding: 1rem 0 1.25rem;
}

.home-intro-text {
    max-width: 100%;
}

.home-intro .explore-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    letter-spacing: -0.01em;
}

.home-intro .explore-subtitle {
    font-size: 0.72rem;
    line-height: 1.5;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* ── Featured card ── */
.featured-showcase {
    position: relative;
    padding: 2rem 0 3rem;
}

.featured-card {
    position: relative;
    max-width: 280px;
    margin: 0 auto;
    text-align: center;
}

.featured-cover-wrap {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    aspect-ratio: 3/4;
    max-width: 220px;
    margin: 0 auto;
    background: var(--bg-elevated);
}

.featured-cover-wrap .featured-placeholder-icon {
    font-size: 2rem;
    opacity: 0.35;
}

.featured-cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(30%);
}

.featured-cover-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 55%, rgba(0, 0, 0, 0.75) 100%);
    pointer-events: none;
}

.featured-action-btn {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    color: var(--accent-dark);
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, background 0.2s ease;
}

.featured-action-btn:hover {
    transform: translateX(-50%) scale(1.06);
    background: var(--accent-hover);
    color: var(--accent-dark);
}

.featured-action-btn i {
    font-size: 1rem;
    line-height: 1;
}

.featured-meta {
    margin-top: 1.25rem;
    padding-top: 0.25rem;
}

.featured-meta h3 {
    font-size: 1.15rem;
    margin-bottom: 0.25rem;
}

.featured-meta .author {
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ── Continue reading ── */
.section-label {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.continue-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    transition: border-color 0.2s;
}

.continue-card:hover {
    border-color: rgba(197, 225, 122, 0.2);
}

.continue-thumb {
    width: 56px;
    height: 72px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--bg-muted);
}

.continue-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.25rem;
}

.continue-info { flex: 1; min-width: 0; }

.continue-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.continue-info .author-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.progress-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.progress-bar-custom {
    flex: 1;
    height: 4px;
    background: var(--bg-muted);
    border-radius: var(--radius-pill);
    overflow: hidden;
}

.progress-bar-custom .fill {
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-pill);
    transition: width 0.4s ease;
}

.progress-percent {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent);
    min-width: 36px;
    text-align: left;
}

/* ── Book grid ── */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1.25rem;
}

.media-item {
    text-decoration: none;
    color: inherit;
}

.media-item .cover-box {
    aspect-ratio: 3/4;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-elevated);
    margin-bottom: 0.75rem;
    position: relative;
}

.media-item .cover-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s, filter 0.3s;
    filter: grayscale(15%);
}

.media-item:hover .cover-box img {
    transform: scale(1.04);
    filter: grayscale(0%);
}

.media-item h3 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    line-height: 1.4;
}

.media-item .meta {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ── Catalog pages (posts / books) ── */
.catalog-hero {
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 0.5rem;
}

.catalog-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 0.65rem;
}

.catalog-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
}

.catalog-breadcrumb a:hover {
    color: var(--accent);
}

.catalog-breadcrumb i {
    font-size: 0.65rem;
    opacity: 0.7;
}

.catalog-body {
    padding-top: 1.5rem;
}

.catalog-section + .catalog-section {
    margin-top: 2.75rem;
    padding-top: 2.75rem;
    border-top: 1px solid var(--border-soft);
}

.catalog-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.catalog-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
}

.catalog-section-desc {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    max-width: 640px;
    line-height: 1.6;
}

.catalog-section-link {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    white-space: nowrap;
    padding-top: 0.15rem;
}

.catalog-section-link:hover {
    color: var(--accent-hover);
}

.catalog-post-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
    color: inherit;
}

.catalog-post-card:hover {
    border-color: rgba(197, 225, 122, 0.25);
    transform: translateY(-2px);
}

.catalog-post-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    background: var(--bg-muted);
}

.catalog-post-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.5rem;
}

.catalog-post-body {
    padding: 1rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.catalog-post-body h3 {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.45;
    margin: 0 0 0.45rem;
    color: var(--text-primary);
}

.catalog-post-body p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0 0 0.65rem;
    flex: 1;
}

.catalog-post-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
}

.catalog-book-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

@media (min-width: 768px) {
    .catalog-book-grid {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    }
}

/* ── Article detail hero ── */
.article-hero {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
    margin-bottom: 0;
}

.article-hero-bg {
    position: absolute;
    inset: 0;
    background: var(--bg-elevated);
}

.article-hero-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    filter: grayscale(40%);
}

.article-hero-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.5) 40%, #000 100%);
}

.article-hero-content {
    position: relative;
    z-index: 2;
    padding: 3rem 0 2rem;
    width: 100%;
}

.article-hero .author-label {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.article-hero h1 {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.article-hero .subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    max-width: 600px;
}

.tag-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.tag-pill {
    padding: 0.4rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.stats-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--border-soft);
    border-bottom: 1px solid var(--border-soft);
    margin-bottom: 2rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.stat-item i { color: var(--accent); }

.stat-item strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ── Fixed bottom bar ── */
.reading-dock {
    position: fixed;
    bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
    left: 0;
    right: 0;
    z-index: 1040;
    padding: 0 1rem;
    pointer-events: none;
}

.reading-dock-inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem;
    background: rgba(18, 18, 18, 0.95);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    backdrop-filter: blur(16px);
    box-shadow: var(--shadow-soft);
    pointer-events: all;
}

.reading-dock .btn-read-main {
    flex: 1;
    min-height: 52px;
    font-size: 0.95rem;
    padding: 0.75rem 1.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    line-height: 1;
}

.reading-dock .favorite-btn {
    width: 52px;
    height: 52px;
    min-width: 52px;
    min-height: 52px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
}

.reading-dock .btn-read-main.is-read {
    background: var(--success-soft);
    border: 1px solid rgba(197, 225, 122, 0.35);
    color: var(--accent);
}

.reading-dock .favorite-btn.is-favorited {
    background: rgba(255, 107, 129, 0.12);
    border-color: rgba(255, 107, 129, 0.45);
    color: #ff8fa3;
}

.reading-dock .favorite-btn.is-favorited i {
    color: #ff8fa3;
}

@media (min-width: 992px) {
    .reading-dock {
        bottom: 1.5rem;
    }

    body.article-page {
        padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
    }
}

/* ── Bottom nav (mobile) ── */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1050;
    background: rgba(0, 0, 0, 0.96);
    border-top: 1px solid var(--border-soft);
    padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom, 0px));
    backdrop-filter: blur(20px);
}

.mobile-bottom-nav .nav-items {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 480px;
    margin: 0 auto;
}

.mobile-bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}

.mobile-bottom-nav a i { font-size: 1.25rem; }

.mobile-bottom-nav a.active,
.mobile-bottom-nav a:hover {
    color: var(--accent);
}

@media (min-width: 992px) {
    .mobile-bottom-nav { display: none; }
    body { padding-bottom: 0; }
    body.article-page { padding-bottom: 5rem; }
}

/* ── Content ── */
.badge-type {
    background: var(--accent-soft);
    color: var(--accent);
    border: none;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0.35em 0.75em;
    border-radius: var(--radius-pill);
}

.meta-line {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0;
}

.section-label {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.content-article {
    font-size: 1.05rem;
    line-height: 2;
    color: rgba(255, 255, 255, 0.88);
}

.content-article img {
    max-width: 100%;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
}

.content-article blockquote {
    border-right: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
}

.article-audio {
    padding: 1rem 1.1rem 1.15rem;
    border: 1px solid rgba(197, 225, 122, 0.18);
    background: linear-gradient(145deg, rgba(197, 225, 122, 0.06), rgba(255, 255, 255, 0.02));
}

.article-audio-head {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.article-audio-icon {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 0.85rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(197, 225, 122, 0.14);
    color: var(--accent);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.article-audio-meta {
    flex: 1;
    min-width: 0;
}

.article-audio-title {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}

.article-audio-sub {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.article-audio-download {
    flex-shrink: 0;
    white-space: nowrap;
}

.article-audio-player {
    height: 42px;
    border-radius: 999px;
    outline: none;
}

.article-audio-player::-webkit-media-controls-panel {
    background: var(--bg-elevated);
}

.comment-item { border-bottom: 1px solid var(--border-soft); }
.comment-item:last-child { border-bottom: none; }

.avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.avatar-img {
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid rgba(197, 225, 122, 0.15);
}

.avatar-xs { width: 28px; height: 28px; font-size: 0.75rem; }
.avatar-sm { width: 32px; height: 32px; font-size: 0.8rem; }
.avatar-lg { width: 56px; height: 56px; font-size: 1.1rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.35rem; }

.profile-header {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-upload-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border: 1px solid var(--border-soft);
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.user-cell-body {
    min-width: 0;
}

.user-cell-body strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-cell-body span {
    display: block;
    font-size: 0.78rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-pill .avatar-circle,
.user-pill .avatar-img {
    width: 26px;
    height: 26px;
    font-size: 0.7rem;
}

.stat-card {
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
}

.stat-card .stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
}

/* ── Forms ── */
.form-control, .form-select {
    background: var(--bg-elevated);
    border-color: var(--border-soft);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
}

.form-control:focus, .form-select:focus {
    background: var(--bg-elevated);
    border-color: rgba(197, 225, 122, 0.45);
    box-shadow: 0 0 0 0.2rem rgba(197, 225, 122, 0.12);
    color: var(--text-primary);
}

.form-control::placeholder { color: var(--text-muted); }

/* ── Admin compat (layout in admin.css) ── */

.table-dark-custom {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    --bs-table-border-color: var(--border-soft);
}

/* ── Footer ── */
.site-footer {
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border-soft);
    margin-top: 3rem;
    background: var(--bg-deep);
}

.footer-links {
    display: flex;
    gap: 1.25rem;
    justify-content: flex-start;
}

.footer-links a { color: var(--text-secondary); }
.footer-links a:hover { color: var(--accent); }

.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem 1.5rem;
}

.developer-credit-wrap {
    margin-right: auto;
}

.developer-credit {
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.developer-credit:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.page-header { padding: 2rem 0 1.5rem; }

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.pagination .page-link {
    background: var(--bg-elevated);
    border-color: var(--border-soft);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    margin: 0 0.15rem;
}

.pagination .page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.breadcrumb { --bs-breadcrumb-divider-color: var(--text-muted); }
.breadcrumb-item a { color: var(--text-secondary); }
.breadcrumb-item.active { color: var(--text-muted); }

.modal-content.glass-card { background: var(--bg-card); }

.alert-success {
    background: var(--success-soft);
    border-color: rgba(197, 225, 122, 0.25);
    color: var(--accent);
}

@media (max-width: 991.98px) {
    .site-footer { padding-bottom: 5rem; }
    .featured-showcase { padding-bottom: 2rem; }
}

/* ── Logo ── */
.site-logo {
    height: 36px;
    width: auto;
    max-width: 110px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
}

.site-logo-preview {
    height: 48px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: block;
}

.navbar-brand .brand-text,
.site-brand .brand-text {
    display: block;
    font-weight: 800;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--text-primary);
}

/* ── Homepage banners ── */
.banner-strip {
    width: 100%;
    padding: 1rem 0 1.15rem;
    border-bottom: 1px solid var(--border-soft);
    background: var(--bg-deep);
}

.banner-row {
    width: 100%;
    margin-inline: auto;
}

.banner-card {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 2.2 / 1;
    min-height: 140px;
    border: none;
    text-decoration: none;
    color: #fff;
    background: var(--bg-deep);
    box-shadow: none;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.banner-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.45s ease, filter 0.35s ease;
    filter: brightness(0.88) saturate(0.92);
}

.banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.05) 0%, rgba(0, 0, 0, 0.68) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 0.65rem 0.75rem;
    pointer-events: none;
}

.banner-overlay strong {
    font-size: 0.78rem;
    font-weight: 600;
    display: block;
    line-height: 1.35;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
}

.banner-overlay span {
    font-size: 0.68rem;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.35;
    margin-top: 0.1rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.banner-card:hover {
    transform: translateY(-2px);
    filter: brightness(1.04);
}

.banner-card:hover img {
    transform: scale(1.05);
    filter: brightness(0.92) saturate(1);
}

@media (max-width: 767.98px) {
    .banner-strip {
        padding: 0.75rem 0 0.95rem;
    }

    .banner-card {
        aspect-ratio: 2 / 1;
        min-height: 96px;
        border-radius: var(--radius-sm);
    }

    .banner-overlay {
        padding: 0.45rem 0.5rem;
    }

    .banner-overlay strong {
        font-size: 0.62rem;
    }

    .banner-overlay span {
        font-size: 0.58rem;
    }
}

@media (max-width: 399.98px) {
    .banner-card {
        min-height: 82px;
    }

    .banner-overlay span {
        display: none;
    }
}

/* ── Animations ── */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.animate-in {
    opacity: 0;
    animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }

.reveal-on-scroll {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s ease, transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.card-dark,
.continue-card,
.media-item,
.stat-card {
    animation: fadeInUp 0.6s ease backwards;
}

.section-label {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.leaderboard-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--accent-soft);
    padding: 0.25rem 0.65rem;
    border-radius: var(--radius-pill);
}

.leaderboard-live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ff4d4d;
    display: inline-block;
}

.leaderboard-live-dot.is-pulse {
    animation: livePulse 1.5s ease infinite;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.85); }
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    transition: transform 0.2s;
}

.leaderboard-item:first-child {
    border: 1px solid rgba(197, 225, 122, 0.25);
}

.leaderboard-rank {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.leaderboard-item:first-child .leaderboard-rank {
    background: var(--accent);
    color: var(--accent-dark);
}

.leaderboard-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.leaderboard-avatar.avatar-img {
    display: block;
}

.leaderboard-info {
    flex: 1;
    min-width: 0;
}

.leaderboard-info strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
}

.leaderboard-info span {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.leaderboard-score {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--accent);
}

@media (max-width: 575.98px) {
    .media-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .reading-dock-inner {
        border-radius: 1rem !important;
    }

    .article-hero {
        min-height: 280px;
    }

    .stat-card .stat-value {
        font-size: 1.75rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .animate-in,
    .reveal-on-scroll,
    .card-dark,
    .continue-card,
    .media-item,
    .stat-card,
    .banner-card {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}
