/*
  CHAT_COLOR_FONT_TOKENS_V1
  Color + font tokens for the existing /chat UI.
  No layout, spacing, radius, component structure, or button geometry changes.

  Rollback:
  Remove the chat-color-font-preview.css <link> from auth/authstatic/chat.html.
*/

@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;450;500;600;700&display=swap");

:root {
  --font-d: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-b: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-m: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="dark"] {
  --bg-0: #000000; /* CHAT_DARK_BLACK_V1: final dark-mode chat surface override */
  --bg-1: #0A0A0A; /* CHAT_SIDEBAR_BLACK_V1: final sidebar surface override */
  --bg-2: #1f201e;
  --bg-3: #292a27;
  --bg-4: #33342f;
  --bg-user: rgba(255,255,255,.055);
  --bg-glass: rgba(31,32,30,.88);

  --brd: rgba(255,255,255,.075);
  --brd-2: rgba(255,255,255,.11);
  --brd-3: rgba(255,255,255,.16);

  --tx: #ecebe5;
  --tx-2: #bdb9ad;
  --tx-3: #8c877b;
  --tx-4: #68645b;

  --ac: #a99a78;
  --ac-2: #b8aa87;
  --ac-3: #83765a;
  --ac-dim: rgba(169,154,120,.12);
  --ac-glow: rgba(169,154,120,.055);

  --adaptive: #879582;
  --adaptive-dim: rgba(135,149,130,.12);
  --lyt: #b8aa87;
  --lyt-dim: rgba(184,170,135,.12);
  --omni: #7f999e;
  --omni-dim: rgba(127,153,158,.12);
  --prme: #83a69f;
  --prme-dim: rgba(131,166,159,.12);

  --code-bg: #141514;
  --code-hd: #1f201e;
  --sh-sm: 0 1px 3px rgba(0,0,0,.28);
  --sh-md: 0 8px 28px rgba(0,0,0,.28);
  --sh-lg: 0 18px 54px rgba(0,0,0,.38);
}

[data-theme="light"] {
  --bg-0: #FFFFFF; /* EPITHRE_LIGHT_V2: plain white chat surface */
  --bg-1: #FDFBF6;
  --bg-2: #F8F3E7;
  --bg-3: #EFE6D2;
  --bg-4: #DED0B3;
  --bg-user: rgba(44,74,111,.075);
  --bg-glass: rgba(253,251,246,.90);

  --brd: rgba(31,24,18,.10);
  --brd-2: rgba(31,24,18,.16);
  --brd-3: rgba(31,24,18,.24);

  --tx: #1F1812;
  --tx-2: rgba(31,24,18,.74);
  --tx-3: rgba(31,24,18,.54);
  --tx-4: rgba(31,24,18,.38);

  --ac: #2C4A6F;
  --ac-2: #3B5D86;
  --ac-3: #1F3858;
  --ac-dim: rgba(44,74,111,.10);
  --ac-glow: rgba(44,74,111,.055);

  --adaptive: #7A4E2D;
  --adaptive-dim: rgba(122,78,45,.10);
  --lyt: #8A5A2B;
  --lyt-dim: rgba(138,90,43,.10);
  --omni: #2C4A6F;
  --omni-dim: rgba(44,74,111,.10);
  --prme: #41684F;
  --prme-dim: rgba(65,104,79,.10);

  --code-bg: #1F1812;
  --code-hd: #2A2118;
  --sh-sm: 0 1px 2px rgba(31,24,18,.06);
  --sh-md: 0 8px 28px rgba(31,24,18,.10);
  --sh-lg: 0 18px 54px rgba(31,24,18,.14);
}

[data-theme="light"] .topbar {
  background: rgba(253,251,246,.92);
  border-bottom-color: rgba(31,24,18,.07);
}

[data-theme="light"] .input-area {
  background: linear-gradient(to top, #FFFFFF 60%, rgba(255,255,255,.88) 75%, transparent);
}

[data-theme="light"] .input-box {
  background: rgba(253,251,246,.94);
  border-color: rgba(31,24,18,.14);
  box-shadow: 0 12px 34px rgba(31,24,18,.08);
}

[data-theme="light"] .input-box:focus-within {
  border-color: rgba(44,74,111,.28);
  box-shadow: 0 0 0 2px rgba(44,74,111,.08), 0 12px 34px rgba(31,24,18,.10);
}

[data-theme="light"] .msg.user .m-body {
  background: rgba(44,74,111,.075);
  border-color: rgba(44,74,111,.14);
}

[data-theme="light"] .sb-new,
[data-theme="light"] .sb-list .c-it.on,
[data-theme="light"] .sb-list .c-it.active,
[data-theme="light"] .sb-list .c-it[class*="active"] {
  background: rgba(44,74,111,.07);
  border-color: rgba(44,74,111,.14);
  color: #2C4A6F;
}

[data-theme="light"] .sb-new:hover {
  background: rgba(44,74,111,.10);
  border-color: rgba(44,74,111,.20);
}

html,
body,
button,
input,
textarea,
select {
  font-family: var(--font-b);
  letter-spacing: 0;
}

.m-txt,
#msgIn {
  font-family: var(--font-b);
}

.m-txt {
  font-size: 17px;
  line-height: 1.72;
}

.msg.user .m-txt {
  font-size: 17px;
  line-height: 1.52;
}

.msg.assistant .m-txt {
  font-size: 17px;
  line-height: 1.7;
}

/* ASSISTANT_TURN_POLISH_V1: clear document hierarchy without turning answers
   into oversized article cards. Data blocks keep the full reading width. */
.msg.assistant .m-txt > :first-child {
  margin-top: 0;
}

.msg.assistant .m-txt h1 {
  font-size: 1.5rem;
  line-height: 1.24;
}

.msg.assistant .m-txt h2 {
  font-size: 1.3rem;
  line-height: 1.3;
}

.msg.assistant .m-txt h3 {
  font-size: 1.08rem;
  line-height: 1.4;
}

.msg.assistant .m-txt p {
  margin-bottom: 14px;
}

/* CALLOUT_LEGACY_STYLE_V1: keep RICH_PANELS_V4 callouts on their original
   compact rhythm; the assistant document-spacing rules above must not leak
   into [!TIP]/[!NOTE]/other admonition boxes. */
.msg.assistant .m-txt > .adm-box:first-child {
  margin-top: 14px;
}

.msg.assistant .m-txt .adm-content p {
  margin-bottom: 8px !important;
}

.msg.assistant .m-txt .adm-content p:last-child {
  margin-bottom: 0 !important;
}
