/* IW Photo Adjuster — circular avatar crop modal.
   Appended to document.body (not .iw-builder) for correct full-screen
   stacking, so colors are hardcoded here rather than relying on the
   --iw-* custom properties scoped to .iw-builder. */

.iw-adj-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(20, 20, 30, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    font-family: inherit;
}

.iw-adj-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}

.iw-adj-overlay[hidden] {
    display: none;
}

.iw-adj-card {
    width: 360px;
    max-width: calc(100vw - 32px);
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.iw-adj-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px 4px;
}

.iw-adj-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1a1d24;
}

.iw-adj-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
}

.iw-adj-hint {
    margin: 0 20px 14px;
    font-size: 13px;
    color: #6b7280;
}

.iw-adj-stage {
    background: #4b4f58;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iw-adj-frame {
    position: relative;
    width: 260px;
    height: 260px;
    border-radius: 50%;
    overflow: hidden;
    background: #2c2e35;
    cursor: grab;
    touch-action: none;
}

.iw-adj-frame.is-dragging {
    cursor: grabbing;
}

.iw-adj-img {
    position: absolute;
    max-width: none;
    user-select: none;
    -webkit-user-drag: none;
}

.iw-adj-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px;
}

.iw-adj-zoom-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1d24;
    flex-shrink: 0;
}

.iw-adj-zoom-input {
    flex: 1;
    accent-color: #ff5c82;
}

.iw-adj-zoom-value {
    font-size: 13px;
    color: #6b7280;
    flex-shrink: 0;
    min-width: 34px;
    text-align: right;
}

.iw-adj-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 20px;
    padding: 14px 20px 20px;
    border-top: 1px solid #eaecf1;
}

.iw-adj-cancel {
    background: none;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: #1a1d24;
    cursor: pointer;
    padding: 12px 8px;
}

.iw-adj-apply {
    background: linear-gradient(135deg, #ff8aa6, #e8446c);
    color: #fff;
    box-shadow: 0 6px 16px -4px rgba(232, 68, 108, 0.45);
}

@media (prefers-color-scheme: dark) {
    .iw-adj-card {
        background: #1c1d24;
    }
    .iw-adj-title {
        color: #f1f2f4;
    }
    .iw-adj-footer {
        border-top-color: #2e303a;
    }
    .iw-adj-cancel {
        color: #f1f2f4;
    }
}
