/* ============================================================
   Нейрощит — лендинг. Токены и стили по дизайн-хендоффу.
   ============================================================ */

:root {
  /* Фон и поверхности */
  --ns-page-top: #fbfbfe;
  --ns-page-mid: #f3f4fc;
  --ns-page-bottom: #edecf9;
  --ns-page-end: #f4f2fc;
  --ns-surface: #ffffff;
  --ns-surface-alt: #f7f8fd;
  --ns-panel-grad: linear-gradient(180deg, #fcfcff, #f8f8fd);
  --ns-dark-panel: #060a2b;
  --ns-code-panel: #02051c;
  --ns-json-panel: #0a0e2e;

  /* Текст */
  --ns-ink: #060a37;
  --ns-ink-70: #3d446b;
  --ns-ink-55: #5d658c;
  --ns-ink-40: #9aa1c0;
  --ns-ink-45: #8b93b5;

  /* Рамки */
  --ns-border: rgba(6, 10, 55, .07);
  --ns-border-soft: rgba(6, 10, 55, .06);
  --ns-border-strong: rgba(6, 10, 55, .10);

  /* Акцент */
  --ns-accent: #7c5cf5;
  --ns-accent-grad: linear-gradient(135deg, #7c5cf5, #a78bfa);
  --ns-accent-deep: #4b2fd0;
  --ns-accent-link: #5b3fe0;
  --ns-accent-soft: #efeafe;
  --ns-accent-border: rgba(108, 78, 240, .28);
  --ns-accent-focus: #8b6df7;

  /* Статусы */
  --ns-ok: #0f9d76;
  --ns-ok-bg: #e7f7f1;
  --ns-ok-ink: #0b7a5c;
  --ns-ok-bd: rgba(15, 157, 118, .24);
  --ns-warn: #d98407;
  --ns-warn-bg: #fdf4e3;
  --ns-warn-ink: #9a5d02;
  --ns-warn-bd: rgba(217, 132, 7, .26);
  --ns-bad: #d92651;
  --ns-bad-bg: #fdeaef;
  --ns-bad-ink: #ab1b41;
  --ns-bad-bd: rgba(217, 38, 81, .24);
  --ns-muted-dot: #c3c8de;

  /* Тёмная тема (точечно) */
  --ns-d-text: #e6e8f8;
  --ns-d-text-2: #c3c9ea;
  --ns-d-label: #7f8ac0;
  --ns-d-stamp: #5d68a8;
  --ns-d-muted: #9aa3d0;
  --ns-d-ok: #5df3c0;
  --ns-d-warn: #ffc46b;
  --ns-d-bad: #ff9db6;
  --ns-d-border: rgba(255, 255, 255, .10);
  --ns-d-surface: rgba(255, 255, 255, .05);
  --ns-d-key: #a48bff;

  /* Тени */
  --ns-shadow-card: 0 4px 18px rgba(20, 26, 64, .04);
  --ns-shadow-card-lg: 0 8px 30px rgba(20, 26, 64, .05);
  --ns-shadow-card-md: 0 6px 24px rgba(20, 26, 64, .05);
  --ns-shadow-soft: 0 2px 10px rgba(20, 26, 64, .04);
  --ns-shadow-demo: 0 24px 70px rgba(20, 26, 64, .09);
  --ns-shadow-cta: 0 20px 60px rgba(20, 26, 64, .08);
  --ns-shadow-accent-btn: 0 10px 26px rgba(108, 78, 240, .30);
  --ns-shadow-accent-btn-sm: 0 6px 18px rgba(108, 78, 240, .28);
  --ns-shadow-plan-rec: 0 18px 44px rgba(6, 10, 43, .28);

  /* Прочее */
  --ns-font: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ns-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ns-container: 1200px;
  --ns-pad-x: 32px;
  --ns-rhythm: 90px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--ns-font);
  color: var(--ns-ink);
  background: #f6f7fc;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--ns-accent-link); text-decoration: none; }
a:hover { color: #3f27b8; }
textarea, input, button { font-family: inherit; }
::selection { background: #ded7fb; }

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

.ns-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.ns-mono { font-family: var(--ns-mono); }

.ns-page {
  background: linear-gradient(178deg, var(--ns-page-top) 0%, var(--ns-page-mid) 38%, var(--ns-page-bottom) 72%, var(--ns-page-end) 100%);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Анимации ── */
@keyframes nsUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes nsPop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes nsBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes nsPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

/* ============================================================
   Хедер
   ============================================================ */
.ns-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(250, 250, 253, .82);
  border-bottom: 1px solid var(--ns-border-soft);
}
.ns-header__inner {
  max-width: var(--ns-container); margin: 0 auto;
  padding: 14px var(--ns-pad-x);
  display: flex; align-items: center; gap: 28px; flex-wrap: wrap;
}
.ns-logo { display: flex; align-items: center; gap: 12px; margin-right: auto; color: var(--ns-ink); }
.ns-logo:hover { color: var(--ns-ink); }
.ns-logo__img { width: 38px; height: 38px; border-radius: 11px; display: block; }
.ns-logo__word { font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.ns-nav { display: flex; gap: 26px; font-size: 15px; font-weight: 500; flex-wrap: wrap; }
.ns-nav a { color: var(--ns-ink-55); }
.ns-nav a:hover { color: var(--ns-accent-deep); }

/* ── Кнопки ── */
.ns-btn {
  display: inline-block; border: none; cursor: pointer;
  padding: 15px 26px; border-radius: 999px;
  font-size: 16px; font-weight: 700; text-align: center;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.ns-btn--accent { background: var(--ns-accent-grad); color: #fff; box-shadow: var(--ns-shadow-accent-btn); }
.ns-btn--accent:hover { color: #fff; transform: translateY(-1px); }
.ns-btn--sm { padding: 11px 22px; font-size: 15px; font-weight: 600; box-shadow: var(--ns-shadow-accent-btn-sm); }
.ns-btn--soft { background: #f4f5fb; color: var(--ns-ink-70); font-weight: 600; }
.ns-btn--soft:hover { color: var(--ns-ink-70); background: #eceef8; }
.ns-btn--ink { background: var(--ns-ink); color: #fff; font-size: 15px; font-weight: 600; padding: 13px; border-radius: 14px; }
.ns-btn--ink:hover { background: #10163f; }
.ns-btn--block { width: 100%; display: block; }
.ns-btn--accent.ns-btn--block { margin-top: 22px; padding: 16px; border-radius: 16px; font-size: 16.5px; }
.ns-btn[disabled] { opacity: .72; cursor: progress; transform: none; }
.ns-btn-ghost {
  background: none; border: 1px solid rgba(255, 255, 255, .16);
  color: var(--ns-d-muted); font-size: 12px; padding: 5px 11px;
  border-radius: 999px; cursor: pointer; transition: border-color .15s, color .15s;
}
.ns-btn-ghost:hover { border-color: rgba(255, 255, 255, .38); color: #fff; }

/* ============================================================
   Hero
   ============================================================ */
.ns-hero {
  max-width: var(--ns-container); margin: 0 auto;
  padding: 78px var(--ns-pad-x) 30px; text-align: center;
}
.ns-status-pill {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 16px; border-radius: 999px;
  background: var(--ns-surface); border: 1px solid var(--ns-border);
  font-size: 13.5px; color: var(--ns-ink-55); font-weight: 500;
  box-shadow: var(--ns-shadow-soft);
}
.ns-status-pill__dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ns-muted-dot); display: block; flex: none; }
.ns-status-pill__dot--ok { background: var(--ns-ok); }
.ns-status-pill__dot--bad { background: var(--ns-bad); }
.ns-h1 {
  font-size: clamp(34px, 4.6vw, 62px); line-height: 1.06; letter-spacing: -.035em;
  font-weight: 800; margin: 26px auto 0; max-width: 16ch; text-wrap: balance;
}
.ns-slogan {
  margin: 16px auto 0; max-width: 40ch;
  font-size: clamp(15px, 1.2vw, 17px); font-weight: 700;
  letter-spacing: .01em; color: var(--ns-accent-deep);
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.ns-slogan::before, .ns-slogan::after {
  content: ''; height: 1px; flex: 1 1 24px; max-width: 56px;
  background: linear-gradient(90deg, transparent, rgba(108, 78, 240, .35));
}
.ns-slogan::after { background: linear-gradient(90deg, rgba(108, 78, 240, .35), transparent); }
.ns-lead {
  font-size: clamp(16px, 1.35vw, 19px); line-height: 1.55;
  color: var(--ns-ink-55); max-width: 64ch; margin: 18px auto 0; text-wrap: pretty;
}
.ns-facts { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 30px; }
.ns-fact {
  padding: 10px 18px; border-radius: 14px; background: var(--ns-surface);
  border: 1px solid var(--ns-border); font-size: 14.5px; font-weight: 600;
  box-shadow: var(--ns-shadow-soft);
}
.ns-fact__mono { color: var(--ns-accent-link); }

/* ============================================================
   Общие секции / типографика
   ============================================================ */
/* Отступ под sticky-хедер при переходе по анкорам */
section[id], footer[id] { scroll-margin-top: 88px; }

.ns-container { max-width: var(--ns-container); margin: 0 auto; padding: 0 var(--ns-pad-x); }
.ns-section { max-width: var(--ns-container); margin: 0 auto; padding: 0 var(--ns-pad-x) var(--ns-rhythm); }
.ns-section--demo { padding-top: 22px; }
.ns-section--cta { padding-bottom: 80px; }

.ns-h2 { font-size: clamp(27px, 3vw, 42px); letter-spacing: -.03em; font-weight: 800; margin: 0 0 30px; }
.ns-h2--narrow { margin-bottom: 12px; max-width: 22ch; text-wrap: balance; }
.ns-h2--light { color: #fff; margin-bottom: 12px; }
.ns-h2--flush { margin: 0 0 10px; }
.ns-h2--cta { font-size: clamp(27px, 3vw, 40px); margin: 0 0 14px; }
.ns-sub { font-size: 17px; color: var(--ns-ink-55); margin: 0 0 30px; max-width: 60ch; line-height: 1.55; }
.ns-sub--light { color: var(--ns-d-muted); margin-bottom: 34px; max-width: 62ch; }
.ns-sub--flush { margin: 0; max-width: 68ch; }
.ns-after { font-size: 16.5px; color: var(--ns-ink-55); margin: 22px 0 0; max-width: 76ch; line-height: 1.6; text-wrap: pretty; }
.ns-after--sm { font-size: 15.5px; max-width: 82ch; line-height: 1.65; }
.ns-caps {
  font-size: 13px; font-weight: 600; color: var(--ns-ink-40);
  letter-spacing: .06em; text-transform: uppercase; margin-bottom: 14px;
}
.ns-caps--dark { color: var(--ns-d-label); }
.ns-caps--flush { margin-bottom: 0; }
.ns-link { display: inline-block; margin-top: 14px; font-size: 15px; font-weight: 600; }

.ns-grid { display: grid; gap: 20px; }
.ns-grid--320 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.ns-grid--280 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.ns-grid--240 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.ns-card {
  background: var(--ns-surface); border: 1px solid var(--ns-border);
  border-radius: 22px; padding: 22px; box-shadow: var(--ns-shadow-card-md);
}
.ns-card--lg { border-radius: 24px; padding: 24px; box-shadow: var(--ns-shadow-card-lg); }

.ns-dot { width: 8px; height: 8px; border-radius: 50%; display: block; flex: none; }
.ns-dot--ok { background: var(--ns-ok); }
.ns-dot--accent { background: var(--ns-accent); }

/* ============================================================
   Живое демо
   ============================================================ */
.ns-demo {
  background: var(--ns-surface); border: 1px solid var(--ns-border);
  border-radius: 28px; box-shadow: var(--ns-shadow-demo); overflow: hidden;
}
.ns-demo__bar {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 26px; border-bottom: 1px solid var(--ns-border-soft); flex-wrap: wrap;
}
.ns-demo__led {
  width: 9px; height: 9px; border-radius: 50%; background: var(--ns-ok);
  display: block; flex: none; box-shadow: 0 0 0 4px rgba(15, 157, 118, .14);
}
.ns-demo__title { font-size: 14.5px; font-weight: 600; }
.ns-demo__endpoint { font-size: 13px; color: var(--ns-ink-40); margin-left: auto; }

.ns-demo__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 0; }
.ns-demo__in { padding: 26px; border-right: 1px solid var(--ns-border-soft); }
.ns-demo__out { padding: 26px; background: var(--ns-panel-grad); min-height: 520px; }

.ns-toolbadge {
  display: inline-block; margin: -6px 0 12px; padding: 5px 11px; border-radius: 999px;
  background: var(--ns-accent-soft); color: var(--ns-accent-deep);
  font-size: 12px; font-weight: 600;
}
.ns-toolbadge[hidden] { display: none; }
.ns-textarea {
  width: 100%; height: 132px; resize: vertical;
  padding: 16px 18px; border-radius: 18px;
  border: 1.5px solid var(--ns-accent-border); background: #fcfbff;
  font-size: 15.5px; line-height: 1.5; color: var(--ns-ink); outline: none;
  box-shadow: inset 0 1px 3px rgba(20, 26, 64, .03);
  transition: border-color .15s, box-shadow .15s;
}
.ns-textarea::placeholder { color: var(--ns-ink-40); }
.ns-textarea:focus { border-color: var(--ns-accent-focus); box-shadow: 0 0 0 4px rgba(139, 109, 247, .13); }
.ns-textarea--policy {
  height: 186px; border-color: var(--ns-border-strong);
  font-size: 15px; line-height: 1.7; border-radius: 16px; box-shadow: none;
}
.ns-privnote {
  margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ns-ink-40);
  padding-left: 14px; position: relative;
}
.ns-privnote::before {
  content: ''; position: absolute; left: 0; top: 6px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--ns-ok);
}
.ns-hint { font-size: 13px; color: var(--ns-ink-40); margin: 20px 0 10px; font-weight: 500; }
.ns-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ns-chip {
  padding: 9px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all .16s;
  border: 1px solid var(--ns-border-strong); background: var(--ns-surface-alt); color: var(--ns-ink-70);
}
.ns-chip:hover { border-color: var(--ns-accent-focus); }
.ns-chip[aria-pressed="true"] {
  background: var(--ns-accent-soft); border-color: rgba(108, 78, 240, .35); color: var(--ns-accent-deep);
}
.ns-note {
  margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--ns-border-soft);
  font-size: 13px; color: var(--ns-ink-40); line-height: 1.6;
}
.ns-note--flush { margin-top: 14px; padding-top: 0; border-top: none; }

/* ── Пустое состояние ── */
.ns-empty {
  height: 100%; min-height: 470px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; gap: 14px;
}
.ns-empty__icon {
  width: 56px; height: 56px; border-radius: 18px; background: var(--ns-surface);
  border: 1px solid var(--ns-border); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(20, 26, 64, .05);
}
.ns-empty__icon img { opacity: .9; display: block; }
.ns-empty__title { font-size: 17px; font-weight: 600; }
.ns-empty__desc { font-size: 14.5px; color: var(--ns-ink-40); max-width: 34ch; line-height: 1.55; }

/* ── Результат ── */
.ns-result { animation: nsPop .22s ease both; }
.ns-verdict-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.ns-verdict {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 20px; border-radius: 16px;
  font-size: 17px; font-weight: 800; letter-spacing: .02em;
}
.ns-verdict--allow { background: var(--ns-ok-bg); border: 1px solid var(--ns-ok-bd); color: var(--ns-ok-ink); }
.ns-verdict--mask { background: var(--ns-warn-bg); border: 1px solid var(--ns-warn-bd); color: var(--ns-warn-ink); }
.ns-verdict--block { background: var(--ns-bad-bg); border: 1px solid var(--ns-bad-bd); color: var(--ns-bad-ink); }
.ns-verdict--run { background: var(--ns-surface-alt); border: 1px solid var(--ns-border-strong); color: var(--ns-ink-40); }

.ns-timer { margin-left: auto; text-align: right; }
.ns-timer__val { font-family: var(--ns-mono); font-size: 34px; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.ns-timer__unit { font-size: 18px; color: var(--ns-ink-40); font-weight: 500; }
.ns-timer__cap { font-size: 12px; color: var(--ns-ink-40); letter-spacing: .04em; }
.ns-cache {
  display: inline-block; margin-top: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--ns-ok-bg); color: var(--ns-ok-ink);
  font-family: var(--ns-mono); font-size: 11.5px; font-weight: 700;
}

/* ── Категории ── */
.ns-cats { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 9px; }
.ns-cat {
  padding: 12px 13px; border-radius: 14px; background: var(--ns-surface);
  border: 1px solid var(--ns-border); box-shadow: 0 1px 4px rgba(20, 26, 64, .03);
  animation: nsPop .22s ease both;
}
.ns-cat__head { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; }
.ns-cat__dot { width: 8px; height: 8px; border-radius: 50%; display: block; flex: none; }
.ns-cat__name { font-size: 12.5px; font-weight: 600; line-height: 1.25; }
.ns-cat__score { font-family: var(--ns-mono); font-size: 16px; font-weight: 700; }
.ns-cat__sub { margin-top: 6px; font-size: 11px; line-height: 1.45; color: var(--ns-ink-45); font-family: var(--ns-mono); }

/* ── Маскирование ── */
.ns-block { margin-top: 18px; padding: 18px; border-radius: 18px; background: var(--ns-surface); border: 1px solid var(--ns-border); }
.ns-caps--warn { color: var(--ns-warn-ink); font-weight: 700; letter-spacing: .05em; margin-bottom: 12px; }
.ns-mask-line { font-size: 15px; line-height: 2.1; word-break: break-word; }
/* Пара «оригинал → плашка» не должна разрываться посередине… */
.ns-mask-pair { white-space: nowrap; }
/* …но на узком экране целая пара шире колонки, и плашка уезжает за край.
   Там разрешаем перенос внутри пары — читаемость важнее слитности. */
@media (max-width: 560px) {
  .ns-mask-pair { white-space: normal; }
  .ns-mask-line { line-height: 2.3; }
}
.ns-del {
  text-decoration: line-through; text-decoration-color: var(--ns-bad);
  color: #b8bdd4; background: var(--ns-bad-bg); padding: 2px 5px; border-radius: 6px;
}
.ns-arrow { color: #c0c5da; margin: 0 6px; }
.ns-tag {
  font-family: var(--ns-mono); font-size: 13.5px; background: var(--ns-accent-soft);
  color: var(--ns-accent-deep); padding: 4px 8px; border-radius: 8px; font-weight: 600;
}
.ns-block__note { margin-top: 14px; font-size: 12.5px; color: var(--ns-ink-40); line-height: 1.55; }

/* ── Таймлайн tool-call ── */
.ns-block--dark { background: var(--ns-json-panel); border-color: rgba(255, 255, 255, .08); }
.ns-caps--tl { color: #8b93c8; font-weight: 700; letter-spacing: .05em; margin-bottom: 12px; }
.ns-tl { display: flex; flex-direction: column; gap: 7px; font-family: var(--ns-mono); font-size: 13px; }
.ns-tl__row { display: flex; gap: 14px; animation: nsUp .2s ease both; }
/* «0,03 мс» шире целого числа мс — колонка не должна переносить единицу */
.ns-tl__t { color: var(--ns-d-label); flex: none; width: 74px; white-space: nowrap; }
.ns-tl__msg { line-height: 1.5; }

/* ── Бонусы ── */
.ns-bonus { margin-top: 18px; display: flex; gap: 10px; flex-wrap: wrap; }
.ns-bonus__item {
  flex: 1 1 200px; padding: 14px 16px; border-radius: 16px;
  background: var(--ns-surface); border: 1px solid var(--ns-border);
}
.ns-bonus__cap { font-size: 11.5px; color: var(--ns-ink-40); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 5px; }
.ns-bonus__val { font-size: 15px; font-weight: 600; }

/* ── JSON-аккордеон ── */
.ns-json { margin-top: 18px; border-radius: 18px; background: var(--ns-surface); border: 1px solid var(--ns-border); overflow: hidden; }
.ns-json__btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; background: none; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--ns-ink); text-align: left;
}
.ns-json__caret { font-family: var(--ns-mono); color: var(--ns-ink-40); font-size: 13px; }
.ns-json__hint { margin-left: auto; font-size: 12.5px; color: var(--ns-ink-40); font-weight: 500; }
.ns-json__wrap { padding: 0 18px 18px; }
.ns-json__body {
  background: var(--ns-json-panel); border-radius: 14px; padding: 16px 18px;
  overflow-x: auto; font-family: var(--ns-mono); font-size: 12.5px; line-height: 1.75;
  color: var(--ns-d-text-2); margin: 0; white-space: pre;
}
.t-key { color: var(--ns-d-key); }
.t-str { color: var(--ns-d-ok); }
.t-num { color: var(--ns-d-warn); }
.t-pun { color: var(--ns-d-text-2); }

/* ── Раскладка времени ── */
.ns-layers { margin-top: 18px; }
.ns-layers__head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 9px; gap: 12px; }
.ns-layers__cap { font-size: 12.5px; font-weight: 600; color: var(--ns-ink-40); letter-spacing: .05em; text-transform: uppercase; }
.ns-layers__total { font-family: var(--ns-mono); font-size: 13px; color: var(--ns-ink-55); }
.ns-bar { display: flex; gap: 3px; height: 10px; border-radius: 999px; overflow: hidden; background: #eceaf7; }
.ns-bar__seg { height: 100%; }
.ns-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; }
.ns-legend__item { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ns-ink-55); }
.ns-legend__sw { width: 8px; height: 8px; border-radius: 2px; display: block; }
.ns-legend__ms { font-family: var(--ns-mono); font-weight: 600; color: var(--ns-ink); }

/* ── Разбор для ИБ ── */
.ns-expl {
  margin-top: 18px; padding: 20px; border-radius: 18px;
  background: linear-gradient(135deg, #f7f4ff, #fdfbff);
  border: 1px solid rgba(108, 78, 240, .18); animation: nsUp .3s ease both;
}
.ns-expl__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ns-expl__title { font-size: 15.5px; font-weight: 700; }
.ns-expl__badge {
  padding: 5px 11px; border-radius: 999px; background: var(--ns-accent-soft);
  color: var(--ns-accent-deep); font-size: 12px; font-weight: 600; font-family: var(--ns-mono);
}
.ns-expl__text { font-size: 14.5px; line-height: 1.65; color: var(--ns-ink-70); text-wrap: pretty; }
.ns-expl__rules { margin: 12px 0 0; padding-left: 20px; font-size: 13.5px; line-height: 1.6; color: var(--ns-ink-55); }
.ns-caret {
  display: inline-block; width: 8px; height: 16px; background: var(--ns-accent);
  vertical-align: -3px; animation: nsBlink 1s steps(1) infinite; margin-left: 2px;
}
.ns-caret--green { width: 7px; height: 15px; background: var(--ns-d-ok); vertical-align: -2px; margin-left: 0; }

/* ── Ошибка ── */
.ns-error {
  padding: 20px; border-radius: 18px; background: var(--ns-bad-bg);
  border: 1px solid var(--ns-bad-bd); animation: nsPop .22s ease both;
}
.ns-error__title { font-size: 16px; font-weight: 700; color: var(--ns-bad-ink); margin-bottom: 8px; }
.ns-error__text { font-size: 14.5px; line-height: 1.6; color: var(--ns-ink-70); }
.ns-error__hint { margin-top: 10px; font-size: 12.5px; color: var(--ns-ink-40); font-family: var(--ns-mono); word-break: break-word; }

/* ── Своя политика: карточка ответа ── */
.ns-quest {
  padding: 14px 16px; border-radius: 14px; background: var(--ns-surface-alt);
  border: 1px solid var(--ns-border); font-size: 15px; line-height: 1.5;
}
.ns-btn--ink.ns-btn--block { margin-top: 12px; }
.ns-pol { margin-top: 14px; animation: nsPop .22s ease both; }
.ns-pol__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ns-pol__verdict { padding: 10px 16px; border-radius: 14px; font-size: 15px; font-weight: 800; }
.ns-pol__ms { font-family: var(--ns-mono); font-size: 22px; font-weight: 700; }
.ns-pol__ms span { font-size: 14px; color: var(--ns-ink-40); font-weight: 500; }
.ns-pol__box {
  margin-top: 14px; padding: 16px; border-radius: 14px; background: #fcfbff;
  border: 1px solid var(--ns-border); font-size: 14.5px; line-height: 1.6; color: var(--ns-ink-70);
}
.ns-pol__score { font-family: var(--ns-mono); font-weight: 600; color: var(--ns-bad-ink); }

/* ============================================================
   Как это работает
   ============================================================ */
.ns-lvl__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.ns-lvl__badge { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 8px; }
.ns-lvl__badge--l0 { color: var(--ns-ok); background: var(--ns-ok-bg); }
.ns-lvl__badge--l1 { color: var(--ns-accent-deep); background: var(--ns-accent-soft); }
.ns-lvl__badge--l2 { color: var(--ns-warn-ink); background: var(--ns-warn-bg); }
.ns-lvl__badge--l3 { color: var(--ns-ink-55); background: #f1f2f8; }
.ns-lvl__time { font-size: 26px; font-weight: 700; letter-spacing: -.03em; }
.ns-lvl__name { font-size: 17px; font-weight: 700; margin-bottom: 7px; }
.ns-lvl__desc { font-size: 14.5px; color: var(--ns-ink-55); line-height: 1.55; }
.ns-lvl__bar { margin-top: 16px; height: 4px; border-radius: 999px; }
.ns-lvl__bar--l0 { background: var(--ns-ok); width: 8%; }
.ns-lvl__bar--l1 { background: var(--ns-accent); width: 26%; }
.ns-lvl__bar--l2 { background: var(--ns-warn); width: 58%; }
.ns-lvl__bar--l3 { background: var(--ns-ink-45); width: 100%; }

/* ============================================================
   Для ИИ-агентов (тёмная секция)
   ============================================================ */
.ns-agents { background: var(--ns-dark-panel); padding: 80px 0; margin-bottom: var(--ns-rhythm); }
.ns-agents__col { display: flex; flex-direction: column; gap: 20px; }
.ns-dark-card { background: var(--ns-d-surface); border: 1px solid var(--ns-d-border); border-radius: 22px; padding: 24px; }
.ns-dark-text { font-size: 16px; line-height: 1.65; color: var(--ns-d-text); }
.ns-danger-line {
  margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: var(--ns-code-panel);
  border: 1px solid rgba(217, 38, 81, .35); font-size: 14px; color: #ff7d9e; overflow-x: auto;
}
.ns-bullets { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ns-bullets li { display: flex; gap: 12px; font-size: 14.5px; color: var(--ns-d-text-2); line-height: 1.55; }
.ns-bullets__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ns-d-ok); flex: none; margin-top: 8px; }

.ns-term { background: var(--ns-code-panel); border: 1px solid var(--ns-d-border); border-radius: 22px; padding: 22px 24px; }
.ns-term__head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.ns-term__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ns-bad); display: block; flex: none; animation: nsPulse 1.6s infinite; }
.ns-term__label { font-size: 12.5px; color: var(--ns-d-label); letter-spacing: .06em; }
.ns-term__head .ns-btn-ghost { margin-left: auto; }
.ns-term__body { display: flex; flex-direction: column; gap: 9px; font-size: 13.5px; min-height: 150px; }
.ns-term__row { display: flex; gap: 14px; animation: nsUp .22s ease both; }
.ns-term__t { color: var(--ns-d-stamp); flex: none; width: 78px; white-space: nowrap; }
.ns-term__msg { line-height: 1.5; }
.ns-term__err { color: var(--ns-d-bad); line-height: 1.6; font-size: 13px; }
.ns-stream { font-size: 15px; line-height: 1.7; color: var(--ns-d-text); }
.ns-stream__cut {
  margin-top: 14px; padding: 11px 14px; border-radius: 12px;
  background: rgba(217, 38, 81, .14); border: 1px solid rgba(217, 38, 81, .32);
  color: var(--ns-d-bad); font-size: 13.5px; font-weight: 600; animation: nsPop .2s ease both;
}

/* ============================================================
   Метрики
   ============================================================ */
.ns-metric__head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.ns-metric__val { font-size: 58px; font-weight: 700; letter-spacing: -.04em; line-height: 1; }
.ns-metric__unit { font-size: 26px; color: var(--ns-ink-40); font-weight: 500; }
.ns-spark { width: 100%; height: 62px; margin-top: 20px; display: block; }
.ns-metric__note { font-size: 13px; color: var(--ns-ink-40); margin-top: 8px; }
.ns-metric__text { font-size: 15.5px; color: var(--ns-ink-55); margin-top: 20px; line-height: 1.6; }
.ns-tri__title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.ns-tri__text { font-size: 15px; color: var(--ns-ink-55); line-height: 1.6; }

/* ============================================================
   Приватность (сверх макета)
   ============================================================ */
.ns-priv {
  background: var(--ns-surface); border: 1px solid var(--ns-border);
  border-radius: 28px; padding: clamp(26px, 3.4vw, 40px);
  box-shadow: var(--ns-shadow-cta);
  position: relative; overflow: hidden;
}
.ns-priv::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 5px;
  background: linear-gradient(180deg, var(--ns-ok), var(--ns-accent));
}
.ns-priv__head { display: flex; gap: 18px; align-items: flex-start; margin-bottom: 26px; }
.ns-priv__mark {
  width: 52px; height: 52px; flex: none; border-radius: 16px;
  background: var(--ns-accent-soft); display: flex; align-items: center; justify-content: center;
}
.ns-priv__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ns-priv-card {
  background: var(--ns-surface-alt); border: 1px solid var(--ns-border);
  border-radius: 18px; padding: 20px 20px 22px;
}
.ns-priv-card__dot {
  width: 10px; height: 10px; border-radius: 50%; display: block;
  background: var(--ns-ok); box-shadow: 0 0 0 4px rgba(15, 157, 118, .14); margin-bottom: 14px;
}
.ns-priv-card__title { font-size: 16px; font-weight: 700; margin-bottom: 8px; letter-spacing: -.01em; }
.ns-priv-card__text { font-size: 14.5px; line-height: 1.6; color: var(--ns-ink-55); }
.ns-priv-card__text .ns-mono { font-size: 13.5px; color: var(--ns-accent-deep); }

/* ============================================================
   Тарифы
   ============================================================ */
.ns-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(216px, 1fr)); gap: 14px; align-items: start; }
.ns-plan {
  border-radius: 22px; padding: 24px 22px; background: var(--ns-surface);
  border: 1px solid var(--ns-border); box-shadow: var(--ns-shadow-card); color: var(--ns-ink);
}
.ns-plan--rec {
  background: var(--ns-dark-panel); border-color: rgba(255, 255, 255, .14);
  box-shadow: var(--ns-shadow-plan-rec); color: #fff;
}
.ns-plan__rec {
  display: inline-block; padding: 5px 12px; border-radius: 999px;
  background: var(--ns-accent-grad); color: #fff; font-size: 11.5px; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px;
}
.ns-plan__name { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.ns-plan__price { font-size: 23px; font-weight: 700; letter-spacing: -.03em; line-height: 1.2; }
.ns-plan__iu { font-size: 13.5px; color: var(--ns-ink-55); margin-top: 6px; }
.ns-plan--rec .ns-plan__iu, .ns-plan--rec .ns-plan__feat { color: var(--ns-d-muted); }
.ns-plan__hr { height: 1px; background: var(--ns-border); margin: 18px 0; }
.ns-plan--rec .ns-plan__hr { background: rgba(255, 255, 255, .14); }
.ns-plan__feat { font-size: 14px; line-height: 1.65; color: var(--ns-ink-55); }

/* ============================================================
   CTA и футер
   ============================================================ */
.ns-cta {
  background: var(--ns-surface); border: 1px solid var(--ns-border); border-radius: 28px;
  padding: clamp(28px, 4vw, 52px); box-shadow: var(--ns-shadow-cta);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 32px; align-items: center;
}
.ns-cta__text { font-size: 16.5px; color: var(--ns-ink-55); margin: 0 0 26px; line-height: 1.6; max-width: 44ch; }
.ns-cta__btns { display: flex; gap: 12px; flex-wrap: wrap; }
.ns-snippet { background: var(--ns-code-panel); border-radius: 20px; padding: 22px 24px; position: relative; }
.ns-copy { position: absolute; top: 16px; right: 16px; padding: 7px 13px; }
.ns-snippet__code {
  font-size: 13px; line-height: 1.9; color: var(--ns-d-text-2);
  white-space: pre; overflow-x: auto; padding-top: 34px; margin: 0;
}

.ns-footer { border-top: 1px solid var(--ns-border); background: rgba(255, 255, 255, .5); }
.ns-footer__grid {
  max-width: var(--ns-container); margin: 0 auto; padding: 44px var(--ns-pad-x);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 28px;
}
.ns-footer__brand { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 17px; font-weight: 700; }
.ns-footer__brand img { border-radius: 9px; display: block; }
.ns-footer__slogan {
  font-size: 14px; font-weight: 600; color: var(--ns-accent-deep);
  margin-bottom: 12px; letter-spacing: .01em;
}
.ns-footer__legal { font-size: 14px; color: var(--ns-ink-45); line-height: 1.6; }
.ns-footer__col { font-size: 14.5px; color: var(--ns-ink-55); line-height: 2; }
.ns-footer__col a { color: var(--ns-ink-55); }
.ns-footer__col a:hover { color: var(--ns-accent-deep); }
.ns-footer__title { font-weight: 700; color: var(--ns-ink); margin-bottom: 6px; }
.ns-footer__bottom { max-width: var(--ns-container); margin: 0 auto; padding: 0 var(--ns-pad-x) 40px; font-size: 13px; color: var(--ns-ink-40); }

/* ============================================================
   Адаптив: только мелкая доводка (сетки — на auto-fit)
   ============================================================ */
@media (max-width: 760px) {
  :root { --ns-pad-x: 20px; --ns-rhythm: 64px; }
  /* На узком экране: знак и кнопка в одну строку, меню — отдельной строкой,
     иначе кнопка вклинивается между логотипом и пунктами меню. */
  .ns-header__inner { gap: 12px 14px; padding: 12px var(--ns-pad-x); }
  .ns-logo__img { width: 32px; height: 32px; border-radius: 9px; }
  .ns-logo__word { font-size: 19px; }
  .ns-header .ns-btn--accent { order: 2; padding: 9px 16px; font-size: 14px; }
  .ns-nav {
    gap: 14px 18px; font-size: 14px; order: 3; width: 100%;
    padding-top: 2px; justify-content: flex-start;
  }
  .ns-hero { padding-top: 48px; }
  .ns-demo__in { border-right: none; border-bottom: 1px solid var(--ns-border-soft); padding: 20px; }
  .ns-demo__out { padding: 20px; min-height: 0; }
  .ns-empty { min-height: 320px; }
  .ns-timer { margin-left: 0; text-align: left; }
  .ns-verdict-row { gap: 12px; }
  .ns-timer__val { font-size: 30px; }
  .ns-agents { padding: 56px 0; }
  .ns-priv__head { flex-direction: column; gap: 14px; }
  .ns-metric__val { font-size: 46px; }
  .ns-snippet__code { font-size: 12px; }
}

/* ============================================================
   Уважение к prefers-reduced-motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .ns-btn--accent:hover { transform: none; }
}
