/* ── Toaster wrapper ── */
.ai-toaster {
    position: fixed;
    z-index: 10000;
    width: 356px;
    max-width: calc(100vw - 32px);
    pointer-events: none;
}

.ai-toaster[data-pos="top-center"] {
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
}

.ai-toaster[data-pos="top-left"] {
    top: 24px;
    left: 20px;
}

.ai-toaster[data-pos="top-right"] {
    top: 24px;
    right: 20px;
}

.ai-toaster[data-pos="bottom-center"] {
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
}

.ai-toaster[data-pos="bottom-left"] {
    bottom: 24px;
    left: 20px;
}

.ai-toaster[data-pos="bottom-right"] {
    bottom: 24px;
    right: 20px;
}

/* ── Toast list ── */
.ai-toast-list {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0;
}

/* ── Individual toast ── */
.ai-toast {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 14px 16px;
    background: var(--ai-toast-bg);
    border: 1px solid var(--ai-toast-border);
    border-radius: var(--ai-toast-radius);
    box-shadow: var(--ai-toast-shadow);
    cursor: default;
    user-select: none;
    pointer-events: auto;
    backface-visibility: hidden;
    font-family: var(--ii-font-body, Inter, sans-serif);
    overflow: hidden;
    transition:
        transform 400ms cubic-bezier(0.21, 1.02, 0.73, 1),
        opacity 400ms ease,
        height 400ms cubic-bezier(0.21, 1.02, 0.73, 1);
}

.ai-toaster[data-pos^="bottom"] .ai-toast::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 100%;
    height: 8px;
}

.ai-toaster[data-pos^="top"] .ai-toast::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 8px;
}

/* Swiping: disable transition so the toast tracks the pointer exactly */
.ai-toast[data-swiping="true"] {
    transition: opacity 150ms ease !important;
    cursor: grabbing;
}

/* ── Icon ── */
.ai-toast-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
}

.ai-toast-icon svg {
    width: 16px;
    height: 16px;
}

.ai-toast[data-type="success"] .ai-toast-icon {
    color: var(--ai-toast-success);
}

.ai-toast[data-type="error"] .ai-toast-icon {
    color: var(--ai-toast-error);
}

.ai-toast[data-type="warning"] .ai-toast-icon {
    color: var(--ai-toast-warning);
}

.ai-toast[data-type="info"] .ai-toast-icon {
    color: var(--ai-toast-info);
}

/* ── Body ── */
.ai-toast-body {
    flex: 1;
    min-width: 0;
}

.ai-toast-title {
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--ai-toast-text-primary);
}

.ai-toast-desc {
    font-size: 12.5px;
    line-height: 1.45;
    margin-top: 2px;
    color: var(--ai-toast-text-secondary);
}

/* ── Close button ── */
.ai-toast-close {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--ai-toast-text-secondary);
    cursor: pointer;
    padding: 0;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}

.ai-toast-close svg {
    width: 11px;
    height: 11px;
}

.ai-toast:hover .ai-toast-close,
.ai-toast-list[data-expanded="true"] .ai-toast-close {
    opacity: 1;
}

.ai-toast-close:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--ai-toast-border);
    color: var(--ai-toast-text-primary);
}

/* ── Progress bar ── */
.ai-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    border-radius: 0 0 var(--ai-toast-radius) var(--ai-toast-radius);
    background: rgba(255, 255, 255, 0.15);
    transform-origin: left;
}

.ai-toast[data-type="success"] .ai-toast-progress {
    background: var(--ai-toast-success);
    opacity: 0.4;
}

.ai-toast[data-type="error"] .ai-toast-progress {
    background: var(--ai-toast-error);
    opacity: 0.4;
}

.ai-toast[data-type="warning"] .ai-toast-progress {
    background: var(--ai-toast-warning);
    opacity: 0.4;
}

.ai-toast[data-type="info"] .ai-toast-progress {
    background: var(--ai-toast-info);
    opacity: 0.4;
}

.ai-toast-action {
    display: inline-flex;
    align-items: center;
    margin-top: 6px;
    padding: 4px 10px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: inherit;
    font-size: 11px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 150ms, border-color 150ms;
}

.ai-toast-action:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.35);
    color: inherit;
}

/* ── Upload-progress track (type:'progress' toasts) ── */
.ai-toast-upload-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 0 0 var(--ai-toast-radius) var(--ai-toast-radius);
    background: rgba(255, 255, 255, 0.12);
    overflow: hidden;
}

.ai-toast-upload-fill {
    height: 100%;
    background: rgba(255, 255, 255, 0.92);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================================
 *  Variant Picker Modal  (.ii-vp-*)
 *
 *  Opened when user clicks "Compare images" in the ⋮ popper menu
 *  or the compare icon-button inside AIImageViewer.
 *  Shows all sibling variants of a group in 16:9 tiles; user
 *  selects one to open the side-by-side compare slider.
 *
 *  Add this block to components.css (at the bottom, before the
 *  final closing comment if one exists).
