/* ─── Шрифт 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: #0E1813;
    --bg-surface: #142019;
    --bg-secondary: #0A130E;

    --text-primary: #F0EEE6;
    --text-secondary: #9DA29B;
    --text-muted: #6E726B;
    --text-on-brand: #F0EEE6;

    --brand-green: #2EA77F;
    --brand-green-soft: rgba(46, 167, 127, 0.18);
    --brand-green-text: #6BD3A8;
    --brand-amber: #FFC04A;
    --brand-amber-soft: rgba(255, 192, 74, 0.18);
    --brand-amber-text: #FFD787;
    --brand-graphite: #1A2620;
    --brand-graphite-text: #F0EEE6;

    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-strong: rgba(255, 255, 255, 0.12);

    --hero-graphite-bg: #1A2620;
}

/* ─── Сброс и базовая типографика ───────────────────────────────────────── */
*, *::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);
}

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

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

/* В тёмной теме инвертируем цвета логотипа,
   потому что исходный SVG чёрный по белому. */
[data-theme="dark"] .logo--full .logo__img {
    filter: invert(1) hue-rotate(180deg) brightness(1.1);
}

/* Внутри 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: 760px;
    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: #E16B5E; }

/* Сам холст графика */
.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: #E16B5E; }

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

.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;
}

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

.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: #E16B5E; }

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

.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: #E16B5E; }


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

.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: #E16B5E;
}

/* График внутри флагмана */
.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__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: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 500;
}

.hbi-summary__delta-value {
    font-size: 32px;
    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; }
[data-theme="dark"] .hbi-summary__delta-value--down { color: #E16B5E; }

.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: #E16B5E; }

.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 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: #E16B5E; }

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

.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: #E16B5E; }

.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 {
    margin-bottom: 48px;
}

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

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

.macro-detail-dashboard__open {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--brand-green);
    font-weight: 500;
    transition: opacity 0.15s ease;
}

.macro-detail-dashboard__open:hover {
    opacity: 0.7;
}

.macro-detail-dashboard__frame {
    position: relative;
    width: 100%;
    /* Соотношение Power BI отчёта: 16:9.5 ≈ 59% */
    padding-bottom: 62%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.macro-detail-dashboard__frame iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.macro-detail-dashboard__source {
    font-size: 12px;
    color: var(--text-muted);
    margin: 14px 0 0;
    font-style: italic;
}

@media (max-width: 768px) {
    .macro-detail-header__title { font-size: 28px; }
    .macro-detail-header__subtitle { font-size: 16px; }
    .macro-detail-dashboard__frame { padding-bottom: 100%; }
}

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

.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;
}