/* djust docs — Workbench-inspired reading interface.
 * System fonts, native disclosures, no CSS build step or external assets.
 * Pygments emits monokai token classes; the palette below adapts them to
 * the site's forest and sage colors. Language headers sit outside scrolling code.
 */

:root {
  /* Surfaces. `--docs-panel` is the card/well fill; `--docs-code-bg` is a well that is
     darker than the page rather than lighter, which is how the marketing site
     treats code too. */
  --docs-bg:           var(--color-brand-dark);
  --docs-panel:        var(--color-brand-panel);
  --docs-code-bg:      #0b100d;

  /* Text, in descending emphasis. */
  --docs-fg:           var(--color-brand-text);
  --docs-fg-bright:    #ffffff;
  --docs-fg-mute:      var(--color-brand-muted);
  --docs-fg-soft:      #a4b5a9;

  /* Hairlines. `--docs-rule` is the structural one; `--docs-rule-soft` divides things
     that are already inside a bordered surface. */
  --docs-rule:         var(--color-brand-border);
  --docs-rule-soft:    #26372b;

  /* Sage: links, active state, accents, eyebrows. */
  --docs-accent:       var(--color-brand-django);
  --docs-accent-soft:  rgba(156, 215, 173, 0.10);

  /* Warm orange marks primary actions and selected entry points. */
  --docs-action:       var(--color-brand-rust);
  --docs-action-fg:    #182019;

  --docs-warn:         #e0a458;
  --docs-selection:    rgba(230, 155, 88, 0.28);

  --docs-font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --docs-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* Keep code wide enough to read while capping prose separately at its
     larger font size. The navigation columns give priority to the article. */
  --docs-measure:      74ch;
  --docs-sidebar-w:    14.5rem;
  --docs-rail-w:       11.5rem;
  --docs-masthead-h:   4rem;
  --docs-gutter:       1.5rem;
  --docs-radius:       8px;

  /* The eyebrow: uppercase mono at small size and wide tracking. Used for
     section labels, table headers, the version badge and code chips, so it is
     worth having in one place. */
  --docs-eyebrow-size:  .7rem;
  --docs-eyebrow-track: .1em;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; color-scheme: dark; }

body {
  margin: 0;
  background: var(--docs-bg);
  color: var(--docs-fg);
  font-family: var(--docs-font-sans);
  font-size: 16px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: var(--docs-selection); }

a {
  color: var(--docs-accent);
  text-decoration-color: rgba(156, 215, 173, 0.35);
  text-underline-offset: 3px;
}
a:hover { color: var(--docs-fg-bright); text-decoration-color: currentColor; }

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--docs-accent); color: var(--docs-bg);
  padding: .6rem 1rem; z-index: 100;
  font-weight: 600; border-radius: 0 0 var(--docs-radius) 0;
}
.skip-link:focus { left: 0; }

/* A 2px sage ring, offset so it never collides with a border. Keyboard users
   get the loudest thing in the palette by design. */
:focus-visible {
  outline: 2px solid var(--docs-accent);
  outline-offset: 3px;
  border-radius: 3px;
}

/* ---------------------------------------------------------------- masthead */

.masthead {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 1.25rem;
  height: var(--docs-masthead-h);
  padding: 0 var(--docs-gutter);
  background: var(--docs-bg);
  border-bottom: 1px solid var(--docs-rule);
}

.brand { display: flex; align-items: baseline; gap: .5rem; text-decoration: none; }
.brand-mark {
  font-family: var(--docs-font-mono); font-weight: 700; font-size: 1.05rem;
  color: var(--docs-accent); letter-spacing: -.02em;
}
.brand-text {
  font-size: .9rem; color: var(--docs-fg-mute);
  letter-spacing: .02em;
}
.brand:hover .brand-text { color: var(--docs-fg-bright); }

.version-badge {
  font-family: var(--docs-font-mono);
  font-size: var(--docs-eyebrow-size); letter-spacing: .06em;
  color: var(--docs-fg-soft);
  border: 1px solid var(--docs-rule); border-radius: 999px;
  padding: .15rem .6rem; white-space: nowrap;
}

/* ------------------------------------------------------------------ layout */
.layout {
  display: grid;
  grid-template-columns: var(--docs-sidebar-w) minmax(0, var(--docs-measure));
  gap: 2rem;
  justify-content: center;
  padding: 0 var(--docs-gutter);
  align-items: start;
}
.layout.has-rail {
  grid-template-columns: var(--docs-sidebar-w) minmax(0, var(--docs-measure)) var(--docs-rail-w);
}

.sidebar {
  position: sticky; top: var(--docs-masthead-h);
  max-height: calc(100vh - var(--docs-masthead-h));
  overflow-y: auto;
  padding: 1.75rem 1.25rem 3rem 0;
  border-right: 1px solid var(--docs-rule-soft);
}

.content {
  padding: 3rem 0 5rem;
  min-width: 0;
}

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

.nav-section { margin-bottom: 1.75rem; }
.nav-section-title {
  font-family: var(--docs-font-mono);
  font-size: var(--docs-eyebrow-size); font-weight: 500;
  letter-spacing: var(--docs-eyebrow-track); text-transform: uppercase;
  color: var(--docs-accent);
  margin: 0 0 .35rem;
}
.nav-section-blurb { display: none; }

.nav-group { margin-bottom: 1.25rem; }
.nav-group-title {
  font-size: .8rem; font-weight: 600; letter-spacing: .02em;
  color: var(--docs-fg-soft);
  margin: .9rem 0 .35rem;
}

.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-list li { margin: 0; }
.nav-link {
  display: block;
  padding: .4rem .65rem;
  margin-left: 0;
  font-size: .875rem; line-height: 1.5;
  color: var(--docs-fg-mute); text-decoration: none;
  border-radius: 4px;
  border-left: 2px solid transparent;
  transition: color .12s, background .12s, border-color .12s;
}
.nav-link:hover { color: var(--docs-fg-bright); background: var(--docs-accent-soft); }
.nav-link.is-active {
  color: var(--docs-accent);
  background: var(--docs-accent-soft);
  border-left-color: var(--docs-accent);
  font-weight: 500;
}

/* Pages no door claims. Render them, but make the gap impossible to miss. */
.nav-section-unclaimed { border-top: 1px dashed var(--docs-rule); padding-top: 1.1rem; }
.nav-section-unclaimed .nav-section-title { color: var(--docs-warn); }

/* -------------------------------------------------------------------- rail
 *
 * The outline, pinned beside the article. It is a <nav> named by aria-label,
 * so its title is a <p> rather than a heading — the page's heading outline
 * describes the document, and a navigation label is not part of it.
 */
.rail {
  position: sticky; top: var(--docs-masthead-h);
  max-height: calc(100vh - var(--docs-masthead-h));
  overflow-y: auto;
  padding: 3rem 0 3rem;
  font-size: .875rem;
}
.rail-title {
  font-family: var(--docs-font-mono);
  font-size: var(--docs-eyebrow-size); font-weight: 500;
  letter-spacing: var(--docs-eyebrow-track); text-transform: uppercase;
  color: var(--docs-fg-soft);
  margin: 0 0 .7rem;
}
.rail-list { list-style: none; margin: 0; padding: 0; }
.rail-list li { margin: .3rem 0; }
.rail-list a {
  display: block;
  color: var(--docs-fg-soft); text-decoration: none;
  line-height: 1.45;
  border-left: 2px solid var(--docs-rule-soft);
  padding: .25rem 0 .25rem .85rem;
  margin-left: -.1rem;
  transition: color .12s, border-color .12s;
}
.rail-list a:hover { color: var(--docs-accent); border-left-color: var(--docs-accent); }
.rail-level-3 a { padding-left: 1.5rem; font-size: .79rem; }

/* --------------------------------------------------------------------- doc */

.doc h1 {
  font-size: clamp(2.25rem, 3.5vw, 2.875rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.035em;
  margin: 0 0 .6rem;
  color: var(--docs-fg-bright);
}
.doc-lede {
  font-size: 1.125rem; line-height: 1.65;
  color: var(--docs-fg-mute);
  margin: 1rem 0 2rem;
  max-width: 60ch;
}
.doc-body {
  margin-top: 2.25rem;
  font-size: 1.0625rem;
  line-height: 1.85;
  overflow-wrap: break-word;
}
.doc-body > :is(p, ul, ol) { max-width: 66ch; }
.doc-body > :first-child { margin-top: 0; }
.doc-body li::marker { color: var(--docs-accent); }
.doc-body li > p { margin-bottom: .75rem; }
.doc-body img { max-width: 100%; height: auto; }
.doc-body :is(h2, h3):target { color: var(--docs-accent); }

/* Headings inside the rendered body. h2 carries a hairline above it, which is
   what actually separates sections — there is no extra colour or weight to
   spend, so the rule does the work. */
.doc-body h2 {
  font-size: 1.5rem; font-weight: 700;
  line-height: 1.25; letter-spacing: -.022em;
  color: var(--docs-fg-bright);
  margin: 3rem 0 .85rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--docs-rule-soft);
}
.doc-body h3 {
  font-size: 1.2rem; font-weight: 700;
  line-height: 1.35; letter-spacing: -.015em;
  color: var(--docs-fg-bright);
  margin: 2.25rem 0 .6rem;
}
.doc-body h4 {
  font-size: .82rem; font-weight: 600;
  letter-spacing: .04em; text-transform: uppercase;
  font-family: var(--docs-font-mono);
  color: var(--docs-fg-soft);
  margin: 1.75rem 0 .5rem;
}

/* Anchor jumps must clear the sticky masthead. */
.doc :is(h1, h2, h3, h4) { scroll-margin-top: calc(var(--docs-masthead-h) + 1.5rem); }

/* Separate paragraphs and list items without interrupting the reading rhythm. */
.doc-body p { margin: 0 0 1.4rem; }
.doc-body ul, .doc-body ol { padding-left: 1.4rem; margin: 0 0 1.6rem; }
.doc-body li { margin: .7rem 0; padding-left: .2rem; }
.doc-body li > ul, .doc-body li > ol { margin: .45rem 0; }
.doc-body strong { color: var(--docs-fg-bright); font-weight: 600; }
.doc-body hr { border: 0; border-top: 1px solid var(--docs-rule-soft); margin: 2.75rem 0; }

.doc-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--docs-panel);
  border-radius: 0 var(--docs-radius) var(--docs-radius) 0;
  border-left: 3px solid var(--docs-accent);
  color: var(--docs-fg-mute);
}
.doc-body blockquote p:last-child { margin-bottom: 0; }

/* -------------------------------------------------------------------- code */

.doc-body code {
  font-family: var(--docs-font-mono); font-size: .86em;
  background: var(--docs-panel);
  color: var(--docs-accent);
  padding: .15em .35em; border-radius: 4px;
  overflow-wrap: anywhere;
}

.doc-body pre {
  font-family: var(--docs-font-mono);
  font-size: .875rem; line-height: 1.8;
  margin: 0;
  padding: 1rem 1.15rem;
  overflow-x: auto;
  background: var(--docs-code-bg);
  border: 1px solid var(--docs-rule);
  border-radius: var(--docs-radius);
  color: #d3ddd7;
  tab-size: 4;
}
.doc-body pre code {
  background: none; border: 0; padding: 0;
  font-size: inherit; color: inherit;
}

/* A highlighted block: the wrapper is the well and the language header;
   the inner <pre> only scrolls. */
.doc-body .highlight {
  position: relative;
  margin: 1.4rem 0;
  background: var(--docs-code-bg);
  border: 1px solid var(--docs-rule);
  border-radius: var(--docs-radius);
  overflow: hidden;
}
.doc-body .highlight pre {
  border: 0; border-radius: 0; background: none; margin: 0;
}

/* The language chip. Pinned to the wrapper, never the <pre> — see the header
   note. `pointer-events: none` keeps it out of text selection drags. */
.doc-body .highlight[data-lang] pre { padding-top: 1rem; }
.doc-body .highlight[data-lang]::before {
  content: attr(data-lang);
  display: block;
  padding: .55rem 1.15rem;
  border-bottom: 1px solid var(--docs-rule-soft);
  background: var(--docs-panel);
  font-family: var(--docs-font-mono);
  font-size: .7rem; font-weight: 500;
  letter-spacing: var(--docs-eyebrow-track); text-transform: uppercase;
  color: var(--docs-fg-soft);
  pointer-events: none;
}

/* Pygments token repaint — One Dark, over monokai's class names. */
.highlight { color: #d3ddd7; }
.highlight .c, .highlight .c1, .highlight .cm, .highlight .cs, .highlight .cp {
  color: #a4b5a9; font-style: italic;
}
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn,
.highlight .kp, .highlight .kr, .highlight .ow { color: #a9dabb; }
.highlight .kt { color: #e5c07b; }
.highlight .s, .highlight .s1, .highlight .s2, .highlight .sb,
.highlight .sc, .highlight .sd, .highlight .sh, .highlight .si,
.highlight .sx, .highlight .sr, .highlight .ss, .highlight .se { color: #98c379; }
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh,
.highlight .mi, .highlight .mo, .highlight .il { color: #d19a66; }
.highlight .nf, .highlight .fm { color: #61afef; }
.highlight .nc, .highlight .ne, .highlight .nb { color: #ebc58e; }
.highlight .nd { color: var(--docs-action); }
.highlight .n  { color: #d3ddd7; }
.highlight .na { color: #d19a66; }
.highlight .nv, .highlight .vc, .highlight .vg,
.highlight .vi, .highlight .vm, .highlight .nt { color: #e06c75; }
.highlight .o  { color: #56b6c2; }
.highlight .err { color: #e06c75; background: none; }
.highlight .gd { color: #e06c75; }
.highlight .gi { color: #98c379; }
/* Whitespace spans are rewritten to &nbsp; by the renderer so minifiers cannot
   collapse them. They must never be given a colour of their own. */
.highlight .w  { color: inherit; }

/* ------------------------------------------------------------------ tables
 *
 * Tables carry most of the reference and task-index pages, so they get real
 * attention rather than defaults. Headers take the monospace eyebrow, which
 * is also what keeps a two-column "I want to… / Go to" table legible.
 */
.doc-body table {
  border-collapse: collapse;
  width: 100%;
  margin: 0;
  font-size: .9375rem;
}
.doc-body th, .doc-body td {
  border-bottom: 1px solid var(--docs-rule-soft);
  padding: .95rem 1.1rem;
  text-align: left;
  vertical-align: top;
}
.doc-body th {
  font-family: var(--docs-font-mono);
  font-size: var(--docs-eyebrow-size); font-weight: 500;
  letter-spacing: var(--docs-eyebrow-track); text-transform: uppercase;
  color: var(--docs-fg-soft);
  border-bottom-color: var(--docs-rule);
  white-space: nowrap;
}
.doc-body tbody tr:hover { background: rgba(156, 215, 173, 0.04); }
/* Prose code may break anywhere so it never overflows a paragraph, but in a
   table that makes every token's min-content one character wide and the
   auto layout starves narrow columns (`'reorder'` rendered as `'reorde` / `r'`).
   Cell code never wraps (hyphens and slashes are break points too, so
   `'top-right'` would still split); the longest generated value is ~44
   characters, and a table that ends up wider than the column scrolls inside
   its `.table-scroll` wrapper, not the page. */
.doc-body td code { font-size: .9em; background: none; padding: 0; white-space: nowrap; overflow-wrap: normal; }

/* ------------------------------------------------------------------- pager */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 4rem;
  background: var(--docs-rule-soft);
  border: 1px solid var(--docs-rule-soft);
  border-radius: var(--docs-radius);
  overflow: hidden;
}
.pager-link {
  display: flex; flex-direction: column; gap: .6rem;
  padding: 1.25rem 1.4rem;
  background: var(--docs-bg);
  text-decoration: none;
  transition: background .12s;
}
.pager-link:hover { background: var(--docs-panel); }
.pager-next { text-align: right; align-items: flex-end; }
.pager-label {
  font-family: var(--docs-font-mono);
  font-size: var(--docs-eyebrow-size); font-weight: 500;
  letter-spacing: var(--docs-eyebrow-track); text-transform: uppercase;
  color: var(--docs-fg-soft);
}
.pager-title { font-size: .9rem; color: var(--docs-fg); }
.pager-link:hover .pager-title { color: var(--docs-accent); }

.page-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--docs-rule-soft);
  font-size: .8rem;
  color: var(--docs-fg-soft);
}
.page-footer a { color: var(--docs-fg-soft); }
.page-footer a:hover { color: var(--docs-accent); }

/* ----------------------------------------------------------------- notices */

.notice {
  border: 1px solid var(--docs-rule);
  border-left: 3px solid var(--docs-warn);
  border-radius: var(--docs-radius);
  padding: .85rem 1.1rem;
  margin: 1.5rem 0;
  font-size: .9rem;
  color: var(--docs-fg-mute);
  background: var(--docs-panel);
}

/* The one place orange is spent on this site. */
.button {
  display: inline-flex; align-items: center;
  min-height: 44px;
  padding: .6rem 1.15rem;
  background: var(--docs-action); color: var(--docs-action-fg);
  font-size: .875rem; font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent; border-radius: var(--docs-radius);
  transition: background .15s;
}
.button:hover {
  color: var(--docs-action-fg);
  background: color-mix(in srgb, var(--docs-action) 85%, white);
}

/* ------------------------------------------------------- home (fallback) */

.home-group { margin-bottom: 2rem; }
.home-group h2 {
  font-family: var(--docs-font-mono);
  font-size: var(--docs-eyebrow-size); font-weight: 500;
  letter-spacing: var(--docs-eyebrow-track); text-transform: uppercase;
  color: var(--docs-fg-soft);
  margin: 0 0 .6rem;
}
.home-group ul { list-style: none; padding: 0; margin: 0; font-size: .9rem; }
.home-group li { margin: .3rem 0; }

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

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.masthead-search { flex: 1 1 auto; max-width: 30rem; margin: 0 .5rem; }
.masthead-right { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.masthead-search input {
  width: 100%;
  background: var(--docs-panel); color: var(--docs-fg);
  border: 1px solid var(--docs-rule); border-radius: var(--docs-radius);
  padding: .45rem .75rem;
  font-size: .9375rem; font-family: inherit;
  min-height: 40px;
}
.masthead-search input::placeholder { color: var(--docs-fg-soft); }
.masthead-search input:focus { border-color: var(--docs-accent); }

.search-input {
  width: 100%;
  background: var(--docs-panel); color: var(--docs-fg-bright);
  border: 1px solid var(--docs-rule); border-radius: var(--docs-radius);
  padding: .7rem .9rem;
  font-size: 1rem; font-family: inherit;
  margin: .5rem 0 1.75rem;
  min-height: 44px;
}
.search-input:focus { border-color: var(--docs-accent); }

.search-count, .search-hint, .search-empty {
  font-size: .875rem; color: var(--docs-fg-mute); margin: 0 0 1.35rem;
}
.search-results { list-style: none; margin: 0; padding: 0; }
.search-result { padding: 1rem 0; border-top: 1px solid var(--docs-rule-soft); }
.search-result:first-child { border-top: 0; }
.search-result-title { font-size: 1rem; font-weight: 600; text-decoration: none; }
.search-result-section {
  margin-left: .55rem;
  font-family: var(--docs-font-mono);
  font-size: var(--docs-eyebrow-size); letter-spacing: .06em; text-transform: uppercase;
  color: var(--docs-fg-soft);
}
.search-result-snippet {
  margin: .35rem 0 0;
  font-size: .875rem; line-height: 1.6;
  color: var(--docs-fg-mute);
}
.search-fallback {
  margin-top: 3rem; padding-top: 1.1rem;
  border-top: 1px solid var(--docs-rule-soft);
  font-size: .8rem; color: var(--docs-fg-soft);
}

/* ------------------------------------------------------ Workbench details */
.brand { gap: .75rem; flex-shrink: 0; }
.brand-mark { font-size: 1.4rem; letter-spacing: -.07em; }
.brand-mark span { color: var(--docs-fg); }
.brand-divider { color: var(--docs-rule); font-size: 1.5rem; font-weight: 300; }
.brand-text { font-size: .9375rem; }
.project-link { color: var(--docs-fg-mute); font-size: .8125rem; text-decoration: none; white-space: nowrap; }
.project-link span { color: var(--docs-accent); margin-left: .25rem; }
.doc-header { border-bottom: 1px solid var(--docs-rule); padding-bottom: 2rem; }
.doc-header .doc-lede { margin-bottom: 0; max-width: 58ch; }
.doc-context { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.breadcrumbs { display: flex; align-items: center; gap: .7rem; font-size: .8rem; }
.breadcrumbs a { color: var(--docs-accent); text-decoration: none; }
.breadcrumbs > span { color: var(--docs-fg-soft); }
.doc-level { font: .65rem/1.6 var(--docs-font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--docs-fg-soft); border-left: 1px solid var(--docs-rule); padding-left: 1rem; }
.nav-folder { margin: .2rem 0; }
.nav-folder > summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; cursor: pointer; list-style: none; font-size: .875rem; color: var(--docs-fg-mute); padding: .55rem .65rem; border-radius: 4px; }
.nav-folder > summary::-webkit-details-marker { display: none; }
.nav-folder > summary::after { content: "›"; color: var(--docs-fg-soft); font-size: 1.1rem; }
.nav-folder[open] > summary { color: var(--docs-fg); }
.nav-folder[open] > summary::after { transform: rotate(90deg); }
.nav-folder > summary:hover { background: var(--docs-accent-soft); color: var(--docs-accent); }
.nav-folder .nav-list { margin: .2rem 0 .6rem .65rem; padding-left: .5rem; border-left: 1px solid var(--docs-rule-soft); }
.nav-section-title { font-size: .6875rem; letter-spacing: .12em; margin-bottom: .65rem; }
.nav-section { margin-bottom: 1.5rem; }
.rail-list a { font-size: .8125rem; }
.rail-level-3 a { font-size: .75rem; }
.rail-tools { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--docs-rule-soft); }
.rail-tools > a { font-size: .8rem; text-decoration: none; }
.doc-body blockquote strong { color: var(--docs-accent); }
.doc-body blockquote { font-size: .9375rem; line-height: 1.8; }
.table-scroll { overflow-x: auto; margin: 1.75rem 0; border: 1px solid var(--docs-rule); border-radius: var(--docs-radius); }
.doc-body th { background: var(--docs-panel); color: var(--docs-fg-mute); font-size: .75rem; letter-spacing: .04em; }
.doc-body tbody tr:last-child td { border-bottom: 0; }
.doc-body td:first-child { min-width: 10rem; }
.doc-body td:last-child { min-width: 12rem; }
.doc-body pre:focus-visible { outline-offset: -3px; }
.search h1 { font-size: clamp(2.25rem, 3.5vw, 2.875rem); line-height: 1.15; letter-spacing: -.035em; margin: 0; }
.search-result { padding: 1.5rem 0; }
.search-result-snippet { font-size: .9375rem; line-height: 1.8; }

/* ------------------------------------------------------------- responsive */

/* Native disclosures keep navigation usable without a client script. */
.mobile-navigation, .inline-toc { display: none; }
.mobile-navigation summary, .inline-toc summary {
  cursor: pointer;
  color: var(--docs-fg-mute);
  font-size: .875rem;
  font-weight: 600;
  min-height: 44px;
  padding: .75rem 0;
}
.mobile-navigation summary::marker, .inline-toc summary::marker { color: var(--docs-accent); }
.inline-toc {
  margin: 1.5rem 0 2rem;
  border-top: 1px solid var(--docs-rule-soft);
  border-bottom: 1px solid var(--docs-rule-soft);
}
.inline-toc .rail-list { padding: 0 0 1rem; }

@media (max-width: 78rem) {
  .layout, .layout.has-rail {
    grid-template-columns: var(--docs-sidebar-w) minmax(0, var(--docs-measure));
    gap: 2rem;
  }
  .rail { display: none; }
  .masthead-right { gap: 1rem; }
  .inline-toc { display: block; }
}

@media (max-width: 60rem) {
  :root { --docs-gutter: 1.5rem; }
  .layout, .layout.has-rail {
    grid-template-columns: minmax(0, var(--docs-measure));
    gap: 0;
  }
  .sidebar { display: none; }
  .mobile-navigation {
    display: block;
    padding: 0 var(--docs-gutter);
    border-bottom: 1px solid var(--docs-rule-soft);
  }
  .mobile-navigation nav {
    max-height: 60vh;
    overflow-y: auto;
    padding: .5rem .5rem 1rem;
  }
  .mobile-navigation .nav-link { min-height: 44px; padding-top: .7rem; }
  .content { padding-top: 2rem; }
  .mobile-navigation .nav-folder > summary { min-height: 44px; }
  .project-link { display: none; }
  .doc h1 { font-size: 2.25rem; }
  .doc-body h2 { font-size: 1.4rem; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; align-items: flex-start; }
  .masthead-search { max-width: none; }
  .inline-toc .rail-list a { padding-top: .7rem; padding-bottom: .7rem; }
}

@media (max-width: 35rem) {
  :root { --docs-gutter: 1.25rem; }
  .masthead { gap: .75rem; flex-wrap: wrap; height: auto; padding-block: .75rem; }
  .doc-body td:first-child { min-width: 9.5rem; }
  .doc-body td:last-child { min-width: 10rem; }
  .doc-context { margin-bottom: 1.25rem; }
  .doc-header { padding-bottom: 1.5rem; }
  .doc-level { font-size: .625rem; }
  .masthead-search { order: 3; flex-basis: 100%; margin: 0; }
  .masthead-search input { font-size: 1rem; min-height: 44px; }
  .doc-lede { font-size: 1.0625rem; }
  .doc-body { font-size: 1rem; }
  .doc-body pre { padding: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
  .doc :is(h1, h2, h3, h4) { scroll-margin-top: 9rem; }
}

/* ------------------------------------------------- reduced motion
 *
 * `scroll-behavior: smooth` on <html> is the one that matters here — a long
 * anchor jump animating down the page is a vestibular trigger, not a nicety.
 * The transitions are small, but there is no reason to keep them either.
 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --------------------------------------------------------------- printing
 *
 * A dark page prints as a grey rectangle and burns toner. This is a small,
 * deliberate flip rather than a full light theme — enough to be usable, not
 * an unaudited second palette to maintain.
 */
@media print {
  :root {
    --docs-bg: #fff; --docs-panel: #fff; --docs-code-bg: #fff;
    --docs-fg: #111; --docs-fg-bright: #000; --docs-fg-mute: #333; --docs-fg-soft: #555;
    --docs-rule: #bbb; --docs-rule-soft: #ddd;
    --docs-accent: #14532d;
  }
  .masthead, .sidebar, .rail, .pager, .page-footer, .skip-link, .mobile-navigation, .inline-toc { display: none; }
  html { color-scheme: light; }
  .doc-body pre, .doc-body .highlight, .doc-body .highlight span { color: #111; }
  .table-scroll { overflow: visible; }
  .doc-body pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  .layout, .layout.has-rail { display: block; padding: 0; }
  .content { padding: 0; }
  a { text-decoration: underline; }
  .doc-body pre, .doc-body .highlight { border-color: #bbb; }
  .doc-body h2 { break-after: avoid; }
  .doc-body pre, .doc-body table, .doc-body blockquote { break-inside: avoid; }
}

/* Quick paths and the topic directory share the sidebar's taxonomy. */
.nav-cheatsheet {
  display: flex; align-items: center; gap: .5rem;
  padding: .7rem .65rem; margin-bottom: 1.5rem;
  border: 1px solid var(--docs-rule); border-radius: var(--docs-radius);
  color: var(--docs-accent); background: var(--docs-accent-soft);
  font-size: .8rem; font-weight: 650; text-decoration: none;
}
.nav-cheatsheet span:last-child { margin-left: auto; }
.nav-cheatsheet:hover { border-color: var(--docs-accent); }
.quick-link { font-size: .8rem; text-decoration: none; white-space: nowrap; }
.cheat-link { color: var(--docs-action); }
.guide-directory { margin: 2rem 0 3rem; }
.guide-directory > h2 { font-size: 1.4rem; letter-spacing: -.02em; }
.guide-directory > p { color: var(--docs-fg-mute); }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; align-items: start; }
.topic-card { border: 1px solid var(--docs-rule); border-radius: var(--docs-radius); background: var(--docs-panel); overflow: hidden; }
.topic-card summary { cursor: pointer; padding: 1rem; position: relative; list-style: none; }
.topic-card summary::-webkit-details-marker { display: none; }
.topic-card summary::after { content: "+"; position: absolute; top: .9rem; right: 1rem; color: var(--docs-accent); }
.topic-card[open] summary::after { content: "−"; }
.topic-card summary:hover { background: var(--docs-accent-soft); }
.topic-title { display: block; font-size: .98rem; font-weight: 650; padding-right: 1rem; }
.topic-count { display: block; font-family: var(--docs-font-mono); font-size: .7rem; color: var(--docs-accent); margin: .35rem 0; }
.topic-description { display: block; color: var(--docs-fg-mute); font-size: .85rem; line-height: 1.65; }
.topic-card ul { border-top: 1px solid var(--docs-rule-soft); padding: .5rem 1rem 1rem 2rem; margin: 0; font-size: .85rem; }
.topic-card li { margin-top: .55rem; }
@media (max-width: 40rem) {
  .topic-grid { grid-template-columns: minmax(0, 1fr); }
  .masthead-right .quick-link:first-child { display: none; }
  .masthead { gap: .65rem; }
  .masthead-right { gap: .6rem; }
  .masthead-right .version-badge { display: none; }
  .cheat-link { font-size: .75rem; }
}

.related-references { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; padding: 1rem 1.25rem; margin: 1.5rem 0; border-left: 2px solid var(--docs-accent); background: var(--docs-accent-soft); border-radius: 0 var(--docs-radius) var(--docs-radius) 0; font-size: .85rem; }
.related-references > span { flex-basis: 100%; color: var(--docs-fg-mute); font-size: .75rem; }

.doc-body td a { overflow-wrap: anywhere; }

/* Brand tokens come from the same native Workbench pack as djust.org.
   Documentation keeps its own typography, measure, and navigation density. */
.brand a { text-decoration: none; }
.brand-text { border-bottom: 1px solid var(--docs-accent); padding-bottom: .15rem; }
.ecosystem-footer { max-width: 84rem; margin: 4rem auto 0; padding: 1.5rem var(--docs-gutter) 2rem; border-top: 1px solid var(--docs-rule); display: flex; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; font-size: .8rem; color: var(--docs-fg-mute); }
.ecosystem-footer p { margin: 0; display: flex; gap: 1rem; align-items: baseline; }
.ecosystem-footer p > a { font-family: var(--docs-font-mono); font-size: 1rem; font-weight: 700; }
.ecosystem-footer nav { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.ecosystem-footer a { text-decoration: none; }
@media (max-width: 78rem) { .masthead-right .community-link { display: none; } }

/* Reading pages use a flat surface even when the shared pack adds decoration. */
body::before { content: none; }

/* Scope reading tokens so native theme HSL channels cannot replace CSS colors. */
.masthead { border-top: 2px solid var(--docs-accent); }
.nav-cheatsheet { color: var(--docs-action); border-color: color-mix(in srgb, var(--docs-action) 35%, var(--docs-rule)); background: color-mix(in srgb, var(--docs-action) 8%, var(--docs-bg)); }
.doc-header { position: relative; }
.doc-header::after { content: ""; display: block; position: absolute; bottom: -1px; left: 0; width: 3rem; height: 2px; background: var(--docs-accent); }
.topic-card { border-top: 2px solid color-mix(in srgb, var(--docs-accent) 55%, var(--docs-rule)); }
.topic-card:nth-child(3n + 2) { border-top-color: var(--docs-action); }
.doc-start .doc-header {
  padding: 2rem; margin: -1rem 0 2rem; border: 1px solid var(--docs-rule); border-radius: 12px;
  background: radial-gradient(ellipse at 100% 0%, rgba(156,215,173,.13), transparent 65%), var(--docs-panel);
  overflow: hidden;
}
.doc-start .doc-header::after { left: 2rem; width: 5rem; background: var(--docs-action); }
.doc-start .doc-context { margin-bottom: 1.75rem; }
.doc-start h1 { font-size: clamp(2.3rem, 4vw, 3.5rem); letter-spacing: -.045em; }
.doc-start h1 span { display: block; color: var(--docs-accent); }
.doc-start .doc-lede { font-size: 1.1rem; max-width: 43ch; }
.start-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.75rem; }
.start-actions a { display: inline-flex; align-items: center; justify-content: center; gap: 1rem; min-height: 44px; padding: .7rem 1rem; border: 1px solid var(--docs-rule); border-radius: 6px; font-size: .875rem; font-weight: 650; text-decoration: none; color: var(--docs-fg); }
.start-actions .start-primary { background: var(--docs-action); border-color: var(--docs-action); color: var(--docs-action-fg); }
.start-actions a:hover { border-color: var(--docs-accent); box-shadow: 0 0 0 1px var(--docs-accent); }
.doc-start #keep-these-close + ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; list-style: none; padding: 0; }
.doc-start #keep-these-close + ul > li { position: relative; margin: 0; padding: 1.2rem; font-size: .9rem; line-height: 1.7; border: 1px solid var(--docs-rule); border-radius: 8px; background: var(--docs-panel); color: var(--docs-fg-mute); }
.doc-start #keep-these-close + ul strong { display: block; margin-bottom: .5rem; font-size: 1rem; }
.doc-start #keep-these-close + ul a { color: var(--docs-accent); text-decoration: none; }
.doc-start #keep-these-close + ul a::after { content: ""; position: absolute; inset: 0; border-radius: 8px; }
.doc-start #keep-these-close + ul a:focus-visible::after { outline: 2px solid var(--docs-accent); outline-offset: 3px; }
.doc-start #keep-these-close + ul > li:hover { border-color: var(--docs-accent); }
.doc-start #keep-these-close + ul > li:first-child { background: color-mix(in srgb, var(--docs-action) 7%, var(--docs-panel)); border-color: color-mix(in srgb, var(--docs-action) 45%, var(--docs-rule)); }
.doc-start #keep-these-close + ul > li:first-child a { color: var(--docs-action); }
@media (max-width: 40rem) {
  .doc-start .doc-header { padding: 1.4rem; margin-top: 0; }
  .doc-start h1 { font-size: 2.35rem; }
  .doc-start #keep-these-close + ul { grid-template-columns: 1fr; }
}
@media print {
  .doc-start .doc-header, .doc-start #keep-these-close + ul > li { background: white; }
  .start-actions, .ecosystem-footer { display: none; }
}
