/* Norsava design tokens: one design system for the command centre, admin, inbox and (inside Shadow DOM) the widget.
   Dark is the default. Light and "system" come from data-theme on <html>: "dark", "light" or "system".
   Contrast (WCAG 2.2 AA) was checked for every text pair below. Rules:
   - Red only for primary actions. On red only white labels of at least 19px, weight 800 (large text, 3.9:1),
     or an icon (non-text, 3:1). Red is never used for text, charts or status.
   - Form controls use --line-strong for their border (3:1 against the panel). --line is for dividers only.
   - Flat: no gradients, no glows. Shadows only to lift a layer (menus, dialogs). */

@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/assets/fonts/manrope-400-latin.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/assets/fonts/manrope-400-latin-ext.woff2) format('woff2'); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  /* Brand, fixed in both themes */
  --red: #FF1330;
  --red-hover: #D80F28;

  /* Dark theme (default) */
  --page: #0B1220;
  --panel: #16213A;
  --panel-2: #1B2744;      /* a raised row or hovered card inside a panel */
  --field: #121B2E;
  --line: #243352;         /* dividers */
  --line-strong: #5E6E94;  /* borders of inputs, checkboxes, outline buttons: 3.1:1 on --panel */
  --text: #F4F6FB;
  --muted: #9AA6C0;        /* 6.5:1 on --panel */
  --success: #37C978;      /* 7.4:1 on --panel */
  --error: #FF6B6B;        /* 5.8:1 on --panel */
  --warning: #F2C14E;      /* 9.5:1 on --panel */
  --info: #7FB2FF;         /* 7.4:1 on --panel */
  --focus: #F4F6FB;
  --on-red: #FFFFFF;
  --shadow-layer: 0 12px 32px rgba(0, 0, 0, .45);
  --scrim: rgba(5, 8, 15, .6);

  /* Charts: series in this order. No red. Checked against --panel for 3:1 non-text contrast. */
  --c1: #F4F6FB;           /* main series, 15:1 */
  --c2: #7FB2FF;           /* second series (English next to Finnish), 7:1 */
  --c3: #37C978;
  --c4: #F2C14E;
  --c5: #C79BFF;
  --c6: #9AA6C0;
  --grid: #243352;

  /* Type (Manrope). Headings and buttons 800, labels 700, body 500. */
  --font: Manrope, system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-md: 14px; --fs-base: 15px; --fs-lg: 18px; --fs-xl: 22px; --fs-2xl: 28px; --fs-kpi: 32px;
  --lh: 1.5; --lh-tight: 1.2;

  /* Space, radius, size */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;
  --h-control: 40px; --h-control-lg: 48px;

  /* Motion: short and purposeful. None under reduced motion. */
  --ease: cubic-bezier(.2, .9, .25, 1);
  --t-fast: 120ms; --t-med: 200ms; --t-slow: 320ms;

  color-scheme: dark;
}

/* Light theme. Same hues, darker success, error and info so text passes 4.5:1 on white. */
:root[data-theme="light"] {
  --page: #F4F6FB;
  --panel: #FFFFFF;
  --panel-2: #F0F3F9;
  --field: #F7F9FC;
  --line: #DDE3EE;
  --line-strong: #7C88A3;  /* 3.6:1 on white */
  --text: #0B1220;         /* 18:1 */
  --muted: #56627C;        /* 6.1:1 on white */
  --success: #13733F;      /* 5.9:1 on white */
  --error: #C62D2D;        /* 5.5:1 */
  --warning: #8A6100;      /* 5.6:1 */
  --info: #1D5FD1;         /* 5.8:1 */
  --focus: #0B1220;
  --shadow-layer: 0 12px 32px rgba(11, 18, 32, .16);
  --scrim: rgba(11, 18, 32, .4);
  --c1: #0B1220; --c2: #1D5FD1; --c3: #13733F; --c4: #A87400; --c5: #7A3FD6; --c6: #56627C; --grid: #DDE3EE;
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --page: #F4F6FB; --panel: #FFFFFF; --panel-2: #F0F3F9; --field: #F7F9FC; --line: #DDE3EE; --line-strong: #7C88A3;
    --text: #0B1220; --muted: #56627C; --success: #13733F; --error: #C62D2D; --warning: #8A6100; --info: #1D5FD1; --focus: #0B1220;
    --shadow-layer: 0 12px 32px rgba(11, 18, 32, .16); --scrim: rgba(11, 18, 32, .4);
    --c1: #0B1220; --c2: #1D5FD1; --c3: #13733F; --c4: #A87400; --c5: #7A3FD6; --c6: #56627C; --grid: #DDE3EE;
    color-scheme: light;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root { --t-fast: 0ms; --t-med: 0ms; --t-slow: 0ms; }
  *, *::before, *::after { animation-duration: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0ms !important; scroll-behavior: auto !important; }
}
