/* The PDF toolkit — structure only. The page sets the --pt-host-* variables to its own tokens. */
.pt-root {
  --pt-surface: var(--pt-host-surface, #ffffff);
  --pt-text: var(--pt-host-text, #1a1a1a);
  --pt-muted: var(--pt-host-muted, #5b5b5b);
  --pt-border: var(--pt-host-border, rgba(0, 0, 0, 0.14));
  --pt-accent: var(--pt-host-accent, #1a1a1a);
  --pt-on-accent: var(--pt-host-on-accent, #ffffff);
  --pt-good: var(--pt-host-good, #1d6b3a);
  --pt-bad: var(--pt-host-bad, #a12a1c);
  --pt-radius: var(--pt-host-radius, 10px);
  color: var(--pt-text);
  font: inherit;
}
.pt-promise { margin: 0 0 12px; font-size: 0.92em; color: var(--pt-muted); }
.pt-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.pt-tab {
  font: inherit; font-size: 0.9em; padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--pt-border); background: transparent; color: var(--pt-text);
}
.pt-tab[aria-selected="true"] { background: var(--pt-accent); color: var(--pt-on-accent); border-color: var(--pt-accent); }
.pt-tab:focus-visible, .pt-btn:focus-visible, .pt-mini:focus-visible { outline: 2px solid var(--pt-accent); outline-offset: 2px; }
.pt-panel { display: grid; gap: 10px; }
.pt-blurb { margin: 0; color: var(--pt-muted); }
.pt-field { display: grid; gap: 4px; font-size: 0.9em; }
.pt-file, .pt-text {
  font: inherit; color: var(--pt-text); background: var(--pt-surface); max-width: 100%;
  border: 1px solid var(--pt-border); border-radius: calc(var(--pt-radius) * 0.6); padding: 7px 9px;
}
.pt-btn {
  font: inherit; justify-self: start; padding: 8px 16px; border-radius: 999px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--pt-border); background: transparent; color: var(--pt-text); display: inline-block;
}
.pt-btn.pt-primary { background: var(--pt-accent); color: var(--pt-on-accent); border-color: var(--pt-accent); }
.pt-btn:disabled { opacity: 0.55; cursor: progress; }
.pt-mini {
  font: inherit; font-size: 0.85em; min-width: 28px; padding: 2px 6px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--pt-border); background: var(--pt-surface); color: var(--pt-text);
}
.pt-mini:disabled { opacity: 0.4; cursor: default; }
.pt-list { margin: 0; padding-left: 1.4em; display: grid; gap: 4px; }
.pt-name { overflow-wrap: anywhere; }
.pt-status { min-height: 1.2em; font-size: 0.92em; }
.pt-status.pt-good { color: var(--pt-good); }
.pt-status.pt-bad { color: var(--pt-bad); }
.pt-results { display: grid; gap: 8px; }
.pt-result { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pt-muted { color: var(--pt-muted); font-size: 0.9em; }
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(156px, 1fr)); gap: 10px; }
.pt-page { margin: 0; padding: 6px; border: 1px solid var(--pt-border); border-radius: var(--pt-radius); background: var(--pt-surface); text-align: center; }
.pt-page img { width: 100%; height: auto; transition: transform 160ms ease; }
.pt-page figcaption { font-size: 0.8em; color: var(--pt-muted); margin: 4px 0; }
.pt-row { display: flex; justify-content: center; gap: 4px; flex-wrap: wrap; }
.pt-textout { width: 100%; box-sizing: border-box; font: 0.85em/1.45 ui-monospace, monospace; color: var(--pt-text);
  background: var(--pt-surface); border: 1px solid var(--pt-border); border-radius: calc(var(--pt-radius) * 0.6); padding: 8px; }
/* the HTML tool's preview — white, like the paper it prints to */
.pt-preview { display: block; width: 100%; height: 520px; margin-top: 10px; border: 1px solid var(--pt-border);
  border-radius: calc(var(--pt-radius) * 0.6); background: #fff; }
.pt-preview[hidden] { display: none; }
@media (max-width: 520px) { .pt-preview { height: 400px; } }
@media (prefers-reduced-motion: reduce) { .pt-page img { transition: none; } }

/* ── A203 · Edit PDF and Sign PDF: the palette, the pages with their layer of placed items, the signature maker ── */
.pt-ed-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.pt-ed-add[aria-pressed="true"] { background: var(--pt-accent); color: var(--pt-on-accent); border-color: var(--pt-accent); }
.pt-ed-hint { margin: 0; }
.pt-ed-slots { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pt-ed-slots:empty { display: none; }
.pt-ed-slot { display: inline-flex; gap: 6px; align-items: center; }
.pt-ed-slotsvg { height: 28px; width: auto; max-width: 140px; }
.pt-ed-pages { display: grid; gap: 18px; justify-items: center; }
.pt-ed-pages:empty { display: none; }
.pt-ed-page { position: relative; margin: 0; width: 100%; max-width: 820px; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18); background: #fff; }
.pt-ed-page figcaption { position: absolute; top: 100%; left: 0; font-size: 0.8em; padding-top: 2px; }
.pt-ed-canvas { display: block; width: 100%; height: 100%; }
.pt-ed-layer { position: absolute; inset: 0; cursor: crosshair; }
.pt-ed-item { position: absolute; box-sizing: border-box; outline: 1px dashed rgba(30, 90, 200, 0.55); cursor: move; touch-action: none; }
.pt-ed-item:focus-visible, .pt-ed-item:focus-within { outline: 2px solid rgba(30, 90, 200, 0.9); }
.pt-ed-item--whiteout { background: #fff; }
.pt-ed-item img, .pt-ed-sig { display: block; width: 100%; height: 100%; pointer-events: none; }
.pt-ed-text {
  display: block; width: 100%; height: 100%; box-sizing: border-box; margin: 0; padding: 0; border: 0; resize: none; overflow: hidden;
  background: rgba(255, 255, 255, 0.35); color: #000; font-family: Helvetica, Arial, sans-serif; line-height: 1.2; cursor: text;
}
.pt-ed-text:focus { outline: none; }
.pt-ed-tools { position: absolute; left: 0; top: calc(100% + 2px); display: none; gap: 2px; }
.pt-ed-item:focus-within .pt-ed-tools { display: inline-flex; }
.pt-ed-x {
  position: absolute; right: -10px; top: -10px; width: 20px; height: 20px; padding: 0; border-radius: 50%; border: 1px solid var(--pt-border);
  background: var(--pt-surface); color: var(--pt-text); font-size: 11px; line-height: 1; cursor: pointer; display: none;
}
.pt-ed-item:hover .pt-ed-x, .pt-ed-item:focus-within .pt-ed-x { display: block; }
.pt-ed-resize { position: absolute; right: -5px; bottom: -5px; width: 10px; height: 10px; background: rgba(30, 90, 200, 0.9); cursor: nwse-resize; }
.pt-ed-grip { position: absolute; left: -5px; top: -5px; width: 10px; height: 10px; border: 2px solid rgba(30, 90, 200, 0.9); background: var(--pt-surface); box-sizing: border-box; }
.pt-ed-maker { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--pt-border); border-radius: var(--pt-radius); background: var(--pt-surface); }
.pt-ed-title { margin: 0; font-size: 1.05em; }
.pt-ed-body { display: grid; gap: 8px; }
.pt-ed-pad { width: 100%; max-width: 640px; height: auto; aspect-ratio: 900 / 260; border: 1px dashed var(--pt-border); border-radius: calc(var(--pt-radius) * 0.6); background: #fff; touch-action: none; cursor: crosshair; }
.pt-ed-preview { min-height: 60px; display: flex; align-items: center; padding: 8px; background: #fff; border-radius: calc(var(--pt-radius) * 0.6); border: 1px solid var(--pt-border); }
.pt-ed-preview:empty::before { content: "Your signature shows here."; color: #888; font-size: 0.9em; }
.pt-ed-previewsvg { max-height: 110px; max-width: 100%; width: auto; height: 110px; }
@media (max-width: 600px) { .pt-ed-x { display: block; } }
/* A203: a grid item's min-width is its content's by default — the 900 px drawing pad and the 1.6× page canvases widened
   the whole panel past a phone (a 390 px screen laid out 506 px wide). Every column may shrink; canvases fit their box. */
.pt-panel > *, .pt-ed-maker > *, .pt-ed-body > *, .pt-ed-pages > * { min-width: 0; }
.pt-ed-pad, .pt-ed-canvas { max-width: 100%; }

/* ── A203 (2) · Edit PDF in draft's sandbox look (owner 11-13: "use the entire sandbox styling and formatting and buttons
   from draft") — draft's Dusk tokens (themes/dusk-dark.js) and its depth box (components/DepthButton.css), redrawn here. */
.pt-sb {
  --sb-canvas: #1B1B1B; --sb-card: #262626; --sb-well: #2E2E2E; --sb-line: #343434; --sb-ink: #FFFFFF; --sb-muted: #A3A3A3;
  --sb-accent: #FBD3C4; --sb-accent-edge: #F2C2B2; --sb-on-accent: #1B1B1B;
  --sb-rest: 0 3px 8px rgba(0,0,0,0.40), inset 0 1px 0 rgba(255,255,255,0.08);
  --sb-hover: 0 7px 17px rgba(0,0,0,0.50), inset 0 1px 0 rgba(255,255,255,0.10);
  --sb-press: 0 2px 5px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
  --sb-glow: 0 10px 26px rgba(251,211,196,0.16), inset 0 1px 0 rgba(255,255,255,0.30);
  display: grid; gap: 12px; min-width: 0; padding: 16px; border-radius: 22px; background: var(--sb-canvas); color: var(--sb-ink);
  font-family: "Inter Tight", Inter, system-ui, sans-serif;
}
.pt-sb .pt-field { color: var(--sb-muted); }
.pt-sb .pt-file { background: var(--sb-card); color: var(--sb-ink); border-color: var(--sb-line); }
.pt-sb .pt-muted, .pt-sb-note { color: var(--sb-muted); margin: 0; font-size: 0.9em; }
.pt-sb .pt-status { color: var(--sb-muted); }
.pt-sb .pt-status.pt-good { color: #9fd8a8; } .pt-sb .pt-status.pt-bad { color: #f2a090; }
.pt-sb-bar {
  position: sticky; top: 8px; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px;
  border-radius: 16px; background: var(--sb-card); border: 1px solid var(--sb-line);
}
.pt-sb-sep { width: 1px; align-self: stretch; background: var(--sb-line); margin: 0 2px; }
.pt-sb-grow { flex: 1 1 auto; }
.pt-sb-count { color: var(--sb-accent); font-size: 0.85em; font-weight: 600; }
.pt-sbx-v { min-width: 2.4em; text-align: center; font-variant-numeric: tabular-nums; color: var(--sb-ink); font-size: 0.9em; }
.pt-sbx {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 30px; height: 30px; padding: 0 10px;
  border: 1px solid var(--sb-line); background: var(--sb-well); color: var(--sb-ink); border-radius: 9px; box-shadow: var(--sb-rest);
  font: 700 12.5px/1 inherit; cursor: pointer; text-decoration: none; transition: transform .16s, box-shadow .16s, border-color .16s, color .16s;
}
.pt-sbx:hover:not(:disabled), .pt-sbx:focus-visible { transform: translateY(-2px); box-shadow: var(--sb-hover); border-color: var(--sb-accent); color: var(--sb-accent); }
.pt-sbx:focus-visible { outline: 2px solid var(--sb-accent); outline-offset: 2px; }
.pt-sbx:active:not(:disabled) { transform: translateY(0); box-shadow: var(--sb-press); }
.pt-sbx:disabled { opacity: .45; cursor: default; }
.pt-sbx[aria-pressed="true"] { border-color: var(--sb-accent); color: var(--sb-accent); }
.pt-sbx--p { height: 42px; padding: 0 18px; background: var(--sb-accent); border-color: var(--sb-accent-edge); color: var(--sb-on-accent); box-shadow: var(--sb-glow); }
.pt-sbx--p:hover:not(:disabled), .pt-sbx--p:focus-visible { color: var(--sb-on-accent); border-color: var(--sb-accent-edge); }
.pt-sbx--sel { padding: 0 6px; font-weight: 600; appearance: auto; }
.pt-sbx-color { width: 18px; height: 18px; padding: 0; border: 0; background: none; cursor: pointer; }
.pt-sb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.pt-sb .pt-result a.pt-btn { background: var(--sb-accent); color: var(--sb-on-accent); border-color: var(--sb-accent-edge); border-radius: 11px; }
.pt-sb .pt-ed-page { box-shadow: 0 8px 26px rgba(0,0,0,0.45); }
.pt-sb .pt-ed-page figcaption { color: var(--sb-muted); }
/* the page's own text runs, each editable where it is */
.pt-tx-layer { cursor: default; }
.pt-tx {
  position: absolute; white-space: pre; line-height: 1; padding: 0 1px; margin-left: -1px; border-radius: 2px; outline: none; cursor: text;
  color: transparent; caret-color: #111; background: transparent;
}
.pt-tx:hover { box-shadow: 0 0 0 1px rgba(30, 90, 200, 0.45); }
.pt-tx:focus { box-shadow: 0 0 0 1.5px rgba(30, 90, 200, 0.9); }
.pt-tx--changed { box-shadow: 0 0 0 1px rgba(251, 140, 100, 0.55); }
.pt-sb .pt-sbx--sel { width: auto; max-width: 170px; flex: 0 0 auto; }
/* A203 (4) (owner 11-13: "it recognises the text and makes fields around the text blocks indicating editable" — PDFfiller):
   every editable line shows its box at all times; a line read from a picture (OCR) has a dashed one. */
.pt-tx { box-shadow: 0 0 0 1px rgba(30, 90, 200, 0.30); }
.pt-tx--ocr { box-shadow: none; outline: 1px dashed rgba(30, 90, 200, 0.55); outline-offset: 0; }
.pt-tx:hover { box-shadow: 0 0 0 1.5px rgba(30, 90, 200, 0.65); }
.pt-tx--ocr:focus, .pt-tx--ocr:hover { outline-color: rgba(30, 90, 200, 0.9); }
.pt-sb-bar { top: 64px; }   /* A203 (4): below the site's fixed 56 px bar */
/* D189 P3 · Fill out: the PDF's own form fields as inputs where they are — a pale field tint, like a form in any viewer */
.pt-fm { position: absolute; box-sizing: border-box; margin: 0; padding: 0 3px; border: 1px solid rgba(30, 90, 200, .45); border-radius: 2px;
  background: rgba(214, 228, 255, .55); color: #111; font-family: Helvetica, Arial, sans-serif; outline: none; }
.pt-fm:focus { border-color: rgba(30, 90, 200, .95); background: rgba(214, 228, 255, .8); }
.pt-fm--text { resize: none; }
.pt-fm--check { width: auto; height: auto; accent-color: #1e5ac8; padding: 0; background: none; border: 0; }
/* Redact: a dashed dark box until the download, when the text under it leaves the file and the box is painted */
.pt-ed-item--redact { background: rgba(0, 0, 0, .72); outline: 1px dashed #f2a090; }
.pt-ed-redact-label { display: grid; place-items: center; width: 100%; height: 100%; color: #f2a090; font: 700 10px/1 system-ui; letter-spacing: .08em; text-transform: uppercase; pointer-events: none; }
/* D189 P3: with a tool armed, the page's text fields and form inputs let the click through to the page (a redaction or a box goes over text) */
.pt-ed-pages[data-armed]:not([data-armed=""]) .pt-tx, .pt-ed-pages[data-armed]:not([data-armed=""]) .pt-fm { pointer-events: none; }
.pt-ed-pages[data-armed]:not([data-armed=""]) .pt-ed-layer { cursor: crosshair; }
