/* ═══ Справка Airgram — стили сайта ════════════════════════════════════════
   С 18.10.2026 — по образцу простых сайтов документации (решение владельца):
   сверху логотип и поиск, слева меню разделов со значками, по центру
   короткий текст, справа «На этой странице». Никаких плашек, таблиц и
   схем: заголовки, абзацы, списки, скриншоты и одно нейтральное
   примечание. Цвета, шрифт и скругления — программы
   (webapp/static/css/tokens.css): Google Sans, акцент #0b57d0.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --font: "Google Sans", Roboto, RobotoDraft, Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;

  --ink: #1f1f1f;
  --ink-mute: #444746;
  --ink-faint: #80868b;
  --text: #3c4043;

  --surface: #ffffff;
  --surface-1: #f8f9fa;
  --surface-4: #f1f3f4;
  --surface-5: #e8eaed;
  --line: #dadce0;
  --line-soft: #e8eaed;

  --primary: #0b57d0;
  --primary-soft: #d3e3fd;

  --shadow-1: 0 1px 2px rgba(60, 64, 67, 0.15);
  --shadow-3: 0 8px 24px rgba(60, 64, 67, 0.18);

  --top-h: 60px;
  --side-w: 280px;
  --toc-w: 240px;
}

* { box-sizing: border-box; }
/* Место под полосу прокрутки занято всегда: на коротких страницах (без полосы)
   контент не сдвигается вправо относительно длинных. */
html { scroll-padding-top: calc(var(--top-h) + 24px); scrollbar-gutter: stable; }
body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
b { color: var(--ink); font-weight: 500; }
svg { display: block; }
code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-4);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 0.86em;
  word-break: break-word;
}

/* ── Верхняя полоса: логотип и поиск ────────────────────────────────────── */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: var(--top-h);
  padding: 0 24px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}
.top__menu {
  display: none;
  flex: none;
  width: 40px;
  height: 40px;
  margin-left: -8px;
  padding: 10px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-mute);
  cursor: pointer;
}
.top__menu:hover { background: var(--surface-4); }
.top__brand {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 19px;
  font-weight: 500;
  white-space: nowrap;
}
.top__brand:hover { text-decoration: none; }
.top__brand img { border-radius: 8px; }

.lang { position: relative; flex: none; }
.lang__btn {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--ink-mute);
  font: 500 14px var(--font);
  cursor: pointer;
}
.lang__btn:hover { background: var(--surface-4); }
.lang__btn svg { width: 12px; height: 12px; }
.lang__panel {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  min-width: 64px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
  z-index: 60;
}
.lang__panel[hidden] { display: none; }
.lang__item {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--ink);
  font: 500 14px var(--font);
}
.lang__item:hover { background: var(--surface-4); text-decoration: none; }
.search { position: relative; width: min(360px, 40vw); min-width: 0; margin-left: auto; }
.search__field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 20px;
  background: var(--surface-4);
  color: var(--ink-faint);
  cursor: text;
  transition: background-color 0.15s, border-color 0.15s;
}
.search__field:hover { background: var(--surface-5); }
.search__field:focus-within {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.search__field svg { width: 18px; height: 18px; flex: none; }
.search__field input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.search__field input::-webkit-search-cancel-button { display: none; }
.search__field kbd {
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink-faint);
  font-family: var(--font);
  font-size: 11px;
  white-space: nowrap;
}
.search__results {
  position: absolute;
  z-index: 30;
  top: 48px;
  right: 0;
  width: min(480px, calc(100vw - 32px));
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow-3);
}
.search__item { display: block; padding: 10px 12px; border-radius: 10px; color: var(--ink); }
.search__item:hover,
.search__item.is-active { background: var(--surface-4); text-decoration: none; }
.search__item b { display: block; font-size: 14px; font-weight: 500; }
.search__item span { display: block; color: var(--ink-faint); font-size: 12px; line-height: 1.4; }
.search__item mark { border-radius: 3px; background: var(--primary-soft); color: inherit; }
.search__empty { margin: 0; padding: 14px 12px; color: var(--ink-faint); font-size: 14px; }

/* ── Раскладка ──────────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w);
  min-height: calc(100vh - var(--top-h));
}

/* ── Слева: меню разделов ───────────────────────────────────────────────── */
.side {
  position: sticky;
  top: var(--top-h);
  height: calc(100vh - var(--top-h));
  overflow-x: hidden;
  overflow-y: auto;
  padding: 20px 12px 32px;
  border-right: 1px solid var(--line-soft);
  scrollbar-width: thin;
}
.side__group { margin-bottom: 16px; }
.side__title {
  margin: 0 0 2px;
  padding: 0 12px;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 500;
  line-height: 28px;
}
.side__item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 5px 12px;
  border-radius: 999px;
  color: var(--ink-mute);
  font-size: 14px;
  line-height: 1.3;
}
.side__item .ico { width: 18px; height: 18px; flex: none; color: var(--ink-faint); }
.side__item:hover { background: var(--surface-4); color: var(--ink); text-decoration: none; }
.side__item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 500; }
.side__item.is-active .ico { color: var(--primary); }

/* ── Страница ───────────────────────────────────────────────────────────── */
.page {
  width: 100%;
  min-width: 0;
  max-width: 800px;
  margin: 0 auto;
  padding: 36px 48px 48px;
}
.page__group { margin: 0 0 6px; color: var(--primary); font-size: 13px; font-weight: 500; }
.page__title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  color: var(--ink);
  font-size: 32px;
  font-weight: 500;
  line-height: 40px;
}
.page__title .ico { width: 30px; height: 30px; flex: none; color: var(--ink-mute); }
.page__lead { margin: 12px 0 0; color: var(--ink-mute); font-size: 18px; line-height: 1.6; }
.page__body { margin-top: 28px; }

/* Первый элемент страницы не отступает сам: контент всегда начинается на
   одном расстоянии (28px) под заголовком или подзаголовком, чем бы он ни
   открывался — абзацем, списком, скриншотом, заголовком раздела или тарифами. */
.page__body > :first-child { margin-top: 0; }
.page__body p { margin: 0 0 14px; }
.page__body h2 {
  margin: 40px 0 12px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 500;
  line-height: 30px;
}
.page__body h3 {
  margin: 24px 0 8px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 500;
  line-height: 24px;
}
.anchor { margin-left: 8px; color: var(--ink-faint); font-weight: 400; opacity: 0; transition: opacity 0.15s; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }
.anchor:hover { color: var(--primary); text-decoration: none; }

.list { margin: 4px 0 16px; padding-left: 22px; }
.list li { margin-bottom: 6px; padding-left: 2px; }
.list li::marker { color: var(--ink-faint); }

/* Нумерованный список — шаги в кружках, как в инструкциях. */
.list--ol { padding-left: 0; list-style: none; counter-reset: step; }
.list--ol li {
  position: relative;
  min-height: 28px;
  margin-bottom: 12px;
  padding-left: 42px;
  counter-increment: step;
}
.list--ol li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  content: counter(step);
}

/* Примечание — одно нейтральное на страницу. */
.note {
  position: relative;
  margin: 20px 0;
  padding: 14px 18px 14px 46px;
  border-radius: 12px;
  background: var(--surface-1);
  color: var(--ink-mute);
  font-size: 14px;
  line-height: 1.6;
}
.note::before {
  position: absolute;
  top: 14px;
  left: 16px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--ink-faint);
  border-radius: 50%;
  color: var(--ink-faint);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  content: "i";
}

/* Блок кода — форматы и примеры строк. */
.code {
  margin: 8px 0 18px;
  padding: 14px 18px;
  overflow-x: auto;
  border-radius: 12px;
  background: var(--surface-4);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
}
.code code { padding: 0; background: none; font-size: inherit; }

/* Скриншот экрана программы. */
.shot { margin: 20px 0 24px; }
.shot img {
  display: block;
  /* Ширину задаёт атрибут width (реальный размер кадра), но не шире колонки. */
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  box-shadow: var(--shadow-1);
}

/* Клик по скриншоту — он открывается во весь экран (site.js). */
.shot img { cursor: zoom-in; }
html.is-zoomed { overflow: hidden; }
.zoom {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(32, 33, 36, 0.82);
  animation: zoom-in 0.15s ease;
}
.zoom__close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s;
}
.zoom__close:hover { background: rgba(255, 255, 255, 0.28); }
.zoom__close svg { width: 22px; height: 22px; }
.zoom img {
  display: block;
  width: auto;
  height: auto;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 48px);
  object-fit: contain;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow-3);
}
@keyframes zoom-in { from { opacity: 0; } to { opacity: 1; } }

/* Тарифы — три карточки с ценами airgram.cc. */
.plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 8px 0 0;
}
.plan {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 400px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-1);
}
.plan.is-featured { border-color: var(--primary); }
.plan__name { margin: 0; color: var(--ink); font-size: 19px; font-weight: 500; line-height: 32px; }
.plan__segs { display: flex; gap: 6px; height: 32px; }
.plan__seg {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-mute);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.plan__seg:hover:not(.is-active) { background: var(--surface-4); color: var(--ink); }
.plan__seg.is-active { border-color: transparent; background: var(--primary-soft); color: var(--primary); }
.plan__price {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  min-height: 40px;
  margin: 14px 0 0;
}
.page__body .plan p { margin: 0; }
.page__body .plan p.plan__price { margin-top: 14px; }
.plan__price[hidden], .plan__list li[hidden] { display: none; }
.plan__price b { color: var(--ink); font-size: 26px; font-weight: 600; line-height: 36px; white-space: nowrap; }
.plan__price s { color: var(--ink-faint); font-size: 14px; white-space: nowrap; }
.plan__price span {
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  white-space: nowrap;
}
.plan__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  margin-top: 6px;
  padding: 0 20px;
  border: 1px solid var(--primary);
  border-radius: 20px;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.1px;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.plan__btn:hover { border-color: #0842a0; background: #0842a0; box-shadow: var(--shadow-1); text-decoration: none; }
.plan__btn.is-quiet { border-color: var(--line); background: transparent; color: var(--primary); }
.plan__btn.is-quiet:hover { border-color: var(--line); background: var(--surface-4); box-shadow: none; }
.plan__list { display: flex; flex-direction: column; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.plan__list li { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 20px; color: var(--ink); }
.plan__list svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--primary); }
.page__body .plan p.plan__fine { margin-top: auto; padding-top: 16px; color: var(--ink-faint); font-size: 12px; line-height: 18px; }
.plans__guard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 24px 0 0 !important;
  color: var(--ink-mute);
  font-size: 13px;
  line-height: 18px;
  text-align: center;
}
.plans__guard svg { flex: none; width: 20px; height: 20px; color: var(--primary); }

/* ── Справа: «На этой странице» ─────────────────────────────────────────── */
.toc {
  position: sticky;
  top: var(--top-h);
  align-self: start;
  max-height: calc(100vh - var(--top-h));
  overflow-y: auto;
  padding: 40px 20px 24px 8px;
}
.toc__title { margin: 0 0 8px; color: var(--ink); font-size: 13px; font-weight: 500; }
.toc__item {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 2px solid var(--line-soft);
  color: var(--ink-faint);
  font-size: 13px;
  line-height: 1.4;
}
.toc__item:hover { color: var(--ink); text-decoration: none; }
.toc__item.is-active { border-left-color: var(--primary); color: var(--primary); }

/* ── Узкие экраны ───────────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .layout { grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .top { gap: 12px; padding: 0 16px; }
  .top__menu { display: block; }
  .search { width: auto; flex: 1 1 auto; }
  .search__field kbd { display: none; }
  .side {
    position: fixed;
    z-index: 25;
    left: 0;
    width: min(300px, 86vw);
    background: var(--surface);
    box-shadow: var(--shadow-3);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
  }
  body.is-menu-open .side { transform: none; }
  .page { padding: 24px 16px 40px; }
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan { min-height: 0; }
  .page__title { font-size: 26px; line-height: 34px; }  .page__title .ico { width: 24px; height: 24px; }
}
