/* AI-Pedia 3.6.7 – обычные страницы и правовые документы (page.php). */
.pg { padding: 8px 0 72px; }
.pg-crumbs { padding: 16px 0 14px; font-size: 13.5px; font-weight: 700; color: var(--text-soft); }
.pg-crumbs ol { list-style: none; display: flex; flex-wrap: wrap; align-items: center; margin: 0; padding: 0; min-width: 0; }
.pg-crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.pg-crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--text-3); }
.pg-crumbs a { color: inherit; text-decoration: none; transition: color .2s; }
.pg-crumbs a:hover { color: var(--text); }
.pg-crumbs [aria-current] span { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 70vw; }

.pg__head { max-width: 860px; margin: 6px 0 28px; }
.pg__label { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 14px; padding: 6px 12px; border-radius: 999px; background: var(--lilac-soft); color: var(--lilac-ink, #6b4dcc); font-size: 12.5px; font-weight: 800; }
.pg__label svg { width: 14px; height: 14px; }
.pg__title { margin: 0; font-size: clamp(30px, 4.2vw, 46px); line-height: 1.1; font-weight: 900; letter-spacing: -.02em; color: var(--text); }
.pg__meta, .pg__lead { margin: 14px 0 0; font-size: 15px; line-height: 1.6; color: var(--text-soft); }
.pg__lead { font-size: 18px; }

.pg__layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
.pg__layout--single { grid-template-columns: minmax(0, 1fr); }
.pg__aside { position: sticky; top: calc(var(--header-h, 72px) + 20px); display: grid; gap: 14px; }
.pg__body { min-width: 0; padding: clamp(22px, 3.4vw, 44px); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg, 24px); box-shadow: var(--shadow-sm); }
.pg__layout--single .pg__body { max-width: 920px; }

.pg-box { padding: 18px 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md, 18px); }
.pg-box__title, .pg-toc summary { margin: 0 0 10px; font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--meta, #686576); }
.pg-toc summary { list-style: none; cursor: default; }
.pg-toc summary::-webkit-details-marker { display: none; }
.pg-toc ol, .pg-docs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.pg-toc a { display: block; padding: 6px 0 6px 12px; border-left: 2px solid var(--line); font-size: 14px; line-height: 1.4; font-weight: 600; color: var(--text-soft); text-decoration: none; transition: color .2s, border-color .2s; }
.pg-toc a:hover { color: var(--text); }
.pg-toc a.is-active { border-color: var(--lilac); color: var(--text); }
.pg-docs li > * { display: block; padding: 7px 10px; border-radius: 10px; font-size: 14px; line-height: 1.35; font-weight: 600; color: var(--text-soft); text-decoration: none; transition: background .2s, color .2s; }
.pg-docs a:hover { background: var(--bg-soft); color: var(--text); }
.pg-docs [aria-current] { background: var(--bg-soft); color: var(--text); font-weight: 800; }
.pg-docs__cookie { display: inline-flex; align-items: center; gap: 7px; margin-top: 12px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; transition: border-color .2s; }
.pg-docs__cookie:hover { border-color: var(--line-strong, #dcd5e6); }
.pg-docs__cookie svg { width: 15px; height: 15px; }

/* Текст страницы */
.pg-prose { max-width: 820px; font-size: 16.5px; line-height: 1.75; color: var(--text); overflow-wrap: anywhere; }
.pg-prose > :first-child, .pg-prose .aipb-legal > :first-child { margin-top: 0; }
.pg-prose p, .pg-prose ul, .pg-prose ol { margin: 0 0 1em; }
.pg-prose ul, .pg-prose ol { padding-left: 1.3em; }
.pg-prose li + li { margin-top: .35em; }
.pg-prose h2 { margin: 1.9em 0 .6em; font-size: 23px; line-height: 1.3; font-weight: 900; letter-spacing: -.01em; scroll-margin-top: calc(var(--header-h, 72px) + 20px); }
.pg-prose h3 { margin: 1.5em 0 .5em; font-size: 18px; font-weight: 800; }
.pg-prose a { color: var(--accent, #3f6fd9); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.pg-prose strong { font-weight: 800; }
.pg-prose .aipb-legal { line-height: inherit; }
.pg-prose .aipb-legal h2 { font-size: 23px; margin: 1.9em 0 .6em; }

/* Таблицы документов */
.pg-prose table, .pg-prose .aipb-legal-table { display: block; width: 100%; max-width: 100%; overflow-x: auto; margin: 1.2em 0 1.4em; border: 1px solid var(--line); border-radius: 14px; border-collapse: separate; border-spacing: 0; font-size: 14px; line-height: 1.55; }
.pg-prose table th, .pg-prose table td { min-width: 130px; padding: 11px 14px; border: 0; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.pg-prose table th { background: var(--bg-soft); font-size: 13px; font-weight: 800; color: var(--text); white-space: nowrap; }
.pg-prose table tr:last-child td { border-bottom: 0; }
.pg-prose table td:first-child { font-weight: 700; }
.pg-prose table code { font-size: 12.5px; padding: 1px 5px; border-radius: 6px; background: var(--bg-soft); }
.pg-prose .aipb-legal-ph { padding: 1px 6px; border-radius: 6px; background: #fff1c2; color: #7a4b00; }
[data-theme="dark"] .pg-prose .aipb-legal-ph { background: #3d3214; color: #f2d58a; }

@media (max-width: 960px) {
  .pg__layout { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .pg__aside { position: static; }
  .pg-docs { order: 2; }
  .pg__layout > .pg__aside { display: contents; }
  .pg-toc { order: -1; }
  .pg__body { order: 0; }
  .pg-toc summary { display: flex; justify-content: space-between; align-items: center; margin: 0; cursor: pointer; }
  .pg-toc summary::after { content: "+"; font-size: 18px; line-height: 1; color: var(--text-soft); }
  .pg-toc[open] summary { margin-bottom: 10px; }
  .pg-toc[open] summary::after { content: "–"; }
}
@media (max-width: 560px) {
  .pg { padding-bottom: 48px; }
  .pg__head { margin-bottom: 18px; }
  .pg__body { padding: 20px 16px; border-radius: 20px; }
  .pg-prose { font-size: 15.5px; }
  .pg-prose h2, .pg-prose .aipb-legal h2 { font-size: 20px; }
  .pg-prose table th, .pg-prose table td { min-width: 120px; padding: 9px 11px; }
}
