/* DGbot Docs Portal — Component Styles */

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

html { font-family: var(--f-sans); font-size: 16px; color: var(--t-primary); background: var(--s-base); -webkit-font-smoothing: antialiased; }

body { min-height: 100vh; font-size: 1rem; }

a { color: var(--ac-t); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── LAYOUT ─────────────────────────────────────────────────────── */
.doc-root {
  display: grid;
  grid-template-rows: var(--nav-h) 1fr;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  min-height: 100vh;
}
.doc-root.home-layout {
  grid-template-columns: 1fr;
}

.topbar {
  grid-column: 1 / -1;
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  background: var(--topbar-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--topbar-border);
  display: flex; align-items: center;
  padding: 0 28px;
  gap: 0;
}
.topbar-logo {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; flex-shrink: 0;
  margin-right: 28px;
}
.topbar-logo-text {
  font-size: 17px; font-weight: 700;
  color: var(--t-primary); letter-spacing: -0.4px;
}
.topbar-tabs {
  display: flex; align-items: stretch; gap: 0;
  flex: 1; height: 100%;
}
.topbar-tab {
  display: flex; align-items: center;
  padding: 0 14px;
  font-size: 13.5px; font-weight: 400;
  color: var(--t-tertiary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  border-top: none; border-left: none; border-right: none;
  background: none;
  text-decoration: none;
  white-space: nowrap;
}
.topbar-tab:hover { color: var(--t-primary); text-decoration: none; }
.topbar-tab.active { color: var(--t-primary); font-weight: 500; border-bottom-color: var(--ac); }
.topbar-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--s-raised);
  border: 1px solid var(--b-default);
  border-radius: var(--r-md);
  cursor: pointer; min-width: 180px;
  transition: border-color 0.15s;
}
.topbar-search:hover { border-color: var(--b-strong); }
.topbar-search-icon { color: var(--t-tertiary); width: 13px; height: 13px; flex-shrink: 0; }
.topbar-search-text { font-size: 13px; color: var(--t-tertiary); flex: 1; }
.topbar-search-kbd {
  font-size: 11px; color: var(--t-tertiary);
  background: var(--s-overlay); border: 1px solid var(--b-default);
  border-radius: var(--r-xs); padding: 1px 5px;
  font-family: var(--f-sans);
}
.topbar-icon-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); cursor: pointer;
  color: var(--t-tertiary); background: none; border: none;
  transition: color 0.15s, background 0.15s;
}
.topbar-icon-btn:hover { color: var(--t-primary); background: var(--s-overlay); }

.sidebar {
  background: var(--s-sidebar);
  border-right: 1px solid var(--b-subtle);
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto; overflow-x: hidden;
  padding: 16px 0 64px;
  scrollbar-width: thin;
  scrollbar-color: var(--b-default) transparent;
}
.sidebar::-webkit-scrollbar { width: 3px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--b-default); border-radius: 4px; }

.sidebar-section { margin-bottom: 0; }
.sidebar-section-label {
  padding: 28px 20px 8px;
  font-size: 13.5px; font-weight: 600;
  color: var(--t-primary);
  letter-spacing: -0.15px;
}
.sidebar-section-label:first-child { padding-top: 8px; }
.sidebar-items { display: flex; flex-direction: column; gap: 0; padding: 2px 12px; }
.sidebar-item {
  display: flex; align-items: center;
  padding: 8px 10px 8px 10px;
  border-radius: var(--r-md);
  font-size: 13.5px; font-weight: 400;
  color: var(--t-secondary);
  cursor: pointer; text-decoration: none;
  transition: color 0.12s, background 0.12s;
  line-height: 1.4;
}
.sidebar-item:hover { color: var(--t-primary); background: var(--s-overlay); text-decoration: none; }
.sidebar-item.active { color: var(--ac-t); background: var(--ac-s); font-weight: 500; }
.sidebar-item-title { flex: 1; }
.sidebar-badge {
  font-size: 10px; font-weight: 500;
  padding: 1px 7px; border-radius: 9999px; flex-shrink: 0;
}
.sidebar-badge.soon { background: var(--s-overlay); color: var(--t-tertiary); border: 1px solid var(--b-default); }
.sidebar-badge.new  { background: var(--ac-s); color: var(--ac-t); border: 1px solid var(--ac-b); }
.sidebar-divider { height: 1px; background: var(--b-subtle); margin: 12px 20px; }

/* ── CONTENT PANE ────────────────────────────────────────────────── */
.content-wrap {
  min-width: 0;
  padding: 40px 56px 64px 56px;
}
.content-inner { max-width: var(--content-max); }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--t-tertiary);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--t-tertiary); text-decoration: none; }
.breadcrumb a:hover { color: var(--t-secondary); text-decoration: none; }
.breadcrumb-sep { color: var(--b-strong); }

/* Page title */
.page-title {
  font-size: 30px; font-weight: 600; color: var(--t-primary);
  letter-spacing: -0.6px; line-height: 1.2;
  margin-bottom: 12px;
}
.page-promise {
  font-size: 16px; color: var(--t-secondary);
  line-height: 1.7; margin-bottom: 18px;
}
.page-meta {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px; flex-wrap: wrap;
}
.page-meta-item {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--t-tertiary);
}
.page-meta-item svg { width: 13px; height: 13px; }

/* Plan badges */
.plan-badge {
  font-size: 10.5px; font-weight: 500;
  padding: 2px 8px; border-radius: var(--r-full, 9999px);
  border: 1px solid;
}
.plan-badge.free    { color: var(--success-t); background: var(--success-s); border-color: var(--success-b); }
.plan-badge.starter { color: var(--info-t);    background: var(--info-s);    border-color: var(--info-b); }
.plan-badge.pro     { color: var(--tip-t);     background: var(--tip-s);     border-color: var(--tip-b); }
.plan-badge.max     { color: var(--warning-t); background: var(--warning-s); border-color: var(--warning-b); }
.plan-badge.soon    { color: var(--t-tertiary); background: var(--s-overlay); border-color: var(--b-default); }

/* Section headings */
.section-divider { border: none; border-top: 1px solid var(--b-subtle); margin: 32px 0; }
h2.section-heading { font-size: 20px; font-weight: 600; color: var(--t-primary); letter-spacing: -0.4px; margin-bottom: 14px; }
h3.sub-heading { font-size: 16px; font-weight: 600; color: var(--t-primary); margin-bottom: 10px; margin-top: 24px; }

/* Body text */
.prose p { font-size: 15px; line-height: 1.8; color: var(--t-primary); margin-bottom: 18px; }
.prose ul, .prose ol { font-size: 15px; line-height: 1.8; color: var(--t-primary); padding-left: 22px; margin-bottom: 18px; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: var(--f-mono); font-size: 13px; background: var(--s-overlay); color: var(--t-primary); padding: 2px 5px; border-radius: var(--r-xs); border: 1px solid var(--b-default); }

/* ── STEP COMPONENT ──────────────────────────────────────────────── */
.steps { display: flex; flex-direction: column; }
.step {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 20px;
  position: relative;
  padding-bottom: 40px;
}
.step:last-child { padding-bottom: 0; }
.step-track {
  display: flex; flex-direction: column; align-items: center;
  position: relative;
}
.step-num {
  width: 28px; height: 28px; flex-shrink: 0;
  background: var(--s-overlay); border: 1.5px solid var(--b-default);
  color: var(--t-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 500; font-family: var(--f-mono);
  position: relative; z-index: 1;
}
.step-line {
  position: absolute;
  top: 28px;       /* starts right below the circle */
  bottom: -40px;   /* extends into the next step's padding */
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: var(--b-default);
}
.step:last-child .step-line { display: none; }
.step-body { min-width: 0; padding-top: 2px; }
.step-title { font-size: 16px; font-weight: 600; color: var(--t-primary); margin-bottom: 10px; margin-top: 2px; line-height: 1.4; }
.step-content { font-size: 15px; line-height: 1.8; color: var(--t-primary); }
.step-content p { margin-bottom: 14px; }
.step-content p:last-child { margin-bottom: 0; }

/* ── CALLOUTS ────────────────────────────────────────────────────── */
.callout {
  display: flex; align-items: baseline; gap: 8px;
  padding: 9px 14px;
  border-radius: var(--r-md);
  border: 1px solid;
  margin: 14px 0;
  font-size: 13.5px; line-height: 1.55;
}
.callout-icon { width: 14px; height: 14px; flex-shrink: 0; position: relative; top: 2px; }
.callout-body { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; }
.callout-title { font-weight: 600; font-size: 13px; white-space: nowrap; }
.callout-title::after { content: " —"; font-weight: 400; margin-right: 2px; }
.callout-text { font-size: 13px; line-height: 1.55; }
.callout.info    { background: var(--info-s);    border-color: var(--info-b);    color: var(--info-t); }
.callout.tip     { background: var(--tip-s);     border-color: var(--tip-b);     color: var(--tip-t); }
.callout.warning { background: var(--warning-s); border-color: var(--warning-b); color: var(--warning-t); }
.callout.danger  { background: var(--danger-s);  border-color: var(--danger-b);  color: var(--danger-t); }
.callout.note    { background: var(--s-raised);  border-color: var(--b-default); color: var(--t-secondary); }
.callout.success { background: var(--success-s); border-color: var(--success-b); color: var(--success-t); }

/* ── CODE BLOCKS ─────────────────────────────────────────────────── */
.code-block {
  border: 1px solid var(--b-default);
  border-radius: var(--r-lg);
  overflow: hidden; margin: 16px 0;
  background: var(--s-base);
}
.code-header {
  display: flex; align-items: flex-end;
  background: var(--s-base);
  padding: 0 10px 0 4px;
  border-bottom: 1px solid var(--b-default);
}
.code-lang-tabs { display: flex; gap: 0; flex: 1; }
.code-lang-tab {
  padding: 9px 12px;
  font-size: 12.5px; font-weight: 400;
  color: var(--t-tertiary);
  border: none; background: none; cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.12s;
  white-space: nowrap;
}
.code-lang-tab:hover { color: var(--t-secondary); }
.code-lang-tab.active { color: var(--ac-t); border-bottom-color: var(--ac); font-weight: 500; }
.code-copy-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 7px 8px 9px;
  color: var(--t-tertiary); background: none; border: none;
  font-size: 12px; font-family: var(--f-sans);
  cursor: pointer; white-space: nowrap;
  transition: color 0.12s;
}
.code-copy-btn:hover { color: var(--t-secondary); }
.code-copy-btn svg { width: 12px; height: 12px; flex-shrink: 0; }
.code-body { background: var(--code-bg); padding: 18px 20px; overflow-x: auto; }
.code-body pre { margin: 0; font-family: var(--f-mono); font-size: 12.5px; line-height: 1.7; color: var(--code-fg); }
/* Syntax highlight */
.code-body .k { color: #a78bfa; }
.code-body .s { color: #5eead4; }
.code-body .c { color: rgba(255,255,255,0.28); font-style: italic; }
.code-body .n { color: #ff8a65; }
.code-body .v { color: #f0eef8; }
.code-body .p { color: rgba(255,255,255,0.45); }

/* ── ADMIN DEEP-LINK BUTTON ──────────────────────────────────────── */
.admin-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background-color: var(--s-raised);
  border: 1px solid var(--b-default);
  border-radius: var(--r-md); font-size: 11.5px; font-weight: 400;
  color: var(--t-tertiary);
  text-decoration: none;
  cursor: pointer; transition: border-color 0.15s, color 0.15s, background-color 0.15s;
  margin: 8px 0;
}
.admin-link:hover { border-color: var(--ac-b); color: var(--ac-t); background-color: var(--ac-s); text-decoration: none; }
.admin-link svg { width: 11px; height: 11px; opacity: 0.5; flex-shrink: 0; }

/* ── SCREENSHOT PLACEHOLDER ──────────────────────────────────────── */
.screenshot-wrap { margin: 16px 0; }
.screenshot-placeholder {
  width: 100%; border-radius: var(--r-lg);
  border: 1.5px dashed var(--b-default);
  background: repeating-linear-gradient(
    45deg, var(--s-raised), var(--s-raised) 4px,
    var(--s-overlay) 4px, var(--s-overlay) 8px
  );
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 40px 20px; text-align: center;
}
.screenshot-placeholder-label { font-size: 12px; font-family: var(--f-mono); color: var(--t-tertiary); }
.screenshot-placeholder-sub { font-size: 11.5px; color: var(--t-tertiary); }
.screenshot-caption { font-size: 12px; color: var(--t-tertiary); margin-top: 8px; line-height: 1.5; }
.screenshot-caption b { color: var(--t-secondary); font-weight: 500; }

/* ── CONTENT TABS ────────────────────────────────────────────────── */
.content-tabs-nav {
  display: flex; gap: 0;
  border-bottom: 1.5px solid var(--b-default);
  margin-bottom: 16px;
}
.content-tab-btn {
  padding: 8px 16px; font-size: 13.5px; font-weight: 400;
  color: var(--t-tertiary); background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -1.5px;
  cursor: pointer; transition: color 0.12s;
}
.content-tab-btn.active { color: var(--ac-t); border-bottom-color: var(--ac); font-weight: 500; }
.content-tab-btn:hover:not(.active) { color: var(--t-secondary); }
.content-tab-pane { display: none; }
.content-tab-pane.active { display: block; }

/* ── RIGHT TOC ───────────────────────────────────────────────────── */
.toc {
  position: sticky; top: var(--nav-h);
  height: calc(100vh - var(--nav-h));
  overflow-y: auto; overflow-x: hidden;
  padding: 28px 16px 40px;
  font-size: 12.5px;
  scrollbar-width: thin;
  scrollbar-color: var(--b-default) transparent;
}
.toc-label {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.7px;
  color: var(--t-tertiary); margin-bottom: 10px;
}
.toc-items { display: flex; flex-direction: column; gap: 2px; margin-bottom: 24px; }
.toc-item {
  display: block; padding: 4px 8px;
  color: var(--t-tertiary); text-decoration: none;
  border-left: 2px solid transparent;
  font-size: 12.5px; line-height: 1.5;
  transition: color 0.12s, border-color 0.12s;
}
.toc-item:hover { color: var(--t-secondary); text-decoration: none; }
.toc-item.active { color: var(--ac-t); border-left-color: var(--ac); }
.toc-item.h3 { padding-left: 16px; font-size: 12px; }
.toc-footer { border-top: 1px solid var(--b-subtle); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.toc-footer a { font-size: 12px; color: var(--t-tertiary); text-decoration: none; display: flex; align-items: center; gap: 5px; }
.toc-footer a:hover { color: var(--t-secondary); text-decoration: none; }
.toc-footer svg { width: 12px; height: 12px; }

/* ── FEEDBACK + ASK AI ───────────────────────────────────────────── */
.page-footer-zone { margin-top: 48px; border-top: 1px solid var(--b-subtle); padding-top: 32px; }
.feedback-row {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 20px;
}
.feedback-label { font-size: 13px; color: var(--t-secondary); }
.feedback-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--r-md);
  font-size: 13px; background: var(--s-raised);
  border: 1px solid var(--b-default); cursor: pointer;
  color: var(--t-secondary); transition: border-color 0.15s, background 0.15s;
}
.feedback-btn:hover { border-color: var(--b-strong); background: var(--s-overlay); }
.ask-ai-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--s-raised);
  border: 1.5px solid var(--b-default);
  border-radius: var(--r-lg);
  cursor: text;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.ask-ai-bar:hover { border-color: var(--ac-b); box-shadow: 0 0 0 3px var(--ac-s); }
.ask-ai-bar svg.sparkle { width: 16px; height: 16px; color: var(--ac-t); flex-shrink: 0; }
.ask-ai-input-placeholder { flex: 1; font-size: 13.5px; color: var(--t-tertiary); }
.ask-ai-shortcut {
  font-size: 11px; font-family: var(--f-sans); color: var(--t-tertiary);
  background: var(--s-overlay); border: 1px solid var(--b-default);
  border-radius: var(--r-xs); padding: 2px 6px;
}
.ask-ai-send {
  width: 28px; height: 28px;
  background: var(--ac); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: none; flex-shrink: 0;
  transition: background 0.15s;
}
.ask-ai-send:hover { background: var(--ac-h); }
.ask-ai-send svg { width: 13px; height: 13px; color: #fff; }
.edit-links { display: flex; gap: 16px; margin-top: 16px; }
.edit-links a { font-size: 12px; color: var(--t-tertiary); text-decoration: none; display: flex; align-items: center; gap: 4px; }
.edit-links a:hover { color: var(--t-secondary); text-decoration: none; }
.edit-links svg { width: 12px; height: 12px; }

/* ── PREV / NEXT ─────────────────────────────────────────────────── */
.prev-next {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px; margin-top: 40px;
}
/* When only one card exists: still use 2-col grid but place correctly */
.prev-next-next-only { grid-column: 2; }
.prev-next-card {
  padding: 16px 20px; border-radius: var(--r-lg);
  border: 1px solid var(--b-default);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
  display: flex; flex-direction: column; gap: 4px;
}
.prev-next-card:hover { border-color: var(--ac-b); background: var(--ac-s); text-decoration: none; }
.prev-next-dir { font-size: 11.5px; color: var(--t-tertiary); display: flex; align-items: center; gap: 4px; }
.prev-next-dir svg { width: 12px; height: 12px; }
.prev-next-title { font-size: 14px; font-weight: 500; color: var(--ac-t); }
.prev-next-card.next { text-align: right; }

/* ── HOME PAGE ───────────────────────────────────────────────────── */
.home-wrap { max-width: 920px; margin: 0 auto; padding: 64px 32px 80px; }
.home-hero { text-align: center; margin-bottom: 56px; }
.home-hero h1 {
  font-size: 40px; font-weight: 500; color: var(--t-primary);
  letter-spacing: -1px; margin-bottom: 14px; line-height: 1.15;
}
.home-hero p { font-size: 16px; color: var(--t-secondary); line-height: 1.65; margin-bottom: 28px; max-width: 480px; margin-left: auto; margin-right: auto; }
.home-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; background: var(--ac); color: #fff;
  border-radius: var(--r-md); font-size: 14px; font-weight: 500;
  text-decoration: none; transition: background 0.15s, box-shadow 0.15s;
}
.home-cta:hover { background: var(--ac-h); box-shadow: 0 4px 16px var(--ac-b); text-decoration: none; }
.home-section-label {
  font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--t-tertiary); margin-bottom: 20px;
}
.intent-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 56px; }
.intent-card {
  padding: 24px; border-radius: var(--r-xl);
  border: 1px solid var(--b-default);
  cursor: pointer; text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
  background: var(--s-base);
}
.intent-card:hover { border-color: var(--b-strong); box-shadow: var(--sh-md); transform: translateY(-2px); text-decoration: none; }
.intent-card-icon {
  width: 36px; height: 36px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px; font-size: 18px;
}
.intent-card-title { font-size: 14px; font-weight: 500; color: var(--t-primary); margin-bottom: 6px; }
.intent-card-desc { font-size: 13px; color: var(--t-secondary); line-height: 1.55; }
.cap-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 56px; }
.cap-card {
  padding: 20px; border-radius: var(--r-lg);
  border: 1px solid var(--b-subtle);
  background: var(--s-raised);
}
.cap-card-icon { font-size: 20px; margin-bottom: 10px; }
.cap-card-title { font-size: 13.5px; font-weight: 500; color: var(--t-primary); margin-bottom: 5px; }
.cap-card-desc { font-size: 12.5px; color: var(--t-secondary); line-height: 1.55; }
.guide-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 48px; }
.guide-card {
  padding: 20px 22px; border-radius: var(--r-lg);
  border: 1px solid var(--b-default); background: var(--s-base);
  text-decoration: none; display: flex; flex-direction: column; gap: 8px;
  transition: border-color 0.15s, background 0.15s;
}
.guide-card:hover { border-color: var(--ac-b); background: var(--ac-s); text-decoration: none; }
.guide-card-title { font-size: 14px; font-weight: 500; color: var(--t-primary); }
.guide-card-meta { display: flex; align-items: center; gap: 10px; }
.guide-card-time { font-size: 12px; color: var(--t-tertiary); }
.guide-card-tag {
  font-size: 11px; color: var(--t-tertiary);
  background: var(--s-overlay); padding: 2px 7px; border-radius: var(--r-full, 9999px);
  border: 1px solid var(--b-subtle);
}
.home-footer-row {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 24px; border-top: 1px solid var(--b-subtle);
}
.home-footer-link { font-size: 13.5px; color: var(--ac-t); text-decoration: none; display: flex; align-items: center; gap: 5px; }
.home-footer-link:hover { text-decoration: underline; }

/* ── INSIGHT / RECOMMENDATION BOX ───────────────────────────────── */
.insight-box {
  position: relative; overflow: hidden;
  padding: 16px 18px 18px;
  border-radius: var(--r-lg);
  border: 1px solid var(--ac-b);
  background: var(--ac-s);
  margin: 20px 0;
}
.insight-box::before {
  content: ''; position: absolute;
  top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--ac), transparent);
}
.insight-box-header {
  display: flex; align-items: center; gap: 7px;
  margin-bottom: 8px;
}
.insight-box-header svg { width: 15px; height: 15px; color: var(--ac-t); flex-shrink: 0; }
.insight-box-label {
  font-size: 11px; font-weight: 500;
  color: var(--ac-t); text-transform: uppercase; letter-spacing: 0.6px;
}
.insight-box-title {
  font-size: 14px; font-weight: 500;
  color: var(--t-primary); margin-bottom: 7px; line-height: 1.4;
}
.insight-box-body {
  font-size: 13.5px; color: var(--t-secondary); line-height: 1.65;
}
.insight-box-body a { color: var(--ac-t); }
.insight-box-actions { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.insight-box-action {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 14px; border-radius: var(--r-md);
  font-size: 12.5px; font-weight: 500;
  background: var(--ac); color: #fff;
  border: none; cursor: pointer; text-decoration: none;
  transition: background 0.15s;
}
.insight-box-action:hover { background: var(--ac-h); text-decoration: none; }
.insight-box-action.ghost {
  background: transparent; color: var(--ac-t);
  border: 1px solid var(--ac-b);
}
.insight-box-action.ghost:hover { background: var(--ac-s); }
.completion-card {
  padding: 12px 16px; border-radius: var(--r-lg);
  background: var(--success-s); border: 1px solid var(--success-b);
  margin: 24px 0;
}
.completion-card-title { font-size: 13px; font-weight: 600; color: var(--success-t); margin-bottom: 4px; display: flex; align-items: center; gap: 7px; }
.completion-card-title svg { width: 14px; height: 14px; flex-shrink: 0; }
.completion-card-body { font-size: 13px; color: var(--success-t); line-height: 1.55; }

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
/* Mobile-only elements: hidden on desktop */
.sidebar-mobile-tabs { display: none; }
.topbar-hamburger { display: none; }

/* Tablet: hide right TOC */
@media (max-width: 1100px) {
  .doc-root { grid-template-columns: var(--sidebar-w) 1fr; }
  .toc { display: none; }
  .content-wrap { padding: 32px 40px 56px; }
}

/* Mobile: single column, sidebar off-canvas */
@media (max-width: 768px) {
  /* Allow body to grow with content but prevent grid blow-out */
  html, body { width: 100%; overflow-x: hidden; }

  /* Collapse to single column */
  .doc-root {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--nav-h) 1fr;
  }

  /* Sidebar: off-canvas drawer */
  .sidebar {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0;
    bottom: 0;
    width: 280px;
    max-width: 85vw;
    z-index: 200;
    overflow-y: auto;
    box-shadow: 4px 0 24px rgba(0,0,0,0.08);
    background: var(--s-base);
    padding: 16px 0;
  }
  .sidebar.sidebar-open { display: block; }

  /* Sidebar backdrop */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 199;
  }
  .sidebar-backdrop.active { display: block; }

  /* Content pane */
  main.content-wrap {
    min-width: 0;
    padding: 20px 16px 48px;
    overflow-wrap: break-word;
    word-wrap: break-word;
  }
  .content-inner {
    max-width: 100%;
    min-width: 0;
  }

  /* Topbar: [☰] [logo] [────auto spacer────] [🔍] [☾] */
  .topbar {
    padding: 0 12px;
    gap: 4px;
  }
  .topbar-logo { margin-right: 0; }
  .topbar-logo-text { font-size: 15px; }
  .topbar-divider { display: none; }
  .topbar-tabs { display: none; }
  .topbar-search-text, .topbar-search-kbd { display: none; }
  .topbar-search {
    padding: 7px 9px;
    min-width: 0;
  }
  /* Push search + theme to the far right */
  .topbar-right { margin-left: auto; }
  .topbar-hamburger { display: flex; flex-shrink: 0; }
  /* Make theme toggle always visible — show a visible icon via CSS fallback */
  .topbar-icon-btn#theme-toggle {
    color: var(--t-secondary);
    border: 1px solid var(--b-default);
    width: 34px; height: 34px;
  }

  /* Mobile tabs at top of sidebar drawer */
  .sidebar-mobile-tabs {
    display: flex; flex-direction: column;
    padding: 0 16px 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--b-subtle);
  }
  .sidebar-mobile-tabs a {
    padding: 10px 12px;
    font-size: 14px; font-weight: 500;
    color: var(--t-secondary);
    border-radius: var(--r-md);
    text-decoration: none;
  }
  .sidebar-mobile-tabs a:hover { background: var(--s-overlay); }

  /* Home page */
  .home-wrap { padding: 32px 16px 56px; }
  .home-hero h1 { font-size: 28px; line-height: 1.2; }
  .home-hero p { font-size: 15px; }
  .home-cta { font-size: 14px; padding: 10px 20px; }
  .intent-cards, .cap-cards { grid-template-columns: 1fr; gap: 12px; }
  .guide-cards { grid-template-columns: 1fr; gap: 12px; }

  /* Page header */
  .page-title { font-size: 24px; line-height: 1.25; }
  .page-promise { font-size: 14.5px; }
  h2.section-heading { font-size: 18px; }
  h3.sub-heading { font-size: 15px; }
  .breadcrumb { font-size: 12px; flex-wrap: wrap; }

  /* Prose */
  .prose p, .prose ul, .prose ol { font-size: 14.5px; line-height: 1.7; }
  .prose ul, .prose ol { padding-left: 18px; }

  /* Steps */
  .step { grid-template-columns: 24px minmax(0, 1fr); gap: 0 12px; padding-bottom: 32px; }
  .step-num { width: 24px; height: 24px; font-size: 11px; }
  .step-line { top: 24px; bottom: -32px; }
  .step-title { font-size: 15px; }
  .step-content { font-size: 14.5px; }
  .step-body { min-width: 0; }

  /* Prev/Next stacks */
  .prev-next { grid-template-columns: 1fr; gap: 10px; }

  /* Code blocks: contained, internal scroll */
  .code-block { max-width: 100%; overflow: hidden; }
  .code-body { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .code-body pre { min-width: 0; }
  .prose code { word-break: break-word; }

  /* Tables: horizontal scroll wrapper */
  .prose table, .content-inner table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Screenshots */
  .screenshot-wrap { max-width: 100%; }
  .screenshot-wrap img,
  .screenshot-placeholder { max-width: 100%; width: 100%; box-sizing: border-box; }
  .screenshot-placeholder-label { font-size: 11px; word-break: break-all; }
  .screenshot-placeholder-sub { font-size: 10.5px; word-break: break-all; }

  /* Misc compact */
  .admin-link { font-size: 12px; }
  .page-meta { gap: 8px; flex-wrap: wrap; }
  .callout { padding: 8px 12px; font-size: 13px; }
}

/* Very small phones */
@media (max-width: 380px) {
  main.content-wrap { padding: 16px 12px 40px; }
  .page-title { font-size: 22px; }
  .home-hero h1 { font-size: 24px; }
}

/* ── Coming Soon Pages ──────────────────────────────────────────── */
.cs-hero {
  text-align: center;
  padding: 72px 32px 40px;
  max-width: 520px;
  margin: 0 auto;
}
.cs-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 14px; border-radius: 9999px;
  font-size: 12px; font-weight: 500;
  background: var(--warning-s); color: var(--warning-t); border: 1px solid var(--warning-b);
  margin-bottom: 28px;
}
.cs-hero h1 {
  font-size: 34px; font-weight: 500;
  color: var(--t-primary); letter-spacing: -0.6px;
  margin-bottom: 14px;
}
.cs-hero p {
  font-size: 15px; color: var(--t-secondary); line-height: 1.7;
}
.cs-preview {
  max-width: 580px; margin: 8px auto 40px; padding: 0 32px;
}
.cs-feature-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 40px;
}
.cs-feature-card {
  padding: 18px 20px; border-radius: var(--r-lg);
  border: 1px solid var(--b-subtle); background: var(--s-raised);
  opacity: 0.7;
}
.cs-feature-card-icon { font-size: 20px; margin-bottom: 8px; }
.cs-feature-card-title {
  font-size: 13.5px; font-weight: 500;
  color: var(--t-primary); margin-bottom: 4px;
}
.cs-feature-card-desc {
  font-size: 12.5px; color: var(--t-secondary); line-height: 1.55;
}
.cs-divider {
  border: none; border-top: 1px solid var(--b-subtle);
  margin: 0 32px 36px; max-width: 516px;
}
.cs-notify {
  max-width: 420px; margin: 0 auto;
  padding: 0 32px 72px; text-align: center;
}
.cs-notify h2 {
  font-size: 16px; font-weight: 500;
  color: var(--t-primary); margin-bottom: 8px;
}
.cs-notify p {
  font-size: 13.5px; color: var(--t-secondary);
  margin-bottom: 20px; line-height: 1.6;
}
.notify-input-row { display: flex; gap: 8px; }
.notify-email {
  flex: 1; padding: 9px 14px;
  border: 1px solid var(--b-default); border-radius: var(--r-md);
  font-size: 13.5px; font-family: var(--f-sans);
  color: var(--t-primary); background: var(--s-base);
  outline: none; transition: border-color 0.15s;
}
.notify-email:focus {
  border-color: var(--ac);
  box-shadow: 0 0 0 3px var(--ac-s);
}
.notify-email::placeholder { color: var(--t-tertiary); }
.notify-btn {
  padding: 9px 18px;
  background: var(--ac); color: #fff;
  border: none; border-radius: var(--r-md);
  font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  font-family: var(--f-sans);
  transition: background 0.15s;
}
.notify-btn:hover { background: var(--ac-h); }
.notify-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.notify-success {
  font-size: 13.5px; color: var(--success-t);
  padding: 10px 16px; background: var(--success-s);
  border: 1px solid var(--success-b);
  border-radius: var(--r-md); margin-top: 12px;
}

/* ── API Reference Stub Page ────────────────────────────────────── */
.api-hero {
  text-align: center;
  padding: 64px 32px 48px;
  max-width: 560px;
  margin: 0 auto;
}
.api-phase-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: 9999px;
  font-size: 11.5px; font-weight: 500;
  background: var(--info-s); color: var(--info-t); border: 1px solid var(--info-b);
  margin-bottom: 24px;
}
.api-phase-badge svg { width: 12px; height: 12px; }
.api-hero h1 {
  font-size: 32px; font-weight: 500;
  color: var(--t-primary); letter-spacing: -0.6px;
  margin-bottom: 14px; line-height: 1.2;
}
.api-hero p {
  font-size: 15px; color: var(--t-secondary);
  line-height: 1.7; margin-bottom: 0;
}
.api-endpoints-preview {
  max-width: 640px; margin: 0 auto 48px; padding: 0 32px;
}
.endpoint-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-md); margin-bottom: 8px;
  background: var(--s-raised); opacity: 0.6;
}
.endpoint-method {
  font-family: var(--f-mono);
  font-size: 11px; font-weight: 500;
  padding: 2px 8px; border-radius: var(--r-xs);
  flex-shrink: 0; min-width: 40px; text-align: center;
}
.method-get  { background: #dcfce7; color: #15803d; }
.method-post { background: #dbeafe; color: #1d4ed8; }
.method-del  { background: #fee2e2; color: #b91c1c; }
.endpoint-path {
  font-family: var(--f-mono); font-size: 12.5px;
  color: var(--t-secondary); flex: 1;
}
.endpoint-desc { font-size: 12px; color: var(--t-tertiary); }
.api-what-section {
  max-width: 640px; margin: 0 auto 56px; padding: 0 32px;
}
.api-what-section h3 {
  font-size: 13px; font-weight: 500;
  color: var(--t-tertiary); text-transform: uppercase;
  letter-spacing: 0.6px; margin-bottom: 16px;
}
.api-feature-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.api-feature-card {
  padding: 16px 18px;
  border: 1px solid var(--b-subtle);
  border-radius: var(--r-lg);
  background: var(--s-raised);
}
.api-feature-card-title {
  font-size: 13px; font-weight: 500;
  color: var(--t-primary); margin-bottom: 4px;
  display: flex; align-items: center; gap: 6px;
}
.api-feature-card-desc {
  font-size: 12.5px; color: var(--t-secondary); line-height: 1.55;
}

@media (max-width: 768px) {
  .cs-feature-grid, .api-feature-grid { grid-template-columns: 1fr; }
}
