/* BYOKG design tokens: the one source of colour, type, space, radius, elevation and motion for every page a person sees
   (the workspace, the public pages, the source viewer, the sign-in pages). Same-origin only; no remote font. The ratios the
   colours keep are in docs/plan/production-plan.md, section 5, and tests/test_tokens.py measures them from this file. */
:root{
  color-scheme:light dark;
  --font:ui-sans-serif,system-ui,-apple-system,"Segoe UI",Inter,Roboto,"Helvetica Neue",Arial,sans-serif;
  --mono:ui-monospace,SFMono-Regular,Menlo,Consolas,"Liberation Mono",monospace;

  /* Surfaces: primary, grouped, nested. */
  --bg:#f4f6f8;--surface:#fff;--surface-2:#f8fafb;--surface-3:#eef2f5;--glass:rgba(255,255,255,.86);
  /* --border divides and carries no meaning; a control keeps 3:1 with --control-border. */
  --border:#e2e7ec;--border-strong:#cdd5dc;--border-more:#5b6a73;--control-border:#7d8c96;
  /* A soft fill for a button: its label identifies it, on every surface. A field keeps its outline. */
  --fill:rgba(14,26,32,.06);--fill-2:rgba(14,26,32,.1);
  --text:#0e1a20;--text-2:#38474f;--text-3:#5b6a73;
  /* The accent means "you can act here" and nothing else. Status colours mean status, and always come with an icon and a word. */
  --accent:#0f766e;--accent-strong:#0b5e57;--accent-soft:#e3f3f0;--on-accent:#fff;--ring:rgba(15,118,110,.28);
  --ok:#13753b;--ok-soft:#e6f5eb;--warn:#a15c07;--warn-soft:#fdf3dc;--danger:#c03a26;--danger-soft:#fdebe7;--on-danger:#fff;--info:#1d4ed8;--info-soft:#e7eefd;
  /* The graph. The kind hues are for node kinds alone; the six relation hues keep 3:1 on the canvas, stay apart under
     deuteranopia and protanopia, and take none of the kind, status or accent hues. */
  --canvas:#fbfcfd;--grid-dot:#d9e0e5;--edge:#808f99;
  --kind-imported:#4f46e5;--kind-memory:#a21caf;--kind-other:#64748b;
  --r0:#008ae9;--r1:#6f1ed1;--r2:#b0347f;--r3:#949200;--r4:#7d2a05;--r5:#579965;

  /* Type, in rem so the reader's font-size setting scales every page. These eight are the only sizes. */
  --type-caption:.75rem;--type-footnote:.8125rem;--type-body:.875rem;--type-headline:.9375rem;
  --type-title-3:1rem;--type-title-2:1.25rem;--type-title-1:1.625rem;--type-display:clamp(2.25rem,5vw,3.75rem);

  /* Space, on a 4 px grid. */
  --space-1:4px;--space-2:8px;--space-3:12px;--space-4:16px;--space-5:24px;--space-6:32px;--space-7:48px;
  /* Controls: 36 px with a fine pointer, 44 px with a coarse one; nothing is smaller than 24 px. */
  --control-h:2.25rem;--control-h-sm:1.875rem;--control-h-xs:1.5rem;--row-h:1.75rem;
  --topbar:3.5rem;--sidebar:14.75rem;--gutter:var(--space-5);
  --radius-control:9px;--radius-card:12px;--radius-sheet:16px;--radius-pill:999px;
  --shadow-1:0 1px 2px rgba(16,24,40,.06);--shadow-2:0 4px 14px rgba(16,24,40,.08),0 1px 3px rgba(16,24,40,.06);--shadow-3:0 18px 48px rgba(16,24,40,.18),0 4px 12px rgba(16,24,40,.08);
  --motion-fast:.15s;--motion:.2s;--focus-width:2px;--blur:saturate(1.4) blur(12px);
}
@media (pointer:coarse){:root{--type-body:1rem;--control-h:2.75rem;--control-h-sm:2.75rem;--control-h-xs:2.75rem;--row-h:2.75rem}}
@media (prefers-color-scheme:dark){:root{
  --bg:#090e11;--surface:#0f161a;--surface-2:#131b20;--surface-3:#1a242a;--glass:rgba(15,22,26,.86);
  --border:#1e2a31;--border-strong:#2c3a43;--border-more:#7f929c;--control-border:#6b7e8a;
  --fill:rgba(228,236,239,.1);--fill-2:rgba(228,236,239,.16);
  --text:#e4ecef;--text-2:#b5c3c9;--text-3:#7f929c;
  --accent:#2dd4bf;--accent-strong:#5eead4;--accent-soft:rgba(45,212,191,.12);--on-accent:#04201d;--ring:rgba(45,212,191,.3);
  --ok:#4ade80;--ok-soft:rgba(74,222,128,.12);--warn:#fbbf24;--warn-soft:rgba(251,191,36,.12);--danger:#f87171;--danger-soft:rgba(248,113,113,.12);--on-danger:#1f0705;--info:#60a5fa;--info-soft:rgba(96,165,250,.13);
  --canvas:#0b1114;--grid-dot:#1a252b;--edge:#5d6f7a;
  --kind-imported:#818cf8;--kind-memory:#e879f9;--kind-other:#94a3b8;
  --r0:#06a3fb;--r1:#7b4dff;--r2:#ffa6c6;--r3:#ffea2a;--r4:#72604a;--r5:#93bc55;
  --shadow-1:0 1px 2px rgba(0,0,0,.4);--shadow-2:0 6px 18px rgba(0,0,0,.35);--shadow-3:0 24px 60px rgba(0,0,0,.55);
}}
@media (prefers-contrast:more){:root{--text-2:var(--text);--text-3:var(--text);--border:var(--border-more);--border-strong:var(--border-more);--control-border:var(--border-more);--focus-width:3px}}
@media (prefers-reduced-transparency:reduce){:root{--glass:var(--surface);--blur:none}}

/* What every page shares. */
html{font-size:100%;font-family:var(--font);line-height:1.5;color:var(--text);background:var(--bg);-webkit-text-size-adjust:100%;text-size-adjust:100%;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}
*,*::before,*::after{box-sizing:border-box}
[hidden]{display:none!important}
body{margin:0;min-height:100vh;min-height:100dvh;background:var(--bg);color:var(--text);font-size:var(--type-body)}
code,kbd,pre,.mono{font-family:var(--mono)}
:focus-visible{outline:var(--focus-width) solid var(--accent);outline-offset:2px}
::selection{background:var(--accent-soft)}
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.brand-mark{flex:none;width:2rem;height:2rem}
.brand-bg{fill:var(--accent)}
.brand-edge{fill:none;stroke:var(--on-accent);stroke-width:2.1;stroke-linejoin:round}
.brand-node{fill:var(--on-accent)}
.skip{position:absolute;top:-80px;left:var(--space-4);z-index:100;padding:10px 14px;border-radius:var(--radius-control);background:var(--surface);color:var(--text);box-shadow:var(--shadow-2)}
.skip:focus{top:var(--space-3)}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}*,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important}}
@media (forced-colors:active){:focus-visible{outline-color:Highlight}}
