/* Image Merger — imr- */
.imr-upload-zone {
    border: 2px dashed rgba(139, 92, 246, 0.35);
    border-radius: 16px;
    background: rgba(139, 92, 246, 0.04);
    padding: 56px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    outline: none;
}

.imr-upload-zone:hover,
.imr-upload-zone:focus,
.imr-upload-zone.imr-drag-over {
    border-color: #8B5CF6;
    background: rgba(139, 92, 246, 0.08);
}

.imr-upload-icon {
    font-size: 3rem;
    color: #8B5CF6;
    opacity: 0.7;
    margin-bottom: 14px;
    display: block;
}

.imr-upload-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
}

.imr-upload-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0;
}

.imr-section {
    padding: 40px 0 60px;

}

.imr-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem
}

.imr-badge {
    width: 44px;
    height: 44px;
    background: rgba(139, 92, 246, .15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #8B5CF6;
    flex-shrink: 0
}

.imr-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0F172A;
    margin: 0 0 .2rem
}

.imr-subtitle {
    font-size: 0.9375rem;
    color: #64748B;
    margin: 0
}

.imr-file-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: 1.25rem;
    padding: .75rem;
    background: #F8FAFC;
    border-radius: 8px;
    border: 1px solid #E2E8F0
}

.imr-file-chip {
    background: #F1F5F9;
    border-radius: 5px;
    padding: .3rem .6rem;
    font-size: 0.8125rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: .35rem
}

.imr-file-chip i {
    font-size: 0.8125rem;
    color: #8B5CF6
}

.imr-controls {
    background: #F8FAFC;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    border: 1px solid #E2E8F0;
    display: flex;
    flex-direction: column;
    gap: .75rem
}

.imr-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .75rem;
    align-items: end
}

.imr-group {
    display: flex;
    flex-direction: column;
    gap: .4rem
}

.imr-group--color {
    justify-content: center
}

.imr-label {
    font-size: 0.9375rem;
    color: #64748B;
    display: flex;
    align-items: center;
    gap: .5rem
}

.imr-val-badge {
    background: #F1F5F9;
    border-radius: 4px;
    padding: .1rem .4rem;
    font-size: 0.8125rem;
    color: #8B5CF6
}

.imr-slider {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: #F1F5F9;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
    width: 100%
}

.imr-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #8B5CF6;
    cursor: pointer
}

.imr-input {
    background: #F1F5F9;
    border: 1px solid #E2E8F0;
    border-radius: 6px;
    padding: .45rem .7rem;
    color: #0F172A;
    font-size: 0.9375rem;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.imr-input:focus {
    border-color: #8B5CF6;
}

.imr-dir-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.imr-align-tabs {
    display: flex;
    gap: .4rem;
}

.imr-dir-tab,
.imr-align-tab {
    padding: .35rem .8rem;
    border-radius: 5px;
    border: 1px solid #E2E8F0;
    background: none;
    color: #64748B;
    cursor: pointer;
    font-size: 0.9375rem;
    transition: all .2s;
    display: flex;
    align-items: center;
    gap: .3rem
}

.imr-dir-tab.active,
.imr-align-tab.active {
    background: #8B5CF6;
    color: #fff;
    border-color: #8B5CF6
}

.imr-color-input {
    width: 48px;
    height: 36px;
    border: 2px solid #E2E8F0;
    border-radius: 6px;
    background: none;
    cursor: pointer;
    padding: 2px
}

.imr-actions {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
    margin-bottom: 1.25rem
}

.imr-btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .55rem 1.2rem;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity .2s, transform .1s
}

.imr-btn:active {
    transform: scale(.97)
}

.imr-btn--primary {
    background: #8B5CF6;
    color: #fff
}

.imr-btn--ghost {
    background: #F1F5F9;
    color: var(--text-secondary, #64748b);
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.imr-btn--ghost:hover {
    border-color: #8B5CF6;
    color: #8B5CF6;
}

.imr-btn--success {
    background: transparent;
    border: 1px solid #8B5CF6;
    color: #8B5CF6;
}

.imr-btn--success:hover {
    background: rgba(139, 92, 246, 0.08);
}

.imr-preview-label {
    font-size: 0.9375rem;
    color: #64748B;
    margin-bottom: .5rem
}

/* ── Side-by-side layout ─────────────────────────────────────────── */
.imr-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.25rem;
}

.imr-col-controls {
    min-width: 0;
}

.imr-col-preview {
    position: sticky;
    top: 90px;
}

.imr-preview-box {
    background: #F8FAFC;
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid #E2E8F0;
    text-align: center;
}

.imr-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .6rem;
}

.imr-pane-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #64748B;
}

#imr-preview-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
    margin: 0 auto;
    border: 1px solid #E2E8F0;
}

/* ── Format select ─────────────────────────────────────────────── */
.imr-format-select {
    padding: 0.45rem 0.7rem;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    background: #F8FAFC;
    color: var(--text-secondary, #64748b);
    font-size: 0.875rem;
    cursor: pointer;
    outline: none;
}

.imr-collage-opts {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-bottom: .75rem;
}

@media(max-width:860px) {
    .imr-layout {
        grid-template-columns: 1fr;
    }

    .imr-col-preview {
        position: static;
        order: -1;
    }
}

@media(max-width:600px) {
    .imr-row {
        grid-template-columns: 1fr
    }
}