.profile-avatar-modal {
    align-items: center;
    background: rgba(15, 23, 42, 0.72);
    display: none;
    inset: 0;
    justify-content: center;
    padding: 1.5rem;
    position: fixed;
    z-index: 100000;
}

.profile-avatar-modal.is-open {
    display: flex;
}

.profile-avatar-modal__dialog {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 50px rgba(15, 23, 42, 0.24);
    max-width: 560px;
    padding: 1.25rem;
    width: min(100%, 560px);
}

.profile-avatar-modal__header {
    align-items: flex-start;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.profile-avatar-modal__header h3 {
    font-size: 1.125rem;
    margin: 0 0 0.25rem;
}

.profile-avatar-modal__header p {
    color: #6b7280;
    margin: 0 0 1rem;
}

.profile-avatar-modal__close {
    background: transparent;
    border: 0;
    color: #6b7280;
    cursor: pointer;
    font-size: 1.75rem;
    line-height: 1;
    padding: 0;
}

.profile-avatar-modal__source-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.profile-avatar-modal__feedback {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.75rem;
    color: #b91c1c;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    padding: 0.75rem 0.875rem;
}

.profile-avatar-modal__stage {
    margin-bottom: 1rem;
}

.profile-avatar-modal__video {
    height: 100%;
    left: 0;
    object-fit: cover;
    position: absolute;
    top: 0;
    width: 100%;
}

.profile-avatar-modal__footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.avatar-editor-crop-frame {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    border-radius: 1rem;
    height: min(72vw, 320px);
    margin: 0 auto;
    max-height: 320px;
    max-width: 320px;
    overflow: hidden;
    position: relative;
    touch-action: none;
    user-select: none;
    width: min(72vw, 320px);
}

.avatar-editor-crop-frame::after {
    border: 2px solid rgba(255, 255, 255, 0.92);
    border-radius: 9999px;
    box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.24);
    content: "";
    inset: 8%;
    pointer-events: none;
    position: absolute;
}

.avatar-editor-crop-image {
    cursor: grab;
    display: none;
    left: 50%;
    max-width: none;
    position: absolute;
    top: 50%;
    transform-origin: center center;
}

.avatar-editor-crop-image.is-ready {
    display: block;
}

.avatar-editor-crop-image.is-dragging {
    cursor: grabbing;
}

.avatar-editor-controls {
    display: grid;
    gap: 0.75rem;
}

.avatar-editor-controls label {
    color: #374151;
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}

.avatar-editor-controls input[type="range"] {
    width: 100%;
}

@media (prefers-color-scheme: dark) {
    .profile-avatar-modal__dialog {
        background: #111827;
    }

    .profile-avatar-modal__header h3 {
        color: #f9fafb;
    }

    .profile-avatar-modal__header p,
    .avatar-editor-controls label,
    .profile-avatar-modal__close {
        color: #d1d5db;
    }

    .profile-avatar-modal__feedback {
        background: rgba(127, 29, 29, 0.35);
        border-color: rgba(248, 113, 113, 0.45);
        color: #fecaca;
    }
}
