/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colors */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(20, 20, 32, 0.7);
    --bg-card-hover: rgba(30, 30, 48, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.03);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-active: rgba(99, 102, 241, 0.4);
    --text-primary: #f0f0f5;
    --text-secondary: #8888a0;
    --text-muted: #55556a;
    --accent-1: #6366f1;
    --accent-2: #a855f7;
    --accent-3: #ec4899;
    --gradient-primary: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    --gradient-subtle: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(168,85,247,0.15));
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== ANIMATED BACKGROUND ===== */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-particles::before,
.bg-particles::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.bg-particles::before {
    width: 500px;
    height: 500px;
    background: var(--accent-1);
    top: -10%;
    right: -10%;
    animation-delay: -5s;
}

.bg-particles::after {
    width: 400px;
    height: 400px;
    background: var(--accent-3);
    bottom: -10%;
    left: -10%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(40px, -60px) scale(1.05); }
    50% { transform: translate(-30px, 30px) scale(0.95); }
    75% { transform: translate(20px, 50px) scale(1.02); }
}

/* ===== HEADER ===== */
.app-header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 48px 24px 16px;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.logo-icon {
    width: 40px;
    height: 40px;
}

.logo h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.logo h1 span {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 15px;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.01em;
}

.lang-switcher {
    margin-top: 16px;
    display: flex;
    justify-content: center;
    gap: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.lang-switcher a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.lang-switcher a:hover {
    color: var(--accent-1);
}

.lang-switcher a.active {
    color: var(--text-primary);
    pointer-events: none;
}

/* ===== MAIN ===== */
.app-main {
    position: relative;
    z-index: 1;
    max-width: 780px;
    margin: 0 auto;
    padding: 24px 24px 48px;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* ===== STEP BADGE ===== */
.step-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    font-size: 13px;
    font-weight: 700;
}

.step-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

/* ===== UPLOAD ZONE ===== */
.upload-zone {
    border: 2px dashed var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.upload-zone::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-xl);
    background: var(--gradient-subtle);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--accent-1);
    box-shadow: var(--shadow-glow);
}

.upload-zone:hover::before,
.upload-zone.drag-over::before {
    opacity: 1;
}

.upload-content {
    position: relative;
    z-index: 1;
}

.upload-icon-wrapper {
    margin-bottom: 16px;
}

.upload-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.upload-zone:hover .upload-icon {
    color: var(--accent-2);
}

.upload-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.upload-subtext {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.upload-formats {
    display: inline-block;
    font-size: 12px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    padding: 6px 14px;
    border-radius: 20px;
    letter-spacing: 0.05em;
    font-weight: 500;
}

/* ===== IMAGE PREVIEW CARD ===== */
.image-preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 16px;
    animation: slideUp 0.4s var(--transition-smooth);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.preview-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.preview-info svg {
    color: var(--accent-2);
    flex-shrink: 0;
}

.file-size, .file-dims {
    color: var(--text-muted);
    font-size: 12px;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 6px;
}

.btn-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
}

.btn-remove:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.preview-thumbnail-wrapper {
    padding: 16px;
    display: flex;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
}

.preview-thumbnail-wrapper img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius-sm);
    object-fit: contain;
}

/* ===== OPTIONS ===== */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

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

.option-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color var(--transition-fast);
}

.option-card:hover {
    border-color: rgba(255, 255, 255, 0.1);
}

.option-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Wide card spanning full grid width */
.option-card--wide {
    grid-column: 1 / -1;
}

/* Grid summary badge */
.grid-summary-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    background: var(--gradient-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: none;
    white-space: nowrap;
}

/* Preset grid */
.preset-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.preset-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 10px 8px;
    background: rgba(255,255,255,0.03);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    min-width: 62px;
}

.preset-btn:hover {
    border-color: rgba(99,102,241,0.4);
    background: rgba(99,102,241,0.06);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.preset-btn.active {
    border-color: var(--accent-1);
    background: rgba(99,102,241,0.1);
    color: var(--text-primary);
    box-shadow: 0 0 14px rgba(99,102,241,0.15);
}

/* Mini visual inside preset button */
.preset-visual {
    display: grid;
    gap: 2px;
    width: 40px;
    height: 34px;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    padding: 2px;
    overflow: hidden;
    opacity: 0.7;
}

.preset-btn.active .preset-visual {
    opacity: 1;
}

.pv-cell {
    background: currentColor;
    border-radius: 1px;
    opacity: 0.35;
}

.preset-btn.active .pv-cell {
    opacity: 0.55;
}

/* Custom spinners row */
.custom-grid-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.custom-grid-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.spinner-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.spinner-group label {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.spinner-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.spin-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 18px;
    font-weight: 300;
    cursor: pointer;
    padding: 4px 10px;
    line-height: 1;
    transition: background var(--transition-fast), color var(--transition-fast);
    font-family: 'Inter', sans-serif;
}

.spin-btn:hover {
    background: rgba(99,102,241,0.15);
    color: var(--accent-1);
}

.spin-val {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 26px;
    text-align: center;
    padding: 4px 2px;
}

.spinner-x {
    font-size: 16px;
    color: var(--text-muted);
    font-weight: 300;
    margin-top: 18px;
}

/* Orientation selector */
.orientation-selector {
    display: flex;
    gap: 10px;
}

.orientation-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 14px 8px;
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.orientation-option input { display: none; }

.orientation-option.active {
    border-color: var(--accent-1);
    background: rgba(99, 102, 241, 0.08);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.orientation-option:hover:not(.active) {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.02);
}

.a4-mini {
    display: flex;
    border: 1.5px solid var(--text-muted);
    border-radius: 3px;
    overflow: hidden;
    transition: border-color var(--transition-fast);
}

.orientation-option.active .a4-mini {
    border-color: var(--accent-1);
}

.a4-mini.vertical {
    width: 32px;
    height: 44px;
    flex-direction: column;
}

.a4-mini.horizontal {
    width: 44px;
    height: 32px;
    flex-direction: row;
}

.a4-mini .img-slot {
    flex: 1;
    background: rgba(99, 102, 241, 0.15);
    transition: background var(--transition-fast);
}

.orientation-option.active .a4-mini .img-slot {
    background: rgba(99, 102, 241, 0.25);
}

.a4-mini.vertical .img-slot:first-child {
    border-bottom: 1px dashed var(--text-muted);
}

.a4-mini.horizontal .img-slot:first-child {
    border-right: 1px dashed var(--text-muted);
}

.orientation-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.orientation-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* Fit selector */
.fit-selector {
    display: flex;
    gap: 10px;
}

.fit-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: center;
}

.fit-option input { display: none; }

.fit-option.active {
    border-color: var(--accent-2);
    background: rgba(168, 85, 247, 0.08);
}

.fit-option:hover:not(.active) {
    border-color: rgba(255, 255, 255, 0.15);
}

.fit-icon {
    width: 40px;
    height: 30px;
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

.fit-option.active .fit-icon {
    color: var(--accent-2);
}

.fit-option span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.fit-desc {
    font-size: 11px !important;
    font-weight: 400 !important;
    color: var(--text-muted) !important;
}

/* Margin control */
.margin-control {
    display: flex;
    align-items: center;
    gap: 16px;
}

.margin-control input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.margin-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-1);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
    transition: transform var(--transition-fast);
}

.margin-control input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.margin-control input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-1);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.margin-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-1);
    min-width: 48px;
    text-align: right;
    white-space: nowrap;
}

/* ===== PREVIEW ===== */
.preview-container {
    display: flex;
    justify-content: center;
    padding: 24px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
}

.a4-preview {
    width: 100%;
    max-width: 500px;
    aspect-ratio: auto;
}

.preview-canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

/* ===== ACTION BUTTONS ===== */
.action-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.01em;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.45);
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* ===== FOOTER ===== */
.app-footer {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 32px 24px;
    border-top: 1px solid var(--border-subtle);
}

.app-footer p {
    font-size: 13px;
    color: var(--text-muted);
}

/* ===== PRINT STYLES ===== */
.print-only {
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    z-index: -1;
    pointer-events: none;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media print {
    /* Hide all main UI elements */
    .bg-particles,
    .app-header,
    .app-main,
    .app-footer,
    .lang-switcher,
    .mode-tabs-bar {
        display: none !important;
    }

    body, html {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
        width: auto !important;
        height: auto !important;
        min-height: auto !important;
    }

    .print-only {
        opacity: 1 !important;
        z-index: 99999 !important;
        pointer-events: auto !important;
        position: static !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
        display: block !important;
    }

    .print-only canvas {
        display: none !important;
    }

    .print-only img {
        display: block !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        object-fit: contain !important;
        margin: 0 auto !important;
        page-break-inside: avoid;
    }

    @page {
        margin: 0;
        /* Size is controlled dynamically in JS */
    }
}

/* ===== ANIMATIONS ===== */
.step-section {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
    .app-header {
        padding: 32px 16px 8px;
    }

    .logo h1 {
        font-size: 26px;
    }

    .subtitle {
        font-size: 13px;
    }

    .app-main {
        padding: 16px 16px 32px;
    }

    .upload-zone {
        padding: 32px 16px;
    }

    .upload-icon {
        width: 48px;
        height: 48px;
    }

    .upload-text {
        font-size: 16px;
    }

    .preview-info {
        flex-wrap: wrap;
        gap: 6px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
    }
}

/* ===== MODE TABS ===== */
.mode-tabs-bar {
    display: flex;
    gap: 8px;
    padding: 6px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 4px;
}

.mode-tab {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 18px;
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--text-secondary);
    background: transparent;
}

.mode-tab:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
}

.mode-tab.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.3);
}

/* ===== MULTI UPLOAD ZONE VARIANT ===== */
.upload-zone--multi {
    border-style: dashed;
    border-color: rgba(168, 85, 247, 0.3);
}
.upload-zone--multi:hover {
    border-color: var(--accent-2);
    box-shadow: 0 0 40px rgba(168, 85, 247, 0.15);
}

/* ===== MULTI IMAGE LIST ===== */
.multi-image-list {
    margin-top: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    backdrop-filter: blur(12px);
    animation: slideUp 0.4s var(--transition-smooth);
}

.multi-list-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.multi-list-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.btn-add-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-sm);
    color: var(--accent-1);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
}
.btn-add-more:hover {
    background: rgba(99, 102, 241, 0.22);
}

.btn-clear-all {
    padding: 7px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    color: #f87171;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    transition: all var(--transition-fast);
}
.btn-clear-all:hover {
    background: rgba(239, 68, 68, 0.16);
}

.multi-thumbnails {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 12px;
    padding: 16px;
}

.multi-thumb-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 2px solid var(--border-subtle);
    background: rgba(0,0,0,0.3);
    transition: border-color var(--transition-fast), transform var(--transition-fast);
    cursor: default;
    animation: slideUp 0.3s ease-out;
}

.multi-thumb-item:hover {
    border-color: var(--accent-2);
    transform: scale(1.03);
}

.multi-thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.multi-thumb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.multi-thumb-item:hover .multi-thumb-overlay {
    opacity: 1;
}

.thumb-num {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 22px;
    height: 22px;
    background: var(--gradient-primary);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.thumb-actions {
    display: flex;
    gap: 6px;
}

.thumb-action-btn {
    width: 30px;
    height: 30px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all var(--transition-fast);
}

.thumb-move-btn {
    background: rgba(255,255,255,0.15);
    color: white;
}
.thumb-move-btn:hover { background: rgba(99,102,241,0.5); }

.thumb-delete-btn {
    background: rgba(239,68,68,0.2);
    color: #fca5a5;
}
.thumb-delete-btn:hover { background: rgba(239,68,68,0.5); }

.thumb-name {
    position: absolute;
    bottom: 0; left: 0; right: 0;
    padding: 4px 6px;
    background: rgba(0,0,0,0.7);
    font-size: 9px;
    color: rgba(255,255,255,0.7);
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* ===== PAGE NAVIGATOR ===== */
.page-navigator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.page-nav-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.page-nav-btn:hover:not(:disabled) {
    background: rgba(99,102,241,0.15);
    border-color: var(--accent-1);
    color: var(--text-primary);
}

.page-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.page-nav-info {
    font-size: 14px;
    color: var(--text-secondary);
    min-width: 110px;
    text-align: center;
}

.page-nav-info strong {
    color: var(--text-primary);
}

/* Page dots */
.multi-page-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.page-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-subtle);
    border: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.page-dot.active {
    background: var(--accent-1);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(99,102,241,0.5);
}

/* ===== ACCENT BUTTON (download all) ===== */
.btn-accent {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.btn-accent:hover {
    background: rgba(168, 85, 247, 0.25);
    border-color: var(--accent-2);
    transform: translateY(-1px);
}

/* options injected into mode containers */
.options-section-inner {
    margin-top: 0;
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
}

.toast {
    background: var(--surface-1);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px 20px;
    box-shadow: var(--shadow-sm);
    color: var(--text-base);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-icon {
    color: var(--accent-1);
    display: flex;
    align-items: center;
}

/* ===== DRAG OVER ANIMATION ===== */
.upload-zone {
    transition: all 0.25s ease;
}

.upload-zone.drag-over {
    background: rgba(99, 102, 241, 0.05);
    border-color: var(--accent-1);
    transform: scale(1.02);
}

.upload-zone.drag-over .upload-icon {
    color: var(--accent-1);
    transform: scale(1.1);
}

/* ===== LANG SWITCHER ===== */
.lang-select {
    background: transparent;
    color: var(--text-base);
    border: none;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    outline: none;
    padding: 4px;
}

.lang-select:focus-visible {
    border-radius: 4px;
    box-shadow: 0 0 0 2px var(--accent-1);
}

/* ===== NEW LANG PILL SETTINGS ===== */
.lang-switcher {
    margin-top: 10px;
    display: flex;
    justify-content: center;
}
.lang-pill {
    display: flex;
    background: var(--surface-2);
    border-radius: 20px;
    padding: 4px;
    gap: 4px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}
.lang-btn {
    background: transparent;
    border: none;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.lang-btn:hover {
    color: var(--text-base);
}
.lang-btn.active {
    background: #fff;
    color: var(--accent-1);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
