/* ================================================================
   Dark mode for the logged-in app (docs/agents/dark-mode.md).

   Not part of the Tailwind build and not in `stylesheet_link_tag :app`
   (which takes every .css under app/assets): it lives in lib/assets so
   the layouts can link it on its own, after the main stylesheet, with a
   media attribute chosen on the server from the account's theme
   setting (ApplicationHelper#app_dark_stylesheet_media):
   "screen and (prefers-color-scheme: dark)" for System, "screen" for
   Dark, no link at all for Light (screen, so a printout stays light). So nothing in here repeats the media query; the link
   carries it. Plain CSS only: no @apply, @theme or other Tailwind-only
   syntax, since nothing compiles it, and so nothing adds the vendor
   prefixes the Tailwind build adds to application.css: where a light
   rule there gets one (text-decoration-color, below), write it here too.

   It is scoped to `.app-theme`, which the application (admin pages
   included), public and onboarding layouts put on <body> (never on
   marketing, mailers or the ChatGPT panel). The light values of the
   `surface` and `scrim` tokens, and of the marketing tokens the
   onboarding layout is drawn in, stay in @theme in application.css.

   It works by redefining the palette variables: Tailwind 4 compiles
   `text-stone-500` to `color: var(--color-stone-500)`, and an opacity
   modifier to a color-mix() over the same variable, so redefining them
   here flips every utility at once. Stone runs end for end (the page is
   stone-50, now the darkest); `surface` is the card colour that used to
   be white; `white` itself is never redefined, because text-white sits on
   amber, red and emerald fills. Pale tints (50-200) of the other families
   become dark tints and their text shades (700-900) light ones.

   Hex lives here and nowhere else in the app's dark styling.
   ================================================================ */

/* The page's own scrollbar and overscroll area belong to <html>, which
   the class is not on (a Turbo visit keeps <html>). */
html:has(> body.app-theme) { color-scheme: dark; }

.app-theme {
  color-scheme: dark;

  --color-surface: #23201e;   /* cards, inputs, menus, the sidebar */
  --color-scrim: #0c0a09;

  --color-stone-50: #1a1716;  /* the page; also ApplicationHelper::DARK_THEME_COLOR */
  --color-stone-100: #2c2826; /* hovers, badges, inline code */
  --color-stone-200: #3a3532; /* borders */
  --color-stone-300: #57514c; /* strong borders, faint text and icons */
  --color-stone-400: #857e78; /* muted text, 4.0:1 on surface */
  --color-stone-500: #a8a29e; /* secondary text, 6.7:1 */
  --color-stone-600: #c4beb9;
  --color-stone-700: #d6d3d1;
  --color-stone-800: #e7e5e4; /* body text; also the inverse button fill */
  --color-stone-900: #f5f5f4; /* headings */
  --color-stone-950: #fafaf9;

  /* amber-500/600/700 keep their light values: they are the buttons'
     fills under text-white. Their use as text is taken care of by the
     utility overrides further down. */
  --color-amber-50: #2b2013;
  --color-amber-100: #3a2a15;
  --color-amber-200: #5a3d1a;
  --color-amber-800: #f0975a; /* amber text: a light orange, never yellow */
  --color-amber-900: #fdba74;
  --color-amber-950: #fed7aa;

  --color-red-50: #351716;
  --color-red-100: #4a1f1d;
  --color-red-200: #6b2a26;
  --color-red-300: #8f3a33;
  --color-red-400: #b84a40;
  --color-red-500: #f47171;
  --color-red-600: #f68a85;
  --color-red-700: #fca5a5;  /* also the hover fill of Delete on the inverse bulk bars, under text-stone-50 */
  --color-red-800: #fecaca;
  --color-red-900: #fee2e2;

  /* emerald-400/500 (status dots, an underline) stay bright as they are. */
  --color-emerald-50: #0f2b22;
  --color-emerald-100: #14392d;
  --color-emerald-200: #1f523f;
  --color-emerald-300: #2f7259;
  --color-emerald-600: #34d399; /* the one emerald button is pinned below */
  --color-emerald-700: #6ee7b7;
  --color-emerald-800: #a7f3d0;
  --color-emerald-900: #d1fae5;

  /* The edit conflict box and the note-limit bar. */
  --color-slate-50: #191c21;
  --color-slate-100: #232830;
  --color-slate-200: #333a44;
  --color-slate-300: #4a5260;
  --color-slate-600: #b8c2cf;
  --color-slate-700: #cbd5e1;
  --color-slate-800: #e2e8f0;
  --color-slate-900: #f1f5f9;

  /* One badge or tile each (assistant chooser, plan and status pills,
     the history page's removed count). */
  --color-sky-50: #0c2533;
  --color-sky-200: #1d4a63;
  --color-sky-700: #7dd3fc;
  --color-blue-50: #14213d;
  --color-blue-700: #93c5fd;
  --color-purple-50: #2a1b3d;
  --color-purple-700: #d8b4fe;
  --color-rose-700: #fda4af;

  /* Admin's badges and tiles (signup method, plan, feedback category,
     dot plot markers). violet-500 and the other 500s are chart and dot
     fills, bright in both. blue-600 and violet-600 are text only. */
  --color-violet-50: #221c3f;
  --color-violet-200: #3f3470;
  --color-violet-600: #b9a6fb;
  --color-violet-700: #c4b5fd;
  --color-purple-200: #4a2f66;
  --color-indigo-50: #1f1d3d;
  --color-indigo-700: #a5b4fc;
  --color-green-50: #12261a;
  --color-green-100: #173322;
  --color-green-200: #22492f;
  --color-green-700: #86efac;
  --color-rose-50: #36151c;
  --color-blue-600: #9cc3fc;
  --color-orange-50: #33200f;
  --color-orange-700: #fdba74;

  /* The marketing tokens (application.css @theme), which the onboarding
     layout is drawn in: sign-in, signup, the onboarding steps, checkout,
     OAuth consent. Mirrors of the stone values above, so the last onboarding
     page and the first dark Dashboard are one surface. The marketing layout
     never carries .app-theme, so its pages keep the light values. bg-accent
     and hover:bg-accent-deep are the buttons' fills under text-white, and
     fill-accent the logo tile: pinned to the light values further down. */
  --color-paper: var(--color-stone-50);     /* the page */
  --color-paper-2: var(--color-stone-100);  /* a hover lift on cards */
  --color-card: var(--color-surface);
  --color-ink: var(--color-stone-900);      /* headings */
  --color-ink-2: var(--color-stone-800);
  --color-ink-soft: var(--color-stone-700); /* labels */
  --color-ink-line: var(--color-stone-700);
  --color-body: var(--color-stone-800);     /* body text */
  --color-muted: var(--color-stone-500);
  --color-faint: var(--color-stone-400);    /* placeholders, icons */
  --color-hairline: var(--color-stone-200);
  --color-hairline-strong: var(--color-stone-300); /* input borders */
  --color-accent: #f0975a;                  /* accent text, the amber-800 above */
  --color-accent-deep: #fdba74;             /* deeper in light means lighter here */
  --color-accent-soft: var(--color-amber-100);
  --color-accent-tint: var(--color-amber-50);
  /* onink is light text on an ink fill; an ink fill turns light, as
     bg-stone-900 does, so its text turns dark. */
  --color-onink: var(--color-stone-50);
  --color-onink-muted: var(--color-stone-300);
  --color-onink-faint: var(--color-stone-400);
  /* The password strength meter's "strong" (password_form_controller.js). */
  --color-brandgreen: #7cc29a;

  /* Sage: the connected panel of the connect wizard and the prompt card
     (onboarding/_prompt_block). sage-500 (dots) stays; sage-600 is the
     check badge's fill under text-white, and its one use as text is
     pinned below. */
  --color-sage-50: #1c2615;
  --color-sage-200: #3b4d2c;
  --color-sage-700: #a9c288;
  --color-sage-900: #d0dcbb;
}

/* ---- Custom CSS above that writes its colours out ------------------- */

.app-theme .sidebar-item:hover { background: var(--color-stone-100); }
.app-theme .sidebar-item.active { background: var(--color-stone-200); color: var(--color-stone-900); }
.app-theme .sidebar-item.active > svg:first-child { color: var(--color-amber-800); }
.app-theme .note-row:hover { background: var(--color-stone-100); }
/* The focus ring: amber-700 is 3.2:1 on the dark page, amber-600 about 5:1. */
.app-theme :is(a, button, [role="button"], select):focus-visible { outline-color: #d97706; }
.app-theme #sidebar-nav::-webkit-scrollbar-thumb { background: var(--color-stone-300); }
/* The scroll shadows' covers are the sidebar's colour. */
.app-theme #sidebar-nav {
  background-image:
    linear-gradient(var(--color-surface) 33%, transparent),
    linear-gradient(transparent, var(--color-surface) 66%),
    radial-gradient(farthest-side at 50% 0, rgb(0 0 0 / 0.5), rgb(0 0 0 / 0)),
    radial-gradient(farthest-side at 50% 100%, rgb(0 0 0 / 0.5), rgb(0 0 0 / 0));
}

.app-theme [data-note-body] .code-copy-btn { background: var(--color-surface); }
.app-theme mark.search-hit { background: #7c4a1e; }

.app-theme .conflict-diff { background: var(--color-surface); border-color: var(--color-stone-200); }
.app-theme .conflict-diff li.ins { background: #0f2b22; color: #6ee7b7; }
.app-theme .conflict-diff li.del { background: #351716; color: #fca5a5; }
.app-theme .conflict-diff .cdiff-context li { color: var(--color-stone-500); }
.app-theme .conflict-diff .cdiff-hunk { border-color: var(--color-stone-200); background: var(--color-stone-50); }
.app-theme .conflict-diff .cdiff-hunk-choice { background: var(--color-stone-100); border-bottom-color: var(--color-stone-200); }
.app-theme .conflict-diff .cdiff-hunk-choice label.cdiff-choice-saved { color: #fca5a5; }
.app-theme .conflict-diff .cdiff-hunk-choice label.cdiff-choice-draft { color: #6ee7b7; }
.app-theme .conflict-diff .cdiff-hunk-choice label.cdiff-choice-custom { color: var(--color-stone-500); }
.app-theme .conflict-diff .cdiff-hunk-custom { background: var(--color-surface); border-color: var(--color-stone-300); color: var(--color-stone-800); }

/* The History page's diff (its colours are in notes/history's <style>). */
.app-theme .note-diff .diff li.ins { background: #0f2b22; color: #6ee7b7; }
.app-theme .note-diff .diff li.del { background: #351716; color: #fca5a5; }
.app-theme .note-diff .diff li.unchanged { color: var(--color-stone-500); }

/* The graph: SVG attributes and the view's own <style>, which these
   outrank. The label's halo is the graph's background. */
.app-theme .graph-empty-icon circle { fill: var(--color-stone-600); }
.app-theme .graph-empty-icon line { stroke: var(--color-stone-400); }
.app-theme .graph-edge { stroke: var(--color-stone-200); }
.app-theme .graph-node-link .graph-node-circle { fill: var(--color-stone-600); }
.app-theme .graph-node-orphan .graph-node-circle { fill: #d97706; stroke: #f59e0b; }
.app-theme .graph-node-link .graph-node-label { fill: var(--color-stone-500); stroke: var(--color-surface); }
.app-theme .graph-node-orphan .graph-node-label { fill: var(--color-stone-400); }
.app-theme .graph-node-link:hover .graph-node-circle { fill: #d97706; }
.app-theme .graph-node-link:hover .graph-node-label { fill: var(--color-stone-900); }
.app-theme .graph-highlighted .graph-node-label { fill: var(--color-stone-700); }
.app-theme .graph-edge.graph-edge-highlighted { stroke: #d97706; }

/* The Light card under Settings > Appearance previews light in dark too:
   its tile is white (settings/show), so its icon keeps the light shades
   (stone-500, stone-700 on hover, amber-700 when chosen). The Dark and
   System tiles draw theirs in white and amber-500, which never flip. */
.app-theme [data-theme-preview="light"] {
  --color-stone-500: #78716c;
  --color-stone-700: #44403c;
  --color-amber-800: #b45309; /* what the text-amber-700 pin resolves to */
}

/* Admin's dot plots and cohort heatmap (AdminHelper::DOT_PLOT_BUCKETS and
   DOT_PLOT_COHORT_BUCKETS). In light more activity is darker, ending in
   stone-900; kept, dark would read bright yellow, darker amber, then white.
   So the ramp runs dim to bright here, and the brightest heatmap cell takes
   dark text. heat-1 needs nothing: amber-100 and amber-900 flip already. */
.app-theme .dot-1 { background-color: #7c4a1e; }
.app-theme .dot-2 { background-color: #b45309; }
.app-theme .dot-3 { background-color: #f59e0b; }
.app-theme .dot-4 { background-color: #fde68a; }
.app-theme .heat-2 { background-color: #7c4a1e; color: #fed7aa; }
.app-theme .heat-3 { background-color: #b45309; color: #fff; }
.app-theme .heat-4 { background-color: #f59e0b; color: var(--color-stone-50); }

/* Sign in with Apple's mark is pure black or pure white, per Apple's
   guidelines, never the page ink: #000 in light (sessions/_apple_logo, on
   a light button), #fff here on the dark one. */
.app-theme .apple-mark path { fill: #fff; }

/* The setup guides' code wells (onboarding/_guide_cursor, _guide_other)
   are a stone-900 fill, which would turn into a white slab on the
   Connections card; inset like the MCP URL block (_mcp_url_block) instead. */
.app-theme :is(pre, code).bg-stone-900 { background-color: var(--color-stone-50); color: var(--color-stone-800); box-shadow: inset 0 0 0 1px var(--color-stone-200); }

.app-theme emoji-picker.folder-emoji-picker {
  --background: var(--color-surface);
  --border-color: var(--color-stone-200);
  --button-hover-background: var(--color-stone-100);
  --button-active-background: var(--color-stone-200);
  --input-border-color: var(--color-stone-300);
  --input-font-color: var(--color-stone-800);
  --input-placeholder-color: var(--color-stone-400);
  --outline-color: var(--color-stone-300);
}

/* ---- Partials shared with the marketing layout -----------------------
   The marketing tokens and sage are redefined for the whole .app-theme
   page above, which covers the partials app pages share with onboarding
   (the testimonial on /upgrade, the prompt card on the Dashboard and in
   Settings > Connections). On a marketing page this stylesheet is never
   linked, so they keep their light look there. */

/* The prompt card's label (onboarding/_prompt_block) is a step quieter
   than muted text elsewhere, as it was before the tokens flipped
   page-wide. */
.app-theme .prompt-block { --color-muted: var(--color-stone-400); }

/* ---- EasyMDE (vendor CSS in easymde.min.css, left as shipped) ------- */

.app-theme .EasyMDEContainer .CodeMirror:not(.cm-editor),
.app-theme .EasyMDEContainer .CodeMirror-fullscreen {
  background: var(--color-surface); color: var(--color-stone-800); border-color: var(--color-stone-200);
}
.app-theme .CodeMirror-gutter-filler, .app-theme .CodeMirror-scrollbar-filler { background-color: var(--color-surface); }
.app-theme .CodeMirror-cursor { border-left-color: var(--color-stone-900); }
.app-theme .CodeMirror-selected,
.app-theme .CodeMirror-focused .CodeMirror-selected,
.app-theme .EasyMDEContainer .CodeMirror-focused .CodeMirror-selected { background: var(--color-stone-300); }
.app-theme .CodeMirror-line::selection,
.app-theme .CodeMirror-line > span::selection,
.app-theme .CodeMirror-line > span > span::selection { background: var(--color-stone-300); }
.app-theme .editor-toolbar { border-color: var(--color-stone-200); }
.app-theme .editor-toolbar button { color: var(--color-stone-600); }
.app-theme .editor-toolbar button.active,
.app-theme .editor-toolbar button:hover { background: var(--color-stone-100); border-color: var(--color-stone-300); }
.app-theme .editor-toolbar i.separator { border-left-color: var(--color-stone-300); border-right-color: transparent; }
.app-theme .editor-toolbar.fullscreen { background: var(--color-surface); }
.app-theme .editor-toolbar.fullscreen::before { background: linear-gradient(to right, var(--color-surface) 0, transparent 100%); }
.app-theme .editor-toolbar.fullscreen::after { background: linear-gradient(to right, transparent 0, var(--color-surface) 100%); }
.app-theme .note-body-editor .editor-toolbar:not(.fullscreen) { background: var(--color-stone-50); }
.app-theme .editor-statusbar { color: var(--color-stone-400); }
.app-theme .editor-preview,
.app-theme .editor-preview-side { background: var(--color-stone-50); color: var(--color-stone-800); border-color: var(--color-stone-200); }
.app-theme .editor-preview pre { background: var(--color-stone-100); }
.app-theme .editor-preview table td, .app-theme .editor-preview table th { border-color: var(--color-stone-200); }
.app-theme .easymde-dropdown-content { background-color: var(--color-surface); }
.app-theme .cm-s-easymde .cm-link,
.app-theme .cm-s-easymde .cm-quote { color: var(--color-stone-500); }
.app-theme .cm-s-easymde .cm-url { color: var(--color-stone-400); }
.app-theme .cm-s-easymde .cm-comment { background: rgb(255 255 255 / 0.07); }
.app-theme .cm-s-easymde .cm-tag { color: #86c27e; }
.app-theme .cm-s-easymde .cm-attribute { color: #b9a3e0; }
.app-theme .cm-s-easymde .cm-string { color: #93c5fd; }
@media (max-width: 480px) {
  .app-theme .editor-toolbar button.preview { background: var(--color-stone-50); box-shadow: -8px 0 8px -4px var(--color-stone-50); }
  .app-theme .editor-toolbar[data-more] button.preview::before { background: linear-gradient(to right, transparent, var(--color-stone-50) 85%); }
}

/* ---- The live editor (live_editor.js) -------------------------------- */

.app-theme .live-editor .cm-editor,
.app-theme .live-editor .cm-editor.CodeMirror { color: var(--color-stone-800); }
.app-theme .live-editor .cm-content { caret-color: var(--color-stone-900); }
.app-theme .live-editor .cm-cursor { border-left-color: var(--color-stone-900); }
.app-theme .live-editor .cm-selectionBackground,
.app-theme .live-editor .cm-focused .cm-selectionBackground { background: #7c4a1e !important; }
.app-theme .live-editor .cm-placeholder,
.app-theme .live-editor .md-mark,
.app-theme .live-editor .live-hang,
.app-theme .live-editor .live-hang-out,
.app-theme .live-editor .cm-line.live-fence:not(.live-editing),
.app-theme .live-editor .cm-line.live-done { color: var(--color-stone-400); }
.app-theme .live-editor .live-hint,
.app-theme .live-cell:empty::before { color: var(--color-stone-300); }
.app-theme .live-editor .md-h1,
.app-theme .live-editor .md-h2,
.app-theme .live-editor .md-h3,
.app-theme .live-table th { color: var(--color-stone-900); }
.app-theme .live-editor .md-link { color: var(--color-stone-600); -webkit-text-decoration-color: var(--color-stone-300); text-decoration-color: var(--color-stone-300); }
.app-theme .live-editor .md-url,
.app-theme .live-editor .cm-line.live-li .live-ol,
.app-theme .live-bullet { color: var(--color-stone-500); }
.app-theme .live-editor .md-code,
.app-theme .live-editor .cm-line.live-code,
.app-theme .live-editor .cm-line.live-fence { background: var(--color-stone-100); }
.app-theme .live-editor .cm-line.live-code .md-code,
.app-theme .live-editor .cm-line.live-fence .md-code { background: none; }
.app-theme .live-editor .cm-line.live-quote { border-left-color: var(--color-stone-300); color: var(--color-stone-500); }
.app-theme .live-editor .cm-line.live-done { -webkit-text-decoration-color: var(--color-stone-300); text-decoration-color: var(--color-stone-300); }
.app-theme .live-rule { border-top-color: var(--color-stone-300); }
.app-theme .live-wikilink { background: #4a2e14; color: #fdba74; }
.app-theme .live-image-handle { background: var(--color-surface); }

.app-theme .live-table th { border-bottom-color: var(--color-stone-300); }
.app-theme .live-table td { border-bottom-color: var(--color-stone-200); }
.app-theme .live-table-wrap:focus-within .live-table { outline-color: var(--color-stone-300); }
.app-theme .live-cell:focus { background: var(--color-stone-100); box-shadow: inset 0 0 0 2px #7c4a1e; }
.app-theme .live-table-add { background: var(--color-surface); border-color: var(--color-stone-300); color: var(--color-stone-500); }
.app-theme .live-table-add:hover { background: #3a2a15; border-color: #7c4a1e; color: #fdba74; }

/* The dark bars (selection bar, table tools, tooltips) are dark in both
   schemes; on a dark page they get a lighter ground and an edge. */
.app-theme .inline-format-bubble,
.app-theme .live-table-tools,
.app-theme .inline-format-button[data-tip]::after { background: #2e2925; box-shadow: 0 0 0 1px #4a433e, 0 8px 20px -6px rgb(0 0 0 / 0.6); }

.app-theme .inline-format-slash,
.app-theme .inline-format-turn-menu,
.app-theme .live-link-card { background: var(--color-surface); border-color: var(--color-stone-300); box-shadow: 0 18px 40px -14px rgb(0 0 0 / 0.7); }
.app-theme .inline-format-slash-row,
.app-theme .inline-format-turn-item,
.app-theme .live-link-card-button { color: var(--color-stone-700); }
.app-theme .inline-format-slash-row[aria-selected="true"],
.app-theme .inline-format-turn-item:hover,
.app-theme .live-link-card-button:hover { background: var(--color-stone-100); color: var(--color-stone-900); }
.app-theme .inline-format-slash-icon { background: var(--color-surface); border-color: var(--color-stone-200); color: var(--color-stone-600); }
.app-theme .inline-format-slash-row[aria-selected="true"] .inline-format-slash-icon { border-color: var(--color-stone-300); }
.app-theme .inline-format-slash-label { color: var(--color-stone-900); }
.app-theme .inline-format-slash-description,
.app-theme .live-link-card-url { color: var(--color-stone-500); }
.app-theme .inline-format-slash-hint,
.app-theme .inline-format-slash-group,
.app-theme .inline-format-slash-row[aria-disabled="true"] { color: var(--color-stone-400); }
.app-theme .inline-format-match { background: #7c4a1e; }
.app-theme .inline-format-flash { color: #fdba74; background: #3a2a15; border-color: #5a3d1a; }

.app-theme .live-key-row { background: var(--color-surface); border-top-color: var(--color-stone-200); box-shadow: 0 -6px 16px -12px rgb(0 0 0 / 0.7); }
.app-theme .live-key { color: var(--color-stone-700); }
.app-theme .live-key:active { background: var(--color-stone-200); }
.app-theme .live-key.is-active { background: #3a2a15; color: #fdba74; }
.app-theme .live-key.menu { color: var(--color-amber-800); }
.app-theme .live-key.done { color: var(--color-stone-500); }

/* Dark mode, continued: shades that are both a fill under white text and
   text on a surface. The variable follows the majority use; the minority
   use is pinned here, by its utility's own selector. In the utilities layer
   and wrapped in :where(), so they keep a utility's specificity and win by
   coming later. That also means they beat a responsive variant on the same
   element (text-amber-700 md:text-stone-500 stays amber at md and up in
   dark): give such an element a different base shade, or add a pin for the
   variant here. */
@layer utilities {
  /* amber-600/700 stay the buttons' fills; as text (3.2:1 on a dark
     card) they take the light orange. */
  :where(.app-theme) .text-amber-700 { color: var(--color-amber-800); }
  :where(.app-theme) .text-amber-600 { color: #f5a36b; }
  @media (hover: hover) {
    :where(.app-theme) .hover\:text-amber-700:hover { color: var(--color-amber-800); }
    :where(.app-theme) .hover\:text-amber-600:hover { color: #fbb685; }
    :where(.app-theme) .group-hover\:text-amber-700:is(:where(.group):hover *) { color: var(--color-amber-800); }
  }
  /* The marketing accent (the onboarding layout): text in 23 places, the
     fill of a button under text-white in 22, and hover:bg-accent-deep is
     only ever that button's hover. The variables take the light orange for
     the text; the fills, the toggle and NPS score that turn accent when
     checked, and the logo tile (fill-accent, white strokes) stay as in
     light. */
  :where(.app-theme) .bg-accent { background-color: #b5510a; }
  :where(.app-theme) .peer-checked\:bg-accent:is(:where(.peer):checked ~ *) { background-color: #b5510a; }
  :where(.app-theme) .fill-accent { fill: #b5510a; }
  @media (hover: hover) {
    :where(.app-theme) .hover\:bg-accent-deep:hover { background-color: #8f3f06; }
  }
  /* sage-600 is the connected check's fill under text-white; its one use
     as text (the connect wizard's bolt icon) takes a light green. */
  :where(.app-theme) .text-sage-600 { color: #8cbf9c; }
  /* emerald-600/700 are text, except the export's Download button. */
  :where(.app-theme) .bg-emerald-600 { background-color: oklch(59.6% 0.145 163.225); }
  @media (hover: hover) {
    :where(.app-theme) .hover\:bg-emerald-700:hover { background-color: oklch(50.8% 0.118 165.612); }
  }
  /* Admin: red-600 is text in 17 places and the Spammer badge's fill
     under text-white in 2; amber-800 is text in 35 and, as
     hover:bg-amber-800, only ever the hover of an amber-700 button under
     text-white (6). The fills keep their light values. */
  :where(.app-theme) .bg-red-600 { background-color: oklch(57.7% 0.245 27.325); }
  @media (hover: hover) {
    :where(.app-theme) .hover\:bg-amber-800:hover { background-color: oklch(47.3% 0.137 46.201); }
  }
  /* hover:bg-stone-50 is a hover on a surface card or menu row. stone-50
     is the page, darker than the surface in dark, so it read as a dip
     while note rows lift; take the stone-100 lift like they do. */
  @media (hover: hover) {
    :where(.app-theme) .hover\:bg-stone-50:hover { background-color: var(--color-stone-100); }
    :where(.app-theme) .hover\:bg-stone-50\/50:hover { background-color: color-mix(in oklab, var(--color-stone-100) 50%, transparent); }
  }
}
