.avatar-crop-backdrop {
    position: fixed;
    inset: 0;
    z-index: 4100;
    background: rgba(10, 10, 20, 0.55);
    animation: guest-backdrop-in 0.22s ease-out;
}

.avatar-crop-sheet {
    position: fixed;
    top: 50%;
    left: 16px;
    right: 16px;
    z-index: 4110;
    transform: translateY(-50%);
    max-height: min(88vh, 640px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    box-shadow: 0 16px 48px rgba(26, 26, 46, 0.28);
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    animation: guest-sheet-center-in 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.avatar-crop-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.avatar-crop-sheet__title {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
}

.avatar-crop-sheet__close {
    border: none;
    background: transparent;
    font-size: 20px;
    color: var(--color-text-secondary);
}

.avatar-crop-sheet__hint {
    margin: 0 0 12px;
    font-size: 13px;
    color: var(--color-text-secondary);
}

.avatar-crop-sheet__stage {
    position: relative;
    width: min(100%, 320px);
    height: min(72vw, 320px);
    margin: 0 auto 14px;
    border-radius: 18px;
    overflow: hidden;
    background: #111;
    touch-action: none;
    user-select: none;
    --crop-cx: 0.5;
    --crop-cy: 0.5;
    --crop-z: 1;
}

.avatar-crop-sheet__image {
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(100% * var(--crop-z, 1));
    height: calc(100% * var(--crop-z, 1));
    max-width: none;
    object-fit: cover;
    opacity: 0;
    transform: translate(
        calc(-50% + (0.5 - var(--crop-cx, 0.5)) * 100%),
        calc(-50% + (0.5 - var(--crop-cy, 0.5)) * 100%)
    );
    pointer-events: none;
    z-index: 1;
    transition: opacity 0.18s ease;
}

.avatar-crop-sheet__image--ready {
    opacity: 1;
}

.avatar-crop-sheet__image--failed {
    display: none;
}

.avatar-crop-sheet__image-error {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
}

.avatar-crop-sheet__image-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 0;
    pointer-events: none;
}

.avatar-crop-sheet__image-spinner {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.28);
    border-top-color: #fff;
    animation: avatar-crop-spin 0.75s linear infinite;
}

@keyframes avatar-crop-spin {
    to {
        transform: rotate(360deg);
    }
}

.avatar-crop-sheet__mask {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    /* Inscribed circle = same viewport as circular avatar preview */
    background: radial-gradient(circle closest-side at center, transparent 99%, rgba(0, 0, 0, 0.58) 100%);
}

.avatar-crop-sheet__preview-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.avatar-crop-sheet__preview-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
}

.avatar-crop-sheet__preview-image {
    opacity: 0;
    transition: opacity 0.18s ease;
}

.avatar-crop-sheet__preview-image.meets-avatar--loaded {
    opacity: 1;
}

.avatar-crop-sheet__preview.meets-avatar-wrap,
.avatar-crop-sheet__preview-image {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar-crop-sheet__preview.meets-avatar-wrap {
    position: relative;
    overflow: hidden;
}

.avatar-crop-sheet__zoom-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

.avatar-crop-sheet__zoom-range {
    touch-action: none;
    margin-top: 8px;
}

.avatar-crop-sheet__actions {
    display: flex;
    gap: 10px;
}
