.profile-edit-page {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
    background: var(--bg-color);
}

.profile-edit-form {
    width: 100%;
}

.profile-edit-avatar-section {
    display: flex;
    min-height: 142px;
    padding: 20px 15px 18px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: #fff;
}

.avatar-picker {
    position: relative;
    display: block;
    width: 76px;
    height: 76px;
    cursor: pointer;
}

.avatar-picker .avatar {
    width: 76px;
    height: 76px;
    margin: 0;
    background-position: center;
    background-size: cover;
}

.avatar-picker input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
}

.avatar-picker > i {
    position: absolute;
    right: -2px;
    bottom: -2px;
    display: flex;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--primary-color);
    color: #fff;
    font-size: 11px;
}

.profile-edit-section {
    margin-top: 10px;
    padding: 15px;
    background: #fff;
}

.profile-edit-section h2 {
    margin-bottom: 4px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: bold;
}

.profile-edit-field {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 13px;
}

.profile-edit-field > span:first-child {
    flex: 0 0 auto;
}

.profile-edit-field input,
.profile-edit-field select {
    width: 66%;
    min-width: 0;
    min-height: 38px;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-main);
    font-size: 13px;
    text-align: right;
}

.profile-edit-field input::placeholder,
.profile-edit-field textarea::placeholder {
    color: #bbb;
}

.profile-edit-field select {
    text-align-last: right;
}

.required-mark {
    margin-left: 2px;
    color: #e14b5b;
    font-style: normal;
    font-weight: bold;
}

.profile-choice-field {
    margin: 0;
}

.profile-segmented-options {
    display: flex;
    gap: 7px;
}

.profile-segmented-options label {
    position: relative;
    display: block;
}

.profile-segmented-options input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.profile-segmented-options label span {
    display: flex;
    min-width: 42px;
    min-height: 28px;
    padding: 5px 8px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-sub);
    font-size: 11px;
}

.profile-segmented-options input:checked + span {
    border-color: #ffb3c5;
    background: #fff0f4;
    color: var(--primary-color);
    font-weight: bold;
}

.profile-textarea-field {
    display: block;
    padding-top: 14px;
    padding-bottom: 12px;
}

.profile-field-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-field-heading small {
    color: var(--text-sub);
    font-size: 10px;
    font-weight: normal;
}

.profile-textarea-field textarea {
    display: block;
    width: 100%;
    min-height: 78px;
    margin-top: 10px;
    padding: 10px;
    resize: vertical;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    outline: 0;
    background: #fafafa;
    color: var(--text-main);
    font-size: 13px;
    line-height: 1.5;
}

.profile-edit-error {
    margin-top: 10px;
    color: #d64b5b;
    font-size: 11px;
}

.profile-account-section {
    padding-bottom: 10px;
}

.profile-account-row {
    display: flex;
    min-height: 44px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-sub);
    font-size: 12px;
}

.profile-account-row strong {
    color: var(--text-main);
    font-weight: normal;
}

.profile-edit-actions {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 80;
    display: flex;
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    padding: 10px 15px calc(10px + env(safe-area-inset-bottom));
    gap: 10px;
    border-top: 1px solid var(--border-color);
    background: #fff;
}

.profile-edit-cancel,
.profile-edit-save {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border-radius: 21px;
    font-size: 14px;
    font-weight: bold;
}

.profile-edit-cancel {
    width: 32%;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.profile-edit-save {
    flex: 1;
    background: var(--primary-color) !important;
    color: #fff;
}

.profile-edit-message {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 100;
    padding: 10px 16px;
    transform: translate(-50%, -50%);
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 12px;
}

@media (max-width: 359px) {
    .profile-edit-section,
    .profile-edit-avatar-section {
        padding-right: 12px;
        padding-left: 12px;
    }

    .profile-edit-actions {
        padding-right: 12px;
        padding-left: 12px;
    }
}
