@font-face { font-family: "Geist"; src: url(/fonts/geist.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url(/fonts/geist-mono.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url(/fonts/newsreader.woff2) format("woff2"); font-weight: 200 800; 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; }

  /* Warm neutrals, and one clay accent. */
  --bg: light-dark(oklch(0.985 0.004 80), oklch(0.17 0.006 60));
  --bg-raised: light-dark(oklch(0.967 0.006 80), oklch(0.205 0.007 60));
  --bg-hover: light-dark(oklch(0.945 0.008 80), oklch(0.245 0.008 60));
  --line: light-dark(oklch(0.905 0.008 80), oklch(0.285 0.008 60));
  --line-strong: light-dark(oklch(0.82 0.012 80), oklch(0.38 0.009 60));
  --text-strong: light-dark(oklch(0.21 0.012 60), oklch(0.965 0.005 80));
  --text: light-dark(oklch(0.33 0.012 60), oklch(0.85 0.007 80));
  --text-muted: light-dark(oklch(0.49 0.012 60), oklch(0.69 0.008 80));
  --accent: light-dark(oklch(0.5 0.14 42), oklch(0.76 0.12 52));
  --accent-soft: light-dark(oklch(0.95 0.025 55), oklch(0.27 0.04 48));
  --note: light-dark(oklch(0.47 0.09 240), oklch(0.77 0.08 240));
  --note-soft: light-dark(oklch(0.96 0.012 240), oklch(0.245 0.025 245));

  --sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --mono: "Geist Mono", ui-monospace, Menlo, monospace;
  --display: "Newsreader", Georgia, "Times New Roman", serif;

  --bar: 56px;
  --radius: 8px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
}

@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
}

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

/* The top bar */
.top { position: sticky; inset-block-start: 0; z-index: 20; display: flex; align-items: center; gap: 36px; height: var(--bar); padding-inline: 28px; background: color-mix(in oklab, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-block-end: 1px solid var(--line); }
.brand { display: inline-flex; flex: none; align-items: center; gap: 9px; font: 500 21px/1 var(--display); letter-spacing: -0.01em; color: var(--text-strong); text-decoration: none; }
.brand svg { color: var(--accent); }
.areas { display: flex; flex: 1; align-self: stretch; gap: 26px; 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: 450; color: var(--text-muted); text-decoration: none; transition: color 120ms ease-out; }
.areas a:hover { color: var(--text-strong); }
.areas a[aria-current] { color: var(--text-strong); border-block-end-color: var(--accent); }
.theme { flex: none; height: 30px; padding-inline: 11px; border: 1px solid var(--line); border-radius: 7px; background: transparent; color: var(--text-muted); font: 450 13px var(--sans); cursor: pointer; transition: color 120ms ease-out, border-color 120ms ease-out, scale 100ms ease-out; }
.theme:hover { color: var(--text-strong); border-color: var(--line-strong); }
.theme:active { scale: 0.97; }

/* 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: 236px minmax(0, 680px) 208px; justify-content: center; gap: 0 64px; max-width: 1440px; margin-inline: auto; padding-inline: 28px; }
.pages { display: none; }
.sidebar, .outline { position: sticky; inset-block-start: var(--bar); align-self: start; max-height: calc(100dvh - var(--bar)); overflow-y: auto; padding-block: 40px; scrollbar-width: none; }
.side ul { margin: 0; padding: 0; list-style: none; }
.side li + li { margin-block-start: 2px; }
.side a { display: block; padding: 6px 10px; margin-inline-start: -10px; border-radius: 6px; font-size: 14px; line-height: 1.4; color: var(--text-muted); text-decoration: none; transition: color 120ms ease-out, background-color 120ms ease-out; }
.side a:hover { color: var(--text-strong); background: var(--bg-raised); }
.side a[aria-current] { color: var(--text-strong); font-weight: 500; background: var(--bg-hover); }
.side-section { margin-block: 28px 8px; font-size: 13px; font-weight: 500; color: var(--text-strong); }
.outline p { margin-block: 0 10px; font-size: 13px; font-weight: 500; color: var(--text-strong); }
.outline ul { margin: 0; padding: 0; list-style: none; }
.outline a { display: block; padding-block: 4px; font-size: 13px; line-height: 1.4; color: var(--text-muted); text-decoration: none; transition: color 120ms ease-out; }
.outline .depth-3 a { padding-inline-start: 12px; }
.outline a:hover { color: var(--text-strong); }
[data-outline] { scroll-target-group: auto; }
.outline a:is(:target-current, .target-current) { color: var(--accent); font-weight: 500; }
main { min-width: 0; padding-block: 56px 96px; }

/* The article */
.body > :first-child { margin-block-start: 0; }
.body h1 { margin-block: 0 16px; font: 500 clamp(36px, 4vw, 46px)/1.1 var(--display); letter-spacing: -0.02em; color: var(--text-strong); text-wrap: balance; }
.body h1 + p { font-size: 18px; line-height: 1.6; color: var(--text); }
.body h2 { margin-block: 56px 12px; font: 500 28px/1.2 var(--display); letter-spacing: -0.012em; color: var(--text-strong); text-wrap: balance; }
.body h3 { margin-block: 36px 8px; font-size: 17px; font-weight: 550; line-height: 1.4; color: var(--text-strong); }
.body h4 { margin-block: 24px 6px; font-size: 16px; font-weight: 550; color: var(--text-strong); }
.body :is(h2, h3, h4) { position: relative; }
.anchor { position: absolute; inset-inline-start: -0.95em; font: 400 0.8em var(--sans); line-height: inherit; color: var(--text-muted); text-decoration: none; opacity: 0; transition: opacity 120ms ease-out; }
:is(h2, h3, h4):hover .anchor, .anchor:focus-visible { opacity: 1; }
.body p { margin-block: 16px 0; text-wrap: pretty; }
.body ul, .body ol { margin-block: 16px 0; padding-inline-start: 22px; }
.body li { margin-block-start: 6px; padding-inline-start: 2px; }
.body li::marker { color: var(--text-muted); }
.body a:not(.anchor, .card) { color: var(--text-strong); text-decoration: underline; text-decoration-color: var(--line-strong); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: text-decoration-color 120ms ease-out; }
.body a:not(.anchor, .card):hover { text-decoration-color: var(--accent); }
.body strong { font-weight: 550; color: var(--text-strong); }
.body :not(pre) > code { padding: 0.12em 0.34em; border-radius: 5px; font: 0.86em var(--mono); color: var(--text-strong); background: var(--bg-hover); overflow-wrap: anywhere; }

/* Code */
.code, .prompt-box { position: relative; margin-block-start: 18px; }
.code pre { margin: 0; padding: 15px 18px; overflow-x: auto; border-radius: var(--radius); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); font: 13px/1.7 var(--mono); }
.code code { font: inherit; }
.code-plain pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.line { display: inline; }
.copy { position: absolute; inset-block-start: 8px; inset-inline-end: 8px; height: 26px; padding-inline: 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text-muted); font: 450 12px var(--sans); cursor: pointer; opacity: 0; transition: opacity 120ms ease-out, color 120ms ease-out, scale 100ms ease-out; }
.code:hover .copy, .copy:focus-visible, .copy[data-done] { opacity: 1; }
@media (hover: none) { .copy { opacity: 1; } }
.copy:hover { color: var(--text-strong); }
.copy:active { scale: 0.97; }

/* The prompt for an agent */
.prompt { margin-block-start: 32px; }
.body .prompt-title { margin: 0; font-size: 17px; font-weight: 550; line-height: 1.4; }
.prompt > p { margin-block-start: 4px; color: var(--text-muted); }
.prompt-box { margin-block-start: 14px; padding: 16px 18px 56px; border-radius: var(--radius); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line-strong); }
.prompt-box pre { margin: 0; max-height: 300px; overflow: auto; font: 13px/1.7 var(--mono); white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }
.prompt-box code { font: inherit; }
.copy-strong { inset-block: auto 10px; inset-inline-end: 10px; height: 32px; padding-inline: 13px; border-color: transparent; background: var(--text-strong); color: var(--bg); font-size: 13px; font-weight: 500; opacity: 1; }
.copy-strong:hover { color: var(--bg); opacity: 0.88; }

/* Steps */
.steps { margin-block: 28px 0; padding: 0; list-style: none; counter-reset: step; }
.body .step { position: relative; margin: 0; padding-block-end: 30px; padding-inline-start: 44px; counter-increment: step; }
.step::before { content: counter(step); position: absolute; inset-inline-start: 0; inset-block-start: 0; z-index: 1; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--bg-hover); font: 500 12.5px var(--sans); font-variant-numeric: tabular-nums; color: var(--text-strong); }
.step:not(:last-child)::after { content: ""; position: absolute; inset-inline-start: 12.5px; inset-block: 32px 6px; width: 1px; background: var(--line); }
.body .step > h3 { margin-block: 0 2px; font-size: 16.5px; line-height: 26px; }
.step > h3 .anchor { display: none; }
.step > p:first-of-type { margin-block-start: 4px; }

/* Alerts */
.callout { margin-block-start: 24px; padding: 14px 18px; border-radius: var(--radius); background: var(--note-soft); font-size: 15px; }
.callout-warning, .callout-caution, .callout-important { background: var(--accent-soft); }
.body .callout-title { margin: 0; font-size: 13.5px; font-weight: 550; color: var(--note); }
.callout-warning .callout-title, .callout-caution .callout-title, .callout-important .callout-title { color: var(--accent); }
.callout > p:not(.callout-title) { margin-block-start: 2px; }

/* Tables */
.table { margin-block-start: 22px; overflow-x: auto; }
.table table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.55; }
.table th { padding: 0 16px 9px 0; text-align: start; font-weight: 500; font-size: 13px; color: var(--text-muted); border-block-end: 1px solid var(--line-strong); white-space: nowrap; }
.table td { padding: 10px 16px 10px 0; vertical-align: top; border-block-end: 1px solid var(--line); }
.table td:last-child, .table th:last-child { padding-inline-end: 0; }
.table td:first-child { color: var(--text-strong); }
.table td:first-child code { white-space: nowrap; overflow-wrap: normal; }

/* Tabs */
.tabs { margin-block-start: 20px; }
[role="tablist"] { display: flex; gap: 18px; border-block-end: 1px solid var(--line); }
[role="tab"] { padding: 6px 0 8px; margin-block-end: -1px; border: 0; border-block-end: 2px solid transparent; background: none; color: var(--text-muted); font: 450 13.5px var(--sans); cursor: pointer; transition: color 120ms ease-out; }
[role="tab"]:hover { color: var(--text-strong); }
[role="tab"][aria-selected="true"] { color: var(--text-strong); border-block-end-color: var(--accent); }

/* The file tree */
.tree { margin-block-start: 18px; padding: 15px 18px; overflow-x: auto; border-radius: var(--radius); background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); font: 13px/1.8 var(--mono); }
.tree ul { margin: 0; padding: 0; list-style: none; }
.tree ul ul { margin-inline-start: 6px; padding-inline-start: 14px; border-inline-start: 1px solid var(--line); }
.body .tree li { margin: 0; padding: 0; }
.tree-row { display: flex; gap: 16px; white-space: nowrap; }
.tree-name { color: var(--text-strong); }
.tree-note { font: 13px var(--sans); line-height: inherit; color: var(--text-muted); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; margin-block-start: 28px; }
.card { display: block; padding: 16px 18px; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line); text-decoration: none; transition: background-color 140ms ease-out, box-shadow 140ms ease-out; }
.card:hover { background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line-strong); }
.card b { display: block; font-weight: 550; color: var(--text-strong); }
.card span { display: block; margin-block-start: 2px; font-size: 14.5px; line-height: 1.5; color: var(--text-muted); }

/* The pager */
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-block-start: 72px; padding-block-start: 24px; border-block-start: 1px solid var(--line); }
.pager a { display: block; text-decoration: none; }
.pager span { display: block; font-size: 13px; color: var(--text-muted); }
.pager b { font: 500 19px/1.3 var(--display); color: var(--text-strong); transition: color 120ms ease-out; }
.pager a:hover b { color: var(--accent); }
.pager-next { grid-column: 2; text-align: end; }

/* The flow */
.flow { margin: 26px 0 0; padding: 22px; overflow-x: auto; border-radius: 12px; background: var(--bg-raised); box-shadow: inset 0 0 0 1px var(--line); }
.flow ol { display: flex; align-items: center; width: max-content; margin: 0; padding: 0; list-style: none; }
.flow ol + ol { margin-block-start: 14px; }
.body .flow li { display: flex; flex: none; align-items: center; margin: 0; padding: 0; }
.flow-node { padding: 5px 11px; border-radius: 7px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line-strong); font-size: 13px; font-weight: 450; line-height: 1.35; color: var(--text-strong); white-space: nowrap; }
.flow-node small { display: block; font-size: 11.5px; font-weight: 400; color: var(--text-muted); }
.flow-node-start { background: var(--text-strong); color: var(--bg); box-shadow: none; }
.flow-node-done { background: var(--accent-soft); box-shadow: none; }
.flow-edge { display: flex; flex-direction: column; align-items: center; min-width: 58px; padding-inline: 4px; font: 11.5px/1.2 var(--mono); color: var(--accent); }
.flow-edge::after { content: ""; display: block; width: 100%; height: 1px; margin-block-start: 5px; background: var(--line-strong); }
.flow ol.flow-branch { padding-inline-start: 52px; }
.flow-edge-plain::after { margin-block-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: 26px 0 0; overflow-x: auto; border-radius: 12px; 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: 620px; padding: 9px 12px; border-block-end: 1px solid var(--p-line); white-space: nowrap; }
.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: 620px; padding: 10px 12px 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-block-start: 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: 620px; padding: 10px 12px 12px; }
.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-block-start: 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: 620px; padding: 8px 12px; border-block-start: 1px solid var(--p-line); color: var(--p-dim); }

/* Narrow screens */
@media (width < 1240px) {
  .layout { grid-template-columns: 216px minmax(0, 680px); gap: 0 48px; }
  .outline { display: none; }
}
@media (width < 880px) {
  .top { gap: 18px; padding-inline: 16px; }
  .layout { display: block; padding-inline: 18px; }
  .sidebar { display: none; }
  .pages { display: block; position: sticky; inset-block-start: var(--bar); z-index: 10; margin-inline: -18px; padding-inline: 18px; background: var(--bg); border-block-end: 1px solid var(--line); }
  .pages summary { padding-block: 11px; font-size: 14px; font-weight: 500; color: var(--text-strong); cursor: pointer; }
  .pages .side { padding-block-end: 12px; }
  .pages .side a { margin-inline-start: 0; padding-block: 9px; }
  main { padding-block: 36px 64px; }
  html { scroll-padding-block-start: calc(var(--bar) + 64px); }
  .anchor { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}
