/* Тема документации /docs/<slug>/ — design/Site Docs Topic.dc.html (общий текст редактора — content.css, здесь — отличия) */
.topic { position: relative; z-index: 2; }
.topic-pad { padding-top: 110px; padding-bottom: 110px; }
.topic-wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr) 200px; gap: 56px; align-items: start; }
/* левая навигация */
.docnav { position: sticky; top: 104px; max-height: calc(100vh - 130px); overflow: auto; padding-right: 18px; display: flex; flex-direction: column; gap: 22px; border-right: 1px solid var(--line); font-size: 14px; color: var(--ink-3); scrollbar-width: thin; }
.docnav-group { display: flex; flex-direction: column; gap: 6px; }
.docnav-gname { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.docnav a { padding: 5px 0 5px 10px; border-left: 2px solid transparent; line-height: 1.35; transition: border-color .2s; }
.docnav a:hover { color: var(--ink); }
.docnav a.is-on { border-left-color: var(--accent); color: var(--accent); font-weight: 500; }
/* кнопка навигации на телефоне */
.docnav-trigger { position: sticky; top: 84px; z-index: 5; min-width: 0; padding: 12px 14px; display: none; align-items: center; gap: 10px; border: 0; border-radius: 14px; background: oklch(1 0 0 / .9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: var(--shadow-card); font-size: 14px; text-align: left; cursor: pointer; }
.docnav-trigger svg { flex: none; }
.docnav-trigger .t-muted { flex: none; color: var(--muted); }
.docnav-trigger .t-cur { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.docnav-trigger .t-arrow { margin-left: auto; color: var(--muted); }
/* статья */
.doc-article { min-width: 0; display: flex; flex-direction: column; gap: 22px; font-size: 17px; line-height: 1.65; color: var(--ink-2); }
.doc-head { display: flex; flex-direction: column; gap: 12px; }
.doc-head h1 { margin: 0; font-size: clamp(32px, 4vw, 48px); line-height: 1.05; letter-spacing: -.03em; font-weight: 600; color: var(--ink); }
.doc-sum { margin: 0; font-size: 19px; line-height: 1.5; color: var(--ink-3); }
.doc-plan { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-3); }
.doc-plan span:first-child { padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.doc-rule { height: 1px; background: var(--line); }
.doc-entry { max-width: none; font-size: 17px; }
.doc-entry h2 { margin-top: 14px; font-size: clamp(22px, 2.4vw, 27px); line-height: 1.2; letter-spacing: -.02em; scroll-margin-top: 110px; }
.doc-entry ul { gap: 10px; }
.doc-entry ul > li { padding-left: 29px; }
/* шаги — чёрные кружки с номером */
.doc-entry ol { gap: 12px; }
.doc-entry ol > li { min-height: 29px; padding-left: 42px; }
.doc-entry ol > li::before { content: counter(rw-ol); top: 1px; width: 28px; min-width: 0; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13.5px; line-height: 1; }
@media (min-width: 721px) { .doc-entry .wp-block-table th, .doc-entry .wp-block-table td { padding: 11px 14px; } }
.doc-entry table { font-size: 14.5px; }
.doc-entry td:first-child { color: var(--ink); font-weight: 500; }
.doc-rel { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.doc-rel-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.doc-rel-list { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-rel-list a { padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; color: var(--ink); }
.doc-rel-list a:hover { background: var(--hover); color: var(--ink); }
.doc-pn { margin-top: 12px; padding-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; border-top: 1px solid var(--line); font-size: 14.5px; }
.doc-pn a { padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 14px; color: inherit; }
.doc-pn a:hover { border-color: var(--line-2); background: var(--paper); color: inherit; }
.doc-pn a span:first-child { font-size: 12.5px; color: var(--muted); }
.doc-pn a span:last-child { font-weight: 500; color: var(--ink); }
.doc-pn .doc-next { grid-column: 2; text-align: right; }
.doc-useful { font-size: 13.5px; color: var(--muted); }
.doc-useful a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.doc-useful a:hover { color: var(--ink); }
/* справа — «On this page» */
.onpage { position: sticky; top: 104px; padding-left: 18px; display: flex; flex-direction: column; gap: 12px; border-left: 1px solid var(--line); font-size: 13.5px; color: var(--ink-3); }
.onpage a { line-height: 1.4; }
.onpage-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.onpage-none { color: oklch(0.62 0.01 280); }
/* выезжающая панель (телефон) */
.drawer { position: fixed; inset: 0; z-index: 60; display: flex; }
.drawer[hidden] { display: none; }
.drawer-bg { position: absolute; inset: 0; background: oklch(0.15 0.008 280 / .45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); animation: rw-fade .25s both; }
.drawer-panel { position: relative; width: min(86vw, 360px); height: 100%; display: flex; flex-direction: column; background: #fff; box-shadow: 0 0 0 1px oklch(0.22 0.012 280 / .08), 30px 0 60px -30px oklch(0 0 0 / .4); animation: rw-drawer .3s var(--ease) both; }
.drawer-head { flex: none; padding: 16px 18px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.drawer-logo { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15px; }
.drawer-logo img { width: 24px; height: 24px; border-radius: 7px; }
.drawer-x { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 999px; background: var(--wash); cursor: pointer; }
.drawer-body { overflow: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 22px; font-size: 15px; color: var(--ink-3); }
.drawer-all { font-size: 14px; font-weight: 500; color: var(--accent); }
.drawer-group { display: flex; flex-direction: column; gap: 4px; }
.drawer-gname { padding-bottom: 4px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.drawer-group a { display: block; padding: 10px 12px; border-radius: 10px; line-height: 1.35; color: var(--ink-2); }
.drawer-group a.is-on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
@keyframes rw-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rw-drawer { from { transform: translateX(-100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .drawer-bg, .drawer-panel { animation: none; } }
@media (max-width: 1100px) { .topic-wrap { grid-template-columns: 260px minmax(0, 1fr); } .onpage { display: none; } }
@media (max-width: 900px) {
  .topic-wrap { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .docnav { display: none; }
  .docnav-trigger { display: flex; }
  .doc-article, .doc-entry { gap: 40px; }   /* как в макете: на узком экране блоки темы — через 40px */
}
@media (max-width: 720px) {
  .topic-pad { padding: 72px 20px; }
  .doc-pn { grid-template-columns: minmax(0, 1fr); }
  .doc-pn .doc-next { grid-column: auto; }
}
