/* HiViews — light (default) and dark themes. Static, no build step.
   Theme: <html data-theme="light|dark"> set by /assets/theme.js before the first paint.
   The :root block below holds the dark palette; the light block further down overrides it
   everywhere except under [data-theme="dark"]. */
:root {
  --bg: #0E1116;
  --bg-2: #11151B;
  --surface: #161B22;
  --surface-2: #1C222B;
  --border: #262C36;
  --border-strong: #353C48;
  --text: #E6EDF3;
  --muted: #8B949E;
  --teal: #2DD4BF;
  --lime: #A3E635;
  --teal-soft: rgba(45, 212, 191, 0.10);
  --teal-line: rgba(45, 212, 191, 0.35);
  --grad: linear-gradient(90deg, var(--teal), var(--lime));
  --warn: #E3B341;
  --danger: #F47067;
  --ok: #3FB950;
  /* Theme tokens (dark values) */
  --teal-bright: var(--teal);
  --lime-bright: var(--lime);
  --teal-icon: var(--teal);
  --grad-text: var(--grad);
  --accent-fill: var(--teal);
  --on-accent-fill: var(--bg);
  --on-accent: #0B0E12;
  --header-bg: var(--bg);
  --header-shadow: none;
  --text-strong: #fff;
  --ghost-hover-border: #46505E;
  --icon-tile-bg: var(--bg);
  --icon-tile-border: var(--border-strong);
  --chip-bg: transparent;
  --code-bg: #0B0E12;
  --code-text: #C9D1D9;
  --code-inline-bg: var(--bg);
  --tok-k: #79C0FF;
  --tok-s: #7EE0CF;
  --tok-n: #D2E88C;
  --tok-c: #8B949E;
  --dot: rgba(139, 148, 158, 0.16);
  --dot-cta: rgba(139, 148, 158, 0.14);
  --dot-tg: rgba(139, 148, 158, 0.13);
  --hero-glow: none;
  --cta-glow: none, none;
  --hero-fade-0: rgba(14, 17, 22, 0);
  --hero-fade-1: rgba(14, 17, 22, 0.6);
  --feed-glow: rgba(45, 212, 191, 0.05);
  --feed-line: rgba(38, 44, 54, 0.55);
  --live-glow: rgba(163, 230, 53, .7);
  --live-bg: var(--lime);
  --live-text: #0B0E12;
  --tag-bg: rgba(139, 148, 158, 0.12);
  --tag-text: var(--muted);
  --hello-bg: rgba(45, 212, 191, 0.12);
  --hello-text: var(--teal);
  --amt-text: var(--lime);
  --amt-bg: rgba(163, 230, 53, 0.10);
  --amt-border: rgba(163, 230, 53, 0.25);
  --done-bg: rgba(45, 212, 191, 0.12);
  --done-border: rgba(45, 212, 191, 0.3);
  --sk-a: #1C222B;
  --sk-b: #262C36;
  --tg-bg: #0B0E12;
  --tg-bubble: var(--surface-2);
  --pill-ok: rgba(63, 185, 80, 0.45);
  --pill-warn: rgba(227, 179, 65, 0.45);
  --pill-err: rgba(244, 112, 103, 0.45);
  --wave-arcs: #5EEAD4;
  --shadow-xs: none;
  --shadow-sm: none;
  --shadow: none;
  --shadow-feed: none;
  --shadow-featured: none;
  --btn-glow: none;
  --btn-glow-hover: none;
  --radius: 12px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --container: 1160px;
  --gutter: 16px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (min-width: 720px) { :root { --gutter: 24px; } }

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  overflow-x: hidden;
}
@supports (overflow: clip) { html { overflow-x: clip; } }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
@supports (overflow: clip) { body { overflow-x: clip; } }

img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
code, pre, .mono { font-family: var(--mono); }

.icon {
  width: 20px; height: 20px; flex: none;
  stroke: currentColor; fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }

.sr-only {
  position: absolute !important; 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: var(--gutter); top: -60px; z-index: 100;
  padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-weight: 600;
}
.skip-link:focus-visible { top: 12px; }

.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
  position: relative;
}
.nowrap { white-space: nowrap; }
.accent { color: var(--teal); }

/* Flat surface card */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: 15px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, filter .15s ease, transform .15s ease, box-shadow .15s ease;
}
.btn .icon { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: var(--on-accent); box-shadow: var(--btn-glow); }
.btn-primary:hover { filter: brightness(1.08); box-shadow: var(--btn-glow-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--ghost-hover-border); }
.btn-sm { min-height: 38px; padding: 7px 14px; font-size: 14px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--header-shadow);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -0.02em; flex: none;
}
.brand .logo-mark { width: 30px; height: 30px; overflow: visible; }
.wave-arcs { stroke: var(--wave-arcs); }
.hand-wave { transform-box: view-box; transform-origin: 15px 26px; }
@media (prefers-reduced-motion: no-preference) {
  .logo-mark.is-animated .hand-wave { animation: hand-wave 4s ease-in-out infinite; }
  .logo-mark.is-animated .wave-arcs { animation: arcs-flicker 4s ease-in-out infinite; }
  @keyframes hand-wave {
    0% { transform: rotate(0deg); }
    8% { transform: rotate(12deg); }
    18% { transform: rotate(-12deg); }
    28% { transform: rotate(12deg); }
    38% { transform: rotate(-12deg); }
    46%, 100% { transform: rotate(0deg); }
  }
  @keyframes arcs-flicker {
    0%, 100% { opacity: .35; }
    8%, 28% { opacity: 1; }
    18%, 38% { opacity: .55; }
    50% { opacity: .35; }
  }
}
.brand span b { font-weight: 700; color: var(--teal); }

.main-nav { margin-left: auto; }
.main-nav ul { display: flex; gap: 2px; }
.main-nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14.5px;
  transition: color .15s, background-color .15s;
}
.main-nav a:hover { color: var(--text); background: var(--surface); }
.main-nav a[aria-current="page"] { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch { display: inline-flex; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); }
.lang-switch ul { display: flex; }
.lang-switch a {
  display: block; padding: 5px 9px; border-radius: 6px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  color: var(--muted); text-decoration: none;
}
.lang-switch a:hover { color: var(--text); }
.lang-switch a[aria-current="page"] { color: var(--on-accent-fill); background: var(--accent-fill); }

.nav-toggle {
  display: none; width: 40px; height: 40px; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
}
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 1079px) {
  .nav-toggle { display: inline-flex; }
  .header-actions { margin-left: auto; }
  .main-nav {
    position: absolute; top: 100%; left: 0; right: 0; margin: 0;
    padding: 8px var(--gutter) 16px;
    background: var(--header-bg); border-bottom: 1px solid var(--border);
    display: none;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 2px; }
  .main-nav a { padding: 12px; font-size: 16px; }
}
@media (max-width: 419px) {
  .header-inner { gap: 8px; }
  .header-actions { gap: 6px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand .logo-mark { width: 26px; height: 26px; }
  .btn-login { padding-inline: 11px; }
  .btn-login .icon { display: none; }
  .lang-switch a { padding: 5px 7px; }
}

/* ---------- Sections ---------- */
.section { padding-block: 72px; position: relative; }
@media (min-width: 920px) { .section { padding-block: 96px; } }
.band { background: var(--bg-2); border-block: 1px solid var(--border); }

.section-head { max-width: 720px; margin-bottom: 40px; }
.section-head.center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 14px;
  font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--teal);
}
.eyebrow .icon { width: 15px; height: 15px; }
.section-title { font-size: clamp(28px, 4.2vw, 40px); letter-spacing: -0.03em; }
.section-lead { margin-top: 14px; color: var(--muted); font-size: 17px; }
.section-lead a { color: var(--teal); text-underline-offset: 3px; }
.section-lead strong { color: var(--text); }

.grad-text {
  background: var(--grad-text);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Hero ---------- */
.hero {
  padding-top: 56px; padding-bottom: 72px;
  position: relative;
  border-bottom: 1px solid var(--border);
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 22px 22px;
  background-position: -11px -11px;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--hero-glow);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, var(--hero-fade-0) 0%, var(--hero-fade-1) 70%, var(--bg) 100%);
}
.hero > .container { z-index: 1; }
@media (min-width: 920px) { .hero { padding-top: 88px; padding-bottom: 96px; } }
.hero-grid { display: grid; gap: 40px; align-items: center; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 980px) { .hero-grid { grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr); gap: 56px; } }
.hero-grid > * { min-width: 0; }
.hero-title { font-size: clamp(36px, 7vw, 62px); line-height: 1.04; letter-spacing: -0.04em; font-weight: 800; }
.hero-lead { margin-top: 20px; max-width: 560px; color: var(--muted); font-size: clamp(16.5px, 2vw, 18.5px); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-points { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 26px; color: var(--muted); font-size: 14px; font-weight: 500; }
.hero-points li { display: inline-flex; align-items: center; gap: 8px; }
.hero-points .icon { width: 16px; height: 16px; color: var(--teal-icon); }
@media (max-width: 479px) { .hero-cta .btn { width: 100%; } }

/* ---------- Live feed (hero) ---------- */
.feed { overflow: hidden; --row: 60px; position: relative;
  background: linear-gradient(180deg, var(--feed-glow), transparent 40%), var(--surface); box-shadow: var(--shadow-feed); }
.feed-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--muted);
}
.feed-live { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.feed-live .dot { position: relative; width: 9px; height: 9px; border-radius: 50%; background: var(--lime-bright); box-shadow: 0 0 10px var(--live-glow); }
.feed-head-r { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.feed-rate { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed-note { padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-strong); font-size: 11px; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.feed:not(.is-live) .feed-note { visibility: hidden; }  /* LIVE only once real data is shown */
.feed.is-live .feed-note { color: var(--live-text); background: var(--live-bg); border-color: transparent; }
.feed-list { height: calc(var(--row) * 7); overflow: hidden; position: relative;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent); mask-image: linear-gradient(180deg, #000 70%, transparent); }
.feed-row {
  display: grid; align-items: center; gap: 12px; grid-template-columns: 36px minmax(0, 1fr) auto;
  height: var(--row); padding: 0 16px; border-bottom: 1px solid var(--feed-line);
}
.feed-av { width: 36px; height: 36px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px; color: #0B0E12; background: linear-gradient(135deg, #2DD4BF, #A3E635); }
.feed-av[data-tone="1"] { background: linear-gradient(135deg, #38BDF8, #2DD4BF); }
.feed-av[data-tone="2"] { background: linear-gradient(135deg, #A78BFA, #38BDF8); }
.feed-av[data-tone="3"] { background: linear-gradient(135deg, #F59E0B, #A3E635); }
.feed-av[data-tone="4"] { background: linear-gradient(135deg, #F472B6, #A78BFA); }
.feed-av[data-tone="5"] { background: linear-gradient(135deg, #34D399, #A3E635); }
.feed-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.feed-bot { color: var(--text); font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; min-width: 0; }
.feed-meta time { font-variant-numeric: tabular-nums; }
.feed-tag { padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; color: var(--tag-text);
  background: var(--tag-bg); }
.feed-tag.is-hello { color: var(--hello-text); background: var(--hello-bg); }
.feed-amt { justify-self: end; padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--amt-text); background: var(--amt-bg); border: 1px solid var(--amt-border); }
.feed-amt.is-done { width: 26px; height: 26px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
  background: var(--done-bg); border-color: var(--done-border); }
.feed-amt.is-done::before { content: ""; width: 10px; height: 6px; border-left: 2px solid var(--teal); border-bottom: 2px solid var(--teal);
  transform: rotate(-45deg) translate(1px, -1px); }
.feed-foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
  padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted);
}
.feed-foot b { color: var(--text); font-weight: 600; }
@media (max-width: 559px) {
  .feed { --row: 56px; border-radius: 16px; }
  .feed-head { padding: 10px 12px; }
  .feed-live { gap: 8px; font-size: 13.5px; }
  .feed-rate { font-size: 11.5px; }
  .feed-list { height: calc(var(--row) * 5); }  /* 5 rows on phones: the card stays compact */
  .feed-row { padding: 0 12px; gap: 10px; grid-template-columns: 34px minmax(0, 1fr) auto; }
  .feed-av { width: 34px; height: 34px; border-radius: 10px; font-size: 14px; }
  .feed-bot { font-size: 14px; }
  .feed-meta { gap: 6px; font-size: 11.5px; }
  .feed-tag { font-size: 10.5px; padding: 1px 6px; }
  .feed-amt { font-size: 12.5px; padding: 3px 9px; }
  .feed-foot { justify-content: center; flex-wrap: nowrap; gap: 0; padding: 9px 10px; font-size: 11.5px; white-space: nowrap; }
  .feed-foot span + span::before { content: "·"; margin: 0 7px; color: var(--border-strong); }
}
@media (max-width: 389px) {
  .feed-foot { font-size: 10.5px; padding: 9px 8px; }
  .feed-foot span + span::before { margin: 0 5px; }
}
@media (max-width: 339px) { .feed-rate { display: none; } .feed-foot span:last-child { display: none; } }
@media (prefers-reduced-motion: no-preference) {
  .feed-live .dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--lime-bright);
    animation: feed-ping 1.8s ease-out infinite; }
  @keyframes feed-ping { from { opacity: .8; transform: scale(.5); } to { opacity: 0; transform: scale(1.6); } }
  .feed-row.is-new { animation: feed-in .6s cubic-bezier(.2, .8, .2, 1) both; }
  @keyframes feed-in {
    from { opacity: 0; transform: translateY(-14px) scale(.98); background: rgba(45, 212, 191, 0.14); }
    55% { opacity: 1; background: rgba(45, 212, 191, 0.08); }
    to { transform: none; background: transparent; }
  }
}

/* ---------- Stats ---------- */
.stats { padding-top: 56px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 920px) { .stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }
.stat { padding: 18px 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
@media (min-width: 720px) { .stat { padding: 22px 22px; } }
.stat-icon { color: var(--teal-icon); margin-bottom: 6px; }
.stat-icon .icon { width: 20px; height: 20px; }
.stat-value {
  font-family: var(--mono); font-variant-numeric: tabular-nums;
  font-size: clamp(20px, 5vw, 30px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15;
  overflow-wrap: anywhere; min-height: 1.15em;
}
.stat-label { color: var(--muted); font-size: 14px; font-weight: 500; line-height: 1.35; }
.stats-note { margin-top: 14px; color: var(--muted); font-size: 13px; text-align: center; min-height: 1.4em; font-family: var(--mono); }
.skeleton {
  display: inline-block; width: 70%; max-width: 140px; height: .8em; border-radius: 4px; vertical-align: middle;
  background: linear-gradient(90deg, var(--sk-a) 0%, var(--sk-b) 50%, var(--sk-a) 100%); background-size: 200% 100%;
}
@media (prefers-reduced-motion: no-preference) {
  .skeleton { animation: shimmer 1.4s linear infinite; }
  @keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
}

/* ---------- Steps & features ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.split > * { min-width: 0; }
@media (min-width: 920px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; } }

.steps { counter-reset: step; display: grid; gap: 10px; }
.step { display: grid; grid-template-columns: 36px 1fr; gap: 14px; padding: 18px; }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--teal); border: 1px solid var(--teal-line); background: var(--teal-soft);
}
.step h3 { font-size: 17px; margin-bottom: 4px; letter-spacing: -0.01em; font-weight: 600; }
.step p { color: var(--muted); font-size: 15px; }

.features { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.feature { padding: 20px; }
.feature-icon {
  width: 38px; height: 38px; border-radius: 8px;
  display: grid; place-items: center; margin-bottom: 14px;
  color: var(--teal-icon); border: 1px solid var(--icon-tile-border); background: var(--icon-tile-bg);
}
.feature-icon .icon { width: 19px; height: 19px; }
.feature h3 { font-size: 16.5px; margin-bottom: 6px; letter-spacing: -0.01em; font-weight: 600; }
.feature p { color: var(--muted); font-size: 15px; }
.section-cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Code ---------- */
.code-card { overflow: hidden; min-width: 0; background: var(--code-bg); }
.code-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 8px 8px 12px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.tabs { display: flex; flex-wrap: wrap; gap: 2px; }
.tab {
  font: inherit; font-family: var(--mono); font-size: 12.5px; font-weight: 500;
  padding: 6px 10px; border-radius: 6px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--teal); }
.copy-btn {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  font: inherit; font-size: 13px; font-weight: 500;
  padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); cursor: pointer;
}
.copy-btn:hover { border-color: var(--ghost-hover-border); }
.copy-btn .icon { width: 15px; height: 15px; }
.copy-btn .icon-check { display: none; color: var(--lime); }
.copy-btn.is-copied .icon-copy { display: none; }
.copy-btn.is-copied .icon-check { display: block; }
.code-panel { margin: 0; }
.code-panel pre {
  margin: 0; padding: 16px 18px 18px; overflow-x: auto;
  font-size: 13px; line-height: 1.7; color: var(--code-text); tab-size: 2;
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 479px) { .code-panel pre { font-size: 12px; padding-inline: 14px; } }
.code-panel code { font-family: inherit; }
.tok-k { color: var(--tok-k); }
.tok-s { color: var(--tok-s); }
.tok-n { color: var(--tok-n); }
.tok-c { color: var(--tok-c); font-style: italic; }
.code-response {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 12px 18px; border-top: 1px solid var(--border);
  font-size: 13.5px; color: var(--muted); background: var(--surface);
}
.code-response code {
  font-size: 12.5px; color: var(--text); padding: 2px 8px;
  border-radius: var(--radius-xs); background: var(--code-inline-bg); border: 1px solid var(--border);
}
.status-ok { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-weight: 600; color: var(--ok); }
.status-ok::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.params { margin-top: 16px; display: grid; gap: 8px; font-size: 14.5px; color: var(--muted); }
.params li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.params code, .step code, .faq-answer code, .section-lead code {
  font-size: 0.86em; color: var(--text);
  padding: 1px 6px; border-radius: var(--radius-xs);
  background: var(--code-inline-bg); border: 1px solid var(--border);
  overflow-wrap: anywhere;
}
.docs-link { margin-top: 16px; }
.docs-link a { display: inline-flex; align-items: center; gap: 8px; color: var(--teal); font-weight: 600; text-decoration: none; }
.docs-link a:hover { text-decoration: underline; text-underline-offset: 4px; }
.docs-link .icon { width: 17px; height: 17px; }

/* ---------- Theme chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 720px) { .chips { justify-content: center; } }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--chip-bg);
  color: var(--text); font-size: 14.5px; font-weight: 500; line-height: 1.2;
  box-shadow: var(--shadow-xs);
  transition: border-color .15s;
}
.chip:hover { border-color: var(--teal-line); }
.chip .icon { width: 16px; height: 16px; color: var(--teal-icon); }
.chip-share {
  margin-left: 2px; font-family: var(--mono); font-size: 12px; font-weight: 500;
  color: var(--muted); font-variant-numeric: tabular-nums;
  padding-left: 8px; border-left: 1px solid var(--border-strong);
}
.chip-share[hidden] { display: none; }

/* ---------- Pricing ---------- */
.price-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); max-width: 920px; margin-inline: auto; }
@media (min-width: 720px) { .price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.price-card { padding: 24px; display: flex; flex-direction: column; gap: 12px; position: relative; }
.price-card.is-featured { border-color: var(--teal-line); box-shadow: var(--shadow-featured); }
.price-card.is-featured::before {
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px;
  background: var(--grad); border-radius: var(--radius) var(--radius) 0 0;
}
.price-head { display: flex; align-items: center; gap: 12px; }
.price-head .feature-icon { margin: 0; }
.price-head h3 { font-size: 18px; font-weight: 600; }
.price-desc { color: var(--muted); font-size: 15px; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }
.price-num { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 46px; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.price-unit { color: var(--muted); font-size: 14.5px; }
.price-notes {
  max-width: 920px; margin: 20px auto 0;
  display: grid; gap: 10px 24px; grid-template-columns: minmax(0, 1fr);
  color: var(--muted); font-size: 14px;
}
@media (min-width: 720px) { .price-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.price-notes li { display: flex; gap: 10px; align-items: flex-start; }
.price-notes .icon { width: 17px; height: 17px; margin-top: 2px; color: var(--teal-icon); }
.price-notes strong { color: var(--text); font-weight: 600; }
.price-notes li.verified {
  grid-column: 1 / -1;
  padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-xs);
}
.verified-badge {
  display: inline-flex; align-items: center; gap: 5px;
  width: 18px; height: 18px; justify-content: center; margin: 0 2px; border-radius: 50%;
  border: 1px solid var(--teal-line); color: var(--teal);
  font-family: var(--mono); font-size: 11.5px; font-weight: 500; vertical-align: 1px;
}
.verified-badge .icon { width: 12px; height: 12px; margin: 0; stroke-width: 2.6; }

/* ---------- Payments ---------- */
.pay-grid { display: grid; gap: 16px; }
@media (min-width: 920px) { .pay-grid { grid-template-columns: 1fr 1fr 0.9fr; } }
.pay-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.pay-card h3 { font-size: 18px; font-weight: 600; }
.pay-card > p { color: var(--muted); font-size: 15px; }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 11px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--bg);
  font-size: 14px; font-weight: 500; color: var(--text);
}
.badge .icon { width: 16px; height: 16px; color: var(--teal-icon); }
.badge small { font-family: var(--mono); font-weight: 400; color: var(--muted); font-size: 12px; }
.pay-meta { display: grid; gap: 6px; font-size: 14.5px; color: var(--muted); margin-top: auto; }
.pay-meta strong { color: var(--text); font-family: var(--mono); font-weight: 600; }
.big-num { font-family: var(--mono); font-size: 46px; font-weight: 600; line-height: 1; letter-spacing: -0.04em; color: var(--lime); }

/* ---------- FAQ ---------- */
.faq-list { max-width: 820px; margin-inline: auto; display: grid; gap: 8px; }
.faq-item { overflow: hidden; }
.faq-item[open] { border-color: var(--border-strong); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; font-weight: 600; font-size: 16px; line-height: 1.35;
  border-radius: var(--radius);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .icon { width: 18px; height: 18px; color: var(--muted); transition: transform .2s ease; }
.faq-item[open] summary .icon { transform: rotate(180deg); color: var(--teal); }
.faq-item summary:hover { color: var(--text-strong); }
.faq-answer { padding: 0 18px 18px; color: var(--muted); font-size: 15px; }
.faq-answer p + p { margin-top: 10px; }
.faq-answer a { color: var(--teal); text-underline-offset: 3px; }

/* ---------- Final CTA ---------- */
.cta-band {
  padding: 40px 24px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  background-image: var(--cta-glow), radial-gradient(var(--dot-cta) 1px, transparent 1px);
  background-size: auto, auto, 22px 22px;
  box-shadow: var(--shadow-sm);
}
@media (min-width: 720px) { .cta-band { padding: 56px 40px; } }
.cta-band h2 { font-size: clamp(26px, 4vw, 36px); letter-spacing: -0.03em; }
.cta-band p { margin: 12px auto 0; max-width: 560px; color: var(--muted); font-size: 17px; }
.cta-band .hero-cta { justify-content: center; }

/* ---------- Footer ---------- */
.site-footer { padding: 48px 0 32px; border-top: 1px solid var(--border); margin-top: 40px; }
.footer-grid { display: grid; gap: 28px; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.footer-about { color: var(--muted); font-size: 14.5px; margin-top: 12px; max-width: 360px; }
.footer-col h2 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; font-weight: 500; }
.footer-col ul { display: grid; gap: 8px; }
.footer-col a { color: var(--text); text-decoration: none; font-size: 15px; }
.footer-col a:hover { color: var(--teal); }
.footer-bottom {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px;
  color: var(--muted); font-size: 13px; font-family: var(--mono);
}

/* ---------- Docs page ---------- */
.docs-hero { padding-top: 48px; padding-bottom: 40px; }
@media (min-width: 920px) { .docs-hero { padding-top: 72px; padding-bottom: 56px; } }
.docs-hero h1 { font-size: clamp(32px, 6vw, 50px); letter-spacing: -0.04em; font-weight: 800; }
.docs-hero .hero-lead { max-width: 720px; }
.endpoint {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  margin-top: 24px; padding: 12px 14px; max-width: 720px;
  font-family: var(--mono); font-size: 14px; background: var(--code-bg);
}
.endpoint .method { padding: 3px 9px; border-radius: var(--radius-xs); background: var(--accent-fill); color: var(--on-accent-fill); font-weight: 600; font-size: 12.5px; }
.endpoint .url { overflow-wrap: anywhere; color: var(--text); }

.docs-layout { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); padding-top: 32px; padding-bottom: 40px; }
@media (min-width: 1080px) { .docs-layout { grid-template-columns: 210px minmax(0, 1fr); gap: 56px; } }
.toc { font-size: 14px; }
@media (min-width: 1080px) { .toc { position: sticky; top: 88px; align-self: start; } }
.toc h2 { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 10px; font-weight: 500; }
.toc ol { display: flex; flex-wrap: wrap; gap: 6px; }
@media (min-width: 1080px) { .toc ol { flex-direction: column; gap: 0; border-left: 1px solid var(--border); } }
.toc a {
  display: block; text-decoration: none; color: var(--muted); font-weight: 500;
  padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border);
}
@media (min-width: 1080px) {
  .toc a { border: 0; border-radius: 0; padding: 7px 14px; margin-left: -1px; border-left: 1px solid transparent; }
  .toc a:hover { border-left-color: var(--teal); }
}
.toc a:hover { color: var(--text); }

.doc { min-width: 0; }
.doc-section { padding-block: 8px 48px; }
.doc-section + .doc-section { border-top: 1px solid var(--border); padding-top: 40px; }
.doc h2 { font-size: clamp(24px, 3.4vw, 30px); margin-bottom: 14px; letter-spacing: -0.03em; }
.doc h3 { font-size: 17px; margin: 24px 0 10px; letter-spacing: -0.01em; font-weight: 600; }
.doc .step h3 { margin: 0 0 4px; }
.doc p, .doc li { color: var(--muted); }
.doc p + p { margin-top: 10px; }
.doc strong { color: var(--text); }
.doc a:not(.btn) { color: var(--teal); text-underline-offset: 3px; }
.doc :not(pre) > code {
  font-size: 0.86em; padding: 1px 6px; border-radius: var(--radius-xs);
  background: var(--code-inline-bg); border: 1px solid var(--border); color: var(--text);
  overflow-wrap: anywhere;
}
.doc .steps { margin-top: 8px; }
.bullets { display: grid; gap: 10px; margin-top: 12px; }
.bullets li { display: flex; gap: 12px; align-items: flex-start; }
.bullets .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--teal-icon); }

.callout {
  display: flex; gap: 12px; align-items: flex-start;
  margin-top: 18px; padding: 14px 16px;
  border: 1px solid var(--border); border-left: 3px solid var(--teal);
  border-radius: var(--radius-sm); background: var(--surface);
  box-shadow: var(--shadow-xs);
  font-size: 15px;
}
.callout .icon { width: 19px; height: 19px; margin-top: 2px; color: var(--teal-icon); }
.callout.warn { border-left-color: var(--warn); }
.callout.warn .icon { color: var(--warn); }
.doc .callout p { color: var(--text); }

.table-card { overflow: hidden; margin-top: 12px; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.doc-table th {
  text-align: left; font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); font-weight: 500;
  padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.doc-table td { padding: 11px 16px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--muted); }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table td:first-child { white-space: nowrap; }
.doc-table code { white-space: normal; }
.pill {
  display: inline-block; padding: 1px 8px; border-radius: var(--radius-xs);
  font-family: var(--mono); font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--border-strong); color: var(--text);
}
.pill.ok { color: var(--ok); border-color: var(--pill-ok); }
.pill.warn { color: var(--warn); border-color: var(--pill-warn); }
.pill.err { color: var(--danger); border-color: var(--pill-err); }
@media (min-width: 640px) {
  .doc-table td:first-child code { white-space: nowrap; overflow-wrap: normal; }
}
@media (max-width: 639px) {
  .doc-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .doc-table, .doc-table tbody, .doc-table tr, .doc-table td { display: block; width: 100%; }
  .doc-table tr { padding: 12px 16px; border-bottom: 1px solid var(--border); }
  .doc-table tr:last-child { border-bottom: 0; }
  .doc-table td { padding: 2px 0; border: 0; white-space: normal; }
  .doc-table td:first-child { white-space: normal; }
  .doc-table td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: 12px; font-family: var(--mono); }
}
.code-card.big .code-top { align-items: flex-start; }

/* ---------- Reveal ---------- */
@media (prefers-reduced-motion: no-preference) {
  .js .reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
  .js .reveal.is-visible { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Why HiViews ---------- */
.why { padding-top: 72px; padding-bottom: 8px; }
@media (min-width: 920px) { .why { padding-top: 96px; } }
.why-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 920px) { .why-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; } }
.why-card { padding: 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 720px) { .why-card { padding: 32px; } }
.why-num { font-family: var(--mono); font-size: 13px; color: var(--teal); letter-spacing: .08em; }
.why-card h3 { font-size: clamp(22px, 2.6vw, 27px); letter-spacing: -0.03em; }
.why-text { color: var(--muted); font-size: 16px; }
.why-text code {
  font-size: .86em; color: var(--text); padding: 1px 6px; border-radius: var(--radius-xs);
  background: var(--code-inline-bg); border: 1px solid var(--border);
}

/* flow: /start -> ad -> greeting */
.flow { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); margin-top: 6px; }
@media (min-width: 560px) { .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; } }
.flow-step {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--bg);
}
.flow-step.is-ad { border-color: var(--teal-line); background: var(--teal-soft); }
.flow-key { font-family: var(--mono); font-size: 14px; font-weight: 600; color: var(--text); }
.flow-step.is-ad .flow-key { color: var(--teal); }
.flow-desc { color: var(--muted); font-size: 13.5px; line-height: 1.4; }
.flow-step:not(:last-child)::after {
  content: ""; position: absolute; left: 50%; bottom: -17px;
  width: 8px; height: 8px; margin-left: -4px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
}
@media (min-width: 560px) {
  .flow-step:not(:last-child)::after { left: auto; right: -19px; top: 50%; bottom: auto; margin: -4px 0 0; transform: rotate(-45deg); }
}
.why-points { display: grid; gap: 8px; margin-top: 4px; color: var(--muted); font-size: 15px; }
.why-points li { display: flex; gap: 10px; align-items: flex-start; }
.why-points .icon { width: 17px; height: 17px; margin-top: 3px; color: var(--lime); }

/* Telegram-style post mock (no phone frame) */
.tg-demo {
  margin: 4px 0 0; padding: 20px 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background-color: var(--tg-bg);
  background-image: radial-gradient(var(--dot-tg) 1px, transparent 1px);
  background-size: 18px 18px;
}
.tg-stack { max-width: 330px; margin-inline: auto; }
.tg-bubble { background: var(--tg-bubble); border: 1px solid var(--border); box-shadow: var(--shadow-xs); border-radius: 12px 12px 12px 4px; overflow: hidden; }
.tg-media {
  height: 132px; display: grid; place-items: center; color: rgba(14, 17, 22, .75);
  background: linear-gradient(135deg, #115E59 0%, #2DD4BF 55%, #A3E635 100%);
}
.tg-media .icon { width: 42px; height: 42px; stroke-width: 1.5; }
.tg-text { padding: 10px 12px 2px; font-size: 14.5px; line-height: 1.45; color: var(--text); }
.tg-text b { font-weight: 700; }
.tg-meta { display: flex; justify-content: space-between; gap: 8px; padding: 2px 12px 8px; font-size: 11.5px; color: var(--muted); }
.tg-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.tg-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 10px; border-radius: 8px;
  font-size: 14px; font-weight: 600; color: #fff; text-align: center;
}
.tg-green { background: #1A7F37; }
.tg-blue { background: #0969DA; }
.why-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.why-tags li {
  padding: 4px 10px; border-radius: 8px; border: 1px solid var(--border-strong);
  font-size: 13px; color: var(--text);
}
.why-foot { margin-top: auto; font-size: 12.5px; color: var(--muted); }

/* ---------- SEO text block ---------- */
.seo-grid { display: grid; gap: 28px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 920px) { .seo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; } }
.seo-item h3 { font-size: 18px; font-weight: 600; margin-bottom: 10px; letter-spacing: -0.01em; }
.seo-item p { color: var(--muted); font-size: 15.5px; }
.seo-item .docs-link { margin-top: 12px; }

/* ---------- Guides ---------- */
.breadcrumbs { margin-bottom: 18px; font-size: 13.5px; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; color: var(--border-strong); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--teal); }
.breadcrumbs [aria-current] { color: var(--text); }
.toc a[aria-current="page"] { color: var(--text); border-color: var(--teal-line); }
@media (min-width: 1080px) { .toc a[aria-current="page"] { border-left-color: var(--teal); } }

.guide-cards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); margin-top: 8px; }
@media (min-width: 640px) { .guide-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.doc .guide-cards li { color: inherit; }
.guide-card {
  display: grid; grid-template-columns: auto 1fr; column-gap: 12px; row-gap: 2px;
  padding: 16px; text-decoration: none; height: 100%;
  transition: border-color .15s, box-shadow .15s;
}
.guide-card:hover { border-color: var(--teal-line); box-shadow: var(--shadow); }
.guide-card .icon { grid-row: span 2; width: 20px; height: 20px; margin-top: 2px; color: var(--teal-icon); }
.guide-card-title { color: var(--text); font-weight: 600; }
.guide-card-text { color: var(--muted); font-size: 14px; }
.doc a.guide-card:not(.btn) { color: inherit; text-decoration: none; }

.two-cards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .two-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.mini-card { padding: 18px; }
.doc .mini-card h3 { margin: 0 0 6px; }
.table-note { margin-top: 10px; font-size: 14px; }
.doc .faq-list { margin: 8px 0 0; max-width: none; }
.callout > div p + p { margin-top: 8px; }

/* ---------- 404 ---------- */
.notfound { min-height: 60vh; display: flex; align-items: center; }
.notfound h1 { font-size: clamp(30px, 5vw, 46px); letter-spacing: -0.03em; margin-top: 8px; }
.nf-code { font-family: var(--mono); font-size: clamp(56px, 12vw, 104px); font-weight: 600; line-height: 1; letter-spacing: -0.05em; color: var(--teal); }
.notfound .hero-lead + .hero-lead { margin-top: 8px; font-size: 15.5px; }

.cta-alt { margin-top: 12px; font-size: 14px; color: var(--muted); }
.cta-alt a { color: var(--teal); text-underline-offset: 3px; }
.cta-band .cta-alt { text-align: center; }

/* ---------- QA pass 2026-10: CSP-safe helpers, touch targets, mobile polish ---------- */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.section-cta-final { padding-top: 0; }
@media (min-width: 920px) { .section-cta-final { padding-top: 0; } }

.pay-card > .big-num { font-size: 46px; color: var(--lime); }
.badge { white-space: nowrap; max-width: 100%; }
.params li { display: block; }
.params li > code:first-child { margin-right: 6px; }
.docs-link a { min-height: 44px; }
.cta-alt a { padding-block: 14px; }

/* Mobile menu: full-height sheet with its own scroll */
@media (max-width: 1079px) {
  .main-nav.is-open {
    height: calc(100vh - 64px); height: calc(100dvh - 64px);
    overflow-y: auto; overscroll-behavior: contain;
  }
  .main-nav a { min-height: 48px; display: flex; align-items: center; }
  html.nav-open { overflow: hidden; }  /* html only: hiding body overflow too makes it a scroller and unsticks the header (menu jumps to page top) */
}

/* Touch devices & narrow screens: every control ≥ 44×44 */
@media (max-width: 1079px), (pointer: coarse) {
  .brand { min-height: 44px; }
  .nav-toggle { width: 44px; height: 44px; }
  .btn-sm { min-height: 44px; }
  .lang-switch { padding: 0; border: 0; background: none; }
  .lang-switch li:has(> a[aria-current="page"]) { display: none; }
  .lang-switch ul { gap: 6px; }
  .lang-switch a {
    display: grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 10px;
    border-radius: var(--radius-sm); border: 1px solid var(--border-strong); background: var(--surface);
    font-size: 13.5px; color: var(--text);
  }
  .lang-switch a[aria-current="page"] { color: var(--on-accent-fill); }
  .tab { min-height: 44px; padding: 8px 12px; font-size: 13.5px; }
  .copy-btn { min-height: 44px; padding: 8px 12px; font-size: 14px; }
  .toc a { min-height: 44px; display: flex; align-items: center; }
  .breadcrumbs a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; }
  .breadcrumbs { margin-bottom: 8px; }
  .footer-col ul { gap: 0; }
  .footer-col a { display: inline-flex; align-items: center; min-height: 44px; min-width: 44px; }
}
/* Code tabs never wrap into several rows: they scroll sideways instead */
.code-top .tabs { flex-wrap: nowrap; overflow-x: auto; min-width: 0; scrollbar-width: none; }
.code-top .tabs::-webkit-scrollbar { display: none; }
.tab { white-space: nowrap; flex: none; }

/* Readable sizes on phones */
.why-foot { font-size: 14px; }
.flow-desc { font-size: 14px; }
.why-tags li { font-size: 14px; }
.code-response { font-size: 14px; }
.chip-share { font-size: 12.5px; }
@media (max-width: 479px) {
  .code-panel pre { font-size: 12.5px; }
  .section-cta .btn { width: 100%; }
}
@media (max-width: 1079px) {
  .main-nav ul { gap: 0; }
  .main-nav li + li { border-top: 1px solid var(--border); }
  .main-nav a { color: var(--text); font-size: 17px; padding: 12px 4px; border-radius: 0; }
  .main-nav a:hover { background: transparent; color: var(--teal); }
}
/* No orphan words in headings; nicer paragraph rag where supported */
h1, h2, h3, summary, .hero-lead, .section-lead { text-wrap: balance; }
p, li { text-wrap: pretty; }

/* Blog: Telegram post mock-ups inside articles; article list on the home page */
.doc .tg-text { color: var(--text); }
.doc .tg-meta { margin-top: 0; }
.doc .tg-demo { margin-top: 12px; }
.home-blog { max-width: 960px; margin-inline: auto; }
.docs-link.center { text-align: center; }
@media (min-width: 960px) { .home-blog { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* Pricing with three cards (impressions ×2 + pay-per-click) */
.price-grid.is-three { max-width: 1080px; }
@media (min-width: 720px) and (max-width: 959px) { .price-grid.is-three > :last-child { grid-column: 1 / -1; } }
@media (min-width: 960px) { .price-grid.is-three { grid-template-columns: repeat(3, minmax(0, 1fr)); } }


/* Feed: real bot avatars fade in over the letter tile */
.feed-av { position: relative; overflow: hidden; }
.feed-av img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feed-av.has-photo { color: transparent; background: var(--surface-2); box-shadow: 0 0 0 1px var(--border) inset; }

/* Feed placeholders until the real data arrives (no example rows) */
.feed-sk .feed-av { background: var(--surface-2); }
.feed-sk .feed-main { gap: 7px; }
.feed-sk .sk-line { display: block; height: 10px; border-radius: 6px; background: var(--surface-2); }
.feed-sk .sk-line.w60 { width: 60%; } .feed-sk .sk-line.w35 { width: 35%; }
.feed-sk .sk-pill { width: 54px; height: 24px; border-radius: 999px; background: var(--surface-2); }
@media (prefers-reduced-motion: no-preference) {
  .feed-sk > * { animation: feed-sk 1.4s ease-in-out infinite; }
  @keyframes feed-sk { 50% { opacity: .45; } }
}

/* =====================================================================
   Light theme = the DEFAULT (also without JS). Dark applies only under
   <html data-theme="dark"> (the user's explicit choice, see theme.js).
   Tokens are shared with the cabinet.
   ===================================================================== */
:root:not([data-theme="dark"]) {
  color-scheme: light;
  --bg: #F7F9FC;
  --bg-2: #EEF3F8;
  --surface: #FFFFFF;
  --surface-2: #F1F5F9;
  --border: #E3E8EF;
  --border-strong: #CBD5E1;
  --text: #0F172A;
  --muted: #5B6676;
  --teal: #0F766E;              /* text-safe on #F7F9FC/#FFFFFF/#EEF3F8 (>= 4.9:1) */
  --teal-icon: #0D9488;         /* icons & UI marks (>= 3.5:1) */
  --teal-bright: #14B8A6;       /* fills */
  --lime: #4D7C0F;              /* text-safe lime (>= 4.6:1) */
  --lime-bright: #84CC16;       /* fills */
  --teal-soft: rgba(20, 184, 166, 0.09);
  --teal-line: rgba(13, 148, 136, 0.32);
  --grad: linear-gradient(90deg, #14B8A6, #84CC16);
  --grad-text: linear-gradient(90deg, #0D9488 0%, #0F9F6E 50%, #5A9A0B 100%);
  --warn: #A84B08;
  --danger: #C81E1E;
  --ok: #15803D;
  --accent-fill: #0F766E;
  --on-accent-fill: #FFFFFF;
  --on-accent: #052E2B;
  --header-bg: #FFFFFF;
  --header-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 8px 24px -16px rgba(15, 23, 42, 0.18);
  --text-strong: #020617;
  --ghost-hover-border: #94A3B8;
  --icon-tile-bg: linear-gradient(135deg, rgba(20, 184, 166, 0.10), rgba(132, 204, 22, 0.10));
  --icon-tile-border: rgba(13, 148, 136, 0.20);
  --chip-bg: #FFFFFF;
  --code-bg: #F1F5F9;
  --code-text: #1E293B;
  --code-inline-bg: #EEF3F8;
  --tok-k: #1D4ED8;
  --tok-s: #0F766E;
  --tok-n: #4D7C0F;
  --tok-c: #5B6676;
  --dot: rgba(15, 23, 42, 0.075);
  --dot-cta: rgba(15, 23, 42, 0.06);
  --dot-tg: rgba(15, 23, 42, 0.07);
  --hero-glow:
    radial-gradient(55% 70% at 8% 0%, rgba(20, 184, 166, 0.18), transparent 70%),
    radial-gradient(45% 60% at 96% 18%, rgba(132, 204, 22, 0.16), transparent 70%),
    radial-gradient(40% 45% at 60% 100%, rgba(20, 184, 166, 0.07), transparent 70%);
  --cta-glow:
    radial-gradient(50% 90% at 0% 0%, rgba(20, 184, 166, 0.12), transparent 70%),
    radial-gradient(50% 90% at 100% 100%, rgba(132, 204, 22, 0.13), transparent 70%);
  --hero-fade-0: rgba(247, 249, 252, 0);
  --hero-fade-1: rgba(247, 249, 252, 0.35);
  --feed-glow: rgba(20, 184, 166, 0.06);
  --feed-line: #EEF2F6;
  --live-glow: rgba(132, 204, 22, 0.65);
  --live-bg: #84CC16;
  --live-text: #1A2E05;
  --tag-bg: #F1F5F9;
  --tag-text: #475569;
  --hello-bg: rgba(20, 184, 166, 0.12);
  --hello-text: #0F766E;
  --amt-text: #3F6212;
  --amt-bg: rgba(132, 204, 22, 0.16);
  --amt-border: rgba(101, 163, 13, 0.30);
  --done-bg: rgba(20, 184, 166, 0.12);
  --done-border: rgba(13, 148, 136, 0.30);
  --sk-a: #EEF2F6;
  --sk-b: #E2E8F0;
  --tg-bg: #E3EEEA;
  --tg-bubble: #FFFFFF;
  --pill-ok: rgba(21, 128, 61, 0.40);
  --pill-warn: rgba(168, 75, 8, 0.40);
  --pill-err: rgba(200, 30, 30, 0.40);
  --wave-arcs: #14B8A6;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 14px 32px -8px rgba(15, 23, 42, 0.14);
  --shadow-feed: 0 1px 2px rgba(15, 23, 42, 0.05), 0 12px 28px -10px rgba(15, 23, 42, 0.12), 0 32px 64px -24px rgba(13, 148, 136, 0.22);
  --shadow-featured: 0 1px 2px rgba(15, 23, 42, 0.06), 0 20px 44px -18px rgba(13, 148, 136, 0.40);
  --btn-glow: 0 1px 2px rgba(15, 23, 42, 0.10), 0 8px 20px -6px rgba(20, 184, 166, 0.55);
  --btn-glow-hover: 0 1px 2px rgba(15, 23, 42, 0.10), 0 12px 26px -6px rgba(20, 184, 166, 0.60);
}
/* Light-only polish */
:root:not([data-theme="dark"]) ::selection { background: rgba(20, 184, 166, 0.22); }
:root:not([data-theme="dark"]) .card,
:root:not([data-theme="dark"]) .site-header { border-color: var(--border); }
:root:not([data-theme="dark"]) .band { background: linear-gradient(180deg, var(--bg-2), #F3F7FA); }
:root:not([data-theme="dark"]) .feed-head { background: linear-gradient(180deg, #FFFFFF, #FAFCFD); }
:root:not([data-theme="dark"]) .feed-av { box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12), inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
:root:not([data-theme="dark"]) .feed-av.has-photo { box-shadow: 0 0 0 1px var(--border) inset, 0 1px 2px rgba(15, 23, 42, 0.10); }
:root:not([data-theme="dark"]) .btn-ghost { box-shadow: var(--shadow-xs); }
:root:not([data-theme="dark"]) .tab[aria-selected="true"] { background: var(--surface); box-shadow: inset 0 -2px 0 var(--teal-bright), 0 1px 2px rgba(15, 23, 42, 0.06); }
:root:not([data-theme="dark"]) .code-top { background: #FFFFFF; }
:root:not([data-theme="dark"]) .code-response { background: #FFFFFF; }
:root:not([data-theme="dark"]) .step::before { color: #0F766E; background: linear-gradient(135deg, rgba(20, 184, 166, 0.12), rgba(132, 204, 22, 0.12)); }
:root:not([data-theme="dark"]) .price-card.is-featured::before { height: 3px; }
.doc .step h3 { color: var(--text); }
:root:not([data-theme="dark"]) .faq-item[open] { box-shadow: var(--shadow); }
:root:not([data-theme="dark"]) .lang-switch { box-shadow: var(--shadow-xs); }
:root:not([data-theme="dark"]) .doc-table th { background: #F4F7FA; }
:root:not([data-theme="dark"]) .tg-demo { background-image: radial-gradient(var(--dot-tg) 1px, transparent 1px), linear-gradient(160deg, #E6F2EE, #E4ECF2); background-size: 18px 18px, auto; }
:root:not([data-theme="dark"]) .tg-bubble { border-color: rgba(15, 23, 42, 0.06); box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08); }
:root:not([data-theme="dark"]) .why-card,
:root:not([data-theme="dark"]) .price-card,
:root:not([data-theme="dark"]) .pay-card { background: linear-gradient(180deg, #FFFFFF 0%, #FFFFFF 60%, #FBFCFE 100%); }
:root:not([data-theme="dark"]) .nf-code { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
@media (max-width: 1079px) {
  :root:not([data-theme="dark"]) .main-nav { box-shadow: 0 24px 40px -24px rgba(15, 23, 42, 0.25); }
}

/* ---------- Theme toggle (sun / moon) ---------- */
.theme-toggle {
  display: inline-grid; place-items: center; flex: none;
  width: 36px; height: 36px; padding: 0;
  border-radius: 8px; border: 1px solid var(--border); background: var(--surface);
  color: var(--muted); cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: color .15s ease, border-color .15s ease, background-color .15s ease;
}
.theme-toggle:hover { color: var(--text); border-color: var(--teal-line); }
html:not([data-theme]) .theme-toggle { display: none; }  /* no JS: the default light theme, no switch */
.theme-icon { width: 19px; height: 19px; overflow: visible; }
.theme-icon .ti-sun, .theme-icon .ti-moon {
  transform-box: view-box; transform-origin: 12px 12px;
  transition: transform .45s cubic-bezier(.34, 1.4, .64, 1), opacity .25s ease;
}
/* The icon shows the theme the button switches TO (same as the cabinet): sun in dark, moon in light. */
.theme-icon .ti-sun { color: #FBBF24; }
.theme-icon .ti-sun circle { fill: #FBBF24; fill-opacity: .22; }
.theme-icon .ti-moon { fill: currentColor; fill-opacity: .14; opacity: 0; transform: rotate(90deg) scale(.4); }
:root:not([data-theme="dark"]) .theme-icon .ti-sun { opacity: 0; transform: rotate(-90deg) scale(.4); }
:root:not([data-theme="dark"]) .theme-icon .ti-moon { opacity: 1; transform: none; color: #334155; }
@media (max-width: 1079px), (pointer: coarse) {
  .theme-toggle { width: 44px; height: 44px; border-radius: var(--radius-sm); border-color: var(--border-strong); color: var(--text); }
  .theme-icon { width: 20px; height: 20px; }
}

/* Theme switch: circular reveal from the toggle (View Transitions; JS skips it on reduced motion) */
html.theme-vt::view-transition-old(root),
html.theme-vt::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* Narrow phones: the header has brand + theme + language + login + menu. On the bilingual 404
   page (no current language) the language pair would not fit: the page body links both homes. */
@media (max-width: 419px) {
  .lang-switch:not(:has(a[aria-current])) { display: none; }
}

/* Three languages: on phones two switch buttons are visible (the current one is hidden), so on
   narrow screens they get narrower and the header controls sit closer — the menu button stays on screen. */
@media (max-width: 479px) {
  .header-actions:has(.lang-switch li:nth-child(3)) { gap: 4px; }
  .header-actions:has(.lang-switch li:nth-child(3)) .btn-login { padding-inline: 8px; }
  .lang-switch:has(li:nth-child(3)) ul { gap: 4px; }
  .lang-switch:has(li:nth-child(3)) a { min-width: 32px; padding: 0 4px; }
}

/* Header controls: one height (36px), one radius, one type size on desktop — tidy row */
@media (min-width: 1025px) {
  .site-header .main-nav a { min-height: 36px; padding-top: 0; padding-bottom: 0; display: inline-flex; align-items: center; border-radius: 10px; }
  .site-header .lang-switch { border-radius: 10px; }
  .site-header .lang-switch a { border-radius: 8px; }
  .site-header .theme-toggle { width: 36px; height: 36px; border-radius: 10px; }
  .site-header .btn-login { min-height: 36px; height: 36px; padding-top: 0; padding-bottom: 0; border-radius: 10px; font-size: 14px; }
  .site-header .header-actions { gap: 8px; }
}

/* QA 2026-10-03 */
.main-nav a { white-space: nowrap; }
@media (min-width: 1080px) and (max-width: 1179px) { .main-nav a { padding-inline: 8px; font-size: 14px; } .header-inner { gap: 10px; } }
code, pre { font-variant-ligatures: none; }
p code, li code, td code { box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.doc .callout + p, .doc .table-wrap + p, .doc .code-card + p, .doc .steps + p, .doc pre + p { margin-top: 16px; }
.hero.notfound { border-bottom: 0; }

/* Audience switch (buyers | bot admins): prices and FAQ are shown for one audience at a time */
.aud-r { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.aud-switch { display: flex; width: fit-content; max-width: 100%; margin: 0 auto 28px; padding: 4px; gap: 4px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-xs); }
.aud-switch label { padding: 10px 22px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--muted); cursor: pointer; white-space: nowrap; transition: color .15s, background-color .15s; min-height: 44px; display: grid; place-items: center; }
.aud-switch label:hover { color: var(--text); }
.aud-r:nth-of-type(1):checked ~ .aud-switch label:nth-child(1),
.aud-r:nth-of-type(2):checked ~ .aud-switch label:nth-child(2) { color: var(--on-accent-fill, #06231F); background: var(--grad); }
.aud-r:focus-visible ~ .aud-switch { outline: 2px solid var(--teal); outline-offset: 3px; }
.aud-panel { display: none; }
.aud-r:nth-of-type(1):checked ~ .aud-b, .aud-r:nth-of-type(2):checked ~ .aud-o { display: block; }
.aud-r:nth-of-type(1):checked ~ .faq-list.aud-b, .aud-r:nth-of-type(2):checked ~ .faq-list.aud-o { display: grid; }
.aud-lead { text-align: center; color: var(--muted); margin: 0 0 20px; }
@media (max-width: 419px) { .aud-switch { width: 100%; } .aud-switch label { flex: 1; padding-inline: 10px; } }

/* Brand mark: the waving duck */
.logo-duck { display: inline-grid; place-items: center; flex: none; line-height: 0; }
.logo-duck img, .logo-duck svg { width: 100%; height: 100%; display: block; }
.brand .logo-duck { width: 34px; height: 34px; }
@media (max-width: 419px) { .brand .logo-duck { width: 30px; height: 30px; } }
.duck-anim { display: block; width: 100%; height: 100%; }

/* Payment methods: the recommended one stands out. */
.badge.badge-star { color: var(--text); border-color: transparent; background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(90deg, var(--teal), var(--lime)) border-box; border: 1.5px solid transparent; font-weight: 600; }
.badge.badge-star .icon { color: var(--teal); }
