/* Styles for the pdf2 group (OCR PDF, Watermark PDF). Colours only through theme tokens. */
.px-stack { display: grid; gap: 18px; }
.px-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.px-note { color: var(--muted); font-size: 0.9rem; line-height: 1.45; }
.px-note b { color: var(--fg); }

/* Toggle chips (languages) */
.px-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.px-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--fg); font-weight: 600; font-size: 0.92rem; cursor: pointer;
}
.px-chip svg { width: 16px; height: 16px; opacity: 0; }
.px-chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.px-chip[aria-pressed="true"] svg { opacity: 1; color: var(--accent-strong); }
.px-chip:focus-visible, .px-sw:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.px-chip[disabled] { opacity: 0.55; cursor: not-allowed; }

/* File rows: allow a small progress bar and wrapping actions */
.px-list .file-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
.px-list .progress { margin-top: 6px; height: 4px; max-width: 260px; }
.px-list .ra { flex-wrap: wrap; justify-content: flex-end; }
.px-list .file-row.is-sel { border-color: var(--accent); }
@media (max-width: 520px) {
  .px-list .file-row { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .px-list .file-row .pv { width: 40px; height: 40px; }
  .px-list .file-row .ra { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Text viewer (OCR) */
.px-text { display: grid; gap: 10px; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg); }
.px-text textarea {
  width: 100%; min-height: 220px; resize: vertical; padding: 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg); font: 0.92rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.px-text h3 { font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* Watermark editor: preview next to controls */
.px-wm { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); gap: 22px; align-items: start; }
.px-preview { display: grid; gap: 8px; justify-items: center; position: sticky; top: 12px; }
.px-preview .sheet {
  position: relative; display: grid; place-items: center; width: 100%; min-height: 240px; padding: 14px; border-radius: 14px;
  background: var(--surface-2); overflow: hidden;
}
.px-preview canvas { display: block; max-width: 100%; height: auto; background: var(--paper); box-shadow: 0 1px 6px rgba(0,0,0,.2); border-radius: 2px; }
.px-preview .cap { color: var(--muted); font-size: 0.85rem; text-align: center; overflow-wrap: anywhere; }
.px-controls { display: grid; gap: 16px; min-width: 0; }
.px-controls .field { min-width: 0; }
.px-controls .input, .px-controls .select { width: 100%; }
.px-range { display: grid; grid-template-columns: minmax(0, 1fr) 52px; gap: 10px; align-items: center; }
.px-range input[type="range"] { width: 100%; accent-color: var(--accent); }
.px-range output { font-variant-numeric: tabular-nums; color: var(--fg); font-size: 0.9rem; text-align: right; }
.px-colors { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.px-sw { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; padding: 0; }
.px-sw[aria-pressed="true"] { border-color: var(--fg); box-shadow: 0 0 0 2px var(--surface) inset; }
.px-colors input[type="color"] { width: 44px; height: 34px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 2px; cursor: pointer; }
.px-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.px-controls .seg { flex-wrap: wrap; max-width: 100%; }
.px-controls .seg button { padding: 0 12px; }
.px-logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.px-logo .pv { width: 64px; height: 44px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; overflow: hidden; flex: none; }
.px-logo .pv img { max-width: 100%; max-height: 100%; }
.px-logo .nm { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; color: var(--muted); }
.px-warn { color: var(--danger); font-size: 0.86rem; }
@media (max-width: 860px) {
  .px-wm { grid-template-columns: minmax(0, 1fr); }
  .px-preview { position: static; }
  .px-preview .sheet { min-height: 0; }
}
