  /* public/custom.css
    Chainlit 2.12.0 × VS Code Solarized
    ─────────────────────────────────────────────────────────────────────
    Source of truth for colors: public/theme.json (HSL variables).
    This file covers only gaps Chainlit does not expose as variables.

    Rules of engagement
    ─────────────────────────────────────────────────────────────────────
    • `theme.json` owns every color that maps to a Solarized base or
      accent. Nothing here invents a new palette.
    • Constants below are annotated with their Solarized base so a
      future reader can cross-check theme.json without opening it.
    • Every selector that must beat a Chainlit-shipped utility (Tailwind
      / shadcn / tailwind-typography / highlight.js) wins on specificity
      alone. Single-class utilities are beaten with combined-class rules;
      `.prose` prefixes are used where the typography layer reasserts;
      `html.dark` prefixes are used where a `dark:` utility would
      otherwise out-specify.
    • `!important` appears nowhere. If a future Chainlit upgrade adds a
      utility that out-specifies a rule below, raise the selector.
    • DOM-dependent selectors are used only where a live DOM chain has
      been inspected. A selector that may match nothing is worse than no
      selector: it dilutes the audit and hides regressions.
    • Surface hierarchy (light → dark mirrors):
        base3  page         |  base03
        base2  code surface |  base02
        base1  border       |  base01
        base01 body         |  base1
        base00 comment      |  base0
      Body text is bumped one step past Solarized's canonical body tone
      (base00 / base0) because the code surface sits on base2 / base02,
      not base3 / base03. Measured on that surface: base01 → 4.39:1
      (97.6% of AA normal, short by 0.11); base1 → 4.86:1 (passes).
      Accents (blue, cyan, green, yellow, red) are left at their
      published Solarized values; those sit below AA normal on the
      light code surface. Code comments (base00 / base0) are likewise
      below AA normal on it (≈3.64:1 / ≈4.11:1) — deliberate: dimmer
      than body without vanishing. This file operates at the ceiling the
      palette allows and does not invent tones to close the gap. If AA
      everywhere is a hard requirement, the palette itself has to be
      swapped (Selenized is the Solarized-derived fork that targets it).
    ───────────────────────────────────────────────────────────────────── */

  /* 1. Links
    No broad [class*="link"] selector: it also hits non-link controls.
    --ring is Solarized blue in theme.json. Hover cyan has no theme
    token, so it is spelled out here. Both are under AA for normal text
    — canonical Solarized accents, documented above. */
  a,
  .prose a {
    color: hsl(var(--ring));
  }
  a:hover,
  .prose a:hover {
    color: #2aa198; /* Solarized cyan */
  }

  /* 2. Selection
    No theme token exists for selection: documented local exceptions.

    The canonical Solarized pairing (base2 fill / base01 text on light,
    base02 / base1 on dark) is a bad fit for this app: base2 and base02
    are exactly the code surface, so inside a fenced block selection is
    invisible, and on the page the fill reads as "basically white."

    Invert to a mid-tone fill so selection is unambiguous on both the
    page and the code surface:

      Light: fill base1, text base03.
      Dark:  fill base01, text base3.

    Fill/background pairs are visibly distinct in both directions
    (base1 sits well below base2 in lightness; base01 sits well above
    base02). Neither pair trips on the code surface. */
  ::selection {
    background-color: #93a1a1; /* light: base1 */
    color: #002b36;            /* light: base03 */
  }
  html.dark ::selection {
    background-color: #586e75; /* dark: base01 */
    color: #fdf6e3;            /* dark: base3 */
  }

  /* 3. Caret / focus */
  input,
  textarea,
  [contenteditable="true"] {
    caret-color: hsl(var(--ring));
  }

  /* 4. Destructive buttons as outline
    shadcn's Button resolves `variant` through cva into utility classes
    at build time — it does not emit a `data-variant` attribute. The
    binding hook is the shipped utility class `bg-destructive` (0,1,0).
    `button.bg-destructive` (0,1,1) wins on specificity alone;
    `button.bg-destructive:hover` (0,2,1) beats the shipped
    `hover:bg-destructive/90` (0,2,0).

    Under dark mode, shadcn ships `dark:bg-destructive/60` and
    `dark:hover:bg-destructive/90`. Tailwind v3 compiles those to
    `.dark .dark\:bg-destructive\/60` (0,2,0) and
    `.dark .dark\:hover\:bg-destructive\/90:hover` (0,3,0). The base
    rules above lose on specificity. The `html.dark`-scoped pair below
    is (0,2,2) and (0,3,2) respectively — one class past the equivalent
    `dark:` utility, element past the `.dark` marker. This is what
    keeps the button transparent in both themes, not just light.

    If a future Chainlit release renders destructive as a non-<button>
    element, extend the selector — do not widen on a hunch. */
  button.bg-destructive {
    background-color: transparent;
    color: #dc322f;               /* Solarized red */
    border: 1px solid #dc322f;
  }
  button.bg-destructive:hover {
    background-color: rgb(220 50 47 / 0.08); /* red @ 8% */
  }
  html.dark button.bg-destructive {
    background-color: transparent;
    color: #dc322f;               /* Solarized red */
    border-color: #dc322f;
  }
  html.dark button.bg-destructive:hover {
    background-color: rgb(220 50 47 / 0.08); /* red @ 8% */
  }

  /* 5. Sent user message bubble — outlined, on the page surface.
    Verified node (DevTools chain, innermost-first):
      div.px-5.py-2.5.relative.bg-accent.rounded-3xl.max-w-[70%].flex-grow-0.ml-auto

    Chainlit already ships padding, `rounded-3xl`, `max-w-[70%]` and
    `ml-auto` — the shape of the box is not ours to touch. The defect
    is `bg-accent`, which resolves to hsl(var(--accent)) and in the
    Solarized theme sits close enough to the page background that the
    bubble disappears.

    Surface: page (base3 / base03), not base2 / base02. Code blocks own
    base2 / base02 — if the bubble also sat there, a fenced block inside
    it would lose its surface separation. The border and shadow are what
    keep the bubble readable when its fill matches the page.

    `div.bg-accent.rounded-3xl` is (0,2,1); Tailwind's `.bg-accent` is
    (0,1,0). No `!important` needed. */
  div.bg-accent.rounded-3xl {
    background-color: hsl(var(--background)); /* light: base3 */
    color: #586e75;                            /* light: base01 */
    border: 1px solid #93a1a1;                /* light: base1 */
    box-shadow: 0 1px 2px rgb(0 43 54 / 0.06); /* base03 @ 6% */
  }

  /* Typography sets an explicit body color on `.prose`; the (0,3,1)
    rule below out-specifies it and pulls text back to inherit so the
    bubble's color reaches every leaf.

    Typography also pins specific leaves through `:where()` rules at
    (0,1,0): `<strong>`, `<b>`, `<blockquote>`, `<h1>`–`<h6>`,
    `<th>` (both `<thead th>` and `<tbody th>`), `<dt>`,
    `<figcaption>`, `<kbd>` carry their own `--tw-prose-*` colors;
    `<ol> li::marker` / `<ul> li::marker` are colored through the
    marker pseudo. If `--foreground` diverges from the bubble tone,
    every one of those drifts while body text stays correct. The two
    rules below name every pinned leaf — the first for elements, the
    second for list markers — each at (0,3,1)/(0,3,2), which beats
    Typography's (0,1,0) / (0,0,2).

    The `<th>` scope rests on the v0.5.20 README target list for
    `prose-headings:{utility}`: `h1, h2, h3, h4, th` — bare `th`, not
    `thead th`. If the compiled `prose` CSS later shows the pin is
    narrower (only `thead th`), `tbody th` in the leaf list is a
    no-op; including it costs nothing and prevents the drift a global
    `th` pin would otherwise cause. Final confirmation: grep the
    shipped stylesheet for `--tw-prose-headings` and check whether
    `th` selectors sit inside or outside `thead`.

    Plain `td`, `p`, `li`, `em`, `i` inherit from `.prose` already and
    need no leaf override.

    `code` and `a` are excluded on purpose — both are meant to depart
    from the bubble tone (§1 and §6 own them). `kbd` is *not* a
    departure here: it carries no shipped chip styling in this build,
    so it inherits with body text. If a `kbd` chip is ever wanted, it
    must be added as its own rule and excluded from the list below. */
  div.bg-accent.rounded-3xl .prose {
    color: inherit;
  }
  div.bg-accent.rounded-3xl .prose :where(
    strong, b, blockquote, h1, h2, h3, h4, h5, h6,
    thead th, tbody th, dt, figcaption, kbd
  ) {
    color: inherit;
  }
  div.bg-accent.rounded-3xl .prose :where(li)::marker {
    color: inherit;
  }

  html.dark div.bg-accent.rounded-3xl {
    background-color: hsl(var(--background)); /* dark: base03 */
    color: #93a1a1;                           /* dark: base1 */
    border-color: #586e75;                    /* dark: base01 */
    box-shadow: 0 1px 2px rgb(0 0 0 / 0.25);
  }

  /* 6. Code surfaces
    One treatment, shared by AI and human messages. Scoping `pre` under
    the bubble would fork the treatment — don't.

    • Inline `<code>` ships `bg-muted` (0,1,0). Bare `code` (0,0,1)
      loses; prefix with `.prose` (0,1,1) to win.
    • Fenced blocks: the `pre` in the DOM has only `m-0` (no bg
      utility), so a bare `pre` binds. The shadcn `.bg-card` wrapper's
      border stays Chainlit's — theme.json owns that chrome.
    • `pre code` (0,0,2) loses to `.prose code` (0,1,1); write
      `.prose pre code` (0,1,2) so the inner element stays transparent.
    • The shipped `.hljs` wrapper sets its own `background` and `color`
      at (0,1,0). `pre code` at (0,0,2) loses to it, so if a fenced
      block ever renders outside `.prose`, the shipped background leaks
      through. `pre .hljs` (0,1,1) and `.prose pre .hljs` (0,2,1)
      neutralize it in both shapes: the reset no longer depends on the
      `.prose` ancestor and survives a markup change without a future
      reader rediscovering it.
    • Text tone is base01 / base1 (one step past canonical body) so the
      dimmer base2 / base02 surface does not drop contrast below where
      it began. See the header note. */
  pre,
  .prose code {
    background-color: #eee8d5; /* light: base2 */
    color: #586e75;            /* light: base01 */
  }
  .prose code {
    border: 1px solid #93a1a1; /* light: base1 */
  }
  .prose pre code,
  pre code,
  pre .hljs,
  .prose pre .hljs {
    background-color: transparent;
    border: 0;
    padding: 0;
    color: inherit;
  }

  html.dark pre,
  html.dark .prose code {
    background-color: #073642; /* dark: base02 */
    color: #93a1a1;            /* dark: base1 */
  }
  html.dark .prose code {
    border-color: #586e75; /* dark: base01 */
  }
  html.dark .prose pre code,
  html.dark pre code,
  html.dark pre .hljs,
  html.dark .prose pre .hljs {
    background-color: transparent;
    border: 0;
    padding: 0;
    color: inherit;
  }

  /* 7. Syntax highlighting (highlight.js)
    2.12.0 renders fenced code with hljs classes on `span.hljs-*` —
    not Shiki inline styles. Token rules therefore bind, and this
    build needs them: the shipped hljs theme is not Solarized.

    Accents are identical across light and dark in Solarized; only the
    comment tint shifts. Comment tone is base00 / base0 — one step
    dimmer than body (base01 / base1) so comments de-emphasise without
    vanishing. Canonical Solarized comment tone (base1 / base01) sits
    near 2:1 on its own ground and is not used here. */
  pre .hljs-comment,
  pre .hljs-quote {
    color: #657b83; /* light: base00 */
    font-style: italic;
  }
  pre .hljs-keyword,
  pre .hljs-selector-tag,
  pre .hljs-addition,
  pre .hljs-built_in {
    color: #859900; /* Solarized green */
  }
  pre .hljs-number,
  pre .hljs-string,
  pre .hljs-meta,
  pre .hljs-literal,
  pre .hljs-doctag,
  pre .hljs-regexp {
    color: #2aa198; /* Solarized cyan */
  }
  pre .hljs-title,
  pre .hljs-section,
  pre .hljs-name,
  pre .hljs-selector-id,
  pre .hljs-selector-class,
  pre .hljs-variable,
  pre .hljs-template-variable {
    color: #268bd2; /* Solarized blue */
  }
  pre .hljs-attr,
  pre .hljs-attribute,
  pre .hljs-type,
  pre .hljs-symbol,
  pre .hljs-bullet,
  pre .hljs-link {
    color: #b58900; /* Solarized yellow */
  }
  pre .hljs-deletion {
    color: #dc322f; /* Solarized red */
  }
  pre .hljs-emphasis {
    font-style: italic;
  }
  pre .hljs-strong {
    font-weight: 700;
  }
  html.dark pre .hljs-comment,
  html.dark pre .hljs-quote {
    color: #839496; /* dark: base0 */
  }
