:root {
  --docs-bg: #f8fafc;
  --docs-sidebar: #0f172a;
  --docs-sidebar-text: #cbd5e1;
  --docs-sidebar-active: #ffffff;
  --docs-accent: #2563eb;
  --docs-accent-soft: #dbeafe;
  --docs-text: #0f172a;
  --docs-muted: #64748b;
  --docs-border: #e2e8f0;
  --docs-card: #ffffff;
  --docs-radius: 12px;
  --docs-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--docs-bg);
  color: var(--docs-text);
  line-height: 1.65;
}

a { color: var(--docs-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.docs-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.docs-sidebar {
  background: var(--docs-sidebar);
  color: var(--docs-sidebar-text);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.docs-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  padding: 8px 10px;
}

.docs-brand:hover { text-decoration: none; opacity: 0.92; }

.docs-brand__logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}

.docs-brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.docs-brand__text small { color: var(--docs-sidebar-text); font-size: 12px; }

.docs-nav { display: flex; flex-direction: column; gap: 4px; }

.docs-nav__group {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  margin: 14px 10px 6px;
}

.docs-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--docs-sidebar-text);
  text-decoration: none;
  font-size: 14px;
}

.docs-nav__link:hover {
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: #fff;
}

.docs-nav__link.active {
  background: rgba(37, 99, 235, 0.25);
  color: var(--docs-sidebar-active);
}

.docs-sidebar__foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.docs-external {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #e2e8f0;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.04);
}

.docs-external:hover {
  background: rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: #fff;
}

.docs-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.docs-main--with-toc .docs-article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  gap: 32px;
  align-items: start;
  padding: 0 40px;
}

.docs-main--with-toc .docs-content {
  padding: 24px 0 48px;
  max-width: none;
}

.docs-content {
  padding: 24px 40px 48px;
  max-width: 860px;
}

.docs-header {
  padding: 28px 40px 0;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.docs-header__eyebrow {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--docs-muted);
  margin-bottom: 4px;
}

.docs-header h1 {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  line-height: 1.2;
}

.docs-menu-btn {
  display: none;
  border: 1px solid var(--docs-border);
  background: #fff;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  cursor: pointer;
  margin-top: 4px;
}

/* Права панель — зміст сторінки */
.docs-toc {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding: 24px 0 48px;
}

.docs-toc__inner {
  border-left: 1px solid var(--docs-border);
  padding-left: 16px;
}

.docs-toc__title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--docs-muted);
  margin-bottom: 12px;
  font-weight: 600;
}

.docs-toc__nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-toc__link {
  display: block;
  padding: 6px 0 6px 12px;
  margin-left: -17px;
  border-left: 2px solid transparent;
  font-size: 13px;
  line-height: 1.4;
  color: var(--docs-muted);
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.docs-toc__link:hover {
  color: var(--docs-text);
  text-decoration: none;
}

.docs-toc__link.active {
  color: var(--docs-accent);
  border-left-color: var(--docs-accent);
  font-weight: 500;
}

.docs-footer {
  margin-top: auto;
  padding: 20px 40px 32px;
  color: var(--docs-muted);
  font-size: 13px;
  border-top: 1px solid var(--docs-border);
}

.prose h2 {
  font-size: 1.35rem;
  margin: 2rem 0 0.75rem;
  padding-top: 0.5rem;
  scroll-margin-top: 88px;
}

.prose h3 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem;
}

.prose p, .prose ul, .prose ol {
  margin-bottom: 1rem;
}

.prose ul, .prose ol {
  padding-left: 1.25rem;
}

.prose li { margin-bottom: 0.35rem; }

.prose code {
  background: #eef2ff;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.92em;
}

.prose .lead {
  font-size: 1.08rem;
  color: var(--docs-muted);
}

.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.docs-card {
  background: var(--docs-card);
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  padding: 20px;
  box-shadow: var(--docs-shadow);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.docs-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
  text-decoration: none;
}

.docs-card i {
  font-size: 1.4rem;
  color: var(--docs-accent);
  margin-bottom: 10px;
  display: block;
}

.docs-card strong { display: block; margin-bottom: 6px; }
.docs-card span { color: var(--docs-muted); font-size: 14px; }

.callout {
  border-left: 4px solid var(--docs-accent);
  background: var(--docs-accent-soft);
  padding: 14px 16px;
  border-radius: 0 8px 8px 0;
  margin: 1.25rem 0;
}

.callout-warning {
  border-left-color: #f59e0b;
  background: #fffbeb;
}

.callout-tip {
  border-left-color: #10b981;
  background: #ecfdf5;
}

.steps {
  counter-reset: step;
  list-style: none;
  padding-left: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin-bottom: 1rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--docs-accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .docs-main--with-toc .docs-article {
    grid-template-columns: 1fr;
  }

  .docs-toc {
    position: static;
    max-height: none;
    padding: 0 0 20px;
    border-bottom: 1px solid var(--docs-border);
    margin-bottom: 8px;
  }

  .docs-toc__inner {
    border-left: none;
    padding-left: 0;
  }

  .docs-toc__nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .docs-toc__link {
    margin-left: 0;
    padding: 6px 12px;
    border: 1px solid var(--docs-border);
    border-radius: 999px;
    background: #fff;
  }

  .docs-toc__link.active {
    border-color: var(--docs-accent);
    background: var(--docs-accent-soft);
  }
}

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    width: min(280px, 88vw);
  }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
  .docs-header { padding-left: 20px; padding-right: 20px; }
  .docs-article { padding-left: 20px; padding-right: 20px; }
  .docs-main--with-toc .docs-article { padding-left: 20px; padding-right: 20px; }
  .docs-content { padding-left: 0; padding-right: 0; }
  .docs-footer { padding-left: 20px; padding-right: 20px; }
}
