.pt-card { padding: 28px; }
.pt-title-bar { background: linear-gradient(135deg, var(--site-dark) 0%, var(--site-dark-2) 100%); border-radius: 10px 10px 0 0; padding: 18px 24px; margin: -28px -28px 24px; }
.pt-title-bar h1 { color: #fff; margin: 0; font-size: 1.4em; text-align: center; }

.pt-mode-tabs { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 22px; }
.pt-mode-tab { border: 2px solid #e5e7eb; background: #fff; border-radius: 30px; padding: 8px 18px; font-weight: 600; font-size: .88em; cursor: pointer; color: #4b5563; }
.pt-mode-tab.is-active { border-color: var(--site-light); background: var(--site-light); color: #fff; }

.pt-dropzone { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 32px 20px; text-align: center; color: #6b7280; cursor: pointer; transition: all .15s ease; margin-bottom: 18px; }
.pt-dropzone.dragover { border-color: var(--site-light); background: #eff6ff; }
.pt-dropzone i { font-size: 2.2em; margin-bottom: 10px; display: block; color: var(--site-dark); }
.pt-dropzone input[type="file"] { display: none; }

.pt-file-list { list-style: none; padding: 0; margin: 0 0 18px; }
.pt-file-list li { display: flex; align-items: center; gap: 10px; background: #f8fafc; border: 1px solid #eee; border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; }
.pt-file-list .pt-file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .92em; }
.pt-file-list .pt-file-meta { font-size: .8em; color: #9ca3af; }
.pt-file-list button { background: none; border: none; color: var(--site-danger); cursor: pointer; font-size: 1.05em; padding: 4px 6px; }
.pt-move-btn { background: none; border: none; color: #6b7280; cursor: pointer; padding: 2px 5px; }

.pt-field { margin-bottom: 18px; }
.pt-field label { display: block; font-weight: 600; margin-bottom: 8px; font-size: .92em; }
.pt-field input[type="text"], .pt-field select { width: 100%; border: 1px solid #ddd; border-radius: 8px; padding: 10px 12px; font-size: .95em; }
.pt-field .pt-hint { font-size: .8em; color: #9ca3af; margin-top: 6px; }

.pt-radio-row { display: flex; gap: 18px; flex-wrap: wrap; }
.pt-radio-row label { display: flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }

.pt-btn { border: none; border-radius: 8px; padding: 12px 26px; font-weight: 700; cursor: pointer; font-size: .98em; display: inline-flex; align-items: center; gap: 8px; background: var(--site-light); color: #fff; width: 100%; justify-content: center; }
.pt-btn:disabled { opacity: .45; cursor: not-allowed; }
.pt-btn:not(:disabled):hover { filter: brightness(1.08); }

.pt-status { text-align: center; color: #6b7280; font-size: .9em; margin-top: 14px; min-height: 1.4em; }
.pt-status.pt-error { color: var(--site-danger); }
.pt-status.pt-success { color: var(--site-success); }

/* Process page (merge/split/rotate/delete result screen) */
.pt-process { text-align: center; padding: 20px 10px; }
.pt-process-icon { font-size: 2.6em; color: var(--site-dark); margin-bottom: 14px; display: block; }
.pt-process h1 { font-size: 1.3em; margin: 0 0 22px; }

.pt-progress-wrap { max-width: 420px; margin: 0 auto; }
.pt-progress-track { background: #eee; border-radius: 20px; height: 10px; overflow: hidden; }
.pt-progress-bar { background: var(--site-light); height: 100%; width: 0%; transition: width .25s ease; }
.pt-progress-label { font-size: .88em; color: #6b7280; margin-top: 10px; }

.pt-process-result { display: none; }
.pt-process-result.show { display: block; }
.pt-process-success-icon { font-size: 2.6em; color: var(--site-success); margin-bottom: 12px; display: block; }
.pt-result-preview { max-width: 260px; margin: 0 auto 18px; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 10px rgba(20,22,31,.08); }
.pt-result-preview.hide { display: none; }
.pt-result-preview canvas { display: block; width: 100%; height: auto; }
.pt-process-result p { color: #374151; margin-bottom: 20px; }
.pt-process-result .pt-btn { max-width: 320px; margin: 0 auto 16px; }

.pt-process-back { display: inline-flex; align-items: center; gap: 8px; color: var(--site-dark); font-weight: 700; font-size: .9em; border: 2px solid var(--site-dark); border-radius: 20px; padding: 10px 22px; text-decoration: none; transition: background .15s ease, color .15s ease; }
.pt-process-back:hover { background: var(--site-dark); color: #fff; }
.pt-process-back-wrap { margin-top: 18px; text-align: center; }
.pt-process-result .pt-process-back-wrap { display: none; }

.pt-status.pt-error:empty { display: none; }
#ppError:not(.show) { display: none; }

/* ===== Crop mode ===== */
.pt-crop-wrap { margin-bottom: 18px; }
.pt-crop-change-file { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; background: none; border: none; color: var(--site-dark); font-size: .85em; font-weight: 600; cursor: pointer; padding: 10px 14px; }
.pt-crop-change-file:hover { text-decoration: underline; }
.pt-crop-layout { display: flex; gap: 20px; align-items: flex-start; }
.pt-crop-canvas-wrap { position: relative; display: block; flex: 0 1 60%; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; cursor: crosshair; user-select: none; touch-action: none; }
.pt-crop-canvas-wrap canvas { display: block; width: 100%; height: auto; }
.pt-crop-actions { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 160px; }
.pt-crop-actions .pt-btn { width: 100%; }

@media (max-width: 700px) {
    .pt-crop-layout { flex-direction: column; }
    .pt-crop-canvas-wrap { flex-basis: auto; width: 100%; }
    .pt-crop-actions { width: 100%; }
}
.pt-crop-box { position: absolute; border: 2px dashed var(--site-light); background: rgba(20, 184, 166, .15); pointer-events: none; }
.pt-crop-reset { width: 100%; background: none; border: 1px solid #ddd; border-radius: 20px; padding: 10px 14px; font-size: .85em; font-weight: 600; color: #6b7280; cursor: pointer; }
.pt-crop-reset:hover { background: #f3f4f6; }
.pt-crop-handle { position: absolute; width: 14px; height: 14px; background: var(--site-dark-2); border: 2px solid #fff; border-radius: 50%; pointer-events: auto; box-shadow: 0 1px 4px rgba(0,0,0,.3); }
.pt-crop-handle-nw { top: -8px; left: -8px; cursor: nwse-resize; }
.pt-crop-handle-ne { top: -8px; right: -8px; cursor: nesw-resize; }
.pt-crop-handle-sw { bottom: -8px; left: -8px; cursor: nesw-resize; }
.pt-crop-handle-se { bottom: -8px; right: -8px; cursor: nwse-resize; }
@media (max-width: 700px) {
    .pt-crop-handle { width: 20px; height: 20px; }
    .pt-crop-handle-nw { top: -11px; left: -11px; }
    .pt-crop-handle-ne { top: -11px; right: -11px; }
    .pt-crop-handle-sw { bottom: -11px; left: -11px; }
    .pt-crop-handle-se { bottom: -11px; right: -11px; }
}
