/* ── Docs portal ─────────────────────────────────────────────────────────────
   Standalone styles for docs.html. Kept independent of the app's CSS so the
   documentation site is self-contained. */

:root {
  --doc-bg:        #ffffff;
  --doc-fg:        #1f2933;
  --doc-muted:     #6b7280;
  --doc-border:    #e5e7eb;
  --doc-accent:    #2563eb;
  --doc-sidebar:   #f8fafc;
  --doc-code-bg:   #f3f4f6;
  --doc-header-h:  64px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--doc-bg);
  color: var(--doc-fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

/* ── Header: see css/page-header.css (shared across settings/help/docs) ─────── */

/* ── Layout ───────────────────────────────────────────────────────────────── */
.doc-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 220px;
  align-items: start;
  max-width: 1400px;
  margin: 0 auto;
}

.doc-sidebar {
  position: sticky;
  top: var(--doc-header-h);
  height: calc(100vh - var(--doc-header-h));
  overflow-y: auto;
  padding: 20px 14px 40px;
  border-right: 1px solid var(--doc-border);
  background: var(--doc-sidebar);
}
.doc-nav-section {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--doc-muted);
  margin: 18px 8px 6px;
}
.doc-nav-section:first-child { margin-top: 0; }
.doc-nav-list { list-style: none; margin: 0; padding: 0; }
.doc-nav-link {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--doc-fg);
  text-decoration: none;
  font-size: 14px;
}
.doc-nav-link:hover { background: #eef2ff; }
.doc-nav-link--active { background: #e0e7ff; color: var(--doc-accent); font-weight: 600; }

.doc-main { min-width: 0; padding: 28px 40px 80px; }
.doc-content { max-width: 780px; }
.doc-content:focus { outline: none; }

.doc-toc {
  position: sticky;
  top: var(--doc-header-h);
  max-height: calc(100vh - var(--doc-header-h));
  overflow-y: auto;
  padding: 28px 16px;
  font-size: 13px;
}
.doc-toc-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--doc-muted);
  margin-bottom: 8px;
}
.doc-toc-link {
  display: block;
  padding: 3px 0;
  color: var(--doc-muted);
  text-decoration: none;
  border-left: 2px solid transparent;
}
.doc-toc-link:hover { color: var(--doc-accent); }
.doc-toc-link--h3 { padding-left: 12px; font-size: 12px; }

/* ── Markdown content ─────────────────────────────────────────────────────── */
.doc-content h1 { font-size: 30px; margin: 0 0 12px; line-height: 1.25; }
.doc-content h2 { font-size: 22px; margin: 32px 0 10px; padding-top: 6px; border-top: 1px solid var(--doc-border); }
.doc-content h3 { font-size: 17px; margin: 22px 0 8px; }
.doc-content p  { margin: 0 0 14px; }
.doc-content ul, .doc-content ol { margin: 0 0 14px; padding-left: 22px; }
.doc-content li { margin: 4px 0; }
.doc-content a  { color: var(--doc-accent); text-decoration: none; }
.doc-content a:hover { text-decoration: underline; }
.doc-content code {
  background: var(--doc-code-bg);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.doc-content pre {
  background: var(--doc-code-bg);
  padding: 14px 16px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 0 0 16px;
}
.doc-content pre code { background: none; padding: 0; }
.doc-content blockquote {
  margin: 0 0 16px;
  padding: 6px 16px;
  border-left: 4px solid var(--doc-accent);
  background: #f8fafc;
  color: var(--doc-fg);
}
.doc-content table { border-collapse: collapse; margin: 0 0 16px; width: 100%; font-size: 14px; }
.doc-content th, .doc-content td { border: 1px solid var(--doc-border); padding: 6px 10px; text-align: left; }
.doc-content th { background: var(--doc-sidebar); }
.doc-content img { max-width: 100%; border: 1px solid var(--doc-border); border-radius: 8px; }
.doc-content hr { border: none; border-top: 1px solid var(--doc-border); margin: 28px 0; }

.doc-placeholder { color: var(--doc-muted); font-style: italic; }

.doc-hidden { display: none !important; }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .doc-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .doc-toc { display: none; }
}
@media (max-width: 760px) {
  .doc-layout { grid-template-columns: 1fr; }
  .doc-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--doc-border);
  }
  .doc-main { padding: 20px; }
  .page-header-title span { display: none; }
}
