/* ==========================================================================
   Relay themes: themes.css
   --------------------------------------------------------------------------
   The server renders <html data-theme="..."> from the signed-in user's
   preference (Account → Appearance); signed-out pages get "system". The
   Relay theme (purple/black, the default) is app.css's :root block (also
   matched by [data-theme="relay"] and [data-theme="system"]); each block
   below overrides the tokens it changes. The selectors aren't tied to :root,
   so an element with data-theme (the Appearance page's previews) shows that
   theme inside any other. This file is linked after app.css: equal
   specificity, so these win. Tokens that
   app.css defines with var() (--focus, --code-bg, --chart-bar, --heat-0,
   --skeleton, ...) follow their source unless a theme sets them.

   Every block is checked by crates/web/src/tokens.rs: text 4.5:1 (7:1 in
   high-contrast) on every surface and tinted fill it is used on, controls,
   focus ring and presence balls 3:1. The "system" light block must equal the
   "light" block (the test compares them).

     light          clean neutral light; violet accent
     classic        the old Relay app: white, light gray rail, blue replies
     midnight       deep navy dark; electric blue accent
     forest         green-tinted dark; jade accent, lime "ok"
     sand           warm paper light; deep teal accent
     high-contrast  pure black, white text, lavender accent, yellow focus
     system         relay when the OS is dark, light when it is light
   ========================================================================== */


/* Light =================================================================== */

[data-theme="light"] {
  color-scheme: light;

  --inset: #FFFFFF;
  --bg: #F4F4F6;
  --surface: #FFFFFF;
  --raised: #F8F8FA;
  --hover: #EDEDF1;

  --border: #E4E4E9;
  --border-strong: #D4D4DB;
  --border-hover: #A9A9B3;
  --border-control: #8A8A95;
  --border-control-hover: #686873;

  --text: #18181B;
  --text-2: #52525B;
  --text-3: #686873;
  --on-accent: #FFFFFF;
  --on-danger: #FFFFFF;

  --accent: #6D4BF6;
  --accent-hover: #5B3BE0;
  --link: #5233D4;
  --accent-soft: rgba(109, 75, 246, 0.1);
  --accent-line: rgba(109, 75, 246, 0.35);
  --link-line: rgba(82, 51, 212, 0.35);

  --ok: #036B4D;
  --ok-soft: rgba(16, 185, 129, 0.12);
  --ok-line: rgba(4, 120, 87, 0.3);
  --danger: #BE123C;
  --danger-soft: rgba(225, 29, 72, 0.08);
  --danger-line: rgba(190, 18, 60, 0.3);
  --warn: #92400E;
  --warn-soft: rgba(245, 158, 11, 0.14);
  --warn-line: rgba(217, 119, 6, 0.4);
  --info: #1D4ED8;
  --info-soft: rgba(59, 130, 246, 0.1);
  --info-line: rgba(29, 78, 216, 0.3);

  --presence-online: #059669;
  --presence-away: #B76E00;
  --star: #B45309;
  --presence-busy: #E11D48;
  --presence-offline: #85858F;

  --selection-bg: rgba(109, 75, 246, 0.2);
  --selection-text: #18181B;
  --scrollbar-thumb: #C6C6CF;

  --backdrop: rgba(24, 24, 27, 0.4);
  --glass: rgba(244, 244, 246, 0.86);
  --wash-1: rgba(24, 24, 27, 0.02);
  --wash-2: rgba(24, 24, 27, 0.035);
  --wash-3: rgba(24, 24, 27, 0.06);

  --chart-1: #5B3BE0;
  --chart-2: #0369A1;
  --chart-3: #0B6A62;
  --chart-4: #92400E;
  --chart-5: #BE123C;
  --chart-6: #3F6212;
  --heat-0: #EDEDF1;
  --heat-1: #E2DBFE;
  --heat-2: #C3B4FC;
  --heat-3: #9B83F9;
  --heat-4: #6D4BF6;
  --heat-5: #4325B5;

  /* Customer avatars: data-hue 1…10 (see app.css). */
  --avatar-1-bg: #FECDD3;
  --avatar-1-fg: #9F1239;
  --avatar-2-bg: #FED7AA;
  --avatar-2-fg: #9A3412;
  --avatar-3-bg: #FDE68A;
  --avatar-3-fg: #92400E;
  --avatar-4-bg: #D9F99D;
  --avatar-4-fg: #3F6212;
  --avatar-5-bg: #A7F3D0;
  --avatar-5-fg: #065F46;
  --avatar-6-bg: #A5F3FC;
  --avatar-6-fg: #155E75;
  --avatar-7-bg: #BFDBFE;
  --avatar-7-fg: #1E40AF;
  --avatar-8-bg: #C7D2FE;
  --avatar-8-fg: #3730A3;
  --avatar-9-bg: #E9D5FF;
  --avatar-9-fg: #6B21A8;
  --avatar-10-bg: #F5D0FE;
  --avatar-10-fg: #86198F;

  --shadow-pop: 0 16px 48px rgba(24, 24, 27, 0.14), 0 0 0 1px rgba(24, 24, 27, 0.06);
  --shadow-card: 0 1px 2px rgba(24, 24, 27, 0.05);
  --shadow-accent: 0 6px 18px rgba(109, 75, 246, 0.28);
  --glow: rgba(109, 75, 246, 0.09);
}


/* Classic =================================================================
   The look of the old Relay app: crisp white panes, a very light gray rail,
   hairline borders, near-black text, solid blue replies, a near-black primary
   button. The reference blue #4F7FE8 gives white text 3.8:1, so the accent is
   the nearest darker shade, #3B6FE0 (4.6:1). The few rules tokens can't
   express are under "Classic: rules" at the end of this file. */

[data-theme="classic"] {
  color-scheme: light;

  --inset: #FFFFFF;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --raised: #F2F3F5;
  --hover: #EFF0F3;

  --border: #E7E8EB;
  --border-strong: #DADBE0;
  --border-hover: #B3B5BC;
  --border-control: #85878F;
  --border-control-hover: #696B73;

  --text: #111114;
  --text-2: #5F6169;
  --text-3: #696B73;
  --on-accent: #FFFFFF;
  --on-danger: #FFFFFF;

  --accent: #3B6FE0;
  --accent-hover: #2F5FD0;
  --link: #2557C9;
  --accent-soft: rgba(59, 111, 224, 0.08);
  --accent-line: rgba(59, 111, 224, 0.35);
  --link-line: rgba(37, 87, 201, 0.35);

  --ok: #036B4D;
  --ok-soft: rgba(16, 185, 129, 0.12);
  --ok-line: rgba(4, 120, 87, 0.3);
  --danger: #BE123C;
  --danger-soft: rgba(225, 29, 72, 0.08);
  --danger-line: rgba(190, 18, 60, 0.3);
  --warn: #B93D0B;
  --warn-soft: rgba(249, 115, 22, 0.1);
  --warn-line: rgba(234, 88, 12, 0.35);
  --info: #1D4ED8;
  --info-soft: rgba(59, 130, 246, 0.1);
  --info-line: rgba(29, 78, 216, 0.3);

  --presence-online: #059669;
  --presence-away: #B76E00;
  --presence-busy: #E11D48;
  --presence-offline: #85878F;

  /* The star on a starred conversation: amber (3:1 on every surface). */
  --star: #B45309;

  --selection-bg: rgba(59, 111, 224, 0.2);
  --selection-text: #111114;
  --scrollbar-thumb: #CDCED4;

  --backdrop: rgba(17, 17, 20, 0.4);
  --glass: rgba(255, 255, 255, 0.9);
  --wash-1: rgba(17, 17, 20, 0.02);
  --wash-2: rgba(17, 17, 20, 0.035);
  --wash-3: rgba(17, 17, 20, 0.06);

  --chart-1: #1D4ED8;
  --chart-2: #6D28D9;
  --chart-3: #0B6A62;
  --chart-4: #92400E;
  --chart-5: #BE123C;
  --chart-6: #3F6212;
  --heat-0: #F0F1F4;
  --heat-1: #DDE6FA;
  --heat-2: #B9CCF5;
  --heat-3: #86A6EE;
  --heat-4: #3B6FE0;
  --heat-5: #1E46A8;

  /* Customer avatars: pastel circles, coloured initials (Tailwind 100 fills,
     700/800 text); data-hue 1…10 (see app.css). */
  --avatar-1-bg: #FFE4E6;
  --avatar-1-fg: #BE123C;
  --avatar-2-bg: #FFEDD5;
  --avatar-2-fg: #9A3412;
  --avatar-3-bg: #FEF3C7;
  --avatar-3-fg: #92400E;
  --avatar-4-bg: #ECFCCB;
  --avatar-4-fg: #3F6212;
  --avatar-5-bg: #D1FAE5;
  --avatar-5-fg: #047857;
  --avatar-6-bg: #CFFAFE;
  --avatar-6-fg: #0E7490;
  --avatar-7-bg: #DBEAFE;
  --avatar-7-fg: #1D4ED8;
  --avatar-8-bg: #E0E7FF;
  --avatar-8-fg: #4338CA;
  --avatar-9-bg: #F3E8FF;
  --avatar-9-fg: #7E22CE;
  --avatar-10-bg: #FAE8FF;
  --avatar-10-fg: #A21CAF;

  /* The rail: very light gray, the current item a white block. */
  --rail-bg: #F7F7F8;
  --rail-current: #FFFFFF;

  /* Type: the system UI face for titles too (no display face), tighter labels. */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;
  --tracking-display: -0.02em;

  --shadow-pop: 0 12px 40px rgba(17, 17, 20, 0.12), 0 0 0 1px rgba(17, 17, 20, 0.06);
  --shadow-card: 0 1px 2px rgba(17, 17, 20, 0.04);
  --shadow-accent: 0 4px 14px rgba(17, 17, 20, 0.18);
  --glow: rgba(59, 111, 224, 0.08);
}


/* Midnight ================================================================ */

[data-theme="midnight"] {
  color-scheme: dark;

  --inset: #060B17;
  --bg: #0A1020;
  --surface: #0F172A;
  --raised: #16203A;
  --hover: #1D2946;

  --border: #1C2742;
  --border-strong: #2A3758;
  --border-hover: #3E4E74;
  --border-control: #5E7098;
  --border-control-hover: #7D8FB6;

  --text: #E8EEF9;
  --text-2: #A7B5D0;
  --text-3: #8898B7;
  --on-accent: #FFFFFF;
  --on-danger: #0A1020;

  --accent: #3A66F0;
  --accent-hover: #5580F7;
  --link: #8FB3FF;
  --accent-soft: rgba(58, 102, 240, 0.2);
  --accent-line: rgba(85, 128, 247, 0.5);
  --link-line: rgba(143, 179, 255, 0.45);
  --focus: #6E98FF;

  --ok: #4ADE9A;
  --ok-soft: rgba(74, 222, 154, 0.12);
  --ok-line: rgba(74, 222, 154, 0.35);
  --danger: #FF8297;
  --danger-soft: rgba(255, 130, 151, 0.12);
  --danger-line: rgba(255, 130, 151, 0.4);
  --warn: #FACC5A;
  --warn-soft: rgba(250, 204, 90, 0.12);
  --warn-line: rgba(250, 204, 90, 0.35);
  --info: #67D0F5;
  --info-soft: rgba(103, 208, 245, 0.12);
  --info-line: rgba(103, 208, 245, 0.35);

  --presence-online: #3DDC97;
  --presence-away: #F5C04A;
  --star: #FBBF24;
  --presence-busy: #FF7189;
  --presence-offline: #71809F;

  --selection-bg: rgba(58, 102, 240, 0.5);
  --selection-text: #FFFFFF;

  --backdrop: rgba(2, 6, 16, 0.68);
  --glass: rgba(10, 16, 32, 0.86);
  --wash-1: rgba(160, 190, 255, 0.02);
  --wash-2: rgba(160, 190, 255, 0.035);
  --wash-3: rgba(160, 190, 255, 0.055);

  --chart-1: #A9BDFF;
  --chart-2: #7DD3FC;
  --chart-3: #5EEAD4;
  --chart-4: #FCD34D;
  --chart-5: #FDA4AF;
  --chart-6: #BEF264;
  --heat-1: #15295A;
  --heat-2: #1C3D8F;
  --heat-3: #2A58D0;
  --heat-4: #5583F7;
  --heat-5: #A9C4FF;

  /* Customer avatars: data-hue 1…10 (see app.css). */
  --avatar-1-bg: #881337;
  --avatar-1-fg: #FECDD3;
  --avatar-2-bg: #7C2D12;
  --avatar-2-fg: #FED7AA;
  --avatar-3-bg: #78350F;
  --avatar-3-fg: #FDE68A;
  --avatar-4-bg: #365314;
  --avatar-4-fg: #D9F99D;
  --avatar-5-bg: #064E3B;
  --avatar-5-fg: #A7F3D0;
  --avatar-6-bg: #164E63;
  --avatar-6-fg: #A5F3FC;
  --avatar-7-bg: #1E3A8A;
  --avatar-7-fg: #BFDBFE;
  --avatar-8-bg: #312E81;
  --avatar-8-fg: #C7D2FE;
  --avatar-9-bg: #581C87;
  --avatar-9-fg: #E9D5FF;
  --avatar-10-bg: #701A75;
  --avatar-10-fg: #F5D0FE;

  --shadow-pop: 0 24px 70px rgba(0, 4, 16, 0.6), 0 0 0 1px rgba(160, 190, 255, 0.05);
  --shadow-card: 0 1px 0 rgba(160, 190, 255, 0.05) inset;
  --shadow-accent: 0 8px 24px rgba(58, 102, 240, 0.4);
  --glow: rgba(58, 102, 240, 0.16);
}


/* Forest ================================================================== */

[data-theme="forest"] {
  color-scheme: dark;

  --inset: #060B09;
  --bg: #09100D;
  --surface: #0F1814;
  --raised: #15211B;
  --hover: #1B2A23;

  --border: #1C2B24;
  --border-strong: #2A3D33;
  --border-hover: #3F574A;
  --border-control: #5E7B6B;
  --border-control-hover: #7E9A8A;

  --text: #EAF2ED;
  --text-2: #A8BCAF;
  --text-3: #89A193;
  --on-accent: #FFFFFF;
  --on-danger: #09100D;

  --accent: #17845E;
  --accent-hover: #1F9A6E;
  --link: #7FDBB2;
  --accent-soft: rgba(31, 154, 110, 0.18);
  --accent-line: rgba(31, 154, 110, 0.5);
  --link-line: rgba(127, 219, 178, 0.45);
  --focus: #3FC28D;

  --ok: #B7E36E;
  --ok-soft: rgba(183, 227, 110, 0.12);
  --ok-line: rgba(183, 227, 110, 0.35);
  --danger: #FF8D82;
  --danger-soft: rgba(255, 141, 130, 0.12);
  --danger-line: rgba(255, 141, 130, 0.4);
  --warn: #F2CB55;
  --warn-soft: rgba(242, 203, 85, 0.12);
  --warn-line: rgba(242, 203, 85, 0.35);
  --info: #7CC8F0;
  --info-soft: rgba(124, 200, 240, 0.12);
  --info-line: rgba(124, 200, 240, 0.35);

  --presence-online: #4ADE80;
  --presence-away: #F5C542;
  --star: #FBBF24;
  --presence-busy: #FF7A6E;
  --presence-offline: #6E8579;

  --selection-bg: rgba(31, 154, 110, 0.45);
  --selection-text: #FFFFFF;

  --backdrop: rgba(2, 8, 5, 0.68);
  --glass: rgba(9, 16, 13, 0.86);
  --wash-1: rgba(200, 255, 225, 0.018);
  --wash-2: rgba(200, 255, 225, 0.03);
  --wash-3: rgba(200, 255, 225, 0.05);

  --chart-1: #8FE0BC;
  --chart-2: #8CCBFF;
  --chart-3: #E8D27C;
  --chart-4: #F7AE8F;
  --chart-5: #C9B8FF;
  --chart-6: #C2E77F;
  --heat-1: #10301F;
  --heat-2: #144D33;
  --heat-3: #1A704A;
  --heat-4: #2C9A66;
  --heat-5: #93E0B6;

  /* Customer avatars: data-hue 1…10 (see app.css). */
  --avatar-1-bg: #881337;
  --avatar-1-fg: #FECDD3;
  --avatar-2-bg: #7C2D12;
  --avatar-2-fg: #FED7AA;
  --avatar-3-bg: #78350F;
  --avatar-3-fg: #FDE68A;
  --avatar-4-bg: #365314;
  --avatar-4-fg: #D9F99D;
  --avatar-5-bg: #064E3B;
  --avatar-5-fg: #A7F3D0;
  --avatar-6-bg: #164E63;
  --avatar-6-fg: #A5F3FC;
  --avatar-7-bg: #1E3A8A;
  --avatar-7-fg: #BFDBFE;
  --avatar-8-bg: #312E81;
  --avatar-8-fg: #C7D2FE;
  --avatar-9-bg: #581C87;
  --avatar-9-fg: #E9D5FF;
  --avatar-10-bg: #701A75;
  --avatar-10-fg: #F5D0FE;

  --shadow-pop: 0 24px 70px rgba(0, 6, 3, 0.6), 0 0 0 1px rgba(200, 255, 225, 0.04);
  --shadow-card: 0 1px 0 rgba(200, 255, 225, 0.04) inset;
  --shadow-accent: 0 8px 24px rgba(23, 132, 94, 0.4);
  --glow: rgba(31, 154, 110, 0.14);
}


/* Sand ==================================================================== */

[data-theme="sand"] {
  color-scheme: light;

  --inset: #FFFEFB;
  --bg: #F3EDE3;
  --surface: #FFFCF7;
  --raised: #F9F4EC;
  --hover: #EFE7DA;

  --border: #E7DDCD;
  --border-strong: #D9CCB7;
  --border-hover: #B4A58A;
  --border-control: #948470;
  --border-control-hover: #766853;

  --text: #2A2119;
  --text-2: #5C4F41;
  --text-3: #6F6253;
  --on-accent: #FFFFFF;
  --on-danger: #FFFFFF;

  --accent: #1C6870;
  --accent-hover: #155660;
  --link: #165B63;
  --accent-soft: rgba(28, 104, 112, 0.1);
  --accent-line: rgba(28, 104, 112, 0.35);
  --link-line: rgba(22, 91, 99, 0.35);

  --ok: #3B6B1C;
  --ok-soft: rgba(101, 163, 13, 0.13);
  --ok-line: rgba(59, 107, 28, 0.3);
  --danger: #B0281E;
  --danger-soft: rgba(196, 50, 36, 0.09);
  --danger-line: rgba(176, 40, 30, 0.3);
  --warn: #874A05;
  --warn-soft: rgba(224, 150, 30, 0.16);
  --warn-line: rgba(180, 110, 10, 0.4);
  --info: #2A5A8C;
  --info-soft: rgba(42, 90, 140, 0.1);
  --info-line: rgba(42, 90, 140, 0.3);

  --presence-online: #2E8540;
  --presence-away: #AD6A00;
  --star: #B45309;
  --presence-busy: #C8352B;
  --presence-offline: #8F806C;

  --selection-bg: rgba(28, 104, 112, 0.2);
  --selection-text: #2A2119;
  --scrollbar-thumb: #CDBFA7;

  --backdrop: rgba(42, 33, 25, 0.38);
  --glass: rgba(243, 237, 227, 0.86);
  --wash-1: rgba(90, 60, 20, 0.025);
  --wash-2: rgba(90, 60, 20, 0.04);
  --wash-3: rgba(90, 60, 20, 0.065);

  --chart-1: #1C6870;
  --chart-2: #2A5A8C;
  --chart-3: #4A6A16;
  --chart-4: #855400;
  --chart-5: #A3304A;
  --chart-6: #6C3F8C;
  --heat-0: #EFE7DA;
  --heat-1: #D3E6E3;
  --heat-2: #A2CDCB;
  --heat-3: #63A6A9;
  --heat-4: #2A7980;
  --heat-5: #134A50;

  /* Customer avatars: data-hue 1…10 (see app.css). */
  --avatar-1-bg: #FECDD3;
  --avatar-1-fg: #9F1239;
  --avatar-2-bg: #FED7AA;
  --avatar-2-fg: #9A3412;
  --avatar-3-bg: #FDE68A;
  --avatar-3-fg: #92400E;
  --avatar-4-bg: #D9F99D;
  --avatar-4-fg: #3F6212;
  --avatar-5-bg: #A7F3D0;
  --avatar-5-fg: #065F46;
  --avatar-6-bg: #A5F3FC;
  --avatar-6-fg: #155E75;
  --avatar-7-bg: #BFDBFE;
  --avatar-7-fg: #1E40AF;
  --avatar-8-bg: #C7D2FE;
  --avatar-8-fg: #3730A3;
  --avatar-9-bg: #E9D5FF;
  --avatar-9-fg: #6B21A8;
  --avatar-10-bg: #F5D0FE;
  --avatar-10-fg: #86198F;

  --shadow-pop: 0 16px 48px rgba(60, 40, 20, 0.15), 0 0 0 1px rgba(60, 40, 20, 0.06);
  --shadow-card: 0 1px 2px rgba(60, 40, 20, 0.05);
  --shadow-accent: 0 6px 18px rgba(28, 104, 112, 0.25);
  --glow: rgba(28, 104, 112, 0.08);
}


/* High contrast =========================================================== */

[data-theme="high-contrast"] {
  color-scheme: dark;

  --inset: #000000;
  --bg: #000000;
  --surface: #0B0B0B;
  --raised: #161616;
  --hover: #242424;

  --border: #6E6E6E;
  --border-strong: #8F8F8F;
  --border-hover: #C2C2C2;
  --border-control: #C2C2C2;
  --border-control-hover: #FFFFFF;

  --text: #FFFFFF;
  --text-2: #E8E8E8;
  --text-3: #D0D0D0;
  --on-accent: #000000;
  --on-danger: #000000;

  --accent: #C9B8FF;
  --accent-hover: #E0D6FF;
  --link: #D2C4FF;
  --accent-soft: rgba(201, 184, 255, 0.16);
  --accent-line: rgba(201, 184, 255, 0.7);
  --link-line: rgba(210, 196, 255, 0.8);
  --focus: #FFE14D;

  --ok: #7DF5B4;
  --ok-soft: rgba(125, 245, 180, 0.12);
  --ok-line: rgba(125, 245, 180, 0.6);
  --danger: #FFA6B2;
  --danger-soft: rgba(255, 166, 178, 0.12);
  --danger-line: rgba(255, 166, 178, 0.6);
  --warn: #FFE170;
  --warn-soft: rgba(255, 225, 112, 0.12);
  --warn-line: rgba(255, 225, 112, 0.6);
  --info: #9DD5FF;
  --info-soft: rgba(157, 213, 255, 0.12);
  --info-line: rgba(157, 213, 255, 0.6);

  --presence-online: #4ADE80;
  --presence-away: #FACC15;
  --star: #FACC15;
  --presence-busy: #FF6B81;
  --presence-offline: #A3A3A3;

  --selection-bg: #FFE14D;
  --selection-text: #000000;
  --scrollbar-thumb: #8F8F8F;

  --backdrop: rgba(0, 0, 0, 0.82);
  --glass: rgba(0, 0, 0, 0.95);
  --wash-1: rgba(255, 255, 255, 0.04);
  --wash-2: rgba(255, 255, 255, 0.07);
  --wash-3: rgba(255, 255, 255, 0.1);

  --chart-1: #D2C4FF;
  --chart-2: #9DD5FF;
  --chart-3: #7DF5DC;
  --chart-4: #FFE170;
  --chart-5: #FFA6B2;
  --chart-6: #C8F08A;
  --heat-1: #241D45;
  --heat-2: #3F3290;
  --heat-3: #634BDB;
  --heat-4: #9A85FF;
  --heat-5: #E0D6FF;

  /* Customer avatars: data-hue 1…10 (see app.css). */
  --avatar-1-bg: #4C0519;
  --avatar-1-fg: #FFE4E6;
  --avatar-2-bg: #431407;
  --avatar-2-fg: #FFEDD5;
  --avatar-3-bg: #451A03;
  --avatar-3-fg: #FEF3C7;
  --avatar-4-bg: #1A2E05;
  --avatar-4-fg: #ECFCCB;
  --avatar-5-bg: #022C22;
  --avatar-5-fg: #D1FAE5;
  --avatar-6-bg: #083344;
  --avatar-6-fg: #CFFAFE;
  --avatar-7-bg: #172554;
  --avatar-7-fg: #DBEAFE;
  --avatar-8-bg: #1E1B4B;
  --avatar-8-fg: #E0E7FF;
  --avatar-9-bg: #3B0764;
  --avatar-9-fg: #F3E8FF;
  --avatar-10-bg: #4A044E;
  --avatar-10-fg: #FAE8FF;

  --shadow-pop: 0 0 0 1px #8F8F8F, 0 24px 70px rgba(0, 0, 0, 0.8);
  --shadow-card: none;
  --shadow-accent: 0 0 0 1px #FFFFFF;
  --glow: rgba(201, 184, 255, 0.08);
}


/* System ==================================================================
   Relay (app.css :root) when the OS is dark; when it is light, the Light
   block again, word for word (CSS can't share a block across a media query;
   the tokens test checks the two are identical). */

@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    color-scheme: light;

    --inset: #FFFFFF;
    --bg: #F4F4F6;
    --surface: #FFFFFF;
    --raised: #F8F8FA;
    --hover: #EDEDF1;

    --border: #E4E4E9;
    --border-strong: #D4D4DB;
    --border-hover: #A9A9B3;
    --border-control: #8A8A95;
    --border-control-hover: #686873;

    --text: #18181B;
    --text-2: #52525B;
    --text-3: #686873;
    --on-accent: #FFFFFF;
    --on-danger: #FFFFFF;

    --accent: #6D4BF6;
    --accent-hover: #5B3BE0;
    --link: #5233D4;
    --accent-soft: rgba(109, 75, 246, 0.1);
    --accent-line: rgba(109, 75, 246, 0.35);
    --link-line: rgba(82, 51, 212, 0.35);

    --ok: #036B4D;
    --ok-soft: rgba(16, 185, 129, 0.12);
    --ok-line: rgba(4, 120, 87, 0.3);
    --danger: #BE123C;
    --danger-soft: rgba(225, 29, 72, 0.08);
    --danger-line: rgba(190, 18, 60, 0.3);
    --warn: #92400E;
    --warn-soft: rgba(245, 158, 11, 0.14);
    --warn-line: rgba(217, 119, 6, 0.4);
    --info: #1D4ED8;
    --info-soft: rgba(59, 130, 246, 0.1);
    --info-line: rgba(29, 78, 216, 0.3);

    --presence-online: #059669;
    --presence-away: #B76E00;
    --star: #B45309;
    --presence-busy: #E11D48;
    --presence-offline: #85858F;

    --selection-bg: rgba(109, 75, 246, 0.2);
    --selection-text: #18181B;
    --scrollbar-thumb: #C6C6CF;

    --backdrop: rgba(24, 24, 27, 0.4);
    --glass: rgba(244, 244, 246, 0.86);
    --wash-1: rgba(24, 24, 27, 0.02);
    --wash-2: rgba(24, 24, 27, 0.035);
    --wash-3: rgba(24, 24, 27, 0.06);

    --chart-1: #5B3BE0;
    --chart-2: #0369A1;
    --chart-3: #0B6A62;
    --chart-4: #92400E;
    --chart-5: #BE123C;
    --chart-6: #3F6212;
    --heat-0: #EDEDF1;
    --heat-1: #E2DBFE;
    --heat-2: #C3B4FC;
    --heat-3: #9B83F9;
    --heat-4: #6D4BF6;
    --heat-5: #4325B5;

    /* Customer avatars: data-hue 1…10 (see app.css). */
    --avatar-1-bg: #FECDD3;
    --avatar-1-fg: #9F1239;
    --avatar-2-bg: #FED7AA;
    --avatar-2-fg: #9A3412;
    --avatar-3-bg: #FDE68A;
    --avatar-3-fg: #92400E;
    --avatar-4-bg: #D9F99D;
    --avatar-4-fg: #3F6212;
    --avatar-5-bg: #A7F3D0;
    --avatar-5-fg: #065F46;
    --avatar-6-bg: #A5F3FC;
    --avatar-6-fg: #155E75;
    --avatar-7-bg: #BFDBFE;
    --avatar-7-fg: #1E40AF;
    --avatar-8-bg: #C7D2FE;
    --avatar-8-fg: #3730A3;
    --avatar-9-bg: #E9D5FF;
    --avatar-9-fg: #6B21A8;
    --avatar-10-bg: #F5D0FE;
    --avatar-10-fg: #86198F;

    --shadow-pop: 0 16px 48px rgba(24, 24, 27, 0.14), 0 0 0 1px rgba(24, 24, 27, 0.06);
    --shadow-card: 0 1px 2px rgba(24, 24, 27, 0.05);
    --shadow-accent: 0 6px 18px rgba(109, 75, 246, 0.28);
    --glow: rgba(109, 75, 246, 0.09);
  }
}


/* Classic: rules =============================================================
   What the Classic tokens can't say on their own (colours and type only, tokens
   only; the layout is every theme's). Checked by crates/web/src/tokens.rs. */

/* The primary button is near-black, not the accent (the old app's assign button). */
[data-theme="classic"] .btn-primary {
  border-color: var(--text);
  background: var(--text);
  color: var(--surface);
}

[data-theme="classic"] .btn-primary:hover {
  border-color: var(--text);
  box-shadow: 0 0 0 1px var(--text), var(--shadow-accent);
}

/* Replies: a solid accent bubble with white text; its header and body (author,
   role, time, links) read in --on-accent. Attachments keep their own chip colours.
   Customer messages: a borderless gray bubble. */
[data-theme="classic"] .msg-agent {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

[data-theme="classic"] .msg-agent .msg-meta,
[data-theme="classic"] .msg-agent .msg-body {
  --text: var(--on-accent);
  --text-2: var(--on-accent);
  --text-3: var(--on-accent);
  --link: var(--on-accent);
  --link-line: var(--on-accent);
  color: var(--on-accent);
}

[data-theme="classic"] .msg-agent :focus-visible {
  outline-color: var(--on-accent);
}

[data-theme="classic"] .msg-visitor {
  border-color: transparent;
}

/* List rows on white: hover shows a light gray. */
[data-theme="classic"] .conv-row:hover .conv-link:not([aria-current="page"]) {
  background: var(--hover);
}

/* Section labels: small, uppercase, letter-spaced gray in the UI face (not mono). */
[data-theme="classic"] .eyebrow,
[data-theme="classic"] .detail-title {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* Times, table heads, key/value labels and chart axes in the UI face too; code, keys
   (kbd) and IDs keep the mono face. */
[data-theme="classic"] .timestamp,
[data-theme="classic"] .kv dt,
[data-theme="classic"] .table th,
[data-theme="classic"] .topbar-ws-slug,
[data-theme="classic"] .msg-role,
[data-theme="classic"] .tile-label,
[data-theme="classic"] .chart-x,
[data-theme="classic"] .chart-y {
  font-family: var(--font-sans);
  letter-spacing: 0;
}

/* Titles in the UI face read heavy at 800. */
[data-theme="classic"] .page-title,
/* The search field: rounded, with the ⌘K chip. */
[data-theme="classic"] .search-box {
  border-radius: 10px;
}

[data-theme="classic"] .search-box-kbd {
  border-bottom-width: 1px;
  background: var(--surface);
}
