/**
 * Оболочка статьи блога (hero, типографика, CTA, шаринг).
 * Источник правды для шаблона и design-preview-frame.html.
 * Поверх: blog-template-unified.css (только при class="blog-article-page" на body).
 */

/* Hero статьи: фон тише главной — читатель смотрит на заголовок, не на декор */
.blog-article-hero {
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    /* Fallback: приглушённый синий → быстрее к светлому (#f7fbff), меньше «кислоты» в середине */
    background: linear-gradient(
        145deg,
        #111b2e 0%,
        #162a45 24%,
        #1c3a62 44%,
        #2a4f7a 62%,
        #5c7da6 82%,
        #b8cce6 93%,
        #f7fbff 100%
    );
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.08);
}
.blog-article-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 62% 44% at 70% 12%, rgba(125, 211, 252, 0.05) 0%, transparent 62%),
        radial-gradient(ellipse 52% 40% at 16% 4%, rgba(191, 219, 254, 0.04) 0%, transparent 60%),
        linear-gradient(180deg, rgba(9, 18, 38, 0.18) 0%, rgba(9, 18, 38, 0.05) 38%, transparent 68%);
    pointer-events: none;
    z-index: 0;
}

/* Desktop: едва заметная сетка — не конкурирует с текстом */
@media (min-width: 769px) {
    .blog-article-hero:not(.blog-article-hero--cover)::before {
        background:
            repeating-linear-gradient(
                90deg,
                transparent,
                transparent 39px,
                rgba(255, 255, 255, 0.018) 39px,
                rgba(255, 255, 255, 0.018) 40px
            ),
            repeating-linear-gradient(
                0deg,
                transparent,
                transparent 39px,
                rgba(255, 255, 255, 0.018) 39px,
                rgba(255, 255, 255, 0.018) 40px
            ),
            radial-gradient(ellipse 62% 44% at 70% 12%, rgba(125, 211, 252, 0.05) 0%, transparent 62%),
            radial-gradient(ellipse 52% 40% at 16% 4%, rgba(191, 219, 254, 0.04) 0%, transparent 60%),
            linear-gradient(180deg, rgba(9, 18, 38, 0.18) 0%, rgba(9, 18, 38, 0.05) 38%, transparent 68%);
    }
}
/* Полностью светлый «шов» к телу статьи: нижняя полоса hero → #f7fbff без просинивания */
.blog-article-hero::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: clamp(110px, 26vh, 220px);
    background: linear-gradient(
        to top,
        #f7fbff 0%,
        #f7fbff 14%,
        rgba(247, 251, 255, 0.94) 32%,
        rgba(237, 246, 255, 0.45) 58%,
        rgba(210, 226, 248, 0) 100%
    );
    pointer-events: none;
    z-index: 0;
}
/* p5: JS ставит z-index:1 — опускаем под контент и сильно приглушаем (иначе «забирает» внимание) */
.blog-article-hero .background-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0 !important;
    pointer-events: none;
    opacity: 0.38;
    filter: saturate(0.82);
}

/* Обложка статьи (featured_image): фото под заголовком; p5 hero не подключается */
.blog-article-hero.blog-article-hero--cover {
    background: #0f172a;
}
.blog-article-hero.blog-article-hero--cover::before {
    background:
        linear-gradient(
            180deg,
            rgba(9, 18, 38, 0.84) 0%,
            rgba(9, 18, 38, 0.52) 36%,
            rgba(30, 64, 138, 0.38) 58%,
            rgba(247, 251, 255, 0.92) 100%
        ),
        var(--hero-cover);
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
}

/* Заголовок статьи в sticky-header рядом с брендом */
.blog-article-page .header__logo {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}

.blog-article-page .header__article-sep {
    color: rgba(37, 99, 235, 0.7);
    font-size: 0.95rem;
    line-height: 1;
    transform: translateY(-1px);
}

.blog-article-page .header__article-title {
    display: inline-block;
    max-width: min(40vw, 520px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #334155;
    font-size: 0.83rem;
    font-weight: 600;
    line-height: 1.25;
}

/* Убираем "коробку" под текстом hero: фон должен быть единым полотном */
.blog-article-hero .article-header {
    background: transparent !important;
    box-shadow: none;
}

/* Hero статьи — градиент (fallback при отсутствии p5), глубина, типографика */
.article-header {
    background: transparent;
    color: #fff;
    padding: 2.5rem 0 1.5rem;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    box-shadow: none;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(220px, 0.95fr);
    gap: 0.55rem 1.25rem;
    align-items: start;
}

/* Одна колонка, если нет бокового teaser (новый шаблон: hero заканчивается на лиде) */
.blog-article-page .blog-article-hero .article-header:not(:has(.article-header__teaser)) {
    grid-template-columns: 1fr;
}

/* Заголовок статьи — первый смысловой якорь; рубрика ниже как тихая метка навигации */
.blog-article-page .blog-article-hero .article-header:not(:has(.article-header__teaser)) > nav.breadcrumbs,
.blog-article-page .blog-article-hero .article-header:not(:has(.article-header__teaser)) > .breadcrumbs {
    order: 10;
}

.blog-article-page .blog-article-hero .article-header:not(:has(.article-header__teaser)) > .article-header__title {
    order: 20;
}

.blog-article-page .blog-article-hero .article-header:not(:has(.article-header__teaser)) > .article-header__eyebrow {
    order: 30;
    margin-top: 0.35rem;
}

.blog-article-page .blog-article-hero .article-header:not(:has(.article-header__teaser)) > .article-header__meta {
    order: 40;
}

.blog-article-page .blog-article-hero .article-header:not(:has(.article-header__teaser)) > .article-header__hero-editorial {
    order: 50;
}

/* Та же логическая колонка, что и .article-content (900px + резерв под фиксированное TOC справа) */
.blog-article-page .blog-article-hero .article-header {
    max-width: 900px;
    margin-left: 0;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
    padding-left: var(--spacing-sm, 1rem);
    padding-right: var(--spacing-sm, 1rem);
}

@media (min-width: 1025px) {
    .blog-article-page .blog-article-hero .article-header {
        /* 260px панель + отступы от края вьюпорта — текст hero не под TOC */
        padding-right: max(1rem, calc(260px + 48px));
    }
}

/* Декоративная подложка без "клетки" */
.article-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(255, 255, 255, 0.02) 42%,
        rgba(255, 255, 255, 0) 100%
    );
    opacity: 1;
    pointer-events: none;
}

/* Мягкий переход к контенту: низ hero совпадает с верхом .article (#f7fbff) */
.article-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: -1;
    height: clamp(88px, 18vh, 160px);
    background: linear-gradient(
        to top,
        #f7fbff 0%,
        rgba(247, 251, 255, 0.92) 28%,
        rgba(232, 242, 252, 0.35) 62%,
        rgba(30, 64, 175, 0) 100%
    );
    opacity: 1;
    pointer-events: none;
}

.article-header .container {
    position: relative;
    z-index: 1;
}

/* Адрес статьи внутри hero: единый бейдж-маршрут */
.breadcrumbs,
.article-breadcrumbs,
.blog-article-hero .breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    max-width: 100%;
    margin: -0.15rem 0 0.45rem;
    padding: 0;
    background: transparent;
    border-bottom: none;
}

.breadcrumbs a,
.breadcrumbs span,
.article-breadcrumbs a,
.article-breadcrumbs span,
.blog-article-hero .breadcrumbs a,
.blog-article-hero .breadcrumbs span {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}
.blog-article-hero .breadcrumbs,
.article-header__eyebrow,
.article-header__category,
.article-header__badges,
.article-header__title,
.article-header__meta,
.article-header__hero-editorial,
.article-header__trust,
.article-header__lead,
.article-header__prelude,
.article-header__facts,
.article-header__micro-cta,
.article-header__continue {
    grid-column: 1;
}

/* Категория + бейджи в одной логической строке */
.article-header__eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.65rem;
    margin: 0 0 0.15rem;
}

.article-header__eyebrow .article-header__category {
    margin-bottom: 0;
}

.article-header__eyebrow .article-header__badges {
    margin-top: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.blog-article-hero .breadcrumbs .container {
    padding: 0.4rem 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    width: auto;
    border-radius: 999px;
    background: rgba(241, 245, 255, 0.14);
    border: 1px solid rgba(226, 232, 240, 0.32);
    box-shadow: 0 1px 6px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.blog-article-hero .breadcrumbs a {
    color: rgba(226, 232, 240, 0.96) !important;
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: none !important;
}

.blog-article-hero .breadcrumbs span {
    color: rgba(248, 250, 252, 0.98);
    font-size: 0.72rem;
    font-weight: 600;
}

.blog-article-hero .breadcrumbs a:hover {
    color: #ffffff !important;
}

.article-header__category {
    display: inline-block;
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.6875rem;
    font-weight: 500;
    font-family: var(--font-family-base, Inter, system-ui, sans-serif);
    text-transform: none;
    letter-spacing: 0.03em;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.62);
    border: none;
}

.article-header__title {
    font-size: clamp(1.45rem, 3.6vw, 2.35rem);
    font-weight: 800;
    font-family: var(--font-family-heading);
    line-height: 1.18;
    letter-spacing: -0.03em;
    margin-bottom: 0.4rem;
    color: #fff;
    text-shadow: 0 1px 8px rgba(15, 23, 42, 0.16);
    max-width: 100%;
    text-wrap: balance;
}

.article-header__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
    font-family: var(--font-family);
    font-weight: 500;
    color: rgba(241, 245, 249, 0.94);
}

.article-header__meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.article-header__trust {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.article-header__trust-item {
    min-width: 0;
    padding: 0.4rem 0.5rem;
    border-radius: 8px;
    border: 1px solid rgba(191, 219, 254, 0.26);
    background: rgba(15, 23, 42, 0.18);
}

.article-header__trust-label {
    display: block;
    margin-bottom: 0.18rem;
    color: rgba(191, 219, 254, 0.88);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.article-header__trust-value {
    display: block;
    color: rgba(241, 245, 249, 0.96);
    font-size: 0.72rem;
    line-height: 1.35;
    font-weight: 600;
}

.article-header__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.article-header__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.26rem 0.55rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(191, 219, 254, 0.26);
    color: rgba(241, 245, 249, 0.96);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.article-header__lead {
    margin: 0.35rem 0 0;
    max-width: 62ch;
    font-size: clamp(0.9rem, 1.35vw, 1.02rem);
    line-height: 1.48;
    color: rgba(241, 245, 249, 0.94);
    text-shadow: none;
}

/* Hero: компактное доверие + главная мысль + лид на тёмном стекле (без «белого на белом» у шва) */
.article-header__hero-editorial {
    margin-top: 0.6rem;
    max-width: min(72ch, 100%);
    padding: 0.75rem 1rem 0.95rem;
    border-radius: 14px;
    background: rgba(4, 8, 22, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 16px 48px rgba(4, 8, 22, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.07);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.article-header__trust-micro {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    padding-bottom: 0.55rem;
    margin-bottom: 0.45rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.article-header__trust-micro-piece {
    display: inline-flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.28rem 0.4rem;
    max-width: 100%;
}

.article-header__trust-micro-k {
    color: rgba(165, 190, 252, 0.78);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.article-header__trust-micro-v {
    color: rgba(248, 250, 252, 0.96);
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
}

.article-header__trust-micro-sep {
    color: rgba(226, 232, 240, 0.35);
    font-size: 0.75rem;
    font-weight: 300;
    user-select: none;
    padding: 0 0.1rem;
}

.article-header__trust-micro-sep::before {
    content: '·';
}

/* Главная мысль в hero — заметно, но в той же тёмной панели */
.article-header__main-thought {
    margin: 0;
    padding: 0 0 0 0.95rem;
    border: none;
    background: transparent;
    border-left: 3px solid rgba(147, 197, 253, 0.75);
    border-radius: 0;
    box-shadow: none;
}

.article-header__main-thought-label {
    display: block;
    margin-bottom: 0.4rem;
    color: rgba(191, 219, 254, 0.88);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.article-header__main-thought p {
    margin: 0;
    color: #f8fafc;
    font-size: clamp(0.98rem, 2.1vw, 1.22rem);
    line-height: 1.48;
    font-weight: 600;
    font-style: normal;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.article-header__hero-editorial .article-header__lead {
    margin: 0.75rem 0 0;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    max-width: 65ch;
    color: rgba(226, 232, 240, 0.93);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.article-header__prelude {
    margin: 0.4rem 0 0;
    max-width: 66ch;
    padding: 0.52rem 0.65rem;
    border-radius: 9px;
    border: 1px solid rgba(191, 219, 254, 0.28);
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.26) 0%, rgba(30, 41, 59, 0.14) 100%);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.article-header__prelude-label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
    padding: 0.2rem 0.48rem;
    border-radius: 999px;
    background: rgba(191, 219, 254, 0.2);
    border: 1px solid rgba(191, 219, 254, 0.28);
    color: rgba(226, 232, 240, 0.96);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.article-header__prelude-text {
    margin: 0;
    color: rgba(241, 245, 249, 0.96);
    font-size: 0.86rem;
    line-height: 1.45;
    font-weight: 500;
}

.article-header__facts {
    list-style: none;
    margin: 0.4rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.article-header__facts li {
    display: inline-flex;
    align-items: center;
    padding: 0.24rem 0.52rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(191, 219, 254, 0.28);
    color: rgba(241, 245, 249, 0.97);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.article-header__teaser {
    grid-column: 2;
    /* Рядом с заголовком и блоком входа: title → meta → trust → lead → prelude */
    grid-row: 3 / span 5;
    align-self: start;
    margin: 0;
    padding: 0.65rem 0.72rem 0.65rem 0.78rem;
    border-left: 2px solid rgba(147, 197, 253, 0.62);
    border-radius: 0 10px 10px 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.26) 0%, rgba(30, 41, 59, 0.12) 100%);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.article-header__teaser-label {
    display: inline-block;
    margin-bottom: 0.45rem;
    padding: 0.22rem 0.52rem;
    border-radius: 999px;
    border: 1px solid rgba(191, 219, 254, 0.3);
    background: rgba(30, 41, 59, 0.22);
    color: rgba(226, 232, 240, 0.9);
    font-size: 0.66rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.article-header__teaser-quote {
    margin: 0;
    color: rgba(241, 245, 249, 0.96);
    font-size: clamp(0.82rem, 1.2vw, 0.95rem);
    line-height: 1.48;
    font-style: normal;
    font-weight: 600;
    text-wrap: balance;
}

/* Без кавычек и курсива — акцент как у делового издания */
.article-header__teaser-quote::before,
.article-header__teaser-quote::after {
    content: none;
}

/* Фон тела статьи: на десктопе — градиент + лёгкий паттерн, на мобильной — сплошной */
.article {
    position: relative;
    margin-top: -44px;
    padding-top: 1.65rem;
    background: linear-gradient(
        180deg,
        rgba(36, 89, 200, 0.2) 0%,
        rgba(59, 130, 246, 0.12) 16%,
        rgba(238, 246, 255, 0.95) 34%,
        #f7fbff 58%,
        #f1f6fc 100%
    );
    z-index: 1;
}
.article::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 340px;
    background:
        radial-gradient(circle at 16% 24%, rgba(59, 130, 246, 0.16) 0, rgba(59, 130, 246, 0) 42%),
        radial-gradient(circle at 84% 8%, rgba(37, 99, 235, 0.12) 0, rgba(37, 99, 235, 0) 40%);
    pointer-events: none;
    z-index: 0;
}

.article-content {
    position: relative;
    background: transparent;
    padding: 3.5rem 0 4rem;
    color: var(--color-text);
    font-feature-settings: 'kern' 1, 'liga' 1;
}

/* Единый ритм и поверхность модулей на странице статьи */
.article > .container > .article-content,
.article > .container > .related-articles,
.article > .container > .article-faq,
.article > .container > .article-navigation,
.article > .container > .article-comments,
.article > .container > .share-buttons-bottom,
.article > .container > .article-snippet,
.article > .container > .qrcode-container {
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
}

.article > .container > .related-articles,
.article > .container > .article-faq,
.article > .container > .article-navigation,
.article > .container > .article-comments,
.article > .container > .share-buttons-bottom,
.article > .container > .qrcode-container {
    background: var(--widget-surface-bg);
    border: 1px solid var(--widget-surface-border);
    border-radius: var(--widget-radius);
    box-shadow: var(--widget-surface-shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Сниппеты в потоке текста — без второй «стеклянной» карточки (оформление в blog.css + article-snippets-embed.css) */
.article > .container > .article-snippet {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
}

.article > .container > .article-faq,
.article > .container > .article-comments,
.article > .container > .qrcode-container {
    padding: 1.25rem 1.25rem;
}

.article > .container > .article-navigation {
    padding: 1rem 0.75rem;
}

.article > .container > .related-articles {
    padding: 1.25rem 1.25rem;
}

@media (min-width: 769px) {
    .article {
        border-top: none;
        border-radius: 28px 28px 0 0;
    }

    .article .container {
        position: relative;
        z-index: 1;
    }

    .article-content {
        border-top: none;
        background: linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.2) 0%,
            rgba(255, 255, 255, 0.1) 24%,
            rgba(255, 255, 255, 0) 100%
        );
    }
    /* Связка с hero: мягкое синее свечение сверху контента */
    .article-content::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 220px;
        background: radial-gradient(
            ellipse 70% 65% at 50% 0%,
            rgba(37, 99, 235, 0.1) 0%,
            rgba(59, 130, 246, 0.055) 36%,
            rgba(255, 255, 255, 0) 84%
        );
        pointer-events: none;
        z-index: 0;
    }
    /* Лёгкая сетка для глубины (не отвлекает от чтения) */
    .article-content::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: url('data:image/svg+xml,<svg width="48" height="48" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="article-grid" width="48" height="48" patternUnits="userSpaceOnUse"><path d="M 48 0 L 0 0 0 48" fill="none" stroke="rgba(30,58,138,0.04)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23article-grid)"/></svg>');
        pointer-events: none;
        z-index: 0;
    }
    .article-content > * {
        position: relative;
        z-index: 1;
    }
}

@media (max-width: 768px) {
    .article-header {
        display: block;
        padding: 1.35rem 0 1rem;
    }
    .blog-article-hero {
        background: linear-gradient(
            145deg,
            #111b2e 0%,
            #162a45 24%,
            #1c3a62 44%,
            #2a4f7a 60%,
            #5c7da6 78%,
            #b8cce6 90%,
            #fafbfc 100%
        );
    }
    .blog-article-hero::after {
        background: linear-gradient(
            to top,
            #fafbfc 0%,
            #fafbfc 14%,
            rgba(250, 251, 252, 0.94) 32%,
            rgba(237, 244, 252, 0.45) 58%,
            rgba(210, 226, 248, 0) 100%
        );
    }
    .article-header::after {
        background: linear-gradient(
            to top,
            #fafbfc 0%,
            rgba(250, 251, 252, 0.92) 28%,
            rgba(236, 242, 248, 0.35) 62%,
            rgba(30, 64, 175, 0) 100%
        );
    }
    .article {
        margin-top: 0;
        padding-top: 0;
        background: #fafbfc;
        border-radius: 0;
    }
    .article-content {
        background: #fafbfc;
    }

    .article-content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 10px;
        margin: 0.95rem 0 1.15rem;
    }

    .article-content table thead th,
    .article-content table th,
    .article-content table td {
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 0.5rem 0.56rem;
    }

    .article-content .reader-question {
        margin: 0.8rem 0 1rem;
        padding: 0.62rem 0.68rem;
        font-size: 0.92rem;
        line-height: 1.45;
    }
}

.article-content h2 {
    font-size: clamp(1.375rem, 3vw, 2.25rem);
    font-weight: 700;
    font-family: var(--font-family-heading);
    color: #1e293b;
    margin: 2.5rem 0 1rem;
    padding-bottom: 16px;
    border-bottom: 3px solid var(--color-primary);
    position: relative;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.article-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -3px;
    width: 60px;
    height: 3px;
    background: var(--color-bg-gradient);
}

.article-content h3 {
    font-size: var(--font-size-h3);
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family);
    color: var(--color-text);
    margin: 36px 0 16px;
    line-height: 1.4;
}

.article-content p {
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    line-height: var(--line-height-reading);
    letter-spacing: -0.011em;
    color: #334155;
    margin-bottom: 1.25rem;
}

/* Вход в текст: «Начинаем прямо здесь» — сразу после дисклеймера, продолжение hero → body */
.article-body-prelude {
    margin: -0.15rem 0 0.85rem;
    max-width: 66ch;
    padding: 0.65rem 0.85rem 0.72rem;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.2);
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.78) 0%,
        rgba(239, 246, 255, 0.55) 100%
    );
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.article-body-prelude__label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.4rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    border: 1px solid rgba(37, 99, 235, 0.22);
    color: #1e40af;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.article-body-prelude__text {
    margin: 0;
    color: #1e293b;
    font-size: clamp(0.95rem, 1.35vw, 1.05rem);
    line-height: 1.58;
    font-weight: 500;
}

/* Ключевые факты в начале статьи (перенесены из hero) */
.article-entry-facts {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.article-entry-facts li {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(37, 99, 235, 0.16);
    color: #1e3a5f;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* Полоса доверия в теле статьи: автор, проверка, ревизия (на светлом фоне, крупнее hero) */
.article-trust-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0.9rem 1.05rem;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.22);
    background: linear-gradient(
        135deg,
        rgba(37, 99, 235, 0.09) 0%,
        rgba(255, 255, 255, 0.94) 45%,
        rgba(239, 246, 255, 0.98) 100%
    );
    box-shadow: 0 6px 22px rgba(37, 99, 235, 0.09), 0 1px 3px rgba(15, 23, 42, 0.05);
}

.article-trust-strip__item {
    min-width: 0;
    padding: 0.52rem 0.6rem;
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(37, 99, 235, 0.14);
}

.article-trust-strip__label {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--color-primary, #2563eb);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.article-trust-strip__value {
    display: block;
    color: #0f172a;
    font-size: 0.875rem;
    line-height: 1.38;
    font-weight: 600;
}

/* Крупная цитата в начале материала («главная мысль») */
.article-content blockquote.article-pullquote {
    margin: 0.25rem 0 1.05rem;
    padding: 1.05rem 1.15rem 1.1rem 1.2rem;
    border-radius: 14px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-left: 4px solid var(--color-primary);
    background: linear-gradient(
        118deg,
        rgba(37, 99, 235, 0.11) 0%,
        rgba(255, 255, 255, 0.92) 40%,
        rgba(248, 250, 252, 0.99) 100%
    );
    box-shadow: 0 10px 32px rgba(37, 99, 235, 0.11);
    font-style: normal;
}

.article-pullquote__label {
    display: inline-block;
    margin-bottom: 0.55rem;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.11);
    border: 1px solid rgba(37, 99, 235, 0.22);
    color: #1e40af;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

blockquote.article-pullquote p {
    margin: 0;
    font-size: clamp(1.06rem, 2.25vw, 1.32rem);
    line-height: 1.52;
    font-weight: 600;
    color: #0f172a;
}

/* Первый экран: лид (верхний дисклеймер в шаблоне не вставляется — см. publish_kapital77_article.py) */
.article-content > p:first-of-type:not(.article-disclaimer),
.article-content > blockquote:first-of-type + p {
    font-size: clamp(1.125rem, 2.1vw, 1.25rem);
    line-height: 1.62;
    color: #1f2937;
    padding: 1rem 1.1rem;
    margin: 0.25rem 0 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(37, 99, 235, 0.14);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Legacy: лид сразу после дисклеймера, если класс остался в MD */
.article-content > p.article-disclaimer + p {
    font-size: clamp(1.125rem, 2.1vw, 1.25rem);
    line-height: 1.62;
    color: #1f2937;
    padding: 1rem 1.1rem;
    margin: 0.25rem 0 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.58);
    border: 1px solid rgba(37, 99, 235, 0.14);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.06);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Второй абзац — подзавязка */
.article-content > p:first-of-type:not(.article-disclaimer) + p,
.article-content > blockquote:first-of-type + p + p,
.article-content > p.article-disclaimer + p + p {
    color: #2f3f57;
    font-size: 1.03rem;
    line-height: var(--line-height-reading);
}

/* Компактный YMYL-дисклеймер в конце .article-content */
.article-content p.article-disclaimer--compact {
    font-size: 0.82rem;
    line-height: 1.45;
    color: #64748b;
    margin: 1.1rem 0 0;
    padding: 0.55rem 0 0;
    border-top: 1px solid rgba(148, 163, 184, 0.4);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    max-width: 48rem;
}

/* Первый абзац продолжения после prelude (цитата и/или факты между prelude и ним) */
.article-content > .article-body-prelude + p,
.article-content > .article-body-prelude + blockquote.article-pullquote + p,
.article-content > .article-body-prelude + blockquote.article-pullquote + ul.article-entry-facts + p,
.article-content > .article-body-prelude + ul.article-entry-facts + p,
.article-content > .article-body-prelude + ul.article-entry-facts + blockquote + p {
    color: #2f3f57;
    font-size: 1.03rem;
    line-height: var(--line-height-reading);
}

.article-transparency {
    margin: 0.8rem 0 1.25rem;
    padding: 0.9rem 1rem;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.06);
}

.article-transparency__title {
    margin: 0 0 0.55rem;
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 700;
    color: #1f2937;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.article-transparency ul {
    margin: 0;
    padding-left: 1.1rem;
}

.article-transparency li {
    margin-bottom: 0.35rem;
    font-size: 0.93rem;
    line-height: 1.55;
    color: #334155;
}

.scenario-card,
.range-calc,
.common-mistakes,
.decision-tree-lite {
    margin: 1rem 0 1.35rem;
    padding: 1rem 1.05rem;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: rgba(255, 255, 255, 0.62);
    box-shadow: 0 3px 12px rgba(37, 99, 235, 0.06);
}

.scenario-card__title,
.range-calc__title,
.common-mistakes__title,
.decision-tree-lite__title {
    margin: 0 0 0.55rem;
    color: #1f2937;
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 700;
}

.scenario-card__lead,
.range-calc__text {
    margin: 0 0 0.65rem;
    font-size: 0.97rem;
    line-height: 1.58;
    color: #334155;
}

.article-header__micro-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.25rem;
    padding: 0.46rem 0.78rem;
    border-radius: 999px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    background: rgba(255, 255, 255, 0.14);
    color: #eff6ff;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: all 0.2s ease;
}

.article-header__micro-cta:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(147, 197, 253, 0.55);
}

/* Мост hero → тело: «продолжение ниже» + лёгкая анимация точек */
.article-header__continue {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    margin-top: 0.35rem;
    padding: 0;
    text-decoration: none;
    color: rgba(226, 232, 240, 0.88);
    max-width: 14rem;
}

.article-header__continue:hover,
.article-header__continue:focus-visible {
    color: #fff;
}

.article-header__continue:focus-visible {
    outline: 2px solid rgba(147, 197, 253, 0.85);
    outline-offset: 3px;
    border-radius: 6px;
}

.article-header__continue-dots {
    display: flex;
    gap: 0.2rem;
    align-items: center;
}

.article-header__continue-dots span {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(191, 219, 254, 0.95);
    animation: article-hero-continue-dot 1.35s ease-in-out infinite;
}

.article-header__continue-dots span:nth-child(2) {
    animation-delay: 0.18s;
}

.article-header__continue-dots span:nth-child(3) {
    animation-delay: 0.36s;
}

.article-header__continue-text {
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.92;
}

@keyframes article-hero-continue-dot {
    0%,
    70%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    35% {
        opacity: 1;
        transform: translateY(3px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .article-header__continue-dots span {
        animation: none;
        opacity: 0.75;
    }
}

.blog-article-page .article-content #article-start {
    scroll-margin-top: 5.5rem;
}

/* Таблицы в тексте статьи: читаемость + единая surface-стилистика */
.article-content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 1.1rem 0 1.45rem;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 4px 16px rgba(37, 99, 235, 0.06);
    overflow: hidden;
}

.article-content table thead th {
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.95) 0%, rgba(229, 237, 255, 0.92) 100%);
    color: #1e3a8a;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    font-size: 0.72rem;
    font-weight: 700;
    border-bottom: 1px solid rgba(37, 99, 235, 0.2);
}

.article-content table th,
.article-content table td {
    padding: 0.68rem 0.78rem;
    text-align: left;
    vertical-align: top;
    font-size: 0.92rem;
    line-height: 1.5;
    color: #334155;
    border-right: 1px solid rgba(148, 163, 184, 0.18);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.article-content table th:last-child,
.article-content table td:last-child {
    border-right: none;
}

.article-content table tbody tr:last-child td {
    border-bottom: none;
}

.article-content table tbody tr:nth-child(even) td {
    background: rgba(248, 252, 255, 0.76);
}

.article-content table tbody td:first-child {
    color: #1e293b;
    font-weight: 700;
    min-width: 150px;
}

/* Акцентные вопросы к читателю */
.article-content .reader-question {
    margin: 1.05rem 0 1.25rem;
    padding: 0.72rem 0.82rem;
    border-left: 3px solid rgba(37, 99, 235, 0.5);
    border-radius: 0 10px 10px 0;
    background: rgba(239, 246, 255, 0.72);
    color: #1e293b;
    font-size: 1rem;
    line-height: 1.55;
    font-weight: 600;
}

.article-content .reader-question strong:first-child {
    color: #1d4ed8;
}

.scenario-card__toggle,
.range-calc__toggle {
    display: inline-flex;
    gap: 0.35rem;
    margin: 0.1rem 0 0.65rem;
    flex-wrap: wrap;
}

.scenario-card__toggle-btn,
.range-calc__toggle-btn {
    border: 1px solid rgba(37, 99, 235, 0.2);
    background: rgba(255, 255, 255, 0.8);
    color: #334155;
    border-radius: 999px;
    padding: 0.32rem 0.64rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.scenario-card__toggle-btn.is-active,
.range-calc__toggle-btn.is-active {
    background: rgba(37, 99, 235, 0.12);
    border-color: rgba(37, 99, 235, 0.38);
    color: #1e3a8a;
}

.scenario-card__list,
.common-mistakes__list {
    margin: 0.2rem 0 0;
    padding-left: 1.15rem;
}

.scenario-card__list li,
.common-mistakes__list li {
    margin-bottom: 0.34rem;
    font-size: 0.93rem;
    line-height: 1.5;
}

.range-calc__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.55rem;
    margin-top: 0.35rem;
}

.range-calc__item {
    padding: 0.6rem 0.7rem;
    border-radius: 10px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    background: rgba(239, 246, 255, 0.75);
}

.range-calc__label {
    display: block;
    color: #1d4ed8;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.2rem;
}

.range-calc__value {
    display: block;
    color: #1f2937;
    font-size: 0.92rem;
    line-height: 1.35;
    font-weight: 600;
}

.range-calc__table-wrap.is-hidden {
    display: none;
}

.range-calc__table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.2rem;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    background: rgba(255, 255, 255, 0.84);
}

.range-calc__table th,
.range-calc__table td {
    padding: 0.52rem 0.6rem;
    text-align: left;
    font-size: 0.84rem;
    line-height: 1.4;
    color: #334155;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.range-calc__table th {
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #1e3a8a;
    background: rgba(239, 246, 255, 0.9);
}

.decision-tree-lite__steps {
    display: grid;
    gap: 0.5rem;
}

.decision-tree-lite__step {
    padding: 0.62rem 0.72rem;
    border-radius: 10px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    background: rgba(241, 245, 255, 0.72);
    font-size: 0.92rem;
    line-height: 1.48;
    color: #334155;
}

.article-content ul,
.article-content ol {
    margin: 24px 0;
    padding-left: 32px;
}

.article-content li {
    font-size: var(--font-size-base);
    font-family: var(--font-family);
    line-height: var(--line-height-reading);
    letter-spacing: -0.011em;
    color: #334155;
    margin-bottom: 0.5rem;
}

.article-content ul li::marker {
    color: var(--color-primary);
}

.article-content blockquote {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(30, 58, 138, 0.1) 100%);
    border-left: 4px solid var(--color-primary);
    padding: 24px 32px;
    margin: 32px 0;
    border-radius: 8px;
    font-style: italic;
    font-size: 18px;
    color: var(--color-text);
}

/* CTA внутри статьи — карточка в стиле блога */
.cta-block-inline {
    background: var(--color-bg-gradient);
    color: #fff;
    padding: 2rem 2.25rem;
    border-radius: var(--radius-lg);
    margin: 2.5rem 0;
    box-shadow: var(--shadow-lg);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.cta-block-inline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    pointer-events: none;
}
.cta-block-inline h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    font-weight: 700;
    font-family: var(--font-family-heading);
    color: #fff;
    margin-bottom: 0.5rem;
}
.cta-block-inline p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.92);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.cta-block-inline .btn {
    background: #fff;
    color: var(--color-primary);
    font-weight: 600;
    padding: 0.75rem 1.75rem;
    border-radius: 10px;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}
.cta-block-inline .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 2rem 0;
    padding: 1.25rem 0;
}

.article-tags .tag {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(37, 99, 235, 0.08);
    color: var(--color-primary);
    border: 1px solid rgba(37, 99, 235, 0.2);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
}
.article-tags .tag:hover {
    background: rgba(37, 99, 235, 0.14);
    border-color: rgba(37, 99, 235, 0.35);
}

/* Прогресс чтения — тонкая полоска в цвете primary */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(37, 99, 235, 0.08);
    z-index: 9999;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-dark));
    width: 0%;
    transition: width 0.12s ease-out;
}

.article-share-widget {
    display: none;
}

.qrcode-container:empty,
.share-buttons-container:empty {
    display: none;
}

.qrcode-container {
    min-width: 200px;
    text-align: center;
}

.qrcode-header {
    text-align: center;
    margin-bottom: 12px;
}

.qrcode-header h4 {
    font-size: clamp(0.9375rem, 1.5vw, 1rem);
    font-weight: 700;
    font-family: var(--font-family-heading);
    color: var(--color-text);
    margin: 0 0 4px 0;
}

.qrcode-hint {
    font-size: 0.8125rem;
    color: var(--color-text-light);
    margin: 0;
    line-height: 1.45;
}

#qrcode-canvas {
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.qrcode-actions {
    margin-top: 12px;
    text-align: center;
}

.share-buttons-container {
    background: var(--widget-surface-bg);
    padding: 1.25rem;
    border-radius: var(--widget-radius);
    box-shadow: var(--widget-surface-shadow);
    min-width: 200px;
    border: 1px solid var(--widget-surface-border);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.share-header {
    text-align: center;
    margin-bottom: 16px;
}

.share-header h4 {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    background: #fff;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 10px;
    text-decoration: none;
    color: var(--color-text);
    font-size: 14px;
    font-weight: 500;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.share-button:hover {
    background: rgba(37, 99, 235, 0.04);
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

.share-button svg {
    flex-shrink: 0;
}

.share-telegram { color: #0088cc; }
.share-whatsapp { color: #25D366; }
.share-vk { color: #0077FF; }
.share-ok { color: #EE8208; }
.share-copy { color: var(--color-primary); }

/* Блок «Поделиться» внизу статьи */
.share-buttons-bottom {
    margin: 2.5rem 0;
    padding: 1.75rem 2rem;
    background: var(--widget-surface-bg);
    border: 1px solid var(--widget-surface-border);
    border-radius: var(--widget-radius);
    text-align: center;
    box-shadow: var(--widget-surface-shadow);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}
.share-buttons-bottom .share-header h4 {
    font-size: clamp(1.0625rem, 2vw, 1.25rem);
    font-weight: 700;
    font-family: var(--font-family-heading);
    color: var(--color-text);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
}
.share-buttons-bottom .share-buttons {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.copy-notification {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    background: var(--color-primary);
    color: #fff;
    padding: 0.75rem 1.25rem;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 500;
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.35);
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s;
    z-index: 10000;
}

.copy-notification.show {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 768px) {
    .article-header__title {
        font-size: 32px;
    }

    .article-content h2 {
        font-size: 24px;
    }

    .article-content p {
        font-size: 16px;
    }

    .article-content > p:first-of-type:not(.article-disclaimer),
    .article-content > blockquote:first-of-type + p,
    .article-content > p.article-disclaimer + p {
        font-size: 1.02rem;
        padding: 0.8rem 0.75rem;
        border-radius: 10px;
        margin-bottom: 0.75rem;
    }

    .article-content > p:first-of-type:not(.article-disclaimer) + p,
    .article-content > blockquote:first-of-type + p + p,
    .article-content > p.article-disclaimer + p + p {
        font-size: 0.98rem;
    }

    .article-content p.article-disclaimer--compact {
        font-size: 0.78rem;
        padding-top: 0.45rem;
    }

    .article-body-prelude {
        margin-top: 0;
        padding: 0.55rem 0.7rem 0.62rem;
    }

    .article-body-prelude__text {
        font-size: 1rem;
        line-height: 1.52;
    }

    .article-content > .article-body-prelude + p,
    .article-content > .article-body-prelude + blockquote.article-pullquote + p,
    .article-content > .article-body-prelude + blockquote.article-pullquote + ul.article-entry-facts + p,
    .article-content > .article-body-prelude + ul.article-entry-facts + p,
    .article-content > .article-body-prelude + ul.article-entry-facts + blockquote + p {
        font-size: 0.98rem;
    }

    .article-trust-strip {
        grid-template-columns: 1fr;
        padding: 0.75rem 0.85rem;
        gap: 0.4rem;
    }

    .article-trust-strip__value {
        font-size: 0.82rem;
    }

    .article-content blockquote.article-pullquote {
        padding: 0.85rem 0.9rem 0.95rem 0.95rem;
        margin-bottom: 0.9rem;
    }

    blockquote.article-pullquote p {
        font-size: 1.03rem;
        line-height: 1.48;
    }

    .article-share-widget {
        display: none;
    }

    .cta-block-inline {
        padding: 1.25rem 1rem;
        border-radius: 14px;
        margin: 1.75rem 0;
    }

    .cta-block-inline h3 {
        font-size: 1.125rem;
        line-height: 1.3;
    }

    .cta-block-inline p {
        font-size: 0.95rem;
        margin-bottom: 1rem;
    }

    .cta-block-inline .btn {
        width: 100%;
        max-width: 320px;
        padding: 0.75rem 1rem;
    }

    .article-tags {
        gap: 8px;
        margin: 1.5rem 0;
        padding: 0.75rem 0;
    }

    .article-tags .tag {
        font-size: 0.75rem;
        padding: 5px 10px;
    }

    .share-buttons-bottom {
        margin: 1.75rem 0;
        padding: 1rem;
        border-radius: 12px;
    }

    .share-buttons-bottom .share-buttons {
        gap: 8px;
    }

    .share-button {
        width: 100%;
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.875rem;
    }

    .share-button span {
        display: none;
    }

    .share-button svg {
        width: 20px;
        height: 20px;
    }

    .copy-notification {
        left: 0.75rem;
        right: 0.75rem;
        bottom: 0.75rem;
        text-align: center;
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }

    .related-articles {
        margin: 1.75rem 0;
        padding: 1rem;
        border-radius: 12px;
    }

    .related-articles h3 {
        font-size: 1rem;
        margin-bottom: 0.75rem;
    }

    .related-articles li {
        padding: 0.625rem 0.75rem;
    }

    .related-articles a {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .article-faq {
        margin: 1.75rem 0;
        padding: 1rem 0;
    }

    .article-faq__title {
        font-size: 1.125rem;
        margin-bottom: 0.875rem;
        border-bottom-width: 2px;
    }

    .article-faq__question {
        font-size: 0.9375rem;
        padding: 0.75rem;
        border-radius: 10px;
    }

    .article-faq__answer {
        font-size: 0.875rem;
        padding: 0 0.75rem 0.75rem;
    }

    .article-comments {
        margin: 1.75rem 0;
        padding: 1.25rem 0;
    }

    .article-comments h2 {
        font-size: 1.125rem;
    }

    .article-comments .comments-subtitle {
        font-size: 0.875rem;
        margin-bottom: 1rem;
    }

    .article > .container > .related-articles,
    .article > .container > .article-faq,
    .article > .container > .article-navigation,
    .article > .container > .article-comments,
    .article > .container > .share-buttons-bottom,
    .article > .container > .article-snippet,
    .article > .container > .qrcode-container {
        margin-top: 1rem;
        margin-bottom: 1rem;
        border-radius: 12px;
    }

    .article > .container > .article-snippet {
        border-radius: 0;
        padding: 0;
    }

    .article > .container > .article-faq,
    .article > .container > .article-comments,
    .article > .container > .related-articles,
    .article > .container > .qrcode-container {
        padding: 0.875rem;
    }

    .article > .container > .article-navigation {
        padding: 0.6rem;
    }

    .blog-article-page .header__article-sep,
    .blog-article-page .header__article-title {
        display: none;
    }

    .blog-article-hero .breadcrumbs {
        margin-bottom: 0.75rem;
    }

    .blog-article-hero .breadcrumbs a,
    .blog-article-hero .breadcrumbs span {
        font-size: 0.6875rem;
    }

    .article-header__badges {
        margin-top: 0.75rem;
        gap: 0.4rem;
    }

    .article-header__trust {
        grid-template-columns: 1fr;
        gap: 0.35rem;
        margin-top: 0.75rem;
    }

    .article-header__hero-editorial {
        margin-top: 0.55rem;
        padding: 0.65rem 0.78rem 0.82rem;
        border-radius: 12px;
    }

    .article-header__trust-micro {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        max-width: 100%;
        padding-bottom: 0.48rem;
        margin-bottom: 0.38rem;
    }

    .article-header__trust-micro-v {
        font-size: 0.68rem;
    }

    .article-header__main-thought {
        padding-left: 0.78rem;
    }

    .article-header__main-thought p {
        font-size: 1.02rem;
        line-height: 1.44;
    }

    .article-header__hero-editorial .article-header__lead {
        margin-top: 0.62rem;
        padding-top: 0.58rem;
        font-size: 0.92rem;
        line-height: 1.46;
    }

    .article-header__trust-item {
        padding: 0.48rem 0.56rem;
        border-radius: 9px;
    }

    .article-header__trust-label {
        font-size: 0.58rem;
    }

    .article-header__trust-value {
        font-size: 0.7rem;
    }

    .article-header__badge {
        font-size: 0.6875rem;
        padding: 0.28rem 0.56rem;
    }

    .article-header__lead {
        margin-top: 0.7rem;
        font-size: 0.94rem;
        line-height: 1.45;
    }

    .article-header__prelude {
        margin-top: 0.65rem;
        padding: 0.62rem 0.68rem;
        border-radius: 9px;
    }

    .article-header__prelude-label {
        font-size: 0.57rem;
        margin-bottom: 0.25rem;
    }

    .article-header__prelude-text {
        font-size: 0.84rem;
        line-height: 1.45;
    }

    .article-header__facts {
        margin-top: 0.7rem;
        gap: 0.35rem;
    }

    .article-header__facts li {
        font-size: 0.66rem;
        padding: 0.25rem 0.5rem;
    }

    .article-header__teaser {
        margin-top: 0.8rem;
        padding: 0.75rem 0.75rem 0.75rem 0.85rem;
        border-left-width: 2px;
        border-radius: 0 10px 10px 0;
    }

    .article-header__teaser-label {
        font-size: 0.62rem;
        margin-bottom: 0.35rem;
    }

    .article-header__teaser-quote {
        font-size: 0.88rem;
        line-height: 1.45;
    }

    .article-transparency {
        margin: 0.65rem 0 1rem;
        padding: 0.72rem 0.8rem;
        border-radius: 10px;
    }

    .article-transparency__title {
        font-size: 0.78rem;
        margin-bottom: 0.42rem;
    }

    .article-transparency li {
        font-size: 0.84rem;
        line-height: 1.45;
    }

    .scenario-card,
    .range-calc,
    .common-mistakes,
    .decision-tree-lite {
        margin: 0.8rem 0 1rem;
        padding: 0.75rem 0.82rem;
        border-radius: 10px;
    }

    .scenario-card__title,
    .range-calc__title,
    .common-mistakes__title,
    .decision-tree-lite__title {
        font-size: 0.9rem;
        margin-bottom: 0.45rem;
    }

    .scenario-card__lead,
    .range-calc__text,
    .scenario-card__list li,
    .common-mistakes__list li,
    .decision-tree-lite__step {
        font-size: 0.84rem;
        line-height: 1.45;
    }

    .range-calc__grid {
        grid-template-columns: 1fr;
        gap: 0.42rem;
    }

    .range-calc__item {
        padding: 0.5rem 0.58rem;
        border-radius: 9px;
    }

    .range-calc__label {
        font-size: 0.64rem;
    }

    .range-calc__value {
        font-size: 0.82rem;
    }

    .article-header__micro-cta {
        font-size: 0.74rem;
        padding: 0.48rem 0.72rem;
        margin-top: 0.2rem;
    }

    .article-header__continue {
        margin-top: 0.3rem;
        max-width: none;
    }

    .article-header__continue-text {
        font-size: 0.62rem;
    }

    .blog-article-page .article-content #article-start {
        scroll-margin-top: 4.25rem;
    }

    .scenario-card__toggle-btn,
    .range-calc__toggle-btn {
        font-size: 0.72rem;
        padding: 0.28rem 0.54rem;
    }

    .range-calc__table th,
    .range-calc__table td {
        font-size: 0.78rem;
        padding: 0.46rem 0.5rem;
    }
}

/* Гарантия видимости тела статьи (исправление пустого отображения под hero) */
.blog-article-page .article-content {
    color: #334155 !important;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 1px;
    display: block !important;
}
.blog-article-page .article-content p,
.blog-article-page .article-content h2,
.blog-article-page .article-content h3,
.blog-article-page .article-content ul,
.blog-article-page .article-content ol,
.blog-article-page .article-content blockquote,
.blog-article-page .article-content table,
.blog-article-page .article-content .typography-test {
    color: inherit;
    visibility: visible !important;
    opacity: 1 !important;
}
.blog-article-page .article-content a {
    color: var(--color-primary) !important;
}

.blog-article-page .article-content a:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Hero: QR — карточка; на широком экране справа от колонки заголовка (зона до TOC) */
.blog-article-page .blog-article-hero .article-header__qr-aside {
    position: absolute;
    top: 1.25rem;
    right: max(0.5rem, var(--spacing-sm, 1rem));
    left: auto;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(120px, 28vw);
    pointer-events: none;
}

@media (min-width: 1100px) {
    .blog-article-page .blog-article-hero .article-header__qr-aside {
        left: 100%;
        right: auto;
        margin-left: 0.85rem;
        top: 1.45rem;
        width: min(118px, 20vw);
    }
}

.blog-article-page .blog-article-hero .article-header__qr-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    padding: 0.62rem 0.65rem 0.72rem;
    border-radius: var(--radius-md, 12px);
    background: linear-gradient(
        145deg,
        rgba(255, 255, 255, 0.16) 0%,
        rgba(15, 23, 42, 0.32) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.24);
    box-shadow:
        0 12px 32px rgba(4, 8, 22, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.blog-article-page .blog-article-hero .article-header__qr-frame {
    padding: 0.5rem;
    border-radius: var(--radius-sm, 8px);
    background: #fff;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.08);
}

.blog-article-page .blog-article-hero .article-header__qr-frame canvas {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    image-rendering: pixelated;
    border-radius: 4px;
}

.blog-article-page .blog-article-hero .article-header__qr-caption {
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(191, 219, 254, 0.95);
    text-align: center;
    line-height: 1.2;
}

.blog-article-page .blog-article-hero .article-header__qr-hint {
    font-size: 0.62rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: rgba(226, 232, 240, 0.88);
    text-align: center;
    line-height: 1.25;
}

@media (max-width: 719px) {
    /* На телефоне QR «статья в телефоне» не нужен — пользователь уже на устройстве */
    .blog-article-page .blog-article-hero .article-header__qr-aside {
        display: none !important;
    }
}
