.ta-avatar-crop {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    pointer-events: none;
}

.ta-avatar-crop[hidden] {
    display: none !important;
}

.ta-avatar-crop.is-open {
    pointer-events: auto;
}

.ta-avatar-crop__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.ta-avatar-crop.is-open .ta-avatar-crop__backdrop {
    opacity: 1;
}

.ta-avatar-crop__sheet {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 414px;
    max-height: 92vh;
    background: #111;
    color: #f5f5f7;
    border-radius: 20px 20px 0 0;
    padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translateY(110%);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.45);
}

html:not([data-lp-color-scheme='dark']) .ta-avatar-crop__sheet {
    background: #fff;
    color: #1d1d1f;
}

.ta-avatar-crop.is-open .ta-avatar-crop__sheet {
    transform: translateY(0);
}

.ta-avatar-crop__head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.ta-avatar-crop__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    letter-spacing: -0.02em;
}

.ta-avatar-crop__btn {
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 4px;
    color: inherit;
}

.ta-avatar-crop__btn--ghost {
    justify-self: start;
    opacity: 0.85;
}

.ta-avatar-crop__btn--primary {
    justify-self: end;
    color: #fe2c55;
}

.ta-avatar-crop__lead {
    margin: 0 0 14px;
    font-size: 13px;
    text-align: center;
    opacity: 0.72;
    line-height: 1.35;
}

.ta-avatar-crop__stage {
    position: relative;
    width: min(100%, 320px);
    margin: 0 auto 16px;
    aspect-ratio: 1;
    touch-action: none;
    user-select: none;
}

.ta-avatar-crop__frame {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}

.ta-avatar-crop__canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.ta-avatar-crop__mask {
    position: absolute;
    inset: 0;
    border-radius: 16px;
    box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    border: 2px solid rgba(255, 255, 255, 0.9);
}

.ta-avatar-crop__zoom {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    font-weight: 600;
    opacity: 0.9;
}

.ta-avatar-crop__zoom input[type='range'] {
    flex: 1;
    accent-color: #fe2c55;
}

.ta-avatar-crop.is-busy .ta-avatar-crop__sheet {
    opacity: 0.92;
    pointer-events: none;
}

body.ta-avatar-crop-open {
    overflow: hidden;
}

.ta-social-profile__avatar-edit,
.ta-profile-edit__avatar-pencil {
    cursor: pointer;
    border: none;
    -webkit-tap-highlight-color: transparent;
}

.ta-social-profile__avatar-edit:disabled,
.ta-profile-edit__avatar-pencil:disabled {
    opacity: 0.5;
    pointer-events: none;
}
