/* Rules and FAQ: plain reading pages. No boxes, no glow, no popups. */
.doc-page main { max-width: 1180px; }
.doc-head { max-width: 72ch; margin-bottom: 56px; }
.doc-head h1 { font-size: clamp(2.1rem, 4vw, 3rem); font-weight: 400; color: #fff; }
.doc-head p { margin-top: 12px; font-size: 1.1rem; }
.doc { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 72px; align-items: start; }
.doc-plain { grid-template-columns: minmax(0, 1fr); }
.doc-side { position: sticky; top: 110px; max-height: calc(100vh - 140px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: #ffffff33 transparent; padding-right: 8px; }
.doc-search { display: grid; gap: 4px; font-size: 14px; }
.doc-search input { width: 100%; min-height: 42px; padding: 0 2px; border: 0; border-bottom: 1px solid rgba(255, 255, 255, .35); background: none; color: #fff; font: 400 16px var(--body); }
.doc-search input:focus { outline: none; border-color: var(--cyan-hi); }
.doc-found { min-height: 26px; font-size: 14px; }
.doc-toc summary { font-family: var(--head); color: var(--text); cursor: pointer; list-style: none; margin-bottom: 6px; }
.doc-toc summary::-webkit-details-marker { display: none; }
.doc-toc ol, .doc-toc ul { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.doc-toc li { counter-increment: toc; display: grid; grid-template-columns: 30px 1fr; font-size: 15px; line-height: 1.5; }
.doc-toc ol li::before { content: counter(toc) "."; color: rgba(255, 255, 255, .55); padding: 4px 0; font-variant-numeric: tabular-nums; }
.doc-toc ul li { grid-template-columns: 1fr; }
.doc-toc a { padding: 4px 0; color: var(--soft); text-decoration: none; }
.doc-toc a:hover { color: #fff; text-decoration: underline; }
.doc-toc a[aria-current] { color: var(--cyan-hi); }
.doc-body { max-width: 74ch; font-weight: 400; font-size: 17px; line-height: 1.7; color: rgba(255, 255, 255, .82); overflow-wrap: break-word; counter-reset: chapter; }
.chapter { counter-increment: chapter; counter-reset: rule; scroll-margin-top: 110px; }
.chapter + .chapter { margin-top: 56px; padding-top: 56px; border-top: 1px solid rgba(255, 255, 255, .14); }
.doc-body h2 { font-size: 1.7rem; font-weight: 700; color: #fff; }
.doc-body h3 { font-size: 1.12rem; font-weight: 700; color: #fff; }
.doc-body h2 a, .doc-body h3 a { color: inherit; text-decoration: none; }
.doc-body h2 a:hover, .doc-body h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; }
.doc-body p { margin: 10px 0 0; }
.doc-body .lead { margin-top: 14px; }
.rule, .qa { scroll-margin-top: 110px; margin-top: 34px; }
.rule { counter-increment: rule; }
.doc-body ul { margin: 10px 0 0; padding-left: 22px; }
.doc-body li { padding-left: 4px; }
.doc-body li + li { margin-top: 7px; }
.doc-body li::marker { color: rgba(255, 255, 255, .5); }
.doc-body strong { font-weight: 700; color: #fff; }
.doc-body code { padding: 1px 6px; border-radius: 4px; background: rgba(255, 255, 255, .1); color: #fff; font-size: .92em; }
/* numbers come from the order on the page, so adding a rule renumbers the rest by itself */
.numbered h2 a::before { content: counter(chapter) ". "; }
.numbered .rule h3 a::before { content: counter(chapter) "." counter(rule) "\00a0\00a0"; font-weight: 400; color: rgba(255, 255, 255, .65); }
.numbered .rule > ul { list-style: none; padding-left: 0; counter-reset: item; }
.numbered .rule > ul > li { counter-increment: item; position: relative; padding: 0 0 0 64px; }
.numbered .rule > ul > li::before { content: counter(chapter) "." counter(rule) "." counter(item); color: rgba(255, 255, 255, .55); font-size: .92em; font-variant-numeric: tabular-nums; position: absolute; left: 0; top: .06em; }
/* searched-out parts stay in the page (invisible) so the numbers do not change */
.is-out { position: absolute; width: 1px; height: 1px; overflow: hidden; visibility: hidden; margin: 0; padding: 0; border: 0; }
.doc-body { position: relative; }
:target > h2 a, :target > h3 a { color: var(--cyan-hi); }
.doc-page .nav-links a[aria-current] { color: #00b8b8; text-decoration: line-through; text-decoration-color: var(--neon); text-shadow: 0 0 6px var(--neon), 0 0 10px var(--neon); }
@media (max-width: 900px) {
  .doc-head { margin-bottom: 32px; }
  .doc { grid-template-columns: 1fr; gap: 40px; }
  .doc-side { position: static; max-height: none; overflow: visible; padding: 0; }
  .doc-toc { padding-bottom: 16px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
  .doc-toc a { padding: 7px 0; }
}
@media (max-width: 560px) {
  .doc-body { font-size: 16px; }
  .numbered .rule > ul > li { padding-left: 52px; }
}
@media print {
  body { background: #fff; color: #000; }
  .nav-wrap, .online-box, .doc-side, .foot, .discord-auth, .skip { display: none !important; }
  main { padding: 0; }
  .doc { display: block; }
  .doc-body, .doc-head h1, .doc-body * { color: #000 !important; }
  .rule, .qa { break-inside: avoid; }
}
