/* Quanto design tokens. Component CSS uses these only, so tenant branding and dark mode keep working. */
@layer tokens {
  :root {
    color-scheme: light dark;

    /* Neutrals: warm, so product photography stays the most colourful thing on screen */
    --bg: #faf8f5;
    --surface: #ffffff;
    --surface-2: #f3efe9;
    --ink: #1c1917;
    --ink-2: #57514a;
    --ink-3: #736c64;
    --line: #e5dfd6;

    /* Quanto's own accent. Tenants override --brand on storefront surfaces only. */
    --accent: #1f4d43;
    --on-accent: #ffffff;
    --brand: var(--accent);
    --on-brand: var(--on-accent);

    /* Status colours stay fixed across tenants so trust signals stay consistent */
    --ok: #17663f;
    --ok-bg: #e3f3ea;
    --warn: #8a5300;
    --warn-bg: #fbefd9;
    --bad: #a82a1f;
    --bad-bg: #fbe7e4;
    --info: #1f5a8a;
    --info-bg: #e3eff8;

    /* Type */
    --font: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-display: "Noto Serif", Georgia, "Times New Roman", serif;
    --tracking-display: -0.025em;
    --text-xs: 0.8125rem;
    --text-sm: 0.875rem;
    --text-md: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.75rem;
    --text-3xl: 2.25rem;
    --leading: 1.5;
    --leading-tight: 1.2;
    --weight: 400;
    --weight-medium: 500;
    --weight-bold: 650;

    /* Spacing: 4px base */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-5: 1.5rem;
    --s-6: 2rem;
    --s-7: 3rem;
    --s-8: 4rem;
    --gutter: var(--s-4);

    /* Shape and depth, used sparingly */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-full: 999px;
    --shadow-sheet: 0 -8px 32px rgb(28 25 23 / 0.14);
    --shadow-float: 0 4px 16px rgb(28 25 23 / 0.10);

    /* Interaction */
    --tap: 44px;
    --focus: 2px solid var(--accent);
    --ease: cubic-bezier(0.2, 0, 0, 1);
    --fast: 120ms;
    --normal: 200ms;

    /* Layout */
    --nav-height: 60px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --content-max: 72rem;
    --image-ratio: 4 / 5;
  }

  /* A page that asks for light, such as the public home, stays light on a phone set to dark. */
  :root[data-theme="light"] { color-scheme: light; }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
      --bg: #151311;
      --surface: #1e1b18;
      --surface-2: #2a2622;
      --ink: #f3efe9;
      --ink-2: #c2bbb1;
      --ink-3: #9d958a;
      --line: #38332e;
      --accent: #7cc4b1;
      --on-accent: #0f2a24;
      --ok: #6fcf9d;
      --ok-bg: #16352a;
      --warn: #e9b65f;
      --warn-bg: #3a2c12;
      --bad: #f08b80;
      --bad-bg: #40201c;
      --info: #85bbe6;
      --info-bg: #17303f;
      --shadow-sheet: 0 -8px 32px rgb(0 0 0 / 0.5);
      --shadow-float: 0 4px 16px rgb(0 0 0 / 0.4);
    }
  }

  :root[data-theme="dark"] {
    --bg: #151311;
    --surface: #1e1b18;
    --surface-2: #2a2622;
    --ink: #f3efe9;
    --ink-2: #c2bbb1;
    --ink-3: #9d958a;
    --line: #38332e;
    --accent: #7cc4b1;
    --on-accent: #0f2a24;
    --ok: #6fcf9d;
    --ok-bg: #16352a;
    --warn: #e9b65f;
    --warn-bg: #3a2c12;
    --bad: #f08b80;
    --bad-bg: #40201c;
    --info: #85bbe6;
    --info-bg: #17303f;
    --shadow-sheet: 0 -8px 32px rgb(0 0 0 / 0.5);
    --shadow-float: 0 4px 16px rgb(0 0 0 / 0.4);
  }

  /* Super-user portal is visibly a different authority from a retailer's */
  /* The chrome colour stays fixed in both themes. Links and buttons keep the ordinary accent, which has the contrast for each theme. */
  :root {
    --admin-chrome: #3b2f6b;
    --on-admin-chrome: #ffffff;
  }

  @media (prefers-reduced-motion: reduce) {
    :root {
      --fast: 0ms;
      --normal: 0ms;
    }
  }
}
