.profile-page {
    width: min(100% - 40px, 980px);
    margin: 0 auto;
    padding: 42px 15px 88px;
    background: #ffffff;
}

.profile-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 26px;
    border-bottom: 1px solid #202124;
}

.profile-head span {
    display: block;
    color: #dd4a2c;
    font-size: 14px;
    font-weight: 500;
}

.profile-head h1 {
    margin: 4px 0 0;
    color: #202124;
    font-size: 32px;
    line-height: 1.35;
    font-weight: 600;
}

.profile-head > a {
    color: #6f7680;
    font-size: 14px;
    white-space: nowrap;
}

.profile-form {
    display: grid;
    gap: 38px;
    padding-top: 30px;
}

.profile-section {
    padding-bottom: 36px;
    border-bottom: 1px solid #e5e8ee;
}

.profile-section__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.profile-section__head h2 {
    margin: 0;
    color: #202124;
    font-size: 22px;
    line-height: 1.35;
    font-weight: 600;
}

.profile-section__head span {
    color: #7d8490;
    font-size: 14px;
}

.profile-section__head button {
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid #d9dde5;
    border-radius: 6px;
    background: #ffffff;
    color: #202124;
    font-size: 14px;
    font-weight: 500;
}

.profile-grid,
.profile-address {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 16px;
}

.profile-address {
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
}

.profile-field {
    display: grid;
    gap: 8px;
    min-width: 0;
    color: #202124;
    font-size: 14px;
}

.profile-field > span {
    color: #6f7680;
    line-height: 1.4;
}

.profile-field--wide {
    grid-column: 1 / -1;
}

.profile-address .profile-field:first-child {
    grid-column: 1;
}

.profile-password-grid .profile-field:first-child {
    grid-column: 1;
}

.profile-password-grid .profile-field:nth-child(2) {
    grid-column: 1;
}

.profile-password-grid .profile-field:nth-child(3) {
    grid-column: 2;
}

.profile-field input {
    width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #d9dde5;
    border-radius: 6px;
    background: #ffffff;
    color: #202124;
    font-size: 15px;
    outline: 0;
}

.profile-field input:read-only {
    background: #f7f8fa;
    color: #7b838f;
}

.profile-field input:focus {
    border-color: #dd4a2c;
}

.profile-field input::placeholder {
    color: #9aa1aa;
}

.profile-agree {
    display: grid;
    gap: 12px;
    padding: 18px;
    border: 1px solid #edf0f4;
    border-radius: 8px;
}

.profile-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
    word-break: keep-all;
}

.profile-check input {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    accent-color: #dd4a2c;
}

.profile-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.profile-actions__buttons {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.profile-actions__withdraw {
    color: #aaaaaa;
    font-size: 16px;
}

.profile-actions__withdraw:hover {
    color: #6f7680;
}

.profile-actions__buttons a,
.profile-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 108px;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid #d9dde5;
    border-radius: 6px;
    background: #ffffff;
    color: #202124;
    font-size: 14px;
    font-weight: 500;
}

.profile-actions button {
    border-color: #dd4a2c;
    background: #dd4a2c;
    color: #ffffff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .profile-page {
        width: 100%;
        padding: 24px 15px 96px;
    }

    .profile-head {
        display: block;
        padding-bottom: 20px;
    }

    .profile-head h1 {
        font-size: 24px;
    }

    .profile-head > a {
        display: inline-block;
        margin-top: 12px;
    }

    .profile-form {
        gap: 32px;
        padding-top: 26px;
    }

    .profile-section {
        padding-bottom: 30px;
    }

    .profile-section__head h2 {
        font-size: 20px;
    }

    .profile-grid,
    .profile-address {
        grid-template-columns: 1fr;
    }

    .profile-address .profile-field:first-child {
        grid-column: auto;
    }

    .profile-password-grid .profile-field:first-child,
    .profile-password-grid .profile-field:nth-child(2),
    .profile-password-grid .profile-field:nth-child(3) {
        grid-column: auto;
    }
}

@media (max-width: 480px) {
    .profile-section__head {
        display: block;
    }

    .profile-section__head span,
    .profile-section__head button {
        margin-top: 8px;
    }

    .profile-actions {
        display: grid;
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .profile-actions__withdraw {
        justify-self: start;
    }

    .profile-actions__buttons {
        display: grid;
        grid-template-columns: 1fr;
    }

    .profile-actions__buttons a,
    .profile-actions button {
        width: 100%;
    }
}

/* mypage-sub 래핑 시 페이지 자체 폭 보정 (디자이너 내부 BEM 유지) */
.mypage-sub__content.profile-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 0 24px;
}
