/* Docs / howto / privacy content layout */

/* ── Wrap ── */
.docs-wrap {
  margin: 0 auto;
  padding: 3.5rem 2rem 5rem;
  align-items: start;
}
.docs-wrap--docs,
.docs-wrap--howto {
  display: grid;
  gap: 0 4rem;
}
.docs-wrap--docs {
  grid-template-columns: 220px minmax(0, 1fr);
  max-width: var(--maxw);
  padding: 48px 28px 80px;
  gap: 0 56px;
}
.docs-wrap--howto {
  grid-template-columns: 230px 1fr;
  max-width: 1040px;
}
.docs-wrap--privacy {
  max-width: 760px;
}

/* ── Sidebar ── */
.docs-sidebar {
  position: sticky;
  top: 78px;
}

.docs-sidebar-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
  padding-left: 0.8rem;
}

.docs-toc {
  list-style: none;
}

.docs-toc li + li { margin-top: 0.1rem; }

.docs-toc a {
  display: block;
  font-size: 0.825rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.28rem 0 0.28rem 0.8rem;
  border-left: 2px solid var(--border);
  line-height: 1.4;
  transition: color 0.1s, border-color 0.1s;
}

.docs-toc a:hover {
  color: var(--text);
  border-left-color: var(--border-hover);
}

.docs-toc a.toc-active {
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
}

/* ── Content ── */
.docs-content {
  min-width: 0;
}

.docs-eyebrow {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.7rem;
}

.docs-content h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 0.6rem;
}

.docs-lede {
  font-size: 1.05rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 3rem;
}
.docs-wrap--docs .docs-lede { max-width: 640px; font-size: 18px; color: var(--ink-2); }
.docs-wrap--howto .docs-lede { max-width: 560px; margin-bottom: 2.5rem; }
.docs-wrap--howto .docs-content .docs-lede { margin-bottom: .75rem; }

.docs-content h2 {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 2.25rem 0 0.6rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}

.docs-content h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.docs-content h3 {
  font-size: 0.975rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 1.75rem 0 0.45rem;
  color: var(--text);
}

.docs-content p {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.75;
  margin-bottom: 0.9rem;
}

.docs-content p:last-child { margin-bottom: 0; }

.docs-content ul,
.docs-content ol {
  font-size: 1rem;
  color: var(--ink-2);
  line-height: 1.75;
  margin: 0.5rem 0 1rem 1.4rem;
}

.docs-content li + li { margin-top: 0.3rem; }

.docs-content strong { color: var(--text); font-weight: 600; }

.docs-content a {
  color: var(--accent);
  text-underline-offset: 3px;
  text-decoration-color: rgba(7,146,160,.4);
}
.docs-content a:hover { text-decoration-color: var(--accent); }
.docs-wrap--docs .docs-content a,
.docs-wrap--howto .docs-content a {
  font-weight: 600;
  text-decoration: underline;
}
.docs-wrap--docs .docs-content .docs-mobile-toc a,
.docs-wrap--howto .docs-content .docs-mobile-toc a {
  font-weight: 400;
  text-decoration: none;
}
.docs-wrap--docs .docs-content .docs-mobile-toc a.toc-active,
.docs-wrap--howto .docs-content .docs-mobile-toc a.toc-active {
  font-weight: 600;
}
.docs-wrap--privacy .docs-content a:hover { opacity: 1; }
/* Download buttons sit on a dark fill; keep the label light. */
.docs-wrap--docs .docs-content a.aic-dl-btn,
.docs-wrap--howto .docs-content a.aic-dl-btn {
  color: var(--card);
  text-decoration: none;
}

.docs-content code {
  font-family: var(--mono);
  font-size: 0.82em;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0.1em 0.42em;
  border-radius: var(--radius-tag);
  color: var(--ink-2);
}

.docs-content pre {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: var(--radius-card);
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
}

.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.835rem;
  color: var(--term-text);
  line-height: 1.7;
}

.docs-content pre .c  { color: var(--term-muted); }
.docs-content pre .kw { color: var(--term-blue); }
.docs-content pre .st { color: var(--term-yellow); }
.docs-content pre .pr { color: var(--accent-bright); }

/* ── Numbered steps (docs / howto only) ── */
.docs-wrap--docs .steps-list,
.docs-wrap--howto .steps-list {
  list-style: none;
  counter-reset: step;
  margin: 0.75rem 0 1.5rem;
}

.docs-wrap--docs .steps-list > li,
.docs-wrap--howto .steps-list > li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 0 0.9rem;
  margin-bottom: 1.5rem;
  align-items: start;
}

.docs-wrap--docs .steps-list > li::before,
.docs-wrap--howto .steps-list > li::before {
  content: counter(step);
  width: 28px;
  height: 28px;
  background: var(--text);
  color: var(--card);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.775rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.step-body { min-width: 0; }
.step-body h3 { margin: 0.1rem 0 0.4rem; }
.step-body p:last-child { margin-bottom: 0; }

/* ── Callouts ── */
.callout {
  background: var(--accent-bg);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-card);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0 1.25rem;
  font-size: 0.875rem;
  color: var(--ink-2);
  line-height: 1.6;
}
.callout strong { color: var(--accent); }

.note {
  background: var(--amber-bg);
  border: 1px solid var(--amber-bd);
  border-radius: var(--radius-card);
  padding: 0.9rem 1.1rem;
  margin: 1rem 0 1.25rem;
  font-size: 0.875rem;
  color: var(--amber-text);
  line-height: 1.6;
}
.note strong { color: var(--amber-text-strong); }
.docs-wrap--docs .note em,
.docs-wrap--howto .note em { color: var(--amber-text-strong); font-style: italic; }

.docs-wrap--privacy .callout {
  border-radius: 9px;
  padding: 0.85rem 1.1rem;
  color: var(--text);
}
.docs-wrap--privacy .note {
  background: var(--surface);
  border-color: var(--border);
  border-radius: 9px;
  padding: 0.85rem 1.1rem;
  color: var(--muted);
}
.docs-wrap--privacy .note strong { color: var(--text); }

/* ── Docs-only ── */
.arch-diagram {
  background: var(--term-bg);
  border: 1px solid var(--term-border);
  border-radius: var(--radius-card);
  padding: 1.5rem 1.75rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--term-text);
  line-height: 1.5;
  white-space: pre;
  overflow-x: auto;
  margin: 0.75rem 0 1.25rem;
}

.arch-diagram .dim { color: var(--term-muted); }
.arch-diagram .hi  { color: var(--term-blue); }

.sec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 0.75rem 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  overflow: hidden;
}
.sec-table th {
  text-align: left;
  padding: 0.6rem 1rem;
  font-size: 0.775rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.sec-table td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  line-height: 1.5;
  vertical-align: top;
}
.sec-table tr:last-child td { border-bottom: none; }
.sec-table td:first-child { color: var(--text); font-weight: 500; white-space: nowrap; }

.docs-content .docs-jump-links { margin: -1rem 0 2rem; }

/* ── Docs page (artboard 12) ── */
.docs-wrap--docs .docs-search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px;
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  background: var(--card);
  color: var(--muted);
  font-size: 13px;
  box-sizing: border-box;
}
.docs-wrap--docs .docs-search svg { flex-shrink: 0; }
.docs-wrap--docs .docs-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  color: var(--ink);
}
.docs-wrap--docs .docs-search input::placeholder { color: var(--muted); }
.docs-wrap--docs .docs-search input::-webkit-search-decoration,
.docs-wrap--docs .docs-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.docs-wrap--docs .docs-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 216, 232, 0.16);
}
.docs-wrap--docs .docs-sidebar-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.docs-wrap--docs .docs-content h1 {
  font-size: clamp(2rem, 4vw, 44px);
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 12px;
}
.docs-wrap--docs .docs-content h2 {
  font-size: 24px;
  letter-spacing: -0.015em;
  margin: 32px 0 12px;
  padding-top: 24px;
}
.docs-wrap--docs .docs-content h2:first-of-type {
  margin-top: 16px;
  padding-top: 0;
}
.docs-wrap--docs .docs-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.docs-wrap--docs .docs-toc li + li { margin-top: 0; }
.docs-wrap--docs .docs-toc-group {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--label);
  padding: 18px 10px 6px;
  line-height: 1.3;
}
.docs-wrap--docs .docs-toc li:first-child.docs-toc-group { padding-top: 0; }
.docs-wrap--docs .docs-toc a {
  display: flex;
  align-items: center;
  height: 32px;
  padding: 0 10px;
  border-left: 0;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
  line-height: 1.3;
}
.docs-wrap--docs .docs-toc a:hover {
  background: var(--bg-alt);
  color: var(--ink);
  border-left-color: transparent;
}
.docs-wrap--docs .docs-toc a.toc-active {
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  border-left-color: transparent;
  box-shadow: 0 1px 2px rgba(20, 20, 18, 0.08), 0 0 0 1px var(--border);
}
.docs-wrap--docs .docs-jump-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 8px 0 8px;
}
.docs-wrap--docs .docs-content .docs-jump-links a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  color: var(--ink);
  font-weight: 600;
  font-size: 14.5px;
  text-decoration: none;
  line-height: 1.3;
}
.docs-wrap--docs .docs-content .docs-jump-links a:hover {
  background: var(--surface);
  border-color: var(--border-hover);
  text-decoration: none;
}
.docs-wrap--docs .docs-jump-links svg {
  flex-shrink: 0;
  color: var(--accent);
}
.docs-wrap--docs .docs-jump-go {
  margin-left: auto;
  color: var(--muted);
  font-weight: 500;
}
.docs-help {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 18px 20px;
  margin: 16px 0 8px;
}
.docs-help svg {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 2px;
}
.docs-help p {
  margin: 0;
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.55;
}

/* ── Howto-only ── */
.docs-content .agent-doc-link { font-size: .875rem; margin-bottom: 1.75rem; }
.client-choice { margin: 1.5rem 0; scroll-margin-top: 88px; }
.client-choice label { display: block; font-weight: 600; margin-bottom: .5rem; }
.client-choice select {
  width: 100%;
  max-width: 100%;
  padding: .75rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
}
.client-choice p { margin-top: .6rem; }
.client-guide[hidden] { display: none; }
.client-guide h2:first-of-type {
  margin-top: 2.25rem;
  padding-top: 2.25rem;
  border-top: 1px solid var(--border);
}

/* ── Privacy-only ── */
.docs-wrap--privacy .eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.65rem;
}

.privacy-feedback-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--accent);
  text-underline-offset: 3px;
  text-decoration: underline;
  text-decoration-color: rgba(7,146,160,.4);
  cursor: pointer;
}
.privacy-feedback-btn:hover { text-decoration-color: var(--accent); opacity: 1; }

.page-index { margin: 1.5rem 0 2.5rem; padding: 1rem 0; border-block: 1px solid var(--border); }
.page-index summary { font-weight: 600; cursor: pointer; }
.page-index ol { columns: 2; column-gap: 2rem; }
.page-index li { break-inside: avoid; }

/* ── Mobile ── */
@media (max-width: 768px) {
  .docs-wrap {
    grid-template-columns: 1fr;
    padding: 2rem 1.25rem 4rem;
  }
  .docs-sidebar { display: none; }
  .docs-content h2 { padding-top: 2rem; margin-top: 2rem; }
  .docs-wrap--docs .docs-content h2 { padding-top: 2rem; margin-top: 2rem; }
  .docs-wrap--docs .docs-jump-links { grid-template-columns: 1fr; }
  .docs-content .docs-mobile-toc .docs-search { margin: 0 0 10px; }
  .docs-content .docs-mobile-toc .docs-toc-group {
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--label);
    padding: 14px 0.4rem 2px;
  }
  .docs-content .docs-mobile-toc li:first-child.docs-toc-group { padding-top: 4px; }
}
@media (max-width: 600px) {
  .sec-table td:first-child { white-space: normal; overflow-wrap: anywhere; }
  .page-index ol { columns: 1; }
}
