/* ─────────────────────────────────────────────────────────────────────────────
   The Real Dev Shop - Seller documentation centre (/docs)
   Built on the tokens in main.css (blue-600 brand, slate neutrals, Inter).
   Layout: sidebar | article | "on this page", collapsing to a drawer + single
   column below 1024px.

   Radius rule used throughout: cards 14px, controls 8-10px, pills full.
   z-index scale: mobile bar 90 (under the site header's 100), search panel 200,
   drawer backdrop 300, drawer 310.
───────────────────────────────────────────────────────────────────────────── */

.docs-body {
  --docs-ink: #334155;            /* prose body text, 10.4:1 on white */
  --docs-sidebar-w: 268px;
  --docs-toc-w: 216px;
  --docs-sticky-top: calc(var(--header-height) + 24px);
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

.docs-sr {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.docs-skip {
  position: absolute; left: 12px; top: -48px; z-index: 400;
  padding: 10px 16px; border-radius: var(--radius);
  background: var(--blue-600); color: #fff; font-weight: 600; font-size: .875rem;
  transition: top var(--duration-md) var(--ease);
}
.docs-skip:focus { top: 12px; color: #fff; }

/* ─── Shell ──────────────────────────────────────────────────────────────── */
.docs-shell {
  display: grid;
  grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr) var(--docs-toc-w);
  gap: 0 var(--space-12);
  align-items: start;
  flex: 1 0 auto;
  padding-bottom: var(--space-20);
}
.docs-view-category .docs-shell,
.docs-view-search .docs-shell { grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr); }
.docs-view-home .docs-shell   { grid-template-columns: minmax(0, 1fr); }

.docs-main {
  min-width: 0;
  padding-top: var(--space-8);
  animation: docs-rise .32s var(--ease) both;
}
.docs-view-article .docs-main,
.docs-view-category .docs-main,
.docs-view-search .docs-main { max-width: 780px; }

@keyframes docs-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ─── Sidebar ────────────────────────────────────────────────────────────── */
.docs-sidebar {
  position: sticky;
  top: var(--header-height);
  height: calc(100dvh - var(--header-height));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6) var(--space-5) var(--space-8) 0;
  border-right: 1px solid var(--border);
  scrollbar-width: thin;
  scrollbar-color: var(--grey-300) transparent;
}
.docs-sidebar__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: var(--space-4);
}
.docs-sidebar__brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.0625rem; letter-spacing: -.01em;
  color: var(--text-primary);
}
.docs-sidebar__brand svg { color: var(--blue-600); }
.docs-sidebar__brand:hover { color: var(--blue-700); }
.docs-sidebar__close {
  display: none; align-items: center; justify-content: center;
  width: 36px; height: 36px; border: 0; border-radius: var(--radius);
  background: none; color: var(--text-secondary);
}
.docs-sidebar__close:hover { background: var(--grey-100); color: var(--text-primary); }

.docs-nav { margin-top: var(--space-5); }
.docs-nav__group { border: 0; }
.docs-nav__group + .docs-nav__group { margin-top: 2px; }
.docs-nav__group > summary {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 9px 10px; border-radius: var(--radius);
  font-size: .9rem; font-weight: 600; color: var(--grey-800);
  cursor: pointer; list-style: none; user-select: none;
  transition: background var(--duration) var(--ease), color var(--duration) var(--ease);
}
.docs-nav__group > summary::-webkit-details-marker { display: none; }
.docs-nav__group > summary:hover { background: var(--grey-100); color: var(--text-primary); }
.docs-nav__group > summary:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 1px; }
.docs-nav__group > summary svg {
  flex: none; color: var(--text-muted);
  transition: transform var(--duration-md) var(--ease);
}
.docs-nav__group[open] > summary svg { transform: rotate(90deg); }
.docs-nav__group ul {
  margin: 2px 0 var(--space-3) 10px;
  border-left: 1px solid var(--border);
}
.docs-nav__group li a {
  display: block; position: relative;
  margin-left: -1px; padding: 6px 10px 6px 14px;
  border-left: 2px solid transparent; border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .875rem; line-height: 1.45; color: var(--grey-600);
  transition: color var(--duration) var(--ease), background var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.docs-nav__group li a:hover { color: var(--text-primary); background: var(--grey-50); border-left-color: var(--grey-300); }
.docs-nav__group li a.is-active {
  color: var(--blue-700); font-weight: 600;
  background: var(--blue-50); border-left-color: var(--blue-600);
}
.docs-sidebar__foot {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: var(--space-6); padding: var(--space-5) 10px 0;
  border-top: 1px solid var(--border);
  font-size: .8125rem;
}
.docs-sidebar__foot a { color: var(--text-secondary); }
.docs-sidebar__foot a:hover { color: var(--blue-700); }

.docs-backdrop { display: none; }

/* ─── Search ─────────────────────────────────────────────────────────────── */
.docs-search { position: relative; display: block; }
.docs-search__icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  display: flex; color: var(--text-muted); pointer-events: none;
}
.docs-search__input {
  width: 100%; height: 42px; padding: 0 40px 0 38px;
  border: 1.5px solid var(--border); border-radius: var(--radius-md);
  background: var(--grey-50); color: var(--text-primary);
  font-size: .9rem; outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color var(--duration) var(--ease), background var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.docs-search__input::placeholder { color: var(--grey-500); }
.docs-search__input::-webkit-search-cancel-button { display: none; }
.docs-search__input:hover { border-color: var(--border-hover); }
.docs-search__input:focus { border-color: var(--blue-600); background: var(--white); box-shadow: 0 0 0 3px var(--blue-100); }
.docs-search__kbd {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  min-width: 22px; height: 22px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 6px; background: var(--white);
  font-family: var(--font-mono); font-size: .72rem; color: var(--text-secondary);
  pointer-events: none;
}
.docs-search__input:focus ~ .docs-search__kbd { opacity: 0; }

.docs-search__panel {
  position: absolute; z-index: 200; top: calc(100% + 8px); left: 0;
  width: max(100%, 440px); max-width: calc(100vw - 32px);
  max-height: min(70dvh, 520px); overflow-y: auto;
  padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--white); box-shadow: 0 18px 40px -12px rgb(15 23 42 / .22), 0 2px 6px rgb(15 23 42 / .06);
  animation: docs-pop .14s var(--ease) both;
}
@keyframes docs-pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.docs-search__group {
  padding: 8px 10px 4px; font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; color: var(--text-secondary);
}
.docs-search__item {
  display: block; padding: 9px 10px; border-radius: var(--radius);
  color: inherit; cursor: pointer;
}
.docs-search__item:hover, .docs-search__item.is-active { background: var(--blue-50); color: inherit; }
.docs-search__item-title { display: block; font-size: .9rem; font-weight: 600; color: var(--text-primary); line-height: 1.35; }
.docs-search__item-cat { display: block; margin-top: 1px; font-size: .75rem; font-weight: 600; color: var(--blue-700); }
.docs-search__item-snip {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-top: 3px; font-size: .8125rem; line-height: 1.45; color: var(--grey-600);
}
.docs-search__item mark { background: #FEF3C7; color: inherit; border-radius: 2px; padding: 0 1px; }
.docs-search__empty { padding: 14px 12px 6px; font-size: .875rem; color: var(--grey-600); }
.docs-search__empty strong { color: var(--text-primary); }
.docs-search__all {
  display: block; margin-top: 4px; padding: 10px; border-top: 1px solid var(--grey-100);
  font-size: .8125rem; font-weight: 600; text-align: center;
}

/* ─── Mobile bar (hidden on desktop) ─────────────────────────────────────── */
.docs-mobilebar { display: none; }

/* ─── Breadcrumb ─────────────────────────────────────────────────────────── */
.docs-breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: .8125rem; color: var(--text-secondary); }
.docs-breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.docs-breadcrumb li + li::before { content: "/"; color: var(--grey-300); }
.docs-breadcrumb a { color: var(--text-secondary); }
.docs-breadcrumb a:hover { color: var(--blue-700); text-decoration: underline; }
.docs-breadcrumb [aria-current] { color: var(--grey-800); font-weight: 500; }

/* ─── Article ────────────────────────────────────────────────────────────── */
.docs-article__head { margin: var(--space-5) 0 var(--space-6); }
.docs-article__head h1 {
  font-size: clamp(1.75rem, 3.6vw, 2.375rem); font-weight: 800;
  line-height: 1.15; letter-spacing: -.025em; color: var(--text-primary);
  text-wrap: balance;
}
.docs-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: var(--space-3); font-size: .8125rem; color: var(--text-secondary); }
.docs-lead { font-size: 1.125rem; line-height: 1.7; color: var(--grey-800); }
.docs-article__head .docs-lead { margin-top: var(--space-3); }

.docs-prose { color: var(--docs-ink); font-size: 1rem; line-height: 1.75; }
.docs-prose > * + * { margin-top: var(--space-5); }
.docs-prose h2 {
  margin-top: var(--space-12); padding-top: var(--space-2);
  font-size: 1.5rem; font-weight: 800; line-height: 1.25; letter-spacing: -.02em;
  color: var(--text-primary); scroll-margin-top: calc(var(--header-height) + 20px);
}
.docs-prose h3 {
  margin-top: var(--space-8);
  font-size: 1.125rem; font-weight: 700; line-height: 1.35; letter-spacing: -.01em;
  color: var(--text-primary); scroll-margin-top: calc(var(--header-height) + 20px);
}
.docs-prose h2 + *, .docs-prose h3 + * { margin-top: var(--space-3); }
.docs-anchor {
  margin-left: 8px; font-weight: 500; color: var(--grey-300); opacity: 0;
  transition: opacity var(--duration) var(--ease), color var(--duration) var(--ease);
}
.docs-prose h2:hover .docs-anchor, .docs-prose h3:hover .docs-anchor, .docs-anchor:focus { opacity: 1; }
.docs-anchor:hover { color: var(--blue-600); }
.docs-prose a:not(.btn) { color: var(--blue-700); font-weight: 500; text-decoration: underline; text-decoration-color: var(--blue-200); text-underline-offset: 3px; transition: text-decoration-color var(--duration) var(--ease); }
.docs-prose a:not(.btn):hover { text-decoration-color: var(--blue-600); }
.docs-prose strong { color: var(--text-primary); font-weight: 650; }
.docs-prose code {
  padding: 2px 6px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--grey-50); font-family: var(--font-mono); font-size: .86em; color: var(--grey-800);
}
.docs-code {
  overflow-x: auto; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--grey-50); line-height: 1.6;
}
.docs-code code {
  padding: 0; border: 0; background: none;
  font-family: var(--font-mono); font-size: .84rem; color: var(--grey-800); white-space: pre;
}
.docs-prose ul { padding-left: 1.25rem; }
.docs-prose ul li { list-style: disc; padding-left: 4px; }
.docs-prose ul li::marker { color: var(--grey-400); }
.docs-prose li + li { margin-top: 8px; }

/* Numbered steps */
.docs-steps { counter-reset: docs-step; }
.docs-steps li {
  position: relative; counter-increment: docs-step;
  padding: 2px 0 2px 44px; min-height: 30px;
}
.docs-steps li + li { margin-top: 14px; }
.docs-steps li::before {
  content: counter(docs-step);
  position: absolute; left: 0; top: 1px;
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-50); border: 1px solid var(--blue-200);
  color: var(--blue-700); font-size: .8125rem; font-weight: 700;
}
.docs-steps li:not(:last-child)::after {
  content: ""; position: absolute; left: 13.5px; top: 33px; bottom: -12px;
  width: 1px; background: var(--border);
}

/* Tables */
.docs-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.docs-table-wrap table { width: 100%; border-collapse: collapse; font-size: .9rem; line-height: 1.55; }
.docs-table-wrap th {
  padding: 11px 16px; text-align: left; white-space: nowrap;
  background: var(--grey-50); border-bottom: 1px solid var(--border);
  font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--grey-600);
}
.docs-table-wrap td { padding: 12px 16px; vertical-align: top; border-top: 1px solid var(--grey-100); }
.docs-table-wrap tbody tr:first-child td { border-top: 0; }
.docs-table-wrap td:first-child { font-weight: 600; color: var(--text-primary); }

/* Callouts */
.docs-callout {
  padding: 14px 18px; border: 1px solid var(--border); border-left-width: 3px;
  border-radius: var(--radius-md); background: var(--grey-50);
}
.docs-callout p { margin: 0; font-size: .9375rem; line-height: 1.65; }
.docs-callout__label { margin-bottom: 2px !important; font-size: .78rem !important; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--grey-600); }
.docs-callout--tip     { background: var(--blue-50); border-color: var(--blue-100); border-left-color: var(--blue-600); }
.docs-callout--tip .docs-callout__label { color: var(--blue-700); }
.docs-callout--warning { background: var(--warning-bg); border-color: #FDE68A; border-left-color: var(--warning); }
.docs-callout--warning .docs-callout__label { color: #92400E; }
.docs-callout--example { background: var(--white); border-left-color: var(--grey-400); }

/* Call to action */
.docs-cta {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-5) var(--space-6); flex-wrap: wrap;
  margin-top: var(--space-10); padding: var(--space-6);
  border: 1px solid var(--blue-100); border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--blue-50), #fff 70%);
}
.docs-prose .docs-cta { margin-top: var(--space-8); margin-bottom: var(--space-8); }
.docs-cta__copy { flex: 1 1 280px; min-width: 0; }
.docs-cta__title { font-size: 1.0625rem; font-weight: 700; line-height: 1.35; color: var(--text-primary); }
.docs-cta__text { margin-top: 4px; font-size: .9rem; line-height: 1.6; color: var(--grey-600); }
.docs-cta .btn { flex: none; }
.docs-cta .btn:active { transform: translateY(0) scale(.98); }

/* Earnings calculator */
.docs-calc { max-width: 460px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--white); overflow: hidden; }
.docs-calc figcaption { padding: 12px 18px; background: var(--grey-50); border-bottom: 1px solid var(--border); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--grey-600); }
.docs-calc__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); padding: 11px 18px; font-size: .9rem; font-variant-numeric: tabular-nums; }
.docs-calc__row + .docs-calc__row { border-top: 1px solid var(--grey-100); }
.docs-calc__row label { font-weight: 600; color: var(--text-primary); }
.docs-calc__input { display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; height: 36px; border: 1.5px solid var(--border); border-radius: var(--radius); font-weight: 600; color: var(--text-primary); transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease); }
.docs-calc__input:focus-within { border-color: var(--blue-600); box-shadow: 0 0 0 3px var(--blue-100); }
.docs-calc__input input { width: 84px; border: 0; outline: 0; background: none; font: inherit; color: inherit; text-align: right; -moz-appearance: textfield; appearance: textfield; }
.docs-calc__input input::-webkit-outer-spin-button, .docs-calc__input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.docs-calc__row--total { background: var(--blue-50); font-weight: 700; color: var(--text-primary); font-size: 1rem; }
.docs-calc__row--total span:last-child { color: var(--blue-700); }
.docs-calc__note { padding: 10px 18px 14px; border-top: 1px solid var(--grey-100); font-size: .8rem; line-height: 1.5; color: var(--text-secondary); }

/* Inline table of contents (tablet and below) */
.docs-toc-inline { display: none; margin-bottom: var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--grey-50); }
.docs-toc-inline summary { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; font-size: .875rem; font-weight: 600; color: var(--grey-800); cursor: pointer; list-style: none; }
.docs-toc-inline summary::-webkit-details-marker { display: none; }
.docs-toc-inline summary svg { color: var(--text-muted); transition: transform var(--duration-md) var(--ease); }
.docs-toc-inline[open] summary svg { transform: rotate(90deg); }
.docs-toc-inline ul { padding: 0 16px 12px; }
.docs-toc-inline li a { display: block; padding: 6px 0; font-size: .875rem; color: var(--grey-600); }
.docs-toc-inline li a:hover { color: var(--blue-700); }

/* Related, pager, help */
.docs-related { margin-top: var(--space-12); }
.docs-related h2 { font-size: 1.125rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: var(--space-4); }
.docs-related__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.docs-related__list a, .docs-pager__link {
  display: flex; flex-direction: column; height: 100%;
  padding: var(--space-4) var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--white); color: inherit;
  transition: border-color var(--duration-md) var(--ease), box-shadow var(--duration-md) var(--ease), transform var(--duration-md) var(--ease);
}
.docs-related__list a:hover, .docs-pager__link:hover {
  border-color: var(--blue-200); color: inherit; transform: translateY(-2px);
  box-shadow: 0 10px 24px -14px rgb(37 99 235 / .45);
}
.docs-related__cat { font-size: .75rem; font-weight: 600; color: var(--blue-700); }
.docs-related__title { margin-top: 2px; font-size: .9375rem; font-weight: 700; line-height: 1.35; color: var(--text-primary); }
.docs-related__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 4px; font-size: .8125rem; line-height: 1.5; color: var(--grey-600); }

.docs-pager { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-8); padding-top: var(--space-8); border-top: 1px solid var(--border); }
.docs-pager__link--next { text-align: right; align-items: flex-end; grid-column: 2; }
.docs-pager__dir { font-size: .75rem; font-weight: 600; color: var(--text-secondary); }
.docs-pager__title { margin-top: 2px; font-size: .9375rem; font-weight: 700; line-height: 1.35; color: var(--blue-700); }
.docs-help { margin-top: var(--space-8); font-size: .875rem; color: var(--text-secondary); }
.docs-help a { font-weight: 600; }

/* ─── "On this page" ─────────────────────────────────────────────────────── */
.docs-toc {
  position: sticky; top: var(--docs-sticky-top);
  max-height: calc(100dvh - var(--docs-sticky-top) - 24px); overflow-y: auto;
  margin-top: var(--space-16); padding-left: var(--space-4);
  border-left: 1px solid var(--border); scrollbar-width: thin;
}
.docs-toc__title { margin-bottom: var(--space-2); font-size: .78rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--grey-600); }
.docs-toc a {
  display: block; margin-left: calc(var(--space-4) * -1 - 1px); padding: 5px 0 5px calc(var(--space-4) - 1px);
  border-left: 2px solid transparent;
  font-size: .8125rem; line-height: 1.45; color: var(--grey-600);
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}
.docs-toc ul ul a { padding-left: calc(var(--space-4) + 11px); font-size: .78rem; }
.docs-toc a:hover { color: var(--text-primary); }
.docs-toc a.is-active { color: var(--blue-700); font-weight: 600; border-left-color: var(--blue-600); }

/* ─── Category index + search results ────────────────────────────────────── */
.docs-index { margin-top: var(--space-6); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.docs-index li + li { border-top: 1px solid var(--grey-100); }
.docs-index a { display: block; padding: var(--space-4) var(--space-5); color: inherit; transition: background var(--duration) var(--ease); }
.docs-index a:hover { background: var(--grey-50); color: inherit; }
.docs-index__cat { display: block; font-size: .75rem; font-weight: 600; color: var(--blue-700); }
.docs-index__title { display: block; font-size: 1rem; font-weight: 700; line-height: 1.4; color: var(--text-primary); transition: color var(--duration) var(--ease); }
.docs-index a:hover .docs-index__title { color: var(--blue-700); }
.docs-index__desc { display: block; margin-top: 2px; font-size: .875rem; line-height: 1.55; color: var(--grey-600); }

.docs-empty { margin-top: var(--space-4); color: var(--docs-ink); line-height: 1.7; }
.docs-empty__title { font-size: 1.0625rem; font-weight: 700; color: var(--text-primary); }
.docs-empty h2 { margin: var(--space-8) 0 var(--space-3); font-size: 1rem; font-weight: 700; }
.docs-empty ul li + li { margin-top: 6px; }
.docs-empty a { font-weight: 500; }

/* ─── Landing page ───────────────────────────────────────────────────────── */
.docs-view-home .docs-main { padding-top: var(--space-10); }
.docs-hero {
  padding: clamp(28px, 5vw, 56px); border: 1px solid var(--blue-100); border-radius: var(--radius-xl);
  background:
    radial-gradient(900px 300px at 100% 0%, rgb(37 99 235 / .10), transparent 60%),
    linear-gradient(180deg, var(--blue-50), #fff);
}
.docs-hero h1 { font-size: clamp(2rem, 4.6vw, 3rem); font-weight: 800; line-height: 1.08; letter-spacing: -.03em; }
.docs-hero__sub { max-width: 60ch; margin-top: var(--space-3); font-size: 1.0625rem; line-height: 1.65; color: var(--grey-600); }
.docs-hero .docs-search { max-width: 640px; margin-top: var(--space-6); }
.docs-hero .docs-search__input { height: 54px; padding-left: 46px; border-radius: var(--radius-lg); background: var(--white); font-size: 1rem; box-shadow: 0 6px 20px -12px rgb(37 99 235 / .5); }
.docs-hero .docs-search__icon { left: 16px; }
.docs-hero .docs-search__panel { width: 100%; }
.docs-hero__popular { display: flex; flex-wrap: wrap; gap: 8px; margin-top: var(--space-5); }
.docs-hero__popular a {
  display: inline-block; padding: 6px 13px; border: 1px solid var(--blue-100); border-radius: var(--radius-full);
  background: var(--white); font-size: .8125rem; font-weight: 500; color: var(--grey-800);
  transition: border-color var(--duration) var(--ease), color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.docs-hero__popular a:hover { border-color: var(--blue-600); color: var(--blue-700); transform: translateY(-1px); }

.docs-start, .docs-directory { margin-top: var(--space-12); }
.docs-start h2, .docs-directory > h2 { font-size: 1.375rem; font-weight: 800; letter-spacing: -.02em; margin-bottom: var(--space-5); }
.docs-start__steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); counter-reset: docs-start; }
.docs-start__steps li { counter-increment: docs-start; }
.docs-start__steps a {
  position: relative; display: block; height: 100%;
  padding: var(--space-5) var(--space-5) var(--space-5) 62px;
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--white); color: inherit;
  transition: border-color var(--duration-md) var(--ease), box-shadow var(--duration-md) var(--ease), transform var(--duration-md) var(--ease);
}
.docs-start__steps a::before {
  content: counter(docs-start); position: absolute; left: 18px; top: 20px;
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--blue-600); color: #fff; font-size: .875rem; font-weight: 700;
}
.docs-start__steps a:hover { border-color: var(--blue-200); transform: translateY(-2px); box-shadow: 0 12px 26px -16px rgb(37 99 235 / .5); color: inherit; }
.docs-start__steps strong { display: block; font-size: .9375rem; line-height: 1.35; color: var(--text-primary); }
.docs-start__steps span { display: block; margin-top: 3px; font-size: .8125rem; line-height: 1.5; color: var(--grey-600); }

.docs-directory__grid { columns: 3 320px; column-gap: var(--space-5); }
.docs-dir {
  break-inside: avoid; margin-bottom: var(--space-5); padding: var(--space-5);
  border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--white);
  transition: border-color var(--duration-md) var(--ease), box-shadow var(--duration-md) var(--ease);
}
.docs-dir:hover { border-color: var(--border-hover); box-shadow: 0 10px 28px -20px rgb(15 23 42 / .35); }
.docs-dir__head { display: flex; gap: var(--space-3); align-items: flex-start; }
.docs-dir__icon { flex: none; width: 38px; height: 38px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; background: var(--blue-50); color: var(--blue-600); }
.docs-dir h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; }
.docs-dir h3 a { color: var(--text-primary); }
.docs-dir h3 a:hover { color: var(--blue-700); }
.docs-dir__head p { margin-top: 2px; font-size: .8125rem; line-height: 1.5; color: var(--grey-600); }
.docs-dir ul { margin-top: var(--space-4); padding-top: var(--space-3); border-top: 1px solid var(--grey-100); }
.docs-dir li a { display: block; padding: 5px 0; font-size: .875rem; line-height: 1.45; color: var(--grey-600); transition: color var(--duration) var(--ease), padding-left var(--duration) var(--ease); }
.docs-dir li a:hover { color: var(--blue-700); padding-left: 4px; }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1240px) {
  .docs-shell { grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr); gap: 0 var(--space-10); }
  .docs-toc { display: none; }
  .docs-toc-inline { display: block; }
}

@media (max-width: 1023px) {
  .docs-shell, .docs-view-category .docs-shell, .docs-view-search .docs-shell { grid-template-columns: minmax(0, 1fr); }
  .docs-main { padding-top: var(--space-5); }
  .docs-view-home .docs-main { padding-top: var(--space-5); }

  .docs-mobilebar {
    position: sticky; top: var(--header-height); z-index: 90;
    display: flex; align-items: center; gap: var(--space-3);
    padding: 8px var(--space-4);
    background: rgb(255 255 255 / .96); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
  }
  .docs-mobilebar__btn {
    display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: var(--radius); background: var(--white);
    font-size: .8125rem; font-weight: 600; color: var(--grey-800);
  }
  .docs-mobilebar__btn:active { transform: scale(.98); }
  .docs-mobilebar__btn--icon { width: 36px; padding: 0; justify-content: center; margin-left: auto; }
  .docs-mobilebar__where { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8125rem; color: var(--text-secondary); }

  .docs-sidebar {
    position: fixed; z-index: 310; top: 0; left: 0; bottom: 0;
    width: min(88vw, 340px); height: 100dvh;
    padding: var(--space-4) var(--space-4) var(--space-8);
    background: var(--white); border-right: 1px solid var(--border);
    transform: translateX(-102%); visibility: hidden;
    transition: transform .26s var(--ease), visibility 0s linear .26s;
  }
  .docs-sidebar.is-open { transform: none; visibility: visible; transition: transform .26s var(--ease); box-shadow: 0 0 60px rgb(15 23 42 / .25); }
  .docs-sidebar__close { display: flex; }
  .docs-search__panel { width: 100%; }
  .docs-search__kbd { display: none; }
  .docs-backdrop { display: block; position: fixed; inset: 0; z-index: 300; background: rgb(15 23 42 / .45); animation: docs-fade .2s var(--ease) both; }
  .docs-backdrop[hidden] { display: none; }
  @keyframes docs-fade { from { opacity: 0; } to { opacity: 1; } }
}
/* The landing page has no sidebar column on desktop: the directory is the page.
   The drawer still exists there for phones. */
@media (min-width: 1024px) {
  .docs-view-home .docs-sidebar, .docs-view-home .docs-backdrop { display: none; }
}

@media (max-width: 900px) {
  .docs-start__steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .docs-shell { padding-left: var(--space-4); padding-right: var(--space-4); padding-bottom: var(--space-12); }
  .docs-prose { font-size: .9688rem; }
  .docs-prose h2 { font-size: 1.3125rem; margin-top: var(--space-10); }
  .docs-related__list, .docs-pager { grid-template-columns: minmax(0, 1fr); }
  .docs-pager__link--next { grid-column: 1; }
  .docs-start__steps { grid-template-columns: minmax(0, 1fr); }
  .docs-cta { padding: var(--space-5); }
  .docs-cta .btn { width: 100%; }
  .docs-anchor { display: none; }
  .docs-hero { border-radius: var(--radius-lg); }
}

@media (prefers-reduced-motion: reduce) {
  .docs-main, .docs-search__panel, .docs-backdrop { animation: none; }
  .docs-body *, .docs-body *::before, .docs-body *::after { transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}

@media print {
  .site-header, .docs-mobilebar, .docs-sidebar, .docs-toc, .docs-toc-inline, .site-footer, .docs-cta, .docs-pager, .docs-related { display: none !important; }
  .docs-shell { display: block; }
}
