/* ---------- Fonts (self-hosted IBM Plex Sans Arabic) ---------- */
@font-face { font-family: "Plex Arabic"; font-style: normal; font-display: swap; font-weight: 400; src: url("../vendor/fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-display: swap; font-weight: 500; src: url("../vendor/fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-display: swap; font-weight: 600; src: url("../vendor/fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-display: swap; font-weight: 700; src: url("../vendor/fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-display: swap; font-weight: 400; src: url("../vendor/fonts/ibm-plex-sans-arabic-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-display: swap; font-weight: 500; src: url("../vendor/fonts/ibm-plex-sans-arabic-latin-500-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-display: swap; font-weight: 600; src: url("../vendor/fonts/ibm-plex-sans-arabic-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plex Arabic"; font-style: normal; font-display: swap; font-weight: 700; src: url("../vendor/fonts/ibm-plex-sans-arabic-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

@font-face { font-family: "Lalezar"; font-style: normal; font-display: swap; font-weight: 400; src: url("../vendor/fonts/lalezar-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "Lalezar"; font-style: normal; font-display: swap; font-weight: 400; src: url("../vendor/fonts/lalezar-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --ground: #f3f4fa;
  --ground-2: #e9ebf6;
  --panel: #ffffff;
  --line: #e2e4f0;
  --line-strong: #c6c9de;
  --ink: #0c0f2e;
  --ink-2: #3f4366;
  --ink-3: #5a5e80;
  --cobalt: #2b35f0;
  --cobalt-hover: #1f28d6;
  --cobalt-press: #1820b0;
  --cobalt-deep: #1d24b8;
  --cobalt-soft: #e7e8ff;
  --lemon: #ffd84a;
  --ok: #08744f;
  --ok-soft: #dcf5ea;
  --warn: #8a5a00;
  --err: #c0261a;
  --err-soft: #ffe8e5;
  /* category: fill, soft tint, readable ink */
  --c-image: #ff5b4a; --c-image-soft: #ffe7e3; --c-image-ink: #b52214;
  --c-video: #7a4dff; --c-video-soft: #eee8ff; --c-video-ink: #5428db;
  --c-audio: #ffcc2e; --c-audio-soft: #fff4cc; --c-audio-ink: #7a5600;
  --c-doc:   #1f9bff; --c-doc-soft:   #e0f1ff; --c-doc-ink:   #0761b3;
  --c-data:  #13c28a; --c-data-soft:  #dcf7ec; --c-data-ink:  #067352;
  --shadow-1: 0 1px 2px rgba(12, 15, 46, .06);
  --shadow-2: 0 18px 40px -18px rgba(12, 15, 46, .28), 0 4px 10px -4px rgba(12, 15, 46, .08);
  --shadow-3: 0 30px 70px -30px rgba(12, 15, 46, .45);
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 22px;
  --font: "Plex Arabic", "Segoe UI", Tahoma, system-ui, sans-serif;
  --display: "Lalezar", "Plex Arabic", "Segoe UI", sans-serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-in: cubic-bezier(.55, 0, .75, .3);
  --mark-ink: #2b35f0;
  --hero: #2b35f0;
  --gate-core: #1d24b8;
  --solid: #0c0f2e;        /* dark chips: download button, toasts, footer */
  --solid-hover: #22265a;
  --on-solid: #ffffff;
  --glass: rgba(255, 255, 255, .92);
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c0f2e' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* Dark theme: deep navy ground, the same flat category colours, no glow. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --ground: #0b0d24;
  --ground-2: #1a1e44;
  --panel: #13163a;
  --line: #262a55;
  --line-strong: #3a3f75;
  --ink: #eef0ff;
  --ink-2: #c0c4e6;
  --ink-3: #9a9ec8;
  --cobalt: #3d47ff;
  --cobalt-hover: #5560ff;
  --cobalt-press: #2b35f0;
  --cobalt-soft: #1e2263;
  --ok: #4fd8a0;
  --ok-soft: #10322a;
  --warn: #f2b84b;
  --err: #ff8f84;
  --err-soft: #3d1a24;
  --c-image-soft: #3a1a22; --c-image-ink: #ff9a8f;
  --c-video-soft: #251c52; --c-video-ink: #b9a2ff;
  --c-audio-soft: #352b0c; --c-audio-ink: #ffd96a;
  --c-doc-soft:   #0f2a46; --c-doc-ink:   #8cc8ff;
  --c-data-soft:  #0e3127; --c-data-ink:  #6fe0b6;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-2: 0 18px 40px -18px rgba(0, 0, 0, .7), 0 4px 10px -4px rgba(0, 0, 0, .35);
  --shadow-3: 0 30px 70px -30px rgba(0, 0, 0, .8);
  --hero: #1b1f8f;
  --gate-core: #12156a;
  --solid: #eef0ff;
  --solid-hover: #ffffff;
  --on-solid: #0b0d24;
  --glass: rgba(19, 22, 58, .9);
  --mark-ink: #1b1f8f;
  --select-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23eef0ff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
:root[data-theme="dark"] .footer { background: #06071a; color: rgba(255, 255, 255, .7); }
:root[data-theme="dark"] .footer strong { color: #fff; }
:root[data-theme="dark"] .toast { background: #eef0ff; color: #0b0d24; }
:root[data-theme="dark"] .hero::before { opacity: .14; }
:root[data-theme="dark"] .drop__overlay { background: rgba(61, 71, 255, .92); }

/* Theme and language changes cross-fade (view transitions) */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .45s; animation-timing-function: cubic-bezier(.16, 1, .3, 1); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 84px; scrollbar-color: var(--line-strong) transparent; }
body {
  margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.65;
  color: var(--ink); background: var(--ground);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--lemon); color: var(--ink); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 2px; border-radius: 8px; }
a { color: var(--cobalt); text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; text-wrap: balance; font-weight: 400; }
p { margin: 0; }
kbd {
  font-family: var(--font); font-size: .8em; padding: 1px 7px; border-radius: 6px;
  border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--panel); color: var(--ink-2);
}
.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { top: 12px; }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 99px; border: 3px solid var(--ground); }

/* ---------- Top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto; z-index: 30; color: #fff;
  transition: background .35s var(--ease), color .35s var(--ease), box-shadow .35s var(--ease);
}
.topbar.is-solid { background: var(--glass); color: var(--ink); box-shadow: 0 1px 0 var(--line); backdrop-filter: saturate(1.6) blur(12px); --mark-ink: #fff; }
.topbar__inner { max-width: 1200px; margin: 0 auto; padding: 0 28px; height: 68px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand__mark { width: 34px; height: 34px; color: #fff; transition: color .35s var(--ease); }
.topbar.is-solid .brand__mark { color: var(--cobalt); }
.brand__name { font-family: var(--display); font-size: 1.75rem; line-height: 1; padding-top: 4px; }
.topnav { display: flex; gap: 2px; }
.topnav a { color: inherit; opacity: .86; text-decoration: none; font-weight: 500; font-size: .95rem; padding: 6px 12px; border-radius: 99px; transition: background .2s, opacity .2s; }
.topnav a:hover { opacity: 1; background: rgba(255, 255, 255, .14); }
.topbar.is-solid .topnav a:hover { background: var(--ground-2); }
.privacy-pill {
  margin-inline-start: auto; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
  font-size: .86rem; font-weight: 600; padding: 6px 14px; border-radius: 99px;
  background: rgba(255, 255, 255, .14); color: #fff; transition: background .35s, color .35s;
}
.topbar.is-solid .privacy-pill { background: var(--ok-soft); color: var(--ok); }
.privacy-pill .i { width: 16px; height: 16px; }

.top-actions { display: flex; align-items: center; gap: 6px; }
.top-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 12px;
  border: 0; border-radius: 99px; cursor: pointer; font: 600 .86rem/1 var(--font); color: inherit;
  background: rgba(255, 255, 255, .14); transition: background .25s var(--ease), transform .25s var(--ease);
}
.top-btn:hover { background: rgba(255, 255, 255, .24); }
.top-btn:active { transform: scale(.94); }
.topbar.is-solid .top-btn { background: var(--ground-2); }
.topbar.is-solid .top-btn:hover { background: var(--line-strong); }
.top-btn--icon { width: 36px; padding: 0; position: relative; overflow: hidden; }
.top-btn--icon .i { position: absolute; transition: transform .5s var(--ease), opacity .3s var(--ease); }
.theme-moon { transform: translateY(0) rotate(0); }
.theme-sun { transform: translateY(140%) rotate(90deg); opacity: 0; }
:root[data-theme="dark"] .theme-moon { transform: translateY(-140%) rotate(-90deg); opacity: 0; }
:root[data-theme="dark"] .theme-sun { transform: none; opacity: 1; }
.top-btn--lang .i { width: 16px; height: 16px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  background: var(--hero); color: #fff;
  padding: 132px 0 150px;
}
.hero::before { /* dot field */
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .22;
  background-image: radial-gradient(rgba(255, 255, 255, .55) 1.2px, transparent 1.6px);
  background-size: 26px 26px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 92%);
}
.hero__inner { max-width: 1200px; margin: 0 auto; padding: 0 28px; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; gap: 40px; }
.hero h1 { font-family: var(--display); font-size: clamp(3rem, 6.2vw, 5.6rem); line-height: 1.12; letter-spacing: 0; }
.hero__line { display: block; }
.roll {
  position: relative; display: inline-grid; vertical-align: bottom; overflow: hidden;
  padding: 0 .22em; margin: 0 .04em -.04em; height: 1.22em; border-radius: .22em;
  background: var(--roll-c, var(--lemon));
  transition: background-color .5s var(--ease), width .5s var(--ease);
}
.roll__word { grid-area: 1 / 1; display: block; color: var(--roll-on, var(--ink)); white-space: nowrap; line-height: 1.28; text-align: center; }
.hero__lead { margin-top: 22px; max-width: 46ch; font-size: 1.15rem; color: rgba(255, 255, 255, .88); }

/* ---------- Conversion machine (signature) ---------- */
.machine { position: relative; height: 360px; --card-w: 128px; --card-h: 164px; }
.machine__rail {
  position: absolute; inset-inline: 0; top: 50%; height: 2px; translate: 0 -1px;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .45) 0 8px, transparent 8px 18px);
  animation: rail 1.4s linear infinite;
  mask-image: linear-gradient(90deg, transparent, #000 15%, #000 85%, transparent);
}
@keyframes rail { to { background-position: -36px 0; } }
.machine__gate { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; translate: -50% -50%; overflow: visible; }
.machine__gate circle { fill: none; }
.g-halo { fill: rgba(255, 255, 255, .06) !important; }
.g-dash { stroke: rgba(255, 255, 255, .55); stroke-width: 2; stroke-dasharray: 3 11; stroke-linecap: round; transform-origin: 110px 110px; animation: spin 18s linear infinite; }
.g-ring { stroke: #fff; stroke-width: 3; stroke-dasharray: 120 345; stroke-linecap: round; transform-origin: 110px 110px; animation: spin 3.2s var(--ease) infinite; }
.g-core { fill: var(--gate-core) !important; stroke: rgba(255, 255, 255, .25); stroke-width: 1.5; }
.g-arrows path { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.machine__gate .g-pulse { transform-origin: 110px 110px; }
.machine__burst { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.machine__burst i { position: absolute; width: 10px; height: 10px; margin: -5px; border-radius: 3px; background: var(--lemon); opacity: 0; }
.fcard {
  position: absolute; left: 50%; top: 50%; width: var(--card-w); height: var(--card-h);
  margin: calc(var(--card-h) / -2) 0 0 calc(var(--card-w) / -2);
  border-radius: 14px; padding: 18px 16px;
  display: flex; flex-direction: column; justify-content: flex-end; direction: ltr;
  clip-path: polygon(0 0, 70% 0, 100% 22%, 100% 100%, 0 100%);
  opacity: 0; will-change: transform, opacity;
}
.fcard::before { /* folded corner */
  content: ""; position: absolute; top: 0; right: 0; width: 30%; height: 22%;
  background: rgba(12, 15, 46, .18); border-bottom-left-radius: 10px;
}
.fcard__lines { position: absolute; top: 30px; left: 16px; right: 40%; height: 46px;
  background: repeating-linear-gradient(180deg, currentColor 0 5px, transparent 5px 13px); opacity: .28; border-radius: 3px; }
.fcard__ext { font-family: var(--display); font-size: 2.3rem; line-height: 1; letter-spacing: .01em; }
.fcard--in { background: #fff; color: var(--cat-ink); box-shadow: var(--shadow-3); }
.fcard--out { background: var(--cat); color: var(--cat-on, #fff); box-shadow: var(--shadow-3); }
[data-cat="image"] { --cat: var(--c-image); --cat-ink: var(--c-image-ink); --cat-on: #fff; }
[data-cat="video"] { --cat: var(--c-video); --cat-ink: var(--c-video-ink); --cat-on: #fff; }
[data-cat="audio"] { --cat: var(--c-audio); --cat-ink: var(--c-audio-ink); --cat-on: var(--ink); }
[data-cat="doc"]   { --cat: var(--c-doc);   --cat-ink: var(--c-doc-ink);   --cat-on: #fff; }
[data-cat="data"]  { --cat: var(--c-data);  --cat-ink: var(--c-data-ink);  --cat-on: var(--ink); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Buttons & controls ---------- */
.btn {
  --h: 42px;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--h); padding: 0 18px; border-radius: 99px;
  font: 600 .95rem/1 var(--font); white-space: nowrap;
  border: 1.5px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .18s, border-color .18s, color .18s, box-shadow .25s var(--ease), transform .25s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.96); transition-duration: .08s; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--lg { --h: 54px; padding: 0 28px; font-size: 1.05rem; }
.btn--sm { --h: 36px; padding: 0 14px; font-size: .9rem; }
.btn--primary { background: var(--cobalt); color: #fff; box-shadow: 0 8px 18px -8px rgba(43, 53, 240, .7); }
.btn--primary:hover:not(:disabled) { background: var(--cobalt-hover); box-shadow: 0 12px 24px -10px rgba(43, 53, 240, .8); transform: translateY(-1px); }
.btn--primary:active:not(:disabled) { background: var(--cobalt-press); }
.btn--ghost { background: var(--panel); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover:not(:disabled) { border-color: var(--ink); }
.btn--danger-ghost { background: transparent; color: var(--err); }
.btn--danger-ghost:hover:not(:disabled) { background: var(--err-soft); }
.btn--ok { background: var(--solid); color: var(--on-solid); }
.btn--ok:hover { background: var(--solid-hover); transform: translateY(-1px); }
.btn .i { transition: transform .35s var(--ease); }
.btn:hover .i { transform: translateY(-1px); }
.btn[data-action="convert"]:hover .i, #convert-all:hover .i { transform: rotate(-90deg); }

.icon-btn {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 99px;
  border: 0; background: transparent; color: var(--ink-3); cursor: pointer;
  transition: background .18s, color .18s, transform .25s var(--ease);
}
.icon-btn:hover:not(:disabled) { background: var(--ground-2); color: var(--ink); }
.icon-btn:disabled { opacity: .4; cursor: not-allowed; }
.icon-btn[aria-expanded="true"] { background: var(--solid); color: var(--on-solid); }
.icon-btn--danger:hover { background: var(--err-soft); color: var(--err); transform: rotate(90deg); }

.select, .input {
  height: 40px; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--panel);
  color: var(--ink); font: 500 .93rem var(--font); padding: 0 12px;
  transition: border-color .18s, box-shadow .25s var(--ease);
}
.select {
  appearance: none; padding-inline-end: 36px; cursor: pointer;
  background-image: var(--select-arrow);
  background-repeat: no-repeat; background-size: 16px; background-position: left 12px center;
}
.select--sm { height: 38px; }
.select:hover:not(:disabled), .input:hover { border-color: var(--ink-3); }
.select:focus-visible, .input:focus-visible { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 4px rgba(43, 53, 240, .18); }
.select:disabled { opacity: .55; cursor: not-allowed; }
.input { width: 100%; }
.input[type="number"] { direction: ltr; text-align: right; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; accent-color: var(--cobalt); }
input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--cobalt); margin: 0; }
input[type="color"].input { padding: 4px; cursor: pointer; }

/* ---------- Work area ---------- */
main { max-width: 1200px; margin: 0 auto; padding: 0 28px; }
.work { position: relative; z-index: 2; margin-top: -96px; padding-bottom: 72px; }
.drop {
  position: relative; border-radius: 28px; background: var(--panel);
  box-shadow: var(--shadow-2); cursor: pointer;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}
.drop__ants { position: absolute; inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); pointer-events: none; overflow: visible; }
.drop__ants rect {
  width: calc(100% - 3px); height: calc(100% - 3px); fill: none;
  stroke: var(--line-strong); stroke-width: 2; stroke-dasharray: 9 9; stroke-linecap: round;
  transition: stroke .25s;
}
.drop:hover .drop__ants rect { stroke: var(--cobalt); animation: ants 1s linear infinite; }
.drop.is-over { transform: scale(1.012); box-shadow: 0 30px 70px -24px rgba(43, 53, 240, .55); }
.drop.is-over .drop__ants rect { stroke: var(--cobalt); stroke-width: 3; animation: ants .45s linear infinite; }
@keyframes ants { to { stroke-dashoffset: -18; } }
.drop__body { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 52px 28px 48px; gap: 6px; }
.drop__icon {
  display: grid; place-items: center; width: 68px; height: 68px; border-radius: 22px;
  background: var(--cobalt); color: #fff; margin-bottom: 12px;
  box-shadow: 0 14px 26px -12px rgba(43, 53, 240, .8);
  transition: transform .5s var(--ease), border-radius .5s var(--ease);
}
.drop__icon .i { width: 30px; height: 30px; stroke-width: 2.2; transition: transform .5s var(--ease); }
.drop:hover .drop__icon { transform: translateY(-4px) rotate(-6deg); border-radius: 26px; }
.drop:hover .drop__icon .i, .drop.is-over .drop__icon .i { transform: translateY(-3px); }
.drop.is-over .drop__icon { transform: translateY(-8px) scale(1.08); animation: bob .7s var(--ease) infinite alternate; }
@keyframes bob { to { transform: translateY(-14px) scale(1.08); } }
.drop__title { font-family: var(--display); font-size: 2rem; line-height: 1.3; }
.drop__hint { color: var(--ink-3); font-size: .98rem; margin-bottom: 20px; }
.drop__overlay {
  position: absolute; inset: 0; display: grid; place-items: center; border-radius: inherit;
  font-family: var(--display); font-size: 2.2rem; color: #fff; background: rgba(43, 53, 240, .92);
  opacity: 0; pointer-events: none; transition: opacity .25s var(--ease);
}
.drop.is-over .drop__overlay { opacity: 1; }
.drop.is-compact .drop__body { flex-direction: row; justify-content: center; flex-wrap: wrap; padding: 20px 24px; gap: 8px 18px; }
.drop.is-compact .drop__icon { width: 48px; height: 48px; border-radius: 16px; margin: 0; }
.drop.is-compact .drop__icon .i { width: 22px; height: 22px; }
.drop.is-compact .drop__title { font-size: 1.45rem; }
.drop.is-compact .drop__hint { margin: 0; }
.drop.is-compact .btn--lg { --h: 44px; font-size: .95rem; padding: 0 20px; }

/* ---------- Queue ---------- */
.queue { margin-top: 22px; background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.queue__bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  position: sticky; top: 68px; z-index: 5; background: var(--glass); backdrop-filter: blur(10px);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.queue__count { font-family: var(--display); font-size: 1.4rem; line-height: 1.2; padding-inline-start: 4px; display: flex; align-items: baseline; gap: 10px; }
.queue__count small { font-family: var(--font); font-size: .88rem; color: var(--ink-3); font-weight: 500; }
.queue__bulk { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.queue__sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.bulk-target { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); font-weight: 500; }

.jobs { list-style: none; margin: 0; padding: 6px 0; }
.job { position: relative; }
.job + .job::before { content: ""; position: absolute; top: 0; inset-inline: 18px; height: 1px; background: var(--line); }
.job__row { display: grid; align-items: center; gap: 16px; grid-template-columns: 56px minmax(0, 1fr) auto auto 36px; padding: 14px 18px; }
.badge {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px;
  font: 400 1rem/1 var(--display); letter-spacing: .02em; direction: ltr;
  color: var(--cat-ink); background: var(--cat-soft); position: relative; overflow: hidden;
  transition: background .4s var(--ease), color .4s var(--ease), border-radius .4s var(--ease);
}
.badge img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: fade-in .4s var(--ease); }
.badge__done {
  position: absolute; inset: 0; display: grid; place-items: center; background: var(--cat); color: var(--cat-on);
  clip-path: circle(0% at 50% 50%); transition: clip-path .55s var(--ease);
}
.badge__done svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.badge__done path { stroke-dasharray: 24; stroke-dashoffset: 24; transition: stroke-dashoffset .45s .25s var(--ease); }
.job.is-done .badge__done { clip-path: circle(75% at 50% 50%); }
.job.is-done .badge__done path { stroke-dashoffset: 0; }
.job.is-working .badge { border-radius: 50%; }
.job.is-working .badge::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  border: 3px solid transparent; border-top-color: var(--cat); border-right-color: var(--cat);
  animation: spin .9s linear infinite;
}
@keyframes fade-in { from { opacity: 0; } }
.cat-image { --cat: var(--c-image); --cat-soft: var(--c-image-soft); --cat-ink: var(--c-image-ink); --cat-on: #fff; }
.cat-video { --cat: var(--c-video); --cat-soft: var(--c-video-soft); --cat-ink: var(--c-video-ink); --cat-on: #fff; }
.cat-audio { --cat: var(--c-audio); --cat-soft: var(--c-audio-soft); --cat-ink: var(--c-audio-ink); --cat-on: var(--ink); }
.cat-doc   { --cat: var(--c-doc);   --cat-soft: var(--c-doc-soft);   --cat-ink: var(--c-doc-ink);   --cat-on: #fff; }
.cat-data  { --cat: var(--c-data);  --cat-soft: var(--c-data-soft);  --cat-ink: var(--c-data-ink);  --cat-on: var(--ink); }
.cat-none  { --cat: var(--ink-3);   --cat-soft: var(--ground-2);     --cat-ink: var(--ink-3);       --cat-on: #fff; }

.job__info { min-width: 0; }
.job__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; text-align: right; }
.job__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .87rem; color: var(--ink-3); margin-top: 2px; min-height: 1.4em; }
.job__meta .ok { color: var(--ok); font-weight: 600; animation: slide-in .5s var(--ease); }
.job__meta .err { color: var(--err); font-weight: 500; }
.job__meta .delta-down { color: var(--ok); animation: slide-in .5s .1s var(--ease) backwards; }
.job__meta .delta-up { color: var(--warn); animation: slide-in .5s .1s var(--ease) backwards; }
@keyframes slide-in { from { opacity: 0; transform: translateX(10px); } }
.job__progress { height: 6px; background: var(--ground-2); border-radius: 99px; overflow: hidden; margin-top: 9px; max-width: 440px; }
.job__progress > span {
  display: block; height: 100%; width: 0; border-radius: inherit;
  background: var(--cat) repeating-linear-gradient(-45deg, rgba(255,255,255,.28) 0 8px, transparent 8px 16px);
  background-size: 22.6px 100%; animation: stripes .6s linear infinite;
  transition: width .35s var(--ease);
}
@keyframes stripes { to { background-position: -22.6px 0; } }
.job__progress.is-indeterminate > span { width: 34%; animation: indet 1.3s var(--ease) infinite, stripes .6s linear infinite; }
@keyframes indet { from { transform: translateX(120%); } to { transform: translateX(-300%); } }

.job__target { display: flex; align-items: center; gap: 8px; color: var(--ink-3); }
.job__target > .i { width: 16px; height: 16px; }
.job.is-working .job__target > .i { color: var(--cat-ink); animation: nudge .8s var(--ease) infinite alternate; }
@keyframes nudge { to { transform: translateX(-5px); } }
.job__target .select { min-width: 132px; font-weight: 600; }
.job__actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; min-width: 132px; }
.job__actions > * { animation: pop-in .35s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: scale(.85); } }
.spin { animation: spin .9s linear infinite; }

.job__opts { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.job__opts > div { overflow: hidden; }
.job.is-open .job__opts:not(.job__pv), .job.is-pv .job__pv { grid-template-rows: 1fr; }
.opts {
  margin: 0 18px 18px; margin-inline-start: 90px; padding: 18px; border-radius: var(--r-md);
  background: var(--ground); display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px 18px;
  opacity: 0; transform: translateY(-8px); transition: opacity .3s var(--ease), transform .35s var(--ease);
}
.job.is-open .opts { opacity: 1; transform: none; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.field > span { color: var(--ink-2); font-weight: 500; display: flex; justify-content: space-between; gap: 8px; }
.field > span output { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.field--check { flex-direction: row; align-items: center; gap: 10px; align-self: end; min-height: 40px; cursor: pointer; }
.field--check > span { color: var(--ink); }
.opts__note { grid-column: 1 / -1; font-size: .85rem; color: var(--ink-3); }
.opts .select, .opts .input { width: 100%; }
.unsupported { padding: 0 18px 14px; margin-inline-start: 90px; color: var(--ink-3); font-size: .9rem; }

/* ---------- Sections ---------- */
.section-head { margin-bottom: 26px; }
.section-head h2 { font-family: var(--display); font-size: clamp(2.2rem, 4vw, 3.2rem); line-height: 1.2; }
.section-head p { color: var(--ink-2); margin-top: 8px; max-width: 64ch; font-size: 1.05rem; }
.formats { padding: 72px 0 72px; }

.format-table { display: grid; gap: 12px; }
.ft-head { display: none !important; }
.ft-row {
  display: grid; grid-template-columns: 220px 1fr 1fr; align-items: stretch;
  background: var(--panel); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-1);
  transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.ft-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.ft-row > div { padding: 20px 22px; }
.ft-row > div[data-label]::before { content: attr(data-label); display: block; font-size: .8rem; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.ft-cat {
  display: flex; align-items: center; gap: 12px; background: var(--cat); color: var(--cat-on);
  font-family: var(--display); font-size: 1.7rem; line-height: 1;
}
.ft-cat .ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, .22); transition: transform .5s var(--ease); }
.ft-row:hover .ft-cat .ic { transform: rotate(-10deg) scale(1.08); }
.ft-cat .i { width: 22px; height: 22px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; direction: ltr; justify-content: flex-end; }
.chip {
  font: 600 .78rem/1 var(--font); letter-spacing: .03em; padding: 7px 10px; min-width: 50px; text-align: center;
  border-radius: 99px; background: var(--ground-2); color: var(--ink-2);
  transition: background .3s var(--ease), color .3s var(--ease), transform .3s var(--ease);
}
.chip--out { background: var(--cat-soft); color: var(--cat-ink); }
.ft-row:hover .chip--out { background: var(--cat); color: var(--cat-on); }
.ft-row:hover .chip--out:nth-child(2n) { transform: translateY(-2px); }

.how { padding: 24px 0 88px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; counter-reset: s; }
.steps li {
  position: relative; padding: 26px 24px 24px; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-1);
  display: flex; flex-direction: column; gap: 6px; counter-increment: s; overflow: hidden;
}
.steps li::before {
  content: counter(s, arabic-indic); font-family: var(--display); font-size: 2.4rem; line-height: 1;
  display: grid; place-items: center; width: 64px; height: 64px; border-radius: 20px; margin-bottom: 10px;
  background: var(--step-c); color: var(--step-on, #fff);
}
.steps li:nth-child(1) { --step-c: var(--c-image); }
.steps li:nth-child(2) { --step-c: var(--c-audio); --step-on: var(--ink); }
.steps li:nth-child(3) { --step-c: var(--c-data); --step-on: var(--ink); }
.steps strong { font-family: var(--display); font-weight: 400; font-size: 1.5rem; line-height: 1.3; }
.steps span { color: var(--ink-2); }

.faq { padding-bottom: 96px; }
.faq__list { max-width: 860px; display: grid; gap: 10px; }
.faq details { background: var(--panel); border-radius: var(--r-md); box-shadow: var(--shadow-1); transition: box-shadow .3s var(--ease); }
.faq details[open] { box-shadow: var(--shadow-2); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 22px; font-weight: 600; font-size: 1.04rem;
  display: flex; justify-content: space-between; gap: 16px; align-items: center;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 99px;
  background: var(--ground-2); font: 600 1.2rem/1 var(--font); color: var(--ink); transition: transform .4s var(--ease), background .3s;
}
.faq details[open] summary::after { transform: rotate(135deg); background: var(--lemon); }
.faq details p { padding: 0 22px 20px; color: var(--ink-2); max-width: 70ch; }
.faq details[open] p { animation: slide-down .4s var(--ease); }
@keyframes slide-down { from { opacity: 0; transform: translateY(-6px); } }

.footer { background: #0c0f2e; color: rgba(255, 255, 255, .78); text-align: center; padding: 34px 24px; font-size: .9rem; }
.footer strong { font-family: var(--display); font-weight: 400; font-size: 1.5rem; color: #fff; display: block; margin-bottom: 4px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 60; width: min(460px, calc(100vw - 32px)); }
.toast {
  display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-radius: 16px;
  background: #0c0f2e; color: #fff; box-shadow: var(--shadow-3); font-size: .93rem;
  animation: toast-in .45s var(--ease);
}
.toast.is-leaving { animation: toast-out .25s var(--ease-in) forwards; }
.toast .i { margin-top: 2px; color: var(--c-data); }
.toast--err .i { color: #ff8f84; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(.97); } }

/* =========================================================
   Tool hub: layout, sidebar, tool pages, shared components
   ========================================================= */
.hub {
  position: relative; z-index: 2; max-width: 1280px; margin: -96px auto 0; padding: 0 28px;
  display: grid; grid-template-columns: 252px minmax(0, 1fr); gap: 24px; align-items: start;
}
.hub__main, .sidebar { min-width: 0; }
.hub main { max-width: none; margin: 0; padding: 0; }
.hub .work { margin-top: 0; }
.hero[data-mode="tool"] { padding: 118px 0 140px; }
.hero[data-mode="tool"] .hero__copy, .hero[data-mode="tool"] .machine { display: none; }
.hero[data-mode="home"] .hero__tool { display: none; }
.hero__tool { grid-column: 1 / -1; max-width: 860px; }
.hero-tool__crumb { display: inline-flex; align-items: center; gap: 6px; color: rgba(255, 255, 255, .8); text-decoration: none; font-weight: 600; font-size: .9rem; margin-bottom: 14px; padding: 4px 12px 4px 10px; border-radius: 99px; background: rgba(255, 255, 255, .12); transition: background .2s; }
.hero-tool__crumb:hover { background: rgba(255, 255, 255, .22); color: #fff; }
.hero-tool__crumb .i { width: 15px; height: 15px; }
.hero-tool__row { display: flex; align-items: center; gap: 20px; }
.hero-tool__ic { flex: none; display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; background: var(--cat); color: var(--cat-on); box-shadow: 0 16px 30px -14px rgba(0, 0, 0, .45); }
.hero-tool__ic .i { width: 36px; height: 36px; stroke-width: 2; }
.hero__tool h1 { font-family: var(--display); font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.15; }
.hero__tool p { margin-top: 6px; color: rgba(255, 255, 255, .86); font-size: 1.08rem; max-width: 60ch; }

/* Sidebar */
.sidebar { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; overscroll-behavior: contain; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-2); scrollbar-width: thin; }
.side { display: flex; flex-direction: column; gap: 2px; padding: 12px; }
.side__group { margin: 14px 10px 6px; font-size: .74rem; font-weight: 700; letter-spacing: .04em; color: var(--ink-3); text-transform: uppercase; }
.side__link {
  position: relative; display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 12px;
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: .93rem; line-height: 1.3;
  transition: background .2s, color .2s;
}
.side__link:hover { background: var(--ground); }
.side__link.is-active { background: var(--cat-soft); color: var(--cat-ink); font-weight: 600; }
.side__link.is-active::before { content: ""; position: absolute; inset-inline-start: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--cat); }
[dir="rtl"] .side__link.is-active::before { border-radius: 4px 0 0 4px; }
.side__ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--cat-soft); color: var(--cat-ink); transition: transform .35s var(--ease), background .2s; }
.side__link:hover .side__ic { transform: rotate(-8deg) scale(1.06); }
.side__link.is-active .side__ic { background: var(--cat); color: var(--cat-on); }
.side__ic .i { width: 17px; height: 17px; }
.side__txt { display: flex; flex-direction: column; min-width: 0; }
.side__txt small { font-size: .76rem; color: var(--ink-3); font-weight: 500; }
.side__link[data-cat], .tcard[data-cat], .hero-tool__ic[data-cat] { --cat-soft: var(--ground-2); }
[data-cat="image"].side__link, [data-cat="image"].tcard { --cat-soft: var(--c-image-soft); --cat-ink: var(--c-image-ink); }
[data-cat="video"].side__link, [data-cat="video"].tcard { --cat-soft: var(--c-video-soft); --cat-ink: var(--c-video-ink); }
[data-cat="audio"].side__link, [data-cat="audio"].tcard { --cat-soft: var(--c-audio-soft); --cat-ink: var(--c-audio-ink); }
[data-cat="doc"].side__link, [data-cat="doc"].tcard { --cat-soft: var(--c-doc-soft); --cat-ink: var(--c-doc-ink); }
[data-cat="data"].side__link, [data-cat="data"].tcard { --cat-soft: var(--c-data-soft); --cat-ink: var(--c-data-ink); }
.topnav a.is-active { opacity: 1; background: rgba(255, 255, 255, .18); }
.topbar.is-solid .topnav a.is-active { background: var(--cobalt-soft); color: var(--cobalt); }
:root[data-theme="dark"] .topbar.is-solid .topnav a.is-active { color: #c9cdff; }

/* Tools index */
.tool-view { padding-bottom: 80px; }
.tindex { margin-bottom: 30px; }
.tindex__title { font-family: var(--display); font-size: 1.7rem; margin: 6px 0 14px; }
.tindex__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tcard {
  display: flex; flex-direction: column; gap: 6px; padding: 20px; border-radius: var(--r-lg); background: var(--panel); color: var(--ink);
  text-decoration: none; box-shadow: var(--shadow-1); transition: transform .45s var(--ease), box-shadow .45s var(--ease);
}
.tcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.tcard__ic { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 15px; background: var(--cat-soft); color: var(--cat-ink); margin-bottom: 6px; transition: transform .5s var(--ease), background .3s, color .3s; }
.tcard:hover .tcard__ic { transform: rotate(-8deg) scale(1.08); background: var(--cat); color: var(--cat-on, #fff); }
.tcard__ic .i { width: 24px; height: 24px; }
.tcard strong { font-family: var(--display); font-weight: 400; font-size: 1.3rem; line-height: 1.3; }
.tcard span:last-child { color: var(--ink-2); font-size: .9rem; }
[data-cat="audio"].tcard, [data-cat="data"].tcard { --cat-on: var(--ink); }
:root[data-theme="dark"] [data-cat="audio"].tcard, :root[data-theme="dark"] [data-cat="data"].tcard { --cat-on: #0b0d24; }

/* Tool layout */
.tgrid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.tcol { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tpanel { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 20px; margin-bottom: 16px; }
.tside { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 12px; background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 20px; }
.tside__title { display: flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 400; font-size: 1.35rem; margin: 0 0 4px; }
.tside__title .i { color: var(--cobalt); }
.tside__stack { display: flex; flex-direction: column; gap: 8px; }
.tside__sum { font-size: .88rem; color: var(--ink-2); }
.tside__hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; width: 100%; }
.tside__prog { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; color: var(--ink-3); }
.tside__prog .job__progress { max-width: none; margin: 0; --cat: var(--cobalt); }
.tform { display: flex; flex-direction: column; gap: 12px; }
.tform .select, .tform .input { width: 100%; }
.btn--block { width: 100%; }
.input--area { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; font-family: var(--font); }
.input--mono { font-family: Consolas, "Cascadia Mono", monospace; font-size: .86rem; }
.field--wide { grid-column: 1 / -1; }

/* Tool drop zone */
.tdrop {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  padding: 34px 20px; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-2);
  outline: 2px dashed var(--line-strong); outline-offset: -12px; cursor: pointer;
  transition: outline-color .2s, transform .35s var(--ease), box-shadow .35s var(--ease);
}
.tdrop:hover { outline-color: var(--cobalt); }
.tdrop.is-over { outline-color: var(--cobalt); outline-style: solid; transform: scale(1.01); box-shadow: 0 24px 60px -24px rgba(43, 53, 240, .55); }
.tdrop__icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px; background: var(--cobalt); color: #fff; margin-bottom: 6px; box-shadow: 0 12px 22px -12px rgba(43, 53, 240, .8); transition: transform .45s var(--ease); }
.tdrop:hover .tdrop__icon, .tdrop.is-over .tdrop__icon { transform: translateY(-4px) rotate(-6deg); }
.tdrop__icon .i { width: 26px; height: 26px; }
.tdrop__text { font-weight: 600; font-size: 1.05rem; }
.tdrop__browse { color: var(--cobalt); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
:root[data-theme="dark"] .tdrop__browse { color: #9aa2ff; }
.tdrop__hint { color: var(--ink-3); font-size: .88rem; }
.is-compact > .tdrop { flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 16px 20px; gap: 10px 14px; }
.is-compact > .tdrop .tdrop__icon { width: 40px; height: 40px; border-radius: 13px; margin: 0; }
.is-compact > .tdrop .tdrop__icon .i { width: 20px; height: 20px; }

/* File list in tools */
.tlist { list-style: none; margin: 0; padding: 6px; background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.tlist:has(.tlist__empty) { display: none; }
.tlist__empty { padding: 18px; color: var(--ink-3); text-align: center; }
.tlist__item { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; transition: background .2s; }
.tlist__item:hover { background: var(--ground); }
.tlist__item + .tlist__item { margin-top: 2px; }
.badge--sm { width: 44px; height: 44px; border-radius: 13px; font-size: .78rem; }
.tlist__item.is-done .badge__done { clip-path: circle(75% at 50% 50%); }
.tlist__item.is-done .badge__done path { stroke-dashoffset: 0; }
.tlist__body { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.tlist__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; unicode-bidi: plaintext; }
.tlist__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .84rem; color: var(--ink-3); }
.tlist__st { display: inline-flex; align-items: center; gap: 6px; color: var(--cobalt); }
:root[data-theme="dark"] .tlist__st { color: #9aa2ff; }
.tlist__st .i { width: 15px; height: 15px; }
.tlist__ok { color: var(--ok); font-weight: 600; }
.tlist__err { color: var(--err); }
.tlist__note { flex-basis: 100%; color: var(--ink-2); font-size: .8rem; }
.tlist__act { display: flex; align-items: center; gap: 4px; }
.tlist__item .job__progress { margin-top: 4px; max-width: none; }
.delta-down { color: var(--ok); }

/* Live preview */
.tpreview { margin: 0; padding: 14px; border-radius: var(--r-lg); background: var(--panel); box-shadow: var(--shadow-2); }
.tpreview figcaption { font-size: .8rem; font-weight: 700; color: var(--ink-3); margin-bottom: 10px; }
.tpreview__stage { display: grid; place-items: center; border-radius: 12px; overflow: hidden; background: repeating-conic-gradient(var(--ground-2) 0 25%, var(--panel) 0 50%) 0 0 / 18px 18px; }
.tpreview__img { display: block; max-width: 100%; max-height: 460px; height: auto; }

/* Segmented control */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border-radius: 99px; background: var(--ground-2); }
.seg button { border: 0; background: transparent; color: var(--ink-2); font: 600 .84rem/1 var(--font); padding: 8px 12px; border-radius: 99px; cursor: pointer; transition: background .2s, color .2s; }
.seg button[aria-checked="true"], .seg button[aria-selected="true"] { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1); }
.seg--tabs { margin-bottom: 14px; }

/* Image editor */
.editor { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 14px; }
.editor__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 12px; }
.editor__sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.flip-x { transform: scaleX(-1); }
.editor__stage { position: relative; display: grid; place-items: center; min-height: 240px; border-radius: 12px; background: repeating-conic-gradient(var(--ground-2) 0 25%, var(--panel) 0 50%) 0 0 / 18px 18px; overflow: hidden; }
.editor__stage canvas { display: block; max-width: 100%; }
.crop {
  position: absolute; box-sizing: border-box; border: 2px solid #fff; cursor: move; touch-action: none;
  box-shadow: 0 0 0 9999px rgba(8, 10, 30, .55);
}
.editor__frame { position: relative; line-height: 0; margin: 12px; overflow: hidden; }
.crop::before, .crop::after { content: ""; position: absolute; inset: 33.33% 0; border-block: 1px solid rgba(255, 255, 255, .45); pointer-events: none; }
.crop::after { inset: 0 33.33%; border-block: 0; border-inline: 1px solid rgba(255, 255, 255, .45); }
.crop span { position: absolute; width: 16px; height: 16px; background: #fff; border-radius: 4px; box-shadow: 0 1px 4px rgba(0, 0, 0, .4); }
.crop [data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.crop [data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.crop [data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.crop [data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }

/* PDF pages */
.pages { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 16px; }
.pages__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; }
.pages__hint { color: var(--ink-2); font-size: .9rem; flex: 1 1 260px; }
.pages__count { font-weight: 600; font-size: .9rem; }
.pages__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.pg { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border-radius: 14px; background: var(--ground); cursor: pointer; outline: 2px solid transparent; transition: outline-color .2s, transform .3s var(--ease), background .2s; }
.pg:hover { transform: translateY(-2px); }
.pg.is-sel { outline-color: var(--cobalt); background: var(--cobalt-soft); }
.pg.is-drag { opacity: .4; }
.pg.is-target { outline: 2px dashed var(--cobalt); }
.pg__img { display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; }
.pg__img canvas { max-width: 100%; max-height: 100%; box-shadow: 0 4px 12px -4px rgba(0, 0, 0, .35); background: #fff; transform: rotate(var(--r)); transition: transform .4s var(--ease); }
.pg__num { font-weight: 700; font-size: .85rem; color: var(--ink-2); }
.pg__rot { position: absolute; top: 6px; inset-inline-end: 6px; width: 30px; height: 30px; background: var(--panel); box-shadow: var(--shadow-1); opacity: 0; transition: opacity .2s; }
.pg:hover .pg__rot, .pg:focus-within .pg__rot { opacity: 1; }
.pg.is-sel::after { content: ""; position: absolute; top: 8px; inset-inline-start: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--cobalt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 14px no-repeat; animation: pop-in .3s var(--ease); }

/* Media tools */
.trim, .frames { background: var(--panel); border-radius: var(--r-lg); box-shadow: var(--shadow-2); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.player video, .player audio { display: block; width: 100%; max-height: 420px; border-radius: 12px; background: #000; }
.player audio { background: transparent; }
.trim__warn { color: var(--warn); font-size: .9rem; }
.trim__track { position: relative; height: 44px; border-radius: 12px; background: var(--ground-2); direction: ltr; }
.trim__sel { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--cobalt) 28%, transparent); border-inline: 3px solid var(--cobalt); border-radius: 8px; pointer-events: none; }
[dir="rtl"] .trim__track .trim__sel { inset-inline-start: auto; }
.trim__r { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: none; pointer-events: none; appearance: none; -webkit-appearance: none; }
.trim__r::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 18px; height: 44px; border-radius: 6px; background: var(--cobalt); box-shadow: 0 2px 6px rgba(0, 0, 0, .3); cursor: ew-resize; }
.trim__r::-moz-range-thumb { pointer-events: auto; width: 18px; height: 44px; border-radius: 6px; border: 0; background: var(--cobalt); cursor: ew-resize; }
.trim__r::-webkit-slider-runnable-track { background: none; }
.trim__times { display: grid; grid-template-columns: 1fr auto auto 1fr; gap: 10px; align-items: end; }
.trim__len { font-weight: 600; color: var(--ink-2); }
.frames__time { color: var(--ink-2); font-weight: 600; }

/* QR & Base64 & info */
.qr__stage { display: grid; place-items: center; padding: 24px; min-height: 360px; border-radius: 14px; background: var(--ground); }
.qr__stage svg { max-width: 100%; height: auto; border-radius: 10px; box-shadow: var(--shadow-2); animation: pop-in .35s var(--ease); }
.b64__grid { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; margin-bottom: 12px; }
.b64__mid { display: flex; flex-direction: column; gap: 8px; }
.b64__row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; margin-top: 12px; }
.b64 .field--check { margin: 12px 0; }
.info__dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin: 0; }
.info__row { padding: 12px 14px; border-radius: 12px; background: var(--ground); animation: slide-down .35s var(--ease) backwards; }
.info__row--wide { grid-column: 1 / -1; }
.info__row dt { font-size: .78rem; font-weight: 700; color: var(--ink-3); margin-bottom: 4px; }
.info__row dd { margin: 0; font-weight: 600; word-break: break-all; }
.info__row code { font-size: .82rem; font-family: Consolas, monospace; }
.info__more { margin-top: 14px; }
.info__raw pre { max-height: 320px; overflow: auto; font-size: .78rem; background: var(--ground); padding: 12px; border-radius: 10px; }
.unzip__sum { font-weight: 600; margin-bottom: 10px; color: var(--ink-2); }
.unzip .tlist { box-shadow: none; padding: 0; }

/* History */
.hist__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.hist__stats { font-family: var(--display); font-size: 1.3rem; }
.hist__table { display: flex; flex-direction: column; }
.hist__row { display: grid; grid-template-columns: minmax(0, 2.2fr) 1fr 1.2fr 1.2fr; gap: 12px; padding: 10px 6px; border-top: 1px solid var(--line); font-size: .9rem; align-items: center; }
.hist__row--head { border-top: 0; font-weight: 700; color: var(--ink-3); font-size: .8rem; }
.hist__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.hist__when { color: var(--ink-3); font-size: .84rem; }
.tempty { display: flex; align-items: center; gap: 10px; color: var(--ink-3); padding: 12px 4px; }
.preset-list { list-style: none; margin: 0; padding: 0; }
.preset-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 4px; border-top: 1px solid var(--line); }

@media (max-width: 1100px) {
  .tgrid { grid-template-columns: 1fr; }
  .tside { position: static; }
}
@media (max-width: 960px) {
  .hub { grid-template-columns: minmax(0, 1fr); margin-top: -96px; gap: 16px; }
  .sidebar { position: static; max-height: none; overflow: visible; background: transparent; box-shadow: none; }
  .side { flex-direction: row; overflow-x: auto; padding: 4px 2px 8px; gap: 8px; scrollbar-width: none; scroll-snap-type: x proximity; }
  .side::-webkit-scrollbar { display: none; }
  .side__group { display: none; }
  .side__link { flex: none; background: var(--panel); box-shadow: var(--shadow-1); padding: 8px 12px 8px 8px; scroll-snap-align: start; white-space: nowrap; }
  .side__link.is-active::before { display: none; }
  .side__txt small { display: none; }
  .hero[data-mode="tool"] { padding: 96px 0 128px; }
  .hero-tool__row { gap: 14px; }
  .hero-tool__ic { width: 58px; height: 58px; border-radius: 18px; }
  .hero-tool__ic .i { width: 28px; height: 28px; }
  .hero__tool { text-align: start; }
  .b64__grid { grid-template-columns: 1fr; }
  .b64__mid { flex-direction: row; }
  .hist__row { grid-template-columns: 1fr; gap: 2px; }
  .hist__row--head { display: none; }
  .trim__times { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .hub { padding: 0 16px; }
  .pages__grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

/* Converter: presets, preview, compare */
.presets { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: end; gap: 10px 14px; padding-bottom: 14px; margin-bottom: 2px; border-bottom: 1px dashed var(--line-strong); }
.presets .field { flex: 1 1 240px; }
.presets .field > span { justify-content: flex-start; align-items: center; gap: 6px; }
.presets .field > span .i { width: 15px; height: 15px; color: var(--cobalt); }
.presets__save { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.presets__form { display: inline-flex; gap: 6px; animation: pop-in .3s var(--ease); }
.presets__form .input { width: 170px; height: 36px; }
.facts { color: var(--ink-2); }
.pv { margin: 0 18px 18px; margin-inline-start: 90px; padding: 16px; border-radius: var(--r-md); background: var(--ground); display: grid; gap: 14px;
  opacity: 0; transform: translateY(-8px); transition: opacity .3s var(--ease), transform .35s var(--ease); }
.job.is-pv .pv { opacity: 1; transform: none; }
.pv--two { grid-template-columns: 1fr 1fr; }
.pv__fig { margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pv__fig figcaption { font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.pv__fig img, .pv__fig video, .pv__fig canvas { display: block; max-width: 100%; max-height: 340px; border-radius: 10px; object-fit: contain; background: repeating-conic-gradient(var(--ground-2) 0 25%, var(--panel) 0 50%) 0 0 / 16px 16px; }
.pv__fig canvas { box-shadow: var(--shadow-1); }
.pv__fig audio { width: 100%; }
.pv__fig pre { margin: 0; max-height: 300px; overflow: auto; padding: 12px; border-radius: 10px; background: var(--panel); font: .8rem/1.5 Consolas, "Cascadia Mono", monospace; white-space: pre-wrap; word-break: break-word; }
.cmp { position: relative; display: grid; border-radius: 12px; overflow: hidden; max-height: 460px; background: repeating-conic-gradient(var(--ground-2) 0 25%, var(--panel) 0 50%) 0 0 / 16px 16px; direction: ltr; }
.cmp img { grid-area: 1 / 1; width: 100%; max-height: 460px; object-fit: contain; display: block; }
.cmp__b { clip-path: inset(0 calc(100% - var(--p)) 0 0); }
.cmp__line { position: absolute; top: 0; bottom: 0; left: var(--p); width: 3px; margin-left: -1.5px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15), 0 0 12px rgba(0, 0, 0, .3); pointer-events: none; }
.cmp__line::after { content: ""; position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; box-shadow: 0 2px 10px rgba(0, 0, 0, .3);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230c0f2e' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 7-5 5 5 5M15 7l5 5-5 5'/%3E%3C/svg%3E") center / 20px no-repeat; }
.cmp__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmp__tag { position: absolute; top: 10px; padding: 4px 10px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: rgba(12, 15, 46, .72); color: #fff; pointer-events: none; }
.cmp__tag--b { left: 10px; }
.cmp__tag--a { right: 10px; }
@media (max-width: 860px) { .pv { margin-inline-start: 18px; } .pv--two { grid-template-columns: 1fr; } }

/* ---------- Left-to-right (English) ---------- */
[dir="ltr"] .select { background-position: right 12px center; }
[dir="ltr"] .job__name { text-align: left; }
[dir="ltr"] .chips { justify-content: flex-start; }
[dir="ltr"] .job__target > .i { transform: scaleX(-1); }
[dir="ltr"] .job.is-working .job__target > .i { animation-name: nudge-ltr; }
@keyframes nudge-ltr { from { transform: scaleX(-1); } to { transform: scaleX(-1) translateX(-5px); } }
[dir="rtl"] .dir-arrow { display: inline-block; transform: scaleX(-1); }
[dir="ltr"] .hero h1 { font-size: clamp(2.8rem, 5.6vw, 5rem); line-height: 1.08; }
[dir="ltr"] .steps li::before { content: counter(s); }
[dir="ltr"] .drop__title, [dir="ltr"] .section-head h2, [dir="ltr"] .steps strong, [dir="ltr"] .queue__count { letter-spacing: .01em; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero { padding: 104px 0 130px; }
  .hero__inner { grid-template-columns: 1fr; gap: 8px; text-align: center; }
  .hero__lead { margin-inline: auto; }
  .machine { height: 250px; --card-w: 96px; --card-h: 124px; }
  .machine__gate { width: 170px; height: 170px; }
  .fcard__ext { font-size: 1.8rem; }
  .fcard { padding: 12px; }
  .fcard__lines { top: 22px; left: 12px; height: 34px; }
}
@media (max-width: 860px) {
  .topnav { display: none; }
  .job__row { grid-template-columns: 48px minmax(0, 1fr) 36px; grid-template-areas: "b i x" "t t t" "a a a"; gap: 10px 12px; }
  .badge { width: 48px; height: 48px; grid-area: b; border-radius: 14px; font-size: .9rem; }
  .job__info { grid-area: i; }
  .job__target { grid-area: t; }
  .job__target .select { flex: 1; }
  .job__actions { grid-area: a; justify-content: stretch; min-width: 0; }
  .job__actions > .btn { flex: 1; }
  .job__remove { grid-area: x; }
  .opts, .unsupported { margin-inline-start: 18px; }
  .queue__bar { position: static; }
  .queue__bulk { width: 100%; }
  .queue__bulk .btn { flex: 1 1 auto; }
  .queue__sep { display: none; }
  .ft-row { grid-template-columns: 1fr; }
  .ft-row > div { padding: 14px 18px; }
  .ft-cat { padding-block: 16px !important; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .topbar__inner { padding: 0 16px; gap: 12px; height: 62px; }
  .privacy-pill { display: none; }
  .top-btn--lang span { display: none; }
  .top-btn--lang { width: 36px; padding: 0; }
  main, .hero__inner { padding: 0 16px; }
  .hero { padding: 92px 0 118px; }
  .hero h1 { font-size: 2.65rem; }
  .hero__lead { font-size: 1rem; }
  .machine { height: 210px; --card-w: 80px; --card-h: 104px; }
  .machine__gate { width: 140px; height: 140px; }
  .fcard__ext { font-size: 1.45rem; }
  .drop__body { padding: 38px 18px 34px; }
  .drop__title { font-size: 1.65rem; }
}
@media (pointer: coarse) {
  .paste-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .machine__rail, .g-dash, .g-ring, .job__progress > span, .drop:hover .drop__ants rect, .drop.is-over .drop__ants rect, .drop.is-over .drop__icon { animation: none !important; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
