:root {
  --bg: #0e0e10;
  --bg-subtle: #161618;
  --bg-card: #1c1c1f;
  --border: #2a2a2d;
  --text: #e8e8ec;
  --text-muted: #8b8b94;
  --text-dim: #5c5c64;
  --accent: #7C6CFF;
  --accent-subtle: rgba(124, 108, 255, 0.08);
  --success: #22c55e;
  --warning: #eab308;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { background: var(--bg); color-scheme: dark; scrollbar-color: #2a2a2d #0e0e10; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #2a2a2d; border-radius: 6px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3a3a3f; }
::-webkit-scrollbar-corner { background: var(--bg); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { padding: 2px 6px; border-radius: 4px; background: var(--bg-subtle); border: 1px solid var(--border); font-size: 12px; font-family: 'SF Mono', 'Fira Code', monospace; }

/* Top nav */
.topnav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 16px;
  height: 52px; padding: 0 24px;
  background: rgba(14,14,16,0.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topnav img { width: 24px; height: 24px; }
.topnav .brand { font-size: 14px; font-weight: 600; color: var(--text); }
.topnav .sep { color: var(--text-dim); font-size: 13px; }
.topnav .title { font-size: 13px; color: var(--text-muted); }

/* Layout */
.layout { display: flex; min-height: calc(100vh - 52px); }

/* Sidebar */
.sidebar {
  width: 240px; padding: 16px 12px;
  border-right: 1px solid var(--border);
  position: sticky; top: 52px; height: calc(100vh - 52px);
  overflow-y: auto; flex-shrink: 0;
}
.sidebar-section { margin-bottom: 20px; }
.sidebar-heading {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text-dim);
  padding: 0 12px; margin-bottom: 4px;
}
.sidebar a {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 6px;
  font-size: 13px; color: var(--text-muted);
  text-decoration: none; transition: all 0.1s;
}
.sidebar a:hover { color: var(--text); background: var(--bg-subtle); }
.sidebar a.active { color: var(--text); background: var(--accent-subtle); font-weight: 500; }

/* Main */
.main { flex: 1; padding: 40px 60px 80px; max-width: 800px; }
/* Help Center home gets a wider column so the card grid reads as a
 * proper landing page rather than a narrow article. Cards expand to
 * three across at desktop widths. */
.main.home-main { max-width: 1120px; }
.main.home-main .cards-grid { grid-template-columns: repeat(2, 1fr); }
.page-title { font-size: 32px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 8px; line-height: 1.2; }
.page-desc { font-size: 15px; color: var(--text-muted); margin-bottom: 32px; }

h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; margin: 36px 0 12px; padding-top: 20px; border-top: 1px solid var(--border); }
h2:first-of-type { border-top: none; padding-top: 0; }
h3 { font-size: 16px; font-weight: 600; margin: 24px 0 8px; }
p { margin-bottom: 12px; font-size: 14px; color: var(--text-muted); }
ul, ol { margin: 0 0 16px 20px; font-size: 14px; color: var(--text-muted); }
li { margin-bottom: 6px; }
li strong { color: var(--text); font-weight: 500; }

/* Cards */
.cards-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 32px; }
.doc-card { padding: 20px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); transition: all 0.15s; cursor: pointer; text-decoration: none; }
.doc-card:hover { border-color: var(--text-dim); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); text-decoration: none; }
.doc-card .card-icon { font-size: 20px; margin-bottom: 10px; }
.doc-card .card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.doc-card .card-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* Callout */
.callout { padding: 14px 16px; border-radius: 8px; margin: 16px 0; font-size: 13px; line-height: 1.5; border-left: 3px solid; }
.callout.info { background: var(--accent-subtle); border-color: var(--accent); color: var(--text-muted); }
.callout.tip { background: rgba(34,197,94,0.06); border-color: var(--success); color: var(--text-muted); }
.callout.warn { background: rgba(234,179,8,0.06); border-color: var(--warning); color: var(--text-muted); }
.callout strong { color: var(--text); }

/* Table */
table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 13px; }
th { text-align: left; padding: 8px 12px; border-bottom: 2px solid var(--border); color: var(--text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text-muted); }
tr:hover td { background: var(--bg-subtle); }

/* Badge */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge.starter { background: rgba(59,130,246,0.1); color: #60a5fa; }
.badge.advanced { background: rgba(168,85,247,0.1); color: #c084fc; }
.badge.pro { background: rgba(234,179,8,0.1); color: #fbbf24; }
.badge.addon { background: rgba(34,197,94,0.1); color: #4ade80; }
.badge.free { background: rgba(255,255,255,0.06); color: var(--text-dim); }

/* Steps */
.steps { counter-reset: step; list-style: none; margin-left: 0; padding-left: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 36px; margin-bottom: 16px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent-subtle); color: var(--accent);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* Footer */
.doc-footer { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; font-size: 12px; color: var(--text-dim); }
.doc-footer a { color: var(--text-muted); }

/* Screenshots */
.screenshot {
  margin: 20px 0; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.screenshot img {
  width: 100%; height: auto; display: block;
}
.screenshot-caption {
  font-size: 12px; color: var(--text-dim); text-align: center;
  padding: 8px 12px; background: var(--bg-subtle); border-top: 1px solid var(--border);
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main { padding: 24px 20px 60px; }
  .cards-grid { grid-template-columns: 1fr; }
}

/* ── New-app additions (post-OpenClaw port) ─────────────────────────── */

/* Coming-soon sidebar entries. Dim, non-interactive cursor, small pill. */
.sidebar a.coming-soon {
  color: var(--text-dim);
  cursor: not-allowed;
  pointer-events: none;
}
.sidebar a.coming-soon:hover {
  background: transparent;
  color: var(--text-dim);
}
.sidebar a .soon {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* Brand wordmark in the topnav. nav.js replaces the legacy brand-mark
 * dot + "Dante AI" text combo with the full Dante logo SVG (circle +
 * "dante" wordmark). Sized to match the 52px topnav height. */
.topnav .brand-logo {
  display: block;
  height: 22px;
  width: auto;
  flex-shrink: 0;
}

/* Legacy fragment left in HTML for back-compat with hand-written pages
 * the auto-updater hasn't touched. nav.js removes these at runtime; the
 * CSS hide is a fallback for the brief flash before JS executes. */
.topnav .brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: conic-gradient(from 220deg, #10b981, #8b7eff, #f59e0b, #10b981);
  flex-shrink: 0;
  box-shadow: 0 0 0 2px var(--bg);
}

/* Top-nav "Back to app" button — soft pill on the right edge of the bar. */
.topnav .back-to-app {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  transition: color 120ms, border-color 120ms;
}
.topnav .back-to-app:hover {
  color: var(--text);
  border-color: var(--text-dim);
  text-decoration: none;
}

/* Screenshot placeholder (used while real PNGs are pending). Shown in
 * place of an <img> when the doc author hasn't dropped a screenshot in
 * yet. Kept neutral so it doesn't visually compete with the surrounding
 * paragraphs. */
.screenshot-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 12px;
  margin: 20px 0;
  padding: 24px;
  text-align: center;
}

/* Source-type quick-jump cards on the knowledge page. Inherits .doc-card
 * sizing but adds a per-card icon stripe that matches the in-app
 * Knowledge sub-route accent colours. */
.source-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 10px;
  background: var(--accent-subtle);
}

/* In-page screenshot of an in-app surface. Sized to fill the article
 * column with a soft border + rounded corners so the bitmap reads as
 * "embedded illustration" rather than "raw image dump". The fallback
 * `.screenshot-placeholder` (used on docs whose page hasn't been
 * captured yet) keeps its dashed-border look. */
.screenshot-img {
  display: block;
  width: 100%;
  height: auto;
  margin: 20px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Step-by-step illustrations embedded inline by the auto-updater. Each
 * figure is a 1440×900 PNG of the in-app surface at a specific step,
 * with a caption describing the matching instruction. Sized smaller than
 * the hero so multiple stack readably down the page. */
.step-figure {
  margin: 18px 0 22px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}
.step-figure .step-img,
.step-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  border-radius: 0;
  margin: 0;
}
.step-figure figcaption {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  padding: 10px 14px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

/* Inline product-section link replacing screenshot placeholders.
 * Shows a subtle pill with an arrow so readers can jump directly to
 * the relevant in-app surface rather than looking at a static image. */
.doc-open-link {
  margin: 16px 0 24px;
}
.doc-open-link a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  background: var(--accent-subtle);
  border: 1px solid rgba(124, 108, 255, 0.2);
  transition: background 120ms, border-color 120ms;
  text-decoration: none;
}
.doc-open-link a:hover {
  background: rgba(124, 108, 255, 0.14);
  border-color: var(--accent);
  text-decoration: none;
}

/* "Contact our team →" CTA shown at the bottom of every help-center page.
 * Pill-style button so it stands out from the surrounding paragraph copy
 * without being a noisy primary button. Mirrors the accent treatment used
 * across the in-app product. */
.contact-cta {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  background: var(--accent-subtle);
  border: 1px solid var(--accent);
  transition: background 120ms, transform 120ms;
}
.contact-cta:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  transform: translateY(-1px);
}

/* ── Help Center search ─────────────────────────────────────────────
 * Injected by nav.js into the topnav on every doc page. Anchors a
 * floating results panel below the input. Index lives at
 * /docs/search-index.json (built by build-docs-search-index.mjs). */

.topnav-search {
  position: relative;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  width: 320px;
  max-width: 38vw;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle);
  transition: border-color 120ms, background 120ms;
}
.topnav-search:focus-within {
  border-color: var(--accent);
  background: var(--bg);
}
.topnav-search .search-icon {
  display: inline-flex;
  color: var(--text-dim);
  flex-shrink: 0;
}
.topnav-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}
.topnav-search input::placeholder { color: var(--text-dim); }
.topnav-search input::-webkit-search-cancel-button { display: none; }

.search-kbd,
.search-foot kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 10px;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

/* "Back to app" already had margin-left:auto; cancel it now that the
 * search box owns the right edge alignment. */
.topnav .back-to-app { margin-left: 0; }

/* Results panel */
.search-results {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: max(420px, 100%);
  max-width: 92vw;
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
  z-index: 60;
}
.search-results[hidden] { display: none; }

.search-hint,
.search-empty {
  padding: 14px 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.search-empty strong { color: var(--text); }
.search-hint kbd { vertical-align: middle; margin: 0 2px; }

.search-result {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  transition: background 80ms;
}
.search-result:hover,
.search-result.active {
  background: var(--bg-subtle);
  text-decoration: none;
}
.search-result.active { outline: 1px solid var(--accent); }
.search-result-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.search-result-snippet {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  /* Truncate to two lines so long bodies don't blow the panel up. */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.search-results mark {
  background: rgba(124, 108, 255, 0.22);
  color: var(--text);
  padding: 0 2px;
  border-radius: 3px;
}
.search-foot {
  padding: 8px 12px 4px;
  border-top: 1px solid var(--border);
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .topnav-search { width: 200px; }
  .topnav-search .search-kbd { display: none; }
  .search-results { width: 92vw; right: -10px; }
}
