/* Anubis PDF - merge tool (pairs with /assets/js/pdf-merge.js) */

#mergeTool .hidden { display: none !important; }
.pm-drop { background: #fff; border: 2px dashed #f59e0b; border-radius: 16px; padding: 32px 20px; text-align: center; cursor: pointer; margin-bottom: 20px; transition: background .15s, border-color .15s; }
.pm-drop:hover, .pm-drop.dragover { background: #fffbeb; border-color: #b45309; }
.pm-drop-title { font-size: 20px; font-weight: 800; color: #0f172a; margin: 0 0 6px; }
.pm-drop-sub { font-size: 14px; color: #475569; margin: 0 0 14px; }
.pm-drop-note { font-size: 12px; color: #64748b; margin: 12px 0 0; }
.pm-cta { display: inline-block; background: #b45309; color: #fff; font-weight: 800; font-size: 14px; border: 0; border-radius: 12px; padding: 10px 24px; cursor: pointer; }
.pm-cta:hover { background: #92400e; }
.pm-cta-big { display: block; width: 100%; font-size: 18px; padding: 16px; }

.pm-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 8px; }
.pm-bar-title { font-size: 17px; font-weight: 800; color: #0f172a; margin: 0; }
.pm-bar-sum { font-size: 12px; color: #64748b; }
.pm-bar-space { flex: 1 1 auto; }
.pm-chip { background: #fff; border: 1px solid #fcd34d; color: #78350f; font-size: 12px; font-weight: 700; border-radius: 9px; padding: 7px 10px; cursor: pointer; min-height: 34px; }
.pm-chip:hover { background: #fef3c7; }
.pm-chip-danger { border-color: #fecaca; color: #b91c1c; }
.pm-chip-danger:hover { background: #fee2e2; }
.pm-hint { font-size: 12px; color: #64748b; margin: 0 0 12px; }
.pm-warnbox { font-size: 13px; line-height: 1.6; color: #92400e; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 10px 12px; margin: 0 0 12px; }

.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pm-card { position: relative; background: #fff; border: 1px solid #fde68a; border-radius: 12px; padding: 8px; -webkit-user-select: none; user-select: none; min-width: 0; cursor: grab; }
.pm-card:hover { border-color: #f59e0b; box-shadow: 0 6px 18px rgba(180, 83, 9, .12); }
.pm-card.pm-warn { border-color: #fca5a5; background: #fff7f7; }
.pm-card.pm-dragging { opacity: .35; }
.pm-card.pm-flash { animation: pm-flash 1.1s ease-out; }
@keyframes pm-flash { 0% { box-shadow: 0 0 0 4px rgba(245, 158, 11, .7); } 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); } }
.pm-ghost { position: fixed; left: 0; top: 0; z-index: 500; pointer-events: none; opacity: .92; box-shadow: 0 18px 40px rgba(15, 23, 42, .35); transform: translate(-999px, -999px); cursor: grabbing; }
.pm-thumb { position: relative; aspect-ratio: 3 / 4; background: #f1f5f9; border-radius: 8px; overflow: hidden; cursor: zoom-in; }
.pm-pic { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.pm-pic img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; pointer-events: none; }
.pm-ico { font-size: 34px; line-height: 1; }
.pm-state { font-size: 11px; font-weight: 700; color: #b91c1c; text-align: center; padding: 0 6px; }
.pm-spin { width: 26px; height: 26px; border: 3px solid #fde68a; border-top-color: #b45309; border-radius: 50%; animation: pm-spin .8s linear infinite; }
@keyframes pm-spin { to { transform: rotate(360deg); } }
.pm-num { position: absolute; top: 6px; inset-inline-start: 6px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: #b45309; color: #fff; font-size: 13px; font-weight: 800; line-height: 26px; text-align: center; unicode-bidi: isolate; }
.pm-pages { position: absolute; bottom: 6px; inset-inline-end: 6px; background: rgba(15, 23, 42, .78); color: #fff; font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 6px; }
.pm-grip { position: absolute; top: 4px; inset-inline-end: 4px; width: 30px; height: 30px; border-radius: 8px; background: rgba(255, 255, 255, .92); border: 1px solid #e2e8f0; color: #475569; font-size: 18px; line-height: 28px; text-align: center; cursor: grab; touch-action: none; }
.pm-name { font-size: 12px; font-weight: 700; color: #0f172a; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-meta { font-size: 11px; color: #64748b; direction: ltr; text-align: start; }
.pm-actions { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; gap: 4px; margin-top: 6px; }
.pm-btn { width: 30px; height: 30px; border: 1px solid #e2e8f0; background: #f8fafc; color: #334155; border-radius: 8px; font-size: 14px; line-height: 1; cursor: pointer; padding: 0; }
.pm-btn:hover { background: #fef3c7; border-color: #fcd34d; }
.pm-del { position: absolute; bottom: 6px; inset-inline-start: 6px; width: 28px; height: 28px; border-radius: 50%; border: 1px solid #fecaca; background: rgba(255, 255, 255, .95); color: #b91c1c; font-size: 13px; line-height: 1; padding: 0; cursor: pointer; }
.pm-del:hover { background: #fee2e2; }
.pm-pos { width: 100%; min-width: 0; height: 30px; border: 1px solid #e2e8f0; border-radius: 8px; text-align: center; font-size: 13px; font-weight: 700; color: #0f172a; background: #fff; padding: 0 2px; -moz-appearance: textfield; direction: ltr; }
.pm-pos::-webkit-outer-spin-button, .pm-pos::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pm-pos:focus { outline: 2px solid #f59e0b; border-color: #f59e0b; }

.pm-panel { background: #fff; border: 1px solid #fde68a; border-radius: 16px; padding: 24px; text-align: center; margin-top: 20px; }
.pm-panel-ok { border-color: #6ee7b7; }
.pm-panel-title { font-size: 18px; font-weight: 800; color: #0f172a; margin: 0 0 12px; }
.pm-panel-info { font-size: 14px; color: #475569; margin: 0 0 16px; }
.pm-track { background: #fef3c7; border-radius: 999px; height: 12px; overflow: hidden; }
.pm-fill { height: 100%; width: 0; background: linear-gradient(90deg, #f59e0b, #b45309); border-radius: 999px; transition: width .25s; }
.pm-row { display: flex; flex-wrap: wrap; gap: 10px; }
.pm-row > * { flex: 1 1 160px; }
.pm-ghostbtn { background: #fff; border: 1px solid #fcd34d; color: #78350f; font-weight: 700; font-size: 14px; border-radius: 12px; padding: 10px 16px; cursor: pointer; }
.pm-ghostbtn:hover { background: #fef3c7; }
.pm-notes { text-align: start; background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 10px 14px; margin: 0 0 16px; max-height: 220px; overflow: auto; }
.pm-note-title { font-size: 13px; font-weight: 800; color: #92400e; margin: 4px 0; }
.pm-note-list { margin: 0 0 6px; padding-inline-start: 18px; font-size: 12px; color: #475569; list-style: disc; }
.pm-note-list em { color: #b91c1c; font-style: normal; }

.pm-modal { position: fixed; inset: 0; z-index: 300; background: rgba(15, 23, 42, .9); display: none; flex-direction: column; }
.pm-modal.open { display: flex; }
.pm-pv-head, .pm-pv-foot { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: #fff; }
.pm-pv-title { flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pm-pv-foot { justify-content: center; flex-wrap: wrap; }
.pm-pv-info { font-size: 13px; font-weight: 700; min-width: 70px; text-align: center; direction: ltr; }
.pm-pv-btn { background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .3); color: #fff; font-size: 13px; font-weight: 700; border-radius: 10px; min-height: 40px; padding: 6px 12px; cursor: pointer; }
.pm-pv-btn:hover { background: rgba(255, 255, 255, .28); }
.pm-pv-body { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px; }
.pm-pv-body canvas { background: #fff; box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.pm-pv-msg { color: #fff; font-size: 15px; font-weight: 700; }

.pm-toast { position: fixed; z-index: 600; bottom: 22px; left: 50%; transform: translateX(-50%); max-width: min(92vw, 520px); background: #1e293b; color: #fff; font-size: 13px; font-weight: 700; line-height: 1.5; padding: 11px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .3); text-align: center; }
.pm-toast-error { background: #b91c1c; }

@media (max-width: 640px) {
  .pm-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .pm-card { padding: 6px; }
  .pm-actions { grid-template-columns: 28px minmax(0, 1fr) 28px; }
  .pm-btn { width: 28px; height: 32px; }
  .pm-pos { height: 32px; }
  .pm-grip { width: 34px; height: 34px; line-height: 32px; }
  .pm-drop { padding: 24px 14px; }
}
