/* ══════════════════════════════════════════════════════════════════════════
   Z11 PACK — shared behaviour pack for the docutools engine
   (Z11-PREVIEW, Z11 LIVE STATS, Z11 OUTPUT MIRROR, UI fixes)

   Every rule below hangs off the generic `.dtp-*` engine classes (which all
   themes share) or off the new `.z11-*` classes this pack introduces, so the
   same block is valid on every site. Nothing here depends on a theme's own
   prefix (z11- / t1- / sp- / dt-) or on its CSS variables.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── the uploaded document, shown in the stage-2 workspace ─────────────── */
.dtp-docpreview{display:flex;flex-direction:column;align-items:center;gap:10px;padding:22px 16px 26px;text-align:center;max-width:100%;box-sizing:border-box}
.dtp-docpreview__label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:#94A3B8}
.dtp-docpreview__page{display:block;max-width:100%;height:auto;max-height:min(62vh,640px);border:1px solid #E2E8F0;border-radius:10px;background:#fff;box-shadow:0 6px 24px rgba(15,23,42,.10)}
.dtp-docpreview__meta{font-size:12.5px;color:#64748B;line-height:1.5;word-break:break-word;max-width:520px}
.dtp-docpreview__card{width:104px;height:132px;border-radius:12px;border:1.5px solid #E2E8F0;background:linear-gradient(180deg,#fff,#F8FAFC);display:flex;align-items:center;justify-content:center;box-shadow:0 4px 18px rgba(15,23,42,.08)}
.dtp-docpreview__ext{font-size:19px;font-weight:900;letter-spacing:.06em;color:#1565C0}
.dtp-docpreview--compact{padding:14px 12px 18px}
.dtp-docpreview--compact .dtp-docpreview__page{max-height:min(46vh,420px)}
html[data-theme="dark"] .dtp-docpreview__page{border-color:#374151;background:#1F2937;box-shadow:0 6px 24px rgba(0,0,0,.45)}
html[data-theme="dark"] .dtp-docpreview__meta{color:#94A3B8}
html[data-theme="dark"] .dtp-docpreview__card{border-color:#374151;background:linear-gradient(180deg,#1F2937,#111827)}
html[data-theme="dark"] .dtp-docpreview__ext{color:#60A5FA}
@media (max-width:600px){
  .dtp-docpreview{padding:16px 10px 20px}
  .dtp-docpreview__page{max-height:min(52vh,460px)}
  .dtp-docpreview__card{width:88px;height:112px}
}

/* ── live preview strip for text / utility tools ───────────────────────── */
.z11-livestats{
  display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;
  margin:14px 0 4px;padding:11px 14px;border:1px solid #E2E8F0;border-radius:10px;
  background:#F8FAFC;font-size:12.5px;color:#64748B;
}
.z11-livestats__lbl{
  font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.075em;
  color:#1565C0;background:#EAF2FD;border-radius:999px;padding:3px 9px;
}
.z11-livestats__item{display:inline-flex;align-items:baseline;gap:5px;white-space:nowrap}
.z11-livestats__item b{font-size:14px;font-weight:800;color:#1E293B;font-variant-numeric:tabular-nums}
.z11-livestats__copy{
  margin-left:auto;border:1px solid #CBD5E1;background:#fff;color:#334155;
  border-radius:8px;padding:6px 12px;font-size:12px;font-weight:600;cursor:pointer;
  font-family:inherit;min-height:32px;
}
.z11-livestats__copy:hover{background:#F1F5F9;border-color:#94A3B8}
.z11-livestats__copy[hidden]{display:none}
html[data-theme="dark"] .z11-livestats{background:#111827;border-color:#1F2937;color:#94A3B8}
html[data-theme="dark"] .z11-livestats__lbl{color:#93C5FD;background:#1E3A5F}
html[data-theme="dark"] .z11-livestats__item b{color:#F1F5F9}
html[data-theme="dark"] .z11-livestats__copy{background:#1F2937;border-color:#374151;color:#E5E7EB}
html[data-theme="dark"] .z11-livestats__copy:hover{background:#374151}
@media (max-width:600px){
  .z11-livestats{gap:6px 12px;padding:10px 12px;font-size:12px;margin-top:12px}
  .z11-livestats__copy{margin-left:0;width:100%}
}

/* ── read-only mirror of the tool's output, inside the workspace ───────── */
.z11-outmirror{margin:14px 0 4px;border:1px solid #E2E8F0;border-radius:10px;overflow:hidden;background:#fff}
.z11-outmirror[hidden]{display:none}
.z11-outmirror__head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 12px;background:#F1F5F9;border-bottom:1px solid #E2E8F0}
.z11-outmirror__lbl{font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.075em;color:#0F766E}
.z11-outmirror__copy{border:1px solid #CBD5E1;background:#fff;color:#334155;border-radius:7px;padding:4px 12px;font-size:11.5px;font-weight:600;cursor:pointer;font-family:inherit;min-height:28px}
.z11-outmirror__copy:hover{background:#E2E8F0}
.z11-outmirror__body{
  margin:0;padding:12px 14px;max-height:300px;overflow:auto;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:12.5px;line-height:1.6;color:#0F172A;background:#fff;
  white-space:pre-wrap;word-break:break-word;
}
html[data-theme="dark"] .z11-outmirror{border-color:#374151;background:#111827}
html[data-theme="dark"] .z11-outmirror__head{background:#1F2937;border-bottom-color:#374151}
html[data-theme="dark"] .z11-outmirror__lbl{color:#5EEAD4}
html[data-theme="dark"] .z11-outmirror__copy{background:#111827;border-color:#374151;color:#E5E7EB}
html[data-theme="dark"] .z11-outmirror__body{background:#0B1220;color:#E2E8F0}
@media (max-width:600px){.z11-outmirror__body{max-height:44vh;font-size:12px}}

/* ── UI fixes measured on the live sites ──────────────────────────────── */

/* Barcode SVG overflowed the workspace by thousands of px: JsBarcode emits a
   fixed-width SVG, so it has to be allowed to scale down. */
.dtp-barcode-output{max-width:100%;overflow:auto;text-align:center;padding:8px 0}
.dtp-barcode-output svg{max-width:100%;height:auto;display:block;margin:0 auto}

/* "Upload different file" was a bare underlined 16px-high link — below the
   24px minimum target size and hard to hit on a phone. */
.dtp-back-btn{
  min-height:34px;padding:7px 12px;border-radius:8px;
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  text-decoration:none;line-height:1.2;
}
.dtp-back-btn:hover{background:#F1F5F9;color:#334155}
html[data-theme="dark"] .dtp-back-btn:hover{background:#1F2937;color:#E5E7EB}

/* Small square icon buttons (page-delete, copy, reveal) were under 24px. */
.dtp-page-thumb__del{min-width:26px;min-height:26px;display:inline-flex;align-items:center;justify-content:center}
.dtp-copy-val-btn,.dtp-lock-eye{min-height:26px;min-width:26px}
.mg-cb,.dtp-check-row input[type="checkbox"]{min-width:18px;min-height:18px}
.dtp-check-row{min-height:32px;align-items:center}

/* Mobile: the options sheet is the only route to the action button, so the
   FAB must be unmistakably tappable and the CTA must never be overlapped. */
@media (max-width:900px){
  #dtp-panel-fab{min-height:46px;padding:0 20px;font-size:14px;border-radius:999px}
  .dtp-process-btn{min-height:50px}
  .dtp-panel-footer{padding-bottom:max(16px, env(safe-area-inset-bottom))}
}

