/* Documentation page styles. Reuses the app theme variables from style.css
   (linked first) and overrides the app's fixed-viewport layout so the page
   scrolls like a normal document. */

body.docs-body {
  overflow: auto;
  height: auto;
  min-height: 100vh;
  user-select: text;
  background: radial-gradient(circle at top, #1a1a1a 0%, var(--bg-primary) 42%);
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(18, 18, 18, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
}
.docs-topbar .app-title {
  margin-right: 0;
}
.docs-topbar .spacer { flex: 1; }
.docs-back {
  text-decoration: none;
  color: var(--text-primary);
  background: linear-gradient(180deg, rgba(52, 52, 52, 0.95), rgba(28, 28, 28, 0.95));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
}
.docs-back:hover { border-color: rgba(255, 255, 255, 0.18); }

.docs-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

/* Sticky table of contents */
.docs-toc {
  position: sticky;
  top: 76px;
  align-self: start;
  max-height: calc(100vh - 96px);
  overflow: auto;
  font-size: 12.5px;
}
.docs-toc h4 {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  font-size: 10.5px;
  margin: 14px 0 6px;
}
.docs-toc a {
  display: block;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  border-left: 2px solid transparent;
}
.docs-toc a:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.docs-content {
  min-width: 0;
  line-height: 1.65;
  color: #d7d7d7;
}
.docs-content h1 {
  font-size: 30px;
  letter-spacing: 0.2px;
  color: #fff;
  margin-bottom: 6px;
}
.docs-lede {
  color: var(--text-secondary);
  font-size: 15px;
  margin-bottom: 8px;
}
.docs-content h2 {
  font-size: 21px;
  color: #fff;
  margin: 40px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  scroll-margin-top: 76px;
}
.docs-content h3 {
  font-size: 16px;
  color: #f3f3f3;
  margin: 24px 0 8px;
  scroll-margin-top: 76px;
}
.docs-content p { margin: 10px 0; }
.docs-content ul, .docs-content ol { margin: 10px 0 10px 22px; }
.docs-content li { margin: 5px 0; }
.docs-content a { color: #7fb2ff; }

.docs-content code {
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #eaeaea;
}
kbd {
  display: inline-block;
  background: linear-gradient(180deg, #3a3a3a, #262626);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 1px 7px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: #fff;
}

.docs-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 16px 0;
  box-shadow: var(--shadow-soft);
}
.docs-note {
  border-left: 3px solid #7fb2ff;
  background: rgba(127, 178, 255, 0.06);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 16px 0;
}
.docs-tip {
  border-left: 3px solid #64d69a;
  background: rgba(100, 214, 154, 0.06);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 16px 0;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13px;
}
.docs-content th, .docs-content td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.docs-content th { color: #fff; }

.docs-steps { counter-reset: step; list-style: none; margin-left: 0; }
.docs-steps > li {
  position: relative;
  padding-left: 34px;
  margin: 12px 0;
}
.docs-steps > li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-active);
  border: 1px solid var(--border);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: grid;
  place-items: center;
}

.docs-footer {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

@media (max-width: 820px) {
  .docs-shell { grid-template-columns: 1fr; }
  .docs-toc { position: static; max-height: none; }
}
