/* ── Two-column docs layout ── */
.docs-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 4rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 2rem 6rem;
  align-items: start;
}

/* ── Sidebar ── */
.docs-sidebar {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding-bottom: 2rem;
}
.docs-nav { display: flex; flex-direction: column; }
.docs-nav-section { margin-bottom: 1.5rem; }
.docs-nav-heading {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
  padding-left: 0.75rem;
}
.docs-nav a {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.25rem 0.75rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  transition: color 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.docs-nav a:hover { color: var(--cream); }
.docs-nav a.active {
  color: var(--red);
  border-left-color: var(--red);
}
.docs-nav-sub { padding-left: 0.75rem; }
.docs-nav-sub a {
  font-size: 0.78rem;
  padding: 0.2rem 0.75rem;
}

/* ── Content ── */
.docs-content {
  min-width: 0;
  max-width: 720px;
}
.docs-content h1 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--cream);
  margin-bottom: 0.5rem;
}
.docs-content h1 em { font-style: normal; color: var(--red); }
.docs-lead {
  font-size: 1.05rem;
  color: var(--muted);
  font-weight: 300;
  margin-bottom: 3.5rem;
}
.docs-section { margin-bottom: 4rem; padding-top: 1rem; }
.docs-section-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.5rem;
}
.docs-content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cream);
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.docs-content h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--cream);
  margin: 1.75rem 0 0.6rem;
}
.docs-content p {
  font-size: 0.925rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 0.75rem;
}
.docs-content p:last-child { margin-bottom: 0; }
.docs-content strong { color: var(--cream); font-weight: 600; }
.docs-content code {
  font-family: 'DM Mono', monospace;
  font-size: 0.8rem;
  color: var(--red);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 0.15rem 0.45rem;
}
.docs-content a { color: var(--red); }
.docs-content a:hover { color: var(--cream); }

/* ── Callout box ── */
.docs-callout {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--red);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
}
.docs-callout p { margin-bottom: 0; }

/* ── Setup step list ── */
.setup-steps { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; margin: 1rem 0; }
.setup-step {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--surface); padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.setup-step:last-child { border-bottom: none; }
.setup-step-n {
  flex-shrink: 0;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--red);
  margin-top: 0.2rem;
  min-width: 1.5rem;
}
.setup-step-body strong { display: block; font-size: 0.9rem; color: var(--cream); margin-bottom: 0.25rem; }
.setup-step-body span { font-size: 0.85rem; color: var(--muted); font-weight: 300; line-height: 1.6; }

/* ── Command groups ── */
.docs-cmd-group { margin-bottom: 2.5rem; }
.docs-cmd-group-label {
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 0.75rem;
}
.docs-cmd-list {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.docs-cmd-row {
  display: grid;
  grid-template-columns: 210px 1fr;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.docs-cmd-row:last-child { border-bottom: none; }
.docs-cmd-name {
  padding: 0.9rem 1.1rem;
  border-right: 1px solid var(--border);
}
.docs-cmd-name code {
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--red);
  background: var(--code-bg);
  border: 1px solid var(--code-border);
  border-radius: 4px;
  padding: 0.2rem 0.45rem;
  white-space: nowrap;
}
.docs-cmd-name .docs-cmd-args {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: 0.68rem;
  color: var(--muted);
  margin-top: 0.3rem;
}
.docs-cmd-detail { padding: 0.9rem 1.1rem; }
.docs-cmd-detail p { font-size: 0.85rem; color: var(--muted); font-weight: 300; margin-bottom: 0.4rem; }
.docs-cmd-detail p:last-child { margin-bottom: 0; }
.docs-cmd-example {
  font-family: 'DM Mono', monospace;
  font-size: 0.73rem;
  color: var(--muted);
  background: var(--bg);
  border-radius: 4px;
  padding: 0.3rem 0.55rem;
  display: inline-block;
  margin-top: 0.25rem;
}
.docs-cmd-example::before { content: "e.g. "; }

/* ── Day-to-day conversation demo ── */
.convo { display: flex; flex-direction: column; gap: 0.5rem; margin: 1rem 0 1.5rem; }
.msg {
  display: inline-block; max-width: 88%;
  padding: 0.55rem 0.9rem; border-radius: 10px;
  font-size: 0.85rem; line-height: 1.5;
}
.msg-user {
  background: var(--red); color: #fff;
  align-self: flex-end; border-bottom-right-radius: 3px;
}
.msg-bot {
  background: var(--surface); border: 1px solid var(--border);
  align-self: flex-start; border-bottom-left-radius: 3px; color: var(--cream);
}
.msg-wrap { display: flex; flex-direction: column; }
.msg-wrap.right { align-items: flex-end; }

/* ── Tips list ── */
.tips-list { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1rem; }
.tip-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  font-size: 0.9rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.6;
}
.tip-item strong { color: var(--cream); }

/* ── Mobile: hide sidebar, show toggle ── */
.docs-mobile-nav {
  display: none;
  position: sticky;
  top: 4.5rem;
  z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.5rem;
}
.docs-mobile-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.75rem;
  font-family: 'DM Mono', monospace;
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
}
.docs-sidebar-mobile {
  display: none;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem 1.5rem;
  position: sticky;
  top: calc(4.5rem + 37px); /* 37px = docs-mobile-toggle height */
  z-index: 4;
  max-height: 60vh;
  overflow-y: auto;
}
.docs-sidebar-mobile.open { display: block; }

/* ── Guide section lists ── */
.docs-content ul {
  margin: 0.5rem 0 1rem 1.25rem;
  padding: 0;
}
.docs-content li {
  font-size: 0.925rem;
  color: var(--muted);
  font-weight: 300;
  line-height: 1.7;
  margin-bottom: 0.4rem;
}
.docs-content li strong { color: var(--cream); font-weight: 600; }

/* ── /setplan annotated prompt block ── */
.docs-prompt-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin: 1rem 0 1.5rem;
}
.docs-prompt-cmd {
  font-family: 'DM Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--red);
  background: color-mix(in srgb, var(--red) 8%, var(--surface));
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 1.25rem;
}
.docs-prompt-rows { display: flex; flex-direction: column; }
.docs-prompt-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.55rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.docs-prompt-row:last-child { border-bottom: none; }
.docs-prompt-tag {
  font-family: 'DM Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--red);
  white-space: nowrap;
  padding-top: 0.05rem;
}
.docs-prompt-text {
  font-size: 0.875rem;
  color: var(--cream);
  font-weight: 300;
  line-height: 1.55;
}

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 0; padding-top: 0; }
  .docs-sidebar { display: none; }
  .docs-mobile-nav { display: block; }
  .docs-content { padding-top: 1.5rem; }
}
@media (max-width: 540px) {
  .docs-cmd-row { grid-template-columns: 1fr; }
  .docs-cmd-name { border-right: none; border-bottom: 1px solid var(--border); }
}
