html {
    scroll-padding-top: 96px !important;
}

/* ============================================================
   МЕДИА-РИДЕР 2.0 (PRODUCTION SPECIFICATION ДЛЯ СТАТЕЙ)
   Файл: static/article_reader.css
   ============================================================ */

:root {
    --article-bg: #fcfcfd;
    --article-text: #1a1f2c;
    --article-lead: #475569;
    --font-heading-h1: 'Unbounded', 'Manrope', -apple-system, sans-serif;
    --font-heading: 'Manrope', 'Plus Jakarta Sans', -apple-system, sans-serif;
    --font-article: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

[data-theme="dark"], body.dark {
    --article-bg: #07090e;
    --article-text: #e2e8f0;
    --article-lead: #94a3b8;
}

/* Лейаут: Две колонки (Оглавление слева + Контент) */
.article-reader-container {
    max-width: 1400px;
    margin: 30px auto 80px;
    padding: 0 24px;
    display: grid !important;
    grid-template-columns: minmax(220px, 1fr) minmax(auto, 780px) minmax(220px, 1fr) !important;
    gap: 40px !important;
    align-items: start !important;
    position: relative;
    box-sizing: border-box;
}

/* Липкое оглавление слева (TOC Desktop) */
.article-toc-sidebar {
    grid-column: 1 !important;
    justify-self: end !important;
    width: 260px;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 20px 16px;
    background: var(--bg-elevated, #ffffff);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    box-shadow: var(--shadow-sm);
    scrollbar-width: thin;
    box-sizing: border-box;
}

.article-toc-sidebar::-webkit-scrollbar {
    width: 4px;
}
.article-toc-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.article-toc-title {
    font-family: var(--font-heading);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    font-weight: 800;
    color: var(--text-light, #64748b);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.article-toc-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-toc-item {
    margin-bottom: 6px;
}

.article-toc-item.level-3 {
    padding-left: 14px;
    font-size: 13px;
}

.article-toc-link {
    display: block;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    font-size: 13.5px;
    line-height: 1.45;
    padding: 6px 10px;
    border-radius: 8px;
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
}

.article-toc-link:hover {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.article-toc-link.active {
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary);
    font-weight: 700;
}

/* Основной контент статьи */
.article-main-wrapper {
    grid-column: 2 !important;
    width: 100% !important;
    min-width: 0;
    max-width: 780px;
    box-sizing: border-box;
}

/* Шапка статьи (Hero) */
.article-hero {
    margin-bottom: 32px;
}

.article-breadcrumbs {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: var(--text-light, #94a3b8);
    margin-bottom: 18px;
}

.article-breadcrumbs a {
    color: var(--text-muted, #64748b);
    text-decoration: none;
    transition: color 0.15s;
}

.article-breadcrumbs a:hover {
    color: var(--primary);
}

.article-badge-cat {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
    font-size: 12.5px;
    font-weight: 700;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.25);
}

.article-title-h1 {
    font-family: var(--font-heading-h1);
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.8px;
    line-height: 1.25;
    color: var(--text);
    margin: 18px 0 20px;
    text-wrap: balance;
}

@media (max-width: 768px) {
    .article-title-h1 {
        font-size: 28px;
    }
}

.article-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    color: var(--text-muted, #64748b);
    font-size: 14px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--border);
}

.article-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Главный блок форматирования статьи */
.article {
    max-width: 760px;
    margin: 0 auto;
    font-family: var(--font-article);
    font-size: 18px;
    line-height: 1.7;
    color: var(--article-text, #1a1f2c);
    text-align: left;
    word-break: break-word;
}

/* Скрываем дублирующийся первый H1 внутри Markdown, если он случайно остался */
.article > h1:first-child {
    display: none !important;
}

/* Заголовки с балансировкой и якорными ссылками */
.article h1,
.article h2,
.article h3,
.article h4,
.article-title-h1,
.article [id] {
    color: var(--text);
    text-wrap: balance;
    font-family: var(--font-heading);
    scroll-margin-top: 100px !important;
}

.article h2 {
    font-size: 27px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin: 56px 0 16px;
    line-height: 1.3;
    position: relative;
    padding-bottom: 6px;
}

.article h3 {
    font-size: 21px;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin: 40px 0 14px;
    line-height: 1.35;
    position: relative;
}

/* Якорные ссылки */
.heading-anchor {
    color: var(--text-light, #94a3b8);
    text-decoration: none;
    font-size: 18px;
    margin-left: 8px;
    opacity: 0;
    transition: opacity 0.15s ease, color 0.15s ease;
    vertical-align: middle;
}

.heading-with-anchor:hover .heading-anchor {
    opacity: 0.8;
}

.heading-anchor:hover {
    opacity: 1 !important;
    color: var(--primary) !important;
}

/* Журнальный лид (Lead) */
.article-lead,
.article > p.article-lead {
    font-size: 20px !important;
    line-height: 1.7 !important;
    color: var(--article-lead, #475569) !important;
    border-left: 4px solid var(--primary);
    padding-left: 18px;
    margin: 28px 0 32px !important;
    font-weight: 500;
    text-wrap: pretty;
}

[data-theme="dark"] .article-lead,
[data-theme="dark"] .article > p.article-lead {
    color: var(--article-lead, #94a3b8) !important;
}

/* Абзацы и ссылки */
.article p {
    margin: 0 0 24px;
    line-height: 1.75;
    text-wrap: pretty;
}

.article a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    transition: all 0.15s;
}

.article a:hover {
    color: var(--primary-hover, #4f46e5);
    text-decoration-thickness: 2px;
}

/* Списки */
.article ul, .article ol {
    margin: 0 0 24px;
    padding-left: 28px;
}

.article li {
    margin-bottom: 10px;
    line-height: 1.65;
}

.article ul > li::marker {
    color: var(--primary);
}

.article ol > li::marker {
    color: var(--primary);
    font-weight: 700;
}

/* Цитаты (Blockquotes) */
.article blockquote {
    position: relative;
    margin: 36px 0;
    padding: 24px 28px 24px 32px;
    border-left: 4px solid var(--primary);
    background: rgba(99, 102, 241, 0.04);
    border-radius: 0 var(--radius-lg, 16px) var(--radius-lg, 16px) 0;
    font-style: italic;
    font-size: 19px;
    line-height: 1.65;
    color: var(--text);
}

.article blockquote::before {
    content: "“";
    position: absolute;
    top: -12px;
    left: 14px;
    font-size: 72px;
    line-height: 1;
    font-family: Georgia, serif;
    color: var(--primary);
    opacity: 0.18;
    pointer-events: none;
}

.article blockquote p {
    margin: 0;
    font-style: italic;
}

/* Callout-блоки (GitHub-алерты) */
.callout {
    border-radius: var(--radius-lg, 14px);
    padding: 18px 22px;
    margin: 30px 0;
    border: 1px solid transparent;
    border-left-width: 4px;
    box-shadow: var(--shadow-sm);
}

.callout-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 10px;
}

.callout-icon {
    font-size: 18px;
    line-height: 1;
}

.callout-content {
    font-size: 16.5px;
    line-height: 1.65;
}

.callout-content p:last-child {
    margin-bottom: 0;
}

/* Варианты алертов */
.callout-tip {
    background: rgba(6, 182, 212, 0.08);
    border-color: rgba(6, 182, 212, 0.2);
    border-left-color: #06b6d4;
}
.callout-tip .callout-header {
    color: #0891b2;
}
[data-theme="dark"] .callout-tip {
    background: rgba(6, 182, 212, 0.12);
}
[data-theme="dark"] .callout-tip .callout-header {
    color: #22d3ee;
}

.callout-warning {
    background: rgba(245, 158, 11, 0.09);
    border-color: rgba(245, 158, 11, 0.25);
    border-left-color: #f59e0b;
}
.callout-warning .callout-header {
    color: #d97706;
}
[data-theme="dark"] .callout-warning {
    background: rgba(245, 158, 11, 0.12);
}
[data-theme="dark"] .callout-warning .callout-header {
    color: #fbbf24;
}

.callout-note {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.2);
    border-left-color: var(--primary);
}
.callout-note .callout-header {
    color: var(--primary);
}
[data-theme="dark"] .callout-note {
    background: rgba(99, 102, 241, 0.12);
}
[data-theme="dark"] .callout-note .callout-header {
    color: #818cf8;
}

/* Интерактивные термины / Тултипы */
.article-term {
    position: relative;
    cursor: help;
    border-bottom: 1.5px dotted var(--primary);
    color: inherit;
    font-weight: 500;
}

.article-term:hover {
    color: var(--primary);
}

.article-term::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #0f172a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: normal;
    width: max-content;
    max-width: 260px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    text-align: center;
}

.article-term::before {
    content: "";
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    border-width: 6px 6px 0 6px;
    border-style: solid;
    border-color: #0f172a transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
}

.article-term:hover::after,
.article-term:hover::before,
.article-term:focus::after,
.article-term:focus::before {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Изображения и Hero-обложка */
.article img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg, 16px);
    display: block;
    margin: 28px auto;
    box-shadow: var(--shadow-md, 0 10px 30px rgba(0,0,0,0.06));
    cursor: zoom-in;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.article img:hover {
    box-shadow: var(--shadow-lg, 0 20px 40px rgba(0,0,0,0.12));
}

.article-hero-cover {
    width: 100% !important;
    max-width: 840px !important;
    border-radius: 18px !important;
    margin: 10px auto 36px !important;
    box-shadow: 0 12px 36px rgba(0,0,0,0.12) !important;
}

/* Блоки кода (Code Blocks) */
.article pre {
    background: #0b0f19 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg, 14px);
    padding: 20px 22px;
    margin: 28px 0;
    overflow-x: auto;
    position: relative;
}

.article code {
    font-family: 'JetBrains Mono', Consolas, Monaco, monospace;
    font-size: 14.5px;
    line-height: 1.6;
}

.article p code,
.article li code {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
    padding: 3px 7px;
    border-radius: 6px;
    font-size: 14px;
    border: 1px solid rgba(99, 102, 241, 0.15);
}

.article kbd {
    display: inline-block;
    padding: 3px 6px;
    font-family: inherit;
    font-size: 12px;
    line-height: 1;
    color: var(--text);
    background: var(--bg-soft, #f8fafc);
    border: 1px solid var(--border);
    border-radius: 5px;
    box-shadow: 0 2px 0 var(--border);
}

/* Кнопка копирования кода */
.code-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: #cbd5e1;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Всплывающее меню цитирования (Medium Quote Share) */
.quote-share-popover {
    position: absolute;
    display: none;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: var(--bg-elevated, #ffffff);
    border: 1px solid var(--border);
    border-radius: 30px;
    box-shadow: var(--shadow-lg, 0 12px 32px rgba(0,0,0,0.18));
    z-index: 1000;
    animation: fadeInPop 0.15s ease;
}

@keyframes fadeInPop {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.quote-share-btn {
    background: transparent;
    border: none;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s, color 0.15s;
}

.quote-share-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary);
}

/* Карточка автора */
.article-author-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 22px 26px;
    background: var(--bg-elevated, #ffffff);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    margin: 48px 0 32px;
    box-shadow: var(--shadow-sm);
}

.article-author-card .author-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.article-author-card .author-info h4 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.article-author-card .author-info p {
    margin: 0;
    font-size: 13.5px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Блок реакций (VK-Style) */
.article-reactions-card {
    background: var(--bg-elevated, #ffffff);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    padding: 22px 26px;
    margin: 32px 0;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.article-reactions-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}

.article-reactions-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.reaction-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--bg-soft, #f8fafc);
    border: 1px solid var(--border);
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
}

.reaction-pill-btn:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.reaction-pill-btn:active {
    transform: scale(0.96);
}

.reaction-pill-btn .reaction-emoji {
    font-size: 17px;
    line-height: 1;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.reaction-pill-btn:hover .reaction-emoji {
    transform: scale(1.25);
}

.reaction-pill-btn.active {
    background: rgba(99, 102, 241, 0.12);
    border-color: var(--primary);
    color: var(--primary);
}

.reaction-pill-btn .reaction-count {
    font-size: 13px;
    font-weight: 700;
    opacity: 0.8;
}

/* Панель шеринга статьи */
.article-share-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 32px 0 48px;
    padding: 16px 20px;
    background: var(--bg-soft, #f8fafc);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 14px);
}

.share-copy-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--bg-elevated, #ffffff);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.share-copy-link-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.share-social-group {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.share-social-label {
    font-size: 13.5px;
    color: var(--text-muted);
}

.share-social-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s ease;
}

.share-social-tg {
    background: rgba(36, 161, 222, 0.12);
    color: #24a1de;
}
.share-social-tg:hover {
    background: #24a1de;
    color: #ffffff;
}

.share-social-vk {
    background: rgba(0, 119, 255, 0.12);
    color: #0077ff;
}
.share-social-vk:hover {
    background: #0077ff;
    color: #ffffff;
}

/* Toast-уведомление */
.smart-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(40px);
    background: #0f172a;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg, 0 16px 36px rgba(0,0,0,0.25));
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.smart-toast.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
}

/* Секция «Читайте также» */
.related-articles-section {
    margin: 56px 0 40px;
    padding-top: 36px;
    border-top: 1px solid var(--border);
}

.related-section-title {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: var(--text);
    margin-bottom: 22px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

@media (max-width: 800px) {
    .related-grid {
        grid-template-columns: 1fr;
    }
}

.related-card {
    position: relative !important;
    display: flex;
    flex-direction: column;
    background: var(--bg-elevated, #ffffff);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-sm);
}

.related-card:hover {
    transform: translateY(-4px);
    border-color: var(--primary);
    box-shadow: var(--shadow-md, 0 10px 24px rgba(0,0,0,0.1));
}

.related-card-cover {
    width: 100%;
    height: 140px;
    background: var(--bg-soft, #f1f5f9);
    position: relative;
    overflow: hidden;
}

.related-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.35s ease;
}

.related-card:hover .related-card-cover img {
    transform: scale(1.05);
}

.related-card-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: linear-gradient(135deg, rgba(99,102,241,0.08) 0%, rgba(236,72,153,0.08) 100%);
}

.related-card-body {
    padding: 16px 18px 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.related-card-badge {
    align-self: flex-start;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 3px 8px;
    border-radius: 12px;
    margin-bottom: 10px;
}

.related-card-title {
    font-family: var(--font-heading);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    margin: 0 0 10px;
    flex: 1;
}

.related-card-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Мобильная шторка содержания (Bottom Sheet) */
.mobile-toc-trigger {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 20px !important;
    right: auto !important;
    width: auto !important;
    max-width: calc(100vw - 120px) !important;
    z-index: 998;
    background: var(--primary-gradient);
    color: #ffffff;
    border: none;
    border-radius: 30px;
    padding: 10px 20px;
    font-size: 13.5px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.4);
    cursor: pointer;
    align-items: center;
    gap: 8px;
    transition: transform 0.15s ease;
}

.mobile-toc-trigger:active {
    transform: scale(0.95);
}

.bottom-sheet-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.bottom-sheet-overlay.open {
    opacity: 1;
}

.bottom-sheet-toc {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-elevated, #ffffff);
    border-top-left-radius: 24px;
    border-top-right-radius: 24px;
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
    max-height: 75vh;
    overflow-y: auto;
    z-index: 10001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-bottom: none;
}

.bottom-sheet-toc.open {
    transform: translateY(0);
}

.bottom-sheet-drag-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 4px;
    margin: 0 auto 16px;
}

.bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.bottom-sheet-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 800;
    color: var(--text);
}

.bottom-sheet-close {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.mobile-sheet-link {
    display: block;
    padding: 10px 12px;
    font-size: 15px;
    color: var(--text);
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 4px;
    transition: background 0.15s;
}

.mobile-sheet-link:hover, .mobile-sheet-link:active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary);
}

.mobile-sheet-link.level-3 {
    padding-left: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

/* Адаптивность перенесена в конец файла */

/* ============================================================
   ОБНОВЛЕННЫЙ НИЗ СТАТЬИ: ВОЗДУШНЫЕ РЕАКЦИИ + ЕДИНАЯ КАРТОЧКА АВТОРА
   ============================================================ */
.article-reactions-airy {
    margin: 44px 0 28px;
    text-align: center;
    padding: 0;
    background: transparent;
    border: none;
}

.reactions-airy-title {
    font-family: var(--font-heading);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 14px;
    letter-spacing: -0.2px;
}

.article-author-share-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    background: var(--bg-elevated, #ffffff);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 16px);
    margin: 28px 0 44px;
    box-shadow: var(--shadow-sm);
    box-sizing: border-box;
}

.author-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.author-profile .author-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.author-profile .author-info {
    min-width: 0;
}

.author-profile .author-name {
    font-weight: 700;
    font-size: 15.5px;
    color: var(--text);
    margin-bottom: 3px;
}

.author-profile .author-bio {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
}

.author-share-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.author-share-actions .share-copy-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--bg-soft, #f8fafc);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: all 0.15s ease;
}

.author-share-actions .share-copy-link-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(99, 102, 241, 0.06);
}

.author-social-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.author-social-links .share-icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft, #f8fafc);
    border: 1px solid var(--border);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.15s ease;
}

.author-social-links .share-icon-btn:hover {
    transform: translateY(-2px);
}

.author-social-links .share-icon-btn.tg:hover {
    color: #229ED9;
    border-color: #229ED9;
    background: rgba(34, 158, 217, 0.1);
}

.author-social-links .share-icon-btn.vk:hover {
    color: #0077FF;
    border-color: #0077FF;
    background: rgba(0, 119, 255, 0.1);
}

/* Компактные карточки «Читайте также» без пустых серых заглушек */
.related-card.no-cover {
    position: relative !important;
    overflow: hidden !important;
    padding-top: 4px;
    border-top: 3px solid var(--primary);
}

/* ============================================================
   АДАПТИВНОСТЬ: ДЕСКТОП, ПЛАНШЕТЫ И МОБИЛЬНЫЕ ТЕЛЕФОНЫ
   ============================================================ */

/* 1. Ноутбуки и экраны 1025px - 1240px: 2 колонки */
@media (max-width: 1240px) and (min-width: 1025px) {
    .article-reader-container {
        grid-template-columns: 240px minmax(0, 1fr) !important;
        gap: 32px !important;
    }
    .article-toc-sidebar {
        grid-column: 1 !important;
        width: 240px !important;
        justify-self: stretch !important;
    }
    .article-main-wrapper {
        grid-column: 2 !important;
        max-width: 100% !important;
    }
}

/* 2. Планшеты и средние экраны (<= 1024px): 1 колонка, сайдбар скрыт */
@media (max-width: 1024px) {
    .article-reader-container {
        display: block !important;
        grid-template-columns: none !important;
        width: 100% !important;
        max-width: 800px !important;
        padding: 0 20px !important;
        margin: 20px auto 60px !important;
        box-sizing: border-box !important;
    }
    .article-toc-sidebar {
        display: none !important;
    }
    .article-main-wrapper {
        grid-column: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    .mobile-toc-trigger {
        display: inline-flex !important;
    }
}

/* 3. Мобильные устройства (<= 640px): Полная ширина, просторные отступы и крупный акцентный заголовок */
@media (max-width: 640px) {
    .article-reader-container {
        display: block !important;
        grid-template-columns: none !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 20px !important;
        margin: 12px auto 40px !important;
        box-sizing: border-box !important;
    }
    .article-toc-sidebar {
        display: none !important;
    }
    .article-main-wrapper {
        grid-column: auto !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-bottom: 95px !important;
        box-sizing: border-box !important;
    }
    .article-title-h1 {
        font-size: 28px !important;
        line-height: 1.22 !important;
        letter-spacing: -0.5px !important;
        font-weight: 800 !important;
        margin-bottom: 16px !important;
    }
    .article h2 {
        font-size: 21px !important;
        line-height: 1.3 !important;
        margin-top: 36px !important;
        margin-bottom: 14px !important;
    }
    .callout {
        padding: 16px 18px !important;
        margin: 22px 0 !important;
    }
    .article-lead {
        font-size: 15.5px !important;
        line-height: 1.5 !important;
        margin-bottom: 18px !important;
    }
    .article-meta-modern {
        gap: 8px !important;
        font-size: 12.5px !important;
    }
    .article-body {
        font-size: 15.5px !important;
        line-height: 1.65 !important;
    }
    .article-author-share-card {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 14px !important;
        padding: 16px 16px !important;
    }
    .author-share-actions {
        justify-content: space-between !important;
        border-top: 1px solid var(--border) !important;
        padding-top: 12px !important;
    }
    .mobile-toc-trigger {
        left: 16px !important;
        bottom: 20px !important;
        max-width: calc(100vw - 120px) !important;
    }
}
