/* ─── Шрифт Inter подключаем в base.html через <link>, здесь только использование ─── */

/* ─── Тема: светлая (по умолчанию) ──────────────────────────────────────── */
:root,
[data-theme="light"] {
    /* Базовые цвета фона и текста */
    --bg-page: #FAF7EE;
    --bg-surface: #FFFFFF;
    --bg-secondary: #F1ECE0;

    /* Текст */
    --text-primary: #1A1A18;
    --text-secondary: #5F5E5A;
    --text-muted: #888780;
    --text-on-brand: #FFFFFF;

    /* Бренд */
    --brand-green: #00805F;
    --brand-green-soft: rgba(0, 128, 95, 0.12);
    --brand-green-text: #005A42;
    --brand-amber: #FAAE17;
    --brand-amber-soft: rgba(250, 174, 23, 0.14);
    --brand-amber-text: #8A5800;
    --brand-graphite: #1A1A18;
    --brand-graphite-text: #F7F3E9;

    /* Границы и разделители */
    --border-subtle: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.15);

    /* Прочее */
    --hero-graphite-bg: #1A1A18;
}

/* ─── Тема: темная ──────────────────────────────────────────────────────── */
[data-theme="dark"] {
    --bg-page: #0A3B33;
    --bg-surface: #0E4A40;
    --bg-secondary: #072E28;
    --text-primary: #EAF5F1;
    --text-secondary: #A7C9C0;
    --text-muted: #7BA39A;
    --text-on-brand: #FFFFFF;
    --brand-green: #2BC9A0;
    --brand-green-soft: rgba(43, 201, 160, 0.20);
    --brand-green-text: #7FE3C6;
    --brand-amber: #FFC04A;
    --brand-amber-soft: rgba(255, 192, 74, 0.18);
    --brand-amber-text: #FFD787;
    --brand-graphite: #118C79;
    --brand-graphite-text: #FFFFFF;
    --border-subtle: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --hero-graphite-bg: #118C79;
}


/* ─── Сброс и базовая типографика ───────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--text-primary);
    background: var(--bg-page);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    color: inherit;
}

/* ─── Layout-каркас ─────────────────────────────────────────────────────── */
.site {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site__header {
    background: var(--bg-surface);
    border-bottom: 0.5px solid var(--border-subtle);
}

.site__main {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 48px;
}

.site__footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    padding: 24px 16px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 40px;
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    margin: 4px 0 16px;
}

.footer__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ─── Шапка ─────────────────────────────────────────────────────────────── */
.header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
    display: flex;
    align-items: center;
    gap: 24px;
}

@media (max-width: 768px) {
    .header__inner {
        padding: 14px 16px;
        gap: 16px;
    }
}


.header__left {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Навигация растягивается на все свободное пространство между логотипом и правой группой */
.nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 48px;
    font-size: 16px;
    margin-left: 48px;
}

@media (max-width: 768px) {
    .nav {
        margin-left: 12px;
        gap: 16px;
        font-size: 14px;
    }
}

.nav__item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px 8px;
    cursor: pointer;
    flex-shrink: 0;
    font-weight: 500;
}



.header__right {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    margin-left: auto;
}

/* ─── Логотип в шапке ───────────────────────────────────────────────────── */

.logo {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

/* Старый вариант с эмодзи-листом — остался для обратной совместимости,
   но в шапке теперь используется полный SVG из logo--full. */
.logo__leaf {
    width: 22px;
    height: 22px;
    color: var(--brand-green);
}

.logo--full .logo__img--dark { display: none !important; }
.logo--full .logo__img--light { display: block !important; }
[data-theme="dark"] .logo--full .logo__img--light { display: none !important; }
[data-theme="dark"] .logo--full .logo__img--dark { display: block !important; }

/* Полный SVG-логотип (с текстом «halykmacro») */
.logo--full .logo__img {
    height: 38px;
    width: auto;
    display: block;
}

@media (max-width: 768px) {
    .logo--full .logo__img {
        height: 28px;
    }
}

/* Внутри nav__item — обернутая <a> ссылка */
.nav__item > a {
    color: inherit;
    text-decoration: none;
    transition: color 0.15s ease;
}

.nav__item:hover > a {
    color: var(--brand-green);
}

/* Активный пункт остается подсвеченным даже без ховера */
.nav__item--active > a {
    color: var(--text-primary);
    font-weight: 500;
}

.nav__item--active {
    border-bottom: 2px solid var(--brand-green);
    margin-bottom: -2px;
}

/* Заглушка для будущих элементов шапки (переключатели) */
.header__placeholder {
    color: var(--text-muted);
}

/* ─── Переключатель темы и языка в шапке ────────────────────────────────── */

.lang-switch {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.3px;
}

.lang-switch__item {
    color: var(--text-muted);
    padding: 4px 6px;
    border-radius: 6px;
    text-transform: uppercase;
    transition: color 0.15s ease, background-color 0.15s ease;
}

.lang-switch__item:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.lang-switch__item--active {
    color: var(--text-primary);
    font-weight: 500;
}

.lang-switch__sep {
    color: var(--text-muted);
    user-select: none;
}

/* Переключатель темы */
.theme-toggle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.15s ease, background-color 0.15s ease;
}

.theme-toggle:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.theme-toggle__icon {
    width: 18px;
    height: 18px;
}

/* По умолчанию показываем иконку «луна» (значит сейчас светлая, кликом включим темную).
   В темной теме показываем «солнце». */
[data-theme="light"] .theme-toggle__icon--sun { display: none; }
[data-theme="dark"] .theme-toggle__icon--moon { display: none; }

/* Кнопка «Войти» */
.btn-login {
    background: var(--text-primary);
    color: var(--bg-surface);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    transition: opacity 0.15s ease;
}

.btn-login:hover {
    opacity: 0.9;
}

/* ─── Заголовок страницы ────────────────────────────────────────────────── */

.page-title {
    margin: 8px 0 6px;
    font-size: 32px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.4px;
    color: var(--text-primary);
}

.page-subtitle {
    margin: 0 0 32px;
    font-size: 16px;
    color: var(--text-secondary);
    max-width: 760px;
}

/* ─── Hero-карточки ─────────────────────────────────────────────────────── */

.heroes {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 16px;
    margin-bottom: 32px;
}

.hero {
    border-radius: 14px;
    padding: 24px 28px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hero--green {
    background: var(--brand-green);
    color: var(--text-on-brand);
}

[data-theme="dark"] .hero--green {
    background: #1F6B47;
}

.hero--amber {
    background: var(--brand-amber);
    color: #1A1A18;
}

[data-theme="dark"] .hero--amber {
    background: #B5800F;
    color: #FFFAF0;
}

.hero__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.hero__name {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

.hero__period {
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 999px;
    font-weight: 500;
}

.hero--green .hero__period {
    background: rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
}

[data-theme="dark"] .hero--green .hero__period {
    background: rgba(43, 196, 119, 0.22);
    color: #A8E6C8;
}

.hero--amber .hero__period {
    background: rgba(26, 26, 24, 0.14);
    color: #1A1A18;
}

[data-theme="dark"] .hero--amber .hero__period {
    background: rgba(255, 250, 240, 0.16);
    color: #FFFAF0;
}

.hero__sub {
    font-size: 14px;
    margin-top: 6px;
    opacity: 0.85;
    line-height: 1.5;
}

.hero__num {
    font-size: 56px;
    font-weight: 500;
    line-height: 1;
    margin-top: 20px;
    letter-spacing: -0.8px;
    font-variant-numeric: tabular-nums;
}

.hero__delta {
    font-size: 14px;
    margin-top: 8px;
    opacity: 0.85;
}

/* ─── Секции с тайлами ──────────────────────────────────────────────────── */

.section {
    margin-bottom: 48px;
}

.section__head {
    margin-bottom: 18px;
}

.section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.section__title-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.section__title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-primary);
}

.section__pill {
    font-size: 11px;
    padding: 3px 11px;
    border-radius: 999px;
    font-weight: 500;
    letter-spacing: 0.3px;
    background: var(--brand-green-soft);
    color: var(--brand-green-text);
}

.section__see {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.section__see:hover {
    color: var(--text-primary);
}

/* hero тоже получают стрелку */
.hero {
    position: relative;
}

.hero__arrow {
    position: absolute;
    bottom: 18px;
    right: 18px;
    width: 16px;
    height: 16px;
    opacity: 0;
    transition: opacity 0.15s ease;
    color: currentColor;
}

.hero:hover .hero__arrow {
    opacity: 0.85;
}

.section-page {
    margin-top: 8px;
}

.section-page__title {
    font-size: 36px;
    font-weight: 500;
    line-height: 1.15;
    margin: 0 0 10px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.section-page__lead {
    font-size: 17px;
    color: var(--text-secondary);
    margin: 0 0 32px;
    max-width: 850px;
    line-height: 1.6;
}

/* ─── Карточка с графиком ───────────────────────────────────────────────── */

.chart-card {
    background: var(--bg-surface);
    border: 0.5px solid var(--border-subtle);
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 24px;
}

.chart-card__title {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
}

.chart-card__sub {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.chart-card__current-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.chart-card__current-value {
    font-size: 36px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.1;
    margin-top: 4px;
    letter-spacing: -0.4px;
    font-variant-numeric: tabular-nums;
}

.chart-card__current-delta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.chart-card__current-delta--up { color: var(--brand-green); }
.chart-card__current-delta--down { color: #C04A3D; }

[data-theme="dark"] .chart-card__current-delta--down { color: #B5800F; }

/* Сам холст графика */
.chart-card__canvas-wrap {
    position: relative;
    height: 360px;
}

@media (max-width: 768px) {
    .chart-card__canvas-wrap { height: 260px; }
    .chart-card__head { flex-direction: column; gap: 12px; }
    .chart-card__current { text-align: left; }
}

/* ─── Фильтры (toolbar над графиком) ────────────────────────────────────── */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 10px;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group__label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-surface);
    border: 0.5px solid var(--border-subtle);
    border-radius: 8px;
    padding: 8px 32px 8px 12px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888780' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s ease;
}

.filter-segment {
    padding: 7px 14px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-secondary);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
    font-weight: 500;
}

/* Группа кнопок-сегментов (как переключатель периода 1М / 3М / 1Г / Все) */
.filter-segments {
    display: inline-flex;
    background: var(--bg-surface);
    border: 0.5px solid var(--border-subtle);
    border-radius: 8px;
    padding: 2px;
    gap: 0;
}

.filter-segment:hover {
    color: var(--text-primary);
}

.filter-segment--active {
    background: var(--brand-green);
    color: #FFFFFF;
}

[data-theme="dark"] .filter-segment--active {
    background: #1F6B47;
}

/* ─── Индикатор загрузки HTMX ───────────────────────────────────────────── */

.htmx-indicator {
    opacity: 0;
    transition: opacity 0.2s ease;
}

.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator {
    opacity: 1;
}

.chart-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-muted);
    font-size: 12px;
}

/* ─── Таблица данных ────────────────────────────────────────────────────── */

.data-table-wrap {
    background: var(--bg-surface);
    border: 0.5px solid var(--border-subtle);
    border-radius: 12px;
    padding: 8px;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.data-table th,
.data-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 0.5px solid var(--border-subtle);
}

.data-table th {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
    color: var(--text-muted);
}

.data-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}

.data-table tr:hover td {
    background: var(--bg-secondary);
}

/* ─── Утилиты и блоки ───────────────────────────────────────────────────── */

.metadata-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 18px 22px;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.metadata-card__title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0 0 10px;
    font-weight: 500;
}

/* Двухколоночный layout: график слева, сайдбар справа */
.split-layout {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 20px;
}

@media (max-width: 980px) {
    .split-layout {
        grid-template-columns: 1fr;
    }
}

/* ─── Тайл со спарклайном (мини-график тренда) ──────────────────────────── */

.tile--spark {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tile__row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
}

.tile__row-num {
    flex-shrink: 0;
}

.tile__spark {
    flex: 1;
    height: 40px;
    min-width: 0;
}

.tile__spark canvas {
    display: block;
    max-width: 100%;
}

.tile__delta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
    font-weight: 500;
}

.tile__delta--up { color: var(--brand-green); }
.tile__delta--down { color: #C04A3D; }

[data-theme="dark"] .tile__delta--up { color: #2BC477; }
[data-theme="dark"] .tile__delta--down { color: #B5800F; }

/* ─── Карточки исследований ─────────────────────────────────────────────── */

.research-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .research-grid {
        grid-template-columns: 1fr;
    }
}

.research-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-surface);
    border: 0.5px solid var(--border-subtle);
    border-radius: 12px;
    padding: 18px 20px;
    min-height: 180px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.research-card:hover {
    border-color: var(--border-strong);
}

.research-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.research-card__type {
    background: var(--brand-green-soft);
    color: var(--brand-green-text);
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 11px;
}

.research-card__title {
    font-size: 17px;
    line-height: 1.4;
    color: var(--text-primary);
    flex: 1;
    margin: 0;
    font-weight: 500;
}

.research-card__authors {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: auto;
}

.article-figure {
    margin: 18px 0;
}
.article-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
}

/* ─── Хлебные крошки ────────────────────────────────────────────────────── */

.breadcrumbs a {
    color: var(--text-secondary);
    transition: color 0.15s ease;
}

.breadcrumbs a:hover {
    color: var(--text-primary);
}

.breadcrumbs__sep {
    color: var(--text-muted);
    user-select: none;
}

.breadcrumbs__current {
    color: var(--text-primary);
}

/* ─── Карточки прогнозов ────────────────────────────────────────────────── */

.forecast-group {
    margin-bottom: 36px;
}

.forecast-group__head {
    margin-bottom: 14px;
}

.forecast-group__title {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.forecast-group__lead {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.forecast-card__eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.forecast-card__title {
    font-size: 15px;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 0;
}

.forecast-card__period {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.forecast-card__value {
    font-size: 30px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.4px;
    font-variant-numeric: tabular-nums;
}

.forecast-card__note {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.forecast-card__change {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.forecast-card__change--up { color: var(--brand-green); }
.forecast-card__change--down { color: #C04A3D; }

[data-theme="dark"] .forecast-card__change--up { color: #2BC477; }
[data-theme="dark"] .forecast-card__change--down { color: #B5800F; }

/* ─── Список исследований ───────────────────────────────────────────────── */

.research-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 24px;
}

.research-tag {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 999px;
    background: var(--bg-surface);
    border: 0.5px solid var(--border-subtle);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
}

.research-tag:hover {
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.research-tag--active {
    background: var(--brand-green);
    color: #FFFFFF;
    border-color: var(--brand-green);
}

[data-theme="dark"] .research-tag--active {
    background: #1F6B47;
    border-color: #1F6B47;
}

/* ─── Страница статьи ───────────────────────────────────────────────────── */

.article-layout {
    display: grid;
    grid-template-columns: minmax(0, 760px) 280px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 980px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.article-header {
    margin-bottom: 28px;
}

.article-header__meta {
    display: flex;
    gap: 12px;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.article-header__type {
    background: var(--brand-green-soft);
    color: var(--brand-green-text);
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-size: 10px;
}

.article-header__title {
    font-size: 36px;
    font-weight: 500;
    line-height: 1.2;
    color: var(--text-primary);
    margin: 0 0 14px;
    letter-spacing: -0.5px;
}

.article-header__lead {
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.55;
    margin: 0;
}

.article-content h2 {
    font-size: 22px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 36px 0 14px;
    line-height: 1.3;
    letter-spacing: -0.2px;
}

.article-content p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-primary);
    margin: 0 0 18px;
}

.article-content ul {
    margin: 0 0 16px;
    padding-left: 22px;
}

.article-content ul li {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Графики внутри статьи */
.article-chart {
    background: var(--bg-surface);
    border: 0.5px solid var(--border-subtle);
    border-radius: 12px;
    padding: 18px 20px;
    margin: 24px 0;
}

.article-chart__title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin: 0 0 2px;
}

.article-chart__subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    margin: 0 0 12px;
}

.article-chart__canvas-wrap {
    position: relative;
    height: 320px;
}

.article-chart__source {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 8px;
    text-align: right;
    font-style: italic;
}

.article-chart--missing {
    background: var(--bg-secondary);
    color: var(--text-muted);
    text-align: center;
    padding: 24px;
    font-size: 13px;
}

/* Сайдбар статьи */
.article-aside {
    position: sticky;
    top: 20px;
}

.article-aside__title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin: 0 0 12px;
    font-weight: 500;
}

.article-related {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-related__item {
    display: block;
    padding: 12px 0;
    border-bottom: 0.5px solid var(--border-subtle);
}

.article-related__item:last-child {
    border-bottom: none;
}

.article-related__date {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.article-related__title {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-primary);
}

.article-related__item:hover .article-related__title {
    color: var(--brand-green);
}

/* ─── Карточки прогнозов ────────────────────────────────────────────────── */

.forecast-group {
    margin-bottom: 40px;
}

.forecast-group__head {
    margin-bottom: 16px;
}

.forecast-group__title {
    font-size: 18px;
    font-weight: 500;
    margin: 0 0 4px;
    color: var(--text-primary);
}

.forecast-group__lead {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
}

.forecast-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 980px) {
    .forecast-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .forecast-grid { grid-template-columns: 1fr; }
}

.forecast-card {
    background: var(--bg-surface);
    border: 0.5px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 0.15s ease;
}

.forecast-card:hover {
    border-color: var(--border-strong);
}

.forecast-card__eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.forecast-card__title {
    font-size: 15px;
    line-height: 1.4;
    color: var(--text-primary);
    margin: 0;
    font-weight: 500;
}

.forecast-card__period {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.forecast-card__value-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 12px;
}

.forecast-card__value {
    font-size: 30px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.4px;
    font-variant-numeric: tabular-nums;
}

.forecast-card__note {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
}

.forecast-card__change {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.forecast-card__change--up { color: var(--brand-green); }
.forecast-card__change--down { color: #C04A3D; }

[data-theme="dark"] .forecast-card__change--up { color: #2BC477; }
[data-theme="dark"] .forecast-card__change--down { color: #B5800F; }


/* ─── Цветные пилюли для тайлов исследований ────────────────────────────── */

.tile-pill {
    display: inline-block;
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 10px;
    font-weight: 500;
    letter-spacing: 0.2px;
}

.tile-pill--coral  { background: #FAECE7; color: #993C1D; }
.tile-pill--purple { background: #EEEDFE; color: #534AB7; }
.tile-pill--teal   { background: #E1F5EE; color: #0F6E56; }
.tile-pill--amber  { background: var(--brand-amber-soft); color: var(--brand-amber-text); }

[data-theme="dark"] .tile-pill--coral  { background: rgba(250, 236, 231, 0.12); color: #E8A48A; }
[data-theme="dark"] .tile-pill--purple { background: rgba(238, 237, 254, 0.12); color: #B0A8E8; }
[data-theme="dark"] .tile-pill--teal   { background: rgba(225, 245, 238, 0.12); color: #7DD3B0; }


/* ─── Тайл-публикация (с пилюлей, без числа) ──────────────────────────── */

.tile--publication {
    /* Уже compact, добавляем специфику */
    min-height: 120px;
}

.tile--publication .tile__title {
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: auto;
    margin-top: 0;
}

.tile--publication .tile__meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ─── Пилюля «логин» ──────────────────────────────────────────────────── */
.lock-pill {
    display: inline-block;
    margin-left: 6px;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    text-transform: lowercase;
    letter-spacing: 0;
    font-weight: 400;
    vertical-align: middle;
}

/* Нижняя строка тайла: число слева, спарклайн справа */
.tile__bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.tile__num-block {
    flex-shrink: 0;
}

/* Спарклайн справа */
.tile__sparkline {
    flex: 1;
    height: 42px;
    min-width: 0;
    max-width: 130px;
    position: relative;
}

.tile__sparkline canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* ─── Спарклайн внутри hero ────────────────────────────────────────────── */

.hero__bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
}

.hero__sparkline {
    flex: 1;
    height: 70px;
    max-width: 280px;
    min-width: 0;
}

.hero__sparkline canvas {
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 768px) {
    .hero__sparkline { display: none; }
}

/* ════════════════════════════════════════════════════════════════════════ */
/*  ФИНАЛЬНАЯ ВЕРСИЯ КАРТОЧЕК ГЛАВНОЙ                                       */
/*  Перекрывает базовые .tile и .tile--compact выше. Все в одном месте.    */
/* ════════════════════════════════════════════════════════════════════════ */

.tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 980px) {
    .tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .tiles { grid-template-columns: 1fr; }
}

/* ─── Компактный тайл ──────────────────────────────────────────────────── */

.tile--compact {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px 22px;
    display: flex;
    flex-direction: column;
    min-height: 170px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tile--compact:hover {
    border-color: var(--border-strong);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

[data-theme="dark"] .tile--compact {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .tile--compact:hover {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Eyebrow — мелкий капс */
.tile--compact .tile__eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 500;
}

/* Title — описание показателя */
.tile--compact .tile__title {
    font-size: 14px;
    line-height: 1.4;
    color: var(--text-secondary);
    margin-bottom: auto;
    font-weight: 400;
}

/* Нижняя часть: число + спарклайн в одной строке */
.tile__bottom {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-top: 18px;
}

.tile__num-block {
    flex-shrink: 0;
}

/* Главный визуальный элемент — большая цифра */
.tile--compact .tile__num {
    font-size: 30px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.5px;
    font-variant-numeric: tabular-nums;
}

/* Подпись под числом */
.tile--compact .tile__meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Спарклайн справа от числа */
.tile__sparkline {
    flex: 1;
    height: 48px;
    min-width: 0;
    max-width: 140px;
}

.tile__sparkline canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
}

/* Стрелка ↗ в правом верхнем углу */
.tile--compact .tile__arrow {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    color: var(--brand-green);
    stroke-width: 2;
}

.tile--compact:hover .tile__arrow {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* ─── Публикация (карточка исследования — без числа) ──────────────────── */

.tile--publication {
    min-height: 160px;
}

.tile--publication .tile__title {
    font-size: 16px;
    line-height: 1.4;
    color: var(--text-primary);
    font-weight: 500;
    margin: 0;
    margin-bottom: auto;
}

.tile--publication .tile__meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
}

/* Цветная пилюля поверх — становится крупнее и заметнее */
.tile--publication .tile-pill {
    font-size: 12px;
    padding: 4px 12px;
    margin-bottom: 14px;
    font-weight: 500;
}

/* ─── Hero — усиление визуала ─────────────────────────────────────────── */

.hero {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}

.hero:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.10);
    transform: translateY(-2px);
}

[data-theme="dark"] .hero {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .hero:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

/* Цифра hero еще крупнее */
.hero__num {
    font-size: 64px;
    font-weight: 600;
    letter-spacing: -1px;
}

@media (max-width: 768px) {
    .hero__num { font-size: 48px; }
}

/* ─── Hero-блок флагмана на странице раздела ───────────────────────────── */

.flagship-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 32px 36px;
    margin-bottom: 48px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
    display: block;
}

.flagship-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

[data-theme="dark"] .flagship-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .flagship-card:hover {
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
}

.flagship-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 24px;
}

.flagship-card__eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 8px;
    font-weight: 500;
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--brand-green-soft);
    color: var(--brand-green-text);
}

.flagship-card__title {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 12px 0 6px;
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.flagship-card__lead {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    max-width: 480px;
    line-height: 1.5;
}

.flagship-card__value-wrap {
    text-align: right;
    flex-shrink: 0;
}

.flagship-card__period {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 500;
}

.flagship-card__value {
    font-size: 56px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.8px;
    font-variant-numeric: tabular-nums;
}

.flagship-card__delta {
    font-size: 14px;
    color: var(--brand-green);
    margin-top: 8px;
    font-weight: 500;
}

.flagship-card__delta--down {
    color: #C04A3D;
}

[data-theme="dark"] .flagship-card__delta--down {
    color: #B5800F;
}

/* График внутри флагмана */
.flagship-card__chart {
    height: 200px;
    position: relative;
    margin-top: 8px;
}

.flagship-card__chart canvas {
    width: 100%;
    height: 100%;
}

/* Стрелка ↗ */
.flagship-card__arrow {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 18px;
    height: 18px;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    color: var(--brand-green);
    stroke-width: 2;
}

.flagship-card:hover .flagship-card__arrow {
    opacity: 1;
    transform: translate(2px, -2px);
}

@media (max-width: 768px) {
    .flagship-card { padding: 24px; }
    .flagship-card__top { flex-direction: column; }
    .flagship-card__value-wrap { text-align: left; }
    .flagship-card__title { font-size: 22px; }
    .flagship-card__value { font-size: 44px; }
    .flagship-card__chart { height: 160px; }
}

/* ─── Группы показателей: визуальный разделитель ───────────────────────── */

.indicator-group {
    margin-bottom: 40px;
}

.indicator-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.indicator-group__title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-primary);
}

.indicator-group__meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════════════ */
/*  СТРАНИЦА HBI                                                            */
/* ════════════════════════════════════════════════════════════════════════ */

/* ─── Заголовок страницы с тремя ключевыми числами ────────────────────── */

.hbi-header {
    margin-bottom: 36px;
}

.hbi-header__title {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 10px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.hbi-header__lead {
    font-size: 16px;
    color: var(--text-secondary);
    margin: 0 0 8px;
    max-width: 760px;
    line-height: 1.55;
}

.hbi-header__period {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 500;
}

/* Трехколоночный блок ключевых цифр */
.hbi-summary {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 36px;
}

@media (max-width: 768px) {
    .hbi-summary { grid-template-columns: 1fr; }
}

.hbi-summary__main {
    background: var(--brand-green);
    color: var(--text-on-brand);
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .hbi-summary__main {
    background: #1F6B47;
}

.hbi-summary__main-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.85;
    margin-bottom: 12px;
    font-weight: 500;
}

.hbi-summary__main-value {
    font-size: 64px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

.hbi-summary__main-period {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 10px;
}

.hbi-summary__main-unit {
    font-size: 0.45em;          /* ~ 24px при main-value 54px */
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    margin-left: 0.35em;
    letter-spacing: 0.01em;
    white-space: nowrap;
    vertical-align: baseline;
}

.hbi-summary__delta {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 24px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hbi-summary__delta-label {
    font-size: 13px;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    font-weight: 500;
}

.hbi-summary__delta-value {
    font-size: 38px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.4px;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.hbi-summary__delta-value--up { color: var(--brand-green); }
.hbi-summary__delta-value--down { color: #C04A3D; padding-bottom: 10px;}
[data-theme="dark"] .hbi-summary__delta-value--down { color: #faae17; }

.hbi-summary__delta-unit {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0;
}

.hbi-summary__delta-meta {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 8px;
}



/* ─── Секции на странице ──────────────────────────────────────────────── */

.hbi-section {
    margin-bottom: 48px;
}

.hbi-section__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.hbi-section__title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-primary);
    margin: 0;
}

.hbi-section__meta {
    font-size: 13px;
    color: var(--text-muted);
}

/* Большая карточка с графиком — общая */
.hbi-chart-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 24px 28px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hbi-chart-card__canvas-wrap {
    position: relative;
    height: 360px;
}

@media (max-width: 768px) {
    .hbi-chart-card__canvas-wrap { height: 260px; }
    .hbi-chart-card { padding: 18px 20px; }
}

/* Высокий вариант для горизонтальной диаграммы отраслей */
.hbi-chart-card__canvas-wrap--tall {
    height: 560px;
}

@media (max-width: 768px) {
    .hbi-chart-card__canvas-wrap--tall { height: 480px; }
}

/* ─── Карточки компонентов (Выручка / ФОТ / Расходы) ─────────────────── */

.hbi-components {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

@media (max-width: 768px) {
    .hbi-components { grid-template-columns: 1fr; }
}

.hbi-component {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hbi-component__name {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    font-weight: 500;
}

.hbi-component__description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
}

.hbi-component__value-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.hbi-component__arrow {
    font-size: 14px;
}

.hbi-component__arrow--up { color: var(--brand-green); }
.hbi-component__arrow--down { color: #C04A3D; }
[data-theme="dark"] .hbi-component__arrow--down { color: #B5800F; }

.hbi-component__value {
    font-size: 32px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.4px;
    font-variant-numeric: tabular-nums;
}

.hbi-component__spark {
    height: 50px;
    margin-top: 10px;
}

.hbi-component__spark canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ─── Таблица регионов ────────────────────────────────────────────────── */

.hbi-regions-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.hbi-regions-table__note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 10px;
    padding: 0 4px;
    line-height: 1.5;
}

.hbi-regions-table thead th {
    background: var(--bg-secondary);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    font-weight: 500;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
}

.hbi-regions-table thead th.num {
    text-align: right;
}

.hbi-regions-table tbody td {
    padding: 11px 16px;
    border-bottom: 0.5px solid var(--border-subtle);
    color: var(--text-primary);
}

.hbi-regions-table tbody tr:last-child td {
    border-bottom: none;
}

.hbi-regions-table tbody tr:hover td {
    background: var(--bg-secondary);
}

.hbi-regions-table td.num {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.hbi-delta {
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.hbi-delta--up   { color: var(--brand-green); }
.hbi-delta--down { color: #C04A3D; }
[data-theme="dark"] .hbi-delta--down { color: #B5800F; }

/* ─── Методология ─────────────────────────────────────────────────────── */

.hbi-methodology {
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 24px 28px;
    margin-top: 24px;
}

.hbi-methodology h3 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-primary);
    margin: 0 0 14px;
}

.hbi-methodology p {
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-secondary);
    margin: 0 0 12px;
}

.hbi-methodology p:last-child { margin-bottom: 0; }

.hbi-methodology__zones {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 18px 0;
}

.hbi-methodology__zone {
    padding-left: 14px;
    border-left: 3px solid var(--brand-green);
}

.hbi-methodology__zone--down {
    border-left-color: #C04A3D;
}

.hbi-methodology__zone-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.hbi-methodology__zone-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 600px) {
    .hbi-methodology__zones { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════════════════════════════════ */
/*  СТРАНИЦА ИДА (Индекс деловой активности)                                */
/*  Тот же скелет что и hbi-*, но hero янтарный + другая шкала графиков    */
/* ════════════════════════════════════════════════════════════════════════ */

.ida-summary {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 14px;
    margin-bottom: 36px;
}

@media (max-width: 768px) {
    .ida-summary { grid-template-columns: 1fr; }
}

.ida-summary__main {
    background: var(--brand-amber);
    color: #1A1A18;
    border-radius: 16px;
    padding: 28px 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .ida-summary__main {
    background: #B5800F;
    color: #FFFAF0;
}

.ida-summary__main-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    opacity: 0.75;
    margin-bottom: 12px;
    font-weight: 500;
}

.ida-summary__main-value {
    font-size: 64px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -1px;
    font-variant-numeric: tabular-nums;
}

.ida-summary__main-period {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 10px;
}

/* Карточки компонентов — 4 в ряд (а не 3, как у HBI) */
.ida-components {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

@media (max-width: 980px) {
    .ida-components { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .ida-components { grid-template-columns: 1fr; }
}

/* Компоненты используют те же стили, что у HBI: */
.ida-component {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px 22px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ida-component__name {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    font-weight: 500;
}

.ida-component__description {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    margin-bottom: 8px;
    min-height: 36px;
}

.ida-component__value-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.ida-component__arrow {
    font-size: 14px;
}

.ida-component__arrow--up { color: var(--brand-green); }
.ida-component__arrow--down { color: #C04A3D; }
[data-theme="dark"] .ida-component__arrow--down { color: #B5800F; }

.ida-component__value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1;
    letter-spacing: -0.3px;
    font-variant-numeric: tabular-nums;
}

.ida-component__spark {
    height: 50px;
    margin-top: 10px;
}

.ida-component__spark canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ════════════════════════════════════════════════════════════════════════ */
/*  ВЫПАДАЮЩИЕ ПОДМЕНЮ В ГЛАВНОЙ НАВИГАЦИИ                                  */
/* ════════════════════════════════════════════════════════════════════════ */

/* Невидимая прослойка под пунктом, чтобы курсор не «срывался» между
   названием и панелью выпадашки */
.nav__item::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 14px;
    display: none;
}

.nav__item:hover::after {
    display: block;
}

/* Сама панель подменю */
.nav-submenu {
    position: absolute;
    top: calc(100% + 14px);
    left: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10);
    padding: 14px 8px;
    min-width: 260px;
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(-4px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

[data-theme="dark"] .nav-submenu {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.nav__item:hover .nav-submenu,
.nav__item:focus-within .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Пункт внутри подменю */
.nav-submenu__link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    line-height: 1.3;
    transition: background-color 0.12s ease, color 0.12s ease;
    text-decoration: none;
    white-space: nowrap;
}

.nav-submenu__link:hover {
    background: var(--bg-secondary);
    color: var(--brand-green);
}

/* Флагман (выделенный пункт — например HBI и ИДА) */
.nav-submenu__link--flagship {
    font-weight: 500;
}

.nav-submenu__link--flagship::before {
    content: '★';
    color: var(--brand-amber);
    font-size: 11px;
    margin-right: -4px;
}

/* Бейдж "логин" для закрытых пунктов */
.nav-submenu__lock {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-muted);
    font-weight: 400;
    letter-spacing: 0;
    text-transform: lowercase;
}

/* Разделитель между группами внутри подменю (по необходимости) */
.nav-submenu__sep {
    height: 1px;
    background: var(--border-subtle);
    margin: 6px 14px;
}

@media (max-width: 768px) {
    .nav-submenu { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════════ */
/*  СТРАНИЦА ДЕТАЛЬНОГО РАЗДЕЛА МАКРОДАННЫХ (с дашбордом Power BI)          */
/* ════════════════════════════════════════════════════════════════════════ */

.macro-detail-header {
    margin-bottom: 32px;
}

.macro-detail-header__title {
    font-size: 36px;
    font-weight: 600;
    line-height: 1.15;
    margin: 0 0 8px;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

.macro-detail-header__subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0 0 16px;
    font-weight: 400;
}

.macro-detail-header__description {
    font-size: 15px;
    color: var(--text-secondary);
    max-width: 820px;
    line-height: 1.65;
    margin: 0;
}

.macro-detail-dashboard {
    width: 100%;
    max-width: 100%;
    margin-bottom: 32px;
}

.macro-detail-dashboard__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
}

.macro-detail-dashboard__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

@media (max-width: 720px) {
    .macro-detail-dashboard__frame {
        aspect-ratio: auto;
        height: 520px;
    }
}

/* ─── Метка «тестовые данные» в углу карточки ─────────────────────────── */

.tile__demo {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 9.5px;
    color: var(--text-muted);
    opacity: 0.6;
    font-style: italic;
    letter-spacing: 0.1px;
    line-height: 1;
    pointer-events: none;
}

/* На hover показываем чуть ярче чтобы было видно */
.tile--compact:hover .tile__demo {
    opacity: 0.85;
}

/* ════════════════════════════════════════════════════════════════════════ */
/*  КАРТОЧКИ РАЗДЕЛОВ НА СТРАНИЦЕ МАКРОДАННЫХ                                */
/* ════════════════════════════════════════════════════════════════════════ */

.macro-tiles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 980px) {
    .macro-tiles { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .macro-tiles { grid-template-columns: 1fr; }
}

.macro-tile {
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 22px 24px 20px;
    display: flex;
    flex-direction: column;
    min-height: 200px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.macro-tile::before {
    /* Тонкая цветная полоска сверху — задает тематику раздела */
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--brand-green);
    opacity: 0.75;
}

.macro-tile:hover {
    border-color: var(--border-strong);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
    transform: translateY(-2px);
}

.macro-tile:hover::before {
    opacity: 1;
}

[data-theme="dark"] .macro-tile {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .macro-tile:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
}

/* Шапка карточки: иконка + название раздела */
.macro-tile__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.macro-tile__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--brand-green-soft);
    color: var(--brand-green-text);
}

.macro-tile__icon svg {
    width: 22px;
    height: 22px;
}

.macro-tile__eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Описание раздела */
.macro-tile__title {
    font-size: 15px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0 0 auto;
    font-weight: 400;
}

/* Источник данных — внизу */
.macro-tile__source {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-subtle);
    letter-spacing: 0.2px;
}

/* Стрелка ↗ в правом верхнем */
.macro-tile__arrow {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 14px;
    height: 14px;
    opacity: 0;
    transition: opacity 0.15s ease, transform 0.15s ease;
    color: var(--brand-green);
    stroke-width: 2;
}

.macro-tile:hover .macro-tile__arrow {
    opacity: 1;
    transform: translate(2px, -2px);
}

/* ── Цветовые варианты карточек ─────────────────────────────────────── */

.macro-tile--green::before { background: var(--brand-green); }
.macro-tile--green .macro-tile__icon {
    background: var(--brand-green-soft);
    color: var(--brand-green-text);
}

.macro-tile--amber::before { background: var(--brand-amber); }
.macro-tile--amber .macro-tile__icon {
    background: var(--brand-amber-soft);
    color: var(--brand-amber-text);
}

.macro-tile--coral::before { background: #C04A3D; }
.macro-tile--coral .macro-tile__icon {
    background: #FAECE7;
    color: #993C1D;
}
[data-theme="dark"] .macro-tile--coral .macro-tile__icon {
    background: rgba(250, 236, 231, 0.12);
    color: #E8A48A;
}

.macro-tile--purple::before { background: #6B5FCC; }
.macro-tile--purple .macro-tile__icon {
    background: #EEEDFE;
    color: #534AB7;
}
[data-theme="dark"] .macro-tile--purple .macro-tile__icon {
    background: rgba(238, 237, 254, 0.12);
    color: #B0A8E8;
}

.macro-tile--teal::before { background: #0F8E70; }
.macro-tile--teal .macro-tile__icon {
    background: #E1F5EE;
    color: #0F6E56;
}
[data-theme="dark"] .macro-tile--teal .macro-tile__icon {
    background: rgba(225, 245, 238, 0.12);
    color: #7DD3B0;
}

/* ─── Кнопка «Связаться с нами» в подвале ─────────────────────────────── */

.btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand-green);
    color: #FFFFFF;
    border-radius: 999px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.2px;
    transition: opacity 0.15s ease, transform 0.15s ease;
    text-decoration: none;
}

.btn-contact:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

[data-theme="dark"] .btn-contact {
    background: #1F6B47;
}

/* ─── Таблицы в статьях исследований ──────────────────────────────────── */

.article-table-wrap {
    margin: 24px 0;
    overflow-x: auto;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--bg-surface);
}

.article-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.5;
}

.article-table thead th {
    background: var(--bg-secondary);
    text-align: left;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.article-table tbody td {
    padding: 10px 14px;
    border-bottom: 0.5px solid var(--border-subtle);
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.article-table tbody td:first-child {
    font-weight: 500;
}

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

.article-table tbody tr:hover td {
    background: var(--bg-secondary);
}

/* Подпись «График N» / «Таблица N» */
.article-caption {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    margin: 18px 0 8px;
    letter-spacing: 0.2px;
}

/* Ссылка на источник под лидом */
.article-header__source {
    margin-top: 14px;
    font-size: 13px;
}

.article-header__source a {
    color: var(--brand-green);
    text-decoration: none;
}

.article-header__source a:hover {
    text-decoration: underline;
}

/* ── Страница раздела «Показатели → ...» ──────────────────────────── */

.pokazateli-detail__block {
    display: inline-block;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
    font-weight: 500;
}

.pokazateli-detail__title {
    font-size: 36px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.pokazateli-detail__description {
    font-size: 15px;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 760px;
    margin: 0;
}

.pokazateli-detail__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 48px;
}

@media (max-width: 720px) {
    .pokazateli-detail__grid {
        grid-template-columns: 1fr;
    }
}

.pkd-card {
    position: relative;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    padding: 20px 22px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 168px;
}

.pkd-card__name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.4;
}

.pkd-card__value-row {
    display: flex;
    align-items: baseline;
    gap: 12px;
    flex-wrap: wrap;
}

.pkd-card__value {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    font-variant-numeric: tabular-nums;
}

.pkd-card__change {
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.pkd-card__change--up {
    color: var(--brand-green);
}

.pkd-card__change--down {
    color: var(--brand-amber);
}

.pkd-card__meta {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
}

.pkd-card__footer {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 0.5px dashed var(--border-subtle);
}

.pkd-card__cuts,
.pkd-card__note {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

.pkd-card__note {
    font-style: italic;
}

.pkd-card__demo {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 2px 8px;
    border-radius: 99px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    font-weight: 500;
}

.pokazateli-detail__cuts-stub {
    background: var(--bg-secondary);
    border-radius: 14px;
    padding: 24px 26px;
    border: 1px dashed var(--border-subtle);
}

.pokazateli-detail__cuts-stub h2 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px;
}

.pokazateli-detail__cuts-stub p {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 0;
}

/* ── Групповые тайлы на /pokazateli/ ──────────────────────────────── */

.pokazateli-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.pkz-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 20px 22px;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    text-decoration: none;
    color: inherit;
    transition: transform 120ms ease, border-color 120ms ease;
    min-height: 168px;
}

.pkz-tile:hover {
    transform: translateY(-1px);
    border-color: var(--brand-green);
}

.pkz-tile__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.pkz-tile__icon svg {
    width: 18px;
    height: 18px;
}

.pkz-tile__icon--green  { background: rgba(0, 128, 95, 0.10);  color: var(--brand-green); }
.pkz-tile__icon--amber  { background: rgba(250, 174, 23, 0.12); color: var(--brand-amber); }
.pkz-tile__icon--blue   { background: rgba(59, 130, 196, 0.12); color: #3B82C4; }
.pkz-tile__icon--coral  { background: rgba(192, 74, 61, 0.12);  color: #C04A3D; }
.pkz-tile__icon--purple { background: rgba(107, 95, 204, 0.12); color: #6B5FCC; }
.pkz-tile__icon--teal   { background: rgba(20, 184, 166, 0.12); color: #14B8A6; }
.pkz-tile__icon--orange { background: rgba(234, 88, 12, 0.12);  color: #EA580C; }

.pkz-tile__title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
    letter-spacing: -0.005em;
}

.pkz-tile__desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    flex-grow: 1;
}

.pkz-tile__meta {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-top: 4px;
}

.pkz-tile__arrow {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 12px;
    height: 12px;
    color: var(--text-muted);
    opacity: 0.6;
    transition: opacity 120ms ease, color 120ms ease;
}

.pkz-tile:hover .pkz-tile__arrow {
    opacity: 1;
    color: var(--brand-green);
}

/* ── Layout: сайдбар + контент ────────────────────────────────────── */

.pokazateli-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 32px;
    margin-top: 12px;
    align-items: start;
}

@media (max-width: 900px) {
    .pokazateli-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

.pkz-main {
    min-width: 0; /* чтобы grid не растягивал контейнер */
}

/* ── Боковое меню ────────────────────────────────────────────────── */

/* ── Боковое меню (общее для /pokazateli/ и /macro/) ──────────────── */

.pkz-sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
    padding: 4px 0;
}

@media (max-width: 900px) {
    .pkz-sidebar {
        position: static;
        background: var(--bg-surface);
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        padding: 14px 16px;
    }
}

/* Группа: заголовок блока + список */
.pkz-sidebar__group {
    margin-bottom: 22px;
}

.pkz-sidebar__group:last-child {
    margin-bottom: 0;
}

.pkz-sidebar__group-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 8px;
    padding: 0 10px;
}

/* Списки */
.pkz-sidebar__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Плоский вариант (для /macro/, где нет групп) — крупнее и просторнее */
.pkz-sidebar--flat .pkz-sidebar__list {
    gap: 18px;
}

.pkz-sidebar--flat .pkz-sidebar__link {
    font-size: 15px;
    padding: 0;
    border-radius: 0;
}

.pkz-sidebar--flat .pkz-sidebar__link:hover {
    background: transparent;
    color: var(--brand-green);
}

.pkz-sidebar--flat .pkz-sidebar__link--active {
    background: transparent;
    font-weight: 600;
    padding: 0;
}

.pkz-sidebar--flat .pkz-sidebar__link--active::before {
    display: none;
}

/* Ссылки в группированном варианте (для /pokazateli/) */
.pkz-sidebar__link {
    display: block;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 120ms ease, color 120ms ease;
}

.pkz-sidebar__link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.pkz-sidebar__link--active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    position: relative;
    padding-left: 14px;
}

.pkz-sidebar__link--active::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 16px;
    background: var(--brand-green);
    border-radius: 2px;
}

/* ── Горизонтальная навигация по макроданным (табы сверху) ────────── */

.macro-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 12px 0 28px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.macro-tabs__link {
    flex-shrink: 0;
    display: inline-block;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: 8px;
    transition: background 120ms ease, color 120ms ease;
    white-space: nowrap;
}

.macro-tabs__link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.macro-tabs__link--active {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    position: relative;
}

.macro-tabs__link--active::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: -9px;
    height: 2px;
    background: var(--brand-green);
    border-radius: 2px;
}

@media (max-width: 720px) {
    .macro-tabs {
        gap: 2px;
        margin: 8px 0 20px;
    }

    .macro-tabs__link {
        padding: 7px 11px;
        font-size: 13px;
    }
}

/* ── Источник под заголовком на странице макро ─────────────────── */

.pokazateli-detail__source {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ── Верх блока дашборда: кнопка Power BI справа ──────────────── */

.macro-detail-dashboard__top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.macro-detail-dashboard__top .macro-detail-dashboard__open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--brand-green);
    text-decoration: none;
    font-weight: 500;
    transition: color 120ms ease;
}

.macro-detail-dashboard__top .macro-detail-dashboard__open:hover {
    text-decoration: underline;
}


/* ── HBI matrix: фильтры ───────────────────────────────────────── */
.hbi-matrix__controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.hbi-matrix__field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 240px;
    flex: 1;
}

.hbi-matrix__field-label {
    font-size: 12px;
    color: var(--text-muted, #888780);
    font-family: 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hbi-matrix__select {
    width: 100%;
    height: 40px;
    padding: 0 36px 0 12px;
    font: 14px 'Inter', sans-serif;
    color: var(--text-primary, #1a1a1a);
    background-color: var(--surface, #fff);
    border: 1px solid var(--border, rgba(0,0,0,0.12));
    border-radius: 6px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23888780' stroke-width='1.5' d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    cursor: pointer;
    transition: border-color .15s;
}

.hbi-matrix__select:hover  { border-color: var(--border-strong, rgba(0,0,0,0.24)); }
.hbi-matrix__select:focus  { outline: none; border-color: #00805F; }

.hbi-matrix__reset {
    height: 40px;
    padding: 0 16px;
    font: 13px 'Inter', sans-serif;
    color: var(--text-muted, #888780);
    background: transparent;
    border: 1px solid var(--border, rgba(0,0,0,0.12));
    border-radius: 6px;
    cursor: pointer;
    transition: all .15s;
}
.hbi-matrix__reset:hover { color: var(--text-primary, #1a1a1a); border-color: var(--border-strong, rgba(0,0,0,0.24)); }

/* ── HBI matrix: статы ─────────────────────────────────────────── */
.hbi-matrix__stats {
    display: flex;
    gap: 32px;
    padding: 12px 0;
    margin-bottom: 12px;
    border-top: 1px solid var(--border-soft, rgba(0,0,0,0.06));
    border-bottom: 1px solid var(--border-soft, rgba(0,0,0,0.06));
}

.hbi-matrix__stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hbi-matrix__stat-label {
    font-size: 11px;
    color: var(--text-muted, #888780);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.hbi-matrix__stat-value {
    font: 600 18px 'Inter', sans-serif;
    color: var(--text-primary, #1a1a1a);
}

/* Тёмная тема — подстраиваем select */
[data-theme="dark"] .hbi-matrix__select {
    background-color: var(--surface, #1a1a1a);
    color: var(--text-primary, #fff);
}

@media (max-width: 640px) {
    .hbi-matrix__controls { flex-direction: column; align-items: stretch; }
    .hbi-matrix__stats    { gap: 20px; flex-wrap: wrap; }
}

/* Переключатель режима — segmented control */
.hbi-matrix__toggle {
    display: inline-flex;
    padding: 3px;
    background: var(--border-soft, rgba(0,0,0,0.04));
    border-radius: 7px;
    height: 40px;
    align-self: flex-end;
}

.hbi-matrix__toggle-btn {
    height: 100%;
    padding: 0 16px;
    font: 13px 'Inter', sans-serif;
    color: var(--text-muted, #888780);
    background: transparent;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}

.hbi-matrix__toggle-btn:hover {
    color: var(--text-primary, #1a1a1a);
}

.hbi-matrix__toggle-btn--active {
    background: var(--surface, #fff);
    color: var(--text-primary, #1a1a1a);
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

[data-theme="dark"] .hbi-matrix__toggle {
    background: rgba(255,255,255,0.06);
}
[data-theme="dark"] .hbi-matrix__toggle-btn--active {
    background: rgba(255,255,255,0.12);
}

/* ── Heatmap ───────────────────────────────────────────────────── */
.hbi-heatmap {
    overflow-x: auto;
    margin: 0 -8px;
    padding: 0 8px;
}

.hbi-heatmap table {
    border-collapse: collapse;
    font: 11px 'Inter', sans-serif;
    width: 100%;
}

.hbi-heatmap th,
.hbi-heatmap td {
    padding: 5px 6px;
    text-align: center;
    border: 1px solid var(--surface, #fff);
    min-width: 44px;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.hbi-heatmap th {
    background: var(--border-soft, rgba(0,0,0,0.04));
    color: var(--text-muted, #888780);
    font-weight: 500;
    position: sticky; top: 0; z-index: 2;
    /* Заголовки регионов — наклон, чтобы влезли */
    height: 100px;
    vertical-align: bottom;
}

.hbi-heatmap th .hbi-heatmap__rotated {
    display: inline-block;
    transform: rotate(-55deg);
    transform-origin: left bottom;
    white-space: nowrap;
    margin-left: 50%;
    padding-bottom: 4px;
}

.hbi-heatmap th.hbi-heatmap__row-head {
    text-align: left;
    padding: 4px 12px 4px 8px;
    position: sticky; left: 0; z-index: 3;
    background: var(--surface, #fff);
    font-weight: 500;
    color: var(--text-primary, #1a1a1a);
    height: auto;
    vertical-align: middle;
    max-width: 280px;
    min-width: 240px;
    white-space: normal;
    line-height: 1.3;
}

.hbi-heatmap th.hbi-heatmap__corner {
    background: var(--surface, #fff);
    z-index: 4;
}

.hbi-heatmap td {
    color: var(--text-primary, #1a1a1a);
}

.hbi-heatmap td:hover {
    outline: 2px solid var(--text-primary, #1a1a1a);
    outline-offset: -1px;
    position: relative; z-index: 5;
}

.hbi-heatmap__legend {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 11px;
    color: var(--text-muted, #888780);
}

.hbi-heatmap__legend-bar {
    height: 12px;
    width: 240px;
    border-radius: 2px;
    background: linear-gradient(to right,
        #C04A3D 0%,
        #E5A498 30%,
        #f0e9d8 50%,
        #95C5B2 70%,
        #00805F 100%);
}

.hbi-heatmap__legend-right { margin-left: auto; }

[data-theme="dark"] .hbi-heatmap th {
    background: rgba(255,255,255,0.04);
}
[data-theme="dark"] .hbi-heatmap th.hbi-heatmap__row-head,
[data-theme="dark"] .hbi-heatmap th.hbi-heatmap__corner {
    background: var(--surface);
}

/* ── Интерактивная карта регионов на странице HBI ─────────────── */

.hbi-map {
    position: relative;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-sizing: border-box;
}

.hbi-map__svg {
    display: block;
    width: 100%;
    height: auto;     /* высота определяется автоматически из viewBox */
}

.hbi-map__loading,
.hbi-map__error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-muted);
    font-size: 13px;
}

/* Группа региона */
/* Группа региона — обёртка <g>, на ней работает transform и filter */
/* Группа региона */
.hbi-map__region-group {
    cursor: pointer;
    transition: filter 300ms ease-out;
    will-change: filter;
}

/* Hover — лёгкое осветление и насыщенность, без подъёма */
.hbi-map__region-group.is-hovered {
    filter: brightness(1.08) saturate(1.18);
}

/* Сама форма региона — обводка усиливается */
.hbi-map__shape {
    stroke: var(--bg-surface);
    stroke-width: 1.4;
    stroke-linejoin: round;
    transition: stroke 280ms ease-out,
                stroke-width 280ms ease-out,
                fill 300ms ease-out;
    vector-effect: non-scaling-stroke;
}

.hbi-map__region-group.is-hovered .hbi-map__shape {
    stroke: #ffffff;
    stroke-width: 2.8;
}

[data-theme="dark"] .hbi-map__region-group.is-hovered .hbi-map__shape {
    stroke: var(--bg-page);
}

/* Подпись с числом внутри группы региона — главный визуальный эффект */
.hbi-map__label {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 600;
    fill: #ffffff;
    pointer-events: none;
    user-select: none;
    paint-order: stroke;
    letter-spacing: -0.01em;
    transition: font-size 380ms cubic-bezier(0.22, 1, 0.36, 1),
                font-weight 300ms ease-out,
                stroke-width 280ms ease-out,
                fill 280ms ease-out;
}

.hbi-map__region-group.is-hovered .hbi-map__label {
    font-size: 30px;
    font-weight: 800;
    fill: #ffffff;
}

/* Тултип */
.hbi-map__tooltip {
    position: absolute;
    z-index: 100;
    background: var(--bg-surface);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px 14px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    min-width: 150px;
    font-size: 13px;
    line-height: 1.4;
}

.hbi-map__tooltip-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 13px;
}

.hbi-map__tooltip-value {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    font-variant-numeric: tabular-nums;
}

.hbi-map__tooltip-arrow--up   { color: var(--brand-green); font-size: 15px; }
.hbi-map__tooltip-arrow--down { color: var(--brand-amber); font-size: 15px; }

.hbi-map__tooltip-unit {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
    margin-left: 4px;
}

.hbi-map__tooltip-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Легенда снизу карты */
.hbi-map__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 22px;
    margin-top: 14px;
    padding: 0 4px;
    font-size: 10px;
    color: var(--text-secondary);
}

.hbi-map__legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hbi-map__legend-swatch {
    width: 8px;
    height: 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.hbi-map__legend-swatch--high { background: #00805F; }
.hbi-map__legend-swatch--good { background: #3fa085; }
.hbi-map__legend-swatch--mid  { background: #d4a544; }
.hbi-map__legend-swatch--low  { background: #C97C5F; }
.hbi-map__legend-swatch--bad  { background: #A85040; }

[data-theme="dark"] .hbi-map__legend-swatch--high { background: #2EA77F; }
[data-theme="dark"] .hbi-map__legend-swatch--good { background: #5fb89a; }
[data-theme="dark"] .hbi-map__legend-swatch--mid  { background: #bfa45e; }
[data-theme="dark"] .hbi-map__legend-swatch--low  { background: #d18860; }
[data-theme="dark"] .hbi-map__legend-swatch--bad  { background: #c66459; }

/* Layout: карта слева + города справа */
/* Обёртка карты — карта во всю ширину, города абсолютом поверх */
.hbi-map-wrap {
    position: relative;
    width: 100%;
}

/* Колонка карточек городов — правый верхний угол поверх карты */
.hbi-map-cities {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 160px;
}

.hbi-map-city {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 9px;
    background: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .hbi-map-city {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.hbi-map-city__swatch {
    width: 9px;
    height: 9px;
    border-radius: 2px;
    flex-shrink: 0;
}

.hbi-map-city__name {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    flex: 1;
}

.hbi-map-city__value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

.hbi-map-city__arrow--up   { color: var(--brand-green); font-size: 9px; }
.hbi-map-city__arrow--down { color: var(--brand-amber); font-size: 9px; }

/* На узких экранах города уезжают под карту в ряд */
@media (max-width: 768px) {
    .hbi-map-cities {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        width: 100%;
        margin-top: 12px;
    }
    .hbi-map-city {
        flex: 1;
        min-width: 130px;
    }
}

.hbi-map-city__arrow--up   { color: var(--brand-green); font-size: 12px; }
.hbi-map-city__arrow--down { color: var(--brand-amber); font-size: 12px; }

/* Примечание под легендой карты */
.hbi-map__note {
    font-size: 12px;
    color: var(--text-muted);
    font-style: italic;
    line-height: 1.5;
    margin: 14px 0 0;
    padding: 0 4px;
}

/* ════════════════════════════════════════════════════════════════════════ */
/*  МОБИЛЬНОЕ БУРГЕР-МЕНЮ                                                    */
/*  Десктоп не затрагивается: бургер и оверлей скрыты вне медиа-запроса,   */
/*  раскладка .nav / .header__right переопределяется только ≤768px.        */
/* ════════════════════════════════════════════════════════════════════════ */

/* Кнопка-бургер и оверлей по умолчанию скрыты (десктоп) */
.nav-burger {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    flex-shrink: 0;
}

.nav-burger__icon {
    width: 24px;
    height: 24px;
}

/* По умолчанию показываем «бургер», прячем «крестик» */
.nav-burger__icon--close { display: none; }

.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.2s ease;
}

@media (max-width: 768px) {

    /* Показываем бургер, прячем его слева от логотипа */
    .nav-burger {
        display: inline-flex;
        order: -1;
        margin-right: 4px;
        margin-left: -8px;
    }

    /* В открытом состоянии меняем иконку на крестик */
    body.nav-open .nav-burger__icon--open  { display: none; }
    body.nav-open .nav-burger__icon--close { display: block; }

    /* Шапка: бургер + логотип в строке, всё остальное уезжает в панель */
    .header__inner {
        flex-wrap: nowrap;
    }

    .header__left {
        flex: 1;
        min-width: 0;
    }

    /* ── Выезжающая панель ── */
    /* .nav вытаскиваем из строки и превращаем в вертикальную панель справа */
    .nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: min(82vw, 340px);
        margin: 0;
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        gap: 0;
        padding: 72px 0 24px;
        background: var(--bg-surface);
        border-left: 1px solid var(--border-subtle);
        box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
        z-index: 95;
        overflow-y: auto;
        transform: translateX(100%);
        transition: transform 0.25s ease;
        font-size: 16px;
    }

    body.nav-open .nav {
        transform: translateX(0);
    }

    body.nav-open .nav-overlay {
        display: block;
        opacity: 1;
    }

    /* Пункт меню — в строку, на всю ширину панели */
    .nav__item {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
        border-bottom: 1px solid var(--border-subtle);
    }

    /* Активный пункт — убираем десктопное подчёркивание снизу */
    .nav__item--active {
        border-bottom: 1px solid var(--border-subtle);
        margin-bottom: 0;
    }

    .nav__item > a {
        display: block;
        padding: 14px 20px;
        font-weight: 500;
        font-size: 16px;
    }

    .nav__item--active > a {
        color: var(--brand-green);
    }

    /* ── Подменю: показываем как вложенный список (перебиваем display:none !important) ── */
    .nav-submenu {
        display: block !important;
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        min-width: 0;
        width: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0 0 8px;
        margin: 0;
        background: var(--bg-secondary);
    }

    /* ── Подменю-аккордеон: по умолчанию скрыто, раскрывается по .is-expanded ── */
    .nav-submenu,
    .nav__item:hover .nav-submenu,
    .nav__item:focus-within .nav-submenu {
        display: block !important;
        position: static;
        top: auto;
        left: auto;
        right: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        min-width: 0;
        width: auto;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
        margin: 0;
        background: var(--bg-secondary);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.25s ease;
    }

    .nav__item.is-expanded .nav-submenu {
        max-height: 500px;
        padding: 0 0 8px;
    }

    /* Стрелка-шеврон у пунктов с подменю */
    .nav__item:has(.nav-submenu) > a {
        position: relative;
    }

    .nav__item:has(.nav-submenu) > a::after {
        content: '';
        position: absolute;
        right: 20px;
        top: 50%;
        width: 8px;
        height: 8px;
        border-right: 1.6px solid var(--text-muted);
        border-bottom: 1.6px solid var(--text-muted);
        transform: translateY(-65%) rotate(45deg);
        transition: transform 0.2s ease;
    }

    .nav__item.is-expanded:has(.nav-submenu) > a::after {
        transform: translateY(-35%) rotate(-135deg);
    }

    /* Прослойка под пунктом (десктопный хак ::after) не нужна */
    .nav__item::after { display: none; }

    /* ── header__right (язык + тема + войти) уезжает в низ панели ── */
    .header__right {
        position: fixed;
        right: 0;
        bottom: 0;
        width: min(82vw, 340px);
        margin-left: 0;
        z-index: 96;
        flex-wrap: wrap;
        gap: 12px;
        padding: 16px 20px;
        background: var(--bg-surface);
        border-top: 1px solid var(--border-subtle);
        border-left: 1px solid var(--border-subtle);
        transform: translateX(100%);
        transition: transform 0.25s ease;
        font-size: 14px;
        align-items: center;
    }

    /* Hero-блоки HBI / ИДА — в одну колонку друг под другом */
    .heroes {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 24px;
    }

    .hero {
        min-height: auto;
        padding: 20px 22px;
    }

    body.nav-open .header__right {
        transform: translateX(0);
    }

    .btn-login {
        margin-left: auto;
        padding: 8px 18px;
        font-size: 13px;
    }

    /* Когда меню открыто — блокируем прокрутку фона */
    body.nav-open {
        overflow: hidden;
    }
}

/* ════════════════════════════════════════════════════════════════════════ */
/*  СВОРАЧИВАЕМЫЙ САЙДБАР РАЗДЕЛОВ НА МОБИЛКЕ                                 */
/*  Кнопка скрыта на десктопе; сайдбар сворачивается только ≤900px.         */
/* ════════════════════════════════════════════════════════════════════════ */

.pkz-sidebar-trigger {
    display: none; /* десктоп — кнопки нет, сайдбар обычной колонкой */
}

@media (max-width: 900px) {

    /* Кнопка-триггер «Разделы» */
    .pkz-sidebar-trigger {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 13px 16px;
        margin-bottom: 12px;
        background: var(--bg-surface);
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        font-family: inherit;
        color: var(--text-primary);
        text-align: left;
    }

    .pkz-sidebar-trigger__label {
        display: flex;
        flex-direction: column;
        gap: 1px;
        min-width: 0;
    }

    .pkz-sidebar-trigger__caption {
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 0.6px;
        color: var(--text-muted);
        font-weight: 500;
    }

    .pkz-sidebar-trigger__current {
        font-size: 15px;
        font-weight: 600;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Шеврон ▾ */
    .pkz-sidebar-trigger__chevron {
        flex-shrink: 0;
        width: 9px;
        height: 9px;
        border-right: 1.8px solid var(--text-muted);
        border-bottom: 1.8px solid var(--text-muted);
        transform: translateY(-2px) rotate(45deg);
        transition: transform 0.2s ease;
    }

    .pkz-sidebar-trigger.is-open .pkz-sidebar-trigger__chevron {
        transform: translateY(2px) rotate(-135deg);
    }

    /* Сам сайдбар: по умолчанию свёрнут, разворачивается по .is-open */
    .pkz-sidebar {
        max-height: 0;
        overflow: hidden;
        padding: 0;
        margin: 0 0 12px;
        background: var(--bg-surface);
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        border-width: 0;
        transition: max-height 0.28s ease, border-width 0.1s ease;
    }

    .pkz-sidebar.is-open {
        max-height: 1200px;
        border-width: 1px;
        padding: 14px 16px;
    }

    /* Внутри развёрнутого сайдбара группы чуть плотнее */
    .pkz-sidebar.is-open .pkz-sidebar__group {
        margin-bottom: 16px;
    }
}

.btn-user {
    font-size: 14px;
    color: var(--text-secondary, #6b6b66);
    margin-right: 6px;
}

.hbi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.hbi-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}
.hbi-period {
    flex-shrink: 0;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.hbi-period__label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary, #6b6b66);
    white-space: nowrap;
}
.hbi-period__select {
    padding: 7px 12px;
    border: 1px solid var(--border, rgba(0,0,0,0.14));
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #1a1a1a);
    background: var(--bg, #fff);
    cursor: pointer;
}
.hbi-period__select:focus {
    outline: none;
    border-color: var(--accent, #00805F);
}

@media (max-width: 640px) {
    .hbi-header { flex-direction: column; }
    .hbi-period { margin-top: 0; }
}

/* halykmacro — кнопка экспорта PDF. */

.pdf-export-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: #00805F;
    color: #fff;
    border: 1px solid #00805F;
    border-radius: 10px;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease,
                box-shadow 0.15s ease, transform 0.1s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

.pdf-export-button:hover {
    background: #00684E;
    border-color: #00684E;
    box-shadow: 0 4px 12px rgba(0, 128, 95, 0.22);
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.pdf-export-button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.pdf-export-button:focus-visible {
    outline: 2px solid rgba(0, 128, 95, 0.45);
    outline-offset: 2px;
}

.pdf-export-button__icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.pdf-export-button__label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.pdf-export-button__period {
    display: inline-block;
    padding: 2px 7px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Тёмная тема — чуть светлее зелёный, как в палитре графиков */
[data-theme="dark"] .pdf-export-button {
    background: #2EA77F;
    border-color: #2EA77F;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .pdf-export-button:hover {
    background: #25956E;
    border-color: #25956E;
    box-shadow: 0 4px 12px rgba(46, 167, 127, 0.28);
}

[data-theme="dark"] .pdf-export-button__period {
    background: rgba(0, 0, 0, 0.22);
}

/* Компактная версия — для тесных шапок (опционально через модификатор) */
.pdf-export-button--compact {
    padding: 8px 14px;
    font-size: 12px;
    gap: 6px;
    border-radius: 8px;
}
.pdf-export-button--compact .pdf-export-button__icon {
    width: 14px;
    height: 14px;
}