/* US Address SaaS — product UI tokens (docs + console).
   Warm neutral surfaces, one restrained accent (Signal Blue from the brand system).
   Contrast checked 2026-10-25: text tokens >= 4.5:1 and control borders >= 3:1 on every
   surface in both themes. Fonts are system stacks: nothing is fetched from a third party. */

:root {
  color-scheme: light;

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;

  /* Surfaces */
  --bg: #F8F7F4;
  --surface: #FFFFFF;
  --surface-sunken: #F1EFEA;
  --surface-hover: #EFECE6;
  --border: #E5E1D8;
  --border-control: #857E72;   /* form controls: >= 3:1 */

  /* Ink */
  --text: #1D1C1A;
  --text-secondary: #5C574F;
  --text-tertiary: #6F695F;

  /* Accent */
  --accent: #2F5BFF;
  --accent-hover: #2449E0;
  --accent-text: #2449E0;
  --accent-soft: #EEF1FF;
  --on-accent: #FFFFFF;
  --focus: #2F5BFF;

  /* Status (always paired with text or an icon, never colour alone) */
  --success: #1B7043;
  --success-soft: #E6F3EA;
  --warning: #8A5300;
  --warning-soft: #FCEFD2;
  --danger: #B42318;
  --danger-soft: #FCEBEA;
  --on-danger: #FFFFFF;

  /* "Test mode / simulated" marker */
  --test-ink: #7A4A00;
  --test-soft: #FCEFD2;
  --test-border: #E9C98A;

  /* Data viz (single series; validated with the dataviz six-check script) */
  --series-1: #2F5BFF;
  --series-muted: #C9C2B5;
  --grid: #ECE8E0;

  /* Code */
  --code-bg: #F3F1EC;
  --code-ink: #2B2925;
  --tok-key: #2449E0;
  --tok-str: #1B7043;
  --tok-num: #8A5300;
  --tok-com: #6F695F;

  /* Shape */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(29, 28, 26, 0.05);
  --shadow-md: 0 1px 2px rgba(29, 28, 26, 0.04), 0 8px 24px rgba(29, 28, 26, 0.07);
  --shadow-lg: 0 2px 6px rgba(29, 28, 26, 0.06), 0 24px 60px rgba(29, 28, 26, 0.14);

  /* Type scale */
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 26px;
  --text-3xl: 34px;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #171615;
    --surface: #1F1E1C;
    --surface-sunken: #1B1A18;
    --surface-hover: #282623;
    --border: #34322E;
    --border-control: #807A70;
    --text: #F1EEE8;
    --text-secondary: #B9B3A8;
    --text-tertiary: #9C968B;
    --accent: #7C9CFF;
    --accent-hover: #9AB2FF;
    --accent-text: #9AB2FF;
    --accent-soft: #252B40;
    --on-accent: #111111;
    --focus: #9AB2FF;
    --success: #5DC48B;
    --success-soft: #1D3226;
    --warning: #F2C46B;
    --warning-soft: #3A2F1A;
    --danger: #F28B82;
    --danger-soft: #3B1F1D;
    --on-danger: #111111;
    --test-ink: #F2C46B;
    --test-soft: #3A2F1A;
    --test-border: #6B5527;
    --series-1: #6A8BFF;
    --series-muted: #4A4741;
    --grid: #2C2A27;
    --code-bg: #1B1A18;
    --code-ink: #E9E5DD;
    --tok-key: #9AB2FF;
    --tok-str: #5DC48B;
    --tok-num: #F2C46B;
    --tok-com: #9C968B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.55);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #171615;
  --surface: #1F1E1C;
  --surface-sunken: #1B1A18;
  --surface-hover: #282623;
  --border: #34322E;
  --border-control: #807A70;
  --text: #F1EEE8;
  --text-secondary: #B9B3A8;
  --text-tertiary: #9C968B;
  --accent: #7C9CFF;
  --accent-hover: #9AB2FF;
  --accent-text: #9AB2FF;
  --accent-soft: #252B40;
  --on-accent: #111111;
  --focus: #9AB2FF;
  --success: #5DC48B;
  --success-soft: #1D3226;
  --warning: #F2C46B;
  --warning-soft: #3A2F1A;
  --danger: #F28B82;
  --danger-soft: #3B1F1D;
  --on-danger: #111111;
  --test-ink: #F2C46B;
  --test-soft: #3A2F1A;
  --test-border: #6B5527;
  --series-1: #6A8BFF;
  --series-muted: #4A4741;
  --grid: #2C2A27;
  --code-bg: #1B1A18;
  --code-ink: #E9E5DD;
  --tok-key: #9AB2FF;
  --tok-str: #5DC48B;
  --tok-num: #F2C46B;
  --tok-com: #9C968B;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.55);
}
