#pdf-reord-ui {
    max-width: 1040px;
    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;
}

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

#reord-drop-zone {
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s, background 0.2s;
}

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

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

#reord-drop-zone p { color: #7f8c8d; margin-bottom: 1rem; }
.reord-hint { color: #95a5a6; font-size: 14px; margin-top: 0.5rem; }
.reord-filename { color: #4e73df; font-weight: 600; margin-top: 0.5rem; }

#reord-pdf-upload { display: none; }

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

.reord-btn-primary { background: #4e73df; color: #fff; }
.reord-btn-primary:hover { background: #3d5fc4; }
.reord-btn-secondary { background: #eef2ff; color: #334155; margin: 4px 2px; }
.reord-btn-secondary:hover { background: #dbe4ff; }
.reord-btn-success { background: #28a745; color: #fff; }

.reord-btn-icon {
    width: 28px;
    height: 28px;
    padding: 0;
    line-height: 26px;
    font-size: 16px;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
    cursor: pointer;
}

.reord-btn-icon:hover:not(:disabled) {
    border-color: #4e73df;
    color: #4e73df;
}

.reord-btn-icon:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

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

.reord-page-info,
.reord-render-status {
    text-align: left;
    color: #64748b;
    font-size: 14px;
    margin: 0 0 0.75rem;
}

.reord-render-status {
    font-weight: 600;
    color: #4e73df;
}

.reord-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 1rem;
}

.reord-toolbar-hint {
    font-size: 13px;
    color: #94a3b8;
    width: 100%;
    text-align: center;
    margin-top: 4px;
}

.reord-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 1.25rem;
    justify-content: flex-start;
    min-height: 80px;
    padding: 4px;
}

.reord-card {
    width: 132px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
    background: #fff;
    cursor: grab;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    user-select: none;
    touch-action: none;
}

.reord-card:hover {
    border-color: #93c5fd;
}

.reord-card.is-dragging {
    opacity: 0.45;
    cursor: grabbing;
}

.reord-card.is-drop-target {
    border-color: #4e73df;
    box-shadow: 0 0 0 3px rgba(78, 115, 223, 0.25);
    transform: scale(1.03);
}

.reord-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
    gap: 4px;
}

.reord-pos {
    font-size: 11px;
    font-weight: 700;
    color: #4e73df;
    background: #eff6ff;
    padding: 2px 6px;
    border-radius: 4px;
}

.reord-orig {
    font-size: 10px;
    color: #94a3b8;
}

.reord-card-actions {
    display: flex;
    gap: 2px;
}

.reord-thumb-wrap {
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    border-radius: 6px;
    overflow: hidden;
}

.reord-thumb-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.reord-placeholder {
    font-size: 28px;
    font-weight: 700;
    color: #cbd5e1;
}

.reord-actions { margin-top: 0.5rem; }

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

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

.reord-result-info {
    color: #64748b;
    margin-bottom: 1rem;
}

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

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

@media (max-width: 640px) {
    #pdf-reord-ui { padding: 1rem; }
    .reord-card { width: calc(50% - 8px); }
}
