/* SHHH design tokens — "Violet Ember" palette (§41).
 * Light and dark themes via [data-theme] on <html>. "system" follows the
 * browser. No third-party fonts or icon libraries; system UI stack only.
 */
:root, [data-theme="light"] {
  --primary: #5A4FCF;
  --primary-hover: #4A40B8;
  --primary-subtle: #EEEEFB;
  --primary-fg: #FFFFFF; /* text on --primary-filled surfaces (AA on light) */
  --danger-fg: #FFFFFF;  /* text on --error-filled surfaces (AA on light) */
  --secondary: #3D7A6C;
  --accent: #D96A3F;
  --accent-deep: #B9552E;
  --bg: #F6F6F9;
  --surface: #FFFFFF;
  --surface-elevated: #FFFFFF;
  --surface-sunken: #EDEDF2;
  --text: #17171C;
  --text-secondary: #5C5F6E;
  --text-tertiary: #6C6F7E;
  --border: #E2E3EA;
  --border-strong: #C9CBD6;
  --success: #1E8E5A;
  --warning: #B7791F;
  --error: #C63F4A;
  --error-subtle: #FEF2F2; /* tinted error surface (recording, danger rows) */
  --accent-fg: #17171C;    /* text on --accent-filled surfaces (AA on orange) */
  --info: #3565B8;
  --bubble-own: #E9E7FA;
  --bubble-other: #FFFFFF;
  --encryption: #3D7A6C;
  --selection: #C9C4F5;
  --shadow-1: 0 1px 3px rgba(23, 23, 28, 0.08), 0 1px 2px rgba(23, 23, 28, 0.04);
  --shadow-2: 0 4px 6px -1px rgba(23, 23, 28, 0.1), 0 2px 4px -1px rgba(23, 23, 28, 0.06);
  --shadow-3: 0 10px 15px -3px rgba(23, 23, 28, 0.1), 0 4px 6px -2px rgba(23, 23, 28, 0.05);
  --shadow-4: 0 20px 25px -5px rgba(23, 23, 28, 0.1), 0 10px 10px -5px rgba(23, 23, 28, 0.04);
}

[data-theme="dark"] {
  --primary: #8B84F2;
  --primary-hover: #A09AF6;
  --primary-subtle: #232141;
  --primary-fg: #17171D; /* near-black on the luminous dark-mode buttons (AA) */
  --danger-fg: #17171D;  /* near-black on the luminous dark-mode danger buttons */
  --secondary: #5FB8A3;
  --accent: #E8875C;
  --accent-deep: #F09A73;
  --bg: #101014;
  --surface: #17171D;
  --surface-elevated: #1E1E26;
  --surface-sunken: #0B0B0F;
  --text: #F2F2F6;
  --text-secondary: #A7A9BC;
  --text-tertiary: #8B8EA2;
  --border: #2A2B36;
  --border-strong: #3A3C4C;
  --success: #4FC18A;
  --warning: #E0A33E;
  --error: #E4646F;
  --error-subtle: #2A1D20;
  --accent-fg: #17171C;
  --info: #6D9CE8;
  --bubble-own: #2C2A4E;
  --bubble-other: #1E1E26;
  --encryption: #5FB8A3;
  --selection: #3A3669;
  --shadow-1: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-2: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-3: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
  --shadow-4: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);
}

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

:root {
  /* type scale: 12/14/16/18/20/24/30/38 */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-md: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 1.875rem;
  --text-4xl: 2.375rem;

  /* spacing: 4px base */
  --sp-1: 0.25rem;
  --sp-2: 0.5rem;
  --sp-3: 0.75rem;
  --sp-4: 1rem;
  --sp-5: 1.25rem;
  --sp-6: 1.5rem;
  --sp-8: 2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* radii */
  --r-8: 8px;
  --r-12: 12px;
  --r-16: 16px;
  --r-18: 18px;
  --r-20: 20px;
  --r-24: 24px;
  --r-pill: 999px;

  /* motion */
  --motion-fast: 120ms;
  --motion-med: 180ms;
  --motion-slow: 240ms;
  --ease-out: cubic-bezier(0.2, 0, 0, 1);

  --nav-w: 68px;
  --list-w: 360px;
  --bottom-nav-h: 56px;

  --font-sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
}