@layer tokens, base, ui, shell, surface;
/* Tokens: the original Geist app's fonts, variables and themes (geist_app/public/css fonts.css,
   variables.css, themes.css token blocks), unchanged. Everything else reads these. */
/* ============================================================================
   Interface faces (docs/archive/design-language.md §5.1). Self-hosted, all SIL OFL.
   Funnel Display: wordmark, headlines, window titles. Funnel Sans: interface.
   Instrument Serif: notes, documents, subheadings (never the Assistant).
   Red Hat Mono: run steps, ids, measurements. Linked before variables.css.
   ========================================================================== */
@font-face {
  font-family: "Funnel Display";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src:
    url("../fonts/funnel-display-latin-ext.woff2") format("woff2-variations"),
    url("../fonts/funnel-display-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA,
    U+02BD-02C5,
    U+02C7-02CC,
    U+02CE-02D7,
    U+02DD-02FF,
    U+0304,
    U+0308,
    U+0329,
    U+1D00-1DBF,
    U+1E00-1E9F,
    U+1EF2-1EFF,
    U+2020,
    U+20A0-20AB,
    U+20AD-20C0,
    U+2113,
    U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Funnel Display";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src:
    url("../fonts/funnel-display-latin.woff2") format("woff2-variations"),
    url("../fonts/funnel-display-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF,
    U+0131,
    U+0152-0153,
    U+02BB-02BC,
    U+02C6,
    U+02DA,
    U+02DC,
    U+0304,
    U+0308,
    U+0329,
    U+2000-206F,
    U+20AC,
    U+2122,
    U+2191,
    U+2193,
    U+2212,
    U+2215,
    U+FEFF,
    U+FFFD;
}
@font-face {
  font-family: "Funnel Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src:
    url("../fonts/funnel-sans-latin-ext.woff2") format("woff2-variations"),
    url("../fonts/funnel-sans-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA,
    U+02BD-02C5,
    U+02C7-02CC,
    U+02CE-02D7,
    U+02DD-02FF,
    U+0304,
    U+0308,
    U+0329,
    U+1D00-1DBF,
    U+1E00-1E9F,
    U+1EF2-1EFF,
    U+2020,
    U+20A0-20AB,
    U+20AD-20C0,
    U+2113,
    U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Funnel Sans";
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src:
    url("../fonts/funnel-sans-latin.woff2") format("woff2-variations"),
    url("../fonts/funnel-sans-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF,
    U+0131,
    U+0152-0153,
    U+02BB-02BC,
    U+02C6,
    U+02DA,
    U+02DC,
    U+0304,
    U+0308,
    U+0329,
    U+2000-206F,
    U+20AC,
    U+2122,
    U+2191,
    U+2193,
    U+2212,
    U+2215,
    U+FEFF,
    U+FFFD;
}
@font-face {
  font-family: "Funnel Sans";
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src:
    url("../fonts/funnel-sans-italic-latin-ext.woff2") format("woff2-variations"),
    url("../fonts/funnel-sans-italic-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA,
    U+02BD-02C5,
    U+02C7-02CC,
    U+02CE-02D7,
    U+02DD-02FF,
    U+0304,
    U+0308,
    U+0329,
    U+1D00-1DBF,
    U+1E00-1E9F,
    U+1EF2-1EFF,
    U+2020,
    U+20A0-20AB,
    U+20AD-20C0,
    U+2113,
    U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Funnel Sans";
  font-style: italic;
  font-weight: 300 800;
  font-display: swap;
  src:
    url("../fonts/funnel-sans-italic-latin.woff2") format("woff2-variations"),
    url("../fonts/funnel-sans-italic-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF,
    U+0131,
    U+0152-0153,
    U+02BB-02BC,
    U+02C6,
    U+02DA,
    U+02DC,
    U+0304,
    U+0308,
    U+0329,
    U+2000-206F,
    U+20AC,
    U+2122,
    U+2191,
    U+2193,
    U+2212,
    U+2215,
    U+FEFF,
    U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src:
    url("../fonts/instrument-serif-latin-ext.woff2") format("woff2"),
    url("../fonts/instrument-serif-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA,
    U+02BD-02C5,
    U+02C7-02CC,
    U+02CE-02D7,
    U+02DD-02FF,
    U+0304,
    U+0308,
    U+0329,
    U+1D00-1DBF,
    U+1E00-1E9F,
    U+1EF2-1EFF,
    U+2020,
    U+20A0-20AB,
    U+20AD-20C0,
    U+2113,
    U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src:
    url("../fonts/instrument-serif-latin.woff2") format("woff2"),
    url("../fonts/instrument-serif-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF,
    U+0131,
    U+0152-0153,
    U+02BB-02BC,
    U+02C6,
    U+02DA,
    U+02DC,
    U+0304,
    U+0308,
    U+0329,
    U+2000-206F,
    U+20AC,
    U+2122,
    U+2191,
    U+2193,
    U+2212,
    U+2215,
    U+FEFF,
    U+FFFD;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src:
    url("../fonts/instrument-serif-italic-latin-ext.woff2") format("woff2"),
    url("../fonts/instrument-serif-italic-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA,
    U+02BD-02C5,
    U+02C7-02CC,
    U+02CE-02D7,
    U+02DD-02FF,
    U+0304,
    U+0308,
    U+0329,
    U+1D00-1DBF,
    U+1E00-1E9F,
    U+1EF2-1EFF,
    U+2020,
    U+20A0-20AB,
    U+20AD-20C0,
    U+2113,
    U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Instrument Serif";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src:
    url("../fonts/instrument-serif-italic-latin.woff2") format("woff2"),
    url("../fonts/instrument-serif-italic-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF,
    U+0131,
    U+0152-0153,
    U+02BB-02BC,
    U+02C6,
    U+02DA,
    U+02DC,
    U+0304,
    U+0308,
    U+0329,
    U+2000-206F,
    U+20AC,
    U+2122,
    U+2191,
    U+2193,
    U+2212,
    U+2215,
    U+FEFF,
    U+FFFD;
}
@font-face {
  font-family: "Red Hat Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src:
    url("../fonts/red-hat-mono-400-latin-ext.woff2") format("woff2"),
    url("../fonts/red-hat-mono-400-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA,
    U+02BD-02C5,
    U+02C7-02CC,
    U+02CE-02D7,
    U+02DD-02FF,
    U+0304,
    U+0308,
    U+0329,
    U+1D00-1DBF,
    U+1E00-1E9F,
    U+1EF2-1EFF,
    U+2020,
    U+20A0-20AB,
    U+20AD-20C0,
    U+2113,
    U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Red Hat Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src:
    url("../fonts/red-hat-mono-400-latin.woff2") format("woff2"),
    url("../fonts/red-hat-mono-400-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF,
    U+0131,
    U+0152-0153,
    U+02BB-02BC,
    U+02C6,
    U+02DA,
    U+02DC,
    U+0304,
    U+0308,
    U+0329,
    U+2000-206F,
    U+20AC,
    U+2122,
    U+2191,
    U+2193,
    U+2212,
    U+2215,
    U+FEFF,
    U+FFFD;
}
@font-face {
  font-family: "Red Hat Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src:
    url("../fonts/red-hat-mono-500-latin-ext.woff2") format("woff2"),
    url("../fonts/red-hat-mono-500-latin-ext.woff2") format("woff2");
  unicode-range:
    U+0100-02BA,
    U+02BD-02C5,
    U+02C7-02CC,
    U+02CE-02D7,
    U+02DD-02FF,
    U+0304,
    U+0308,
    U+0329,
    U+1D00-1DBF,
    U+1E00-1E9F,
    U+1EF2-1EFF,
    U+2020,
    U+20A0-20AB,
    U+20AD-20C0,
    U+2113,
    U+2C60-2C7F,
    U+A720-A7FF;
}
@font-face {
  font-family: "Red Hat Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src:
    url("../fonts/red-hat-mono-500-latin.woff2") format("woff2"),
    url("../fonts/red-hat-mono-500-latin.woff2") format("woff2");
  unicode-range:
    U+0000-00FF,
    U+0131,
    U+0152-0153,
    U+02BB-02BC,
    U+02C6,
    U+02DA,
    U+02DC,
    U+0304,
    U+0308,
    U+0329,
    U+2000-206F,
    U+20AC,
    U+2122,
    U+2191,
    U+2193,
    U+2212,
    U+2215,
    U+FEFF,
    U+FFFD;
}

@layer tokens {
  /* ============================================================================
     Geist design tokens (docs/archive/design-language.md §4, docs/archive/theme-unification.md).
     Every visual property lives here. :root is solid Signal Dawn (what Reduce transparency shows);
     its glass and the other themes live in themes.css. Derived tokens follow.
     ========================================================================== */

  :root {
    /* ---- palette: solid Signal Dawn (themes.css holds its glass and the other themes) ----
       act (graphite) = the one thing to press, and "working"; measure (amber) = the system's own
       voice and "needs you"; danger = failure only. */
    --color-bg: #dde4ea; /* desk */
    --color-zone: var(--color-bg); /* desk-coloured zones inside a window (sidebars, wells) */
    /* Near-solid faces for panels that float over a window's content (a slid-over list, a draft
       composer): on glass the plain faces are see-through there (theme-surfaces.css, section 4). */
    --color-overlay: var(--color-surface);
    --color-overlay-raised: var(--color-surface-raised);
    /* A side list inside a face (the Assistant's chat list): a little lighter than the face. */
    --color-surface-side: color-mix(in srgb, var(--color-surface-raised) 55%, var(--color-surface));
    --color-bg-top: #cfd9e0; /* top of the desk */
    --color-surface: #eff0f2; /* face: windows, panels, popovers */
    --color-surface-top: #f6f7f8; /* top of a face */
    --color-surface-raised: #fdfdfe; /* lifted pills, cards */
    --color-ink: #141619;
    --color-ink-secondary: #45484b;
    --color-ink-faint: #5e6163;
    --color-accent-fill: #1a1d21; /* act */
    --color-accent-text: #344f6d;
    --color-on-accent: #ffffff;
    --color-measure: #935a00;
    --color-measure-text: #855006;
    --color-danger: #b23a2e;
    --color-danger-hover: #962f25;
    --color-on-danger: #ffffff;
    --color-shadow: rgba(41, 46, 52, 0.1);
    --color-shadow-strong: rgba(41, 46, 52, 0.26);
    --color-scrim: rgba(221, 228, 234, 0.72);
    --color-surface-overlay: rgba(14, 16, 19, 0.62);

    /* ---- derived (follow the theme) ----------------------------------------- */
    --color-border: color-mix(in srgb, var(--color-ink) 11%, transparent); /* layout lines */
    --color-border-soft: color-mix(in srgb, var(--color-ink) 7%, transparent); /* rows */
    --color-border-strong: color-mix(in srgb, var(--color-ink) 20%, transparent);
    --color-fill: color-mix(in srgb, var(--color-ink) 6%, transparent); /* inputs, tonal, hover */
    --color-fill-strong: color-mix(in srgb, var(--color-ink) 11%, transparent);
    --color-surface-sunken: color-mix(in srgb, var(--color-ink) 4%, transparent);
    --color-wash: color-mix(in srgb, var(--color-accent-fill) 13%, transparent); /* selection */
    --color-measure-wash: color-mix(in srgb, var(--color-measure) 14%, transparent);
    --color-danger-fill: color-mix(in srgb, var(--color-danger) 12%, transparent);
    --color-signal-empty: color-mix(in srgb, var(--color-ink) 18%, var(--color-surface));
    --color-focus-ring: color-mix(in srgb, var(--color-accent-fill) 40%, transparent);
    --color-focus-outline: var(--color-accent-fill);
    --focus-outline: 2px solid var(--color-focus-outline);
    --focus-offset: 2px;

    /* Ink on a raised surface (theme-unification.md §3.1): the face's ink unless a theme rebinds it. */
    --raised-ink: var(--color-ink);
    --raised-ink-secondary: var(--color-ink-secondary);
    --raised-ink-faint: var(--color-ink-faint);
    --raised-accent-text: var(--color-accent-text);
    --raised-fill: var(--color-fill);
    --raised-fill-strong: var(--color-fill-strong);
    --raised-border: var(--color-border);
    --raised-border-soft: var(--color-border-soft);
    --raised-accent-fill: var(--color-accent-fill);
    --raised-on-accent: var(--color-on-accent);
    --raised-grad-lit: var(--grad-lit);
    --raised-wash: var(--color-wash);
    --raised-measure-text: var(--color-measure-text);
    --raised-danger: var(--color-danger);
    /* Your message bubble. */
    --color-bubble: var(--color-ink);
    --color-on-bubble: var(--color-surface);

    /* ---- gradients: light and progress only (§4.2) --------------------------- */
    --grad-desk: linear-gradient(180deg, var(--color-bg-top), var(--color-bg));
    --grad-face: linear-gradient(180deg, var(--color-surface-top), var(--color-surface));
    --grad-lit: linear-gradient(
      180deg,
      color-mix(in srgb, var(--color-accent-fill) 86%, #fff),
      var(--color-accent-fill)
    );
    --grad-trace: linear-gradient(
      90deg,
      var(--color-measure),
      color-mix(in srgb, var(--color-measure) 45%, var(--color-accent-fill)) 70%,
      var(--color-accent-fill)
    );

    /* Dark stages (comp editor, phone keyboard) stay dark in every theme. */
    --stage-dark-surface: #151d19;
    --stage-dark-accent: #5cc7a6;

    /* ---- entity accents: muted so they sit on sage beside act ---- */
    --entity-card: #4f7396;
    --entity-highlight: #a8743a;
    --entity-view: #7a6a9a;
    --entity-app: #3f8577;
    --entity-table: #5e7a80;
    --entity-memory: #8e6480;
    --entity-comp: #a0606e;

    /* ---- tones and roles (docs/ui.md §2) -------------------------------------
       One sheet divided by lines. Desk: the Assistant column, the rail and the drawer. Sheet: the
       tabs, where work is shown (solid even in glass themes). Raised: what you act on (results,
       tiles, the composer, the active tab, floating layers). Sunk: wells. */
    --tone-desk: var(--color-bg);
    --tone-sheet: var(--color-overlay);
    --tone-raised: var(--color-surface-raised);
    --tone-sunk: var(--color-surface-sunken);
    --tone-floating: var(--color-overlay-raised);
    --role-act: var(--color-accent-fill);
    --role-wash: var(--color-wash);
    --role-measure: var(--color-measure);
    --role-danger: var(--color-danger);

    /* ---- fixed paints: the same in every theme (§2.2) ----------------------------
       Media sits on black with white controls; an app's page and an email are authored on white;
       scrims over media are black at a strength. */
    --paint-white: #ffffff;
    --paint-black: #000000;
    --media-stage: var(--paint-black);
    --media-ink: var(--paint-white);
    --app-page: var(--paint-white);
    --app-checker: #e6e6e6;
    --paper-ink: #111111;
    --mail-page: var(--paint-white);
    --mail-ink: #202124;
    --mail-ink-secondary: #5f6368;
    --edit-select: rgb(59, 130, 246);
    --edit-select-alt: rgb(94, 169, 80);
    --docx-mark: #e4572e;
    --guide-listen: #2a8f94;
    --guide-listen-ink: #1f7479;

    /* ---- kind hues: a node kind tints its glyph and pill dot, never a fill (§2.3) ---- */
    --kind-note: #4f7396;
    --kind-folder: #5a7086;
    --kind-project: #6e62a3;
    --kind-table: #4f7c84;
    --kind-canvas: #a0606e;
    --kind-person: #8e6480;
    --kind-reminder: #9a6a2a;
    --kind-mail: #4a6aa0;
    --kind-app: #2f7f6c;
    --kind-library: #7a6a3e;
    --kind-community: #5d6b64;
    --kind-chat: var(--color-ink-secondary);

    /* ---- typography -------------------------------------------------------- */
    /* Faces in fonts.css (§5.1). Display: titles only. Sans: all interface text. Mono: metadata.
       Serif: document bodies, never in the Assistant. Seven sizes, nothing under 11px. */
    --font-sans: "Funnel Sans", ui-sans-serif, system-ui, sans-serif;
    --font-display: "Funnel Display", var(--font-sans);
    --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
    --font-mono: "Red Hat Mono", ui-monospace, Menlo, monospace;
    --type-11: 0.6875rem;
    --type-12: 0.75rem;
    --type-13: 0.8125rem;
    --type-14: 0.875rem; /* base */
    --type-16: 1rem;
    --type-22: 1.375rem;
    --type-32: 2rem;
    --text-xs: var(--type-11);
    --text-sm: var(--type-13);
    --text-md: var(--type-14);
    --text-lg: var(--type-16);
    --text-xl: var(--type-22);
    --text-2xl: var(--type-32);
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
    --weight-title: 500; /* window titles */
    --weight-heading: 600; /* headings inside windows */
    --leading-tight: 1.25;
    --leading-normal: 1.5;
    --tracking-wide: 0.04em;

    /* ---- spacing ------------------------------------------------------------ */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --space-8: 64px;
    --space-panel-gap: 16px; /* gap keeping floating panels off edges */
    --space-4h: 20px;

    /* ---- heights (§2.5) --------------------------------------------------------- */
    --h-control: 32px;
    --h-control-sm: 26px;
    --h-field: 34px;
    --h-row: 36px;
    --h-bar: 52px; /* the tab bar and the panel header */
    --h-touch: 44px;
    --w-rail: 56px;

    /* ---- radius (docs/ui.md §2.6): soft. 6 rows and pills, 10 holds, 14 floating, a full
       pill for anything pressed or typed into. Millennium and Retro keep their own corners. -- */
    --radius-row: 6px;
    --radius-hold: 10px; /* cards, tiles, results, tables, assistant output */
    --radius-window: 14px; /* the old shell's windows */
    --radius-window-top: var(--radius-window); /* a theme may round a window's top only */
    --radius-window-bottom: var(--radius-window);
    --radius-popover: 14px; /* popovers, menus, dialogs, toasts, floating toolbars */
    --radius-media: 8px; /* thumbnails and media inside a card */
    --radius-inner: 6px; /* rows, swatches and small holds nested in a card */
    --radius-pill: 999px; /* buttons, inputs, chips, tabs, toggles, avatars */
    --radius-bubble: 18px; /* your multi-line messages */
    --radius-bar: 25px; /* the task bar (square when docked) */

    /* ---- line, material, icon, shell ------------------------------------------ */
    --line-width: 1px;
    --window-edge: var(--color-border);
    --window-edge-active: var(--color-border-strong);
    /* A window's title strip (the header row): transparent unless a theme paints it. */
    --window-title-paint: transparent;
    --window-title-paint-active: var(--window-title-paint);
    --material-blur: 20px; /* backdrop blur behind faces; only glass themes pay for it */
    --material-sat: 1.5;
    --face-sheen: none; /* light along a glass face's top edge */
    --icon-stroke: 1.6;
    --icon-cap: round;
    --icon-join: round;
    --field-paint: var(--color-fill); /* text inputs */
    --field-shadow: none; /* e.g. a sunken bevel */
    --bar-float: 8px; /* gap between the task bar and the screen edges (0 = docked) */
    --bar-paint: var(--grad-face);
    --bar-ring: var(--window-edge);
    --bar-edge: transparent; /* the docked bar's top rule */
    --bar-shadow: var(--shadow-window);

    /* ---- elevation ------------------------------------------------------------ */
    --shadow-lift: 0 1px 2px var(--color-shadow), 0 3px 10px var(--color-shadow);
    --shadow-lift-hover: 0 2px 4px var(--color-shadow), 0 8px 18px var(--color-shadow);
    --shadow-window: 0 8px 24px var(--color-shadow);
    --shadow-window-focus: 0 12px 34px var(--color-shadow);
    --shadow-pop: 0 18px 48px var(--color-shadow-strong);

    /* ---- borders ---------------------------------------------------------------- */
    --border-hairline: var(--line-width) solid var(--color-border);
    --border-strong: var(--line-width) solid var(--color-border-strong);

    /* ---- z-index scale ----------------------------------------------------------- */
    --z-canvas: 0;
    --z-floating: 10; /* toolbar, chat, collapsed orbs */
    --z-panel: 20; /* expanded panels */
    --z-overlay: 30; /* auth gate, modals */
    --z-popover: 35; /* dropdowns, anchored menus (above modals) */
    --z-toast: 40;
    --z-fullscreen: 100; /* an embed filling its own page */
    --z-top: 1000; /* drag ghosts, menus opened from inside a dialog, the boot splash */
    --z-hovercard: 10000; /* a pill's hover card: above everything in the page */
    /* Values inside one component's own stacking context (1–9, the canvas item layers, map
       controls placed against Leaflet's panes) stay plain numbers: they order siblings, not
       layers of the page. Documents without this sheet (app frames, app-embed.css) do too. */

    /* ---- motion --------------------------------------------------------------------- */
    --ease: cubic-bezier(0.32, 0.72, 0.24, 1);
    --ease-enter: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-exit: cubic-bezier(0.4, 0, 1, 1);
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-press: cubic-bezier(0.32, 0.72, 0.24, 1); /* press and hover feedback */
    --dur-instant: 80ms;
    --dur-fast: 120ms;
    --dur-control: 160ms;
    --dur-overlay-out: 170ms;
    --dur-med: 240ms;
    --dur-layout: 280ms;
    --dur-slow: 360ms;
    --dur-panel: 440ms;
    --dur-window: 420ms;
    --dur-press: 120ms;
    --rise: 14px;
    --press-scale: 0.95; /* pressed controls */
    --hover-lift: -1px; /* raised things on hover */
    --open-rise: var(--rise); /* windows and popovers arriving */
    --open-scale: 0.985;
    --open-blur: 0px;
    --pop-scale: 0.98;
    --stagger: 20ms;
    --dur-theme: 360ms; /* the cross-fade when the theme changes */

    /* ---- component sizes -------------------------------------------------------------- */
    --orb-size: 44px;
    --icon-size: 20px;
    --toolbar-height: 44px;
    --control-height: 32px;
    --control-height-compact: 24px;
    --control-height-comfortable: 40px;
    --touch-target: 44px;
    --tool-control-size: 32px;
    --chat-height: 48px;
    /* desktop: the chat column is ~1/3 of the viewport */
    --panel-col-width: calc((100vw - 3 * var(--space-panel-gap)) / 3);
    /* top of the free area under the orb/toolbar row */
    --chrome-top: calc(var(--space-panel-gap) + var(--orb-size) + var(--space-2));
  }

  /* Phones keep the language they were redesigned in (docs/ui.md: desktop and tablet only): the
     type and corner steps from before the v2 scales. A theme that reshapes corners still wins. */
  :root[data-form="phone"] {
    --text-md: 0.9375rem;
    --text-lg: 1.125rem;
    --text-xl: 1.5rem;
    --radius-hold: 18px;
    --radius-window: 26px;
    --radius-popover: 22px;
    --radius-media: 12px;
    --radius-inner: 10px;
    --radius-bubble: 24px;
    --h-field: var(--control-height);
  }

  /* Coarse pointers (phones / tablets): taller default controls so buttons,
     selects and inputs land nearer the 44px touch floor. */
  @media (hover: none), (pointer: coarse) {
    :root {
      --control-height: var(--touch-target);
      --control-height-compact: var(--touch-target);
      --control-height-comfortable: var(--touch-target);
      --tool-control-size: var(--touch-target);
    }
  }

  /* The dark hours (Dusk, Night) take the dark kind and entity hues (a card pill kept the light
     blue on the dark panel, Fernwood QA). */
  html[data-scheme="dark"] {
    --entity-card: #8fb0cf;
    --entity-highlight: #d6a870;
    --entity-view: #b0a2cf;
    --entity-app: #74c2b0;
    --entity-table: #9db6bb;
    --entity-memory: #c79dbb;
    --entity-comp: #d8949f;
    --kind-note: #8fb0cf;
    --kind-folder: #9fb2c4;
    --kind-project: #b0a6e0;
    --kind-table: #8fbcc4;
    --kind-canvas: #d8949f;
    --kind-person: #c79dbb;
    --kind-reminder: #dcae6a;
    --kind-mail: #93aee0;
    --kind-app: #74c2b0;
    --kind-library: #c8b67e;
    --kind-community: #a6b5ad;
  }

  @media (forced-colors: active) {
    :root {
      --color-focus-outline: Highlight;
    }
  }

  /* ============================================================================
     Themes (docs/archive/theme-unification.md). Solid Signal Dawn is :root in variables.css; Signal
     Dawn's glass and every other theme live here. A theme block only sets
     tokens: paint, shape, material, line, weight, icon, motion. Derived tokens in variables.css
     (borders, fills, washes) follow automatically. Shape (round holds, the floating bar) is shared
     in :root; Millennium and Retro reshape it.
     ========================================================================== */

  /* ---- Orbit and Signal, four hours each ------------------------------------------------------
     One hue per family in shades, its gradients within ~40° of hue. Light hours (Dawn, Day) are
     frosted glass over the desk; dark hours (Dusk, Night) are dark glass. Signal Dawn is the default
     (the absent data-theme); without glass (Reduce transparency) each paints the solid faces below.
     Generated values: OKLCH ramps from the Line and Fold buffet, laid out like the old Sky and Dusk. */

  /* ---- Signal Dawn (default): steel washed with first light, frosted glass --------------------- */
  :root:not([data-theme]) {
    color-scheme: light;

    --color-bg: #dde4ea;
    --color-bg-top: #cfd9e0;
    --color-zone: rgba(30, 34, 39, 0.06);
    --grad-desk: radial-gradient(120% 60% at 18% 18%, rgba(255, 255, 255, 0.3), transparent 55%),
      linear-gradient(180deg, #cfd9e0 0%, #d8e0e7 33.3%, #e1e8ee 66.7%, #eaeff4 100%);
    --color-surface: rgba(245, 247, 248, 0.55);
    --color-surface-top: rgba(251, 252, 253, 0.66);
    --grad-face: linear-gradient(180deg, rgba(249, 250, 251, 0.68), rgba(239, 240, 242, 0.56));
    --color-surface-raised: rgba(255, 255, 255, 0.74);
    --color-overlay: rgba(244, 245, 247, 0.97);
    --color-overlay-raised: rgba(255, 255, 255, 0.97);
    --color-ink: #141619;
    --color-ink-secondary: #45484b;
    --color-ink-faint: #5e6163;
    --color-accent-fill: #1a1d21;
    --color-accent-text: #344f6d;
    --color-on-accent: #ffffff;
    --grad-lit: linear-gradient(180deg, #32363a, #1a1d21);
    --color-wash: rgba(52, 79, 109, 0.12);
    --color-focus-outline: #344f6d;
    --color-measure: #935a00;
    --color-measure-text: #855006;
    --color-border: rgba(31, 34, 38, 0.1);
    --color-border-soft: rgba(31, 34, 38, 0.07);
    --color-border-strong: rgba(31, 34, 38, 0.18);
    --color-fill: rgba(31, 34, 38, 0.06);
    --color-fill-strong: rgba(31, 34, 38, 0.1);
    --color-shadow: rgba(41, 46, 52, 0.1);
    --color-shadow-strong: rgba(41, 46, 52, 0.26);
    --color-scrim: rgba(81, 86, 91, 0.28);
    --color-bubble: rgba(29, 32, 35, 0.9);
    --color-on-bubble: #f4f5f6;
    --shadow-lift: 0 1px 1px rgba(41, 46, 52, 0.05), 0 6px 18px rgba(41, 46, 52, 0.1);
    --shadow-lift-hover: 0 2px 4px rgba(41, 46, 52, 0.07), 0 12px 28px rgba(41, 46, 52, 0.14);
    --shadow-window: 0 24px 60px rgba(41, 46, 52, 0.16);
    --shadow-window-focus: 0 30px 70px rgba(41, 46, 52, 0.24);
    --shadow-pop: 0 30px 80px rgba(41, 46, 52, 0.3);
    --material-sat: 1.2;
    --face-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 90px);
    --window-edge: rgba(255, 255, 255, 0.6);
    --window-edge-active: rgba(255, 255, 255, 0.95);
    --bar-ring: rgba(255, 255, 255, 0.6);
    --logo-ink: #25292e;
    --logo-act: #344f6d;
    --logo-badge: #1a1d21;
    --logo-badge-ink: #ffffff;

    --weight-title: 500;
    --weight-heading: 500;
    --icon-stroke: 1.4;

    /* Springy: a light overshoot, deeper press, small lift. */
    --ease-enter: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-spring: linear(0, 0.22 8%, 0.58 18%, 0.9 30%, 1.05 42%, 1.07 50%, 1.03 62%, 0.995 78%, 1);
    --ease-press: linear(0, 0.3 10%, 0.75 25%, 1.06 45%, 1.04 60%, 1);
    --dur-press: 200ms;
    --dur-control: 180ms;
    --dur-med: 340ms;
    --dur-window: 520ms;
    --press-scale: 0.93;
    --hover-lift: -2px;
    --open-rise: 18px;
    --open-scale: 0.94;
    --pop-scale: 0.9;
    --stagger: 45ms;
  }

  /* ---- Signal Day: almost white steel, frosted glass ------------------------------------------- */
  :root[data-theme="signal-day"] {
    color-scheme: light;

    --color-bg: #f5f8fb;
    --color-bg-top: #f0f4f7;
    --color-zone: rgba(30, 34, 39, 0.06);
    --grad-desk: radial-gradient(120% 60% at 18% 18%, rgba(255, 255, 255, 0.3), transparent 55%),
      linear-gradient(180deg, #f0f4f7 0%, #f4f7fa 33.3%, #f7f9fc 66.7%, #fafcfe 100%);
    --color-surface: rgba(245, 247, 248, 0.55);
    --color-surface-top: rgba(251, 252, 253, 0.66);
    --grad-face: linear-gradient(180deg, rgba(249, 250, 251, 0.68), rgba(239, 240, 242, 0.56));
    --color-surface-raised: rgba(255, 255, 255, 0.74);
    --color-overlay: rgba(244, 245, 247, 0.97);
    --color-overlay-raised: rgba(255, 255, 255, 0.97);
    --color-ink: #141619;
    --color-ink-secondary: #45484b;
    --color-ink-faint: #5e6163;
    --color-accent-fill: #1a1d21;
    --color-accent-text: #344f6d;
    --color-on-accent: #ffffff;
    --grad-lit: linear-gradient(180deg, #32363a, #1a1d21);
    --color-wash: rgba(52, 79, 109, 0.12);
    --color-focus-outline: #344f6d;
    --color-measure: #935a00;
    --color-measure-text: #855006;
    --color-border: rgba(31, 34, 38, 0.1);
    --color-border-soft: rgba(31, 34, 38, 0.07);
    --color-border-strong: rgba(31, 34, 38, 0.18);
    --color-fill: rgba(31, 34, 38, 0.06);
    --color-fill-strong: rgba(31, 34, 38, 0.1);
    --color-shadow: rgba(41, 46, 52, 0.1);
    --color-shadow-strong: rgba(41, 46, 52, 0.26);
    --color-scrim: rgba(81, 86, 91, 0.28);
    --color-bubble: rgba(29, 32, 35, 0.9);
    --color-on-bubble: #f4f5f6;
    --shadow-lift: 0 1px 1px rgba(41, 46, 52, 0.05), 0 6px 18px rgba(41, 46, 52, 0.1);
    --shadow-lift-hover: 0 2px 4px rgba(41, 46, 52, 0.07), 0 12px 28px rgba(41, 46, 52, 0.14);
    --shadow-window: 0 24px 60px rgba(41, 46, 52, 0.16);
    --shadow-window-focus: 0 30px 70px rgba(41, 46, 52, 0.24);
    --shadow-pop: 0 30px 80px rgba(41, 46, 52, 0.3);
    --material-sat: 1.2;
    --face-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 90px);
    --window-edge: rgba(255, 255, 255, 0.6);
    --window-edge-active: rgba(255, 255, 255, 0.95);
    --bar-ring: rgba(255, 255, 255, 0.6);
    --logo-ink: #25292e;
    --logo-act: #344f6d;
    --logo-badge: #1a1d21;
    --logo-badge-ink: #ffffff;

    --weight-title: 500;
    --weight-heading: 500;
    --icon-stroke: 1.4;

    /* Springy: a light overshoot, deeper press, small lift. */
    --ease-enter: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-spring: linear(0, 0.22 8%, 0.58 18%, 0.9 30%, 1.05 42%, 1.07 50%, 1.03 62%, 0.995 78%, 1);
    --ease-press: linear(0, 0.3 10%, 0.75 25%, 1.06 45%, 1.04 60%, 1);
    --dur-press: 200ms;
    --dur-control: 180ms;
    --dur-med: 340ms;
    --dur-window: 520ms;
    --press-scale: 0.93;
    --hover-lift: -2px;
    --open-rise: 18px;
    --open-scale: 0.94;
    --pop-scale: 0.9;
    --stagger: 45ms;
  }

  /* ---- Signal Dusk: graphite rising into slate, dark glass ------------------------------------- */
  :root[data-theme="signal-dusk"] {
    color-scheme: dark;

    --color-bg: #565e68;
    --color-bg-top: #3d434d;
    --color-zone: rgba(255, 255, 255, 0.05);
    --color-surface-side: rgba(255, 255, 255, 0.06);
    --grad-desk: radial-gradient(110% 55% at 70% 14%, rgba(128, 135, 144, 0.28), transparent 60%),
      linear-gradient(180deg, #3d434d 0%, #4e555f 33.3%, #5f6872 66.7%, #727c85 100%);
    --color-surface: rgba(27, 32, 36, 0.5);
    --color-surface-top: rgba(37, 41, 46, 0.6);
    --grad-face: linear-gradient(180deg, rgba(37, 41, 46, 0.62), rgba(25, 29, 34, 0.52));
    --color-surface-raised: rgba(67, 72, 78, 0.72);
    --color-overlay: rgba(32, 37, 41, 0.97);
    --color-overlay-raised: rgba(54, 59, 64, 0.98);
    --color-ink: #f4f5f6;
    --color-ink-secondary: #cfd1d3;
    --color-ink-faint: #afb1b3;
    --color-accent-fill: #e3e5e7;
    --color-accent-text: #cad9eb;
    --color-on-accent: #1c2024;
    --grad-lit: linear-gradient(180deg, #edeef0, #d2d4d7);
    --color-wash: rgba(255, 255, 255, 0.14);
    --color-focus-outline: #cad9eb;
    --color-measure: #f4b768;
    --color-measure-text: #f9c37a;
    --color-danger: #f2806f;
    --color-danger-hover: #f79a8b;
    --color-on-danger: #1f0b08;
    --color-border: rgba(255, 255, 255, 0.12);
    --color-border-soft: rgba(255, 255, 255, 0.07);
    --color-border-strong: rgba(255, 255, 255, 0.22);
    --color-fill: rgba(255, 255, 255, 0.09);
    --color-fill-strong: rgba(255, 255, 255, 0.15);
    --color-shadow: rgba(4, 6, 9, 0.3);
    --color-shadow-strong: rgba(4, 6, 9, 0.5);
    --color-scrim: rgba(7, 9, 13, 0.45);
    --color-surface-overlay: rgba(4, 6, 9, 0.72);
    --color-bubble: rgba(67, 72, 78, 0.8);
    --color-on-bubble: #f4f5f6;
    --shadow-lift: 0 8px 22px rgba(4, 6, 9, 0.22);
    --shadow-lift-hover: 0 12px 30px rgba(4, 6, 9, 0.3);
    --shadow-window: 0 24px 60px rgba(4, 6, 9, 0.3);
    --shadow-window-focus: 0 30px 70px rgba(4, 6, 9, 0.42);
    --shadow-pop: 0 30px 80px rgba(4, 6, 9, 0.5);
    --material-sat: 1.2;
    --face-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 90px);
    --window-edge: rgba(255, 255, 255, 0.12);
    --window-edge-active: rgba(255, 255, 255, 0.26);
    --bar-ring: rgba(255, 255, 255, 0.14);
    --logo-ink: #e7e8e9;
    --logo-act: #cad9eb;
    --logo-badge: #565e68;
    --logo-badge-ink: #f4f5f6;

    --weight-title: 500;
    --weight-heading: 500;
    --icon-stroke: 1.4;

    /* Glide: long, smooth, no overshoot; things arrive out of a soft blur. */
    --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-press: 200ms;
    --dur-control: 220ms;
    --dur-med: 420ms;
    --dur-window: 620ms;
    --press-scale: 0.96;
    --hover-lift: -1px;
    --open-rise: 10px;
    --open-blur: 12px;
    --pop-scale: 0.96;
    --stagger: 70ms;
  }

  /* ---- Signal Night: near-black graphite, dark glass ------------------------------------------- */
  :root[data-theme="signal-night"] {
    color-scheme: dark;

    --color-bg: #0d1218;
    --color-bg-top: #06090e;
    --color-zone: rgba(255, 255, 255, 0.05);
    --color-surface-side: rgba(255, 255, 255, 0.06);
    --grad-desk: radial-gradient(110% 55% at 70% 14%, rgba(128, 135, 144, 0.28), transparent 60%),
      linear-gradient(180deg, #06090e 0%, #0b0f14 33.3%, #10151b 66.7%, #151b22 100%);
    --color-surface: rgba(27, 32, 36, 0.5);
    --color-surface-top: rgba(37, 41, 46, 0.6);
    --grad-face: linear-gradient(180deg, rgba(37, 41, 46, 0.62), rgba(25, 29, 34, 0.52));
    --color-surface-raised: rgba(67, 72, 78, 0.72);
    --color-overlay: rgba(32, 37, 41, 0.97);
    --color-overlay-raised: rgba(54, 59, 64, 0.98);
    --color-ink: #f4f5f6;
    --color-ink-secondary: #cfd1d3;
    --color-ink-faint: #afb1b3;
    --color-accent-fill: #e3e5e7;
    --color-accent-text: #cad9eb;
    --color-on-accent: #1c2024;
    --grad-lit: linear-gradient(180deg, #edeef0, #d2d4d7);
    --color-wash: rgba(255, 255, 255, 0.14);
    --color-focus-outline: #cad9eb;
    --color-measure: #f4b768;
    --color-measure-text: #f9c37a;
    --color-danger: #f2806f;
    --color-danger-hover: #f79a8b;
    --color-on-danger: #1f0b08;
    --color-border: rgba(255, 255, 255, 0.12);
    --color-border-soft: rgba(255, 255, 255, 0.07);
    --color-border-strong: rgba(255, 255, 255, 0.22);
    --color-fill: rgba(255, 255, 255, 0.09);
    --color-fill-strong: rgba(255, 255, 255, 0.15);
    --color-shadow: rgba(4, 6, 9, 0.3);
    --color-shadow-strong: rgba(4, 6, 9, 0.5);
    --color-scrim: rgba(7, 9, 13, 0.45);
    --color-surface-overlay: rgba(4, 6, 9, 0.72);
    --color-bubble: rgba(67, 72, 78, 0.8);
    --color-on-bubble: #f4f5f6;
    --shadow-lift: 0 8px 22px rgba(4, 6, 9, 0.22);
    --shadow-lift-hover: 0 12px 30px rgba(4, 6, 9, 0.3);
    --shadow-window: 0 24px 60px rgba(4, 6, 9, 0.3);
    --shadow-window-focus: 0 30px 70px rgba(4, 6, 9, 0.42);
    --shadow-pop: 0 30px 80px rgba(4, 6, 9, 0.5);
    --material-sat: 1.2;
    --face-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 90px);
    --window-edge: rgba(255, 255, 255, 0.12);
    --window-edge-active: rgba(255, 255, 255, 0.26);
    --bar-ring: rgba(255, 255, 255, 0.14);
    --logo-ink: #e7e8e9;
    --logo-act: #cad9eb;
    --logo-badge: #0d1218;
    --logo-badge-ink: #f4f5f6;

    --weight-title: 500;
    --weight-heading: 500;
    --icon-stroke: 1.4;

    /* Glide: long, smooth, no overshoot; things arrive out of a soft blur. */
    --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-press: 200ms;
    --dur-control: 220ms;
    --dur-med: 420ms;
    --dur-window: 620ms;
    --press-scale: 0.96;
    --hover-lift: -1px;
    --open-rise: 10px;
    --open-blur: 12px;
    --pop-scale: 0.96;
    --stagger: 70ms;
  }

  /* ---- Orbit Dawn: cobalt sky with light rising from below, frosted glass ---------------------- */
  :root[data-theme="orbit-dawn"] {
    color-scheme: light;

    --color-bg: #9bbeff;
    --color-bg-top: #7485da;
    --color-zone: rgba(12, 30, 74, 0.06);
    --grad-desk: radial-gradient(120% 60% at 18% 18%, rgba(255, 255, 255, 0.3), transparent 55%),
      radial-gradient(130% 95% at 50% 100%, #d8eafe 0%, #c2dcfe 16.7%, #aecdfd 33.3%, #9bbeff 50%, #8cabf3 66.7%, #7f98e7 83.3%, #7485da 100%);
    --color-surface: rgba(243, 247, 255, 0.55);
    --color-surface-top: rgba(250, 252, 255, 0.66);
    --grad-face: linear-gradient(180deg, rgba(248, 250, 255, 0.68), rgba(233, 240, 254, 0.56));
    --color-surface-raised: rgba(255, 255, 255, 0.74);
    --color-overlay: rgba(240, 245, 255, 0.97);
    --color-overlay-raised: rgba(255, 255, 255, 0.97);
    --color-ink: #0a152d;
    --color-ink-secondary: #3a4764;
    --color-ink-faint: #546179;
    --color-accent-fill: #0c1b3c;
    --color-accent-text: #2751b8;
    --color-on-accent: #ffffff;
    --grad-lit: linear-gradient(180deg, #233458, #0c1b3c);
    --color-wash: rgba(39, 81, 184, 0.12);
    --color-focus-outline: #2751b8;
    --color-measure: #935a00;
    --color-measure-text: #855006;
    --color-border: rgba(16, 32, 66, 0.1);
    --color-border-soft: rgba(16, 32, 66, 0.07);
    --color-border-strong: rgba(16, 32, 66, 0.18);
    --color-fill: rgba(16, 32, 66, 0.06);
    --color-fill-strong: rgba(16, 32, 66, 0.1);
    --color-shadow: rgba(18, 41, 96, 0.1);
    --color-shadow-strong: rgba(18, 41, 96, 0.26);
    --color-scrim: rgba(61, 84, 133, 0.28);
    --color-bubble: rgba(16, 30, 59, 0.9);
    --color-on-bubble: #f2f5fc;
    --shadow-lift: 0 1px 1px rgba(18, 41, 96, 0.05), 0 6px 18px rgba(18, 41, 96, 0.1);
    --shadow-lift-hover: 0 2px 4px rgba(18, 41, 96, 0.07), 0 12px 28px rgba(18, 41, 96, 0.14);
    --shadow-window: 0 24px 60px rgba(18, 41, 96, 0.16);
    --shadow-window-focus: 0 30px 70px rgba(18, 41, 96, 0.24);
    --shadow-pop: 0 30px 80px rgba(18, 41, 96, 0.3);
    --material-sat: 1.6;
    --face-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 90px);
    --window-edge: rgba(255, 255, 255, 0.6);
    --window-edge-active: rgba(255, 255, 255, 0.95);
    --bar-ring: rgba(255, 255, 255, 0.6);
    --logo-ink: #122652;
    --logo-act: #2751b8;
    --logo-badge: #0c1b3c;
    --logo-badge-ink: #ffffff;

    --weight-title: 500;
    --weight-heading: 500;
    --icon-stroke: 1.4;

    /* Springy: a light overshoot, deeper press, small lift. */
    --ease-enter: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-spring: linear(0, 0.22 8%, 0.58 18%, 0.9 30%, 1.05 42%, 1.07 50%, 1.03 62%, 0.995 78%, 1);
    --ease-press: linear(0, 0.3 10%, 0.75 25%, 1.06 45%, 1.04 60%, 1);
    --dur-press: 200ms;
    --dur-control: 180ms;
    --dur-med: 340ms;
    --dur-window: 520ms;
    --press-scale: 0.93;
    --hover-lift: -2px;
    --open-rise: 18px;
    --open-scale: 0.94;
    --pop-scale: 0.9;
    --stagger: 45ms;
  }

  /* ---- Orbit Day: frost-blue sky, frosted glass ------------------------------------------------ */
  :root[data-theme="orbit-day"] {
    color-scheme: light;

    --color-bg: #e1ecff;
    --color-bg-top: #c7d7fd;
    --color-zone: rgba(12, 30, 74, 0.06);
    --grad-desk: radial-gradient(120% 60% at 18% 18%, rgba(255, 255, 255, 0.3), transparent 55%),
      radial-gradient(140% 110% at 50% 110%, #f7faff 0%, #eff6ff 20%, #e8f1fe 40%, #e1ecff 60%, #d8e5ff 73.3%, #cfdefd 86.7%, #c7d7fd 100%);
    --color-surface: rgba(243, 247, 255, 0.55);
    --color-surface-top: rgba(250, 252, 255, 0.66);
    --grad-face: linear-gradient(180deg, rgba(248, 250, 255, 0.68), rgba(233, 240, 254, 0.56));
    --color-surface-raised: rgba(255, 255, 255, 0.74);
    --color-overlay: rgba(240, 245, 255, 0.97);
    --color-overlay-raised: rgba(255, 255, 255, 0.97);
    --color-ink: #0a152d;
    --color-ink-secondary: #3a4764;
    --color-ink-faint: #546179;
    --color-accent-fill: #0c1b3c;
    --color-accent-text: #2751b8;
    --color-on-accent: #ffffff;
    --grad-lit: linear-gradient(180deg, #233458, #0c1b3c);
    --color-wash: rgba(39, 81, 184, 0.12);
    --color-focus-outline: #2751b8;
    --color-measure: #935a00;
    --color-measure-text: #855006;
    --color-border: rgba(16, 32, 66, 0.1);
    --color-border-soft: rgba(16, 32, 66, 0.07);
    --color-border-strong: rgba(16, 32, 66, 0.18);
    --color-fill: rgba(16, 32, 66, 0.06);
    --color-fill-strong: rgba(16, 32, 66, 0.1);
    --color-shadow: rgba(18, 41, 96, 0.1);
    --color-shadow-strong: rgba(18, 41, 96, 0.26);
    --color-scrim: rgba(61, 84, 133, 0.28);
    --color-bubble: rgba(16, 30, 59, 0.9);
    --color-on-bubble: #f2f5fc;
    --shadow-lift: 0 1px 1px rgba(18, 41, 96, 0.05), 0 6px 18px rgba(18, 41, 96, 0.1);
    --shadow-lift-hover: 0 2px 4px rgba(18, 41, 96, 0.07), 0 12px 28px rgba(18, 41, 96, 0.14);
    --shadow-window: 0 24px 60px rgba(18, 41, 96, 0.16);
    --shadow-window-focus: 0 30px 70px rgba(18, 41, 96, 0.24);
    --shadow-pop: 0 30px 80px rgba(18, 41, 96, 0.3);
    --material-sat: 1.6;
    --face-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 90px);
    --window-edge: rgba(255, 255, 255, 0.6);
    --window-edge-active: rgba(255, 255, 255, 0.95);
    --bar-ring: rgba(255, 255, 255, 0.6);
    --logo-ink: #122652;
    --logo-act: #2751b8;
    --logo-badge: #0c1b3c;
    --logo-badge-ink: #ffffff;

    --weight-title: 500;
    --weight-heading: 500;
    --icon-stroke: 1.4;

    /* Springy: a light overshoot, deeper press, small lift. */
    --ease-enter: cubic-bezier(0.32, 0.72, 0, 1);
    --ease-spring: linear(0, 0.22 8%, 0.58 18%, 0.9 30%, 1.05 42%, 1.07 50%, 1.03 62%, 0.995 78%, 1);
    --ease-press: linear(0, 0.3 10%, 0.75 25%, 1.06 45%, 1.04 60%, 1);
    --dur-press: 200ms;
    --dur-control: 180ms;
    --dur-med: 340ms;
    --dur-window: 520ms;
    --press-scale: 0.93;
    --hover-lift: -2px;
    --open-rise: 18px;
    --open-scale: 0.94;
    --pop-scale: 0.9;
    --stagger: 45ms;
  }

  /* ---- Orbit Dusk: violet light under deep cobalt, dark glass ---------------------------------- */
  :root[data-theme="orbit-dusk"] {
    color-scheme: dark;

    --color-bg: #39489e;
    --color-bg-top: #092661;
    --color-zone: rgba(255, 255, 255, 0.05);
    --color-surface-side: rgba(255, 255, 255, 0.06);
    --grad-desk: radial-gradient(110% 55% at 70% 14%, rgba(106, 129, 206, 0.28), transparent 60%),
      radial-gradient(130% 95% at 50% 100%, #7b73ca 0%, #6564bc 16.7%, #4f56ad 33.3%, #39489e 50%, #293d89 66.7%, #193175 83.3%, #092661 100%);
    --color-surface: rgba(9, 27, 71, 0.5);
    --color-surface-top: rgba(18, 38, 82, 0.6);
    --grad-face: linear-gradient(180deg, rgba(18, 38, 82, 0.62), rgba(7, 25, 68, 0.52));
    --color-surface-raised: rgba(48, 70, 117, 0.72);
    --color-overlay: rgba(14, 33, 76, 0.97);
    --color-overlay-raised: rgba(35, 56, 102, 0.98);
    --color-ink: #f2f5fc;
    --color-ink-secondary: #c9d1e1;
    --color-ink-faint: #a8b1c3;
    --color-accent-fill: #dce5f6;
    --color-accent-text: #bbd1fd;
    --color-on-accent: #0c1c43;
    --grad-lit: linear-gradient(180deg, #e9effa, #cad5e9);
    --color-wash: rgba(255, 255, 255, 0.14);
    --color-focus-outline: #bbd1fd;
    --color-measure: #f4b768;
    --color-measure-text: #f9c37a;
    --color-danger: #f2806f;
    --color-danger-hover: #f79a8b;
    --color-on-danger: #1f0b08;
    --color-border: rgba(255, 255, 255, 0.12);
    --color-border-soft: rgba(255, 255, 255, 0.07);
    --color-border-strong: rgba(255, 255, 255, 0.22);
    --color-fill: rgba(255, 255, 255, 0.09);
    --color-fill-strong: rgba(255, 255, 255, 0.15);
    --color-shadow: rgba(0, 2, 31, 0.3);
    --color-shadow-strong: rgba(0, 2, 31, 0.5);
    --color-scrim: rgba(0, 5, 37, 0.45);
    --color-surface-overlay: rgba(0, 2, 31, 0.72);
    --color-bubble: rgba(48, 70, 117, 0.8);
    --color-on-bubble: #f2f5fc;
    --shadow-lift: 0 8px 22px rgba(0, 2, 31, 0.22);
    --shadow-lift-hover: 0 12px 30px rgba(0, 2, 31, 0.3);
    --shadow-window: 0 24px 60px rgba(0, 2, 31, 0.3);
    --shadow-window-focus: 0 30px 70px rgba(0, 2, 31, 0.42);
    --shadow-pop: 0 30px 80px rgba(0, 2, 31, 0.5);
    --material-sat: 1.6;
    --face-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 90px);
    --window-edge: rgba(255, 255, 255, 0.12);
    --window-edge-active: rgba(255, 255, 255, 0.26);
    --bar-ring: rgba(255, 255, 255, 0.14);
    --logo-ink: #e3e8f1;
    --logo-act: #bbd1fd;
    --logo-badge: #39489e;
    --logo-badge-ink: #f2f5fc;

    --weight-title: 500;
    --weight-heading: 500;
    --icon-stroke: 1.4;

    /* Glide: long, smooth, no overshoot; things arrive out of a soft blur. */
    --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-press: 200ms;
    --dur-control: 220ms;
    --dur-med: 420ms;
    --dur-window: 620ms;
    --press-scale: 0.96;
    --hover-lift: -1px;
    --open-rise: 10px;
    --open-blur: 12px;
    --pop-scale: 0.96;
    --stagger: 70ms;
  }

  /* ---- Orbit Night: deep space, dark glass ----------------------------------------------------- */
  :root[data-theme="orbit-night"] {
    color-scheme: dark;

    --color-bg: #08183b;
    --color-bg-top: #020b1c;
    --color-zone: rgba(255, 255, 255, 0.05);
    --color-surface-side: rgba(255, 255, 255, 0.06);
    --grad-desk: radial-gradient(110% 55% at 70% 14%, rgba(106, 129, 206, 0.28), transparent 60%),
      radial-gradient(130% 100% at 50% 100%, #202d65 0%, #172656 18.3%, #0f1f48 36.7%, #08183b 55%, #051430 70%, #040f26 85%, #020b1c 100%);
    --color-surface: rgba(9, 27, 71, 0.5);
    --color-surface-top: rgba(18, 38, 82, 0.6);
    --grad-face: linear-gradient(180deg, rgba(18, 38, 82, 0.62), rgba(7, 25, 68, 0.52));
    --color-surface-raised: rgba(48, 70, 117, 0.72);
    --color-overlay: rgba(14, 33, 76, 0.97);
    --color-overlay-raised: rgba(35, 56, 102, 0.98);
    --color-ink: #f2f5fc;
    --color-ink-secondary: #c9d1e1;
    --color-ink-faint: #a8b1c3;
    --color-accent-fill: #dce5f6;
    --color-accent-text: #bbd1fd;
    --color-on-accent: #0c1c43;
    --grad-lit: linear-gradient(180deg, #e9effa, #cad5e9);
    --color-wash: rgba(255, 255, 255, 0.14);
    --color-focus-outline: #bbd1fd;
    --color-measure: #f4b768;
    --color-measure-text: #f9c37a;
    --color-danger: #f2806f;
    --color-danger-hover: #f79a8b;
    --color-on-danger: #1f0b08;
    --color-border: rgba(255, 255, 255, 0.12);
    --color-border-soft: rgba(255, 255, 255, 0.07);
    --color-border-strong: rgba(255, 255, 255, 0.22);
    --color-fill: rgba(255, 255, 255, 0.09);
    --color-fill-strong: rgba(255, 255, 255, 0.15);
    --color-shadow: rgba(0, 2, 31, 0.3);
    --color-shadow-strong: rgba(0, 2, 31, 0.5);
    --color-scrim: rgba(0, 5, 37, 0.45);
    --color-surface-overlay: rgba(0, 2, 31, 0.72);
    --color-bubble: rgba(48, 70, 117, 0.8);
    --color-on-bubble: #f2f5fc;
    --shadow-lift: 0 8px 22px rgba(0, 2, 31, 0.22);
    --shadow-lift-hover: 0 12px 30px rgba(0, 2, 31, 0.3);
    --shadow-window: 0 24px 60px rgba(0, 2, 31, 0.3);
    --shadow-window-focus: 0 30px 70px rgba(0, 2, 31, 0.42);
    --shadow-pop: 0 30px 80px rgba(0, 2, 31, 0.5);
    --material-sat: 1.6;
    --face-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 90px);
    --window-edge: rgba(255, 255, 255, 0.12);
    --window-edge-active: rgba(255, 255, 255, 0.26);
    --bar-ring: rgba(255, 255, 255, 0.14);
    --logo-ink: #e3e8f1;
    --logo-act: #bbd1fd;
    --logo-badge: #08183b;
    --logo-badge-ink: #f2f5fc;

    --weight-title: 500;
    --weight-heading: 500;
    --icon-stroke: 1.4;

    /* Glide: long, smooth, no overshoot; things arrive out of a soft blur. */
    --ease-enter: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
    --dur-press: 200ms;
    --dur-control: 220ms;
    --dur-med: 420ms;
    --dur-window: 620ms;
    --press-scale: 0.96;
    --hover-lift: -1px;
    --open-rise: 10px;
    --open-blur: 12px;
    --pop-scale: 0.96;
    --stagger: 70ms;
  }

  /* ---- Millennium: XP-inspired. Blue title strips, cream bodies, green start, hills ---- */
  :root[data-theme="millennium"] {
    color-scheme: light;

    --color-bg: #5a9a3a;
    --color-bg-top: #2a64d6;
    /* Our own drawing: a blue sky, two soft clouds and rolling green hills. */
    --grad-desk:
      radial-gradient(140% 52% at 22% 108%, #74bd45 0%, #5aa232 50%, #4a8e27 59%, transparent 59.5%),
      radial-gradient(120% 48% at 92% 112%, #68b13c 0%, #4f962b 50%, #3f7f20 58%, transparent 58.5%),
      radial-gradient(30% 9% at 28% 26%, rgba(255, 255, 255, 0.85), transparent 70%), radial-gradient(
      24% 7% at 70% 18%,
      rgba(255, 255, 255, 0.7),
      transparent 70%
    ), linear-gradient(180deg, #1f5fd4 0%, #3d7fe6 30%, #7fb2f0 60%, #c4def8 100%);
    --color-zone: #f4f2e8;
    --color-surface: #ece9d8;
    --color-surface-top: #f1efe2;
    --color-surface-raised: #ffffff;
    --color-ink: #000000;
    --color-ink-secondary: #2f2f2f;
    --color-ink-faint: #5f5f5f;
    --color-accent-fill: #2559c9;
    --color-accent-text: #0b4dc2;
    --color-on-accent: #ffffff;
    --grad-lit: linear-gradient(180deg, #5b95f5 0%, #2f6be0 50%, #1f55c4 100%);
    --color-wash: rgba(49, 106, 197, 0.16);
    --color-focus-outline: #2559c9;
    --color-border: rgba(0, 40, 110, 0.18);
    --color-border-soft: rgba(0, 40, 110, 0.1);
    --color-border-strong: rgba(0, 40, 110, 0.3);
    --color-shadow: rgba(0, 0, 0, 0.18);
    --color-shadow-strong: rgba(0, 0, 0, 0.35);
    --color-scrim: rgba(20, 50, 120, 0.3);
    --color-bubble: #2559c9;
    --color-on-bubble: #ffffff;

    --radius-hold: 4px;
    --radius-window: 8px;
    --radius-window-bottom: 0px;
    --radius-popover: 3px;
    --radius-media: 2px;
    --radius-inner: 3px;
    --radius-pill: 3px;
    --radius-bubble: 8px;
    --radius-bar: 0px;

    --window-edge: #0a3fc4;
    --window-edge-active: #0831d9;
    --window-title-paint: linear-gradient(180deg, #6f90da 0%, #8eaaea 10%, #6c8cd8 55%, #5d7ecc 100%);
    --window-title-paint-active: linear-gradient(
      180deg,
      #0a5ee8 0%,
      #3a8cff 7%,
      #1767ec 22%,
      #0b58e0 60%,
      #0452d8 88%,
      #0a45b8 100%
    );
    --shadow-window: 0 0 0 2px #3a6fd8, 3px 5px 12px rgba(0, 0, 0, 0.3);
    --shadow-window-focus: 0 0 0 2px #0b4ed8, 4px 7px 16px rgba(0, 0, 0, 0.38);
    --shadow-lift: inset 0 0 0 1px #003c74, inset 0 -2px 0 rgba(0, 0, 0, 0.08);
    --shadow-lift-hover: inset 0 0 0 1px #003c74, inset 0 0 0 2px #f8b636;
    --shadow-pop: 0 0 0 1px #6f8fc8, 3px 4px 10px rgba(0, 0, 0, 0.35);
    --field-paint: #ffffff;
    --field-shadow: inset 0 0 0 1px #7f9db9;

    --bar-float: 0px;
    --bar-paint: linear-gradient(
      180deg,
      #3168d5 0%,
      #4993e6 5%,
      #2a6fe3 14%,
      #245edb 60%,
      #1e52cc 90%,
      #1941a5 100%
    );
    --bar-ring: transparent;
    --bar-edge: #0c37a8;
    --bar-shadow: none;

    --font-sans: Tahoma, Verdana, "Segoe UI", sans-serif;
    --font-display: "Trebuchet MS", Tahoma, sans-serif;
    --weight-title: 700;
    --icon-stroke: 1.8;

    --dur-control: 90ms;
    --dur-med: 140ms;
    --dur-window: 180ms;
    --press-scale: 1;
    --hover-lift: 0px;
    --open-rise: 0px;
    --open-scale: 0.98;
    --pop-scale: 1;
    --stagger: 0ms;

    /* Logo (mark, tab icon). */
    --logo-ink: #1f55c4;
    --logo-act: #3fa22c;
    --logo-badge: #245edb;
    --logo-badge-ink: #ffffff;
  }

  /* ---- Retro: Windows 95-inspired. Teal desk, silver bevels, square everything ----- */
  :root[data-theme="retro"] {
    color-scheme: light;

    --color-bg: #008080;
    --color-bg-top: #008080;
    --grad-desk: linear-gradient(#008080, #008080);
    --color-zone: #c0c0c0;
    --color-surface: #c0c0c0;
    --color-surface-top: #c0c0c0;
    --color-surface-raised: #c0c0c0;
    --color-ink: #000000;
    --color-ink-secondary: #1a1a1a;
    --color-ink-faint: #4a4a4a;
    --color-accent-fill: #000080;
    --color-accent-text: #000080;
    --color-on-accent: #ffffff;
    --grad-lit: linear-gradient(#000080, #000080);
    --color-wash: rgba(0, 0, 128, 0.18);
    --color-focus-outline: #000000;
    --color-border: #808080;
    --color-border-soft: rgba(0, 0, 0, 0.18);
    --color-border-strong: #404040;
    --color-fill: rgba(0, 0, 0, 0.08);
    --color-fill-strong: rgba(0, 0, 0, 0.16);
    --color-shadow: rgba(0, 0, 0, 0.3);
    --color-shadow-strong: rgba(0, 0, 0, 0.5);
    --color-scrim: rgba(0, 64, 64, 0.4);
    --color-bubble: #000080;
    --color-on-bubble: #ffffff;
    --color-signal-empty: #808080;

    --radius-hold: 0px;
    --radius-window: 0px;
    --radius-popover: 0px;
    --radius-media: 0px;
    --radius-inner: 0px;
    --radius-pill: 0px;
    --radius-bubble: 0px;
    --radius-bar: 0px;

    /* The bevel: light top-left, dark bottom-right; sunken flips it. */
    --bevel-raised:
      inset -1px -1px #0a0a0a, inset 1px 1px #ffffff, inset -2px -2px #808080, inset 2px 2px #dfdfdf;
    --bevel-sunken:
      inset -1px -1px #ffffff, inset 1px 1px #0a0a0a, inset -2px -2px #dfdfdf, inset 2px 2px #808080;
    --window-edge: #dfdfdf;
    --window-edge-active: #dfdfdf;
    --window-title-paint: linear-gradient(90deg, #808080, #b5b5b5);
    --window-title-paint-active: linear-gradient(90deg, #000080, #1084d0);
    --shadow-window: 1px 1px 0 #0a0a0a, inset -1px -1px #808080;
    --shadow-window-focus: var(--shadow-window);
    --shadow-lift: var(--bevel-raised);
    --shadow-lift-hover: var(--bevel-raised);
    --shadow-pop: 1px 1px 0 #0a0a0a, var(--bevel-raised);
    --field-paint: #ffffff;
    --field-shadow: var(--bevel-sunken);

    --bar-float: 0px;
    --bar-paint: #c0c0c0;
    --bar-ring: transparent;
    --bar-edge: #ffffff;
    --bar-shadow: inset 0 1px #dfdfdf;

    --font-sans: Tahoma, Geneva, Verdana, sans-serif;
    --font-display: Tahoma, Geneva, Verdana, sans-serif;
    --weight-title: 700;
    --weight-heading: 700;
    --icon-stroke: 2;
    --icon-cap: square;
    --icon-join: miter;

    /* No flourishes: things appear. */
    --dur-press: 0ms;
    --dur-fast: 0ms;
    --dur-control: 0ms;
    --dur-med: 60ms;
    --dur-window: 80ms;
    --press-scale: 1;
    --hover-lift: 0px;
    --open-rise: 0px;
    --open-scale: 1;
    --pop-scale: 1;
    --stagger: 0ms;

    /* Logo (mark, tab icon). */
    --logo-ink: #000080;
    --logo-act: #008080;
    --logo-badge: #008080;
    --logo-badge-ink: #ffffff;
  }

  /* ---- Reduce transparency (§7.1): solid faces in the glass themes ------------- */
  /* data-material is dropped too, so css/theme-surfaces.css paints no blur and keeps the fades. */
  :root:not([data-theme])[data-transparency="reduced"] {
    --color-surface: #eff0f2;
    --color-surface-top: #f6f7f8;
    --grad-face: linear-gradient(180deg, #f6f7f8, #eff0f2);
    --color-surface-raised: #fdfdfe;
  }
  :root[data-theme="signal-day"][data-transparency="reduced"] {
    --color-surface: #eff0f2;
    --color-surface-top: #f6f7f8;
    --grad-face: linear-gradient(180deg, #f6f7f8, #eff0f2);
    --color-surface-raised: #fdfdfe;
  }
  :root[data-theme="signal-dusk"][data-transparency="reduced"] {
    --color-surface: #22272c;
    --color-surface-top: #2c3136;
    --grad-face: linear-gradient(180deg, #2c3136, #22272c);
    --color-surface-raised: #43484e;
  }
  :root[data-theme="signal-night"][data-transparency="reduced"] {
    --color-surface: #22272c;
    --color-surface-top: #2c3136;
    --grad-face: linear-gradient(180deg, #2c3136, #22272c);
    --color-surface-raised: #43484e;
  }
  :root[data-theme="orbit-dawn"][data-transparency="reduced"] {
    --color-surface: #e9f0fe;
    --color-surface-top: #f3f7ff;
    --grad-face: linear-gradient(180deg, #f3f7ff, #e9f0fe);
    --color-surface-raised: #fdfdff;
  }
  :root[data-theme="orbit-day"][data-transparency="reduced"] {
    --color-surface: #e9f0fe;
    --color-surface-top: #f3f7ff;
    --grad-face: linear-gradient(180deg, #f3f7ff, #e9f0fe);
    --color-surface-raised: #fdfdff;
  }
  :root[data-theme="orbit-dusk"][data-transparency="reduced"] {
    --color-surface: #10234f;
    --color-surface-top: #1a2e5b;
    --grad-face: linear-gradient(180deg, #1a2e5b, #10234f);
    --color-surface-raised: #304675;
  }
  :root[data-theme="orbit-night"][data-transparency="reduced"] {
    --color-surface: #10234f;
    --color-surface-top: #1a2e5b;
    --grad-face: linear-gradient(180deg, #1a2e5b, #10234f);
    --color-surface-raised: #304675;
  }


  /* Phone type and spacing (the original's mobile-native.css), and the solid face places sit on. */
  :root {
    --pt-large-title: 28px; --pt-title: 20px; --pt-headline: 17px; --pt-body: 16px; --pt-callout: 15px;
    --pt-subhead: 14px; --pt-footnote: 13px; --pt-caption: 12px;
    --pt-hit: 44px; --pt-control: 36px; --pt-row: 52px; --pt-gutter: 16px; --pt-nav: 52px;
    --ph-solid-face: linear-gradient(var(--color-surface), var(--color-surface)) var(--color-bg);
  }
}
