/* Help center («Справка», /help). World 1 of DESIGN.md: the app's calm,
   light, hairline-bordered look, so the screenshots inside articles sit in a
   frame that matches them. Self-contained: no Tailwind/daisyUI on these pages. */

:root {
  --hc-ink: #1a1a2e;
  --hc-slate: #525866;
  --hc-whisper: #8b8fa3;
  --hc-canvas: #fafbfc;
  --hc-paper: #ffffff;
  --hc-hover: #f4f5f7;
  --hc-line: #e1e4e8;
  --hc-line-soft: #eef0f2;
  --hc-indigo: #4f46e5;
  --hc-indigo-deep: #4338ca;
  --hc-indigo-soft: #eef2ff;
  --hc-radius: 8px;
  --hc-radius-lg: 12px;
  --hc-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --hc-top: 60px;
  --hc-font: "Golos Text", system-ui, sans-serif;
  --hc-mono: "JetBrains Mono", ui-monospace, monospace;
}

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

html { scroll-padding-top: calc(var(--hc-top) + 24px); -webkit-text-size-adjust: 100%; }

body.hc {
  margin: 0;
  background: var(--hc-canvas);
  color: var(--hc-ink);
  font-family: var(--hc-font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hc a { color: inherit; }
.hc svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hc :focus-visible { outline: 2px solid var(--hc-indigo); outline-offset: 1px; border-radius: 6px; }

kbd {
  font-family: var(--hc-mono);
  font-size: 11px;
  line-height: 1;
  color: var(--hc-slate);
  background: var(--hc-paper);
  border: 1px solid var(--hc-line);
  border-radius: 5px;
  padding: 3px 5px;
}

.hc-skip { position: absolute; left: -9999px; }
.hc-skip:focus { left: 16px; top: 12px; z-index: 100; background: var(--hc-paper); padding: 8px 12px; border-radius: var(--hc-radius); }

/* ── Buttons ── */
.hc-btn {
  display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: 14px; font-weight: 500;
  border-radius: var(--hc-radius);
  padding: 7px 12px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 120ms var(--hc-ease), border-color 120ms var(--hc-ease), color 120ms var(--hc-ease), transform 120ms var(--hc-ease);
}
.hc-btn svg { width: 16px; height: 16px; }
.hc-btn-primary { background: var(--hc-indigo); border-color: var(--hc-indigo); color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2); }
.hc .hc-btn-primary { color: #fff; }
.hc-btn-primary:hover { background: var(--hc-indigo-deep); transform: translateY(-0.5px); }
.hc-btn-outline { background: var(--hc-paper); border-color: var(--hc-line); color: var(--hc-slate); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); }
.hc-btn-outline:hover { background: var(--hc-hover); color: var(--hc-ink); }
.hc-btn-quiet { background: var(--hc-hover); color: var(--hc-slate); }
.hc-btn-quiet:hover { color: var(--hc-ink); background: #eceef1; }
.hc-btn[aria-pressed="true"] { background: var(--hc-indigo-soft); border-color: #c7d2fe; color: var(--hc-indigo-deep); }

/* ── Top bar ── */
.hc-top {
  position: sticky; top: 0; z-index: 40;
  height: var(--hc-top);
  background: var(--hc-paper);
  border-bottom: 1px solid var(--hc-line);
}
.hc-top-inner {
  max-width: 1360px; height: 100%; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 10px;
}
.hc-brand { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; text-decoration: none; }
.hc-brand-sep { color: var(--hc-line); font-size: 18px; }
.hc-brand-sub { color: var(--hc-slate); text-decoration: none; font-weight: 500; }
.hc-brand-sub:hover { color: var(--hc-ink); }
.hc-menu-btn { display: none; }

.hc-search-btn {
  margin-left: 28px;
  display: flex; align-items: center; gap: 8px;
  width: min(360px, 40vw);
  font: inherit; font-size: 14px; color: var(--hc-whisper);
  background: var(--hc-canvas);
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-radius);
  padding: 7px 8px 7px 10px;
  cursor: pointer;
  transition: border-color 120ms var(--hc-ease), background-color 120ms var(--hc-ease);
}
.hc-search-btn:hover { border-color: #cbd5e1; background: var(--hc-paper); }
.hc-search-btn span { flex: 1; text-align: left; }
.hc-top-links { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.hc-top-link { text-decoration: none; color: var(--hc-slate); font-size: 14px; font-weight: 500; }
.hc-top-link:hover { color: var(--hc-ink); }
.hc-top-links .hc-btn { white-space: nowrap; }
.hc-cta-short { display: none; }

/* ── Layout ── */
.hc-layout {
  max-width: 1360px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 48px;
}
.hc-layout.has-toc { grid-template-columns: 264px minmax(0, 1fr) 216px; }
.hc-main { min-width: 0; padding: 40px 0 72px; }

/* ── Sidebar ── */
.hc-nav {
  position: sticky; top: var(--hc-top);
  max-height: calc(100vh - var(--hc-top));
  overflow-y: auto;
  padding: 28px 4px 32px 0;
  scrollbar-width: thin;
}
.hc-nav-head { display: none; }
.hc-nav-list, .hc-nav-list ul { list-style: none; margin: 0; padding: 0; }
.hc-nav-list > li + li { margin-top: 2px; }
.hc-nav-section summary {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: 6px;
  font-weight: 500; color: var(--hc-ink);
  cursor: pointer; list-style: none;
  transition: background-color 120ms var(--hc-ease);
}
.hc-nav-section summary::-webkit-details-marker { display: none; }
.hc-nav-section summary:hover { background: var(--hc-hover); }
.hc-nav-section summary svg { width: 15px; height: 15px; color: var(--hc-whisper); transition: transform 160ms var(--hc-ease); }
.hc-nav-section[open] summary svg { transform: rotate(90deg); }
.hc-nav-section ul { padding: 2px 0 8px 10px; }
.hc-nav-section ul a {
  display: block; padding: 5px 10px; border-radius: 6px;
  font-size: 14px; line-height: 1.4; color: var(--hc-slate); text-decoration: none;
  transition: background-color 120ms var(--hc-ease), color 120ms var(--hc-ease);
}
.hc-nav-section ul a:hover { background: var(--hc-hover); color: var(--hc-ink); }
.hc-nav-section ul a[aria-current="page"] { background: var(--hc-indigo-soft); color: var(--hc-indigo-deep); font-weight: 500; }
.hc-nav-support {
  margin: 24px 0 0 10px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--hc-slate); text-decoration: none;
}
.hc-nav-support:hover { color: var(--hc-ink); }
.hc-nav-support svg { width: 16px; height: 16px; }
.hc-scrim { display: none; }

/* ── Index ── */
.hc-hero { padding: 24px 0 8px; max-width: 760px; }
.hc-hero h1 { margin: 0; font-size: clamp(28px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.025em; font-weight: 600; }
.hc-lead { margin: 12px 0 0; font-size: 17px; line-height: 1.55; color: var(--hc-slate); max-width: 64ch; }
.hc-hero-search {
  margin-top: 28px; width: 100%;
  display: flex; align-items: center; gap: 12px;
  font: inherit; font-size: 15px; color: var(--hc-whisper); text-align: left;
  background: var(--hc-paper);
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-radius-lg);
  padding: 14px 14px 14px 16px;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: border-color 120ms var(--hc-ease), box-shadow 120ms var(--hc-ease);
}
.hc-hero-search:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
.hc-hero-search svg { width: 20px; height: 20px; color: var(--hc-slate); }
.hc-hero-search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.hc-block { margin-top: 48px; }
.hc-block-title { margin: 0 0 14px; font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }

.hc-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; counter-reset: s; }
.hc-step {
  display: flex; gap: 14px; height: 100%;
  padding: 16px 18px;
  background: var(--hc-paper);
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-radius-lg);
  text-decoration: none;
  transition: border-color 120ms var(--hc-ease), box-shadow 120ms var(--hc-ease);
}
.hc-step:hover { border-color: #cbd5e1; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); }
.hc-step-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 13px; font-weight: 600; color: var(--hc-indigo-deep); background: var(--hc-indigo-soft);
}
.hc-step-body { display: grid; gap: 3px; min-width: 0; }
.hc-step-title { font-weight: 600; line-height: 1.35; }
.hc-step-desc { font-size: 14px; color: var(--hc-slate); line-height: 1.45; }

.hc-sections { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.hc-section-card {
  padding: 18px 20px 16px;
  background: var(--hc-paper);
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-radius-lg);
}
.hc-section-card h3 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.hc-section-card h3 a { text-decoration: none; }
.hc-section-card h3 a:hover { color: var(--hc-indigo-deep); }
.hc-section-card > p { margin: 4px 0 12px; font-size: 14px; color: var(--hc-slate); line-height: 1.45; }
.hc-section-card ul { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--hc-line-soft); display: grid; gap: 2px; }
.hc-section-card li a { display: block; padding: 3px 0; font-size: 14px; color: var(--hc-slate); text-decoration: none; }
.hc-section-card li a:hover { color: var(--hc-indigo-deep); }

/* ── Section list ── */
.hc-list { list-style: none; margin: 28px 0 0; padding: 0; background: var(--hc-paper); border: 1px solid var(--hc-line); border-radius: var(--hc-radius-lg); overflow: hidden; }
.hc-list li + li { border-top: 1px solid var(--hc-line-soft); }
.hc-list-row { display: grid; gap: 3px; padding: 14px 20px; text-decoration: none; transition: background-color 120ms var(--hc-ease); }
.hc-list-row:hover { background: var(--hc-hover); }
.hc-list-title { font-weight: 600; }
.hc-list-desc { font-size: 14px; color: var(--hc-slate); }

/* ── Article ── */
.hc-article { max-width: 760px; }
.hc-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--hc-whisper); }
.hc-crumbs a { color: var(--hc-slate); text-decoration: none; }
.hc-crumbs a:hover { color: var(--hc-ink); }
.hc-h1 { margin: 12px 0 0; font-size: clamp(26px, 3.2vw, 34px); line-height: 1.15; letter-spacing: -0.025em; font-weight: 600; }
.hc-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  margin-top: 18px; padding-bottom: 24px; border-bottom: 1px solid var(--hc-line);
  font-size: 13px; color: var(--hc-whisper);
}
.hc-meta .hc-btn { font-size: 13px; padding: 5px 10px; }

.hc-prose { margin-top: 8px; font-size: 16px; line-height: 1.65; }
.hc-prose > * { max-width: 70ch; }
.hc-prose h2 { margin: 40px 0 12px; font-size: 21px; line-height: 1.3; letter-spacing: -0.015em; font-weight: 600; }
.hc-prose h3 { margin: 28px 0 8px; font-size: 17px; line-height: 1.35; font-weight: 600; }
.hc-prose .hc-anchor { color: inherit; text-decoration: none; }
.hc-anchor:hover::after { content: " #"; color: var(--hc-whisper); font-weight: 400; }
.hc-prose p { margin: 12px 0; }
.hc-prose ul, .hc-prose ol { margin: 12px 0; padding-left: 1.4em; }
.hc-prose li { margin: 6px 0; padding-left: 2px; }
.hc-prose li::marker { color: var(--hc-whisper); }
.hc-prose ol > li::marker { font-weight: 600; color: var(--hc-slate); }
.hc-prose strong { font-weight: 600; }
.hc-prose a { color: var(--hc-indigo-deep); text-decoration: underline; text-decoration-color: #c7d2fe; text-underline-offset: 3px; }
.hc-prose a:hover { text-decoration-color: currentColor; }
.hc-prose code { font-family: var(--hc-mono); font-size: 0.86em; background: var(--hc-hover); border: 1px solid var(--hc-line-soft); border-radius: 5px; padding: 1px 5px; }
.hc-prose hr { border: 0; border-top: 1px solid var(--hc-line); margin: 32px 0; }

.hc-figure { margin: 24px 0; max-width: none; }
.hc-figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-radius-lg);
  background: var(--hc-paper);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.hc-figure img.is-narrow { width: auto; max-width: min(100%, 440px); }
.hc-figure img.is-medium { width: auto; max-width: min(100%, 600px); }
.hc-figure > a { display: block; cursor: zoom-in; }
.hc-figure figcaption { margin-top: 8px; font-size: 13px; line-height: 1.45; color: var(--hc-whisper); }

.hc-note {
  margin: 20px 0; padding: 14px 16px;
  background: var(--hc-paper);
  border: 1px solid var(--hc-line);
  border-radius: var(--hc-radius-lg);
  font-size: 15px;
}
.hc-note p { margin: 6px 0; }
.hc-note p:first-child { margin-top: 0; }
.hc-note p:last-child { margin-bottom: 0; }

.hc-table { margin: 20px 0; overflow-x: auto; border: 1px solid var(--hc-line); border-radius: var(--hc-radius-lg); background: var(--hc-paper); max-width: none; }
.hc-table table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.45; }
.hc-table th { text-align: left; font-weight: 600; color: var(--hc-slate); background: var(--hc-canvas); }
.hc-table th, .hc-table td { padding: 10px 14px; border-bottom: 1px solid var(--hc-line-soft); vertical-align: top; }
.hc-table tr:last-child td { border-bottom: 0; }

/* ── Feedback, pager ── */
.hc-feedback {
  margin-top: 48px; padding: 16px 20px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  background: var(--hc-paper); border: 1px solid var(--hc-line); border-radius: var(--hc-radius-lg);
}
.hc-feedback-q { margin: 0; font-weight: 600; }
.hc-feedback-actions { display: flex; gap: 8px; }
.hc-feedback-thanks { margin: 0; flex-basis: 100%; font-size: 14px; color: var(--hc-slate); }
.hc-feedback-thanks a { color: var(--hc-indigo-deep); }

.hc-pager { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hc-pager-link {
  display: grid; gap: 2px; padding: 14px 18px;
  border: 1px solid var(--hc-line); border-radius: var(--hc-radius-lg);
  background: var(--hc-paper); text-decoration: none;
  transition: border-color 120ms var(--hc-ease);
}
.hc-pager-link:hover { border-color: #cbd5e1; }
.hc-pager-link.is-next { text-align: right; grid-column: 2; }
.hc-pager-dir { font-size: 13px; color: var(--hc-whisper); }
.hc-pager-title { font-weight: 500; line-height: 1.35; }

/* ── Table of contents ── */
.hc-toc { position: sticky; top: var(--hc-top); align-self: start; padding: 40px 0 24px; max-height: calc(100vh - var(--hc-top)); overflow-y: auto; }
.hc-toc-title { margin: 0 0 10px; font-size: 13px; font-weight: 600; color: var(--hc-ink); }
.hc-toc ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hc-toc a {
  display: block; padding: 4px 8px; border-radius: 6px;
  font-size: 13px; line-height: 1.4; color: var(--hc-slate); text-decoration: none;
  transition: background-color 120ms var(--hc-ease), color 120ms var(--hc-ease);
}
.hc-toc a:hover { color: var(--hc-ink); background: var(--hc-hover); }
.hc-toc a.is-active { color: var(--hc-indigo-deep); background: var(--hc-indigo-soft); }

/* ── Footer ── */
.hc-footer { border-top: 1px solid var(--hc-line); background: var(--hc-paper); }
.hc-footer-inner { max-width: 1360px; margin: 0 auto; padding: 24px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 32px; }
.hc-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 14px; }
.hc-footer nav a { color: var(--hc-slate); text-decoration: none; }
.hc-footer nav a:hover { color: var(--hc-ink); }

/* ── Search dialog ── */
.hc-search {
  width: min(640px, calc(100vw - 32px));
  margin: 12vh auto auto;
  padding: 0; border: 1px solid var(--hc-line); border-radius: var(--hc-radius-lg);
  background: var(--hc-paper); color: var(--hc-ink);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 24px 48px rgba(26, 26, 46, 0.12);
}
.hc-search::backdrop { background: rgba(26, 26, 46, 0.32); }
.hc-search[open] { animation: hc-pop 160ms var(--hc-ease); }
@keyframes hc-pop { from { opacity: 0; transform: translateY(6px) scale(0.99); } }
.hc-search-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--hc-line); }
.hc-search-field svg { color: var(--hc-slate); }
.hc-search-field input { flex: 1; min-width: 0; border: 0; outline: 0; font: inherit; font-size: 16px; color: var(--hc-ink); background: transparent; }
.hc-search-field input::-webkit-search-cancel-button { display: none; }
.hc-search-field input:focus-visible { outline: none; }
.hc-search-field:focus-within { box-shadow: inset 0 -1px 0 var(--hc-indigo); }
.hc-search-results { list-style: none; margin: 0; padding: 6px; max-height: min(60vh, 460px); overflow-y: auto; }
.hc-search-results:empty { display: none; }
.hc-search-results a {
  display: grid; gap: 2px; padding: 10px 12px; border-radius: var(--hc-radius);
  text-decoration: none;
}
.hc-search-results a[aria-selected="true"] { background: var(--hc-indigo-soft); }
.hc-sr-title { font-weight: 600; font-size: 15px; }
.hc-sr-section { font-size: 12px; color: var(--hc-whisper); }
.hc-sr-snippet { font-size: 13px; line-height: 1.45; color: var(--hc-slate); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hc-search-results mark { background: transparent; color: var(--hc-indigo-deep); font-weight: 600; }
.hc-search-empty { margin: 0; padding: 20px 18px; font-size: 14px; color: var(--hc-slate); }
.hc-search-empty a { color: var(--hc-indigo-deep); }
.hc-search-foot { margin: 0; padding: 10px 16px; border-top: 1px solid var(--hc-line-soft); display: flex; gap: 16px; font-size: 12px; color: var(--hc-whisper); }
.hc-search-foot kbd { margin-right: 3px; }

/* ── Responsive ── */
@media (max-width: 1180px) {
  .hc-layout.has-toc { grid-template-columns: 248px minmax(0, 1fr); }
  .hc-toc { display: none; }
  .hc-layout { gap: 36px; }
}

@media (max-width: 860px) {
  .hc-top-inner { padding: 0 12px 0 8px; gap: 6px; }
  .hc-menu-btn {
    display: grid; place-items: center; width: 40px; height: 40px;
    border: 0; background: transparent; color: var(--hc-ink); border-radius: var(--hc-radius); cursor: pointer;
  }
  .hc-menu-btn:hover { background: var(--hc-hover); }
  .hc-search-btn { margin-left: auto; width: 40px; height: 40px; padding: 0; justify-content: center; background: transparent; border-color: transparent; color: var(--hc-ink); }
  .hc-search-btn span, .hc-search-btn kbd { display: none; }
  .hc-top-links { margin-left: 0; }
  .hc-top-link { display: none; }
  .hc-top-links .hc-btn { padding: 6px 12px; font-size: 13px; }
  .hc-cta-long { display: none; }
  .hc-cta-short { display: inline; }

  .hc-layout, .hc-layout.has-toc { display: block; padding: 0 18px; }
  .hc-main { padding-top: 24px; }
  .hc-nav {
    position: fixed; z-index: 60; top: 0; left: 0; bottom: 0;
    width: min(320px, 86vw); max-height: none;
    padding: 0 12px 32px;
    background: var(--hc-paper);
    border-right: 1px solid var(--hc-line);
    transform: translateX(-102%);
    transition: transform 220ms var(--hc-ease);
  }
  .hc-nav.is-open { transform: none; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08); }
  .hc-nav-head {
    position: sticky; top: 0; z-index: 1;
    display: flex; align-items: center; justify-content: space-between;
    height: var(--hc-top); margin-bottom: 8px; padding-left: 10px;
    background: var(--hc-paper); font-weight: 600;
  }
  .hc-nav-close { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; color: var(--hc-ink); border-radius: var(--hc-radius); cursor: pointer; }
  .hc-scrim:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(26, 26, 46, 0.32); }
  body.hc-locked { overflow: hidden; }

  .hc-steps { grid-template-columns: minmax(0, 1fr); }
  .hc-prose { font-size: 16px; }
  .hc-figure { margin: 20px -4px; }
  .hc-pager { grid-template-columns: minmax(0, 1fr); }
  .hc-pager-link.is-next { grid-column: auto; }
  .hc-search { margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .hc *, .hc *::before, .hc *::after { transition: none !important; animation: none !important; }
}
