/* ==========================================================================
   AzForge — Documentation Styles (Aurora Glass A-to-Z)
   ========================================================================== */

:root {
  --sidebar-w: 280px;
}

body.docs {
  font-size: 15px;
}

/* ---------- Кнопка возврата на главную и кнопка поиска в шапке ---------- */
.back-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text-dim);
  transition: all 0.18s ease;
}
.back-pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
  background: var(--bg-hover);
}
.back-pill svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.searchbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text-dim);
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  min-width: 176px;
  transition: all 0.18s ease;
}
.searchbtn:hover {
  border-color: var(--border-strong);
  background: var(--bg-hover);
  color: var(--text);
}
.searchbtn .s-ic {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.searchbtn kbd {
  margin-left: auto;
}

kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--kbd-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
}

/* ---------- Оболочка и 2-колоночная сетка ---------- */
.docs-shell {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 26px 24px 64px;
}

.docs-mbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}
.docs-mtabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.docs-mtabs::-webkit-scrollbar { display: none; }
.docs-mtabs a {
  padding: 6px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-dim);
  transition: all 0.16s ease;
}
body[data-theme="dark"] .docs-mtabs a.active {
  background: rgba(6, 182, 212, 0.20);
  border-color: rgba(34, 211, 238, 0.45);
  color: #ffffff;
}
body[data-theme="light"] .docs-mtabs a.active {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

.mside-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.mside-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

/* ---------- Стеклянный сайдбар ---------- */
.sidebar {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 104px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-scroll {
  position: relative;
  z-index: 2;
  overflow-y: auto;
  padding: 16px 14px 22px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.25) transparent;
}
.sidebar-scroll::-webkit-scrollbar { width: 5px; }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.24);
  border-radius: 4px;
}

.side-group {
  margin-bottom: 14px;
}
.side-group:last-child {
  margin-bottom: 0;
}
.side-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 8px 10px 6px;
}

.side-filter-wrap {
  padding: 2px 4px 10px;
}
.side-filter {
  width: 100%;
  padding: 8px 11px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-code);
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.18s ease;
}
body[data-theme="light"] .side-filter {
  background: #ffffff;
  color: #0f172a;
}
.side-filter::placeholder {
  color: var(--text-faint);
}
.side-filter:focus {
  border-color: var(--accent-border);
}

.side-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  margin: 2px 0;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.16s ease;
}
.side-link span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.side-link:hover {
  background: var(--bg-hover);
  color: var(--text);
}
body[data-theme="dark"] .side-link.active {
  background: rgba(6, 182, 212, 0.16);
  border-color: rgba(34, 211, 238, 0.38);
  color: #ffffff;
  font-weight: 600;
}
body[data-theme="light"] .side-link.active {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #3730a3;
  font-weight: 600;
}

.side-link .cnt {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--chip-bg);
  color: var(--text-faint);
}
body[data-theme="dark"] .side-link.active .cnt {
  background: rgba(34, 211, 238, 0.22);
  color: #a5f3fc;
}
body[data-theme="light"] .side-link.active .cnt {
  background: #c7d2fe;
  color: #312e81;
}

.side-link.sub {
  font-family: var(--font-mono);
  font-size: 12px;
}

.side-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 2px 4px 10px;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--accent-border);
  background: var(--accent-bg);
  color: var(--link);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: filter 0.16s ease;
}
.side-back:hover {
  filter: brightness(1.1);
}

.sidebar-backdrop { display: none; }

/* ---------- Правая область контента ---------- */
.content {
  min-width: 0;
}

.doc-card-inner {
  position: relative;
  z-index: 2;
}

/* ---------- Шапка раздела (.page-head) ---------- */
.page-head {
  padding: 26px 30px;
  margin-bottom: 24px;
}
.crumb {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}
.crumb a {
  color: var(--text-dim);
  text-decoration: none;
  transition: color 0.15s ease;
}
.crumb a:hover { color: var(--link); }
.crumb .sep {
  margin: 0 7px;
  color: var(--text-faint);
}

h1.page-title {
  font-family: var(--font-display);
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.16;
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}
.page-sub {
  color: var(--text-dim);
  font-size: 15.5px;
  line-height: 1.62;
  margin: 0;
  max-width: 780px;
}
.page-head .rule {
  height: 3px;
  width: 68px;
  margin-top: 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, #22d3ee, #6366f1, transparent);
}

/* ---------- Типографика контента ---------- */
h2.sec {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 38px 0 14px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  color: var(--text);
  scroll-margin-top: 96px;
}
.content > h2.sec:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

h3 {
  font-family: var(--font-display);
  font-size: 17px;
  margin: 24px 0 10px;
  font-weight: 700;
  color: var(--text);
}
.content p {
  margin: 0 0 14px;
  max-width: 860px;
  color: var(--text-dim);
  line-height: 1.68;
}
.content p b,
.content li b,
.content strong {
  color: var(--text);
  font-weight: 600;
}
.content a {
  color: var(--link);
}
.content p a:hover,
.note a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border);
}
body[data-theme="dark"] code {
  background: rgba(7, 11, 20, 0.85);
  color: #67e8f9;
}
body[data-theme="light"] code {
  background: #eef2ff;
  border-color: rgba(199, 210, 254, 0.85);
  color: #4338ca;
}

/* ---------- Заметки (.note) ---------- */
.note {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: 14px;
  padding: 15px 18px;
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.62;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--accent-border);
  background: var(--accent-bg);
  color: var(--text);
}
.note .ic {
  flex: 0 0 auto;
  color: var(--accent);
  font-weight: 700;
  margin-top: 1px;
}
body[data-theme="dark"] .note.warn {
  background: rgba(245, 158, 11, 0.09);
  border-color: rgba(251, 191, 36, 0.34);
  color: #fef3c7;
}
body[data-theme="light"] .note.warn {
  background: #fffbeb;
  border-color: #fde68a;
  color: #78350f;
}
.note.warn .ic {
  color: var(--warn);
}

/* ---------- Сетки карточек (.cols / .card) ---------- */
.cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin: 18px 0 24px;
}
.cols .card {
  padding: 20px 22px;
}
.cols .card h4 {
  font-family: var(--font-display);
  margin: 0 0 8px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.cols .card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.6;
}
.cols .card .ic {
  color: var(--accent);
  flex: 0 0 auto;
}

/* ---------- Плашки метрик (.stat-row) ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 0 0 24px;
}
.stat {
  padding: 16px 20px;
}
.stat .n {
  font-size: 24px;
  font-weight: 700;
  color: var(--link);
  font-family: var(--font-mono);
  letter-spacing: -0.02em;
}
.stat .l {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-top: 3px;
}

/* ---------- Таблицы (.tbl-wrap / table.tbl) ---------- */
.tbl-wrap {
  overflow-x: auto;
  margin: 16px 0 24px;
}
table.tbl {
  position: relative;
  z-index: 2;
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.tbl th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}
body[data-theme="light"] .tbl th {
  background: rgba(248, 250, 252, 0.9);
}
.tbl td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tr:hover td { background: var(--bg-hover); }
.tbl td code { white-space: nowrap; }
.tbl .t-dim { color: var(--text-dim); }

/* ---------- Блоки кода (.codeblk) ---------- */
.codeblk {
  position: relative;
  margin: 14px 0 22px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: var(--bg-code);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.26);
}
body[data-theme="light"] .codeblk {
  border-color: rgba(30, 41, 59, 0.85);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.codeblk .cb-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: #67e8f9;
  padding: 9px 15px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.codeblk pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.8px;
  line-height: 1.66;
  tab-size: 4;
  color: #e2e8f0;
}
.codeblk pre code {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  color: inherit !important;
}
.codeblk pre::-webkit-scrollbar { height: 7px; }
.codeblk pre::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.25);
  border-radius: 4px;
}

.copybtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #cbd5e1;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  transition: all 0.16s ease;
}
.copybtn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}
.copybtn.copied {
  background: rgba(16, 185, 129, 0.22);
  border-color: rgba(52, 211, 153, 0.45);
  color: #a7f3d0;
}

.tok-kw { color: var(--code-kw); font-weight: 500; }
.tok-type { color: var(--code-type); }
.tok-tag { color: var(--code-tag); font-weight: 600; }
.tok-str { color: var(--code-str); }
.tok-num { color: var(--code-num); }
.tok-com { color: var(--code-com); font-style: italic; }
.tok-fn { color: #f8fafc; font-weight: 600; }
.tok-punc { color: #94a3b8; }

/* ---------- Схема архитектуры (.arch) ---------- */
.arch {
  margin: 20px 0 26px;
  padding: 24px;
  overflow-x: auto;
}
.arch svg {
  position: relative;
  z-index: 2;
  display: block;
  min-width: 640px;
  width: 100%;
  height: auto;
}

/* ---------- Нумерованные шаги в Быстром старте (.steps) ---------- */
ol.steps {
  counter-reset: step;
  margin: 20px 0 28px;
  padding: 0;
  list-style: none;
}
ol.steps li {
  position: relative;
  padding: 0 0 26px 50px;
  border-left: 1px solid var(--accent-border);
  margin-left: 18px;
}
ol.steps li:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}
ol.steps li::before {
  counter-increment: step;
  content: "0" counter(step);
  position: absolute;
  left: -18px;
  top: 0;
  transform: translateX(-50%);
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
  background: var(--bg-panel-solid);
  border: 1px solid var(--accent-border);
  color: var(--link);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.16);
}
ol.steps h4 {
  font-family: var(--font-display);
  margin: 4px 0 8px;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--text);
}
ol.steps p {
  font-size: 14px;
  color: var(--text-dim);
}

/* ---------- Справочник: категории и карточки подсистем (.sys-grid) ---------- */
.sys-group-block {
  margin-top: 28px;
}
.sys-group-title {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin-bottom: 12px;
}

.sys-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin: 12px 0 22px;
}
.sys-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-decoration: none;
  color: var(--text);
  padding: 18px 20px;
}
.sys-card:hover {
  transform: translateY(-2px);
}
.sys-card .nm {
  font-weight: 700;
  font-size: 14.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sys-card .nm code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: var(--link) !important;
  font-size: 13.5px;
  font-weight: 700;
}
.sys-card .ns-pill {
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.sys-card .ds {
  font-size: 13px;
  color: var(--text-dim);
  margin-top: 8px;
  line-height: 1.55;
}
.sys-card .mt {
  font-size: 11px;
  color: var(--text-faint);
  font-family: var(--font-mono);
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ---------- Пилюли метаданных и якорной навигации подсистемы ---------- */
.pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.pill {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  background: var(--chip-bg);
  border: 1px solid var(--border);
  padding: 4px 11px;
  border-radius: 999px;
  color: var(--text-dim);
}
.pill.accent {
  background: var(--accent-bg);
  border-color: var(--accent-border);
  color: var(--link);
}

/* ---------- Секции справочника и карточки функций (.fn-card) ---------- */
.ref-section {
  margin-top: 36px;
  scroll-margin-top: 96px;
}
.ref-section > h2 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  color: var(--text);
}
.ref-section > h2 .cnt {
  font-size: 11.5px;
  color: var(--link);
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
}

.fn-card {
  margin: 14px 0;
  overflow: hidden;
  scroll-margin-top: 96px;
}
body[data-theme="dark"] .fn-card:target,
body[data-theme="dark"] .fn-card.flash {
  border-color: rgba(56, 189, 248, 0.78);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.30), 0 0 36px rgba(56, 189, 248, 0.22);
}
body[data-theme="light"] .fn-card:target,
body[data-theme="light"] .fn-card.flash {
  border-color: #6366f1;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.28), 0 12px 34px rgba(99, 102, 241, 0.16);
}

.fn-sig {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  background: var(--bg-code);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
}
.fn-sig .sig-code {
  background: none !important;
  border: none !important;
  padding: 0 !important;
  color: #e2e8f0 !important;
  font-family: var(--font-mono);
  font-size: 12.8px;
  line-height: 1.55;
  white-space: pre;
}
.fn-sig .fn-name {
  color: #38bdf8;
  font-weight: 700;
}

.fn-body {
  position: relative;
  z-index: 2;
  padding: 15px 18px 16px;
}
.fn-desc {
  margin: 0 0 10px !important;
  font-size: 14px;
  color: var(--text-dim);
}
.fn-wrap-line {
  margin: 0 0 10px !important;
  font-size: 12.5px;
  color: var(--text-faint) !important;
}
.fn-args {
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: grid;
  gap: 4px;
}
.fn-args .arg {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 3px 0;
  font-size: 12.8px;
}
.fn-args .arg-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text);
  min-width: 136px;
}
.fn-args .arg-type {
  font-family: var(--font-mono);
  color: #a5b4fc;
}
body[data-theme="light"] .fn-args .arg-type {
  color: #6d28d9;
}

.badge {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 8px;
  vertical-align: 2px;
}
.badge.legacy {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

/* ---------- Блоки enum / struct / defines (.kind-block) ---------- */
.kind-block {
  margin: 16px 0;
  overflow: hidden;
}
.kind-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
}
body[data-theme="light"] .kind-head {
  background: rgba(248, 250, 252, 0.9);
}
.kind-head .kind-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.09em;
  color: var(--link);
  text-transform: uppercase;
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  padding: 2px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
}
.kind-desc {
  position: relative;
  z-index: 2;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
  color: var(--text-dim);
}
.kind-members {
  position: relative;
  z-index: 2;
  overflow-x: auto;
}
.kind-members .km {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.kind-members .km:last-child { border-bottom: none; }
.kind-members .km:hover { background: var(--bg-hover); }
.km .m-name {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--link);
  min-width: 240px;
  flex-shrink: 0;
}
.km .m-val {
  font-family: var(--font-mono);
  color: #fbbf24;
  min-width: 72px;
  flex-shrink: 0;
}
body[data-theme="light"] .km .m-val { color: #b45309; }
.km .m-type {
  font-family: var(--font-mono);
  color: #a5b4fc;
  min-width: 190px;
  font-size: 12.5px;
  flex-shrink: 0;
}
body[data-theme="light"] .km .m-type { color: #6d28d9; }
.km .m-desc { color: var(--text-dim); }

/* ---------- Футер документации ---------- */
.foot-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.foot-brand img {
  width: 22px;
  height: 22px;
}
.foot-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-dim);
}
.foot-meta b {
  color: var(--text);
  font-weight: 600;
}
.foot-gh {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  transition: color 0.16s ease;
}
.foot-gh:hover { color: var(--link); }
.foot-gh svg {
  width: 15px;
  height: 15px;
}

/* ---------- Модальное окно поиска (Ctrl+K) ---------- */
.modal-wrap[hidden] { display: none; }
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 16px 20px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal {
  width: min(640px, 100%);
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-raise);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  overflow: hidden;
}

.modal-input-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.modal-input-row .m-sic {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}
.modal-input-row input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
}
.modal-input-row input::placeholder { color: var(--text-faint); }

.modal-esc {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--chip-bg);
  color: var(--text-dim);
  cursor: pointer;
}
.modal-esc:hover { color: var(--text); }

.modal-results {
  overflow-y: auto;
  padding: 8px;
  flex: 1;
  scrollbar-width: thin;
}
.sr-group {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 10px 12px 5px;
}
.sr-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.sr-main {
  min-width: 0;
  flex: 1;
}
.sr-item .nm {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-item .nm mark {
  background: none;
  color: var(--link);
  font-weight: 700;
}
.sr-item .ds {
  display: block;
  font-size: 12px;
  color: var(--text-faint);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.sr-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--text-dim);
}
.sr-badge.fn {
  background: rgba(139, 92, 246, 0.18);
  color: #c4b5fd;
}
body[data-theme="light"] .sr-badge.fn {
  background: #ede9fe;
  color: #6d28d9;
}
.sr-enter {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
}
.sr-item:hover,
.sr-item.sel {
  background: var(--accent-bg);
  border-color: var(--accent-border);
}
.sr-item.sel .sr-enter { opacity: 1; }

.sr-empty {
  padding: 36px 20px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-faint);
}
.modal-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-faint);
  background: rgba(255, 255, 255, 0.02);
}

/* ---------- Тост-уведомление ---------- */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  transform: translateY(80px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
  opacity: 0;
  transition: transform 0.24s ease, opacity 0.24s ease;
  z-index: 120;
  pointer-events: none;
}
body[data-theme="dark"] .toast {
  background: rgba(13, 21, 41, 0.95);
  border: 1px solid rgba(52, 211, 153, 0.42);
  color: #a7f3d0;
}
body[data-theme="light"] .toast {
  background: #ffffff;
  border: 1px solid #6ee7b7;
  color: #047857;
}
.toast svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: #34d399;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* ---------- Адаптив документации ---------- */
@media (max-width: 1024px) {
  .topnav { display: none; }
  .burger { display: grid; }
  .docs-mbar { display: flex; }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .sidebar {
    position: fixed;
    left: 12px;
    top: 78px;
    bottom: 12px;
    width: min(300px, calc(100vw - 24px));
    max-height: none;
    z-index: 70;
    background: var(--bg-raise);
    transform: translateX(calc(-100% - 24px));
    transition: transform 0.24s ease;
  }
  body.side-open .sidebar {
    transform: translateX(0);
    box-shadow: var(--shadow);
  }
  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 65;
    background: rgba(2, 6, 23, 0.58);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.side-open .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .searchbtn span,
  .searchbtn kbd { display: none; }
  .searchbtn { min-width: 0; padding: 0 10px; }
}

@media (max-width: 640px) {
  .topbar { padding: 10px 12px 0; }
  .docs-shell { padding: 18px 14px 48px; }
  .back-pill span { display: none; }
  .back-pill { padding: 6px 8px; }
  .page-head { padding: 20px 18px; }
  .km .m-name { min-width: 150px; }
  .km .m-type { min-width: 130px; }
  .fn-args .arg-name { min-width: 96px; }
}
