Skip to content

A local-first multi-agent app development platform, built on PenguinHarness

40.6 KB
Raw Blame
/**
 * Frost (`modern`) — soft, roomy, quiet. A cool-neutral off-white with almost no lines: the
 * navigation column is a soft grey beside a near-white main column (flat — no field, no
 * floating sheet), grouping comes from soft grey fills rather than borders, a card's edge is a
 * hairline that barely exists, dialogs are opaque on a dimmed backdrop with large corners; pill
 * controls, regular-weight titles set large with negative tracking, a light frost on the small
 * layers that float over content, motion that springs and de-blurs, and work in progress shown
 * by nothing more than a highlight sweeping across its label. References: the owner's three
 * captures of 2026-09-29 (a grey sidebar beside a near-white transcript, an opaque About dialog
 * on a blurred page, a settings dialog whose rows sit in soft-filled groups), with Codex /
 * macOS for the lineless working state; the earlier sierra.ai warm field and floating sheet
 * were retired at that review.
 *
 * Status of each group:
 * - Light is a near-neutral grey ramp with a faint cool cast: the canvas `#fafafa` (never a
 *   stark white slab), the navigation column and grouped rows `#f3f4f5`, cards white, lines a
 *   step above the fill they sit on. Dark is the same ramp inverted, set calm but not dim — the
 *   body ink about 11:1 on the muted surface, the near-white kept for headings, the muted ink
 *   6.5:1 and the subtle 4.9:1 there.
 * - The accent family derives from `--ui-accent`: hover and active are the accent shaded, the
 *   wash and the line are the accent at an alpha, so a preset sets the one value per mode.
 * - Semantic tones use Sierra's hues, tuned until every tone reads at 4.5:1 as text on its own
 *   tint and 3:1 as a mark on every surface (proposal). Chart and code colours are proposals.
 * - Fonts: MiSans (Xiaomi) in place of Sierra's commercial GT America, Latin and Chinese in one
 *   family at weights 400 and 500, with JetBrains Mono for code (`fonts/modern.css`). Chrome and
 *   reading text share the face.
 * - Density and type are Frost's own: a 0.28rem space unit (12% above Tailwind's 0.25rem, so
 *   every `h-8` and `px-2` grows with it), a 0.9375rem body rung, roomier control padding. The
 *   size of nothing is shared with the other themes any more.
 *
 * Shape of the file (the same in every theme): one `@layer ui-theme` block holding the base rule,
 * which defines every name in tokens.ts in its group order with its light value, after the gray
 * bridge that re-points Tailwind's `--color-gray-*` / `--color-white` so the app's existing
 * palette classes follow the theme; the dark rule, which declares only what dark changes (the
 * rest keeps its base value, since this file comes after `github.css` and so its base rule beats
 * that file's dark rule); and then this theme's recipes for the style hooks (hooks.ts). After it,
 * one `@layer ui-accent` block with the theme's own accent presets.
 */
@layer ui-theme {
  :root[data-theme="modern"] {
    /* Tailwind bridge: the app's gray classes land on the cool-neutral ramp. white = the card
       surface. */
    --color-white: var(--ui-surface);
    --color-gray-50: #fafafa;
    --color-gray-100: #f3f4f5;
    --color-gray-200: #e6e8ea;
    --color-gray-300: #d0d3d6;
    --color-gray-400: #979b9f;
    --color-gray-500: #686c71;
    --color-gray-600: #565a5e;
    --color-gray-700: #424549;
    --color-gray-800: #313336;
    --color-gray-900: #242628;
    --color-gray-950: #18191b;

    /* Colour — surfaces. The canvas is a near-white, not a white slab; grouped rows and the
       navigation column sit on the muted grey; cards and dialogs are white. */
    --ui-canvas: #fafafa;
    --ui-surface: #ffffff;
    --ui-surface-muted: #f3f4f5;
    --ui-fill-neutral: var(--color-gray-100);
    --ui-inset: #f5f6f7;
    --ui-overlay: #ffffff;
    --ui-overlay-backdrop: rgb(24 25 27 / 0.4);

    /* Colour — text */
    --ui-fg: #232527;
    --ui-fg-emphasis: var(--ui-fg);
    --ui-fg-muted: #686c71;
    --ui-fg-subtle: #979b9f;
    --ui-fg-link: #2f66c4;
    --ui-fg-link-hover: #244f9a;

    /* Colour — lines: a step above the fill they sit on, so a card's edge barely exists */
    --ui-line: #e9eaec;
    --ui-line-muted: #f0f1f2;
    --ui-line-emphasis: #d0d3d6;
    --ui-divider: #f0f1f2;

    /* Colour — accent: Sierra's forest green. The rest of the family derives from it: hover and
       active are the accent shaded toward black (the label is white, so a darker fill only gains
       contrast), the wash and the line are the accent at an alpha. A preset therefore sets
       `--ui-accent` alone; its label ink is the theme's for the mode. */
    --ui-accent: #006838;
    --ui-accent-hover: color-mix(in srgb, var(--ui-accent) 86%, #000000);
    --ui-accent-active: color-mix(in srgb, var(--ui-accent) 74%, #000000);
    --ui-accent-fg: #ffffff;
    --ui-accent-muted: color-mix(in srgb, var(--ui-accent) 14%, transparent);
    --ui-accent-line: color-mix(in srgb, var(--ui-accent) 35%, transparent);

    /* Colour — semantic tones: a soft tint with its ink and no edge — a tone's line is its tint,
       so a badge or a pill is a tinted shape, never a bordered one. */
    --ui-tone-success-fg: #007a3a;
    --ui-tone-success-bg: #e4f2e8;
    --ui-tone-success-line: var(--ui-tone-success-bg);
    --ui-tone-success-emphasis: #007a3a;
    --ui-tone-success-emphasis-fg: #ffffff;
    --ui-tone-attention-fg: #806210;
    --ui-tone-attention-bg: #fbf4dc;
    --ui-tone-attention-line: var(--ui-tone-attention-bg);
    --ui-tone-attention-emphasis: #ebc247;
    --ui-tone-attention-emphasis-fg: #232527;
    --ui-tone-danger-fg: #c72d06;
    --ui-tone-danger-bg: #fcebe8;
    --ui-tone-danger-line: var(--ui-tone-danger-bg);
    --ui-tone-danger-emphasis: #c72d06;
    --ui-tone-danger-emphasis-fg: #ffffff;
    --ui-tone-done-fg: #7644a6;
    --ui-tone-done-bg: #f1edf8;
    --ui-tone-done-line: var(--ui-tone-done-bg);
    --ui-tone-done-emphasis: #7644a6;
    --ui-tone-done-emphasis-fg: #ffffff;
    --ui-tone-neutral-fg: #5f6367;
    --ui-tone-neutral-bg: #f3f4f5;
    --ui-tone-neutral-line: var(--ui-tone-neutral-bg);
    --ui-tone-neutral-emphasis: #6d7176;
    --ui-tone-neutral-emphasis-fg: #ffffff;
    --ui-tone-info-fg: #2f66c4;
    --ui-tone-info-bg: #eaf0fa;
    --ui-tone-info-line: var(--ui-tone-info-bg);
    --ui-tone-info-emphasis: #2f66c4;
    --ui-tone-info-emphasis-fg: #ffffff;

    /* Colour — marks: the update dot in a soft coral, the danger hue lifted so it reads as news;
       one value on both pages */
    --ui-mark-new: #f0765a;

    /* Charts: soft. A low-chroma palette in the roles (heather, ochre, dusk blue, rose, sage,
       mauve, teal, clay), each just clearing 3:1 on the canvas so a line and a point read; the
       bars are the same colours let through at seven tenths (a little more in dark) with no
       outline — a first pass edged them in their own colour and the owner preferred them plain
       — so a chart never glares. The reference curve in the muted ink, the token-kind blues
       softened, and a soft geometry: bars a little over half their band with rounded tops, a
       2px smooth curve, round points, a light wash under a line. */
    --ui-chart-1: #8b7cc4;
    --ui-chart-2: #a8863a;
    --ui-chart-3: #6590c2;
    --ui-chart-4: #c4718b;
    --ui-chart-5: #5f9c7a;
    --ui-chart-6: #b57cb3;
    --ui-chart-7: #58978f;
    --ui-chart-8: #bd7d52;
    --ui-chart-ref: var(--ui-fg-muted);
    --ui-chart-cache-read: #b9cfe8;
    --ui-chart-cache-write: #7fa3d2;
    --ui-chart-output: #4d6f9e;
    --ui-chart-grid: #eef0f1;
    --ui-chart-axis: #979b9f;
    --ui-chart-bar-fill: 0.55;
    --ui-chart-bar-radius: 3px;
    --ui-chart-line-width: 2px;
    --ui-chart-point-radius: 3px;
    --ui-chart-curve: smooth;
    --ui-chart-area-opacity: 0.12;
    --ui-chart-bar-stroke: 0px;
    --ui-chart-bar-stroke-color: series;
    --ui-chart-bar-opacity: 0.7;

    /* Colour — code */
    --ui-code-bg: #f5f6f7;
    --ui-code-line: #e9eaec;
    --ui-code-gutter: #979b9f;
    --ui-code-selection: rgb(47 102 196 / 0.16);
    --ui-diff-add-bg: #e7f3ea;
    --ui-diff-add-word: #c2e5ca;
    --ui-diff-del-bg: #fcebe8;
    --ui-diff-del-word: #f6c9bb;
    --ui-diff-hunk-bg: #eaf0fa;

    /* Shape: large on boxes — 6 / 8 / 12 / 20 / 24 px at the 16px root, so a card takes 12px
       and a dialog 20px — with the pill kept for every pressable control. */
    --ui-radius-xs: 0.375rem;
    --ui-radius-sm: 0.5rem;
    --ui-radius-md: 0.75rem;
    --ui-radius-lg: 1.25rem;
    --ui-radius-xl: 1.5rem;
    --ui-radius-pill: 9999px;
    --ui-radius-control: 9999px;
    --ui-border-w: 1px;
    --ui-border-w-thick: 2px;

    /* Elevation: untinted and soft — a faint drop, no ring (a layer's edge is its own hairline).
       `flat` is a zero shadow rather than `none`: Tailwind composes shadows into a comma list,
       where `none` would invalidate the whole declaration. The frost is light and nearly opaque:
       a small layer over content keeps a hint of what moves under it, no more. */
    --ui-shadow-flat: 0 0 #0000;
    --ui-shadow-raised: 0 1px 2px rgb(0 0 0 / 0.04);
    --ui-shadow-overlay: 0 4px 16px -4px rgb(0 0 0 / 0.1);
    --ui-shadow-modal: 0 12px 40px -12px rgb(0 0 0 / 0.18);
    --ui-shadow-drawer: var(--ui-shadow-modal);
    --ui-glass-bg: rgb(255 255 255 / 0.85);
    --ui-glass-blur: 16px;
    --ui-glass-saturate: 1.2;
    --ui-glass-line: rgb(0 0 0 / 0.06);

    /* Shell: flat. The navigation column is the muted grey, the main column the canvas, and the
       change of fill is the whole edge between them — no field, no washes, no gap, no corner,
       no shadow (the floating sheet was retired at the owner's review of 2026-09-29). */
    --ui-shell-field: var(--ui-surface-muted);
    --ui-shell-wash-1: transparent;
    --ui-shell-wash-2: transparent;
    --ui-shell-nav-bg: var(--ui-surface-muted);
    --ui-shell-main-bg: var(--ui-canvas);
    --ui-shell-line: transparent;
    --ui-shell-gap: 0px;
    --ui-shell-radius: 0px;
    --ui-shell-shadow: 0 0 #0000;

    /* Structure: a roomy tree (a 0.75rem inset, 1.125rem per level) against a soft guide in the
       line colour; a field keeps the host's label-beside-control row (the label column is
       unused), with a half-rem between label and control. */
    --ui-tree-inset: 0.75rem;
    --ui-tree-indent: 1.125rem;
    --ui-tree-guide: var(--ui-line);
    --ui-field-label-w: auto;
    --ui-field-gap: 0.5rem;

    /* Controls: the switch's off track is the line, its knob the muted ink (5:1 on the track);
       on the accent the knob takes the accent's label ink. */
    --ui-switch-track: var(--color-gray-200);
    --ui-switch-knob: var(--ui-fg-muted);
    --ui-switch-knob-on: var(--ui-accent-fg);
    --ui-switch-knob-line: rgb(0 0 0 / 0.1);

    /* Typography — families. MiSans sets Latin and Chinese alike; the system CJK faces stay ahead
       of the generic fallbacks for the rare ideograph MiSans's slices do not carry. Chrome and
       reading text share the one face. */
    --ui-font-cjk: "MiSans", "PingFang SC", "Microsoft YaHei";
    --ui-font-sans: "MiSans", var(--ui-font-cjk), ui-sans-serif, system-ui, sans-serif;
    --ui-font-ui: var(--ui-font-sans);
    --ui-font-mono:
      "JetBrains Mono Variable", ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono",
      var(--ui-font-cjk), monospace;
    --ui-font-display: var(--ui-font-sans);

    /* Typography — scale and roles: a 15px body at the 16px root, 13px small and caption, and
       titles set large in the regular weight with tightening negative tracking up the scale, the
       way Sierra sets its h1 and h2 (400, −1.3px at 65px). Frost's weights stop at 500. */
    --ui-text-body-size: 0.9375rem;
    --ui-text-body-lh: 1.5;
    --ui-text-small-size: 0.8125rem;
    --ui-text-small-lh: 1.5;
    --ui-text-caption-size: 0.8125rem;
    --ui-text-caption-lh: 1.4;
    --ui-text-code-size: 0.8125rem;
    --ui-text-code-lh: 1.6;
    --ui-text-prose-size: 1rem;
    --ui-text-prose-lh: 1.65;
    --ui-h1-size: 2.25rem;
    --ui-h1-lh: 1.1;
    --ui-h1-weight: 400;
    --ui-h1-tracking: -0.03em;
    --ui-h1-transform: none;
    --ui-h1-font: var(--ui-font-display);
    --ui-h2-size: 1.75rem;
    --ui-h2-lh: 1.15;
    --ui-h2-weight: 400;
    --ui-h2-tracking: -0.025em;
    --ui-h2-transform: none;
    --ui-h2-font: var(--ui-font-display);
    --ui-h3-size: 1.375rem;
    --ui-h3-lh: 1.25;
    --ui-h3-weight: 400;
    --ui-h3-tracking: -0.015em;
    --ui-h3-transform: none;
    --ui-h3-font: var(--ui-font-sans);
    --ui-h4-size: 1.125rem;
    --ui-h4-lh: 1.35;
    --ui-h4-weight: 500;
    --ui-h4-tracking: -0.01em;
    --ui-h4-transform: none;
    --ui-h4-font: var(--ui-font-sans);
    --ui-h5-size: 0.9375rem;
    --ui-h5-lh: 1.5;
    --ui-h5-weight: 500;
    --ui-h5-tracking: 0;
    --ui-h5-transform: none;
    --ui-h5-font: var(--ui-font-sans);
    --ui-h6-size: 0.8125rem;
    --ui-h6-lh: 1.5;
    --ui-h6-weight: 500;
    --ui-h6-tracking: 0;
    --ui-h6-transform: none;
    --ui-h6-font: var(--ui-font-sans);
    --ui-md-h1-size: 1.5rem;
    --ui-md-h2-size: 1.25rem;
    --ui-md-h3-size: 1.0625rem;
    --ui-weight-body: 400;
    --ui-weight-medium: 500;
    --ui-weight-strong: 500;
    --ui-tracking-body: 0;
    --ui-tracking-mono: 0;
    --ui-tracking-label: 0;

    /* Density: a 0.28rem space unit (every Tailwind spacing and size utility scales with it), and
       control, row and menu-row padding a step roomier than the unit alone gives. Pills take wide
       padding-inline. Stacks are the unit's multiples. */
    --ui-space-unit: 0.28rem;
    --ui-control-py-sm: 0.375rem;
    --ui-control-py-md: 0.5rem;
    --ui-control-py-lg: 0.75rem;
    --ui-control-px-sm: 0.875rem;
    --ui-control-px-md: 1.125rem;
    --ui-control-px-lg: 1.375rem;
    --ui-control-gap-sm: 0.375rem;
    --ui-control-gap-md: 0.625rem;
    --ui-row-py: 0.5rem;
    --ui-row-px: 1rem;
    --ui-menu-row-py: 0.5625rem;
    --ui-menu-row-px: 0.75rem;
    --ui-card-p: 1.25rem;
    --ui-panel-p: 1.5rem;
    --ui-stack-0: 0.3125rem;
    --ui-stack-1: 0.625rem;
    --ui-stack-2: 1.25rem;
    --ui-stack-3: 1.875rem;
    --ui-stack-4: 3rem;

    /* Motion: Sierra's cubic-bezier(.4,0,.2,1) for state changes, held to 120–200ms. Layers enter
       on a soft spring (a touch of overshoot, never a bounce) scaling up from 0.96 with a 6px
       blur-in and an 8px slide from their edge, and leave quickly on the overlay-out curve;
       streamed text de-blurs in word by word over 360ms; the sidebar's width settles on a long
       ease-out. */
    --ui-dur-fast: 120ms;
    --ui-dur-base: 200ms;
    --ui-dur-slow: 320ms;
    --ui-ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ui-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    --ui-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --ui-ease-overlay-in: cubic-bezier(0.16, 1, 0.3, 1);
    --ui-ease-overlay-out: cubic-bezier(0.4, 0, 1, 1);
    --ui-live-timing: linear;
    --ui-dur-enter: 280ms;
    --ui-dur-exit: 160ms;
    --ui-ease-enter: cubic-bezier(0.22, 1.15, 0.36, 1);
    --ui-ease-exit: var(--ui-ease-overlay-out);
    --ui-enter-shift: 8px;
    --ui-enter-scale: 0.96;
    --ui-enter-blur: 6px;
    --ui-dur-reveal: 360ms;
    --ui-reveal-blur: 4px;
    --ui-dur-layout: 320ms;
    --ui-ease-layout: cubic-bezier(0.22, 1, 0.36, 1);

    /* Streaming: a reply surfaces word by word at about 220 characters a second — quick enough
       never to hold a fast model back for long, even enough to read as a calm flow — through
       the soft veil the `ui-stream` recipe draws over its trailing lines. */
    --ui-stream-reveal: fade;
    --ui-stream-rate: 220;

    /* Icons */
    --ui-icon-stroke: 1.6;
    --ui-icon-cap: round;
    --ui-icon-join: round;

    /* Focus, selection and scrollbar. The outline follows the element's radius, so pills get a
       round halo; inputs draw theirs as a box-shadow. */
    --ui-focus-ring: 3px solid color-mix(in srgb, var(--ui-accent) 32%, transparent);
    --ui-focus-ring-offset: 1px;
    --ui-focus-ring-input: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 22%, transparent);
    --ui-selection-bg: rgb(47 102 196 / 0.2);
    --ui-scrollbar-w: thin;
    --ui-scrollbar-thumb: rgb(0 0 0 / 0.2);
    --ui-scrollbar-thumb-hover: rgb(0 0 0 / 0.36);
    --ui-scrollbar-track: transparent;
    --ui-scrollbar-visibility: auto;
  }

  /* Dark: the same cool-neutral ramp inverted — calm greys, fills rather than lines, the body
     ink a light grey and the near-white kept for headings. */
  :root[data-theme="modern"].dark {
    /* Tailwind bridge: 950 canvas, 900 surface, 800 grouped rows / hover, 700 control line, then
       the ink ramp — 500 subtle, 400 muted, 100 body, 50 the near-white for headings. white
       stays literal: `dark:*-white/N` hairlines read it as ink. */
    --color-white: #ffffff;
    --color-gray-50: #f5f5f6;
    --color-gray-100: #e4e4e5;
    --color-gray-200: #cfd0d2;
    --color-gray-300: #bcbdbf;
    --color-gray-400: #adaeb0;
    --color-gray-500: #95979a;
    --color-gray-600: #6a6c70;
    --color-gray-700: #3a3c3f;
    --color-gray-800: #2f3033;
    --color-gray-900: #232426;
    --color-gray-950: #1b1c1e;

    /* Colour — surfaces: the navigation column a step below the canvas, cards a step above,
       grouped rows another */
    --ui-canvas: #1b1c1e;
    --ui-surface: #232426;
    --ui-surface-muted: #2a2b2e;
    --ui-fill-neutral: var(--color-gray-800);
    --ui-inset: #161718;
    --ui-overlay: #262729;
    --ui-overlay-backdrop: rgb(0 0 0 / 0.55);

    /* Colour — text: body about 11:1 on the muted surface, muted 6.5:1 and subtle 4.9:1 there */
    --ui-fg: var(--color-gray-100);
    --ui-fg-emphasis: var(--color-gray-50);
    --ui-fg-muted: var(--color-gray-400);
    --ui-fg-subtle: var(--color-gray-500);
    --ui-fg-link: #8bbff5;
    --ui-fg-link-hover: #b8d7f9;

    /* Colour — lines */
    --ui-line: rgb(255 255 255 / 0.07);
    --ui-line-muted: rgb(255 255 255 / 0.04);
    --ui-line-emphasis: rgb(255 255 255 / 0.16);
    --ui-divider: rgb(255 255 255 / 0.04);

    /* Colour — accent. The green lifts and takes the canvas as ink (white on it is under
       4.5:1), so hover now shades toward white and active toward black — away from the ink,
       as in light — and the wash and the line strengthen a step on the dark page. */
    --ui-accent: #4aa45c;
    --ui-accent-hover: color-mix(in srgb, var(--ui-accent) 86%, #ffffff);
    --ui-accent-active: color-mix(in srgb, var(--ui-accent) 90%, #000000);
    --ui-accent-fg: #111214;
    --ui-accent-muted: color-mix(in srgb, var(--ui-accent) 18%, transparent);
    --ui-accent-line: color-mix(in srgb, var(--ui-accent) 45%, transparent);

    /* Colour — semantic tones: the tints lifted; a tone's line stays its tint */
    --ui-tone-success-fg: #7ed185;
    --ui-tone-success-bg: rgb(126 209 133 / 0.14);
    --ui-tone-success-emphasis: #2a7a3f;
    --ui-tone-attention-fg: #ebc247;
    --ui-tone-attention-bg: rgb(235 194 71 / 0.14);
    --ui-tone-attention-emphasis-fg: #1b1c1e;
    --ui-tone-danger-fg: #f0765a;
    --ui-tone-danger-bg: rgb(233 78 42 / 0.16);
    --ui-tone-danger-emphasis: #c23a1c;
    --ui-tone-done-fg: #c9a8f0;
    --ui-tone-done-bg: rgb(166 115 222 / 0.16);
    --ui-tone-done-emphasis: #7f52b5;
    --ui-tone-neutral-fg: var(--color-gray-300);
    --ui-tone-neutral-bg: rgb(255 255 255 / 0.06);
    --ui-tone-neutral-emphasis: #5a5c60;
    --ui-tone-info-fg: #8bbff5;
    --ui-tone-info-bg: rgb(139 191 245 / 0.14);
    --ui-tone-info-emphasis: #3a6bc4;

    /* Charts: the same roles lifted for the dark page */
    --ui-chart-1: #9f90d4;
    --ui-chart-2: #c4a45f;
    --ui-chart-3: #84a8d6;
    --ui-chart-4: #d494ab;
    --ui-chart-5: #86b99b;
    --ui-chart-6: #c99ac5;
    --ui-chart-7: #82b5b0;
    --ui-chart-8: #d3a281;
    --ui-chart-cache-read: #c5d8ee;
    --ui-chart-cache-write: #8fb1dc;
    --ui-chart-output: #6a8fc0;
    --ui-chart-bar-opacity: 0.78;
    --ui-chart-grid: rgb(255 255 255 / 0.06);
    --ui-chart-axis: var(--color-gray-500);

    /* Colour — code */
    --ui-code-bg: #161718;
    --ui-code-line: rgb(255 255 255 / 0.07);
    --ui-code-gutter: var(--color-gray-500);
    --ui-code-selection: rgb(139 191 245 / 0.22);
    --ui-diff-add-bg: rgb(126 209 133 / 0.1);
    --ui-diff-add-word: rgb(126 209 133 / 0.28);
    --ui-diff-del-bg: rgb(233 78 42 / 0.12);
    --ui-diff-del-word: rgb(233 78 42 / 0.32);
    --ui-diff-hunk-bg: rgb(139 191 245 / 0.1);

    /* Elevation: a faint top edge on raised surfaces; overlays keep a soft drop, their edge a
       light hairline of their own. */
    --ui-shadow-raised: inset 0 1px 0 rgb(255 255 255 / 0.04);
    --ui-shadow-overlay: 0 4px 16px -4px rgb(0 0 0 / 0.5);
    --ui-shadow-modal: 0 12px 40px -12px rgb(0 0 0 / 0.6);
    --ui-glass-bg: rgb(35 36 38 / 0.85);
    --ui-glass-line: rgb(255 255 255 / 0.08);

    /* Shell: the navigation column a step below the canvas; the rest keeps its base values */
    --ui-shell-field: #17181a;
    --ui-shell-nav-bg: #17181a;

    /* Controls: the dark off track, and the body ink as the knob on it */
    --ui-switch-track: var(--color-gray-700);
    --ui-switch-knob: var(--ui-fg);

    /* Focus, selection and scrollbar */
    --ui-focus-ring: 3px solid color-mix(in srgb, var(--ui-accent) 40%, transparent);
    --ui-focus-ring-input: 0 0 0 3px color-mix(in srgb, var(--ui-accent) 28%, transparent);
    --ui-selection-bg: rgb(139 191 245 / 0.28);
    --ui-scrollbar-thumb: rgb(255 255 255 / 0.16);
    --ui-scrollbar-thumb-hover: rgb(255 255 255 / 0.3);
  }

  /*
   * Style hooks (hooks.ts). A component opts into a hook with its class; this theme decides what
   * the hook does. These rules sit in `ui-theme`, after Tailwind's `utilities`, so a hook wins over
   * the utilities its component also carries — that is what lets `.ui-live` re-time an
   * `animate-spin`, `.ui-glass` replace a panel's opaque fill and `.ui-shell` re-paint the
   * window's columns.
   *
   * Frost gives all fifteen a recipe: glass, eyebrow (its ink; the rung is theme.css's),
   * display, live, frame, underline-nav, shell, icon-decor, tree, field, activity, notice, chart,
   * scrim, stream.
   */

  /* Frosted transient layer: menus, popovers, tooltips and the floating composer — the small
     layers with content moving underneath, which is what a light frost shows. Never on cards,
     the sidebar or the login card, where nothing scrolls behind. Elevation stays the host's own
     shadow token; the edge is the glass hairline, barely there. */
  :root[data-theme="modern"] .ui-glass {
    background-color: var(--ui-glass-bg);
    -webkit-backdrop-filter: blur(var(--ui-glass-blur)) saturate(var(--ui-glass-saturate));
    backdrop-filter: blur(var(--ui-glass-blur)) saturate(var(--ui-glass-saturate));
    border-color: var(--ui-glass-line);
  }
  /* A dialog is opaque, unfrosted and edgeless, with the large corner, on a dimmed backdrop —
     the reference's About and settings dialogs: a page of its own to read, nothing of the page
     behind showing through (even at 96% the Settings dialog let the transcript's lines ghost
     through its rows). Menus, popovers and tooltips keep the frost at a translucency whose ink
     clears 4.5:1 on the worst backdrop — the contrast suite measures the glass over black in
     light and over white in dark. */
  :root[data-theme="modern"] .ui-glass[role="dialog"] {
    background-color: var(--ui-overlay);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-color: transparent;
    border-radius: var(--ui-radius-lg);
  }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root[data-theme="modern"] .ui-glass {
      background-color: color-mix(in srgb, var(--ui-overlay) 96%, transparent);
    }
  }
  @media (prefers-reduced-transparency: reduce) {
    :root[data-theme="modern"] .ui-glass {
      background-color: color-mix(in srgb, var(--ui-overlay) 96%, transparent);
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
  }

  /* The scrim — the dimmed layer behind a dialog, drawer or sheet: the page blurs behind it
     under the host's dim (--ui-overlay-backdrop), the reference's frosted backdrop, in both
     modes. The blur is the scrim's backdrop only — a backdrop filter never reaches an element's
     own descendants — so a dialog drawn inside the scrim stays sharp; and the scrim is already
     fixed to the viewport, so becoming a containing block moves nothing. Without backdrop
     filters, or under reduced transparency, the dim alone remains. */
  :root[data-theme="modern"] .ui-scrim {
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    :root[data-theme="modern"] .ui-scrim {
      background-color: var(--ui-overlay-backdrop);
    }
  }
  @media (prefers-reduced-transparency: reduce) {
    :root[data-theme="modern"] .ui-scrim {
      -webkit-backdrop-filter: none;
      backdrop-filter: none;
    }
  }

  /* Group label, in sentence case on the h6 rung (theme.css), in the muted ink. */
  :root[data-theme="modern"] .ui-eyebrow {
    color: var(--ui-fg-muted);
  }

  /* Regular-weight display title with tight tracking. */
  :root[data-theme="modern"] .ui-display {
    font-weight: 400;
    letter-spacing: -0.03em;
  }

  :root[data-theme="modern"] .ui-live {
    animation-timing-function: var(--ui-live-timing);
  }
  :root[data-theme="modern"] .ui-live[data-live="caret"] {
    animation-duration: 1.2s;
  }

  /* Tool cards, code blocks and the work group: rounded on the box scale with an edge that
     barely exists, the header inside the box with no fill or rule of its own — it takes the
     box's fill rather than none, because a work group's header sticks while its rows scroll
     under it and must stay opaque. */
  :root[data-theme="modern"] .ui-frame {
    border-radius: var(--ui-radius-md);
    border-color: var(--ui-line-muted);
  }
  :root[data-theme="modern"] .ui-frame > [data-slot="head"] {
    background-color: inherit;
    border-bottom-color: transparent;
  }

  /* A work group — a frame headed by a step of the agent's work, open or collapsed — is lineless
     in every state, the way Codex and macOS list work: no card border, no fill, no rule under
     the header or between the rows. Header and rows sit on the page, painted in its colour so
     they stay opaque while they stick, spaced by whitespace, and a hover is a soft rounded
     highlight; a running step adds nothing but the sweep across its label. */
  :root[data-theme="modern"] .ui-frame:has(> .ui-activity) {
    border-color: transparent;
    background-color: transparent;
    box-shadow: none;
  }
  :root[data-theme="modern"] .ui-frame:has(> .ui-activity) > * {
    border-color: transparent;
  }
  :root[data-theme="modern"] .ui-frame:has(> .ui-activity) > [data-slot="head"],
  :root[data-theme="modern"] .ui-frame:has(> .ui-activity) .ui-tree .ui-activity {
    border-radius: var(--ui-radius-sm);
    background-color: var(--ui-canvas);
  }
  :root[data-theme="modern"] .ui-frame:has(> .ui-activity) > [data-slot="head"]:hover,
  :root[data-theme="modern"] .ui-frame:has(> .ui-activity) .ui-tree .ui-activity:hover {
    background-color: var(--ui-surface-muted);
  }
  :root[data-theme="modern"] .ui-frame:has(> .ui-activity) .ui-tree > [data-depth] {
    border-color: transparent;
    margin-block: var(--ui-stack-0);
  }

  /* Tabs: a rounded accent bar under the selected tab. */
  :root[data-theme="modern"] .ui-underline-nav [role="tab"] {
    position: relative;
    /* The marker below is the only one: the host's own bottom border (Primer's) gives way. */
    border-bottom-color: transparent;
  }
  :root[data-theme="modern"] .ui-underline-nav [role="tab"]::after {
    content: "";
    position: absolute;
    inset-inline: 0.5rem;
    bottom: -1px;
    height: 2px;
    border-radius: var(--ui-radius-pill);
    background-color: transparent;
    transition: background-color var(--ui-dur-fast) var(--ui-ease-out);
    pointer-events: none;
  }
  :root[data-theme="modern"] .ui-underline-nav [role="tab"]:hover::after {
    background-color: var(--ui-line);
  }
  :root[data-theme="modern"] .ui-underline-nav [role="tab"][aria-selected="true"]::after {
    background-color: var(--ui-accent);
  }

  /* The app window, flat: the navigation column on the muted grey, the main column and the dock
     on the canvas, and the change of fill the whole edge between them — the shell tokens set no
     gap, corner, shadow or wash, so the recipe below (which still reads them, as the tokens may
     yet say otherwise) paints nothing but the two fills. A host's rule between the columns turns
     transparent. */
  :root[data-theme="modern"] .ui-shell {
    background-color: var(--ui-shell-field);
    background-image:
      radial-gradient(70% 60% at 0% 0%, var(--ui-shell-wash-1), transparent 70%),
      radial-gradient(60% 55% at 100% 100%, var(--ui-shell-wash-2), transparent 70%);
  }
  :root[data-theme="modern"] .ui-shell > [data-slot="nav"] {
    background-color: var(--ui-shell-nav-bg);
    border-color: var(--ui-shell-line);
  }
  :root[data-theme="modern"] .ui-shell > [data-slot="main"],
  :root[data-theme="modern"] .ui-shell > [data-slot="dock"] {
    margin: var(--ui-shell-gap);
    border-radius: var(--ui-shell-radius);
    border-color: var(--ui-shell-line);
    background-color: var(--ui-shell-main-bg);
    box-shadow: var(--ui-shell-shadow);
    overflow: clip;
  }
  :root[data-theme="modern"] .ui-shell > [data-slot="nav"] + [data-slot="main"],
  :root[data-theme="modern"] .ui-shell > [data-slot="main"] + [data-slot="dock"] {
    margin-inline-start: 0;
  }
  /* Decorative icons are drawn in the muted ink, as the reference's sidebar draws its glyphs —
     quiet, one colour, beside labels in the body ink; a menu row's icon keeps the row's own ink
     (a danger row's stays as red as its label). Ink only: no tinted chip behind an icon. */
  :root[data-theme="modern"] .ui-icon-decor:not([data-role="menu"]) {
    color: var(--ui-fg-muted);
  }

  /* Nested rows sit against a soft guide inside the host's own card: each row past its tree's
     first level indents on the tree tokens and draws a hairline down its parent's column — half
     an indent before its own content — and a branch continues its parent's guide alongside the
     rows it holds, so every ancestor's guide runs the whole way down. No elbows and no box of
     its own. The first level is the tree's base (theme.css): a file tree's roots sit at the
     inset, and a work group's steps, which hang off the header, sit flush with it — their
     icons in the header's icon column, no gutter and no guide, the card alone holding them. */
  :root[data-theme="modern"] .ui-tree [data-depth]:not([data-branch]) {
    position: relative;
    padding-inline-start: calc(
      var(--_lead) + var(--ui-tree-indent) * (var(--_depth) - var(--_base))
    );
  }
  :root[data-theme="modern"] .ui-tree [data-depth]:not([data-branch], [data-depth="0"])::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: calc(
      var(--_lead) + var(--ui-tree-indent) * (var(--_depth) - var(--_base) - 0.5)
    );
    border-inline-start: var(--ui-border-w) solid var(--ui-tree-guide);
    pointer-events: none;
  }
  :root[data-theme="modern"] .ui-tree [data-branch] {
    position: relative;
  }
  :root[data-theme="modern"]
    .ui-tree
    [data-branch]:not([data-depth="0"], [data-depth="1"])::before {
    content: "";
    position: absolute;
    inset-block: 0;
    inset-inline-start: calc(
      var(--_lead) + var(--ui-tree-indent) * (var(--_depth) - var(--_base) - 1.5)
    );
    border-inline-start: var(--ui-border-w) solid var(--ui-tree-guide);
    pointer-events: none;
  }
  /* In a tree that starts a level in, its first level has no parent column to draw on. */
  :root[data-theme="modern"] .ui-tree:not(:has([data-depth="0"])) [data-depth="1"]::before,
  :root[data-theme="modern"]
    .ui-tree:not(:has([data-depth="0"]))
    [data-branch][data-depth="2"]::before {
    content: none;
  }

  /* A labelled control row is a band in a grouped block, the way the reference lists its
     settings: the muted fill, the row's own padding, the label beside its control (the host's
     layout), the host's faint divider between rows, and the block's corners rounded on its first
     and last rows. Grouping by fill, not by border. */
  :root[data-theme="modern"] .ui-field {
    padding: var(--ui-row-py) var(--ui-row-px);
    background-color: var(--ui-surface-muted);
  }
  :root[data-theme="modern"] .ui-field:first-child {
    border-start-start-radius: var(--ui-radius-md);
    border-start-end-radius: var(--ui-radius-md);
  }
  :root[data-theme="modern"] .ui-field:last-child {
    border-end-start-radius: var(--ui-radius-md);
    border-end-end-radius: var(--ui-radius-md);
  }

  /* Work in progress is shown the way Codex and macOS show it: nothing around the row — no
     fill, no border, no ring, no halo (a first pass drew a luminous surface; the owner asked
     for the lineless version) — and a soft highlight in the accent's hue sweeping across the
     label, beside the host's own status mark. At rest (done, error) the row is the host's plain
     row, so a finished transcript adds nothing. The highlight is a gradient clipped to the
     label's glyphs and slid across them; parked at either end it shows only the ink, which is
     what reduced motion shows: a plain label. The slots are found anywhere inside the row (a
     card nests them in its own button); a work group's header shares the recipe with its rows. */
  :root[data-theme="modern"] .ui-activity[data-state="running"] [data-slot="label"] {
    color: var(--ui-fg);
    background-image: linear-gradient(
      90deg,
      currentColor 0 38%,
      var(--ui-accent) 50%,
      currentColor 62% 100%
    );
    background-size: 300% 100%;
    background-position: 100% 0;
    background-repeat: no-repeat;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: ui-frost-shimmer 2.8s var(--ui-ease-in-out) infinite;
  }
  @keyframes ui-frost-shimmer {
    from {
      background-position: 100% 0;
    }
    to {
      background-position: 0% 0;
    }
  }

  /* A reply still arriving surfaces through a soft veil, so the newest words read as fading in
     (the reveal paces them word by word): over the trailing three lines a gradient runs from
     nothing to the page's own colour at a little over half strength, above a faint glow in the
     accent's wash that fades out towards every edge — no line, no box, no band where the veil
     stops. The text moving up through it is the only motion; each line brightens as it leaves.
     The veil is the host's `::after`, drawn only while the stream's caret is the host's last
     child: the caret marks where the text ends, so what the host appends after it (a stop
     reason, a files card) is never veiled; the caret itself is not shown. On `done` — or once
     something follows the caret — the veil eases away over the reveal duration: the fade runs
     on opacity, and a discrete `step-end` transition holds the gradient until the fade is over,
     so the last lines settle into full ink instead of snapping. A reply that mounts finished
     carries only an empty, transparent layer. Under reduced motion the veil is not drawn. */
  :root[data-theme="modern"] .ui-stream {
    position: relative;
  }
  :root[data-theme="modern"] .ui-stream > [data-slot="caret"] {
    display: none;
  }
  :root[data-theme="modern"] .ui-stream::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-size: 100% 1.5lh;
    background-position: bottom;
    background-repeat: no-repeat;
    opacity: 0;
    transition:
      opacity var(--ui-dur-reveal) var(--ui-ease-out),
      background-image var(--ui-dur-reveal) step-end allow-discrete;
  }
  :root[data-theme="modern"]
    .ui-stream[data-state="streaming"]:has(> [data-slot="caret"]:last-child)::after {
    opacity: 1;
    background-image:
      linear-gradient(
        to bottom,
        transparent,
        color-mix(in srgb, var(--ui-canvas) 40%, transparent)
      ),
      radial-gradient(
        closest-side,
        color-mix(in srgb, var(--ui-overlay) 60%, transparent),
        transparent
      );
    transition: opacity var(--ui-dur-reveal) var(--ui-ease-out);
  }
  :root[data-theme="modern"][data-motion="reduced"] .ui-stream::after {
    display: none;
  }
  @media (prefers-reduced-motion: reduce) {
    :root[data-theme="modern"] .ui-stream::after {
      display: none;
    }
  }

  /* A notice is a soft card: the overlay surface under the overlay's shadow, no coloured border
     and no tinted fill — the tone is one small dot of its ink at the start (a toast is a button;
     the dot is its `::before`, which a button draws too). The dot sits out of the flow,
     absolutely at the row's inset with the host padded to make room, because a host lays its
     body and actions out as a flex row — a dot in the flow would be a third item and push the
     body to the middle. A toast that also carries `ui-glass` frosts like every other floating
     layer. */
  :root[data-theme="modern"] .ui-notice {
    position: relative;
    padding-inline-start: calc(var(--ui-row-px) + 1.125em);
    border-color: transparent;
    border-radius: var(--ui-radius-lg);
    background-color: var(--ui-overlay);
    box-shadow: var(--ui-shadow-overlay);
    color: var(--ui-fg);
  }
  /* The host's own leading mark gives way to the dot: two marks would say the same thing. */
  :root[data-theme="modern"] .ui-notice [data-slot="icon"] {
    display: none;
  }
  :root[data-theme="modern"] .ui-notice::before {
    content: "";
    position: absolute;
    inset-inline-start: var(--ui-row-px);
    top: 50%;
    width: 0.5em;
    height: 0.5em;
    margin-top: -0.25em;
    border-radius: var(--ui-radius-pill);
    background-color: var(--_tone-fg);
  }

  /* A notice laid edge to edge (a banner) is still a rounded card here, so it stands off the
     column's edges and whatever sits beside it instead of butting its corners against them. */
  :root[data-theme="modern"] .ui-notice[data-banner] {
    margin: calc(var(--ui-space-unit) * 2) calc(var(--ui-space-unit) * 3) 0;
  }

  /* Folds: the chevron sits right after the row's words rather than at its far edge; a tool row
     shows its inline chevron and drops the one at its end. */
  :root[data-theme="modern"] .ui-activity [data-slot="toggle"] {
    order: 0;
    display: flex;
  }
  :root[data-theme="modern"] .ui-activity [data-slot="toggle-end"] {
    display: none;
  }

  /* Charts: the chart primitives write everything a token can say — colours, widths, radii,
     opacities, the curve — so the recipe owns only what a token cannot: lines join and end
     round, a line's area fades to nothing towards the baseline (a mask, the one gradient a
     chart may paint), and a point wears a thin ring of the surface. */
  :root[data-theme="modern"] .ui-chart :is(path, polyline)[data-part="series"] {
    stroke-linejoin: round;
    stroke-linecap: round;
  }
  :root[data-theme="modern"] .ui-chart [data-part="area"] {
    -webkit-mask-image: linear-gradient(to bottom, #000000, transparent);
    mask-image: linear-gradient(to bottom, #000000, transparent);
  }
  :root[data-theme="modern"] .ui-chart [data-part="point"] {
    stroke: var(--ui-surface);
    stroke-width: 1.5;
  }

  /* MiSans ships Regular (400) and Medium (500) only. A heavier request renders in Medium rather
     than as a synthesized bold, which smears Han strokes; Frost's own weights stop at 500. */
  :root[data-theme="modern"] {
    font-synthesis-weight: none;
  }
}

/*
 * The user's accent presets (tokens.ts, `ACCENT_PRESETS.modern`): five warm, muted hues beside
 * Frost's own forest green, each deep enough in light for the theme's white label and lifted in
 * dark for its dark ink, the way the theme's own accent flips. A preset sets `--ui-accent` and
 * nothing else — hover, active, wash and line derive from it in the theme's rules above, and
 * the label ink is the theme's for the mode — so each preset is one value per mode. The
 * selectors match only Frost's root, so a preset another theme lists paints nothing here.
 */
@layer ui-accent {
  :root[data-theme="modern"][data-accent="ocean"] {
    --ui-accent: #3b6ea8;
  }
  :root[data-theme="modern"][data-accent="ocean"].dark {
    --ui-accent: #7fa9df;
  }
  :root[data-theme="modern"][data-accent="clay"] {
    --ui-accent: #b8552f;
  }
  :root[data-theme="modern"][data-accent="clay"].dark {
    --ui-accent: #e08a66;
  }
  :root[data-theme="modern"][data-accent="plum"] {
    --ui-accent: #7a4d8f;
  }
  :root[data-theme="modern"][data-accent="plum"].dark {
    --ui-accent: #b78fd0;
  }
  :root[data-theme="modern"][data-accent="honey"] {
    --ui-accent: #96660f;
  }
  :root[data-theme="modern"][data-accent="honey"].dark {
    --ui-accent: #d9ab4a;
  }
  :root[data-theme="modern"][data-accent="slate"] {
    --ui-accent: #5c6470;
  }
  :root[data-theme="modern"][data-accent="slate"].dark {
    --ui-accent: #9ea6b3;
  }
}