:root {
    --bg: #0a0e14;
    --bg-card: #121821;
    --bg-card-2: #181f2a;
    --border: #232b38;
    --text: #e8edf2;
    --text-dim: #8a96a8;
    --accent: #36d399;
    --accent-d: #1ea87b;
    --danger: #f87171;
    --radius: 14px;
  }
  *,*::before,*::after { box-sizing: border-box; }
  html,body { margin:0; padding:0; }
  /* ⚠️ overflow-x: hidden на body ЛОМАЕТ position: sticky в Telegram WebView
     и старых Safari — sticky прилипает к body вместо viewport.
     Если нужно гасить горизонтальный overflow — использовать `overflow-x: clip`
     или вешать на конкретный «вылезающий» элемент, а не на body. */
  html { overflow-x: clip; }
  body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.55;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
  }
  a { color: var(--accent); text-decoration: none; }
  a:hover { color: #fff; }
  .container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

  /* Header */
  header {
    padding: 22px 0;
    padding-top: calc(22px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid transparent;
    position: -webkit-sticky;
    position: sticky;
    top: 0; z-index: 50;
    background: rgba(10,14,20,0.92);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
  }
  /* Fallback для WebView без backdrop-filter (Telegram in-app, старые Safari) —
     иначе хедер остаётся полупрозрачным и контент просвечивает. */
  @supports not ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))) {
    header { background: #0a0e14; }
  }
  header.scrolled { border-bottom-color: var(--border); }
  .nav {
    display: flex; align-items: center; justify-content: space-between; gap: 24px;
  }
  .logo {
    display:flex; align-items:center; gap:10px;
    font-weight: 700; color: #fff; font-size: 18px;
  }
  .logo-mark {
    width: 30px; height: 30px;
    background: linear-gradient(135deg, var(--accent), var(--accent-d));
    border-radius: 8px;
    display: grid; place-items: center;
    color: #07120c; font-weight: 800; font-size: 16px;
  }
  .nav-links { display:flex; gap: 22px; }
  .nav-links a { color: var(--text-dim); font-weight: 500; font-size: 14.5px; }
  .nav-links a:hover { color: #fff; }
  .nav-cta {
    background: var(--accent);
    color: #07120c;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14.5px;
    transition: background .15s ease;
  }
  .nav-cta:hover { background: #4ee3a8; color: #07120c; }

  /* Hero */
  .hero {
    padding: 88px 0 56px;
    text-align: center;
    position: relative;
  }
  .hero::before {
    content: ""; position: absolute; inset: 0;
    background:
      radial-gradient(60% 50% at 50% 0%, rgba(54,211,153,.18), transparent 70%),
      radial-gradient(40% 30% at 80% 30%, rgba(80,180,255,.10), transparent 70%);
    z-index: -1; pointer-events: none;
  }
  .pill {
    display:inline-flex; align-items:center; gap:8px;
    padding: 6px 12px;
    background: rgba(54,211,153,0.12);
    border: 1px solid rgba(54,211,153,0.35);
    color: var(--accent);
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
  }
  .pill::before {
    content: ""; width: 7px; height: 7px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 0 0 rgba(54,211,153,.7);
    animation: pulse 1.8s infinite;
  }
  @keyframes pulse {
    0%   { box-shadow: 0 0 0 0    rgba(54,211,153,.7); }
    70%  { box-shadow: 0 0 0 8px  rgba(54,211,153,0); }
    100% { box-shadow: 0 0 0 0    rgba(54,211,153,0); }
  }
  h1 {
    font-size: clamp(34px, 6vw, 60px);
    line-height: 1.05;
    margin: 0 0 18px;
    color: #fff;
    letter-spacing: -0.02em;
    font-weight: 800;
  }
  h1 .grad {
    background: linear-gradient(135deg, var(--accent), #6ee7b7 60%, #67d4ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .lead {
    font-size: clamp(16px, 1.8vw, 19px);
    color: var(--text-dim);
    max-width: 680px;
    margin: 0 auto 36px;
  }
  .cta-row {
    display:flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  }
  .btn {
    display:inline-flex; align-items:center; gap:8px;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 15px;
    transition: transform .12s ease, background .15s ease, color .15s ease;
    border: 1px solid transparent;
  }
  .btn-primary {
    background: var(--accent); color: #07120c;
  }
  .btn-primary:hover {
    background: #4ee3a8; color: #07120c; transform: translateY(-1px);
  }
  .btn-secondary {
    background: var(--bg-card);
    color: #fff;
    border-color: var(--border);
  }
  .btn-secondary:hover { background: var(--bg-card-2); color: #fff; }

  /* Stats */
  .stats {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-top: 56px; max-width: 800px; margin-left:auto; margin-right:auto;
  }
  .stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
  }
  .stat-num {
    font-size: 30px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg, var(--accent), #6ee7b7);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  .stat-lbl { color: var(--text-dim); font-size: 13px; margin-top: 4px; }

  /* Section base */
  section { padding: 64px 0; scroll-margin-top: 80px; }
  .section-head {
    text-align: center;
    max-width: 720px; margin: 0 auto 44px;
  }
  .section-head h2 {
    font-size: clamp(26px, 4vw, 38px);
    margin: 0 0 12px;
    color: #fff;
    letter-spacing: -0.02em;
    font-weight: 800;
  }
  .section-head p {
    color: var(--text-dim);
    margin: 0;
    font-size: 16px;
  }

  /* Tools grid */
  .tools {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  .tool {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 20px;
    transition: transform .15s ease, border-color .15s ease, background .15s ease;
  }
  .tool:hover {
    transform: translateY(-2px);
    border-color: rgba(54,211,153,.4);
    background: var(--bg-card-2);
  }
  .tool-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: rgba(54,211,153,0.12);
    display:grid; place-items:center;
    font-size: 20px;
    margin-bottom: 14px;
  }
  .tool-name { font-weight: 700; color: #fff; margin: 0 0 4px; font-size: 16px; }
  .tool-desc { margin: 0; color: var(--text-dim); font-size: 13.5px; }

  /* How */
  .how {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    counter-reset: step;
  }
  .step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    counter-increment: step;
  }
  .step::before {
    content: counter(step);
    position: absolute; top: -14px; left: 20px;
    background: var(--accent); color: #07120c;
    width: 32px; height: 32px;
    border-radius: 50%;
    display: grid; place-items: center;
    font-weight: 800;
    font-size: 14px;
  }
  .step h3 { margin: 6px 0 8px; color: #fff; font-size: 17px; }
  .step p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

  /* Features list */
  .features {
    display: grid; gap: 14px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  }
  .feature {
    display: flex; gap: 14px;
    padding: 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
  }
  .feature .check {
    flex-shrink: 0; width: 26px; height: 26px;
    background: rgba(54,211,153,0.15);
    color: var(--accent);
    border-radius: 50%;
    display:grid; place-items:center;
    font-weight: 800;
    margin-top: 1px;
  }
  .feature-text strong { color: #fff; display: block; margin-bottom: 4px; }
  .feature-text span { color: var(--text-dim); font-size: 14.5px; }

  /* Pricing */
  .pricing {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    align-items: stretch;
  }
  .plan {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    display: flex; flex-direction: column;
    transition: transform .15s ease, border-color .15s ease;
  }
  .plan:hover { transform: translateY(-2px); border-color: rgba(54,211,153,.35); }
  .plan.featured {
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(54,211,153,0.08), var(--bg-card) 60%);
    box-shadow: 0 0 0 1px rgba(54,211,153,0.4), 0 20px 50px -20px rgba(54,211,153,0.25);
    position: relative;
  }
  .plan.featured::before {
    content: 'Популярный';
    position: absolute; top: -12px; right: 20px;
    background: var(--accent); color: #07120c;
    font-size: 12px; font-weight: 700;
    padding: 5px 12px; border-radius: 999px;
    letter-spacing: 0.02em;
  }
  .plan-name { color: #fff; font-weight: 800; font-size: 18px; margin: 0 0 6px; }
  .plan-tagline { color: var(--text-dim); font-size: 14px; margin: 0 0 18px; min-height: 38px; }
  .plan-price { color: #fff; font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
  .plan-price .per { color: var(--text-dim); font-size: 14px; font-weight: 500; }
  .plan-features { list-style: none; padding: 0; margin: 22px 0 28px; flex: 1; }
  .plan-features li {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 7px 0;
    color: var(--text-dim); font-size: 14.5px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .plan-features li:last-child { border-bottom: none; }
  .plan-features li::before {
    content: '✓'; color: var(--accent); font-weight: 800; flex-shrink: 0;
  }
  .plan-cta {
    display: block; text-align: center;
    padding: 12px 18px; border-radius: 10px;
    font-weight: 700; font-size: 14.5px;
    background: var(--bg-card-2); color: #fff;
    border: 1px solid var(--border);
    transition: background .15s ease, border-color .15s ease;
  }
  .plan-cta:hover { background: var(--border); color: #fff; }
  .plan.featured .plan-cta {
    background: var(--accent); color: #07120c; border-color: var(--accent);
  }
  .plan.featured .plan-cta:hover { background: #4ee3a8; color: #07120c; }
  .plan-note {
    text-align: center; color: var(--text-dim);
    font-size: 13.5px; margin-top: 22px;
  }

  /* Testimonials */
  .reviews {
    display: grid; gap: 18px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
  .review {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex; flex-direction: column; gap: 16px;
  }
  .review-stars { color: var(--accent); font-size: 16px; letter-spacing: 2px; }
  .review-text {
    color: var(--text); font-size: 15px; line-height: 1.6;
    margin: 0; flex: 1;
  }
  .review-author {
    display: flex; align-items: center; gap: 12px;
    padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.05);
  }
  .review-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-d));
    display: grid; place-items: center;
    color: #07120c; font-weight: 800; font-size: 15px;
    flex-shrink: 0;
  }
  .review-meta strong { color: #fff; display: block; font-size: 14.5px; }
  .review-meta span { color: var(--text-dim); font-size: 13px; }

  /* FAQ */
  .faq {
    display: flex; flex-direction: column; gap: 10px;
    max-width: 820px; margin: 0 auto;
  }
  .faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color .15s ease;
  }
  .faq-item[open] { border-color: rgba(54,211,153,0.35); }
  .faq-item summary {
    list-style: none;
    cursor: pointer;
    padding: 18px 22px;
    font-weight: 600; color: #fff; font-size: 15.5px;
    display: flex; justify-content: space-between; align-items: center;
    gap: 16px;
  }
  .faq-item summary::-webkit-details-marker { display: none; }
  .faq-item summary::after {
    content: '+'; color: var(--accent);
    font-size: 22px; font-weight: 400;
    transition: transform .2s ease;
    flex-shrink: 0;
  }
  .faq-item[open] summary::after { content: '−'; }
  .faq-item .faq-answer {
    padding: 0 22px 18px;
    color: var(--text-dim); font-size: 14.5px; line-height: 1.65;
  }
  .faq-item .faq-answer p { margin: 0 0 10px; }
  .faq-item .faq-answer p:last-child { margin-bottom: 0; }

  /* CTA Banner */
  .cta-banner {
    margin: 40px 0;
    background: linear-gradient(135deg, rgba(54,211,153,0.12), rgba(80,180,255,0.08));
    border: 1px solid rgba(54,211,153,0.3);
    border-radius: 20px;
    padding: 44px 28px;
    text-align: center;
  }
  .cta-banner h2 {
    margin: 0 0 12px;
    font-size: clamp(24px, 3.5vw, 32px);
    color: #fff;
    letter-spacing: -0.02em;
  }
  .cta-banner p { color: var(--text-dim); margin: 0 0 22px; }

  /* Footer */
  footer {
    border-top: 1px solid var(--border);
    padding: 36px 0;
    color: var(--text-dim);
    font-size: 14px;
  }
  .footer-row {
    display: flex; justify-content: space-between; gap: 20px;
    flex-wrap: wrap; align-items: center;
  }
  .footer-links { display:flex; gap: 20px; flex-wrap: wrap; }
  .footer-links a { color: var(--text-dim); }
  .footer-links a:hover { color: #fff; }

  @media (max-width: 640px) {
    .nav-links { display: none; }
    .hero { padding: 56px 0 36px; }
    section { padding: 48px 0; }
    .cta-banner { padding: 32px 20px; }
  }

/* =========================================================
   ДОПОЛНЕНИЯ для /tools/ и tool-страниц
   ========================================================= */

/* Breadcrumbs — НЕ переопределяем horizontal padding из .container (24px),
   только vertical, иначе на мобиле текст прижимается к краю экрана. */
.breadcrumbs {
  padding-top: 18px;
  padding-bottom: 4px;
  font-size: 13.5px;
  color: var(--text-dim);
}
.breadcrumbs ol {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.breadcrumbs li { display: flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before {
  content: '/'; color: var(--border);
}
.breadcrumbs a { color: var(--text-dim); }
.breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs [aria-current="page"] { color: var(--text); }

/* Tools index — карточка с состояниями */
.tools-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.tool-card {
  display: flex; flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  position: relative;
  transition: transform .15s ease, border-color .15s ease;
}
.tool-card.is-live { color: inherit; }
.tool-card.is-live:hover {
  transform: translateY(-2px);
  border-color: rgba(54,211,153,.5);
}
.tool-card.is-soon {
  opacity: 0.58;
  cursor: not-allowed;
}
.tool-card .badge {
  position: absolute; top: 14px; right: 14px;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.tool-card .badge.live { background: rgba(54,211,153,0.15); color: var(--accent); }
.tool-card .badge.soon { background: rgba(255,255,255,0.05); color: var(--text-dim); }

/* Article — длинный текст гайда */
.article {
  max-width: 760px;
  margin: 0 auto;
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text);
}
.article h1 {
  font-size: clamp(28px, 4.5vw, 42px);
  letter-spacing: -0.02em;
  margin: 8px 0 16px;
  color: #fff;
  font-weight: 800;
  line-height: 1.15;
}
.article .article-lead {
  font-size: 18px;
  color: var(--text-dim);
  margin: 0 0 32px;
}
.article h2 {
  font-size: clamp(22px, 3vw, 28px);
  margin: 48px 0 14px;
  color: #fff;
  letter-spacing: -0.01em;
  font-weight: 800;
  scroll-margin-top: 90px;
}
.article h3 {
  font-size: 18px;
  margin: 28px 0 10px;
  color: #fff;
  font-weight: 700;
}
.article p { margin: 0 0 16px; color: var(--text); }
.article ul, .article ol { margin: 0 0 16px; padding-left: 24px; }
.article li { margin-bottom: 8px; color: var(--text); }
.article ul li::marker { color: var(--accent); }
.article ol li::marker { color: var(--accent); font-weight: 700; }
.article strong { color: #fff; }
.article a { color: var(--accent); border-bottom: 1px dotted rgba(54,211,153,0.4); }
.article a:hover { color: #fff; border-bottom-color: #fff; }
.article a.btn {
  border-bottom: 0;
}
.article a.btn-primary,
.article a.btn-primary:visited,
.article a.btn-primary:hover {
  color: #07120c;
}
.article a.btn-secondary,
.article a.btn-secondary:visited,
.article a.btn-secondary:hover {
  color: #fff;
}
.article code {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  color: var(--accent);
}
.article hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* TOC — содержание */
.toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 32px 0;
}
.toc-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  margin: 0 0 10px;
  font-weight: 600;
}
.toc ol {
  list-style: decimal;
  padding-left: 22px;
  margin: 0;
  color: var(--text-dim);
}
.toc li { margin: 5px 0; }
.toc a { color: var(--text); border: none; }
.toc a:hover { color: var(--accent); }

/* Callouts */
.callout {
  border-left: 3px solid var(--accent);
  background: rgba(54,211,153,0.06);
  padding: 14px 18px;
  margin: 20px 0;
  border-radius: 0 10px 10px 0;
}
.callout.warn {
  border-left-color: #f59e0b;
  background: rgba(245,158,11,0.06);
}
.callout.danger {
  border-left-color: var(--danger);
  background: rgba(248,113,113,0.06);
}
.callout p { margin: 0; }
.callout p + p { margin-top: 10px; }
.callout strong { display: block; margin-bottom: 4px; color: #fff; font-size: 14.5px; letter-spacing: 0.01em; }

/* HowTo — нумерованные шаги */
.howto {
  display: grid; gap: 14px;
  counter-reset: howstep;
  margin: 24px 0;
}
.howto-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px 20px 64px;
  position: relative;
  counter-increment: howstep;
}
.howto-step::before {
  content: counter(howstep);
  position: absolute; top: 18px; left: 20px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--accent); color: #07120c;
  display: grid; place-items: center;
  font-weight: 800; font-size: 14px;
}
.howto-step h3 {
  margin: 0 0 6px; color: #fff; font-size: 16.5px;
}
.howto-step p { margin: 0; color: var(--text-dim); font-size: 14.5px; }

/* =========================================================
   МОБИЛЬНЫЕ ПРАВКИ для tool-страниц
   На мобайле текст должен быть компактнее — иначе строки получаются
   слишком короткие и глаз "прыгает". Apple HIG: 15-17px для основного.
   ========================================================= */
@media (max-width: 640px) {
  .article {
    font-size: 15.5px;
    line-height: 1.6;
  }
  .article h1 {
    font-size: clamp(24px, 7.5vw, 32px);
    line-height: 1.18;
    margin: 4px 0 14px;
  }
  .article .article-lead {
    font-size: 16px;
    line-height: 1.55;
    margin: 0 0 24px;
  }
  .article h2 {
    font-size: 21px;
    margin: 36px 0 12px;
  }
  .article h3 { font-size: 17px; margin: 22px 0 8px; }
  .article p { margin: 0 0 14px; }
  .article ul, .article ol { padding-left: 22px; }

  .toc { padding: 16px 18px; margin: 24px 0; }
  .toc ol { padding-left: 20px; }
  .toc li { margin: 4px 0; font-size: 15px; }

  .howto-step { padding: 18px 18px 18px 58px; }
  .howto-step::before { top: 16px; left: 16px; }
  .howto-step h3 { font-size: 16px; }
  .howto-step p { font-size: 14px; }

  .callout { padding: 12px 14px; margin: 16px 0; }
  .callout p { font-size: 14.5px; }

  .breadcrumbs { font-size: 13px; }

  .tool-card { padding: 18px 16px; }
}
