.profile-builder-hero .banner__row {
    /* На странице могут быть подключены другие варианты .banner (например,
       баннер направлений), где строка ограничивается max-width: 87.1rem.
       Конструктор профиля всегда использует полноширинный главный баннер. */
    width: 100%;
    max-width: none;
    min-height: 67.2rem;
    margin-bottom: 0;
    gap: 0;
    background-color: var(--profile-hero-bg, #0060fd);
}

.profile-builder-hero .banner__column {
    width: 50%;
    min-width: 0;
}

.profile-builder-hero .banner__column:nth-child(1) {
    /* Верхняя метка профиля должна начинаться от верхнего внутреннего
       края баннера. На отдельных шаблонах профилей это свойство
       переопределялось выравниванием по центру. */
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
    height: 67.2rem;
    padding: 4.8rem;
}

.profile-builder-hero .banner__column:nth-child(2) {
    height: 67.2rem;
}

.profile-builder-hero .banner__title {
    color: var(--profile-hero-title, #ffffff);
}

.profile-builder-hero .banner-tag__title {
    color: var(--profile-hero-category-title, #ffffff);
}

.profile-builder-hero .banner-tag {
    position: absolute;
    top: 4.8rem;
    right: 4.8rem;
    left: 4.8rem;
    z-index: 1;
    padding-bottom: 1.2rem;
    border-color: rgba(255, 255, 255, 0.25);
    /* Метка направления должна быть привязана к верхнему краю баннера,
       не влияя на вертикальное центрирование основного контента. */
}

.profile-builder-hero .banner-tag__title {
    margin-bottom: 1.2rem;
}

.profile-builder-hero .banner__info {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    margin-top: 9.6rem;
    justify-content: center;
}

.profile-builder-hero .profile-builder-hero__heading {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.profile-builder-hero .banner__title {
    font-family: Onest, Arial, sans-serif;
    font-weight: 500;
    margin-bottom: 1.6rem !important;
}

.profile-builder-hero .banner__title.title--h1 {
    font-size: 5.6rem;
    line-height: 5.6rem;
    letter-spacing: -0.224rem;
}

.profile-builder-hero .banner__title.title--h2 {
    font-size: 4rem;
    line-height: 4rem;
    letter-spacing: -0.08rem;
}

.profile-builder-hero .profile-builder-hero__subtitle {
    margin: 0;
    color: var(--profile-hero-subtitle, #ffffff);
    font-family: Onest, Arial, sans-serif;
    font-weight: 500;
    font-size: 2.6rem;
    line-height: 3.6rem;
    letter-spacing: 0;
}

.profile-builder-hero .profile-builder-hero__subtitle p {
    margin: 0;
}

/* Визуальный редактор добавляет p/span, но выбранный стиль текстового
   контейнера должен оставаться первичным на фронтенде. */
.profile-builder-content :is(.title, .text-body) :is(p, div, span, em, i, a) {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}

/* Фиксированный блок «Скидка за отличную учёбу». */
.profile-builder-discount-hint .no-gaps-hint {
    border-color: var(--profile-discount-hint-border, #000000);
    background-color: var(--profile-discount-hint-background, #ffffff);
    padding: 3.2rem 4.7rem;
}

.profile-builder-discount-hint .no-gaps-hint__title {
    color: #0060fd;
}

/* Фиксированная сетка блока «Скидка за отличную учёбу».
   Общий .no-gaps-hint рассчитан на другой вариант блока и при широкой
   странице заставляет изображение и правый текст пересекаться. */
@media screen and (min-width: 1000px) {
    .profile-builder-discount-hint .no-gaps-hint {
        display: grid;
        grid-template-columns: minmax(40rem, 50rem) 20rem minmax(28rem, 1fr);
        grid-template-areas: "title image description";
        align-items: center;
        column-gap: 4.5rem;
        padding: 3.2rem 4.7rem;
    }

    .profile-builder-discount-hint .no-gaps-hint__title,
    .profile-builder-discount-hint .no-gaps-hint__img,
    .profile-builder-discount-hint .no-gaps-hint__desc {
        position: static;
        margin: 0;
    }

    .profile-builder-discount-hint .no-gaps-hint__title {
        grid-area: title;
        /* На широкой версии заголовок должен оставаться двухстрочным:
           «За отличную учёбу —» / «отличные скидки». */
        font-size: 5.2rem;
        line-height: 5.2rem;
    }

    .profile-builder-discount-hint .no-gaps-hint__img {
        grid-area: image;
        width: 20rem;
        height: 20rem;
    }

    .profile-builder-discount-hint .no-gaps-hint__img img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .profile-builder-discount-hint .no-gaps-hint__desc {
        grid-area: description;
        padding: 0;
        white-space: nowrap;
    }

    .profile-builder-discount-hint .no-gaps-hint__desc > span {
        position: static;
        display: inline-block;
        margin-left: 1.2rem;
        transform: rotate(-2deg);
    }
}

/* Блок «О специальности» использует оригинальную вёрстку профилей. */
.profile-builder-specialty .about-specialty-slider-item {
    background: var(--profile-specialty-background, #c13ce3);
}

.profile-builder-specialty .about-specialty-slider-item__title,
.profile-builder-specialty .about-specialty-slider-item__desc > .text-body,
.profile-builder-specialty .about-specialty-slider-item__desc ul > li > .text-body {
    color: var(--profile-specialty-text-color, #ffffff) !important;
}

/*
 * В шаблоне профиля редактор выводит текст сразу в <p>, а в конструкторе
 * TinyMCE добавляет <p> внутрь .text-body. Без этого правила вложенный тег
 * получает браузерные 400 / 20px / 20px и собственные отступы. Приводим
 * оба варианта разметки к оригинальному блоку «О специальности».
 */
.profile-builder-specialty .about-specialty-slider-item__title {
    margin-bottom: 4.8rem;
}

/* Slightly stronger inactive tab outline without changing the global tab style. */
.profile-builder-specialty .about-specialty-tab__item:not(:hover) {
    border-color: #d1d1d1;
}

.profile-builder-specialty .about-specialty-slider-item__desc > .text-body,
.profile-builder-specialty .about-specialty-slider-item__desc > .text-body > p,
.profile-builder-specialty .about-specialty-slider-item__desc ul > li > .text-body,
.profile-builder-specialty .about-specialty-slider-item__desc ul > li > .text-body > p,
.profile-builder-specialty .about-specialty-slider-item__more {
    margin: 0;
    color: var(--profile-specialty-text-color, #ffffff) !important;
}

/* Маркеры списков используют mask и получают цвет через background. */
.profile-builder-specialty .about-specialty-slider-item__desc ul > li::before,
.profile-builder-specialty .about-specialty-slider-item__hint > div > ul > li::before {
    background: var(--profile-specialty-text-color, #ffffff) !important;
}

.profile-builder-specialty .about-specialty-slider-item__hint .text-body,
.profile-builder-specialty .about-specialty-slider-item__hint .text-body > p,
.profile-builder-specialty .about-specialty-slider-item__hint ul > li > .text-body,
.profile-builder-specialty .about-specialty-slider-item__hint ul > li > .text-body > p {
    margin: 0;
    color: #ffffff !important;
}

/* Не даём тегам из визуального редактора сбрасывать выбранный стиль списка. */
.profile-builder-specialty .text-body :is(p, span, strong, em, b, i, a) {
    font-family: inherit !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    letter-spacing: inherit !important;
}

.profile-builder-specialty .about-specialty-slider-item__desc ul > li::before {
    background: var(--profile-specialty-check-color, rgba(255, 255, 255, .7)) !important;
}

.profile-builder-specialty .about-specialty-slider-item__desc ul > li,
.profile-builder-specialty .about-specialty-slider-item__hint ul > li {
    gap: .8rem;
    margin-bottom: 1.6rem;
}

.profile-builder-specialty .about-specialty-slider-item__desc ul > li:last-child,
.profile-builder-specialty .about-specialty-slider-item__hint ul > li:last-child {
    margin-bottom: 0;
}

.profile-builder-specialty .about-specialty-slider-item__desc ul > li > .text-body,
.profile-builder-specialty .about-specialty-slider-item__hint ul > li > .text-body {
    margin: 0;
}

.profile-builder-specialty .about-specialty-slider-item__desc ul > li > .text-body > p,
.profile-builder-specialty .about-specialty-slider-item__hint ul > li > .text-body > p {
    margin: 0;
}

.profile-builder-specialty .about-specialty-slider-item__hint .text-body,
.profile-builder-specialty .about-specialty-slider-item__hint .text-body p,
.profile-builder-specialty .about-specialty-slider-item__hint ul > li > .text-body {
    color: #ffffff;
}

.profile-builder-specialty .about-specialty-slider-item__hint > div > .text-body,
.profile-builder-specialty .about-specialty-slider-item__hint > div > .text-body > p {
    margin: 0;
}

.profile-builder-specialty .about-specialty-tab[data-slide="4"] .about-specialty-tab__item:nth-child(5),
.profile-builder-specialty .about-specialty-tab[data-slide="5"] .about-specialty-tab__item:nth-child(6),
.profile-builder-specialty .about-specialty-tab[data-slide="6"] .about-specialty-tab__item:nth-child(7),
.profile-builder-specialty .about-specialty-tab[data-slide="7"] .about-specialty-tab__item:nth-child(8) {
    background: #000;
    border-color: #000;
    color: #fff;
}

.about-specialty-modal--appear .about-specialty-modal__wrapper {
    background: #0060fd;
}

.about-specialty-modal__list > li {
    align-items: flex-start;
    gap: .8rem;
    margin-bottom: 1.6rem;
}

.about-specialty-modal__list > li:last-child {
    margin-bottom: 0;
}

.about-specialty-modal__list > li::before {
    margin-top: .1rem;
}

.about-specialty-modal__list > li,
.about-specialty-modal__list > li p {
    color: #ffffff;
}

.about-specialty-modal__list > li p {
    margin: 0;
}

.profile-builder-paid-profession .paid-profession__row {
    flex-wrap: wrap;
}

/* В шаблонах профиля между общим заголовком секции и карточками 4.8rem. */
.profile-builder-paid-profession .paid-profession__title {
    margin-bottom: 4.8rem;
}

/* Override the legacy generic card border loaded later on some profile pages. */
.profile-builder-paid-profession .paid-profession-item {
    border-color: #d1d1d1;
}

/* Международное приложение к диплому. */
.profile-builder-diploma-supplement__row {
    display: flex;
    gap: 0;
    border-radius: 1.6rem;
    background: var(--profile-diploma-supplement-background, #0060fd);
    overflow: hidden;
}

.profile-builder-diploma-supplement__column {
    width: calc((100% - 2.4rem) / 2);
}

.profile-builder-diploma-supplement__column--left {
    padding: 4.8rem 8rem 4.8rem 4.8rem;
    color: #fff !important;
}

.profile-builder-diploma-supplement__column--right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4.7rem 0 4.7rem 4.7rem;
    width: calc(50% - 2.4rem);
    margin-right: 2.4rem;
    color: #000;
    background: #fff;
    border: .1rem solid #ebebeb;
    border-radius: 1.6rem;
}

.profile-builder-diploma-supplement__title {
    margin: 0 0 2.4rem !important;
    color: #fff !important;
}

.profile-builder-diploma-supplement__left-text,
.profile-builder-diploma-supplement__left-text :is(p, span, strong, em, b, i, a) {
    color: #fff !important;
    font-weight: 500;
}

.profile-builder-diploma-supplement__left-text p,
.profile-builder-diploma-supplement__right-top p,
.profile-builder-diploma-supplement__right-bottom p {
    margin: 0;
}

.profile-builder-diploma-supplement__texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 6.2rem;
    max-width: 55%;
}

.profile-builder-diploma-supplement__right-top {
    font-weight: 600 !important;
}

.profile-builder-diploma-supplement__right-top,
.profile-builder-diploma-supplement__right-top :is(p, span, strong, em, b, i, a),
.profile-builder-diploma-supplement__right-bottom,
.profile-builder-diploma-supplement__right-bottom :is(p, span, strong, em, b, i, a) {
    color: inherit;
}

.profile-builder-diploma-supplement__right-top :is(p, span, strong, em, b, i, a) {
    font-weight: 600 !important;
}

.profile-builder-diploma-supplement__image {
    width: 25rem;
    max-height: 31.2rem;
    margin-right: 0;
    object-fit: contain;
    object-position: center;
}

@media screen and (min-width: 569px) {
    .profile-builder-paid-profession .paid-profession-item {
        width: calc((100% - 2.4rem) / 2);
    }
}

@media screen and (max-width: 568px) {
    .profile-builder-diploma-supplement__row {
        flex-wrap: wrap;
        gap: 0;
    }

    .profile-builder-diploma-supplement__column {
        width: 100%;
    }

    .profile-builder-diploma-supplement__column--left {
        padding: 2.4rem;
    }

    .profile-builder-diploma-supplement__column--right {
        position: relative;
        min-height: 29rem;
        padding: 2.3rem;
        width: 100%;
        margin-right: 0;
    }

    .profile-builder-diploma-supplement__texts {
        max-width: 60%;
        gap: 3.2rem;
    }

    .profile-builder-diploma-supplement__image {
        position: absolute;
        right: 0;
        bottom: 2.4rem;
        width: 14rem;
        max-height: 20rem;
        margin-right: 0;
    }
}

/* Контакты в обязательной нижней части профильного конструктора. */
.profile-builder-content .contacts-small-top-item__actions {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 2.4rem;
}

.profile-builder-content .contacts-small-top-item__email {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: #000;
    white-space: nowrap;
}

.profile-builder-content .contacts-small-top-item__email:hover {
    color: #00cd7a;
}

.profile-builder-content .contacts-small-top-item__email-icon {
    width: 2.4rem;
    height: 2.4rem;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

@media screen and (max-width: 568px) {
    .profile-builder-content .contacts-small-top-item__actions {
        gap: 1.6rem;
    }

    .profile-builder-content .contacts-small-top-item__email-icon {
        width: 2rem;
        height: 2rem;
    }
}

/* В редакторе можно добавить <br class="profile-builder-desktop-break">. */
@media screen and (max-width: 568px) {
    .profile-builder-hero .profile-builder-desktop-break {
        display: none;
    }
}

.profile-builder-hero .profile-builder-hero__button {
    background: var(--profile-hero-button-bg) !important;
    color: var(--profile-hero-button-text) !important;
}

.profile-builder-hero .profile-builder-hero__button .btn__icon {
    background: var(--profile-hero-button-text) !important;
}

.profile-builder-hero .profile-builder-hero__button:hover {
    background: var(--profile-hero-button-hover-bg) !important;
    color: var(--profile-hero-button-hover-text) !important;
}

.profile-builder-hero .profile-builder-hero__button:hover .btn__icon {
    background: var(--profile-hero-button-hover-text) !important;
}

.profile-builder-hero .banner__column:nth-child(2) img {
    object-fit: cover;
}

/* Карточки Telegram и ВКонтакте заполняют вторую колонку при нечётном числе профилей. */
.profile-builder-content .profiles-item--contact-filler {
    width: calc((100% - 2.4rem) / 2);
    height: 44rem;
    min-height: 44rem;
    padding: 0;
    gap: 2.4rem;
    background: transparent;
    border: 0;
    border-radius: 0;
}

.profile-builder-content .profiles-item--contact-filler .profiles-item__contact-card {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    flex: 1 1 0;
    padding: 2.3rem;
    background: #fff;
}

.profile-builder-content .profiles-item--contact-filler .btn-big__icon {
    display: inline-block;
    background-color: #000;
}

.profile-builder-content .profiles-item--contact-filler .btn-big__link {
    display: inline-flex;
    align-items: center;
    gap: 1.2rem;
    color: #000;
}

.profile-builder-content .profiles-item--contact-filler .btn-big__link .link__icon {
    display: inline-block;
    width: 2.4rem;
    height: 2.4rem;
    flex: 0 0 2.4rem;
    background-color: currentColor;
}

@media screen and (max-width: 568px) {
    .profile-builder-hero .banner__row {
        /* На страницах направлений общий мобильный стиль скрывает
           .banner__row. Баннер конструктора использует этот же базовый
           класс, поэтому явно возвращаем его в поток. */
        display: flex !important;
        flex-wrap: wrap;
        align-items: stretch;
        gap: 0;
        min-height: 0;
    }

    .profile-builder-hero {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    .profile-builder-hero .banner__column {
        width: 100%;
    }

    .profile-builder-hero .banner__column:nth-child(1) {
        display: flex;
        flex-direction: column;
        height: auto;
        padding: 2.4rem;
    }

    .profile-builder-hero .banner__column:nth-child(2) {
        height: 33.6rem;
    }

    .profile-builder-hero .banner__info {
        flex: none;
        min-height: auto;
        margin-top: 0;
    }

    .profile-builder-hero .banner-tag {
        position: static;
    }


    .profile-builder-hero .banner__title.title--h1 {
        font-size: 3.2rem;
        line-height: 3.6rem;
        letter-spacing: -0.128rem;
    }

    .profile-builder-hero .banner__title.title--h2 {
        font-size: 2.4rem;
        line-height: 2.8rem;
        letter-spacing: -0.048rem;
    }

    .profile-builder-hero .profile-builder-hero__subtitle {
        font-size: 1.8rem;
        line-height: 2.4rem;
    }

    /* На телефоне тексту в карточке скидки не нужен десктопный padding 4.7rem. */
    .profile-builder-discount-hint .no-gaps-hint {
        padding-right: 2.4rem;
        padding-left: 2.4rem;
    }

    /* The tabs remain visibly scrollable on narrow screens instead of a long
       first label hiding all the following slides. */
    .profile-builder-specialty .about-specialty-tab__wrapper {
        display: flex;
        gap: .8rem;
        padding: 0;
        margin: 0;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-behavior: smooth;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .profile-builder-specialty .about-specialty-tab__wrapper::-webkit-scrollbar {
        display: none;
    }

    .profile-builder-specialty .about-specialty-tab__item {
        display: flex;
        flex: 0 0 70vw;
        align-items: center;
        justify-content: center;
        width: 70vw;
        min-width: 0;
        max-width: 70vw;
        white-space: normal;
        overflow-wrap: anywhere;
        line-height: 1.2;
        scroll-snap-align: start;
    }

    .profiles-item--contact-filler {
        width: 100%;
        height: auto;
        min-height: 0;
        flex-direction: column;
        gap: 1.6rem !important;
    }

    .profiles-item--contact-filler .profiles-item__contact-card {
        width: 100%;
        flex: none !important;
        min-height: 12.4rem;
    }
}
