@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: 40px;
}

#upload {
    scroll-margin-top: 40px;
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    margin: 0;
}

:root {
    --bg:            #060a14;
    --bg2:           #0c1220;
    --glass:         rgba(13,20,40,0.7);
    --glass2:        rgba(17,24,42,0.8);
    --border:        rgba(255,255,255,0.07);
    --border-glow:   rgba(139,92,246,0.35);
    --primary:       #8b5cf6;
    --primary-dim:   rgba(139,92,246,0.12);
    --primary-glow:  rgba(139,92,246,0.4);
    --accent:        #06b6d4;
    --accent-dim:    rgba(6,182,212,0.1);
    --accent-glow:   rgba(6,182,212,0.35);
    --success:       #10b981;
    --danger:        #ef4444;
    --text:          #f1f5f9;
    --text-muted:    #64748b;
    --text-dim:      #94a3b8;
    --radius:        16px;
    --radius-sm:     10px;
    --shadow:        0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow:   0 8px 32px var(--primary-glow);
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
    line-height: 1.6;
}

/* Ambient background blobs */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    filter: blur(80px);
}
body::before {
    width: 600px; height: 600px;
    top: -200px; left: -200px;
    background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, transparent 70%);
}
body::after {
    width: 500px; height: 500px;
    bottom: -150px; right: -150px;
    background: radial-gradient(circle, rgba(6,182,212,0.15) 0%, transparent 70%);
}

/* ── Shell ────────────────────────────────────────────────────────────────── */
.shell {
    position: relative;
    z-index: 1;
    max-width: 1080px;
    margin: 0 auto;
    padding: 20px 24px 80px;
    width: 100%;
    overflow-x: hidden;
}

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 22px;
    background: var(--glass2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 24px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 1080px;
    margin-left: auto;
    margin-right: auto;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-width: 0; }

.brand-icon {
    width: 42px; height: 42px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 900; font-size: 1.3rem; color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
    flex-shrink: 0;
}

.brand-img { height: 38px; width: auto; object-fit: contain; max-width: 160px; }

.brand-info { min-width: 0; }
.brand-info strong { display: block; font-size: 1.05rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-info small { color: var(--text-muted); font-size: 0.75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-wrap: wrap;
}

.header-nav .nav-link {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 8px;
    transition: all 0.18s ease;
}

.header-nav .nav-link:hover {
    color: var(--text);
    background: rgba(255,255,255,0.08);
}

.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    font-family: inherit; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; border: none; text-decoration: none;
    transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
    white-space: nowrap;
    max-width: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #6d28d9);
    color: #fff;
    box-shadow: 0 4px 16px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 24px var(--primary-glow); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none !important; box-shadow: none; }

.btn-ghost {
    background: var(--glass);
    border: 1px solid var(--border);
    color: var(--text-dim);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-dim);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger-ghost {
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.2);
    color: #fca5a5;
}
.btn-danger-ghost:hover { background: rgba(239,68,68,0.18); }

.btn.disabled, .btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* ── Layout ───────────────────────────────────────────────────────────────── */
.workspace {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
}

.main-col { display: flex; flex-direction: column; gap: 24px; width: 100%; min-width: 0; }

.vector-settings-bar {
    padding: 12px 20px;
}

.side-card-title {
    font-size: 0.85rem; font-weight: 700;
    margin-bottom: 8px;
    display: flex; justify-content: space-between; align-items: center;
}

.side-card-title span { color: var(--text-muted); font-size: 0.72rem; font-weight: 400; }

.settings-grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.slider-field { margin-bottom: 0; }

.slider-meta {
    display: flex; justify-content: space-between;
    font-size: 0.76rem; color: var(--text-dim);
    margin-bottom: 2px;
}

.slider-meta output { color: #c4b5fd; font-weight: 600; }

/* Custom Toggle Switch */
.toggle-sw {
    appearance: none;
    -webkit-appearance: none;
    width: 36px;
    height: 18px;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid var(--border);
    border-radius: 100px;
    position: relative;
    cursor: pointer;
    outline: none;
    transition: background 0.25s ease, border-color 0.25s ease;
    flex-shrink: 0;
}

.toggle-sw::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 12px;
    height: 12px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.toggle-sw:checked {
    background: var(--primary);
    border-color: var(--primary);
}

.toggle-sw:checked::after {
    transform: translateX(18px);
}

/* Custom Range Slider */
.range-inp {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 100px;
    outline: none;
    cursor: pointer;
}

.range-inp::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease;
}

.range-inp::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    background: #22d3ee;
}

.range-inp::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px var(--accent-glow);
    cursor: pointer;
}

.toggles-flex-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    flex-wrap: wrap;
}

.toggle-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 12px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex: 1;
    min-width: 180px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.18s;
}

.toggle-chip:hover { background: rgba(255,255,255,0.04); }

/* ── Glass card ───────────────────────────────────────────────────────────── */
.glass-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 100%;
    overflow: hidden;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero {
    padding: 44px 32px;
    position: relative;
    overflow: hidden;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: '';
    position: absolute;
    right: -60px; top: -60px;
    width: 300px; height: 300px;
    background: radial-gradient(circle, rgba(139,92,246,0.2) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.hero-eyebrow {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 16px;
    background: var(--primary-dim);
    border: 1px solid rgba(139,92,246,0.25);
    border-radius: 100px;
    color: #c4b5fd;
    font-size: 0.78rem; font-weight: 600;
    margin-bottom: 16px;
    max-width: 100%;
}

.hero h1 {
    font-size: clamp(1.6rem, 3vw, 2.5rem);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 14px;
    background: linear-gradient(135deg, #fff 30%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    max-width: 800px;
}

.hero-subtitle {
    color: var(--text-dim);
    font-size: 1rem;
    line-height: 1.65;
    max-width: 620px;
    margin: 0 auto;
}

/* ── Dropzone ─────────────────────────────────────────────────────────────── */
.dropzone {
    border: 2px dashed rgba(139,92,246,0.4);
    border-radius: var(--radius);
    padding: 20px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.28s ease;
    background: var(--primary-dim);
    position: relative;
    max-width: 100%;
}

.dropzone:hover, .dropzone.drag-over {
    border-color: var(--accent);
    background: var(--accent-dim);
    transform: scale(1.005);
    box-shadow: 0 0 40px rgba(6,182,212,0.15), inset 0 0 40px rgba(6,182,212,0.05);
}

.dz-icon {
    width: 38px; height: 38px;
    background: rgba(139,92,246,0.15);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 6px;
    font-size: 1.15rem;
    border: 2px solid rgba(139,92,246,0.3);
    transition: all 0.28s ease;
}

.dropzone:hover .dz-icon {
    background: rgba(6,182,212,0.15);
    border-color: rgba(6,182,212,0.4);
}

.dropzone h2 { font-size: 1.05rem; font-weight: 700; margin-bottom: 3px; }
.dropzone p  { color: var(--text-muted); font-size: 0.8rem; margin-bottom: 8px; }

.dropzone #chooseFiles {
    padding: 6px 16px;
    font-size: 0.8rem;
}

.dropzone .dz-formats {
    display: flex; justify-content: center; gap: 6px; margin-top: 6px; flex-wrap: wrap;
}

.fmt-badge {
    padding: 3px 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.72rem; font-weight: 700;
    color: var(--text-muted); letter-spacing: 0.04em;
}

/* ── Dropzone Live Upload Previews (Micro Chips Inside Dropzone) ────────── */
.dz-upload-list {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed rgba(255, 255, 255, 0.12);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    text-align: left;
    width: 100%;
    max-width: 100%;
}

.dz-upload-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 3px;
    background: rgba(8, 14, 26, 0.92);
    border: 1px solid var(--border);
    border-radius: 20px;
    transition: all 0.2s ease;
    animation: fadeInScale 0.2s ease-out;
    position: relative;
    overflow: hidden;
    max-width: 220px;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}

.dz-upload-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.dz-upload-info {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    flex: 1;
}

.dz-upload-filename {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 110px;
}

.dz-upload-pct {
    font-weight: 700;
    font-size: 0.68rem;
    color: var(--accent);
    white-space: nowrap;
}

.dz-upload-bar-wrap {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
}

.dz-upload-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.15s ease-out;
}

.dz-upload-item.done {
    border-color: rgba(16, 185, 129, 0.4);
    background: rgba(16, 185, 129, 0.1);
}

.dz-upload-item.done .dz-upload-pct {
    color: var(--success);
}

.dz-upload-item.error {
    border-color: rgba(239, 68, 68, 0.4);
    background: rgba(239, 68, 68, 0.1);
}

.dz-upload-item.error .dz-upload-pct {
    color: var(--danger);
}

/* ── Progress ─────────────────────────────────────────────────────────────── */
.progress-wrap {
    padding: 16px 22px;
    display: none;
    max-width: 100%;
}

.progress-meta {
    display: flex; justify-content: space-between;
    font-size: 0.85rem; color: var(--text-dim);
    margin-bottom: 10px;
}

.progress-track {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 100px;
    overflow: hidden;
}

#progressBar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 100px;
    width: 0%;
    transition: width 0.4s ease;
}

/* ── Queue header ─────────────────────────────────────────────────────────── */
.queue-header {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 6px 0;
    width: 100%;
}

.queue-header-top {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.queue-header-top h2 { font-size: 1.25rem; font-weight: 700; }
.queue-header-top p  { color: var(--text-muted); font-size: 0.85rem; margin-top: 2px; }

.queue-header-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.queue-action-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    flex-wrap: wrap;
}

/* Queue Header Stats Badges - Matched to Button Dimensions */
.queue-stats-badges {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-right: auto;
}

.q-stat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 22px;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}

.q-stat-total {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.q-stat-completed {
    background: rgba(16, 185, 129, 0.12);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.q-stat-pending {
    background: rgba(245, 158, 11, 0.12);
    color: #fde68a;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty-state {
    padding: 48px 24px;
    text-align: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    max-width: 100%;
}

.empty-icon { font-size: 2.8rem; margin-bottom: 12px; opacity: 0.4; }
.empty-state strong { display: block; font-size: 1.05rem; margin-bottom: 6px; }
.empty-state span   { color: var(--text-muted); font-size: 0.875rem; }

/* ── Image grid ───────────────────────────────────────────────────────────── */
.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

/* ── Image card ───────────────────────────────────────────────────────────── */
.image-card {
    background: var(--glass2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    max-width: 100%;
}

.image-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.image-card.is-done { border-color: rgba(16,185,129,0.3); }
.image-card.is-processing { border-color: rgba(139,92,246,0.4); }
.image-card.has-error { border-color: rgba(239,68,68,0.3); }

/* card toolbar */
.card-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: rgba(0,0,0,0.25);
    border-bottom: 1px solid var(--border);
}

.file-badge {
    font-size: 0.68rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 3px 9px;
    border-radius: 100px;
    background: rgba(255,255,255,0.07);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

.image-card.is-done   .file-badge { background: rgba(16,185,129,0.15); color: #6ee7b7; border-color: rgba(16,185,129,0.3); }
.image-card.is-processing .file-badge { background: var(--primary-dim); color: #c4b5fd; border-color: rgba(139,92,246,0.3); }
.image-card.has-error .file-badge { background: rgba(239,68,68,0.15); color: #fca5a5; border-color: rgba(239,68,68,0.3); }

.remove-btn {
    background: none; border: none;
    color: var(--text-muted); cursor: pointer;
    font-size: 1.1rem; line-height: 1;
    padding: 4px 6px; border-radius: 6px;
    transition: all 0.15s;
}
.remove-btn:hover { background: rgba(239,68,68,0.15); color: #fca5a5; }

/* preview slider */
.preview-slider {
    position: relative;
    width: 100%;
    height: 220px;
    background: #000;
    overflow: hidden;
    user-select: none;
    touch-action: pan-y;
}

.preview-slider img.before-img,
.preview-slider .after-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}

.before-img { object-fit: contain; z-index: 1; }

.after-layer {
    background: #fff;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    z-index: 2;
}

.svg-preview {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
}

.svg-preview svg {
    max-width: 100%; max-height: 220px;
    width: auto; height: auto; display: block;
}

.slider-range {
    position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0; cursor: ew-resize; z-index: 10;
    touch-action: pan-y;
}

.slider-line {
    position: absolute; top: 0; bottom: 0;
    width: 2px; z-index: 9;
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent-glow);
    pointer-events: none;
    transition: left 0.05s linear;
}

.slider-handle {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 28px; height: 28px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    z-index: 9; pointer-events: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.6rem; color: #fff;
}

.preview-labels {
    position: absolute; bottom: 8px;
    left: 8px; right: 8px;
    display: flex; justify-content: space-between;
    z-index: 8; pointer-events: none;
}

.preview-label {
    font-size: 0.65rem; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.06em;
    padding: 2px 8px; border-radius: 4px;
    backdrop-filter: blur(6px);
}

.preview-label.original { background: rgba(0,0,0,0.5); color: #fff; }
.preview-label.vector    { background: rgba(0,0,0,0.5); color: #6ee7b7; }

/* card body */
.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.card-filename {
    font-size: 0.88rem; font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.card-status-text { font-size: 0.8rem; color: var(--text-muted); }
.image-card.is-done .card-status-text   { color: var(--success); }
.image-card.has-error .card-status-text { color: var(--danger); }
.image-card.is-processing .card-status-text { color: #c4b5fd; }

.card-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card-actions .btn { flex: 1; min-width: 100px; padding: 8px 12px; font-size: 0.82rem; }

.btn-vectorize  { background: linear-gradient(135deg, var(--primary), #6d28d9); color: #fff; box-shadow: 0 2px 10px var(--primary-glow); }
.btn-download   { background: rgba(16,185,129,0.12); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.25); }
.btn-download.disabled { opacity: 0.3; pointer-events: none; }

/* ── Settings sidebar ─────────────────────────────────────────────────────── */
.side-card {
    background: var(--glass);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    backdrop-filter: blur(20px);
    max-width: 100%;
}

.side-card-title {
    font-size: 0.9rem; font-weight: 700;
    margin-bottom: 16px;
    display: flex; justify-content: space-between; align-items: center;
}

.side-card-title span { color: var(--text-muted); font-size: 0.75rem; font-weight: 400; }

.slider-field { margin-bottom: 16px; }

.slider-meta {
    display: flex; justify-content: space-between;
    font-size: 0.8rem; color: var(--text-dim);
    margin-bottom: 6px;
}

.slider-meta output { color: #c4b5fd; font-weight: 600; }

.range-inp {
    width: 100%;
    accent-color: var(--primary);
    cursor: pointer;
}

.toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
    cursor: pointer;
}
.toggle-row:last-child { border-bottom: none; }

.toggle-sw {
    width: 40px; height: 22px;
    appearance: none;
    background: rgba(255,255,255,0.1);
    border-radius: 100px;
    cursor: pointer;
    position: relative;
    transition: background 0.2s;
    flex-shrink: 0;
}
.toggle-sw::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 16px; height: 16px;
    background: #fff; border-radius: 50%;
    transition: transform 0.2s;
}
.toggle-sw:checked { background: var(--primary); }
.toggle-sw:checked::after { transform: translateX(18px); }

/* History panel */
.history-list {
    display: flex; flex-direction: column; gap: 0;
    max-height: 220px;
    overflow-y: auto;
}

.history-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-dim);
}
.history-item:last-child { border-bottom: none; }
.history-item a { color: var(--accent); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Warning banner ───────────────────────────────────────────────────────── */
.warn-banner {
    padding: 18px 22px;
    background: rgba(239,68,68,0.08);
    border: 1px solid rgba(239,68,68,0.25);
    border-radius: var(--radius-sm);
    color: #fca5a5;
    font-size: 0.875rem;
    max-width: 100%;
}

.warn-banner h2 { color: var(--danger); font-size: 1rem; margin-bottom: 8px; }

.maint-banner {
    padding: 18px 22px;
    background: rgba(245,158,11,0.08);
    border: 1px solid rgba(245,158,11,0.25);
    border-radius: var(--radius-sm);
    color: #fde68a;
    max-width: 100%;
}

.maint-banner h2 { font-size: 1rem; margin-bottom: 6px; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer {
    margin-top: 50px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    max-width: 100%;
}

.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.18s; }
.footer-links a:hover { color: var(--text); }

/* ── Scrollbar ────────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Mobile & Tablet Responsiveness ────────────────────────────────────────── */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative;
    }

    .shell {
        padding: 12px 14px 40px;
    }

    .topbar {
        padding: 10px 14px;
        margin-bottom: 20px;
        border-radius: 12px;
    }

    .brand-icon {
        width: 36px; height: 36px; font-size: 1.1rem;
    }

    .brand-info small { display: none; }

    .topbar-right {
        gap: 6px;
    }

    .topbar-right .btn {
        padding: 6px 12px;
        font-size: 0.78rem;
    }

    .hero {
        padding: 24px 18px;
        border-radius: 14px;
    }

    .hero h1 {
        font-size: 1.45rem;
    }

    .hero-subtitle {
        font-size: 0.88rem;
    }

    .dropzone {
        padding: 28px 16px;
        border-radius: 14px;
    }

    .dz-icon {
        width: 50px; height: 50px; font-size: 1.6rem; margin-bottom: 12px;
    }

    .dropzone h2 {
        font-size: 1.1rem;
    }

    .dropzone p {
        font-size: 0.82rem;
        margin-bottom: 16px;
    }

    .queue-header {
        flex-direction: column;
        align-items: stretch;
    }

    #processAll {
        width: 100%;
        padding: 12px;
        font-size: 0.95rem;
    }

    .settings-grid-3 {
        grid-template-columns: 1fr;
    }

    .image-grid {
        grid-template-columns: 1fr;
    }

    .side-col {
        position: static;
    }

    .site-footer {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    .footer-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .brand-info strong {
        font-size: 0.92rem;
    }

    .topbar-right .btn {
        padding: 6px 10px;
        font-size: 0.72rem;
    }
}

/* ========================================================
   HOMEPAGE DYNAMIC CONTENT SECTIONS STYLES
   ======================================================== */
.homepage-dynamic-sections {
    width: 100%;
    margin-top: 40px;
    margin-bottom: 20px;
}

.hp-section {
    width: 100%;
    position: relative;
    box-sizing: border-box;
    transition: all 0.3s ease;
    border-radius: 20px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    overflow: hidden;
}

/* Background Presets */
.hp-section.bg-white {
    background: #ffffff;
    color: #0f172a;
}
.hp-section.bg-white .hp-title { color: #0f172a; }
.hp-section.bg-white .hp-description { color: #334155; }
.hp-section.bg-white .hp-eyebrow { color: var(--primary); }

.hp-section.bg-light_gray {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
}

.hp-section.bg-dark {
    background: #0b1120;
    color: #ffffff;
    border-color: rgba(255,255,255,0.1);
}

.hp-section.bg-gradient {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(6, 182, 212, 0.15) 100%);
    border-color: var(--primary-glow);
    color: var(--text);
}

.hp-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.hp-grid {
    display: flex;
    gap: 40px;
    width: 100%;
}

.hp-grid.pos-left {
    flex-direction: row-reverse;
}

.hp-grid.pos-right {
    flex-direction: row;
}

/* Alignment */
.hp-grid.align-top { align-items: flex-start; }
.hp-grid.align-center { align-items: center; }
.hp-grid.align-bottom { align-items: flex-end; }

/* Layout Grid Ratios */
.hp-grid.layout-50-50 .hp-content { flex: 1; }
.hp-grid.layout-50-50 .hp-media { flex: 1; }

.hp-grid.layout-40-60 .hp-content { flex: 0.4; }
.hp-grid.layout-40-60 .hp-media { flex: 0.6; }

.hp-grid.layout-60-40 .hp-content { flex: 0.6; }
.hp-grid.layout-60-40 .hp-media { flex: 0.4; }

.hp-grid.layout-full {
    flex-direction: column !important;
    align-items: center;
    text-align: center;
}
.hp-grid.layout-full .hp-content,
.hp-grid.layout-full .hp-media {
    width: 100%;
}

/* Typography & Content */
.hp-eyebrow {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 10px;
}

.hp-title {
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 16px;
}

.hp-description {
    font-size: 1.05rem;
    line-height: 1.6;
    opacity: 0.9;
    margin-bottom: 24px;
}

.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* CTA Button */
.hp-btn-wrap {
    margin-top: 20px;
}

.hp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s ease;
    box-shadow: 0 6px 20px var(--primary-glow);
}

.hp-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px var(--primary-glow);
    color: #ffffff;
}

/* Media & Image Sizes */
.hp-media {
    display: flex;
    justify-content: center;
    align-items: center;
}

.hp-img {
    max-width: 100%;
    height: auto;
    border-radius: 14px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.3);
    object-fit: cover;
}

.img-small .hp-img { max-width: 320px; }
.img-medium .hp-img { max-width: 520px; }
.img-large .hp-img { max-width: 760px; }
.img-full .hp-img { width: 100%; max-width: 100%; }

/* Animations */
.anim-fade { animation: hpFadeIn 0.8s ease forwards; }
.anim-slide_left { animation: hpSlideLeft 0.8s ease forwards; }
.anim-slide_right { animation: hpSlideRight 0.8s ease forwards; }
.anim-zoom { animation: hpZoomIn 0.8s ease forwards; }
.anim-scale { animation: hpScaleUp 0.8s ease forwards; }

@keyframes hpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes hpSlideLeft {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes hpSlideRight {
    from { opacity: 0; transform: translateX(-40px); }
    to { opacity: 1; transform: translateX(0); }
}
@keyframes hpZoomIn {
    from { opacity: 0; transform: scale(0.92); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes hpScaleUp {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .hp-grid {
        flex-direction: column !important;
        gap: 28px;
    }
    .hp-content {
        text-align: center !important;
    }
    .hp-media {
        width: 100% !important;
    }
    .hp-img {
        max-width: 100% !important;
    }
}

