.code-freshness {
    padding-top: 32px;
}

.code-freshness__line {
    padding: 20px 24px;
    border: 1px solid var(--darkFiolet);
    border-radius: 16px;
    background: var(--lightBlue);
    font-size: 16px;
    line-height: 1.6;
}

.code-freshness__name {
    font-weight: 600;
}

.code-freshness__detail {
    display: inline-block;
}

.code-freshness__detail::before {
    content: "·";
    margin: 0 10px;
}

.code-guide {
    padding: 72px 0;
    background: var(--lightBlue);
    font-size: 18px;
    line-height: 1.6;
}

.code-guide .h2 {
    margin: 0 0 24px;
}

.code-guide p + p,
.code-guide__table-wrap + p {
    margin-top: 20px;
}

.code-guide__section + .code-guide__section {
    margin-top: 56px;
    padding-top: 48px;
    border-top: 1px solid var(--darkFiolet);
}

.code-guide__steps,
.code-guide__risks {
    margin: 24px 0;
    padding-left: 28px;
}

.code-guide__steps {
    list-style: decimal;
}

.code-guide__risks {
    list-style: disc;
}

.code-guide__steps li,
.code-guide__risks li {
    padding-left: 8px;
}

.code-guide__steps li + li,
.code-guide__risks li + li {
    margin-top: 16px;
}

.code-guide strong {
    font-weight: 600;
}

.code-guide a {
    color: var(--green);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.code-guide a:hover {
    color: #fff;
}

.code-guide a:focus-visible,
.code-guide__table-wrap:focus-visible {
    outline: 2px solid var(--green) !important;
    outline-offset: 4px;
}

.code-guide__table-wrap {
    margin-top: 24px;
    overflow-x: auto;
    border: 1px solid var(--darkFiolet);
    border-radius: 16px;
}

.code-guide__table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
    text-align: left;
    font-size: 17px;
}

.code-guide__table caption {
    padding: 20px;
    background: var(--darkBlue);
    text-align: left;
    font-weight: 600;
}

.code-guide__table th,
.code-guide__table td {
    padding: 16px 20px;
    border-top: 1px solid var(--darkFiolet);
    vertical-align: top;
}

.code-guide__table thead th {
    background: var(--darkBlue);
    font-weight: 600;
}

.code-guide__table tbody th {
    font-weight: 400;
}

.code-guide__table--rates td:last-child {
    white-space: nowrap;
    font-weight: 600;
}

.code-guide__code {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.code-guide .code-guide__note {
    font-size: 16px;
}

@media (max-width: 767px) {
    .code-freshness__line {
        padding: 16px;
        font-size: 14px;
    }

    .code-freshness__detail {
        display: block;
        margin-top: 4px;
    }

    .code-freshness__detail::before {
        content: none;
    }

    .code-guide {
        padding: 40px 0;
        font-size: 16px;
    }

    .code-guide__section + .code-guide__section {
        margin-top: 36px;
        padding-top: 32px;
    }

    .code-guide__table {
        font-size: 15px;
    }

    .code-guide__table caption,
    .code-guide__table th,
    .code-guide__table td {
        padding: 12px 16px;
    }
}

/* Страница сервиса: карточки и последовательность разделов из макета. */
.code-page .main--sections {
    padding: 120px 0;
}
.code-page .main__content {
    gap: 60px;
    align-items: center;
}
.code-page .main__content-img {
    width: 428px;
    height: 400px;
    max-width: 428px;
    flex: 0 0 428px;
    order: 1;
}
.code-page .main__content-img-item {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: contain;
}
.code-page .main__content-text {
    max-width: 652px;
    order: 0;
}
.code-page .main__content-text > p,
.code-page .main__content-text > h1 {
    max-width: 520px;
}
.code-page .code-definition-trial {
    margin-top: 40px;
}
.code-page .code-freshness {
    padding: 0 0 40px;
}
.code-section {
    padding: 60px 0;
}
.code-section .h2 {
    margin-bottom: 40px;
}
.code-section--benefits {
    padding-top: 0;
}
.code-benefits {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px;
}
.code-benefits__card {
    display: flex;
    gap: 24px;
    padding: 36px 24px 40px;
    border-radius: 32px;
    background: var(--lightBlue);
    font-size: 16px;
    line-height: 1.52;
}
.code-benefits__card > img {
    flex: 0 0 54px;
    align-self: flex-start;
}
.code-benefits__card h3 {
    margin-bottom: 24px;
    color: var(--green);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.56;
}
.code-page > .code-guide {
    padding: 60px 0;
    background: var(--darkBlue);
    line-height: 1.36;
}
.code-section--planning {
    padding: 120px 0 60px;
    background: var(--lightBlue);
}
.code-planning {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 32px;
    align-items: start;
}
.code-planning > h2 {
    padding-top: 36px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
}
.code-planning__card {
    padding: 36px 36px 40px;
    border: 1px solid var(--darkFiolet);
    border-radius: 32px;
    background: var(--darkBlue);
    align-self: stretch;
    font-size: 16px;
    line-height: 1.52;
}
.code-planning__card h3 {
    margin-bottom: 24px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}
.code-page > .code-guide--details {
    padding: 120px 0 60px;
}
.code-page .code-guide__section + .code-guide__section {
    padding-top: 60px;
    margin-top: 60px;
    border-top: 0;
}
.code-algorithm__heading {
    display: flex;
    gap: 32px;
    justify-content: space-between;
    align-items: flex-start;
}
.code-algorithm__heading > div:first-child {
    flex: 1;
}
.code-algorithm__heading .h2 {
    margin-bottom: 40px;
}
.code-algorithm__controls {
    display: flex;
    gap: 16px;
}
.code-algorithm__controls button {
    display: flex;
    border: 0;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}
.code-algorithm__controls button:disabled {
    opacity: .4;
    cursor: default;
}
.code-steps {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    margin: 60px 0;
    padding: 0 0 8px;
    list-style: none;
}
.code-steps::-webkit-scrollbar {
    display: none;
}
.code-steps__card {
    flex: 0 0 min(1140px, calc(100% - 76px));
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 480fr) minmax(0, 512fr);
    gap: 20px;
    align-items: start;
    padding: 64px;
    border-radius: 36px;
    background: var(--lightBlue);
    scroll-snap-align: start;
}
.code-steps__number {
    display: block;
    margin-bottom: 16px;
    color: var(--green);
    font-size: 40px;
    font-weight: 600;
    line-height: 1.3;
}
.code-steps__text h3 {
    margin-bottom: 16px;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.3;
}
.code-steps__text p {
    font-size: 16px;
    line-height: 1.52;
}
.code-steps__preview {
    display: block;
    min-width: 0;
    border-radius: 32px;
    cursor: zoom-in;
}
.code-shot {
    display: block;
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 32px;
}
.code-shot img {
    display: block;
    width: 100%;
    height: auto;
}
.code-shot__mask {
    position: absolute;
    background: #1c1c33;
    pointer-events: none;
}
.code-shot__mask--header {
    left: 28.125%;
    top: 3.067%;
    width: 84.961%;
    height: 7.669%;
}
.code-shot__mask--address {
    left: .391%;
    top: -2.454%;
    width: 100.195%;
    height: 7.055%;
}
.code-steps__zoom-label {
    display: block;
    margin-top: 12px;
    font-size: 14px;
    text-align: center;
}
.code-page .code-steps__preview {
    text-decoration: none;
}
.code-results,
.code-risks {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px;
    margin-top: 40px;
}
.code-risks {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    margin-bottom: 40px;
}
.code-results__card {
    padding: 36px 36px 40px;
    border: 1px solid var(--darkFiolet);
    border-radius: 32px;
    background: var(--lightBlue);
    font-size: 16px;
    line-height: 1.52;
}
.code-results__heading {
    display: flex;
    gap: 16px;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
}
.code-results__heading h3 {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}
.code-results__heading > span {
    color: var(--green);
    font-size: 40px;
    font-weight: 600;
    line-height: 1;
}
.code-results__card ul {
    padding-left: 24px;
    list-style: disc;
}
.code-results__more summary {
    margin-top: 24px;
    color: var(--gray);
    cursor: pointer;
}
.code-results__more summary span:last-child,
.code-results__more[open] summary span:first-child {
    display: none;
}
.code-results__more[open] summary span:last-child {
    display: inline;
}
.code-results__more ul {
    margin-top: 16px;
}
.code-trial {
    padding: 60px 0;
}
.code-trial > .container {
    margin: 0;
    max-width: none;
    padding-bottom: 0;
}
.code-page .code-trial .block-step__button {
    color: #fff;
    text-decoration: none;
}
.code-page .code-guide__table-wrap {
    margin-top: 40px;
    border-radius: 0;
    border: 0;
}
.code-page .code-guide__table {
    font-size: 16px;
    line-height: 1.52;
}
.code-page .code-guide__table caption {
    background: var(--lightBlue);
    font-size: 18px;
    font-weight: 400;
}
.code-page .code-guide__table thead th {
    background: var(--lightBlue);
}
.code-page .code-guide__table th,
.code-page .code-guide__table td {
    padding: 24px 20px;
}
.code-page .code-guide__table tr:last-child > * {
    border-bottom: 1px solid var(--darkFiolet);
}
.code-page .work-step--code-definition {
    padding: 60px 0;
    background: var(--lightBlue);
}
.code-page button:focus-visible,
.code-page summary:focus-visible,
.code-steps:focus-visible,
.code-step-viewer__viewport:focus-visible {
    outline: 2px solid var(--green) !important;
    outline-offset: 4px;
}

/* В просмотрщике используется исходник, без растягивания миниатюры. */
html.code-step-viewer-open {
    overflow: hidden;
}
.code-step-viewer {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(1440px, calc(100vw - 32px));
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px);
    padding: 20px;
    border: 1px solid var(--darkFiolet);
    border-radius: 20px;
    color: #fff;
    background: var(--lightBlue);
}
.code-step-viewer[open] {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.code-step-viewer::backdrop {
    background: rgba(0, 0, 0, .8);
}
.code-step-viewer__header {
    display: flex;
    gap: 16px;
    align-items: center;
}
.code-step-viewer__header h2 {
    flex: 1;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
}
.code-step-viewer__header button {
    flex-shrink: 0;
    padding: 10px 16px;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: var(--darkFiolet);
    cursor: pointer;
}
.code-step-viewer__header .code-step-viewer__close {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 32px;
    line-height: 1;
}
.code-step-viewer > p {
    font-size: 14px;
    color: var(--gray);
}
.code-step-viewer__viewport {
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    border-radius: 8px;
}
.code-shot--full {
    width: 2430px;
    max-width: none;
    border-radius: 0;
}
.code-shot--full.is-fit {
    width: 100%;
}

@media (max-width: 1024px) {
    .code-page .main__content-img {
        flex-basis: auto;
    }
}

@media (max-width: 1023px) {
    .code-benefits {
        grid-template-columns: minmax(0, 1fr);
    }
    .code-planning {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .code-planning > h2 {
        grid-column: 1 / -1;
        padding-top: 0;
    }
    .code-results {
        grid-template-columns: minmax(0, 1fr);
    }
    .code-steps__card {
        grid-template-columns: minmax(0, 1fr);
        flex-basis: calc(100% - 40px);
        padding: 40px;
        gap: 32px;
    }
}

@media (max-width: 767px) {
    .code-page .main--sections {
        padding: 40px 0;
    }
    .code-page .main__content {
        gap: 32px;
    }
    .code-page .main__content-img {
        width: min(100%, 320px);
        height: auto;
        flex-basis: auto;
    }
    .code-page .main__content-img-item {
        height: auto;
    }
    .code-section,
    .code-section--planning,
    .code-page > .code-guide,
    .code-page > .code-guide--details {
        padding: 40px 0;
    }
    .code-section--benefits {
        padding-top: 0;
    }
    .code-benefits,
    .code-planning,
    .code-risks {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
    }
    .code-benefits__card,
    .code-planning__card,
    .code-results__card {
        padding: 24px;
        border-radius: 24px;
    }
    .code-algorithm__heading {
        flex-direction: column;
        gap: 24px;
    }
    .code-algorithm__heading .h2 {
        margin-bottom: 24px;
    }
    .code-steps {
        margin: 32px 0;
    }
    .code-steps__card {
        padding: 24px;
        flex-basis: calc(100% - 20px);
        border-radius: 24px;
    }
    .code-steps__text h3 {
        font-size: 24px;
    }
    .code-steps__number {
        font-size: 32px;
    }
    .code-shot,
    .code-steps__preview {
        border-radius: 16px;
    }
    .code-page .code-guide__section + .code-guide__section {
        padding-top: 40px;
        margin-top: 40px;
    }
    .code-page .code-guide__table th,
    .code-page .code-guide__table td {
        padding: 16px;
    }
    .code-step-viewer {
        padding: 16px;
    }
    .code-step-viewer__header {
        flex-wrap: wrap;
        gap: 12px;
    }
    .code-step-viewer__header h2 {
        flex-basis: calc(100% - 52px);
        font-size: 20px;
        order: 0;
    }
    .code-step-viewer__close {
        order: 1;
    }
    .code-step-viewer__fit {
        order: 2;
    }
    .code-page .block-form-faq {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    .code-page .block-application__form-input-container {
        min-width: 0;
        width: 100%;
    }
}
