/* PDFConvert – tool workspace */
.pdfx-working .tool-info, .pdfx-working .breadcrumbs, .pdfx-working .ad-tool { display: none; }
.pdfx-working .site-footer { display: none; }
.pdfx-app { position: relative; }

.ws { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: calc(100vh - 64px); background: var(--bg); }
.ws[hidden] { display: none; }
.ws-main { display: flex; flex-direction: column; min-width: 0; }
.ws-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 64px; z-index: 5; flex-wrap: wrap; }
.admin-bar .ws-toolbar { top: 96px; }
.tb-left, .tb-right { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tb-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px; color: var(--text); }
.tb-btn:hover { border-color: var(--text); }
.tb-btn.icon { padding: 8px; }
.tb-btn.on { background: var(--text); color: var(--surface); border-color: var(--text); }
.tb-btn:disabled { opacity: .45; cursor: not-allowed; }
.tb-zoom { display: flex; gap: 4px; margin-left: 6px; }
.tb-sep { width: 1px; height: 26px; background: var(--line); margin: 0 4px; }
.ws-body { flex: 1; padding: 24px; --thumb: 150px; }

.ws-side { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 64px; height: calc(100vh - 64px); }
.admin-bar .ws-side { top: 96px; height: calc(100vh - 96px); }
.ws-side-head { padding: 22px 24px 8px; text-align: center; }
.ws-side-head h2 { font-size: 24px; font-weight: 800; margin: 0; }
.ws-min-hint { margin: 0 24px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 12%, transparent); color: var(--warn); font-size: 14px; font-weight: 600; }
.ws-opts { flex: 1; overflow: auto; padding: 12px 24px 24px; display: flex; flex-direction: column; gap: 16px; }
.ws-side-foot { padding: 16px 24px 20px; border-top: 1px solid var(--line); }
.btn-run { width: 100%; display: inline-flex; justify-content: center; align-items: center; gap: 10px; background: var(--brand); color: #fff; border: 0; border-radius: 14px; font-size: 20px; font-weight: 800; padding: 18px; cursor: pointer; box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 32%, transparent); }
.btn-run:hover { background: var(--brand-dark); }
.btn-run:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-ghost { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; color: var(--text); }
.btn-ghost:hover { border-color: var(--text); text-decoration: none; }
.btn-sm { padding: 6px 10px; font-size: 13.5px; }

@media (max-width: 900px) {
	.ws { grid-template-columns: 1fr; }
	.ws-side { position: static; height: auto; border-left: 0; border-top: 1px solid var(--line); }
	.ws-side-foot { position: sticky; bottom: 0; background: var(--surface); z-index: 6; }
	.ws-toolbar { top: 64px; }
	.ws-body { padding: 16px; }
}

/* Options */
.opt-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.opt-help { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.opt-h { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 6px 0 -4px; }
.opt-info { padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; color: var(--muted); line-height: 1.5; }
.opt-info.ok { background: color-mix(in srgb, var(--ok) 12%, transparent); color: var(--ok); }
.opt-info.warn { background: color-mix(in srgb, var(--warn) 12%, transparent); color: color-mix(in srgb, var(--warn) 80%, var(--text)); }
.opt-info.brand { background: var(--brand-soft); color: var(--text); }
.opt-info p { margin: 0 0 .4em; }
.opt-info p:last-child { margin: 0; }
.opt-cards { display: grid; gap: 8px; }
.opt-card { text-align: left; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "i t" "i d"; column-gap: 12px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text); }
.opt-card:not(:has(.oc-ico)) { grid-template-columns: 1fr; grid-template-areas: "t" "d"; }
.opt-card .oc-ico { grid-area: i; align-self: center; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.opt-card .oc-t { grid-area: t; font-weight: 800; font-size: 15px; }
.opt-card .oc-d { grid-area: d; font-size: 13px; color: var(--muted); line-height: 1.4; }
.opt-card.on { border-color: var(--brand); background: var(--brand-soft); }
.opt-card.on .oc-ico { background: var(--brand); color: #fff; }
.opt-seg { display: flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.opt-seg button { flex: 1 1 auto; display: inline-flex; gap: 6px; align-items: center; justify-content: center; padding: 9px 10px; border: 0; border-right: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: 14px; color: var(--text); }
.opt-seg button:last-child { border-right: 0; }
.opt-seg button.on { background: var(--brand); color: #fff; }
.opt-check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-weight: 600; font-size: 14.5px; }
.opt-check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.opt-checks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; max-height: 240px; overflow: auto; padding: 4px; }
.opt-range { display: flex; gap: 12px; align-items: center; }
.opt-range input { flex: 1; accent-color: var(--brand); }
.opt-range output { min-width: 52px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.opt-num { display: flex; gap: 8px; align-items: center; }
.opt-num input { max-width: 140px; }
.opt-color { display: flex; gap: 10px; align-items: center; }
.opt-color input { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.opt-pos { display: grid; grid-template-columns: repeat(3, 44px); gap: 6px; }
.opt-pos button { width: 44px; height: 34px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: grid; place-items: center; }
.opt-pos button i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.opt-pos button.on { border-color: var(--brand); background: var(--brand-soft); }
.opt-pos button.on i { background: var(--brand); }
.opt-image .oi-prev img { max-height: 90px; margin-top: 10px; border-radius: 8px; border: 1px solid var(--line); background: repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.opt [hidden], .opt[hidden] { display: none !important; }

/* File grid */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 20px; align-items: start; }
.file-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 14px 12px; box-shadow: var(--shadow-sm); cursor: grab; transition: box-shadow .15s; }
.file-card:hover { box-shadow: var(--shadow); }
.file-card.sortable-ghost { opacity: .35; }
.file-card.is-error { border-color: var(--err); }
.fc-num { position: absolute; left: 10px; top: 10px; z-index: 2; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: var(--text); color: var(--surface); font-size: 12px; font-weight: 800; display: grid; place-items: center; }
.fc-act { position: absolute; right: 8px; top: 8px; z-index: 3; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.file-card:hover .fc-act, .file-card:focus-within .fc-act { opacity: 1; }
@media (hover: none) { .fc-act, .pc-act { opacity: 1 !important; } }
.fc-act button, .pc-act button { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; display: grid; place-items: center; color: var(--text); }
.fc-act button:hover, .pc-act button:hover { background: var(--brand); color: #fff; }
.fc-thumbwrap { height: 190px; display: grid; place-items: center; overflow: hidden; }
.fc-thumb { max-width: 100%; max-height: 100%; display: grid; place-items: center; transition: transform .2s; }
.fc-thumb canvas, .fc-thumb img { max-width: 100%; max-height: 186px; width: auto; height: auto; box-shadow: 0 2px 8px rgba(0, 0, 0, .15); background: #fff; display: block; }
.fc-ph { width: 120px; height: 160px; display: grid; place-items: center; align-content: center; gap: 6px; background: var(--surface-2); border-radius: 6px; color: var(--muted); font-weight: 800; }
.fc-ph.doc .ico { color: var(--tool, var(--brand)); }
.fc-ph.docx .ico, .fc-ph.doc .ico { color: #2B579A; }
.fc-ph.xlsx .ico, .fc-ph.xls .ico, .fc-ph.csv .ico, .fc-ph.ods .ico { color: #217346; }
.fc-ph.pptx .ico { color: #D24726; }
.fc-ph.err { color: var(--err); font-size: 32px; }
.fc-name { margin-top: 10px; font-size: 13.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.fc-meta { font-size: 12.5px; color: var(--muted); text-align: center; }
.file-add, .page-add { min-height: 240px; border: 2px dashed var(--line); border-radius: 14px; background: transparent; display: grid; place-items: center; align-content: center; gap: 6px; cursor: pointer; color: var(--muted); font-weight: 700; }
.file-add:hover, .page-add:hover { border-color: var(--brand); color: var(--brand); }
.page-add { min-height: 0; aspect-ratio: 3/4; }

/* Page grid */
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--thumb), 1fr)); gap: 18px; align-items: start; }
.page-card { position: relative; cursor: default; user-select: none; }
.page-grid.selectable .page-card { cursor: pointer; }
.pc-box { position: relative; background: var(--surface); border: 2px solid transparent; border-radius: 10px; padding: 8px; box-shadow: var(--shadow-sm); aspect-ratio: 3/4; display: grid; place-items: center; overflow: hidden; transition: border-color .12s, box-shadow .12s; }
.page-card:hover .pc-box { box-shadow: var(--shadow); }
.pc-img { display: grid; place-items: center; width: 100%; height: 100%; transition: transform .2s; }
.pc-img canvas { max-width: 100%; max-height: 100%; width: auto; height: auto; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); display: block; background: #fff; }
.pc-loading { width: 70%; aspect-ratio: 3/4; background: linear-gradient(90deg, var(--surface-2), var(--line), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 4px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.pc-blank { width: 70%; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.pc-label { text-align: center; font-size: 13px; font-weight: 700; margin-top: 6px; color: var(--muted); display: flex; justify-content: center; gap: 6px; }
.pc-file { font-weight: 600; opacity: .8; }
.pc-act { position: absolute; top: 4px; right: 4px; z-index: 3; display: flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.page-card:hover .pc-act { opacity: 1; }
.pc-act button { width: 28px; height: 28px; }
.pc-check { position: absolute; left: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line); background: var(--surface); display: grid; place-items: center; color: transparent; }
.page-card.is-sel .pc-box { border-color: var(--brand); }
.page-card.is-sel .pc-check { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-grid.sel-remove .page-card.is-sel .pc-img { opacity: .35; }
.page-grid.sel-remove .page-card.is-sel .pc-box::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent calc(50% - 2px), var(--brand) calc(50% - 1px), var(--brand) calc(50% + 1px), transparent calc(50% + 2px)); opacity: .5; }
.page-card.sortable-ghost { opacity: .3; }
.page-card.is-dim .pc-box { opacity: .4; }
.range-tag { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--c, var(--brand)); color: #fff; font-size: 11px; font-weight: 800; padding: 1px 8px; border-radius: 999px; z-index: 4; white-space: nowrap; }

/* Progress */
.pdfx-progress { position: fixed; inset: 0; z-index: 200; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; }
.pp-box { width: min(440px, 100%); background: var(--surface); border-radius: 18px; padding: 32px 28px 24px; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--line); }
.pp-box h2 { font-size: 22px; margin: 18px 0 16px; }
.pp-spin { width: 54px; height: 54px; margin: 0 auto; border-radius: 50%; border: 5px solid var(--brand-soft); border-top-color: var(--brand); animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pp-bar { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.pp-bar i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .25s; }
.pp-pct { font-weight: 800; font-size: 18px; margin: 10px 0 0; font-variant-numeric: tabular-nums; }
.pp-label { color: var(--muted); font-size: 14px; min-height: 1.4em; margin: 2px 0 14px; }

/* Result */
.pdfx-result { position: relative; text-align: center; padding: 40px 16px 64px; max-width: 920px; margin: 0 auto; }
.pdfx-result h2 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 800; margin: 12px 0 18px; }
.res-back { position: absolute; left: 16px; top: 20px; display: inline-flex; gap: 6px; align-items: center; border: 0; background: none; cursor: pointer; font-weight: 700; color: var(--muted); }
.res-back:hover { color: var(--text); }
.res-note { color: var(--muted); max-width: 640px; margin: 0 auto 18px; }
.res-actions { display: flex; justify-content: center; }
.btn-download { display: inline-flex; align-items: center; gap: 12px; background: var(--brand); color: #fff; border-radius: 16px; padding: 22px 46px; font-size: clamp(19px, 2vw, 24px); font-weight: 800; box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn-download:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.res-meta { color: var(--muted); font-size: 14px; margin-top: 12px; word-break: break-all; }
.res-stats { display: inline-flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 6px 0 10px; }
.res-stats .stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; font-size: 14px; }
.res-stats .stat b { display: block; font-size: 22px; }
.res-stats .stat.good b { color: var(--ok); }
.res-list { max-width: 560px; margin: 12px auto; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 4px 16px; }
.res-list summary { cursor: pointer; padding: 10px 0; font-weight: 700; }
.res-list ul { list-style: none; padding: 0 0 10px; margin: 0; max-height: 300px; overflow: auto; }
.res-list li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; font-size: 14px; border-top: 1px solid var(--line); }
.res-list a { display: inline-flex; gap: 6px; align-items: center; word-break: break-all; }
.res-list span { color: var(--muted); white-space: nowrap; }
.res-secondary { margin: 22px 0; }
.res-next { margin: 30px auto 0; max-width: 760px; }
.res-next h3 { font-size: 16px; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; }
.next-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.next-item { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: 14.5px; text-align: left; }
.next-item:hover { border-color: var(--brand); text-decoration: none; }
.res-privacy { margin-top: 28px; display: inline-flex; gap: 6px; align-items: center; color: var(--ok); font-weight: 600; font-size: 14px; }
.res-preview { margin: 18px auto; max-width: 820px; }
.res-preview img { max-width: 100%; border-radius: 8px; box-shadow: var(--shadow); }
.pdfx-result.custom { max-width: 1200px; text-align: left; }
.pdfx-result.custom h2 { text-align: center; }
.pdfx-result.custom .res-secondary { text-align: center; }
.res-custom { text-align: left; }
.text-out { width: 100%; min-height: 360px; font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.res-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin: 0 0 16px; }

/* Modal & toast */
.pdfx-modal { position: fixed; inset: 0; z-index: 300; background: rgba(10, 10, 20, .55); display: grid; place-items: center; padding: 16px; }
.pdfx-modal-box { position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); border-radius: 18px; padding: 26px 24px 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.pdfx-modal-box.wide { width: min(760px, 100%); }
.pdfx-modal-box h2 { font-size: 21px; margin: 0 30px 10px 0; }
.pdfx-modal-x { position: absolute; right: 12px; top: 12px; border: 0; background: none; cursor: pointer; color: var(--muted); padding: 6px; border-radius: 8px; }
.pdfx-modal-x:hover { background: var(--surface-2); }
.pdfx-modal-msg { color: var(--muted); }
.pdfx-modal-msg .err { color: var(--err); font-weight: 700; }
.pdfx-modal-body { margin: 10px 0 0; }
.pdfx-modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.pdfx-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; z-index: 400; background: #1f1f28; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14.5px; box-shadow: var(--shadow); transition: all .3s; max-width: calc(100% - 32px); }
.pdfx-toast.show { transform: translate(-50%, 0); opacity: 1; }
.pdfx-toast.err { background: var(--err); }

/* Global drop overlay */
.drop-overlay { position: fixed; inset: 0; z-index: 250; display: none; place-items: center; background: color-mix(in srgb, var(--brand) 85%, transparent); color: #fff; text-align: center; font-size: 26px; font-weight: 800; pointer-events: none; }
.drop-overlay.on { display: grid; }
.drop-overlay div { border: 3px dashed rgba(255, 255, 255, .8); border-radius: 24px; padding: 48px 64px; }

/* Start screen extras */
.tool-extra-start:empty { display: none; }
.tool-extra-start { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- Editor (edit / sign / redact / crop) ---------- */
.ws.editor-mode { grid-template-columns: 170px minmax(0, 1fr) 320px; }
.ws.editor-mode .ws-body { padding: 0; }
.ed-wrap { display: grid; grid-template-columns: 1fr; height: calc(100vh - 64px - 59px); }
.ed-thumbs { background: var(--surface); border-right: 1px solid var(--line); overflow: auto; padding: 14px 18px; position: sticky; top: 64px; height: calc(100vh - 64px); }
.ed-thumbs .ed-th { display: block; width: 100%; margin-bottom: 14px; border: 2px solid transparent; border-radius: 6px; background: none; padding: 2px; cursor: pointer; }
.ed-thumbs .ed-th.on { border-color: var(--brand); }
.ed-thumbs canvas { width: 100%; height: auto; display: block; box-shadow: 0 1px 4px rgba(0, 0, 0, .2); background: #fff; }
.ed-thumbs small { display: block; text-align: center; font-weight: 700; color: var(--muted); font-size: 12px; }
.ed-tools { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.ed-tool { display: inline-flex; gap: 6px; align-items: center; padding: 8px 10px; border-radius: 9px; border: 1px solid transparent; background: none; cursor: pointer; font-weight: 700; font-size: 13.5px; color: var(--text); }
.ed-tool:hover { background: var(--surface-2); }
.ed-tool.on { background: var(--brand-soft); color: var(--brand); border-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.ed-pages { padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 24px; overflow: auto; }
.ed-page { position: relative; background: #fff; box-shadow: 0 4px 18px rgba(0, 0, 0, .14); flex: none; }
.ed-page canvas.ed-bg { display: block; width: 100%; height: 100%; }
.ed-layer { position: absolute; inset: 0; touch-action: none; }
.ed-layer.tool-text { cursor: text; }
.ed-layer.tool-rect, .ed-layer.tool-ellipse, .ed-layer.tool-highlight, .ed-layer.tool-whiteout, .ed-layer.tool-redact, .ed-layer.tool-line { cursor: crosshair; }
.ed-layer.tool-draw { cursor: crosshair; }
.ed-layer.tool-place { cursor: copy; }
.ed-pnum { position: absolute; bottom: -22px; left: 0; right: 0; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.ed-obj { position: absolute; box-sizing: border-box; }
.ed-obj.sel { outline: 2px solid #3B82F6; outline-offset: 1px; }
.ed-obj .ed-h { position: absolute; width: 14px; height: 14px; right: -8px; bottom: -8px; background: #fff; border: 2px solid #3B82F6; border-radius: 50%; cursor: nwse-resize; display: none; }
.ed-obj .ed-x { position: absolute; top: -14px; right: -14px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #EF4444; color: #fff; cursor: pointer; display: none; place-items: center; padding: 0; }
.ed-obj.sel .ed-h { display: block; }
.ed-obj.sel .ed-x { display: grid; }
.ed-obj .ed-move { position: absolute; inset: 0; cursor: move; }
.ed-obj.t-text .ed-move { inset: auto; left: -12px; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: #3B82F6; display: none; }
.ed-obj.t-text.sel .ed-move { display: block; }
.ed-obj.t-text .ed-txt { outline: none; white-space: pre; min-width: 10px; line-height: 1.2; cursor: text; padding: 0; }
.ed-obj.t-text { outline: 1px dashed rgba(59, 130, 246, .5); }
.ed-obj.t-image img { width: 100%; height: 100%; display: block; pointer-events: none; user-select: none; }
.ed-obj.t-redact { background: #000; }
.ed-obj.t-redact::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(45deg, transparent 0 6px, rgba(255, 255, 255, .12) 6px 8px); }
.ed-obj.t-whiteout { background: #fff; outline: 1px dashed #bbb; }
.ed-draw-svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.ed-crop { position: absolute; border: 2px solid var(--brand); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45); cursor: move; }
.ed-crop .ch { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--brand); border-radius: 3px; }
.ed-crop .ch.nw { left: -8px; top: -8px; cursor: nwse-resize; }
.ed-crop .ch.ne { right: -8px; top: -8px; cursor: nesw-resize; }
.ed-crop .ch.sw { left: -8px; bottom: -8px; cursor: nesw-resize; }
.ed-crop .ch.se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.ed-crop .ch.n { left: calc(50% - 7px); top: -8px; cursor: ns-resize; }
.ed-crop .ch.s { left: calc(50% - 7px); bottom: -8px; cursor: ns-resize; }
.ed-crop .ch.w { top: calc(50% - 7px); left: -8px; cursor: ew-resize; }
.ed-crop .ch.e { top: calc(50% - 7px); right: -8px; cursor: ew-resize; }
.ed-crop-page { overflow: hidden; }
.ed-props { display: flex; flex-direction: column; gap: 14px; }
.ed-props .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ed-props .row > * { flex: 1; }
.ed-hint { font-size: 13.5px; color: var(--muted); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
@media (max-width: 1100px) {
	.ws.editor-mode { grid-template-columns: minmax(0, 1fr) 300px; }
	.ws.editor-mode .ed-thumbs { display: none; }
}
@media (max-width: 900px) {
	.ws.editor-mode { grid-template-columns: 1fr; }
	.ed-pages { padding: 14px 8px; }
}

/* Signature pad */
.sig-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.sig-tabs button { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-weight: 700; cursor: pointer; color: var(--text); }
.sig-tabs button.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.sig-pad { width: 100%; height: 200px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; display: block; cursor: crosshair; }
.sig-colors { display: flex; gap: 8px; margin: 10px 0; align-items: center; }
.sig-colors button { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; }
.sig-colors button.on { box-shadow: 0 0 0 2px var(--brand); }
.sig-fonts { display: grid; gap: 8px; margin-top: 10px; max-height: 260px; overflow: auto; }
.sig-fonts button { text-align: left; padding: 10px 16px; border-radius: 10px; border: 2px solid var(--line); background: #fff; color: #111; font-size: 32px; cursor: pointer; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sig-fonts button.on { border-color: var(--brand); }
.sig-list { display: grid; gap: 10px; }
.sig-item { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; background: #fff; cursor: grab; }
.sig-item img { max-height: 46px; max-width: 170px; }
.sig-item .si-l { font-size: 12px; font-weight: 700; color: #666; margin-right: auto; }

/* Compare */
.cmp-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cmp-slot { border: 2px dashed var(--line); border-radius: 16px; min-height: 280px; display: grid; place-items: center; text-align: center; padding: 16px; background: var(--surface); cursor: pointer; }
.cmp-slot.has { border-style: solid; cursor: default; }
.cmp-slot canvas { max-height: 300px; width: auto; box-shadow: var(--shadow); }
.cmp-slot h3 { font-size: 15px; margin: 8px 0 2px; }
.cmp-out { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cmp-col { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; word-wrap: break-word; max-height: 75vh; overflow: auto; }
.cmp-col del { background: #FECACA; color: #7F1D1D; text-decoration: line-through; }
.cmp-col ins { background: #BBF7D0; color: #14532D; text-decoration: none; }
.cmp-col h4 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; color: var(--muted); letter-spacing: .06em; position: sticky; top: -16px; background: var(--surface); padding: 6px 0; }
.cmp-visual { display: grid; gap: 24px; justify-items: center; }
.cmp-visual figure { margin: 0; text-align: center; }
.cmp-visual canvas { max-width: 100%; box-shadow: var(--shadow); }
.cmp-summary { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-bottom: 16px; }
@media (max-width: 760px) { .cmp-pick, .cmp-out { grid-template-columns: 1fr; } }

/* Scanner */
.scan-cam { position: relative; background: #000; border-radius: 14px; overflow: hidden; max-width: 760px; margin: 0 auto 16px; }
.scan-cam video { width: 100%; display: block; max-height: 60vh; object-fit: contain; }
.scan-cam .scan-shoot { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); width: 68px; height: 68px; border-radius: 50%; border: 5px solid #fff; background: var(--brand); cursor: pointer; }
.scan-cam .scan-close { position: absolute; top: 10px; right: 10px; }

/* Forms (fill form) */
.form-fields { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; }
.form-field { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.form-field label.ff-l { display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; word-break: break-word; }
.form-field .ff-t { font-size: 12px; color: var(--muted); font-weight: 600; margin-left: 6px; }
.form-field .ff-radios { display: flex; flex-wrap: wrap; gap: 10px 16px; }

/* Text panels */
.summary-box { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 20px 22px; line-height: 1.7; }
.summary-box h3 { font-size: 15px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; }
.summary-box h3:first-child { margin-top: 0; }
.kw { display: inline-block; padding: 3px 10px; margin: 0 6px 6px 0; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-weight: 700; font-size: 13px; }
.html-input { width: 100%; min-height: 320px; font: 13.5px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.url-row { display: flex; gap: 8px; }
.meta-grid { display: grid; gap: 12px; max-width: 760px; margin: 0 auto; }
.meta-grid label { font-weight: 700; font-size: 14px; display: block; margin-bottom: 4px; }
