/* ============================================================
   Image Alpha Channel Remover
   Styles for standalone & batch alpha removal tool.
   ============================================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hidden,
body.img-tool-page .hidden {
    display: none !important;
}

body.alpha-page {
    /* Theme tokens provided by image-tool-shell.css */
}

.alpha-layout {
    display: grid;
    grid-template-columns: minmax(340px, 440px) 1fr;
    gap: 24px;
    align-items: start;
}

/* ---------- Panels ---------- */
.alpha-panel {
    background: var(--input-bg-color, rgba(16, 20, 36, 0.88));
    border: 1px solid var(--input-border-color, rgba(167, 139, 250, 0.2));
    border-radius: 16px;
    padding: 22px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(14px);
    color: var(--primary-text-color, #eef2ff);
}

/* ---------- Upload Area ---------- */
.alpha-upload-area {
    border: 2px dashed rgba(167, 139, 250, 0.35);
    border-radius: 14px;
    padding: 30px 18px;
    text-align: center;
    cursor: pointer;
    background: rgba(124, 58, 237, 0.05);
    transition: border-color 0.22s, background 0.22s, transform 0.22s, box-shadow 0.22s;
}

.alpha-upload-area:hover,
.alpha-upload-area:focus-visible,
.alpha-upload-area.dragover {
    border-color: #a78bfa;
    background: rgba(124, 58, 237, 0.12);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.15);
    transform: translateY(-2px);
    outline: none;
}

.alpha-upload-area svg {
    stroke: #a78bfa;
    margin-bottom: 10px;
}

.alpha-upload-area h3 {
    color: #eef2ff;
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.alpha-upload-area p {
    color: #a5b0cc;
    font-size: 0.82rem;
    margin-bottom: 10px;
}

.alpha-upload-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.3);
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 8px;
}

.alpha-sample-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    cursor: pointer;
    transition: all 0.18s;
}

.alpha-sample-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    color: #fff;
    border-color: #a78bfa;
}

/* ---------- Batch Queue Management Card ---------- */
.alpha-batch-box {
    margin-top: 16px;
    padding: 14px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.32);
    border: 1px solid rgba(167, 139, 250, 0.2);
}

.alpha-batch-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.alpha-batch-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #eef2ff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.alpha-batch-actions {
    display: flex;
    gap: 8px;
}

.alpha-mini-btn {
    padding: 4px 9px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 6px;
    border: 1px solid rgba(167, 139, 250, 0.25);
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    cursor: pointer;
    transition: all 0.15s;
}

.alpha-mini-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    color: #fff;
    border-color: #a78bfa;
}

.alpha-mini-btn.btn-clear:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    border-color: #ef4444;
}

.alpha-batch-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

.alpha-queue-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 8px;
    background: rgba(16, 20, 36, 0.7);
    border: 1px solid rgba(167, 139, 250, 0.15);
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
}

.alpha-queue-item:hover {
    background: rgba(124, 58, 237, 0.15);
    border-color: rgba(167, 139, 250, 0.35);
}

.alpha-queue-item.active {
    background: rgba(124, 58, 237, 0.25);
    border-color: #8b5cf6;
    box-shadow: 0 0 0 1px #8b5cf6;
}

.alpha-queue-thumb {
    width: 38px;
    height: 38px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: repeating-conic-gradient(#333 0% 25%, #222 0% 50%) 50% / 10px 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.alpha-queue-thumb img,
.alpha-queue-thumb canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.alpha-queue-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alpha-queue-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #eef2ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alpha-queue-meta {
    font-size: 0.72rem;
    color: #a5b0cc;
    font-family: ui-monospace, "JetBrains Mono", Consolas, monospace;
}

.alpha-queue-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 4px;
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
    margin-right: 4px;
}

.alpha-queue-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.alpha-queue-del {
    width: 22px;
    height: 22px;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: #a5b0cc;
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.alpha-queue-del:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #f87171;
}

/* ---------- Source Meta Badge ---------- */
.alpha-source-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 14px;
    padding: 12px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(167, 139, 250, 0.18);
}

.alpha-thumb-wrap {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    background: repeating-conic-gradient(#333 0% 25%, #222 0% 50%) 50% / 12px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.alpha-thumb-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.alpha-source-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.alpha-source-name {
    color: #eef2ff;
    font-weight: 700;
    font-size: 0.88rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.alpha-source-dims {
    color: #a5b0cc;
    font-size: 0.78rem;
    font-family: ui-monospace, "JetBrains Mono", Consolas, monospace;
}

.alpha-stats-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 3px;
}

.alpha-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(124, 58, 237, 0.2);
    color: #c4b5fd;
    border: 1px solid rgba(167, 139, 250, 0.25);
}

.alpha-pill.pill-detected {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.35);
}

.alpha-pill.pill-opaque {
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.35);
}

/* ---------- Settings Sections ---------- */
.alpha-settings {
    margin-top: 18px;
}

.alpha-settings-title {
    color: #eef2ff;
    font-family: "Outfit", system-ui, sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(167, 139, 250, 0.16);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alpha-form-group {
    margin-bottom: 16px;
}

.alpha-form-group > label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #eef2ff;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.alpha-form-group .alpha-val {
    color: #c4b5fd;
    font-weight: 700;
    font-size: 0.82rem;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.3);
    padding: 2px 8px;
    border-radius: 999px;
    font-family: ui-monospace, "JetBrains Mono", Consolas, monospace;
}

.alpha-form-group small {
    display: block;
    color: #a5b0cc;
    font-size: 0.78rem;
    margin-top: 6px;
    line-height: 1.4;
}

/* Segmented Control / Button Grid */
.alpha-segmented {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
    gap: 5px;
    background: rgba(0, 0, 0, 0.3);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid rgba(167, 139, 250, 0.2);
}

.alpha-seg-btn {
    padding: 7px 5px;
    background: transparent;
    color: #a5b0cc;
    border: 1px solid transparent;
    border-radius: 7px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    text-align: center;
    transition: all 0.18s;
}

.alpha-seg-btn:hover {
    color: #eef2ff;
    background: rgba(255, 255, 255, 0.05);
}

.alpha-seg-btn.active {
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: #fff;
    border-color: #8b5cf6;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.35);
}

/* ============================================================
   PROMINENT COLOR REPLACEMENT BOX
   ============================================================ */
.alpha-color-box {
    background: rgba(124, 58, 237, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
}

.alpha-color-box-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.alpha-color-box-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #eef2ff;
    display: flex;
    align-items: center;
    gap: 6px;
}

.alpha-color-applies-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: #a78bfa;
    background: rgba(139, 92, 246, 0.15);
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(167, 139, 250, 0.25);
}

.alpha-color-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.alpha-color-picker-wrap {
    position: relative;
    width: 44px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(167, 139, 250, 0.35);
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.alpha-color-picker-wrap input[type="color"] {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    cursor: pointer;
    border: none;
    padding: 0;
}

.alpha-hex-input {
    flex: 1;
    font-family: ui-monospace, "JetBrains Mono", Consolas, monospace !important;
    text-transform: uppercase;
    font-weight: 600;
}

.alpha-eyedropper-btn {
    padding: 0 12px;
    height: 40px;
    border-radius: 8px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #eef2ff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.18s;
}

.alpha-eyedropper-btn:hover {
    background: rgba(139, 92, 246, 0.35);
    border-color: #a78bfa;
}

.alpha-color-swatches {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 7px;
    margin-top: 10px;
}

.alpha-swatch {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 7px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
    position: relative;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.alpha-swatch:hover {
    transform: scale(1.18);
    z-index: 3;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    border-color: #fff;
}

.alpha-swatch.active {
    outline: 2.5px solid #a78bfa;
    outline-offset: 2px;
    transform: scale(1.08);
}

/* Format & Quality Controls */
.alpha-export-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ---------- Actions & Buttons ---------- */
.alpha-btn-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.alpha-main-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #a78bfa, #7c3aed);
    color: #fff;
    border: none;
    box-shadow: 0 8px 22px rgba(124, 58, 237, 0.35);
    transition: all 0.18s;
}

.alpha-main-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(124, 58, 237, 0.45);
}

.alpha-main-btn:active {
    transform: translateY(0);
}

.alpha-batch-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 18px;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff;
    border: none;
    box-shadow: 0 8px 22px rgba(37, 99, 235, 0.35);
    transition: all 0.18s;
}

.alpha-batch-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(37, 99, 235, 0.45);
}

.alpha-secondary-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.alpha-sub-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    background: rgba(139, 92, 246, 0.15);
    color: #eef2ff;
    border: 1px solid rgba(167, 139, 250, 0.28);
    transition: all 0.18s;
}

.alpha-sub-btn:hover {
    background: rgba(139, 92, 246, 0.28);
    border-color: #a78bfa;
    transform: translateY(-1px);
}

.alpha-sub-btn.copied {
    background: rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
    border-color: rgba(16, 185, 129, 0.4);
}

/* ---------- PREVIEW STAGE & TOOLBAR ---------- */
.alpha-preview-panel {
    display: flex;
    flex-direction: column;
    min-height: 600px;
}

.alpha-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.alpha-view-tabs {
    display: inline-flex;
    padding: 3px;
    gap: 3px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(167, 139, 250, 0.2);
}

.alpha-view-tab {
    padding: 6px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #a5b0cc;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 7px;
    transition: all 0.18s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.alpha-view-tab:hover {
    color: #eef2ff;
}

.alpha-view-tab.active {
    background: #8b5cf6;
    color: #fff;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.alpha-tool-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alpha-bg-theme-btn {
    padding: 6px 10px;
    font-size: 0.78rem;
    border-radius: 8px;
    border: 1px solid rgba(167, 139, 250, 0.22);
    background: rgba(0, 0, 0, 0.28);
    color: #a5b0cc;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.18s;
}

.alpha-bg-theme-btn:hover {
    color: #eef2ff;
    border-color: #8b5cf6;
}

/* Stage Workspace */
.alpha-stage-wrap {
    position: relative;
    flex: 1;
    min-height: 460px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(167, 139, 250, 0.2);
    background: #090c16;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

/* Checkerboard Backgrounds */
.checker-dark {
    background: repeating-conic-gradient(#151928 0% 25%, #0f121d 0% 50%) 50% / 24px 24px !important;
}

.checker-light {
    background: repeating-conic-gradient(#c6ccd8 0% 25%, #f1f3f9 0% 50%) 50% / 24px 24px !important;
}

/* Empty Placeholder */
.alpha-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #a5b0cc;
    text-align: center;
    padding: 30px;
}

.alpha-placeholder svg {
    stroke: #6f7c9a;
    opacity: 0.6;
}

/* Comparison Container (Split Slider) */
.alpha-split-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.alpha-canvas-wrap {
    position: relative;
    max-width: 100%;
    max-height: 520px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    border-radius: 6px;
    overflow: hidden;
    display: inline-flex;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

.alpha-orig-canvas,
.alpha-proc-canvas,
.alpha-mask-canvas {
    max-width: 100%;
    max-height: 520px;
    height: auto;
    display: block;
    object-fit: contain;
}

/* Split slider clip overlay */
.alpha-split-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.alpha-split-overlay canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Split Handle Divider */
.alpha-split-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #fff;
    cursor: ew-resize;
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.alpha-split-handle-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: #a78bfa;
}

.alpha-split-handle-knob {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #8b5cf6;
    border: 2.5px solid #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.alpha-split-handle-knob svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* Comparison Badges (Positioned at TOP corners so they never collide with bottom zoom bar) */
.alpha-badge-tag {
    position: absolute;
    top: 12px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    backdrop-filter: blur(8px);
    z-index: 8;
    pointer-events: none;
}

.alpha-badge-orig {
    left: 12px;
    background: rgba(0, 0, 0, 0.7);
    color: #eef2ff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.alpha-badge-proc {
    right: 12px;
    background: rgba(124, 58, 237, 0.8);
    color: #fff;
    border: 1px solid rgba(167, 139, 250, 0.4);
}

/* Zoom Toolbar (Positioned cleanly at bottom center of the stage) */
.alpha-zoom-bar {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(12, 16, 32, 0.88);
    border: 1px solid rgba(167, 139, 250, 0.28);
    border-radius: 999px;
    padding: 3px 8px;
    backdrop-filter: blur(10px);
    z-index: 12;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

.alpha-zoom-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: #a5b0cc;
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.15s;
}

.alpha-zoom-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    color: #fff;
}

.alpha-zoom-level {
    font-size: 0.75rem;
    font-family: ui-monospace, monospace;
    color: #c4b5fd;
    padding: 0 4px;
    min-width: 42px;
    text-align: center;
}

/* ============================================================
   BATCH GALLERY GRID VIEW
   ============================================================ */
.alpha-gallery-container {
    width: 100%;
    height: 100%;
    padding: 16px;
    overflow-y: auto;
    max-height: 520px;
    scrollbar-width: thin;
}

.alpha-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.alpha-gallery-card {
    background: rgba(16, 20, 36, 0.85);
    border: 1px solid rgba(167, 139, 250, 0.2);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.alpha-gallery-card:hover {
    border-color: #8b5cf6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.alpha-gallery-card.active {
    border-color: #a78bfa;
    box-shadow: 0 0 0 2px #8b5cf6;
}

.alpha-gallery-preview {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: repeating-conic-gradient(#333 0% 25%, #222 0% 50%) 50% / 14px 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.alpha-gallery-preview canvas {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.alpha-gallery-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.alpha-gallery-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #eef2ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.alpha-gallery-dims {
    font-size: 0.72rem;
    color: #a5b0cc;
    font-family: ui-monospace, monospace;
}

.alpha-gallery-dl-btn {
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(167, 139, 250, 0.3);
    color: #c4b5fd;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    transition: all 0.15s;
}

.alpha-gallery-dl-btn:hover {
    background: #8b5cf6;
    color: #fff;
}

/* Results Stats Bar */
.alpha-results-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(167, 139, 250, 0.16);
    font-size: 0.82rem;
    color: #a5b0cc;
}

.alpha-results-stat {
    display: flex;
    align-items: center;
    gap: 6px;
}

.alpha-results-stat strong {
    color: #eef2ff;
    font-family: ui-monospace, "JetBrains Mono", Consolas, monospace;
}

/* Info Box formatting */
.alpha-panel .info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin-top: 14px;
}

.alpha-panel .info-box svg {
    flex-shrink: 0;
    margin-top: 2px;
}

/* Toast Message */
.alpha-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: #1e1b4b;
    border: 1px solid #8b5cf6;
    color: #fff;
    padding: 10px 22px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s;
    z-index: 9999;
}

.alpha-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.alpha-toast.error {
    background: #450a0a;
    border-color: #f87171;
    color: #fee2e2;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .alpha-layout {
        grid-template-columns: 1fr;
    }

    .alpha-preview-panel {
        order: -1;
        min-height: 440px;
    }
}

/* ---------- Light Mode Theme ---------- */
[data-theme="light"] .alpha-panel {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(124, 58, 237, 0.16);
    color: #121826;
    box-shadow: 0 12px 32px rgba(30, 20, 60, 0.08);
}

[data-theme="light"] .alpha-upload-area {
    background: rgba(124, 58, 237, 0.04);
    border-color: rgba(124, 58, 237, 0.28);
}

[data-theme="light"] .alpha-upload-area:hover {
    background: rgba(124, 58, 237, 0.08);
}

[data-theme="light"] .alpha-upload-area h3,
[data-theme="light"] .alpha-settings-title,
[data-theme="light"] .alpha-source-name,
[data-theme="light"] .alpha-form-group > label,
[data-theme="light"] .alpha-batch-title,
[data-theme="light"] .alpha-color-box-title,
[data-theme="light"] .alpha-queue-name,
[data-theme="light"] .alpha-gallery-name {
    color: #121826;
}

[data-theme="light"] .alpha-upload-area p,
[data-theme="light"] .alpha-source-dims,
[data-theme="light"] .alpha-form-group small,
[data-theme="light"] .alpha-results-bar,
[data-theme="light"] .alpha-queue-meta,
[data-theme="light"] .alpha-gallery-dims {
    color: #5a6578;
}

[data-theme="light"] .alpha-batch-box,
[data-theme="light"] .alpha-source-meta {
    background: #f3f0fa;
    border-color: rgba(124, 58, 237, 0.14);
}

[data-theme="light"] .alpha-queue-item {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.15);
}

[data-theme="light"] .alpha-color-box {
    background: rgba(124, 58, 237, 0.05);
    border-color: rgba(124, 58, 237, 0.18);
}

[data-theme="light"] .alpha-segmented,
[data-theme="light"] .alpha-view-tabs {
    background: #f3f0fa;
    border-color: rgba(124, 58, 237, 0.18);
}

[data-theme="light"] .alpha-seg-btn,
[data-theme="light"] .alpha-view-tab {
    color: #5a6578;
}

[data-theme="light"] .alpha-sub-btn,
[data-theme="light"] .alpha-mini-btn,
[data-theme="light"] .alpha-eyedropper-btn {
    background: rgba(124, 58, 237, 0.08);
    color: #6d28d9;
    border-color: rgba(124, 58, 237, 0.2);
}

[data-theme="light"] .alpha-sub-btn:hover,
[data-theme="light"] .alpha-mini-btn:hover,
[data-theme="light"] .alpha-eyedropper-btn:hover {
    background: rgba(124, 58, 237, 0.16);
}

[data-theme="light"] .alpha-stage-wrap {
    background: #f7f5fc;
    border-color: rgba(124, 58, 237, 0.18);
}

[data-theme="light"] .alpha-gallery-card {
    background: #ffffff;
    border-color: rgba(124, 58, 237, 0.18);
}

[data-theme="light"] .alpha-results-bar {
    background: #f3f0fa;
    border-color: rgba(124, 58, 237, 0.14);
}

[data-theme="light"] .alpha-results-stat strong {
    color: #121826;
}
