html,
body {
  overscroll-behavior: none;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  height: 100%;
  height: 100vh;
  height: 100dvh;
  margin: 0;

  @media all and (display-mode: standalone) {
    height: 100lvh;
  }
}

patchwork-view {
  display: block;
  height: 100%;
  width: 100%;
  contain: layout;
}

/* Strict on purpose: we don't trust every tool author to animate accessibly.
   TODO(chee): I think it would be a good idea to add an opt-out here, an
   attribute a tool puts on its root to say it does its own reduced-motion work
   (fades instead of movement, spinners that still spin), so this rule skips
   that element and everything inside it. */
@media (prefers-reduced-motion: reduce) {
  *,
  *:before,
  *:after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
    animation-iteration-count: 1 !important;
  }
}
/* The fallback theme: every --studio-* token, following the computer's light or
   dark mode, under every theme. It sits in `@layer patchwork`, so a theme's
   unlayered [theme="…"] rules win whenever they arrive. This is a blocking
   stylesheet in the generated <head>, so the tokens are there from the first
   frame, before any theme's stylesheet has loaded. */
@layer patchwork {
  :root,
  :host,
  [theme] {
    color-scheme: light dark;
    color: var(--studio-line);
    accent-color: var(--studio-primary);
    font-family: var(--studio-family);
    font-size: var(--studio-font-size);
    font-weight: var(--studio-font-weight);
    line-height: var(--studio-line-height);
    --default-tab-size: 2;

    /* a plain fill<->line mix drifts to neutral gray in the middle of the
	   ramp, so every derived offset is pulled a little toward this tint.
	   keeps the whole ramp tied to the palette instead of only the light
	   end inheriting a cast from a tinted fill. defaults to the secondary;
	   set the amount to 0% for a purely neutral ramp. */
    --studio-offset-tint: var(--studio-secondary);
    --studio-offset-tint-amount: 10%;
    --studio-fill: light-dark(white, black);
    /* the offset labels (10..50) stay linear, but the actual mix amount curves:
	   finer steps near the fill where the eye is most sensitive, so subtle
	   tints (active line, gutter) stay distinct. 10 starts at the fill itself. */
    --studio-fill-offset-10: color-mix(
      in oklch,
      color-mix(in oklch, var(--studio-fill), var(--studio-line) 0%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-fill-offset-20: color-mix(
      in oklch,
      color-mix(in oklch, var(--studio-fill), var(--studio-line) 7%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-fill-offset-30: color-mix(
      in oklch,
      color-mix(in oklch, var(--studio-fill), var(--studio-line) 18%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-fill-offset-40: color-mix(
      in oklch,
      color-mix(in oklch, var(--studio-fill), var(--studio-line) 32%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-fill-offset-50: color-mix(
      in oklch,
      color-mix(in oklch, var(--studio-fill), var(--studio-line) 50%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-line: light-dark(black, white);
    --studio-line-offset-10: color-mix(
      in oklch,
      color-mix(in oklch, var(--studio-line), var(--studio-fill) 8%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-line-offset-20: color-mix(
      in oklch,
      color-mix(in oklch, var(--studio-line), var(--studio-fill) 18%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-line-offset-30: color-mix(
      in oklch,
      color-mix(in oklch, var(--studio-line), var(--studio-fill) 33%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-line-offset-40: color-mix(
      in oklch,
      color-mix(in oklch, var(--studio-line), var(--studio-fill) 52%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-line-offset-50: color-mix(
      in oklch,
      color-mix(in oklch, var(--studio-line), var(--studio-fill) 76%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );

    /* chrome: the surface for app chrome (sideboard, context sidebar, toolbar).
	   a faint secondary-tinted fill: light themes get a light tinted surface,
	   dark themes a dark tinted one, because both fill and secondary come from
	   the palette. the offset ramp mirrors --studio-fill-offset, curving the
	   same way, so chrome surfaces get borders/hovers that track the palette. */
    --studio-chrome-fill: var(--studio-fill-offset-10);
    /* the offset ramp mixes chrome toward --studio-chrome-line (the chrome's own
	   ink), not --studio-line, so borders/hovers stay sensible whether the chrome
	   is lighter or darker than the content. defaults to --studio-line. */
    --studio-chrome-fill-offset-10: color-mix(
      in oklch,
      color-mix(
        in oklch,
        var(--studio-chrome-fill),
        var(--studio-chrome-line) 0%
      ),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-chrome-fill-offset-20: color-mix(
      in oklch,
      color-mix(
        in oklch,
        var(--studio-chrome-fill),
        var(--studio-chrome-line) 7%
      ),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-chrome-fill-offset-30: color-mix(
      in oklch,
      color-mix(
        in oklch,
        var(--studio-chrome-fill),
        var(--studio-chrome-line) 18%
      ),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-chrome-fill-offset-40: color-mix(
      in oklch,
      color-mix(
        in oklch,
        var(--studio-chrome-fill),
        var(--studio-chrome-line) 32%
      ),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-chrome-fill-offset-50: color-mix(
      in oklch,
      color-mix(
        in oklch,
        var(--studio-chrome-fill),
        var(--studio-chrome-line) 50%
      ),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );

    /* back-compat aliases for the pre-rename --studio-chrome[-offset-*] names. */
    --studio-chrome: var(--studio-chrome-fill);
    --studio-chrome-offset-10: var(--studio-chrome-fill-offset-10);
    --studio-chrome-offset-20: var(--studio-chrome-fill-offset-20);
    --studio-chrome-offset-30: var(--studio-chrome-fill-offset-30);
    --studio-chrome-offset-40: var(--studio-chrome-fill-offset-40);
    --studio-chrome-offset-50: var(--studio-chrome-fill-offset-50);

    /* the ink/line color for content on chrome surfaces. mirrors --studio-line
	   but its offset ramp mixes toward --studio-chrome-fill (the chrome surface)
	   instead of --studio-fill, so borders/dividers on chrome track the chrome
	   palette the same way --studio-line-offset tracks the fill. */
    --studio-chrome-line: var(--studio-line);
    --studio-chrome-line-offset-10: color-mix(
      in oklch,
      color-mix(
        in oklch,
        var(--studio-chrome-line),
        var(--studio-chrome-fill) 8%
      ),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-chrome-line-offset-20: color-mix(
      in oklch,
      color-mix(
        in oklch,
        var(--studio-chrome-line),
        var(--studio-chrome-fill) 18%
      ),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-chrome-line-offset-30: color-mix(
      in oklch,
      color-mix(
        in oklch,
        var(--studio-chrome-line),
        var(--studio-chrome-fill) 33%
      ),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-chrome-line-offset-40: color-mix(
      in oklch,
      color-mix(
        in oklch,
        var(--studio-chrome-line),
        var(--studio-chrome-fill) 52%
      ),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --studio-chrome-line-offset-50: color-mix(
      in oklch,
      color-mix(
        in oklch,
        var(--studio-chrome-line),
        var(--studio-chrome-fill) 76%
      ),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );

    /* the font family for app chrome; tracks the ui family by default. */
    --studio-chrome-family: var(--studio-family-ui);

    --sideboard-primary: var(--studio-primary);
    --sideboard-fill: var(--studio-chrome-fill);

    --studio-primary: #35f7ca;
    --studio-added: #35f7ca;
    --studio-deleted: #ff6a90;
    --studio-modified: #f8c43b;
    --studio-secondary: #33ccf8;
    --studio-link: #36e;
    --studio-danger: #ff6a90;
    --studio-warning: #f8c43b;
    /* success/info default to existing palette colours so every theme gets
	   sensible ones without defining them: success rides --studio-added (the
	   "good change" colour), info rides the secondary. */
    --studio-success: var(--studio-added);
    --studio-info: var(--studio-secondary);

    /* GitHub-style callouts (`> [!NOTE]` and friends). each rides the accent
	   that already means the same thing, so a theme's palette carries over:
	   note is information (the link blue), tip is success, warning is
	   warning, caution is danger. important has no accent of its own; it's
	   the link hue turned toward violet, GitHub's purple. */
    --studio-callout-note: var(--studio-link);
    --studio-callout-tip: var(--studio-success);
    --studio-callout-important: oklch(from var(--studio-link) l c calc(h + 35));
    --studio-callout-warning: var(--studio-warning);
    --studio-callout-caution: var(--studio-danger);

    /* presence: the account picker's named colours. a contact stores the
	   colour's value; wherever it's drawn (carets, nametags, avatars) a
	   palette value is swapped for its token here, so a theme can restyle
	   people's colours — say, lighter on a dark theme — without touching
	   anyone's account. the defaults are the palette's own values. */
    --studio-presence-sky-blue: hsl(200 70% 50%);
    --studio-presence-coral: hsl(10 75% 58%);
    --studio-presence-emerald: hsl(145 70% 45%);
    --studio-presence-violet: hsl(270 70% 55%);
    --studio-presence-amber: hsl(38 85% 50%);
    --studio-presence-rose: hsl(350 70% 55%);
    --studio-presence-teal: hsl(178 70% 45%);
    --studio-presence-indigo: hsl(235 70% 58%);
    --studio-presence-lime: hsl(85 70% 45%);
    --studio-presence-fuchsia: hsl(310 70% 55%);
    --studio-presence-orange: hsl(25 80% 52%);
    --studio-presence-cyan: hsl(188 75% 48%);

    /* Accent surfaces. Each accent (primary/secondary/danger/warning/success/info) ships as a
	   Bulma-style contrast pair — the same fill/line shape as --studio-chrome:

	   --studio-{accent}-fill  the accent used AS A SURFACE (button/pill background).
	   --studio-{accent}-line  the INVERT: ink placed ON that fill. Legibility must hold
	                           for ANY accent (themes ship everything from near-white to
	                           near-black accents), so it can't be tied to --studio-line
	                           (that tracks the page, not the accent). Instead it's
	                           luminance-adaptive: read the accent's own oklch lightness and
	                           snap the ink to black for light accents / white for dark ones.
	                           clamp(0,(0.62 - l)*1000,1) is a hard step at L≈0.62 — the
	                           perceptual black/white flip point — with chroma & hue zeroed
	                           for a neutral ink. A theme can still override -line to taste.
	   --studio-{accent}-fill-offset-10..50  a hover/border ramp, fill mixed toward the
	                           invert. offset-10 == the fill itself (matches the chrome
	                           numbering); the first visible step is -20. No offset-tint:
	                           an accent→dark-ink mix stays in-hue and never drifts gray,
	                           so the neutralising tint the other ramps use isn't needed.

	   Distinct from the -text tokens below: -line is for ink ON the accent; -text is the
	   accent used AS ink on the ambient background. */
    --studio-primary-fill: var(--studio-primary);
    --studio-primary-line: oklch(
      from var(--studio-primary) clamp(0, (0.62 - l) * 1000, 1) 0 0
    );
    --studio-primary-fill-offset-10: color-mix(
      in oklch,
      var(--studio-primary-fill),
      var(--studio-primary-line) 0%
    );
    --studio-primary-fill-offset-20: color-mix(
      in oklch,
      var(--studio-primary-fill),
      var(--studio-primary-line) 7%
    );
    --studio-primary-fill-offset-30: color-mix(
      in oklch,
      var(--studio-primary-fill),
      var(--studio-primary-line) 18%
    );
    --studio-primary-fill-offset-40: color-mix(
      in oklch,
      var(--studio-primary-fill),
      var(--studio-primary-line) 32%
    );
    --studio-primary-fill-offset-50: color-mix(
      in oklch,
      var(--studio-primary-fill),
      var(--studio-primary-line) 50%
    );

    --studio-secondary-fill: var(--studio-secondary);
    --studio-secondary-line: oklch(
      from var(--studio-secondary) clamp(0, (0.62 - l) * 1000, 1) 0 0
    );
    --studio-secondary-fill-offset-10: color-mix(
      in oklch,
      var(--studio-secondary-fill),
      var(--studio-secondary-line) 0%
    );
    --studio-secondary-fill-offset-20: color-mix(
      in oklch,
      var(--studio-secondary-fill),
      var(--studio-secondary-line) 7%
    );
    --studio-secondary-fill-offset-30: color-mix(
      in oklch,
      var(--studio-secondary-fill),
      var(--studio-secondary-line) 18%
    );
    --studio-secondary-fill-offset-40: color-mix(
      in oklch,
      var(--studio-secondary-fill),
      var(--studio-secondary-line) 32%
    );
    --studio-secondary-fill-offset-50: color-mix(
      in oklch,
      var(--studio-secondary-fill),
      var(--studio-secondary-line) 50%
    );

    --studio-danger-fill: var(--studio-danger);
    --studio-danger-line: oklch(
      from var(--studio-danger) clamp(0, (0.62 - l) * 1000, 1) 0 0
    );
    --studio-danger-fill-offset-10: color-mix(
      in oklch,
      var(--studio-danger-fill),
      var(--studio-danger-line) 0%
    );
    --studio-danger-fill-offset-20: color-mix(
      in oklch,
      var(--studio-danger-fill),
      var(--studio-danger-line) 7%
    );
    --studio-danger-fill-offset-30: color-mix(
      in oklch,
      var(--studio-danger-fill),
      var(--studio-danger-line) 18%
    );
    --studio-danger-fill-offset-40: color-mix(
      in oklch,
      var(--studio-danger-fill),
      var(--studio-danger-line) 32%
    );
    --studio-danger-fill-offset-50: color-mix(
      in oklch,
      var(--studio-danger-fill),
      var(--studio-danger-line) 50%
    );

    --studio-warning-fill: var(--studio-warning);
    --studio-warning-line: oklch(
      from var(--studio-warning) clamp(0, (0.62 - l) * 1000, 1) 0 0
    );
    --studio-warning-fill-offset-10: color-mix(
      in oklch,
      var(--studio-warning-fill),
      var(--studio-warning-line) 0%
    );
    --studio-warning-fill-offset-20: color-mix(
      in oklch,
      var(--studio-warning-fill),
      var(--studio-warning-line) 7%
    );
    --studio-warning-fill-offset-30: color-mix(
      in oklch,
      var(--studio-warning-fill),
      var(--studio-warning-line) 18%
    );
    --studio-warning-fill-offset-40: color-mix(
      in oklch,
      var(--studio-warning-fill),
      var(--studio-warning-line) 32%
    );
    --studio-warning-fill-offset-50: color-mix(
      in oklch,
      var(--studio-warning-fill),
      var(--studio-warning-line) 50%
    );

    --studio-success-fill: var(--studio-success);
    --studio-success-line: oklch(
      from var(--studio-success) clamp(0, (0.62 - l) * 1000, 1) 0 0
    );
    --studio-success-fill-offset-10: color-mix(
      in oklch,
      var(--studio-success-fill),
      var(--studio-success-line) 0%
    );
    --studio-success-fill-offset-20: color-mix(
      in oklch,
      var(--studio-success-fill),
      var(--studio-success-line) 7%
    );
    --studio-success-fill-offset-30: color-mix(
      in oklch,
      var(--studio-success-fill),
      var(--studio-success-line) 18%
    );
    --studio-success-fill-offset-40: color-mix(
      in oklch,
      var(--studio-success-fill),
      var(--studio-success-line) 32%
    );
    --studio-success-fill-offset-50: color-mix(
      in oklch,
      var(--studio-success-fill),
      var(--studio-success-line) 50%
    );

    --studio-info-fill: var(--studio-info);
    --studio-info-line: oklch(
      from var(--studio-info) clamp(0, (0.62 - l) * 1000, 1) 0 0
    );
    --studio-info-fill-offset-10: color-mix(
      in oklch,
      var(--studio-info-fill),
      var(--studio-info-line) 0%
    );
    --studio-info-fill-offset-20: color-mix(
      in oklch,
      var(--studio-info-fill),
      var(--studio-info-line) 7%
    );
    --studio-info-fill-offset-30: color-mix(
      in oklch,
      var(--studio-info-fill),
      var(--studio-info-line) 18%
    );
    --studio-info-fill-offset-40: color-mix(
      in oklch,
      var(--studio-info-fill),
      var(--studio-info-line) 32%
    );
    --studio-info-fill-offset-50: color-mix(
      in oklch,
      var(--studio-info-fill),
      var(--studio-info-line) 50%
    );

    /* The link accent is built on the --studio-link color. Everything else derives
	   from --studio-link-fill — the invert ink, hover/border ramp, and all three
	   -text variants — so retinting links is a single override of --studio-link. */
    --studio-link-fill: var(--studio-link);
    --studio-link-line: oklch(
      from var(--studio-link-fill) clamp(0, (0.62 - l) * 1000, 1) 0 0
    );
    --studio-link-fill-offset-10: color-mix(
      in oklch,
      var(--studio-link-fill),
      var(--studio-link-line) 0%
    );
    --studio-link-fill-offset-20: color-mix(
      in oklch,
      var(--studio-link-fill),
      var(--studio-link-line) 7%
    );
    --studio-link-fill-offset-30: color-mix(
      in oklch,
      var(--studio-link-fill),
      var(--studio-link-line) 18%
    );
    --studio-link-fill-offset-40: color-mix(
      in oklch,
      var(--studio-link-fill),
      var(--studio-link-line) 32%
    );
    --studio-link-fill-offset-50: color-mix(
      in oklch,
      var(--studio-link-fill),
      var(--studio-link-line) 50%
    );

    /* Accent AS ink on the ambient background. Legibility depends on which surface
	   the text sits on, so there's one per surface family — each mixes the accent
	   toward that surface's own line, which rides the theme automatically (darkened
	   on light fills, lightened on dark ones). The --editor-* and --text-editor-* ones
	   are defined alongside those surfaces below. */
    --studio-primary-text: color-mix(
      in oklch,
      var(--studio-primary),
      var(--studio-line) 35%
    );
    --studio-secondary-text: color-mix(
      in oklch,
      var(--studio-secondary),
      var(--studio-line) 35%
    );
    --studio-danger-text: color-mix(
      in oklch,
      var(--studio-danger),
      var(--studio-line) 35%
    );
    --studio-warning-text: color-mix(
      in oklch,
      var(--studio-warning),
      var(--studio-line) 35%
    );
    --studio-success-text: color-mix(
      in oklch,
      var(--studio-success),
      var(--studio-line) 35%
    );
    --studio-info-text: color-mix(
      in oklch,
      var(--studio-info),
      var(--studio-line) 35%
    );
    --studio-link-text: color-mix(
      in oklch,
      var(--studio-link-fill),
      var(--studio-line) 35%
    );

    --studio-family-sans: "Jost*", "Jost", system-ui, -apple-system, sans-serif;
    --studio-family-code:
      "Fantasque Sans Mono", "IBM Plex Mono", "Fira Code", "Iosevka",
      ui-monospace, monospace;
    /* the default family for studio content, and a separate ui family for
	   controls/chrome; both track the sans family by default. */
    --studio-family: var(--studio-family-sans);
    --studio-family-ui: var(--studio-family-sans);
    --studio-family-serif:
      "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, ui-serif, serif;
    --studio-font-size: 16px;

    /* Opt-in typography. all of these are left unset so nothing changes until a
	   theme sets them:
	   --studio-letter-spacing          tracking for content (applied on :root)
	   --studio-chrome-letter-spacing   tracking for small chrome labels; tools
	                                    read var(--studio-chrome-letter-spacing, <theirs>)
	   --studio-font-features           font-feature-settings, e.g. "ss01", "zero"
	   --studio-font-variation          font-variation-settings, e.g. "wght" 420
	   --studio-heading-family          a display face for headings
	   --studio-heading-weight          heading weight
	   --studio-font-scale              a modular ratio for headings, e.g. 1.25.
	                                    when set, --studio-heading-size-1..6 become
	                                    ratio^4, ^3, ^2, ^1, 1em and 1/ratio. they
	                                    reference the unset ratio, so they stay
	                                    invalid (and tools' var(--studio-heading-size-N,
	                                    <theirs>) fallbacks win) until it's set. */
    --studio-heading-size-1: calc(1em * pow(var(--studio-font-scale), 4));
    --studio-heading-size-2: calc(1em * pow(var(--studio-font-scale), 3));
    --studio-heading-size-3: calc(1em * pow(var(--studio-font-scale), 2));
    --studio-heading-size-4: calc(1em * var(--studio-font-scale));
    --studio-heading-size-5: calc(1em * pow(var(--studio-font-scale), 0));
    --studio-heading-size-6: calc(1em / var(--studio-font-scale));
    --studio-font-weight: 400;
    --studio-selection-fill: light-dark(#ffee8888, #26465388);
    --studio-selection-line: var(--studio-line);
    --studio-line-height: 1.5;

    /* Border radius. --studio-radius-scale multiplies the whole scale: 0 gives a
	   square theme, 1.5 a soft one. round stays round at any positive scale. */
    --studio-radius-scale: 1;
    --studio-radius-xs: calc(2px * var(--studio-radius-scale));
    --studio-radius-sm: calc(4px * var(--studio-radius-scale));
    --studio-radius: calc(6px * var(--studio-radius-scale));
    --studio-radius-md: calc(8px * var(--studio-radius-scale));
    --studio-radius-lg: calc(12px * var(--studio-radius-scale));
    --studio-radius-xl: calc(16px * var(--studio-radius-scale));
    --studio-radius-round: calc(9999px * var(--studio-radius-scale));

    /* Spacing scale. --studio-density multiplies the whole scale: ~0.75 is
	   compact, ~1.25 roomy. */
    --studio-density: 1;
    --studio-space-3xs: calc(0.125rem * var(--studio-density)); /* 2px */
    --studio-space-2xs: calc(0.25rem * var(--studio-density)); /* 4px */
    --studio-space-xs: calc(0.375rem * var(--studio-density)); /* 6px */
    --studio-space-sm: calc(0.5rem * var(--studio-density)); /* 8px */
    --studio-space: calc(0.75rem * var(--studio-density)); /* 12px */
    --studio-space-md: calc(1rem * var(--studio-density)); /* 16px */
    --studio-space-lg: calc(1.5rem * var(--studio-density)); /* 24px */
    --studio-space-xl: calc(2rem * var(--studio-density)); /* 32px */
    --studio-space-2xl: calc(3rem * var(--studio-density)); /* 48px */

    /* Borders. width and style for ordinary ui borders (dividers, inputs,
	   cards); a theme can go chunky (2px) or sketchy (dashed). */
    --studio-border-width: 1px;
    --studio-border-style: solid;

    /* Shadows. the shadow colour is the line pulled toward the offset tint by
	   the same amount as the rest of the ramp, so shadows read as part of the
	   palette instead of a flat neutral black. */
    --studio-shadow-color: color-mix(
      in oklch,
      var(--studio-line),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    /* --studio-shadow-strength multiplies every shadow's opacity: 0 is a flat
	   theme, 2-3 a heavy one. each layer keeps its own base alpha (5/6/10%). */
    --studio-shadow-strength: 1;
    --studio-shadow-a5: clamp(
      0%,
      calc(100% - 5% * var(--studio-shadow-strength)),
      100%
    );
    --studio-shadow-a6: clamp(
      0%,
      calc(100% - 6% * var(--studio-shadow-strength)),
      100%
    );
    --studio-shadow-a10: clamp(
      0%,
      calc(100% - 10% * var(--studio-shadow-strength)),
      100%
    );
    --studio-shadow-sm: 0 1px 2px
      color-mix(
        in oklch,
        var(--studio-shadow-color),
        transparent var(--studio-shadow-a5)
      );
    --studio-shadow:
      0 1px 3px
        color-mix(
          in oklch,
          var(--studio-shadow-color),
          transparent var(--studio-shadow-a10)
        ),
      0 1px 2px
        color-mix(
          in oklch,
          var(--studio-shadow-color),
          transparent var(--studio-shadow-a6)
        );
    --studio-shadow-md:
      0 4px 6px -1px
        color-mix(
          in oklch,
          var(--studio-shadow-color),
          transparent var(--studio-shadow-a10)
        ),
      0 2px 4px -2px
        color-mix(
          in oklch,
          var(--studio-shadow-color),
          transparent var(--studio-shadow-a10)
        );
    --studio-shadow-lg:
      0 10px 15px -3px
        color-mix(
          in oklch,
          var(--studio-shadow-color),
          transparent var(--studio-shadow-a10)
        ),
      0 4px 6px -4px
        color-mix(
          in oklch,
          var(--studio-shadow-color),
          transparent var(--studio-shadow-a10)
        );

    /* Motion. --studio-motion-scale multiplies every duration: 0 turns motion
	   off, 2 is slow and dreamy. --studio-motion-preference is the user's OS
	   setting (0 under prefers-reduced-motion, see below) and multiplies on top,
	   so a theme can't override it. durations never go below 1ms so
	   transitionend/animationend still fire for code waiting on them. */
    --studio-motion-scale: 1;
    --studio-motion-preference: 1;
    --studio-duration-fast: max(
      1ms,
      calc(100ms * var(--studio-motion-scale) * var(--studio-motion-preference))
    );
    --studio-duration: max(
      1ms,
      calc(150ms * var(--studio-motion-scale) * var(--studio-motion-preference))
    );
    --studio-duration-slow: max(
      1ms,
      calc(250ms * var(--studio-motion-scale) * var(--studio-motion-preference))
    );
    --studio-ease: ease;
    /* Strong ease-out for things entering: fast start, long gentle settle. */
    --studio-ease-out: cubic-bezier(0.23, 1, 0.32, 1);
    /* ease-in for things leaving; spring overshoots a little for playful entrances. */
    --studio-ease-in: cubic-bezier(0.55, 0, 1, 0.45);
    --studio-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --studio-transition-fast: var(--studio-duration-fast) var(--studio-ease);
    --studio-transition: var(--studio-duration) var(--studio-ease);
    --studio-transition-slow: var(--studio-duration-slow) var(--studio-ease);

    /* Focus. --studio-focus-ring is the outline shorthand for keyboard focus;
	   tools read it as var(--studio-focus-ring, <their own ring>), so it is
	   deliberately left undefined here (opt-in): set it in a theme to make every
	   focus ring match, e.g. `3px dashed hotpink`. same for the offset. */
    /* --studio-focus-ring: <unset>; */
    /* --studio-focus-ring-offset: <unset>; */

    /* Interaction states. */
    --studio-disabled-opacity: 0.5;
    /* hover/pressed surfaces are opt-in like the focus ring: tools fall back to
	   their own offset step. set these to pick one step for everything, e.g.
	   `var(--studio-fill-offset-30)` for a stronger hover. */
    /* --studio-hover-fill / --studio-active-fill: <unset>;  (content surfaces) */
    /* --studio-chrome-hover-fill / --studio-chrome-active-fill: <unset>;  (chrome) */

    /* Cursors. a theme can ship its own, e.g.
	   --studio-cursor-pointer: url(hand.svg) 4 0, pointer; */
    --studio-cursor-default: default;
    --studio-cursor-pointer: pointer;
    --studio-cursor-text: text;
    --studio-cursor-grab: grab;
    --studio-cursor-grabbing: grabbing;
    --studio-cursor-move: move;
    --studio-cursor-crosshair: crosshair;
    --studio-cursor-not-allowed: not-allowed;
    --studio-cursor-resize-col: col-resize;
    --studio-cursor-resize-row: row-resize;

    /* Layers. a shared z-index scale so tools' overlays stack predictably.
	   opt-in for now: tools read var(--studio-layer-*, <their own z>), so
	   nothing moves until a theme or a future pass defines the scale. the
	   intended values are:
	     --studio-layer-raised: 1;     sticky headers, floating bits inside a view
	     --studio-layer-dropdown: 1000;
	     --studio-layer-overlay: 2000; scrims, drawers
	     --studio-layer-modal: 3000;
	     --studio-layer-popover: 4000; menus/popovers that can sit over a modal
	     --studio-layer-toast: 5000;
	     --studio-layer-tooltip: 6000; */

    /* Backdrops behind modals/menus. opt-in: tools read
	   var(--studio-backdrop, <theirs>) and var(--studio-backdrop-blur, <theirs>). */
    /* --studio-backdrop: <unset>;  e.g. color-mix(in oklch, var(--studio-line), transparent 70%) */
    /* --studio-backdrop-blur: <unset>;  e.g. blur(8px) */

    /* Scrollbars. opt-in: unset means the browser default.
	   --studio-scrollbar-color takes the scrollbar-color pair (thumb track),
	   e.g. `var(--studio-fill-offset-40) transparent`;
	   --studio-scrollbar-width takes auto | thin | none. */

    /* Categorical swatches: 8 distinct colours that belong to the theme, for
	   cursors, collaborators, tags and charts. walked round the hue wheel from
	   the primary, with lightness/chroma pinned to a band that reads on both
	   light and dark fills. override any of them individually. */
    --studio-swatch-lightness: 0.7;
    --studio-swatch-chroma: 0.15;
    --studio-swatch-1: oklch(
      from var(--studio-primary) var(--studio-swatch-lightness)
        var(--studio-swatch-chroma) h
    );
    --studio-swatch-2: oklch(
      from var(--studio-primary) var(--studio-swatch-lightness)
        var(--studio-swatch-chroma) calc(h + 45)
    );
    --studio-swatch-3: oklch(
      from var(--studio-primary) var(--studio-swatch-lightness)
        var(--studio-swatch-chroma) calc(h + 90)
    );
    --studio-swatch-4: oklch(
      from var(--studio-primary) var(--studio-swatch-lightness)
        var(--studio-swatch-chroma) calc(h + 135)
    );
    --studio-swatch-5: oklch(
      from var(--studio-primary) var(--studio-swatch-lightness)
        var(--studio-swatch-chroma) calc(h + 180)
    );
    --studio-swatch-6: oklch(
      from var(--studio-primary) var(--studio-swatch-lightness)
        var(--studio-swatch-chroma) calc(h + 225)
    );
    --studio-swatch-7: oklch(
      from var(--studio-primary) var(--studio-swatch-lightness)
        var(--studio-swatch-chroma) calc(h + 270)
    );
    --studio-swatch-8: oklch(
      from var(--studio-primary) var(--studio-swatch-lightness)
        var(--studio-swatch-chroma) calc(h + 315)
    );

    --editor-line: var(--studio-line);
    --editor-fill: var(--studio-fill);
    --editor-fill-offset-10: color-mix(
      in oklch,
      color-mix(in oklch, var(--editor-fill), var(--editor-line) 0%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --editor-fill-offset-20: color-mix(
      in oklch,
      color-mix(in oklch, var(--editor-fill), var(--editor-line) 7%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --editor-fill-offset-30: color-mix(
      in oklch,
      color-mix(in oklch, var(--editor-fill), var(--editor-line) 18%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --editor-fill-offset-40: color-mix(
      in oklch,
      color-mix(in oklch, var(--editor-fill), var(--editor-line) 32%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --editor-fill-offset-50: color-mix(
      in oklch,
      color-mix(in oklch, var(--editor-fill), var(--editor-line) 50%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --editor-line-offset-10: color-mix(
      in oklch,
      color-mix(in oklch, var(--editor-line), var(--editor-fill) 8%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --editor-line-offset-20: color-mix(
      in oklch,
      color-mix(in oklch, var(--editor-line), var(--editor-fill) 18%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --editor-line-offset-30: color-mix(
      in oklch,
      color-mix(in oklch, var(--editor-line), var(--editor-fill) 33%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --editor-line-offset-40: color-mix(
      in oklch,
      color-mix(in oklch, var(--editor-line), var(--editor-fill) 52%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --editor-line-offset-50: color-mix(
      in oklch,
      color-mix(in oklch, var(--editor-line), var(--editor-fill) 76%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );

    /* accents as ink on the editor surface — mixed toward --editor-line */
    --editor-primary-text: color-mix(
      in oklch,
      var(--studio-primary),
      var(--editor-line) 35%
    );
    --editor-secondary-text: color-mix(
      in oklch,
      var(--studio-secondary),
      var(--editor-line) 35%
    );
    --editor-danger-text: color-mix(
      in oklch,
      var(--studio-danger),
      var(--editor-line) 35%
    );
    --editor-warning-text: color-mix(
      in oklch,
      var(--studio-warning),
      var(--editor-line) 35%
    );
    --editor-success-text: color-mix(
      in oklch,
      var(--studio-success),
      var(--editor-line) 35%
    );
    --editor-info-text: color-mix(
      in oklch,
      var(--studio-info),
      var(--editor-line) 35%
    );
    --editor-link-text: color-mix(
      in oklch,
      var(--studio-link-fill),
      var(--editor-line) 35%
    );

    --editor-family-code: var(--studio-family-code);
    --editor-family-sans: var(--studio-family-sans);
    --editor-family: var(--editor-family-sans);
    --editor-font-size: var(--studio-font-size);
    --editor-font-weight: var(--studio-font-weight);
    --editor-selection-fill: var(--studio-selection-fill);
    --editor-selection-line: var(--studio-selection-line);
    --editor-line-height: var(--studio-line-height);
    --editor-cursor-fill: var(--editor-line);
    --text-editor-fill: var(--editor-fill);
    --text-editor-fill-offset-10: color-mix(
      in oklch,
      color-mix(in oklch, var(--text-editor-fill), var(--text-editor-line) 0%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --text-editor-fill-offset-20: color-mix(
      in oklch,
      color-mix(in oklch, var(--text-editor-fill), var(--text-editor-line) 7%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --text-editor-fill-offset-30: color-mix(
      in oklch,
      color-mix(in oklch, var(--text-editor-fill), var(--text-editor-line) 18%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --text-editor-fill-offset-40: color-mix(
      in oklch,
      color-mix(in oklch, var(--text-editor-fill), var(--text-editor-line) 32%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --text-editor-fill-offset-50: color-mix(
      in oklch,
      color-mix(in oklch, var(--text-editor-fill), var(--text-editor-line) 50%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --text-editor-line: var(--editor-line);
    --text-editor-line-offset-10: color-mix(
      in oklch,
      color-mix(in oklch, var(--text-editor-line), var(--text-editor-fill) 8%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --text-editor-line-offset-20: color-mix(
      in oklch,
      color-mix(in oklch, var(--text-editor-line), var(--text-editor-fill) 18%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --text-editor-line-offset-30: color-mix(
      in oklch,
      color-mix(in oklch, var(--text-editor-line), var(--text-editor-fill) 33%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --text-editor-line-offset-40: color-mix(
      in oklch,
      color-mix(in oklch, var(--text-editor-line), var(--text-editor-fill) 52%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    --text-editor-line-offset-50: color-mix(
      in oklch,
      color-mix(in oklch, var(--text-editor-line), var(--text-editor-fill) 76%),
      var(--studio-offset-tint) var(--studio-offset-tint-amount)
    );
    /* accents as ink on the text-editor surface — mixed toward --text-editor-line */
    --text-editor-primary-text: color-mix(
      in oklch,
      var(--studio-primary),
      var(--text-editor-line) 35%
    );
    --text-editor-secondary-text: color-mix(
      in oklch,
      var(--studio-secondary),
      var(--text-editor-line) 35%
    );
    --text-editor-danger-text: color-mix(
      in oklch,
      var(--studio-danger),
      var(--text-editor-line) 35%
    );
    --text-editor-warning-text: color-mix(
      in oklch,
      var(--studio-warning),
      var(--text-editor-line) 35%
    );
    --text-editor-success-text: color-mix(
      in oklch,
      var(--studio-success),
      var(--text-editor-line) 35%
    );
    --text-editor-info-text: color-mix(
      in oklch,
      var(--studio-info),
      var(--text-editor-line) 35%
    );
    --text-editor-link-text: color-mix(
      in oklch,
      var(--studio-link-fill),
      var(--text-editor-line) 35%
    );
    /* callouts on the text-editor surface: ink for the title and icon (mixed
	   toward the line, like the -text accents above), and a faint tint of the
	   accent for the box behind them. */
    --text-editor-callout-note-text: color-mix(
      in oklch,
      var(--studio-callout-note),
      var(--text-editor-line) 35%
    );
    --text-editor-callout-tip-text: color-mix(
      in oklch,
      var(--studio-callout-tip),
      var(--text-editor-line) 35%
    );
    --text-editor-callout-important-text: color-mix(
      in oklch,
      var(--studio-callout-important),
      var(--text-editor-line) 35%
    );
    --text-editor-callout-warning-text: color-mix(
      in oklch,
      var(--studio-callout-warning),
      var(--text-editor-line) 35%
    );
    --text-editor-callout-caution-text: color-mix(
      in oklch,
      var(--studio-callout-caution),
      var(--text-editor-line) 35%
    );
    --text-editor-callout-note-fill: color-mix(
      in oklch,
      var(--studio-callout-note) 9%,
      var(--text-editor-fill)
    );
    --text-editor-callout-tip-fill: color-mix(
      in oklch,
      var(--studio-callout-tip) 9%,
      var(--text-editor-fill)
    );
    --text-editor-callout-important-fill: color-mix(
      in oklch,
      var(--studio-callout-important) 9%,
      var(--text-editor-fill)
    );
    --text-editor-callout-warning-fill: color-mix(
      in oklch,
      var(--studio-callout-warning) 9%,
      var(--text-editor-fill)
    );
    --text-editor-callout-caution-fill: color-mix(
      in oklch,
      var(--studio-callout-caution) 9%,
      var(--text-editor-fill)
    );

    --text-editor-family-code: var(--editor-family-code);
    --text-editor-family-sans: var(--editor-family-sans);
    --text-editor-family: var(--text-editor-family-code);
    --text-editor-font-size: var(--editor-font-size);
    --text-editor-cursor-fill: var(--editor-cursor-fill);
    --text-editor-selection-fill: var(--editor-selection-fill);
    --text-editor-selection-line: var(--editor-selection-line);
    --text-editor-active-line-fill: color-mix(
      in oklch,
      var(--text-editor-fill-offset-10),
      transparent 80%
    );
    --text-editor-active-line-line: var(--text-editor-line);
    --text-editor-active-line-fill--gutter: var(--text-editor-fill-offset-20);
    --text-editor-active-line-line--gutter: var(--text-editor-line);
    --text-editor-gutter-fill: var(--text-editor-fill-offset-30);
    --text-editor-gutter-line: var(--text-editor-line);
    --text-editor-gutter-border: var(--text-editor-fill-offset-40);
    --text-editor-gutter-font-size: var(--editor-font-size);
    --text-editor-gutter-fill--line-numbers: var(--text-editor-gutter-fill);
    --text-editor-gutter-line--line-numbers: var(--text-editor-gutter-line);
    --text-editor-gutter-font-size--line-numbers: var(--editor-font-size);
    --text-editor-tooltip-fill: var(--text-editor-fill-offset-20);
    --text-editor-tooltip-color: var(--text-editor-line);
    --text-editor-tooltip-border: var(--text-editor-fill-offset-40);
    --text-editor-tooltip-shadow: color-mix(
      in oklch,
      var(--text-editor-line) 14%,
      transparent
    );
    --text-editor-tooltip-radius: var(--studio-radius-sm);
    --text-editor-tooltip-family: var(--text-editor-family-code);
    --text-editor-tooltip-family-prose: var(--text-editor-family-sans);
    --text-editor-tooltip-font-size: 0.92em;
    --text-editor-tooltip-line-height: 1.5;
    --text-editor-tooltip-muted: var(--text-editor-line-offset-40);
    --text-editor-tooltip-faint: var(--text-editor-line-offset-50);
    --text-editor-tooltip-match: var(--text-editor-primary-text);
    --text-editor-tooltip-selected-fill: color-mix(
      in oklch,
      var(--studio-primary) 14%,
      var(--text-editor-tooltip-fill)
    );
    --text-editor-tooltip-selected-line: var(--text-editor-tooltip-color);
    --text-editor-diagnostic-error: var(--text-editor-danger-text);
    --text-editor-diagnostic-warning: var(--text-editor-warning-text);
    --text-editor-diagnostic-info: var(--text-editor-line-offset-40);
    --text-editor-line-height: var(--editor-line-height);
    --text-editor-text-style: normal;
    --text-editor-text-weight: normal;
    --text-editor-text-fill: transparent;

    --syntax-comment: var(--text-editor-line-offset-50);
    --syntax-style-comment: italic;
    --syntax-fill-comment: var(--text-editor-text-fill);
    --syntax-weight-comment: var(--text-editor-text-weight);

    --syntax-line-comment: var(--syntax-comment);
    --syntax-style-line-comment: var(--syntax-style-comment);
    --syntax-fill-line-comment: var(--syntax-fill-comment);
    --syntax-weight-line-comment: var(--syntax-weight-comment);

    --syntax-block-comment: var(--syntax-comment);
    --syntax-style-block-comment: var(--syntax-style-comment);
    --syntax-fill-block-comment: var(--syntax-fill-comment);
    --syntax-weight-block-comment: var(--syntax-weight-comment);

    --syntax-doc-comment: var(--syntax-comment);
    --syntax-style-doc-comment: var(--syntax-style-comment);
    --syntax-fill-doc-comment: var(--syntax-fill-comment);
    --syntax-weight-doc-comment: var(--syntax-weight-comment);

    --syntax-meta: var(--text-editor-line);
    --syntax-style-meta: var(--text-editor-text-style);
    --syntax-fill-meta: var(--text-editor-text-fill);
    --syntax-weight-meta: var(--text-editor-text-weight);

    --syntax-invalid: var(--studio-danger);
    --syntax-style-invalid: var(--text-editor-text-style);
    --syntax-fill-invalid: var(--text-editor-text-fill);
    --syntax-weight-invalid: var(--text-editor-text-weight);

    --syntax-operator: var(--text-editor-line);
    --syntax-style-operator: var(--text-editor-text-style);
    --syntax-fill-operator: var(--text-editor-text-fill);
    --syntax-weight-operator: var(--text-editor-text-weight);

    --syntax-punctuation: var(--text-editor-line);
    --syntax-style-punctuation: var(--text-editor-text-style);
    --syntax-fill-punctuation: var(--text-editor-text-fill);
    --syntax-weight-punctuation: var(--text-editor-text-weight);

    --syntax-bool: var(--text-editor-line);
    --syntax-style-bool: var(--text-editor-text-style);
    --syntax-fill-bool: var(--text-editor-text-fill);
    --syntax-weight-bool: var(--text-editor-text-weight);

    --syntax-atom: var(--text-editor-line);
    --syntax-style-atom: var(--text-editor-text-style);
    --syntax-fill-atom: var(--text-editor-text-fill);
    --syntax-weight-atom: var(--text-editor-text-weight);

    --syntax-keyword: var(--text-editor-line);
    --syntax-style-keyword: var(--text-editor-text-style);
    --syntax-fill-keyword: var(--text-editor-text-fill);
    --syntax-weight-keyword: var(--text-editor-text-weight);

    --syntax-control-keyword: var(--syntax-keyword);
    --syntax-style-control-keyword: var(--syntax-style-keyword);
    --syntax-fill-control-keyword: var(--syntax-fill-keyword);
    --syntax-weight-control-keyword: var(--syntax-weight-keyword);

    --syntax-module-keyword: var(--syntax-keyword);
    --syntax-style-module-keyword: var(--syntax-style-keyword);
    --syntax-fill-module-keyword: var(--syntax-fill-keyword);
    --syntax-weight-module-keyword: var(--syntax-weight-keyword);

    --syntax-type-name: var(--text-editor-line);
    --syntax-style-type-name: var(--text-editor-text-style);
    --syntax-fill-type-name: var(--text-editor-text-fill);
    --syntax-weight-type-name: var(--text-editor-text-weight);

    --syntax-class-name: var(--text-editor-line);
    --syntax-style-class-name: var(--text-editor-text-style);
    --syntax-fill-class-name: var(--text-editor-text-fill);
    --syntax-weight-class-name: var(--text-editor-text-weight);

    --syntax-type-operator: var(--syntax-operator);
    --syntax-style-type-operator: var(--syntax-style-operator);
    --syntax-fill-type-operator: var(--syntax-fill-operator);
    --syntax-weight-type-operator: var(--syntax-weight-operator);

    --syntax-variable-name: var(--text-editor-line);
    --syntax-style-variable-name: var(--text-editor-text-style);
    --syntax-fill-variable-name: var(--text-editor-text-fill);
    --syntax-weight-variable-name: var(--text-editor-text-weight);

    --syntax-special--variable-name: var(--syntax-variable-name);
    --syntax-style-special--variable-name: var(--syntax-style-variable-name);
    --syntax-fill-special--variable-name: var(--syntax-fill-variable-name);
    --syntax-weight-special--variable-name: var(--syntax-weight-variable-name);

    --syntax-function--variable-name: var(--syntax-variable-name);
    --syntax-style-function--variable-name: var(--syntax-style-variable-name);
    --syntax-fill-function--variable-name: var(--syntax-fill-variable-name);
    --syntax-weight-function--variable-name: var(--syntax-weight-variable-name);

    --syntax-definition--variable-name: var(--syntax-variable-name);
    --syntax-style-definition--variable-name: var(--syntax-style-variable-name);
    --syntax-fill-definition--variable-name: var(--syntax-fill-variable-name);
    --syntax-weight-definition--variable-name: var(
      --syntax-weight-variable-name
    );

    --syntax-function--property-name: var(--syntax-variable-name);
    --syntax-style-function--property-name: var(--syntax-style-variable-name);
    --syntax-fill-function--property-name: var(--syntax-fill-variable-name);
    --syntax-weight-function--property-name: var(--syntax-weight-variable-name);

    --syntax-string: var(--text-editor-line);
    --syntax-fill-string: var(--text-editor-text-fill);
    --syntax-style-string: var(--text-editor-text-style);
    --syntax-weight-string: var(--text-editor-text-weight);

    --syntax-number: var(--text-editor-line);
    --syntax-fill-number: var(--text-editor-text-fill);
    --syntax-style-number: var(--text-editor-text-style);
    --syntax-weight-number: var(--text-editor-text-weight);

    --syntax-integer: var(--syntax-number);
    --syntax-style-integer: var(--syntax-style-number);
    --syntax-fill-integer: var(--syntax-fill-number);
    --syntax-weight-integer: var(--syntax-weight-number);

    --syntax-float: var(--syntax-number);
    --syntax-style-float: var(--syntax-style-number);
    --syntax-fill-float: var(--syntax-fill-number);
    --syntax-weight-float: var(--syntax-weight-number);

    --syntax-escape: var(--syntax-punctuation);
    --syntax-style-escape: var(--syntax-style-punctuation);
    --syntax-fill-escape: var(--syntax-fill-punctuation);
    --syntax-weight-escape: var(--syntax-weight-punctuation);

    --syntax-regexp: var(--syntax-string);
    --syntax-style-regexp: var(--syntax-style-string);
    --syntax-fill-regexp: var(--syntax-fill-string);
    --syntax-weight-regexp: var(--syntax-weight-string);

    --syntax-special--string: var(--syntax-string);
    --syntax-style-special--string: var(--syntax-style-string);
    --syntax-fill-special--string: var(--syntax-fill-string);
    --syntax-weight-special--string: var(--syntax-weight-string);

    --syntax-tag-name: var(--text-editor-line);
    --syntax-fill-tag-name: var(--text-editor-text-fill);
    --syntax-style-tag-name: var(--text-editor-text-style);
    --syntax-weight-tag-name: var(--text-editor-text-weight);

    --syntax-angle-bracket: var(--syntax-punctuation);
    --syntax-style-angle-bracket: var(--syntax-style-punctuation);
    --syntax-fill-angle-bracket: var(--syntax-fill-punctuation);
    --syntax-weight-angle-bracket: var(--syntax-weight-punctuation);

    --syntax-attribute-name: var(--text-editor-line);
    --syntax-fill-attribute-name: var(--text-editor-text-fill);
    --syntax-style-attribute-name: var(--text-editor-text-style);
    --syntax-weight-attribute-name: var(--text-editor-text-weight);

    --syntax-namespace: var(--text-editor-line);
    --syntax-fill-namespace: var(--text-editor-text-fill);
    --syntax-style-namespace: var(--text-editor-text-style);
    --syntax-weight-namespace: var(--text-editor-text-weight);

    --syntax-strong: var(--text-editor-line);
    --syntax-fill-strong: var(--text-editor-text-fill);
    --syntax-style-strong: var(--text-editor-text-style);
    --syntax-weight-strong: bold;

    --syntax-emphasis: var(--text-editor-line);
    --syntax-fill-emphasis: var(--text-editor-text-fill);
    --syntax-style-emphasis: italic;
    --syntax-weight-emphasis: var(--text-editor-text-weight);

    --syntax-heading: var(--text-editor-line);
    --syntax-fill-heading: var(--text-editor-text-fill);
    --syntax-style-heading: var(--text-editor-text-style);
    --syntax-weight-heading: bold;

    --syntax-link: var(--studio-link);
    --syntax-fill-link: var(--text-editor-text-fill);
    --syntax-style-link: var(--text-editor-text-style);
    --syntax-weight-link: var(--text-editor-text-weight);

    /* a quote's and a list's text is prose, not syntax: the text's own colour
	   and style. (a quote is set off by its bar, a list by its markers.) */
    --syntax-quote: var(--text-editor-line);
    --syntax-style-quote: var(--text-editor-text-style);
    --syntax-fill-quote: var(--text-editor-text-fill);
    --syntax-weight-quote: var(--text-editor-text-weight);

    --syntax-list: var(--text-editor-line);
    /* bullets drawn in place of `-`: the theme's primary accent, as ink */
    --syntax-list-marker: var(--text-editor-primary-text);
    /* a quote's bar: the same colour as the bullets */
    --syntax-quote-bar: var(--syntax-list-marker);
    --syntax-fill-list: var(--text-editor-text-fill);
    --syntax-style-list: var(--text-editor-text-style);
    --syntax-weight-list: var(--text-editor-text-weight);

    --syntax-inserted: var(--studio-added);
    --syntax-fill-inserted: var(--text-editor-text-fill);
    --syntax-style-inserted: var(--text-editor-text-style);
    --syntax-weight-inserted: var(--text-editor-text-weight);

    --syntax-deleted: var(--studio-deleted);
    --syntax-fill-deleted: var(--text-editor-text-fill);
    --syntax-style-deleted: var(--text-editor-text-style);
    --syntax-weight-deleted: var(--text-editor-text-weight);

    --syntax-changed: var(--studio-modified);
    --syntax-fill-changed: var(--text-editor-text-fill);
    --syntax-style-changed: var(--text-editor-text-style);
    --syntax-weight-changed: var(--text-editor-text-weight);

    --syntax-content-separator: var(--text-editor-line);
    --syntax-fill-content-separator: var(--text-editor-text-fill);
    --syntax-style-content-separator: var(--text-editor-text-style);
    --syntax-weight-content-separator: var(--text-editor-text-weight);
  }

  @media (prefers-reduced-motion: reduce) {
    :root,
    :host,
    [theme] {
      --studio-motion-preference: 0;
    }
  }

  :root {
    background-color: var(--studio-chrome-fill);
    /* opt-in, inherited knobs. every fallback is the property's initial value,
	   and anything a tool sets on its own elements still wins over inheritance. */
    letter-spacing: var(--studio-letter-spacing, normal);
    font-feature-settings: var(--studio-font-features, normal);
    font-variation-settings: var(--studio-font-variation, normal);
    scrollbar-color: var(--studio-scrollbar-color, auto);
    scrollbar-width: var(--studio-scrollbar-width, auto);
  }

  ::selection {
    background: var(--studio-selection-fill);
    color: var(--studio-selection-line);
  }

  body {
    margin: 0;
  }

  input,
  button,
  select,
  textarea,
  optgroup {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
  }
}
