/* ==========================================================================
   PinGrab - stylesheet
   Warm, Pinterest-inspired palette. Mobile-first, light + dark, no frameworks.
   ========================================================================== */

/* ---------- tokens ---------- */
:root {
  --bg: #fffaf8;
  --bg-soft: #fff3ee;
  --surface: #ffffff;
  --surface-2: #fdf0eb;
  --surface-3: #fbe7e1;
  --border: #f0e1da;
  --border-strong: #e4cec5;
  --text: #201418;
  --text-soft: #3b2a30;
  --muted: #736067;
  --accent: #e60023;
  --accent-hover: #c5001e;
  --accent-soft: #ffecef;
  --accent-2: #ff5c5c;
  --on-accent: #ffffff;
  --ring: rgba(230, 0, 35, .3);
  --success: #0a7d4f;
  --success-soft: #e9fbf2;
  --danger: #c2001e;
  --danger-soft: #ffecef;
  --warn: #8a5a00;
  --warn-soft: #fff7e6;
  --dot: rgba(230, 0, 35, .085);
  --radius: 20px;
  --radius-sm: 12px;
  --shadow-sm: 0 1px 2px rgba(48, 16, 24, .05);
  --shadow: 0 2px 4px rgba(48, 16, 24, .04), 0 18px 44px -20px rgba(48, 16, 24, .22);
  --shadow-pop: 0 24px 60px -24px rgba(48, 16, 24, .3);
  --maxw: 1080px;
  --header-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

html[data-theme="dark"] {
  --bg: #120b0e;
  --bg-soft: #170e13;
  --surface: #1c1116;
  --surface-2: #25161d;
  --surface-3: #2f1b24;
  --border: #31202a;
  --border-strong: #462e3a;
  --text: #f9eef1;
  --text-soft: #eddde3;
  --muted: #b49aa5;
  --accent: #ff3550;
  --accent-hover: #ff5469;
  --accent-soft: #350f18;
  --accent-2: #ff7a6b;
  --on-accent: #ffffff;
  --ring: rgba(255, 53, 80, .42);
  --success: #43d69b;
  --success-soft: #0e2a20;
  --danger: #ff7b8f;
  --danger-soft: #351018;
  --warn: #f0c278;
  --warn-soft: #2c2110;
  --dot: rgba(255, 82, 105, .1);
  --shadow-sm: none;
  --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 22px 50px -24px rgba(0, 0, 0, .7);
  --shadow-pop: 0 32px 70px -24px rgba(0, 0, 0, .8);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #120b0e;
    --bg-soft: #170e13;
    --surface: #1c1116;
    --surface-2: #25161d;
    --surface-3: #2f1b24;
    --border: #31202a;
    --border-strong: #462e3a;
    --text: #f9eef1;
    --text-soft: #eddde3;
    --muted: #b49aa5;
    --accent: #ff3550;
    --accent-hover: #ff5469;
    --accent-soft: #350f18;
    --accent-2: #ff7a6b;
    --on-accent: #ffffff;
    --ring: rgba(255, 53, 80, .42);
    --success: #43d69b;
    --success-soft: #0e2a20;
    --danger: #ff7b8f;
    --danger-soft: #351018;
    --warn: #f0c278;
    --warn-soft: #2c2110;
    --dot: rgba(255, 82, 105, .1);
    --shadow-sm: none;
    --shadow: 0 2px 4px rgba(0, 0, 0, .3), 0 22px 50px -24px rgba(0, 0, 0, .7);
    --shadow-pop: 0 32px 70px -24px rgba(0, 0, 0, .8);
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}
img, svg, video { max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.025em; color: var(--text); }
h1 { font-size: clamp(1.85rem, 5.4vw, 3.15rem); font-weight: 850; }
h2 { font-size: clamp(1.35rem, 3.2vw, 1.9rem); font-weight: 800; }
h3 { font-size: 1.02rem; font-weight: 700; }
p { margin: 0 0 1rem; }
ul, ol { padding-left: 1.25rem; margin: 0 0 1rem; }
li { margin: .3rem 0; }
code, kbd { font-family: var(--mono); font-size: .88em; }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; border-radius: 8px; }
::selection { background: var(--accent); color: #fff; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 18px; }
.narrow { max-width: 820px; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- opterik top bar ---------- */
.opterik-bar {
  background: var(--bg-soft); border-bottom: 1px solid var(--border);
  text-align: center; padding: 6px 12px; font-size: .78rem;
}
.opterik-bar a { color: var(--muted); font-weight: 650; }
.opterik-bar a:hover { color: var(--accent); text-decoration: none; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 10px; min-height: var(--header-h); }
.brand {
  display: inline-flex; align-items: center; gap: 10px; flex: 0 0 auto;
  font-weight: 850; letter-spacing: -.03em; color: var(--text); font-size: 1.16rem;
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 32px; height: 32px; flex: 0 0 auto; border-radius: 9px; box-shadow: var(--shadow-sm); }
.brand-name span { color: var(--accent); }
.nav { margin-left: auto; display: flex; align-items: center; gap: 2px; }
.nav a {
  color: var(--muted); font-weight: 600; font-size: .92rem;
  padding: 8px 11px; border-radius: 9px; text-decoration: none;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); background: var(--surface-2); text-decoration: none; }
.nav-toggle {
  display: none; margin-left: auto; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 8px 10px; cursor: pointer; line-height: 0;
}
.header-actions { display: flex; align-items: center; gap: 8px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 10px 16px; border-radius: 12px;
  font: inherit; font-weight: 650; font-size: .95rem; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  transition: transform .06s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  text-decoration: none; white-space: nowrap; text-align: center;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
  box-shadow: 0 10px 24px -12px var(--ring), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: .84rem; border-radius: 9px; }
.btn-icon { padding: 8px; min-height: 40px; min-width: 40px; }
.btn-lg { min-height: 52px; padding: 13px 22px; font-size: 1rem; border-radius: 13px; }
.btn-block { width: 100%; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 46px 0 18px;
  background:
    radial-gradient(58% 52% at 50% 0%, color-mix(in srgb, var(--accent) 11%, transparent) 0%, transparent 70%),
    radial-gradient(38% 40% at 88% 12%, color-mix(in srgb, var(--accent-2) 12%, transparent) 0%, transparent 70%);
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 78%);
}
.hero > * { position: relative; }
.hero-inner { text-align: center; max-width: 780px; margin: 0 auto; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); border-radius: 999px; padding: 6px 13px 6px 8px;
  font-size: .79rem; font-weight: 700; letter-spacing: .02em;
  box-shadow: var(--shadow-sm);
}
.eyebrow .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--success);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 18%, transparent);
  margin-left: 3px;
}
.eyebrow b { color: var(--text); font-weight: 750; }
.hero h1 { margin: 0 0 12px; }
.hero h1 em {
  font-style: normal; color: var(--accent);
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero .lead { font-size: clamp(1rem, 2.5vw, 1.13rem); color: var(--muted); max-width: 58ch; margin: 0 auto 10px; }
.hero .lead b { color: var(--text-soft); font-weight: 650; }
.badges {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  margin: 18px 0 0; padding: 0; list-style: none;
}
.badges li {
  display: inline-flex; align-items: center; gap: 6px;
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--border); color: var(--muted);
  border-radius: 999px; padding: 6px 12px; font-size: .79rem; font-weight: 650;
  backdrop-filter: blur(6px);
}
.badges svg { width: 14px; height: 14px; flex: 0 0 auto; color: var(--accent); }
.section[id], .hero { scroll-margin-top: calc(var(--header-h) + 10px); }

/* ---------- card / downloader ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.downloader {
  max-width: 840px; margin: 24px auto 0; padding: 20px;
  text-align: left; scroll-margin-top: calc(var(--header-h) + 16px);
}
.downloader.is-busy { cursor: progress; }
.field-label { display: block; font-weight: 700; font-size: .9rem; margin: 0 0 8px; color: var(--text-soft); }
.input-row { display: flex; gap: 10px; align-items: stretch; }
.input-wrap {
  position: relative; flex: 1 1 auto; display: flex; align-items: center;
  background: var(--bg-soft); border: 1.5px solid var(--border-strong); border-radius: 13px;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
  min-width: 0;
}
.input-wrap:focus-within {
  border-color: var(--accent); background: var(--surface);
  box-shadow: 0 0 0 4px var(--ring);
}
.input-wrap.is-invalid { border-color: var(--danger); }
.input-icon { position: absolute; left: 14px; color: var(--muted); display: flex; pointer-events: none; }
.input-icon svg { width: 19px; height: 19px; }
.input-wrap input {
  width: 100%; min-width: 0; border: 0; background: transparent; color: var(--text);
  font: inherit; font-size: .97rem; padding: 14px 88px 14px 44px; outline: none; border-radius: 12px;
}
.input-wrap input::placeholder { color: color-mix(in srgb, var(--muted) 72%, transparent); }
.input-action {
  position: absolute; right: 6px; border: 0; background: var(--surface); color: var(--text-soft);
  border: 1px solid var(--border); font: inherit; font-size: .8rem; font-weight: 700;
  padding: 7px 11px; border-radius: 9px; cursor: pointer; min-height: 34px;
}
.input-action:hover { background: var(--surface-2); }
.input-row .btn-primary { flex: 0 0 auto; }
.field-hint { margin: 9px 0 0; font-size: .82rem; color: var(--muted); }
.field-hint code {
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 1px 5px; border-radius: 5px; color: var(--text-soft); font-size: .78rem;
}
.spinner {
  width: 17px; height: 17px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite; display: inline-block; flex: 0 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- status ---------- */
.status {
  display: flex; align-items: flex-start; gap: 10px;
  margin: 14px 0 0; padding: 12px 14px; border-radius: 12px;
  font-size: .9rem; line-height: 1.45; border: 1px solid transparent;
}
.status svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 1px; }
.status[data-tone="error"] { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.status[data-tone="info"] { background: var(--surface-2); color: var(--text-soft); border-color: var(--border); }
.status[data-tone="success"] { background: var(--success-soft); color: var(--success); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.status[data-tone="warn"] { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 24%, transparent); }
.status a { color: inherit; font-weight: 700; text-decoration: underline; }
.status strong { font-weight: 750; }

/* ---------- skeleton ---------- */
.skeleton {
  display: grid; grid-template-columns: 220px 1fr; gap: 22px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border);
}
.sk-media { aspect-ratio: 3 / 4; border-radius: 16px; max-height: 300px; }
.sk-body { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.sk-line { height: 13px; border-radius: 7px; }
.sk-line.w40 { width: 40%; } .sk-line.w70 { width: 70%; } .sk-line.w55 { width: 55%; }
.sk-line.tall { height: 26px; } .sk-line.btn { height: 46px; width: 60%; margin-top: 8px; border-radius: 12px; }
.sk-media, .sk-line {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 40%, var(--surface-2) 60%);
  background-size: 300% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ---------- result ---------- */
.result {
  display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 22px;
  margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border);
  animation: fadeUp .32s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.result-media {
  position: relative; border-radius: 16px; overflow: hidden; background: var(--surface-3);
  aspect-ratio: 3 / 4; max-height: 320px; box-shadow: var(--shadow-sm);
}
.result-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.result-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(20, 8, 12, .55));
  pointer-events: none;
}
.play-btn {
  position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; z-index: 2;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .22); backdrop-filter: blur(8px);
  color: #fff; display: grid; place-items: center; cursor: pointer;
  transition: transform .15s ease, background .15s ease;
}
.play-btn:hover { transform: scale(1.06); background: var(--accent); border-color: var(--accent); }
.play-btn svg { width: 24px; height: 24px; margin-left: 2px; }
.duration-badge {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  background: rgba(18, 8, 12, .72); color: #fff; font-size: .75rem; font-weight: 700;
  padding: 3px 8px; border-radius: 7px; backdrop-filter: blur(4px);
  font-variant-numeric: tabular-nums;
}
.result-body { min-width: 0; display: flex; flex-direction: column; }
.kicker {
  display: inline-flex; align-items: center; gap: 7px; margin: 0 0 7px;
  color: var(--success); font-size: .76rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.kicker .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.result-title {
  font-size: clamp(1.08rem, 2.4vw, 1.32rem); font-weight: 750; letter-spacing: -.02em;
  margin: 0 0 6px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.result-author { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--muted); font-size: .88rem; }
.result-author img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--surface-2); }
.result-author .avatar-fallback {
  width: 24px; height: 24px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-size: .7rem; font-weight: 800;
}
.result-desc {
  margin: 0 0 12px; color: var(--muted); font-size: .86rem; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; }
.chips li {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-soft);
  border-radius: 7px; padding: 3px 8px; font-size: .76rem; font-weight: 650;
}
.chips li.hd { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.result-actions .btn-primary { flex: 1 1 220px; }
.result-note { margin: 12px 0 0; font-size: .78rem; color: var(--muted); }
.result-note code { color: var(--text-soft); }
.quality-select {
  display: flex; align-items: center; gap: 8px; margin: 0 0 12px;
  font-size: .82rem; color: var(--muted);
}
.quality-select select {
  font: inherit; font-size: .84rem; font-weight: 650; color: var(--text);
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 7px 10px; cursor: pointer;
}
.image-note { margin: 0 0 12px; font-size: .86rem; color: var(--muted); }

/* ---------- recent ---------- */
.recent { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.recent-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.recent-head h3 { margin: 0; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.recent-clear { background: none; border: 0; color: var(--muted); font: inherit; font-size: .78rem; cursor: pointer; text-decoration: underline; }
.recent-list { display: flex; gap: 10px; overflow-x: auto; padding: 0 0 4px; scrollbar-width: thin; scroll-snap-type: x proximity; }
.recent-item {
  flex: 0 0 208px; display: flex; align-items: center; gap: 10px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px; cursor: pointer; color: var(--text); font: inherit;
  scroll-snap-align: start; transition: border-color .15s ease, background .15s ease;
}
.recent-item:hover { border-color: var(--border-strong); background: var(--surface-2); }
.recent-thumb { width: 46px; height: 56px; border-radius: 8px; object-fit: cover; background: var(--surface-3); flex: 0 0 auto; }
.recent-meta { min-width: 0; }
.recent-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: .82rem; font-weight: 650; line-height: 1.35; margin: 0 0 3px;
}
.recent-sub { font-size: .72rem; color: var(--muted); }

/* ---------- sections ---------- */
.section { padding: 44px 0; }
.section-head { text-align: center; max-width: 62ch; margin: 0 auto 26px; }
.section-head p { color: var(--muted); margin: 0; }
.section-soft { background: var(--bg-soft); border-block: 1px solid var(--border); }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: step; }
.step {
  position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 22px 20px 18px; box-shadow: var(--shadow-sm);
}
.step-num {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent); font-weight: 850; font-size: .92rem;
  margin-bottom: 10px; border: 1px solid color-mix(in srgb, var(--accent) 16%, transparent);
}
.step h3 { margin: 0 0 5px; }
.step p { margin: 0; color: var(--muted); font-size: .9rem; }

/* features */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.feature-icon {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); margin-bottom: 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 14%, transparent);
}
.feature-icon svg { width: 19px; height: 19px; }
.feature h3 { margin: 0 0 4px; font-size: .98rem; }
.feature p { margin: 0; color: var(--muted); font-size: .875rem; line-height: 1.5; }

/* support panel */
.support-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 20px; }
.panel h3 { margin: 0 0 4px; }
.panel > p { color: var(--muted); font-size: .88rem; }
.example-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.example-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.example-list code {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px;
  padding: 5px 9px; font-size: .78rem; color: var(--text-soft); word-break: break-all;
}
.example-list span { font-size: .78rem; color: var(--muted); }
.quality-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.quality-table th, .quality-table td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--border); }
.quality-table th { color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 750; }
.quality-table tr:last-child td { border-bottom: 0; }
.quality-table td:first-child { font-weight: 650; white-space: nowrap; }
.quality-table td { color: var(--muted); }
.quality-table td b { color: var(--text-soft); font-weight: 650; }

/* faq */
.faq { display: flex; flex-direction: column; gap: 8px; max-width: 820px; margin: 0 auto; }
.faq-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 13px;
  overflow: hidden;
}
.faq-item summary {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  cursor: pointer; padding: 14px 16px; font-weight: 650; font-size: .95rem;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; flex: 0 0 auto; display: grid; place-items: center;
  width: 24px; height: 24px; border-radius: 7px; background: var(--surface-2);
  color: var(--accent); font-size: 1.05rem; font-weight: 700; line-height: 1;
  transition: transform .18s ease;
}
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item[open] summary { background: var(--bg-soft); }
.faq-body { padding: 4px 16px 16px; color: var(--muted); font-size: .92rem; }
.faq-body p:last-child { margin-bottom: 0; }
.faq-body a { font-weight: 650; }

/* disclaimer */
.disclaimer {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 22%, transparent);
  border-radius: 14px; padding: 16px 18px; max-width: 860px; margin: 0 auto;
}
.disclaimer svg { width: 20px; height: 20px; color: var(--warn); flex: 0 0 auto; margin-top: 2px; }
.disclaimer p { margin: 0; font-size: .86rem; color: var(--text-soft); }
.disclaimer strong { color: var(--warn); }

/* ads */
.ad-slot {
  margin: 22px auto; max-width: 970px; min-height: 92px;
  border: 1px dashed var(--border-strong); border-radius: 12px;
  display: none; place-items: center; color: var(--muted);
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  overflow: hidden;
}
.ad-slot.is-filled::before { content: 'Advertisement'; display: block; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.ad-slot.is-filled { display: grid; border: 0; background: none; min-height: 0; }
.ad-slot ins { display: block; }

/* Adsterra containers */
#adsterra-banners-top, #adsterra-banners, #adsterra-banners-mid { text-align: center; }
#adsterra-banners-top::before, #adsterra-banners::before, #adsterra-banners-mid::before {
  content: 'Advertisement'; display: block; font-size: .62rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-soft); padding: 34px 0 24px; margin-top: 12px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 26px; }
.footer-brand p { color: var(--muted); font-size: .86rem; max-width: 38ch; margin: 8px 0 0; }
.footer-col h4 { font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin: 0 0 10px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.footer-col a { color: var(--text-soft); font-size: .88rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between;
  border-top: 1px solid var(--border); margin-top: 26px; padding-top: 16px;
  color: var(--muted); font-size: .78rem;
}
.footer-bottom p { margin: 0; }

/* ---------- preview dialog ---------- */
.preview-dialog {
  border: 0; padding: 0; background: transparent; max-width: min(440px, 92vw); width: 100%;
  border-radius: 18px;
}
.preview-dialog::backdrop { background: rgba(16, 6, 10, .72); backdrop-filter: blur(4px); }
.preview-shell {
  position: relative; background: #000; border-radius: 18px; overflow: hidden;
  box-shadow: var(--shadow-pop); max-height: 86vh;
}
.preview-shell video { display: block; width: 100%; max-height: 86vh; background: #000; }
.preview-close {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .35);
  background: rgba(0, 0, 0, .5); color: #fff; cursor: pointer; font-size: 1.15rem;
  display: grid; place-items: center; line-height: 1;
}
.preview-close:hover { background: var(--accent); border-color: var(--accent); }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translate(-50%, 14px);
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px;
  font-size: .86rem; font-weight: 600; z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; max-width: 90vw; text-align: center;
  box-shadow: var(--shadow-pop);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- content pages ---------- */
.page { padding: 40px 0 20px; }
.page-header { max-width: 760px; margin: 0 auto 26px; text-align: center; }
.page-header .eyebrow { margin-bottom: 12px; }
.page-header p { color: var(--muted); font-size: 1.02rem; }
.prose { max-width: 780px; margin: 0 auto; }
.prose h2 { margin-top: 2rem; padding-top: .4rem; }
.prose h3 { margin-top: 1.5rem; }
.prose p, .prose li { color: var(--text-soft); }
.prose ul, .prose ol { margin-bottom: 1.1rem; }
.prose .card { padding: 20px 22px; margin: 18px 0; }
.prose .card p:last-child, .prose .card ul:last-child { margin-bottom: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 12px 0 20px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 11px; text-align: left; vertical-align: top; }
.prose th { background: var(--surface-2); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.prose td { color: var(--muted); }
.callout {
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  padding: 14px 16px; border-radius: 0 12px 12px 0; margin: 18px 0; font-size: .92rem;
}
.callout p:last-child { margin: 0; }
.page-toc { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0 auto 8px; }
.page-toc a {
  font-size: .8rem; font-weight: 650; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 5px 11px;
}
.page-toc a:hover { color: var(--accent); border-color: var(--accent); text-decoration: none; }
.error-code {
  font-size: clamp(4rem, 14vw, 7rem); font-weight: 850; line-height: 1;
  letter-spacing: -.04em; margin: 4px 0 8px;
  background: linear-gradient(135deg, var(--accent), #ff7a59);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .features { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 20px; }
}

@media (max-width: 760px) {
  :root { --header-h: 60px; }
  .nav-toggle { display: inline-flex; }
  .nav {
    position: absolute; left: 12px; right: 12px; top: calc(var(--header-h) - 2px);
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    box-shadow: var(--shadow); padding: 8px; display: none; flex-direction: column;
    align-items: stretch; gap: 2px; margin: 0; z-index: 60;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: 10px 12px; }
  .header-actions { margin-left: auto; }
  .header-actions .install-label { display: none; }
  .header-actions #install-btn { padding: 8px 10px; }
  .hero { padding-top: 34px; }
  .steps { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; }
  .result { grid-template-columns: 1fr; }
  .result-media { max-height: 380px; aspect-ratio: 4 / 3; }
  .skeleton { grid-template-columns: 130px 1fr; }
  .result-actions .btn-primary { flex-basis: 100%; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  .container { padding: 0 14px; }
  .downloader { padding: 15px; border-radius: 17px; }
  .input-row { flex-direction: column; }
  .input-row .btn-primary { width: 100%; }
  .input-wrap input { padding-right: 74px; font-size: .92rem; }
  .features { grid-template-columns: 1fr; }
  .section { padding: 34px 0; }
  .hero { padding-top: 26px; }
  .eyebrow { font-size: .74rem; }
  .result-media { max-height: 320px; aspect-ratio: 4 / 3; }
  .footer-grid { grid-template-columns: 1fr; gap: 18px; }
  .footer-bottom { flex-direction: column; }
  .recent-item { flex-basis: 186px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}

@media print {
  .site-header, .site-footer, .ad-slot, .downloader, .preview-dialog, .toast { display: none !important; }
}
