/* Mint Pay design tokens — the single source of colour, type, space, radius and motion
   for the customer app (public/), the staff consoles and the marketing site (landing/).
   Load this file FIRST on every page. Other stylesheets map their legacy variable names
   onto these tokens and must not introduce new raw colour literals
   (scripts/check-design-tokens.js ratchets the remaining count down per file).
   It also holds the app's layout scales (space, type, control heights, radius, z scale,
   layout and category tones; ui-overhaul 2026-11-16). The marketing site receives them
   through the mirror but does not use them.

   Palette: Wise-class clarity — ink-dark green for identity, one confident action green,
   a bright mint accent used sparingly on balances and hero moments, cool neutral surfaces
   in-app, warm paper surfaces on the marketing site. See DESIGN.md and landing/DESIGN.md. */
:root{
  /* ---- brand ---- */
  --mp-ink:#102a23;          /* identity dark green: nav, headline ink on marketing */
  --mp-brand:#176748;        /* brand green (marketing, emphasis) */
  --mp-action:#147d57;       /* primary action: buttons, links, focus */
  --mp-action-hover:#106344;
  --mp-mint:#c4edbb;         /* bright mint accent — balances, hero, success glows; use sparingly */
  --mp-mint-deep:#8ae0b3;    /* mint on dark surfaces (sidebar, dark theme action) */
  --mp-mint-soft:#e7f5ed;    /* mint tint fill (light theme) */

  /* ---- neutrals (app, light) ---- */
  --mp-bg:#f5f7fa;
  --mp-surface:#ffffff;
  --mp-surface-2:#f0f3f6;
  --mp-surface-3:#e8eef2;
  --mp-text:#172b3a;
  --mp-text-2:#526273;
  --mp-text-3:#667380;
  --mp-border:#d8e0e7;
  --mp-border-strong:#8495a5;
  --mp-on-action:#ffffff;
  --mp-on-ink:#f4faf6;
  --mp-white:#ffffff;        /* fixed white (never themed) */
  --mp-black:#000000;

  /* ---- neutrals (marketing, warm) ---- */
  --mp-surface-warm:#f5f2e9;
  --mp-surface-warm-2:#fffef9;
  --mp-text-warm:#17372d;
  --mp-text-warm-2:#52665c;
  --mp-border-warm:#d7ddd0;
  --mp-gold:#c6b58f;

  /* ---- semantic status: ink / fill / border ---- */
  --mp-success:#12633f;      --mp-success-bg:#e7f5ed;  --mp-success-bd:#9bc9ac;
  --mp-warning:#785408;      --mp-warning-bg:#fff5dc;  --mp-warning-bd:#dfc17b;
  --mp-danger:#a52c35;       --mp-danger-bg:#fff0f0;   --mp-danger-bd:#dfb0b5;
  --mp-info:#245c91;         --mp-info-bg:#edf4fb;     --mp-info-bd:#aac5e0;
  --mp-neutral:#526273;      --mp-neutral-bg:#edf1f5;  --mp-neutral-bd:#c9d3dd;
  --mp-indigo:#4f5bd5;       --mp-indigo-bg:#eef0ff;   --mp-indigo-bd:#b9bfff; /* compliance accent */

  /* ---- sidebar (always dark, both themes) ---- */
  --mp-nav-bg:#102a23;
  --mp-nav-border:#29483e;
  --mp-nav-text:#f4faf6;
  --mp-nav-text-2:#c2d3ca;
  --mp-nav-text-3:#afc3b8;
  --mp-nav-line:#476155;
  --mp-nav-line-strong:#69937b;
  --mp-nav-surface:#19392d;
  --mp-nav-surface-2:#224536;
  --mp-nav-accent:#8ae0b3;
  --mp-nav-accent-hover:#b5edd0;

  /* ---- elevation ---- */
  --mp-shadow-sm:0 1px 3px rgba(23,43,58,.05);
  --mp-shadow:0 1px 3px rgba(23,43,58,.05);
  --mp-shadow-lg:0 16px 48px rgba(23,43,58,.16);
  --mp-focus:0 0 0 3px rgba(20,125,87,.28);

  /* ---- type ---- */
  --mp-font-display:"Bricolage Grotesque","Schibsted Grotesk",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mp-font-ui:"Schibsted Grotesk",system-ui,-apple-system,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --mp-font-mono:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --mp-fs-11:11px; --mp-fs-12:12px; --mp-fs-13:13px; --mp-fs-14:14px; --mp-fs-16:16px;
  --mp-fs-20:20px; --mp-fs-28:28px; --mp-fs-40:40px; --mp-fs-56:56px;
  --mp-lh-tight:1.1; --mp-lh:1.45; --mp-lh-loose:1.6;
  --mp-weight-display:800; --mp-weight-heading:700; --mp-weight-medium:600;
  --mp-numerals:"tnum" 1,"lnum" 1; /* tabular balances everywhere money is shown */

  /* ---- space (4-pt) ---- */
  --mp-sp-1:4px; --mp-sp-2:8px; --mp-sp-3:12px; --mp-sp-4:16px; --mp-sp-5:20px;
  --mp-sp-6:24px; --mp-sp-8:32px; --mp-sp-10:40px; --mp-sp-12:48px; --mp-sp-16:64px;

  /* ---- radius ---- */
  --mp-radius-sm:8px; --mp-radius:12px; --mp-radius-lg:16px; --mp-radius-xl:24px; --mp-radius-pill:999px;

  /* ---- motion ---- */
  --mp-dur-fast:120ms; --mp-dur:160ms; --mp-dur-slow:180ms;
  --mp-ease:cubic-bezier(.2,.65,.25,1);

  /* ---- layout ---- */
  --mp-sidebar-w:224px; --mp-content-max:1360px; --mp-gutter:16px; --mp-customer-header-height:64px;
}

/* App layout scales (ui-overhaul 2026-11-16), the same in both themes. Every tone derives
   from the palette above (var() or color-mix()), so it follows the dark theme and adds no
   colour literal. Used by public/ui/system.css and the component sheets. */
:root{
  /* ---- space (4px base) ---- */
  --sp-1:4px; --sp-2:8px; --sp-3:12px; --sp-4:16px; --sp-5:20px;
  --sp-6:24px; --sp-8:32px; --sp-10:40px; --sp-12:48px; --sp-16:64px;

  /* ---- type scale: size / line-height ---- */
  --ui-fs-display:32px; --ui-lh-display:40px;   /* page titles only, Bricolage 600 */
  --ui-fs-h2:22px;      --ui-lh-h2:28px;
  --ui-fs-h3:17px;      --ui-lh-h3:24px;
  --ui-fs-body:15px;    --ui-lh-body:22px;
  --ui-fs-control:14px; --ui-lh-control:20px;   /* buttons, nav items */
  --ui-fs-small:13px;   --ui-lh-small:18px;
  --ui-fs-th:12px;      --ui-lh-th:16px;        /* table header */
  --ui-fs-micro:11px;   --ui-lh-micro:16px;     /* uppercase labels */
  --ui-fs-stat:28px;    --ui-lh-stat:34px;      /* stat tile values */
  --ui-track-micro:.06em;
  --ui-track-display:-.02em;
  --ui-w-regular:400; --ui-w-medium:500; --ui-w-semibold:600;
  --ui-font:var(--mp-font-ui);
  --ui-font-display:var(--mp-font-display);
  --ui-font-mono:var(--mp-font-mono);

  /* ---- control heights ---- */
  --ui-h-btn:36px; --ui-h-btn-sm:32px; --ui-h-btn-xs:28px;
  --ui-h-input:40px; --ui-h-row:48px; --ui-h-nav:36px; --ui-h-chip:22px; --ui-h-tap:44px;

  /* ---- radius ---- */
  --ui-r-ctl:8px; --ui-r-card:12px; --ui-r-pill:999px;

  /* ---- elevation: one hairline shadow, nothing heavier on content ---- */
  --ui-shadow:0 1px 2px color-mix(in srgb, var(--mp-ink) 4%, transparent);
  --ui-shadow-pop:var(--mp-shadow-lg);

  /* ---- motion: hover/focus only ---- */
  --ui-dur:var(--mp-dur-fast); --ui-ease:ease-out;

  /* ---- z scale ---- */
  --ui-z-sticky:10; --ui-z-nav:40; --ui-z-overlay:60; --ui-z-drawer:70; --ui-z-modal:80; --ui-z-toast:100;

  /* ---- layout ---- */
  --ui-content-max:1280px; --ui-gutter:32px; --ui-sidebar-w:248px; --ui-rail-w:64px;

  /* ---- focus ring: 2px action colour at a 2px offset ---- */
  --ui-focus-w:2px; --ui-focus-offset:2px;

  /* ---- chart / category tones: one accent + five muted tones + neutral "other" ---- */
  --ui-cat-1:var(--mp-action);
  --ui-cat-2:color-mix(in srgb, var(--mp-info) 78%, var(--mp-surface));
  --ui-cat-3:color-mix(in srgb, var(--mp-warning) 72%, var(--mp-surface));
  --ui-cat-4:color-mix(in srgb, var(--mp-indigo) 74%, var(--mp-surface));
  --ui-cat-5:color-mix(in srgb, var(--mp-danger) 62%, var(--mp-surface));
  --ui-cat-6:color-mix(in srgb, var(--mp-brand) 45%, var(--mp-surface));
  --ui-cat-other:var(--mp-text-3);
  --ui-area-tint:8%;
  --ui-grid-line:var(--mp-border);
}

/* Dark theme (app). Activated by <html data-theme="dark">; the marketing site stays light. */
:root[data-theme="dark"]{
  --mp-action:#77dbab;
  --mp-action-hover:#99e8c2;
  --mp-on-action:#102a23;
  --mp-mint-soft:#173b2c;
  --mp-bg:#101820;
  --mp-surface:#17212b;
  --mp-surface-2:#1e2c38;
  --mp-surface-3:#263745;
  --mp-text:#f1f5f9;
  --mp-text-2:#b6c3cf;
  --mp-text-3:#788a9b;
  --mp-border:#3b4b5b;
  --mp-border-strong:#788a9b;
  --mp-success:#9be1b8;  --mp-success-bg:#173b2c; --mp-success-bd:#477c60;
  --mp-warning:#f1d58a;  --mp-warning-bg:#3d321b; --mp-warning-bd:#8a7647;
  --mp-danger:#ffb4bc;   --mp-danger-bg:#42262e;  --mp-danger-bd:#925561;
  --mp-info:#b1d7ff;     --mp-info-bg:#20394e;    --mp-info-bd:#537ba0;
  --mp-neutral:#b6c3cf;  --mp-neutral-bg:#263340; --mp-neutral-bd:#536575;
  --mp-indigo:#aab1ff;   --mp-indigo-bg:#262a4a;  --mp-indigo-bd:#5a63b8;
  --mp-shadow-sm:0 1px 3px rgba(0,0,0,.35);
  --mp-shadow:0 1px 3px rgba(0,0,0,.35);
  --mp-shadow-lg:0 16px 48px rgba(0,0,0,.5);
  --mp-focus:0 0 0 3px rgba(119,219,171,.35);
}

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