/* ============================================================================
   DESIGN TOKENS  -  Material 3 foundation, single source of truth.
   Colour scheme generated with Material Color Utilities (SchemeTonalSpot)
   from seed #4457A6 (indigo). Change the seed and regenerate to re-hue.
   Layer order: M3 sys tokens  ->  semantic aliases  ->  components.css.
   Graph node/edge colours are a separate data-viz palette (kept intact).
   ============================================================================ */

:root{
  /* ==== M3 sys color roles :: DARK (the default scheme) =================== */
  --md-sys-color-primary:#b8c4ff;                --md-sys-color-on-primary:#1f2c61;
  --md-sys-color-primary-container:#374379;      --md-sys-color-on-primary-container:#dde1ff;
  --md-sys-color-secondary:#c2c5dd;              --md-sys-color-on-secondary:#2c2f42;
  --md-sys-color-secondary-container:#424659;    --md-sys-color-on-secondary-container:#dfe1f9;
  --md-sys-color-tertiary:#e4bad9;               --md-sys-color-on-tertiary:#44273f;
  --md-sys-color-tertiary-container:#5c3d56;     --md-sys-color-on-tertiary-container:#ffd7f3;
  --md-sys-color-error:#ffb4ab;                  --md-sys-color-on-error:#690005;
  --md-sys-color-error-container:#93000a;        --md-sys-color-on-error-container:#ffdad6;
  --md-sys-color-background:#121318;             --md-sys-color-on-background:#e3e1e9;
  --md-sys-color-surface:#121318;                --md-sys-color-on-surface:#e3e1e9;
  --md-sys-color-surface-variant:#45464f;        --md-sys-color-on-surface-variant:#c6c5d0;
  --md-sys-color-surface-dim:#121318;            --md-sys-color-surface-bright:#38393f;
  --md-sys-color-surface-container-lowest:#0d0e13;
  --md-sys-color-surface-container-low:#1b1b21;
  --md-sys-color-surface-container:#1f1f25;
  --md-sys-color-surface-container-high:#292a2f;
  --md-sys-color-surface-container-highest:#34343a;
  --md-sys-color-outline:#90909a;                --md-sys-color-outline-variant:#45464f;
  --md-sys-color-inverse-surface:#e3e1e9;        --md-sys-color-inverse-on-surface:#2f3036;
  --md-sys-color-inverse-primary:#4f5b92;        --md-sys-color-scrim:#000000;

  /* ==== Colour :: node fill by container (data-viz, theme-independent) ==== */
  --node-apparatus:#3f4855; --node-evidence:#5b6e8c; --node-consensus:#6b5b8c;
  --node-construct:#4f7d6b; --node-lens:#8a6d3b; --node-thesis:#9c5b6b; --node-default:#7a869a;

  /* ==== Colour :: edge by relation type (data-viz) ======================= */
  --edge-derived-from:#a3abb8; --edge-supports:#22c55e; --edge-contradicts:#ef4444;
  --edge-critiques:#ef4444; --edge-reinterprets:#3b82f6; --edge-rests-on:#94a3b8;
  --edge-extends:#22c55e; --edge-weakens:#e0567a; --edge-strengthens:#3f9e6e;
  --edge-threatens:#f97316; --edge-kin:#c7ccd4; --edge-converges-with:#57a08a;
  --edge-in-tension-with:#e0863a; --edge-qualifies:#9aa0aa; --edge-evaluates:#e879f9;
  --edge-default:#5b6472; --edge-warn:#ef4444;

  /* ==== Semantic aliases (map our names onto M3 roles; follow the theme) == */
  --bg:var(--md-sys-color-surface);
  --pan:var(--md-sys-color-surface-container);
  --pan2:var(--md-sys-color-surface-container-highest);
  --ink:var(--md-sys-color-on-surface);
  --mut:var(--md-sys-color-on-surface-variant);
  --line:color-mix(in srgb, var(--md-sys-color-outline-variant) 55%, transparent);
  --acc:var(--md-sys-color-primary);
  --lbl:var(--md-sys-color-on-surface);
  --nstroke:var(--md-sys-color-surface);
  --sel:var(--md-sys-color-primary);
  --band:color-mix(in srgb, var(--md-sys-color-outline-variant) 32%, transparent);
  --onbg:var(--md-sys-color-primary-container);

  /* ==== M3 state layer opacities ========================================= */
  --md-state-hover:8%; --md-state-focus:10%; --md-state-pressed:10%; --md-state-dragged:16%;

  /* ==== M3 shape / corner scale ========================================== */
  --md-shape-none:0; --md-shape-xs:4px; --md-shape-sm:8px; --md-shape-md:12px;
  --md-shape-lg:16px; --md-shape-xl:28px; --md-shape-full:999px;
  /* legacy radius names remapped onto the M3 shape scale */
  --r-1:var(--md-shape-xs); --r-2:var(--md-shape-sm); --r-3:var(--md-shape-sm);
  --r-4:var(--md-shape-sm); --r-5:var(--md-shape-md); --r-6:var(--md-shape-md);
  --r-7:var(--md-shape-lg); --r-pill:var(--md-shape-full);

  /* ==== M3 elevation (tonal surfaces carry most of it; shadows are light) = */
  /* flat UI: elevation carried by tonal surfaces + outlines, not shadow */
  --md-elevation-1:none;
  --md-elevation-2:none;
  --md-elevation-3:none;
  --md-elevation-4:none;
  --md-elevation-5:none;
  /* legacy shadow names mapped to M3 elevation roles */
  --shadow-1:var(--md-elevation-1);  /* resting card / bar */
  --shadow-2:var(--md-elevation-3);  /* FAB               */
  --shadow-3:var(--md-elevation-2);  /* popover           */
  --shadow-4:var(--md-elevation-2);  /* menu              */

  /* ==== Type :: families ================================================= */
  --font-sans:'Inter',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;
  --font-mono:ui-monospace,Menlo,Consolas,monospace;
  --font-icon:"Material Symbols Rounded";

  /* ==== Type :: scale (M3-aligned, 6 steps) ============================== */
  --fs-2xs:11px;  /* label-small  : superscripts, counters        */
  --fs-xs:12px;   /* label-medium : overlines, table + band heads */
  --fs-sm:13px;   /* compact      : node labels, dense UI          */
  --fs-md:14px;   /* body-medium  : detail body, controls         */
  --fs-lg:16px;   /* title-medium : detail h3, large UI, icons     */
  --fs-xl:22px;   /* title-large  : detail H1                      */

  /* ==== Type :: weight / leading / tracking ============================== */
  --fw-regular:400; --fw-medium:500; --fw-semibold:600; --fw-bold:700;
  --lh-tight:1.1; --lh-snug:1.3; --lh-normal:1.5; --lh-relaxed:1.62;
  --tr-2:.02em; --tr-3:.03em; --tr-4:.04em; --tr-8:.08em; --tr-9:.09em; --tr-10:.1em; --tr-13:.1em;

  /* ==== Motion (M3 easing + duration) ==================================== */
  --dur-1:.12s; --dur-2:.13s; --dur-3:.15s; --dur-4:.2s; --dur-5:.2s; --dur-6:.28s;
  --ease-standard:cubic-bezier(0.2,0,0,1);
}

/* ==== M3 sys color roles :: LIGHT ======================================== */
body.light{
  --md-sys-color-primary:#4f5b92;                --md-sys-color-on-primary:#ffffff;
  --md-sys-color-primary-container:#dde1ff;      --md-sys-color-on-primary-container:#07164b;
  --md-sys-color-secondary:#5a5d72;              --md-sys-color-on-secondary:#ffffff;
  --md-sys-color-secondary-container:#dfe1f9;    --md-sys-color-on-secondary-container:#171b2c;
  --md-sys-color-tertiary:#76546e;               --md-sys-color-on-tertiary:#ffffff;
  --md-sys-color-tertiary-container:#ffd7f3;     --md-sys-color-on-tertiary-container:#2c1229;
  --md-sys-color-error:#ba1a1a;                  --md-sys-color-on-error:#ffffff;
  --md-sys-color-error-container:#ffdad6;        --md-sys-color-on-error-container:#410002;
  --md-sys-color-background:#fbf8ff;             --md-sys-color-on-background:#1b1b21;
  --md-sys-color-surface:#fbf8ff;                --md-sys-color-on-surface:#1b1b21;
  --md-sys-color-surface-variant:#e2e1ec;        --md-sys-color-on-surface-variant:#45464f;
  --md-sys-color-surface-dim:#dbd9e0;            --md-sys-color-surface-bright:#fbf8ff;
  --md-sys-color-surface-container-lowest:#ffffff;
  --md-sys-color-surface-container-low:#f5f2fa;
  --md-sys-color-surface-container:#efedf4;
  --md-sys-color-surface-container-high:#e9e7ef;
  --md-sys-color-surface-container-highest:#e3e1e9;
  --md-sys-color-outline:#767680;                --md-sys-color-outline-variant:#c6c5d0;
  --md-sys-color-inverse-surface:#2f3036;        --md-sys-color-inverse-on-surface:#f2f0f7;
  --md-sys-color-inverse-primary:#b8c4ff;        --md-sys-color-scrim:#000000;

  /* aliases MUST be redeclared here so they resolve against the light roles
     (a var() alias is resolved on the element it is declared on, so it cannot
     live only in :root or it bakes in the dark values). */
  --bg:var(--md-sys-color-surface-container);   /* light: tinted canvas */
  --pan:var(--md-sys-color-surface);             /* light: bright cards */
  --pan2:var(--md-sys-color-surface-container-highest);
  --ink:var(--md-sys-color-on-surface);
  --mut:var(--md-sys-color-on-surface-variant);
  --line:color-mix(in srgb, var(--md-sys-color-outline-variant) 55%, transparent);
  --acc:var(--md-sys-color-primary);
  --lbl:var(--md-sys-color-on-surface);
  --nstroke:var(--md-sys-color-surface);
  --sel:var(--md-sys-color-primary);
  --band:color-mix(in srgb, var(--md-sys-color-outline-variant) 32%, transparent);
  --onbg:var(--md-sys-color-primary-container);
}
