/* ==========================================================================
   Warqa — brand design system
   Paper + leaf (ورقة means both). Warm paper neutrals, one emerald brand colour
   for every primary action, category colours only as accents.
   ========================================================================== */

/* Readex Pro (SIL OFL 1.1, fonts/brand/OFL.txt) — one variable file per script, loaded only when needed. */
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 160 700; font-display: swap; src: url(/fonts/brand/readex-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 160 700; font-display: swap; src: url(/fonts/brand/readex-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 160 700; font-display: swap; src: url(/fonts/brand/readex-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Russian and Hindi: Readex Pro has no Cyrillic or Devanagari, so those letters come from Manrope and Noto Sans
   Devanagari (both OFL) declared under the same family name — every page picks them up by itself. Their weight range must equal the
   Readex faces (160 700): Chrome only combines faces of a family whose descriptors match. */
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 160 700; font-display: swap; src: url(/fonts/brand/manrope-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Readex Pro'; font-style: normal; font-weight: 160 700; font-display: swap; src: url(/fonts/brand/noto-devanagari.woff2) format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF; }
/* Persian and Urdu pages: Readex Pro's Arabic subset has no ی ک گ پ چ ژ, so those letters come from Vazirmatn (OFL). */
@font-face { font-family: 'Vazirmatn'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/brand/vazirmatn-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }

:root {
  --brand: #0e7a63;
  --brand-strong: #0a5f4d;
  --brand-ink: #ffffff;
  --brand-soft: #e2f2ec;
  --brand-fold: #5fc7a6;
  --accent: #e59a2f;
  --bg: #f6f5f0;
  --surface: #ffffff;
  --surface-2: #f1f0ea;
  --surface-3: #e8e6de;
  --line: #e5e2d9;
  --line-strong: #d3cfc3;
  --text: #14211d;
  --muted: #5b6762;
  --faint: #8b9590;
  --good: #0f7a4a;
  --bad: #c43a2f;
  --shadow-sm: 0 1px 2px rgba(20, 33, 29, .06);
  --shadow: 0 1px 2px rgba(20, 33, 29, .05), 0 8px 24px -10px rgba(20, 33, 29, .14);
  --shadow-lg: 0 2px 6px rgba(20, 33, 29, .04), 0 28px 60px -22px rgba(20, 33, 29, .30);
  --glow: radial-gradient(620px 340px at 50% -40px, rgba(14, 122, 99, .14), transparent 75%);
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --r-xl: 28px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, 'Noto Sans Arabic', 'Geeza Pro', Arial, sans-serif;
  color-scheme: light;
}
:root:lang(fa), :root:lang(ur) { --font: 'Vazirmatn', 'Readex Pro', system-ui, -apple-system, 'Segoe UI', Tahoma, 'Noto Sans Arabic', Arial, sans-serif; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #3ccf9f; --brand-strong: #74e2bf; --brand-ink: #03150f; --brand-soft: rgba(60, 207, 159, .13); --brand-fold: #1e8a6a; --accent: #f3b34f;
    --bg: #0b1110; --surface: #121a18; --surface-2: #18221f; --surface-3: #1f2b27; --line: #233230; --line-strong: #31443f;
    --text: #e8efec; --muted: #9dada6; --faint: #6f7e78; --good: #4ade80; --bad: #f87171;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -12px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, .75);
    --glow: radial-gradient(620px 340px at 50% -40px, rgba(60, 207, 159, .12), transparent 75%);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #3ccf9f; --brand-strong: #74e2bf; --brand-ink: #03150f; --brand-soft: rgba(60, 207, 159, .13); --brand-fold: #1e8a6a; --accent: #f3b34f;
  --bg: #0b1110; --surface: #121a18; --surface-2: #18221f; --surface-3: #1f2b27; --line: #233230; --line-strong: #31443f;
  --text: #e8efec; --muted: #9dada6; --faint: #6f7e78; --good: #4ade80; --bad: #f87171;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -12px rgba(0, 0, 0, .6); --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, .75);
  --glow: radial-gradient(620px 340px at 50% -40px, rgba(60, 207, 159, .12), transparent 75%);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15.5px/1.65 var(--font); min-height: 100vh; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { font-weight: 650; line-height: 1.3; }
[dir="ltr"] h1, [dir="ltr"] h2 { letter-spacing: -.02em; }
::selection { background: color-mix(in srgb, var(--brand) 24%, transparent); }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.wrap { --gutter: 20px; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
main.wrap { flex: 1; padding-bottom: 72px; }
.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; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; top: -60px; inset-inline-start: 12px; z-index: 100; background: var(--brand); color: var(--brand-ink); padding: 8px 14px; border-radius: 10px; font-weight: 600; transition: top .2s; }
.skip:focus { top: 12px; }

/* ---------- logo ---------- */
.logo-mark { --lg-page: var(--brand); --lg-fold: var(--brand-fold); --lg-leaf: var(--surface); }
.logo-mark .lg-page { fill: var(--lg-page); }
.logo-mark .lg-fold { fill: var(--lg-fold); }
.logo-mark .lg-leaf { fill: var(--lg-leaf); }
.logo-mark .lg-vein { stroke: var(--lg-page); stroke-width: 1.5; stroke-linecap: round; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid transparent; transition: border-color .25s, box-shadow .25s; }
.topbar.scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(0, 0, 0, .35); }
.topbar-in { position: relative; display: flex; align-items: center; gap: 6px; height: 66px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 21px; margin-inline-end: 14px; flex: none; }
.logo .logo-mark { width: 34px; height: 34px; transition: transform .35s var(--ease); }
.logo:hover .logo-mark { transform: rotate(-6deg) scale(1.04); }
.logo-tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--brand); background: var(--brand-soft); padding: 2px 7px; border-radius: 7px; direction: ltr; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav > a, .mega > summary { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: 14.5px; cursor: pointer; transition: background .15s, color .15s; }
.nav > a:hover, .mega > summary:hover, .mega[open] > summary { background: var(--surface-2); color: var(--text); }
.top-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; }
.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: 6px 12px; border-radius: 999px; white-space: nowrap; }
.pill-safe .ico { width: 14px; height: 14px; stroke-width: 2.3; }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); }
.icon-btn .ico { width: 19px; height: 19px; }
.theme-btn .i-sun { display: none; }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; }
  :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; }
}

/* tools mega menu (a <details>, so it also works before scripts load) */
.mega > summary { list-style: none; }
.mega > summary::-webkit-details-marker { display: none; }
.mega .i-chev { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.mega[open] .i-chev { transform: rotate(180deg); }
.mega .i-burger, .mega .i-close { display: none; }
.mega-panel { position: absolute; top: calc(100% + 6px); inset-inline: 20px; z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); padding: 22px; animation: pop .22s var(--ease); }
.mega-cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 18px; }
.mega-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 0 0 8px; padding-inline-start: 8px; }
.mega-h i, .tgroup-h i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.mega-col a { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 10px; font-size: 14px; font-weight: 500; transition: background .15s; }
.mega-col a:hover { background: var(--surface-2); }
.mega-col a .ico { width: 17px; height: 17px; color: var(--c); }
.mega-extra { display: none; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.99); } to { opacity: 1; transform: none; } }

/* language menu */
.langmenu { position: relative; }
.langmenu summary { list-style: none; display: inline-flex; align-items: center; gap: 7px; cursor: pointer; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 500; font-size: 13.5px; color: var(--muted); white-space: nowrap; transition: color .15s, border-color .15s; }
.langmenu summary:hover { color: var(--text); border-color: var(--line-strong); }
.langmenu summary::-webkit-details-marker { display: none; }
.langmenu summary .ico { width: 17px; height: 17px; }
.langmenu[open] summary { border-color: var(--brand); color: var(--text); }
.langlist { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; min-width: 190px; z-index: 50; animation: pop .2s var(--ease); }
.langlist a { padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.langlist a:hover, .langlist a:focus-visible { background: var(--surface-2); outline: none; }
.langlist a.on { color: var(--brand); font-weight: 650; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: 12px; padding: 9px 16px; font-weight: 600; cursor: pointer; background: none; transition: background .18s, border-color .18s, box-shadow .18s, transform .12s var(--ease), color .18s; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: default; }
.btn .ico { width: 18px; height: 18px; }
.btn-primary, .btn-run { background: var(--brand); color: var(--brand-ink); box-shadow: 0 1px 0 rgba(255, 255, 255, .18) inset, 0 8px 20px -10px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn-primary:hover, .btn-run:hover { background: var(--brand-strong); }
.btn-ghost { border-color: var(--line); background: var(--surface); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-soft:hover { background: color-mix(in srgb, var(--brand) 20%, transparent); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-sm .ico { width: 15px; height: 15px; }
.btn-lg { padding: 13px 24px; font-size: 16px; border-radius: 14px; }
.btn-xl { padding: 16px 30px; font-size: 17px; border-radius: 16px; }
.btn-block { width: 100%; }

/* ---------- chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: var(--surface); padding: 7px 14px; border-radius: 999px; font-weight: 500; font-size: 14px; cursor: pointer; color: var(--muted); transition: color .15s, border-color .15s, background .15s; }
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.chip .ico { color: var(--c, var(--brand)); width: 16px; height: 16px; }
.tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.tag-new { font-style: normal; font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px; color: #fff; background: var(--accent); letter-spacing: .02em; }

/* ---------- home: hero ---------- */
.hero { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .85fr); gap: 44px; align-items: center; padding: 64px 0 40px; }
.hero::before { content: ''; position: absolute; inset: -66px calc(-1 * var(--gutter)) 0; background: var(--glow); z-index: -1; pointer-events: none; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); font-size: 13px; font-weight: 600; color: var(--good); }
.eyebrow .ico { width: 15px; height: 15px; }
.hero h1 { font-size: clamp(32px, 3.8vw, 46px); line-height: 1.16; margin: 20px 0 16px; font-weight: 700; }
.hero h1 em { font-style: normal; color: var(--brand); }
.lead { max-width: 620px; margin: 0; color: var(--muted); font-size: 17.5px; line-height: 1.75; }
.trust { list-style: none; display: flex; flex-wrap: wrap; gap: 8px 20px; padding: 0; margin: 24px 0 0; }
.trust li { display: inline-flex; align-items: center; gap: 7px; font-weight: 500; font-size: 14.5px; }
.trust .ico { width: 18px; height: 18px; padding: 3px; border-radius: 50%; color: var(--brand-ink); background: var(--brand); stroke-width: 3; }
.trust.sm { margin-top: 14px; gap: 6px 16px; }
.trust.sm li { font-size: 13.5px; color: var(--muted); }
.trust.sm .ico { width: 16px; height: 16px; }

/* smart drop card: drop any file, get the right tools */
.hdrop { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 34px 28px 28px; box-shadow: var(--shadow-lg); text-align: center; transition: transform .25s var(--ease); }
.hdrop::before { content: ''; position: absolute; inset: 10px; border: 2px dashed var(--line-strong); border-radius: 20px; pointer-events: none; transition: border-color .2s, background .2s; }
body.dragging .hdrop { transform: scale(1.015); }
body.dragging .hdrop::before { border-color: var(--brand); background: var(--brand-soft); }
.hdrop > * { position: relative; }
.hdrop h2 { margin: 18px 0 6px; font-size: 22px; }
.hdrop p { margin: 0; }
.hdrop .btn-lg { margin: 20px 0 14px; }
.file-fan { position: relative; display: block; width: 200px; height: 92px; margin: 0 auto; }
.file-fan span { position: absolute; top: 6px; inset-inline-start: 50%; width: 62px; height: 78px; margin-inline-start: -31px; border-radius: 10px 18px 10px 10px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: grid; place-items: end center; padding-bottom: 12px; font-size: 11px; font-weight: 700; letter-spacing: .04em; color: #fff; direction: ltr; transition: transform .35s var(--ease); }
.file-fan span::after { content: attr(data-t); padding: 2px 7px; border-radius: 6px; background: var(--c); }
.file-fan span:nth-child(1) { --c: #2b579a; transform: translateX(-58px) rotate(-12deg); }
.file-fan span:nth-child(2) { --c: #d97706; transform: translateX(58px) rotate(12deg); }
.file-fan span:nth-child(3) { --c: #e0533d; transform: translateY(-4px); z-index: 1; }
.hdrop:hover .file-fan span:nth-child(1), body.dragging .file-fan span:nth-child(1) { transform: translateX(-64px) rotate(-16deg); }
.hdrop:hover .file-fan span:nth-child(2), body.dragging .file-fan span:nth-child(2) { transform: translateX(64px) rotate(16deg); }
.hdrop:hover .file-fan span:nth-child(3), body.dragging .file-fan span:nth-child(3) { transform: translateY(-10px); }
.drop-local, .side-note { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--good); font-weight: 500; font-size: 13px; margin: 6px 0; }
.drop-local .ico, .side-note .ico { width: 14px; height: 14px; }
.pick-head { text-align: start; margin-bottom: 14px; }
.pick-head h2 { margin: 0 0 2px; font-size: 19px; overflow-wrap: anywhere; }
.pick-head p { font-size: 13px; color: var(--muted); }
.pick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: start; font-weight: 500; font-size: 14px; cursor: pointer; transition: border-color .15s, background .15s, transform .15s var(--ease); animation: rise .3s var(--ease) both; }
.pick:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); background: color-mix(in srgb, var(--c) 6%, var(--surface)); transform: translateY(-1px); }
.pick .tic { width: 34px; height: 34px; border-radius: 10px; }
.pick .tic .ico { width: 18px; height: 18px; }
.pick-foot { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- home: tool catalogue ---------- */
.tools { margin-top: 36px; }
.tools-head { display: flex; align-items: end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 16px; }
.tools-head h2 { margin: 0; font-size: clamp(24px, 3vw, 30px); }
.search { position: relative; flex: 0 1 380px; min-width: 240px; }
.search .ico { position: absolute; inset-inline-start: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 19px; height: 19px; }
.search input { width: 100%; height: 48px; padding: 0 16px; padding-inline-start: 44px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); outline: none; font-size: 15px; transition: border-color .15s, box-shadow .15s; }
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 16%, transparent); }
.tools .chips { margin-bottom: 8px; }
.tgroup { margin-top: 26px; }
.tgroup-h { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 650; color: var(--muted); margin: 0 0 12px; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.tcard { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 18px 18px 16px; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
a.tcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--c) 45%, var(--line)); }
.tcard h4 { margin: 12px 0 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tcard p { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tcard-go { position: absolute; top: 20px; inset-inline-end: 18px; color: var(--c); opacity: 0; transform: translateX(-6px); transition: opacity .2s, transform .2s var(--ease); }
[dir="rtl"] .tcard-go { transform: translateX(6px) scaleX(-1); }
a.tcard:hover .tcard-go { opacity: 1; transform: none; }
[dir="rtl"] a.tcard:hover .tcard-go { transform: scaleX(-1); }
.tcard.soon { opacity: .6; }
.tic { display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; color: var(--c); background: color-mix(in srgb, var(--c) 12%, transparent); }
.tic .ico { width: 23px; height: 23px; }
.tic.lg { width: 62px; height: 62px; border-radius: 18px; }
.tic.lg .ico { width: 30px; height: 30px; }
.extras { margin-top: 40px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.extras > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.soonbox { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px; }
.soonbox h2 { font-size: 14px; color: var(--muted); margin: 0 0 12px; font-weight: 650; }
.soonbox .chips .chip { cursor: default; }
.soonbox .chips span.chip { opacity: .8; }

/* ---------- home: why / business ---------- */
.sec-head { text-align: center; max-width: 680px; margin: 0 auto 28px; }
.sec-head h2 { font-size: clamp(26px, 3.4vw, 36px); margin: 0; }
.why { margin-top: 88px; }
.why-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.why-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px; transition: transform .2s var(--ease), box-shadow .2s; }
.why-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.why-item h3 { margin: 16px 0 6px; font-size: 17px; }
.why-item p { margin: 0; color: var(--muted); font-size: 14.5px; }
.why-ic { display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--brand-soft); color: var(--brand); }
.why-ic .ico { width: 23px; height: 23px; }
.biz { position: relative; overflow: hidden; margin-top: 72px; display: grid; grid-template-columns: 1.1fr .9fr; gap: 36px; align-items: center; color: #eaf6f1; background: linear-gradient(135deg, #0c4d40 0%, #0e6a55 55%, #13826a 100%); border-radius: var(--r-xl); padding: 44px; }
.biz::after { content: ''; position: absolute; width: 420px; height: 420px; inset-inline-end: -120px; top: -160px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .14), transparent); pointer-events: none; }
.biz > * { position: relative; }
.biz h2 { font-size: clamp(24px, 3vw, 32px); margin: 16px 0 10px; color: #fff; }
.biz p { color: #cfe9df; margin: 0; }
.biz .why-ic { background: rgba(255, 255, 255, .12); color: #fff; }
.biz .btn-ghost { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .25); color: #fff; margin-top: 18px; }
.biz .btn-ghost:hover { background: rgba(255, 255, 255, .18); }
.biz-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.biz-list li { display: flex; gap: 12px; align-items: flex-start; font-weight: 500; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .1); padding: 12px 14px; border-radius: 14px; }
.biz-list .ico { color: #7ee2bf; margin-top: 4px; stroke-width: 2.6; }

/* ---------- tool page ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--faint); padding-top: 20px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }
.thead { position: relative; padding: 18px 0 22px; }
.thead::before { content: ''; position: absolute; inset: -120px calc(-1 * var(--gutter)) 0; background: radial-gradient(560px 280px at 50% -20px, color-mix(in srgb, var(--c) 12%, transparent), transparent 70%); z-index: -1; pointer-events: none; }
.thead-row { display: flex; gap: 18px; align-items: center; }
.thead h1 { margin: 0; font-size: clamp(26px, 3.4vw, 36px); font-weight: 700; }
.thead p { margin: 4px 0 0; font-size: 16px; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; font-size: 14px; margin-bottom: 12px; }
[dir="ltr"] .back .ico { transform: scaleX(-1); }

.drop { position: relative; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 58px 24px 46px; box-shadow: var(--shadow); transition: transform .25s var(--ease); }
.drop::before { content: ''; position: absolute; inset: 12px; border: 2px dashed var(--line-strong); border-radius: 20px; pointer-events: none; transition: border-color .2s, background .2s; }
.drop > * { position: relative; }
.drop:hover::before { border-color: color-mix(in srgb, var(--brand) 55%, var(--line-strong)); }
body.dragging .drop { transform: scale(1.01); }
body.dragging .drop::before { border-color: var(--brand); background: var(--brand-soft); }
body.dragging .work-main { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 5%, var(--surface)); }
.drop-ic { display: inline-grid; place-items: center; width: 78px; height: 78px; border-radius: 24px; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); animation: float 4s ease-in-out infinite; }
.drop-ic .ico { width: 36px; height: 36px; }
.drop h2 { margin: 20px 0 4px; font-size: 25px; }
.drop-btns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 22px 0 16px; }
.drop-btns .btn-lg { margin: 0; min-width: 220px; }
@keyframes float { 50% { transform: translateY(-5px); } }

.work { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 18px; align-items: start; animation: rise .3s var(--ease); }
.work-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; min-height: 440px; box-shadow: var(--shadow-sm); transition: border-color .2s, background .2s; }
.work-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.count { font-weight: 600; color: var(--muted); font-size: 14px; }
.bar-actions { margin-inline-start: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.work-side { position: sticky; top: 82px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px; display: flex; flex-direction: column; max-height: calc(100vh - 100px); box-shadow: var(--shadow); }
.side-head { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.side-head h2 { font-size: 18px; margin: 0; }
.side-head .tic { width: 40px; height: 40px; border-radius: 12px; }
.side-head .tic .ico { width: 20px; height: 20px; }
.fields { overflow: auto; padding: 16px 2px; display: grid; gap: 18px; align-content: start; }
.side-foot { padding-top: 14px; border-top: 1px solid var(--line); }

/* file cards */
.items.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.fcard { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: 16px; padding: 10px; cursor: grab; user-select: none; transition: box-shadow .2s, transform .2s var(--ease); animation: rise .3s var(--ease) both; }
.fcard:hover { box-shadow: var(--shadow); }
.fcard.ghost { opacity: .4; }
.fthumb { height: 176px; display: grid; place-items: center; overflow: hidden; border-radius: 10px; }
.fthumb canvas, .fthumb img { max-width: 100%; max-height: 176px; box-shadow: 0 2px 8px rgba(0, 0, 0, .16); background: #fff; border-radius: 2px; }
.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: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow-sm); cursor: pointer; font-size: 17px; line-height: 1; color: var(--muted); transition: color .15s, transform .15s; }
.fx:hover { color: var(--bad); transform: scale(1.08); }
.fadd { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 236px; border: 2px dashed var(--line-strong); background: none; cursor: pointer; color: var(--muted); font-weight: 600; transition: border-color .15s, color .15s, background .15s; }
.fadd:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.fadd .ico { width: 30px; height: 30px; }
.skeleton { display: block; width: 110px; height: 150px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-3), var(--surface), var(--surface-3)); background-size: 200% 100%; animation: sk 1.2s infinite linear; }
@keyframes sk { to { background-position: -200% 0; } }
.doc-badge { display: grid; place-items: center; width: 64%; aspect-ratio: 3/4; margin: auto; border-radius: 8px; background: #2b579a; color: #fff; font-weight: 800; letter-spacing: .06em; font-size: .8rem; }
.doc-badge.xl { background: #1d6f42; }
.doc-badge.pp { background: #c43e1c; aspect-ratio: 4/3; width: 80%; }

/* page cards */
.items.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 14px; }
.pcard { position: relative; background: var(--surface-2); border: 2px solid transparent; border-radius: 14px; padding: 8px; user-select: none; transition: border-color .15s, background .15s; }
.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 .25s var(--ease); }
.pinner canvas { max-width: 110px; max-height: 150px; box-shadow: 0 2px 8px rgba(0, 0, 0, .16); 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-strong); font-size: 13px; font-weight: 800; color: transparent; transition: background .15s, border-color .15s; }
.pcard.sel { border-color: var(--brand); background: var(--brand-soft); }
.pcard.sel .pcheck { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.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); color: #fff; }
.items.danger .pcard.sel canvas { opacity: .35; }
.pact { display: flex; justify-content: center; gap: 4px; margin-top: 6px; }
.pact button { width: 32px; height: 30px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-size: 14px; transition: border-color .15s, color .15s; }
.pact button:hover { border-color: var(--brand); color: var(--brand); }
.pcard.ghost { opacity: .4; }
.blank-page { display: block; width: 100px; max-height: 140px; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .16); }

/* option fields */
.field { display: grid; gap: 8px; }
.flabel { font-size: 13px; font-weight: 650; color: var(--muted); }
.note { margin: 0; font-size: 13px; color: var(--muted); background: var(--surface-2); padding: 11px 13px; border-radius: 12px; line-height: 1.65; }
.input { width: 100%; padding: 10px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 14%, transparent); }
textarea.input { resize: vertical; min-height: 64px; }
.seg { display: flex; flex-wrap: wrap; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { flex: 1; min-width: 58px; border: 0; background: none; border-radius: 9px; padding: 8px 6px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; transition: background .15s, color .15s, box-shadow .15s; }
.seg button:hover { color: var(--text); }
.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: 2px; text-align: start; border: 1.5px solid var(--line); background: var(--surface); border-radius: 14px; padding: 11px 14px; cursor: pointer; transition: border-color .15s, background .15s; }
.ocard:hover { border-color: var(--line-strong); }
.ocard span { font-size: 12.5px; color: var(--muted); }
.ocard.on { border-color: var(--brand); background: var(--brand-soft); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; line-height: 1.5; }
.check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.range { display: flex; align-items: center; gap: 10px; }
.range input { flex: 1; accent-color: var(--brand); }
.range output { min-width: 54px; text-align: center; font-weight: 700; font-size: 13px; background: var(--surface-2); border-radius: 9px; padding: 4px 6px; }
.color { width: 56px; height: 38px; border: 1px solid var(--line); border-radius: 10px; 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: 14px; width: 180px; }
.posgrid button { height: 34px; border: 1.5px solid var(--line); background: var(--surface); border-radius: 8px; cursor: pointer; display: grid; place-items: center; }
.posgrid button i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.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(--brand); }
.posgrid button.on i { background: var(--brand); }
.btnrow, .row { display: flex; gap: 6px; flex-wrap: wrap; }
.row .input { flex: 1; min-width: 0; }
.filepick { display: flex; align-items: center; gap: 10px; }
.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, .pw-card p { margin: 0; }
.pw-err { color: var(--bad) !important; font-weight: 600; }

/* result */
.result { max-width: 660px; margin: 10px auto 0; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 44px 28px 32px; box-shadow: var(--shadow-lg); animation: rise .35s var(--ease); }
.result.wide { max-width: 1100px; }
.res-ic { display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 50%; background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); animation: popin .5s var(--ease) both; }
.res-ic .ico { width: 36px; height: 36px; stroke-width: 2.6; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .45s .2s var(--ease) forwards; }
@keyframes popin { from { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.08); } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
.result h2 { margin: 18px 0 4px; font-size: 27px; }
.result .res-main { margin: 22px 0 12px; 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: 11px 14px; border-radius: 12px; font-size: 14px; }
.stat .fname { margin: 0; text-align: start; }
.stat .good { color: var(--good); font-weight: 700; }
.stat .bad { color: var(--bad); 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: 14px; }
.res-list li { display: flex; align-items: center; gap: 10px; padding: 9px 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: 14px; 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: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.res-next:empty { display: none; }
.res-next p { margin: 0; font-size: 14px; }
.res-next .chips { margin-top: 10px; justify-content: center; }
.res-actions { display: flex; justify-content: center; gap: 8px; margin-top: 22px; flex-wrap: wrap; }

/* sign & annotate */
.signer { display: grid; gap: 12px; justify-items: center; }
.sg-nav { display: flex; align-items: center; gap: 12px; font-weight: 600; }
[dir="rtl"] .sg-nav .btn { transform: scaleX(-1); }
.sg-page { position: relative; width: 100%; max-width: 900px; box-shadow: 0 4px 20px rgba(0, 0, 0, .16); background: #fff; }
.sg-canvas canvas { display: block; width: 100%; height: auto; }
.sg-layer { position: absolute; inset: 0; }
.sg-layer.armed { cursor: crosshair; touch-action: none; }
.sg-item { position: absolute; border: 1.5px dashed transparent; cursor: move; touch-action: none; }
.sg-item:hover, .sg-item.active { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 6%, transparent); }
.sg-item img { width: 100%; height: 100%; display: block; pointer-events: none; }
.sg-rect { display: block; width: 100%; height: 100%; pointer-events: none; }
.sg-x, .sg-all { position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--brand); 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(--brand); 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: 12px; padding: 6px; width: 132px; height: 62px; cursor: pointer; }
.sg-sig:hover { border-color: var(--brand); }
.sg-sig img { max-width: 100%; max-height: 100%; }
.shape-tools .btn.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
/* PDF editor: editable lines, text boxes, covers for edited lines */
.ed-line { position: absolute; z-index: 1; border-radius: 3px; cursor: text; outline: 1px dashed transparent; }
.sg-layer.texting .ed-line { outline-color: color-mix(in srgb, var(--brand) 35%, transparent); }
.sg-layer.texting .ed-line:hover { outline: 2px solid var(--brand); background: color-mix(in srgb, var(--brand) 8%, transparent); }
.ed-cover { position: absolute; z-index: 1; pointer-events: none; }
.ed-tx { position: absolute; z-index: 3; }
.ed-box { display: block; margin: 0; padding: 0; white-space: pre; min-width: 4px; outline: 1px dashed color-mix(in srgb, var(--brand) 55%, transparent); outline-offset: 2px; cursor: text; caret-color: var(--brand); }
.ed-box:empty::before { content: attr(data-ph); opacity: .45; }
.ed-tx.sel .ed-box, .ed-box:focus { outline: 2px solid var(--brand); }
.ed-tx .sg-x { right: auto; inset-inline-end: -14px; top: -26px; }
.ed-mv { position: absolute; top: -26px; inset-inline-start: -2px; width: 22px; height: 22px; border-radius: 6px; background: var(--brand); color: #fff; font-size: 13px; line-height: 22px; text-align: center; cursor: move; touch-action: none; display: none; }
.ed-tx:hover .sg-x, .ed-tx:hover .ed-mv, .ed-tx.sel .sg-x, .ed-tx.sel .ed-mv { display: block; }
@media (hover: none) { .ed-mv { display: block; } }
.sg-item { z-index: 2; }
.ed-modes .btn.on, .ed-style .btn.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.ed-style .ed-font { flex: 1 1 140px; min-width: 0; }
.ed-style .ed-size { width: 72px; flex: 0 0 auto; }
.ed-safe { font-size: 13px; }
.ed-style { align-items: center; }
/* Form filling: the PDF's fields as inputs over the page */
.fm-input { position: absolute; z-index: 2; box-sizing: border-box; margin: 0; padding: 0 2px; border: 0; border-bottom: 1px solid color-mix(in srgb, #2563eb 55%, transparent); border-radius: 2px; background: rgba(37, 99, 235, .09); color: #111; font-family: Arial, 'Noto Sans Arabic', sans-serif; line-height: 1.15; }
.fm-input:focus { outline: 2px solid var(--brand); background: rgba(37, 99, 235, .05); }
textarea.fm-input { resize: none; padding-top: 2px; }
.fm-check, .fm-radio { appearance: auto; accent-color: #2563eb; border: 0; background: transparent; }
.fm-input:disabled { background: transparent; border-bottom-color: transparent; }
.ed-style input[type=range] { flex: 1; min-width: 80px; accent-color: var(--brand); }
.ed-sz { font-size: 12px; font-weight: 700; min-width: 40px; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(8, 14, 12, .55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.modal-card { width: 100%; max-width: 560px; background: var(--surface); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow-lg); display: grid; gap: 14px; animation: pop .25s var(--ease); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 9px 14px; font-weight: 650; 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-strong); border-radius: 14px; 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; color: #111; border-radius: 12px; 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: 30px; height: 30px; 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; }
@keyframes fade { from { opacity: 0; } }

/* 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(--brand); cursor: move; touch-action: none; }
.ch { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--brand); 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 */
.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: 14px; padding: 12px; background: var(--surface); }

/* busy overlay & toasts */
.busy { position: fixed; inset: 0; z-index: 50; background: rgba(8, 14, 12, .45); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
.busy-card { background: var(--surface); border-radius: var(--r-lg); padding: 30px 28px 24px; width: 100%; max-width: 390px; text-align: center; box-shadow: var(--shadow-lg); animation: pop .25s var(--ease); }
.busy-card h3 { margin: 16px 0 14px; font-size: 17px; }
.busy-card p { margin: 12px 0 0; font-size: 13px; min-height: 1.6em; word-break: break-word; }
.spinner { width: 46px; height: 46px; margin: 0 auto; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--brand); border-inline-end-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; border-radius: 99px; background: linear-gradient(90deg, var(--brand), color-mix(in srgb, var(--brand) 60%, var(--accent))); transition: width .25s var(--ease); }
.toasts { position: fixed; bottom: 20px; inset-inline: 16px; z-index: 70; display: grid; justify-items: center; gap: 8px; pointer-events: none; }
.toast { background: var(--text); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-weight: 500; font-size: 14px; box-shadow: var(--shadow-lg); max-width: 540px; transition: opacity .3s, transform .3s; animation: rise .25s var(--ease); }
.toast.error { background: var(--bad); color: #fff; }
.toast.ok { background: var(--good); color: #fff; }
.toast.out { opacity: 0; transform: translateY(8px); }

/* ---------- SEO sections (tool, size, info pages) ---------- */
.seo { margin-top: 64px; display: grid; gap: 44px; }
.seo h2 { font-size: 23px; margin: 0 0 16px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; counter-reset: s; }
.steps li { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; padding-inline-start: 62px; counter-increment: s; }
.steps li::before { content: counter(s); position: absolute; inset-inline-start: 18px; top: 16px; width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: color-mix(in srgb, var(--c, var(--brand)) 13%, transparent); color: var(--c, var(--brand)); }
.prose { max-width: 820px; color: var(--muted); }
.prose p { margin: 0 0 10px; }
.prose strong, .prose h2 { 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: 18px 20px; }
.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: 14px; padding: 14px 18px; transition: border-color .15s, box-shadow .15s; }
.faq details[open] { border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.faq summary { font-weight: 600; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.faq summary::after { content: ''; flex: none; width: 9px; height: 9px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s var(--ease); }
.faq details[open] summary::after { transform: rotate(-135deg) translate(-2px, -2px); }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin: 10px 0 2px; color: var(--muted); }
.related { display: flex; flex-wrap: wrap; gap: 8px; }
.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: 12px 16px; 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, .cmp-table tr:last-child th { border-bottom: 0; }
.cmp-table .yes { color: var(--good); font-weight: 700; }
.page-hero { position: relative; padding: 44px 0 8px; }
.page-hero::before { content: ''; position: absolute; inset: -140px calc(-1 * var(--gutter)) 0; background: var(--glow); z-index: -1; pointer-events: none; }
.page-hero h1 { font-size: clamp(28px, 4vw, 44px); margin: 0 0 12px; font-weight: 700; }
.page-hero p { color: var(--muted); font-size: 17px; max-width: 760px; margin: 0; }

/* ---------- footer ---------- */
.footer { margin-top: 24px; border-top: 1px solid var(--line); background: var(--surface); font-size: 14px; }
.footer-top { display: grid; grid-template-columns: minmax(220px, 1.2fr) 3fr; gap: 40px; padding: 48px 0 32px; }
.foot-brand .logo { margin-bottom: 12px; }
.foot-brand p { margin: 0 0 14px; color: var(--muted); max-width: 320px; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px; }
.foot-h { font-size: 13px; font-weight: 700; margin: 0 0 10px; color: var(--text); }
.foot-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; }
.foot-cols a { color: var(--muted); transition: color .15s; }
.foot-cols a:hover { color: var(--brand); }
.footer-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; padding: 18px 0 26px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.footer-langs { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.footer-langs a:hover { color: var(--brand); }
.footer-verify { max-width: 640px; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .pill-safe { display: none; }
  .mega-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 32px; padding-top: 40px; text-align: center; }
  .hero .lead { margin-inline: auto; }
  .trust { justify-content: center; }
  .work { grid-template-columns: 1fr; }
  .work-side { position: static; max-height: none; }
  .side-foot { position: sticky; bottom: 0; background: var(--surface); padding-bottom: 8px; margin-bottom: -8px; }
  .biz { grid-template-columns: 1fr; padding: 28px; }
  .footer-top { grid-template-columns: 1fr; gap: 28px; }
  /* the tools menu becomes the mobile menu */
  .nav { order: 3; }
  .nav > a { display: none; }
  .mega > summary { width: 40px; height: 40px; padding: 0; justify-content: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); }
  .mega .mega-lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .mega .i-chev { display: none; }
  .mega .i-burger { display: block; width: 20px; height: 20px; }
  .mega[open] .i-burger { display: none; }
  .mega[open] .i-close { display: block; width: 20px; height: 20px; }
  .mega-panel { position: fixed; top: 66px; inset-inline: 0; max-height: calc(100dvh - 66px); overflow: auto; border-radius: 0 0 var(--r-lg) var(--r-lg); border-inline: 0; padding: 18px 20px 24px; }
  .mega-cols { grid-template-columns: 1fr 1fr; gap: 18px 12px; }
  .mega-extra { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .wrap { --gutter: 16px; }
  body { font-size: 15px; }
  .logo { font-size: 19px; margin-inline-end: 4px; }
  .logo .logo-mark { width: 30px; height: 30px; }
  .langmenu summary span { display: none; }
  .langmenu summary { width: 40px; padding: 0; justify-content: center; }
  .hero { padding-top: 28px; gap: 24px; }
  .hero h1 { margin-top: 16px; }
  .lead { font-size: 16px; }
  .trust { gap: 8px 14px; }
  .trust li { font-size: 13.5px; }
  .hdrop { padding: 28px 18px 22px; }
  .pick { gap: 8px; padding: 8px; font-size: 13px; }
  .pick .tic { width: 30px; height: 30px; border-radius: 9px; }
  .tools-head { align-items: stretch; }
  .search { flex: 1 1 100%; }
  .tools .chips { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 6px; scrollbar-width: none; }
  .tools .chips::-webkit-scrollbar { display: none; }
  .tools .chips .chip { flex: none; }
  .tgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .tcard { padding: 14px; border-radius: 16px; }
  .tcard p, .tcard-go { display: none; }
  .tcard h4 { font-size: 14.5px; margin-top: 10px; }
  .tic { width: 40px; height: 40px; border-radius: 12px; }
  .tic .ico { width: 21px; height: 21px; }
  .extras { grid-template-columns: 1fr; }
  .why { margin-top: 64px; }
  .thead-row { gap: 14px; }
  .tic.lg { width: 52px; height: 52px; border-radius: 15px; }
  .tic.lg .ico { width: 26px; height: 26px; }
  .thead p { font-size: 15px; }
  .drop { padding: 40px 16px 32px; }
  .drop-btns .btn-lg { min-width: 0; width: 100%; }
  .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: 12px; min-height: 0; }
  .stat { grid-template-columns: 1fr; gap: 2px; }
  .result { padding: 34px 18px 24px; }
  .seo { margin-top: 48px; gap: 36px; }
  .foot-cols { grid-template-columns: 1fr 1fr; }
}

/* phones: no drag-and-drop or Ctrl+V, so drop the hint about them */
@media (hover: none) and (pointer: coarse) { .drop > p.small { display: none; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .res-ic .ico { stroke-dashoffset: 0; }
}

/* file pickers: the real <input> stays focusable (visually hidden), so the button shows its focus ring */
.btn, .fadd { position: relative; }
label:has(> input.sr-only:focus-visible) { outline: 2.5px solid var(--brand); outline-offset: 2px; }
