/* VideoToFrames.io — main stylesheet
   Palette "Iris": graphite neutrals + one iris-violet accent (+ a cyan used only in art/glow).
   Two themes, default follows the OS; the header toggle stores the choice (localStorage vf_theme).
   To re-brand, change the --accent* tokens in both theme blocks. */

@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/geist-latin-wght-normal.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; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/geist-latin-ext-wght-normal.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: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/geist-mono-latin-wght-normal.woff2) format("woff2"); }

:root {
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  --r-xs: 8px; --r-sm: 10px; --r: 14px; --r-lg: 18px; --r-xl: 24px; --pill: 999px;
  --wrap: 1240px; --main: 760px; --side: 320px;
  --gut: 24px;
  --hdr: 64px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
  /* light */
  --bg: #f7f7f9;
  --bg-alt: #ffffff;
  --surface: #ffffff;
  --surface-2: #f3f3f6;
  --surface-3: #e9e9ef;
  --line: #e6e6ec;
  --line-2: #d6d6df;
  --text: #121218;
  --text-2: #3d3d4a;
  --muted: #6b6b7b;
  --intro: #8a8a99;
  --accent: #5b4bf0;
  --accent-hover: #4e3ee6;
  --accent-press: #4434d6;
  --on-accent: #ffffff;
  --accent-text: #4a3ad8;
  --accent-soft: #efedff;
  --accent-line: #c9c2ff;
  --accent-2: #0ea5e9;
  --glow-1: rgba(91, 75, 240, .16);
  --glow-2: rgba(14, 165, 233, .10);
  --ok: #12825a; --warn-bg: #fff7e6; --warn-line: #f3d48b; --warn-text: #7a4b00; --err: #c9302c;
  --shadow-1: 0 1px 2px rgba(18, 18, 30, .05);
  --shadow-2: 0 1px 2px rgba(18, 18, 30, .04), 0 12px 32px -14px rgba(18, 18, 40, .16);
  --shadow-3: 0 30px 70px -24px rgba(18, 18, 40, .35), 0 2px 8px rgba(18, 18, 40, .06);
  --chip: #f1f0f7; --chip-h: #e8e6f3; --chip-a: #dedbee;
  --seg-on: #ffffff;
  --scrim: rgba(12, 12, 18, .5);
  --art-bg: #f3f2fa; --art-panel: #e8e6f4; --art-card: #ffffff; --art-line: #d4d1e6; --art-ink: #2a2840;
  --art-g1: #6d5cff; --art-g2: #2563eb;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #08080b; --bg-alt: #0d0d11; --surface: #121217; --surface-2: #191920; --surface-3: #22222b;
  --line: #24242d; --line-2: #33333f; --text: #f3f3f7; --text-2: #c9c9d4; --muted: #8d8d9e; --intro: #9c9cad;
  --accent: #7262ff; --accent-hover: #8173ff; --accent-press: #6252f5; --on-accent: #ffffff;
  --accent-text: #a89dff; --accent-soft: rgba(114, 98, 255, .14); --accent-line: rgba(140, 125, 255, .42);
  --accent-2: #38bdf8; --glow-1: rgba(114, 98, 255, .22); --glow-2: rgba(56, 189, 248, .10);
  --ok: #3ccf8e; --warn-bg: rgba(255, 176, 32, .09); --warn-line: rgba(255, 176, 32, .32); --warn-text: #ffcf7a; --err: #ff6b66;
  --shadow-1: 0 1px 0 rgba(255, 255, 255, .03) inset; --shadow-2: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 16px 40px -20px rgba(0, 0, 0, .8);
  --shadow-3: 0 30px 80px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .04);
  --chip: #1b1830; --chip-h: #251f42; --chip-a: #141124; --seg-on: #2b2b36;
  --scrim: rgba(0, 0, 0, .7);
  --art-bg: #15151c; --art-panel: #1f1f29; --art-card: #2a2a36; --art-line: #393947; --art-ink: #e8e8f0;
  --art-g1: #4b3fd6; --art-g2: #1d4ed8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #08080b; --bg-alt: #0d0d11; --surface: #121217; --surface-2: #191920; --surface-3: #22222b;
    --line: #24242d; --line-2: #33333f; --text: #f3f3f7; --text-2: #c9c9d4; --muted: #8d8d9e; --intro: #9c9cad;
    --accent: #7262ff; --accent-hover: #8173ff; --accent-press: #6252f5; --on-accent: #ffffff;
    --accent-text: #a89dff; --accent-soft: rgba(114, 98, 255, .14); --accent-line: rgba(140, 125, 255, .42);
    --accent-2: #38bdf8; --glow-1: rgba(114, 98, 255, .22); --glow-2: rgba(56, 189, 248, .10);
    --ok: #3ccf8e; --warn-bg: rgba(255, 176, 32, .09); --warn-line: rgba(255, 176, 32, .32); --warn-text: #ffcf7a; --err: #ff6b66;
    --shadow-1: 0 1px 0 rgba(255, 255, 255, .03) inset; --shadow-2: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 16px 40px -20px rgba(0, 0, 0, .8);
    --shadow-3: 0 30px 80px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .04);
    --chip: #1b1830; --chip-h: #251f42; --chip-a: #141124; --seg-on: #2b2b36;
    --scrim: rgba(0, 0, 0, .7);
    --art-bg: #15151c; --art-panel: #1f1f29; --art-card: #2a2a36; --art-line: #393947; --art-ink: #e8e8f0;
    --art-g1: #4b3fd6; --art-g2: #1d4ed8;
  }
}
html.theme-now, html.theme-now *, html.theme-now *::before, html.theme-now *::after { transition: none !important; }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--hdr) + 20px); }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 16px/1.65 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; overflow-x: hidden; }
body.no-scroll { overflow: hidden; }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: var(--accent-text); text-decoration: none; }
@media (hover: hover) { a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; } }
h1, h2, h3, h4 { color: var(--text); line-height: 1.15; margin: 0; letter-spacing: -.025em; text-wrap: balance; font-weight: 650; }
h1 { font-size: clamp(2.05rem, 1.35rem + 2.9vw, 3.5rem); font-weight: 700; letter-spacing: -.045em; line-height: 1.02; text-wrap: wrap; }
h2 { font-size: clamp(1.6rem, 1.25rem + 1.2vw, 2.25rem); letter-spacing: -.035em; }
h3 { font-size: 1.08rem; letter-spacing: -.015em; font-weight: 620; }
p { margin: 0 0 1em; }
ul, ol { padding-inline-start: 1.25em; margin: 0 0 1em; }
li + li { margin-top: .4em; }
strong, b { font-weight: 620; color: var(--text); }
code, kbd, .mono, .num { font-family: var(--mono); }
.num { font-variant-numeric: tabular-nums; font-size: .94em; letter-spacing: -.01em; }
code { background: var(--surface-2); border: 1px solid var(--line); padding: .06em .38em; border-radius: 6px; font-size: .86em; }
kbd { display: inline-block; min-width: 1.7em; text-align: center; padding: .02em .45em; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; background: var(--surface); font-size: .78em; color: var(--text); line-height: 1.5; }
pre { position: relative; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 52px 16px 18px; overflow-x: auto; line-height: 1.6; margin: 0 0 1.2em; }
pre code { background: none; border: 0; padding: 0; font-size: .85rem; }
.code-copy { position: absolute; top: 8px; inset-inline-end: 8px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
.grow { flex: 1 1 auto; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.i { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: color-mix(in srgb, var(--accent) 30%, transparent); }
[hidden] { display: none !important; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--r-sm); font-weight: 600; }
.skip:focus { top: 12px; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gut)); margin-inline: auto; padding-inline: var(--gut); }
@media (max-width: 520px) { :root { --gut: 16px; } }

/* ---------- buttons ---------- */
.btn { --b-bg: var(--surface); --b-fg: var(--text); --b-line: var(--line-2);
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: var(--pill); border: 1px solid var(--b-line); background: var(--b-bg); color: var(--b-fg);
  font: 560 .94rem/1 var(--font); letter-spacing: -.01em; cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease), box-shadow .2s var(--ease); }
.btn .i { width: 18px; height: 18px; }
@media (hover: hover) { .btn:hover { --b-bg: var(--surface-2); } }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary { --b-bg: var(--accent); --b-fg: var(--on-accent); --b-line: transparent; box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 8px 24px -10px var(--accent); }
@media (hover: hover) { .btn-primary:hover { --b-bg: var(--accent-hover); box-shadow: 0 1px 0 rgba(255, 255, 255, .22) inset, 0 12px 30px -10px var(--accent); } }
.btn-primary:active { --b-bg: var(--accent-press); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; color: var(--muted); }
@media (hover: hover) { .btn-ghost:hover { --b-bg: var(--surface-2); color: var(--text); } }
.btn-lg { min-height: 54px; padding: 0 28px; font-size: 1rem; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .86rem; }
.btn.is-busy { pointer-events: none; color: transparent !important; }
.btn.is-busy::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2px solid var(--on-accent); border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.is-busy:not(.btn-primary)::after { border-color: var(--text); border-right-color: transparent; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; transition: background-color .15s var(--ease), color .15s var(--ease); flex: none; }
.icon-btn .i { pointer-events: none; }
.icon-btn.sm { width: 36px; height: 36px; border-radius: 10px; }
.icon-btn.xs { width: 30px; height: 30px; border-radius: 9px; }
.icon-btn.xs .i { width: 16px; height: 16px; }
.icon-btn.ring { border: 1px solid var(--line-2); background: var(--surface); }
@media (hover: hover) { .icon-btn:hover:not(:disabled) { background: var(--surface-2); color: var(--text); } }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.is-busy { animation: pulse .8s ease-in-out infinite; }
@media (pointer: coarse) { .icon-btn { width: 44px; height: 44px; } .icon-btn.sm { width: 42px; height: 42px; } }
.pill { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 540 .84rem/1 var(--font); cursor: pointer; text-decoration: none !important; transition: background-color .15s, border-color .15s, color .15s; }
.pill.num { font-family: var(--mono); font-size: .8rem; }
@media (hover: hover) { .pill:hover:not(:disabled) { border-color: var(--line-2); color: var(--text); } }
.pill.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.pill:disabled { opacity: .4; cursor: not-allowed; }

/* tooltips: [data-tip] on any element; .tip = small (i) button for longer help */
[data-tip] { position: relative; }
@media (hover: hover) {
  [data-tip]:hover::after, [data-tip]:focus-visible::after {
    content: attr(data-tip); position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
    width: max-content; max-width: 260px; padding: 7px 10px; border-radius: 8px; background: var(--text); color: var(--bg);
    font: 500 .78rem/1.4 var(--font); letter-spacing: 0; text-align: start; white-space: normal; pointer-events: none; box-shadow: var(--shadow-2);
    animation: pop .12s var(--ease);
  }
  [data-tip-pos="end"]:hover::after { left: auto; right: 0; transform: none; }
  [data-tip-pos="start"]:hover::after { left: 0; transform: none; }
  [data-tip-pos="below"]:hover::after, [data-tip-pos="below"]:focus-visible::after { bottom: auto; top: calc(100% + 8px); left: auto; right: 0; transform: none; }
}
.tip { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: help; padding: 0; vertical-align: middle; }
.tip .i { width: 16px; height: 16px; }
.tip[aria-expanded="true"]::after { content: attr(data-tip); position: absolute; z-index: 30; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: 240px; padding: 7px 10px; border-radius: 8px; background: var(--text); color: var(--bg); font: 500 .78rem/1.4 var(--font); text-align: start; }

/* ---------- header ---------- */
.hdr { position: sticky; top: 0; z-index: 40; height: var(--hdr); background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.8) blur(16px); -webkit-backdrop-filter: saturate(1.8) blur(16px); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent); }
.hdr .wrap { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; height: 100%; gap: 6px; }
.hdr .wrap > .brand,
.ftr-about > .brand { font-size: 1.4rem; }
.hdr .wrap > .brand { justify-self: start; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 1.04rem; letter-spacing: -.025em; margin-inline-end: 18px; text-decoration: none !important; }
.brand img { width: 28px; height: 28px; }
.brand b { font-weight: 700; }
.brand b.bn { word-spacing: -.24em; }
.hdr .brand b.bn { word-spacing: normal; }
.bn-wrap { display: inline-flex; align-items: flex-start; }
.brand span.brand-io { margin: 1px 0 0 6px; padding: 3px 7px; border-radius: 7px; background: var(--accent); color: var(--on-accent); font-size: .72rem; font-weight: 700; line-height: 1.15; letter-spacing: .02em; }
.brand span span { color: var(--muted); font-weight: 500; }
.nav { display: flex; align-items: center; gap: 2px; }
.nav > a, .dd-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border-radius: 999px; color: var(--text-2); font: 520 .92rem/1 var(--font); background: none; border: 0; cursor: pointer; text-decoration: none !important; }
.nav > a .i, .dd-btn .i { width: 17px; height: 17px; opacity: .85; }
@media (hover: hover) { .nav > a:hover, .dd-btn:hover, .dd.open > .dd-btn { background: var(--accent); color: var(--on-accent); } .nav > a:hover .i, .dd-btn:hover .i { opacity: 1; } }
.nav > a[aria-current="page"], .dd.cur > .dd-btn { color: var(--on-accent); background: var(--accent); }
.nav > a[aria-current="page"] .i, .dd.cur > .dd-btn .i { opacity: 1; }
.dd { position: relative; }
.dd-btn .chev { width: 14px; height: 14px; transition: transform .2s var(--ease); }
.dd.open .dd-btn .chev { transform: rotate(180deg); }
.dd-panel { position: absolute; top: calc(100% + 10px); inset-inline-start: -10px; width: 600px; padding: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-3); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 8px; animation: pop .16s var(--ease); }
.dd-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.dd-panel.lang { width: 220px; grid-template-columns: 1fr; inset-inline-start: auto; inset-inline-end: 0; }
.dd-group { display: flex; flex-direction: column; gap: 6px; padding: 6px; }
.dd-group .dd-h { margin: 0; font-size: .74rem; color: var(--muted); font-weight: 560; letter-spacing: .02em; text-transform: uppercase; padding: 6px 10px 8px; }
.dd-item { display: flex; gap: 12px; padding: 10px; border-radius: var(--r); color: var(--text); text-decoration: none !important; }
.dd-item .ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); flex: none; }
.dd-item b { display: block; font-size: .92rem; font-weight: 600; line-height: 1.3; }
.dd-item small { display: block; color: var(--muted); font-size: .8rem; line-height: 1.4; margin-top: 2px; }
@media (hover: hover) { .dd-item:hover { background: var(--surface-2); } }
.dd-item[aria-current="page"] { background: var(--surface-2); }
.lang-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text); font-size: .92rem; text-decoration: none !important; }
.lang-item small { color: var(--muted); font-weight: 600; font-size: .74rem; font-family: var(--mono); }
@media (hover: hover) { .lang-item:hover { background: var(--surface-2); } }
.lang-item[aria-current="true"] { color: var(--accent-text); font-weight: 600; }
.hdr-end { justify-self: end; display: flex; align-items: center; gap: 4px; }
.lang-btn b { font-size: .78rem; font-weight: 600; font-family: var(--mono); }
.theme-btn .i-sun { display: none; }
.theme-btn[aria-pressed="true"] .i-sun { display: block; }
.theme-btn[aria-pressed="true"] .i-moon { display: none; }
.menu-btn { display: none; }
@media (max-width: 880px) {
  .hdr .wrap { display: flex; }
  .nav { display: none; }
  .menu-btn { display: inline-grid; }
  .brand { margin-inline-end: auto; }
  .hdr-end .lang-dd { display: none; }
}
.drawer { position: fixed; inset: 0; z-index: 60; overflow: hidden; background: var(--scrim); opacity: 0; visibility: hidden; transition: opacity .2s var(--ease), visibility .2s; }
.drawer.open { opacity: 1; visibility: visible; }
.drawer-in { position: absolute; inset-block: 0; inset-inline-end: 0; width: min(360px, 88vw); background: var(--surface); padding: 12px 14px 28px; overflow-y: auto; transform: translateX(100%); transition: transform .24s var(--ease); display: flex; flex-direction: column; gap: 2px; }
.drawer.open .drawer-in { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 0 8px; }
.drawer .drawer-h { margin: 0; font-size: .74rem; color: var(--muted); font-weight: 560; text-transform: uppercase; letter-spacing: .02em; padding: 16px 10px 6px; }
.drawer a { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 0 10px; border-radius: var(--r); color: var(--text); font-weight: 520; text-decoration: none !important; }
.drawer a .i { color: var(--accent-text); }
.drawer a[aria-current="page"] { background: var(--surface-2); }
.drawer .langs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px 4px 0; }
.drawer .langs a { min-height: 42px; justify-content: center; border: 1px solid var(--line); font-size: .9rem; }
@media (prefers-reduced-motion: reduce) { .drawer, .drawer-in { transition: none; } }
.langbar { background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .88rem; }
.langbar .wrap { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 40px; }
.langbar a { font-weight: 560; }

/* ---------- breadcrumbs ---------- */
.crumbs { position: relative; z-index: 2; font-size: .84rem; color: var(--muted); padding-top: 22px; }
.crumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 2px 4px; align-items: center; }
.crumbs li { margin: 0; display: inline-flex; align-items: center; gap: 4px; }
.crumbs li + li::before { content: ""; width: 5px; height: 5px; margin: 0 4px; border-top: 1.5px solid currentColor; border-right: 1.5px solid currentColor; transform: rotate(45deg); opacity: .5; }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; padding: 0 6px; margin: 0 -6px; border-radius: 8px; color: var(--muted); }
@media (hover: hover) { .crumbs a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; } }
.crumbs [aria-current] { color: var(--text-2); font-weight: 520; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 36px 0 56px; text-align: center; isolation: isolate; }
.hero::before { content: ""; position: absolute; z-index: -1; inset: -120px 0 auto; height: 760px; pointer-events: none;
  background: radial-gradient(40% 50% at 50% 30%, var(--glow-1), transparent 70%), radial-gradient(30% 40% at 72% 48%, var(--glow-2), transparent 70%); }
.hero::after { content: ""; position: absolute; z-index: -1; inset: -80px 0 auto; height: 680px; pointer-events: none; opacity: .5;
  background-image: radial-gradient(color-mix(in srgb, var(--text) 16%, transparent) 1px, transparent 1px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(50% 55% at 50% 30%, #000, transparent 75%); mask-image: radial-gradient(50% 55% at 50% 30%, #000, transparent 75%); }
.hero h1 { margin: 0 auto; font-size: clamp(1.95rem, 1.25rem + 2.55vw, 3.2rem); }
.hero .lede { margin: 16px auto 0; width: fit-content; max-width: 100%; text-align: center; color: var(--intro); font-size: clamp(.94rem, .9rem + .28vw, 1.08rem); line-height: 1.6; }
.badges { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; margin: 0 0 16px; padding: 0; font-size: .84rem; font-weight: 520; color: var(--muted); }
@media (max-width: 520px) { .badges { flex-wrap: nowrap; gap: 4px 10px; } }
.tool-tabs-nav { position: relative; margin: 14px 0 0; }
.tool-tabs { display: flex; flex-wrap: nowrap; justify-content: center; gap: 8px; margin: 0; overflow-x: auto; scrollbar-width: none; scroll-padding-inline: 48px; -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain; }
.tool-tabs::-webkit-scrollbar { display: none; }
.tool-tabs a { display: inline-flex; align-items: center; gap: 8px; flex: none; height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2); font: 560 .92rem/1 var(--font); white-space: nowrap; text-decoration: none !important; }
.tool-tabs a .i { width: 16px; height: 16px; }
.tool-tabs a[aria-current="page"] { background: #fff; border-color: var(--accent); color: var(--accent); }
@media (hover: hover) { .tool-tabs a:hover { border-color: var(--accent-line); color: var(--text); } .tool-tabs a[aria-current="page"]:hover { background: #fff; border-color: var(--accent); color: var(--accent); } }
:root[data-theme="dark"] .tool-tabs a[aria-current="page"],
:root[data-theme="dark"] .tool-tabs a[aria-current="page"]:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tool-tabs a[aria-current="page"],
  :root:not([data-theme="light"]) .tool-tabs a[aria-current="page"]:hover { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
}
.tool-tabs-nav + .vf { margin-top: 36px; }
.tool-tabs-btn { display: none; position: absolute; z-index: 2; top: 0; bottom: 0; width: 96px; align-items: center; border: 0; background: transparent; color: var(--text); cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
.tool-tabs-btn::before { content: ""; position: absolute; inset: -8px 0; z-index: 0; pointer-events: none; }
.tool-tabs-btn.prev { left: 0; justify-content: flex-start; padding-left: 2px; }
.tool-tabs-btn.next { right: 0; justify-content: flex-end; padding-right: 2px; }
.tool-tabs-btn.prev::before { background: linear-gradient(90deg, var(--bg) 0, var(--bg) 34%, color-mix(in srgb, var(--bg) 72%, transparent) 58%, transparent 100%); -webkit-mask-image: linear-gradient(90deg, #000 0, #000 38%, transparent 100%); mask-image: linear-gradient(90deg, #000 0, #000 38%, transparent 100%); }
.tool-tabs-btn.next::before { background: linear-gradient(270deg, var(--bg) 0, var(--bg) 34%, color-mix(in srgb, var(--bg) 72%, transparent) 58%, transparent 100%); -webkit-mask-image: linear-gradient(270deg, #000 0, #000 38%, transparent 100%); mask-image: linear-gradient(270deg, #000 0, #000 38%, transparent 100%); }
.tool-tabs-btn .i { position: relative; z-index: 1; width: 26px; height: 26px; }
.tool-tabs.can-left ~ .prev, .tool-tabs.can-right ~ .next { display: flex; }
@media (max-width: 720px) {
  .tool-tabs-nav { margin-inline: calc(var(--gut) * -1); }
  .tool-tabs { justify-content: flex-start; padding-inline: 16px 72px; scroll-padding-inline: 72px; }
  .tool-tabs-btn { width: 112px; }
  .tool-tabs-btn .i { width: 30px; height: 30px; }
}
.badges li { margin: 0; display: inline-flex; align-items: center; gap: 6px; }
.badges .i { width: 14px; height: 14px; }
.badges .c-free { color: var(--accent); }
.badges .c-fast { color: #e0941a; }
.badges .c-private { color: var(--ok); }
.tool-hero { padding-top: 0; }
.tool-hero .crumbs { padding-top: 6px; }
.tool-hero .crumbs a { min-height: 24px; }
.tool-hero h1 { font-size: clamp(1.8rem, 1.25rem + 1.85vw, 2.6rem); margin-top: 0; }
.tool-hero .badges { margin-top: 10px; }
.tool-hero:has(.tool-tabs) { padding-top: 36px; }
.tool-hero:has(.tool-tabs) h1 { font-size: clamp(1.95rem, 1.25rem + 2.55vw, 3.2rem); }
.tool-hero:has(.tool-tabs) .badges { margin-top: 0; }
.hero:has(.tool-tabs) h1 { min-height: 1.02em; }

/* ---------- the tool (shared by all tools) ---------- */
.vf { position: relative; max-width: 1100px; margin: 40px auto 0; text-align: start; }
.vf-drop { position: relative; display: grid; place-items: center; text-align: center; min-height: 360px; padding: 48px 24px; border-radius: var(--r-xl); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); transition: border-color .2s var(--ease), box-shadow .2s var(--ease), transform .2s var(--ease); overflow: hidden; isolation: isolate; }
.vf-drop::before { content: ""; position: absolute; inset: 14px; z-index: -1; border-radius: calc(var(--r-xl) - 8px); border: 1.5px dashed var(--line-2); transition: border-color .2s, background-color .2s; }
@media (hover: hover) { .vf-drop:hover::before { border-color: var(--accent-line); } .vf-drop:hover .vf-drop-ico { transform: translateY(-3px); } }
.vf.is-drag .vf-drop::before, .vf-drop:focus-visible::before { border-color: var(--accent); background: var(--accent-soft); }
.vf-drop:focus-visible { outline: none; }
.vf.is-pulse .vf-drop { animation: ring .9s var(--ease); }
.vf-drop-in { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 560px; }
.vf-drop-ico { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; color: #fff; background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); box-shadow: 0 1px 0 rgba(255, 255, 255, .3) inset, 0 18px 40px -14px var(--accent); transition: transform .2s var(--ease); }
.vf-drop-ico .i { width: 30px; height: 30px; stroke-width: 2; }
.vf-drop-t { font-size: 1.32rem; font-weight: 620; letter-spacing: -.025em; margin: 4px 0 0; }
.vf-drop-t .when-drag { display: none; }
.vf.is-drag .vf-drop-t .when-idle { display: none; }
.vf.is-drag .vf-drop-t .when-drag { display: inline; }
.vf-drop-s { color: var(--muted); font-size: .9rem; margin: 0; }
.vf-drop-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }
.vf-formats { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; color: var(--muted); font-size: .8rem; margin: 6px 0 0; font-family: var(--mono); letter-spacing: -.01em; }
.vf-formats span { display: inline-flex; align-items: center; gap: 6px; }
.vf-formats .i { width: 14px; height: 14px; color: var(--ok); }
.vf-urlbtn { position: absolute; top: 26px; inset-inline-end: 26px; }
.vf-drop.is-url .vf-drop-ico, .vf-drop.is-url .vf-drop-t, .vf-drop.is-url .vf-drop-s, .vf-drop.is-url .vf-drop-acts, .vf-drop.is-url .vf-formats { display: none; }
.vf-drop.is-url .vf-drop-in { width: 100%; }
.vf-drop.is-url .vf-urlbtn { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.vf-url { display: flex; gap: 8px; width: min(560px, 100%); }
.vf-url .inp { flex: 1; }
.vf-url[hidden] + .vf-url-note { display: none; }
.vf-url-note { margin: 0; max-width: 560px; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.vf-results, .gif-result, .mp3-files { scroll-margin-top: calc(var(--hdr) + 16px); }
.vf-drop.is-url .vf-url-note { display: block; }
.vf .vf-body:empty { display: none; }
.vf:not([data-state="empty"]) .vf-drop { display: none; }
.vf-loading { min-height: 360px; display: flex; align-items: center; justify-content: center; gap: 14px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); color: var(--text-2); font-weight: 520; box-shadow: var(--shadow-3); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spin.sm { width: 14px; height: 14px; border-width: 2px; display: inline-block; vertical-align: -2px; }
.vf-error { min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 18px; padding: 40px 24px; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-3); }
.vf-error-art { width: 120px; height: 80px; color: var(--line-2); }
.vf-error-msg { max-width: 560px; color: var(--text); font-size: 1rem; margin: 0; }
.vf-noscript { margin-top: 18px; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.vf-noscript .ex-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.vf-noscript img { border-radius: 8px; width: 100%; height: auto; }

/* ready: one big card holding player + panel */
.vf-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 8px 8px 10px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.vf-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 10px; border-radius: 9px; background: var(--surface-2); color: var(--text-2); font-size: .8rem; font-weight: 520; white-space: nowrap; }
.vf-chip .num { font-size: .78rem; }
.vf-chip .i { width: 15px; height: 15px; color: var(--muted); }
.vf-name { max-width: 300px; background: transparent; padding-inline-start: 4px; color: var(--text); font-weight: 560; font-size: .86rem; }
.vf-name span { overflow: hidden; text-overflow: ellipsis; }
.vf-name .i { color: var(--accent-text); }
.vf-chip-hdr { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.vf-close { margin-inline-start: auto; }
.vf-work { display: grid; grid-template-columns: minmax(0, 1fr) 400px; grid-template-rows: 1fr auto; gap: 10px; align-items: stretch; }
.vf-panel > .vf-est { margin-top: auto; }
.vf-stage { grid-row: 1 / span 2; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 12px; min-width: 0; box-shadow: var(--shadow-2); }
.vf-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 14px; min-width: 0; box-shadow: var(--shadow-2); }
.vf-go { grid-column: 2; position: sticky; bottom: 12px; z-index: 5; }
.vf-go .btn { width: 100%; }
.vf-main.is-stop { --b-bg: var(--text); --b-fg: var(--bg); box-shadow: none; }
.vf-player { position: relative; width: 100%; max-height: 60vh; margin: 0 auto; background: #000; border-radius: 12px; overflow: hidden; display: grid; place-items: center; }
.vf-player video, .vf-player canvas { width: 100%; height: 100%; object-fit: contain; }
.vf-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.vf-flash.go { animation: flash .35s ease-out; }
.vf-ctrl { display: flex; align-items: center; gap: 2px; padding: 8px 0 2px; }
.vf-tc { margin-inline-start: 8px; font: 500 .84rem/1 var(--mono); color: var(--text); white-space: pre; letter-spacing: -.01em; }
.vf-tc b { color: var(--muted); font-weight: 500; }
.pop-wrap { position: relative; }
.pop { position: absolute; bottom: calc(100% + 6px); inset-inline-end: 0; z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-3); padding: 12px 14px; min-width: 250px; animation: pop .14s var(--ease); }
.vf-keys dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; font-size: .84rem; align-items: center; }
.vf-keys dt { white-space: nowrap; color: var(--muted); }
.vf-keys dd { margin: 0; color: var(--text-2); }

/* timeline */
.tl { position: relative; height: 60px; margin: 8px 4px 2px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: pointer; }
.tl-strip { position: absolute; inset: 4px 0; display: grid; grid-template-columns: repeat(var(--n, 10), 1fr); border-radius: 9px; overflow: hidden; background: var(--surface-2); }
.tl-strip canvas { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .25s; }
.tl-strip canvas.in { opacity: 1; }
.tl-strip canvas.wave { object-fit: fill; }
.tl-shade { position: absolute; top: 4px; bottom: 4px; background: color-mix(in srgb, var(--bg) 72%, transparent); pointer-events: none; }
.tl-shade-l { left: 0; border-radius: 9px 0 0 9px; }
.tl-shade-r { right: 0; border-radius: 0 9px 9px 0; }
.tl-sel { position: absolute; top: 0; bottom: 0; border: 2.5px solid var(--accent); border-inline-width: 0; border-radius: 4px; cursor: grab; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent); }
.tl.is-drag .tl-sel { cursor: grabbing; }
.tl-h { position: absolute; top: 0; bottom: 0; width: 14px; margin-left: -7px; background: var(--accent); border-radius: 6px; cursor: ew-resize; z-index: 2; display: grid; place-items: center; outline-offset: 3px; }
.tl-h::after { content: ""; width: 2px; height: 18px; border-radius: 2px; background: #fff; opacity: .75; }
.tl-h::before { content: ""; position: absolute; inset: 0 -15px; }
.tl-ph { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--text); border-radius: 2px; pointer-events: none; z-index: 3; box-shadow: 0 0 0 1px color-mix(in srgb, var(--bg) 60%, transparent); }
.tl-ph::before { content: ""; position: absolute; top: -3px; left: -5px; width: 12px; height: 8px; background: var(--text); clip-path: polygon(0 0, 100% 0, 50% 100%); }
.vf-range { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 0; }
.vf-time { display: flex; align-items: center; gap: 4px; }
.vf-time .inp { width: 120px; text-align: center; font-family: var(--mono); font-size: 14px; height: 38px; }
.vf-dur { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .8rem; }
.vf-dur .i { width: 14px; height: 14px; }


/* ---------- settings rows: label on the left, control on the right ---------- */
.vf-panel .field,
.vf-params .field,
.vf-dd .field,
.vf-out-body .field { display: grid; grid-template-columns: 112px minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 8px; }
.vf-panel .field > .field-l,
.vf-params .field > .field-l,
.vf-dd .field > .field-l,
.vf-out-body .field > .field-l { grid-column: 1; justify-content: flex-start; gap: 2px; }
.vf-panel .field > :not(.field-l),
.vf-params .field > :not(.field-l),
.vf-dd .field > :not(.field-l),
.vf-out-body .field > :not(.field-l) { grid-column: 2; }
.vf-panel .field:has(> .field-l output),
.vf-params .field:has(> .field-l output),
.vf-dd .field:has(> .field-l output),
.vf-out-body .field:has(> .field-l output) { grid-template-columns: 112px minmax(0, 1fr) auto; }
.vf-panel .field:has(> .field-l output) > .field-l,
.vf-params .field:has(> .field-l output) > .field-l,
.vf-dd .field:has(> .field-l output) > .field-l,
.vf-out-body .field:has(> .field-l output) > .field-l { display: contents; }
.vf-panel .field:has(> .field-l output) .lbl,
.vf-params .field:has(> .field-l output) .lbl,
.vf-dd .field:has(> .field-l output) .lbl,
.vf-out-body .field:has(> .field-l output) .lbl { grid-column: 1; grid-row: 1; }
.vf-panel .field:has(> .field-l output) > .range,
.vf-params .field:has(> .field-l output) > .range,
.vf-dd .field:has(> .field-l output) > .range,
.vf-out-body .field:has(> .field-l output) > .range { grid-column: 2; grid-row: 1; }
.vf-panel .field:has(> .field-l output) output,
.vf-params .field:has(> .field-l output) output,
.vf-dd .field:has(> .field-l output) output,
.vf-out-body .field:has(> .field-l output) output { grid-column: 3; grid-row: 1; min-width: 3.6em; text-align: end; }
.vf-panel .field > .seg,
.vf-params .field > .seg,
.vf-dd .field > .seg,
.vf-out-body .field > .seg { justify-self: start; max-width: 100%; }
.vf-panel .field > .row,
.vf-params .field > .row,
.vf-dd .field > .row,
.vf-out-body .field > .row { min-width: 0; }
.vf-panel .seg-b, .vf-out-body .seg-b, .vf-dd .seg-b { padding: 0 10px; }
@media (max-width: 480px) {
  .vf-panel .field:not(:has(> .field-l output)),
  .vf-params .field:not(:has(> .field-l output)),
  .vf-dd .field:not(:has(> .field-l output)),
  .vf-out-body .field:not(:has(> .field-l output)) { grid-template-columns: minmax(0, 1fr); }
  .vf-panel .field:not(:has(> .field-l output)) > :not(.field-l),
  .vf-params .field:not(:has(> .field-l output)) > :not(.field-l),
  .vf-dd .field:not(:has(> .field-l output)) > :not(.field-l),
  .vf-out-body .field:not(:has(> .field-l output)) > :not(.field-l) { grid-column: 1; }
}

/* panel */
.panel-sec { display: flex; flex-direction: column; gap: 10px; }
.panel-sec + .panel-sec { padding-top: 14px; border-top: 1px solid var(--line); }
.vf-modes { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; }
.vf-modes .mode { grid-column: span 3; }
.vf-modes .mode:nth-child(n+5) { grid-column: span 4; }
.mode { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 62px; padding: 8px 4px; border-radius: 12px; border: 1px solid transparent; background: var(--surface-2); color: var(--text-2); font: 560 .76rem/1.15 var(--font); cursor: pointer; text-align: center; hyphens: auto; overflow-wrap: anywhere; transition: border-color .15s, background-color .15s, color .15s; }
.mode .i { width: 20px; height: 20px; }
@media (hover: hover) { .mode:hover:not(:disabled) { background: var(--surface-3); color: var(--text); } }
.mode[aria-checked="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent-text); }
.mode:disabled { opacity: .38; cursor: not-allowed; }
.vf-params, .vf-dd { display: flex; flex-direction: column; gap: 10px; }
.vf-dd { padding-top: 12px; border-top: 1px solid var(--line); }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-l { font-size: .8rem; font-weight: 560; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.field-l .lbl { display: inline-flex; align-items: center; gap: 6px; }
.field-l .lbl .i { width: 15px; height: 15px; color: var(--muted); }
.field-l output { color: var(--accent-text); font-family: var(--mono); font-size: .8rem; }
.inp { height: 42px; padding: 0 12px; border-radius: var(--r-sm); border: 1px solid var(--line-2); background: var(--surface); color: var(--text); font: 500 16px/1 var(--font); width: 100%; min-width: 0; transition: border-color .15s, box-shadow .15s; }
.inp:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.inp.is-bad { border-color: var(--err); animation: shake .3s; }
.inp.mono { font-family: var(--mono); font-size: 14px; }
.inp.color { padding: 4px; width: 56px; cursor: pointer; }
.inp-unit { position: relative; display: flex; align-items: center; flex: 1; }
.inp-unit .inp { padding-inline-end: 44px; font-family: var(--mono); font-size: 15px; }
.inp-unit .unit { position: absolute; inset-inline-end: 12px; color: var(--muted); font-size: .8rem; font-family: var(--mono); pointer-events: none; }
.inp-ico { display: flex; align-items: center; gap: 8px; }
.inp-ico > .i { color: var(--muted); }
input[type="number"]::-webkit-inner-spin-button { opacity: .35; }
.presets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stepper { display: inline-flex; align-items: center; gap: 1px; height: 32px; padding: 0 10px 0 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); flex: none; }
.stepper .inp { width: 3.4em; height: 28px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: center; font-size: 13px; }
.stepper .inp:focus { border-color: transparent; box-shadow: none; }
.stepper:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.stepper .unit { color: var(--muted); font: 560 .72rem/1 var(--mono); }
.stepper.on { background: var(--accent-soft); border-color: var(--accent-line); }
.stepper.on .inp, .stepper.on .unit { color: var(--accent-text); }
.vf-params .stepper input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.vf-params .stepper input[type="number"]::-webkit-inner-spin-button,
.vf-params .stepper input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.vf-params .field > .stepper { justify-self: start; }
.vf-params .field.tune { grid-template-columns: 112px minmax(0, 1fr); align-items: center; column-gap: 12px; }
.vf-params .field.tune > .field-l { grid-column: 1; min-height: 0; }
.vf-params .field.tune > .presets { grid-column: 2; justify-self: stretch; min-width: 0; width: 100%; }
.vf-params .pill { min-height: 28px; padding: 0 9px; }
.vf-params .stepper { height: 28px; }
@media (max-width: 480px) {
  .vf-params .field.tune { grid-template-columns: minmax(0, 1fr); }
  .vf-params .field.tune > .presets { grid-column: 1; }
}
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
.range::-moz-range-track { height: 4px; border-radius: 4px; background: var(--surface-3); }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .25), 0 0 0 5px color-mix(in srgb, var(--accent) 30%, transparent); }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12), 0 2px 6px rgba(0, 0, 0, .25); }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 30px; font-size: .88rem; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw { width: 36px; height: 22px; border-radius: 11px; background: var(--surface-3); position: relative; transition: background-color .15s; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s var(--ease); }
.switch input:checked + .sw { background: var(--accent); }
.switch input:checked + .sw::after { transform: translateX(14px); }
.switch input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.switch-l { font-weight: 540; color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.switch-l .i { width: 16px; height: 16px; color: var(--muted); }
.switch .tip { margin-inline-start: -4px; }
.hint { display: flex; gap: 8px; align-items: flex-start; font-size: .82rem; color: var(--muted); margin: 0; line-height: 1.45; }
.hint .i { width: 15px; height: 15px; margin-top: 2px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 11px; background: var(--surface-2); flex-wrap: wrap; }
.seg-b { min-height: 32px; padding: 0 12px; border-radius: 8px; border: 0; background: transparent; color: var(--text-2); font: 540 .82rem/1 var(--font); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg-b .i { width: 16px; height: 16px; }
.seg-b.on { background: var(--seg-on); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .1), 0 0 0 1px rgba(0, 0, 0, .03); }
.seg-b:disabled { opacity: .4; cursor: not-allowed; }
.field > .seg, .row > .seg { align-self: flex-start; }
.vf-out { border-top: 1px solid var(--line); padding-top: 10px; }
.vf-out summary { list-style: none; display: flex; align-items: center; gap: 10px; min-height: 38px; cursor: pointer; font-weight: 560; font-size: .86rem; color: var(--text); border-radius: var(--r-sm); }
.vf-out summary::-webkit-details-marker { display: none; }
.vf-out summary > .i:first-child { color: var(--muted); }
.vf-out .chev { margin-inline-start: auto; width: 16px; height: 16px; color: var(--muted); transition: transform .2s var(--ease); }
.vf-out[open] .chev { transform: rotate(180deg); }
.vf-out-sum { white-space: pre; font-family: var(--mono); font-size: .8rem; color: var(--text-2); }
.vf-out-body { display: flex; flex-direction: column; gap: 12px; padding: 10px 0 2px; }
.out-dims, .out-ex { margin: 0; font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: 6px; overflow-wrap: anywhere; font-family: var(--mono); }
.out-ex .i { width: 14px; height: 14px; }
.vf-est { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); min-height: 44px; }
.vf-est:empty { display: none; }
.est-i { display: inline-flex; align-items: center; gap: 7px; font-size: .9rem; }
.est-i .i { width: 16px; height: 16px; color: var(--muted); }
.est-i b { font-weight: 600; font-family: var(--mono); font-size: .86rem; }
.est-err { display: flex; gap: 8px; align-items: center; margin: 0; color: var(--err); font-size: .86rem; font-weight: 520; }
.vf-warn { display: flex; gap: 10px; padding: 12px; border-radius: 12px; background: var(--warn-bg); border: 1px solid var(--warn-line); color: var(--warn-text); font-size: .86rem; }
.vf-warn p { margin: 0 0 8px; }
.vf-warn .btn { --b-bg: var(--surface); }
.vf-prog { display: flex; flex-direction: column; gap: 8px; }
.bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 50%, var(--accent-2))); border-radius: 6px; transition: width .2s linear; }
.vf-prog-txt { font-size: .82rem; color: var(--text-2); }

/* results */
.vf-results { margin-top: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); }
.vf-rhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.vf-rtitle { font-size: 1.06rem; font-weight: 620; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 8px; }
.vf-rcount { color: var(--muted); font-weight: 500; font-size: .86rem; }
.vf-rtools { display: flex; align-items: center; gap: 2px; }
.vf-selcount { font-size: .8rem; color: var(--accent-text); font-weight: 600; margin-inline-end: 6px; font-family: var(--mono); }
.vf-zoom { display: inline-flex; align-items: center; gap: 6px; margin-inline-start: 8px; color: var(--muted); }
.vf-zoom .i { width: 17px; height: 17px; }
.vf-zoom input { width: 100px; -webkit-appearance: none; appearance: none; height: 24px; background: transparent; }
.vf-zoom input::-webkit-slider-runnable-track { height: 4px; border-radius: 3px; background: var(--surface-3); }
.vf-zoom input::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--text-2); }
.vf-zoom input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--text-2); border: 0; }
.vf-export { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 0; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.vf-export .sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.vf-note { display: flex; gap: 8px; font-size: .82rem; color: var(--muted); margin: -4px 0 12px; }
.vf-grid { position: relative; min-height: 120px; }
.vf-grid .cell { position: absolute; top: 0; left: 0; outline-offset: 3px; border-radius: 12px; }
.cell-img { position: relative; border-radius: 10px; overflow: hidden; background: var(--surface-2); cursor: pointer; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .12s, transform .12s; }
.cell-img img { width: 100%; height: 100%; object-fit: cover; }
.cell.is-sel .cell-img { box-shadow: 0 0 0 2.5px var(--accent); }
.ck { position: absolute; top: 6px; inset-inline-start: 6px; width: 28px; height: 28px; display: grid; place-items: center; cursor: pointer; }
.ck input { position: absolute; opacity: 0; }
.ck span { width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid rgba(255, 255, 255, .9); background: rgba(0, 0, 0, .3); display: grid; place-items: center; color: transparent; opacity: 0; transition: opacity .12s; backdrop-filter: blur(4px); }
.ck .i { width: 14px; height: 14px; stroke-width: 3; }
.cell.is-sel .ck span { background: var(--accent); border-color: var(--accent); color: #fff; opacity: 1; }
.cell-acts { position: absolute; bottom: 6px; inset-inline-end: 6px; display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: 4px; max-width: calc(100% - 12px); opacity: 0; transition: opacity .12s; }
.cell-acts .icon-btn { background: rgba(10, 10, 14, .62); color: #fff; backdrop-filter: blur(6px); }
@media (hover: hover) {
  .cell:hover .ck span, .cell:focus-within .ck span, .vf-grid:has(.is-sel) .ck span { opacity: 1; }
  .cell:hover .cell-acts, .cell:focus-within .cell-acts { opacity: 1; }
  .cell-acts .icon-btn:hover { background: var(--accent); color: #fff; }
  .cell-acts .icon-btn[data-c="rm"]:hover { background: var(--err); color: #fff; }
}
@media (hover: none) { .ck span { opacity: 1; } .cell-acts { opacity: 1; } .cell-acts [data-c="copy"] { display: none; } }
.cell-meta { display: flex; justify-content: space-between; gap: 6px; font: 500 .72rem/1 var(--mono); color: var(--muted); padding: 7px 2px 0; white-space: nowrap; overflow: hidden; }
.vf-empty { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--muted); padding: 30px; text-align: center; }
.vf-empty .i { width: 32px; height: 32px; }

@media (max-width: 960px) {
  .vf-work { grid-template-columns: minmax(0, 1fr); }
  .vf-stage { grid-row: auto; padding: 8px; }
  .vf-go { grid-column: 1; bottom: 0; margin-inline: calc(-1 * var(--gut)); padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
  .vf-modes .mode, .vf-modes .mode:nth-child(n+5) { grid-column: auto; }
  .vf-modes { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78px; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; scrollbar-width: none; margin-inline: -4px; padding-inline: 4px; }
  .vf-modes::-webkit-scrollbar { display: none; }
  .mode { scroll-snap-align: start; }
  .vf-name { max-width: 100%; flex: 1 1 100%; }
  .vf-info { position: relative; padding-inline-end: 48px; }
  .vf-close { position: absolute; top: 4px; inset-inline-end: 4px; }
  .vf-player { max-height: 46vh; }
}
@media (max-width: 520px) {
  .vf { margin-top: 28px; }
  .vf-drop { min-height: 320px; padding: 44px 18px; }
  .vf-urlbtn { top: 20px; inset-inline-end: 20px; }
  .vf-range { gap: 6px; }
  .vf-time { flex: 1 1 0; min-width: 0; gap: 2px; }
  .vf-time .inp { width: auto; flex: 1 1 auto; min-width: 0; padding: 0 4px; }
  .vf-time .icon-btn.sm { width: 34px; height: 38px; }
  .vf-dur { display: none; }
  .vf-ctrl .pop-wrap { display: none; }
  .vf-zoom { display: none; }
  .vf-results { padding: 10px; margin-inline: calc(-1 * var(--gut) + 6px); }
}

/* lightbox & dialogs */
dialog { color: var(--text); }
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(4px); }
.lb { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgba(6, 6, 9, .95); color: #f4f4f5; }
.lb-top { display: flex; align-items: center; gap: 4px; padding: 10px 12px; }
.lb-top .icon-btn { color: #e4e4e7; }
@media (hover: hover) { .lb-top .icon-btn:hover, .lb-nav:hover { background: rgba(255, 255, 255, .1); color: #fff; } }
.lb-cap { font: 500 .82rem/1.3 var(--mono); color: #c8c8cf; padding-inline-start: 8px; white-space: pre; overflow: hidden; text-overflow: ellipsis; }
.lb-stage { position: relative; height: calc(100% - 64px); display: grid; place-items: center; padding: 0 64px 24px; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); color: #fff; background: rgba(255, 255, 255, .06); }
.lb-prev { left: 10px; } .lb-next { right: 10px; }
@media (max-width: 600px) { .lb-stage { padding: 0 8px 70px; } .lb-nav { top: auto; bottom: 12px; transform: none; } .lb-prev { left: calc(50% - 56px); } .lb-next { right: calc(50% - 56px); } }
.dlg { border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow-3); }
.dlg-in { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.dlg-head { display: flex; align-items: center; justify-content: space-between; margin: -6px -8px 0 0; }
.dlg-head h3 { font-size: 1.08rem; }
.dlg-acts { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.dlg.ask p { margin: 0; font-size: .98rem; }
.sheet { width: min(980px, calc(100vw - 24px)); }
.sheet-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; align-items: end; }
.sheet-prev { max-height: 46vh; overflow: auto; border-radius: var(--r); background: var(--surface-2); padding: 10px; display: grid; place-items: center; }
.sheet-prev canvas { max-width: 100%; height: auto; border-radius: 4px; }
.sheet-info { margin: 0; font: .8rem var(--mono); color: var(--muted); }
.share-row { display: flex; gap: 8px; }
.share-apps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 6px; }
.share-app { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 6px 2px; border: 0; background: none; border-radius: var(--r); color: var(--text-2); font: 500 .76rem var(--font); cursor: pointer; text-decoration: none !important; }
.share-app .b { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; transition: transform .16s var(--ease), box-shadow .16s; }
.share-app .b.copy { background: var(--surface-2); border: 1px solid var(--line); color: var(--text); }
.share-app .b.copy .i { width: 20px; height: 20px; }
@media (hover: hover) { .share-app:hover .b { transform: translateY(-2px); box-shadow: var(--shadow-2); } .share-app:hover { color: var(--text); } }
.share-app:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.share-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); z-index: 90; max-width: min(560px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 12px; background: var(--text); color: var(--bg); font-size: .88rem; font-weight: 520; box-shadow: var(--shadow-3); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body[data-tool="ready"] .toast, body[data-tool="extracting"] .toast, body[data-tool="done"] .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
@media (min-width: 961px) { body[data-tool] .toast { bottom: 24px; } }

/* tool-page specifics */
.crop { position: absolute; inset: 0; touch-action: none; }
.crop-box { position: absolute; border: 2px solid var(--accent); box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); cursor: move; }
.crop-h { position: absolute; width: 16px; height: 16px; background: #fff; border: 2px solid var(--accent); border-radius: 50%; }
.crop-h::after { content: ""; position: absolute; inset: -12px; }
.crop-h[data-h="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.crop-h[data-h="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.crop-h[data-h="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.crop-h[data-h="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.gif-out { display: grid; place-items: center; padding: 16px; margin-top: 12px; border-radius: var(--r); background: repeating-conic-gradient(var(--surface-2) 0 25%, var(--surface) 0 50%) 0 0 / 20px 20px; }
.gif-out img { max-width: 100%; height: auto; border-radius: 6px; }
.gif-meta { font: .8rem var(--mono); color: var(--muted); }
.gif-result .vf-export { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.mp3-player { background: #000; aspect-ratio: 16 / 9; }
.mp3-player > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.mp3-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 56px 24px 24px; color: rgba(255,255,255,.75); text-align: center; }
.mp3-msg .i { width: 44px; height: 44px; }
.mp3-msg p { margin: 0; max-width: 34ch; font-size: .9rem; }
.mp3-msg.is-err { color: #ffb4b4; background: #14101a; }
.mp3-track select { height: 38px; font-size: 14px; width: auto; max-width: 260px; }
.mp3-files { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: thin; }
.mp3-row { flex: none; display: flex; align-items: center; gap: 4px; max-width: 260px; padding: 2px 4px 2px 2px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.mp3-row.on { border-color: var(--accent-line); background: var(--accent-soft); }
.mp3-row.err { border-color: var(--err); }
.mp3-pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 8px; border: 0; background: none; color: var(--text); font: 540 .84rem/1.2 var(--font); text-align: start; cursor: pointer; border-radius: 999px; }
.mp3-pick .i { color: var(--accent-text); width: 16px; height: 16px; flex: none; }
.mp3-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp3-st { display: inline-flex; align-items: center; gap: 5px; font: .74rem var(--mono); color: var(--muted); white-space: nowrap; }
.mp3-st .i { width: 14px; height: 14px; }
.mp3-st.ok { color: var(--ok); } .mp3-st.no { color: var(--err); }
.mp3-export { margin-top: 12px; border: 0; }
.img-player { background: var(--surface-2) repeating-conic-gradient(rgba(127,127,127,.12) 0 25%, transparent 0 50%) 0 0 / 18px 18px; aspect-ratio: 4 / 3; }
.img-player.multi { aspect-ratio: auto; height: clamp(240px, 52vh, 420px); }
.img-body { position: absolute; inset: 0; }
.img-big { width: 100%; height: 100%; object-fit: contain; display: block; }
.img-spin { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); }
.img-tiles { height: 100%; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; padding: 10px; align-content: start; background: var(--surface); }
.img-tile { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; color: var(--muted); }
.img-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-tile.err { outline: 2px solid var(--err); outline-offset: -2px; }
.img-tile-n { position: absolute; inset-inline: 0; bottom: 0; padding: 14px 8px 5px; font: 560 .72rem/1.2 var(--font); color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-tile-x { position: absolute; top: 5px; inset-inline-end: 5px; width: 28px; height: 28px; border-radius: 50%; background: rgba(12,12,18,.6); color: #fff; }
.img-tile-x .i { width: 15px; height: 15px; }
.img-tile .tile-err { padding: 8px; font-size: .72rem; text-align: center; color: var(--err); }
.vf-ctrl .img-count { font: 560 .84rem var(--font); color: var(--text-2); }
.img-result .vf-rbox { max-width: 1040px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; padding-top: 12px; }
.img-card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.img-card-th { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2) repeating-conic-gradient(rgba(127,127,127,.12) 0 25%, transparent 0 50%) 0 0 / 16px 16px; display: grid; place-items: center; color: var(--muted); }
.img-card-th img { width: 100%; height: 100%; object-fit: contain; display: block; }
.img-card.sk .img-card-th { background: var(--surface-2); animation: imgpulse 1.2s ease-in-out infinite; }
@keyframes imgpulse { 50% { opacity: .55; } }
.img-card-b { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 10px 10px 8px; min-width: 0; }
.img-name { font-weight: 560; font-size: .86rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.img-size { font: .76rem var(--mono); color: var(--muted); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.img-size b { color: var(--text); font-weight: 600; }
.img-tags { display: flex; flex-wrap: wrap; gap: 4px; min-height: 0; }
.img-acts { display: flex; gap: 2px; justify-content: flex-end; padding: 0 6px 6px; }
.img-acts .icon-btn.sm { width: 34px; height: 34px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .7rem; font-weight: 600; padding: 2px 8px; border-radius: var(--pill); background: var(--surface-2); color: var(--text-2); }
.tag .i { width: 12px; height: 12px; }
.ok { color: var(--ok); font-weight: 600; }
.no { color: var(--err); font-weight: 600; }
.cmp-box { position: relative; max-width: 100%; max-height: 100%; width: min(100%, 1200px); }
.cmp-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.cmp-box::after { content: ""; position: absolute; top: 0; bottom: 0; left: var(--x, 50%); width: 2px; background: var(--accent); pointer-events: none; }
.cmp-r { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.cmp-l { position: absolute; top: 10px; left: 10px; font-size: .74rem; font-weight: 600; padding: 4px 10px; border-radius: var(--pill); background: rgba(0, 0, 0, .6); color: #fff; pointer-events: none; }
.cmp-l.r { left: auto; right: 10px; }
@media (max-width: 640px) { .img-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } .img-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- illustrations (inline SVG, see include/art.inc.php) ---------- */
.art { width: 100%; height: auto; display: block; }
.art .art-bg { fill: var(--art-bg); }
.art .art-panel { fill: var(--art-panel); }
.art .art-card { fill: var(--art-card); }
.art .art-line-f { fill: var(--art-line); }
.art .art-line-s { stroke: var(--art-line); }
.art .art-drop { stroke: var(--art-line); }
.art .art-acc { fill: var(--accent); }
.art .art-acc2 { fill: var(--accent-2); }
.art .art-acc-s { stroke: var(--accent); }
.art .art-soft { fill: var(--accent-soft); }
.art .art-ink-f { fill: var(--art-ink); }
.art .art-cap { fill: var(--muted); font: 600 11px var(--mono); }
.art .art-badge { fill: #fff; font: 700 12px var(--mono); }
.art .art-tc { fill: #fff; font: 600 10px var(--mono); }
.art .art-g1 { stop-color: var(--art-g1); }
.art .art-g2 { stop-color: var(--art-g2); }
.art-step .art-cap { font-size: 12px; }

/* ---------- sections ---------- */
.sec { padding: 96px 0; }
.feat-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.feat-grid > li { margin: 0; min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "i t" "d d"; column-gap: 14px; row-gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 18px 16px; }
.feat-grid > li + li { margin-top: 0; }
.feat-grid h3 { grid-area: t; margin: 0; font-size: 1.05rem; line-height: 1.3; }
.feat-grid .feat-i { grid-area: i; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-text); }
.feat-grid .feat-i .i { width: 22px; height: 22px; }
.feat-grid p { grid-area: d; margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55; }
@media (max-width: 800px) { .feat-grid { grid-template-columns: 1fr; } }
@media (max-width: 900px) { .sec { padding: 64px 0; } }
@media (max-width: 600px) { .sec { padding: 48px 0; } }
.sec-tight { padding: 64px 0; }
.sec-alt { background: var(--bg-alt); border-block: 1px solid var(--line); }
.sec-head { margin: 0 0 40px; }
.sec-head p { width: fit-content; max-width: 100%; margin: 14px auto 0; text-align: center; color: var(--intro); font-size: 1.06rem; line-height: 1.6; }
.sec-head.center { margin-inline: auto; text-align: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; font: 600 .74rem/1 var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--accent-text); }
.eyebrow .i { width: 15px; height: 15px; }
.prose { max-width: var(--main); }
.prose h2 { margin: 2.2em 0 .6em; font-size: clamp(1.4rem, 1.2rem + .8vw, 1.8rem); }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.8em 0 .5em; }
.prose p, .prose li { color: var(--text-2); }
.prose a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); }
.prose img { border-radius: var(--r); height: auto; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { font-size: .84rem; color: var(--muted); margin-top: 8px; }
.prose > section { margin-top: 3em; }
.prose > section:first-child { margin-top: 0; }
.answer { position: relative; max-width: 860px; margin: 28px auto 0; padding: 18px 22px 18px 54px; border-radius: var(--r-lg); background: color-mix(in srgb, var(--surface) 70%, transparent); border: 1px solid var(--line); font-size: 1rem; line-height: 1.65; color: var(--text-2); text-align: start; }
.answer::before { content: ""; position: absolute; left: 20px; top: 21px; width: 18px; height: 18px; border-radius: 6px; background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237262ff' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 7v6M12 17h.01'/%3E%3C/svg%3E") center / 14px no-repeat; }
.answer p { margin: 0; }
.answer strong { color: var(--text); }
.direct { max-width: 42em; margin: 0 0 28px; padding-inline-start: 16px; border-inline-start: 3px solid var(--accent); color: var(--text-2); font-size: 1.05rem; line-height: 1.75; text-align: start; }
.direct p { margin: 0; }
.direct strong { color: var(--text); }
.direct + .prose > section:first-child > h2, .prose > section:first-child > h2 { margin-top: 0; }
.prose > .direct + h2 { margin-top: 1.15em; }

/* cards */
.card { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none !important; transition: border-color .2s var(--ease), transform .2s var(--ease), box-shadow .2s var(--ease); }
@media (hover: hover) { a.card:hover, button.card:hover { border-color: var(--accent-line); transform: translateY(-2px); box-shadow: var(--shadow-2); } }
.card .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); margin-bottom: 6px; }
.card .ico .i { width: 21px; height: 21px; }
.card h3 { font-size: 1.02rem; }
.card p { color: var(--muted); font-size: .9rem; margin: 0; line-height: 1.55; }
.card .go { margin-top: auto; padding-top: 8px; font-size: .84rem; font-weight: 560; color: var(--accent-text); display: inline-flex; align-items: center; gap: 4px; }
.card .go .i { width: 15px; height: 15px; transition: transform .2s var(--ease); }
@media (hover: hover) { a.card:hover .go .i { transform: translateX(3px); } }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.card-art { padding: 0; overflow: hidden; gap: 0; }
.card-art .art { border-radius: 0; }
.card-art .card-b { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-art .art-wrap { padding: 10px 10px 0; }
.card-art .art-wrap .art { border-radius: 12px; }
.modes-grid { display: grid; gap: 16px; grid-template-columns: repeat(4, 1fr); counter-reset: mode; }
.modes-grid > a.card { counter-increment: mode; }
.modes-grid .card-b h3 { display: flex; align-items: center; gap: 8px; }
.mode-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; flex: none; background: var(--accent); color: var(--on-accent); font: 650 .84rem/1 var(--font); box-shadow: 0 6px 14px -8px var(--accent); }
.mode-n::before { content: counter(mode); }

@media (max-width: 1100px) { .modes-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .modes-grid { grid-template-columns: 1fr; } }
.flow { position: relative; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 28px; counter-reset: flow; }
.flow::before { content: ""; position: absolute; z-index: 0; top: 28px; left: calc(100% / 6); right: calc(100% / 6); height: 1px; background: var(--accent-line); }
.flow > .flow-step { counter-increment: flow; position: relative; z-index: 1; margin: 0; text-align: center; }
.flow-k { display: grid; place-items: center; width: 56px; height: 56px; margin: 0 auto; border-radius: 50%; background: var(--accent); color: var(--on-accent); font: 650 1.4rem/1 var(--font); }
.flow-k::before { content: counter(flow); }
.flow-step h3 { margin: 14px 0 0; font-size: 1.28rem; font-weight: 650; letter-spacing: -.025em; }
.flow-art { margin: 16px auto 12px; width: min(100%, 280px); }
.flow-art .art { width: 100%; height: auto; border-radius: 14px; box-shadow: 0 12px 28px -20px rgba(18, 18, 40, .45); }
.flow-step p { width: fit-content; max-width: 34ch; margin: 0 auto; text-align: start; color: var(--muted); font-size: .84rem; line-height: 1.45; }
@media (max-width: 800px) {
  .flow { grid-template-columns: 1fr; gap: 28px; max-width: 460px; margin-inline: auto; }
  .flow::before { display: none; }
  .flow > .flow-step { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 14px; row-gap: 8px; text-align: start; align-items: center; }
  .flow-k { grid-column: 1; grid-row: 1; margin: 0; }
  .flow-step h3 { grid-column: 2; grid-row: 1; margin: 0; }
  .flow-art, .flow-step p { grid-column: 1 / -1; }
  .flow-art { width: 100%; margin: 4px 0 0; }
  .flow-step p { margin: 0; max-width: none; }
}
.uses-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
.uses-grid .card { cursor: default; }
@media (max-width: 1000px) { .uses-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .uses-grid { grid-template-columns: 1fr; } }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.steps > li { counter-increment: s; position: relative; margin: 0; padding: 2px 0 30px 72px; min-height: 52px; }
.steps > li:last-child { padding-bottom: 2px; }
.steps > li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: var(--on-accent); font: 700 1.3rem/1 var(--font); background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 80%, #fff), var(--accent)); box-shadow: 0 8px 20px -8px var(--accent), 0 0 0 5px var(--accent-soft); z-index: 1; }
.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 25px; top: 58px; bottom: 6px; width: 2px; border-radius: 2px; background: linear-gradient(var(--accent-line), transparent); }
.steps > li > b { display: block; font-size: 1.1rem; letter-spacing: -.015em; margin: 6px 0 4px; }
.steps > li p { margin: 0; color: var(--text-2); }

.math-block { max-width: 920px; margin-inline: auto; }
.math-block .sec-head { max-width: none; }
.math-note { width: fit-content; max-width: 100%; margin: 0 auto 28px; text-align: start; color: var(--muted); font-size: .94rem; }
.eq { display: flex; flex-direction: column; gap: 8px; padding: 24px; margin: 0 0 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); }
.eq.math-eq { max-width: none; margin: 0 0 20px; }
.eq-f { font: 600 clamp(1.1rem, .98rem + .7vw, 1.42rem)/1.3 var(--mono); letter-spacing: -.02em; color: var(--text); }
.eq-f var { font-style: normal; color: var(--accent-text); }
.eq-n { font-size: .88rem; color: var(--muted); margin: 0; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); margin: 0 0 1.4em; box-shadow: var(--shadow-1); }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: 11px 14px; text-align: start; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; color: var(--text); background: var(--surface-2); white-space: nowrap; font-size: .82rem; }
td { color: var(--text-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: end; font-size: .84rem; }

.methods { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.method { padding: 22px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.method h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 1.02rem; }
.method h3 .i { color: var(--accent-text); }
.method p, .method li { color: var(--text-2); font-size: .92rem; }
.method p:last-child, .method ul:last-child, .method ol:last-child, .method pre:last-child { margin-bottom: 0; }
.methods-after { max-width: 860px; margin-top: 28px; }
.methods-after h3 { margin: 1.4em 0 .5em; }

.faq-wrap { max-width: 860px; }
.faq-wrap .sec-head { margin-bottom: 36px; }
.faq { display: grid; gap: 10px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); transition: border-color .45s cubic-bezier(.16, 1, .3, 1), box-shadow .45s cubic-bezier(.16, 1, .3, 1); }
@media (hover: hover) { .faq details:hover { border-color: var(--line-2); } }
.faq details[open] { border-color: var(--accent-line); box-shadow: var(--shadow-1); }
.faq.is-ready details[open] { border-color: var(--line); box-shadow: none; }
.faq.is-ready details.is-open { border-color: var(--accent-line); box-shadow: var(--shadow-1); }
.faq summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 22px; cursor: pointer; border-radius: var(--r-lg); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary h3 { font-size: 1rem; font-weight: 580; }
.faq summary .i { width: 18px; height: 18px; color: var(--muted); transition: transform .62s cubic-bezier(.22, 1, .36, 1), color .25s var(--ease); flex: none; }
.faq details[open] summary .i { transform: rotate(45deg); color: var(--accent-text); }
.faq.is-ready details[open] summary .i { transform: none; color: var(--muted); }
.faq.is-ready details.is-open summary .i { transform: rotate(45deg); color: var(--accent-text); }
.faq .a { overflow: hidden; }
.faq .a-in { padding: 0 22px 20px; color: var(--text-2); max-width: 720px; }
.faq .a-in p:last-child { margin: 0; }
@media (prefers-reduced-motion: reduce) {
  .faq summary .i { transition: none; }
}
.faq-aside { margin-top: 28px; }

.ai-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 8px; padding: 12px 14px; margin: 32px 0 0; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.ai-bar > span { font-size: .86rem; font-weight: 580; color: var(--text); display: inline-flex; align-items: center; gap: 8px; margin-inline-end: 6px; }
.ai-bar > span .i { color: var(--accent-text); width: 18px; height: 18px; }
.ai-bar .pill { background: var(--chip); border-color: transparent; color: var(--text); }
@media (hover: hover) { .ai-bar .pill:hover { background: var(--chip-h); } }
.ai-bar .pill:active { background: var(--chip-a); }
.side-ai { margin: 0; padding: 0; border: 0; background: none; } .side-ai > span { display: none; }

.trust { display: flex; gap: 16px; align-items: flex-start; padding: 22px 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.trust .ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); flex: none; }
.trust p { margin: 0; color: var(--text-2); font-size: .94rem; }

/* tool pages & articles with sidebar */
.cols { display: grid; grid-template-columns: minmax(0, var(--main)) var(--side); gap: 56px; justify-content: space-between; }
.side { display: flex; flex-direction: column; gap: 16px; }
.side-sticky { position: sticky; top: calc(var(--hdr) + 20px); display: flex; flex-direction: column; gap: 16px; }
.side-card { padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.side-card h3 { font-size: .8rem; margin-bottom: 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.side-card ul { list-style: none; padding: 0; margin: 0; }
.side-card li { margin: 0; }
.side-card a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--r-sm); color: var(--text); font-size: .9rem; font-weight: 520; text-decoration: none !important; }
.side-card a .i { color: var(--accent-text); width: 17px; height: 17px; }
@media (hover: hover) { .side-card a:hover { background: var(--surface-2); } }
.side-toc ol { list-style: none; padding: 0; margin: 0; border-inline-start: 1px solid var(--line); }
.side-toc li { margin: 0; }
.side-toc a { display: block; border-radius: 0 !important; padding: 6px 12px; margin-inline-start: -1px; border-inline-start: 2px solid transparent; color: var(--muted); font-size: .86rem; line-height: 1.4; text-decoration: none !important; }
@media (hover: hover) { .side-toc a:hover { color: var(--text); } }
.side-toc a.on { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
@media (max-width: 1080px) { .cols { grid-template-columns: minmax(0, 1fr); } .side { display: none; } }
.howto-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; align-items: center; }
.howto-grid .art { border-radius: var(--r-xl); box-shadow: var(--shadow-2); border: 1px solid var(--line); }
@media (max-width: 900px) { .howto-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; } }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .86rem; margin-top: 16px; }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta .i { width: 15px; height: 15px; }
.art-head { padding: 26px 0 0; max-width: var(--main); }
.art-head h1 { font-size: clamp(1.9rem, 1.35rem + 1.85vw, 2.7rem); }
.art-cover { margin-top: 28px; max-width: var(--main); }
.art-cover .art { border-radius: var(--r-xl); box-shadow: var(--shadow-2); }
.callout { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); margin: 0 0 1.6em; color: var(--text-2); font-size: .9rem; }
.callout .i { color: var(--accent-text); flex: none; margin-top: 2px; }
.callout p { margin: 0; color: var(--text-2); }
.related { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(240px, 100%), 1fr)); }

/* hubs */
.post-list { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.post { display: flex; flex-direction: column; border-radius: var(--r-xl); border: 1px solid var(--line); background: var(--surface); color: var(--text); overflow: hidden; text-decoration: none !important; transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s; }
@media (hover: hover) { .post:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); border-color: var(--accent-line); } }
.post .art { border-radius: 0; }
.post-b { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 8px; }
.post h2 { font-size: 1.2rem; letter-spacing: -.025em; }
.post p { margin: 0; color: var(--muted); font-size: .92rem; }
.post time { color: var(--muted); font: .78rem var(--mono); }
.page-head { padding: 26px 0 0; max-width: var(--main); }
.page-head .lede { color: var(--intro); font-size: 1rem; margin-top: 14px; text-align: start; }
.page-head h1 { font-size: clamp(1.9rem, 1.35rem + 1.85vw, 2.7rem); }

/* ---------- footer ---------- */
.ftr { margin-top: 40px; border-top: 1px solid var(--line); background: var(--bg-alt); padding: 56px 0 calc(28px + env(safe-area-inset-bottom)); font-size: .9rem; }
.ftr-grid { display: flex; align-items: flex-start; gap: 56px; }
.ftr-about { flex: 0 1 360px; }
.ftr-links { flex: 1 1 auto; display: flex; justify-content: space-between; gap: 32px; min-width: 0; padding-inline-end: 56px; }
.ftr h2 { font-size: .74rem; font-weight: 600; color: var(--muted); margin-bottom: 14px; letter-spacing: .05em; text-transform: uppercase; }
.ftr ul { list-style: none; padding: 0; margin: 0; }
.ftr li { margin: 0 0 9px; }
.ftr a { color: var(--text-2); }
@media (hover: hover) { .ftr a:hover { color: var(--text); text-decoration: none; } }
.ftr-about p { color: var(--muted); max-width: 30em; margin: 14px 0 18px; }
.ftr-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ftr-chips .pill { background: var(--chip); border-color: transparent; color: var(--text); min-height: 36px; }
@media (hover: hover) { .ftr-chips .pill:hover { background: var(--chip-h); } }
.ftr-chips .pill:active { background: var(--chip-a); }
.ftr-chips .i { width: 17px; height: 17px; }
[data-install] .i { stroke: none; color: var(--text-2); }
.ftr-ai { margin: 0 0 8px; padding: 0; border: 0; background: none; gap: 8px; }
.ftr-ai > span { width: 100%; margin: 0; font-size: .8rem; font-weight: 600; color: var(--muted); }
.ftr-ai > span .i { width: 15px; height: 15px; }
.ftr-ai .ftr-chips { width: 100%; }
.ftr-ai a[href*="chatgpt.com"] .i { stroke: none; }
.ftr-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .82rem; }
.ftr-langs { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.ftr-langs a { color: var(--muted); }
.ftr-langs a[aria-current="true"] { color: var(--text); font-weight: 600; }
@media (max-width: 860px) {
  .ftr-grid { display: block; }
  .ftr-about { max-width: none; }
  .ftr-links { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; margin-top: 32px; padding-inline-end: 0; }
  .ftr-links > div:last-child { grid-column: 1 / -1; }
  .ftr-links > div:last-child ul { display: grid; grid-template-columns: 1fr 1fr; column-gap: 16px; }
}

/* ---------- FAB ---------- */
.fab { position: fixed; inset-inline-end: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 30; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.fab [data-fab="top"] { display: none; }
.fab.is-past-fold [data-fab="top"] { display: inline-grid; }
.fab-items { display: flex; flex-direction: column; gap: 8px; }
.fab .icon-btn { width: 42px; height: 42px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-2); color: var(--text); }
.fab [data-fab="more"] { display: none; }
body[data-tool="ready"] .fab, body[data-tool="extracting"] .fab, body[data-tool="done"] .fab { bottom: calc(86px + env(safe-area-inset-bottom)); }
@media (min-width: 961px) { body[data-tool] .fab { bottom: calc(18px + env(safe-area-inset-bottom)); } }
body[data-tool="extracting"] .fab [data-fab="more"], body[data-tool="done"] .fab [data-fab="more"] { display: inline-grid; }
body[data-tool="extracting"] .fab:not(.open) .fab-items, body[data-tool="done"] .fab:not(.open) .fab-items { display: none; }
.toc-pop { position: absolute; bottom: 0; inset-inline-end: 54px; width: 280px; max-height: 60vh; overflow: auto; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-3); }
.toc-pop ol { margin: 0; padding-inline-start: 1.2em; font-size: .88rem; }
.toc-pop a { color: var(--text); }

/* ---------- ads (no accent colors inside ad containers) ---------- */
.ad { margin: 40px auto; text-align: center; min-height: var(--ad-h, 0); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ad-label { font-size: .68rem; color: var(--muted); margin-bottom: 4px; }
.ad-reserve { background: repeating-linear-gradient(45deg, var(--surface-2) 0 10px, var(--surface) 10px 20px); border: 1px dashed var(--line-2); color: var(--muted); font-size: .8rem; border-radius: 8px; }
@media (max-width: 760px) { .ad-d { display: none; } }
@media (min-width: 761px) { .ad-m { display: none; } }

/* ---------- misc pages ---------- */
.err-page { text-align: center; padding: 80px 0 40px; }
.err-page .big { font: 700 clamp(5rem, 3rem + 10vw, 9rem)/1 var(--mono); letter-spacing: -.06em; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.support-live { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); margin: 0 0 24px; }
.sl { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.sl > .i { color: var(--muted); }
.sl .st { margin-inline-start: auto; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 0; }
.sl .st::before { content: ""; width: 14px; height: 14px; background: currentColor; -webkit-mask: var(--m) center / contain no-repeat; mask: var(--m) center / contain no-repeat; }
.sl .st.y { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.sl .st.n { color: var(--err); background: color-mix(in srgb, var(--err) 12%, transparent); --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E"); }
.sl .st.w { color: var(--muted); background: var(--surface-2); --m: none; }
.sl .st.w::before { width: 12px; height: 12px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; background: none; -webkit-mask: none; mask: none; animation: spin .8s linear infinite; }
.sl b { font-weight: 580; font-size: .92rem; }
.sl small { display: block; color: var(--muted); font-size: .78rem; }
.support-ua { color: var(--muted); font: .78rem var(--mono); }
.changelog h2 { font-size: 1.2rem; display: flex; gap: 12px; align-items: baseline; }
.changelog h2 time { font: .84rem var(--mono); color: var(--muted); font-weight: 500; }
.dataflow { margin: 1.4em 0; padding: 18px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); }
.dataflow svg { width: 100%; height: auto; color: var(--text); }

/* ---------- motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(.98); } }
@keyframes flash { from { opacity: .55; } to { opacity: 0; } }
@keyframes pulse { 50% { opacity: .45; } }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
@keyframes ring { 0% { box-shadow: var(--shadow-3), 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); } 100% { box-shadow: var(--shadow-3), 0 0 0 18px transparent; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
.mode-note { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); font-size: .86rem; font-weight: 540; }
.mode-note > .i { width: 18px; height: 18px; }
.mode-note span { flex: 1; }
.mode-note .tip { color: inherit; }
.mode-cta { align-items: flex-start; justify-content: flex-end; text-align: start; min-height: 240px; color: #fff; border: 0; overflow: hidden; isolation: isolate; cursor: pointer;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--accent-2) 55%, transparent), transparent 60%), linear-gradient(150deg, var(--accent) 0%, color-mix(in srgb, var(--accent) 60%, #000) 100%); }
.mode-cta::before { content: ""; position: absolute; inset: 0; z-index: -1; background: url(/img/art/scene-2-sm.webp) center / cover; opacity: .22; mix-blend-mode: luminosity; }
.mode-cta h3 { color: #fff; font-size: 1.15rem; }
.mode-cta p { color: rgba(255, 255, 255, .8); }
.mode-cta-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: rgba(255, 255, 255, .18); backdrop-filter: blur(6px); margin-bottom: auto; }
.mode-cta-ico .i { width: 24px; height: 24px; fill: #fff; stroke: none; }
@media (hover: hover) { .mode-cta:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -18px var(--accent); } }
th::first-letter { text-transform: uppercase; }
.art .art-acc-f { fill: var(--accent); }
.post .art-cover > rect:first-of-type { rx: 0; }

/* output settings: one tidy column of controls next to the labels */
.field-c { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.field-c > .inp, .field-c > .inp-unit { width: 100%; }
.field-c .size-max { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; width: 100%; }
.inp-unit.sm { width: 132px; flex: none; }
.vf-panel .inp, .vf-out-body .inp, .vf-dd .inp, .vf-params .inp { height: 38px; }
.vf-params .stepper .inp { height: 24px; width: 3.4em; }
.pill.sm { min-height: 26px; padding: 0 9px; font-size: .74rem; }
.presets.sm { gap: 5px; }
.vf-out-body .field, .vf-params .field, .vf-dd .field, .vf-panel .field { align-items: start; }
.vf-out-body .field > .field-l, .vf-params .field > .field-l, .vf-dd .field > .field-l, .vf-panel .field > .field-l { min-height: 38px; align-items: center; }
.vf-out-body .field:has(> .field-l output) { align-items: center; }
/* Skip duplicates: label on the left, switch at the control column, hint just after the switch */
.vf-dd .field.dd-on { align-items: center; }
.vf-dd .field.dd-on > .field-l { min-width: 0; flex-wrap: nowrap; }
.vf-dd .field.dd-on .lbl { flex: none; white-space: nowrap; }
.vf-dd .field.dd-on > .dd-ctl { display: inline-flex; align-items: center; gap: 2px; justify-self: start; }
.vf-dd .field.dd-on .switch { position: relative; min-height: 0; }
.vf-dd .field.dd-on .switch input { inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
@media (max-width: 480px) {
  .vf-dd .field.dd-on { grid-template-columns: 112px minmax(0, 1fr); }
  .vf-dd .field.dd-on > .dd-ctl { grid-column: 2; }
}
@media (max-width: 480px) { .vf-out-body .field > .field-l { min-height: 0; } }

/* results as a modal overlay */
.vf-results { position: fixed; inset: 0; z-index: 70; margin: 0; padding: 4vh 16px; background: var(--scrim); backdrop-filter: blur(4px); border: 0; border-radius: 0; box-shadow: none; overflow-y: auto; overscroll-behavior: contain; display: none; }
.vf-results.is-open { display: block; animation: rfade .18s var(--ease); }
.vf-rbox { max-width: 1120px; margin: 0 auto; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-2); outline: 0; }
.gif-result .vf-rbox { max-width: 760px; }
.vf-rbox .vf-rhead { position: sticky; top: -16px; z-index: 2; margin: -16px -16px 0; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0; flex-wrap: nowrap; }
.vf-rbox .vf-rhead .vf-rtools { margin-inline-start: auto; }
.vf-rbox .vf-rhead > .icon-btn { margin-inline-start: 4px; }
.gif-result .vf-rhead .gif-meta { margin-inline-start: auto; }
html.has-overlay { overflow: hidden; }
@keyframes rfade { from { opacity: 0; } }
@media (max-width: 640px) {
  .vf-results { padding: 0; }
  .vf-rbox { min-height: 100%; border-radius: 0; border: 0; padding: 12px; }
  .vf-rbox .vf-rhead { margin: -12px -12px 0; padding: 10px 12px; top: -12px; border-radius: 0; }
}
@media (prefers-reduced-motion: reduce) { .vf-results.is-open { animation: none; } }
html.has-overlay .hero, html.has-overlay main, html.has-overlay .vf-work { isolation: auto; z-index: auto; }

/* ---- round 5: calmer drop zone, flat output block, tinted URL note, select ---- */
.vf-drop { min-height: 300px; padding: 40px 24px; background: var(--surface); border: 1.5px dashed var(--line-2); box-shadow: none; }
.vf-drop::before { display: none; }
@media (hover: hover) { .vf-drop:hover { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); } }
.vf.is-drag .vf-drop, .vf-drop:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.vf-drop-in { gap: 10px; }
.vf-drop-ico { width: 56px; height: 56px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-text); box-shadow: none; }
.vf-drop-ico .i { width: 26px; height: 26px; }
.vf-drop-t { font-size: 1.25rem; margin: 6px 0 0; }
.vf-drop-acts { margin-top: 6px; }
.vf-formats { margin: 10px 0 0; font-size: .76rem; opacity: .9; }
.vf-urlbtn { top: 18px; inset-inline-end: 18px; }

.vf-url-note { display: flex; align-items: flex-start; gap: 8px; width: min(560px, 100%); max-width: none; margin: 0; padding: 9px 12px; text-align: start; border-radius: 10px; background: var(--accent-soft); color: var(--accent-text); font-size: .8rem; line-height: 1.5; }
.vf-url-note .i { width: 15px; height: 15px; flex: none; margin-top: 2px; }
.vf-url-note span { min-width: 0; }
.vf-drop.is-url .vf-drop-in { align-items: center; }
.vf-drop.is-url .vf-url-note { display: flex; }
.vf-url[hidden] + .vf-url-note { display: none; }

.inp.sel { appearance: none; -webkit-appearance: none; width: 100%; padding-inline-end: 34px; cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8aa0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }
[dir=rtl] .inp.sel { background-position: left 12px center; }
.vf-out { border-top: 1px solid var(--line); padding-top: 14px; }
.vf-out-body { padding: 0; gap: 10px; }
.mode { min-height: 54px; gap: 4px; background: transparent; border-color: var(--line); }
@media (hover: hover) { .mode:hover:not(:disabled) { background: var(--surface-2); } }

/* results modal: loading strip + skeleton; reopen button sits beside the main action */
.vf-go { display: flex; gap: 8px; }
.vf-go .btn { width: auto; flex: 1; }
.vf-go .vf-showres { flex: none; padding-inline: 16px; background: var(--surface); }
.vf-showres-n { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--accent-soft); color: var(--accent-text); font-size: .78rem; font-weight: 640; }
.vf-rprog { display: flex; align-items: center; gap: 12px; padding: 12px 0 2px; font-size: .84rem; color: var(--text-2); }
.vf-rprog[hidden] { display: none; }
.vf-rprog-txt { flex: none; max-width: 46%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vf-rprog .bar { flex: 1; min-width: 40px; height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.vf-rprog .bar span { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--accent); transition: width .2s linear; }
.vf-skel { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.vf-skel i { display: block; aspect-ratio: 16 / 9; border-radius: 10px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
@keyframes shimmer { to { background-position: -150% 0; } }
@media (max-width: 480px) { .vf-rprog-txt { display: none; } }
.gif-result.is-working .gif-out { min-height: 220px; background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
.gif-result.is-working .gif-out img, .gif-result.is-working .gif-meta { visibility: hidden; }
.gif-result.is-working .vf-export { visibility: hidden; }

/* results dialog: fixed-size box, only the list scrolls inside it */
.vf-results { overflow: hidden; display: none; padding: 4vh 16px; }
.vf-results.is-open { display: flex; align-items: center; justify-content: center; }
.vf-rbox { width: 100%; max-height: 100%; margin: 0 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; }
.vf-rbox .vf-rhead { top: -16px; }
.vf-rbox .vf-export { position: sticky; top: 49px; z-index: 2; margin: 0 -16px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
@media (max-width: 640px) {
  .vf-results { padding: 0; }
  .vf-rbox { height: 100%; max-height: 100%; }
  .vf-rbox .vf-rhead { top: -12px; }
  .vf-rbox .vf-export { margin: 0 -12px; padding: 8px 12px; top: 45px; }
}
.gif-result .vf-rbox .vf-export { position: static; border: 0; padding: 12px 0 0; margin: 0; }

/* remove-video button on the preview; dialog tooltips open downward so the scroll box never clips them */
.vf-player { position: relative; }
.vf-del { position: absolute; top: 10px; inset-inline-end: 10px; z-index: 3; width: 36px; height: 36px; border-radius: 50%; background: rgba(12, 12, 18, .55); color: #fff; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.vf-del .i { width: 18px; height: 18px; }
@media (hover: hover) { .vf-del:hover:not(:disabled) { background: var(--err); color: #fff; } }
@media (hover: hover) {
  .vf-rbox [data-tip]:hover::after, .vf-rbox [data-tip]:focus-visible::after { bottom: auto; top: calc(100% + 8px); }
  .vf-rbox .vf-rhead [data-tip]:hover::after, .vf-rbox .vf-rhead [data-tip]:focus-visible::after { left: auto; right: 0; transform: none; }
  .vf-rbox .vf-export [data-tip]:hover::after { left: 0; transform: none; }
  .vf-rbox .vf-export .vf-trash[data-tip]:hover::after, .vf-rbox .vf-export .vf-trash[data-tip]:focus-visible::after { left: auto; right: 0; }
}
.inp-unit:not(:has(.unit)) .inp { padding-inline-end: 10px; }
input[type="number"]::-webkit-inner-spin-button { opacity: .5; margin: 0; }

/* dialog polish: tooltip layering, single divider, soft fade under the sticky bar, placeholder tiles */
.vf-rbox .vf-rhead { z-index: 4; }
.vf-rbox .vf-export { z-index: 3; border-bottom: 0; padding-bottom: 12px; }
.vf-rbox .vf-export::after { content: ""; position: absolute; inset-inline: 0; top: 100%; height: 14px; background: linear-gradient(var(--surface), transparent); pointer-events: none; }
.vf-rbox .vf-note { margin-top: 4px; }
.gif-result .vf-rbox .vf-export::after { display: none; }
.cell.sk { pointer-events: none; }
.cell.sk .cell-img { box-shadow: none; cursor: default; background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%) 0 0 / 300% 100%; animation: shimmer 1.3s linear infinite; }
@media (prefers-reduced-motion: reduce) { .cell.sk .cell-img, .vf-skel i { animation: none; } }
.vf-rbox .vf-grid { margin-top: 14px; }
.dd-btn b { color: inherit; }

/* round 6: minimal drop zone (icon, title, one quiet line; sample + link as corner icons), flat export buttons */
.vf-drop-tools { position: absolute; top: 16px; inset-inline-end: 16px; display: flex; gap: 6px; z-index: 2; }
.vf-sample { position: absolute; bottom: 16px; inset-inline-end: 16px; z-index: 2; }
.vf-drop.is-url .vf-sample { display: none; }
.vf-drop-tools .vf-urlbtn { position: static; inset: auto; }
.vf-drop { min-height: 280px; }
.vf-drop-acts:empty { display: none; }
.vf-drop-t { margin-top: 10px; }
.vf-formats { margin-top: 2px; }
.vf-export .btn-primary, .vf-rbox .btn-primary { box-shadow: none; }

/* round 7: dialog = fixed header + toolbar, only the frame area scrolls */
.vf-rbox { display: flex; flex-direction: column; overflow: hidden; max-height: 100%; padding: 0; }
.vf-rbox .vf-rhead { position: static; margin: 0; padding: 14px 16px 12px; border-bottom: 0; border-radius: 0; flex: none; }
.vf-rbox .vf-export { position: static; margin: 0; padding: 0 16px 12px; border: 0; background: none; flex: none; }
.vf-rbox .vf-export::after { display: none; }
.vf-rbox .vf-note { margin: 0 16px 8px; flex: none; }
.vf-gscroll { position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 16px; border-top: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.vf-rbox .vf-grid { margin-top: 12px; }
.gif-result .vf-rbox { overflow: visible; padding: 0; }
.gif-result .vf-rbox .vf-rhead { border-bottom: 1px solid var(--line); }
.gif-result .vf-gif-body, .gif-result .gif-out { margin: 16px 16px 0; }
.gif-result .vf-rbox .vf-export { padding: 12px 16px 16px; }
.vf-master.on { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }
.vf-trash.is-danger { color: var(--err); background: color-mix(in srgb, var(--err) 10%, transparent); }
@media (hover: hover) { .vf-trash.is-danger:hover:not(:disabled) { background: color-mix(in srgb, var(--err) 18%, transparent); color: var(--err); } }
.vf-skel { display: grid; place-items: center; min-height: 160px; }
.vf-skel .spin { width: 26px; height: 26px; }
@media (max-width: 640px) {
  .vf-rbox { padding: 0; }
  .vf-rbox .vf-rhead { padding: 12px; margin: 0; top: auto; }
  .vf-rbox .vf-export { padding: 0 12px 10px; margin: 0; top: auto; }
  .vf-gscroll { padding: 4px 12px 12px; }
}
.gif-result .vf-rprog { padding: 14px 16px 0; } .gif-result .vf-rbox { overflow: hidden; }

/* round 8: file info lives on the preview (name chip + details card); compact mode tabs */
.vf-meta { position: absolute; top: 10px; inset-inline-start: 10px; z-index: 3; max-width: calc(100% - 64px); }
.vf-meta-btn { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; height: 36px; padding: 0 12px; border: 0; border-radius: 18px; background: rgba(12, 12, 18, .55); color: #fff; font: 560 .82rem/1 var(--font); cursor: pointer; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); transition: background-color .15s var(--ease); }
.vf-meta-btn .i { width: 16px; height: 16px; flex: none; opacity: .9; }
.vf-meta-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .vf-meta-btn:hover { background: rgba(12, 12, 18, .75); } }
.vf-meta-pop { display: none; position: absolute; top: calc(100% + 8px); inset-inline-start: 0; z-index: 6; width: 250px; max-width: 80vw; padding: 6px; border-radius: 14px; background: var(--surface); color: var(--text); border: 1px solid var(--line); box-shadow: var(--shadow-3); }
.vf-meta.open .vf-meta-pop { display: block; }
@media (hover: hover) { .vf-meta:hover .vf-meta-pop { display: block; } }
.vf-meta-pop .vf-chip { display: flex; width: 100%; min-height: 34px; padding: 0 10px; background: none; border-radius: 8px; gap: 10px; font-size: .84rem; }
.vf-meta-pop .vf-chip::after { content: attr(data-tip); margin-inline-start: auto; color: var(--muted); font: 500 .76rem/1 var(--font); }
.vf-meta-pop .vf-chip .num { font-size: .82rem; color: var(--text); }
.vf-meta-pop [data-tip]::after { position: static; transform: none; width: auto; padding: 0; background: none; box-shadow: none; animation: none; }
.vf-meta-pop [data-tip]:hover::after { position: static; transform: none; padding: 0; background: none; box-shadow: none; color: var(--muted); }

.vf-modes { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--surface-2); overflow: visible; grid-template-columns: none; scroll-snap-type: none; margin-inline: 0; }
.vf-modes .mode, .vf-modes .mode-more { flex: 1 1 0; min-width: 0; min-height: 0; height: 36px; padding: 0 6px; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; border: 0; border-radius: 9px; background: transparent; color: var(--text-2); font: 560 .84rem/1 var(--font); cursor: pointer; grid-column: auto; }
.vf-modes .mode span, .vf-modes .mode-more span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (hover: hover) { .vf-modes .mode:hover:not(:disabled):not([aria-checked="true"]), .vf-modes .mode-more:hover { color: var(--text); background: color-mix(in srgb, var(--surface) 60%, transparent); } }
.vf-modes .mode[aria-checked="true"], .vf-modes .mode-more.on { background: var(--surface); color: var(--accent-text); box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 0 0 1px var(--line); }
.mode-more .chev { width: 18px; height: 18px; }
.mode-more[aria-expanded="true"] .chev { transform: rotate(180deg); }
.mode-more-wrap { flex: 1 1 0; min-width: 0; display: flex; }
.mode-more-wrap .mode-more { width: 100%; }
.mode-pop { bottom: auto; top: calc(100% + 6px); inset-inline-end: 0; width: 280px; padding: 6px; }
.vf-modes .mode-pop .mode { display: grid; grid-template-columns: 20px 1fr; grid-template-rows: auto auto; column-gap: 10px; row-gap: 2px; align-items: center; height: auto; width: 100%; padding: 9px 10px; justify-content: stretch; text-align: start; border-radius: 10px; flex: none; }
.vf-modes .mode-pop .mode .i { grid-row: 1 / span 2; width: 18px; height: 18px; color: var(--muted); }
.vf-modes .mode-pop .mode span { color: var(--text); font-weight: 600; font-size: .88rem; }
.vf-modes .mode-pop .mode small { grid-column: 2; color: var(--muted); font: 500 .76rem/1.3 var(--font); white-space: normal; }
.vf-modes .mode-pop .mode[aria-checked="true"] { background: var(--accent-soft); box-shadow: none; }
.vf-modes .mode-pop .mode[aria-checked="true"] span, .vf-modes .mode-pop .mode[aria-checked="true"] .i { color: var(--accent-text); }
@media (max-width: 480px) { .vf-modes { overflow: visible; } }
.vf-modes .mode-more-wrap { flex: 0 0 auto; position: relative; }
.vf-modes .mode-more-wrap .mode-more { flex: none; width: 36px; padding: 0; }

/* round 9: fixed modal size; labelled actions on small screens */
@media (min-width: 641px) { .vf-results:not(.gif-result) .vf-rbox { height: min(100%, 880px); } }
.xl { display: none; }
@media (max-width: 640px) {
  .vf-export { flex-wrap: wrap; gap: 8px; }
  .vf-export .btn-primary { flex: 1 1 0; justify-content: center; }
  .vf-export .grow { display: none; }
  .vf-export .vf-trash { order: 2; }
  .vf-export .vf-master, .vf-export [data-act="folder"], .vf-export [data-act="share"], .vf-export [data-act="sheet"], .vf-export [data-act="gif"] { width: auto; padding: 0 12px; gap: 6px; font: 560 .84rem/1 var(--font); }
  .vf-export .xl { display: inline; }
  .vf-export [data-act="selall"] { order: 0; }
  .vf-export [data-act="zip"] { order: 1; }
  .vf-export [data-act="share"], .vf-export [data-act="folder"], .vf-export [data-act="sheet"], .vf-export [data-act="gif"] { order: 3; }
  .vf-export [data-act="folder"] { order: 3; }
  .vf-drop-tools .icon-btn { width: auto; padding: 0 12px; gap: 6px; font: 560 .82rem/1 var(--font); }
  .vf-drop-tools .xl { display: inline; }
}
@media (max-width: 640px) { .vf-export .icon-btn, .vf-drop-tools .icon-btn { display: inline-flex; flex-direction: row; align-items: center; justify-content: center; white-space: nowrap; } }
@media (max-width: 640px) { .vf-export .vf-trash { order: 9; margin-inline-start: auto; } }
/* labels only where the icon alone is ambiguous */
@media (max-width: 640px) {
  .vf-export [data-act="selall"] .xl, .vf-export [data-act="share"] .xl, .vf-drop-tools .vf-urlbtn .xl { display: none; }
  .vf-export [data-act="selall"], .vf-export [data-act="share"], .vf-drop-tools .vf-urlbtn { width: 44px; padding: 0; }
}

/* drop zone: mosaic sits at the old hover depth; hover only steps a little further */
.vf-drop { isolation: isolate; overflow: hidden; background: color-mix(in srgb, var(--accent-soft) 40%, var(--surface)); --mo: color-mix(in srgb, var(--accent) 12%, transparent); --mo2: color-mix(in srgb, var(--accent) 7%, transparent); transition: border-color .2s, background-color .2s; }
.vf-drop::before { display: block; content: ""; position: absolute; inset: 0; z-index: -1; border: 0; border-radius: inherit; pointer-events: none;
  background:
    conic-gradient(var(--mo) 25%, transparent 0 50%, var(--mo) 0 75%, transparent 0) 0 0 / 40px 40px,
    conic-gradient(transparent 25%, var(--mo2) 0 50%, transparent 0 75%, var(--mo2) 0) 20px 20px / 40px 40px;
  -webkit-mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, transparent 30%, #000 100%);
  mask-image: radial-gradient(ellipse 62% 58% at 50% 50%, transparent 30%, #000 100%); transition: opacity .2s; }
@media (hover: hover) {
  .vf-drop:hover { border-color: var(--accent-line); background: color-mix(in srgb, var(--accent-soft) 58%, var(--surface)); --mo: color-mix(in srgb, var(--accent) 16%, transparent); --mo2: color-mix(in srgb, var(--accent) 10%, transparent); }
}
.vf-drop.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.vf-drop.is-url::before { opacity: .5; }

/* preview: fit every aspect ratio fully inside the player (letterbox, never crop) */
.vf-player > video, .vf-player > canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.vf-player { min-height: 160px; }
.vf-urlbtn .ic-lk, .vf-urlbtn .ic-up { display: contents; }
.vf-urlbtn .ic-up, .vf-drop.is-url .vf-urlbtn .ic-lk { display: none; }
.vf-drop.is-url .vf-urlbtn .ic-up { display: contents; }
@media (max-width: 640px) {
  .vf-drop.is-url .vf-urlbtn { width: auto; padding: 0 12px; }
  .vf-drop.is-url .vf-urlbtn .xl { display: inline; }
}

/* code blocks: compact terminal card, command wraps, copy sits inline */
pre { display: flex; align-items: flex-start; gap: 10px; margin: 12px 0 14px; padding: 12px 10px 12px 14px; overflow: visible; background: #15151d; border: 1px solid #262633; border-radius: 12px; color: #e8e8f2; box-shadow: none; }
pre::before { content: "$"; flex: none; color: #8d7fff; font: 600 .85rem/1.6 var(--mono, ui-monospace, monospace); user-select: none; }
pre code { flex: 1; min-width: 0; margin: 0; color: inherit; font-size: .83rem; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
pre .code-copy { position: static; flex: none; width: 30px; height: 30px; margin: -3px 0 -3px auto; border: 0; background: transparent; color: #a9a9bd; }
@media (hover: hover) { pre .code-copy:hover { background: #262633; color: #fff; } }

/* round 10: settings column hugs its content (no stretched blank area) */
.vf-work { grid-template-rows: auto auto 1fr; align-items: start; }
.vf-stage { grid-row: 1 / span 3; }
.vf-panel > .vf-est { margin-top: 0; }
.vf-go { position: static; }
@media (max-width: 900px) { .vf-work { grid-template-rows: none; } .vf-stage { grid-row: auto; } .vf-go { position: sticky; } }

/* contact sheet dialog: preview left, settings right */
.dlg.sheet { width: min(980px, calc(100vw - 24px)); }
.sheet-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: start; }
.sheet-main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.sheet-prev { max-height: 62vh; min-height: 220px; overflow: auto; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--line); padding: 10px; display: grid; place-items: center; }
.sheet-info { text-align: center; }
.sheet-side { display: flex; flex-direction: column; gap: 4px; }
.sheet-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 0 2px; border-bottom: 1px solid var(--line); font-size: .9rem; font-weight: 560; color: var(--text-2); cursor: pointer; }
.sheet-row .inp, .sheet-row .inp-unit { width: 120px; flex: none; }
.sheet-row .seg { flex: none; }
.sheet-row .switch { min-height: 0; }
.sheet-color { width: 44px; height: 32px; padding: 3px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); cursor: pointer; flex: none; }
.sheet-save { margin-top: 16px; width: 100%; justify-content: center; }
@media (max-width: 760px) {
  .sheet-body { grid-template-columns: 1fr; }
  .sheet-prev { max-height: 34vh; }
  .dlg.sheet .dlg-in { padding: 16px; }
}

/* long option lists (6+) get their own full-width row instead of wrapping */
.vf-panel .field:has(> .seg > .seg-b:nth-child(6)) { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
.vf-panel .field:has(> .seg > .seg-b:nth-child(6)) > .field-l, .vf-panel .field:has(> .seg > .seg-b:nth-child(6)) > .seg { grid-column: 1; }
.vf-panel .field:has(> .seg > .seg-b:nth-child(6)) > .seg { justify-self: stretch; }
.vf-panel .field:has(> .seg > .seg-b:nth-child(6)) > .seg > .seg-b { flex: 1 1 0; padding-inline: 4px; }
.post .art-cover { margin-top: 0; }

/* desktop: preview and settings column share one height; the preview box is fixed and letterboxes any ratio */
@media (min-width: 901px) {
  .vf-work { grid-template-rows: 1fr auto; align-items: stretch; }
  .vf-stage { grid-row: 1 / span 2; display: flex; flex-direction: column; }
  .vf-panel > .vf-est { margin-top: auto; }
  .vf-go { position: static; }
  .vf-player:not(.gif-player) { aspect-ratio: auto !important; height: clamp(260px, 38vh, 360px); max-height: none; }
}
.vf-export [data-act="share"].is-ready, .cell-acts [data-c="share"].is-ready, .lb-top [data-l="share"].is-ready { color: var(--accent-text); border-color: var(--accent-line); background: var(--accent-soft); }

/* round 11: centered segment labels; result modal image always fits so the action bar stays visible */
.seg-b { justify-content: center; text-align: center; }
.gif-result .gif-out { min-height: 0; overflow: hidden; }
.gif-result .gif-out img { max-width: 100%; max-height: calc(92vh - 230px); width: auto; height: auto; object-fit: contain; }
@media (max-width: 640px) { .gif-result .gif-out img { max-height: calc(100vh - 250px); } }
@media (max-width: 640px) {
  .gif-result.is-open { padding: 12px; }
  .gif-result .vf-rbox { height: auto; border-radius: var(--r-lg); border: 1px solid var(--line); min-height: 0; }
  .gif-result .vf-rhead { flex-wrap: wrap; row-gap: 2px; }
  .gif-result .vf-rtitle { white-space: nowrap; }
  .gif-result .vf-rhead .gif-meta { order: 3; flex: 1 0 100%; margin: 0; }
}
@media (min-width: 901px) {
  .vf-stage { container-type: inline-size; }
  .vf-player.gif-player { --h: clamp(260px, 38vh, 360px); aspect-ratio: auto; height: min(var(--h), calc(100cqw / var(--ar, 1.7778))); width: min(100%, calc(var(--h) * var(--ar, 1.7778))); max-height: none; margin-inline: auto; }
}
.vf-stop { background: var(--text); color: var(--bg); border-color: transparent; }
.vf-stop[hidden] { display: none; }

@media (min-width: 901px) {
  .vf-stage .img-player { flex: 1 1 auto; height: auto; min-height: 260px; aspect-ratio: auto !important; }
}
.img-result .vf-export .xl { display: none !important; }
@media (max-width: 900px) {
  .img-player.multi { height: auto; max-height: 52vh; min-height: 0; }
  .img-player.multi .img-body { position: static; }
  .img-player.multi .img-tiles { height: auto; max-height: 52vh; }
}
