/* The default theme's tokens: every value its components draw with, and the
   only place each one is written. A component reads them with no fallback —
   a missing token should look missing, not quietly draw this theme's value
   under another name. `app.css` reads them too and declares no colour of its
   own. See RECORD/2026-10-29.a-design-system.completed.md.

   Close to current macOS: a slowly drifting wallpaper behind translucent,
   blurred materials. **Two tones**, by what a thing sits on:

   - `dark`, the default on `:root`: light text on the dark wallpaper
     and on the toolbar's dark glass.
   - `light`: dark text on the light materials — a card, a dialog, the toast.

   Any element is an island of the other tone with `data-tone="light"` (or
   `"dark"`): the colours are re-declared on it, and everything inside draws
   with them. `Card` and `Modal` are light islands of their own. Shape, type
   and motion are the same in both.

   **Lengths are rem** (1rem is 16px on a desktop), so on a phone, where the
   root's font size follows the window's width (at the end of this file),
   everything scales with it. Only what must not stays in px: hairlines and
   borders under 2px, `999px` for "round", and a field's text, at least
   16px (`max(16px, 1rem)`), which iOS would zoom into otherwise. */

:root {
  /* ---- the page ----------------------------------------------------------- */

  /* The wallpaper: near black, and four glows that drift over it. */
  --ig-bg: #121212;
  --ig-wall-1: rgb(10 132 255 / .5);
  --ig-wall-2: rgb(191 90 242 / .42);
  --ig-wall-3: rgb(64 200 224 / .38);
  --ig-wall-4: rgb(255 159 10 / .26);

  /* Materials: translucent fills that blur what is behind them. A card, the
     toolbar, and what floats over everything (a dialog, the toast, a
     picker): white, a card letting the wallpaper's glows through. */
  --ig-material: rgb(255 255 255 / .75);
  --ig-material-bar: rgb(10 10 10 / .62);
  --ig-material-hud: rgb(255 255 255 / .88);
  --ig-blur: blur(.75rem);
  /* What a dialog lays over the page behind it. */
  --ig-overlay: rgb(10 14 30 / .35);
  --ig-overlay-blur: blur(.1875rem);

  /* ---- colour, by role ---------------------------------------------------- */

  /* The accent fills controls; `--ig-link` is the same blue as text, per
     tone. */
  --ig-accent: #0071e3;
  --ig-on-accent: #fff;
  /* The primary button: the secondary's glass, in a vivid blue that holds
     white text at 4.5:1. */
  --ig-button-1: #006cff;
  --ig-button-1-hover: #1a78ff;
  --ig-button-1-active: #005ad6;
  --ig-button-1-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 0 0 1px rgb(255 255 255 / .14), 0 1px .125rem rgb(0 0 0 / .16);
  /* Buttons that lose something, and the quiet dark one (sign out). */
  --ig-danger: #d92d23;
  --ig-dark: #3a3f4a;
  /* The system colours, for dots, lights and switches. */
  --ig-green: #30d158;
  --ig-red: #ff453a;
  --ig-orange: #ff9f0a;
  /* A solid "ok" pill: dark green on light green, the same in both tones. */
  --ig-ok-solid: color-mix(in srgb, #30d158 75%, #fff);
  --ig-on-ok-solid: #0f3d1c;

  /* Hues for icons and tinted tiles: a fact's tile, an option's icon. A
     tile is a gradient from its hue lightened toward `--ig-light`. */
  --ig-light: #fff;
  --ig-hue-gray: #8e8e93;
  --ig-hue-blue: #0a84ff;
  --ig-hue-purple: #a35ce6;
  --ig-hue-green: #28b24b;
  --ig-hue-orange: #ff9500;
  --ig-hue-teal: #20a8c4;
  --ig-hue-pink: #ff2d55;

  /* An avatar without a photo. */
  --ig-avatar: linear-gradient(160deg, #a2a2ab, #6e6e76);

  /* Roles, as their icons are drawn. */
  --ig-role-owner: #e08a00;
  --ig-role-admin: #8e4fd6;

  /* A switch: green with the knob right when on, red with it left when off. */
  --ig-switch-on: linear-gradient(180deg, #4cd97b, #28b850);
  --ig-switch-off: linear-gradient(180deg, #ff6b62, #e8352b);
  --ig-switch-knob: linear-gradient(180deg, #fff, #f1f1f3);
  --ig-switch-well: inset 0 1px .125rem rgb(0 0 0 / .18);
  --ig-switch-knob-shadow: 0 1px .1875rem rgb(0 0 0 / .3);

  /* The line under the toolbar's chosen tab. */
  --ig-tab-line: #64b5ff;
  /* The ring a focused control draws. */
  --ig-ring: 0 0 0 .21875rem rgb(64 156 255 / .7);

  /* A button is tinted glass: light catches its rim, top and bottom, and its
     colour glows softly beneath. */
  --ig-gloss: linear-gradient(180deg, rgb(255 255 255 / .16), rgb(255 255 255 / 0) 55%, rgb(255 255 255 / .06));
  --ig-gloss-2: linear-gradient(180deg, rgb(255 255 255 / .12), rgb(255 255 255 / 0) 55%);
  --ig-rim: inset 0 1px 0 rgb(255 255 255 / .42), inset 0 -1px 0 rgb(255 255 255 / .1), inset 0 0 0 1px rgb(255 255 255 / .16);
  --ig-glass-blur: blur(.875rem) saturate(190%);

  /* Shadows. */
  --ig-shadow-xs: 0 1px .125rem rgb(0 0 0 / .05);
  --ig-shadow-sm: 0 1px .125rem rgb(0 0 0 / .12);
  --ig-shadow-inset: 0 .5px 1px rgb(0 0 0 / .12) inset;
  --ig-shadow: 0 1px .125rem rgb(0 0 0 / .16), 0 .875rem 2.25rem rgb(10 14 30 / .3);
  --ig-shadow-pop: 0 .125rem .375rem rgb(0 0 0 / .2), 0 1.375rem 3.5rem rgb(10 14 30 / .45);
  --ig-shadow-lift: 0 .1875rem .625rem rgb(0 0 0 / .08);

  /* Code: a light Monokai, its hues deep enough to read on paper. */
  --ig-code-bg: #fbfaf4;
  --ig-code-surface: #fff;
  --ig-code-line: rgb(0 0 0 / .13);
  --ig-code-fg: #272822;
  --ig-code-comment: #9a967e;
  --ig-code-pink: #d0105c;
  --ig-code-green: #4d7c0f;
  --ig-code-yellow: #a35b00;
  --ig-code-purple: #7547c9;
  --ig-code-teal: #0f7a8e;

  /* A command to copy: a terminal line on #222a2e, in Monokai's hues at
     their most saturated. Green and yellow full; pink, purple and grey as
     saturated as they could be on #444 and still read at 4:1, and at 6:1
     on this. */
  --ig-term-bg: #222a2e;
  --ig-term-line: rgb(0 0 0 / .2);
  --ig-term-fg: #f8f8f2;
  --ig-term-comment: #aca893;
  --ig-term-pink: #ff7d9a;
  --ig-term-green: #a9ea00;
  --ig-term-yellow: #f5e200;
  --ig-term-purple: #b793ff;
  --ig-term-button: rgb(255 255 255 / .12);
  --ig-term-button-hover: rgb(255 255 255 / .2);

  /* ---- type --------------------------------------------------------------- */

  --ig-font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, "Helvetica Neue", sans-serif;
  --ig-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ig-text-2xs: .625rem;
  --ig-text-xs: .6875rem;
  --ig-text-sm: .75rem;
  --ig-text-md: .8125rem;
  --ig-text-base: .875rem;
  --ig-text-lg: .9375rem;
  --ig-text-xl: 1.0625rem;
  --ig-text-2xl: 1.375rem;
  --ig-text-3xl: 1.5rem;
  --ig-text-4xl: 1.75rem;
  --ig-weight-regular: 400;
  --ig-weight-medium: 500;
  --ig-weight-semibold: 600;
  --ig-weight-bold: 650;
  --ig-weight-heavy: 700;
  --ig-leading: 1.5;
  --ig-leading-tight: 1.2;

  /* ---- space -------------------------------------------------------------- */

  --ig-space-1: .25rem;
  --ig-space-2: .375rem;
  --ig-space-3: .5rem;
  --ig-space-4: .625rem;
  --ig-space-5: .75rem;
  --ig-space-6: .875rem;
  --ig-space-7: 1rem;
  --ig-space-8: 1.25rem;
  --ig-space-9: 1.5rem;
  --ig-space-10: 2rem;

  /* ---- shape -------------------------------------------------------------- */

  --ig-radius-xs: .25rem;
  --ig-radius-sm: .375rem;
  --ig-radius-control: .5rem;
  --ig-radius-md: .625rem;
  --ig-radius-lg: .75rem;
  --ig-radius-xl: .875rem;
  --ig-radius-full: 999px;
  --ig-hairline: .5px;

  /* A control's height, so a button, a field and a select on one row line up
     without anybody measuring. A phone's are taller, for a finger. */
  --ig-control-xs: 1.75rem;
  --ig-control-sm: 1.875rem;
  --ig-control-md: 2.375rem;
  /* Between blocks on a page: one card and the next. */
  --ig-block-gap: 1rem;

  /* ---- motion ------------------------------------------------------------- */

  /* Something that arrives, with a little overshoot: a dialog, the toast. */
  --ig-ease-spring: cubic-bezier(.2, .9, .3, 1.2);
  /* A knob that slides. */
  --ig-ease-knob: cubic-bezier(.3, .7, .4, 1.2);
  /* Something that leaves: quick, no overshoot. */
  --ig-ease-in: cubic-bezier(.4, 0, 1, 1);
  --ig-duration-fast: 120ms;
  --ig-duration: 150ms;
  --ig-duration-slow: 200ms;
  --ig-duration-arrive: 280ms;

  /* ---- layers ------------------------------------------------------------- */

  --ig-z-bar: 5;
  --ig-z-toast: 10;
}

/* The dark tone: on the wallpaper and the toolbar. */
:root, [data-tone="dark"] {
  --ig-fg: #fff;
  --ig-fg-muted: #e0e3ea;
  --ig-link: #b8daff;
  /* The tones as text, readable on this ground. */
  --ig-ok: #8ff0a9;
  --ig-bad: #ffc9c4;
  --ig-warn: #ffd08a;

  /* Hover and chosen: a veil of the ink over whatever is there. */
  --ig-fill: rgb(255 255 255 / .25);
  --ig-fill-2: rgb(255 255 255 / .07);
  --ig-field: rgb(26 28 35 / .5);
  /* A field being typed in is solid: its colour, with no glass. */
  --ig-field-focus: rgb(26 28 35);
  --ig-field-line: rgb(255 255 255 / .24);
  --ig-line: rgb(255 255 255 / .2);
  --ig-separator: rgb(255 255 255 / .15);
  --ig-material-edge: rgb(255 255 255 / .2);

  /* A secondary button: clear glass, lighter on hover. */
  --ig-button-2: rgb(255 255 255 / .13);
  --ig-button-2-hover: rgb(255 255 255 / .2);
  --ig-button-2-active: rgb(255 255 255 / .08);
  --ig-button-2-shadow: inset 0 1px 0 rgb(255 255 255 / .3), inset 0 0 0 1px rgb(255 255 255 / .14), 0 1px .125rem rgb(0 0 0 / .16);
  /* A row that is a tile of its own (a subdomain, a key): clear glass,
     lighter on hover, sinking while pressed. */
  --ig-row: rgb(255 255 255 / .13);
  --ig-row-hover: rgb(255 255 255 / .2);
  --ig-row-active: rgb(255 255 255 / .08);
  /* How much of its colour a primary button's glass holds. */
  --ig-tint: 58%;

  color-scheme: dark;
}

/* The light tone: on a card, a dialog, the toast. */
[data-tone="light"] {
  --ig-fg: #1d2125;
  --ig-fg-muted: #333a3e;
  /* The tones as text, each at least 4.5:1 on a card over the wallpaper's
     darkest. */
  --ig-link: #074791;
  --ig-ok: #145425;
  --ig-bad: #8c1c15;
  --ig-warn: #693f00;

  /* On a card, hover lifts toward white; what is chosen sinks. */
  --ig-fill: rgb(0 0 0 / .06);
  --ig-fill-2: rgb(255 255 255 / .35);
  --ig-field: rgb(255 255 255 / .92);
  --ig-field-focus: #fff;
  --ig-field-line: rgb(0 0 0 / .16);
  --ig-line: rgb(0 0 0 / .1);
  --ig-separator: rgb(0 0 0 / .09);
  --ig-material-edge: rgb(255 255 255 / .8);

  --ig-button-2: rgb(255 255 255 / .55);
  --ig-button-2-hover: rgb(255 255 255 / .8);
  --ig-button-2-active: rgb(255 255 255 / .35);
  --ig-button-2-shadow: inset 0 1px 0 rgb(255 255 255 / .95), inset 0 0 0 1px rgb(0 0 0 / .09), 0 1px .125rem rgb(0 0 0 / .07);
  /* A tile row stands out from the card short of a field's white, which
     it takes on hover. */
  --ig-row: rgb(255 255 255 / .8);
  --ig-row-hover: rgb(255 255 255 / .92);
  --ig-row-active: rgb(255 255 255 / .6);
  /* On light material the glass holds more colour, for white text. */
  --ig-tint: 84%;

  color-scheme: light;
}

/* Wider than a phone: controls a step shorter, for a pointer. */
@media (min-width: 640px) {
  :root {
    --ig-control-md: 2rem;
    --ig-block-gap: 1.125rem;
  }
}

/* On a phone the root's font size follows the window's width: 16px on one
   390px wide, 13px on a 320px one, 17.6px on a 430px one. Every length
   here, and every one the components and the page write, is in rem, so
   the whole dashboard scales with it, as a picture would: the same layout,
   the same lines breaking in the same places, on a small phone as on a
   large one. Past 439px, where phones end, it holds at 18px, so a small
   tablet does not get a giant page. On a wider screen it is the browser's
   own, 16px, and 1rem is the pixel sizes the comments give. */
@media (width < 640px) {
  html { font-size: min(100vw / 24.375, 18px); }
}

/* Once, here, instead of a media query in every component: every transition
   and animation the components write takes its time from these. */
@media (prefers-reduced-motion: reduce) {
  :root {
    --ig-duration-fast: 0ms;
    --ig-duration: 0ms;
    --ig-duration-slow: 0ms;
    --ig-duration-arrive: 0ms;
  }
}

/* One rule beyond the tokens. A component's slot for free content (a card's
   body, a dialog's) trims the outer margins of what is put in it: its scoped
   style cannot reach slotted elements, and a paragraph's margin would
   otherwise add to the padding around it. A component's own box
   (`data-c79-box`, jq79's) lays out as if it were not there, so what is in
   it counts. */
[data-flow] > :first-child,
[data-flow] > [data-c79-box]:first-child > :first-child { margin-top: 0; }
[data-flow] > :last-child,
[data-flow] > [data-c79-box]:last-child > :last-child { margin-bottom: 0; }
