/* PDF extras (pdf-extras.js): compress to size, extract images, N-up, booklet, bookmarks, split by chapters. */

.px-target-row { display: flex; gap: 8px; }
.px-target-row .form-input { flex: 1 1 auto; min-width: 0; font-size: 18px; font-weight: 600; }
.px-target-row .form-select { flex: 0 0 92px; }
.px-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.px-chip { min-height: 34px; padding: 6px 12px; }
.px-chip.active {
  border-color: var(--accent-cyan, #06b6d4);
  background: rgba(6, 182, 212, 0.16);
  color: var(--text-strong);
}

.px-result {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--sunken);
  color: var(--text-strong);
  font-size: 13.5px;
  line-height: 1.5;
}
.px-result[hidden] { display: none; }
.px-result a { color: inherit; text-decoration: underline; }
.px-ok { border-color: rgba(16, 185, 129, 0.55); background: rgba(16, 185, 129, 0.10); }
.px-warn { border-color: rgba(245, 158, 11, 0.6); background: rgba(245, 158, 11, 0.10); }
.px-bad { border-color: rgba(239, 68, 68, 0.6); background: rgba(239, 68, 68, 0.10); }
.px-info { border-color: rgba(99, 102, 241, 0.55); background: rgba(99, 102, 241, 0.10); }
.px-dim { color: var(--text-muted); font-size: 12.5px; }

.px-note {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed var(--border-subtle);
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
}
.px-note strong { color: var(--text-strong); }

/* N-up preview: a small sheet with numbered cells */
.px-preview { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.px-sheet {
  display: grid;
  gap: 3px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--border-subtle);
  border-radius: 3px;
  box-shadow: 0 2px 10px rgba(var(--ink, 0, 0, 0), 0.15);
  flex: 0 0 auto;
}
.px-sheet.px-portrait { width: 64px; height: 90px; }
.px-sheet.px-landscape { width: 90px; height: 64px; }
.px-sheet span {
  display: flex; align-items: center; justify-content: center;
  background: #e0f2fe; color: #0c4a6e; border-radius: 2px;
  font-size: 10px; font-weight: 700; min-width: 0; min-height: 0;
}

/* Bookmarks */
.px-label-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.px-label-row .form-label { margin: 0; }
.px-toc { width: 100%; min-height: 150px; resize: vertical; font-family: var(--font-mono, monospace); font-size: 13px; line-height: 1.55; }
.px-checks { display: grid; gap: 6px; margin: 4px 0 10px; }

/* Split by chapters */
.px-front { align-self: end; }
.px-chapters { margin-top: 10px; }
.px-chap-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; color: var(--text-muted); font-size: 13px; }
.px-chap-head span { margin-right: auto; }
.px-chap-list {
  list-style: none; margin: 0; padding: 0;
  max-height: 280px; overflow: auto;
  border: 1px solid var(--border-subtle); border-radius: 10px; background: var(--sunken);
}
.px-chap-list li + li { border-top: 1px solid var(--border-subtle); }
.px-chap-list label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; cursor: pointer; }
.px-chap-title { flex: 1 1 auto; min-width: 0; color: var(--text-strong); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.px-chap-pages { flex: 0 0 auto; color: var(--text-muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }

@media (max-width: 520px) {
  .px-chip { flex: 1 1 calc(33% - 6px); }
}

/* Keep the two columns of a row level (the global .form-group + .form-group margin would push the right one down). */
.px-grid > .form-group + .form-group { margin-top: 0; }
.px-grid + .px-grid, .px-grid + .checkbox-group { margin-top: 12px; }
