/*
 * 電話不通ポップアップ（popup-tel-script.js）のメール相談アコーディオンと、その中の見積もりフォーム。
 *
 * 1. フォームの部品と希望日時の選択ポップアップは、事業者ページのチャット型フォーム
 *    （trader-detail-estimate.css の .estimateFormWrap / .estimateDateTimePopup）から値を変えずに抜き出したもの。
 *    trader-detail-estimate.css は事業者ページのCTAの見た目も含むため、全ページでは読み込まない。
 *    元の値を直したら、ここも同じ値に直す（.estimateFormWrap → .popupEstimateForm に置き換えただけ）。
 * 2. アコーディオン・バッジ・かけ直すボタンは Figma「SF-未応答ポップアップ改修」fix ページ（node 16-689）どおり。
 */

/* ========== 1. フォームの部品（trader-detail-estimate.css から抜き出し） ========== */

.popupEstimateForm input,
.popupEstimateForm button,
.popupEstimateForm textarea,
.popupEstimateForm select {
    font-family: inherit;
}

.popupEstimateForm .wrapEstimateForm {
    padding: 15px 8px 14px;
    display: flex;
    overflow: hidden;
    border: 1px solid #EC484B;
    border-radius: 0 0 10px 10px;
}

.popupEstimateForm .estimateForm {
    padding: 0 4px;
    overflow-y: auto;
    flex: 1;
}

.popupEstimateForm .estimateForm::-webkit-scrollbar {
    width: 8px;
}

.popupEstimateForm .estimateForm::-webkit-scrollbar-track {
    background: #D9D9D9;
    border-radius: 10px;
}

.popupEstimateForm .estimateForm::-webkit-scrollbar-thumb {
    background: #2EBAEC;
    border-radius: 10px;
}

.popupEstimateForm .formGroup {
    margin-bottom: 18px;
}

.popupEstimateForm .formLabel {
    display: flex;
    align-items: center;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 8px;
    color: #40536a;
}

.popupEstimateForm .labelRequired,
.popupEstimateForm .labelOptional {
    font-size: 12px;
    padding: 1px 5px;
    border-radius: 2px;
    margin-left: 9px;
    color: #fff;
    font-weight: normal;
    margin-top: -3px;
}

.popupEstimateForm .labelRequired {
    background-color: #ff7300;
}

.popupEstimateForm .labelOptional {
    background-color: #e0ecf2;
    color: #676767;
}

.popupEstimateForm .formCheckboxGroup {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: stretch;
    gap: 6px 11px;
}

.popupEstimateForm .checkboxBtn {
    cursor: pointer;
    display: block;
    margin: 0;
    min-height: 42px;
}

.popupEstimateForm .checkboxBtn input[type="checkbox"] {
    display: none;
}

.popupEstimateForm .checkboxBtn span {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 8px 2px;
    text-align: center;
    font-size: 11px;
    color: #46576d;
    background: #fff;
    transition: all 0.2s;
    line-height: 1.1;
    letter-spacing: -1px;
    font-weight: bold;
    height: 100%;
}

.popupEstimateForm .checkboxBtn input[type="checkbox"]:checked + span {
    border-color: #00a8f0;
    color: #00a8f0;
    background-color: #e7f8ff;
}

.popupEstimateForm .formNote {
    font-size: 11px;
    color: #333;
    margin: -5px 0 3px;
}

.popupEstimateForm .fileUploadBtn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #d9eff6 url(/wp-content/themes/safely-v2/assets-v2/images/trader-detail/estimate-chat-upload.svg) no-repeat right 10px center / 12px;
    color: #0092c0;
    border: 1px solid #0092c0;
    border-radius: 4px;
    padding: 9px 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background-color 0.2s;
    width: 190px;
    position: relative;
}

.popupEstimateForm .formControl {
    width: 100%;
    padding: 8px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    box-sizing: border-box;
    color: #46576d;
    background-color: #FFF;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: none;
}

.popupEstimateForm .formControl::placeholder {
    color: #e0e0e0;
}

.popupEstimateForm .formControl:focus {
    outline: none;
    border-color: #00a0e9;
}

.popupEstimateForm .formControl.inputDate {
    background-image: url(/wp-content/themes/safely-v2/assets-v2/images/trader-detail/estimate-chat-calendar.svg);
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    background-size: 16px;
}

.popupEstimateForm .postalCodeWrap {
    display: flex;
    gap: 10px;
}

.popupEstimateForm .inputPostal {
    width: 208px;
}

.popupEstimateForm .btnAddressSearch {
    width: 75px;
    background-color: #00a8f0;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 2px 12px 4px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.popupEstimateForm .textarea {
    resize: vertical;
    height: 85px;
}

.popupEstimateForm .formTerms {
    text-align: center;
    margin: 24px 0 20px;
    font-size: 15px;
    color: #40536a;
}

.popupEstimateForm .checkboxLabel {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.popupEstimateForm .checkboxLabel input {
    display: none;
}

.popupEstimateForm .checkboxLabel .customCheckbox {
    width: 23px;
    height: 23px;
    border: 1px dashed #0092c0;
    margin-right: 8px;
    display: inline-block;
    position: relative;
    background-color: #fff;
    box-sizing: border-box;
}

.popupEstimateForm .checkboxLabel input:checked + .customCheckbox {
    border-style: solid;
    background-color: #0092c0;
}

.popupEstimateForm .checkboxLabel input:checked + .customCheckbox::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 1px;
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.popupEstimateForm .formTerms a {
    color: #0092c0;
    text-decoration: underline;
}

.popupEstimateForm .formSubmit {
    text-align: center;
}

.popupEstimateForm .btnSubmit {
    background-color: #0092c0;
    color: #fff;
    border: none;
    border-radius: 40px;
    padding: 14px 40px;
    font-size: 19px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.popupEstimateForm .btnSubmit:disabled {
    background-color: #b3b3b3;
    pointer-events: none;
}

.estimateDateTimePopup .popupOverlay {
    z-index: 9998;
}

.estimateDateTimePopup .popupWrap {
    max-width: 805px;
    padding: 47px 7px 47px 15px;
    max-height: 70vh;
    height: auto;
    overflow-y: auto;
    overflow-x: hidden;
    top: 50%;
    transform: translateY(-50%) translateX(-50%);
    border-radius: 12px;
    box-sizing: border-box;
    scrollbar-gutter: stable;
    z-index: 9999;
}

.estimateDateTimePopup .popupWrap .close {
    font-size: 40px;
    width: fit-content;
    top: 14px;
    right: 22px;
    color: #40536A;
    line-height: 1;
    font-weight: 100;
    margin: 0;
}

.estimateDateTimePopup .popupWrap .close::before,
.estimateDateTimePopup .popupWrap .close::after {
    display: none;
}

.estimateDateTimePopup .popupWrap .popupTitle {
    font-size: 24px;
    padding-right: 26px;
    margin: 0;
    margin-bottom: 25px !important;
}

.estimateDateTimePopup .popupWrap .popupContent {

}

.estimateDateTimePopup .popupWrap .estDateTimeRow {
    display: flex;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol {
    transform: translateY(2px);
    padding-right: 12px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateInlinePicker {
    display: none;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol.datePickerBox .flatpickr-current-month {
    padding-top: 0;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar {
    box-shadow: none;
    width: 367px;
    padding: 0 11.5px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-days {
    width: 344px;
    margin-top: 18px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-weekdays {
    border-bottom: 1px solid #D5D4DF;
    height: 34px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .dayContainer {
    max-width: 342px;
    width: 100%;
    gap: 4px;
    padding-left: 2px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-day {
    max-width: 45px;
    line-height: 45px;
    height: 45px;
    color: #40536A;
    font-size: 14px;
    border-radius: 0;
    border: 1px solid #D5D4DF;
    box-sizing: border-box;
    transition: all 0.3s;
    padding-right: 0.5px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-day.today {
    border: 1px solid #40536A;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-day.prevMonthDay,
.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-day.nextMonthDay {
    color: #A8A8A8;
    border: 1px solid #D5D4DF;
    background: #F2F3F7;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-day.selected {
    color: white;
    background: #00AFEC;
    border: 1px solid #00AFEC;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol span.flatpickr-weekday {
    font-size: 16px;
    font-weight: 600;
    color: #40536A;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-current-month .numInputWrapper {
    width: 7ch;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-current-month input.cur-year {
    font-size: 20px;
    font-weight: bold;
    color: #40536A;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-current-month .flatpickr-monthDropdown-months {
    font-size: 20px;
    font-weight: bold;
    color: #40536A;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-current-month .flatpickr-monthDropdown-months option {
    font-size: 18px;
    font-weight: 500;
    border: none;
    background: white;
    box-shadow: none;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-prev-month,
.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-next-month {
    height: 40px;
    padding: 10px 13px;
    border-radius: 8px;
    box-sizing: border-box;
    border: 1px solid #DDDDDD;
    line-height: 1.5;
    transition: all 0.3s;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-prev-month {
    left: 16px;
    top: -5px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-next-month {
    right: 12px;
    top: -5px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-prev-month svg,
.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-next-month svg {
    width: 12px;
    height: 12px;
    fill: #40536A;
    transition: all 0.3s;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeRadioItem input[type="radio"] {
    display: none;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol.timeSelectBox {
    padding-left: 26.04px;
    padding-right: 0;
    max-width: 354px;
    height: auto;
    box-sizing: border-box;
    border-left: 1px solid #D5D4DF;
    transform: translateY(0);
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeFrameSelect {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeRadioItem {
    flex: 0 0 100px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeRadioItem .timeFrameLabel {
    text-align: center;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    font-weight: 500;
    color: #40536A;
    padding: 9px 12px 9.5px;
    border: 1px solid #40536A;
    border-radius: 5px;
    transition: all 0.3s;
    cursor: pointer;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeRadioItem input[type="radio"]:checked+.timeFrameLabel {
    color: white;
    background: #00AFEC;
    border: 1px solid #00AFEC;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput.timeFrameSelect {
    margin-top: 0;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput {
    margin-top: 24px;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput .estDateTimeLabel {
    margin-bottom: 0;
    margin-top: 0;
    font-size: 14px;
    font-weight: bold;
    color: #40536A;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput .estDesiredTime {
    border-radius: 5px;
    width: 100%;
    box-shadow: none;
    border: 1px solid #E0E0E0;
    box-sizing: border-box;
    font-size: 14px;
    line-height: 1.5;
    font-weight: bold;
    margin: 3px 0 0;
    padding: 12px 10px 13px;
    color: #40536A;
    font-family: "Noto Sans JP", sans-serif;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput .estDesiredTime::placeholder {
    color: #E0E0E0;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput.estDateTimeBtn {
    margin: 27px auto 0;
    width: fit-content;
}

.estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput.estDateTimeBtn .estSelectDateTimeBtn {
    margin: 0 auto 0;
    display: block;
    background: #0092C0;
    box-sizing: border-box;
    color: white;
    border: 1px solid #0092C0;
    font-size: 16px;
    font-weight: bold;
    line-height: 1.5;
    padding: 11px 20px 10px;
    border-radius: 70px;
    width: 154px;
}

@media (min-width: 769px) {

    .popupEstimateForm .btnAddressSearch:hover {
        background-color: #008ac9;
    }

    .popupEstimateForm .formTerms a:hover {
        text-decoration: none;
    }

    .popupEstimateForm .fileUploadBtn:hover {
        background-color: #d6eefa;
    }

    .popupEstimateForm .btnSubmit:hover {
        background-color: #007ca3;
    }

    .popupEstimateForm .btnSubmit:disabled:hover {
        background-color: #b3b3b3;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput.estDateTimeBtn .estSelectDateTimeBtn:hover {
        opacity: 0.7;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeRadioItem:hover .timeFrameLabel {
        color: white;
        background: #00AFEC;
        border: 1px solid #00AFEC;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-prev-month:hover,
    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-next-month:hover {
        background: #e6e6e6;
    }

}

@media (max-width: 768px) {

    .estimateDateTimePopup .popupWrap {
        max-width: 92.307%;
        max-height: 90vh;
        min-height: 80vh;
        z-index: 9999;
        padding: 0;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow {
        flex-direction: column;
    }

    .estimateDateTimePopup .popupWrap .close {
        position: sticky;
        float: right;
        font-size: 27px;
        top: 10px;
        right: 5px;
        z-index: 99;
        background-color: #fff;
        border-radius: 50%;
    }

    .estimateDateTimePopup .popupWrap .popupContent {
        padding: 35px 0 0;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol {
        padding-right: 0;
        transform: translateY(0px);
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar {
        width: 342px;
        padding: 0 1px;
        margin: 0 auto;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-days {
        width: 343px;
        margin-top: 12px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-weekdays {
        width: auto;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol span.flatpickr-weekday {
        font-size: 14px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-current-month input.cur-year {
        font-size: 18px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-current-month .flatpickr-monthDropdown-months {
        font-size: 18px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-innerContainer {
        margin-top: 22px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .dayContainer {
        max-width: 340px;
        padding: 0 0;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol.timeSelectBox {
        padding-left: 0;
        padding-top: 18px;
        border-left: none;
        border-top: 1px solid #D5D4DF;
        max-width: 94.44%;
        margin: 20px auto 0;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeFrameSelect {
        justify-content: start;
        max-width: 94.9%;
        margin: 0 auto;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeRadioItem {
        flex: 0 0 95px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeRadioItem .timeFrameLabel {
        padding: 9px 9px 9.5px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput.timeRangeSelect {
        margin-top: 16px;
        padding: 0 6px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput .estDesiredTime {
        margin-top: 4px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput.estDateTimeBtn {
        position: sticky;
        bottom: 0;
        width: 100%;
        margin-top: 18px;
        padding: 25px 0;
        background-color: #fff;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-prev-month,
    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-next-month {
        padding: 10px 10px;
        height: 32px;
        line-height: 0.8;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-prev-month svg,
    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-next-month svg {
        width: 10px;
        height: 10px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-next-month {
        right: 10px;
        top: -2px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-months .flatpickr-prev-month {
        left: 12px;
        top: -2px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput {
        margin-top: 16px;
        padding: 0 7px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .estDateTimeInput.timeFrameSelect {
        padding: 0 0;
    }

}

@media (max-width: 560px) {

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeFrameSelect {
        max-width: 90.9%;
    }

}

@media (max-width: 389px) {

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-weekdays {
        max-width: 320px;
        margin: 0 auto;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .dayContainer {
        max-width: 320px;
        margin: 0 auto;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .flatpickr-calendar .flatpickr-day {
        max-width: 42px;
        height: 42px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeRadioItem {
        flex: 0 0 90px;
    }

    .estimateDateTimePopup .popupWrap .estDateTimeRow .estDateTimeCol .timeRadioItem .timeFrameLabel {
        padding: 9px 5px 9.5px;
    }

}

.popupEstimateForm .boxPhoto {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin-top: 10px;
}

.popupEstimateForm .boxPhoto .photoDetail {
    position: relative;
}

.popupEstimateForm .boxPhoto .photoDetail input {
    display: none;
}

.popupEstimateForm .boxPhoto .photoDetail img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    object-position: center;
}

.popupEstimateForm .boxPhoto .photoDetail .deleteImage {
    position: absolute;
    top: 2px;
    right: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    color: #40536A;
    background-color: #fff;
    width: 15px;
    aspect-ratio: 1 / 1;
    cursor: pointer;
    line-height: 0;
}

.popupEstimateForm .boxPhoto .photoDetail .deleteImage img {
    width: 9px;
    aspect-ratio: 1 / 1;
}

.popupEstimateForm .errorMsg {
    font-size: 12px;
    font-weight: normal;
    color: #e84545;
    margin-top: 5px;
    display: block;
}

.popupEstimateForm .successMessageWrap {
    text-align: center;
    padding: 60px 10px;
    border: 1px solid #EC484B;
    border-radius: 0 0 10px 10px;
    overflow-y: auto;
    flex: 1;
}

.popupEstimateForm .successMessageWrap .successTitle {
    font-size: 18px;
    color: #40536A;
    margin-bottom: 20px;
    font-weight: bold;
}

.popupEstimateForm .successMessageWrap .successText {
    font-size: 14px;
    color: #40536A;
    line-height: 1.6;
}

.popupEstimateForm .formTerms.errorMsg {
    text-align: center;
}

@media (max-width: 768px) {

    .popupEstimateForm .wrapEstimateForm {
        padding: 14px 0 14px 0;
    }

    .popupEstimateForm .estimateForm {
        padding: 0 9px 0 9px;
        width: 100%;
    }

    .popupEstimateForm .formLabel {
        margin-bottom: 7px;
    }

    .popupEstimateForm .formCheckboxGroup {
        gap: 6px 7px;
    }

    .popupEstimateForm .checkboxBtn span {
        padding: 5px 4px 7px;
        font-size: 11px;
        line-height: 1.35;
    }

    .popupEstimateForm .formNote {
        margin: -3px 0 2px;
    }

    .popupEstimateForm .formControl {
        padding: 7.5px 37px 7.5px 17px;
    }

    .popupEstimateForm .formControl.inputDate {
        background-position: calc(100% - 7px) center;
        background-size: 19px;
    }

    .popupEstimateForm .checkboxLabel .customCheckbox {
        margin-right: 10px;
    }

    .estimateDateTimePopup .popupWrap .close:after,
    .estimateDateTimePopup .popupWrap .close:before {
        display: none;
    }

}

/* ========== 2. アコーディオン（Figma fix ページ） ========== */

/* 閉じるボタン：見た目は20pxのまま、押せる範囲を44pxに */
.popupTelephone--estimate .popupTelephone__close {
    top: 8px;
    right: 4px;
    width: 44px;
    height: 44px;
}
.popupTelephone--estimate .popupTelephone__close img {
    width: 20px;
    height: 20px;
}

/* 案内文：閉じているとき／開いているときで出し分け */
.popupTelephone--estimate .popupTelephone__lead--open {
    display: none;
}
.popupTelephone--estimate.is-formOpen .popupTelephone__lead--closed {
    display: none;
}
.popupTelephone--estimate.is-formOpen .popupTelephone__lead--open {
    display: block;
}
.popupTelephone--estimate.is-formOpen .popupTelephone__body .popupTelephone__message {
    margin-bottom: 12px;
}
.popupTelephone--estimate.is-formOpen .popupTelephone__body .popupTelephone__message.popupTelephone__message--sub {
    margin-bottom: 24px;
}

.popupTelephone--estimate .popupTelephone__mailCta {
    width: 100%;
    max-width: 326px;
    padding-top: 8px;
}
.popupTelephone--estimate.is-formOpen .popupTelephone__mailCta {
    max-width: 390px;
}

/* メールボタン兼アコーディオンの見出し */
.popupTelephone__accordionBtn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 11px 36px 13px 70px;
    border: none;
    border-radius: 15px;
    background: #EF4646;
    color: #fff;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    cursor: pointer;
    transition: opacity .4s ease;
}
.popupTelephone--estimate.is-formOpen .popupTelephone__accordionBtn {
    border-radius: 15px 15px 0 0;
}

/* 「最短1分・簡単入力」バッジ（チャット型フォームの見出しと同じ部品） */
.popupTelephone__badge {
    position: absolute;
    top: -14px;
    left: -6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 71px;
    height: 71px;
    border-radius: 50%;
    background-color: #fad438;
    color: #222222;
    font-weight: bold;
    line-height: 1.2;
}
.popupTelephone__badge .badgeSmall {
    font-size: 14px;
}
.popupTelephone__badge .badgeLarge {
    font-size: 22px;
    color: #ff6e01;
}
.popupTelephone__badge .badgeOrange {
    color: #ff6e01;
}

/* 開閉アイコン：既存アコーディオン（blog-detail.css の .titleNew .icon）を白丸・赤線に反転 */
.popupTelephone__accordionIcon {
    position: absolute;
    top: 50%;
    right: 14px;
    width: 18px;
    height: 18px;
    margin-top: -9px;
    border-radius: 50%;
    background-color: #fff;
}
.popupTelephone__accordionIcon::before,
.popupTelephone__accordionIcon::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 12px;
    height: 2px;
    border-radius: 10px;
    background-color: #EF4646;
    transform: translate(-50%, -50%);
}
.popupTelephone__accordionIcon::after {
    transform: translate(-50%, -50%) rotate(90deg);
    transition: all .3s;
}
.popupTelephone--estimate.is-formOpen .popupTelephone__accordionIcon::after {
    transform: translate(-50%, -50%) rotate(0deg);
}

.popupTelephone__mailNote {
    margin-top: 10px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    color: #40536A;
}

.popupTelephone__retryBtn {
    min-height: 44px;
    padding: 0 10px;
    border: none;
    background: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
    color: #40536A;
    text-decoration: underline;
    cursor: pointer;
}

.popupTelephone--estimate.is-formOpen .popupTelephone__mailNote,
.popupTelephone--estimate.is-formOpen .popupTelephone__retry {
    display: none;
}

/* フォームの枠：アコーディオン見出しの下へつなげる（ポップアップ本体がスクロールする） */
.popupTelephone .popupEstimateForm .wrapEstimateForm {
    display: block;
    border-top: none;
}
.popupTelephone .popupEstimateForm .estimateForm {
    overflow: visible;
}
.popupTelephone .popupEstimateForm .successMessageWrap {
    border: 1px solid #EC484B;
    border-top: none;
    border-radius: 0 0 10px 10px;
}

/* 希望日時の選択ポップアップを電話不通ポップアップ（z-index: 9999）より手前に */
.estimateDateTimePopup .popupOverlay {
    z-index: 10000;
}
.estimateDateTimePopup .popupWrap {
    z-index: 10001;
}

@media (min-width: 769px) {
    .popupTelephone__accordionBtn:hover,
    .popupTelephone__retryBtn:hover {
        opacity: .7;
    }
}
