/* Merge PDF — app-specific styles. Shared tokens/components come from ../styles.css
   (dropped beside this app by the build). Uses the house blue accent (tokens.css
   default), matching Split PDF's convention. */

.wrap { max-width: 720px; padding: 28px 24px 96px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* --- Drop zone --- */
.dropzone {
  border: 2px dashed var(--line-strong); border-radius: var(--radius);
  background: var(--surface); transition: border-color .15s ease, background .15s ease;
}
.dropzone.dragover { border-color: var(--accent); background: var(--accent-soft); }
.empty { display: grid; place-items: center; gap: 12px; padding: 48px 24px; text-align: center; }
.empty svg { color: var(--accent); }
.empty-title { font-weight: 600; }
.empty-sub { color: var(--muted); font-size: 13px; max-width: 420px; }
#pick-file { background: linear-gradient(135deg, #4a84f5, #2f6df0); box-shadow: 0 6px 22px rgba(47,109,240,.35); }

/* --- File list / reorder --- */
.filelist-section { margin-top: 22px; }
.filelist-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.filelist-head .num { font-size: 14px; font-weight: 600; color: var(--muted); }
.filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

.file-card {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  cursor: grab; transition: box-shadow .12s ease, opacity .12s ease;
}
.file-card.dragging { opacity: .45; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
.drag-handle { color: var(--muted); flex: none; display: flex; }
.thumb { width: 40px; height: 52px; object-fit: contain; border-radius: 5px; border: 1px solid var(--line); background: var(--bg); flex: none; }
.thumb-placeholder {
  width: 40px; height: 52px; border-radius: 5px; border: 1px solid var(--line); background: var(--bg);
  display: grid; place-items: center; color: var(--accent); flex: none;
}
.file-card-body { flex: 1; min-width: 0; }
.file-card-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); font-size: 14px; }
.file-card-meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.file-card-actions { display: flex; gap: 4px; flex: none; }
.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px;
  background: transparent; border: 1px solid var(--line); color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn:disabled:hover { background: transparent; border-color: var(--line); color: var(--text); }

.mode-error { color: #b91c1c; font-size: 13px; font-weight: 600; min-height: 18px; margin-top: 10px; }
.mode-action { margin-top: 12px; }

/* Merge PDF button in Tip Jar amber, matching Split PDF's action button. */
#btn-merge { background: linear-gradient(135deg, #f6b545, var(--amber)); color: #2a1500; box-shadow: 0 6px 22px rgba(237,131,54,.35); }

/* --- Progress --- */
.progress { margin-top: 22px; }
.progress-stage { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.progress-bar { height: 8px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent2), var(--accent)); transition: width .2s ease; }

/* --- Result --- */
.results { margin-top: 24px; }
.resbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.resbar .num { font-size: 14px; font-weight: 600; color: var(--muted); }

/* --- Privacy footer --- */
.privacy {
  margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 10px;
}
.privacy .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.privacy .dot.good { background: var(--good); box-shadow: 0 0 0 3px rgba(28,164,99,.18); }

/* --- Toast --- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  background: var(--text); color: #fff; padding: 11px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; pointer-events: none; z-index: 60;
  transition: opacity .2s ease, transform .2s ease; max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* --- Mobile: sticky merge action --- */
@media (max-width: 640px) {
  .mode-action {
    position: sticky; bottom: 0; margin: 16px -24px 0; padding: 12px 24px;
    background: linear-gradient(180deg, rgba(238,241,246,0), var(--bg) 30%);
  }
  .mode-action .btn { width: 100%; justify-content: center; }
  .file-card-actions .icon-btn { width: 34px; height: 34px; }
}
