#main_container .apply .form_write #next-country {
    width: 100%;
    min-width: 0;
}
#main_container .apply .form_write input[type='email'] {
    border: 1px solid #d8d8d8;
    background: #f3f3f3;
    height: 45px;
    border-radius: 5px;
    padding: 0 17px;
    min-width: 0;
    width: 100%;
}
#main_container .apply .btn_wrap > button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}
#main_container .apply .form_wrap .btn_wrap > #next-lookup-open {
    background: #032557;
}
#main_container .apply .form_wrap .btn_wrap {
    flex-direction: row;
    flex-wrap: wrap;
}
/* 영문 버튼의 아이콘과 긴 문구가 같은 줄에서 겹치지 않도록 배치합니다. */
#main_container .apply .apply_info .form_wrap .btn_wrap > .next-submit-guard,
#main_container .apply .apply_info .form_wrap .btn_wrap > #next-lookup-open {
    width: 240px;
    min-width: 240px;
    max-width: 100%;
}
#main_container .apply .apply_info .next-submit-guard > button,
#main_container .apply .apply_info .form_wrap .btn_wrap > #next-lookup-open {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    text-align: center;
    white-space: nowrap;
}
#main_container .apply .apply_info .next-submit-guard > button::before,
#main_container .apply .apply_info .form_wrap .btn_wrap > #next-lookup-open::before {
    position: static;
    transform: none;
    flex-shrink: 0;
}
@media (max-width: 600px) {
    #main_container .apply .apply_info .form_wrap .btn_wrap {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    #main_container .apply .apply_info .form_wrap .btn_wrap > .next-submit-guard,
    #main_container .apply .apply_info .form_wrap .btn_wrap > #next-lookup-open {
        flex: none;
        width: 100%;
        min-width: 0;
    }
}
#main_container .apply .btn_wrap > .next-submit-guard {
    position: relative;
    display: inline-block;
    width: 220px;
    height: 60px;
    flex-shrink: 0;
}
#main_container .apply .next-submit-guard > button {
    position: relative;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(to right, var(--color-accent), var(--color-sub));
    color: #fff;
    text-align: right;
    padding-right: 30px;
    box-shadow: var(--shadow);
}
#main_container .apply .next-submit-guard > button:before {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    left: 30px;
    width: 21px;
    height: 21px;
    background: url(/images/ico_arrows.png);
}
.next-submit-guard.needs-consent {
    cursor: help;
}
.next-submit-guard.needs-consent > button {
    pointer-events: none;
}
#main_container .apply .next-submit-guard > button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}
.next-consent-tooltip {
    display: none;
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: #032557;
    color: #fff;
    padding: 10px 14px;
    border-radius: 6px;
    width: 260px;
    max-width: 80vw;
    font-size: 14px;
    line-height: 1.5;
    z-index: 20;
    box-shadow: 0 4px 12px #0002;
}
.next-submit-guard.needs-consent:hover .next-consent-tooltip,
.next-submit-guard.needs-consent:focus .next-consent-tooltip {
    display: block;
}
.next-consent-help {
    margin-top: 12px;
    color: #666;
    text-align: right;
    font-size: 14px;
    line-height: 1.5;
}
.next-consent-help[hidden] {
    display: none;
}
@media (max-width: 1200px) {
    #main_container .apply .btn_wrap > .next-submit-guard {
        width: 200px;
        height: 50px;
    }
}
@media (max-width: 768px) {
    #main_container .apply .btn_wrap > .next-submit-guard {
        width: 160px;
        height: 40px;
    }
    #main_container .apply .next-submit-guard > button {
        border-radius: 5px;
        padding-right: 15px;
    }
    #main_container .apply .next-submit-guard > button:before {
        left: 15px;
        width: 16px;
        height: 16px;
        background-size: cover;
    }
}
@media (max-width: 600px) {
    #main_container .apply .form_wrap .btn_wrap > .next-submit-guard {
        flex: 1;
        min-width: 130px;
        width: auto;
    }
}
#next-apply-message,
#next-lookup-message {
    margin-top: 16px;
    line-height: 1.6;
    color: #032557;
}
.next-modal[hidden] {
    display: none !important;
}
.next-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 15, 35, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.next-dialog {
    position: relative;
    background: #fff;
    color: #222;
    width: 560px;
    max-width: 100%;
    max-height: 90vh;
    overflow: auto;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 15px 50px #00152a55;
}
.next-dialog h2 {
    font-size: 26px;
    color: #032557;
    margin: 0 35px 12px 0;
}
.next-dialog p {
    line-height: 1.6;
}
.next-dialog label {
    display: block;
    margin: 16px 0 6px;
    font-weight: 600;
}
.next-dialog input:not([type='hidden']) {
    width: 100%;
    height: 44px;
    border: 1px solid #ccc;
    border-radius: 5px;
    padding: 8px 12px;
    font: inherit;
    box-sizing: border-box;
}
.next-dialog button[type='submit'] {
    background: #032557;
    color: #fff;
    padding: 12px 20px;
    border: 0;
    border-radius: 6px;
    margin-top: 20px;
    cursor: pointer;
}
#next-lookup-form button[type='submit'] {
    display: block;
    margin: 20px auto 0;
}
.next-dialog button:disabled {
    opacity: 0.4;
    cursor: wait;
}
.next-dialog .next-close {
    position: absolute;
    right: 16px;
    top: 12px;
    background: transparent;
    border: 0;
    font-size: 32px;
    cursor: pointer;
    color: #032557;
}
.next-result {
    margin-top: 22px;
    border-top: 1px solid #d9dfe6;
    padding-top: 18px;
}
.next-result h3 {
    font-size: 20px;
    color: #032557;
    margin-bottom: 14px;
}
.next-result dl {
    display: grid;
    grid-template-columns: 95px 1fr;
    gap: 10px;
    font-size: 15px;
    line-height: 1.5;
}
.next-result dt {
    font-weight: 600;
}
.next-result dd {
    margin: 0;
    overflow-wrap: anywhere;
}
@media (max-width: 600px) {
    .next-dialog {
        padding: 24px 20px;
    }
    .next-modal {
        padding: 12px;
    }
    #main_container .apply .form_write input[type='email'] {
        height: 35px;
    }
    #main_container .apply .form_wrap .btn_wrap > button {
        flex: 1;
        min-width: 130px;
        width: auto;
    }
    .next-result dl {
        grid-template-columns: 80px 1fr;
    }
}
.next-success-dialog {
    max-width: 540px;
    text-align: center;
    padding: 38px 30px;
}
/* 완료 안내는 국문·영문 모두 단어 단위로 줄바꿈합니다. */
#next-success-modal .next-success-dialog h2,
#next-success-modal .next-success-dialog p {
    word-break: keep-all;
    overflow-wrap: normal;
}
.next-success-mark {
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: #e1f8f5;
    color: #079e99;
    font-size: 42px;
}
.next-dialog-eyebrow {
    color: #0ba5b3;
    font-size: 12px;
    letter-spacing: 2px;
    font-weight: 700;
    margin-bottom: 12px;
}
.next-success-dialog h2 {
    margin: 0 0 14px;
    font-size: 25px;
    line-height: 1.5;
}
.next-receipt {
    margin: 24px 0;
    padding: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    background: #f4f7fb;
    border: 1px solid #e2e9f2;
    border-radius: 10px;
}
.next-receipt strong {
    font-size: 24px;
    color: #032557;
}
.next-success-note {
    font-size: 14px;
    color: #64748b;
}
.next-success-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 26px;
}
.next-primary-button,
.next-secondary-button {
    border-radius: 7px;
    border: 1px solid #032557;
    padding: 12px 22px;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.next-primary-button {
    color: #fff;
    background: #032557;
}
.next-secondary-button {
    color: #032557;
    background: #fff;
}
.next-status-badge {
    display: inline-flex;
    align-items: center;
    padding: 7px 12px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}
.next-status-badge.is-applied {
    background: #edf2ff;
    color: #3c54aa;
}
.next-status-badge.is-approved {
    background: #e2f6ed;
    color: #1c7954;
}
.next-status-badge.is-rejected {
    background: #fff0ee;
    color: #b64b40;
}
#next-lookup-modal .next-dialog {
    width: 660px;
}
#next-lookup-form[hidden],
#next-lookup-intro[hidden] {
    display: none !important;
}
.next-result {
    border: 1px solid #e1e8f1;
    border-radius: 12px;
    overflow: hidden;
    padding: 0;
    margin-top: 18px;
}
.next-result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 20px 14px;
    background: #c23878;
}
#next-lookup-modal #next-lookup-result .next-result-header h3 {
    color: #ffffff;
    margin: 0;
    line-height: 1.5;
    font-size: 21px;
    overflow-wrap: anywhere;
}
.next-status-description {
    padding: 0 20px 20px;
    background: #c23878;
    color: #fff1f7;
    font-size: 14px;
}
#next-lookup-modal #next-lookup-result .next-status-description {
    color: #fff1f7;
}
#next-lookup-modal #next-lookup-result .next-result-header h3::before {
    background-color: #ffffff;
    border-color: #ffffff;
}
.next-result dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 8px 20px;
}
.next-detail-item {
    padding: 14px 0;
    border-bottom: 1px solid #edf1f6;
}
.next-detail-item:nth-child(odd) {
    padding-right: 16px;
}
.next-detail-item dt {
    font-size: 12px;
    color: #6a7c91;
    margin-bottom: 5px;
}
.next-detail-item dd {
    font-size: 16px;
    color: #24344b;
    font-weight: 500;
}
.next-query-again {
    width: 100%;
    margin-top: 20px;
}
@media (max-width: 600px) {
    .next-success-dialog {
        padding: 32px 20px;
    }
    .next-success-dialog h2 {
        font-size: 23px;
    }
    .next-result-header {
        padding: 18px 16px 12px;
    }
    #next-lookup-modal #next-lookup-result .next-result-header h3 {
        font-size: 18px;
    }
    .next-status-description {
        padding: 0 16px 16px;
    }
    .next-result dl {
        padding: 4px 16px;
    }
    .next-detail-item dd {
        font-size: 14px;
    }
}
/* 영문 국가번호 선택과 Other 직접 입력 */
#main_container .apply .next-phone-fields {
    display: flex;
    gap: 8px;
    min-width: 0;
}
#main_container .apply .next-phone-fields > select {
    width: 22.5%;
    min-width: 70px;
    padding-right: 30px;
}
#main_container .apply .next-phone-fields > input {
    flex: 1;
    width: 0;
    min-width: 0;
}
.next-category-other[hidden] {
    display: none !important;
}
.next-category-other {
    margin-top: 10px;
}
#main_container .apply .next-category-other input {
    width: 100%;
}
@media (max-width: 600px) {
    #main_container .apply .next-phone-fields {
        flex-direction: column;
    }
    #main_container .apply .next-phone-fields > select,
    #main_container .apply .next-phone-fields > input {
        flex: none;
        width: 100%;
        min-width: 0;
    }
    #main_container .apply .next-phone-fields > select {
        width: 50%;
    }
}

/* 모바일 연락처와 이메일은 각각 전체 너비로 표시합니다. */
@media (max-width: 600px) {
    #main_container .apply .form_write > .next-contact-row {
        grid-column: 1 / -1;
    }
    #main_container .apply .next-phone-fields {
        flex-direction: row;
    }
    #main_container .apply .next-phone-fields > select {
        flex: none;
        width: 22.5%;
        min-width: 70px;
    }
    #main_container .apply .next-phone-fields > input {
        flex: 1;
        width: 0;
        min-width: 0;
    }
}
/* 신청 오류/중복 안내 레이어 */
.next-error-dialog .next-error-mark {
    background: #ffedf4;
    color: #c23878;
    font-weight: 700;
}
#next-error-modal .next-error-dialog h2,
#next-error-modal .next-error-dialog p {
    word-break: keep-all;
    overflow-wrap: normal;
}
#next-error-modal #next-error-description {
    font-size: 16px;
    line-height: 1.8;
    color: #39485c;
    white-space: pre-line;
}
.next-error-actions > button[hidden] {
    display: none !important;
}
/* 국문·영문 완료 및 알림 안내의 창과 글자, 버튼을 크게 표시합니다. */
#next-success-modal .next-success-dialog,
#next-error-modal .next-success-dialog {
    width: 660px;
    max-width: 100%;
    padding: 48px 40px;
}
#next-success-modal .next-success-mark,
#next-error-modal .next-success-mark {
    width: 84px;
    height: 84px;
    font-size: 46px;
}
#next-success-modal .next-dialog-eyebrow,
#next-error-modal .next-dialog-eyebrow {
    font-size: 14px;
}
#next-success-modal .next-success-dialog h2,
#next-error-modal .next-success-dialog h2 {
    font-size: 28px;
}
#next-success-modal #next-success-description,
#next-error-modal #next-error-description {
    font-size: 20px;
    line-height: 1.7;
}
#next-success-modal .next-success-actions,
#next-error-modal .next-success-actions {
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 30px;
}
#next-success-modal .next-success-actions button,
#next-error-modal .next-success-actions button {
    min-width: 88px;
    min-height: 54px;
    padding: 14px 26px;
    font-size: 17px;
}
@media (max-width: 600px) {
    #next-success-modal .next-success-dialog,
    #next-error-modal .next-success-dialog {
        padding: 32px 22px;
    }
    #next-success-modal .next-success-dialog h2,
    #next-error-modal .next-success-dialog h2 {
        font-size: 25px;
    }
    #next-success-modal #next-success-description,
    #next-error-modal #next-error-description {
        font-size: 17px;
    }
    #next-success-modal .next-success-actions button,
    #next-error-modal .next-success-actions button {
        flex: 1 1 100px;
        min-width: 0;
        min-height: 52px;
        padding: 14px 16px;
        font-size: 16px;
    }
}

/* 기존 상담·매칭 디자인을 유지하며 선택 항목과 비활성 상태를 연결합니다. */
#main_container .apply .check_wrap .next-choice-option {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font: inherit;
    color: inherit;
    cursor: pointer;
}
#main_container .apply .check_wrap .next-choice-option input {
    flex: none;
    margin: 0;
}
#main_container .apply .check_wrap.next-choice-disabled {
    background: #f7f7f7;
    color: #999;
}
#main_container .apply .next-choice-disabled .next-choice-option {
    cursor: default;
}

/* 전체 국가명과 국가번호를 함께 표시할 공간을 확보합니다. */
#main_container .apply .next-phone-fields > select {
    width: 44%;
    min-width: 180px;
}
@media (max-width: 600px) {
    #main_container .apply .next-phone-fields {
        flex-direction: column;
    }
    #main_container .apply .next-phone-fields > select,
    #main_container .apply .next-phone-fields > input {
        flex: none;
        width: 100%;
        min-width: 0;
    }
}

/* 참가확인도 신청폼과 같은 성/이름 두 칸으로 표시합니다. */
.next-lookup-name-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
.next-lookup-name-fields > div {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-width: 0;
}
#next-lookup-intro {
    word-break: keep-all;
    overflow-wrap: break-word;
}
.next-required {
    color: #ad255f;
    font-size: 0.9em;
}
