/*
 * editorial.css — overlay поверх styles.css для гармонизации лендинга
 * с tokens (Phase 2). Подключается ПОСЛЕ styles.css в layouts/app.blade.php.
 *
 * Стратегия: не переписываем 1500 строк styles.css — добавляем точечные
 * overrides на токены. После того как UI Kit будет готов (Phase 3+) —
 * styles.css можно будет постепенно заменить.
 */

/* === Sections — мягкий ритм через токены === */
.section {
    padding: var(--s-9) 0;
    background: var(--surface);
}

.section--surface {
    background: var(--surface-sunken);
}

@media (max-width: 768px) {
    .section { padding: var(--s-7) 0; }
}

/* === Container — выровнять под landing width === */
.container {
    max-width: var(--w-landing);
    padding-left: var(--s-6);
    padding-right: var(--s-6);
}

.container--narrow {
    max-width: var(--w-content-rail);
}

/* === Заголовки секций (x-section-header) === */
.section__head .overline,
.overline {
    font-family: var(--font-mono);
    font-size: var(--t-overline);
    letter-spacing: var(--ls-overline);
    color: var(--ink-muted);
    text-transform: uppercase;
}

.overline--accent {
    color: var(--accent);
}

.section__head h2,
.section h2 {
    font-family: var(--font-display);
    font-size: var(--t-h2);
    line-height: var(--lh-snug);
    letter-spacing: var(--ls-h2);
    color: var(--ink);
    font-weight: 600;
}

.section h3 {
    font-family: var(--font-display);
    font-size: var(--t-h3);
    color: var(--ink);
}

/* === Tokens-aware buttons (overrides поверх .btn) === */
.btn--primary {
    background: var(--accent);
    color: var(--surface);
    border: 1px solid var(--accent);
    transition: background var(--duration-base) var(--ease-soft);
}

.btn--primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.btn--ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--hairline);
    transition: border-color var(--duration-base) var(--ease-soft);
}

.btn--ghost:hover {
    border-color: var(--ink);
    background: var(--surface-sunken);
}

.btn--secondary {
    background: var(--surface-sunken);
    color: var(--accent);
    border: 1px solid transparent;
}

.btn--secondary:hover {
    background: var(--hairline);
}

.btn--inverse {
    color: var(--surface);
    border-color: rgba(255, 255, 255, 0.4);
}

.btn--inverse:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--surface);
}

/* === Cards (feature-card, contact-card, etc) === */
.card,
.feature-card,
.contact-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: var(--radius-md);
    box-shadow: none;
    transition: border-color var(--duration-base) var(--ease-soft);
}

.card:hover,
.feature-card:hover {
    border-color: var(--hairline-strong);
}

/* === Risk banner — серьёзный, не растворяется === */
.risk-banner {
    background: var(--surface);
    border-left: 4px solid var(--warning);
    border-radius: var(--radius-sm);
    padding: var(--s-5) var(--s-6);
    color: var(--ink);
}

.risk-banner__title {
    color: var(--ink);
    font-weight: 600;
}

/* === Trust bar / trust items === */
.trust-bar {
    background: var(--surface);
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
}

.trust-bar__item strong {
    color: var(--ink);
}

.trust-bar__item span:not(strong) {
    color: var(--ink-muted);
}

/* === Badge (включая «реестр ЦБ») === */
.badge,
.badge--accent {
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: var(--t-small);
    letter-spacing: 0.02em;
}

/* === Page-hero (наследие — у которых ещё не применён editorial-page-hero) === */
.page-hero {
    background: var(--foundation);
    color: var(--ink);
    padding: var(--s-8) 0;
}

.page-hero h1 {
    font-family: var(--font-display);
    color: var(--ink);
}

.hero--inverse {
    background: var(--accent);
    color: var(--surface);
}

.hero--inverse h1,
.hero--inverse .page-hero__lead-inverse {
    color: var(--surface);
}

.hero--inverse .overline,
.hero--inverse .overline--accent {
    color: rgba(255, 255, 255, 0.7);
}

/* === Header (top bar) — мягко выровнять === */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
}

.logo__text {
    color: var(--ink);
    font-family: var(--font-display);
    font-weight: 700;
}

.logo__tagline {
    color: var(--ink-muted);
    font-size: var(--t-small);
}

.nav__link {
    color: var(--ink-muted);
    transition: color var(--duration-base) var(--ease-soft);
}

.nav__link:hover,
.nav__link.is-active {
    color: var(--ink);
}

.nav__link.is-active {
    border-bottom: 2px solid var(--accent);
}

/* === Footer === */
.footer {
    background: var(--brand-anchor);
    color: rgba(255, 255, 255, 0.9);
    border-top: none;
}

.footer__brand h3,
.footer__col h4 {
    color: var(--surface);
}

.footer a {
    color: rgba(255, 255, 255, 0.75);
    transition: color var(--duration-base) var(--ease-soft);
}

.footer a:hover {
    color: var(--surface);
}

.footer__disclaimer,
.footer__bottom {
    color: rgba(255, 255, 255, 0.6);
    border-top-color: rgba(255, 255, 255, 0.12);
}

/* === Body text — Inter + Onest fallback === */
body {
    font-family: var(--font-body);
    background: var(--foundation);
    color: var(--ink);
}

/* === Полностью убрать GSAP reveal animations при reduced motion (страховка) === */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* =========================================================================
 * EDITORIAL OVERRIDES для legacy sections главной + sub-pages
 * Подключается ПОСЛЕ styles.css → перебивает старые правила.
 * ========================================================================= */

/* === Section header (x-section-header → .section__head) === */
.section__head {
    margin-bottom: var(--s-7);
    text-align: center;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

.section__head .overline,
.section__head span.overline {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--t-overline);
    letter-spacing: var(--ls-overline);
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: var(--s-3);
    background: none !important;
    padding: 0 !important;
    border: none !important;
}

.section__head h2 {
    font-family: var(--font-display);
    font-size: var(--t-h1);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-h1);
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 var(--s-4);
}

.section__head p {
    font-size: var(--t-body-lg);
    line-height: var(--lh-body);
    color: var(--ink-muted);
    max-width: 560px;
    margin: 0 auto;
}

/* === Feature card (преимущества) === */
.feature-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 0;
    padding: var(--s-6) var(--s-5);
    box-shadow: none;
    transition: border-color var(--duration-base) var(--ease-soft);
}

.feature-card:hover {
    border-color: var(--ink);
}

.feature-card__icon {
    width: 40px;
    height: 40px;
    background: var(--accent-soft);
    border-radius: var(--radius-sm);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--s-4);
}

.feature-card__title {
    font-family: var(--font-display);
    font-size: var(--t-h3);
    line-height: var(--lh-snug);
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 var(--s-3);
}

.feature-card__text {
    font-size: var(--t-body);
    line-height: var(--lh-body);
    color: var(--ink-muted);
    margin: 0;
}

/* === Steps timeline === */
.steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s-5);
    position: relative;
    margin-top: var(--s-6);
}

.steps::before {
    content: "";
    position: absolute;
    top: 24px;
    left: 12.5%;
    right: 12.5%;
    height: 1px;
    background: var(--hairline-strong);
    z-index: 0;
}

.step {
    position: relative;
    z-index: 1;
    padding: 0;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.step__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 0;
    background: var(--surface);
    border: 1px solid var(--hairline-strong);
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: var(--t-body);
    font-weight: 600;
    letter-spacing: var(--ls-mono);
    margin-bottom: var(--s-4);
}

.step__title {
    font-family: var(--font-display);
    font-size: var(--t-h3);
    line-height: var(--lh-snug);
    font-weight: 600;
    color: var(--ink);
    margin: 0 0 var(--s-3);
}

.step__text {
    font-size: var(--t-body);
    line-height: var(--lh-body);
    color: var(--ink-muted);
    margin: 0;
}

@media (max-width: 768px) {
    .steps {
        grid-template-columns: 1fr;
        gap: var(--s-5);
    }
    .steps::before {
        display: none;
    }
}

/* Tabs «Я заёмщик / Я инвестор» — editorial pill switcher */
.tabs {
    display: inline-flex;
    background: var(--surface);
    border: 1px solid var(--hairline);
    padding: var(--s-1);
    border-radius: 999px;
    margin: var(--s-5) auto 0;
}

.tabs__btn {
    background: transparent;
    border: none;
    padding: var(--s-2) var(--s-5);
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: var(--t-body);
    color: var(--ink-muted);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-soft);
}

.tabs__btn.is-active {
    background: var(--accent);
    color: var(--surface);
}

/* === Compare table === */
.compare {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 0;
    border-collapse: separate;
    border-spacing: 0;
    margin: var(--s-6) 0;
    box-shadow: none;
    position: relative;
    z-index: 1;
}

.compare thead {
    background: var(--surface-sunken);
}

.compare th {
    font-family: var(--font-mono);
    font-size: var(--t-overline);
    letter-spacing: var(--ls-overline);
    text-transform: uppercase;
    color: var(--ink-muted);
    text-align: left;
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--hairline);
    font-weight: 500;
}

.compare th:first-child {
    background: transparent;
}

.compare td {
    padding: var(--s-4) var(--s-5);
    font-size: var(--t-body);
    color: var(--ink);
    border-bottom: 1px solid var(--hairline);
    vertical-align: middle;
}

.compare tr:last-child td {
    border-bottom: none;
}

.compare td:first-child {
    font-weight: 500;
    color: var(--ink);
}

.compare__neutral {
    color: var(--ink-muted);
}

.compare__cross {
    color: var(--ink-muted);
    text-decoration: none;
}

.compare__highlight {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    position: relative;
}

.compare__highlight::before {
    content: "ПЛАТФОРМА";
    display: block;
    font-family: var(--font-mono);
    font-size: 10px;
    letter-spacing: var(--ls-overline);
    color: var(--accent);
    opacity: 0.7;
    margin-bottom: 2px;
    font-weight: 500;
}

/* === Requirements check-list === */
.req-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--s-4) var(--s-7);
    margin-top: var(--s-6);
}

.req-item {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: var(--s-3) 0;
    font-size: var(--t-body);
    line-height: var(--lh-body);
    color: var(--ink-muted);
}

.req-item [data-icon] {
    color: var(--success);
    flex-shrink: 0;
    margin-top: 4px;
}

.req-item strong {
    color: var(--ink);
    font-weight: 600;
}

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

/* === Stat card === */
.stat-card {
    background: var(--surface);
    border: 1px solid var(--hairline);
    border-radius: 0;
    padding: var(--s-6) var(--s-5);
    box-shadow: none;
    text-align: left;
}

.stat-card__num {
    display: block;
    font-family: var(--font-display);
    font-size: var(--t-h1);
    line-height: var(--lh-tight);
    font-weight: 600;
    color: var(--ink);
    font-variant-numeric: tabular-nums lining-nums;
    margin-bottom: var(--s-2);
}

.stat-card__num small {
    font-size: 0.5em;
    color: var(--ink-muted);
    font-weight: 500;
    margin-left: var(--s-1);
}

.stat-card__label {
    font-family: var(--font-mono);
    font-size: var(--t-overline);
    letter-spacing: var(--ls-overline);
    text-transform: uppercase;
    color: var(--ink-muted);
}

/* === FAQ === */
.faq {
    max-width: 800px;
    margin: var(--s-6) auto 0;
    border-top: 1px solid var(--hairline);
}

.faq__item {
    border-bottom: 1px solid var(--hairline);
    padding: var(--s-4) 0;
}

.faq__item summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-display);
    font-size: var(--t-h3);
    line-height: var(--lh-snug);
    color: var(--ink);
    font-weight: 500;
}

.faq__item summary::-webkit-details-marker { display: none; }

.faq__icon {
    color: var(--accent);
    transition: transform var(--duration-base) var(--ease-soft);
    flex-shrink: 0;
}

.faq__item[open] .faq__icon {
    transform: rotate(45deg);
}

.faq__answer {
    margin-top: var(--s-3);
    color: var(--ink-muted);
    font-size: var(--t-body);
    line-height: var(--lh-body);
}

/* === CTA final — editorial inverse panel === */
.cta-final {
    background: var(--accent);
    color: var(--surface);
    padding: var(--s-9) var(--s-7);
    border-radius: 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.cta-final h2 {
    font-family: var(--font-display);
    font-size: var(--t-h1);
    line-height: var(--lh-tight);
    letter-spacing: var(--ls-h1);
    font-weight: 600;
    color: var(--surface) !important;
    margin: 0 0 var(--s-4);
}

.cta-final p {
    font-size: var(--t-body-lg);
    color: rgba(255, 255, 255, 0.85);
    max-width: 560px;
    margin: 0 auto var(--s-6);
}

.cta-final .button-group {
    display: flex;
    gap: var(--s-4);
    justify-content: center;
    flex-wrap: wrap;
}

.cta-final .btn--primary {
    background: var(--surface);
    color: var(--accent);
    border: none;
}

.cta-final .btn--primary:hover {
    background: var(--surface-sunken);
}

.cta-final .btn--ghost {
    background: transparent;
    color: var(--surface);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.cta-final .btn--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--surface);
}

/* === Trust bar — editorial 4-up === */
.trust-bar {
    background: var(--surface);
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
    padding: var(--s-5) 0;
}

.trust-bar__row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--s-5);
    align-items: center;
}

.trust-bar__item {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    font-size: var(--t-small);
    color: var(--ink-muted);
    line-height: var(--lh-snug);
}

.trust-bar__item [data-icon] {
    color: var(--accent);
    flex-shrink: 0;
}

.trust-bar__item strong {
    display: block;
    color: var(--ink);
    font-weight: 600;
    margin-bottom: 2px;
}

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

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

/* === Header navigation — editorial === */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
    padding: var(--s-4) 0;
}

.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-6);
    max-width: var(--w-landing);
    margin: 0 auto;
    padding: 0 var(--s-6);
}

.header .logo {
    display: flex;
    align-items: center;
    gap: var(--s-3);
    color: var(--ink);
    text-decoration: none;
}

.header .logo__mark {
    width: 36px;
    height: 36px;
}

.header .logo__text {
    display: block;
    font-family: var(--font-display);
    font-size: var(--t-h3);
    font-weight: 700;
    letter-spacing: var(--ls-h2);
    color: var(--ink);
    line-height: 1;
}

.header .logo__tagline {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--t-overline);
    letter-spacing: var(--ls-overline);
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-top: var(--s-1);
    line-height: 1.3;
    max-width: 11ch;
    word-spacing: 100vw;
}

.header__nav a {
    color: var(--ink-muted);
    text-decoration: none;
    font-size: var(--t-body);
    transition: color var(--duration-base) var(--ease-soft);
    padding: var(--s-2) 0;
    position: relative;
}

.header__nav a:hover {
    color: var(--ink);
}

.header__nav a.is-active {
    color: var(--ink);
}

.header__nav a.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    background: var(--success);
}

/* Header CTA — editorial buttons */
.header .btn,
.header__cta .btn {
    border-radius: 0;
    padding: var(--s-3) var(--s-5);
    font-size: var(--t-body);
    font-weight: 500;
    border: 1px solid var(--hairline-strong);
    background: var(--surface);
    color: var(--ink);
    transition: all var(--duration-base) var(--ease-soft);
}

.header .btn--primary,
.header__cta .btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--surface);
}

.header .btn--primary:hover,
.header__cta .btn--primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

/* === Mobile responsive — editorial overlay для drawer/nav/sections ===
 * IMPORTANT: drawer открывается через `body.menu-open` (классическая логика
 * из assets/js/main.js → initMobileMenu). Не пытаемся переопределить open-state
 * mechanism — accept existing `.menu-open .header__drawer { transform: translateX(0) }`
 * из styles.css. Только перекрашиваем editorial-стилем.
 *
 * Breakpoint у styles.css drawer = 1024px, поэтому используем тот же.
 */
@media (max-width: 1024px) {
    /* Header — компактный логотип */
    .header__inner {
        padding: 0 var(--s-4);
    }

    .header .logo__mark {
        width: 32px;
        height: 32px;
    }

    .header .logo__text {
        font-size: var(--t-h3);
    }

    /* Скрываем tagline на узких экранах — освобождает место для burger */
    .header .logo__tagline {
        display: none;
    }

    /* Burger — editorial square, повышенная специфичность через .header */
    .header .burger {
        background: transparent;
        border: 1px solid var(--hairline-strong);
        border-radius: var(--radius-sm);
        padding: 0;
    }

    .header .burger span,
    .header .burger span::before,
    .header .burger span::after {
        background: var(--ink);
        border-radius: 0;
    }

    /* Drawer panel — editorial skin (НЕ трогаем width/transform/position
     * — они приходят из styles.css. Только цвета, padding внутри.
     * NB: НЕ перебиваем display — оставляем `display: block` от styles.css
     * чтобы избежать WebKit iOS layer composition quirks. */
    .header__drawer {
        background: var(--surface) !important;
        padding: var(--s-7) var(--s-5) var(--s-5) !important;
        box-shadow: -8px 0 32px rgba(15, 23, 42, 0.08) !important;
    }

    .drawer-backdrop {
        background: rgba(15, 23, 42, 0.45);
    }

    /* Drawer close (round X) — скрываем дубликат, остаётся только burger который
     * сам анимируется в X при body.menu-open (см. styles.css L337-339). */
    .drawer-close {
        display: none !important;
    }

    /* Nav inside drawer — editorial list */
    .header__drawer .nav {
        display: flex;
        flex-direction: column;
        gap: 0;
        margin-top: var(--s-7);
        border-top: 1px solid var(--hairline);
        align-items: stretch;
    }

    .header__drawer .nav__link {
        display: block;
        padding: var(--s-4) 0;
        font-family: var(--font-body);
        font-size: var(--t-h3);
        font-weight: 500;
        color: var(--ink);
        text-decoration: none;
        border-bottom: 1px solid var(--hairline);
        transition: color var(--duration-base) var(--ease-soft);
        white-space: normal;
        word-break: normal;
    }

    .header__drawer .nav__link:hover {
        color: var(--accent);
    }

    .header__drawer .nav__link.is-active {
        color: var(--accent);
    }

    .header__drawer .nav__link.is-active::after {
        display: none;
    }

    /* CTA blok внизу drawer */
    .drawer-cta {
        margin-top: auto;
        padding-top: var(--s-5);
        display: flex !important;
        flex-direction: column;
        gap: var(--s-3) !important;
        border-top: 1px solid var(--hairline);
    }

    .drawer-cta .btn {
        width: 100%;
        text-align: center;
        justify-content: center;
        padding: var(--s-3) var(--s-4);
        border-radius: 0;
    }

    .drawer-cta .btn--primary {
        background: var(--accent);
        color: var(--surface);
        border-color: var(--accent);
    }

    .drawer-cta .btn--ghost,
    .drawer-cta .btn--secondary {
        background: var(--surface);
        color: var(--ink);
        border: 1px solid var(--hairline-strong);
    }

    /* Hero — компактнее */
    .editorial-hero__container,
    .editorial-page-hero__container {
        grid-template-columns: 1fr !important;
        gap: var(--s-5) !important;
        padding: 0 var(--s-4) !important;
    }

    .editorial-hero__rail,
    .editorial-hero__toc,
    .editorial-page-hero__rail,
    .editorial-page-hero__meta {
        display: none !important;
    }

    .editorial-hero__display {
        font-size: clamp(2.5rem, 9vw, 4rem) !important;
    }

    /* Section header — поджать */
    .section__head h2 {
        font-size: var(--t-h2);
    }

    /* Steps на мобиле — вертикально */
    .steps {
        grid-template-columns: 1fr !important;
    }
    .steps::before { display: none; }

    /* Requirements list — 1 col */
    .req-list {
        grid-template-columns: 1fr;
    }

    /* Trust-bar */
    .trust-bar__row {
        grid-template-columns: 1fr;
    }

    /* Compare table — горизонтальный скролл */
    .compare {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* CTA final */
    .cta-final {
        padding: var(--s-7) var(--s-5);
    }
    .cta-final h2 {
        font-size: var(--t-h2);
    }

    /* NB: scroll-lock через `body.menu-open { overflow: hidden }` НЕ ставим —
     * на iOS Safari это может вызывать white-page rendering issue. JS из
     * styles.js уже добавляет `is-locked` класс на body, если scroll-lock нужен. */
}

/* === Cabinet mobile fallback ===
 * Многие Tailwind grid-cols-N use без responsive prefix (grid-cols-3/4)
 * — на узких экранах сжимают контент в нечитабельные колонки.
 * Fallback: на ≤640px заставляем 3+ колонки превратиться в одну. */
@media (max-width: 640px) {
    .cabinet .grid-cols-3,
    .cabinet .grid-cols-4,
    .cabinet .grid-cols-5,
    .cabinet .grid-cols-6 {
        grid-template-columns: 1fr !important;
        gap: var(--s-3) !important;
    }
    /* min-w-[180px] фильтр-форм — раскрывать full-width */
    .cabinet [class*="min-w-["] {
        min-width: 0 !important;
    }
}

/* На tablet оставляем 2 колонки для 3+ — компромисс */
@media (min-width: 641px) and (max-width: 900px) {
    .cabinet .grid-cols-3,
    .cabinet .grid-cols-4 {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

.bento-cell { min-width: 0; }


/* === Print stylesheet ===
 * Требование 259-ФЗ: документы раскрытия и договоры должны быть удобно
 * читаемы при печати (регулятор, контрагенты, бумажный аудит).
 */
@media print {
    /* Цвета — чистые ч/б + max readable */
    :root {
        --foundation: #ffffff;
        --surface: #ffffff;
        --surface-sunken: #f5f5f5;
        --ink: #000000;
        --ink-muted: #333333;
        --ink-subtle: #555555;
        --hairline: #999999;
        --hairline-strong: #666666;
        --accent: #000000;
        --brand-anchor: #000000;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 11pt;
        line-height: 1.5;
    }

    /* Скрыть UI-элементы не нужные для печати */
    header, footer, nav,
    .cabinet__sidebar,
    .cabinet__topbar,
    .sidebar,
    .topbar,
    .btn, .button, .base-button,
    .filter, .header__nav,
    .editorial-numbering,
    .hero__visual,
    .hero__cta,
    .reveal {
        display: none !important;
    }

    /* Карточки — минимум визуального шума */
    .card, .base-card,
    [class*="card"] {
        border: 1px solid #999 !important;
        box-shadow: none !important;
        background: #fff !important;
        page-break-inside: avoid;
    }

    /* Таблицы — обязательны для finance/regulator печати */
    table {
        page-break-inside: auto;
        border-collapse: collapse;
        width: 100%;
    }
    tr { page-break-inside: avoid; page-break-after: auto; }
    thead { display: table-header-group; }
    tfoot { display: table-footer-group; }
    th, td {
        border: 1px solid #999 !important;
        padding: 6pt 8pt;
    }

    /* Ссылки — показать URL для печати (рег. требование traceability) */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }
    a[href^="#"]::after,
    a[href^="javascript:"]::after,
    a[href^="mailto:"]::after,
    a[href^="tel:"]::after {
        content: "";
    }

    /* Заголовки — не разрывать через page break */
    h1, h2, h3, h4 {
        page-break-after: avoid;
        page-break-inside: avoid;
        color: #000 !important;
    }

    /* Не разрывать parahgraph и list items */
    p, li {
        orphans: 3;
        widows: 3;
    }

    /* Раскрытие — добавить footer-номер страницы */
    @page {
        margin: 20mm 18mm;
        size: A4;
    }

    /* Договоры — шрифт серифный для удобства чтения */
    .contract, .disclosure, .pdf-content {
        font-family: 'Times New Roman', Times, serif;
    }

    /* Не обрезать длинные ИНН/хеши */
    code, .font-mono, [class*="font-mono"] {
        font-family: 'Courier New', Courier, monospace;
        word-break: break-all;
    }
}
