/* Документация Just Talk: светлая, читаемая, без горизонтальной прокрутки страницы.
   Таблицы и код прокручиваются внутри себя. Цвета — из кабинета. */
:root {
  --text: #1d1d24; --muted: #5f6472; --line: #e4e5ea; --bg: #ffffff; --soft: #f6f7f9;
  --accent: #6a4fd1; --accent-soft: #f1edfc; --code: #f5f6f8; --mark: #fff1a8;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Шапка */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.brand { font-weight: 700; color: var(--text); white-space: nowrap; }
.brand span { font-weight: 400; color: var(--muted); margin-left: 4px; }
.cabinet { white-space: nowrap; font-size: 15px; }
.search { position: relative; flex: 1 1 auto; max-width: 560px; min-width: 0; }
.search input { width: 100%; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 15px; background: var(--soft); }
.search input:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); background: #fff; }
.results { position: absolute; left: 0; right: 0; top: calc(100% + 6px); max-height: min(70vh, 560px); overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(20,20,40,.12); }
.results a { display: block; padding: 10px 14px; border-bottom: 1px solid var(--line); color: var(--text); }
.results a:last-child { border-bottom: 0; }
.results a:hover, .results a[aria-selected="true"] { background: var(--accent-soft); text-decoration: none; }
.results .where { display: block; font-size: 13px; color: var(--muted); }
.results .what { display: block; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.results mark { background: var(--mark); color: inherit; padding: 0 1px; border-radius: 2px; }
.results .none { margin: 0; padding: 12px 14px; color: var(--muted); font-size: 14px; }

/* Раскладка: меню, текст, оглавление страницы */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr) 210px; gap: 40px; max-width: 1320px; margin: 0 auto; padding: 0 24px; }
.side { position: sticky; top: 58px; align-self: start; max-height: calc(100vh - 58px); overflow: auto; padding: 24px 0 40px; font-size: 15px; }
.side summary { display: none; }
.side ul { list-style: none; margin: 0 0 8px; padding: 0; }
.side li a { display: block; padding: 5px 10px; border-radius: 6px; color: var(--text); }
.side li a:hover { background: var(--soft); text-decoration: none; }
.side li a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side .nav-group { margin: 18px 10px 6px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.side .nav-group:first-of-type { margin-top: 0; }
.side .sub details summary { display: block; cursor: pointer; padding: 5px 10px; color: var(--muted); }
.side .sub ul { margin-left: 10px; border-left: 1px solid var(--line); padding-left: 4px; }
main { min-width: 0; padding: 32px 0 64px; }
article { max-width: 760px; }
.toc { position: sticky; top: 58px; align-self: start; padding: 32px 0; font-size: 14px; }
.toc p { margin: 0 0 8px; font-weight: 600; color: var(--muted); font-size: 13px; }
.toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.toc li a { display: block; padding: 3px 0 3px 12px; color: var(--muted); }
.toc li a:hover { color: var(--accent); }

/* Текст */
h1 { font-size: 34px; line-height: 1.2; margin: 0 0 16px; letter-spacing: -.01em; }
h2 { font-size: 24px; line-height: 1.3; margin: 44px 0 12px; padding-top: 8px; scroll-margin-top: 70px; }
h3 { font-size: 19px; line-height: 1.35; margin: 32px 0 8px; scroll-margin-top: 70px; }
p, ul, ol { margin: 0 0 14px; }
ul, ol { padding-left: 24px; }
li { margin: 4px 0; }
li > p { margin: 0 0 6px; }
strong { font-weight: 650; }
article > p:first-of-type { font-size: 18px; color: #33363f; }
code { font-family: var(--mono); font-size: .88em; background: var(--code); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
pre { background: var(--code); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; overflow-x: auto; font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
pre code { background: none; padding: 0; font-size: inherit; overflow-wrap: normal; white-space: pre; }
.table { overflow-x: auto; margin: 0 0 18px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 9px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; color: var(--muted); font-size: 13px; border-bottom-width: 2px; }
td code { white-space: nowrap; }
td:first-child { min-width: 9rem; }
hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.page-foot { max-width: 760px; margin-top: 56px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }

@media (max-width: 1180px) {
  .layout { grid-template-columns: 230px minmax(0, 1fr); }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .top { flex-wrap: wrap; gap: 8px 12px; padding: 10px 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .cabinet { margin-left: auto; }
  .layout { display: block; padding: 0 16px; }
  .side { position: static; max-height: none; padding: 12px 0 0; }
  .side summary { display: block; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; }
  .side details[open] > summary { margin-bottom: 8px; }
  main { padding-top: 20px; }
  h1 { font-size: 28px; }
  h2 { font-size: 22px; margin-top: 36px; }
  article > p:first-of-type { font-size: 17px; }
  td code { white-space: normal; overflow-wrap: anywhere; }
  td:first-child { min-width: 7rem; }
}

/* Путь над заголовком страницы */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 16px; font-size: 14px; color: var(--muted); }
.crumbs i { font-style: normal; }
.crumbs span[aria-current] { padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }

/* Главная: без бокового меню, шапка с названием, карточки разделов, вопросы, блок поддержки */
.home .layout { display: block; max-width: 1160px; }
.home .side { display: none; }
.home article { max-width: none; }
.home article > p:first-of-type { font-size: inherit; color: inherit; }
.home .page-foot { max-width: none; }
.hero { margin: 0 0 32px; padding: 56px 24px; border-radius: 16px; text-align: center; background: linear-gradient(115deg, #f5f2ff 0%, #fbeefb 55%, #f3f1ff 100%); }
.hero h1 { margin: 0 0 14px; font-size: 42px; }
.hero h1 span { color: var(--accent); }
.hero p { max-width: 720px; margin: 0 auto; font-size: 19px; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin: 0 0 8px; }
.card { display: flex; flex-direction: column; padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(20,20,40,.05); }
.card h2 { margin: 0 0 8px; padding: 0; font-size: 20px; }
.card p { margin: 0 0 18px; font-size: 15px; color: var(--muted); }
.card > :last-child { margin: auto 0 0; }
.button { display: block; padding: 10px 14px; border: 1px solid var(--accent); border-radius: 8px; text-align: center; font-weight: 600; }
.button:hover { background: var(--accent-soft); text-decoration: none; }
.button.primary { background: var(--accent); color: #fff; }
.button.primary:hover { background: #5a41bd; }
.faq { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.faq summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; font-weight: 600; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "?"; flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; line-height: 22px; text-align: center; }
.faq summary:hover { color: var(--accent); }
.faq[open] summary { border-bottom: 1px solid var(--line); }
.faq > div { padding: 14px 18px 4px 52px; }
.more { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 48px 0 0; }
.more-box { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); }
.more-box h2 { margin: 0 0 4px; padding: 0; font-size: 20px; }
.more-link { display: block; margin-top: 10px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--text); }
.more-link:hover { border-color: var(--accent); text-decoration: none; }
.more-link strong, .more-link span { display: block; }
.more-link span { font-size: 14px; color: var(--muted); }

@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .hero { padding: 36px 16px; }
  .hero h1 { font-size: 30px; }
  .hero p { font-size: 17px; }
  .more { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 560px) {
  .cards { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .faq > div { padding-left: 18px; }
}
