/* ===== Free tools ===== */
.tool { padding: 22px; border: 1px solid var(--line); border-radius: 14px; background: color-mix(in srgb, var(--text) 3%, var(--bg)); }
.tool .lbl, .tool label { font-size: 14px; color: var(--muted); }
.tool .lbl { display: block; margin: 18px 0 8px; }
.tool .lbl:first-child { margin-top: 0; }
.tool .lbl small { color: var(--muted); opacity: .7; margin-left: 6px; }
.tool input[type="text"], .tool input[type="number"], .tool select, .tool textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); color: var(--text); font: inherit; font-size: 15px; line-height: 1.5;
}
.tool textarea { resize: vertical; min-height: 120px; }
.tool .code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; line-height: 1.6; }
.tool input:focus-visible, .tool textarea:focus-visible, .tool select:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }
.tool input[type="range"] { width: 100%; accent-color: var(--text); }
.tool input[type="color"] { width: 36px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; }
.tool .num { width: 90px; display: inline-block; margin-left: 8px; }
.tool .row { display: flex; gap: 12px 20px; flex-wrap: wrap; align-items: center; }
.tool .row.between { justify-content: space-between; }
.tool .row.opts { margin: 14px 0 0; }
.tool .inline { display: inline-flex; align-items: center; gap: 8px; }
.tool .inline select { width: auto; padding: 6px 10px; }
.tool .meta { margin: 8px 0 14px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.tool .btns { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.btn-sm { font-family: inherit; }
.btn-sm:disabled { opacity: .4; cursor: default; }
.btn-sm[aria-pressed="true"] { border-color: var(--text); }
.tool .status { min-height: 1.4em; margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.tool .status.err { color: var(--text); border-left: 2px solid var(--text); padding-left: 10px; }
.muted { color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; margin-top: 8px; }
@media (max-width: 860px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.chipbtns { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chipbtns button { padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; cursor: pointer; transition: color .15s, border-color .15s; }
.chipbtns button:hover { color: var(--text); border-color: var(--muted); }
.chipbtns button[aria-pressed="true"] { color: var(--accent-ink); background: var(--text); border-color: var(--text); }
.chipbtns button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Drop zone */
.drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 44px 20px; border: 1.5px dashed var(--muted); border-radius: 12px; text-align: center; cursor: pointer; transition: border-color .15s, background-color .15s; }
.drop:hover, .drop.over { border-color: var(--text); background: color-mix(in srgb, var(--text) 5%, transparent); }
.drop:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }
.drop .icon { width: 28px; height: 28px; margin-bottom: 6px; }
.drop strong { font-size: 17px; font-weight: 600; }
.drop span { color: var(--muted); font-size: 14px; }
.drop[hidden], .work[hidden] { display: none; }

/* Background remover */
.stage { position: relative; display: grid; place-items: center; min-height: 240px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  background: repeating-conic-gradient(color-mix(in srgb, var(--text) 10%, transparent) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px, var(--bg); }
.stage.flat { background: var(--stage-bg, #fff); }
.stage canvas { display: block; max-width: 100%; max-height: 520px; width: auto; height: auto; }
.busy { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 20px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(3px); text-align: center; font-size: 15px; }
.busy[hidden] { display: none; }
.busy progress { width: min(320px, 80%); height: 6px; accent-color: var(--text); }
.controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 24px; margin-top: 18px; }
.controls.row3 { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 18px 0 0; }
.controls .btns { grid-column: 1 / -1; margin: 0; }
.opt { min-width: 0; margin: 0; padding: 0; border: 0; }
.opt legend, .opt > label { display: block; margin: 0 0 8px; padding: 0; font-size: 14px; color: var(--muted); }
.radio { display: block !important; margin: 0 0 6px !important; color: var(--text) !important; }
.radio small { color: var(--muted); margin-left: 6px; }
@media (max-width: 720px) { .controls, .controls.row3 { grid-template-columns: 1fr; } }

/* Grammar checker */
.issues { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.issues li { padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.i-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.i-kind { padding: 1px 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--muted); }
.i-go { border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.i-go:hover { color: var(--text); }
.i-ctx { margin: 0 0 6px; font-size: 15px; word-break: break-word; }
.i-ctx mark { background: color-mix(in srgb, var(--text) 18%, transparent); color: var(--text); padding: 0 2px; border-radius: 3px; text-decoration: underline wavy; text-underline-offset: 3px; }
.i-msg { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.i-acts { display: flex; flex-wrap: wrap; gap: 8px; }
.sug, .ign { padding: 5px 11px; border: 1px solid var(--line); border-radius: 8px; background: transparent; color: var(--text); font: inherit; font-size: 13.5px; cursor: pointer; transition: border-color .15s; }
.sug:hover, .ign:hover { border-color: var(--muted); }
.ign { color: var(--muted); }
.summary { margin: 16px 0 0; font-weight: 500; }

/* SERP preview */
.hint { margin: 6px 0 0; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.meter { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; }
.meter .bar { flex: 1; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--text) 12%, transparent); overflow: hidden; }
.meter .bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: var(--muted); transition: width .15s; }
.meter[data-state="good"] .bar i { background: var(--text); }
.meter[data-state="bad"] .bar i { background: repeating-linear-gradient(45deg, var(--text) 0 4px, transparent 4px 8px); }
.meter .mv { min-width: 190px; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.serp { margin: 10px 0 0; padding: 18px 20px; border-radius: 12px; background: #fff; color: #202124; font-family: Arial, Helvetica, sans-serif; }
.serp[data-mode="mobile"] { max-width: 380px; padding: 14px 16px; }
.serp-url { display: flex; align-items: center; gap: 10px; font-size: 14px; color: #202124; line-height: 1.3; }
.serp .fav { width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; border: 1px solid #dadce0; flex: none; }
.serp-title { margin: 8px 0 4px; font-size: 20px; line-height: 1.3; color: #1a0dab; }
.serp[data-mode="mobile"] .serp-title { font-size: 18px; }
.serp-desc { font-size: 14px; line-height: 1.58; color: #4d5156; word-break: break-word; }

/* Word counter */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 20px 0; }
.stats > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.stats .wide { grid-column: span 2; }
.stats dt { font-size: 12.5px; color: var(--muted); }
.stats dd { margin: 2px 0 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; text-shadow: var(--bold-glow); }
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.th { margin: 0 0 8px; font-size: 14px; font-weight: 500; color: var(--muted); }
.kw { width: 100%; border-collapse: collapse; font-size: 14px; }
.kw th { text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted); padding: 6px 0; border-bottom: 1px solid var(--line); }
.kw td { padding: 6px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.kw td:nth-child(n+2), .kw th:nth-child(n+2) { text-align: right; width: 64px; }

/* Image compressor results */
.rows { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.rows li { display: flex; align-items: center; gap: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.rows .thumb { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; flex: none; background: var(--line); }
.rows .ri { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 14px; }
.rows .ri strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.rows .ri .muted { font-size: 13px; }
.rows .rb { flex: none; }
@media (max-width: 560px) { .rows li { flex-wrap: wrap; } .rows .rb { width: 100%; } }

/* FAQ schema rows */
.faqrow { position: relative; display: grid; gap: 10px; padding: 14px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.faqrow label { display: grid; gap: 6px; }
.link-btn { justify-self: end; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.link-btn:hover { color: var(--text); }

/* Tool pages: steps, faq, related, credit */
.tsec { margin: 56px 0 0; }
.tsec h2 { margin: 0 0 16px; font-size: 22px; font-weight: 600; letter-spacing: -.03em; text-shadow: var(--bold-glow); }
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 12px; }
.steps li { counter-increment: s; display: flex; gap: 14px; align-items: baseline; color: var(--muted); font-size: 16px; }
.steps li::before { content: counter(s); flex: none; width: 26px; height: 26px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 7px; color: var(--text); font-size: 13px; font-variant-numeric: tabular-nums; }
.tfaq { display: grid; gap: 10px; }
.tfaq details { border: 1px solid var(--line); border-radius: 10px; padding: 0 16px; background: color-mix(in srgb, var(--text) 3%, var(--bg)); }
.tfaq summary { cursor: pointer; padding: 14px 0; font-weight: 500; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.tfaq summary::-webkit-details-marker { display: none; }
.tfaq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.tfaq details[open] summary::after { content: "–"; }
.tfaq details p { margin: 0 0 16px; color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.private { display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 0; color: var(--muted); font-size: 14px; }
.private .icon { width: 18px; height: 18px; margin-top: 2px; color: var(--text); }
.credit { margin: 18px 0 0; color: var(--muted); font-size: 12.5px; }
.related { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

/* Tools index cards */
.tool-groups h2 { margin: 44px 0 14px; font-size: 15px; font-weight: 500; color: var(--muted); }
.tool-groups h2:first-child { margin-top: 0; }
.tcards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
@media (max-width: 640px) { .tcards { grid-template-columns: 1fr; } }
.tcard { position: relative; display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 20px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: color-mix(in srgb, var(--text) 3%, var(--bg)); transition: border-color .15s; }
.tcard::before { content: ""; position: absolute; top: 0; right: 0; width: 130px; height: 96px; pointer-events: none; opacity: .5;
  background: radial-gradient(circle, color-mix(in srgb, var(--text) 30%, transparent) 1px, transparent 1.4px) 0 0 / 8px 8px;
  -webkit-mask-image: linear-gradient(225deg, #000 0%, transparent 70%); mask-image: linear-gradient(225deg, #000 0%, transparent 70%); }
.tcard:hover { border-color: color-mix(in srgb, var(--text) 45%, var(--line)); }
.tcard .ticon { position: relative; display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg); }
.tcard .ticon .icon { width: 19px; height: 19px; }
.tcard h3 { position: relative; margin: 0; font-size: 17px; font-weight: 600; letter-spacing: -.02em; text-shadow: var(--bold-glow); }
.tcard p { position: relative; margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.6; }
.tcard .go { position: relative; margin-top: auto; padding-top: 10px; display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13.5px; }
.tcard:hover .go { color: var(--text); }
.tcard .go .icon { width: 14px; height: 14px; }
.tag-free { position: relative; align-self: flex-start; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; color: var(--muted); }

/* Engine check table */
.kw.chk { margin-top: 14px; }
.kw.chk td, .kw.chk th { text-align: left !important; width: auto !important; padding: 8px 10px 8px 0; vertical-align: top; }
.kw.chk td:nth-child(2) { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 12.5px; word-break: break-all; }
.kw.chk tr.ok td:nth-child(3) { color: var(--text); }
.kw.chk tr.bad td:nth-child(3) { color: var(--text); border-left: 2px solid var(--text); padding-left: 10px; font-weight: 500; }
.kw.chk tr.warn td:nth-child(3) { color: var(--muted); }

/* QR code generator */
.qr-stage { display: grid; place-items: center; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: repeating-conic-gradient(color-mix(in srgb, var(--text) 8%, transparent) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px, var(--bg); min-height: 200px; }
.qr-stage canvas { display: block; max-width: 100%; height: auto; image-rendering: pixelated; box-shadow: 0 0 0 1px var(--line); }
.grid2.tight { gap: 14px; }
.grid2.tight .lbl { margin-top: 14px; }
.opts-row { margin: 10px 0 0; font-size: 14px; color: var(--muted); }

/* ---------- SEO title generator ---------- */
.drop.small { flex-direction: row; justify-content: center; gap: 12px; margin-top: 12px; padding: 14px 16px; text-align: left; }
.drop.small .icon { margin: 0; width: 22px; height: 22px; }
.drop.small span { font-size: 14px; }
.drop.small strong { font-size: 14px; }
.seo-out { display: grid; gap: 14px; margin-top: 22px; }
.seo-out[hidden] { display: none; }
.rcard { padding: 18px 18px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.rhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 12px; }
.rhead h3 { margin: 0; font-size: 17px; }
.rhead .h-sm { font-size: 15px; }
.rhead.sp2 { margin-top: 16px; }
.rbig { margin: 0 0 12px; font-family: var(--pixel); font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; text-shadow: var(--bold-glow); word-break: break-word; }
.rcode { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: color-mix(in srgb, var(--text) 5%, var(--bg)); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 15px; word-break: break-all; }
.rta { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--text) 3%, var(--bg)); color: var(--text); font: inherit; font-size: 14.5px; line-height: 1.55; resize: vertical; }
.rta.code { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 13px; }
.small { font-size: 13px; }
.opts { display: grid; gap: 8px; }
label.opt { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: border-color .15s; }
label.opt:hover { border-color: var(--muted); }
label.opt:has(input:checked) { border-color: var(--text); background: color-mix(in srgb, var(--text) 4%, var(--bg)); }
label.opt input { margin-top: 4px; accent-color: var(--text); flex: none; }
.obody { flex: 1; min-width: 0; display: grid; gap: 4px; }
.otext { font-size: 15.5px; line-height: 1.5; color: var(--text); word-break: break-word; }
.pick { display: inline-block; margin-left: 8px; padding: 0 7px; border: 1px solid var(--text); border-radius: 999px; font-size: 11px; font-style: normal; letter-spacing: .03em; vertical-align: 1px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.checks li { display: flex; gap: 12px; align-items: baseline; font-size: 14.5px; }
.checks li b { flex: none; min-width: 52px; padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; text-align: center; }
.checks li.pass b { background: var(--text); color: var(--accent-ink); border-color: var(--text); }
.checks li.fail b { border-style: dashed; color: var(--muted); }
.checks li span { color: var(--muted); }
.checks li.pass span { color: var(--text); }
.seo-out .serp { margin: 0 0 14px; }
.link-btn.inline { display: inline; padding: 0; color: var(--text); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Color code checker ---------- */
.color-top { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 24px; align-items: start; }
.color-input .row { flex-wrap: nowrap; }
.color-input .row input[type="text"] { flex: 1; min-width: 0; }
.color-input input[type="color"] { width: 46px; height: 42px; flex: none; }
.swatch-big { position: relative; display: flex; align-items: flex-end; min-height: 150px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden;
  background: repeating-conic-gradient(color-mix(in srgb, var(--text) 12%, transparent) 0% 25%, transparent 0% 50%) 0 0 / 18px 18px; }
.swatch-big::before { content: ""; position: absolute; inset: 0; background: var(--sw, #ff5733); opacity: var(--swa, 1); }
.swatch-big span { position: relative; margin: 14px; font-family: var(--pixel); font-size: 22px; }
@media (max-width: 760px) { .color-top { grid-template-columns: 1fr; } .swatch-big { min-height: 110px; } }
.th.sp { margin-top: 30px; }
.fmt { display: grid; gap: 0; border-top: 1px solid var(--line); }
.frow { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.frow .fk { color: var(--muted); font-size: 14px; }
.frow .fv { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 14px; word-break: break-all; }
.contrast { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 14px; }
@media (max-width: 760px) { .contrast { grid-template-columns: 1fr; } .frow { grid-template-columns: 110px minmax(0, 1fr) auto; } }
.cprev { display: flex; flex-direction: column; justify-content: center; gap: 8px; min-height: 160px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 12px; }
.cp-big { font-size: 52px; line-height: 1; font-family: var(--pixel); }
.cp-txt { font-size: 15px; }
.cmeta { display: grid; gap: 10px; align-content: start; }
.ratio { display: flex; align-items: baseline; gap: 4px; }
.ratio strong { font-size: 40px; line-height: 1; text-shadow: var(--bold-glow); }
.ratio span { color: var(--muted); }
.cchecks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cchecks li { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.cchecks b { padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 12px; }
.cchecks .pass b { background: var(--text); color: var(--accent-ink); border-color: var(--text); }
.cchecks .fail b { border-style: dashed; color: var(--muted); }
.fix { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.chipsw { width: 22px; height: 22px; border: 1px solid var(--line); border-radius: 6px; flex: none; }
.prow { margin: 0 0 20px; }
.phead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 8px; }
.phead h4 { margin: 0; font-size: 15px; }
.phead .muted { flex: 1; min-width: 160px; font-size: 13px; }
.sws { display: flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sw { flex: 1 1 0; min-width: 0; min-height: 76px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 8px 8px 9px; border: 0; cursor: pointer; font: inherit; text-align: left; transition: flex-grow .18s; }
.sw:hover { flex-grow: 1.35; }
.sw:focus-visible { outline: 2px solid var(--text); outline-offset: -3px; }
.sw-hex { font-size: 12px; font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.sw-role { font-size: 11px; opacity: .8; }
@media (max-width: 560px) { .sws { flex-wrap: wrap; } .sw { flex: 1 1 33%; } }
@media (prefers-reduced-motion: reduce) { .sw { transition: none; } }

.rmid { margin: 0 0 8px; font-size: 18px; line-height: 1.4; word-break: break-word; }

/* ---------- PDF signature tool ---------- */
.ptools { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: space-between; margin: 0 0 12px; }
.pgrp { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pzoom { min-width: 48px; text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.pedit { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.pedit input[type="text"] { width: 260px; max-width: 100%; margin-left: 8px; }
.pedit input[type="range"] { width: 160px; margin-left: 8px; }
.pviewer { max-height: min(78vh, 900px); overflow: auto; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 16px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--text) 8%, var(--bg)); outline: none; }
.ppage { position: relative; flex: none; background: #fff; box-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.ppage canvas { display: block; background: #fff; }
.ov { position: absolute; inset: 0; touch-action: pan-y; }
.pnum { position: absolute; left: 0; top: -22px; font-size: 12px; color: var(--muted); }
.ppage { margin-top: 22px; }
.pitem { position: absolute; cursor: move; touch-action: none; user-select: none; -webkit-user-select: none; }
.pitem img { display: block; width: 100%; height: 100%; pointer-events: none; }
.pitem.sel { outline: 1.5px dashed #000; outline-offset: 2px; }
.hnd { position: absolute; width: 12px; height: 12px; background: #fff; border: 2px solid #000; border-radius: 3px; }
.hnd.h-nw { left: -8px; top: -8px; cursor: nwse-resize; } .hnd.h-ne { right: -8px; top: -8px; cursor: nesw-resize; }
.hnd.h-sw { left: -8px; bottom: -8px; cursor: nesw-resize; } .hnd.h-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.pdel { position: absolute; right: -12px; top: -30px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: #000; color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.modal { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 16px; background: rgba(0, 0, 0, .62); }
.modal[hidden] { display: none; }
.modal-card { width: min(620px, 100%); max-height: calc(100dvh - 32px); overflow: auto; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg); box-shadow: 0 24px 70px rgba(0, 0, 0, .55); }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 14px; }
.modal-head strong { font-size: 18px; }
.pad { display: block; width: 100%; margin: 14px 0 0; border: 1px dashed var(--muted); border-radius: 10px; background-color: #fff; background-image: linear-gradient(to bottom, transparent 69%, #d4d4d8 69%, #d4d4d8 70%, transparent 70%); touch-action: none; cursor: crosshair; }
.modal .row.opts { margin: 12px 0 0; }
.modal .btns { margin-top: 18px; }
.sig-prev { display: grid; place-items: center; min-height: 120px; margin: 12px 0 0; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.sig-prev canvas { max-width: 100%; max-height: 160px; }
.recent { display: flex; flex-wrap: wrap; gap: 8px; }
.rthumb { padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.rthumb img { display: block; height: 34px; width: auto; }
