/* ═══════════════════════════════════════════════════════════════════════════
   LootX Documentation — stylesheet
   Tokens mirror BRAND.md and apps/landing/src/index.css :root. Dark only:
   the brand has no light surface, and a half-hearted light theme on a site
   full of screenshots taken in the dark terminal looks broken.
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  --bg-primary: #08080d;
  --bg-secondary: #0e0e16;
  --bg-card: #14141f;
  --bg-card-hover: #1a1a2a;
  --border: #1e1e2e;
  --border-light: #2a2a3e;

  --text-primary: #f0f0f5;
  --text-secondary: #7a7a95;
  --text-muted: #56566e;

  --lootx-blue: #4799f5;
  --lootx-teal: #31cfc3;
  --lootx-green: #3deeb4;
  --lootx-grad: linear-gradient(115deg, #4799f5 0%, #31cfc3 55%, #3deeb4 100%);

  --accent-green: #22c55e;
  --accent-red: #ef4444;
  --accent-gold: #f59e0b;
  --accent-cyan: #06b6d4;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, system-ui, sans-serif;
  --font-mono: "Cascadia Code", "Fira Code", "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;

  --mobile-bar-h: 52px;
  --sidebar-w: 280px;
  --toc-w: 232px;
  --content-max: 792px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Anchor targets must clear the sticky header, or every #link lands with the
     heading hidden underneath it. */
  scroll-padding-top: 24px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(49, 207, 195, 0.28);
  color: #fff;
}

a {
  color: var(--lootx-teal);
  text-decoration: none;
}
a:hover {
  color: var(--lootx-green);
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

/* Scrollbars: the default light-on-dark ones are the single loudest thing on a
   dark page. */
* {
  scrollbar-width: thin;
  scrollbar-color: #2a2a3e transparent;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: #23233a;
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: #33334e;
  background-clip: content-box;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}
.skip-link:focus {
  left: 12px;
}

:focus-visible {
  outline: 2px solid var(--lootx-teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─────────────────────── the frame: sidebar + content ───────────────────
 *
 * No full-width header bar. The sidebar owns the left column top to bottom —
 * logo, search, section switcher, navigation, language — and the content sits
 * beside it with its own table of contents. Documentation is read in one
 * column; a bar across the top only steals the vertical space that column
 * needs.
 */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  align-items: start;
  min-height: 100vh;
}
.layout.no-sidebar {
  grid-template-columns: minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 12px 12px;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
  z-index: 40;
}

.side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 40px;
  padding: 0 4px 0 8px;
  margin-bottom: 4px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: 0.005em;
  white-space: nowrap;
  min-width: 0;
}
.brand:hover {
  color: var(--text-primary);
}
.brand-text {
  overflow: hidden;
  text-overflow: ellipsis;
}
.mark {
  width: 20px;
  height: 20px;
  flex: none;
  stroke: none;
}
.brand-sub {
  margin-left: 2px;
  color: var(--text-secondary);
  font-weight: 500;
}

.side-collapse svg {
  width: 17px;
  height: 17px;
}
/* Collapsing is a convenience for a wide screen; on a narrow one the sidebar is
   already a drawer, so the button steps aside. */
@media (max-width: 900px) {
  .side-collapse {
    display: none;
  }
}
body.side-collapsed .sidebar {
  display: none;
}
body.side-collapsed .layout {
  grid-template-columns: minmax(0, 1fr);
}

/* ── search ── */

.search-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 34px;
  padding: 0 8px 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.search-trigger:hover {
  border-color: #3a3a56;
  color: var(--text-primary);
}
.search-trigger svg {
  width: 15px;
  height: 15px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.search-trigger span {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.search-trigger kbd {
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ── section switcher ──
 *
 * The full-width control under the search box: it names the section you are
 * in, and opens the list of the others with a line of description each. One
 * button survives a sixth section, a long title and a 1280px laptop; a row of
 * links across a header survives none of the three. */

.space-switch {
  position: relative;
}
.space-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 38px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.space-btn:hover,
.space-switch.is-open .space-btn {
  background: var(--bg-card-hover);
  border-color: #3a3a56;
}
.space-btn-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
}
.space-btn-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.space-btn-label {
  flex: 1;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
}
.space-btn-chevron svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.space-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  padding: 6px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  background: var(--bg-card);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.16s var(--ease), transform 0.16s var(--ease), visibility 0.16s;
  z-index: 60;
}
.space-switch.is-open .space-dropdown {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.space-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 8px 9px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: background 0.14s var(--ease);
}
.space-option:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.space-option-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 1px;
}
.space-option-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.space-option-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.space-option-title {
  font-size: 13.5px;
  font-weight: 600;
}
.space-option-tagline {
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}
.space-option-check {
  flex: none;
  margin-top: 2px;
  opacity: 0;
  color: var(--lootx-blue);
}
.space-option.is-current .space-option-check {
  opacity: 1;
}
.space-option-check svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── the scrolling part ── */

.side-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 2px 16px;
  margin-right: -6px;
  padding-right: 8px;
}
.side-scroll::-webkit-scrollbar {
  width: 8px;
}
.side-scroll::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: var(--border-light);
}

.side-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.side-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 1;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 13px;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.side-cta:hover {
  color: var(--text-primary);
  border-color: var(--lootx-teal);
}
.side-cta svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ── the right column ── */

.pane {
  min-width: 0;
  /* Короткая страница не должна оставлять футер висеть посреди экрана.
     Высоту страницы держит липкий сайдбар (100vh), а правая колонка при
     `align-items: start` кончается вместе с текстом — под футером остаётся
     голый фон. Колонка тянется на весь экран, содержимое забирает остаток,
     футер оказывается внизу. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
@supports (min-height: 100dvh) {
  /* На телефоне адресная строка съедает часть 100vh и страница дёргается
     при прокрутке; dvh считает по видимой области. */
  .pane {
    min-height: 100dvh;
  }
}
.pane > .content {
  flex: 1 0 auto;
}

/* The only bar that exists, and only on a phone: the drawer handle. */
.mobile-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 35;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  height: 52px;
  padding: 0 12px;
  background: rgba(8, 8, 13, 0.9);
  backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  min-width: 32px;
  padding: 0 7px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.icon-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}
.icon-btn svg {
  width: 17px;
  height: 17px;
}

.lang-menu {
  position: relative;
}
.lang-code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
.lang-dropdown {
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  min-width: 176px;
  padding: 6px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
  display: none;
  z-index: 50;
}
.lang-menu.is-open .lang-dropdown {
  display: block;
}
.lang-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
}
.lang-option:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.lang-option.is-current {
  color: var(--lootx-teal);
}
/* A language this page has no translation into — the link still works (it lands
   on the original) and the dot says so without a tooltip nobody reads. */
.lang-missing {
  color: var(--text-muted);
}

.btn-gradient {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--lootx-grad);
  color: #04201c;
  font: inherit;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s var(--ease), transform 0.15s var(--ease);
}
.btn-gradient:hover {
  color: #04201c;
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}
.btn-ghost:hover {
  background: var(--bg-card);
  border-color: #3a3a56;
  color: var(--text-primary);
}

/* ──────────────────────────────── shell ─────────────────────────────── */

/* Ширина колонки контента задаётся здесь; сама сетка — в .layout выше. */
.content {
  min-width: 0;
  padding: 44px 0 96px;
}
/* Pages that are one column (space index, search, 404) get the same gutter
   and the same centring the article grid gives itself. */
.content > .doc {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 40px;
  box-sizing: content-box;
}
.content > .home {
  padding: 0 40px;
  box-sizing: content-box;
}

.space-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  color: var(--lootx-teal);
}
.space-icon svg {
  width: 18px;
  height: 18px;
}
.space-icon.lg {
  width: 48px;
  height: 48px;
  border-radius: 14px;
}
.space-icon.lg svg {
  width: 24px;
  height: 24px;
}
.accent-blue {
  color: var(--lootx-blue);
}
.accent-teal {
  color: var(--lootx-teal);
}
.accent-green {
  color: var(--lootx-green);
}
.accent-gold {
  color: var(--accent-gold);
}
.accent-cyan {
  color: var(--accent-cyan);
}

.space-name {
  display: block;
  color: var(--text-primary);
  font-weight: 650;
  font-size: 15px;
}
.space-tagline {
  color: var(--text-secondary);
  font-size: 12.5px;
  line-height: 1.45;
  margin-top: 2px;
}

.nav-group + .nav-group {
  margin-top: 22px;
}
.nav-group-title {
  padding: 0 12px 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
  transition: color 0.12s var(--ease), background 0.12s var(--ease);
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}
.nav-link.is-active {
  color: var(--lootx-teal);
  background: rgba(49, 207, 195, 0.11);
  font-weight: 600;
}

.nav-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 99px;
  border: 1px solid currentColor;
  opacity: 0.9;
}
.nav-badge-new {
  color: var(--lootx-green);
}
.nav-badge-beta {
  color: var(--lootx-blue);
}
.nav-badge-soon {
  color: var(--accent-gold);
}
.nav-badge-updated {
  color: var(--lootx-teal);
}

/* ── release entries (:::release 0.6.3 | 2026-09-18 | stable) ──
 *
 * A changelog read the way people actually read one: scan the version column
 * until you find the one you are on, then read down. The version is an anchor,
 * so "что изменилось в 0.6.0" is a link somebody can send. */

.release {
  position: relative;
  margin: 0 0 4px;
  padding: 0 0 28px 26px;
  border-left: 1px solid var(--border);
}
.release:last-child {
  border-left-color: transparent;
  padding-bottom: 8px;
}
.release::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg-primary);
  box-shadow: 0 0 0 2px var(--border-light);
}
.release-major::before {
  background: var(--lootx-green);
  box-shadow: 0 0 0 3px rgba(61, 238, 180, 0.18);
}

.release-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.release-version {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  color: var(--text-primary);
  scroll-margin-top: 24px;
}
.release-date {
  font-size: 13px;
  color: var(--text-secondary);
}
.release-tag {
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border-light);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.release-major .release-tag {
  border-color: rgba(61, 238, 180, 0.4);
  color: var(--lootx-green);
}
.release-beta .release-tag {
  border-color: rgba(245, 192, 74, 0.4);
  color: var(--accent-gold);
}

.release-body > p:first-child {
  margin-top: 0;
}
.release-body p strong {
  display: inline-block;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.release-body ul {
  margin: 6px 0 16px;
}
.release-body li {
  margin: 4px 0;
}
.release-body .callout {
  margin: 12px 0 0;
}

/* ── nested groups ──
 *
 * <details> per subgroup: collapsing works with JavaScript disabled, the
 * keyboard and screen readers get it for free, and the server opens the branch
 * the reader is in so their page is never hidden on first paint. */

.nav-subs {
  margin-top: 2px;
}
.nav-sub {
  margin: 2px 0;
}
.nav-sub-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 550;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background 0.14s var(--ease), color 0.14s var(--ease);
}
.nav-sub-title::-webkit-details-marker {
  display: none;
}
.nav-sub-title:hover {
  background: var(--bg-card);
}
.nav-sub-chevron {
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  flex: none;
}
.nav-sub-chevron svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.16s var(--ease);
}
.nav-sub[open] > .nav-sub-title .nav-sub-chevron svg {
  transform: rotate(90deg);
}
.nav-sub-count {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}
.nav-sub[open] > .nav-sub-title .nav-sub-count {
  opacity: 0;
}

/* Everything under a subgroup is indented once and hung on a rail, so depth is
   visible without counting pixels. */
.nav-sub > .nav-list,
.nav-sub > .nav-sub {
  margin-left: 16px;
  padding-left: 8px;
  border-left: 1px solid var(--border);
}
.nav-sub > .nav-list .nav-link {
  font-size: 13px;
}
/* The rail lights up for the branch the reader is in. */
.nav-sub:has(.nav-link.is-active) > .nav-list,
.nav-sub:has(.nav-link.is-active) > .nav-sub {
  border-left-color: var(--lootx-teal);
}

/* Space index: a subgroup is a subheading, not a folder. */
.space-subsection {
  margin-top: 22px;
}
.space-subsection h3 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.sidebar-scrim {
  display: none;
}

/* ─────────────────────────────── content ────────────────────────────── */

/* The wrap is exactly as wide as the column pair it holds, so `margin: auto`
   centres the article on a wide screen instead of parking it on the left. */
.doc-wrap {
  display: grid;
  grid-template-columns: minmax(0, var(--content-max)) var(--toc-w);
  gap: 56px;
  align-items: start;
  width: 100%;
  max-width: calc(var(--content-max) + var(--toc-w) + 56px + 80px);
  padding: 0 40px;
  margin: 0 auto;
}

.doc {
  min-width: 0;
  max-width: var(--content-max);
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
}
.breadcrumbs a {
  color: var(--text-secondary);
}
.breadcrumbs a:hover {
  color: var(--text-primary);
}
.breadcrumbs svg {
  width: 13px;
  height: 13px;
  color: var(--text-muted);
}

.doc-head h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 700;
}
.doc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--text-secondary);
}
.doc-version {
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 99px;
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
}
.doc-lead {
  margin: 16px 0 0;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.locale-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 13.5px;
}
.locale-note svg {
  width: 16px;
  height: 16px;
  color: var(--lootx-blue);
}

/* ── long-form typography ── */

.doc-body {
  margin-top: 36px;
}

.doc-body h2,
.doc-body h3,
.doc-body h4 {
  scroll-margin-top: 24px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  position: relative;
}
.doc-body h2 {
  margin: 52px 0 16px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  font-size: 26px;
  font-weight: 700;
}
.doc-body h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.doc-body h3 {
  margin: 34px 0 12px;
  font-size: 19px;
  font-weight: 650;
}
.doc-body h4 {
  margin: 26px 0 10px;
  font-size: 16px;
  font-weight: 650;
  color: var(--text-primary);
}

/* The anchor link appears on hover of the heading — present for everyone who
   wants it, invisible to everyone who does not. */
.doc-body h2::before,
.doc-body h3::before {
  content: "#";
  position: absolute;
  left: -22px;
  color: var(--lootx-teal);
  opacity: 0;
  font-weight: 500;
  transition: opacity 0.15s var(--ease);
}
.doc-body h2:hover::before,
.doc-body h3:hover::before {
  opacity: 0.6;
}

.doc-body p {
  margin: 0 0 18px;
}
.doc-body ul,
.doc-body ol {
  margin: 0 0 18px;
  padding-left: 22px;
}
.doc-body li {
  margin: 6px 0;
}
.doc-body li::marker {
  color: var(--text-muted);
}
.doc-body strong {
  color: #fff;
  font-weight: 650;
}
.doc-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 36px 0;
}
.doc-body blockquote {
  margin: 22px 0;
  padding: 2px 0 2px 18px;
  border-left: 2px solid var(--border-light);
  color: var(--text-secondary);
}
/* Подчёркивание — только обычным ссылкам в тексте: кнопка, вкладка и
   карточка тоже <a>, и селектор с классом-предком перебивал их
   собственное text-decoration: none. */
.doc-body a:not([class]) {
  text-decoration: underline;
  text-decoration-color: rgba(49, 207, 195, 0.35);
  text-underline-offset: 3px;
}
.doc-body a:not([class]):hover {
  text-decoration-color: currentColor;
}
.external-link::after {
  content: "↗";
  font-size: 0.85em;
  margin-left: 2px;
  opacity: 0.7;
}

.doc-body code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: 5px;
  background: rgba(120, 140, 200, 0.12);
  border: 1px solid var(--border);
  color: #cfe9ff;
  word-break: break-word;
}

/* ── FAQ ── */

.faq {
  margin-top: 48px;
}
.faq h2 {
  font-size: 22px;
  margin-bottom: 14px;
}
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-secondary);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-item summary {
  padding: 13px 16px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.faq-item summary::-webkit-details-marker {
  display: none;
}
.faq-item div {
  padding: 0 16px 14px;
  color: var(--text-secondary);
}

/* ─────────────────────── table of contents (right) ──────────────────── */

.toc {
  position: sticky;
  top: 44px;
  max-height: calc(100vh - 88px);
  overflow-y: auto;
  font-size: 13.5px;
}
.toc-title {
  display: flex;
  align-items: center;
  gap: 7px;
  padding-left: 13px;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  margin-bottom: 10px;
}
.toc-title svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* The rail lives on the items, not on the container: that is what lets the
   segment beside the section being read light up while the rest stays grey —
   the "live" part of a live table of contents. */
.toc-item {
  border-left: 1px solid var(--border);
  transition: border-color 0.18s var(--ease);
}
.toc-item > a {
  display: block;
  padding: 5px 0 5px 13px;
  color: var(--text-secondary);
  line-height: 1.45;
  transition: color 0.14s var(--ease);
}
.toc-item > a:hover {
  color: var(--text-primary);
}
.toc-l3 > a {
  padding-left: 26px;
  font-size: 13px;
}

/* Two states, deliberately different: the heading you are reading, and the
   branch it belongs to. Highlighting only the exact heading loses the place in
   a long page; highlighting the whole list highlights nothing. */
.toc-item.in-branch {
  border-left-color: var(--lootx-blue);
}
.toc-item.in-branch > a {
  color: #8fc2ff;
}
.toc-item.is-active {
  border-left-color: var(--lootx-blue);
}
.toc-item.is-active > a {
  color: var(--lootx-blue);
  font-weight: 550;
}

/* ───────────────────────── feedback / pager / CTA ───────────────────── */

.feedback {
  margin-top: 56px;
  padding: 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-secondary);
  text-align: center;
}
.feedback-q {
  font-weight: 600;
  margin-bottom: 12px;
}
.feedback-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.fb-btn {
  min-width: 84px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.fb-btn:hover {
  border-color: var(--lootx-teal);
  background: var(--bg-card-hover);
}
.fb-btn.is-picked {
  border-color: var(--lootx-teal);
  color: var(--lootx-teal);
}
.feedback-form {
  margin-top: 14px;
  display: grid;
  gap: 8px;
  text-align: left;
  max-width: 460px;
  margin-inline: auto;
}
.feedback-form label {
  font-size: 13px;
  color: var(--text-secondary);
}
.feedback-form textarea {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-primary);
  color: var(--text-primary);
  font: inherit;
  font-size: 14px;
  resize: vertical;
}
.feedback-thanks {
  color: var(--lootx-green);
  font-size: 14px;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 40px;
}
.pager-link {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.pager-link:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.pager-link.next {
  text-align: right;
}
.pager-dir {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}
.pager-link.next .pager-dir {
  justify-content: flex-end;
}
.pager-link.prev .pager-dir svg {
  transform: rotate(180deg);
}
.pager-dir svg {
  width: 14px;
  height: 14px;
}
.pager-title {
  font-weight: 600;
  font-size: 15px;
}

.support-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 32px;
  padding: 18px 22px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(49, 207, 195, 0.08), transparent 60%),
    var(--bg-secondary);
}
.support-cta p {
  margin: 4px 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ─────────────────────────────── home ──────────────────────────────── */

.page-home .content {
  padding-top: 56px;
}
.home {
  max-width: 1080px;
  margin: 0 auto;
}
.hero {
  text-align: center;
  padding: 40px 0 48px;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -40px -10% auto;
  height: 320px;
  background: radial-gradient(60% 100% at 50% 0%, rgba(49, 207, 195, 0.14), transparent 70%);
  pointer-events: none;
  z-index: -1;
}
.hero-eyebrow {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hero-title {
  margin: 0;
  font-size: clamp(38px, 6vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.03em;
  background: var(--lootx-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-text {
  margin: 18px auto 0;
  max-width: 620px;
  color: var(--text-secondary);
  font-size: 17px;
}
.hero-search {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  height: 48px;
  padding: 0 14px 0 18px;
  /* Ширина считается от контейнера, а не от окна: 92vw не знает про боковые
     отступы страницы, и на телефоне кнопка вылезала за правый край. */
  width: min(520px, 100%);
  max-width: 100%;
  box-sizing: border-box;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.hero-search:hover {
  border-color: #3a3a56;
  background: var(--bg-card-hover);
}
.hero-search span {
  flex: 1;
  text-align: left;
}

.space-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}
.space-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.space-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.space-card-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  color: inherit;
  margin-bottom: 4px;
}
.space-card-icon svg {
  width: 20px;
  height: 20px;
}
.space-card.accent-blue .space-card-icon {
  color: var(--lootx-blue);
}
.space-card.accent-teal .space-card-icon {
  color: var(--lootx-teal);
}
.space-card.accent-green .space-card-icon {
  color: var(--lootx-green);
}
.space-card.accent-gold .space-card-icon {
  color: var(--accent-gold);
}
.space-card.accent-cyan .space-card-icon {
  color: var(--accent-cyan);
}
.space-card-title {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.space-card-text {
  color: var(--text-secondary);
  font-size: 14px;
  flex: 1;
}
.space-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 12.5px;
}
.space-card-meta svg {
  width: 14px;
  height: 14px;
  transition: transform 0.18s var(--ease);
}
.space-card:hover .space-card-meta svg {
  transform: translateX(3px);
  color: var(--lootx-teal);
}

.quick {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 28px;
}
.quick-title {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.quick-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.quick-col li {
  margin: 6px 0;
}
.quick-col a {
  color: var(--text-secondary);
  font-size: 14px;
}
.quick-col a:hover {
  color: var(--text-primary);
}

/* ────────────────────────── space index page ───────────────────────── */

.space-index .doc-head {
  display: grid;
  gap: 14px;
  justify-items: start;
  margin-bottom: 8px;
}
.space-section {
  margin-top: 40px;
}
.space-section h2 {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.page-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.page-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease);
}
.page-card:hover {
  border-color: var(--border-light);
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.page-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 550;
  font-size: 15px;
}
.page-card-arrow svg {
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}
.page-card:hover .page-card-arrow svg {
  color: var(--lootx-teal);
}

/* ────────────────────────────── search ─────────────────────────────── */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: start center;
  padding: 10vh 16px 16px;
}
.search-modal[hidden] {
  display: none;
}
.search-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(3px);
}
.search-panel {
  position: relative;
  width: min(680px, 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: pop 0.16s var(--ease);
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-8px) scale(0.99);
  }
}
.search-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 18px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}
.search-field input {
  flex: 1;
  border: 0;
  background: none;
  color: var(--text-primary);
  font: inherit;
  font-size: 16px;
  outline: none;
}
/* Одна кнопка закрытия — и та в виде клавиши: она же подсказывает,
   что модалка закрывается с клавиатуры. */
.esc-key {
  flex: none;
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  background: var(--bg-primary);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.esc-key:hover {
  color: var(--text-primary);
  border-color: #3a3a56;
}

.search-results {
  max-height: min(56vh, 480px);
  overflow-y: auto;
  padding: 8px;
}
.search-foot {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.result {
  display: block;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
}
.result:hover,
.result.is-active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.result:hover .result-snippet,
.result.is-active .result-snippet {
  border-left-color: var(--lootx-teal);
}
/* Путь до страницы над заголовком: без него в выдаче три «Быстрых старта»
   из трёх разделов неразличимы. */
.result-path {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
}
.result-sep {
  display: inline-block;
  margin: 0 6px;
  opacity: 0.6;
}
.result-title {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin: 3px 0 4px;
}
.result-snippet {
  display: block;
  padding-left: 14px;
  border-left: 2px solid var(--border);
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.5;
  /* Snippets are a couple of fragments; beyond two lines they stop being a
     preview and start being the page. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.result-snippet mark {
  background: rgba(49, 207, 195, 0.22);
  color: var(--lootx-green);
  border-radius: 3px;
  padding: 0 2px;
}
.search-empty {
  padding: 26px 16px;
  text-align: center;
  color: var(--text-secondary);
}

.search-page-form {
  display: flex;
  gap: 10px;
  margin: 20px 0 8px;
}
.search-page-form input {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  font: inherit;
}
.search-page-form .btn-gradient {
  height: 44px;
}
.search-meta {
  color: var(--text-secondary);
  font-size: 14px;
}
.search-page .results {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}
.search-page .result {
  border: 1px solid var(--border);
  background: var(--bg-card);
}

/* ─────────────────────────────── 404 ───────────────────────────────── */

.not-found {
  max-width: 560px;
  margin: 8vh auto 0;
  text-align: center;
}
.err-code {
  font-family: var(--font-mono);
  font-size: 68px;
  line-height: 1;
  margin: 0 0 12px;
  background: var(--lootx-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nf-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

/* ────────────────────────────── footer ─────────────────────────────── */

.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  margin-top: 40px;
}
.footer-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 650;
  color: var(--text-primary);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}
.footer-links a {
  color: var(--text-secondary);
}
.footer-links a:hover {
  color: var(--text-primary);
}
.footer-copy {
  margin-left: auto;
  color: var(--text-muted);
  font-size: 13px;
}

/* ───────────────────────────── responsive ──────────────────────────── */

@media (max-width: 1240px) {
  .doc-wrap {
    grid-template-columns: minmax(0, 1fr);
  }
  .toc {
    display: none;
  }
}

@media (max-width: 1080px) {
  .search-trigger {
    min-width: 180px;
  }
  .search-trigger kbd {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --sidebar-w: 300px;
  }
  .mobile-bar {
    display: flex;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Ниже 900px сайдбар — выдвижной ящик поверх контента. */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-w);
    max-width: 86vw;
    height: 100vh;
    z-index: 45;
    transform: translateX(-102%);
    transition: transform 0.24s var(--ease);
  }
  body.menu-open .sidebar {
    transform: none;
  }
  body.menu-open .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 44;
    background: rgba(4, 4, 8, 0.6);
  }
  body.menu-open {
    overflow: hidden;
  }
  .content {
    padding: 24px 0 72px;
  }
  .doc-body h2::before,
  .doc-body h3::before {
    display: none;
  }
  .pager {
    grid-template-columns: 1fr;
  }
  .support-cta {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15.5px;
  }
  .doc-wrap {
    padding: 0 16px;
  }
  .search-trigger {
    min-width: 0;
    flex: 1;
  }
  .search-trigger span {
    display: none;
  }
  .shell {
    padding: 0 14px;
  }
  .doc-head h1 {
    font-size: 28px;
  }
  .doc-lead {
    font-size: 16px;
  }
  .footer-copy {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .mobile-bar,
  .sidebar,
  .toc,
  .footer,
  .feedback,
  .pager,
  .support-cta,
  .search-modal {
    display: none !important;
  }
  body {
    background: #fff;
    color: #111;
  }
  .doc-body a:not([class]) {
    color: #111;
  }
}

/* Кнопка возврата сайдбара: видна только когда он свёрнут — иначе единственный
   способ вернуть панель остался бы внутри самой панели. */
.side-restore {
  display: none;
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 46;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
}
.side-restore:hover {
  color: var(--text-primary);
}
.side-restore svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}
body.side-collapsed .side-restore {
  display: inline-flex;
}
@media (max-width: 900px) {
  body.side-collapsed .side-restore {
    display: none;
  }
  body.side-collapsed .sidebar {
    display: flex;
  }
}

/* ── lite header (pages with no sidebar) ── */

.lite-bar {
  border-bottom: 1px solid var(--border);
}
.lite-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 56px;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 40px;
}
.lite-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
/* In a top bar the language list drops down and hangs off the right edge. */
.lang-menu.lang-down .lang-dropdown {
  top: calc(100% + 8px);
  bottom: auto;
  left: auto;
  right: 0;
}
@media (max-width: 680px) {
  .lite-inner {
    padding: 0 16px;
  }
}

/* ── keyboard shortcuts: ++mod+K++ ── */

.kbd {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: baseline;
  white-space: nowrap;
}
.key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 6px;
  border-radius: 6px;
  border: 1px solid var(--border-light);
  border-bottom-width: 2px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82em;
  line-height: 1.5;
}
.key-plus,
.key-or {
  color: var(--text-muted);
  font-size: 0.85em;
}
.key-mod {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ── ссылки на версию для печати ──
   Неброско: PDF нужен меньшинству, но нужен ему всерьёз — в дорогу, в
   распечатку для новичка, в приложение к договору. */
.doc-pdf {
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-light);
}
.doc-pdf:hover {
  color: var(--lootx-teal);
  border-bottom-color: var(--lootx-teal);
}
.space-pdf {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  font-size: 13px;
  text-decoration: none;
}
.space-pdf:hover {
  border-color: var(--lootx-teal);
  color: var(--lootx-teal);
}

/* ── «Спросить» в окне поиска ────────────────────────────────────────────
 *
 * Помощник живёт НАД списком результатов и появляется, только когда в поле
 * есть вопрос. Ответ разворачивается внутри той же панели: уводить читателя
 * на отдельную страницу ради трёх предложений — значит потерять его поиск.
 */
.search-ask {
  padding: 8px 8px 0;
  border-top: 1px solid var(--border);
}
.ask-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(
    135deg,
    rgba(49, 207, 195, 0.08),
    rgba(49, 207, 195, 0)
  );
  color: var(--text-primary);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s var(--ease),
    background 0.15s var(--ease);
}
.ask-btn:hover {
  border-color: var(--lootx-teal);
}
.ask-label {
  flex: 1;
  min-width: 0;
}
.ask-btn kbd {
  flex: none;
}
/* Искра — два треугольника из градиента: иконку ради одной кнопки не тянем. */
.ask-spark {
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--lootx-teal);
  clip-path: polygon(
    50% 0%,
    61% 39%,
    100% 50%,
    61% 61%,
    50% 100%,
    39% 61%,
    0% 50%,
    39% 39%
  );
}

.ask-answer {
  margin: 8px 0 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card, #0f0f18);
  color: var(--text-secondary);
  font-size: 13.5px;
  line-height: 1.65;
}
.ask-answer.is-thinking,
.ask-answer.is-empty {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
}
.ask-body > :first-child {
  margin-top: 0;
}
.ask-body > :last-child {
  margin-bottom: 0;
}
.ask-body p {
  margin: 0 0 8px;
}
.ask-body ul,
.ask-body ol {
  margin: 0 0 8px;
  padding-left: 20px;
}
.ask-body li {
  margin: 2px 0;
}
.ask-body code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-inset, #08080d);
  font-size: 12.5px;
}

.ask-sources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.ask-sources > span {
  color: var(--text-muted);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.ask-source {
  padding: 3px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--lootx-teal);
  font-size: 12.5px;
  text-decoration: none;
}
.ask-source:hover {
  border-color: var(--lootx-teal);
}
.ask-note {
  margin: 8px 0 0;
  color: var(--text-muted);
  font-size: 11.5px;
}

.ask-dots {
  display: inline-flex;
  gap: 3px;
}
.ask-dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--lootx-teal);
  animation: ask-pulse 1.1s infinite ease-in-out;
}
.ask-dots i:nth-child(2) {
  animation-delay: 0.15s;
}
.ask-dots i:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes ask-pulse {
  0%,
  80%,
  100% {
    opacity: 0.25;
  }
  40% {
    opacity: 1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ask-dots i {
    animation: none;
    opacity: 0.6;
  }
}
