/* Self-hosted Source Sans 3 (Latin, Latin-ext, Cyrillic; /fonts/OFL.txt) and Noto Sans Arabic (arabic subset; /fonts/OFL-noto-sans-arabic.txt), both SIL OFL 1.1. No third-party requests. */
@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url(/fonts/source-sans-3-latin-400-normal.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:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url(/fonts/source-sans-3-latin-ext-400-normal.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-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:400;src:url(/fonts/source-sans-3-cyrillic-400-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:600;src:url(/fonts/source-sans-3-latin-600-normal.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:"Source Sans 3";font-style:normal;font-display:swap;font-weight:600;src:url(/fonts/source-sans-3-latin-ext-600-normal.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-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:600;src:url(/fonts/source-sans-3-cyrillic-600-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}
@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:700;src:url(/fonts/source-sans-3-latin-700-normal.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:"Source Sans 3";font-style:normal;font-display:swap;font-weight:700;src:url(/fonts/source-sans-3-latin-ext-700-normal.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-20C4,U+2113,U+2C60-2C7F,U+A720-A7FF}
@font-face{font-family:"Source Sans 3";font-style:normal;font-display:swap;font-weight:700;src:url(/fonts/source-sans-3-cyrillic-700-normal.woff2) format("woff2");unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116}

@font-face{font-family:"Noto Sans Arabic";font-style:normal;font-display:swap;font-weight:400;src:url(/fonts/noto-sans-arabic-arabic-400-normal.woff2) format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:"Noto Sans Arabic";font-style:normal;font-display:swap;font-weight:600;src:url(/fonts/noto-sans-arabic-arabic-600-normal.woff2) format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}
@font-face{font-family:"Noto Sans Arabic";font-style:normal;font-display:swap;font-weight:700;src:url(/fonts/noto-sans-arabic-arabic-700-normal.woff2) format("woff2");unicode-range:U+0600-06FF,U+0750-077F,U+0870-088E,U+0890-0891,U+0897-08E1,U+08E3-08FF,U+200C-200E,U+2010-2011,U+204F,U+2E41,U+FB50-FDFF,U+FE70-FE74,U+FE76-FEFC}

/* Brevklart design tokens. Light default, dark via OS preference or [data-theme="dark"].
   All contrast pairs below are checked for WCAG AA (text >= 4.5:1, UI >= 3:1).

   RTL NOTES (Arabic)
   - Set dir="rtl" lang="ar" on the container that holds translated content (.result[dir=rtl]),
     not only <html>: the UI chrome stays LTR English/Norwegian, the output is RTL.
   - Use CSS logical properties only (margin-inline-start, padding-inline, inset-inline-end,
     border-inline-start, text-align:start). Never left/right. Icons that imply direction
     (arrows, chevrons) get .icon-dir, which is mirrored in RTL.
   - Norwegian quotes, dates, amounts, reference numbers and the draft reply are LTR islands:
     wrap in dir="ltr" lang="nb" (class .ltr). Use <bdi> for inline numbers inside Arabic text.
   - Arabic needs more line-height (--lh-ar) and a slightly larger size (+1px). Never use
     letter-spacing on Arabic. Do not use italic for Arabic. Use Western digits (0-9) in dates
     and amounts so they match the Norwegian original.
   - Ukrainian/Polish/Somali are LTR: only the font stack needs to cover Cyrillic/Latin-ext. */

:root {
  color-scheme: light dark;

  /* Brand */
  --c-primary: #1f5568;          /* fjord */
  --c-primary-hover: #17434f;
  --c-on-primary: #ffffff;       /* 8.6:1 on primary */
  --c-primary-soft: #e3eff2;
  --c-accent: #b4541a;           /* rowan/amber, deadlines only */
  --c-accent-soft: #fdf0e3;
  --c-accent-text: #8a3f10;      /* 6.4:1 on accent-soft */

  /* Surfaces & text */
  --c-bg: #f7f5f0;               /* warm snow */
  --c-surface: #ffffff;
  --c-surface-2: #efece4;
  --c-border: #c9c5ba;           /* 1.6:1 decorative */
  --c-border-strong: #6f7d84;    /* 4.2:1 on bg, for inputs (UI >= 3:1) */
  --c-text: #17262e;             /* 13.5:1 on bg */
  --c-text-muted: #485a63;       /* 6.6:1 on bg */
  --c-link: #1a5a70;

  /* Status */
  --c-success: #1b6a43;  --c-success-soft: #e4f3ea;
  --c-warning: #8a5a00;  --c-warning-soft: #fff4d6;
  --c-danger:  #a02626;  --c-danger-soft:  #fdeaea;
  --c-info:    #1f5568;  --c-info-soft:    #e3eff2;
  --c-redact:  #17262e;  /* masked-text bar */
  --c-redact-hit: #fff1b8; /* auto-detected, awaiting review */
  --c-focus: #0b6bcb;
  --c-focus-halo: #ffffff;       /* inner ring so the focus ring reads on any background */

  /* Type */
  --font-body: "Source Sans 3", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Geeza Pro", Tahoma, Arial, sans-serif;
  --font-head: var(--font-body);
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --fs-xs: 0.875rem;   --fs-sm: 1rem;      --fs-md: 1.125rem;   /* body 18px for stressed readers; scale 14/16/18/22/28/34 */
  --fs-lg: 1.375rem;   --fs-xl: 1.75rem;   --fs-2xl: 2.125rem;  --fs-3xl: 2.75rem;
  --lh-body: 1.6;  --lh-head: 1.25;  --lh-ar: 1.9;

  /* Space (4px base), radius, elevation */
  --sp-1: .25rem; --sp-2: .5rem; --sp-3: .75rem; --sp-4: 1rem; --sp-5: 1.5rem;
  --sp-6: 2rem;   --sp-7: 3rem;  --sp-8: 4.5rem;
  --r-sm: 4px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;
  --shadow-1: 0 1px 2px rgb(23 38 46 / .08), 0 1px 3px rgb(23 38 46 / .06);
  --shadow-2: 0 8px 28px rgb(23 38 46 / .14);
  --tap: 48px;                   /* min touch target */
  --container: 68rem;  --measure: 42rem;
  --ease: 160ms ease-out;

  --r-xl: 20px;
  --shadow-md: 0 6px 20px rgb(23 38 46 / .10);
  --shadow-lg: 0 -4px 24px rgb(23 38 46 / .12);   /* casts upward: sticky bar, bottom sheet */
  --shadow-xl: 0 24px 64px rgb(23 38 46 / .22);

  /* v3 additions (design/system-v3). Ink band surface: dark slab in light theme, raised slab in dark theme. */
  --surface-ink: #17262e;
  --on-ink: #f7f5f0;             /* 13.0:1 on surface-ink */
  --on-ink-muted: #b9c3c7;       /* 8.4:1 on surface-ink */

  /* Design-system names (bundle.css uses only these). Aliases, so the app values above stay the single source of truth. */
  --surface-page: var(--c-bg);  --surface-band: var(--c-surface-2);  --surface-card: var(--c-surface);
  --ink: var(--c-text);  --ink-muted: var(--c-text-muted);
  --border-card: var(--c-border);  --border-control: var(--c-border-strong);
  --brand: var(--c-primary);  --brand-hover: var(--c-primary-hover);  --brand-soft: var(--c-primary-soft);  --on-brand: var(--c-on-primary);
  --deadline-ink: var(--c-accent-text);  --deadline-soft: var(--c-accent-soft);  --deadline-border: var(--c-accent);
  --caution: var(--c-warning);  --caution-soft: var(--c-warning-soft);
  --success: var(--c-success);  --success-soft: var(--c-success-soft);
  --font-sans: var(--font-body);
  --radius-sm: var(--r-sm);  --radius-md: var(--r-md);  --radius-lg: var(--r-lg);  --radius-xl: var(--r-xl);  --radius-pill: var(--r-pill);
  --shadow-sm: var(--shadow-1);
  --target-min: var(--tap);      /* 48px, not the DS 44px */
  --column: 640px;
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px;  --space-4: 16px;  --space-5: 20px;  --space-6: 24px;
  --space-8: 32px;  --space-10: 40px;  --space-12: 48px;  --space-16: 64px;  --space-20: 80px;
  --fs-hero: 3.5rem;  --fs-display: 2.75rem;  --fs-deadline: 2rem;  --fs-eyebrow: .8125rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --dark: 1; }
}
:root[data-theme="dark"] { --dark: 1; }

/* Dark tokens are declared twice (media query + attribute) because CSS cannot share them. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-primary: #8ccddd;  --c-primary-hover: #a9dbe7;
    --c-on-primary: #0d1a20;          /* 10.5:1 on primary */
    --c-primary-soft: #1a3039;
    --c-accent: #f0a468;   --c-accent-soft: #33261a;  --c-accent-text: #f5c08f;
    --c-bg: #0d171c;  --c-surface: #14222a;  --c-surface-2: #1b2d36;
    --c-border: #2d424d;  --c-border-strong: #7f949e;
    --c-text: #e8eff2;  --c-text-muted: #a3b5be;  --c-link: #8ccddd;
    --c-success: #6fcf9a; --c-success-soft: #14301f;
    --c-warning: #f0c35c; --c-warning-soft: #33290f;
    --c-danger:  #ff9a9a; --c-danger-soft:  #3a1a1a;
    --c-info:    #8ccddd; --c-info-soft:    #1a3039;
    --c-redact: #e8eff2;  --c-redact-hit: #5a4a10;
    --c-focus: #7ab8ff;  --c-focus-halo: #0d171c;
    --shadow-1: 0 1px 2px rgb(0 0 0 / .4);  --shadow-2: 0 8px 28px rgb(0 0 0 / .55);
    --surface-ink: #1b2d36;  --on-ink: #e8eff2;  --on-ink-muted: #a3b5be;
    --shadow-md: 0 6px 20px rgb(0 0 0 / .45);  --shadow-lg: 0 -4px 24px rgb(0 0 0 / .5);  --shadow-xl: 0 24px 64px rgb(0 0 0 / .6);
  }
}
:root[data-theme="dark"] {
  --c-primary: #8ccddd;  --c-primary-hover: #a9dbe7;
  --c-on-primary: #0d1a20;
  --c-primary-soft: #1a3039;
  --c-accent: #f0a468;   --c-accent-soft: #33261a;  --c-accent-text: #f5c08f;
  --c-bg: #0d171c;  --c-surface: #14222a;  --c-surface-2: #1b2d36;
  --c-border: #2d424d;  --c-border-strong: #7f949e;
  --c-text: #e8eff2;  --c-text-muted: #a3b5be;  --c-link: #8ccddd;
  --c-success: #6fcf9a; --c-success-soft: #14301f;
  --c-warning: #f0c35c; --c-warning-soft: #33290f;
  --c-danger:  #ff9a9a; --c-danger-soft:  #3a1a1a;
  --c-info:    #8ccddd; --c-info-soft:    #1a3039;
  --c-redact: #e8eff2;  --c-redact-hit: #5a4a10;
  --c-focus: #7ab8ff;  --c-focus-halo: #0d171c;
  --shadow-1: 0 1px 2px rgb(0 0 0 / .4);  --shadow-2: 0 8px 28px rgb(0 0 0 / .55);
  --surface-ink: #1b2d36;  --on-ink: #e8eff2;  --on-ink-muted: #a3b5be;
  --shadow-md: 0 6px 20px rgb(0 0 0 / .45);  --shadow-lg: 0 -4px 24px rgb(0 0 0 / .5);  --shadow-xl: 0 24px 64px rgb(0 0 0 / .6);
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

@media (min-width: 48rem) {
  :root { --fs-xl: 2rem; --fs-2xl: 2.5rem; --fs-3xl: 3.25rem; }
}
@media (prefers-reduced-motion: reduce) {
  :root { --ease: 0ms; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
