/* ── MFA Status Modal (success/error) ─────────────────────────────── */
/* --- MFA Status Modal (success/error) --- */
.mfa-status-modal {
    display: none;
    position: fixed;
    top: 32px;
    left: 50%;
    transform: translateX(-50%);
    min-width: 240px;
    max-width: 90vw;
    z-index: 99999;
    align-items: center;
    gap: 12px;
    padding: 8px 18px 8px 14px;
    border-radius: 12px;
    box-shadow: 0 4px 18px 0 rgba(0, 0, 0, 0.13);
    font-size: 1rem;
    font-weight: 500;
    background: #fff;
    color: #222;
    border: 1.5px solid #e0e0e0;
    transition:
        opacity 0.4s,
        top 0.4s;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    height: 40px;
}

.mfa-status-modal.show {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    top: 48px;
}

.mfa-status-icon {
    font-size: 1.3em;
    margin-right: 6px;
    flex-shrink: 0;
}

.mfa-status-modal.success {
    border-color: #1a7f37;
    background: #e6f7ed;
    color: #1a7f37;
}

.mfa-status-modal.success .mfa-status-icon {
    color: #1a7f37;
}

.mfa-status-modal.error {
    border-color: #c0392b !important;
    background: #ffeaea !important;
    color: #c0392b !important;
}

.mfa-status-modal.error .mfa-status-icon {
    color: #c0392b !important;
}

.mfa-status-close {
    background: none;
    border: none;
    font-size: 1.2em;
    color: inherit;
    position: absolute;
    right: 8px;
    top: 6px;
    cursor: pointer;
    line-height: 1;
}

@media (max-width: 600px) {
    .mfa-status-modal {
        min-width: 0;
        padding: 7px 6vw 7px 4vw;
        font-size: 0.95rem;
        height: 36px;
    }
}

/* ── インライン通知（操作起点近くに表示・手動で閉じる・自動消去なし） ── */
.mfa-inline-notice {
    display: none;
    align-items: flex-start;
    gap: 12px;
    margin-top: 16px;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.6;
    border: 2px solid;
    background: #fff;
    color: #222;
}

.mfa-inline-notice.show {
    display: flex;
}

.mfa-inline-notice.success {
    border-color: #1a7f37;
    background: #e6f7ed;
    color: #0f5a26;
}

.mfa-inline-notice.warning {
    border-color: #e08e0b;
    background: #fff7e6;
    color: #8a5500;
}

.mfa-inline-notice__icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1.4;
}

.mfa-inline-notice__msg {
    flex: 1;
    word-break: break-word;
    white-space: pre-line;
}

.mfa-inline-notice__close {
    background: transparent;
    border: none;
    color: inherit;
    font-size: 24px;
    line-height: 1;
    width: 32px;
    height: 32px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 4px;
}

.mfa-inline-notice__close:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mfa-inline-notice__close:focus {
    background: rgba(0, 0, 0, 0.05);
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.35);
}

/* モバイル最適化（年配の方向け：フォント大きめ・タップ領域広め） */
@media (max-width: 600px) {
    .mfa-inline-notice {
        font-size: 17px;
        padding: 18px 16px;
    }
    .mfa-inline-notice__icon {
        font-size: 28px;
    }
    .mfa-inline-notice__close {
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
}

/* ── 重大エラー用モーダル（通信失敗・認証失敗など） ── */
.mfa-error-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* JS の classList で開閉を制御する（inline style 依存を避けて将来の誤動作リスクを下げる） */
.mfa-error-modal.is-open {
    display: flex;
}

.mfa-error-modal__container {
    background: #fff;
    border-radius: 12px;
    padding: 32px 28px 24px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.mfa-error-modal__icon {
    font-size: 48px;
    color: #c0392b;
    margin-bottom: 12px;
}

.mfa-error-modal__title {
    font-size: 20px;
    font-weight: 600;
    color: #222;
    margin-bottom: 12px;
}

.mfa-error-modal__body {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 24px;
    white-space: pre-line;
}

.mfa-error-modal__close-btn {
    background: #4a2087;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 12px 32px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    min-width: 120px;
}

.mfa-error-modal__close-btn:hover {
    background: #3a1a6d;
}

.mfa-error-modal__close-btn:focus {
    background: #3a1a6d;
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.25);
}

@media (max-width: 600px) {
    .mfa-error-modal__container {
        padding: 24px 18px 20px;
    }
    .mfa-error-modal__icon {
        font-size: 40px;
    }
    .mfa-error-modal__title {
        font-size: 18px;
    }
    .mfa-error-modal__body {
        font-size: 17px;
    }
    .mfa-error-modal__close-btn {
        font-size: 17px;
        padding: 14px 40px;
        width: 100%;
    }
}

/* Responsive for password confirm modal */
.password-modal-responsive {
    max-width: 380px;
    width: 92vw;
    padding: 32px 18px 20px 18px;
}

@media (max-width: 600px) {
    .password-modal-responsive {
        max-width: 98vw;
        width: 98vw;
        padding: 18px 6vw 16px 6vw;
        border-radius: 12px;
    }

    .password-modal-responsive .cc-modal-title {
        font-size: 17px;
    }

    .password-modal-responsive .cc-modal-desc {
        font-size: 13px;
    }

    .password-modal-btns {
        flex-direction: column;
        gap: 8px !important;
    }

    .password-modal-btns button {
        width: 100%;
        font-size: 15px;
        padding: 0.7em 0;
    }
}

/* ── Toggle switch */
.cc-toggle-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.passkey-toggle-column {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.passkey-toggle-notice {
    margin: 0;
    font-size: 12px;
    color: #666;
}

.cc-toggle {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    margin-bottom: unset;
}

.cc-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cc-toggle__slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    border-radius: 26px;
    transition: background-color 0.2s ease;
}

.cc-toggle__slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.cc-toggle input:checked+.cc-toggle__slider {
    background-color: #4a2087;
}

.cc-toggle input:checked+.cc-toggle__slider::before {
    transform: translateX(22px);
}

.cc-toggle input:disabled+.cc-toggle__slider {
    opacity: 0.5;
    cursor: not-allowed;
}

.cc-toggle__label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.cc-toggle__label.is-on {
    color: #4a2087;
}

.cc-toggle__label.is-off {
    color: #909090;
}
.cc-toggle__label.is-unset {
    color: #9ca3af; 
}
.cc-toggle input:disabled + .cc-toggle__slider {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ── Section card ─────────────────────────────────────────────────── */
.security-section {
    border: 1px solid #dddddd;
    border-radius: 4px;
    background-color: #fff;
    margin-bottom: 24px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.security-section__header {
    padding: 20px 20px 16px;
    border-bottom: none;
    background-color: #fff;
    gap: 16px;
    flex-wrap: nowrap;
}

.security-section__header-content {
    padding-bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #dddddd;
}

.security-section__title-group {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
}

.security-section__icon {
    font-size: 20px;
    color: #4a2087;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.security-section__title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin: 0;
}

.security-section__body {
    padding: 0 20px 20px;
}

.security-section__description {
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
}

/* ── Inner status box (grey border) ────────────────────────────── */
.security-status-box {
    border: 3px solid #dddddd;
    background-color: #fff;
    padding: 0;
    overflow: hidden;
}

.security-status-box__content {
    padding: 10px 10px;
    max-height: 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.security-status-box__content.have-passkey {
    max-height: unset;
    padding: unset;
}

.security-status-box__empty {
    text-align: left;
    font-size: 15px;
    font-weight: 700;
    color: #374151;
}

.security-status-box__footer {
    border-top: 1px solid #dddddd;
    padding: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    max-height: 41px;
    width: 100%;
}

.security-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: none;
    border: none;
    color: #4b208c;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    padding: 8px 16px;
    transition: opacity 0.2s;
    width: 100%;
}

.security-add-btn:hover {
    opacity: 0.8;
}

.security-add-btn:focus,
.security-add-btn:focus-visible,
.passkey-save-btn:focus,
.passkey-save-btn:focus-visible,
.passkey-delete-btn:focus,
.passkey-delete-btn:focus-visible,
.cc-modal-btn-grey:focus,
.cc-modal-btn-grey:focus-visible {
    outline: none;
}

.security-add-btn i {
    font-size: 18px;
}

/* ── Standalone Add Button ────────────────────────────────────────── */
.cc-standalone-add-btn {
    display: flex;
    justify-content: center;
    padding: 30px 0;
    width: 100%;
}

.cc-standalone-add-btn .security-add-btn {
    width: 80%;
    max-width: 320px;
}

/* ── Sub-option radio rows ────────────────────────────────────────── */
.auth-option-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.auth-option-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    background-color: #fff;
    transition:
        border-color 0.2s,
        background-color 0.2s;
    /* reset label defaults */
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    margin: 0;
    text-indent: 0;
}

.auth-option-item:hover:not(.is-disabled) {
    border-color: #4a2087;
    background-color: #f9f6ff;
}

.auth-option-item.is-selected {
    border-color: #4a2087;
    background-color: #f3eeff;
}

.auth-option-item.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f5f5f5;
}

.auth-option-item input[type="radio"] {
    margin-top: 3px;
    accent-color: #4a2087;
    flex-shrink: 0;
    cursor: inherit;
}

.auth-option-item__body {
    flex: 1 1;
}

.auth-option-item__label {
    font-size: 14px;
    font-weight: 600;
    display: block;
    line-height: 1.4;
}

.auth-option-item__desc {
    font-size: 12px;
    color: #666;
    margin: 2px 0 0;
    line-height: 1.5;
}

/* ── Restriction notice ────────────────────────────────────────────── */
.restriction-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    background-color: #fff9f0;
    border-left: 3px solid #f08f22;
    border-radius: 0 4px 4px 0;
    padding: 10px 14px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
    margin-top: 12px;
}

.restriction-notice .fa {
    color: #f08f22;
    margin-top: 2px;
    flex-shrink: 0;
}

.restriction-notice a {
    color: #4a2087;
    text-decoration: underline;
}

/* ── Passkey count badge ───────────────────────────────────────────── */
.passkey-count-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #555;
    background: #f0ecfa;
    border: 1px solid #c5b0e8;
    border-radius: 20px;
    padding: 3px 12px;
    font-weight: 600;
}

/* ── Passkey header status ────────────────────────────────────────── */
.passkey-header-status {
    font-size: 14px;
    color: #333333;
    font-weight: normal;
}

/* ── Passkey list ─────────────────────────────────────────────────── */
.passkey-list {
    display: flex;
    flex-direction: column;
    padding: 0 10px;
    padding-bottom: 14px;
}

.passkey-list:not(:last-child) {
    border-bottom: 1px solid #dddddd;
}

.passkey-list-item {
    display: flex;
    align-items: center;
    padding: 14px 0 0 0;
}

.passkey-number {
    color: #4b208c;
}

.passkey-list-item__icon {
    width: 25px;
    height: 23px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.passkey-list-item__body {
    flex: 1 1;
    min-width: 0;
}

.passkey-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.passkey-name-field {
    flex: 1 1;
    min-width: 0;
    max-width: 400px;
}

input.InputBox[type="text"].passkey-name-field {
    padding: 8px;
    max-height: 33px;
}

.passkey-save-btn {
    padding: 5px 12px;
    font-size: 14px;
    border: 1px solid #4a2087;
    background: #fff;
    color: #4a2087;
    cursor: not-allowed;
    transition: all 0.2s;
    max-width: 56px;
    max-height: 33px;
    opacity: 0.2;
}

.passkey-save-btn.is-active {
    border-color: #4a2087;
    color: #4a2087;
    cursor: pointer;
    opacity: 1;
}

.passkey-save-btn.is-active:hover {
    background: #f3eeff;
}

.passkey-list-item__meta {
    font-size: 14px;
    color: #666666;
}

.passkey-list-item__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.passkey-list-item__info {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 95%;
}

.passkey-delete-btn-text {
    background: none;
    border: none;
    padding: 4px;
    font-size: 14px;
    color: #666666;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* パスキー有効 + 登録1件のとき、削除ボタンは論理的にガード（クリックは発火させエラー表示する） */
.passkey-delete-btn.is-blocked,
.passkey-delete-btn.is-blocked:hover {
    cursor: not-allowed;
    opacity: 0.6;
}

.icon-delete-passkey {
    width: 11px;
    height: 14px;
}

.security-section__title-recommend {
    color: #6b7280;
    font-weight: normal;
    margin-left: 4px;
}

/* ── Add passkey row ──────────────────────────────────────────────── */
.passkey-add-row {
    margin-top: 12px;
    width: 100%;
}

.passkey-add-row .security-add-btn {
    width: 100%;
}

/* ── Disabled overlay for body ────────────────────────────────────── */
.security-section__body.is-disabled-section,
.security-section__body .is-disabled-section,
.cc-toggle-wrap.is-disabled-section {
    opacity: 0.5;
    pointer-events: none;
    user-select: none;
}

/* ── Save button area ─────────────────────────────────────────────── */
.security-save-area {
    text-align: center;
    margin: 32px 0 60px;
}

/* ── Phone registered display ── */
.phone-registered-card {
    border: 1px solid #dddddd;
    border-radius: 12px;
    padding: 20px;
    background: #fff;
}

.phone-registered-card__header {
    font-size: 15px;
    font-weight: 700;
    color: #374151;
    margin-bottom: 16px;
}

.phone-registered-card__body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
}

.phone-number-display {
    font-size: 16px;
    color: #333333;
    letter-spacing: 0.05em;
}

.phone-change-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #4a2087;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.phone-change-btn:hover {
    opacity: 0.8;
}

/* 認証用電話番号の削除ボタン（変更ボタンの隣） */
.phone-delete-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #666666;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

/* 「パスワード+電話番号認証によるログイン」有効時は削除不可（論理ガード） */
.phone-delete-btn.is-blocked,
.phone-delete-btn.is-blocked:hover {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ── Divider label ────────────────────────────────────────────────── */
.section-sub-label {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

/* ── Status chip ──────────────────────────────────────────────────── */
.status-chip {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    vertical-align: middle;
}

.status-chip.is-active {
    background: #e4f7ef;
    color: #0a9;
    border: 1px solid #b2dece;
}

.status-chip.is-inactive {
    background: #f2f2f2;
    color: #888;
    border: 1px solid #ddd;
}

@media screen and (max-width: 659px) {
    .security-section__header {
        padding: 12px 14px;
    }

    .security-section__body {
        padding: 12px 14px;
    }

    .passkey-list-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .passkey-list-item__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .passkey-name-input {
        width: 100%;
        flex: 1 1 55px;
    }

    #passkey-naming-modal .Withdrawal_buttons {
        flex-direction: column-reverse;
    }
}

#delete-passkey-modal .modal-box {
    left: 50% !important;
    transform: translateX(-50%) !important;
}

/* ── Passkey Error ─────────────────────────────────────────────────── */
.error-content {
    margin-bottom: 5px;
    color: #ef0256;
    white-space: break-spaces;
}

#passkey-warning.error-content {
    font-size: 14px;
}

/* ── Passkey Success ─────────────────────────────────────────────────── */
.success-content {
    margin-bottom: 5px;
    color: #28a745;
}

/* ── Passkey Warning ─────────────────────────────────────────────────── */
.warning-content {
    color: #f08f22;
}

.MypageForm_section {
    margin-bottom: 10px;
}

/* ── Modal shared styles ────────────────────────────────────────── */
.cc-modal-container {
    font-size: 14px;
}

.cc-modal-centered {
    text-align: center;
}

.cc-modal-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.cc-modal-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 16px;
    line-height: 1.5;
}

.cc-modal-hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 16px 0 12px;
}

.cc-modal-error {
    color: #eb5757;
    font-size: 12px;
    margin-top: 4px;
}

.cc-modal-form-group {
    margin-bottom: 8px;
}

.cc-modal-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #444;
}

.cc-modal-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin-bottom: 16px;
}

.cc-modal-icon-wrap--danger {
    background: #fdecea;
}

.cc-modal-icon-wrap--danger i {
    font-size: 22px;
    color: #eb5757;
}

.cc-modal-highlight-text {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    word-break: break-all;
    overflow-wrap: break-word;
    margin-bottom: 0;
}

.cc-modal-status-box {
    background: #f8fafc;
    border: 1px solid #dddddd;
    border-radius: 8px;
    padding: 20px 16px;
    text-align: center;
}

.cc-modal-call-label {
    font-size: 16px;
    color: #666666;
    margin: 0;
}

.cc-modal-call-label__free {
    color: #ef0256;
}

.cc-modal-big-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #4b208c;
    margin: 8px 0;
    letter-spacing: 0.5px;
}

#phone-oversea.cc-modal-sub-number {
    font-size: 14px;
    color: #333333;
    margin-top: 12px;
}

.cc-modal-notice-text {
    font-size: 16px;
    color: #333333;
    margin: 16px 0;
}

.cc-modal-verification-status {
    text-align: center;
    margin-bottom: 24px;
}

.phone-support-notice {
    margin: 0;
    padding: 12px 14px;
    border-top: 1px solid #d1d5db;
    font-size: 13px;
    color: #666666;
    line-height: 1.6;
}

.cc-modal-footer-btns {
    margin-top: 24px;
    margin-bottom: 0;
}

.cc-modal-footer-btns--centered {
    justify-content: center;
}

.cc-modal-footer-btns button,
.cc-modal-footer-btns a {
    width: 80%;
    margin: 0 auto;
    display: block;
    text-align: center;
    padding: 13px;
    font-weight: 700;
    font-size: 14px;
}

.cc-modal-footer-btns.btn-cancel-phone button {
    width: 70%;
}

.cc-modal-btn-purple {
    background-color: #4b208c !important;
    color: #fff !important;
    border: none !important;
}

.cc-modal-btn-grey {
    background-color: #eee !important;
    color: #333 !important;
    border: none !important;
}

/* ── Form table layout ────────────────────────────────────────── */
.cc-modal-form-table {
    border: 3px solid #dddddd;
    border-collapse: collapse;
    width: 100%;
}

.cc-modal-form-table td {
    border: 1px solid #dddddd;
    padding: 10px;
    vertical-align: middle;
}

.cc-modal-form-table .cc-modal-label-cell {
    max-width: 265px;
    background-color: #fff;
    font-weight: 700;
    color: #333;
}

.cc-modal-form-table .cc-modal-value-cell {
    background-color: #fff;
    position: relative;
}

.width-100 {
    max-width: 100%;
    width: 100%;
}

#notice-msg,
#passkey-error-msg,
.error-content-wrap {
    padding: 10px;
    background-color: #fae5e6;
    color: #ea2d2d;
}

#notice-msg li {
    list-style: none;
    position: relative;
    padding-left: 1.6em;
}

#notice-msg li::before {
    content: "•";
    color: #ea2d2d;
    position: absolute;
    left: 0;
    top: -0.1em;
    font-size: 22px;
}

#btn-call-auth:disabled {
    color: #000 !important;
    box-shadow: inset 0 0 1px 1px #ccc;
    background: #cdcdcd !important;
    cursor: not-allowed !important;
    opacity: 0.8;
}

@media screen and (max-width: 480px) {

    #mfa-phone-modal .modal-box,
    #phone-verification-modal .modal-box {
        position: fixed !important;
        top: 50% !important;
        left: 16px !important;
        right: 16px !important;
        transform: translateY(-50%) !important;
        width: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

/* ── 2FA Setup Reminder Modal ─────────────────────────────────────── */
#twofa-setup-modal .modal-box {
    /* max-width: 480px; */
    /* width: 92%; */
    box-sizing: border-box;
}

#twofa-setup-modal .twofa-setup-icon {
    text-align: center;
    margin-bottom: 12px;
    color: #4a2087;
    font-size: 36px;
}

#twofa-setup-modal .twofa-setup-body {
    font-size: 14px;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

#twofa-setup-modal .twofa-setup-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

#twofa-setup-modal .twofa-setup-btn-go {
    display: block;
    width: 100%;
    max-width: 320px;
    padding: 12px;
    background: #4a2087;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

#twofa-setup-modal .twofa-setup-btn-go:hover {
    background: #3a1870;
    color: #fff;
    text-decoration: none;
}

#twofa-setup-modal .twofa-setup-btn-later {
    background: none;
    border: none;
    font-size: 13px;
    color: #888;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

@media screen and (max-width: 480px) {
    #twofa-setup-modal .modal-box {
        position: fixed !important;
        top: 50% !important;
        left: 16px !important;
        right: 16px !important;
        transform: translateY(-50%) !important;
        width: auto !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
}

.font-size-28 {
    font-size: 28px;
}

.font-size-18 {
    font-size: 18px;
}

.font-size-16 {
    font-size: 16px;
}

.font-size-14 {
    font-size: 14px;
}

.phone-note-toggle {
    font-size: 12px;
    color: #666666;
    margin: 0;
    margin-top: 4px;
}

/* Base style matching the previously inline-styled wrapper */
.password-toggle-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.select-phone-country {
    max-height: 61px;
}

.input-phone {
    max-height: 53px;
}

.phone-note {
    font-size: 14px;
    color: #333333;
    white-space: nowrap;
}

.modal-verify-phone .cc-modal-desc {
    font-size: 16px;
    color: #333333;
}

.font-weight-bold {
    font-weight: bold;
}

#phone-verification-container>p {
    font-size: 16px;
    color: #333333;
}

#verification-status-msg {
    font-size: 14px;
    color: #333333;
}

#phone-verification-container #qrcode {
    display: flex;
    justify-content: center;
    height: 120px;
}

#phone-verification-container .qrcode-caption {
    display: block;
}

#verification-countdown {
    font-size: 18px;
    color: #333333;
    font-weight: bold;
}

.not-margin {
    margin: unset;
}

.margin-top-40 {
    margin-top: 40px;
}

.cc-modal-footer-btns a.text-link-later {
    padding: unset;
    font-size: 12px;
    color: #007bff;
    text-decoration: none;
    display: inline-block;
    margin: unset;
    font-weight: normal;
}

#phone-success-modal .cc-modal-btn-purple {
    width: 70%;
    max-width: none;
    margin: 0 auto 16px;
    display: block;
}

.security-status-box__header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px;
    border-bottom: 1px solid #dddddd;
}

.passkey-header-title {
    font-size: 15px;
    font-weight: bold;
    color: #333333;
}

#phone-verification-modal {
    font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
    line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE: Mobile (≤ 480px)
   ══════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 480px) {

    /* Header */
    .ContentsHeading.font-size-28 {
        font-size: 24px;
    }

    /* Section cards */
    .security-section {
        margin-bottom: 16px;
    }

    .security-section__header {
        padding: 16px 14px 16px;
    }

    .security-section__header-content {
        padding-bottom: 12px;
        align-items: flex-start;
        gap: 10px;
    }

    .security-section__header-content {
        padding-bottom: 12px;
        align-items: flex-start;
        gap: 10px;
    }

    .security-section__title-group {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 225px;
    }

    .security-section__title.font-size-18 {
        font-size: 16px;
        hyphens: none;
    }

    .security-section__body {
        padding: 0 14px 16px;
    }

    .security-section__description {
        font-size: 14px;
        margin-bottom: 20px;
    }

    .security-section__description .font-size-14 {
        font-size: 12px;
    }

    /* Password section toggle column */
    .password-toggle-wrap {
        flex: 0 1 50px;
        align-items: flex-end;
        min-width: 50px;
    }

    /* Toggle */
    .cc-toggle-wrap {
        align-items: center;
        gap: 6px;
        flex-shrink: 0;
    }

    .cc-toggle {
        width: 48px;
        height: 28px;
    }

    .cc-toggle__slider::before {
        height: 24px;
        width: 24px;
        left: 2px;
        bottom: 2px;
    }

    .cc-toggle input:checked+.cc-toggle__slider::before {
        transform: translateX(20px);
    }

    .cc-toggle__label {
        font-size: 14px;
        white-space: nowrap;
    }

    .phone-note-toggle {
        font-size: 10px;
        text-align: right;
        margin-top: 16px;
        line-height: 1.25;
        max-width: none;
        white-space: nowrap;
    }

    /* Status box */
    .security-status-box {
        border-width: 2px;
    }

    .security-status-box__content {
        padding: 10px;
        max-height: unset;
    }

    .security-status-box__empty {
        font-size: 14px;
    }

    .security-status-box__footer {
        padding: 10px;
        max-height: 38px;
    }

    /* Add button */
    .security-add-btn {
        font-size: 12px;
        padding: 10px;
        gap: 6px;
    }

    .security-add-btn i {
        font-size: 12px;
    }

    /* Passkey list */
    .passkey-list {
        padding: 0 8px;
        padding-bottom: 12px;
    }

    .passkey-list-item {
        padding: 12px 0 0 0;
    }

    .passkey-header-status {
        font-size: 12px;
    }

    .passkey-number {
        font-size: 12px;
    }

    /* Phone display */
    .phone-number-display {
        font-size: 15px;
    }

    .phone-change-btn {
        font-size: 13px;
    }

    /* Save button area */
    .security-save-area {
        margin: 24px 0 40px;
    }

    .security-save-area .RoundedButton-full {
        font-size: 15px;
        padding: 14px 20px;
    }

    /* Error/Success messages */
    .error-content,
    .success-content {
        font-size: 13px;
    }

    #passkey-warning.error-content {
        font-size: 13px;
    }

    /* Passkey registered header */
    .security-status-box__header {
        padding: 11.5px 10px;
        gap: 8px;
    }

    .passkey-header-title {
        font-size: 14px;
    }

    /* Passkey input row mobile adjustment */
    .passkey-input-row {
        gap: 6px;
        width: 100%;
    }

    input.InputBox[type="text"].passkey-name-field {
        font-size: 14px;
        padding: 6px 8px;
        flex: 1;
    }

    .passkey-save-btn {
        font-size: 14px;
        padding: 4px 10px;
        max-width: 50px;
        flex-shrink: 0;
    }

    /* Keep passkey active items on a single row */
    .passkey-list-item {
        flex-direction: row;
        align-items: center;
        gap: 6px;
    }

    .passkey-list-item__info {
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        gap: 4px;
        justify-content: flex-start;
    }

    .passkey-list-item__icon {
        width: 24px;
        height: 24px;
    }

    .passkey-list-item__icon img {
        width: 14px;
        height: 14px;
    }

    .passkey-list-item__body {
        flex: 1;
        min-width: 0;
        width: auto;
    }

    .passkey-input-row {
        gap: 4px;
    }

    input.InputBox[type="text"].passkey-name-field {
        font-size: 13px;
        padding: 5px 6px;
        flex: 1;
        min-width: 0;
    }

    .passkey-save-btn {
        font-size: 14px;
        padding: 4px 8px;
        max-width: 48px;
        flex-shrink: 0;
    }

    .passkey-list-item__actions {
        width: auto;
        flex-shrink: 0;
        margin-top: 0;
    }

    .passkey-list-item__meta {
        font-size: 10px;
        margin-top: 4px;
        color: #666666;
    }

    .passkey-delete-btn-text {
        font-size: 13px;
    }

    .icon-delete-passkey {
        width: 9px;
        height: 12px;
    }

    /* Passkey header */
    .security-status-box__header {
        padding: 11.5px 10px;
        gap: 8px;
    }

    .passkey-header-title {
        font-size: 14px;
    }

    .passkey-header-status {
        font-size: 13px;
    }

    /* Phone display */
    .phone-number-display {
        font-size: 15px;
    }

    .phone-change-btn {
        font-size: 13px;
    }

    #phone-display-row {
        padding: 10px 12px !important;
        gap: 8px;
    }

    .phone-number-display {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
        min-width: 0;
    }

    .phone-change-btn {
        flex-shrink: 0;
        white-space: nowrap;
    }

    /* ── Modal Box Container ─────────────────────────────────────── */
    #modal_regist_phone .modal-title {
        font-size: 16px;
    }

    #modal_regist_phone .modal-txt {
        padding: 10px 0 0 !important;
    }

    /* ── Modal Registration Phone ───────────────────────────────── */
    /* Modal title */
    .cc-modal-title {
        font-size: 16px !important;
        margin-bottom: 12px !important;
    }

    /* Modal description */
    .cc-modal-desc {
        font-size: 14px;
        color: #333333 !important;
        margin-bottom: 16px !important;
        line-height: 1.6 !important;
    }

    /* Form table - make it responsive */
    .cc-modal-form-table {
        border-width: 2px;
        display: block;
    }

    .cc-modal-form-table tbody,
    .cc-modal-form-table tr,
    .cc-modal-form-table td {
        display: block;
        border: none;
    }

    .cc-modal-form-table tr {
        border-bottom: 2px solid #dddddd;
        padding: 0;
    }

    .cc-modal-form-table tr:last-child {
        border-bottom: none;
    }

    .cc-modal-form-table .cc-modal-label-cell {
        border: none;
        padding: 10px;
        font-size: 14px;
        font-weight: 700;
        color: #333333;
        max-width: 100%;
        display: block;
        background-color: #fff;
        border-bottom: 1px solid #dddddd;
    }

    .cc-modal-form-table .cc-modal-value-cell {
        border: none;
        padding: 14px 10px;
        display: block;
        background-color: #fff;
    }

    /* Phone input wrapper */
    .cc-modal-value-cell>div[style*="display:flex"] {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
    }

    /* Input box styling */
    .cc-modal-value-cell .InputBox {
        flex: 1;
        min-width: 0;
        font-size: 14px !important;
        padding: 10px 12px !important;
    }

    /* Phone note text */
    .phone-note {
        font-size: 13px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Select box (country code dropdown) */
    .cc-modal-value-cell .SelectBox {
        width: 100% !important;
    }

    .cc-modal-value-cell .SelectBox select {
        width: 100%;
        font-size: 14px;
        padding: 10px 12px;
    }

    /* Modal footer buttons */
    .cc-modal-footer-btns {
        margin-top: 24px;
    }

    .cc-modal-btn-purple {
        font-weight: 700 !important;
        letter-spacing: 0.02em;
    }

    /* Error message in modal */
    .FormErrorMessage {
        font-size: 13px !important;
    }

    /* Modal icon wrap */
    .cc-modal-icon-wrap {
        width: 48px;
        height: 48px;
        margin-bottom: 12px;
    }

    .cc-modal-icon-wrap i {
        font-size: 20px !important;
    }

    /* ── Modal Phone Verification ───────────────────────────────── */
    #phone-verification-modal .modal-title {
        font-size: 16px;
    }

    .modal-verify-phone .cc-modal-desc {
        font-size: 14px !important;
        line-height: 1.6 !important;
        margin-bottom: 14px !important;
    }

    .modal-verify-phone .cc-modal-status-box {
        padding: 20px 10px;
        border-radius: 6px !important;
    }

    .modal-verify-phone .cc-modal-status-box p {
        font-size: 13px !important;
    }

    .modal-verify-phone .cc-modal-big-number {
        font-size: 32px;
        margin: 8px 0;
    }

    .modal-verify-phone #phone-oversea.cc-modal-sub-number {
        font-size: 13px !important;
    }

    #phone-verification-container>p {
        font-size: 14px;
    }

    #phone-verification-container>.cc-modal-verification-status {
        margin-bottom: 20px !important;
    }

    #verification-countdown {
        font-size: 16px;
    }

    #verification-status-msg {
        font-size: 12px;
    }

    .modal-verify-phone .cc-modal-footer-btns.btn-cancel-phone button {
        width: 100% !important;
        max-width: 100% !important;
        font-size: 15px !important;
        padding: 13px 16px !important;
    }

    #phone-verification-help {
        margin-top: 12px !important;
    }

    #phone-verification-help a {
        font-size: 12px !important;
    }

    /* ── Modal Phone Success (Completed Registration) ──────────── */
    #phone-success-modal .modal-title {
        font-size: 16px;
    }

    #phone-success-modal .modal-txt {
        padding: 16px 0 0;
    }

    #phone-success-modal .cc-modal-desc {
        font-size: 14px !important;
        margin-bottom: 32px !important;
    }

    #phone-success-modal .cc-modal-desc p {
        font-size: 14px;
        margin-bottom: 16px;
    }

    #phone-success-modal .js-success-mask-phone {
        font-size: 14px;
    }

    #phone-success-modal .cc-modal-btn-purple {
        width: 100%;
        max-width: 100%;
    }

    #phone-success-modal .cc-modal-footer-btns a {
        font-size: 12px;
    }
}

/* ══════════════════════════════════════════════════════════════════
   RESPONSIVE: Extra Small Mobile (≤ 375px)
   ══════════════════════════════════════════════════════════════════ */
@media screen and (max-width: 375px) {
    .ContentsHeading.font-size-28 {
        font-size: 24px;
    }

    .security-section__header {
        padding: 14px 12px 16px;
    }

    .security-section__header-content {
        gap: 8px;
        flex-wrap: nowrap;
        align-items: flex-start;
    }

    .security-section__title-group {
        flex: 1 1 auto;
        min-width: 0;
        max-width: 225px;
    }

    .security-section__body {
        padding: 0 12px 14px;
    }

    .security-section__title.font-size-18 {
        font-size: 16px;
    }

    .security-section__description {
        font-size: 14px;
    }

    .security-add-btn {
        font-size: 12px;
        padding: 10px;
    }

    /* Toggle (Extra Small) */
    .cc-toggle-wrap {
        flex-shrink: 0;
        gap: 4px;
        align-items: center;
    }

    .cc-toggle {
        width: 48px;
        height: 28px;
    }

    .cc-toggle__slider::before {
        height: 24px;
        width: 24px;
        left: 2px;
        bottom: 2px;
    }

    .cc-toggle input:checked+.cc-toggle__slider::before {
        transform: translateX(20px);
    }

    .cc-toggle__label {
        font-size: 14px;
        white-space: nowrap;
        text-align: right;
    }

    .phone-note-toggle {
        font-size: 10px;
        max-width: none;
        line-height: 1.2;
        text-align: right;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }

    /* ── Modal Box Container (Extra Small) ──────────────────────── */
    #modal_regist_phone .modal-title {
        font-size: 16px;
    }

    /* ── Modal Registration Phone (Extra Small) ─────────────────── */
    .cc-modal-title {
        font-size: 15px !important;
    }

    .cc-modal-desc {
        font-size: 14px;
    }

    .cc-modal-form-table .cc-modal-label-cell {
        padding: 10px;
        font-size: 14px;
        border-bottom: 1px solid #dddddd;
    }

    .cc-modal-form-table .cc-modal-value-cell {
        padding: 14px 10px;
    }

    .cc-modal-value-cell .InputBox {
        font-size: 13px !important;
        padding: 9px 10px !important;
        min-width: 0;
        flex: 1;
    }

    .phone-note {
        font-size: 12px !important;
        white-space: nowrap;
        flex-shrink: 0;
    }

    /* Ensure flex row in phone input doesn't overflow */
    .cc-modal-value-cell>div[style*="display:flex"] {
        flex-wrap: nowrap !important;
        overflow: hidden;
    }

    /* ── Modal Phone Verification (Extra Small) ─────────────────── */
    #phone-verification-modal .modal-title {
        font-size: 16px;
    }

    #phone-verification-modal .cc-modal-desc {
        margin-top: 0px;
    }

    .modal-verify-phone .cc-modal-desc {
        font-size: 14px;
        margin-bottom: 12px !important;
    }

    .modal-verify-phone .cc-modal-status-box {
        padding: 20px 10px;
    }

    .modal-verify-phone .cc-modal-status-box p {
        font-size: 12px !important;
    }

    .modal-verify-phone .cc-modal-big-number {
        font-size: 32px;
        margin: 8px 0;
    }

    .modal-verify-phone #phone-oversea.cc-modal-sub-number {
        font-size: 12px !important;
    }

    #phone-verification-container>p {
        font-size: 14px;
    }

    #phone-verification-container>.cc-modal-verification-status {
        margin-bottom: 18px !important;
    }

    #verification-countdown {
        font-size: 16px;
    }

    #verification-status-msg {
        font-size: 12px;
    }

    .modal-verify-phone .cc-modal-footer-btns.btn-cancel-phone button {
        font-size: 14px !important;
        padding: 12px 14px !important;
    }

    #phone-verification-help {
        margin-top: 10px !important;
    }

    #phone-verification-help a {
        font-size: 11px !important;
    }

    /* ── Modal Phone Success (Extra Small) ──────────────────────── */
    #phone-success-modal .modal-title {
        font-size: 16px;
    }

    #phone-success-modal .cc-modal-desc {
        font-size: 14px;
        margin-bottom: 28px !important;
    }

    #phone-success-modal .cc-modal-desc p {
        font-size: 14px;
        margin-bottom: 16px;
    }

    #phone-success-modal .js-success-mask-phone {
        font-size: 14px;
    }

    #phone-success-modal .cc-modal-btn-purple,
    #modal_regist_phone .cc-modal-btn-purple,
    #phone-verification-modal .cc-modal-btn-purple {
        width: 100%;
        max-width: 100%;
    }

    #phone-success-modal .cc-modal-footer-btns a {
        font-size: 12px;
    }

    /* ── Passkey List (Extra Small) ─────────────────────────────── */
    input.InputBox[type="text"].passkey-name-field {
        font-size: 13px;
        padding: 6px 8px;
    }

    .passkey-save-btn {
        font-size: 14px;
        padding: 4px 8px;
        max-width: 48px;
    }

    .passkey-list {
        padding: 0 8px;
        padding-bottom: 12px;
    }

    .passkey-list-item {
        padding: 10px 0 0 0;
    }

    .passkey-list-item__icon {
        width: 30px;
        height: 28px;
    }

    .passkey-list-item__icon img {
        width: 16px;
        height: 16px;
    }

    .passkey-list-item__meta {
        font-size: 10px;
        margin-top: 4px;
    }

    .passkey-delete-btn-text {
        font-size: 12px;
    }

    .passkey-header-status {
        font-size: 12px;
    }

    .security-status-box__header {
        padding: 11.5px 10px;
        gap: 8px;
    }

    .passkey-header-title {
        font-size: 14px;
    }

    /* Phone display (Extra Small) */
    .phone-number-display {
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
        min-width: 0;
    }

    .phone-change-btn {
        font-size: 12px;
        flex-shrink: 0;
        white-space: nowrap;
    }

    #phone-display-row {
        padding: 10px 10px !important;
        gap: 8px;
    }
}

/* 電話番号 tel: リンク（モバイルからタップで発信）
   通常は親要素の文字色を継承し、装飾は最小限。
   モバイル幅ではアンダーラインを表示してタップ可能領域であることを示す。 */
.tel-link {
    color: inherit;
    text-decoration: none;
}

.tel-link:hover,
.tel-link:focus {
    color: inherit;
    text-decoration: underline;
}

@media (max-width: 600px) {
    .tel-link {
        text-decoration: underline;
        text-underline-offset: 4px;
    }
}
