/* codna.me
 *
 * The colours and type are the product's own (codna/web/src/app.css), so the
 * site and the app read as one thing. Token names are shared; the site adds
 * only what a page about the product needs: larger type, wider sections. */

:root {
  color-scheme: light dark;

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

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4.5rem;
  --space-9: 6rem;

  --radius: 6px;
  --radius-lg: 12px;

  --wrap: 72rem;
  --gutter: 1.5rem;

  --bg:            light-dark(#fdfdfc, #17171a);
  --bg-raised:     light-dark(#ffffff, #1e1e22);
  --bg-sunken:     light-dark(#f4f4f2, #121214);
  --bg-hover:      light-dark(#eeeeeb, #27272c);
  --border:        light-dark(#e2e2dd, #2e2e34);
  --border-strong: light-dark(#94948c, #6a6a74);

  --text:          light-dark(#1e1e1c, #e8e8e4);
  --text-muted:    light-dark(#5c5c55, #a3a39d);
  --text-faint:    light-dark(#6a6a64, #90908b);

  --accent:        light-dark(#0d6e6e, #4db6ac);
  --accent-hover:  light-dark(#0a5757, #6ec9bf);
  --accent-bg:     light-dark(#e6f2f2, #16302e);
  --on-accent:     light-dark(#ffffff, #0f1f1e);

  --danger:        light-dark(#a33a2a, #e08374);
  --danger-bg:     light-dark(#fbecea, #331c19);
  --warn:          light-dark(#8a6410, #d9a441);
  --warn-bg:       light-dark(#fdf3e0, #2e2413);

  --code-keyword: light-dark(#7a3e9d, #c792ea);
  --code-string:  light-dark(#1e6b3a, #7ec699);
  --code-comment: light-dark(#6a6a64, #8b8b86);
  --code-number:  light-dark(#a35a00, #e3a35c);

  --shadow-color: light-dark(rgb(0 0 0 / 0.06), rgb(0 0 0 / 0.4));
  --shadow:    0 1px 2px var(--shadow-color), 0 2px 8px var(--shadow-color);
  --shadow-lg: 0 2px 6px var(--shadow-color), 0 24px 48px -12px var(--shadow-color);
}
@media (max-width: 40rem) {
  :root { --gutter: 1rem; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.15; text-wrap: balance; }
h1 { font-size: clamp(2.25rem, 1.5rem + 3.2vw, 3.75rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.625rem, 1.3rem + 1.3vw, 2.25rem); letter-spacing: -0.02em; }
h3 { font-size: 1.1875rem; letter-spacing: -0.01em; line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }

code, pre, kbd { font-family: var(--font-mono); }
code { font-size: 0.875em; }
p code, li code, td code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--bg-hover);
}
kbd {
  font-size: 0.85em;
  padding: 0 0.4em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--bg-sunken);
}

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: -3rem;
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--on-accent);
}
.skip:focus { top: var(--space-3); }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.wrap.narrow { max-width: calc(38rem + 2 * var(--gutter)); }
.wrap.wide { max-width: calc(76rem + 2 * var(--gutter)); }

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 2.75rem;
  padding: 0.6rem 1.15rem;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); }
.button.quiet { background: transparent; border-color: var(--border-strong); color: var(--text); }
.button.quiet:hover { background: var(--bg-hover); color: var(--text); }
.button.small { min-height: 2.25rem; padding: 0.4rem 0.85rem; font-size: 0.9375rem; }

/* Top bar */

.top {
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
}
.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 4rem;
}
.brand {
  color: var(--text);
  font-weight: 650;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }
/* The mark: the favicon's square, in the theme's accent, so it follows
   light and dark with the page. The name beside it says what it is. */
.brand, .brand-small { display: inline-flex; align-items: center; gap: 0.55em; }
.mark { width: 1.3em; height: 1.3em; flex: none; }
.mark rect { fill: var(--accent); }
.mark path { fill: none; stroke: var(--on-accent); stroke-width: 2.6; stroke-linecap: round; }
/* CoDNA: the DNA in it, in the accent. */
.dna { color: var(--accent); }
/* The links sit at the right, before the button, with the same space
   between them as between each other. */
.top nav { display: flex; align-items: center; gap: var(--space-5); margin-left: auto; margin-right: var(--space-2); }
.nav-link { color: var(--text-muted); text-decoration: none; font-size: 0.9375rem; }
.nav-link:hover { color: var(--text); }
/* The section you are in: its link in full colour, underlined in the
   accent, where the others are muted. */
.nav-link[aria-current] {
  color: var(--text); font-weight: 600;
  text-decoration: underline; text-decoration-color: var(--accent);
  text-decoration-thickness: 2px; text-underline-offset: 0.45em;
}
@media (max-width: 56rem) {
  .nav-link.wide { display: none; }
}
/* On a phone the links get a row of their own, under the name and the
   button, rather than going missing. */
@media (max-width: 44rem) {
  html { scroll-padding-top: 6.5rem; }
  .top-inner { flex-wrap: wrap; row-gap: 0; min-height: 3.5rem; padding-top: var(--space-2); }
  .top nav {
    order: 1; flex-basis: 100%; margin: 0;
    gap: var(--space-4); min-height: 2.75rem;
    overflow-x: auto; scrollbar-width: none; white-space: nowrap;
  }
  .nav-link[aria-current] { text-underline-offset: 0.35em; }
}

/* Hero */

.hero {
  padding-top: var(--space-8);
  background:
    radial-gradient(60rem 28rem at 50% -6rem, var(--accent-bg), transparent 70%);
}
.eyebrow {
  display: inline-block;
  margin-bottom: var(--space-4);
  padding: 0.2rem 0.65rem;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hero h1 { max-width: 19ch; }
/* Georgian words run longer, and Mkhedruli reads worse tightened: a wider,
   slightly smaller headline, and headings at their natural spacing. */
:lang(ka) .hero h1 { max-width: 30ch; font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
:lang(ka) h1, :lang(ka) h2 { letter-spacing: 0; }
.lede {
  margin-top: var(--space-5);
  max-width: 40rem;
  color: var(--text-muted);
  font-size: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);
  line-height: 1.55;
}
.actions { display: flex; flex-wrap: wrap; gap: var(--space-3); margin-top: var(--space-6); }
.aside { margin-top: var(--space-5); color: var(--text-faint); font-size: 0.9375rem; }
/* The screenshot sits over the section below it, which starts behind its
   lower part; above it, so the section's background never covers it. */
.hero .shot { position: relative; z-index: 1; margin-top: var(--space-8); margin-bottom: 0; }

/* Screenshots: the product, framed like a window. The dark one is offered
   to dark systems by <picture>. */

.shot {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-lg);
}
.shot img { display: block; width: 100%; height: auto; }

/* Sections */

.section { padding-block: var(--space-9); }
.section + .section { border-top: 1px solid var(--border); }
.band {
  padding-block: var(--space-9);
  margin-top: calc(-1 * var(--space-9));
  padding-top: calc(var(--space-9) * 2);
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--border);
}
@media (max-width: 56rem) {
  .section, .band { padding-block: var(--space-8); }
  .band { margin-top: calc(-1 * var(--space-7)); padding-top: calc(var(--space-7) + var(--space-8)); }
}
.intro { margin-top: var(--space-4); max-width: 42rem; color: var(--text-muted); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: var(--space-8);
  align-items: center;
}
.split.reverse { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.split.reverse > .copy { order: 2; }
.copy > * + * { margin-top: var(--space-4); }
.copy > h2 + * { margin-top: var(--space-5); }
.copy p { color: var(--text-muted); }
@media (max-width: 56rem) {
  .split, .split.reverse { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .split.reverse > .copy { order: 0; }
}

.points { margin: var(--space-5) 0 0; padding: 0; list-style: none; }
.points li { padding: var(--space-3) 0; border-top: 1px solid var(--border); color: var(--text-muted); }
.points li:last-child { border-bottom: 1px solid var(--border); }
.points strong { color: var(--text); font-weight: 600; }

/* The agent at work */

.agent {
  margin: 0;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
  box-shadow: var(--shadow-lg);
  font-size: 0.96875rem;
}
.turn { display: grid; gap: var(--space-1); }
.who {
  color: var(--text-faint);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.turn.you p {
  justify-self: start;
  padding: var(--space-3) var(--space-4);
  border-radius: 10px;
  background: var(--bg-hover);
}
.agent-turn p + p { margin-top: var(--space-2); }
.calls {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  border-left: 2px solid var(--accent);
  background: var(--accent-bg);
  border-radius: 0 var(--radius) var(--radius) 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
}
.calls li { display: flex; flex-wrap: wrap; gap: 0 var(--space-3); color: var(--text-muted); }
.calls code { color: var(--accent); font-weight: 600; font-size: inherit; }
.calls .result { color: var(--text-faint); }
.calls .result::before { content: "→ "; }
.cite { color: var(--text-faint); font-size: 0.875rem; }
.addr { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--accent); }

/* Cards */

.cards { display: grid; gap: var(--space-5); margin-top: var(--space-7); }
.cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 64rem) {
  .cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 52rem) {
  .cards.three, .cards.two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 36rem) {
  .cards.four { grid-template-columns: minmax(0, 1fr); }
}
.card {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-raised);
}
.card > * + * { margin-top: var(--space-3); }
.card p { color: var(--text-muted); }
.card.plain {
  padding: var(--space-5) 0 0;
  border: 0;
  border-top: 2px solid var(--accent);
  border-radius: 0;
  background: none;
}
.card.offer { display: flex; flex-direction: column; padding: var(--space-6); }
.card.offer > :last-child { margin-top: auto; padding-top: var(--space-5); }
.card.offer h3 { font-size: 1.375rem; }

.tag {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 600;
}
.card p.tag.wiki   { background: var(--accent-bg); color: var(--accent); }
.card p.tag.raw    { background: var(--warn-bg); color: var(--warn); }
.card p.tag.output { background: var(--bg-hover); color: var(--text-muted); }

.ticks { margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.ticks li { position: relative; padding: var(--space-1) 0 var(--space-1) 1.75rem; }
.ticks li::before {
  content: "";
  position: absolute;
  left: 0.3rem;
  top: 0.62em;
  width: 0.7rem;
  height: 0.38rem;
  border-left: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg);
}

/* Code */

.code { margin: 0; }
.code pre {
  margin: 0;
  overflow-x: auto;
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-sunken);
  font-size: 0.875rem;
  line-height: 1.65;
}
.code code { font-size: inherit; }
.code .k { color: var(--code-keyword); }
.code .s { color: var(--code-string); }
.code .c { color: var(--code-comment); font-style: italic; }

/* Closing */

.closing {
  padding-block: var(--space-9);
  border-top: 1px solid var(--border);
  background: radial-gradient(50rem 22rem at 50% 120%, var(--accent-bg), transparent 70%);
  text-align: center;
}
.closing p { margin-top: var(--space-4); color: var(--text-muted); }
.closing p:last-child { margin-top: var(--space-6); }

/* Plain pages: the form, thanks, privacy */

.page { padding-block: var(--space-8) var(--space-9); }
.page h1 { font-size: clamp(2rem, 1.6rem + 1.8vw, 2.75rem); }
.page .lede { margin-bottom: var(--space-6); }
.page .lede + p { margin-top: 0; }

.prose h2 { margin-top: var(--space-7); font-size: 1.375rem; letter-spacing: -0.01em; }
.prose h2 + p { margin-top: var(--space-3); }
.prose p + p { margin-top: var(--space-4); }
.prose .lede { margin-bottom: var(--space-3); }

.fine { color: var(--text-faint); font-size: 0.875rem; }
/* The link to the same page in the other language, above a form. */
.page .lang-switch { margin-bottom: var(--space-6); }
.nowrap { white-space: nowrap; }

.notice {
  margin-bottom: var(--space-5);
  padding: var(--space-3) var(--space-4);
  border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent);
  border-radius: var(--radius);
  background: var(--warn-bg);
}

.form { display: grid; gap: var(--space-5); }
.field { display: grid; gap: var(--space-2); }
.field label, .field legend { font-weight: 600; font-size: 0.9375rem; }
.opt { margin-left: var(--space-1); color: var(--text-faint); font-weight: 400; font-size: 0.875rem; }
.form input[type="text"], .form input[type="email"], .form input[type="tel"], .form textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}
.form textarea { resize: vertical; min-height: 7rem; }
.form input:focus-visible, .form textarea:focus-visible { outline-offset: 1px; border-color: var(--accent); }
.field.invalid input, .field.invalid textarea { border-color: var(--danger); }
.err { color: var(--danger); font-size: 0.9375rem; }
.hint { color: var(--text-faint); font-size: 0.875rem; }
.choices { margin: 0; padding: 0; border: 0; }
.choices legend { padding: 0; margin-bottom: var(--space-2); }
.choice { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-1) 0; font-weight: 400 !important; cursor: pointer; }
.choice input { width: 1.125rem; height: 1.125rem; margin: 0; accent-color: var(--accent); }
.form .button { min-width: 10rem; }

/* A field for programs, out of sight and out of the tab order. */
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Footer */

.foot {
  padding-block: var(--space-7);
  border-top: 1px solid var(--border);
  background: var(--bg-sunken);
  color: var(--text-muted);
  font-size: 0.9375rem;
}
.foot-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: var(--space-2) var(--space-6);
}
.brand-small { color: var(--text); font-weight: 650; }
.foot nav { display: flex; gap: var(--space-5); }
.foot a { color: var(--text-muted); }
.foot a:hover { color: var(--text); }
.foot .fine { grid-column: 1 / -1; }
@media (max-width: 48rem) {
  .foot-inner { grid-template-columns: minmax(0, 1fr); }
}

/* Docs: the contents on the left, the page, and what is on it on the right.
   Narrower, the contents fold into a disclosure above the page. */

.docs {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr) 13rem;
  gap: var(--space-7);
  align-items: start;
  padding-block: var(--space-6) var(--space-9);
}
.docs-side, .docs-toc {
  position: sticky;
  top: 5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  font-size: 0.9375rem;
}
.docs-menu { display: none; }
.docs-main { min-width: 0; max-width: 46rem; }
@media (max-width: 75rem) {
  .docs { grid-template-columns: 14rem minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 52rem) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: var(--space-4); padding-top: var(--space-4); }
  .docs-side { display: none; }
  .docs-menu {
    display: block;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-raised);
  }
  .docs-menu summary { padding: var(--space-3) var(--space-4); font-weight: 600; cursor: pointer; }
  .docs-menu .docs-nav { padding: 0 var(--space-4) var(--space-4); }
}

.docs-nav-h {
  margin: var(--space-5) 0 var(--space-2);
  color: var(--text-faint);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.docs-nav-h:first-child { margin-top: 0; }
.docs-nav ul, .docs-toc ul { margin: 0; padding: 0; list-style: none; }
.docs-nav a, .docs-toc a {
  display: block;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.35;
}
.docs-nav a:hover, .docs-toc a:hover { background: var(--bg-hover); color: var(--text); }
.docs-nav a[aria-current="page"] { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.docs-toc { padding-left: var(--space-4); border-left: 1px solid var(--border); }
.docs-toc a { padding: 0.25rem 0; border-radius: 0; font-size: 0.875rem; }
.docs-toc a:hover { background: none; }
.docs-toc .l3 a { padding-left: var(--space-4); }

.docs-search { display: flex; gap: var(--space-2); margin-bottom: var(--space-6); }
.docs-search input {
  flex: 1;
  min-width: 0;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg-raised);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
}
.docs-search input:focus-visible { outline-offset: 1px; border-color: var(--accent); }

.docs-crumb { margin-bottom: var(--space-2); color: var(--text-faint); font-size: 0.875rem; }
.docs-crumb a { color: var(--text-muted); }
.docs-main h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 2.5rem); }
.docs-main > .lede { margin-bottom: var(--space-6); }

.docs-section + .docs-section { margin-top: var(--space-7); }
.docs-section h2 { font-size: 1.375rem; }
.docs-list { margin: var(--space-4) 0 0; padding: 0; list-style: none; }
.docs-list li { padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.docs-list a { font-weight: 600; }
.docs-list span { display: block; margin-top: var(--space-1); color: var(--text-muted); font-size: 0.9375rem; }

.docs-count { color: var(--text-muted); }
.docs-hits { margin: var(--space-5) 0 0; padding: 0; list-style: none; }
.docs-hits li { padding: var(--space-4) 0; border-top: 1px solid var(--border); }
.docs-hits a { font-weight: 600; font-size: 1.0625rem; }
.docs-hit-section { margin-left: var(--space-2); color: var(--text-faint); font-size: 0.8125rem; }
.docs-hits p { margin-top: var(--space-1); color: var(--text-muted); font-size: 0.9375rem; }
mark { border-radius: 2px; background: var(--warn-bg); color: var(--text); box-shadow: 0 0 0 2px var(--warn-bg); }

.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-8);
  padding-top: var(--space-5);
  border-top: 1px solid var(--border);
}
.docs-pager a {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-weight: 600;
}
.docs-pager a:hover { border-color: var(--accent); }
.docs-pager span { display: block; color: var(--text-faint); font-size: 0.8125rem; font-weight: 400; }
.docs-pager .next { grid-column: 2; text-align: right; }

/* Prose: a page of the docs as it reads. */

.prose { margin-top: var(--space-5); }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 {
  margin-top: var(--space-7);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--border);
  font-size: 1.5rem;
}
.prose h3 { margin-top: var(--space-6); font-size: 1.1875rem; }
.prose h4 { margin-top: var(--space-5); font-size: 1rem; }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: var(--space-3); }
.prose :is(h2, h3, h4) { scroll-margin-top: 5rem; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li + li { margin-top: var(--space-1); }
.prose li > ul, .prose li > ol { margin-top: var(--space-1); }
.prose blockquote {
  margin-left: 0;
  margin-right: 0;
  padding: var(--space-3) var(--space-4);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--accent-bg);
  color: var(--text);
}
.prose blockquote > * + * { margin-top: var(--space-2); }
.prose img { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin-block: var(--space-6); }
.prose table {
  display: block;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.prose th, .prose td { padding: var(--space-2) var(--space-3); border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th { background: var(--bg-sunken); font-weight: 600; }
.prose pre {
  overflow-x: auto;
  padding: var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-sunken);
  font-size: 0.8125rem;
  line-height: 1.6;
}
.prose pre code { padding: 0; background: none; font-size: inherit; }
.prose code { overflow-wrap: anywhere; }
.prose input[type="checkbox"] { margin-right: var(--space-2); accent-color: var(--accent); }

/* Code, highlighted on the server: the product's own small vocabulary. */
.chroma { background: none; }
.chroma :is(.k, .kc, .kd, .kn, .kp, .kr, .kt, .nt) { color: var(--code-keyword); }
.chroma :is(.s, .sa, .sb, .sc, .dl, .sd, .s2, .se, .sh, .si, .sx, .sr, .s1, .ss) { color: var(--code-string); }
.chroma :is(.c, .ch, .cm, .c1, .cs, .cp, .cpf) { color: var(--code-comment); font-style: italic; }
.chroma :is(.m, .mb, .mf, .mh, .mi, .il, .mo) { color: var(--code-number); }
.chroma :is(.nb, .bp, .na) { color: var(--accent); }
.chroma .gd { color: var(--danger); }
.chroma .gi { color: var(--code-string); }

/* The assistant at /ask: a conversation, then the question box. */
.convo { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-5); }
.convo:empty { display: none; }
.turn { padding: var(--space-3) var(--space-4); border-radius: var(--radius-lg); overflow-wrap: anywhere; }
.turn > :first-child { margin-top: 0; }
.turn > :last-child { margin-bottom: 0; }
.turn.user { align-self: flex-end; max-width: 85%; background: var(--accent-bg); }
.turn.assistant { border: 1px solid var(--border); background: var(--bg-raised); }
.turn.assistant[aria-busy="true"] p:empty::after { content: "…"; color: var(--text-faint); }
.turn ul, .turn ol { padding-left: 1.25rem; }
.ask-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
.ask-actions [hidden] { display: none; }
.ask-status { color: var(--text-faint); font-size: 0.9375rem; }
.ask-fine { margin-top: var(--space-6); color: var(--text-faint); font-size: 0.875rem; }
