/* assets/css/tokens.css — design tokens (DESIGN.md "Foundations"). Loaded on every page by index.php,
   after the page's theme CSS. New CSS should use these instead of raw values; dark mode changes the
   tokens, not each rule (see the dark block below). Values follow what the app already uses, so
   switching a rule to a token doesn't change how it looks.

   Colour     --bbm-brand #01AA85 (+ strong/soft), --bbm-akasenge (purple), surfaces, text, border,
              danger / warning / success
   Spacing    --bbm-space-1 … -8  = 4 8 12 16 20 24 32 px   (4/8 scale)
   Radius     --bbm-radius-sm 8 · md 12 · lg 16 · xl 20 · pill
   Type       --bbm-text-xs 12 · sm 13 · base 15 · md 16 · lg 18 · xl 22 · 2xl 28 px; --bbm-font (system)
   Elevation  --bbm-shadow-1 … -3
   Touch      --bbm-tap 44px (minimum tap target) */

:root {
    --bbm-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --bbm-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --bbm-brand: #01AA85;          --bbm-brand-rgb: 1, 170, 133;
    --bbm-brand-strong: #01876b;   --bbm-brand-soft: #e6f6f2;   --bbm-brand-bright: #01AA85;
    --bbm-akasenge: #7b5ea7;       --bbm-akasenge-strong: #4a3578;   --bbm-akasenge-soft: #f0ebf9;
    --bbm-on-brand: #ffffff;

    --bbm-bg: #ffffff;
    --bbm-surface: #ffffff;        /* cards, sheets, dialogs */
    --bbm-surface-2: #f4f7f6;      /* inputs, chips, quiet buttons */
    --bbm-surface-3: #eef2f1;      /* pressed / selected */
    --bbm-text: #1f2b28;
    --bbm-text-muted: #6b7471;
    --bbm-border: #e3e9e7;
    --bbm-border-strong: #d0d9d6;

    --bbm-danger: #dc3545;   --bbm-danger-soft: #fdecea;
    --bbm-warning: #c58a00;  --bbm-warning-soft: #fff3cd;
    --bbm-success: #2e9e5b;  --bbm-success-soft: #e6f6ec;

    --bbm-space-1: 4px;  --bbm-space-2: 8px;  --bbm-space-3: 12px; --bbm-space-4: 16px;
    --bbm-space-5: 20px; --bbm-space-6: 24px; --bbm-space-8: 32px;

    --bbm-radius-sm: 8px; --bbm-radius-md: 12px; --bbm-radius-lg: 16px; --bbm-radius-xl: 20px; --bbm-radius-pill: 999px;

    --bbm-text-xs: 12px; --bbm-text-sm: 13px; --bbm-text-base: 15px; --bbm-text-md: 16px;
    --bbm-text-lg: 18px; --bbm-text-xl: 22px; --bbm-text-2xl: 28px;

    --bbm-shadow-1: 0 1px 3px rgba(0, 0, 0, .08);
    --bbm-shadow-2: 0 4px 16px rgba(0, 0, 0, .10);
    --bbm-shadow-3: 0 8px 32px rgba(0, 0, 0, .18);

    --bbm-tap: 44px;

    /* Icon colours (24 Nov): the soft colour of the small icon before a message's name (Home's chat list, a quoted reply …),
       one per kind — which kind takes which: classes/msg_kinds.php; used only through .bbm-kind-* (assets/css/bbm-kinds.css).
       Each is at least 3 : 1 on a white row AND on a quote's grey panel inside a bubble (#d3e2e0 / #e0e0e0, the darkest light
       surface such an icon sits on); the dark shades are in the dark block below. */
    --bbm-kind-voice: #018c6d;     /* a voice note, a sound file — the app's green, a shade deeper so it reaches 3 : 1 */
    --bbm-kind-photo: #3b7ccb;     /* soft blue */
    --bbm-kind-video: #866bc0;     /* soft violet */
    --bbm-kind-poster: #a27012;    /* warm amber */
    --bbm-kind-gif: #d25034;       /* soft coral */
    --bbm-kind-doc: #627d98;       /* PDF, document, spreadsheet — slate grey-blue */
    /* …and on a DEEP surface whatever the mode (a quote inside MY OWN Akasenge bubble, inside my own green voice bubble: white
       writing on a deeper shade of the bubble) the lighter shades — the same as the dark-mode ones; used by bbm-kinds.css */
    --bbm-kind-deep-voice: #45b89a;  --bbm-kind-deep-photo: #7aa9d8;  --bbm-kind-deep-video: #ac9bd8;
    --bbm-kind-deep-poster: #d9a857; --bbm-kind-deep-gif: #e8917f;    --bbm-kind-deep-doc: #94a9bd;
}

/* Dark mode: same tokens, dark values. html[data-bs-theme=dark] is set in <head> before the first
   paint; body.dark a moment later by theme-setting.js — both carry the dark values. */
:root[data-bs-theme=dark], body.dark {
    color-scheme: dark;
    --bbm-brand-soft: #0f3a30;     --bbm-brand-bright: #3fd1ad;
    --bbm-akasenge-soft: #1e1730;
    --bbm-bg: #020d0b;
    --bbm-surface: #0c1f1b;
    --bbm-surface-2: #0f2420;
    --bbm-surface-3: #123029;
    --bbm-text: #e3e9e7;
    --bbm-text-muted: #9fb3ae;
    --bbm-border: #1f3530;
    --bbm-border-strong: #2a4842;
    --bbm-danger-soft: #3a1416;
    --bbm-warning-soft: #3a2f12;
    --bbm-success-soft: #12311f;
    --bbm-shadow-1: 0 1px 3px rgba(0, 0, 0, .4);
    --bbm-shadow-2: 0 4px 16px rgba(0, 0, 0, .5);
    --bbm-shadow-3: 0 8px 32px rgba(0, 0, 0, .6);
    /* Icon colours (24 Nov): the same kinds on a dark row */
    --bbm-kind-voice: #45b89a;  --bbm-kind-photo: #7aa9d8;  --bbm-kind-video: #ac9bd8;
    --bbm-kind-poster: #d9a857; --bbm-kind-gif: #e8917f;    --bbm-kind-doc: #94a9bd;
}

/* ── F22: the phone's own font (no download). The themes asked Google for Manrope (app) and Outfit
   (TV) on every page, which held up the first paint (one load took 13 s). ── */
body, body.outfit-font, body[class*="-font"],
button, input, select, textarea, .btn, .form-control {
    font-family: var(--bbm-font);
}
code, kbd, pre, samp { font-family: var(--bbm-font-mono); }

/* ── Shared icons (assets/icons/bbm-icons.svg via bbm_icon() / bbmIcon()) ── */
.bbm-i { display: inline-block; width: 1.25em; height: 1.25em; vertical-align: -.25em; flex-shrink: 0;
         fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bbm-i.fill { fill: currentColor; stroke: none; }
