.ajax-modal-widget-modal.bbh-modal {
    z-index: 2200;
}

.ajax-modal-widget-modal.show,
.ajax-modal-widget-modal.in,
.ajax-modal-widget-modal.ajax-modal-widget-modal_is-closing {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
}

.ajax-modal-widget-modal.show .modal-dialog,
.ajax-modal-widget-modal.in .modal-dialog,
.ajax-modal-widget-modal.ajax-modal-widget-modal_is-closing .modal-dialog {
    transform: none !important;
}

.ajax-modal-widget-modal .modal-dialog {
    width: calc(100vw - 48px);
    max-width: 1040px;
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 48px);
    margin: 4vh auto;
}

.ajax-modal-widget-modal__content {
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    max-height: calc(100dvh - 48px);
    border: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 16px 45px rgba(47, 51, 56, .22);
}

.ajax-modal-widget-modal__header {
    position: relative;
    border-bottom: 1px solid #d8dfe2;
    background: #fff;
}

.ajax-modal-widget-modal__header-main {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 12px 62px 12px 24px;
}

.ajax-modal-widget-modal__heading {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ajax-modal-widget-modal__title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    color: #2f3338;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none !important;
}

.ajax-modal-widget-modal__subtitle {
    display: none;
    margin-top: 4px;
    color: #7a8493;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
}

.ajax-modal-widget-modal__back-slot {
    display: none;
    flex: 0 0 auto;
    margin-right: 14px;
}

.ajax-modal-widget-modal__back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #f56363;
    border-radius: 8px;
    background: #f56363;
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    padding: 0;
}

.ajax-modal-widget-modal__back-button:hover,
.ajax-modal-widget-modal__back-button:focus {
    background: #fff;
    color: #f56363;
    box-shadow: 0 0 0 3px rgba(245, 99, 99, .14);
    outline: none;
}

.ajax-modal-widget-modal__back-button > span {
    display: block;
    width: 16px;
    height: 16px;
    font-size: 0;
    line-height: 0;
    transform: none;
    background: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 8H3M7 4L3 8L7 12' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
}

.ajax-modal-widget-modal__back-button:hover > span,
.ajax-modal-widget-modal__back-button:focus > span {
    background-image: url("data:image/svg+xml,%3Csvg width='16' height='16' viewBox='0 0 16 16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M13 8H3M7 4L3 8L7 12' stroke='%23f56363' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.ajax-modal-widget-modal__close {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 24px;
    height: 24px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 1;
    padding: 0;
}

.ajax-modal-widget-modal__close::before,
.ajax-modal-widget-modal__close::after {
    content: "";
    position: absolute;
    top: 11px;
    left: 2px;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: #1f2937;
}

/* Legacy competitor editor: use the same header contract as AJAX modals. */
#edit_object .edit-object-modal__header {
    position: relative;
    border-bottom: 1px solid #d8dfe2;
    background: #fff;
}

#edit_object .edit-object-modal__header-main {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 72px;
    padding: 12px 62px 12px 24px;
}

#edit_object .edit-object-modal__title {
    margin: 0;
    color: #2f3338;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: 0;
    text-transform: none !important;
}

#edit_object .edit-object-modal__close {
    position: absolute;
    top: 50%;
    right: 16px;
    width: 24px;
    height: 24px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 1;
    padding: 0;
}

#edit_object .edit-object-modal__close::before,
#edit_object .edit-object-modal__close::after {
    content: "";
    position: absolute;
    top: 11px;
    left: 2px;
    width: 20px;
    height: 2px;
    border-radius: 1px;
    background: #1f2937;
}

#edit_object .edit-object-modal__close::before {
    transform: rotate(45deg);
}

#edit_object .edit-object-modal__close::after {
    transform: rotate(-45deg);
}

.ajax-modal-widget-modal__close::before {
    transform: rotate(45deg);
}

.ajax-modal-widget-modal__close::after {
    transform: rotate(-45deg);
}

.ajax-modal-widget-modal__body {
    display: block;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    max-height: none;
    background: #fff;
    overflow: hidden;
}

.ajax-modal-widget-modal__scroll {
    width: 100%;
    height: 100%;
    max-height: inherit;
    box-sizing: border-box;
    overflow: auto;
    padding: 26px 32px 42px;
}

.repair-examples {
    position: relative;
}

.repair-examples_grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.repair-examples__card {
    box-sizing: border-box;
    min-width: 0;
    border: 1px solid #dfe3e6;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.repair-examples_grid .repair-examples__card {
    display: flex;
    align-items: center;
    min-height: 92px;
    padding: 8px 10px 8px 16px;
    gap: 12px;
}

.repair-examples_grid .repair-examples__image {
    margin-left: auto;
}

.repair-info-question,
.repair-info-question-mobile {
    display: inline-flex;
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
    vertical-align: text-top;
}

.competitors-list .table td .repair-info-question > img,
.competitors-list .table td .repair-info-question-mobile > img {
    display: block;
    width: 17px !important;
    min-width: 17px !important;
    max-width: 17px !important;
    height: 17px !important;
    min-height: 17px !important;
    max-height: 17px !important;
}

.repair-examples__card-content {
    min-width: 0;
}

.repair-examples__name,
.repair-examples__score {
    margin: 0;
}

.repair-examples__name {
    color: #2f3338;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.28;
}

.repair-examples__score {
    margin-top: 7px;
    color: #9d3c3c;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.repair-examples__image {
    display: block;
    width: 82px;
    height: 82px;
    flex: 0 0 82px;
    border-radius: 8px;
    object-fit: cover;
}

.repair-examples_slider {
    padding: 0 34px;
}

.repair-examples_slider .repair-examples__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 310px;
}

.repair-examples_slider .repair-examples__image {
    display: block;
    width: 100%;
    height: 128px;
    flex: 0 0 128px;
    border-radius: 0;
    object-fit: cover;
    object-position: center;
}

.repair-examples_slider .repair-examples__card-content {
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
    padding: 10px 10px 12px;
}

.repair-examples_slider .repair-examples__score {
    flex: 0 0 auto;
    margin: 7px 10px 12px;
}

#house_info_button.house_info_button_active,
#house_info_button.house_info_button_active span {
    color: #fff !important;
}

.repair-examples_slider .swiper-slide {
    display: flex;
    height: auto;
}

.repair-examples__nav {
    position: absolute;
    top: 50%;
    width: 28px;
    height: 36px;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 0;
}

.repair-examples__nav::before {
    content: "";
    position: absolute;
    top: 10px;
    width: 12px;
    height: 12px;
    border-top: 2px solid #4e4e4e;
    border-right: 2px solid #4e4e4e;
}

.repair-examples__nav_prev {
    left: 0;
}

.repair-examples__nav_prev::before {
    left: 9px;
    transform: rotate(-135deg);
}

.repair-examples__nav_next {
    right: 0;
}

.repair-examples__nav_next::before {
    right: 9px;
    transform: rotate(45deg);
}

.repair-examples__nav.swiper-button-disabled {
    cursor: default;
    opacity: .35;
}

.ajax-modal-widget-modal__content-area {
    display: block;
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    color: #4e4e4e;
    font-size: 15px;
    line-height: 1.55;
}

.ajax-modal-widget-modal__content-area p {
    margin: 0 0 12px;
}

.ajax-modal-widget-modal__message {
    color: #9a9a9a;
}

.ajax-modal-widget-modal__table-scroll {
    width: 100%;
    overflow-x: auto;
}

.ajax-modal-widget-modal__table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    color: #4e4e4e;
    font-size: 14px;
    line-height: 1.4;
}

.ajax-modal-widget-modal__table th,
.ajax-modal-widget-modal__table td {
    border: 1px solid #d8dfe2;
    padding: 8px 10px;
    text-align: left;
    vertical-align: top;
}

.ajax-modal-widget-modal__table th {
    background: #f5f5f5;
    color: #2f3338;
    font-weight: 700;
}

.ajax-modal-widget-modal__table a {
    color: #e83c3c;
    text-decoration: underline;
}

.ajax-modal-widget-modal__table a:hover,
.ajax-modal-widget-modal__table a:focus {
    text-decoration: none;
}

/* The evaluated-object history keeps its original compact legacy layout. */
#evaluation_history_modal .modal-dialog {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 48px) !important;
}

#evaluation_history_modal .ajax-modal-widget-modal__content {
    display: block !important;
    position: relative !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 48px) !important;
}

#evaluation_history_modal .ajax-modal-widget-modal__body {
    display: block !important;
    flex: none !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 48px);
}

#evaluation_history_modal .ajax-modal-widget-modal__scroll {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 48px);
    overflow: auto;
    padding: 20px 24px 16px;
}

#evaluation_history_modal .evaluation-history-modal__facts p {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.5;
}

#evaluation_history_modal .evaluation-history-modal > p {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.5;
}

#evaluation_history_modal .evaluation-history-modal__price {
    display: flex;
    align-items: center;
}

#evaluation_history_modal .evaluation-history-modal__price-trigger {
    display: inline-block;
    width: 12px;
    height: 12px;
    margin: auto 3px auto 10px;
    padding: 0;
    border: 0;
    background: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect x='0.5' y='0.5' width='11' height='11' rx='0.5' stroke='%23F56363'/%3E%3Cpath d='M3 5.57141V8.99998' stroke='%23F56363' stroke-linecap='round'/%3E%3Cpath d='M9 4.71423L9 8.99995' stroke='%23F56363' stroke-linecap='round'/%3E%3Cpath d='M6 3L6 9' stroke='%23F56363' stroke-linecap='round'/%3E%3C/svg%3E%0A") center / contain no-repeat;
    cursor: pointer;
    vertical-align: middle;
}

#evaluation_history_modal .evaluation-history-modal__price-trigger:focus-visible {
    outline: 2px solid #f56363;
    outline-offset: 2px;
}

#evaluation_history_modal .evaluation-history-modal__feature-link {
    margin-top: 10px;
    line-height: 20px;
}

#evaluation_history_modal .evaluation-history-modal__feature-link .evaluation-history-modal__link {
    color: #8a8a8a;
    font-size: 14px;
    line-height: 20px;
}

/* Parameter-change history keeps the compact legacy modal presentation. */
#evaluation_feature_history_modal .modal-dialog {
    height: auto !important;
    max-height: calc(100dvh - 48px) !important;
}

#evaluation_feature_history_modal .ajax-modal-widget-modal__content {
    height: auto !important;
    max-height: calc(100dvh - 48px) !important;
}

#evaluation_feature_history_modal .ajax-modal-widget-modal__body {
    flex: 0 1 auto;
    height: auto !important;
    max-height: calc(100dvh - 120px);
}

#evaluation_feature_history_modal .feature-history-group-title {
    font-weight: 600;
}

#evaluation_feature_history_modal .feature-history-group-meta {
    font-size: 13px;
    color: #777;
    white-space: nowrap;
}

.report-history-link {
    display: inline-block;
    float: right;
    margin: 0 10px 10px 0;
    color: #e83c3c;
    vertical-align: top;
    font-size: 14px;
    font-weight: 400;
    line-height: 17px;
    text-decoration: underline;
}

.infoHouseWrapper {
    flex-wrap: wrap;
}

.house-info-button-ajax-row {
    display: block !important;
    clear: both !important;
    width: 100% !important;
    flex: 0 0 100% !important;
    order: 10;
    margin-top: 6px;
    line-height: 17px;
}

.house-info-button-ajax-row::before {
    content: "";
    display: block;
    clear: both;
}

.house-info-button-ajax-row .house-info-button,
.house-info-button-ajax-row .house-info-button:hover,
.house-info-button-ajax-row .house-info-button:focus,
.house-info-button-ajax-row .house-info-button:active {
    text-decoration: underline !important;
}

.ajax-modal-widget-modal .bbh-house-info-main-photo,
.ajax-modal-widget-modal .bbh-house-gallery__viewport {
    overflow: hidden;
}

.ajax-modal-widget-modal .bbh-house-info-main-photo__link,
.ajax-modal-widget-modal .bbh-house-gallery__link {
    position: absolute !important;
    inset: 0;
    width: auto !important;
    height: auto !important;
}

.ajax-modal-widget-modal .bbh-house-info-main-photo img,
.ajax-modal-widget-modal .bbh-house-gallery__image {
    position: absolute !important;
    inset: 0;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover !important;
    object-position: center;
}

@media (max-width: 767px) {
    .ajax-modal-widget-modal .modal-dialog {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        max-height: calc(100dvh - 24px);
        margin: 0 auto;
    }

    .ajax-modal-widget-modal__content {
        max-height: calc(100dvh - 24px);
    }

    .ajax-modal-widget-modal__header-main {
        min-height: 64px;
        padding: 12px 52px 12px 16px;
    }

    .ajax-modal-widget-modal__title {
        font-size: 18px;
    }

    #edit_object .edit-object-modal__header-main {
        min-height: 64px;
        padding: 12px 52px 12px 16px;
    }

    #edit_object .edit-object-modal__title {
        font-size: 18px;
    }

    .ajax-modal-widget-modal__body {
        max-height: calc(100dvh - 88px);
    }

    .ajax-modal-widget-modal__scroll {
        padding: 20px 18px 34px;
    }

    .repair-examples_grid {
        grid-template-columns: 1fr;
    }

    .repair-examples_grid .repair-examples__card {
        min-height: 86px;
        padding-left: 12px;
    }

    .repair-examples__image {
        width: 70px;
        height: 70px;
        flex-basis: 70px;
    }

    .repair-examples_slider {
        padding: 0 28px;
    }

    .repair-examples_slider .repair-examples__card {
        height: 250px;
        min-width: 0;
        border: 1px solid #dfe3e6;
        border-radius: 10px;
        overflow: hidden;
    }

    .repair-examples_slider .swiper {
        margin: -1px;
        padding: 1px;
    }

    .repair-examples_slider .repair-examples__image {
        height: 96px;
        flex-basis: 96px;
    }

    .repair-examples_slider .repair-examples__card-content {
        padding: 8px 9px;
    }

    .repair-examples_slider .repair-examples__name {
        font-size: 12px;
        line-height: 1.25;
    }

    .repair-examples_slider .repair-examples__score {
        margin: 6px 9px 10px;
        color: #9d3c3c;
        font-size: 13px;
        font-weight: 700;
    }

    #evaluation_feature_history_modal .modal-dialog {
        width: 95vw !important;
        max-width: 95vw !important;
        height: auto !important;
    }

    #evaluation_history_modal .modal-dialog {
        width: 95vw !important;
        max-width: 95vw !important;
        height: auto !important;
        min-height: 0 !important;
        margin: auto !important;
        top: auto !important;
        transform: none !important;
    }

    #evaluation_history_modal.show,
    #evaluation_history_modal.in,
    #evaluation_history_modal.ajax-modal-widget-modal_is-closing {
        align-items: center !important;
        justify-content: center !important;
    }

    #evaluation_history_modal .ajax-modal-widget-modal__content {
        display: block !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 24px) !important;
    }

    #evaluation_history_modal .ajax-modal-widget-modal__body {
        display: block !important;
        flex: none !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 24px);
    }

    #evaluation_history_modal .ajax-modal-widget-modal__scroll {
        height: auto !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 24px);
    }

    #evaluation_feature_history_modal .ajax-modal-widget-modal__content {
        height: auto !important;
        max-height: calc(100dvh - 24px) !important;
    }

    #evaluation_feature_history_modal .ajax-modal-widget-modal__body {
        height: auto !important;
        max-height: calc(100dvh - 96px);
    }

    #evaluation_announcements_modal .ajax-modal-widget-modal__table-scroll {
        overflow: visible;
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__table,
    #evaluation_announcements_modal .evaluation-announcements-modal__table tbody,
    #evaluation_announcements_modal .evaluation-announcements-modal__table tr,
    #evaluation_announcements_modal .evaluation-announcements-modal__table td {
        display: block;
        width: 100%;
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__table thead {
        display: none;
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 4px 12px;
        margin-bottom: 10px;
        padding: 10px 12px;
        border: 1px solid #d8dfe2;
        border-radius: 6px;
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__table td {
        min-width: 0;
        padding: 0;
        border: 0;
        font-size: 13px;
        line-height: 1.35;
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__source {
        grid-column: 1;
        grid-row: 1;
        font-weight: 600;
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__price {
        grid-column: 2;
        grid-row: 1;
        white-space: nowrap;
        text-align: right;
        font-weight: 600;
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__start,
    #evaluation_announcements_modal .evaluation-announcements-modal__end {
        color: #6f7782;
        font-size: 12px;
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__start {
        grid-column: 1;
        grid-row: 2;
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__end {
        grid-column: 2;
        grid-row: 2;
        text-align: right;
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__start::before {
        content: "Начало: ";
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__end::before {
        content: "Снятие: ";
    }

    #evaluation_announcements_modal .evaluation-announcements-modal__end:empty {
        display: none;
    }
}

@media (max-width: 576px) {
    #evaluation_feature_history_modal .feature-history-group-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 8px !important;
    }

    #evaluation_feature_history_modal .feature-history-group-title {
        display: block;
        width: 100%;
    }

    #evaluation_feature_history_modal .feature-history-group-meta {
        display: block;
        width: 100%;
        margin-left: auto;
        text-align: right;
        line-height: 18px;
        white-space: normal;
    }
}

@media (max-width: 575px) {
    .ajax-modal-widget-modal_has-house-info .ajax-modal-widget-modal__scroll {
        padding: 10px 10px 18px;
    }

    .ajax-modal-widget-modal_has-house-info .bbh-house-info-modal__scroll {
        padding: 10px;
    }
}
