/*
  Sortr Docs. The dashboard's and landing page's own tokens, a three-column reading
  layout (menu, page, "On this page"), and the components docs/WRITING.md lists.
  Dark only, like the product. No external fonts or scripts: the site's CSP allows
  only its own files.
*/

@font-face { font-family: "Geist"; src: url("/fonts/geist-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/fonts/geist-mono-latin.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0c0e11;
  --card: #131619;
  --card-2: #1a1e23;
  --card-3: #22272e;
  --border: #252a31;
  --border-strong: #333a44;
  --text: #e9ebee;
  --body: #c9ced5;
  --muted: #969ea9;
  --faint: #6b7380;
  --accent: #f0a23c;
  --accent-bright: #ffb254;
  --accent-ink: #21160a;
  --accent-wash: rgb(240 162 60 / 0.1);
  --accent-dim: rgb(240 162 60 / 0.45);
  --blue: #6aa9f4;
  --green: #56b98a;
  --red: #e4706b;

  --d-chat: #313338;
  --d-embed: #2b2d31;
  --d-input: #1e1f22;
  --d-blurple: #5865f2;
  --d-grey: #4e5058;
  --d-green: #248046;
  --d-red: #da373c;

  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --top: 60px;
  --side: 264px;
  --toc: 220px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top) + 20px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01";
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 1em; height: 1em; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { left: 12px; }

/* ---------- header ---------- */

.top {
  position: sticky; top: 0; z-index: 50; height: var(--top);
  background: rgb(12 14 17 / 0.86);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.top-inner { height: 100%; max-width: 1440px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; gap: 20px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 650; font-size: 17px; letter-spacing: -0.02em; flex-shrink: 0; }
.logo svg { width: 24px; height: 24px; }
.logo .row-mid { transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1); }
.logo:hover .row-mid { transform: translateX(2px); }
.logo-tag { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); border: 1px solid var(--accent-dim); background: var(--accent-wash); padding: 1px 7px; border-radius: 999px; margin-left: 2px; }
.logo-sm { font-size: 15px; }
.logo-sm svg { width: 20px; height: 20px; }

.search-btn {
  display: flex; align-items: center; gap: 10px; flex: 1; max-width: 420px; height: 38px; margin-left: 12px;
  padding: 0 10px 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--card);
  color: var(--faint); font-size: 14px; cursor: pointer; transition: border-color 0.15s ease, color 0.15s ease;
}
.search-btn:hover { border-color: var(--border-strong); color: var(--muted); }
.search-btn .ic { font-size: 16px; }
.search-btn span { flex: 1; text-align: left; }
.search-key { font-size: 11px; }

.top-links { display: flex; align-items: center; gap: 22px; margin-left: auto; font-size: 14px; color: var(--muted); }
.top-links a:not(.btn):hover { color: var(--text); }
.btn { display: inline-flex; align-items: center; gap: 7px; font-weight: 550; border-radius: 9px; white-space: nowrap; transition: background 0.15s ease; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-bright); }
.btn-sm { font-size: 13.5px; padding: 7px 13px; }
.icon-btn { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 9px; background: none; border: 1px solid transparent; cursor: pointer; font-size: 20px; color: var(--text); }
.icon-btn:hover { background: var(--card-2); }

kbd {
  font-family: var(--mono); font-size: 0.78em; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border-strong); border-bottom-width: 2px; background: var(--card-2);
  padding: 1px 6px; border-radius: 6px; white-space: nowrap;
}

/* ---------- three columns ---------- */

.shell { flex: 1; width: 100%; max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: var(--side) minmax(0, 1fr); }
.main { display: grid; grid-template-columns: minmax(0, 1fr) var(--toc); gap: 48px; padding: 40px 40px 72px 56px; min-width: 0; }
.doc { min-width: 0; max-width: 780px; }

/* ---------- sidebar ---------- */

.side { position: sticky; top: var(--top); height: calc(100vh - var(--top)); border-right: 1px solid var(--border); }
.side-scroll { height: 100%; overflow-y: auto; padding: 24px 16px 40px 24px; scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
.side-home { display: block; font-size: 14px; color: var(--muted); padding: 6px 10px; border-radius: 8px; margin-bottom: 14px; }
.side-home:hover { color: var(--text); background: var(--card); }
.side-home.is-active { color: var(--text); background: var(--card-2); }
.side-group { margin-bottom: 18px; }
.side-title { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); padding: 0 10px 6px; }
.side-group.is-current .side-title { color: var(--accent); }
.side ul { list-style: none; display: grid; gap: 1px; }
.side li a { display: block; font-size: 14px; line-height: 1.4; color: var(--muted); padding: 6px 10px; border-radius: 8px; border-left: 2px solid transparent; transition: color 0.12s ease, background 0.12s ease; }
.side li a:hover { color: var(--text); background: var(--card); }
.side li a[aria-current="page"] { color: var(--text); background: var(--card-2); border-left-color: var(--accent); font-weight: 520; }
.side-backdrop { display: none; }

/* ---------- on this page ---------- */

.toc { position: sticky; top: calc(var(--top) + 40px); align-self: start; max-height: calc(100vh - var(--top) - 80px); overflow-y: auto; scrollbar-width: none; }
.toc-title { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.toc ul { list-style: none; border-left: 1px solid var(--border); }
.toc li a { display: block; font-size: 13px; line-height: 1.45; color: var(--faint); padding: 5px 0 5px 14px; margin-left: -1px; border-left: 1px solid transparent; transition: color 0.12s ease; }
.toc li.l3 a { padding-left: 26px; font-size: 12.5px; }
.toc li a:hover { color: var(--text); }
.toc li a.is-active { color: var(--accent); border-left-color: var(--accent); }

/* ---------- page head ---------- */

.page-head { margin-bottom: 32px; padding-bottom: 28px; border-bottom: 1px solid var(--border); }
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--faint); margin-bottom: 14px; }
.crumbs a:hover { color: var(--text); }
.page-head h1 { font-size: clamp(28px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -0.03em; font-weight: 650; }
.page-desc { margin-top: 12px; font-size: 17px; line-height: 1.55; color: var(--muted); max-width: 62ch; }

/* ---------- prose ---------- */

.prose { color: var(--body); font-size: 16px; }
.prose > * + * { margin-top: 18px; }
.prose h2 { color: var(--text); font-size: 23px; line-height: 1.25; letter-spacing: -0.02em; font-weight: 620; margin-top: 52px; position: relative; }
.prose h3 { color: var(--text); font-size: 18px; line-height: 1.3; letter-spacing: -0.01em; font-weight: 600; margin-top: 36px; position: relative; }
.prose h2 + *, .prose h3 + * { margin-top: 12px; }
.prose .anchor { position: absolute; left: -24px; top: 0; width: 20px; text-align: center; color: var(--faint); opacity: 0; font-weight: 500; transition: opacity 0.12s ease; }
.prose h2:hover .anchor, .prose h3:hover .anchor, .prose .anchor:focus { opacity: 1; }
.prose .anchor:hover { color: var(--accent); }
.prose p, .prose li { max-width: 72ch; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-dim); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: text-decoration-color 0.12s ease; }
.prose a:hover { text-decoration-color: var(--accent); }
.prose b, .prose strong { color: var(--text); font-weight: 600; }
.prose ul, .prose ol { padding-left: 22px; }
.prose li + li { margin-top: 6px; }
.prose li::marker { color: var(--faint); }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 40px 0; }
.prose code {
  font-family: var(--mono); font-size: 0.86em; color: var(--text); background: var(--card-2);
  border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; white-space: nowrap;
}
.prose pre.code {
  position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.65; scrollbar-width: thin;
}
.prose pre.code code { background: none; border: none; padding: 0; white-space: pre; font-size: inherit; color: #d4d9e0; }
.copy-btn {
  position: absolute; top: 8px; right: 8px; font-size: 12px; font-family: var(--sans); color: var(--muted);
  background: var(--card-2); border: 1px solid var(--border-strong); border-radius: 7px; padding: 3px 9px; cursor: pointer;
  opacity: 0; transition: opacity 0.12s ease, color 0.12s ease;
}
.prose pre.code:hover .copy-btn, .copy-btn:focus-visible { opacity: 1; }
.copy-btn:hover { color: var(--text); }
.copy-btn.is-done { color: var(--green); opacity: 1; }

.prose .lead { font-size: 18px; line-height: 1.6; color: var(--text); }

/* Where to find it: the click path to the setting. */
.prose .where {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted);
  background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; max-width: none;
}
.prose .where::before { content: "Where"; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); border-right: 1px solid var(--border-strong); padding-right: 10px; margin-right: 4px; }
.prose .where b { color: var(--text); }

/* ---------- steps ---------- */

.prose ol.steps { list-style: none; padding: 0; counter-reset: step; }
.prose ol.steps > li { counter-increment: step; position: relative; padding: 0 0 22px 48px; margin: 0; }
.prose ol.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 999px;
  display: grid; place-items: center; font-family: var(--mono); font-size: 13px; font-weight: 600;
  color: var(--accent); background: var(--accent-wash); border: 1px solid var(--accent-dim);
}
.prose ol.steps > li::after { content: ""; position: absolute; left: 14.5px; top: 36px; bottom: 6px; width: 1px; background: var(--border-strong); }
.prose ol.steps > li:last-child { padding-bottom: 0; }
.prose ol.steps > li:last-child::after { display: none; }
.prose ol.steps > li > strong:first-child { color: var(--text); }
.prose ol.steps > li > * + * { margin-top: 10px; }

/* ---------- callouts ---------- */

.prose .callout { --tone: var(--blue); display: block; background: color-mix(in srgb, var(--tone) 7%, var(--card)); border: 1px solid color-mix(in srgb, var(--tone) 28%, var(--border)); border-left: 3px solid var(--tone); border-radius: 10px; padding: 14px 18px; }
.prose .callout p { max-width: none; }
.prose .callout > * + * { margin-top: 10px; }
.prose .callout strong:first-child { color: var(--tone); }
.prose .callout.tip { --tone: var(--green); }
.prose .callout.note { --tone: var(--blue); }
.prose .callout.warning { --tone: var(--accent); }
.prose .callout.danger { --tone: var(--red); }

/* ---------- tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; scrollbar-width: thin; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.prose th { text-align: left; font-weight: 600; color: var(--text); background: var(--card); font-size: 13px; padding: 11px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.prose td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose tr:last-child td { border-bottom: none; }
.prose tbody tr:hover td { background: rgb(255 255 255 / 0.015); }
.prose td:first-child { color: var(--text); }
.prose table.settings td:first-child { width: 30%; }
.prose table.settings td:last-child { color: var(--muted); font-size: 13.5px; }
.prose td code { white-space: nowrap; }

/* ---------- screenshots ---------- */

.prose figure.shot { margin-left: 0; margin-right: 0; }
.prose figure.shot img { display: block; width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--border-strong); background: var(--card); box-shadow: 0 18px 50px rgb(0 0 0 / 0.35); }
.prose figure.shot.narrow img { max-width: 300px; }
.prose figure.shot.medium img { max-width: 560px; }
.prose figure.shot.narrow figcaption, .prose figure.shot.medium figcaption { text-align: left; }
.prose figure.shot figcaption { margin-top: 10px; font-size: 13.5px; color: var(--faint); text-align: center; }

/* ---------- cards ---------- */

.prose .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.prose .card {
  display: grid; gap: 4px; align-content: start; padding: 16px 18px; border-radius: 12px; text-decoration: none;
  background: var(--card); border: 1px solid var(--border); transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.prose .card:hover { border-color: var(--accent-dim); background: var(--card-2); transform: translateY(-1px); }
.prose .card strong { color: var(--text); font-size: 15px; }
.prose .card span { color: var(--muted); font-size: 13.5px; line-height: 1.5; }

/* ---------- questions and answers ---------- */

.prose details.qa { background: var(--card); border: 1px solid var(--border); border-radius: 12px; }
.prose details.qa + details.qa { margin-top: 8px; }
.prose details.qa summary { list-style: none; cursor: pointer; padding: 14px 44px 14px 18px; font-weight: 580; color: var(--text); position: relative; }
.prose details.qa summary::-webkit-details-marker { display: none; }
.prose details.qa summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 20px; font-weight: 400; transition: transform 0.2s ease, color 0.15s ease; }
.prose details.qa[open] summary::after { transform: translateY(-50%) rotate(45deg); color: var(--accent); }
.prose details.qa > :not(summary) { padding: 0 18px; }
.prose details.qa > :not(summary) + * { margin-top: 10px; }
.prose details.qa > :last-child { padding-bottom: 16px; }

/* ---------- a Discord message, as members see it ---------- */

.prose .dc { background: var(--d-chat); border: 1px solid #3a3c42; border-radius: 12px; padding: 16px 18px 14px 14px; font-size: 15px; line-height: 1.375; color: #dbdee1; max-width: 560px; }
.prose .dc + .dc { margin-top: 12px; }
.dc-msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 14px; }
.dc-msg + .dc-msg { margin-top: 18px; }
.dc-avatar {
  width: 40px; height: 40px; border-radius: 999px; background: #0c0e11 center / 26px no-repeat;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Cg transform='translate(4.375 4) scale(0.75)'%3E%3Cpath d='M10 6H6V26H10' fill='none' stroke='%23e9ebee' stroke-width='2'/%3E%3Crect x='12' y='9' width='12' height='3' rx='1' fill='%23e9ebee'/%3E%3Crect x='14' y='14.5' width='12' height='3' rx='1' fill='%23f0a23c'/%3E%3Crect x='12' y='20' width='12' height='3' rx='1' fill='%23e9ebee'/%3E%3C/g%3E%3C/svg%3E");
}
.dc-avatar.user { background: #7b61c9; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 16px; }
.dc-body { min-width: 0; }
.dc-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.dc-name { font-weight: 600; color: #f2f3f5; font-size: 15px; }
.dc-name.user { color: #c9b8ff; }
.dc-tag { font-size: 10px; font-weight: 600; background: var(--d-blurple); color: #fff; padding: 1px 5px; border-radius: 4px; position: relative; top: -1px; }
.dc-time { font-size: 12px; color: #949ba4; }
.dc-text { margin-top: 3px; color: #dbdee1; }
.dc-text p + p { margin-top: 6px; }
.dc-embed { --bar: var(--accent); margin-top: 6px; background: var(--d-embed); border-left: 4px solid var(--bar); border-radius: 4px; padding: 10px 14px 12px 12px; max-width: 440px; }
.dc-embed-title { font-weight: 600; color: #f2f3f5; font-size: 15px; }
.dc-embed-desc { margin-top: 6px; font-size: 14px; color: #dbdee1; }
.dc-embed-desc p + p { margin-top: 6px; }
.dc-embed-field { margin-top: 8px; font-size: 14px; }
.dc-embed-field b { display: block; color: #f2f3f5; font-weight: 600; font-size: 13.5px; }
.dc-buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.dc-btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 16px; border-radius: 8px; font-size: 14px; font-weight: 500; color: #fff; background: var(--d-grey); white-space: nowrap; }
.dc-btn.primary { background: var(--d-blurple); }
.dc-btn.secondary { background: var(--d-grey); }
.dc-btn.success { background: var(--d-green); }
.dc-btn.danger { background: var(--d-red); }
.dc-select { margin-top: 8px; max-width: 400px; height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-radius: 8px; background: var(--d-input); border: 1px solid #1a1b1e; color: #949ba4; font-size: 14px; }
.dc-select::after { content: ""; width: 7px; height: 7px; border-right: 2px solid #b5bac1; border-bottom: 2px solid #b5bac1; transform: rotate(45deg) translate(-2px, -2px); }

/* ---------- an embed with every part numbered, matched by the table under it ---------- */

.prose figure.embed-map { margin-left: 0; margin-right: 0; }
.prose figure.embed-map figcaption { margin-top: 10px; font-size: 13.5px; color: var(--faint); }
.dc-embed.map { --bar: #5865f2; position: relative; max-width: 470px; }
.dc-embed-top { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; }
.dc-embed-author { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #f2f3f5; }
.dc-embed-author-icon, .dc-embed-footer-icon { flex: none; width: 22px; height: 22px; border-radius: 999px; background: linear-gradient(135deg, #f0a23c, #b8661c); }
.dc-embed-footer-icon { width: 20px; height: 20px; }
.dc-embed.map .dc-embed-title { margin-top: 6px; display: flex; align-items: center; gap: 8px; }
.dc-embed.map .pin.inline { margin-left: 6px; vertical-align: -3px; }
.dc-embed-thumb { position: relative; width: 80px; height: 80px; border-radius: 6px; background: linear-gradient(135deg, #2b3a55, #5865f2); }
.dc-embed-fields { position: relative; margin-top: 10px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; font-size: 13.5px; color: #dbdee1; }
.dc-embed-fields b { display: block; color: #f2f3f5; font-weight: 600; font-size: 13px; }
.dc-embed-image { position: relative; margin-top: 12px; aspect-ratio: 12 / 5; border-radius: 6px; background: linear-gradient(120deg, #1f3b36, #3ba55c 55%, #f0a23c); }
.dc-embed-footer { margin-top: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: #b5bac1; }
.pin {
  display: inline-grid; place-items: center; flex: none; width: 18px; height: 18px; border-radius: 999px;
  background: var(--accent); color: #21160a; font-size: 11px; font-weight: 700; line-height: 1; font-style: normal;
}
.dc-embed-thumb .pin, .dc-embed-image .pin { position: absolute; top: 6px; left: 6px; }
.dc-embed-fields > .pin { position: absolute; top: -2px; right: -4px; }
.dc-embed.map > .pin.bar { position: absolute; left: -13px; top: 50%; transform: translateY(-50%); box-shadow: 0 0 0 2px var(--d-chat); }
.prose table.settings td:first-child .pin { margin-right: 6px; position: relative; top: -1px; }
.dc-mention { background: rgb(88 101 242 / 0.3); color: #c9cdfb; border-radius: 3px; padding: 0 2px; font-weight: 500; }
.dc-note { margin-top: 4px; font-size: 12.5px; color: #949ba4; }

/* ---------- pager and page foot ---------- */

.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.pager-link { display: grid; gap: 4px; padding: 14px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); transition: border-color 0.15s ease, background 0.15s ease; }
.pager-link:hover { border-color: var(--accent-dim); background: var(--card-2); }
.pager-link.next { text-align: right; }
.pager-dir { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--faint); }
.pager-link.next .pager-dir { justify-content: flex-end; }
.pager-title { font-weight: 580; color: var(--text); font-size: 15px; }
.doc-foot { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--faint); }
.doc-foot a { color: var(--accent); }
.site-foot { border-top: 1px solid var(--border); }
.site-foot-inner { max-width: 1440px; margin: 0 auto; padding: 22px 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 20px; font-size: 13px; color: var(--muted); }
.site-foot nav a:hover { color: var(--text); }

/* ---------- the overview page ---------- */

.is-home .main { grid-template-columns: minmax(0, 1fr); }
.is-home .doc { max-width: 980px; }
.is-home .toc { display: none; }
.hero { padding: 16px 0 36px; border-bottom: 1px solid var(--border); margin-bottom: 36px; }
.hero .eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.hero h1 { margin-top: 12px; font-size: clamp(32px, 4.4vw, 46px); line-height: 1.08; letter-spacing: -0.035em; font-weight: 660; color: var(--text); }
.hero p { margin-top: 14px; font-size: 18px; line-height: 1.6; color: var(--muted); max-width: 60ch; }
.hero-search {
  margin-top: 24px; display: flex; align-items: center; gap: 12px; width: 100%; max-width: 560px; height: 50px; padding: 0 14px 0 16px;
  border-radius: 12px; border: 1px solid var(--border-strong); background: var(--card); color: var(--faint); font-size: 15.5px; cursor: pointer;
  transition: border-color 0.15s ease;
}
.hero-search:hover { border-color: var(--accent-dim); }
.hero-search .ic { font-size: 18px; }
.hero-search span { flex: 1; text-align: left; }
.prose .cards.big { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.prose .cards.big .card { padding: 20px 22px; gap: 6px; }
.prose .card .card-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
.prose .section-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 28px 24px; list-style: none; padding: 0; }
.prose .section-list > li { max-width: none; margin: 0; }
.prose .section-list h3 { margin-top: 0; font-size: 15px; }
.prose .section-list ul { list-style: none; padding: 0; margin-top: 8px; }
.prose .section-list ul li { margin-top: 4px; font-size: 14.5px; }
.prose .section-list ul a { color: var(--muted); text-decoration: none; }
.prose .section-list ul a:hover { color: var(--accent); }

/* ---------- search ---------- */

.search { position: fixed; inset: 0; z-index: 100; display: grid; justify-items: center; align-items: start; padding: 12vh 16px 16px; }
.search[hidden] { display: none; }
.search-backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / 0.6); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.search-panel { position: relative; width: 100%; max-width: 640px; max-height: 72vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: 0 24px 80px rgb(0 0 0 / 0.55); overflow: hidden; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 0 12px 0 16px; height: 56px; border-bottom: 1px solid var(--border); color: var(--faint); font-size: 18px; }
.search-field input { flex: 1; min-width: 0; height: 100%; background: none; border: none; outline: none; font-size: 16.5px; color: var(--text); }
.search-field input::placeholder { color: var(--faint); }
.search-field input::-webkit-search-cancel-button { display: none; }
.search-esc { background: none; border: none; cursor: pointer; }
.search-results { list-style: none; overflow-y: auto; padding: 8px; scrollbar-width: thin; }
.search-results:empty { display: none; }
.search-results li a { display: grid; gap: 3px; padding: 10px 12px; border-radius: 9px; }
.search-results li a[aria-selected="true"] { background: var(--card-3); }
.search-results .r-path { font-size: 12px; color: var(--faint); }
.search-results .r-title { font-size: 15px; font-weight: 580; color: var(--text); }
.search-results .r-text { font-size: 13.5px; color: var(--muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results mark { background: none; color: var(--accent-bright); font-weight: 600; }
.search-empty { padding: 28px 16px; text-align: center; color: var(--faint); font-size: 14px; }
.search-empty a { color: var(--accent); }
.search-foot { display: flex; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--border); font-size: 12px; color: var(--faint); }
.search-foot kbd { margin-right: 2px; }

/* ---------- smaller screens ---------- */

@media (max-width: 1200px) {
  .main { grid-template-columns: minmax(0, 1fr); padding: 36px 40px 64px; }
  .toc { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .icon-btn { display: inline-flex; }
  .side {
    position: fixed; top: var(--top); left: 0; bottom: 0; height: auto; width: min(300px, 86vw); z-index: 60;
    background: var(--bg); border-right: 1px solid var(--border); transform: translateX(-102%); transition: transform 0.22s ease; visibility: hidden;
  }
  body.menu-open .side { transform: none; visibility: visible; }
  .side-backdrop { display: block; position: fixed; inset: var(--top) 0 0 0; z-index: 55; background: rgb(0 0 0 / 0.5); }
  .side-backdrop[hidden] { display: none; }
  .top-links a:not(.btn) { display: none; }
  .search-btn { margin-left: 0; }
  .search-btn span, .search-key { display: none; }
  .search-btn { flex: 0 0 auto; width: 38px; justify-content: center; padding: 0; }
  .top-links { gap: 12px; }
  .main { padding: 28px 16px 56px; }
  .prose .anchor { display: none; }
}
@media (max-width: 520px) {
  .logo-tag { display: none; }
  .pager { grid-template-columns: minmax(0, 1fr); }
  .pager-link.next { text-align: left; }
  .pager-link.next .pager-dir { justify-content: flex-start; }
  .prose table.settings td:first-child { width: auto; }
  .prose .dc { padding: 12px; }
  .dc-msg { grid-template-columns: 32px minmax(0, 1fr); gap: 10px; }
  .dc-avatar { width: 32px; height: 32px; background-size: 21px; }
  .dc-embed-thumb { width: 56px; height: 56px; }
  .dc-embed-fields { grid-template-columns: minmax(0, 1fr); }
}
