/* ==========================================================================
   Familiar — стили
   Токены цвета взяты из проверенной палитры (контрасты посчитаны для обеих тем).
   Тёмная тема — отдельные, подобранные под тёмную поверхность значения,
   а не автоматическая инверсия светлой.
   ========================================================================== */

/* ── Токены ───────────────────────────────────────────────────────────── */

:root {
  color-scheme: light;

  --page:        #f7f7f5;
  --surface:     #fcfcfb;   /* поверхность графиков — та, под которую считались контрасты */
  --surface-2:   #ffffff;
  --surface-3:   #f1f1ee;

  --ink:         #0b0b0b;
  --ink-2:       #52514e;
  --ink-3:       #898781;

  --line:        rgba(11, 11, 11, .10);
  --line-strong: rgba(11, 11, 11, .16);
  --grid:        #e1e0d9;
  --baseline:    #c3c2b7;

  --accent:      #2a78d6;   /* заливка столбцов, ссылки в крупном тексте */
  --accent-2:    #4a3aa7;   /* второй полюс градиента */
  --accent-ink:  #2a78d6;
  --btn-a:       #256abf;
  --btn-b:       #4f5bd5;
  --btn-ink:     #ffffff;

  --good:        #0ca30c;
  --warning:     #fab219;
  --serious:     #ec835a;
  --critical:    #d03b3b;

  --glow-1:      rgba(42, 120, 214, .10);
  --glow-2:      rgba(74, 58, 167, .08);

  --shadow-sm:   0 1px 2px rgba(11, 11, 11, .05);
  --shadow-md:   0 6px 20px -8px rgba(11, 11, 11, .16), 0 2px 6px -2px rgba(11, 11, 11, .06);
  --shadow-lg:   0 24px 60px -24px rgba(11, 11, 11, .26), 0 8px 24px -12px rgba(11, 11, 11, .12);

  --r-xs: 8px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --header-h: 64px;
  --ease: cubic-bezier(.22, 1, .36, 1);
}

/* Тёмные значения объявлены в двух областях: медиазапрос ловит настройку ОС,
   а data-theme — переключатель в шапке. Переключатель должен побеждать в обе
   стороны, поэтому в медиазапросе стоит :not([data-theme="light"]). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;

    --page:        #0d0d0d;
    --surface:     #1a1a19;
    --surface-2:   #222220;
    --surface-3:   #262624;

    --ink:         #ffffff;
    --ink-2:       #c3c2b7;
    --ink-3:       #898781;

    --line:        rgba(255, 255, 255, .10);
    --line-strong: rgba(255, 255, 255, .18);
    --grid:        #2c2c2a;
    --baseline:    #383835;

    --accent:      #3987e5;
    --accent-2:    #9085e9;
    --accent-ink:  #3987e5;
    --btn-a:       #256abf;
    --btn-b:       #4f5bd5;
    --btn-ink:     #ffffff;

    --glow-1:      rgba(57, 135, 229, .20);
    --glow-2:      rgba(144, 133, 233, .16);

    --shadow-sm:   0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md:   0 6px 20px -8px rgba(0, 0, 0, .6), 0 2px 6px -2px rgba(0, 0, 0, .4);
    --shadow-lg:   0 24px 60px -24px rgba(0, 0, 0, .75), 0 8px 24px -12px rgba(0, 0, 0, .5);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --page:        #0d0d0d;
  --surface:     #1a1a19;
  --surface-2:   #222220;
  --surface-3:   #262624;

  --ink:         #ffffff;
  --ink-2:       #c3c2b7;
  --ink-3:       #898781;

  --line:        rgba(255, 255, 255, .10);
  --line-strong: rgba(255, 255, 255, .18);
  --grid:        #2c2c2a;
  --baseline:    #383835;

  --accent:      #3987e5;
  --accent-2:    #9085e9;
  --accent-ink:  #3987e5;
  --btn-a:       #256abf;
  --btn-b:       #4f5bd5;
  --btn-ink:     #ffffff;

  --glow-1:      rgba(57, 135, 229, .20);
  --glow-2:      rgba(144, 133, 233, .16);

  --shadow-sm:   0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md:   0 6px 20px -8px rgba(0, 0, 0, .6), 0 2px 6px -2px rgba(0, 0, 0, .4);
  --shadow-lg:   0 24px 60px -24px rgba(0, 0, 0, .75), 0 8px 24px -12px rgba(0, 0, 0, .5);
}

/* ── База ─────────────────────────────────────────────────────────────── */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;   /* не hidden: hidden сломал бы position: sticky у шапки */
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.15; letter-spacing: -.022em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; width: 100%; }

/* Иконки: единый штриховой стиль */
svg[viewBox="0 0 24 24"] {
  width: 20px; height: 20px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

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

.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: 12px; top: -60px; z-index: 200;
  background: var(--surface-2); color: var(--ink);
  padding: 10px 16px; border-radius: var(--r-sm); border: 1px solid var(--line);
  transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

/* ── Раскладка ────────────────────────────────────────────────────────── */

.container { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 24px; }
.container.narrow { max-width: 820px; }
@media (max-width: 560px) { .container { padding: 0 16px; } }

.section { padding: 104px 0; }
.section-alt { background: var(--surface-3); }
@media (max-width: 760px) { .section { padding: 72px 0; } }

.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); margin-bottom: 14px; }
.eyebrow {
  margin-bottom: 12px;
  font-size: .8125rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3);
}
.lead { font-size: 1.0625rem; line-height: 1.65; color: var(--ink-2); }

.only-narrow { display: none !important; }
@media (max-width: 900px) {
  .only-wide { display: none !important; }
  .only-narrow { display: inline-flex !important; }
  .mobile-menu.only-narrow { display: none !important; }
  .mobile-menu.only-narrow.is-open { display: flex !important; }
}

/* ── Кнопки ───────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 0 18px; height: 42px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font-size: .9375rem; font-weight: 600; letter-spacing: -.01em;
  white-space: nowrap;
  transition: transform .15s var(--ease), background-color .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }

.btn-primary {
  background-image: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  color: var(--btn-ink);
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { box-shadow: var(--shadow-md); filter: saturate(1.08); }

.btn-ghost {
  background: transparent; color: var(--ink-2);
  border-color: var(--line);
}
.btn-ghost:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }

.btn-outline {
  background: var(--surface-2); color: var(--ink);
  border-color: var(--line-strong);
}
.btn-outline:hover { border-color: var(--accent); color: var(--accent-ink); }

.btn-lg { height: 50px; padding: 0 26px; font-size: 1rem; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0;
  background: transparent; color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.icon-btn:hover { background: var(--surface-3); color: var(--ink); border-color: var(--line-strong); }

/* ── Плашка о техработах ──────────────────────────────────────────────── */

.notice {
  background: var(--surface-3);
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.notice[hidden] { display: none; }
.notice-inner {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px; padding-top: 8px; padding-bottom: 8px;
}
.notice .ico { flex: none; width: 18px; height: 18px; color: var(--warning); }
.notice p { flex: 1; font-size: .875rem; line-height: 1.45; }
.notice-close {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; padding: 0;
  background: transparent; border: 0; border-radius: var(--r-xs); color: var(--ink-3);
}
.notice-close:hover { background: var(--surface); color: var(--ink); }
.notice-close svg { width: 16px; height: 16px; }

/* ── Шапка ────────────────────────────────────────────────────────────── */

.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--page);   /* запасной вариант, если color-mix не поддержан */
  background: color-mix(in srgb, var(--page) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
.header.is-stuck { border-bottom-color: var(--line); }

.header-inner { display: flex; align-items: center; gap: 24px; min-height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 30px; height: 30px; }
.brand-name { font-size: 1.125rem; font-weight: 700; letter-spacing: -.03em; }

.nav { display: flex; gap: 4px; margin-right: auto; }
.nav a {
  padding: 8px 12px; border-radius: var(--r-xs);
  font-size: .9375rem; font-weight: 500; color: var(--ink-2);
  transition: background-color .16s ease, color .16s ease;
}
.nav a:hover { background: var(--surface-3); color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }

/* Переключатель темы: показываем ту иконку, которая переключит в другую тему */
#themeToggle .ico-sun { display: none; }
#themeToggle .ico-moon { display: block; }
:root[data-theme="dark"] #themeToggle .ico-sun { display: block; }
:root[data-theme="dark"] #themeToggle .ico-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #themeToggle .ico-sun { display: block; }
  :root:not([data-theme="light"]) #themeToggle .ico-moon { display: none; }
}

.mobile-menu {
  flex-direction: column; gap: 4px;
  padding: 12px 24px 20px;
  background: var(--page);
  border-bottom: 1px solid var(--line);
}
.mobile-menu a { padding: 12px 4px; font-size: 1rem; font-weight: 500; color: var(--ink-2); }
.mobile-menu a:hover { color: var(--ink); }
.mobile-menu-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.mobile-menu-actions .btn { width: 100%; }

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero { position: relative; padding: 96px 0 88px; overflow: hidden; }
.hero-glow {
  position: absolute; left: 50%; top: -240px; width: min(1200px, 130vw); height: 780px;
  transform: translateX(-50%); pointer-events: none;
  background:
    radial-gradient(closest-side, var(--glow-1), transparent 72%) 22% 42% / 620px 460px no-repeat,
    radial-gradient(closest-side, var(--glow-2), transparent 72%) 78% 30% / 560px 420px no-repeat;
}
.hero-inner { position: relative; text-align: center; }

.pill {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 26px; padding: 7px 14px 7px 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  font-size: .8125rem; color: var(--ink-2);
  box-shadow: var(--shadow-sm);
}
.pill b { color: var(--ink); font-weight: 600; }

.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-good { background: var(--good); box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 22%, transparent); }
.dot-warn { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 22%, transparent); }

.hero h1 {
  font-size: clamp(2.25rem, 6.2vw, 4rem);
  letter-spacing: -.035em; line-height: 1.04;
  margin-bottom: 22px;
  color: var(--ink);
}
/* Градиент по тексту включаем только там, где обрезка фона поддержана:
   иначе заголовок рискует остаться прозрачным. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .hero h1 {
    background-image: linear-gradient(105deg, var(--ink) 18%, var(--accent) 58%, var(--accent-2) 92%);
    -webkit-background-clip: text; background-clip: text;
    -webkit-text-fill-color: transparent; color: transparent;
  }
}
@media (forced-colors: active) {
  .hero h1 { background-image: none; -webkit-text-fill-color: currentColor; color: var(--ink); }
}

.hero-lead { max-width: 560px; margin: 0 auto 36px; font-size: 1.125rem; }

/* ── Загрузчик ────────────────────────────────────────────────────────── */

.dl { max-width: 660px; margin: 0 auto; }

.dl-field {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 7px 7px 16px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-md);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.dl-field:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow-md), 0 0 0 4px color-mix(in srgb, var(--accent) 16%, transparent);
}
.dl-field.is-invalid { border-color: var(--critical); animation: shake .4s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-6px); }
  44% { transform: translateX(5px); }
  66% { transform: translateX(-3px); }
  88% { transform: translateX(2px); }
}

.dl-ico { flex: none; width: 20px; height: 20px; color: var(--ink-3); }

.dl-field input {
  flex: 1 1 auto; min-width: 0; height: 44px;
  background: transparent; border: 0; outline: none;
  font-size: 1rem;
}
.dl-field input::placeholder { color: var(--ink-3); }
.dl-field input:focus-visible { outline: none; }

.dl-submit { flex: none; height: 44px; padding: 0 20px; }
.dl-submit .ico-dl { width: 18px; height: 18px; }

.dl-hint { margin-top: 14px; font-size: .8125rem; color: var(--ink-3); }

.dl-error {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 12px; font-size: .875rem; color: var(--critical);
}
.dl-error[hidden] { display: none; }
.dl-error::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--critical); flex: none;
}

.platforms {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin: 28px auto 0; max-width: 660px;
}
.platforms li {
  padding: 5px 12px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 999px;
  font-size: .8125rem; color: var(--ink-2);
}

.trust {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 32px;
  margin-top: 40px; font-size: .875rem; color: var(--ink-3);
}
.trust b { display: block; font-size: 1.125rem; font-weight: 700; color: var(--ink); letter-spacing: -.02em; }

/* ── Результат обработки ──────────────────────────────────────────────── */

.hero-result { max-width: 660px; margin: 28px auto 0; text-align: left; }
.hero-result:empty { display: none; }

.result-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: 18px;
  animation: pop .3s var(--ease) both;
}
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.99); } }

.rc-top { display: flex; gap: 16px; align-items: flex-start; }

.rc-thumb {
  position: relative; flex: none;
  width: 148px; aspect-ratio: 16 / 9;
  border-radius: var(--r-md); overflow: hidden;
  background-image: linear-gradient(135deg, var(--t1, #256abf), var(--t2, #4f5bd5));
  display: flex; align-items: center; justify-content: center;
}
.rc-thumb::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(closest-side, rgba(255, 255, 255, .28), transparent 70%);
}
.rc-play {
  position: relative; z-index: 1;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  display: flex; align-items: center; justify-content: center;
}
.rc-play svg { width: 14px; height: 14px; color: #10131a; fill: currentColor; stroke: none; margin-left: 2px; }
.rc-dur {
  position: absolute; right: 8px; bottom: 8px; z-index: 1;
  padding: 2px 7px; border-radius: 6px;
  background: rgba(10, 10, 10, .72); color: #fff;
  font-size: .6875rem; font-weight: 600; font-variant-numeric: tabular-nums;
  backdrop-filter: blur(4px);
}

.rc-meta { min-width: 0; flex: 1 1 auto; }
.rc-title {
  font-size: 1rem; font-weight: 600; line-height: 1.35; letter-spacing: -.015em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rc-sub { margin-top: 6px; font-size: .8125rem; color: var(--ink-3); }
.rc-sub span + span::before { content: " · "; }

.rc-formats { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fmt {
  display: flex; flex-direction: column; gap: 2px; align-items: flex-start;
  padding: 9px 14px; min-width: 108px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm);
  text-align: left;
  transition: border-color .16s ease, background-color .16s ease;
}
.fmt:hover { border-color: var(--line-strong); }
.fmt.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-3)); }
.fmt-q { font-size: .875rem; font-weight: 600; }
.fmt-s { font-size: .75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.rc-actions { margin-top: 16px; }
.rc-btn { width: 100%; }
.rc-btn.is-done { background-image: none; background-color: color-mix(in srgb, var(--good) 16%, var(--surface-3)); color: var(--ink); box-shadow: none; }

.rc-progress { margin-top: 14px; }
.rc-bar {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--accent) 18%, var(--surface-3));
}
.rc-bar span {
  display: block; height: 100%; width: 0; border-radius: 999px;
  background-image: linear-gradient(90deg, var(--btn-a), var(--btn-b));
  transition: width .25s linear;
}
.rc-pct { margin-top: 8px; font-size: .8125rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* Скелетон анализа */
.skeleton { display: flex; gap: 16px; align-items: flex-start; }
.sk {
  background-image: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-xs);
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.sk-thumb { flex: none; width: 148px; aspect-ratio: 16 / 9; border-radius: var(--r-md); }
.sk-lines { flex: 1 1 auto; padding-top: 4px; }
.sk-line { height: 12px; margin-bottom: 10px; }
.sk-line.w70 { width: 70%; }
.sk-line.w45 { width: 45%; }
.sk-line.w30 { width: 30%; }

.rc-status { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: .875rem; color: var(--ink-2); }
.spinner {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Карточки возможностей ────────────────────────────────────────────── */

.cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 980px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .cards { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 24px;
}
.cards .card { transition: border-color .2s ease, transform .3s var(--ease), box-shadow .3s ease; }
.cards .card:hover { border-color: var(--line-strong); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cards h3 { font-size: 1.0625rem; margin-bottom: 8px; }
.cards p { font-size: .9375rem; color: var(--ink-2); }

.card-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin-bottom: 16px;
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface-3));
  color: var(--accent-ink);
}

/* ── Статистика ───────────────────────────────────────────────────────── */

.stats-grid { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 1000px) { .stats-grid { grid-template-columns: 1fr; } }

.stats-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stats-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stats-side h3 { font-size: 1rem; margin-bottom: 18px; }

.hero-figure { padding: 26px 24px; }
.hf-label { font-size: .9375rem; color: var(--ink-2); }
.hf-value {
  margin: 6px 0 10px;
  font-size: clamp(2.75rem, 6vw, 3.75rem); font-weight: 700;
  letter-spacing: -.04em; line-height: 1;
}
.hf-foot { font-size: .8125rem; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 1180px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .tiles { grid-template-columns: 1fr; } }

.tile {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 18px 18px 0;
}
.tile-label { font-size: .8125rem; color: var(--ink-2); }
.tile-value {
  margin: 6px 0 6px;
  font-size: 1.75rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1;
}
.tile-value .unit { font-size: .875rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.tile-delta { font-size: .75rem; padding-bottom: 14px; }

.spark { width: 100%; height: 30px; display: block; }
.spark-line { fill: none; stroke: var(--accent); stroke-width: 2; opacity: .5; vector-effect: non-scaling-stroke; }

.delta { display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.delta svg { width: 14px; height: 14px; stroke-width: 2; }
.delta-up { color: var(--good); }
.delta-down { color: var(--good); }
.tile-delta.delta-up, .tile-delta.delta-down { color: var(--good); }

/* ── График ───────────────────────────────────────────────────────────── */

.chart-card { padding: 24px; margin: 0; }
.chart-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 24px;
}
.chart-head h3 { font-size: 1rem; }
.chart-sub { margin-top: 5px; font-size: .8125rem; color: var(--ink-3); }

.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--r-sm);
}
.seg-btn {
  padding: 6px 12px; border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-2);
  font-size: .8125rem; font-weight: 500;
  transition: background-color .16s ease, color .16s ease;
}
.seg-btn:hover { color: var(--ink); }
.seg-btn.is-active { background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow-sm); }

.chart { --bar-gap: 12px; --bar-radius: 4px; }
.chart[data-range="30"] { --bar-gap: 4px; --bar-radius: 3px; }
.chart[data-range="90"] { --bar-gap: 2px; --bar-radius: 2px; }

.plot { position: relative; height: 240px; margin: 8px 0 0 60px; }
@media (max-width: 560px) { .plot { height: 180px; margin-left: 44px; } }

.grid { position: absolute; inset: 0; }
.grid-line { position: absolute; left: 0; right: 0; height: 1px; background: var(--grid); }
.grid-line.is-base { background: var(--baseline); }
.grid-line span {
  position: absolute; right: calc(100% + 12px); top: 50%; transform: translateY(-50%);
  font-size: .75rem; color: var(--ink-3); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: var(--bar-gap); }
.bar-col {
  position: relative; flex: 1 1 0; min-width: 0; height: 100%;
  display: flex; align-items: flex-end; justify-content: center;
}
.bar {
  width: 100%; max-width: 24px; min-width: 2px; height: var(--h, 0%);
  background: var(--accent);
  border-radius: var(--bar-radius) var(--bar-radius) 0 0;
  transform-origin: bottom;
  transition: transform .85s var(--ease), filter .15s ease;
}
.js .bars .bar { transform: scaleY(0); }
.js .bars.is-drawn .bar { transform: scaleY(1); }
.bar-col:hover .bar { filter: brightness(1.14) saturate(1.05); }

.bar-label {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--h, 0%) + 8px);
  font-size: .75rem; font-weight: 600; color: var(--ink-2);
  white-space: nowrap; font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.chart-tip {
  position: absolute; z-index: 5; pointer-events: none;
  transform: translate(-50%, -100%);
  padding: 8px 12px; border-radius: var(--r-xs);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  font-size: .8125rem; color: var(--ink); white-space: nowrap;
}
.chart-tip[hidden] { display: none; }
.chart-tip b { font-variant-numeric: tabular-nums; }
.chart-tip i { display: block; font-style: normal; font-size: .75rem; color: var(--ink-3); }

.xaxis {
  display: flex; gap: var(--bar-gap); margin: 10px 0 0 60px;
}
@media (max-width: 560px) { .xaxis { margin-left: 44px; } }
.xaxis span {
  flex: 1 1 0; min-width: 0; text-align: center;
  font-size: .75rem; color: var(--ink-3); white-space: nowrap;
  overflow: hidden;
}

.table-toggle { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.table-toggle summary {
  cursor: pointer; font-size: .8125rem; color: var(--ink-3); list-style: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.table-toggle summary::-webkit-details-marker { display: none; }
.table-toggle summary::before {
  content: ""; width: 0; height: 0; flex: none;
  border-left: 4px solid currentColor; border-top: 4px solid transparent; border-bottom: 4px solid transparent;
  transition: transform .18s ease;
}
.table-toggle[open] summary::before { transform: rotate(90deg); }
.table-toggle summary:hover { color: var(--ink); }

.table-wrap { max-height: 280px; overflow: auto; margin-top: 14px; }
.table-wrap table { font-size: .8125rem; }
.table-wrap th, .table-wrap td {
  padding: 7px 12px 7px 0; text-align: left; border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}
.table-wrap th { color: var(--ink-3); font-weight: 500; position: sticky; top: 0; background: var(--surface); }
.table-wrap td:first-child { color: var(--ink-2); }

/* Платформы */
.plat li { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.plat-name { flex: none; width: 84px; font-size: .875rem; color: var(--ink-2); }
.track {
  flex: 1 1 auto; height: 8px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface-3));
}
.fill {
  display: block; height: 100%; width: var(--w); border-radius: 999px;
  background: var(--accent);
  transition: width 1.1s var(--ease);
}
.plat-val {
  flex: none; width: 44px; text-align: right;
  font-size: .8125rem; color: var(--ink-2); font-variant-numeric: tabular-nums;
}

/* Лента загрузок */
.live-head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; flex-wrap: wrap; }
.live-head h3 { margin: 0; }
.live-now {
  margin-left: auto; flex: none; white-space: nowrap;
  font-size: .75rem; color: var(--ink-3); font-variant-numeric: tabular-nums;
}
.pulse {
  width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent);
  animation: pulse 2.4s ease-out infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); }
  70% { box-shadow: 0 0 0 9px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.live li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--line);
  font-size: .8125rem; color: var(--ink-2);
}
.live li:last-child { border-bottom: 0; }
.live li.is-new { animation: slide-in .65s var(--ease) both; }
@keyframes slide-in { from { opacity: 0; transform: translateY(-8px); } }
.live .q {
  flex: none; padding: 2px 7px; border-radius: 5px;
  background: var(--surface-3); border: 1px solid var(--line);
  font-size: .6875rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums;
}
.live .city { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live .ago { flex: none; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.tag-demo {
  display: inline-block; margin-left: 6px; padding: 2px 8px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 999px;
  font-size: .75rem; color: var(--ink-3); white-space: nowrap;
}

/* ── Тарифы ───────────────────────────────────────────────────────────── */

.plans { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: start; }
@media (max-width: 900px) { .plans { grid-template-columns: 1fr; max-width: 460px; margin: 0 auto; } }

.plan { position: relative; display: flex; flex-direction: column; padding: 28px 24px; }
.plan-featured { border-color: var(--accent); box-shadow: var(--shadow-md); }
.plan-badge {
  position: absolute; top: -11px; left: 24px;
  padding: 4px 12px; border-radius: 999px;
  background-image: linear-gradient(135deg, var(--btn-a), var(--btn-b));
  color: var(--btn-ink); font-size: .75rem; font-weight: 600;
}
.plan-head { margin-bottom: 20px; }
.plan-head h3 { font-size: 1.25rem; }
.plan-desc { margin-top: 6px; font-size: .875rem; color: var(--ink-3); }
.plan-price { margin-top: 16px; display: flex; align-items: baseline; gap: 6px; }
.plan-price .amount { font-size: 2rem; font-weight: 700; letter-spacing: -.035em; }
.plan-price .per { font-size: .875rem; color: var(--ink-3); }

.plan-list { flex: 1 1 auto; margin-bottom: 24px; }
.plan-list li {
  position: relative; padding: 7px 0 7px 26px;
  font-size: .9375rem; color: var(--ink-2);
}
.plan-list li::before {
  content: ""; position: absolute; left: 2px; top: 14px;
  width: 6px; height: 10px;
  border-right: 2px solid var(--good); border-bottom: 2px solid var(--good);
  transform: rotate(45deg);
}
.plan-btn { width: 100%; }

.plans-note {
  display: flex; align-items: flex-start; gap: 10px;
  max-width: 620px; margin: 32px auto 0;
  padding: 14px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  font-size: .875rem; color: var(--ink-2);
}
.plans-note .ico { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--warning); }

/* ── FAQ ──────────────────────────────────────────────────────────────── */

.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 0; cursor: pointer; list-style: none;
  font-size: 1.0625rem; font-weight: 600; letter-spacing: -.015em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 10px; height: 10px;
  border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3);
  transform: rotate(45deg) translateY(-2px);
  transition: transform .22s var(--ease);
}
.faq details[open] summary::after { transform: rotate(-135deg) translateY(-2px); }
.faq summary:hover { color: var(--accent-ink); }
.faq details > p {
  padding: 0 48px 22px 0; font-size: .9375rem; color: var(--ink-2);
  animation: fade-in .25s ease both;
}
@keyframes fade-in { from { opacity: 0; } }

/* ── CTA ──────────────────────────────────────────────────────────────── */

.cta {
  position: relative; overflow: hidden;
  padding: 64px 32px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl);
}
.cta::before {
  content: ""; position: absolute; left: 50%; top: -160px; width: 900px; height: 420px;
  transform: translateX(-50%); pointer-events: none;
  background:
    radial-gradient(closest-side, var(--glow-1), transparent 70%) 30% 60% / 520px 320px no-repeat,
    radial-gradient(closest-side, var(--glow-2), transparent 70%) 72% 50% / 460px 300px no-repeat;
}
.cta > * { position: relative; }
.cta h2 { font-size: clamp(1.625rem, 3.6vw, 2.25rem); margin-bottom: 12px; }
.cta .lead { margin-bottom: 28px; }

/* ── Подвал ───────────────────────────────────────────────────────────── */

.footer { border-top: 1px solid var(--line); background: var(--surface); padding: 64px 0 32px; }
.footer-inner { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 2fr); gap: 48px; }
@media (max-width: 820px) { .footer-inner { grid-template-columns: 1fr; gap: 40px; } }

.footer-brand p { margin: 16px 0 20px; max-width: 320px; font-size: .9375rem; color: var(--ink-2); }
.status { display: flex; flex-direction: column; gap: 8px; font-size: .8125rem; color: var(--ink-2); }
.status li { display: flex; align-items: center; gap: 9px; }

.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 520px) { .footer-cols { grid-template-columns: repeat(2, 1fr); } }
.footer-cols h4 {
  margin-bottom: 14px; font-size: .8125rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3);
}
.footer-cols a { display: block; padding: 5px 0; font-size: .9375rem; color: var(--ink-2); }
.footer-cols a:hover { color: var(--accent-ink); }

.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px;
  margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line);
  font-size: .8125rem; color: var(--ink-3);
}

/* ── Модальное окно ───────────────────────────────────────────────────── */

.modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(6, 6, 6, .55); backdrop-filter: blur(3px); animation: fade-in .2s ease both; }
.modal-panel {
  position: relative; width: 100%; max-width: 460px;
  padding: 32px 28px 24px; text-align: center;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  animation: pop .28s var(--ease) both;
}
.modal-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; margin-bottom: 18px; border-radius: 50%;
  background: color-mix(in srgb, var(--warning) 18%, var(--surface-3));
  color: var(--warning);
}
.modal-ico svg { width: 24px; height: 24px; }
.modal-ico[data-kind="lock"] { background: color-mix(in srgb, var(--accent) 14%, var(--surface-3)); color: var(--accent-ink); }
.modal-panel h2 { font-size: 1.375rem; margin-bottom: 12px; }
.modal-panel p { font-size: .9375rem; color: var(--ink-2); }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 26px; }
.modal-actions .btn { width: 100%; }
.modal-foot { margin-top: 16px; font-size: .75rem; color: var(--ink-3); }
.modal-foot:empty { display: none; }

/* ── Тосты ────────────────────────────────────────────────────────────── */

.toasts {
  position: fixed; left: 50%; bottom: 24px; z-index: 400;
  transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; align-items: center;
  width: max-content; max-width: calc(100vw - 32px);
  pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; border-radius: var(--r-sm);
  background: var(--surface-2); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  font-size: .875rem; color: var(--ink);
  animation: toast-in .3s var(--ease) both;
}
.toast.is-out { animation: toast-out .25s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
.toast svg { width: 18px; height: 18px; flex: none; }
.toast .t-good { color: var(--good); }
.toast .t-warn { color: var(--warning); }
.toast .t-info { color: var(--ink-3); }

/* ── Появление при скролле ────────────────────────────────────────────── */
/* Прячем только если JS заведомо работает — иначе контент останется невидимым. */

.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .85s ease, transform .85s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .js .bars .bar { transform: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .spinner { animation-duration: .7s !important; animation-iteration-count: infinite !important; }
  .sk { animation: none !important; }
}

@media print {
  .header, .notice, .hero-glow, .toasts, .modal, .cta, .skip-link { display: none !important; }
  body { background: #fff; color: #000; }
  .card, .plan, .chart-card { border-color: #ccc; box-shadow: none; }
}
