#pdf-merge-ui {
    max-width: 980px;
    margin: 0 auto;
    padding: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.merge-section { text-align: center; }
.merge-section h3, .merge-section h4 { color: #2c3e50; margin-bottom: 1rem; }

#merge-drop-zone {
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1rem;
    transition: all 0.25s ease;
}

#merge-drop-zone.merge-drag {
    border-color: #4e73df;
    background: #f8f9ff;
}

.merge-icon { font-size: 48px; margin-bottom: 1rem; }
.merge-icon-ok { color: #28a745; }

#merge-drop-zone p { color: #7f8c8d; margin-bottom: 1rem; }
.merge-hint { color: #95a5a6; font-size: 14px; margin-top: 0.5rem; }

#merge-file-input { display: none; }

.merge-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s ease;
    text-decoration: none;
}

.merge-btn-primary { background: #4e73df; color: #fff; }
.merge-btn-primary:hover { background: #3d5fc4; }
.merge-btn-secondary { background: #eef2ff; color: #334155; }
.merge-btn-secondary:hover { background: #dbe4ff; }
.merge-btn-success { background: #28a745; color: #fff; margin-top: 0.5rem; }
.merge-btn-success:hover { background: #218838; }

.merge-link-btn {
    background: none;
    border: none;
    color: #4e73df;
    cursor: pointer;
    text-decoration: underline;
    font-size: 14px;
    margin-top: 12px;
    display: inline-block;
}

.merge-summary {
    text-align: left;
    color: #475569;
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.merge-list-label {
    text-align: left;
    color: #334155;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.merge-list-hint {
    font-weight: 400;
    color: #94a3b8;
}

.merge-file-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    text-align: left;
}

.merge-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    cursor: grab;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.merge-file-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.merge-file-item.is-dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.merge-file-item.is-drag-over {
    border-color: #4e73df;
    background: #f8f9ff;
}

.merge-drag-handle {
    color: #94a3b8;
    font-size: 18px;
    user-select: none;
    flex-shrink: 0;
}

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

.merge-file-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merge-file-pages {
    font-size: 12px;
    color: #64748b;
}

.merge-file-remove {
    width: 32px;
    height: 32px;
    border: 1px solid #fecaca;
    border-radius: 6px;
    background: #fff;
    color: #dc2626;
    cursor: pointer;
    flex-shrink: 0;
}

.merge-add-row {
    text-align: left;
    margin-bottom: 1.25rem;
}

.merge-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.5rem;
    justify-content: flex-start;
}

.merge-thumb-wrap {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    background: #fff;
    width: 120px;
}

.merge-page-thumb {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.merge-page-label {
    font-size: 11px;
    margin-top: 6px;
    color: #64748b;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.merge-actions { margin-top: 1rem; }

.merge-progress-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
    margin: 1rem auto;
    max-width: 420px;
}

#merge-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #4e73df, #28a745);
    transition: width 0.15s ease;
}

#merge-progress-status { color: #64748b; font-size: 14px; }

.merge-result-info {
    color: #475569;
    font-size: 15px;
    margin-bottom: 1rem;
}

.merge-status {
    margin-top: 1rem;
    color: #374151;
    font-size: 14px;
}

.merge-status-error { color: #dc2626; }

@media (max-width: 640px) {
    #pdf-merge-ui { padding: 1rem; }
    .merge-file-item { padding: 8px 10px; }
}
