/* ==========================================================================
   MYCV — DOCUMENTATION
   The reference pages (/docs/…): a slim brand bar, a sticky contents pane on
   the left in the console's grey, and the article on the right. Same tokens
   as the dashboard shell so the two read as one product; the marketing
   navigation and footer are not part of this layout.
   ========================================================================== */

body.site.docs-body,
.docs-body {
  --docs-bar-h: 56px;
  --docs-pane-w: 272px;
  --ds-pane: #f8f8fa;
  --ds-pane-line: #ededf0;
  --ds-pill: #ebebf0;
  --ds-pill-hover: #f0f0f4;
  --ds-card: #f5f5f7;
  --ds-card-line: #e9e9ee;
  --ds-ink: #1a1a1c;
  --ds-ink-2: #3f3f46;
  --ds-muted: #6f6f78;
  --ds-faint: #a0a0a8;
  --ds-black: #111114;
  --ds-black-hover: #2a2a30;
  --ds-accent: #4d6bfe;
  background: #fff;
  color: var(--ds-ink);
}

/* ── Bar ────────────────────────────────────────────────────────────── */

.docs-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--docs-bar-h);
  padding-inline: clamp(1rem, 2.5vw, 1.75rem);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ds-pane-line);
}
.docs-bar-brand { display: flex; align-items: center; gap: 0.5rem; }
.docs-bar .brand { font-size: 1.2rem; gap: 0.35rem; }
.docs-bar .brand-mark { width: 30px; }
.docs-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 0.4rem;
  border: 1.5px solid var(--ds-ink);
  border-radius: 4px;
  color: var(--ds-ink);
  font-size: 0.66rem;
  font-weight: 600;
  line-height: 1;
}
.docs-bar-actions { display: flex; align-items: center; gap: 0.5rem; }

.docs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 1rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ds-black);
  color: #fff;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.docs-btn:hover { background: var(--ds-black-hover); color: #fff; }
.docs-btn-ghost { background: var(--ds-card); color: var(--ds-ink); }
.docs-btn-ghost:hover { background: var(--ds-pill); color: var(--ds-ink); }
.docs-btn-sm { height: 32px; padding: 0 0.85rem; font-size: 0.8125rem; }
.docs-btn:focus-visible { outline: 2px solid var(--ds-accent); outline-offset: 2px; }

/* ── Layout ─────────────────────────────────────────────────────────── */

.docs {
  display: grid;
  grid-template-columns: var(--docs-pane-w) minmax(0, 1fr);
  align-items: start;
  min-height: calc(100vh - var(--docs-bar-h));
}

.docs-pane {
  position: sticky;
  top: var(--docs-bar-h);
  display: flex;
  flex-direction: column;
  height: calc(100vh - var(--docs-bar-h));
  height: calc(100dvh - var(--docs-bar-h));
  padding: 1.4rem 0.75rem 1rem;
  background: var(--ds-pane);
  border-right: 1px solid var(--ds-pane-line);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}
.docs-pane::-webkit-scrollbar { display: none; }

.docs-contents summary { list-style: none; cursor: default; }
.docs-contents summary::-webkit-details-marker { display: none; }
.docs-contents-title {
  margin: 0 0 0.5rem;
  padding: 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-muted);
}
.docs-nav { display: grid; gap: 2px; }
.docs-nav-item {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0.35rem 0.9rem;
  border-radius: 12px;
  color: var(--ds-ink);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.docs-nav-item:hover { background: var(--ds-pill-hover); color: var(--ds-ink); }
.docs-nav-item.is-active { background: var(--ds-pill); color: var(--ds-ink); }
.docs-nav-sub {
  min-height: 32px;
  margin-left: 0.9rem;
  padding-left: 0.85rem;
  border-left: 2px solid var(--ds-card-line);
  border-radius: 0 10px 10px 0;
  color: var(--ds-muted);
  font-size: 0.8375rem;
  font-weight: 500;
}
.docs-nav-sub:hover { background: transparent; color: var(--ds-ink); border-left-color: var(--ds-faint); }
.docs-nav-sub.is-active { background: transparent; color: var(--ds-ink); border-left-color: var(--ds-accent); }

.docs-pane-foot { margin-top: auto; padding-top: 1.2rem; }
.docs-agent-card {
  padding: 0.9rem 0.95rem 1rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(17, 17, 20, 0.04);
}
.docs-agent-card strong { display: block; font-size: 0.85rem; font-weight: 600; color: var(--ds-ink); }
.docs-agent-card p { margin: 0.3rem 0 0.7rem; font-size: 0.78rem; line-height: 1.5; color: var(--ds-muted); }
.docs-agent-card code {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.05em 0.35em;
  border-radius: 5px;
  background: var(--ds-card);
  color: var(--ds-ink);
}

/* ── Article ────────────────────────────────────────────────────────── */

.docs-main {
  min-width: 0;
  padding: 2.4rem clamp(1.25rem, 5vw, 4.5rem) 4rem;
}
.docs-article { max-width: 48rem; }
.docs-head { margin-bottom: 2rem; }
.docs-kicker {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ds-accent);
}
.docs-head h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ds-ink);
}
.docs-lead {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ds-muted);
}

.guide { max-width: none; font-size: 0.9875rem; line-height: 1.7; color: var(--ds-ink-2); }
.guide > p:first-child { font-size: 1rem; color: var(--ds-ink-2); }
.guide h2 {
  margin: 2.8rem 0 0.9rem;
  padding: 0;
  border: none;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ds-ink);
  scroll-margin-top: calc(var(--docs-bar-h) + 1.25rem);
}
.guide h2:first-of-type { margin-top: 2.2rem; }
.guide h3 {
  margin: 2rem 0 0.6rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ds-ink);
  scroll-margin-top: calc(var(--docs-bar-h) + 1.25rem);
}
.guide p { margin: 0 0 1rem; }
.guide strong { color: var(--ds-ink); font-weight: 600; }
.guide ul, .guide ol { margin: 0 0 1.1rem; padding-left: 1.35rem; }
.guide li { margin: 0.4rem 0; }
.guide li::marker { color: var(--ds-faint); }
.guide code {
  font-family: var(--font-mono);
  font-size: 0.84em;
  padding: 0.1em 0.4em;
  border-radius: 6px;
  background: var(--ds-card);
  color: var(--ds-ink);
  white-space: nowrap;
}
.guide a { color: var(--ds-ink); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ds-faint); }
.guide a:hover { text-decoration-color: var(--ds-ink); }

.guide-table {
  margin: 0 0 1.5rem;
  border: 1px solid var(--ds-card-line);
  border-radius: 14px;
  overflow-x: auto;
  background: #fff;
}
.guide table { width: 100%; border-collapse: collapse; font-size: 0.9rem; line-height: 1.55; }
.guide th, .guide td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.95rem;
  border-bottom: 1px solid var(--ds-card-line);
}
.guide th {
  background: var(--ds-card);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ds-muted);
}
.guide tr:last-child td { border-bottom: none; }
.guide th:first-child { width: 34%; }
.guide td:first-child { font-weight: 500; color: var(--ds-ink); }
.guide td code { white-space: normal; }
.guide td:first-child code { background: var(--ds-card); }

.docs-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 3.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ds-pane-line);
  font-size: 0.8125rem;
  color: var(--ds-muted);
}
.docs-foot-links { display: flex; gap: 1rem; }
.docs-foot a { color: var(--ds-muted); text-decoration: none; }
.docs-foot a:hover { color: var(--ds-ink); }

/* ── Small screens: contents pane folds above the article ───────────── */

@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); }
  .docs-pane {
    position: sticky;
    top: var(--docs-bar-h);
    z-index: 50;
    height: auto;
    max-height: calc(100vh - var(--docs-bar-h));
    max-height: calc(100dvh - var(--docs-bar-h));
    padding: 0.85rem 1rem;
    border-right: none;
    border-bottom: 1px solid var(--ds-pane-line);
    overflow-y: auto;
  }
  .docs-contents summary { cursor: pointer; }
  .docs-contents-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0.35rem 0.25rem;
  }
  .docs-contents-title::after {
    content: '';
    width: 7px;
    height: 7px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
  }
  .docs-contents[open] .docs-contents-title::after { transform: rotate(-135deg); }
  .docs-contents:not([open]) + .docs-pane-foot { display: none; }
  .docs-nav {
    margin-top: 0.5rem;
    max-height: 55vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .docs-nav-item { min-height: 36px; }
  .docs-pane-foot { display: none; }
  .docs-main { padding: 1.5rem 1rem 3rem; }
  .docs-head { margin-bottom: 1.5rem; }
  .guide th:first-child { width: auto; }
  .docs-bar-actions .docs-btn-ghost { display: none; }
}
