/* Дополнительная адаптация шаблона после проверки на 320–1920 px. */

html,
body {
    max-width: 100%;
}

main :where(article, section, div, form, fieldset),
.site-header__inner > *,
.site-footer__grid > * {
    min-width: 0;
    min-inline-size: 0;
}

:where(h1, h2, h3, p, li, dd, dt, a) {
    overflow-wrap: break-word;
}

.arch-panels,
.arch-card,
.arch-card > *,
.calc-row,
.calc-row__grid,
.lead-form,
.table-scroll {
    min-width: 0;
    max-width: 100%;
}

.table-scroll {
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    -webkit-overflow-scrolling: touch;
}

input,
select,
textarea,
button {
    max-width: 100%;
}

@media (max-width: 767.98px) {
    .section-lead {
        max-width: 42rem;
    }

    .site-footer__grid {
        grid-template-columns: 1fr;
    }

    .table-scroll {
        margin-inline: calc(var(--space-2) * -1);
        padding-inline: var(--space-2);
    }
}

@media (max-width: 479.98px) {
    .hero__actions,
    .hero-segment__actions,
    .final-cta__actions,
    .thanks__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero__actions > .btn,
    .hero-segment__actions > .btn,
    .final-cta__actions > .btn,
    .thanks__actions > .btn {
        width: 100%;
    }

    .sticky-actions .btn {
        min-width: 0;
        padding-inline: var(--space-2);
        font-size: var(--text-sm);
        line-height: 1.2;
    }
}

@media (max-width: 359.98px) {
    .container {
        padding-inline: 0.75rem;
    }

    .site-header__inner {
        gap: var(--space-2);
    }

    .brand {
        font-size: 1rem;
    }

    .brand__mark {
        width: 32px;
        height: 32px;
    }

    .card,
    .lead-form,
    .calculator-shell {
        padding: var(--space-3);
    }

    :where(h1, h2, h3, .legal) {
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    .nav-drawer__list {
        max-width: calc(100vw - 1.5rem);
    }

    .sticky-actions {
        gap: 0.375rem;
        padding-inline: 0.5rem;
    }
}

@media (min-width: 1600px) {
    .container {
        max-width: 76rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}
