/* PDF Toolkit - tool-specific layout only. Tokens/components come from tools.css. */

.mode-bar { margin-bottom: 24px; }

.panel { display: block; }

/* ---------- shared action bar ---------- */
.action-bar {
  margin-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.action-bar .progress-wrap {
  flex: 1 1 100%;
  order: -1;
}
.progress-wrap { margin-bottom: 4px; }

/* ---------- merge file list ---------- */
.file-list { margin-top: 20px; }

.file-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-surface);
  padding: 14px 16px;
}
.file-row.has-error { border-color: var(--danger); }

.file-row .file-index {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  width: 22px;
  flex: 0 0 auto;
  text-align: right;
}
.file-row .file-glyph {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  color: var(--text-3);
}
.file-row .file-body { min-width: 0; flex: 1; }
.file-row .file-name {
  font-weight: 540;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-row .file-meta { margin-top: 2px; }
.file-row .row-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 3px;
}
.file-row .file-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.mini-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}
.mini-btn:hover:not(:disabled) { border-color: var(--text-3); color: var(--text); }
.mini-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.mini-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
.mini-btn svg { width: 16px; height: 16px; }

.file-row[draggable="true"] { cursor: grab; }
.file-row.dragging { opacity: 0.5; }
.file-row.drop-target { border-color: var(--accent); }

/* ---------- split toolbar ---------- */
.split-toolbar { display: flex; flex-direction: column; gap: 18px; }
.split-range-field { max-width: 420px; }
.split-controls { gap: 10px; }
.rotate-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  padding: 0 4px;
}
.rotate-toggle input { width: auto; accent-color: var(--accent); }

/* ---------- to-images options ---------- */
.topng-options {
  gap: 22px;
  align-items: flex-end;
}
.topng-field { margin: 0; }
.topng-field > label { display: block; }
.topng-quality-field { min-width: 180px; }
.topng-quality-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}
.topng-field .segmented-sm button { padding: 5px 12px; }
.topng-dims { display: block; }

/* ---------- thumbnail grid (split + images) ---------- */
.thumb-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 14px;
}
.thumb {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--r-surface);
  background: var(--surface);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.thumb.selectable { cursor: pointer; }
.thumb.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.thumb .thumb-canvas-wrap {
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border-radius: var(--r-input);
  overflow: hidden;
}
.thumb canvas, .thumb img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 4px;
}
.thumb .thumb-skel {
  width: 100%;
  height: 100%;
}
.thumb .thumb-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.thumb .thumb-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.thumb .thumb-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: transparent;
}
.thumb.selected .thumb-check {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}
.thumb .thumb-check svg { width: 12px; height: 12px; }
.thumb.rotated canvas, .thumb.rotated img { transform: rotate(90deg); }

/* image reorder controls inside thumb foot */
.thumb .thumb-controls { display: flex; gap: 3px; }
.thumb .thumb-controls .mini-btn { width: 26px; height: 26px; }
.thumb .thumb-controls .mini-btn svg { width: 13px; height: 13px; }

@media (max-width: 640px) {
  .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); }
  .action-bar { gap: 12px; }
  .action-bar .row { flex: 1; }
  .file-row { padding: 12px; gap: 10px; }
}
