/* ===================================================================
   PDF Chop Shop — Cyberpunk Design System
   =================================================================== */

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

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

/* ---- Design Tokens ---- */
:root {
    /* Backgrounds */
    --bg-void:        #06060c;
    --bg-surface:     #0d0d1a;
    --bg-card:        rgba(18, 18, 34, 0.6);
    --bg-card-hover:  rgba(26, 26, 51, 0.7);
    --bg-panel:       rgba(10, 10, 20, 0.85);
    --bg-toolbar:     rgba(12, 12, 24, 0.92);
    --bg-modal:       rgba(8, 8, 16, 0.95);

    /* Neon Accents */
    --neon-cyan:      #00f0ff;
    --neon-magenta:   #ff00aa;
    --neon-green:     #39ff14;
    --neon-amber:     #ffaa00;
    --neon-purple:    #bf00ff;

    /* Glow */
    --glow-cyan:        0 0 12px rgba(0, 240, 255, 0.25);
    --glow-cyan-strong: 0 0 25px rgba(0, 240, 255, 0.45);
    --glow-magenta:     0 0 12px rgba(255, 0, 170, 0.25);
    --glow-magenta-strong: 0 0 25px rgba(255, 0, 170, 0.45);
    --glow-green:       0 0 12px rgba(57, 255, 20, 0.25);

    /* Text */
    --text-primary:   #ffffff;
    --text-secondary: #ccddff;
    --text-muted:     #aaccff;
    --text-neon:      #00f0ff;

    /* Fonts */
    --font-display:   'Orbitron', sans-serif;
    --font-body:      'Inter', sans-serif;

    /* Spacing */
    --radius-xs: 4px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --gap-xs: 4px;
    --gap-sm: 8px;
    --gap-md: 16px;
    --gap-lg: 24px;
    --gap-xl: 32px;

    /* Transitions */
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
    --transition-fast: 150ms var(--ease-out-expo);
    --transition-med:  300ms var(--ease-out-expo);
    --transition-slow: 500ms var(--ease-out-expo);
}

/* ---- Base ---- */
html, body {
    height: 100%;
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Subtle grid pattern overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.015) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.015) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* ---- App Layout ---- */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

/* ===================================================================
   NEON SIGN STOREFRONT
   =================================================================== */
#storefront {
    display: flex;
    justify-content: center;
    padding: 32px 16px 0;
}

#storefront.hidden {
    display: none;
}

.neon-sign {
    position: relative;
    display: flex;
    justify-content: center;
    filter: drop-shadow(0 0 60px rgba(255, 255, 255, 0.1)) drop-shadow(0 0 120px rgba(255, 255, 255, 0.06)) drop-shadow(0 0 200px rgba(255, 255, 255, 0.03));
}

/* Hanging chains */
.neon-chain {
    position: absolute;
    top: -20px;
    width: 2px;
    height: 20px;
    background: linear-gradient(to bottom,
        rgba(120, 120, 160, 0.6),
        rgba(120, 120, 160, 0.3));
    border-radius: 1px;
}

.neon-chain-left {
    left: 60px;
}

.neon-chain-right {
    right: 60px;
}

/* Sign frame — like a real mounted neon sign */
.neon-sign-frame {
    position: relative;
    border: 2px solid rgba(120, 120, 160, 0.15);
    border-radius: 12px;
    padding: 20px 44px 16px;
    background:
        radial-gradient(ellipse at center, rgba(0, 240, 255, 0.03) 0%, transparent 70%),
        rgba(6, 6, 12, 0.7);
    backdrop-filter: blur(6px);
    box-shadow:
        inset 0 0 40px rgba(0, 0, 0, 0.5),
        0 4px 30px rgba(0, 0, 0, 0.4);
}

/* Inner sign — metal backing */
.neon-sign-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

/* Each line of the sign */
.neon-line {
    display: flex;
    align-items: baseline;
    gap: 14px;
}

/* ---- Neon text styling ---- */
/* "PDF" top line — cyan → magenta gradient */
.neon-text-pdf {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    background: linear-gradient(90deg, var(--neon-cyan) 0%, var(--neon-magenta) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter:
        drop-shadow(0 0 6px rgba(0, 240, 255, 0.5))
        drop-shadow(0 0 20px rgba(0, 240, 255, 0.3))
        drop-shadow(0 0 40px rgba(255, 0, 170, 0.25));
    animation: neon-steady 3s ease-in-out infinite;
}

.neon-text-chop {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--neon-magenta);
    text-shadow:
        0 0 4px rgba(255, 255, 255, 0.4),
        0 0 15px var(--neon-magenta),
        0 0 40px var(--neon-magenta),
        0 0 80px var(--neon-magenta),
        0 0 140px var(--neon-magenta);
}

.neon-text-shop {
    font-family: var(--font-display);
    font-size: 3.2rem;
    font-weight: 900;
    letter-spacing: 6px;
    text-transform: uppercase;
    color: var(--neon-cyan);
    text-shadow:
        0 0 4px rgba(255, 255, 255, 0.4),
        0 0 15px var(--neon-cyan),
        0 0 40px var(--neon-cyan),
        0 0 80px var(--neon-cyan),
        0 0 140px var(--neon-cyan);
}

/* ---- Tagline under the sign ---- */
.neon-sign-tagline {
    text-align: center;
    margin-top: 10px;
    font-family: var(--font-display);
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: rgba(0, 240, 255, 0.5);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
    animation: neon-steady 4s ease-in-out infinite;
}

/* ---- Flicker Animations ---- */
/* Steady gentle pulse */
@keyframes neon-steady {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.92; }
}

/* Flicker 1 — "H's" occasionally dims then snaps back */
.neon-flicker-1 {
    animation: flicker1 4s ease-in-out infinite;
}

@keyframes flicker1 {
    0%, 19%, 21%, 23%, 25%, 54%, 100% {
        opacity: 1;
        text-shadow:
            0 0 4px rgba(255, 255, 255, 0.4),
            0 0 15px var(--neon-magenta),
            0 0 40px var(--neon-magenta),
            0 0 80px var(--neon-magenta),
            0 0 120px var(--neon-magenta);
    }
    20%, 24% {
        opacity: 0.3;
        text-shadow: none;
    }
    22% {
        opacity: 0.7;
        text-shadow:
            0 0 8px var(--neon-magenta);
    }
}

/* Flicker 2 — "Chop" has a quick double-blink */
.neon-flicker-2 {
    animation: flicker2 6s ease-in-out infinite;
}

@keyframes flicker2 {
    0%, 64%, 66%, 69%, 71%, 100% {
        opacity: 1;
        text-shadow:
            0 0 4px rgba(255, 255, 255, 0.4),
            0 0 15px var(--neon-magenta),
            0 0 40px var(--neon-magenta),
            0 0 80px var(--neon-magenta),
            0 0 140px var(--neon-magenta);
    }
    65%, 70% {
        opacity: 0.2;
        text-shadow: none;
    }
    67% {
        opacity: 0.9;
        text-shadow:
            0 0 10px var(--neon-magenta);
    }
}

/* Flicker 3 — "Shop" has a longer off moment */
.neon-flicker-3 {
    animation: flicker3 8s ease-in-out infinite;
}

@keyframes flicker3 {
    0%, 40%, 43%, 45%, 47%, 100% {
        opacity: 1;
        text-shadow:
            0 0 4px rgba(255, 255, 255, 0.4),
            0 0 15px var(--neon-cyan),
            0 0 40px var(--neon-cyan),
            0 0 80px var(--neon-cyan),
            0 0 140px var(--neon-cyan);
    }
    41% {
        opacity: 0.15;
        text-shadow: none;
    }
    42%, 44%, 46% {
        opacity: 0.6;
        text-shadow:
            0 0 8px var(--neon-cyan);
    }
}

@media (max-width: 600px) {
    .neon-text-chop,
    .neon-text-shop {
        font-size: 2rem;
        letter-spacing: 4px;
    }
    .neon-text-pdf {
        font-size: 1.4rem;
        letter-spacing: 4px;
    }
    .neon-sign-frame {
        padding: 16px 24px 12px;
    }
}


/* ===================================================================
   PRIVACY BADGE
   =================================================================== */
#privacy-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    margin: 12px auto 0;
    background: rgba(57, 255, 20, 0.05);
    border: 1px solid rgba(57, 255, 20, 0.15);
    border-radius: 20px;
    max-width: fit-content;
}

.privacy-icon {
    font-size: 0.85rem;
}

.privacy-text {
    font-size: 0.7rem;
    color: var(--neon-green);
    font-weight: 500;
    letter-spacing: 0.5px;
}


/* ===================================================================
   DROPZONE
   =================================================================== */
#dropzone {
    position: relative;
    margin: var(--gap-md);
    margin-top: 0;
    padding: var(--gap-xl) var(--gap-lg);
    border: 2px dashed var(--neon-cyan);
    border-radius: var(--radius-lg);
    background: rgba(0, 240, 255, 0.03);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-med);
    overflow: hidden;
}

#dropzone::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-lg);
    box-shadow: var(--glow-cyan), inset var(--glow-cyan);
    opacity: 0.5;
    transition: opacity var(--transition-med);
    pointer-events: none;
}

#dropzone:hover,
#dropzone.drag-over {
    border-color: var(--neon-magenta);
    background: rgba(255, 0, 170, 0.05);
}

#dropzone:hover::before,
#dropzone.drag-over::before {
    box-shadow: var(--glow-magenta-strong), inset var(--glow-magenta);
    opacity: 1;
}

#dropzone.hidden {
    display: none;
}

.dropzone-icon {
    font-size: 48px;
    margin-bottom: var(--gap-sm);
    filter: drop-shadow(var(--glow-cyan));
}

.dropzone-title {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--neon-cyan);
    text-transform: uppercase;
    margin-bottom: var(--gap-xs);
}

.dropzone-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

#file-input {
    display: none;
}

/* Upload progress bar */
.upload-progress {
    display: none;
    margin-top: var(--gap-md);
}

.upload-progress.active {
    display: block;
}

.progress-bar-track {
    height: 4px;
    background: rgba(0, 240, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    border-radius: 2px;
    transition: width 200ms linear;
    box-shadow: 0 0 10px var(--neon-cyan);
}

.progress-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: var(--gap-xs);
}

/* ===================================================================
   TOOLBAR
   =================================================================== */
#toolbar {
    display: none;
    align-items: center;
    gap: var(--gap-md);
    padding: var(--gap-sm) var(--gap-md);
    margin: 0 var(--gap-md);
    background: var(--bg-toolbar);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    flex-wrap: wrap;
}

#toolbar.visible {
    display: flex;
}

/* Toolbar brand / file info */
.toolbar-brand {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    margin-right: auto;
}

.toolbar-brand h1 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--neon-cyan);
    text-transform: uppercase;
    white-space: nowrap;
}

.file-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-info .page-count {
    color: var(--neon-cyan);
    font-weight: 600;
}

/* Toolbar buttons */
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    flex-wrap: wrap;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--gap-xs);
    padding: 6px 14px;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 500;
    border: 1px solid;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    background: transparent;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:active {
    transform: scale(0.96);
}

.btn-cyan {
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
}

.btn-cyan:hover {
    background: rgba(0, 240, 255, 0.1);
    box-shadow: var(--glow-cyan);
}

.btn-magenta {
    color: var(--neon-magenta);
    border-color: var(--neon-magenta);
}

.btn-magenta:hover {
    background: rgba(255, 0, 170, 0.1);
    box-shadow: var(--glow-magenta);
}

.btn-generate {
    color: #fff;
    border-color: var(--neon-magenta);
    background: linear-gradient(135deg, rgba(255, 0, 170, 0.3), rgba(191, 0, 255, 0.2));
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 0.8rem;
    padding: 8px 20px;
    letter-spacing: 1px;
}

.btn-generate:hover {
    background: linear-gradient(135deg, rgba(255, 0, 170, 0.5), rgba(191, 0, 255, 0.35));
    box-shadow: var(--glow-magenta-strong);
}

.btn-generate.pulse {
    animation: pulse-magenta 2s infinite;
}

@keyframes pulse-magenta {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 0, 170, 0.2); }
    50% { box-shadow: 0 0 20px rgba(255, 0, 170, 0.4); }
}

.btn-ghost {
    color: var(--text-secondary);
    border-color: transparent;
}

.btn-ghost:hover {
    color: var(--text-primary);
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
}

.btn-sm {
    padding: 4px 10px;
    font-size: 0.7rem;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* ---- Toggle Switch ---- */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: var(--gap-xs);
}

.toggle-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.toggle {
    position: relative;
    width: 36px;
    height: 20px;
    appearance: none;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toggle::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: var(--text-secondary);
    border-radius: 50%;
    transition: all var(--transition-fast);
}

.toggle:checked {
    background: rgba(0, 240, 255, 0.2);
    border-color: var(--neon-cyan);
}

.toggle:checked::after {
    left: 18px;
    background: var(--neon-cyan);
    box-shadow: 0 0 8px var(--neon-cyan);
}

/* ---- Divider ---- */
.toolbar-divider {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.08);
}

/* ===================================================================
   WORKSPACE (Split Pane)
   =================================================================== */
#workspace {
    display: none;
    flex: 1;
    gap: var(--gap-md);
    padding: var(--gap-md);
    min-height: 0;
}

#workspace.visible {
    display: flex;
}

/* ---- Panel ---- */
.panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid rgba(0, 240, 255, 0.08);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    overflow: hidden;
    min-width: 0;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap-sm) var(--gap-md);
    border-bottom: 1px solid rgba(0, 240, 255, 0.08);
    flex-shrink: 0;
}

.panel-title {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.panel-source .panel-title {
    color: var(--neon-cyan);
}

.panel-output .panel-title {
    color: var(--neon-magenta);
}

.panel-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 500;
}

.panel-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--gap-sm);
    min-height: 100px;
}

/* Custom scrollbar */
.panel-body::-webkit-scrollbar {
    width: 6px;
}

.panel-body::-webkit-scrollbar-track {
    background: transparent;
}

.panel-body::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.15);
    border-radius: 3px;
}

.panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.3);
}

/* Panel empty state */
.panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: var(--gap-xl);
}

.panel-empty-icon {
    font-size: 40px;
    margin-bottom: var(--gap-md);
    opacity: 0.4;
}

.panel-empty-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

.panel-empty-text strong {
    color: var(--text-secondary);
}

/* ===================================================================
   SECTION CARDS
   =================================================================== */
.section-card {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: 10px 14px;
    margin-bottom: var(--gap-sm);
    background: var(--bg-card);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: var(--radius-md);
    cursor: grab;
    transition: all var(--transition-fast);
    user-select: none;
    position: relative;
    backdrop-filter: blur(8px);
}

.section-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(0, 240, 255, 0.3);
    box-shadow: var(--glow-cyan);
    transform: translateY(-1px);
}

.section-card:active {
    cursor: grabbing;
}

.section-card.type-reference {
    border-color: rgba(255, 0, 170, 0.12);
}

.section-card.type-reference:hover {
    border-color: rgba(255, 0, 170, 0.3);
    box-shadow: var(--glow-magenta);
}

.section-card.selected {
    border-color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    box-shadow: var(--glow-cyan);
}

.section-card.hidden-sweep {
    display: none;
}

/* Card grip handle */
.card-grip {
    color: var(--text-muted);
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity var(--transition-fast);
}

.section-card:hover .card-grip {
    opacity: 0.8;
}

/* Card content */
.card-content {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-meta {
    display: flex;
    gap: var(--gap-sm);
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.card-type-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1px 6px;
    border-radius: 3px;
    flex-shrink: 0;
    align-self: center;
}

.card-type-badge.narrative {
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.card-type-badge.reference {
    color: var(--neon-magenta);
    background: rgba(255, 0, 170, 0.1);
    border: 1px solid rgba(255, 0, 170, 0.2);
}

/* Card page count */
.card-pages {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    text-align: right;
}

.card-pages strong {
    color: var(--text-primary);
    display: block;
    font-size: 0.85rem;
}

/* Card checkbox */
.card-checkbox {
    width: 16px;
    height: 16px;
    appearance: none;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 3px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    position: relative;
}

.card-checkbox:checked {
    background: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
}

.card-checkbox:checked::after {
    content: '✓';
    position: absolute;
    top: -1px;
    left: 2px;
    font-size: 12px;
    color: var(--bg-void);
    font-weight: 700;
}

/* ---- SortableJS states ---- */
.card-ghost {
    opacity: 0.4;
    border-style: dashed;
}

.card-chosen {
    box-shadow: var(--glow-cyan-strong);
    transform: scale(1.02);
}

.card-drag {
    box-shadow: var(--glow-cyan-strong);
}

/* ===================================================================
   STACK CARDS (Grouped sections)
   =================================================================== */
.stack-card {
    padding: 12px 14px;
    margin-bottom: var(--gap-sm);
    background: rgba(255, 0, 170, 0.04);
    border: 1px solid rgba(255, 0, 170, 0.2);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
    backdrop-filter: blur(8px);
}

.stack-card:hover {
    border-color: rgba(255, 0, 170, 0.4);
    box-shadow: var(--glow-magenta);
}

.stack-header {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    margin-bottom: var(--gap-sm);
}

.stack-name {
    flex: 1;
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--neon-magenta);
    background: transparent;
    border: none;
    outline: none;
    padding: 2px 4px;
    border-radius: var(--radius-xs);
    letter-spacing: 0.5px;
}

.stack-name:hover {
    background: rgba(255, 255, 255, 0.05);
}

.stack-name:focus {
    background: rgba(255, 0, 170, 0.1);
    box-shadow: 0 0 0 1px var(--neon-magenta);
}

.stack-pages {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.stack-pages strong {
    color: var(--neon-magenta);
}

.stack-actions {
    display: flex;
    gap: var(--gap-xs);
}

.stack-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: var(--gap-md);
    border-left: 2px solid rgba(255, 0, 170, 0.15);
}

.stack-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-xs);
}

.stack-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stack-item-pages {
    color: var(--text-muted);
    font-size: 0.65rem;
    flex-shrink: 0;
    margin-left: var(--gap-sm);
}

/* ===================================================================
   CONTEXT MENU
   =================================================================== */
.context-menu {
    position: fixed;
    z-index: 1000;
    min-width: 180px;
    padding: var(--gap-xs);
    background: var(--bg-modal);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), var(--glow-cyan);
    display: none;
}

.context-menu.visible {
    display: block;
    animation: contextFadeIn 150ms var(--ease-out-expo);
}

@keyframes contextFadeIn {
    from { opacity: 0; transform: scale(0.95) translateY(-4px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.context-menu-item {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: 8px 12px;
    font-size: 0.8rem;
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-family: var(--font-body);
}

.context-menu-item:hover {
    background: rgba(0, 240, 255, 0.08);
    color: var(--neon-cyan);
}

.context-menu-item .icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.context-menu-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: var(--gap-xs) 0;
}

/* ===================================================================
   MODALS
   =================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 900;
}

.modal-overlay.visible {
    display: flex;
    animation: modalBgIn 200ms ease-out;
}

@keyframes modalBgIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: var(--bg-modal);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-xl);
    padding: var(--gap-lg);
    width: 90%;
    max-width: 480px;
    box-shadow: 0 16px 64px rgba(0, 0, 0, 0.6), var(--glow-cyan);
    animation: modalIn 300ms var(--ease-out-expo);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--neon-cyan);
    margin-bottom: var(--gap-md);
    text-transform: uppercase;
}

.modal-body {
    margin-bottom: var(--gap-lg);
}

.modal-body p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--gap-md);
}

.modal-actions {
    display: flex;
    gap: var(--gap-sm);
    justify-content: flex-end;
}

/* ---- Form inputs ---- */
.input {
    width: 100%;
    padding: 8px 12px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition-fast);
}

.input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 0 2px rgba(0, 240, 255, 0.1);
}

.input::placeholder {
    color: var(--text-muted);
}

.input-number {
    width: 80px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--neon-cyan);
}

/* ===================================================================
   MANUAL MODE SECTION EDITOR
   =================================================================== */
.manual-entry {
    display: flex;
    gap: var(--gap-sm);
    align-items: flex-end;
    margin-bottom: var(--gap-sm);
}

.manual-entry .input {
    flex: 1;
}

.manual-entry .input-page {
    width: 70px;
    text-align: center;
}

/* ===================================================================
   PDF PREVIEW PANEL
   =================================================================== */
.preview-panel {
    position: fixed;
    z-index: 800;
    background: var(--bg-modal);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: var(--gap-sm);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), var(--glow-cyan);
    display: none;
    max-width: 320px;
    backdrop-filter: blur(16px);
}

.preview-panel.visible {
    display: block;
    animation: previewIn 200ms var(--ease-out-expo);
}

@keyframes previewIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.preview-image {
    width: 100%;
    border-radius: var(--radius-sm);
    background: #1a1a2e;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-image img {
    width: 100%;
    border-radius: var(--radius-sm);
}

.preview-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap-xs) 0;
    margin-top: var(--gap-xs);
}

.preview-page-info {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: var(--font-display);
}

/* ===================================================================
   TOAST NOTIFICATIONS
   =================================================================== */
.toast-container {
    position: fixed;
    bottom: var(--gap-lg);
    right: var(--gap-lg);
    z-index: 950;
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--gap-sm);
    padding: 10px 16px;
    background: var(--bg-modal);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-md);
    backdrop-filter: blur(16px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: toastIn 300ms var(--ease-out-expo);
    max-width: 360px;
    font-size: 0.8rem;
}

.toast.success { border-color: var(--neon-green); }
.toast.error { border-color: var(--neon-magenta); }
.toast.warning { border-color: var(--neon-amber); }
.toast.info { border-color: var(--neon-cyan); }

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.toast-exit {
    animation: toastOut 300ms var(--ease-out-expo) forwards;
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(40px); }
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.toast-message {
    flex: 1;
    color: var(--text-primary);
}

/* ===================================================================
   STATUS BAR
   =================================================================== */
#status-bar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 4px var(--gap-md);
    margin: 0 var(--gap-md) var(--gap-sm);
    font-size: 0.7rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(0, 240, 255, 0.06);
}

#status-bar.visible {
    display: flex;
}

.status-warnings {
    color: var(--neon-amber);
    cursor: pointer;
}

.status-warnings:hover {
    text-decoration: underline;
}

/* ===================================================================
   EXPORT PROGRESS OVERLAY
   =================================================================== */
.export-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 6, 12, 0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 850;
    flex-direction: column;
    gap: var(--gap-lg);
}

.export-overlay.visible {
    display: flex;
}

.export-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 240, 255, 0.1);
    border-top-color: var(--neon-cyan);
    border-right-color: var(--neon-magenta);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.export-text {
    font-family: var(--font-display);
    font-size: 0.85rem;
    color: var(--neon-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* ===================================================================
   KEYBOARD SHORTCUT OVERLAY
   =================================================================== */
.shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.shortcuts-overlay.visible {
    display: flex;
}

.shortcuts-panel {
    background: var(--bg-modal);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: var(--radius-xl);
    padding: var(--gap-lg);
    max-width: 400px;
    width: 90%;
}

.shortcuts-panel h2 {
    font-family: var(--font-display);
    font-size: 0.9rem;
    color: var(--neon-cyan);
    margin-bottom: var(--gap-md);
    letter-spacing: 1px;
}

.shortcut-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.shortcut-key {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(0, 240, 255, 0.2);
}

.shortcut-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* ===================================================================
   ANIMATIONS
   =================================================================== */
.card-enter {
    animation: cardSlideIn 300ms var(--ease-out-expo) both;
}

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

.shake {
    animation: shake 400ms ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-4px); }
}

/* Scanning animation for analysis */
.scanning {
    position: relative;
    overflow: hidden;
}

.scanning::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        transparent 0%,
        rgba(0, 240, 255, 0.06) 50%,
        transparent 100%
    );
    animation: scanLine 1.5s ease-in-out infinite;
}

@keyframes scanLine {
    0% { transform: translateY(-100%); }
    100% { transform: translateY(100%); }
}

/* ===================================================================
   MERGE PREVIEW PANEL (hover popup)
   =================================================================== */
.merge-preview-panel {
    position: fixed;
    z-index: 800;
    background: var(--bg-modal);
    border: 1px solid rgba(255, 0, 170, 0.25);
    border-radius: var(--radius-lg);
    padding: var(--gap-sm);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7), var(--glow-magenta);
    display: none;
    width: 320px;
    backdrop-filter: blur(16px);
}

.merge-preview-panel.visible {
    display: block;
    animation: previewIn 200ms var(--ease-out-expo);
}

.merge-preview-filename {
    font-family: var(--font-display);
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--neon-magenta);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 6px 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merge-preview-image {
    width: 100%;
    border-radius: var(--radius-sm);
    background: #1a1a2e;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.merge-preview-image img {
    width: 100%;
    border-radius: var(--radius-sm);
}

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 1024px) {
    #workspace {
        flex-direction: column;
    }

    .panel {
        max-height: 45vh;
    }
}

@media (max-width: 768px) {
    #toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-brand {
        margin-right: 0;
    }

    .toolbar-actions {
        justify-content: center;
    }

    .panel {
        max-height: 40vh;
    }
}

/* ===================================================================
   DROPZONE — MERGE LANDING BUTTON
   =================================================================== */
.dropzone-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px auto 16px;
    max-width: 280px;
}

.dropzone-divider-line {
    flex: 1;
    height: 1px;
    background: rgba(0, 240, 255, 0.12);
}

.dropzone-divider-text {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: var(--font-display);
}

.btn-merge-landing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--neon-magenta);
    background: rgba(255, 0, 170, 0.06);
    border: 1px solid rgba(255, 0, 170, 0.25);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-med);
    position: relative;
    z-index: 2;
}

.btn-merge-landing:hover {
    background: rgba(255, 0, 170, 0.14);
    border-color: var(--neon-magenta);
    box-shadow: var(--glow-magenta-strong);
    transform: translateY(-1px);
}

.btn-merge-landing:active {
    transform: scale(0.97);
}

.merge-landing-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* ===================================================================
   GOOGLE DRIVE IMPORT BUTTONS
   =================================================================== */
.drive-icon {
    width: 16px;
    height: 14px;
    flex-shrink: 0;
}

.btn-drive-landing {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 22px;
    margin-top: 12px;
    font-family: var(--font-display);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-med);
    position: relative;
    z-index: 2;
}

.btn-drive-landing:hover {
    background: rgba(66, 133, 244, 0.1);
    border-color: rgba(66, 133, 244, 0.4);
    color: #fff;
    box-shadow: 0 0 14px rgba(66, 133, 244, 0.15);
    transform: translateY(-1px);
}

.btn-drive-landing:active {
    transform: scale(0.97);
}

.btn-drive-merge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 20px;
    margin-top: 8px;
    font-family: var(--font-display);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-med);
    width: 100%;
    justify-content: center;
}

.btn-drive-merge:hover {
    background: rgba(66, 133, 244, 0.1);
    border-color: rgba(66, 133, 244, 0.4);
    color: #fff;
    box-shadow: 0 0 14px rgba(66, 133, 244, 0.15);
}

/* ===================================================================
   MERGE WORKSPACE (Full-screen view)
   =================================================================== */
#merge-workspace {
    display: none;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 1;
}

#merge-workspace.visible {
    display: flex;
}

.merge-ws-header {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
    padding: var(--gap-sm) var(--gap-md);
    margin: var(--gap-md) var(--gap-md) 0;
    background: var(--bg-toolbar);
    border: 1px solid rgba(255, 0, 170, 0.12);
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
}

.merge-ws-title {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--neon-magenta);
    text-transform: uppercase;
    white-space: nowrap;
}

.merge-ws-spacer {
    flex: 1;
}

.merge-ws-body {
    display: flex;
    flex: 1;
    gap: var(--gap-md);
    padding: var(--gap-md);
    min-height: 0;
}

/* Left: Drop Area */
.merge-ws-drop-panel {
    flex: 0 0 380px;
    display: flex;
    flex-direction: column;
    gap: var(--gap-md);
    align-items: center;
    justify-content: center;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 0, 170, 0.08);
    border-radius: var(--radius-lg);
    padding: var(--gap-lg);
    backdrop-filter: blur(12px);
}

.merge-ws-stats {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
}

/* Right: File List panel */
.merge-ws-list-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-panel);
    border: 1px solid rgba(255, 0, 170, 0.08);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(12px);
    overflow: hidden;
    min-width: 0;
}

.merge-ws-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gap-sm) var(--gap-md);
    border-bottom: 1px solid rgba(255, 0, 170, 0.08);
    flex-shrink: 0;
}

.merge-ws-footer {
    padding: var(--gap-md);
    border-top: 1px solid rgba(255, 0, 170, 0.08);
    display: flex;
    align-items: flex-end;
    gap: var(--gap-md);
    flex-shrink: 0;
}

.merge-ws-footer .merge-output-row {
    flex: 1;
    margin-top: 0;
}

.merge-ws-go {
    flex-shrink: 0;
    padding: 10px 28px !important;
    font-size: 0.85rem !important;
}

/* Merge empty state */
.merge-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: var(--gap-xl);
    min-height: 200px;
}

.merge-empty-icon {
    font-size: 40px;
    margin-bottom: var(--gap-md);
    opacity: 0.4;
}

.merge-empty-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    line-height: 1.6;
}

/* ===================================================================
   MERGE — SHARED STYLES (dropzone, file items)
   =================================================================== */
.merge-dropzone {
    border: 2px dashed rgba(255, 0, 170, 0.2);
    border-radius: var(--radius-md);
    padding: 32px 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-med);
    background: rgba(255, 0, 170, 0.02);
    position: relative;
    width: 100%;
}

.merge-dropzone:hover,
.merge-dropzone.drag-over {
    border-color: var(--neon-magenta);
    background: rgba(255, 0, 170, 0.06);
    box-shadow: var(--glow-magenta);
}

.merge-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.merge-dz-icon { font-size: 2.5rem; margin-bottom: 8px; filter: drop-shadow(var(--glow-magenta)); }
.merge-dz-text { font-size: 0.9rem; color: var(--text-secondary); margin-bottom: 6px; }
.merge-dz-sub  { font-size: 0.72rem; color: var(--text-muted); }

.merge-file-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    overflow-y: auto;
    padding: var(--gap-sm);
    min-height: 80px;
}

/* Custom scrollbar for merge list */
.merge-file-list::-webkit-scrollbar {
    width: 6px;
}
.merge-file-list::-webkit-scrollbar-track {
    background: transparent;
}
.merge-file-list::-webkit-scrollbar-thumb {
    background: rgba(255, 0, 170, 0.15);
    border-radius: 3px;
}
.merge-file-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 0, 170, 0.3);
}

.merge-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    transition: all var(--transition-fast);
    user-select: none;
    animation: cardSlideIn 300ms var(--ease-out-expo) both;
}

.merge-file-item:hover {
    background: rgba(255, 0, 170, 0.04);
    border-color: rgba(255, 0, 170, 0.2);
}

.merge-file-item.uploading {
    border-color: rgba(0, 240, 255, 0.2);
    opacity: 0.7;
}

.merge-file-item.ready {
    border-color: rgba(255, 0, 170, 0.12);
    cursor: grab;
}

.merge-file-item.error {
    border-color: rgba(255, 80, 80, 0.4);
    opacity: 0.6;
}

.merge-file-item .merge-order {
    font-family: var(--font-display);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--neon-magenta);
    min-width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 0, 170, 0.2);
    border-radius: 4px;
    background: rgba(255, 0, 170, 0.06);
    flex-shrink: 0;
}

.merge-grip {
    color: var(--text-muted);
    font-size: 1rem;
    cursor: grab;
    opacity: 0.4;
    transition: opacity var(--transition-fast);
    flex-shrink: 0;
}

.merge-file-item:hover .merge-grip {
    opacity: 0.8;
}

.merge-file-info { flex: 1; min-width: 0; }

.merge-file-name {
    font-size: 0.82rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merge-file-meta {
    font-size: 0.68rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.merge-file-pages {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-secondary);
    flex-shrink: 0;
    text-align: right;
}

.merge-file-pages strong {
    color: var(--neon-magenta);
    display: block;
    font-size: 0.85rem;
}

.merge-file-bar {
    height: 2px;
    background: rgba(0, 240, 255, 0.12);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

.merge-file-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta));
    border-radius: 2px;
    transition: width 0.2s ease;
}

.merge-file-remove {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 2px 6px;
    border-radius: var(--radius-xs);
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.merge-file-remove:hover {
    color: var(--neon-magenta);
    background: rgba(255, 0, 170, 0.08);
}

.merge-output-row {
    margin-top: 14px;
}

.merge-output-row label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
}

@media (max-width: 1024px) {
    .merge-ws-body {
        flex-direction: column;
    }
    .merge-ws-drop-panel {
        flex: 0 0 auto;
    }
}

@media (max-width: 768px) {
    .merge-ws-footer {
        flex-direction: column;
    }
}

/* ===================================================================
   EDIT SECTION MODAL
   =================================================================== */
.edit-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.edit-form-group label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.edit-page-row {
    display: flex;
    gap: 12px;
}

.edit-page-row .edit-form-group { flex: 1; }

.split-divider {
    border: none;
    border-top: 1px solid rgba(0, 240, 255, 0.1);
    margin: 14px 0 12px;
}

.split-enable-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    cursor: pointer;
}

.split-enable-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--neon-cyan);
    cursor: pointer;
}

.split-enable-row label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.split-fields {
    background: rgba(0, 240, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.1);
    border-radius: var(--radius-sm);
    padding: 12px;
}

.split-hint {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    line-height: 1.5;
}
