/* dokk layout and prose. Plain CSS on Basecoat variables; unlayered, so it wins over Basecoat's @layer rules. */

:root {
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --dk-header-height: 3.5rem;
  --dk-content-width: 46rem;
}

html {
  scrollbar-gutter: stable; /* no sideways jump between short and long pages */
}

/* Set by an inline script until the page has loaded; see base.html.jinja. */
.dk-preload *, .dk-preload *::before, .dk-preload *::after { transition: none !important; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
}

/* Shell */
.dk-shell {
  min-height: 100vh;
  min-width: 0;
}

.dk-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--dk-header-height);
  padding: 0 1rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--background) 85%, transparent);
  backdrop-filter: blur(8px);
}

.dk-header-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

/* One brand at a time: in the open sidebar, else in the top bar. On phones the sidebar is an
   overlay, so the top bar keeps it. 768px is Basecoat's sidebar breakpoint. */
@media (min-width: 768px) {
  .sidebar[aria-hidden="false"] + .dk-shell .dk-header-title { display: none; }
}

.dk-header-actions {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.dk-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
}

/* Site logo next to the title; a logo-dark variant swaps in for dark mode. */
.dk-logo {
  height: 1.5rem;
  width: auto;
}
.dk-logo-dark { display: none; }
html.dark .dk-logo-light { display: none; }
html.dark .dk-logo-dark { display: block; }

/* Theme toggle: show the icon for the mode you would switch to. */
.dk-icon-sun { display: none; }
html.dark .dk-icon-sun { display: block; }
html.dark .dk-icon-moon { display: none; }

.dk-content {
  display: flex;
  justify-content: center;
  gap: 3rem;
  padding: 2rem 1.5rem 4rem;
}

.dk-main {
  width: 100%;
  max-width: var(--dk-content-width);
  min-width: 0;
}

.dk-toc {
  display: none;
  width: 14rem;
  flex-shrink: 0;
}

@media (min-width: 1200px) {
  .dk-toc {
    display: block;
    position: sticky;
    top: calc(var(--dk-header-height) + 2rem);
    align-self: flex-start;
    /* A long table of contents scrolls on its own instead of running off the screen. */
    max-height: calc(100vh - var(--dk-header-height) - 4rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.dk-breadcrumbs {
  margin-bottom: 1.5rem;
}

/* Pager */
.dk-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.dk-pager a {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: inherit;
  text-decoration: none;
}

.dk-pager a:hover { background: var(--accent); }
.dk-pager span { font-size: 0.8125rem; color: var(--muted-foreground); }
.dk-pager-next { margin-left: auto; text-align: right; }

/* TOC */
.dk-toc-nav h2 { font-size: 0.8125rem; font-weight: 600; margin: 0 0 0.75rem; }
.dk-toc-nav ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.dk-toc-nav li[data-level="3"] { padding-left: 0.75rem; }
.dk-toc-nav a {
  display: block;
  margin-left: -1px;
  padding: 0.25rem 0 0.25rem 0.75rem;
  border-left: 1px solid transparent;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  text-decoration: none;
}
.dk-toc-nav a:hover { color: var(--foreground); }
.dk-toc-nav a[aria-current="true"] { color: var(--foreground); border-left-color: var(--foreground); }

/* Prose */
.dk-prose {
  line-height: 1.75;
  overflow-wrap: break-word;
}

.dk-prose > :first-child { margin-top: 0; }
.dk-prose h1 { font-size: 2.25rem; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 1.5rem; }
.dk-prose h2 { font-size: 1.5rem; line-height: 1.3; font-weight: 600; letter-spacing: -0.01em; margin: 2.5rem 0 1rem; padding-bottom: 0.375rem; border-bottom: 1px solid var(--border); }
.dk-prose h3 { font-size: 1.25rem; line-height: 1.4; font-weight: 600; margin: 2rem 0 0.75rem; }
.dk-prose h4 { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 0.5rem; }
.dk-prose :is(h2, h3) { scroll-margin-top: calc(var(--dk-header-height) + 1rem); }
.dk-prose .header-anchor { margin-left: 0.25rem; color: var(--muted-foreground); text-decoration: none; opacity: 0; }
.dk-prose :is(h2, h3):hover .header-anchor, .dk-prose .header-anchor:focus { opacity: 1; }

.dk-prose :is(p, ul, ol, dl, blockquote, .dk-code, .table-container) { margin: 0 0 1.25rem; }
.dk-prose :is(ul, ol) { padding-left: 1.5rem; }
.dk-prose ul { list-style: disc; }
.dk-prose ol { list-style: decimal; }
.dk-prose li + li { margin-top: 0.25rem; }
.dk-prose li > :is(ul, ol) { margin: 0.25rem 0 0; }
.dk-prose ul.contains-task-list { list-style: none; padding-left: 0.25rem; }
.dk-prose .task-list-item-checkbox { margin-right: 0.5rem; vertical-align: middle; }

.dk-prose a:not(.btn) { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
.dk-prose strong { font-weight: 600; }
.dk-prose img { max-width: 100%; height: auto; border-radius: var(--radius); }
.dk-prose hr:not([role="separator"]) { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; } /* leave Basecoat button-group separators alone */
.dk-prose blockquote { border-left: 3px solid var(--border); padding-left: 1rem; color: var(--muted-foreground); }
/* Definition lists read like a reference: term, then its description under a guide line. */
.dk-prose dt { font-weight: 600; margin-top: 1rem; }
.dk-prose dt:first-child { margin-top: 0; }
.dk-prose dd { margin: 0.25rem 0 0; padding-left: 1rem; border-left: 2px solid var(--border); }
.dk-prose dd > p:last-child { margin-bottom: 0; }

/* ::image: click to enlarge in a dialog */
.dk-prose .dk-image { margin: 0 0 1.25rem; }
.dk-image-zoom { display: block; cursor: zoom-in; }
.dk-image-zoom img { display: block; border: 1px solid var(--border); }
.dk-prose .dk-image figcaption { margin-top: 0.5rem; font-size: 0.875rem; color: var(--muted-foreground); }
.dk-prose .dk-image figcaption > p { margin: 0; }
.dk-lightbox {
  margin: auto; /* centered: Basecoat's reset clears the dialog's default margin */
  max-width: 96vw;
  max-height: 96vh;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.dk-lightbox::backdrop { background: rgb(0 0 0 / 0.8); }
.dk-lightbox img { display: block; max-width: 96vw; max-height: 92vh; object-fit: contain; border-radius: var(--radius); }
.dk-lightbox button { position: absolute; top: 0.5rem; right: 0.5rem; }

/* :swatch[color] and :kbd[key] */
.dk-swatch {
  display: inline-block;
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  border-radius: 0.25em;
  background: var(--dk-swatch);
}
.dk-prose .kbd { font-size: 0.8em; }

/* Code */
.dk-prose code { font-family: var(--font-mono); font-size: 0.875em; }
.dk-prose :not(pre) > code { background: var(--muted); border-radius: calc(var(--radius) - 4px); padding: 0.15em 0.35em; }
.dk-code { position: relative; }
.dk-prose pre {
  margin: 0 0 1.25rem;
  overflow-x: auto;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}
.dk-code pre { margin: 0; }
.dk-prose pre code { font-size: inherit; }
.dk-copy { position: absolute; top: 0.5rem; right: 0.5rem; opacity: 0; transition: opacity 0.15s; }
.dk-code:hover .dk-copy, .dk-copy:focus-visible { opacity: 1; }

/* Tables (Basecoat .table inside .table-container) */
.dk-prose .table { border-collapse: collapse; }
.dk-prose .table :is(th, td) { white-space: normal; padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--border); text-align: left; }

/* Footnotes */
.dk-prose .footnotes-sep { margin-top: 3rem; }
.dk-prose .footnotes { font-size: 0.875rem; color: var(--muted-foreground); }
.dk-prose .footnote-ref a, .dk-prose .footnote-backref { text-decoration: none; }

/* Callouts follow Basecoat's alert: note and tip are the default alert, danger is the
   destructive variant, caution uses Basecoat's amber "custom colors" example. */
.dk-prose .dk-callout { margin: 0 0 1.25rem; }
.dk-prose .dk-callout > section > :last-child { margin-bottom: 0; }
.dk-callout[data-callout="caution"] {
  border-color: oklch(0.924 0.12 95.746);   /* amber-200 */
  background: oklch(0.987 0.022 95.277);    /* amber-50 */
  color: oklch(0.414 0.112 45.904);         /* amber-900 */
}
html.dark .dk-callout[data-callout="caution"] {
  border-color: oklch(0.414 0.112 45.904);  /* amber-900 */
  background: oklch(0.279 0.077 45.635);    /* amber-950 */
  color: oklch(0.987 0.022 95.277);         /* amber-50 */
}
.dk-callout[data-callout="caution"] > section { color: inherit; }

/* Tabs (Basecoat .tabs) */
.dk-prose .dk-tabs { margin: 0 0 1.25rem; }
.dk-prose .dk-tabs [role="tabpanel"] { padding-top: 0.75rem; }
.dk-prose .dk-tabs [role="tabpanel"] > :last-child { margin-bottom: 0; }

/* Cards (Basecoat .card) */
.dk-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; margin: 0 0 1.25rem; }
.dk-card { position: relative; gap: 0.5rem; }
.dk-card:has(.dk-card-link):hover { background: var(--accent); }
.dk-prose .dk-card-link { color: inherit; text-decoration: none; }
.dk-card-link::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */
.dk-prose .dk-card section > :last-child { margin-bottom: 0; }

/* AI components: :::model, ::huggingface and :::prompt, all Basecoat cards */
.dk-model, .dk-hf, .dk-prompt { margin: 0 0 1.25rem; gap: 1rem; }
.dk-model > header, .dk-hf > header, .dk-prompt > header { display: flex; align-items: center; gap: 0.75rem; }
.dk-model .card-title, .dk-hf .card-title, .dk-prompt .card-title { display: block; font-size: 1rem; line-height: 1.4; }
.dk-prose .dk-model .card-description, .dk-prose .dk-hf .card-description { margin: 0; font-size: 0.8125rem; }
.dk-prose .dk-model section > :last-child, .dk-prose .dk-hf section > :last-child,
.dk-prose :is(.dk-prompt section, .dk-prompt-text) > :last-child { margin-bottom: 0; }
.dk-model svg, .dk-hf svg, .dk-prompt svg { width: 1em; height: 1em; flex-shrink: 0; }
.dk-model-avatar, .dk-prompt-icon {
  display: grid; place-items: center; flex-shrink: 0; width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius); background: var(--muted); color: var(--primary); font-size: 1.25rem;
}
.dk-model-avatar img { width: 1.5rem; height: 1.5rem; object-fit: contain; }
.dk-model-avatar .dk-vendor-logo { color: var(--foreground); } /* vendor logos: partials/logos.html.jinja */
.dk-prompt-icon { width: 2rem; height: 2rem; font-size: 1rem; }
.dk-prose .dk-model-stats {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: 0.75rem 1.5rem;
  margin: 1rem 0 0; padding: 0.875rem 1rem; border-radius: var(--radius); background: var(--muted);
}
.dk-prose .dk-model-stats:first-child { margin-top: 0; } /* no description */
.dk-prose .dk-model-stats > div { min-width: 0; }
.dk-prose .dk-model-stats dt {
  display: flex; align-items: center; gap: 0.375rem; margin: 0; white-space: nowrap;
  color: var(--muted-foreground); font-size: 0.75rem; font-weight: 500;
}
.dk-prose .dk-model-stats dd {
  margin: 0.125rem 0 0; padding: 0; border: 0; font-weight: 600; font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.dk-model > footer, .dk-prompt > footer, .dk-hf > footer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; }
.dk-model > footer .badge { gap: 0.25rem; }
.dk-prose .dk-model-link { margin-left: auto; text-decoration: none; }
.dk-hf-logo { display: grid; place-items: center; flex-shrink: 0; width: 2.5rem; height: 2.5rem;
  border-radius: var(--radius); background: var(--muted); font-size: 1.5rem; }
.dk-prose a.dk-hf-link { color: inherit; text-decoration: none; }
.dk-hf-link::after { content: ""; position: absolute; inset: 0; } /* whole card is clickable */
.dk-hf { position: relative; }
.dk-hf:hover { background: var(--accent); }
.dk-hf-owner { color: var(--muted-foreground); font-weight: 400; }
.dk-hf-stat { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted-foreground); font-size: 0.8125rem; }
.dk-hf > footer { gap: 0.5rem 1rem; }
.dk-prompt > header .badge { gap: 0.25rem; }
.dk-prompt > header .card-title { margin-right: auto; }
.dk-prompt-text {
  border-left: 3px solid var(--primary); padding: 0.25rem 0 0.25rem 1rem;
}
.dk-prompt > footer a { text-decoration: none; }
.dk-prompt > footer[hidden] { display: none; }

.dk-prompt-vars { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; margin-top: 1rem; }
.dk-prompt-vars[hidden] { display: none; }
.dk-prompt-vars label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.8125rem; }
.dk-prompt-vars label span { font-family: var(--font-mono); color: var(--muted-foreground); }
.dk-prompt-vars .input { width: 12rem; height: 2rem; }
.dk-prompt-var { padding: 0 0.2em; border-radius: 0.25rem; background: color-mix(in oklab, var(--primary) 15%, transparent); color: inherit; font-family: var(--font-mono); font-size: 0.875em; }
.dk-prompt-var[data-filled] { font-family: inherit; font-size: inherit; }

/* ::::chat, after shadcn's AI Elements: the person's turn as a bubble on the right, the reply as
   plain text next to its avatar, the system prompt as a quiet note. */
.dk-chat { display: flex; flex-direction: column; gap: 1.25rem; margin: 0 0 1.25rem; padding: 1.25rem;
  border: 1px solid var(--border); border-radius: var(--radius); }
.dk-chat > figcaption { margin: -0.25rem 0 0; color: var(--muted-foreground); font-size: 0.8125rem; font-weight: 500; }
.dk-msg { display: flex; flex-direction: column; gap: 0.25rem; }
.dk-msg-name { color: var(--muted-foreground); font-size: 0.75rem; font-weight: 500; }
.dk-msg[data-role="user"] { align-items: flex-end; margin-left: 15%; }
.dk-msg-bubble { padding: 0.5rem 0.875rem; border-radius: calc(var(--radius) + 4px); background: var(--muted); }
.dk-msg[data-role="assistant"] { flex-direction: row; gap: 0.75rem; }
.dk-msg-avatar { display: grid; place-items: center; flex-shrink: 0; width: 1.75rem; height: 1.75rem;
  border: 1px solid var(--border); border-radius: 999px; font-size: 0.875rem; }
.dk-msg-avatar svg { width: 1em; height: 1em; }
.dk-msg-content { min-width: 0; flex: 1; padding-top: 0.2rem; }
.dk-msg-content > .dk-msg-name { display: block; margin-bottom: 0.25rem; }
.dk-msg[data-role="system"] { padding: 0.5rem 0.875rem; border: 1px dashed var(--border); border-radius: var(--radius);
  color: var(--muted-foreground); font-size: 0.875rem; }
.dk-prose :is(.dk-msg-bubble, .dk-msg-content, .dk-msg[data-role="system"]) > :last-child { margin-bottom: 0; }
.dk-prose .dk-msg :is(p, ul, ol, .dk-code) { margin-bottom: 0.75rem; }

/* :::tool: a tool's parameters, then its JSON */
.dk-tool { margin: 0 0 1.25rem; gap: 1rem; }
.dk-tool > header { display: flex; align-items: center; gap: 0.75rem; }
.dk-tool svg { width: 1em; height: 1em; flex-shrink: 0; }
.dk-tool .card-title code { font-size: 0.95rem; }
.dk-prose .dk-tool section > :last-child { margin-bottom: 0; }
.dk-params-extra { color: var(--muted-foreground); font-size: 0.8125rem; }
.dk-tool-json > summary { cursor: pointer; color: var(--muted-foreground); font-size: 0.8125rem; font-weight: 500; }
.dk-tool-json[open] > summary { margin-bottom: 0.5rem; }

/* ::::trace, after shadcn's AI Elements: a line per step, open the ones with details */
.dk-trace { margin: 0 0 1.25rem; }
.dk-prose .dk-trace-title { margin: 0 0 0.5rem; font-size: 0.875rem; font-weight: 600; }
.dk-prose .dk-trace ol { list-style: none; margin: 0; padding: 0; }
.dk-prose .dk-trace .dk-step { position: relative; margin: 0; padding: 0 0 0.25rem; }
.dk-step:not(:last-child)::before { content: ""; position: absolute; left: 0.5rem; top: 1.5rem; bottom: 0; border-left: 1px solid var(--border); }
.dk-step-line, .dk-step summary { display: flex; align-items: center; gap: 0.625rem; padding: 0.25rem 0;
  color: var(--muted-foreground); font-size: 0.875rem; }
.dk-step summary { cursor: pointer; list-style: none; }
.dk-step summary::-webkit-details-marker { display: none; }
.dk-step summary:hover, .dk-step details[open] > summary { color: var(--foreground); }
.dk-step svg { width: 1rem; height: 1rem; flex-shrink: 0; }
.dk-step summary > svg:last-child { transition: transform 0.15s; }
.dk-step details[open] > summary > svg:last-child { transform: rotate(90deg); }
.dk-step-icon { display: grid; place-items: center; background: var(--background); }
.dk-step[data-status="error"] .dk-step-icon, .dk-step[data-status="error"] .dk-step-title { color: var(--destructive); }
.dk-step[data-status="running"] .dk-step-icon svg { animation: dk-spin 1s linear infinite; }
@keyframes dk-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .dk-step[data-status="running"] .dk-step-icon svg { animation: none; } }
.dk-step-body { margin: 0.25rem 0 0.5rem 1.625rem; font-size: 0.875rem; }
.dk-prose .dk-step-body > :last-child { margin-bottom: 0; }

/* ::::models: models side by side */
.dk-models th[scope="row"] { color: var(--muted-foreground); font-weight: 500; white-space: nowrap; }
.dk-models-name { display: inline-flex; align-items: center; gap: 0.5rem; }
.dk-models-name svg { width: 1rem; height: 1rem; }
.dk-models .badge { margin: 0.1rem 0; }
.dk-models-none { color: var(--muted-foreground); }

/* :::bench: a bar per score */
.dk-bench { margin: 0 0 1.25rem; }
.dk-bench > figcaption { margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 600; }
.dk-prose .dk-bench dl { display: grid; grid-template-columns: minmax(6rem, max-content) 1fr; gap: 0.375rem 1rem; margin: 0; }
.dk-bench dl > div { display: contents; }
.dk-prose .dk-bench dt { margin: 0; font-size: 0.875rem; font-weight: 400; color: var(--muted-foreground); }
.dk-prose .dk-bench dd { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0; border: 0; }
.dk-bench-bar { height: 0.625rem; min-width: 2px; border-radius: 999px; background: color-mix(in oklab, var(--foreground) 25%, transparent); }
.dk-bench-value { font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.dk-bench [data-highlight] dt { color: var(--foreground); font-weight: 600; }
.dk-bench [data-highlight] .dk-bench-bar { background: var(--primary); }
.dk-bench [data-highlight] .dk-bench-value { font-weight: 600; }

/* :::env: environment variables, with Copy .env */
.dk-env { margin: 0 0 1.25rem; }
.dk-env .table-container { margin-bottom: 0.5rem; }
.dk-env > .btn svg { width: 1em; height: 1em; }

/* Steps: numbered procedure from an ordered list */
.dk-prose .dk-steps > ol { list-style: none; padding-left: 0; counter-reset: dk-step; }
.dk-prose .dk-steps > ol > li {
  position: relative;
  counter-increment: dk-step;
  padding: 0 0 1.25rem 2.75rem;
  border-left: 1px solid var(--border);
  margin-left: 0.875rem;
}
.dk-prose .dk-steps > ol > li:last-child { border-left-color: transparent; }
.dk-prose .dk-steps > ol > li::before {
  content: counter(dk-step);
  position: absolute;
  left: -0.875rem;
  top: 0;
  width: 1.75rem;
  height: 1.75rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--muted);
  font-size: 0.8125rem;
  font-weight: 600;
}
.dk-prose .dk-steps > ol > li { padding-left: 1.75rem; }

/* Site footer: [footer] text and the "Built with dokk" credit */
.dk-site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.5rem;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
.dk-site-footer p { margin: 0; }
.dk-site-footer a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.dk-site-footer a:hover { color: var(--foreground); }

/* Page footer: edit link and last updated */
.dk-page-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-top: 2.5rem;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}
.dk-page-meta a { color: inherit; }
.dk-page-meta a:hover { color: var(--foreground); }

/* Search (Basecoat command palette) */
/* Header button styled as a search field */
.dk-search-button {
  width: 16rem;
  justify-content: flex-start;
  gap: 0.5rem;
  padding-inline: 0.75rem 0.375rem;
  font-weight: 400;
  color: var(--muted-foreground);
}
.dk-search-kbd { margin-left: auto; }
@media (max-width: 640px) {
  .dk-search-button { width: auto; padding-inline: 0.625rem; }
  .dk-search-label, .dk-search-kbd { display: none; }
}
.dk-search .command { width: min(40rem, calc(100vw - 2rem)); }
.dk-search [role="menu"] { max-height: min(28rem, 60vh); }
.dk-search [role="menuitem"] { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; padding-block: 0.625rem; }
.dk-search [role="menuitem"] strong { font-weight: 500; color: var(--foreground); }
.dk-search [role="menuitem"] > span {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--muted-foreground);
}
.dk-search mark { background: oklch(0.93 0.12 95); color: inherit; border-radius: 2px; }
html.dark .dk-search mark { background: oklch(0.45 0.1 95); }

/* Link buttons: inline, so consecutive ones sit side by side */
.dk-prose .dk-linkbutton { margin: 0 0.5rem 1.25rem 0; text-decoration: none; }

/* File tree */
.dk-filetree {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.75;
}
.dk-prose .dk-filetree ul { list-style: none; margin: 0; padding-left: 1.25rem; }
.dk-prose .dk-filetree > ul { padding-left: 0; }
.dk-prose .dk-filetree li + li { margin-top: 0; }
.dk-filetree summary { cursor: pointer; list-style: none; }
.dk-filetree summary::-webkit-details-marker { display: none; }
.dk-filetree :is(summary, .dk-ft-entry) { display: inline-flex; align-items: center; gap: 0.4rem; }
.dk-filetree svg { width: 1em; height: 1em; flex-shrink: 0; color: var(--muted-foreground); }
.dk-ft-comment { margin-left: 0.5rem; font-family: var(--font-sans); color: var(--muted-foreground); }
.dk-ft-highlight > details > summary .dk-ft-name,
.dk-ft-highlight > .dk-ft-entry .dk-ft-name {
  padding: 0 0.3rem;
  border-radius: calc(var(--radius) - 4px);
  background: var(--accent);
  font-weight: 600;
}

/* Code block title (```py title="app.py") */
.dk-prose .dk-codeblock { margin: 0 0 1.25rem; }
.dk-codeblock figcaption {
  padding: 0.5rem 1rem;
  border: 1px solid var(--border);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--muted);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}
.dk-codeblock pre { border-top-left-radius: 0; border-top-right-radius: 0; }

/* Highlighted lines (```py {2,4-6}) */
.dk-prose .hl .hll {
  display: block;
  margin: 0 -1rem;
  padding: 0 1rem;
  background: color-mix(in oklab, var(--foreground) 9%, transparent);
  box-shadow: inset 2px 0 0 var(--foreground);
}

/* Collapsible block (:::details) */
.dk-details {
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.dk-details > summary { padding: 0.625rem 1rem; cursor: pointer; font-weight: 500; }
.dk-details > div { padding: 0 1rem 0.25rem; }
.dk-details > div > :last-child { margin-bottom: 1rem; }

/* Inline badges (:badge[Text]) sit on the text baseline */
.dk-prose .badge { vertical-align: 0.1em; }

/* Page title row with Basecoat-style page actions */
.dk-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin: 0 0 1.5rem;
}
.dk-prose .dk-page-header h1 { margin: 0; flex: 1 1 18rem; min-width: 0; } /* a long title wraps beside the actions */
.dk-page-actions { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.375rem; flex-shrink: 0; }
.dk-page-actions [role="menu"] a { text-decoration: none; color: inherit; }
