*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg: #eef3f5;
    --white: #ffffff;
    --card-bg: #f7fafb;

    --accent: #54798c;
    --accent-dark: #3f6274;
    --accent-light: #dce8ee;

    --text-dark: #2d3136;
    --text-mid: #4f5b65;
    --text-light: #7c8791;

    --border: #d7e0e5;
    --shadow: 0 8px 30px rgba(55, 74, 87, 0.08);

    --radius: 14px;
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg);
    color: var(--text-dark);
    line-height: 1.6;
}

/* NAV */
nav {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    box-shadow: 0 3px 18px rgba(0, 0, 0, 0.04);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    border-radius: 0;
    width: auto;
    height: auto;
}

.logo-icon img {
    display: block;
    height: 38px;   /* регулируй высоту */
    width: auto;    /* ширина подстроится автоматически */
    max-width: 180px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 34px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    font-size: 16px;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.2s ease, opacity 0.2s ease;
    position: relative;
}

.nav-links a:hover {
    color: var(--accent-dark);
}

.nav-links a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.25s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-primary,
.btn-outline {
    display: inline-block;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 10px 22px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
    border: 1px solid var(--accent);
    box-shadow: 0 4px 14px rgba(84, 121, 140, 0.18);
}

.btn-primary:hover {
    background: var(--accent-dark);
    border-color: var(--accent-dark);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border);
}

.btn-outline:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent-dark);
}

.btn-sm {
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 8px;
}

.hamburger {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-dark);
    cursor: pointer;
}

.mobile-menu {
    display: none;
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px 20px;
    flex-direction: column;
    gap: 12px;
    box-shadow: 0 8px 18px rgba(0,0,0,0.04);
}

.mobile-menu.open {
    display: flex;
}

.mobile-menu a {
    text-decoration: none;
    color: var(--text-mid);
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    font-size: 15px;
}

.mobile-menu a:hover {
    color: var(--accent-dark);
}

.mobile-menu-actions {
    margin-top: 8px;
}

/* HERO */
.hero {
    background: linear-gradient(180deg, #f9fbfc 0%, #eef3f5 100%);
    overflow: hidden;
    border-bottom: 1px solid var(--border);
}

.hero-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 70px 24px 20px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 48px;
    min-height: 420px;
}

.hero-content {
    padding-bottom: 40px;
}

.hero-content h1 {
    font-size: clamp(36px, 5vw, 58px);
    font-weight: 700;
    line-height: 1.12;
    margin-bottom: 20px;
    color: var(--text-dark);
}

.hero-content p {
    font-size: 17px;
    color: var(--text-mid);
    margin-bottom: 34px;
    max-width: 560px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-image {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.hero-image img {
    width: 100%;
    max-width: 500px;
    border-radius: 18px;
    object-fit: cover;
    display: block;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

/* SECTION */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 24px;
}

.section-title {
    font-size: clamp(24px, 3vw, 32px);
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
}

.section-title-line {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 42px;
}

.section-title-line::before,
.section-title-line::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* CARDS */
.cards-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    min-height: 160px;
    box-shadow: 0 4px 18px rgba(30, 50, 70, 0.03);
}

.card:hover {
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.card-content {
    flex: 1;
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.card-content p {
    font-size: 14px;
    color: var(--text-light);
    margin-bottom: 16px;
}

.card-image {
    width: 150px;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--card-bg);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* FEATURES */
.why-section {
    background: #f9fbfc;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

.feature {
    text-align: center;
    padding: 12px;
}

.feature-icon {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    background: var(--accent-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-dark);
    border: 1px solid var(--border);
    font-size: 22px;
    font-weight: 700;
}

.feature h4 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.feature p {
    font-size: 14px;
    color: var(--text-light);
}

/* GALLERY */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.gallery-item {
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--border);
    background: var(--white);
    box-shadow: 0 3px 12px rgba(0,0,0,0.03);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.04);
}

/* FOOTER */
footer {
    background: var(--white);
    border-top: 1px solid var(--border);
    padding: 40px 24px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-links {
    display: flex;
    gap: 24px;
    list-style: none;
    flex-wrap: wrap;
}

.footer-links a {
    text-decoration: none;
    font-size: 14px;
    color: var(--text-light);
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--accent-dark);
}

.footer-copy {
    font-size: 13px;
    color: var(--text-light);
}

/* RESPONSIVE */
@media (max-width: 900px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .nav-links,
    .nav-actions {
        display: none;
    }

    .hamburger {
        display: block;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        padding-top: 40px;
        gap: 32px;
        min-height: auto;
    }

    .hero-content {
        padding-bottom: 0;
    }

    .hero-image {
        justify-content: center;
    }

    .hero-image img {
        border-radius: 16px;

    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .card-image {
        width: 110px;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 520px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }
}


@media (max-width: 520px) {
    .section-title-line {
        display: block;
        text-align: center;
        margin-bottom: 30px;
    }

    .section-title-line::before,
    .section-title-line::after {
        display: none;
    }

    .section-title {
        display: block;
        font-size: 26px;
        line-height: 1.2;
        overflow-wrap: break-word;
    }
}

img {
    max-width: 100%;
}




.hero-content p {
    text-align: justify;
}

@media (max-width: 700px) {
    .hero-content {
        text-align: center;
    }

    .hero-content p {
        text-align: justify;
        max-width: 100%;
    }

    .hero-actions {
        justify-content: center;
    }
}

/* CONTACT PAGE */
.contact-hero .hero-inner {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    min-height: 340px;
    padding-bottom: 48px;
}

.contact-hero .hero-content {
    padding-bottom: 0;
}

.contact-hero-note {
    max-width: 440px;
    justify-self: end;
    padding: 32px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.contact-note-mark {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 50%;
    background: var(--accent-light);
    color: var(--accent-dark);
    font-size: 23px;
}

.contact-hero-note h2 {
    margin-bottom: 8px;
    font-size: 22px;
    line-height: 1.3;
}

.contact-hero-note p,
.contact-intro,
.contact-detail-row p,
.contact-hint {
    color: var(--text-light);
    font-size: 14px;
}

.contact-section {
    max-width: 1120px;
}

.contact-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
    gap: 56px;
    align-items: start;
}

.contact-details .section-title-line {
    margin-bottom: 20px;
}

.contact-details .section-title {
    white-space: nowrap;
}

.contact-intro {
    margin-bottom: 32px;
}

.contact-detail-row {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-top: 24px;
}

.contact-detail-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-light);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--accent-dark);
    font-weight: 700;
}

.contact-detail-row h3 {
    margin: 1px 0 4px;
    font-size: 16px;
}

.contact-form-wrap {
    padding: 30px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 4px 18px rgba(30, 50, 70, 0.04);
}

.contact-form,
.contact-field {
    display: grid;
    gap: 10px;
}

.contact-form {
    gap: 20px;
}

.contact-fields-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.contact-field label {
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
}

.contact-field label span {
    color: #b34d43;
}

.contact-field input,
.contact-field textarea {
    width: 100%;
    min-width: 0;
    padding: 11px 12px;
    color: var(--text-dark);
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    font: inherit;
    font-size: 15px;
}

.contact-field textarea {
    min-height: 150px;
    resize: vertical;
}

.contact-field input:focus,
.contact-field textarea:focus {
    outline: 2px solid var(--accent-light);
    border-color: var(--accent);
}

.contact-file-input {
    padding: 10px !important;
    background: var(--card-bg) !important;
}

.contact-file-input::file-selector-button {
    margin-right: 12px;
    padding: 7px 12px;
    color: var(--text-dark);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

.contact-hint {
    margin-top: -4px;
    font-size: 12px;
}

.contact-submit {
    justify-self: start;
    font: inherit;
    font-size: 14px;
}

.contact-alert {
    margin-bottom: 20px;
    padding: 13px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
}

.contact-alert-success {
    color: #275c45;
    background: #edf7f1;
    border-color: #c7e4d1;
}

.contact-alert-error {
    color: #843f39;
    background: #fff3f1;
    border-color: #efd0cb;
}

.contact-alert ul {
    padding-left: 20px;
}

@media (max-width: 900px) {
    .contact-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .contact-details .section-title-line {
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .contact-hero .hero-inner {
        grid-template-columns: 1fr;
        padding-bottom: 36px;
    }

    .contact-hero-note {
        width: 100%;
        max-width: none;
        justify-self: stretch;
        padding: 24px;
        text-align: left;
    }

    .contact-note-mark {
        margin-left: auto;
        margin-right: auto;
    }

    .contact-hero-note p {
        text-align: center;
    }
}

@media (max-width: 520px) {
    .contact-fields-row {
        grid-template-columns: 1fr;
    }

    .contact-form-wrap {
        padding: 20px 16px;
    }

    .contact-details .section-title-line {
        justify-content: center;
    }

    .contact-details .section-title {
        white-space: normal;
    }

    .contact-submit {
        width: 100%;
    }
}

/* Contact page visual refinement */
.contact-hero { background: linear-gradient(115deg, #f8fbfc 0%, #e6eff2 100%); }
.contact-hero .hero-inner { grid-template-columns: minmax(0, 1fr) minmax(300px, .72fr); min-height: 330px; padding-top: 54px; padding-bottom: 54px; gap: 72px; }
.contact-hero .hero-content { padding: 0; }
.contact-hero .hero-content h1 { font-size: 48px; margin-bottom: 14px; }
.contact-hero .hero-content p { max-width: 580px; margin-bottom: 26px; text-align: left; }
.contact-hero-note { justify-self: stretch; max-width: none; padding: 28px 30px; background: rgba(255,255,255,.78); border: 1px solid #d4e0e4; border-radius: 10px; box-shadow: 0 12px 34px rgba(55,74,87,.07); }
.contact-note-mark { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; margin-bottom: 20px; border-radius: 9px; background: var(--accent-light); color: var(--accent-dark); font-size: 21px; }
.contact-hero-note h2 { margin-bottom: 8px; font-size: 21px; line-height: 1.3; }
.contact-hero-note p, .contact-intro, .contact-detail-row p, .contact-hint { color: var(--text-light); font-size: 14px; }
.contact-section { max-width: 1160px; padding-top: 54px; padding-bottom: 72px; }
.contact-layout { display: grid; grid-template-columns: minmax(250px, .72fr) minmax(0, 1.28fr); gap: clamp(32px, 6vw, 76px); align-items: start; }
.contact-details .section-title-line { margin-bottom: 18px; }
.contact-details .section-title { white-space: normal; text-align: left; }
.contact-intro { max-width: 340px; margin-bottom: 34px; }
.contact-detail-row { display: grid; grid-template-columns: 44px minmax(0,1fr); gap: 14px; align-items: start; margin-top: 25px; }
.contact-detail-icon { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: var(--white); border: 1px solid var(--border); border-radius: 9px; color: var(--accent-dark); font-weight: 700; }
.contact-detail-row h3 { margin: 1px 0 4px; font-size: 16px; }
.contact-form-wrap { padding: clamp(22px, 3vw, 36px); background: var(--white); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 34px rgba(45,65,78,.07); }
.contact-form, .contact-field { display: grid; gap: 9px; }
.contact-form { gap: 20px; }
.contact-fields-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.contact-field label { color: var(--text-dark); font-size: 14px; font-weight: 600; }
.contact-field label span { color: #b34d43; }
.contact-field input:not([type=file]), .contact-field textarea { width: 100%; min-width: 0; padding: 12px 13px; color: var(--text-dark); background: #fbfcfd; border: 1px solid #cfdbe0; border-radius: 7px; font: inherit; font-size: 15px; transition: border-color .18s, box-shadow .18s, background .18s; }
.contact-field textarea { min-height: 154px; resize: vertical; }
.contact-field input:focus, .contact-field textarea:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(84,121,140,.14); }
.contact-file-input { width: 100%; min-height: 58px; padding: 10px !important; background: #f6f9fa !important; border: 1px dashed #b8c9d0 !important; border-radius: 7px; }
.contact-file-input::file-selector-button { margin-right: 12px; padding: 8px 13px; color: var(--text-dark); background: var(--white); border: 1px solid var(--border); border-radius: 5px; cursor: pointer; }
.contact-hint { margin-top: -3px; font-size: 12px; line-height: 1.5; }
.contact-submit { justify-self: start; min-height: 46px; padding: 10px 24px; border-radius: 7px; font: inherit; font-size: 14px; }
.contact-alert { margin-bottom: 20px; padding: 13px 16px; border: 1px solid var(--border); border-radius: 7px; font-size: 14px; }
.contact-alert-success { color: #275c45; background: #edf7f1; border-color: #c7e4d1; }
.contact-alert-error { color: #843f39; background: #fff3f1; border-color: #efd0cb; }
.contact-alert ul { padding-left: 20px; }
@media (max-width: 900px) {
    .contact-layout { grid-template-columns: 1fr; gap: 28px; }
    .contact-details .section-title-line { justify-content: flex-start; }
    .contact-intro { max-width: 600px; margin-bottom: 22px; }
}
@media (max-width: 700px) {
    .contact-hero .hero-inner { grid-template-columns: 1fr; padding-top: 38px; padding-bottom: 38px; gap: 24px; }
    .contact-hero .hero-content h1 { font-size: 38px; }
    .contact-hero-note { padding: 22px; }
    .contact-hero-note p { text-align: left; }
    .contact-section { padding-top: 38px; padding-bottom: 48px; }
}
@media (max-width: 520px) {
    .contact-fields-row { grid-template-columns: 1fr; }
    .contact-form-wrap { padding: 20px 16px; }
    .contact-details .section-title-line { justify-content: flex-start; text-align: left; }
    .contact-details .section-title { text-align: left; }
    .contact-submit { width: 100%; }
}

/* Consent checkbox */
.contact-hero-image {
    overflow: hidden;
    border-radius: 16px;
}

.contact-hero-image img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
}

.contact-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text-mid);
    font-size: 13px;
    line-height: 1.5;
}

.contact-consent input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
    accent-color: var(--accent);
}

.contact-consent label {
    cursor: pointer;
}

.contact-consent a {
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.contact-consent span {
    color: #b34d43;
}

/* КУКИ */
.cookie-consent {
    position: fixed;
    z-index: 1000;
    right: 24px;
    bottom: 24px;
    display: flex;
    align-items: center;
    gap: 24px;
    width: min(620px, calc(100% - 32px));
    padding: 20px 22px;
    color: var(--text-dark);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 36px rgba(45, 65, 78, 0.18);
}

.cookie-consent[hidden] {
    display: none;
}

.cookie-consent__content {
    flex: 1;
}

.cookie-consent__content h2 {
    margin-bottom: 6px;
    font-size: 17px;
}

.cookie-consent__content p {
    color: var(--text-mid);
    font-size: 13px;
    line-height: 1.5;
}

.cookie-consent__content a {
    color: var(--accent-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cookie-consent__button {
    flex: 0 0 auto;
    border: 0;
}

@media (max-width: 520px) {
    .cookie-consent {
        right: 16px;
        bottom: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        width: calc(100% - 32px);
        padding: 18px;
    }

    .cookie-consent__button {
        width: 100%;
    }
}
/* ПДн и Оферта */

/* LEGAL PAGES */
.legal-page {
    min-height: 100vh;
    background: linear-gradient(180deg, #f8fbfc 0, var(--bg) 420px);
}

.legal-container {
    width: min(1160px, calc(100% - 48px));
    margin: 0 auto;
}

.legal-hero {
    padding: 76px 0 58px;
    background: linear-gradient(115deg, #f8fbfc 0%, #e6eff2 100%);
    border-bottom: 1px solid var(--border);
}

.legal-eyebrow {
    margin-bottom: 12px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.legal-hero h1 {
    max-width: 850px;
    font-size: clamp(34px, 5vw, 52px);
    line-height: 1.12;
}

.legal-hero__subtitle,
.legal-date {
    margin-top: 14px;
    color: var(--text-mid);
}

.legal-date {
    font-size: 14px;
}

.legal-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: clamp(28px, 5vw, 72px);
    align-items: start;
    padding-top: 54px;
    padding-bottom: 76px;
}

/* Содержание */
.legal-sidebar {
    position: sticky;
    top: 96px;
    overflow: hidden;
    padding: 0;
    background: rgba(255, 255, 255, .88);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(45, 65, 78, .05);
}

.legal-sidebar__header {
    padding: 18px 18px 15px;
    border-bottom: 1px solid var(--border);
}

.legal-sidebar__eyebrow {
    margin: 0 0 4px;
    color: var(--accent-dark);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.legal-sidebar__title {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.legal-nav {
    display: grid;
    gap: 2px;
    max-height: calc(100vh - 180px);
    padding: 10px;
    overflow-y: auto;
    counter-reset: legal-nav-item;
    scrollbar-width: thin;
    scrollbar-color: #c7d6dc transparent;
}

.legal-nav::-webkit-scrollbar {
    width: 6px;
}

.legal-nav::-webkit-scrollbar-track {
    background: transparent;
}

.legal-nav::-webkit-scrollbar-thumb {
    background: #c7d6dc;
    border-radius: 10px;
}

.legal-nav a {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    gap: 7px;
    align-items: start;
    padding: 8px;
    color: var(--text-mid);
    font-size: 13px;
    line-height: 1.35;
    text-decoration: none;
    border-radius: 7px;
    transition: color .18s ease, background-color .18s ease;
    counter-increment: legal-nav-item;
}

.legal-nav a::before {
    content: counter(legal-nav-item, decimal-leading-zero);
    padding-top: 1px;
    color: #93a6ae;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.45;
    transition: color .18s ease;
}

.legal-nav a:hover,
.legal-nav a:focus-visible {
    color: var(--accent-dark);
    background: var(--accent-light);
    outline: none;
}

.legal-nav a:hover::before,
.legal-nav a:focus-visible::before {
    color: var(--accent-dark);
}

/* Добавляйте этот класс ссылке через JS при прокрутке, если потребуется */
.legal-nav a.is-active {
    color: var(--accent-dark);
    font-weight: 600;
    background: var(--accent-light);
    box-shadow: inset 3px 0 0 var(--accent-dark);
}

.legal-nav a.is-active::before {
    color: var(--accent-dark);
}

/* Документ */
.legal-document {
    padding: clamp(24px, 4vw, 46px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 10px 34px rgba(45, 65, 78, .07);
}

.legal-document section + section {
    margin-top: 38px;
}

.legal-document h2 {
    margin-bottom: 15px;
    font-size: clamp(21px, 3vw, 27px);
    line-height: 1.25;
}

.legal-document p,
.legal-document li,
.legal-document dd {
    color: var(--text-mid);
    font-size: 15px;
    line-height: 1.7;
}

.legal-document p + p {
    margin-top: 13px;
}

.legal-document ul,
.legal-document ol {
    display: grid;
    gap: 8px;
    margin: 14px 0 0 22px;
    padding-left: 8px;
}

.legal-document a:not(.btn-primary):not(.btn-outline) {
    color: var(--accent-dark);
    text-underline-offset: 2px;
}

.legal-notice {
    margin-bottom: 35px;
    padding: 15px 17px;
    color: var(--text-mid);
    font-size: 14px;
    line-height: 1.55;
    background: var(--accent-light);
    border: 1px solid #c9dce5;
    border-radius: 8px;
}

.legal-definitions {
    display: grid;
    grid-template-columns: minmax(150px, .35fr) 1fr;
    gap: 12px 24px;
}

.legal-definitions dt {
    font-size: 15px;
    font-weight: 700;
}

.legal-details {
    padding: 20px;
    background: #f7fafb;
    border: 1px solid var(--border);
    border-radius: 8px;
}

.legal-details p + p {
    margin-top: 7px;
}

.legal-action-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px 24px;
    align-items: center;
    margin-top: 22px;
    padding: 20px;
    background: #f7fafb;
    border: 1px solid var(--border);
    border-radius: 10px;
}

.legal-action-card h3 {
    margin: 0 0 5px;
    font-size: 17px;
}

.legal-action-card p {
    font-size: 14px;
    line-height: 1.55;
}

.legal-revoke-button,
.legal-email-button {
    border-radius: 7px;
    font: inherit;
}

.legal-action-card__status {
    grid-column: 1 / -1;
    min-height: 1.55em;
    color: #275c45 !important;
}

/* Списки оферты с нумерацией вида 3.1., 3.2. */
.legal-document .legal-list--numbered {
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: clause;
}

.legal-document .legal-list--numbered > li {
    position: relative;
    margin-bottom: 8px;
    padding-left: 42px;
    counter-increment: clause;
}

.legal-document .legal-list--numbered > li::before {
    position: absolute;
    top: 0;
    left: 0;
    color: var(--text-mid);
    font-weight: 600;
}

#subject .legal-list--numbered > li::before {
    content: "3." counter(clause) ".";
}

#acceptance .legal-list--numbered > li::before {
    content: "4." counter(clause) ".";
}

#financial .legal-list--numbered > li::before {
    content: "5." counter(clause) ".";
}

#provider-rights .legal-list--numbered > li::before {
    content: "6." counter(clause) ".";
}

#user-rights .legal-list--numbered > li::before {
    content: "7." counter(clause) ".";
}

#liability .legal-list--numbered > li::before {
    content: "8." counter(clause) ".";
}

#refund .legal-list--numbered > li::before {
    content: "9." counter(clause) ".";
}

#confidentiality .legal-list--numbered > li::before {
    content: "10." counter(clause) ".";
}

#force-majeure .legal-list--numbered > li::before {
    content: "11." counter(clause) ".";
}

#term .legal-list--numbered > li::before {
    content: "12." counter(clause) ".";
}

#additional .legal-list--numbered > li::before {
    content: "13." counter(clause) ".";
}

/* Планшеты */
@media (max-width: 860px) {
    .legal-layout {
        grid-template-columns: 1fr;
    }

    .legal-sidebar {
        position: static;
    }

    .legal-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: none;
        column-gap: 8px;
    }
}

/* Телефоны */
@media (max-width: 560px) {
    .legal-container {
        width: min(100% - 32px, 1160px);
    }

    .legal-hero {
        padding: 48px 0 40px;
    }

    .legal-layout {
        padding-top: 30px;
        padding-bottom: 48px;
    }

    .legal-document {
        padding: 24px 18px;
    }

    .legal-definitions,
    .legal-action-card,
    .legal-nav {
        grid-template-columns: 1fr;
    }

    .legal-nav {
        padding: 8px;
    }

    .legal-nav a {
        grid-template-columns: 29px minmax(0, 1fr);
        padding: 9px 8px;
    }

    .legal-definitions {
        gap: 4px;
    }

    .legal-definitions dd {
        margin-bottom: 12px;
    }

    .legal-revoke-button,
    .legal-email-button {
        width: 100%;
        text-align: center;
    }

    .legal-hero h1 {
        font-size: clamp(30px, 9vw, 38px);
        overflow-wrap: anywhere;
    }

    .legal-hero__subtitle {
        font-size: 16px;
    }

    .legal-notice {
        margin-bottom: 28px;
        padding: 14px;
    }

    .legal-document section + section {
        margin-top: 30px;
    }

    .legal-document h2 {
        font-size: 21px;
        overflow-wrap: anywhere;
    }

    .legal-document p,
    .legal-document li,
    .legal-document dd {
        font-size: 14px;
        line-height: 1.6;
        overflow-wrap: anywhere;
    }

    .legal-document ul,
    .legal-document ol {
        margin-left: 18px;
        padding-left: 4px;
    }

    .legal-document li ul,
    .legal-document li ol {
        margin-left: 14px;
    }

    .legal-details {
        padding: 16px;
    }

    .legal-document .legal-list--numbered > li {
        padding-left: 38px;
    }
}


#upload-preview.has-image {
    cursor: grab;
    touch-action: none;
}

#upload-preview.has-image.is-dragging {
    cursor: grabbing;
}

.preview-frame img {
    user-select: none;
    -webkit-user-drag: none;
}

/* Управление изображением: компактнее ползунки */
.range-controls {
    display: grid;
    gap: 16px;
}

.range-control {
    display: grid;
    gap: 1px;
}

.range-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.range-control input[type="range"] {
    display: block;
    width: 100%;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
    cursor: pointer;
}

.range-control input[type="range"]::-webkit-slider-thumb {
    width: 14px;
    height: 14px;
}

.range-control input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
}

/* Выбор стиля обработки */
.processing-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    min-width: 0;
    margin-top: 18px;
    border: 0;
}

.processing-mode legend {
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 14px;
    font-weight: 600;
}

.processing-mode__option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.processing-mode__option:has(input:checked) {
    background: var(--accent-light);
    border-color: var(--accent);
}

.processing-mode__option input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: var(--accent);
}

.processing-mode__text {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.processing-mode__text strong {
    color: var(--text-dark);
    font-size: 14px;
    line-height: 1.35;
}

.processing-mode__text small {
    color: var(--text-mid);
    font-size: 12px;
    line-height: 1.4;
}

#upload-preview.has-image {
    cursor: grab;
    touch-action: none;
}

#upload-preview.has-image.is-dragging {
    cursor: grabbing;
}

.preview-frame img {
    user-select: none;
    -webkit-user-drag: none;
}

@media (max-width: 520px) {
    .processing-mode {
        grid-template-columns: 1fr;
    }
}

#thread-fill {
    width: 100%;
}

.string-art-page .range-controls {
    gap: 8px;
}

.string-art-page .range-control {
    gap: 4px;
    padding: 9px 12px;
    border-radius: 8px;
}

.string-art-page .range-label {
    font-size: 13px;
}

.string-art-page .range-control input[type="range"] {
    height: 14px;
}

.string-art-page .range-control input[type="range"]::-webkit-slider-thumb {
    width: 12px;
    height: 12px;
}

.string-art-page .range-control input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
}

.string-art-page .parameters-grid {
    gap: 8px 10px;
}

.string-art-page .number-control {
    gap: 5px;
}

.string-art-page .number-control input {
    min-height: 40px;
    padding: 8px 10px;
}

.string-art-page .processing-mode {
    gap: 8px;
    margin-top: 12px;
}

.string-art-page .processing-mode legend {
    margin-bottom: 6px;
}

.string-art-page .processing-mode__option {
    gap: 7px;
    padding: 8px 10px;
}

.string-art-page .processing-mode__text {
    gap: 1px;
}

.string-art-page .processing-mode__text strong {
    font-size: 13px;
}

.string-art-page .processing-mode__text small {
    font-size: 11px;
    line-height: 1.3;
}
