/* ============================================================
   Документация getvizir.com/docs и /en/docs.
   Режим «читать»: слева разделы, по центру текст (~70 знаков), справа «На этой странице».
   Цвета, шрифты и радиусы - только переменные из styles.css. Подключается после styles.css.
   ============================================================ */

.docs { padding-block: clamp(28px, 5vw, 56px) clamp(48px, 8vw, 96px); }
.docs__grid {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 200px;
  gap: clamp(28px, 4vw, 56px);
  align-items: start;
}

/* ---------- Колонка разделов и «На этой странице» ---------- */
.docs-side, .docs-toc {
  position: sticky; top: 88px;
  max-height: calc(100dvh - 104px); overflow-y: auto;
  padding-bottom: 12px;
}
.docs-side__h, .docs-toc__h {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--mut-2);
}
.docs-side__h a { color: inherit; text-decoration: none; }
.docs-side__h a:hover { color: var(--tx); }

.docs-menu { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 2px; }
.docs-menu a {
  display: block; padding: 8px 12px; border-radius: var(--r-sm);
  border-left: 2px solid transparent;
  color: var(--mut); text-decoration: none; font-size: 14.5px; line-height: 1.35;
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.docs-menu a:hover { color: var(--tx); background: rgba(255, 255, 255, 0.03); }
.docs-menu a[aria-current="page"] {
  color: var(--tx); background: var(--panel-2); border-left-color: var(--ac);
  border-top-left-radius: 2px; border-bottom-left-radius: 2px;
}

.docs-toc ul { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 1px; border-left: 1px solid var(--bd); }
.docs-toc a {
  display: block; margin-left: -1px; padding: 5px 0 5px 14px;
  border-left: 1px solid transparent;
  color: var(--mut); text-decoration: none; font-size: 13.5px; line-height: 1.4;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.docs-toc a:hover { color: var(--tx); border-left-color: var(--bd-strong); }
.docs-toc a.is-active { color: var(--tx); border-left-color: var(--ac); }

/* Выпадашка разделов на узком экране (на широком спрятана) */
.docs-mnav { display: none; }

/* ---------- Текст ---------- */
.docs-body { min-width: 0; max-width: 72ch; }
/* строка пути над заголовком - общий класс .crumbs из styles.css */

.docs-body h1 {
  margin-top: 14px;
  font-size: clamp(1.75rem, 4.2vw, 2.55rem); line-height: 1.1; letter-spacing: -0.025em;
  overflow-wrap: break-word;
}
.docs-lead { margin-top: 16px; font-size: clamp(1.03rem, 1.5vw, 1.13rem); line-height: 1.65; color: var(--mut); }

.docs-body h2 {
  margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--bd);
  font-size: clamp(1.25rem, 2.3vw, 1.5rem); line-height: 1.2;
  scroll-margin-top: 84px;
}
.docs-body h3 { margin-top: 28px; font-size: 1.06rem; line-height: 1.3; letter-spacing: -0.01em; scroll-margin-top: 84px; }

.docs-body p, .docs-body li { line-height: 1.72; color: var(--tx); color: color-mix(in srgb, var(--tx) 86%, var(--mut)); }
.docs-body p { margin-top: 14px; }
.docs-body h3 + p { margin-top: 8px; }
.docs-body ul, .docs-body ol { margin-top: 12px; padding-left: 22px; display: grid; gap: 8px; }
.docs-body li::marker { color: var(--mut-2); }
.docs-body strong { color: var(--tx); font-weight: 600; }

.docs-body :where(p, li, td, figcaption) a {
  color: var(--ac); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--ac-line);
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
.docs-body :where(p, li, td, figcaption) a:hover { color: var(--ac-hover); text-decoration-color: var(--ac); }
/* меню разделов в выпадашке живёт внутри текста - стиль ссылок прозы на него не распространяется */
.docs-body .docs-menu a { color: var(--mut); text-decoration: none; }
.docs-body .docs-menu a:hover, .docs-body .docs-menu a[aria-current="page"] { color: var(--tx); }

/* Клавиши в строке текста - компактнее, чем отдельный чип на лендинге */
.docs-body .kbd { min-height: 22px; padding: 1px 7px; font-size: 12px; vertical-align: 1px; }
/* Путь в интерфейсе приложения: «Настройки → Речь» */
.docs-path {
  font-family: var(--font-mono); font-size: 0.86em; color: var(--tx);
  padding: 1px 6px; border: 1px solid var(--bd); border-radius: 6px; background: var(--panel-2);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ---------- Плашки ---------- */
.docs-note {
  margin-top: 20px; padding: 14px 16px 14px 18px;
  border: 1px solid var(--bd-strong);
  border-radius: var(--r); background: var(--panel);
}
.docs-note--warn { background: linear-gradient(180deg, var(--ac-soft), var(--panel)); }
.docs-note__t {
  display: block; margin: 0 0 4px;
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.07em; text-transform: uppercase; color: var(--intv);
}
.docs-note--tip .docs-note__t { color: var(--you); }
.docs-note--warn .docs-note__t { color: var(--ac); }
.docs-note p { margin-top: 0; font-size: 15px; }
.docs-note p + p { margin-top: 8px; }
.docs-note .docs-note__t { margin-top: 0; font-size: 11.5px; }

/* ---------- Шаги быстрого старта ---------- */
.docs-body ol.docs-steps { list-style: none; padding: 0; margin-top: 22px; gap: 0; counter-reset: dstep; }
.docs-steps > li { position: relative; padding: 0 0 24px 46px; counter-increment: dstep; }
.docs-steps > li:last-child { padding-bottom: 0; }
.docs-steps > li::before {
  content: counter(dstep); position: absolute; left: 0; top: 0;
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--ac);
  border: 1px solid var(--ac-line); background: var(--ac-soft);
}
.docs-steps > li::after { content: ""; position: absolute; left: 15px; top: 36px; bottom: 6px; width: 1px; background: var(--bd-strong); }
.docs-steps > li:last-child::after { display: none; }
.docs-body .docs-steps h3 { margin-top: 4px; font-size: 1.02rem; }
.docs-steps p { margin-top: 6px; }

/* ---------- Карточки-ссылки на разделы ---------- */
.docs-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.docs-card {
  display: block; padding: 16px 18px; border: 1px solid var(--bd); border-radius: var(--r);
  background: var(--panel); color: var(--tx); text-decoration: none;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.docs-card:hover { border-color: var(--bd-strong); background: var(--panel-2); }
.docs-card b { display: block; font-family: var(--font-mono); font-size: 15px; font-weight: 700; letter-spacing: -0.01em; }
.docs-card b::after { content: " →"; color: var(--ac); }
.docs-card span { display: block; margin-top: 6px; font-size: 14px; line-height: 1.55; color: var(--mut); }

/* ---------- Таблица ---------- */
.docs-tablewrap {
  margin-top: 18px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--bd); border-radius: var(--r); background: var(--panel);
}
.docs-table { width: 100%; min-width: 500px; border-collapse: collapse; font-size: 14.5px; }
.docs-table th, .docs-table td { padding: 10px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--bd); }
.docs-table th {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--mut-2); background: var(--panel-2);
}
.docs-table td { color: var(--tx); color: color-mix(in srgb, var(--tx) 86%, var(--mut)); line-height: 1.55; }
.docs-table td:first-child { width: 42%; min-width: 180px; }
.docs-table td .kbd { margin: 2px 4px 2px 0; vertical-align: middle; }
.docs-table tr:last-child td { border-bottom: 0; }
.docs-nw { white-space: nowrap; }

/* ---------- Кадры окон ---------- */
.docs-fig { margin: 22px 0 0; }
.docs-fig img { display: block; width: 100%; height: auto; max-width: 440px; filter: drop-shadow(0 24px 40px rgba(0, 0, 0, 0.5)); }
.docs-fig--wide img { max-width: 620px; }
.docs-fig--set img { max-width: 560px; }
.docs-fig--phone img { max-width: 250px; border: 1px solid var(--bd-strong); border-radius: 18px; }
.docs-fig figcaption { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--mut-2); }

/* ---------- Назад / Далее ---------- */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--bd); }
.docs-pager a {
  display: block; padding: 14px 16px; border: 1px solid var(--bd); border-radius: var(--r);
  background: var(--panel); text-decoration: none;
  transition: border-color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.docs-pager a:hover { border-color: var(--bd-strong); background: var(--panel-2); }
.docs-pager small { display: block; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mut-2); }
.docs-pager b { display: block; margin-top: 4px; color: var(--tx); font-weight: 600; }
.docs-pager .next { grid-column: 2; text-align: right; }

/* ---------- Адаптив ---------- */
@media (max-width: 1180px) {
  .docs__grid { grid-template-columns: 210px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 900px) {
  .docs__grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs-side { display: none; }
  .docs-body { max-width: none; }
  .docs-mnav {
    display: block; margin-bottom: 22px;
    border: 1px solid var(--bd-strong); border-radius: var(--r); background: var(--panel);
  }
  .docs-mnav summary {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    min-height: 46px; padding: 10px 16px; cursor: pointer; list-style: none;
    font-family: var(--font-mono); font-size: 14px; color: var(--tx); touch-action: manipulation;
  }
  .docs-mnav summary::-webkit-details-marker { display: none; }
  .docs-mnav__k { color: var(--mut-2); margin-right: 6px; }
  .docs-mnav__k::after { content: " ·"; }
  .docs-mnav .chev { flex: 0 0 auto; width: 18px; height: 18px; color: var(--mut); transition: transform var(--dur) var(--ease); }
  .docs-mnav[open] .chev { transform: rotate(180deg); }
  .docs-mnav .docs-menu { margin: 0; padding: 6px; border-top: 1px solid var(--bd); }
  .docs-mnav .docs-menu a { padding-block: 11px; }
}
@media (max-width: 560px) {
  /* таблица клавиш на телефоне - карточками: действие, под ним macOS и Windows */
  .docs-table { min-width: 0; }
  .docs-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .docs-table, .docs-table tbody, .docs-table tr, .docs-table td { display: block; }
  .docs-table tr { padding: 12px 14px; border-bottom: 1px solid var(--bd); }
  .docs-table tr:last-child { border-bottom: 0; }
  .docs-table td { padding: 0; border: 0; }
  .docs-table td:first-child { width: auto; min-width: 0; margin-bottom: 6px; color: var(--tx); }
  .docs-table td[data-label] { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 4px; }
  .docs-table td[data-label]::before {
    content: attr(data-label); min-width: 74px;
    font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--mut-2);
  }
  .docs-table td .kbd { margin: 0; }
  .docs-cards { grid-template-columns: 1fr; }
  .docs-body h2 { margin-top: 40px; padding-top: 24px; }
  .docs-pager { grid-template-columns: 1fr; }
  .docs-pager .next { grid-column: auto; }
  .docs-steps > li { padding-left: 42px; }
}
