/* ============================================================
   Sei docs (/docs and /docs/*). Loaded only on docs pages, on top of
   styles.css: same blue background, Rajdhani text, pixel headings and the
   shared .legal article styles. Pages are generated by _docs-src/build.mjs.
   ============================================================ */

.docs {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 56px);
  max-width: 1080px;
  margin: 0 auto;
  align-items: start;
}

/* ---------- sidebar (desktop) ---------- */
.docs__side { position: sticky; top: 96px; }
.docs__side-title {
  font-family: var(--pixel); font-size: 11px; letter-spacing: 0.5px;
  color: var(--off-dim); margin: 4px 0 14px; line-height: 1.6;
}
.docs__side-title a { color: inherit; text-decoration: none; }
.docs__side-title a:hover { color: var(--white); }
.docs__list { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--line); }
.docs__list a {
  display: block; padding: 7px 0 7px 16px; margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 16px; font-weight: 600; line-height: 1.35;
  color: var(--off); text-decoration: none;
  transition: color 0.2s, border-color 0.2s;
}
.docs__list a:hover { color: var(--white); }
.docs__list a[aria-current="page"] { color: var(--white); border-left-color: var(--white); }

/* ---------- guide menu (phones and small windows) ---------- */
.docs__menu { display: none; margin: 0 0 26px; }
.docs__menu summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 16px; font-weight: 700; color: var(--white);
}
.docs__menu summary::-webkit-details-marker { display: none; }
.docs__menu summary span { margin-right: auto; font-weight: 500; color: var(--off); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.docs__menu summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin: -4px 4px 0 0;
  border-right: 2px solid var(--white); border-bottom: 2px solid var(--white);
  transform: rotate(45deg); transition: transform 0.2s;
}
.docs__menu[open] summary::after { transform: rotate(225deg); margin-top: 4px; }
.docs__menu .docs__list { margin: 10px 0 0 6px; }

/* ---------- article ---------- */
.docs__main { min-width: 0; }
.docs__main.legal { max-width: 760px; margin: 0; }
.docs__crumbs { font-size: 14px; color: var(--off-dim); margin-bottom: 14px; }
.docs__crumbs a { color: var(--off); text-decoration: none; }
.docs__crumbs a:hover { color: var(--white); text-decoration: underline; }
.docs__lead { font-size: clamp(17px, 1.9vw, 20px); color: var(--white); margin: 8px 0 6px; }
.docs__main h2 { scroll-margin-top: 90px; }
.docs__main h3 { scroll-margin-top: 90px; }
.docs__main ol li, .docs__main ul li { margin: 7px 0; }
.docs__main ol li::marker { font-weight: 700; color: var(--white); }
.docs__main b { color: var(--white); font-weight: 700; }
.docs__main pre {
  margin: 12px 0 16px; padding: 12px 14px; overflow-x: auto;
  background: rgba(20, 40, 80, 0.28); border: 1px solid var(--line); border-radius: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 14px; line-height: 1.6; color: var(--white);
}
.docs__main pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* on-page contents */
.docs__toc { margin: 22px 0 6px; padding: 14px 18px; border-radius: 12px; background: rgba(255, 255, 255, 0.1); }
.docs__toc p { font-family: var(--pixel); font-size: 10px; letter-spacing: 0.5px; color: var(--off-dim); margin-bottom: 6px; }
.docs__toc ul { margin: 0; padding: 0; list-style: none; columns: 2; column-gap: 28px; }
.docs__main .docs__toc li { margin: 0; padding: 3px 0; font-size: 15px; break-inside: avoid; }
.docs__toc a { text-decoration: none; color: var(--off); }
.docs__toc a:hover { color: var(--white); text-decoration: underline; }

/* screenshots */
.shot { margin: 22px 0 10px; }
.shot img {
  width: 100%; height: auto; border-radius: 12px;
  border: 1px solid var(--line); background: #070a12;
  box-shadow: 0 22px 54px -26px rgba(40, 70, 130, 0.6);
}
.shot--narrow img { max-width: 440px; }
.shot--small img { max-width: 300px; }
.shot figcaption { font-size: 14px; color: var(--off-dim); margin-top: 9px; }

/* notes */
.note {
  margin: 18px 0; padding: 12px 16px; border-radius: 10px;
  background: rgba(255, 255, 255, 0.12); color: var(--off);
  font-size: clamp(15px, 1.6vw, 16px);
}
.note b:first-child { color: var(--white); }

/* tables (call buttons, scripts) */
.docs__table { width: 100%; border-collapse: collapse; margin: 12px 0 18px; }
.docs__table th, .docs__table td {
  text-align: left; vertical-align: top; padding: 9px 10px;
  border-bottom: 1px solid var(--line); font-size: clamp(14px, 1.5vw, 16px);
}
.docs__table th { color: var(--white); font-weight: 700; }
.docs__table td:first-child { color: var(--white); font-weight: 600; white-space: nowrap; }

/* download buttons */
.docs__main .cta-row { justify-content: flex-start; margin: 14px 0 6px; }
.docs__main a.install { text-decoration: none; }

/* prev / next */
.docs__pager {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line);
}
.docs__pager a {
  display: block; padding: 12px 16px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.12); text-decoration: none; color: var(--white);
  font-weight: 700; line-height: 1.35; transition: background 0.2s;
}
.docs__pager a:hover { background: rgba(255, 255, 255, 0.2); }
.docs__pager span { display: block; font-size: 13px; font-weight: 500; color: var(--off-dim); }
.docs__pager .next { text-align: right; grid-column: 2; }

/* index cards */
.docs-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 28px 0 10px; }
.docs-card {
  display: block; padding: 20px 22px; border-radius: 16px;
  background: rgba(255, 255, 255, 0.12); text-decoration: none;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease);
}
.legal .docs-card { text-decoration: none; }
.docs-card:hover { transform: translateY(-3px); background: rgba(255, 255, 255, 0.18); }
.docs-card__n { font-family: var(--pixel); font-size: 11px; color: rgba(255, 255, 255, 0.6); }
.docs-card__t { display: block; font-size: 20px; font-weight: 700; color: var(--white); margin: 6px 0 4px; line-height: 1.3; }
.docs-card__d { display: block; font-size: 15px; color: var(--off); line-height: 1.5; }

@media (max-width: 860px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .docs__side { display: none; }
  .docs__menu { display: block; }
}
@media (max-width: 600px) {
  .docs-cards { grid-template-columns: minmax(0, 1fr); }
  .docs__toc ul { columns: 1; }
  .docs__pager { grid-template-columns: minmax(0, 1fr); }
  .docs__pager .next { grid-column: 1; }
  .docs__table td:first-child { white-space: normal; }
}

/* troubleshooting questions (shared .faq__item styles, sized for articles) */
.docs__main .faq__item summary { font-size: clamp(16px, 1.7vw, 19px); padding: 16px 4px; }
.docs__main .faq__a { padding-bottom: 16px; font-size: clamp(15px, 1.7vw, 17px); }
.docs__main .faq__a p { margin: 0 0 8px; }
.docs__main > p + p { margin-top: 12px; }
.docs__main :not(pre) > code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.84em; }
.docs__main pre { white-space: pre-wrap; overflow-wrap: anywhere; }
/* the last question already draws a line, so the pager skips its own */
.docs__main .faq__item + .docs__pager { margin-top: 28px; padding-top: 0; border-top: 0; }
.docs__table code { white-space: nowrap; }
