:root {
  --brand: #0f766e;
  --brand-2: #0d9488;
  --brand-ink: #ffffff;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --line: #e3e6eb;
  --text: #111827;
  --muted: #5b6472;
  --good: #15803d;
  --bad: #dc2626;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .14);
  --r: 14px;
  --font: "Segoe UI", system-ui, -apple-system, Tahoma, "Noto Sans Arabic", "Geeza Pro", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #14b8a6; --brand-2: #2dd4bf; --brand-ink: #04201d;
    --bg: #0d1117; --surface: #151b23; --surface-2: #1c242e; --line: #2a3441;
    --text: #e6e9ee; --muted: #9aa4b2; --good: #4ade80; --bad: #f87171;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3); --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #14b8a6; --brand-2: #2dd4bf; --brand-ink: #04201d;
  --bg: #0d1117; --surface: #151b23; --surface-2: #1c242e; --line: #2a3441;
  --text: #e6e9ee; --muted: #9aa4b2; --good: #4ade80; --bad: #f87171;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
main.wrap { flex: 1; padding-bottom: 48px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.ico { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-in { display: flex; align-items: center; gap: 24px; height: 62px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; letter-spacing: -.01em; }
.logo svg { width: 30px; height: 30px; }
.nav { display: flex; gap: 4px; }
.nav a { padding: 6px 12px; border-radius: 8px; color: var(--muted); font-weight: 600; font-size: 14px; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 10px; }
.pill-safe { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--good); background: color-mix(in srgb, var(--good) 10%, transparent); padding: 5px 10px; border-radius: 999px; }
.pill-safe svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; font-weight: 600; cursor: pointer; background: none; transition: background .15s, border-color .15s, transform .05s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--brand); color: var(--brand-ink); }
.btn-primary:hover { background: var(--brand-2); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-soft { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.btn-soft:hover { background: color-mix(in srgb, var(--brand) 20%, transparent); }
.btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.btn-xl { padding: 15px 28px; font-size: 17px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:focus-visible, .chip:focus-visible, .tcard:focus-visible, .seg button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- hero & home ---------- */
.hero { text-align: center; padding: 56px 0 28px; }
.badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--good); }
.badge .ico { width: 15px; height: 15px; }
.hero h1 { font-size: clamp(30px, 5vw, 52px); line-height: 1.2; margin: 18px 0 14px; letter-spacing: -.02em; font-weight: 800; }
.hero h1 em { font-style: normal; color: var(--brand); }
.lead { max-width: 680px; margin: 0 auto; color: var(--muted); font-size: 17px; }
.search { position: relative; max-width: 520px; margin: 28px auto 16px; }
.search .ico { position: absolute; inset-inline-start: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { width: 100%; padding: 14px 18px; padding-inline-start: 46px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); outline: none; font-size: 16px; }
.search input:focus { border-color: var(--brand); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 14px; cursor: pointer; color: var(--muted); }
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .ico { color: var(--c, var(--brand)); }

.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 24px; }
.tcard { position: relative; display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.tcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 40%, var(--line)); }
.tcard h3 { margin: 14px 0 6px; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.tcard p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.tcard.soon { opacity: .6; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tic { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.tic .ico { width: 23px; height: 23px; }
.tic.lg { width: 56px; height: 56px; border-radius: 16px; }
.tic.lg .ico { width: 28px; height: 28px; }

.why { margin-top: 72px; }
.why h2, .biz h2 { font-size: 28px; margin: 0 0 22px; text-align: center; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.why-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; }
.why-item h3 { margin: 12px 0 4px; font-size: 17px; }
.why-item p { margin: 0; color: var(--muted); font-size: 14px; }
.why-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.why-ic .ico { width: 21px; height: 21px; }
.biz { margin-top: 56px; display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 14%, var(--surface)), var(--surface)); border: 1px solid var(--line); border-radius: 20px; padding: 36px; }
.biz h2 { text-align: start; margin: 14px 0 10px; }
.biz p { color: var(--muted); margin: 0; }
.biz-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.biz-list li { display: flex; gap: 10px; align-items: flex-start; font-weight: 600; }
.biz-list .ico { color: var(--good); margin-top: 4px; }

/* ---------- tool page ---------- */
.thead { padding: 22px 0 18px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.back:hover { color: var(--text); }
[dir="ltr"] .back .ico { transform: scaleX(-1); }
.thead-row { display: flex; gap: 16px; align-items: center; }
.thead h1 { margin: 0; font-size: 28px; letter-spacing: -.01em; }
.thead p { margin: 2px 0 0; }

.drop { text-align: center; background: var(--surface); border: 2px dashed color-mix(in srgb, var(--c) 45%, var(--line)); border-radius: 20px; padding: 56px 20px; transition: background .15s, border-color .15s; }
body.dragging .drop, body.dragging .work-main { background: color-mix(in srgb, var(--c) 8%, var(--surface)); border-color: var(--c); }
.drop-ic { display: inline-grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); }
.drop-ic .ico { width: 34px; height: 34px; }
.drop h2 { margin: 18px 0 4px; font-size: 24px; }
.drop .btn-lg { margin: 18px 0 14px; background: var(--c); color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--c) 35%, transparent); }
.drop-local, .side-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--good); font-weight: 600; font-size: 13px; margin: 6px 0; }
.drop-local .ico, .side-note .ico { width: 14px; height: 14px; }

.work { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
.work-main { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; min-height: 420px; border-style: solid; }
.work-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.count { font-weight: 600; color: var(--muted); font-size: 14px; }
.bar-actions { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.bar-actions .ico { width: 15px; height: 15px; }
.work-side { position: sticky; top: 78px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; max-height: calc(100vh - 96px); }
.side-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.side-head h2 { font-size: 18px; margin: 0; }
.side-head .tic { width: 36px; height: 36px; border-radius: 10px; }
.side-head .tic .ico { width: 19px; height: 19px; }
.fields { overflow: auto; padding: 14px 2px; display: grid; gap: 16px; align-content: start; }
.side-foot { padding-top: 12px; border-top: 1px solid var(--line); }
.btn-run { background: var(--c); color: #fff; }
.btn-run:hover { background: color-mix(in srgb, var(--c) 85%, #000); }

/* file cards */
.items.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.fcard { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px; cursor: grab; user-select: none; }
.fcard.ghost { opacity: .4; }
.fthumb { height: 170px; display: grid; place-items: center; overflow: hidden; border-radius: 8px; }
.fthumb canvas, .fthumb img { max-width: 100%; max-height: 170px; box-shadow: 0 1px 4px rgba(0,0,0,.18); background: #fff; }
.fname { margin-top: 8px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; direction: ltr; text-align: center; }
.fmeta { font-size: 12px; color: var(--muted); text-align: center; }
.fx { position: absolute; top: 6px; inset-inline-end: 6px; z-index: 2; width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--surface); box-shadow: var(--shadow); cursor: pointer; font-size: 17px; line-height: 1; color: var(--muted); }
.fx:hover { color: var(--bad); }
.fadd { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 230px; border: 2px dashed var(--line); background: none; cursor: pointer; color: var(--muted); font-weight: 600; }
.fadd:hover { border-color: var(--c); color: var(--c); }
.fadd .ico { width: 30px; height: 30px; }
.skeleton { display: block; width: 110px; height: 150px; border-radius: 6px; background: linear-gradient(90deg, var(--line), var(--surface), var(--line)); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }

/* page cards */
.items.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.pcard { position: relative; background: var(--surface-2); border: 2px solid transparent; border-radius: 12px; padding: 8px; user-select: none; }
.pcard.selectable { cursor: pointer; }
.items.pages:has(.pact) .pcard { cursor: grab; }
.pthumb { position: relative; height: 160px; display: grid; place-items: center; overflow: hidden; }
.pinner { display: grid; place-items: center; transition: transform .2s; }
.pinner canvas { max-width: 110px; max-height: 150px; box-shadow: 0 1px 4px rgba(0,0,0,.18); display: block; }
.pinner .skeleton { width: 100px; height: 140px; }
.pnum { text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 4px; }
.pcheck { position: absolute; top: 4px; inset-inline-end: 4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-size: 13px; font-weight: 800; color: transparent; }
.pcard.sel { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface-2)); }
.pcard.sel .pcheck { background: var(--c); border-color: var(--c); color: #fff; }
.items.danger .pcard.sel { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, var(--surface-2)); }
.items.danger .pcard.sel .pcheck { background: var(--bad); border-color: var(--bad); }
.items.danger .pcard.sel canvas { opacity: .35; }
.pact { display: flex; justify-content: center; gap: 4px; margin-top: 6px; }
.pact button { width: 30px; height: 28px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; }
.pact button:hover { border-color: var(--c); color: var(--c); }
.pcard.ghost { opacity: .4; }

/* fields */
.field { display: grid; gap: 7px; }
.flabel { font-size: 13px; font-weight: 700; color: var(--muted); }
.note { margin: 0; font-size: 13px; color: var(--muted); background: var(--surface-2); padding: 10px 12px; border-radius: 10px; line-height: 1.6; }
.input { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); outline: none; }
.input:focus { border-color: var(--c, var(--brand)); }
.seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { flex: 1; border: 0; background: none; border-radius: 8px; padding: 7px 6px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.ocards { display: grid; gap: 8px; }
.ocard { display: grid; gap: 1px; text-align: start; border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 14px; cursor: pointer; }
.ocard span { font-size: 12.5px; color: var(--muted); }
.ocard.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 14px; cursor: pointer; line-height: 1.5; }
.check input { margin-top: 3px; width: 17px; height: 17px; accent-color: var(--c, var(--brand)); flex: none; }
.range { display: flex; align-items: center; gap: 10px; }
.range input { flex: 1; accent-color: var(--c, var(--brand)); }
.range output { min-width: 52px; text-align: center; font-weight: 700; font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 3px 6px; }
.color { width: 56px; height: 36px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 3px; cursor: pointer; }
.posgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--surface-2); padding: 8px; border-radius: 12px; width: 180px; }
.posgrid button { height: 34px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 7px; cursor: pointer; display: grid; place-items: center; }
.posgrid button i { width: 10px; height: 10px; border-radius: 50%; background: var(--line); }
.posgrid button:nth-child(-n+3) { align-items: start; padding-top: 5px; } .posgrid button:nth-child(n+4) { align-items: end; padding-bottom: 5px; }
.posgrid button.on { border-color: var(--c); } .posgrid button.on i { background: var(--c); }
.btnrow, .row { display: flex; gap: 6px; flex-wrap: wrap; }
.row .input { flex: 1; min-width: 0; }
.filepick { display: flex; align-items: center; gap: 10px; }

/* result */
.result { max-width: 640px; margin: 10px auto 0; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 40px 24px; }
.res-ic { display: inline-grid; place-items: center; width: 70px; height: 70px; border-radius: 50%; background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.res-ic .ico { width: 34px; height: 34px; stroke-width: 2.6; }
.result h2 { margin: 16px 0 4px; font-size: 26px; }
.result .res-main { margin: 20px 0 12px; background: var(--c); color: #fff; max-width: 100%; }
.result .res-main span, .result .res-main { overflow: hidden; text-overflow: ellipsis; }
.stats { display: grid; gap: 8px; margin: 18px 0 0; }
.stat { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center; text-align: start; background: var(--surface-2); padding: 10px 14px; border-radius: 10px; font-size: 14px; }
.stat .fname { margin: 0; text-align: start; }
.stat .good { color: var(--good); font-weight: 700; }
.res-list { list-style: none; padding: 0; margin: 8px 0; text-align: start; max-height: 280px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; }
.res-list li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
.res-list li:last-child { border-bottom: 0; }
.res-list .fname { flex: 1; margin: 0; text-align: start; }
.res-text { position: relative; margin: 14px 0; }
.res-text textarea { width: 100%; height: 240px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); padding: 12px; resize: vertical; font-size: 14px; line-height: 1.7; }
.res-text .copy { position: absolute; top: 8px; inset-inline-end: 8px; }
.res-next { margin-top: 22px; }
.res-next .chips { margin-top: 8px; }
.res-actions { display: flex; justify-content: center; gap: 8px; margin-top: 22px; flex-wrap: wrap; }

/* sign */
.signer { display: grid; gap: 12px; justify-items: center; }
.sg-nav { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.sg-page { position: relative; width: 100%; max-width: 900px; box-shadow: 0 2px 14px rgba(0,0,0,.16); background: #fff; }
.sg-canvas canvas { display: block; width: 100%; height: auto; }
.sg-layer { position: absolute; inset: 0; }
.sg-item { position: absolute; border: 1.5px dashed transparent; cursor: move; touch-action: none; }
.sg-item:hover, .sg-item.active { border-color: var(--c); background: color-mix(in srgb, var(--c) 6%, transparent); }
.sg-item img { width: 100%; height: 100%; display: block; pointer-events: none; }
.sg-x, .sg-all { position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--c); color: #fff; cursor: pointer; font-size: 14px; line-height: 1; display: none; }
.sg-x { right: -12px; background: var(--bad); }
.sg-all { right: 16px; }
.sg-rs { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 4px; background: var(--c); cursor: nwse-resize; display: none; }
.sg-item:hover .sg-x, .sg-item:hover .sg-all, .sg-item:hover .sg-rs, .sg-item.active .sg-rs { display: block; }
@media (hover: none) { .sg-x, .sg-all, .sg-rs { display: block; } }
.sg-side { display: grid; gap: 16px; }
.sg-sigs { display: flex; flex-wrap: wrap; gap: 8px; }
.sg-sig { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 6px; width: 132px; height: 62px; cursor: pointer; }
.sg-sig:hover { border-color: var(--c); }
.sg-sig img { max-width: 100%; max-height: 100%; }

.modal { position: fixed; inset: 0; z-index: 60; background: rgba(10, 14, 20, .55); display: grid; place-items: center; padding: 16px; }
.modal-card { width: 100%; max-width: 560px; background: var(--surface); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 9px 14px; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 2.5px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.tab { display: grid; gap: 10px; }
.pad-wrap { position: relative; }
.pad { width: 100%; height: 200px; border: 1.5px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.pad-hint { position: absolute; inset: 0; display: grid; place-items: center; color: #9ca3af; pointer-events: none; font-size: 14px; }
.pad-clear { justify-self: start; }
.fonts { display: grid; gap: 6px; }
.font-opt { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 14px; font-size: 30px; cursor: pointer; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.font-opt.on { border-color: var(--brand); }
.up-prev img { max-width: 100%; max-height: 160px; background: repeating-conic-gradient(#eee 0 25%, #fff 0 50%) 0 0/16px 16px; }
.inks { display: flex; gap: 8px; }
.ink { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; }
.ink.on { box-shadow: 0 0 0 2.5px var(--brand); }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; }

/* busy & toasts */
.busy { position: fixed; inset: 0; z-index: 50; background: rgba(10, 14, 20, .45); display: grid; place-items: center; padding: 16px; }
.busy-card { background: var(--surface); border-radius: 18px; padding: 28px; width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow-lg); }
.busy-card h3 { margin: 14px 0 12px; }
.busy-card p { margin: 10px 0 0; font-size: 13px; min-height: 1.6em; word-break: break-word; }
.spinner { width: 40px; height: 40px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 99px; transition: width .2s; }
.toasts { position: fixed; bottom: 18px; inset-inline: 16px; z-index: 70; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600; font-size: 14px; box-shadow: var(--shadow-lg); max-width: 520px; transition: opacity .3s, transform .3s; }
.toast.error { background: var(--bad); color: #fff; }
.toast.ok { background: var(--good); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0; font-size: 14px; }
.footer-in { display: grid; gap: 4px; }

/* responsive */
@media (max-width: 900px) {
  .work { grid-template-columns: 1fr; }
  .work-side { position: static; max-height: none; }
  .side-foot { position: sticky; bottom: 0; background: var(--surface); padding-bottom: 6px; }
  .biz { grid-template-columns: 1fr; padding: 24px; }
  .nav { display: none; }
}
@media (max-width: 560px) {
  .pill-safe span { display: none; }
  .hero { padding-top: 34px; }
  .tgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tcard { padding: 14px; }
  .tcard p { display: none; }
  .tcard h3 { font-size: 15px; }
  .items.files { grid-template-columns: 1fr 1fr; }
  .items.pages { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .pthumb { height: 120px; } .pinner canvas { max-width: 80px; max-height: 110px; }
  .work-main { padding: 10px; }
  .stat { grid-template-columns: 1fr; gap: 2px; }
  .drop { padding: 36px 16px; }
}
[dir="rtl"] .sg-nav .btn { transform: scaleX(-1); }

/* ---------- static SEO pages ---------- */
.crumbs { font-size: 13px; color: var(--muted); padding-top: 18px; }
.crumbs a:hover { color: var(--text); }
.crumbs span { margin: 0 6px; }
.seo { margin-top: 48px; display: grid; gap: 34px; }
.seo h2 { font-size: 22px; margin: 0 0 14px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; counter-increment: s; position: relative; padding-inline-start: 56px; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 16px; top: 14px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: color-mix(in srgb, var(--c, var(--brand)) 14%, transparent); color: var(--c, var(--brand)); }
.prose { max-width: 820px; color: var(--muted); }
.prose p { margin: 0 0 10px; }
.prose strong { color: var(--text); }
.feat { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.feat div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.feat strong { display: block; margin-bottom: 4px; }
.feat span { color: var(--muted); font-size: 14px; }
.faq { display: grid; gap: 8px; max-width: 860px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::after { content: '+'; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: '−'; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 10px 0 2px; color: var(--muted); }
.related { display: flex; flex-wrap: wrap; gap: 8px; }
.soonbox { margin-top: 26px; text-align: center; }
.soonbox h2 { font-size: 15px; color: var(--muted); margin: 0 0 10px; font-weight: 700; }
.soonbox .chips .chip { cursor: default; opacity: .75; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.cmp-table th, .cmp-table td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; }
.cmp-table thead th { background: var(--surface-2); }
.cmp-table tr:last-child td { border-bottom: 0; }
.cmp-table .yes { color: var(--good); font-weight: 700; }
.page-hero { padding: 40px 0 8px; }
.page-hero h1 { font-size: clamp(26px, 4vw, 40px); margin: 0 0 10px; }
.page-hero p { color: var(--muted); font-size: 17px; max-width: 760px; margin: 0; }
.footer-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px 18px; margin: 14px 0 6px; font-size: 13.5px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--text); }
.footer-meta { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; }
.footer-meta a { color: var(--muted); text-decoration: underline; }
.btn-lang { text-decoration: none; }

/* ---------- workspace additions ---------- */
.drop-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 18px 0 14px; }
.drop-btns .btn-lg { margin: 0; }
.drop-btns .btn-ghost { box-shadow: none; }
.blank-page { display: block; width: 100px; max-height: 140px; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.pwfield { position: relative; }
.pwfield .input { padding-inline-end: 40px; }
.pw-eye { position: absolute; inset-inline-end: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; font-size: 16px; opacity: .6; }
.pw-card h3 { margin: 0; }
.pw-card p { margin: 0; }
.pw-err { color: var(--bad) !important; font-weight: 600; }
.shape-tools .btn.on { border-color: var(--c); color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.ed-style { align-items: center; }
.ed-style input[type=range] { flex: 1; min-width: 80px; accent-color: var(--c); }
.ed-sz { font-size: 12px; font-weight: 700; min-width: 40px; }
.sg-layer.armed { cursor: crosshair; touch-action: none; }
.sg-rect { display: block; width: 100%; height: 100%; pointer-events: none; }
textarea.input { resize: vertical; min-height: 64px; }

/* crop */
.crop-page { overflow: hidden; }
.crop-layer { position: absolute; inset: 0; }
.crop-box { position: absolute; box-shadow: 0 0 0 9999px rgba(10, 14, 20, .5); outline: 2px solid var(--c); cursor: move; touch-action: none; }
.ch { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--c); border-radius: 3px; }
.ch-nw { left: -8px; top: -8px; cursor: nwse-resize; } .ch-ne { right: -8px; top: -8px; cursor: nesw-resize; }
.ch-sw { left: -8px; bottom: -8px; cursor: nesw-resize; } .ch-se { right: -8px; bottom: -8px; cursor: nwse-resize; }
.ch-n { left: calc(50% - 7px); top: -8px; cursor: ns-resize; } .ch-s { left: calc(50% - 7px); bottom: -8px; cursor: ns-resize; }
.ch-w { top: calc(50% - 7px); left: -8px; cursor: ew-resize; } .ch-e { top: calc(50% - 7px); right: -8px; cursor: ew-resize; }
.crop-dims { margin: 0; }

/* compare */
.result.wide { max-width: 1100px; }
.res-html { text-align: start; margin: 18px 0; }
.cmp-sum { font-weight: 700; margin: 0 0 12px; }
.cmp-sum.same { color: var(--good); }
.cmp-head, .cmp-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cmp-head { font-weight: 700; font-size: 13px; padding: 6px 0; border-bottom: 2px solid var(--line); margin-bottom: 6px; }
.cmp-head span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-row > div { padding: 4px 8px; border-radius: 6px; font-size: 14px; min-height: 1.6em; word-break: break-word; }
.cmp-row.eq > div { color: var(--muted); }
.cmp-row.del .cmp-a { background: color-mix(in srgb, var(--bad) 14%, transparent); }
.cmp-row.add .cmp-b { background: color-mix(in srgb, var(--good) 16%, transparent); }
.cmp-row.ch > div { background: color-mix(in srgb, #eab308 14%, transparent); }
.cmp-row del { background: color-mix(in srgb, var(--bad) 35%, transparent); text-decoration: line-through; }
.cmp-row ins { background: color-mix(in srgb, var(--good) 38%, transparent); text-decoration: none; }
.cmp-pg { float: inline-end; font-size: 11px; color: var(--muted); margin-inline-start: 8px; }
.cmp-gap { text-align: center; color: var(--muted); padding: 2px 0; }
.cmp { max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface); }
.prose h2 { color: var(--text); }
.seg { flex-wrap: wrap; } .seg button { min-width: 58px; }
.stat .bad { color: var(--bad); font-weight: 700; } .stat { grid-template-columns: 1fr auto auto; }

/* language menu */
.langmenu { position: relative; }
.langmenu summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 6px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 600; font-size: 13px; white-space: nowrap; }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary .ico { width: 15px; height: 15px; }
.langmenu[open] summary { border-color: var(--brand); }
.langlist { position: absolute; inset-inline-end: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; min-width: 180px; z-index: 30; }
.langlist a { padding: 7px 12px; border-radius: 8px; font-size: 14px; }
.langlist a:hover, .langlist a:focus-visible { background: var(--surface-2); outline: none; }
.langlist a.on { color: var(--brand); font-weight: 700; }
.footer-langs a { text-decoration: none !important; }
@media (max-width: 560px) { .langmenu summary span { display: none; } }
