/* НейроЛидка — стили раздела «Документация» (/docs, /docs/tech). */
button, input, select, textarea { font-family: inherit; }
:root { color-scheme: dark; }
:root {
--bg: #0f172a; --card: #1e293b; --border: #334155;
--accent: #6366f1; --accent-hover: #818cf8; --text: #e2e8f0;
--text-muted: #94a3b8; --radius: 14px;
--header-h: 64px;
}
html { overflow-y: scroll; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); scrollbar-width: thin; scrollbar-color: var(--accent) var(--card); }
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: var(--bg); color: var(--text); font-family: -apple-system, 'Segoe UI', sans-serif; line-height: 1.65; }
a { color: var(--accent-hover); }

/* Шапка */
.docs-header { position: sticky; top: 0; z-index: 50; height: var(--header-h); background: var(--bg); border-bottom: 1px solid var(--border); }
.docs-header-inner { max-width: 1240px; height: 100%; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.05em; white-space: nowrap; }
.brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 1px rgba(129,140,248,0.45); }
.brand small { color: var(--text-muted); font-weight: 500; font-size: 0.85em; padding-left: 10px; border-left: 1px solid var(--border); }
.search { flex: 1; max-width: 360px; margin-left: auto; position: relative; }
.search input { width: 100%; height: 38px; padding: 0 12px 0 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 0.9em; }
.search input:focus { outline: none; border-color: var(--accent); }
.search::before { content: '⌕'; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: var(--text-muted); font-size: 1.05em; pointer-events: none; }
.header-links { display: flex; gap: 6px; }
.header-links a { color: var(--text-muted); text-decoration: none; font-size: 0.9em; padding: 8px 12px; border-radius: 8px; white-space: nowrap; }
.header-links a:hover { color: var(--text); background: var(--card); }
.header-links a.primary { color: #fff; background: var(--accent); }
.header-links a.primary:hover { background: var(--accent-hover); }
.menu-btn { display: none; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 0.9em; cursor: pointer; }

/* Каркас: меню слева, текст справа */
.docs-layout { max-width: 1240px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 48px; }
.sidebar { position: sticky; top: var(--header-h); align-self: start; max-height: calc(100vh - var(--header-h)); overflow-y: auto; padding: 28px 0 40px; scrollbar-width: thin; }
.nav-group { margin-bottom: 22px; }
.nav-group-title { font-size: 0.72em; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; margin: 0 0 6px 12px; }
.nav-link { display: block; padding: 6px 12px; border-radius: 8px; color: var(--text-muted); text-decoration: none; font-size: 0.92em; border-left: 2px solid transparent; }
.nav-link:hover { color: var(--text); background: var(--card); }
.nav-link.active { color: var(--text); background: rgba(99,102,241,0.12); border-left-color: var(--accent); font-weight: 600; }
.nav-link.hidden { display: none; }
.nav-empty { display: none; color: var(--text-muted); font-size: 0.88em; padding: 6px 12px; }

.content { padding: 36px 0 96px; max-width: 780px; }
.content h1 { font-size: 2em; line-height: 1.25; margin-bottom: 10px; }
.lead { color: var(--text-muted); font-size: 1.05em; margin-bottom: 8px; }
.meta { color: var(--text-muted); font-size: 0.82em; margin-bottom: 36px; }
.doc-section { padding-top: 8px; margin-bottom: 44px; }
.doc-section h2 { font-size: 1.45em; line-height: 1.3; margin-bottom: 12px; padding-top: 20px; border-top: 1px solid var(--border); }
.doc-section h3 { font-size: 1.05em; margin: 22px 0 8px; }
.doc-section p { margin-bottom: 12px; }
.doc-section ul, .doc-section ol { margin: 0 0 14px 22px; }
.doc-section li { margin-bottom: 6px; }
.doc-section li::marker { color: var(--text-muted); }
code { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; font-size: 0.88em; background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
pre { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; overflow-x: auto; margin: 0 0 14px; }
pre code { background: none; border: 0; padding: 0; font-size: 0.85em; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--border); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 0.92em; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--border); }
th { background: var(--card); font-weight: 600; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td:first-child { font-weight: 500; min-width: 140px; }
.note { border: 1px solid var(--border); border-left: 3px solid var(--accent); background: var(--card); border-radius: 10px; padding: 12px 16px; margin: 0 0 16px; font-size: 0.95em; }
.faq-q { font-weight: 600; margin-bottom: 4px; }
.faq-item { margin-bottom: 18px; }
.page-footer { margin-top: 56px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.88em; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.page-footer a { color: var(--text-muted); }
.page-footer a:hover { color: var(--text); }

@media (max-width: 960px) {
  .docs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .sidebar { display: none; position: fixed; top: var(--header-h); left: 0; right: 0; bottom: 0; max-height: none; z-index: 40; background: var(--bg); padding: 16px 20px 40px; border-top: 1px solid var(--border); }
  .sidebar.open { display: block; }
  .menu-btn { display: inline-flex; align-items: center; }
  .header-links { display: none; }
  .brand small { display: none; }
  .search { max-width: none; }
}
@media (max-width: 600px) {
  .docs-header-inner, .docs-layout { padding: 0 16px; }
  .brand span { display: none; }
  .content { padding-top: 24px; }
  .content h1 { font-size: 1.6em; }
  .doc-section h2 { font-size: 1.25em; }
  td:first-child { min-width: 110px; }
}

/* Схемы и чек-листы (техническая документация) */
.diagram { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--card); padding: 8px; margin: 0 0 14px; }
.diagram svg { display: block; width: 100%; min-width: 560px; height: auto; }
.d-zone { fill: rgba(148, 163, 184, 0.07); stroke: var(--border); stroke-width: 1; }
.d-box { fill: none; stroke: var(--text-muted); stroke-width: 1.25; }
.d-main { fill: rgba(99, 102, 241, 0.14); stroke: var(--accent); stroke-width: 2; }
.d-lines path { stroke: var(--text-muted); stroke-width: 1.25; }
.d-arrow { fill: var(--text-muted); }
.d-name { fill: var(--text); font-weight: 600; font-size: 13px; }
.d-line, .d-note { fill: var(--text-muted); font-size: 11.5px; }
.d-strong { fill: var(--text); }
.checklist { list-style: none; margin-left: 0 !important; }
.checklist li::before { content: '☐'; color: var(--text-muted); margin-right: 8px; }
.state-box { border: 1px solid var(--border); background: var(--card); border-radius: var(--radius); padding: 28px; text-align: center; margin-top: 24px; }
.state-box p { color: var(--text-muted); margin-bottom: 16px; }
.state-box a { display: inline-block; padding: 10px 18px; border-radius: 10px; background: var(--accent); color: #fff; text-decoration: none; }
