/* i2lovePDF editor styles — loaded only on tool pages that open an editor (photo, PDF, document makers). */
/* ======================= Editor workspace (assets/ws.js) ======================= */
.ws [hidden], .ws-foot [hidden] { display: none !important; }
body.ws-on .crumbs, body.ws-on .thead, body.ws-on .ad.top, body.ws-on .stepper, body.ws-on #fileList, body.ws-on #drop { display: none !important; }
.tool.ws-mode { max-width: none; padding: 0; border: 0; background: none; box-shadow: none; margin-top: 12px; }
.ws { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 12px; height: calc(100dvh - 60px - 28px); min-height: 540px; }
.ws-stage { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.ws-bar { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); min-height: 50px; }
.ws-title { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.ws-name { font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-dims { font-size: .8rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ws-tools { display: flex; align-items: center; gap: 4px; }
.ws-b { min-width: 36px; height: 34px; padding: 0 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-sm); font: 600 .82rem/1 inherit; cursor: pointer; display: inline-grid; place-items: center; transition: background-color .15s, border-color .15s; }
.ws-b:hover { border-color: var(--line-2); background: var(--surface-2); }
.ws-b .icon { width: 16px; height: 16px; }
.ws-zl { min-width: 58px; font-variant-numeric: tabular-nums; }
.ws-cmp[aria-pressed="true"] { background: var(--cat); border-color: var(--cat); color: #fff; }
.ws.custom .ws-tools [data-z] { display: none; }

/* the canvas area: checkerboard shows transparency */
/* the stage takes a soft tint from the photo's own colours (--amb, set by ws.js); a checkerboard appears only
   inside images that actually have transparency, and its squares keep the same on-screen size at any zoom */
.ws-view { position: relative; overflow: hidden; outline: none; touch-action: none; cursor: grab; contain: strict;
  --amb: #8a8f99; background: radial-gradient(120% 90% at 50% 45%, color-mix(in srgb, var(--amb) 16%, var(--surface-2)) 0%, color-mix(in srgb, var(--amb) 7%, var(--surface-2)) 60%, var(--surface-2) 100%);
  transition: background-color .4s; }
.ws-img, .ws-custom .pv-canvas, .ws-custom #custom > canvas, .bf-stage canvas, .ws-media-out img {
  background: repeating-conic-gradient(#e6e6e6 0 25%, #fff 0 50%) 0 0 / calc(14px / var(--s, 1)) calc(14px / var(--s, 1)); }
.ws-custom .pv-canvas, .ws-custom #custom > canvas, .bf-stage canvas { --s: 1; }
.ws-view.grab { cursor: grabbing; }
.ws-zoom { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.ws-img { position: absolute; left: 0; top: 0; max-width: none; user-select: none; -webkit-user-drag: none; box-shadow: 0 2px 18px rgba(0,0,0,.18); image-rendering: auto; }
.ws-after { z-index: 1; }
.ws.splitting .ws-after { clip-path: inset(0 0 0 var(--p, 50%)); }
/* each layer shows only on its own side, so transparent results never reveal the original underneath */
.ws.splitting .ws-before { clip-path: inset(0 calc(100% - var(--p, 50%)) 0 0); }
.ws.has-after:not(.splitting) .ws-before { visibility: hidden; }
.ws.custom .ws-zoom, .ws.custom .ws-split { display: none; }
.ws-custom { position: absolute; inset: 0; display: none; cursor: default; }
.ws.custom .ws-custom { display: block; }
.ws-custom > #custom { position: absolute; inset: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 0; }
/* trim / ringtone: player on top, controls in a row under it */
.ws-custom #custom > video { width: auto !important; max-width: 100%; max-height: calc(100% - 64px) !important; margin: 0 !important; }
.ws-custom #custom > audio { width: min(640px, 100%) !important; margin: 0 !important; background: none !important; }
.ws-custom #custom > .res-row { margin: 0; flex-wrap: wrap; justify-content: center; }
.ws-custom .pv-canvas, .ws-custom #custom > canvas { max-width: 100% !important; max-height: 100% !important; width: auto !important; height: auto !important; margin: 0 !important; border-radius: 6px; box-shadow: 0 2px 18px rgba(0,0,0,.18); }
.ws-custom .crop-wrap { width: 100%; height: 100%; align-self: stretch; }
.ws-custom .crop-wrap img { max-height: 100%; }
/* before/after divider: full-size invisible range on top, visual handle follows --p */
.ws-split { position: absolute; inset: 0; z-index: 3; }
.ws-split input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.ws-split i { position: absolute; top: 0; bottom: 0; left: var(--p, 50%); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); pointer-events: none; }
.ws-split i::after { content: ""; position: absolute; top: 50%; left: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.ws-split span { position: absolute; top: 12px; padding: 4px 9px; border-radius: 99px; background: rgba(20,22,26,.72); color: #fff; font: 700 .7rem/1 inherit; letter-spacing: .06em; text-transform: uppercase; pointer-events: none; }
.ws-split .l { left: 12px; } .ws-split .r { right: 12px; }
.ws-busy { position: absolute; left: 50%; top: 12px; z-index: 4; transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-2); font-size: .8rem; font-weight: 650; pointer-events: none; }
.ws-busy i { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--cat); animation: spin .8s linear infinite; }
/* processing animation sits over the canvas instead of replacing the page */
.ws-view > .stage.ws-ov { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; justify-content: center; align-items: stretch; margin: 0; padding: 16px; background: var(--surface); cursor: default; }
/* progress inside the editor: a full-width bar and one line of text (message left, number right) */
.ws-view > .stage.ws-ov .stage-bar, .ws-view > .stage.ws-ov .stage-meta { width: min(460px, 100%); max-width: none; margin-left: auto; margin-right: auto; }
.ws-view > .stage.ws-ov .stage-meta { gap: 16px; }
.ws-view > .stage.ws-ov #stMsg { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* filmstrip */
.ws-strip { display: flex; gap: 8px; padding: 8px 10px; overflow-x: auto; border-top: 1px solid var(--line); scrollbar-width: thin; }
.ws.single .ws-strip { display: none; }
.ws-th { position: relative; flex: 0 0 auto; width: 76px; padding: 0; border: 2px solid transparent; border-radius: 10px; background: none; cursor: pointer; color: var(--ink-2); font: 600 .68rem/1.2 inherit; text-align: center; transition: border-color .15s, transform .15s var(--ease-out, ease); }
.ws-th:hover { transform: translateY(-1px); }
.ws-th.on { border-color: var(--cat); color: var(--ink); }
.ws-th-i { display: block; height: 56px; border-radius: 8px; background: var(--surface-2) center / cover no-repeat; }
.ws-th-n { display: block; padding: 3px 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-th-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--surface); font-size: 14px; line-height: 20px; opacity: 0; transition: opacity .15s; }
.ws-th:hover .ws-th-x, .ws-th.on .ws-th-x { opacity: 1; }
.ws-th-s { position: absolute; left: 4px; bottom: 20px; padding: 1px 5px; border-radius: 5px; background: var(--ok); color: #fff; font-size: .62rem; }
.ws-add .icon { display: grid; width: 100%; height: 56px; padding: 18px; box-sizing: border-box; border: 2px dashed var(--line-2); border-radius: 8px; color: var(--cat); }

/* right panel */
.ws-panel { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1); }
.ws-grip { display: none; }
.ws-head { order: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 12px 12px 18px; border-bottom: 1px solid var(--line); }
.ws-head b { font-size: 1.02rem; }
.ws-x { width: 34px; height: 34px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); cursor: pointer; display: grid; place-items: center; }
.ws-x:hover { background: var(--surface-2); color: var(--ink); }
.ws-body { order: 2; flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 16px 18px; }
.ws-foot { order: 3; padding: 14px 18px 16px; border-top: 1px solid var(--line); background: var(--surface); }
.ws-body .opts.two, .ws-body .opts { grid-template-columns: 1fr !important; gap: 16px; margin-top: 0; padding-top: 0; border-top: 0; }
.tool.ws-mode::before { display: none; }
.ws-body .tool-form { margin: 0; }
.ws-body #specNote { margin: 0 0 14px; }
.ws-body .result { text-align: left; padding: 0; }
.ws-body .result .res-ok { width: 44px; height: 44px; margin: 0 0 8px; }
.ws-body .result h2 { font-size: 1.2rem; margin: 0 0 4px; }
.ws-body .result .dl, .ws-body .result .act { max-width: none; width: 100%; }
.ws-body .result .res-row { justify-content: flex-start; flex-wrap: wrap; }
.ws-body .result .res-preview { display: none; }
.ws-body .result .cont .chips { justify-content: flex-start; }
.ws-foot .act { margin: 10px 0 0; }
.ws-foot .btn-p { max-width: none; width: 100%; min-height: 52px; }
.ws-foot .trust { margin: 10px 0 0; justify-content: center; font-size: .74rem; }
.ws-foot .prog { margin-top: 10px; }
.ws-panel.busy .ws-body { opacity: .5; pointer-events: none; }
.ws-read { min-height: 24px; font-size: .88rem; }
.ws-read.calc { opacity: .55; }
.ws-out { display: flex; align-items: baseline; gap: 8px; }
.ws-out { align-items: center; }
.ws-out span { color: var(--ink-2); flex: 1; }
.ws-out-i { width: 34px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.ws-out b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.ws-out em { font-style: normal; font-weight: 700; font-size: .82rem; padding: 2px 7px; border-radius: 99px; background: var(--surface-2); }
.ws-out em.good { background: var(--ok-soft); color: var(--ok); }
.ws-chk { margin-top: 6px; font-size: .82rem; color: var(--ink-2); }
.ws-chk.warn { color: var(--warn); }
.ws-sub { margin-top: 4px; font-size: .78rem; color: var(--ink-2); }

/* phones & small tablets: preview on top, options in a bottom sheet (peek / half / full) */
@media (max-width: 899px) {
  .ws { display: block; height: auto; min-height: 0; }
  .ws-stage { height: calc(100dvh - 60px - 190px); min-height: 300px; border-radius: 12px; }
  .ws-bar { padding: 6px 8px 6px 12px; min-height: 44px; }
  .ws-dims, .ws-tools [data-z="out"], .ws-tools [data-z="in"] { display: none; }
  .ws-panel { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; height: 88dvh; border-radius: 18px 18px 0 0; border-bottom: 0; box-shadow: 0 -8px 30px rgba(0,0,0,.18);
    --peek: 176px; transform: translate3d(0, calc(88dvh - var(--peek) + var(--drag, 0px)), 0); transition: transform .32s var(--ease-out, cubic-bezier(.2,.8,.2,1)); will-change: transform; }
  .ws-panel[data-sheet="half"] { transform: translate3d(0, calc(38dvh + var(--drag, 0px)), 0); }
  .ws-panel[data-sheet="full"] { transform: translate3d(0, calc(0px + var(--drag, 0px)), 0); }
  .ws-panel.drag { transition: none; }
  .ws-grip { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 34px; cursor: grab; touch-action: none; flex: none; }
  .ws-grip-l { font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
  .ws[data-sheet="peek"] .ws-stage { height: calc(100dvh - 60px - 176px - 18px); }
  .ws[data-sheet="half"] .ws-stage, .ws[data-sheet="full"] .ws-stage { height: calc(50dvh - 60px - 22px); min-height: 200px; }
  .ws-grip i { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); }
  .ws-foot { order: 0; border-top: 0; border-bottom: 1px solid var(--line); padding: 4px 16px 12px; }
  .ws-foot .trust { display: none; }
  .ws-head { touch-action: none; padding: 8px 10px 8px 16px; }
  .ws-body { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

}
/* resize: original size shown as a dashed outline, result at true scale inside it */
.ws-ghost { position: absolute; z-index: 0; outline: calc(2px / var(--s, 1)) dashed color-mix(in srgb, var(--ink) 45%, transparent); outline-offset: 0; background: color-mix(in srgb, var(--ink) 5%, transparent); }
.ws-ghost span { position: absolute; left: 0; bottom: 100%; margin-bottom: calc(6px / var(--s, 1)); white-space: nowrap; font: 650 calc(12px / var(--s, 1)) / 1.2 system-ui, sans-serif; color: var(--ink-2); }
.ws.rel .ws-before { visibility: hidden; }
.ws-chk .warn { color: var(--warn); }
/* resize presets */
.rz-chips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rz-p { display: grid; gap: 1px; padding: 8px 10px; text-align: left; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; font: inherit; transition: border-color .15s, background-color .15s; }
.rz-p b { font-size: .8rem; } .rz-p span { font-size: .72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rz-p:hover { border-color: var(--line-2); }
.rz-p.on { border-color: var(--cat); background: color-mix(in srgb, var(--cat) 10%, var(--surface)); }
/* crop: shape shown on the crop box, floating rotate/flip toolbar, live crop size */
.crop-wrap[data-shape="rounded"] .cropper-view-box, .crop-wrap[data-shape="rounded"] .cropper-face { border-radius: var(--crop-r, 6%); }
.crop-wrap[data-shape="circle"] .cropper-view-box, .crop-wrap[data-shape="oval"] .cropper-view-box { border-radius: 50%; }
.crop-wrap[data-shape="heart"] .cropper-view-box, .crop-wrap[data-shape="star"] .cropper-view-box, .crop-wrap[data-shape="hexagon"] .cropper-view-box { outline: 0; -webkit-mask: var(--crop-mask) center / 100% 100% no-repeat; mask: var(--crop-mask) center / 100% 100% no-repeat; }
.crop-wrap:not([data-shape="rect"]) .cropper-view-box { outline-color: #fff; }
.crop-wrap:not([data-shape="rect"]) .cropper-dashed, .crop-wrap:not([data-shape="rect"]) .cropper-center { display: none; }
.crop-tools { position: absolute; left: 50%; bottom: 10px; z-index: 5; transform: translateX(-50%); display: flex; gap: 4px; padding: 5px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-2); }
.crop-tools button { width: 38px; height: 38px; border: 0; border-radius: 9px; background: none; color: var(--ink); cursor: pointer; display: grid; place-items: center; }
.crop-tools button:hover { background: var(--surface-2); }
.crop-tools .icon { width: 19px; height: 19px; }
.crop-size { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; padding: 4px 10px; border-radius: 99px; background: rgba(20,22,26,.75); color: #fff; font: 650 .78rem/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums; pointer-events: none; }
.ws-custom .crop-wrap { padding-bottom: 50px; box-sizing: border-box; }
/* never cover the editor with a sticky bottom bar or floating video ad */
body.ws-on .ad-anchor, body.ws-on .ad-dock { display: none !important; }

/* ======================= PDF workspace ======================= */
.ws.pdf .ws-view { cursor: default; touch-action: auto; background: var(--surface-2); }
.ws.pdf .ws-zoom, .ws.pdf .ws-custom, .ws.pdf .ws-split, .ws.pdf [data-z="1"], .ws.pdf .ws-cmp { display: none !important; }
.ws.pdf.one .ws-tools [data-z] { display: none !important; }
.wsp { position: absolute; inset: 0; overflow: auto; padding: 18px 20px 28px; overscroll-behavior: contain; outline: none; --pgw: 250px; scrollbar-width: thin; }
.wsp-grid, .wsp .pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--pgw), 1fr)); gap: 22px 18px; align-items: start; margin: 0; }
.wsp-h { display: flex; align-items: baseline; gap: 10px; margin: 18px 0 10px; font-size: .88rem; }
.wsp-h:first-child { margin-top: 0; }
.wsp-h span { color: var(--ink-2); font-size: .8rem; }
.wsp-pg { margin: 0; cursor: zoom-in; }
.wsp-pg .wsp-c { aspect-ratio: var(--ar, .707); background: #fff; border-radius: 3px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 6px 18px rgba(0,0,0,.08); transition: transform .18s var(--ease-out, ease), box-shadow .18s; }
.wsp-pg:hover .wsp-c { transform: translateY(-2px); box-shadow: 0 2px 6px rgba(0,0,0,.14), 0 12px 28px rgba(0,0,0,.12); }
.wsp-pg canvas, .wsp-pg img { display: block; width: 100%; height: 100%; object-fit: contain; }
.wsp-pg figcaption { display: flex; justify-content: center; gap: 6px; align-items: center; margin-top: 7px; font-size: .78rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.wsp-pg figcaption em { font-style: normal; font-weight: 700; color: var(--cat); max-width: 70%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsp-pg.img figcaption { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wsp-more { grid-column: 1 / -1; text-align: center; }
/* page picker (remove / extract / organize / rotate) moved into the view */
.wsp .pages .pg { padding: 8px 8px 6px; background: var(--surface); border-radius: 10px; }
.wsp .pages .pg .pg-c { min-height: 0 !important; display: block !important; }
.wsp .pages .pg canvas { width: 100%; height: auto; max-height: none; margin: 0 0 6px; transition: transform .25s var(--ease-out, ease); }
.wsp .pages .pg.sel::after { width: 28px; height: 28px; font-size: .95rem; top: 10px; right: 10px; }
.wsp .pages .pg-tools button { width: 36px; height: 36px; }
/* crop / sign: one big page with a draggable box */
.wsp-one { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; }
.wsp-sheet { position: relative; flex: none; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.14), 0 14px 40px rgba(0,0,0,.14); overflow: hidden; }
.wsp-sheet canvas { display: block; }
.wsp-ov { position: absolute; inset: 0; }
.wsp-cap { font-size: .8rem; color: var(--ink-2); text-align: center; }
.wsp-crop { position: absolute; outline: 2px solid var(--cat); box-shadow: 0 0 0 9999px rgba(20,22,26,.5); cursor: move; touch-action: none; }
.wsp-crop i { position: absolute; width: 14px; height: 14px; margin: -7px 0 0 -7px; background: #fff; border: 2px solid var(--cat); border-radius: 3px; }
.wsp-crop i[data-h="n"] { left: 50%; top: 0; cursor: ns-resize; } .wsp-crop i[data-h="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.wsp-crop i[data-h="w"] { left: 0; top: 50%; cursor: ew-resize; } .wsp-crop i[data-h="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.wsp-crop i[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; } .wsp-crop i[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.wsp-crop i[data-h="ne"] { left: 100%; top: 0; cursor: nesw-resize; } .wsp-crop i[data-h="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.wsp-crop span { position: absolute; left: 50%; top: 8px; transform: translateX(-50%); padding: 3px 9px; border-radius: 99px; background: rgba(20,22,26,.75); color: #fff; font: 650 .74rem/1.2 system-ui, sans-serif; white-space: nowrap; pointer-events: none; }
.wsp-sig { position: absolute; outline: 2px dashed var(--cat); outline-offset: 2px; cursor: move; touch-action: none; border-radius: 4px; }
.wsp-sig:hover { background: color-mix(in srgb, var(--cat) 8%, transparent); }
.wsp-sig .sig-in { width: 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.wsp-sig img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.wsp-sig.empty .sig-in { background: color-mix(in srgb, var(--cat) 12%, #fff); }
.wsp-sig.empty span { padding: 4px; font-size: .7rem; font-weight: 650; color: var(--cat); text-align: center; line-height: 1.2; }
.wsp-sig .rs { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--cat); border: 2px solid #fff; cursor: nwse-resize; }
/* full-size page viewer */
.wsp-lb { position: fixed; inset: 0; z-index: 90; display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; justify-items: center; background: rgba(16,17,20,.88); animation: fade-in .15s both; }
.wsp-lb .lb-c { display: grid; place-items: center; max-height: 94vh; }
.wsp-lb .lb-c canvas, .wsp-lb .lb-c img { max-height: 92vh; max-width: 86vw; box-shadow: 0 10px 40px rgba(0,0,0,.5); background: #fff; }
.wsp-lb button { width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(255,255,255,.14); color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.wsp-lb button:hover { background: rgba(255,255,255,.26); }
.wsp-lb .lb-x { position: absolute; top: 16px; right: 16px; }
.wsp-lb .lb-i { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); color: #fff; font: 650 .85rem/1 system-ui, sans-serif; }
@media (max-width: 899px) {
  .wsp { padding: 12px; --pgw: 140px !important; }
  .wsp-grid, .wsp .pages { gap: 14px 10px; }
  .wsp-lb { grid-template-columns: 44px 1fr 44px; }
}
.ws-tip { margin: 0 0 14px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); color: var(--ink-2); font-size: .84rem; line-height: 1.45; }
/* blur faces */
.bf-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 0; }
.bf-stage { position: relative; max-width: 100%; max-height: calc(100% - 34px); display: flex; min-height: 0; }
.bf-stage canvas { max-width: 100%; max-height: 100%; width: auto !important; height: auto !important; display: block; }
.bf-ov { position: absolute; inset: 0; cursor: crosshair; touch-action: none; }
.bf-ov i { position: absolute; border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 1px rgba(0,0,0,.35), 0 2px 10px rgba(0,0,0,.3); cursor: pointer; }
.bf-ov i.sq { border-radius: 4px; }
.bf-ov i.off { border-style: dashed; border-color: rgba(255,255,255,.8); background: rgba(0,0,0,.08); }
.bf-ov i.ghost { pointer-events: none; border-color: var(--cat); }
.bf-ov i b { position: absolute; top: -10px; right: -10px; width: 22px; height: 22px; border-radius: 50%; background: #111; color: #fff; font: 700 14px/22px system-ui; text-align: center; opacity: 0; transition: opacity .15s; }
.bf-ov i:hover b { opacity: 1; }
.bf-status { margin: 0; font-size: .82rem; color: var(--ink-2); text-align: center; }
/* Aadhaar print */
.ap-wrap { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.ap-sheet { position: relative; flex: none; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.14), 0 14px 40px rgba(0,0,0,.14); }
.ap-sheet canvas { display: block; }
.ap-ov { position: absolute; inset: 0; touch-action: none; }
.ap-box { position: absolute; border: 2px solid var(--cat); background: color-mix(in srgb, var(--cat) 10%, transparent); box-shadow: 0 0 0 9999px rgba(20,22,26,.18); cursor: move; border-radius: 3px; }
.ap-box[data-k="back"] { border-color: #2360c0; background: rgba(35,96,192,.1); }
.ap-box span { position: absolute; left: -2px; top: -24px; padding: 2px 8px; border-radius: 6px 6px 0 0; background: var(--cat); color: #fff; font: 700 .72rem/20px system-ui; }
.ap-box[data-k="back"] span { background: #2360c0; }
.ap-box .rs { position: absolute; right: -9px; bottom: -9px; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 3px solid var(--cat); cursor: nwse-resize; }
.ap-box[data-k="back"] .rs { border-color: #2360c0; }
.ap-lock { max-width: 420px; margin: auto; padding: 24px; background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-2); text-align: center; }
.ap-lock h3 { margin: 6px 0; } .ap-lock .card-ic { font-size: 28px; }
.ap-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; text-align: left; font-size: .82rem; font-weight: 650; }
.ap-row .in { margin-top: 4px; }
.ap-lock .btn-p { width: 100%; max-width: none; min-height: 48px; }
/* compare PDF */
.cmp-view { position: absolute; inset: -16px; overflow: auto; padding: 0 16px 24px; }
.cmp-sum { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 10px 4px; background: color-mix(in srgb, var(--surface-2) 94%, transparent); font-size: .82rem; }
.cmp-sum .cmp-l { color: #c0392b; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-sum .cmp-r { color: #1e8449; font-weight: 700; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-st { padding: 4px 12px; border-radius: 99px; background: var(--surface); box-shadow: var(--shadow-1); }
.cmp-note { margin: 6px 0; }
.cmp-row { margin: 14px 0 22px; }
.cmp-row h4 { display: flex; gap: 10px; align-items: center; margin: 0 0 8px; font-size: .9rem; }
.cmp-row h4 span { font-weight: 600; font-size: .78rem; color: var(--ink-2); }
.cmp-row h4 i { font-style: normal; font-weight: 800; margin-right: 6px; } .cmp-row h4 i.r { color: #c0392b; } .cmp-row h4 i.a { color: #1e8449; }
.cmp-row:not(.ch) h4 span { color: var(--ok); }
.cmp-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; justify-items: center; }
.cmp-pair canvas { max-width: 100%; height: auto; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 6px 18px rgba(0,0,0,.08); background: #fff; }
.cmp-miss { display: grid; place-items: center; width: 100%; min-height: 200px; border: 2px dashed var(--line-2); border-radius: 8px; color: var(--ink-2); }
.cmp-empty { text-align: center; }
/* Edit PDF */
.ed-wrap { position: absolute; inset: -16px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.ed-bar { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; font-size: .85rem; font-weight: 650; }
.ed-bar button { min-width: 36px; height: 34px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: 1.2rem; cursor: pointer; display: grid; place-items: center; }
.ed-bar button:hover { background: var(--surface-2); }
.ed-bar .icon { width: 16px; height: 16px; }
.ed-bar select { height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--ink); font: inherit; margin: 0 4px; }
.ed-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.ed-stage { position: relative; display: grid; place-items: center; overflow: auto; }
.ed-sheet { position: relative; background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.14), 0 14px 40px rgba(0,0,0,.14); }
.ed-sheet .ed-bg { position: absolute; left: 0; top: 0; }
.ed-sheet .canvas-container { position: absolute !important; left: 0; top: 0; }
.ed-hint { padding: 0 0 10px; }

/* file cards in the editor view: media players, text, Word/Excel/PowerPoint */
.wsp-media { grid-column: 1 / -1; margin: 0 auto; width: min(100%, 960px); }
.wsp-media video { display: block; width: 100%; max-height: 62vh; background: #000; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.18); }
.wsp-media.audio { width: min(100%, 640px); padding: 28px 24px 18px; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-1); }
.wsp-media audio { width: 100%; }
.wsp-media figcaption, .wsp-doc figcaption { display: flex; justify-content: space-between; gap: 12px; margin-top: 10px; font-size: .84rem; }
.wsp-media figcaption span, .wsp-doc figcaption span { color: var(--ink-2); white-space: nowrap; }
.wsp-media figcaption b, .wsp-doc figcaption b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wsp-doc { margin: 0; }
.wsp-doc .wsp-ic { aspect-ratio: .78; display: grid; place-content: center; justify-items: center; gap: 10px; background: #fff; border-radius: 6px; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 6px 18px rgba(0,0,0,.08); color: #2b579a; }
.wsp-doc.excel .wsp-ic { color: #217346; } .wsp-doc.ppt .wsp-ic { color: #d24726; } .wsp-doc.file .wsp-ic { color: var(--ink-2); }
.wsp-doc .wsp-ic .icon { width: 56px; height: 56px; } .wsp-doc .wsp-ic b { font-size: 1rem; letter-spacing: .08em; }
.wsp-doc.text { grid-column: 1 / -1; } .wsp-doc pre { margin: 0; max-height: 60vh; overflow: auto; padding: 18px 20px; background: #fff; color: #111; border-radius: 8px; box-shadow: var(--shadow-1); white-space: pre-wrap; font: 13px/1.55 ui-monospace, Menlo, Consolas, monospace; }
.ws-media-out { position: absolute; inset: 0; z-index: 4; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; background: var(--surface-2); }
.ws-media-out video { max-width: 100%; max-height: 70vh; border-radius: 12px; background: #000; box-shadow: 0 8px 30px rgba(0,0,0,.2); }
.ws-media-out audio { width: min(560px, 90vw); }
.ws-media-out p { margin: 0; font-size: .84rem; color: var(--ink-2); }
.ws.custom .ws-media-out { display: none; }

/* ======================= Document makers: form | live preview ======================= */
.tband .tool.doc-mode { max-width: none; }
.dws { display: grid; grid-template-columns: minmax(360px, 1fr) minmax(0, 1.15fr); gap: 16px; align-items: start; }
.dws-tabs { display: none; }
.dws-form { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; box-shadow: var(--shadow-1); min-width: 0; }
.dws-form .tool-form { margin: 0; }
.dws-form .opts { margin-top: 0; padding-top: 0; border-top: 0; }
.dws-form #custom + .opts { margin-top: 16px; }
.dws-form .trust { margin-top: 16px; justify-content: flex-start; }
.dws-pv { position: sticky; top: 72px; height: calc(100dvh - 88px); display: flex; flex-direction: column; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; min-width: 0; }
.dws-bar { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.dws-bar b { font-size: .92rem; }
.dws-info { flex: 1; color: var(--ink-2); font-size: .82rem; }
.dws-z { display: flex; gap: 4px; }
.dws-z button { min-width: 34px; height: 32px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); cursor: pointer; font: 600 .82rem/1 inherit; }
.dws.visual .dws-z { display: none; }
.dws-act .act { margin: 0; }
.dws-act .btn-p { min-height: 40px; width: auto; padding: 0 20px; font-size: .95rem; }
.dws-res .result.on { margin: 0; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.dws-res .result .res-ok { width: 28px; height: 28px; margin: 0; } .dws-res .result .res-ok .icon { width: 16px; height: 16px; }
.dws-res .result h2 { font-size: .95rem; margin: 0; } .dws-res .result .res-stats { margin: 0; font-size: .82rem; }
.dws-res .result .res-preview, .dws-res .result .res-text, .dws-res .result #copyBtn, .dws-res .result #againBtn { display: none; }
.dws-res .result .act { margin: 0; } .dws-res .result .dl { min-height: 34px; padding: 0 14px; font-size: .85rem; width: auto; }
.dws-res .result .res-row, .dws-res .result .cont { margin: 0; display: flex; align-items: center; gap: 8px; }
.dws-res .result .cont h3 { font-size: .78rem; margin: 0; color: var(--ink-2); }
.dws-stage { flex: 1; overflow: auto; padding: 20px; overscroll-behavior: contain; }
.dws-inner { transform-origin: 0 0; margin: 0 auto; }
.dws-paper { position: relative; background: #fff; color: #111; box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 10px 36px rgba(0,0,0,.12); box-sizing: border-box; overflow: hidden; }
.dws-breaks i { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed #c9c9c9; }
.dws-breaks span { position: absolute; right: 8px; top: 4px; font: 600 11px/1 system-ui, sans-serif; color: #999; background: #fff; padding: 2px 6px; border-radius: 4px; }
/* QR / barcode / quote image previews */
.dws.visual .dws-stage { display: grid; place-items: center; }
.code-pv { display: grid; justify-items: center; gap: 14px; text-align: center; }
.code-pv .qr-out { display: grid; place-items: center; min-height: 260px; min-width: 260px; padding: 18px; background: #fff; border-radius: 16px; box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 10px 30px rgba(0,0,0,.1); }
.code-pv .qr-c { width: min(360px, 70vw); height: auto; image-rendering: pixelated; }
.code-pv .bar-out svg { max-width: min(560px, 80vw); height: auto; }
.code-pv .res-row { justify-content: center; margin: 0; }
.code-pv .btn-p { width: auto; min-height: 46px; padding: 0 22px; }
.img-pv .qi-c { max-width: 100%; max-height: calc(100dvh - 200px); width: auto; height: auto; border-radius: 12px; box-shadow: 0 10px 36px rgba(0,0,0,.2); }
@media (max-width: 899px) {
  .dws { display: block; }
  .dws-tabs { display: flex; position: sticky; top: 60px; z-index: 6; gap: 4px; padding: 4px; margin-bottom: 12px; background: var(--surface-2); border-radius: 12px; }
  .dws-tabs button { flex: 1; height: 40px; border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: 700 .95rem/1 inherit; cursor: pointer; }
  .dws-tabs [aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
  .dws[data-tab="edit"] .dws-pv { display: none; }
  .dws[data-tab="pv"] .dws-form { display: none; }
  .dws-pv { position: static; height: calc(100dvh - 140px); }
  .dws-form { padding: 16px; }
  .dws-bar b { display: none; }
}

.ws.nozoom .ws-tools [data-z] { display: none !important; }
.wsp-pg.img.solo { grid-column: 1 / -1; width: min(100%, 880px); margin: 0 auto; }
.wsp-pg.img.solo .wsp-c { background: transparent; box-shadow: none; }
.wsp-pg.img.solo img { border-radius: 8px; box-shadow: 0 8px 30px rgba(0,0,0,.16); max-height: 70vh; }
/* invoice items: a table when there's room, stacked cards when the form column is narrow (tablets, phones) */
.dws-form { container-type: inline-size; }
.items { table-layout: fixed; }
.items .in { min-width: 0 !important; width: 100%; }
.items td.amt { text-align: right; font-variant-numeric: tabular-nums; padding-top: 14px; white-space: nowrap; }
.items td.rm { width: 44px; }
.items + .res-row, .items-scroll + .res-row { margin: 10px 0 18px; }
@container (max-width: 620px) {
  .items-scroll { overflow: visible; }
  .items, .items tbody { display: block; }
  .items thead { display: none; }
  .items tr { position: relative; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 12px 12px 10px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
  .items td { display: block; padding: 0; }
  .items td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 4px; font-size: .72rem; font-weight: 650; color: var(--ink-2); }
  .items td:first-child { grid-column: 1 / -1; padding-right: 40px; }
  .items td.amt { text-align: left; padding-top: 0; font-weight: 800; font-size: 1.05rem; align-self: end; }
  .items tr:has([data-k=gst]) td.amt { grid-column: span 2; }
  .items td.rm { position: absolute; top: 8px; right: 6px; width: auto; }
}
.code-pv.bad .bar-out { min-height: 140px; background: repeating-linear-gradient(135deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); }
.code-pv .btn[disabled] { opacity: .45; pointer-events: none; }
.ws-foot .trust span { text-wrap: balance; text-align: center; }
/* compare on narrow screens: original above the new version, labelled */
@media (max-width: 700px) {
  .cmp-pair { grid-template-columns: 1fr; gap: 18px; }
  .cmp-pair > div::before { display: block; margin-bottom: 6px; font: 700 .72rem/1 system-ui, sans-serif; letter-spacing: .06em; text-transform: uppercase; }
  .cmp-pair > div:first-child::before { content: "Original"; color: #c0392b; }
  .cmp-pair > div:last-child::before { content: "New version"; color: #1e8449; }
  .cmp-sum { grid-template-columns: 1fr; text-align: center; }
  .cmp-sum .cmp-r { text-align: center; }
}
/* trim / ringtone timeline */
.ws-custom #custom > .tl-media { max-width: 100%; max-height: calc(100% - 190px) !important; width: auto !important; border-radius: 12px; background: #000; margin: 0 !important; }
.ws-custom #custom > .tl-media.audio { display: none; }
.tl { width: min(100%, 900px); display: grid; gap: 10px; }
.tl-track { position: relative; height: 84px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); touch-action: none; cursor: pointer; --wave: color-mix(in srgb, var(--ink) 30%, transparent); overflow: visible; }
.tl-wave { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 12px; }
.tl-sel { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--cat) 22%, transparent); border-top: 3px solid var(--cat); border-bottom: 3px solid var(--cat); pointer-events: none; }
.tl-play { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; }
.tl-h { position: absolute; top: -6px; bottom: -6px; width: 22px; margin-left: -11px; padding: 0; border: 0; border-radius: 6px; background: var(--cat); cursor: ew-resize; display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.25); touch-action: none; }
.tl-h i { width: 3px; height: 26px; border-radius: 2px; background: rgba(255,255,255,.85); box-shadow: 5px 0 0 rgba(255,255,255,.85); margin-left: -5px; }
.tl-h:focus-visible { outline: 3px solid color-mix(in srgb, var(--cat) 45%, transparent); outline-offset: 2px; }
.tl-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tl-t { font: 700 .9rem/1 ui-monospace, Menlo, monospace; font-variant-numeric: tabular-nums; min-width: 64px; }
.tl-t.e { text-align: right; }
.tl-mid { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.tl-sum { margin: 0; text-align: center; font-size: .86rem; color: var(--ink-2); } .tl-sum .warn { color: var(--warn); }
@media (max-width: 899px) { .tl-track { height: 64px; } .tl-mid .btn { padding: 0 10px; } .ws-custom #custom > .tl-media { max-height: calc(100% - 170px) !important; } }
