/* Shared design tokens for every page (app, sign-in, invite, landing).
   World: Adora — white-surface discipline, one vivid violet for action, plum
   headlines over charcoal copy, pearl hairlines, generous container radius and
   pastel confetti, with one colour per board (the tone tokens below). See DESIGN.md.
   The installation's brand colour (--brand-accent, set from its branding) drives
   primary actions and selection; its shades are derived where the browser
   supports color-mix, with fixed fallbacks for the default violet. */
:root{
  color-scheme:light;
  --brand:var(--brand-accent,#592eff);
  --brand-strong:#4423c4;
  --brand-ink:#21164c;
  --brand-line:#d4caff;
  --brand-soft:#eeeaff;
  --brand-softer:#f8f6ff;
  --brand-text:var(--brand);
  --on-brand:#fff;
  --ok:#2f7a4d;--ok-soft:#eaf7e4;
  --warn:#9a5a12;--warn-soft:#fdf3e1;
  --danger:#b0285f;--danger-soft:#ffeaf5;
  --info:#1f62a8;--info-soft:#e6f8ff;
  --radius-sm:8px;--radius:12px;--radius-lg:24px;--radius-xl:40px;--radius-pill:200px;
  /* Text: --ink for primary copy and titles, --ink-2 for secondary copy,
     --muted for hints/meta. All meet WCAG AA (>=4.5:1) on #fff, the app
     background and the sunken fills (see scripts/test-contrast.mjs). */
  --ink:#21164c;--ink-2:#353241;--muted:#5f5f69;--placeholder:#5f5f69;
  --line:#e0e0db;--line-strong:#cbcbc4;
  /* Surfaces: --surface for cards, panels and inputs; --surface-2 for quiet
     panels and table heads; --surface-3 for hover/sunken fills; --app-bg behind. */
  --surface:#ffffff;--surface-2:#fafaf9;--surface-3:#eeeeee;--app-bg:#f7f7f5;
  --panel:var(--surface);--overlay:#21164c59;
  /* Pastel confetti (decoration only: squiggles, washes, tag outlines; never fills or body text). */
  --sky:#bcf2ff;--lime:#dfff9d;--candy:#ffaae6;--cyan-pop:#2ed6ff;--lime-pop:#a2ea13;--magenta-pop:#f843c2;
  --focus-ring:0 0 0 1.5px var(--brand);
  /* Elevation: none on cards. Depth comes from white-on-white layering, hairlines and
     radius; hover strengthens the hairline. Only floating panels cast a soft shadow. */
  --shadow-card:0 0 0 0 transparent;
  --shadow-card-hover:0 0 0 1px var(--line-strong);
  --shadow-pop:0 16px 40px #21164c1f;
  /* Type scale (Zad). Operate surfaces: fixed rem steps, readable 15px body. */
  --fs-xs:12px;--fs-sm:13px;--fs-base:15px;--fs-md:16px;--fs-lg:18px;--fs-xl:22px;--fs-2xl:28px;--fs-3xl:34px;
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:24px;--space-6:32px;--space-7:48px;
  /* Board tones: each board gets one, derived from its id (OverviewLogic.tone).
     --bc is set per element (style="--bc:var(--tone-N)"); soft fields and ink are
     mixed from it. Deep enough that white initials read on the swatch. */
  --tone-0:#c4512f;--tone-1:#a0660a;--tone-2:#5b7f28;--tone-3:#1d7c70;
  --tone-4:#2b6fb0;--tone-5:#5a58c4;--tone-6:#8c44a0;--tone-7:#b63c68;
  --bc:var(--brand);
}
/* Derived board-tone colours are declared on every element that sets --bc
   (class "tone"), because custom properties resolve where they are declared. */
:root,.tone{
  --bc-soft:light-dark(color-mix(in srgb,var(--bc) 14%,#fff),color-mix(in srgb,var(--bc) 26%,#1b1826));
  --bc-softer:light-dark(color-mix(in srgb,var(--bc) 6%,#fff),color-mix(in srgb,var(--bc) 12%,#1b1826));
  --bc-line:light-dark(color-mix(in srgb,var(--bc) 26%,#fff),color-mix(in srgb,var(--bc) 42%,#1b1826));
  --bc-ink:light-dark(color-mix(in srgb,var(--bc) 72%,#000),color-mix(in srgb,var(--bc) 38%,#fff));
}
@supports (color:color-mix(in srgb,red 50%,blue)){
  :root{
    --brand-strong:color-mix(in srgb,var(--brand) 76%,#000);
    --brand-ink:color-mix(in srgb,var(--brand) 30%,#1a1233);
    --brand-line:color-mix(in srgb,var(--brand) 24%,#fff);
    --brand-soft:color-mix(in srgb,var(--brand) 11%,#fff);
    --brand-softer:color-mix(in srgb,var(--brand) 5%,#fff);
  }
}
/* Dark theme. «تلقائي» follows the system unless the person picked «فاتح»
   (data-theme="light"); «داكن» forces it (data-theme="dark"). boot.js sets the
   attribute in <head> before first paint. Component colours use
   light-dark(light, dark), which follows the color-scheme set here, so the two
   dark blocks below must stay identical (scripts/test-contrast.mjs checks).
   Engines without light-dark() keep the whole light theme instead of mixing
   light components with dark tokens. Night ink: violet-black, plum-tinted greys. */
@supports (color:light-dark(#000,#fff)){
  @media screen and (prefers-color-scheme:dark){
    :root:not([data-theme="light"]){
      color-scheme:dark;
      --brand-strong:color-mix(in srgb,var(--brand) 52%,#fff);
      --brand-ink:color-mix(in srgb,var(--brand) 34%,#fff);
      --brand-line:color-mix(in srgb,var(--brand) 40%,#1b1826);
      --brand-soft:color-mix(in srgb,var(--brand) 22%,#1b1826);
      --brand-softer:color-mix(in srgb,var(--brand) 10%,#1b1826);
      --brand-text:color-mix(in srgb,var(--brand) 55%,#fff);
      --ok:#74cf98;--ok-soft:#1a3022;
      --warn:#f0b35e;--warn-soft:#3a2a14;
      --danger:#ff8fc4;--danger-soft:#3a1a2c;
      --info:#7fd8ff;--info-soft:#14283a;
      --ink:#f3f1fb;--ink-2:#d7d3e6;--muted:#aaa5bd;--placeholder:#a09bb4;
      --line:#2e2a3c;--line-strong:#443e57;
      --surface:#1b1826;--surface-2:#171521;--surface-3:#262235;--app-bg:#121019;
      --overlay:#0000008c;
      --shadow-card:0 0 0 0 transparent;
      --shadow-card-hover:0 0 0 1px var(--line-strong);
      --shadow-pop:0 14px 36px #00000073;
    }
  }
  :root[data-theme="dark"]{
    color-scheme:dark;
    --brand-strong:color-mix(in srgb,var(--brand) 52%,#fff);
    --brand-ink:color-mix(in srgb,var(--brand) 34%,#fff);
    --brand-line:color-mix(in srgb,var(--brand) 40%,#1b1826);
    --brand-soft:color-mix(in srgb,var(--brand) 22%,#1b1826);
    --brand-softer:color-mix(in srgb,var(--brand) 10%,#1b1826);
    --brand-text:color-mix(in srgb,var(--brand) 55%,#fff);
    --ok:#74cf98;--ok-soft:#1a3022;
    --warn:#f0b35e;--warn-soft:#3a2a14;
    --danger:#ff8fc4;--danger-soft:#3a1a2c;
    --info:#7fd8ff;--info-soft:#14283a;
    --ink:#f3f1fb;--ink-2:#d7d3e6;--muted:#aaa5bd;--placeholder:#a09bb4;
    --line:#2e2a3c;--line-strong:#443e57;
    --surface:#1b1826;--surface-2:#171521;--surface-3:#262235;--app-bg:#121019;
    --overlay:#0000008c;
    --shadow-card:0 0 0 0 transparent;
    --shadow-card-hover:0 0 0 1px var(--line-strong);
    --shadow-pop:0 14px 36px #00000073;
  }
}
