/* Смена фото профиля (Telegram-style): нижний лист + круглое кадрирование. */

.ae-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ae-sheet {
    width: min(420px, calc(100vw - 24px));
    border-radius: 16px;
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #111);
    overflow: hidden;
    padding: 8px 0;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    animation: aeIn 0.18s ease-out;
}
.ae-sheet-title {
    padding: 12px 18px 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary, #666);
}
.ae-sheet-item {
    display: block;
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text-primary, #111);
    font-size: 16px;
    text-align: left;
    padding: 14px 18px;
    cursor: pointer;
}
.ae-sheet-item:hover {
    background: var(--border-light, #f1f5f9);
}
.ae-sheet-cancel {
    color: var(--text-secondary, #888);
    font-size: 15px;
    text-align: center;
}

.ae-card {
    width: min(420px, calc(100vw - 24px));
    border-radius: 18px;
    background: var(--bg-card, #ffffff);
    color: var(--text-primary, #111);
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
    padding-bottom: 14px;
    animation: aeIn 0.18s ease-out;
}
.ae-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 6px;
    font-weight: 600;
}
.ae-close {
    border: 0;
    background: transparent;
    color: var(--text-secondary, #888);
    font-size: 18px;
    cursor: pointer;
    line-height: 1;
}

.ae-stage {
    position: relative;
    width: 260px;
    height: 260px;
    margin: 10px auto 4px;
    border-radius: 50%;
    overflow: hidden;
    touch-action: none;
    background: #111;
}
.ae-view {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 50%;
}
.ae-photo {
    position: absolute;
    left: 0;
    top: 0;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
    will-change: transform;
}
.ae-hint {
    text-align: center;
    font-size: 12.5px;
    color: var(--text-secondary, #888);
    margin: 2px 0 10px;
}

.ae-zoom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 22px;
}
.ae-zoom-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid var(--border, #ddd);
    background: transparent;
    color: var(--text-primary, #111);
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}
.ae-slider {
    flex: 1;
    accent-color: #2563eb;
}

.ae-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 18px 4px;
}
.ae-btn {
    border: 0;
    border-radius: 22px;
    padding: 9px 22px;
    font-size: 15px;
    cursor: pointer;
}
.ae-btn-primary {
    background: #2563eb;
    color: #fff;
}
.ae-btn-primary:disabled {
    opacity: 0.6;
    cursor: default;
}
.ae-btn-ghost {
    background: transparent;
    color: var(--text-secondary, #888);
}

.ae-toast {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0, 0, 0, 0.82);
    color: #fff;
    padding: 10px 18px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    pointer-events: none;
}
.ae-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes aeIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: none; }
}
