/* Dark theme of the chat page (by the person's choice: the sidebar button, kept in fit.theme). Loaded last.
 * Taken from the live page's polish.css (ADR-T040, 20/11/2026): only its dark-theme part — the dark values of the
 * redesign's own colour variables and the surfaces it painted with fixed light colours. The rest of polish.css
 * (one-column welcome, mode switch, no offset shadows…) changes the approved design and is not taken.
 * Removing this file (and the sidebar button) brings back the light-only page. */

:root[data-theme="dark"] {
  /* The redesign paints with palette steps directly (gray-100 fields, gray-700 times, blue-200 lines…). */
  --gray-50: #151E30; --gray-100: #1A2438; --gray-200: #263248; --gray-300: #34405A; --gray-400: #5B6780;
  --gray-500: #8792A6; --gray-600: #A3ADBE; --gray-700: #BAC2CF; --gray-800: #D5DBE4; --gray-900: #EEF1F5;
  --tdtu-blue-50: #16223A; --tdtu-blue-100: #1B2A47; --tdtu-blue-200: #2C3F63;
  --v-ink: var(--heading);                  /* navy text/borders would vanish on the dark canvas */
  /* Only on 8897 (not in polish.css): the redesign writes headings, bold words and links in blue-800, which turns
     unreadable on the dark canvas; it is only ever a text colour, so it becomes a light blue. */
  --tdtu-blue-800: #B9CCF5;
  /* Yellow and cream are only ever backgrounds (selected, hover, highlighted): a deep amber keeps the accent without
     glaring, and the light text drawn on them stays readable. */
  --v-yellow: #5A4712; --v-yellow-strong: #6E5717; --v-cream: #262316;
  --tdtu-red-100: #3A1820;   /* light pink panels (a tool that could not load): the dark danger tint */
}

/* Surfaces the redesign painted with fixed light colours (polish.css §10). */
:root[data-theme="dark"] .brand .tile { background: #fff; border-radius: 8px; }
:root[data-theme="dark"] .lede-q, :root[data-theme="dark"] .lede-a { color: var(--text-2); }
:root[data-theme="dark"] .msg.user .bubble { border: 1px solid var(--border); background: var(--surface-1); color: var(--text); }
/* The brand blue turns light, so filled buttons take dark text (white failed 4.5:1). */
:root[data-theme="dark"] .tb-solid.btn-login,
:root[data-theme="dark"] .signin-btn, :root[data-theme="dark"] .avatar { color: #0B1220; }
:root[data-theme="dark"] .tb-solid.btn-login:hover, :root[data-theme="dark"] .signin-btn:hover { color: #0B1220; }
/* The send button stays TDTU red here (the live page's is blue): white on red reads, dark text did not (2.97:1). */
:root[data-theme="dark"] .send, :root[data-theme="dark"] .send:hover { color: #fff; }
:root[data-theme="dark"] [data-slot="notice"] p, :root[data-theme="dark"] .sa-state small { color: var(--muted); }
:root[data-theme="dark"] .cite.is-on, :root[data-theme="dark"] .sc-part[aria-pressed="true"] .sc-pn { color: #0B1220; }
/* (8897 removes body[data-cv] while it runs, so these rules do not lean on it as polish.css did.) */

/* Short notices: a light strip on the dark page (navy with dark text read at 1.14:1). */
:root[data-theme="dark"] #toast { background: #E6EBF5; color: #0B1220; }

/* Answer notes: the red / amber / navy titles were drawn for a light card; the dark theme's lighter tones. */
:root[data-theme="dark"] .er { --er-c: var(--danger-600); --er-line: var(--danger-500); }
:root[data-theme="dark"] .er.is-warning, :root[data-theme="dark"] .er-cut { --er-c: var(--warning-600); --er-line: var(--warning-500); }
