/* Grabo — structure and components. Every color, font and radius comes from tokens set per design in layouts.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--fg); font-family: var(--font-body); font-size: 1rem; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
[dir="rtl"] body { font-family: var(--font-body-ar); }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.1; margin: 0; text-wrap: balance; letter-spacing: var(--display-tracking, -0.02em); }
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { font-family: var(--font-display-ar); letter-spacing: 0; line-height: 1.35; }
p { margin: 0; }
a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--focus, var(--accent)); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 50; background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: 10px; text-decoration: none; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
svg { stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- header ---------- */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; gap: 22px; padding: 14px clamp(16px, 4vw, 40px); background: var(--top-bg, var(--bg)); border-bottom: var(--top-line, 0) solid var(--line); backdrop-filter: var(--top-blur, none); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-brand, var(--font-display)); font-weight: 800; font-size: 1.3rem; letter-spacing: var(--brand-tracking, -0.01em); flex: none; }
.mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--mark-radius, 10px); background: var(--mark-bg, var(--accent)); color: var(--mark-fg, var(--accent-fg)); font-size: .95rem; font-weight: 800; font-family: var(--font-display); flex: none; transform: var(--mark-rotate, none); }
/* VidGrabo logo (a video being pulled down): drawn in the mark colours of the current template and mode,
   so it follows every theme and dark mode. The arrow is white on the yellow sticker theme, else the mark colour. */
.mark.logo-mark { font-size: 0; }
.mark.logo-mark::after { display: none; }
.mark.logo-mark svg { width: 25px; height: 25px; display: block; }
.mark.logo-mark .lm-arrow { stroke: var(--mark-arrow, currentColor); }
[data-layout="grabo"]:not([data-theme="dark"]) { --mark-arrow: #fff; }
[data-layout="savvo"] .mark.logo-mark { color: #fff; } /* its mark colour is transparent over a gradient */
.nav { display: flex; gap: 20px; margin-inline-start: auto; font-size: .92rem; }
.nav a { text-decoration: none; color: var(--nav, var(--muted)); font-weight: 500; }
.nav a:hover, .nav a.on { color: var(--fg); }
.acts { display: flex; align-items: center; gap: 8px; }
.pill-btn { height: 38px; min-width: 38px; padding: 0 12px; border-radius: var(--pill-radius, 99px); border: var(--bw-s, 1px) solid var(--pill-line, var(--line)); background: var(--pill-bg, transparent); font-size: .8rem; font-weight: 700; display: inline-grid; place-items: center; }
.pill-btn.icon { padding: 0; }
.pill-btn svg { width: 18px; height: 18px; }
[data-theme="dark"] .i-sun, [data-theme="light"] .i-moon { display: none; }
.lang-wrap { position: relative; }
.lang-menu { position: absolute; top: calc(100% + 8px); inset-inline-end: 0; min-width: 180px; max-height: 70vh; overflow: auto; padding: 6px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 16px 40px rgba(0, 0, 0, .18); display: grid; z-index: 30; }
.lang-menu button { text-align: start; background: none; border: 0; padding: 9px 12px; border-radius: 9px; font-size: .9rem; }
.lang-menu button:hover, .lang-menu button.on { background: var(--soft); }
@media (max-width: 760px) { .nav { display: none; } .acts { margin-inline-start: auto; } }

main { flex: 1; width: 100%; }
.view { width: 100%; }

/* ---------- downloader stage (arranged per design in layouts.css) ---------- */
.stage { max-width: var(--stage-max, 1180px); margin: 0 auto; padding: clamp(22px, 5vw, 56px) clamp(16px, 4vw, 40px) 26px; display: grid; gap: 18px; }
.hero-copy h1 { font-size: var(--h1-size, clamp(2.3rem, 6vw, 3.8rem)); font-weight: var(--h1-weight, 800); }
.hero-copy h1 .l2 { display: inline-block; }
.hero-copy .sub { margin-top: 14px; color: var(--muted); font-size: clamp(.98rem, 2.2vw, 1.08rem); max-width: 48ch; }
.grab { display: flex; align-items: center; gap: 8px; padding: var(--field-pad, 8px); background: var(--field-bg, var(--card)); border: var(--field-bw, 1px) solid var(--field-line, var(--line)); border-radius: var(--field-radius, 18px); box-shadow: var(--field-shadow, none); min-width: 0; }
.grab:focus-within { border-color: var(--field-focus, var(--accent)); }
.grab input { flex: 1; min-width: 0; height: 46px; border: 0; background: transparent; outline: none; padding: 0 12px; font-size: 1rem; font-family: var(--font-field, inherit); }
.grab input::placeholder { color: var(--muted); opacity: 1; }
[dir="rtl"] .grab input:placeholder-shown { direction: rtl; }
.grab .rec { display: none; }
.paste { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: var(--btn-radius-s, 10px); border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .85rem; white-space: nowrap; }
.paste svg { width: 16px; height: 16px; }
.go { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border: 0; border-radius: var(--btn-radius, 12px); background: var(--btn-bg, var(--accent)); color: var(--btn-fg, var(--accent-fg)); font-weight: 800; white-space: nowrap; font-family: var(--font-btn, inherit); letter-spacing: var(--btn-tracking, 0); }
.go svg { width: 18px; height: 18px; stroke-width: 2.4; }
.go:disabled { opacity: .7; cursor: progress; }
.go.busy svg { animation: bob .9s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(3px); } }
.agree { font-size: .78rem; color: var(--muted); }
.agree a { color: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; align-items: center; gap: 7px; font-size: .8rem; padding: 6px 12px; border-radius: 99px; text-decoration: none; background: var(--chip-bg, var(--soft)); border: var(--chip-bw, 1px) solid var(--chip-line, transparent); font-weight: 600; }
/* Platform logo tiles: brand color behind the official glyph (Simple Icons). */
.pdot { width: 20px; height: 20px; border-radius: 6px; flex: none; display: inline-grid; place-items: center; color: #fff; }
.pdot svg { width: 64%; height: 64%; fill: currentColor; stroke: none; }
.p-tiktok { background: #000; }
.p-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.p-facebook { background: #0866ff; }
.p-youtube { background: #ff0000; }
.p-x { background: #000; }
.p-snapchat { background: #fffc00; color: #000; }
.p-pinterest { background: #bd081c; }
.p-threads { background: #000; }
.p-reddit { background: #ff4500; }
.p-vimeo { background: #1ab7ea; }
.p-soundcloud { background: #ff5500; }
.p-dailymotion { background: #0a0a0a; }
.p-twitch { background: #9146ff; }
.p-other { background: var(--muted); }
.p-brand { background: var(--accent); color: var(--accent-fg); }
.p-brand svg { stroke: currentColor; }
/* Black tiles need an edge on dark backgrounds. */
[data-theme="dark"] :is(.p-tiktok, .p-x, .p-threads, .p-dailymotion) { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35); }

/* decorative idle stack (only some designs show it) */
.idle-art { display: none; }
.tile { display: none; }

/* ---------- result ---------- */
.result { display: grid; gap: 16px; min-width: 0; scroll-margin-top: 90px; }
.result:empty { display: none; }
.result { container: result / inline-size; }
/* A narrow result column on a computer (Grabo puts it beside the headline): the cover stays as it is with the
   title beside it, and the formats take the whole card underneath. */
@media (min-width: 900px) {
  @container result (max-width: 640px) {
    .res:not(.pl):not(.res-imgs) { row-gap: 10px; align-items: start; }
    .res:not(.pl):not(.res-imgs) > .res-body { display: contents; container-type: normal; }
    .res:not(.pl):not(.res-imgs) > .thumb { grid-row: 1 / span 2; }
    .res:not(.pl):not(.res-imgs) .res-title, .res:not(.pl):not(.res-imgs) .res-meta { grid-column: 2; }
    .res:not(.pl):not(.res-imgs) > .res-body > :not(.res-title):not(.res-meta) { grid-column: 1 / -1; }
  }
}
.res { display: grid; grid-template-columns: var(--res-cols, 200px minmax(0, 1fr)); gap: 18px; padding: var(--res-pad, 16px); background: var(--res-bg, var(--card)); border: var(--res-bw, 1px) solid var(--res-line, var(--line)); border-radius: var(--res-radius, 20px); box-shadow: var(--res-shadow, none); min-width: 0; }
.thumb { position: relative; border-radius: var(--thumb-radius, 14px); overflow: hidden; background: var(--soft); aspect-ratio: 16 / 10; align-self: start; border: var(--thumb-bw, 0) solid var(--fg); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.tall { aspect-ratio: 4 / 5; }
.thumb .dur, .thumb .pf { position: absolute; z-index: 1; font: 700 .7rem/1 var(--font-body); color: #fff; background: rgba(0, 0, 0, .62); padding: 5px 7px; border-radius: 7px; }
.thumb .dur { bottom: 8px; inset-inline-end: 8px; direction: ltr; }
.thumb .pf { top: 8px; inset-inline-start: 8px; display: inline-flex; gap: 5px; align-items: center; }
.thumb .pf .pdot { width: 15px; height: 15px; border-radius: 4px; }
.res-body { display: grid; gap: 10px; align-content: start; min-width: 0; container-type: inline-size; }
/* Narrow cards: drop the secondary labels, keep the button whole. */
@container (max-width: 420px) { .opt .kind { display: none; } }
@container (max-width: 340px) { .opt .act > span { display: none; } .opt .act { padding: 0 9px; } }
@container (min-width: 520px) { .opts { --opt-cols-wide: 1fr 1fr; } }
.res-title { font-family: var(--font-body); font-size: 1.05rem; font-weight: 700; line-height: 1.4; letter-spacing: 0; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
[dir="rtl"] .res-title { font-family: var(--font-body-ar); line-height: 1.6; }
.res-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: .8rem; color: var(--muted); }
.nw { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 99px; background: var(--nw-bg, color-mix(in srgb, #22c55e 18%, transparent)); color: var(--nw-fg, #15803d); font-weight: 700; font-size: .72rem; border: var(--nw-bw, 0) solid var(--fg); }
[data-theme="dark"] .nw { color: var(--nw-fg-dark, #4ade80); }
.opts { display: grid; gap: 8px; grid-template-columns: var(--opt-cols, 1fr); }
.opt-h { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-top: 4px; grid-column: 1 / -1; }
.opt { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 10px 8px 14px; border-radius: var(--opt-radius, 12px); border: var(--opt-bw, 1px) solid var(--opt-line, var(--line)); background: var(--opt-bg, transparent); text-align: start; overflow: hidden; width: 100%; text-decoration: none; }
[dir="rtl"] .opt { padding: 8px 14px 8px 10px; }
.opt:hover { border-color: var(--opt-hover, var(--accent)); }
.opt .q { font-weight: 800; font-variant-numeric: tabular-nums; font-family: var(--font-opt, inherit); }
.opt .kind { font-size: .75rem; color: var(--muted); font-weight: 600; }
.opt .hd { font-size: .62rem; font-weight: 800; padding: 1px 5px; border-radius: 4px; background: var(--fg); color: var(--bg); }
.opt .sz { margin-inline-start: auto; font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; white-space: nowrap; }
.opt .act { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: var(--btn-radius-s, 9px); background: var(--act-bg, var(--fg)); color: var(--act-fg, var(--bg)); font-size: .78rem; font-weight: 800; white-space: nowrap; }
.opt .act svg { width: 15px; height: 15px; stroke-width: 2.4; }
.opt.best { background: var(--best-bg, var(--soft)); border-color: var(--best-line, var(--opt-line, var(--line))); }
.opt .bar { position: absolute; inset-inline-start: 0; bottom: 0; height: 3px; width: 0; background: var(--bar, var(--accent)); transition: width .4s ease; }
.opt[data-state] .sz { display: none; }
.opt[data-state="queued"] .act, .opt[data-state="running"] .act, .opt[data-state="processing"] .act { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.opt[data-state="processing"] .bar { width: 100% !important; background: repeating-linear-gradient(90deg, var(--bar, var(--accent)) 0 12px, transparent 12px 24px); animation: slide 1s linear infinite; }
@keyframes slide { to { background-position: 24px 0; } }
.opt[data-state="done"] { border-color: var(--ok, #16a34a); }
.opt[data-state="done"] .act { background: var(--ok, #16a34a); color: #fff; }
.opt[data-state="error"] { border-color: var(--bad, #dc2626); }
.opt .st { font-size: .78rem; color: var(--muted); margin-inline-start: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.opt:disabled { opacity: .55; cursor: not-allowed; }
.res-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.link-btn { background: none; border: 0; padding: 4px 0; font-size: .82rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; display: inline-flex; gap: 6px; align-items: center; }
.link-btn svg { width: 15px; height: 15px; }
.res-err { padding: 16px 18px; border-radius: var(--res-radius, 16px); background: color-mix(in srgb, var(--bad, #dc2626) 10%, var(--card)); border: 1px solid color-mix(in srgb, var(--bad, #dc2626) 35%, transparent); display: flex; gap: 12px; align-items: flex-start; }
.res-err svg { width: 22px; height: 22px; color: var(--bad, #dc2626); flex: none; margin-top: 2px; }
.res-more { justify-self: start; }

/* trim */
.trim-box { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--soft); }
.trim-track { position: relative; height: 38px; border-radius: 8px; background: var(--trim-bg, repeating-linear-gradient(90deg, color-mix(in srgb, var(--fg) 12%, transparent) 0 18px, color-mix(in srgb, var(--fg) 6%, transparent) 18px 36px)); direction: ltr; }
.trim-sel { position: absolute; top: -2px; bottom: -2px; border: 3px solid var(--trim-sel, var(--accent)); border-radius: 8px; pointer-events: none; box-shadow: 0 0 0 999px color-mix(in srgb, var(--bg) 40%, transparent); }
.trim-track { overflow: hidden; }
.trim-track input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.trim-track input[type=range]::-webkit-slider-thumb { pointer-events: auto; -webkit-appearance: none; width: 18px; height: 44px; border-radius: 6px; background: var(--trim-sel, var(--accent)); cursor: ew-resize; border: 2px solid var(--bg); }
.trim-track input[type=range]::-moz-range-thumb { pointer-events: auto; width: 16px; height: 40px; border-radius: 6px; background: var(--trim-sel, var(--accent)); cursor: ew-resize; border: 2px solid var(--bg); }
.trim-tc { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; direction: ltr; font-family: var(--font-mono, inherit); }
.trim-tc b { color: var(--fg); }

/* skeleton */
.sk { display: block; height: 12px; border-radius: 8px; background: var(--soft); position: relative; overflow: hidden; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--fg) 8%, transparent), transparent); animation: shine 1.3s ease-in-out infinite; }
@keyframes shine { to { transform: translateX(100%); } }
.skel .thumb .sk { height: 100%; border-radius: 0; }
.sk-t { height: 18px; width: 80%; }
.sk-s { width: 45%; }
.sk-o { height: 46px; border-radius: 12px; }
.res-wait { font-size: .82rem; }

/* ---------- sections ---------- */
.features, .block { max-width: var(--stage-max, 1180px); margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; padding-block: 18px 34px; }
.feat { padding: 16px 18px; border-radius: var(--feat-radius, 16px); background: var(--feat-bg, var(--card)); border: var(--feat-bw, 1px) solid var(--feat-line, var(--line)); display: grid; gap: 4px; font-size: .88rem; color: var(--muted); }
.feat b { color: var(--fg); font-size: 1rem; }
.block { padding-block: 34px; display: grid; gap: 18px; }
.block h2 { font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.steps li { display: flex; gap: 14px; padding: 18px; border-radius: var(--feat-radius, 16px); background: var(--feat-bg, var(--card)); border: var(--feat-bw, 1px) solid var(--feat-line, var(--line)); }
.steps .n { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-fg); font-weight: 800; }
.steps b { display: block; margin-bottom: 2px; }
.steps p { color: var(--muted); font-size: .9rem; }
/* bookmarklet (computers only) */
.bookmarklet { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 14px; padding: 18px; border-radius: var(--feat-radius, 16px); background: var(--feat-bg, var(--card)); border: var(--feat-bw, 1px) dashed var(--feat-line, var(--line)); }
.bookmarklet[hidden] { display: none; }
.bookmarklet p { color: var(--muted); font-size: .9rem; margin: 2px 0 0; }
.bm-btn { cursor: grab; }
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pf-card { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--feat-radius, 14px); background: var(--feat-bg, var(--card)); border: var(--feat-bw, 1px) solid var(--feat-line, var(--line)); text-decoration: none; font-weight: 700; font-size: .92rem; }
.pf-card:hover { border-color: var(--accent); }
.pf-card .pdot { width: 34px; height: 34px; border-radius: 10px; }
.app-cta { grid-template-columns: minmax(0, 1fr) auto; align-items: center; margin: 10px auto; padding: 26px clamp(18px, 4vw, 34px); border-radius: var(--res-radius, 22px); background: var(--cta-bg, var(--card)); color: var(--cta-fg, var(--fg)); border: var(--feat-bw, 1px) solid var(--feat-line, var(--line)); width: calc(100% - 2 * clamp(16px, 4vw, 40px)); max-width: calc(var(--stage-max, 1180px) - 2 * clamp(16px, 4vw, 40px)); }
.app-cta p { color: var(--cta-muted, var(--muted)); margin-top: 6px; max-width: 60ch; }
.app-acts { display: grid; gap: 6px; justify-items: end; }
.app-cta .btn { background: var(--cta-btn-bg, var(--btn-bg, var(--accent))); color: var(--cta-btn-fg, var(--btn-fg, var(--accent-fg))); }
.app-cta small { color: var(--cta-muted, var(--muted)); max-width: 34ch; }
.tg-link { display: inline-flex; align-items: center; gap: 8px; color: var(--cta-fg, var(--fg)); font-size: .85rem; font-weight: 700; text-decoration: none; }
.tg-link svg { width: 22px; height: 22px; fill: #26a5e4; stroke: none; }
/* The card's main action depends on the device: Android app, "add to home screen", or a QR code on a computer. */
.app-main { display: grid; gap: 8px; justify-items: inherit; }
.app-acts.and { justify-items: stretch; min-width: 280px; }
.app-acts.and .app-alt { justify-content: center; }
.app-cta .apk-btn { height: 52px; font-size: 1.02rem; }
.apk-btn svg { width: 24px; height: 24px; fill: currentColor; }
.app-cta .app-meta { text-align: center; font-size: .78rem; margin-top: -2px; }
.app-alt { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.app-alt:not(:has(> :not([hidden]))) { display: none; }
.app-web { padding: 0; border: 0; background: none; font: inherit; font-size: .85rem; font-weight: 700; color: var(--cta-fg, var(--fg)); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; opacity: .85; }
.app-acts.desk { display: flex; align-items: center; gap: 22px; }
.app-acts.desk .app-main { justify-items: center; }
.app-qr { display: grid; justify-items: center; gap: 6px; }
.app-qr img { width: 132px; height: 132px; padding: 8px; background: #fff; border-radius: 14px; }
.app-cta .app-qr small { max-width: 150px; text-align: center; font-size: .78rem; }
.app-cta .btn.ghost { background: transparent; color: var(--cta-fg, var(--fg)); border: 1.5px solid currentColor; height: 44px; }
/* Floating app banner on phones */
.app-banner { display: flex; align-items: center; gap: 10px; padding: 10px clamp(12px, 4vw, 40px); background: var(--card); color: var(--fg); border-bottom: 1px solid var(--line); }
.app-banner[hidden] { display: none; }
.app-banner img { width: 42px; height: 42px; border-radius: 11px; flex: none; }
.ab-txt { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.ab-txt b { font-size: .92rem; }
.ab-txt small { color: var(--muted); font-size: .78rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ab-x { flex: none; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.ab-btn { flex: none; display: inline-flex; align-items: center; height: 36px; padding: 0 18px; border-radius: 999px; background: var(--btn-bg, var(--accent)); color: var(--btn-fg, var(--accent-fg)); font-weight: 800; font-size: .88rem; text-decoration: none; }
.app-banner.bottom { position: fixed; z-index: 70; inset-inline: 10px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); padding: 10px 12px; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 14px 40px rgba(0, 0, 0, .22); animation: abUp .35s cubic-bezier(.2, .8, .2, 1); }
@keyframes abUp { from { transform: translateY(120%); } }
body.ab-bottom { padding-bottom: 84px; }
body.ab-bottom .toast { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
body:has(.don-float) .app-banner.bottom { display: none; }
.app-cta .open-chrome { background: transparent; color: var(--cta-fg, var(--fg)); border: 1.5px solid currentColor; height: 40px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border: 0; border-radius: var(--btn-radius, 12px); background: var(--btn-bg, var(--accent)); color: var(--btn-fg, var(--accent-fg)); font-weight: 800; text-decoration: none; white-space: nowrap; }
.faq-list { display: grid; gap: 10px; }
/* share a result */
.sp-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.sh { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: var(--btn-radius-s, 12px); border: var(--chip-bw, 1px) solid var(--chip-line, var(--line)); background: var(--card); text-decoration: none; font-weight: 700; font-size: .86rem; white-space: nowrap; }
.sh:hover { border-color: var(--accent); }
.sh .pdot { width: 24px; height: 24px; border-radius: 7px; }
.sh svg.i { width: 18px; height: 18px; }
.p-whatsapp { background: #25d366; }
.p-telegram { background: #26a5e4; }
.side-spread:empty { display: none; }
.res-spread { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 12px 14px; border-radius: var(--res-radius, 16px); background: var(--soft); font-size: .88rem; font-weight: 600; }
.res-spread .sp-btns { gap: 6px; }
.res-spread .sh { height: 36px; padding: 0 10px; font-size: .8rem; }
.res-spread .sh .lbl { display: none; }
.faq-list details { border-radius: var(--feat-radius, 14px); background: var(--feat-bg, var(--card)); border: var(--feat-bw, 1px) solid var(--feat-line, var(--line)); }
.faq-list summary { cursor: pointer; padding: 16px 18px; font-weight: 700; list-style: none; display: flex; gap: 12px; align-items: center; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; margin-inline-start: auto; font-size: 1.3rem; line-height: 1; color: var(--muted); }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { padding: 0 18px 16px; color: var(--muted); }
@media (max-width: 640px) { .app-cta { grid-template-columns: 1fr; } .app-acts { justify-items: start; } .app-acts.and { min-width: 0; } }

/* ---------- footer ---------- */
.foot { margin-top: 30px; padding: 28px clamp(16px, 4vw, 40px) calc(30px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: grid; gap: 12px; justify-items: center; text-align: center; font-size: .85rem; color: var(--muted); background: var(--foot-bg, transparent); }
.foot-brand { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.foot-brand b { color: var(--fg); }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { color: var(--fg); }
.foot-legal { font-size: .8rem; opacity: .85; }

/* ---------- pages ---------- */
.page-head { max-width: 760px; margin: 0 auto; padding: 40px 16px 16px; display: grid; gap: 8px; }
.page-head h1 { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--res-radius, 18px); padding: clamp(18px, 3vw, 26px); }
.doc { max-width: 820px; margin: 30px auto 10px; padding: 30px clamp(18px, 4vw, 40px); line-height: 1.85; background: var(--card); border: 1px solid var(--line); border-radius: var(--res-radius, 18px); }
@media (max-width: 860px) { .doc { margin-inline: 16px; } }
.doc h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 4px; }
.doc h1 + p { color: var(--muted); font-size: .85rem; margin: 0 0 18px; }
.doc h2 { font-size: 1.2rem; margin: 26px 0 8px; }
.doc p { margin: 8px 0; }
.doc ul { margin: 8px 0; padding-inline-start: 22px; }
.doc a { color: var(--link, var(--accent)); }
.contact-form { position: relative; max-width: 680px; margin: 0 auto 30px; display: grid; gap: 14px; }
@media (max-width: 712px) { .contact-form { margin-inline: 16px; } }
.contact-form label { display: grid; gap: 6px; font-size: .9rem; color: var(--muted); }
.contact-form input, .contact-form textarea { width: 100%; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--fg); }
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form .ct-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.contact-form .hp { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); opacity: 0; pointer-events: none; }
.contact-form .btn { justify-self: start; }
.ct-msg { padding: 10px 14px; border-radius: 10px; font-size: .92rem; background: color-mix(in srgb, #22c55e 14%, transparent); }
.ct-msg.err { background: color-mix(in srgb, #ef4444 14%, transparent); }
@media (max-width: 600px) { .contact-form .ct-row { grid-template-columns: 1fr; } }
.nf { text-align: center; padding: 70px 16px 50px; display: grid; justify-items: center; gap: 12px; }
.nf-code { font-family: var(--font-display); font-size: clamp(4rem, 14vw, 7rem); font-weight: 800; line-height: 1; color: var(--accent-text, var(--accent)); }

.toast { position: fixed; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); left: 50%; transform: translateX(-50%); z-index: 60; background: var(--fg); color: var(--bg); padding: 10px 18px; border-radius: 12px; font-size: .9rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); max-width: calc(100vw - 32px); }
.ad-slot { max-width: 1180px; margin: 12px auto; padding: 0 16px; text-align: center; }

/* ---------- error actions, tips, history, playlists, badges ---------- */
.res-err .err-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mini-btn { height: 38px; padding: 0 14px; border-radius: var(--btn-radius-s, 10px); border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: .85rem; }
.mini-btn.primary { background: var(--btn-bg, var(--accent)); color: var(--btn-fg, var(--accent-fg)); border-color: transparent; }
.tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--res-radius, 16px); background: color-mix(in srgb, var(--accent) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); }
.tip b { display: block; margin-bottom: 2px; }
.tip p { font-size: .9rem; color: var(--fg); opacity: .85; }
.tip .mini-btn { margin-inline-start: auto; flex: none; }
.clip-sug { display: flex; min-width: 0; max-width: 100%; }
/* A long copied link is cut with "…" instead of pushing past the screen edge. */
.clip-sug button { min-width: 0; }
.clip-sug button svg, .clip-sug button span { flex: none; }
.clip-sug bdi { min-width: 0; flex: 1 1 auto; white-space: nowrap; }
.clip-sug button { max-width: 100%; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 99px; border: 1px dashed var(--accent-text, var(--accent)); background: var(--card); font-size: .85rem; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.clip-sug bdi { overflow: hidden; text-overflow: ellipsis; }
.history { padding-block: 10px 24px; }
.hist-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.hist-head h2 { font-size: clamp(1.2rem, 3vw, 1.5rem); }
.hist-list { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.hist-item { flex: 0 0 150px; scroll-snap-align: start; display: grid; gap: 6px; text-align: start; background: none; border: 0; padding: 0; }
.hist-item .thumb { aspect-ratio: 16 / 10; }
.hist-item span { font-size: .8rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qb { font-size: .62rem; font-weight: 800; padding: 2px 6px; border-radius: 99px; background: var(--ok, #16a34a); color: #fff; white-space: nowrap; }
.qb.small { background: var(--muted); }
.pl-head { display: grid; gap: 4px; }
.pl-list { display: grid; gap: 8px; max-height: 520px; overflow-y: auto; padding: 2px; }
.pl-item { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); text-align: start; width: 100%; }
.pl-item .thumb { aspect-ratio: 16 / 9; }
.pl-item b { font-size: .88rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pl-item small { color: var(--muted); }
/* thumbnail that failed to load: the platform logo instead of an empty box */
.thumb.fb { display: grid; place-items: center; }
.thumb.fb .big-logo { width: 64px; height: 64px; border-radius: 18px; }
/* comfortable touch targets */
@media (pointer: coarse) {
  .pill-btn { height: 44px; min-width: 44px; }
  .chip { min-height: 40px; padding-inline: 14px; }
  .brand { min-height: 44px; }
}

/* ---------- photo posts, extras ---------- */
.imgs-head { display: flex; align-items: center; gap: 10px; }
.imgs-head .pdot { width: 26px; height: 26px; border-radius: 8px; }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.img-cell { position: relative; display: block; border-radius: 12px; overflow: hidden; background: var(--soft); aspect-ratio: 3 / 4; border: var(--thumb-bw, 0) solid var(--fg); }
.img-cell img { width: 100%; height: 100%; object-fit: cover; }
.img-cell .img-dl { position: absolute; bottom: 8px; inset-inline-end: 8px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--act-bg, var(--fg)); color: var(--act-fg, var(--bg)); }
.img-cell .img-dl svg { width: 18px; height: 18px; stroke-width: 2.4; }
.img-cell small { position: absolute; top: 8px; inset-inline-start: 8px; font: 700 .65rem/1 var(--font-body); color: #fff; background: rgba(0, 0, 0, .6); padding: 4px 6px; border-radius: 6px; direction: ltr; }
.img-cell.fb, .img-cell:has(.big-logo) { display: grid; place-items: center; }
.img-all { justify-self: start; }
.img-all svg { width: 18px; height: 18px; }
.extras { display: flex; flex-wrap: wrap; gap: 8px; }
.xbtn { position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 12px; border-radius: var(--opt-radius, 10px); border: var(--opt-bw, 1px) solid var(--opt-line, var(--line)); background: var(--opt-bg, transparent); text-decoration: none; font-size: .82rem; font-weight: 700; }
.xbtn svg { width: 17px; height: 17px; }
.xbtn small { color: var(--muted); font-weight: 500; }
.xbtn .st { font-size: .72rem; color: var(--muted); font-weight: 600; }
.xbtn .bar { position: absolute; inset-inline-start: 0; bottom: 0; height: 3px; width: 0; background: var(--bar, var(--accent)); transition: width .4s; }
.xbtn[data-state="done"] { border-color: var(--ok, #16a34a); }
.sub-pick { display: inline-flex; gap: 6px; align-items: stretch; flex-wrap: wrap; }
.sub-pick select { min-height: 40px; max-width: 190px; border-radius: var(--opt-radius, 10px); border: var(--opt-bw, 1px) solid var(--opt-line, var(--line)); background: var(--card); color: var(--fg); padding: 0 10px; font: inherit; font-size: .82rem; font-weight: 600; }
.xbtn[data-state="error"] { border-color: var(--bad, #dc2626); }

/* ---------- phones ---------- */
@media (max-width: 640px) {
  .grab { flex-wrap: wrap; }
  .grab input { flex-basis: 100%; height: 48px; }
  .grab .paste { flex: none; }
  .grab .go { flex: 1; }
  .res { grid-template-columns: 1fr; }
  .thumb { aspect-ratio: 16 / 9; }
  .thumb.tall { aspect-ratio: 16 / 11; }
  .opt .kind { display: none; }
  /* Platform chips: compact, each as wide as its name, wrapping naturally. */
  .chips { gap: 6px; }
  .chip { min-height: 38px; padding: 4px 10px; gap: 6px; font-size: calc(.74rem + 2px); }
  .chip .cl { white-space: nowrap; }
  .chip .pdot { width: 18px; height: 18px; border-radius: 5px; }
  .chip.more { white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

/* Light/dark switch: the new theme grows as a circle from the button. */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: theme-reveal .7s cubic-bezier(.4, 0, .2, 1); }
@keyframes theme-reveal { from { clip-path: circle(0 at var(--tx, 50%) var(--ty, 0%)); } to { clip-path: circle(var(--tr, 150vmax) at var(--tx, 50%) var(--ty, 0%)); } }
html.theme-fade, html.theme-fade * { transition: background-color .6s ease, color .6s ease, border-color .6s ease, fill .6s ease !important; }
@media (prefers-reduced-motion: reduce) { ::view-transition-new(root) { animation: none; } }

/* Language switcher: flag / globe + code / code */
#langLabel { display: inline-flex; align-items: center; gap: 6px; }
.lang-flag { display: block; width: 22px; height: 22px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
#langBtn.is-flag { padding: 0; width: 38px; }
#langBtn.is-flag .lang-flag { width: 26px; height: 26px; }
.lang-globe { width: 17px !important; height: 17px !important; fill: none; stroke: currentColor; stroke-width: 1.8; }
.lang-menu button { display: flex; align-items: center; gap: 10px; }
.lang-menu .lang-flag { width: 20px; height: 20px; flex: none; }
.apk-link svg { fill: #3ddc84; }
/* Large screens: everything a little bigger and the content wider, so it doesn't sit small in the middle. */
@media (min-width: 1600px) {
  html { font-size: 112.5%; }
  :root { --stage-max: 1360px; }
}
