@font-face { font-family: "Plex Sans"; src: url(/fonts/plex-sans-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(/fonts/plex-sans-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url(/fonts/plex-sans-600.woff2) format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url(/fonts/plex-mono-500.woff2) format("woff2"); font-weight: 500; font-display: swap; }

:root {
  color-scheme: light dark;
  &:has(> head > meta[name="color-scheme"][content="dark"]) { color-scheme: dark; }
  &:has(> head > meta[name="color-scheme"][content="light"]) { color-scheme: light; }

  --bg: light-dark(oklch(0.988 0.003 85), oklch(0.175 0.005 75));
  --surface: light-dark(oklch(0.965 0.005 85), oklch(0.215 0.006 75));
  --surface-2: light-dark(oklch(0.935 0.006 85), oklch(0.26 0.007 75));
  --line: light-dark(oklch(0.895 0.007 85), oklch(0.3 0.007 75));
  --line-strong: light-dark(oklch(0.8 0.01 85), oklch(0.4 0.008 75));
  --fg-strong: light-dark(oklch(0.2 0.01 75), oklch(0.97 0.004 85));
  --fg: light-dark(oklch(0.3 0.01 75), oklch(0.87 0.005 85));
  --muted: light-dark(oklch(0.47 0.012 75), oklch(0.7 0.007 85));
  --accent: light-dark(oklch(0.49 0.15 42), oklch(0.77 0.13 58));
  --accent-soft: light-dark(oklch(0.94 0.035 60), oklch(0.29 0.05 55));
  --blue: light-dark(oklch(0.48 0.12 250), oklch(0.77 0.1 245));
  --blue-soft: light-dark(oklch(0.95 0.02 245), oklch(0.27 0.04 250));
  --sans: "Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "Plex Mono", ui-monospace, Menlo, monospace;
  --bar: 52px;
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--bar) + 24px); -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; font: 400 16px/1.65 var(--sans); color: var(--fg); background: var(--bg); }
a { color: inherit; }
pre, .table, .tree, .panel { scrollbar-width: thin; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 30; padding: 8px 12px; background: var(--fg-strong); color: var(--bg); }
.skip:focus { top: 8px; }

/* The top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; height: var(--bar); padding: 0 24px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; flex: none; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; color: var(--fg-strong); text-decoration: none; }
.brand svg { color: var(--accent); }
.areas { display: flex; flex: 1; align-self: stretch; gap: 22px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.areas a { display: flex; flex: none; align-items: center; border-block: 2px solid transparent; font-size: 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.areas a:hover { color: var(--fg-strong); }
.areas a[aria-current] { color: var(--fg-strong); border-bottom-color: var(--accent); }
.theme { flex: none; height: 30px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--fg); font: 500 13px var(--sans); cursor: pointer; }
.theme:hover { background: var(--surface); }

/* The theme button names the scheme that it changes to. */
.theme-to-light { display: none; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-to-light { display: inline; }
:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-to-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-to-light { display: inline; }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-to-dark { display: none; }
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .line span[style] { color: var(--shiki-dark) !important; }
}
:root:has(> head > meta[name="color-scheme"][content="dark"]) .line span[style] { color: var(--shiki-dark) !important; }

/* The layout */
.layout { display: grid; grid-template-columns: 232px minmax(0, 700px) 208px; justify-content: center; gap: 0 48px; max-width: 1360px; margin: 0 auto; padding: 0 24px; }
.pages { display: none; }
.sidebar, .outline { position: sticky; top: var(--bar); align-self: start; max-height: calc(100dvh - var(--bar)); overflow-y: auto; padding-block: 32px; }
.side ul { margin: 0; padding: 0; list-style: none; }
.side li + li { margin-top: 1px; }
.side a { display: block; padding: 5px 10px; margin-inline-start: -10px; border-radius: var(--radius); font-size: 14.5px; line-height: 1.4; color: var(--muted); text-decoration: none; }
.side a:hover { color: var(--fg-strong); background: var(--surface); }
.side a[aria-current] { color: var(--fg-strong); font-weight: 500; background: var(--surface-2); }
.side-section { margin: 20px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--fg-strong); }
.outline p { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; color: var(--fg-strong); }
.outline ul { margin: 0; padding: 0; list-style: none; border-inline-start: 1px solid var(--line); }
.outline a { display: block; margin-inline-start: -1px; padding: 3px 0 3px 12px; border-inline-start: 2px solid transparent; font-size: 13px; line-height: 1.4; color: var(--muted); text-decoration: none; }
.outline .depth-3 a { padding-inline-start: 24px; }
.outline a:hover { color: var(--fg-strong); }
[data-outline] { scroll-target-group: auto; }
.outline a:is(:target-current, .target-current) { color: var(--fg-strong); font-weight: 500; border-inline-start-color: var(--accent); }
main { min-width: 0; padding-block: 44px 72px; }

/* The article */
.body > :first-child { margin-top: 0; }
.body h1 { margin: 0 0 16px; font-size: clamp(30px, 3.2vw, 38px); font-weight: 600; line-height: 1.15; letter-spacing: -0.02em; color: var(--fg-strong); text-wrap: balance; }
.body h1 + p { font-size: 18px; line-height: 1.6; color: var(--fg); }
.body h2 { margin: 52px 0 12px; font-size: 23px; font-weight: 600; line-height: 1.25; letter-spacing: -0.012em; color: var(--fg-strong); }
.body h3 { margin: 32px 0 8px; font-size: 18px; font-weight: 600; line-height: 1.35; color: var(--fg-strong); }
.body h4 { margin: 24px 0 6px; font-size: 16px; font-weight: 600; color: var(--fg-strong); }
.body :is(h2, h3, h4) { position: relative; }
.anchor { position: absolute; inset-inline-start: -1.05em; padding-inline-end: 0.3em; font-weight: 400; color: var(--muted); text-decoration: none; opacity: 0; }
:is(h2, h3, h4):hover .anchor, .anchor:focus-visible { opacity: 1; }
.body p { margin: 14px 0 0; text-wrap: pretty; }
.body ul, .body ol { margin: 14px 0 0; padding-inline-start: 22px; }
.body li { margin-top: 5px; }
.body li::marker { color: var(--muted); }
.body a:not(.anchor, .card) { color: var(--fg-strong); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.body a:not(.anchor, .card):hover { text-decoration-color: var(--accent); }
.body strong { font-weight: 600; color: var(--fg-strong); }
.body :not(pre) > code { padding: 0.1em 0.32em; border-radius: 4px; font: 0.875em var(--mono); color: var(--fg-strong); background: var(--surface-2); overflow-wrap: anywhere; }
.body hr { margin: 40px 0; border: 0; border-top: 1px solid var(--line); }

/* Code */
.code, .prompt-box { position: relative; margin-top: 16px; }
.code pre { margin: 0; padding: 14px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: 13.5px/1.65 var(--mono); }
.code code { font: inherit; }
.code-plain pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.line { display: inline; }
.copy { position: absolute; top: 8px; right: 8px; height: 26px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 5px; background: var(--bg); color: var(--muted); font: 500 12px var(--sans); cursor: pointer; opacity: 0; }
.code:hover .copy, .copy:focus-visible, .copy[data-done] { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }
.copy:hover { color: var(--fg-strong); }

/* The prompt for an agent */
.prompt { margin-top: 28px; padding: 18px 18px 18px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); }
.body .prompt-title { margin: 0; font-size: 16px; }
.prompt > p { margin-top: 4px; font-size: 15px; color: var(--muted); }
.prompt-box { padding: 12px 14px 48px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); }
.prompt-box pre { margin: 0; max-height: 300px; overflow: auto; font: 13px/1.6 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--fg); }
.prompt-box code { font: inherit; }
.copy-strong { top: auto; bottom: 8px; height: 30px; padding: 0 12px; border-color: transparent; background: var(--fg-strong); color: var(--bg); font-size: 13px; opacity: 1; }
.copy-strong:hover { color: var(--bg); opacity: 0.88; }

/* Steps */
.steps { margin: 24px 0 0; padding: 0; list-style: none; counter-reset: step; }
.body .step { position: relative; margin: 0; padding: 0 0 26px 40px; counter-increment: step; }
.step::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 1px; display: grid; place-items: center; width: 25px; height: 25px; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--bg); font: 500 12px var(--mono); color: var(--fg-strong); z-index: 1; }
.step:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 12px; top: 26px; bottom: 0; width: 1px; background: var(--line); }
.step > h3 { margin: 0 0 4px; font-size: 16.5px; line-height: 1.6; }
.step > h3 .anchor { display: none; }
.step > p:first-of-type { margin-top: 4px; }

/* Alerts */
.callout { margin-top: 20px; padding: 12px 16px; border-inline-start: 3px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; background: var(--blue-soft); font-size: 15px; }
.callout-warning, .callout-caution, .callout-important { border-inline-start-color: var(--accent); background: var(--accent-soft); }
.body .callout-title { margin: 0; font-size: 13px; font-weight: 600; color: var(--fg-strong); }
.callout > p:not(.callout-title) { margin-top: 2px; }

/* Tables */
.table { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.table th { padding: 8px 12px; text-align: start; font-weight: 600; font-size: 13px; color: var(--fg-strong); background: var(--surface); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 12px; vertical-align: top; border-top: 1px solid var(--line); }
.table tr:first-child td { border-top: 0; }
.table td:first-child code { white-space: nowrap; overflow-wrap: normal; }

/* Tabs */
.tabs { margin-top: 18px; }
[role="tablist"] { display: flex; gap: 2px; border-bottom: 1px solid var(--line); }
[role="tab"] { padding: 6px 10px; margin-bottom: -1px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font: 500 13.5px var(--sans); cursor: pointer; }
[role="tab"]:hover { color: var(--fg-strong); }
[role="tab"][aria-selected="true"] { color: var(--fg-strong); border-bottom-color: var(--accent); }
[data-panel] > .code:first-child, [data-panel] > .tree:first-child { margin-top: 12px; }

/* The file tree */
.tree { margin-top: 16px; padding: 12px 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font: 13.5px/1.7 var(--mono); }
.tree ul { margin: 0; padding: 0; list-style: none; }
.tree ul ul { margin-inline-start: 7px; padding-inline-start: 14px; border-inline-start: 1px solid var(--line); }
.body .tree li { margin: 0; }
.tree-row { display: flex; gap: 14px; white-space: nowrap; }
.tree-name { color: var(--fg-strong); }
.tree-note { font-family: var(--sans); font-size: 13.5px; color: var(--muted); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 18px; }
.card { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; }
.card:hover { border-color: var(--line-strong); background: var(--surface); }
.card b { display: block; font-weight: 600; color: var(--fg-strong); }
.card span { display: block; margin-top: 2px; font-size: 14.5px; line-height: 1.5; color: var(--muted); }

/* The pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; padding-top: 20px; border-top: 1px solid var(--line); }
.pager a { display: block; text-decoration: none; }
.pager span { display: block; font-size: 13px; color: var(--muted); }
.pager b { font-weight: 500; color: var(--fg-strong); }
.pager a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.pager-next { grid-column: 2; text-align: end; }

/* The loop */
.loop { margin: 24px 0 0; }
.loop ol { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0; margin: 0; padding: 0; list-style: none; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.body .loop li { margin: 0; padding: 12px; border-inline-start: 1px solid var(--line); }
.body .loop li:first-child { border-inline-start: 0; }
.loop b { display: block; font-size: 14px; font-weight: 600; color: var(--fg-strong); }
.loop span { display: block; margin-top: 3px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.body .loop li:nth-child(-n + 2), .body .loop li:nth-child(n + 5) { background: var(--accent-soft); }
@media (width < 640px) { .loop ol { grid-template-columns: 1fr 1fr; } .body .loop li { border-top: 1px solid var(--line); } .body .loop li:nth-child(-n + 2) { border-top: 0; } .body .loop li:nth-child(odd) { border-inline-start: 0; } }

/* The drawing of the panel. It keeps its own dark colours, as Herdr does. */
.panel { color-scheme: dark; --p-bg: #14161a; --p-card: #1a1d22; --p-col: #1e2126; --p-line: #2c3036; --p-fg: #e3e5e8; --p-dim: #8b9096; margin: 24px 0 0; overflow-x: auto; border-radius: 8px; border: 1px solid var(--p-line); background: var(--p-bg); color: var(--p-fg); font-size: 11.5px; line-height: 1.4; }
.panel i { font-style: normal; color: var(--p-dim); }
.panel-bar { display: flex; align-items: center; gap: 6px; min-width: 660px; padding: 8px 10px; border-bottom: 1px solid var(--p-line); white-space: nowrap; }
.panel-dim { color: var(--p-dim); font-size: 10.5px; }
.panel-tab { padding: 3px 6px; border-radius: 5px; font-weight: 500; }
.panel-tab-on { background: #2a2e34; }
.panel-gap { flex: 1; }
.panel-button { padding: 3px 8px; border: 1px solid var(--p-line); border-radius: 5px; }
.panel-button-on { border-color: transparent; background: var(--p-fg); color: var(--p-bg); }
.panel-miles { display: flex; gap: 6px; min-width: 660px; padding: 8px 10px 0; }
.panel-mile { width: 130px; padding: 5px 7px; border: 1px solid var(--p-line); border-radius: 5px; }
.panel-mile span { display: flex; justify-content: space-between; }
.panel-mile u { display: block; height: 3px; margin-top: 4px; border-radius: 2px; background: var(--p-col); text-decoration: none; }
.panel-mile s { display: block; height: 3px; border-radius: 2px; background: #6d9ce0; }
.panel-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; min-width: 660px; padding: 8px 10px 10px; }
.panel-col { min-height: 118px; padding: 6px; border-radius: 6px; background: var(--p-col); }
.panel-col-head { display: flex; justify-content: space-between; padding: 0 2px 5px; font-weight: 600; }
.panel-card { padding: 7px; border: 1px solid var(--p-line); border-radius: 5px; background: var(--p-card); }
.panel-card > i, .panel-card > span { display: block; }
.panel-card > i { font-size: 10px; }
.panel-card em { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 4px; font-style: normal; }
.panel-card small { padding: 0 4px; border: 1px solid var(--p-line); border-radius: 3px; font-size: 9.5px; color: var(--p-dim); }
.panel figcaption { min-width: 660px; padding: 7px 10px; border-top: 1px solid var(--p-line); color: var(--p-dim); font-size: 11.5px; }

/* Narrow screens */
@media (width < 1180px) {
  .layout { grid-template-columns: 216px minmax(0, 720px); gap: 0 40px; }
  .outline { display: none; }
}
@media (width < 860px) {
  .top { gap: 16px; padding: 0 16px; }
  .layout { display: block; padding: 0 16px; }
  .sidebar { display: none; }
  .pages { display: block; position: sticky; top: var(--bar); z-index: 10; margin: 0 -16px; padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
  .pages summary { padding: 10px 0; font-size: 14px; font-weight: 500; color: var(--fg-strong); cursor: pointer; }
  .pages .side { padding-bottom: 12px; }
  .pages .side a { margin-inline-start: 0; padding-block: 8px; }
  main { padding-block: 28px 48px; }
  html { scroll-padding-top: calc(var(--bar) + 60px); }
  .anchor { display: none; }
}
