/* --- ARTICLE PAGE ENHANCEMENTS --- */

.article-layout-container {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.articles-main-col {
    flex: 1;
    min-width: 0;
    /* Fix flex overflow */
}

.articles-sidebar {
    width: 320px;
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--text-primary, #1e293b);
    margin-bottom: 32px;
    position: relative;
    display: inline-block;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--accent-primary, #3b82f6);
    border-radius: 2px;
}

/* --- TOOLBAR --- */
.articles-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.search-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

#search-input {
    width: 100%;
    padding: 10px 10px 10px 36px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
}

#search-input:focus {
    outline: none;
    border-color: var(--accent-primary, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-wrapper {
    display: flex;
    gap: 12px;
}

.filter-wrapper select {
    padding: 10px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background-color: #f8fafc;
    font-size: 0.9rem;
    cursor: pointer;
}

/* --- ARTICLE CARDS --- */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.article-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    opacity: 0;
    animation: fadeInSlideUp 0.5s ease forwards;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.article-card:active {
    transform: translateY(-4px) scale(0.99);
}

.card-thumbnail {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    background-color: #f1f5f9;
}

.card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.6s ease;
}

.card-thumbnail img.loaded {
    opacity: 1;
}

.card-category-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    color: var(--accent-primary, #3b82f6);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-content {
    padding: 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 12px;
    line-height: 1.3;
    transition: color 0.2s;
}

.article-card:hover .card-title {
    color: var(--accent-primary, #3b82f6);
}

.card-snippet {
    font-size: 0.95rem;
    color: #64748b;
    margin-bottom: 20px;
    line-height: 1.5;
    flex: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
    font-size: 0.85rem;
    color: #94a3b8;
}

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

.author-name {
    font-weight: 600;
    color: #475569;
}

/* --- SIDEBAR --- */
.sidebar-section {
    margin-bottom: 32px;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--accent-primary, #3b82f6);
    border-radius: 2px;
}

.sidebar-card {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid #f1f5f9;
}

.countdown-sidebar-card {
    background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 100%);
    border: 1px solid rgba(59, 130, 246, 0.1);
}

.sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
}

.sidebar-item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.sidebar-item-info {
    flex: 1;
    min-width: 0;
}

.sidebar-item-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
}

.sidebar-item:hover .sidebar-item-title {
    color: var(--accent-primary, #3b82f6);
}

.sidebar-item-date {
    font-size: 0.75rem;
    color: #94a3b8;
}

.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-btn {
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 0.85rem;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s;
}

.tag-btn:hover,
.tag-btn.active {
    background: var(--accent-primary, #3b82f6);
    color: #fff;
    border-color: var(--accent-primary, #3b82f6);
}

/* --- LOADER, SKELETON & EMPTY STATE --- */
.loader-anim {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px;
    gap: 12px;
    color: #94a3b8;
}

/* Skeleton Loading */
.skeleton-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    height: 400px;
    display: flex;
    flex-direction: column;
}

.skeleton-img {
    height: 200px;
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}

.skeleton-text {
    padding: 24px;
    flex: 1;
}

.skeleton-line {
    height: 12px;
    background: #f1f5f9;
    margin-bottom: 12px;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-line.title {
    height: 20px;
    width: 80%;
    margin-bottom: 20px;
}

.skeleton-line.short {
    width: 40%;
}

.shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 1.5s infinite;
}

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

    100% {
        transform: translateX(100%);
    }
}

.scanner-dot {
    width: 40px;
    height: 40px;
    border: 3px solid #f1f5f9;
    border-top: 3px solid var(--accent-primary, #3b82f6);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 3rem;
    color: #e2e8f0;
    margin-bottom: 16px;
}

.empty-state h3 {
    color: #1e293b;
    margin-bottom: 8px;
}

.empty-state p {
    color: #64748b;
}

/* --- READING VIEW --- */
body.reading-mode {
    background: #f5f7fb;
}

.social-share-bar {
    display: none !important;
}

.scroll-progress-container {
    position: fixed;
    top: 70px;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 40;
    background: rgba(100, 116, 139, 0.1);
}

.scroll-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #16a34a, #22c55e);
    transition: width 0.12s linear;
}

.page-articles-unified {
    --reading-font-body: "Newsreader", Georgia, serif;
    --reading-font-ui: "Source Sans 3", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    --reading-gutter: clamp(16px, 4.8vw, 24px);
    --reading-paragraph-gap: 1.28em;
    --reading-sticky-top: 84px;
    --reading-hero-gap: clamp(10px, 1.9vw, 16px);
}

#article-detail-content .article-detail,
#article-detail-container .article-detail {
    max-width: 860px;
    margin: 0 auto;
    padding: 18px var(--reading-gutter) 22px;
}

.reading-hero {
    display: flex;
    flex-direction: column;
    gap: var(--reading-hero-gap);
    margin-bottom: 10px;
}

.reading-back-link {
    width: fit-content;
    min-height: 44px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #d7e0ea;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.reading-back-link:hover {
    background: #eef2f7;
    border-color: #c8d3df;
    color: #0b1320;
}

.reading-kicker {
    margin: 0;
    font-family: var(--reading-font-ui);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-weight: 800;
    color: #047857;
    line-height: 1.3;
}

.detail-title {
    margin: 0;
    font-family: var(--reading-font-ui);
    font-size: 1.82rem;
    line-height: 1.16;
    font-weight: 800;
    color: #111827;
    text-wrap: balance;
}

.detail-dek {
    margin: 0;
    font-family: var(--reading-font-ui);
    font-size: 1.02rem;
    line-height: 1.72;
    color: #475569;
    max-width: 66ch;
}

.reading-byline {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    font-family: var(--reading-font-ui);
}

.byline-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 0.81rem;
    font-weight: 650;
    font-family: var(--reading-font-ui);
}

.byline-item i {
    color: #2563eb;
}

.article-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    margin: 2px 0 0;
    background: #e2e8f0;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.hero-img.is-loaded {
    opacity: 1;
}

.reading-summary-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #64748b;
    font-size: 0.82rem;
    margin-bottom: 2px;
    font-family: var(--reading-font-ui);
}

.reading-tools {
    position: sticky;
    top: var(--reading-sticky-top);
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 12px;
    margin: 2px 0 16px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #e2e8f0;
    backdrop-filter: blur(6px);
}

.reading-tools-status {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    color: #1e293b;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: var(--reading-font-ui);
}

.reading-tools-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.reading-tool-btn {
    min-height: 44px;
    padding: 9px 14px;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--reading-font-ui);
}

.reading-tool-btn.primary {
    border-color: #111827;
    background: #111827;
    color: #fff;
}

.article-toc {
    margin: 0 0 16px;
    padding: 13px 14px;
    border-radius: 14px;
    border: 1px solid #dfe7f0;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.toc-title {
    font-family: var(--reading-font-ui);
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #475569;
    font-weight: 800;
    margin-bottom: 8px;
}

.toc-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 5px;
}

.toc-item.is-sub {
    margin-left: 10px;
    padding-left: 10px;
    border-left: 1px solid #dbe6f1;
}

.toc-link {
    display: block;
    padding: 6px 8px;
    border-radius: 8px;
    text-decoration: none;
    color: #334155;
    font-size: 0.88rem;
    line-height: 1.4;
    transition: background-color 0.16s ease, color 0.16s ease;
    font-family: var(--reading-font-ui);
}

.toc-link:hover {
    background: #eef4fb;
    color: #1e293b;
}

.toc-link.active {
    background: #eaf7f1;
    color: #047857;
    font-weight: 700;
}

.reading-back-link:focus-visible,
.reading-tool-btn:focus-visible,
.more-articles-btn:focus-visible,
.toc-link:focus-visible {
    outline: 2px solid #0f766e;
    outline-offset: 2px;
}

.article-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 10px 0 20px;
}

.article-content-body {
    max-width: min(72ch, 100%);
    margin: 0 auto;
    font-family: var(--reading-font-body);
    font-size: 1.05rem;
    line-height: 1.9;
    letter-spacing: 0.002em;
    color: #111827;
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

.article-content-body p {
    margin: 0 0 var(--reading-paragraph-gap);
}

.article-content-body p:last-child {
    margin-bottom: 0;
}

.article-content-body h1,
.article-content-body h2,
.article-content-body h3,
.article-content-body h4 {
    margin: 1.9em 0 0.75em;
    line-height: 1.35;
    color: #0f172a;
    font-family: var(--reading-font-ui);
    letter-spacing: 0;
}

.article-content-body h2 {
    margin-top: 2.05em;
    margin-bottom: 0.74em;
    font-size: 1.45rem;
    line-height: 1.28;
}

.article-content-body h3 {
    margin-top: 1.72em;
    margin-bottom: 0.66em;
    font-size: 1.2rem;
    line-height: 1.3;
}

.article-content-body blockquote {
    margin: 1.4em 0;
    padding: 0.15em 0 0.15em 1em;
    border-left: 3px solid #16a34a;
    color: #334155;
    font-style: italic;
}

.article-content-body ul,
.article-content-body ol {
    margin: 0 0 1.2em 1.3em;
    padding: 0;
}

.article-content-body li {
    margin: 0 0 0.55em;
}

.article-content-body a {
    color: #0f766e;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.16em;
}

.article-content-body img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
    margin: 1.25em 0;
    background: #e2e8f0;
}

.article-content-body [id] {
    scroll-margin-top: 108px;
}

.rec-skeleton {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 12px;
    background: #fff;
    border: 1px solid #eef2f7;
    border-radius: 14px;
    padding: 10px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.04);
}

.rec-skeleton-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #e2e8f0;
    position: relative;
}

.rec-skeleton-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rec-skeleton-line {
    height: 12px;
    background: #e2e8f0;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.rec-skeleton-line.short {
    width: 70%;
}

.rec-skeleton-line.tiny {
    width: 50%;
}

.article-recommendations {
    margin-top: 34px;
}

.rec-title {
    font-size: 1.08rem;
    font-weight: 800;
    margin-bottom: 14px;
    color: #1e293b;
}

.rec-grid {
    display: grid;
    gap: 14px;
}

.rec-card {
    display: grid;
    grid-template-columns: 126px 1fr;
    gap: 13px;
    background: #fff;
    border: 1px solid #dde6f0;
    border-radius: 15px;
    padding: 11px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rec-card:hover {
    transform: translateY(-2px);
    border-color: #cfdbe8;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.07);
}

.rec-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    overflow: hidden;
    background: #f1f5f9;
}

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

.rec-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rec-card-title {
    font-size: 0.98rem;
    font-weight: 700;
    line-height: 1.36;
}

.rec-card-snippet {
    font-size: 0.84rem;
    color: #5b6b7f;
    line-height: 1.53;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rec-loading,
.rec-empty {
    padding: 12px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.more-articles-wrap {
    margin-top: 20px;
}

.more-articles-btn {
    width: 100%;
    min-height: 46px;
    border: 1px solid #c5d2df;
    border-radius: 12px;
    background: #fdfefe;
    color: #1e293b;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.more-articles-btn:hover {
    border-color: #a8bccf;
    background: #f6fbff;
    color: #0f172a;
}

.fade-in {
    animation: articleFadeIn 0.4s ease;
}

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

.page-articles-unified #header-back-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 50%;
    margin-right: 8px;
    color: #475569;
}

body.page-articles-unified.reading-mode .premium-fab-container {
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
}

@media (min-width: 768px) {
    #article-detail-content .article-detail,
    #article-detail-container .article-detail {
        padding: 22px 24px;
    }

    .detail-title {
        font-size: 2.35rem;
    }

    .rec-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* --- RESPONSIVE --- */
@media (max-width: 1024px) {
    .article-layout-container {
        flex-direction: column;
    }

    .articles-sidebar {
        width: 100%;
        position: static;
        order: -1;
    }
}

@media (max-width: 640px) {
    .page-articles-unified {
        --reading-gutter: clamp(18px, 5.6vw, 24px);
        --reading-paragraph-gap: 1.34em;
        --reading-sticky-top: calc(56px + env(safe-area-inset-top, 0px) + 8px);
        --reading-hero-gap: 11px;
    }

    .articles-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 10px;
    }

    .filter-wrapper {
        width: 100%;
    }

    .filter-wrapper select {
        width: 100%;
    }

    #article-detail-content .article-detail,
    #article-detail-container .article-detail {
        padding: 14px var(--reading-gutter) 18px;
    }

    .detail-title {
        font-size: 1.56rem;
        line-height: 1.22;
    }

    .detail-dek {
        font-size: 0.98rem;
        line-height: 1.7;
    }

    .reading-tools {
        padding: 9px 10px;
    }

    .article-hero {
        border-radius: 14px;
    }

    .reading-summary-meta {
        font-size: 0.8rem;
    }

    .reading-tools-actions {
        width: 100%;
        gap: 6px;
    }

    .reading-tool-btn {
        flex: 1 1 auto;
        justify-content: center;
        min-height: 42px;
        font-size: 0.8rem;
    }

    .article-content-body {
        font-size: 1.08rem;
        line-height: 1.92;
    }

    .article-content-body h2 {
        margin-top: 1.9em;
        margin-bottom: 0.66em;
        font-size: 1.28rem;
    }

    .article-content-body h3 {
        margin-top: 1.6em;
        margin-bottom: 0.58em;
        font-size: 1.14rem;
    }

    .rec-card {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 10px;
    }

    .rec-thumb {
        aspect-ratio: 16 / 9;
        border-radius: 10px;
    }

    .rec-card-snippet {
        -webkit-line-clamp: 3;
    }

    .article-toc {
        padding: 12px 12px;
    }

    .toc-link {
        padding: 6px 7px;
        font-size: 0.86rem;
    }
}

/* --- Reading View Final Density Patch (Single Source Override) --- */
body.page-articles-unified.reading-mode {
    --reading-paper-bg: #fdfdfd;
    --reading-paper-bg-soft: #ffffff;
    --reading-gutter: clamp(14px, 4.4vw, 18px);
    --reading-paragraph-gap: clamp(12px, 3.2vw, 16px);
    --reading-heading-gap-top: clamp(30px, 7.4vw, 42px);
    --reading-heading-gap-bottom: clamp(12px, 3.1vw, 16px);
    background: var(--reading-paper-bg);
}

body.page-articles-unified.reading-mode .main-content {
    background: var(--reading-paper-bg);
}

body.page-articles-unified.reading-mode #article-detail-content .article-detail,
body.page-articles-unified.reading-mode #article-detail-container .article-detail {
    background: linear-gradient(180deg, var(--reading-paper-bg) 0%, var(--reading-paper-bg-soft) 35%);
}

@media (max-width: 767.98px) {
    body.page-articles-unified.reading-mode #article-detail-content .article-detail,
    body.page-articles-unified.reading-mode #article-detail-container .article-detail {
        max-width: none;
        margin: 0;
        padding: 4px var(--reading-gutter) 18px;
    }

    body.page-articles-unified.reading-mode .article-content-body {
        width: 100%;
        max-width: none;
        margin: 0;
        font-size: clamp(1.095rem, 1.95vw, 1.145rem);
        line-height: 1.6;
        text-rendering: optimizeLegibility;
        font-kerning: normal;
        font-feature-settings: "kern" 1, "liga" 1, "clig" 1;
        -webkit-font-smoothing: antialiased;
        hyphens: auto;
        color: #222;
    }

    body.page-articles-unified.reading-mode .article-content-body p {
        margin: 0;
        margin-block: var(--reading-paragraph-gap);
    }

    body.page-articles-unified.reading-mode .article-content-body p:first-child {
        margin-top: 0;
    }

    body.page-articles-unified.reading-mode .article-content-body p:last-child {
        margin-bottom: 0;
    }

    body.page-articles-unified.reading-mode .article-content-body h2,
    body.page-articles-unified.reading-mode .article-content-body h3,
    body.page-articles-unified.reading-mode .article-content-body h4 {
        margin-top: var(--reading-heading-gap-top);
        margin-bottom: var(--reading-heading-gap-bottom);
        line-height: 1.26;
    }

    body.page-articles-unified.reading-mode .article-content-body h2 {
        font-size: clamp(1.28rem, 4.2vw, 1.46rem);
        font-weight: 800;
    }

    body.page-articles-unified.reading-mode .article-content-body h3 {
        font-size: clamp(1.14rem, 3.35vw, 1.24rem);
        font-weight: 800;
    }

    body.page-articles-unified.reading-mode .article-content-body h4 {
        font-size: clamp(1.04rem, 2.9vw, 1.14rem);
        font-weight: 700;
    }

    body.page-articles-unified.reading-mode .article-content-body ul,
    body.page-articles-unified.reading-mode .article-content-body ol {
        margin-block: 14px;
        padding-left: 20px;
    }

    body.page-articles-unified.reading-mode .article-content-body li {
        margin-bottom: clamp(8px, 2.1vw, 10px);
        line-height: 1.6;
    }

    body.page-articles-unified.reading-mode .article-content-body li:last-child {
        margin-bottom: 0;
    }
}

@media (min-width: 768px) {
    body.page-articles-unified.reading-mode {
        --reading-gutter: 24px;
    }

    body.page-articles-unified.reading-mode #article-detail-content .article-detail,
    body.page-articles-unified.reading-mode #article-detail-container .article-detail {
        max-width: 680px;
        margin: 0 auto;
        padding-left: var(--reading-gutter);
        padding-right: var(--reading-gutter);
    }

    body.page-articles-unified.reading-mode .article-content-body {
        max-width: min(67ch, 100%);
        margin: 0 auto;
        font-size: clamp(1.08rem, 0.26vw + 1rem, 1.14rem);
        line-height: 1.62;
        letter-spacing: 0.001em;
    }

    body.page-articles-unified.reading-mode .article-content-body h2 {
        font-size: clamp(1.5rem, 0.52vw + 1.3rem, 1.72rem);
    }

    body.page-articles-unified.reading-mode .article-content-body h3 {
        font-size: clamp(1.25rem, 0.34vw + 1.12rem, 1.4rem);
    }
}

/* --- Ultra-Compact Mobile Edge Patch (force-remove parent gutters) --- */
@media (max-width: 767.98px) {
    body.page-articles-unified.reading-mode .main-content {
        padding-left: 0;
        padding-right: 0;
    }

    body.page-articles-unified.reading-mode .main-content > .container.article-layout-container {
        width: 100%;
        max-width: none;
        margin-left: 0;
        margin-right: 0;
        padding-left: 0;
        padding-right: 0;
    }

    body.page-articles-unified.reading-mode #article-detail-view.articles-main-col,
    body.page-articles-unified.reading-mode #article-detail-content {
        width: 100%;
        margin: 0;
        padding-left: 0;
        padding-right: 0;
    }

    body.page-articles-unified.reading-mode #article-detail-content .article-detail,
    body.page-articles-unified.reading-mode #article-detail-container .article-detail {
        padding-left: var(--reading-gutter);
        padding-right: var(--reading-gutter);
    }
}
