/* Design tokens, V3 (docs/design/DESIGN-V3.md). One system for light and dark.
   Three materials: base (the window ground, Stevie's neutral #f2f2f2), raised (the white work sheet, cards, fields) and
   glass (the floating layers: sidebar, top bar, menus, sheets, the composer), each with its own edge and elevation.
   Pure neutral greys, one cool accent (blue: Needs you, unread, keyboard focus, nothing else); the ember Orb is the only
   warm thing on screen. Radii are concentric (inner = outer - padding) and generous; controls are capsules.
   Every V1 and V2 name still resolves (marked "V2 name" where it is now an alias), so no module breaks.
   Motion tokens live here too (durations, easings, springs, distances); motion.css holds the animations. */
:root {
  color-scheme: light;

  /* ---------- primitives: the neutral ramp (light). Components use the semantic tokens below. ---------- */
  --g-0: #ffffff;
  --g-25: #fbfbfb;
  --g-50: #f7f7f7;
  --g-75: #f5f5f5;
  --g-100: #f2f2f2;  /* the base: Stevie's grey (2026-11-01) */
  --g-150: #ebebeb;
  --g-200: #e5e5e5;
  --g-300: #d4d4d4;
  --g-400: #9e9e9e;  /* ink-4: placeholder, disabled, decorative glyphs */
  --g-500: #6b6b6b;  /* ink-3: meta, 4.76:1 on the base, 5.4:1 on white */
  --g-600: #525252;  /* ink-2: secondary text, 7.8:1 */
  --g-800: #262626;
  --g-900: #171717;  /* ink */

  /* ---------- type: the system face (SF Pro on Apple; the native apps will use the same) ---------- */
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --fs-2xs: 11px;    /* the count inside a 16 px badge, kbd */
  --fs-xs: 12px;     /* quiet metadata: timestamps, badges, status pills, section labels, hints */
  --fs-sm: 13px;     /* chips, segmented labels, dense buttons, table headers */
  --fs-md: 14px;     /* the UI size: rows, cells, menus, buttons, inputs, sidebar */
  --fs-base: 14px;
  --fs-input: 15px;  /* the composer's textarea only (16 on touch through --field-min) */
  --fs-lg: 16px;     /* prose: the transcript, notes */
  --fs-prose: 16px;
  --fs-xl: 20px;     /* headings inside prose, sheet titles */
  --fs-2xl: 24px;    /* the peek's title, section titles of a page */
  --fs-title: 30px;  /* the large title at the top of a page (V3) */
  --fs-3xl: 32px;    /* a note's or document's title */
  --lh-tight: 1.2;
  --lh-snug: 1.43;
  --lh: 1.5;
  --lh-prose: 1.65;
  --w-regular: 400;
  --w-medium: 500;   /* every interactive label */
  --w-semibold: 600; /* sheet and card titles */
  --w-bold: 700;     /* the large title, a note's title */
  --w-strong: var(--w-semibold); /* V1 name */
  --track-title: -0.022em;   /* 20 to 24 px */
  --track-large: -0.026em;   /* the large title */
  --track-display: -0.03em;  /* 32 px and up */
  --field-min: 0px;          /* 16px on touch so iPhone Safari never zooms into a field */

  /* ---------- space: a 4 px grid with the half steps the UI uses ---------- */
  --sp-0h: 2px;
  --sp-1: 4px;
  --sp-1h: 6px;
  --sp-2: 8px;
  --sp-2h: 10px;
  --sp-3: 12px;
  --sp-3h: 14px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-7: 32px;
  --sp-8: 40px;
  --sp-9: 56px;
  --sp-10: 72px;

  /* ---------- fixed heights ---------- */
  --h-xs: 24px;   /* row More buttons */
  --h-sm: 28px;   /* dense toolbar controls, chips, segmented */
  --h-md: 32px;   /* buttons, inputs, menu items */
  --h-row: 36px;  /* table and list rows */
  --h-tab: 40px;  /* tab bars */
  --h-nav: 32px;  /* sidebar rows (V2 30) */

  /* ---------- radius: generous and concentric (inner radius = outer radius - the padding between them) ----------
     A control is a capsule; a row or menu item is 10; a card 14; a menu 16 (10 + 6 padding); the sidebar panel and the
     work sheet 18 (10 + 8); the composer 22 (10 + 12); a sheet or dialog 28. */
  --r-xs: 6px;       /* badges, tags, kbd, checkboxes (V2 4) */
  --r-sm: 10px;      /* fields, nav rows, list rows, menu items, inline code blocks (V2 6) */
  --r-md: 14px;      /* cards, gallery cards, code blocks, your prompt, board columns (V2 8) */
  --r-lg: 16px;      /* menus, popovers, the floating peek, toasts (V2 12) */
  --r-panel: 18px;   /* the sidebar panel and the work sheet on desktop */
  --r-xl: 22px;      /* the composer, the Inbox drawer, the search window (V2 16) */
  --r-sheet: 28px;   /* phone sheets: the sidebar, Details, menus, the Inbox */
  --r-pill: 999px;   /* buttons, chips, segmented controls, status pills, counts, avatars, switches */
  --r-control: var(--r-pill); /* the shape of a button: a capsule */

  /* ---------- layout ---------- */
  --sidebar-w: 260px;      /* the user drags it between --sidebar-min and --sidebar-max; ui.js remembers it per device */
  --sidebar-min: 200px;
  --sidebar-max: 360px;
  --sidebar-rail: 56px;    /* the icon-only state */
  --topbar-h: 52px;
  --gutter: 64px;          /* the transcript's time rail */
  --measure: 820px;
  --measure-note: 680px;
  --measure-wide: 1080px;  /* an output's item page (item.css) */
  --page-mid: 880px;
  --page-wide: 1200px;     /* polish v6: list pages fill the content column up to 1200 px */
  --page-pad: 40px;        /* 20 on phones */
  --card-pad: 20px;        /* round 6 (S1): every Settings card's padding, the same on all four sides; 16 on phones */
  --set-box-max: 60vh;     /* round 6 (S1): the most a growing list or tree in Settings takes before it scrolls inside; 50vh on phones */
  --card-gap: 12px;        /* round 6 (S1): a form or button row at the end of a card, below the row above it */
  --peek-w: 520px;
  --peek-w-wide: 720px;
  --drawer-w: 400px;
  --inset: 8px;            /* the gap between the window edge and a floating layer, and between the panels */
  --hit: 32px;             /* 44 on touch */
  --pick-h: 420px;         /* AS.ui.iconPicker on a computer: one fixed height, the grid scrolls inside */
  --pick-h-sheet: 64vh;    /* the same picker as a phone sheet */
  --send: 32px;

  /* ---------- colour: the materials (light) ---------- */
  --base: var(--g-100);    /* the window ground; shows in the gaps around the floating panels */
  --paper: var(--g-0);     /* the work surface: the page, the transcript, tables */
  --raised: var(--g-0);    /* cards, fields while editing, the segmented thumb */
  --panel: var(--base);    /* V2 name: the sidebar's ground */
  --pane: var(--g-75);     /* inset surfaces: your prompt, code, tool input */
  --well: var(--g-50);     /* preview wells, the board's columns */
  --float: var(--g-0);     /* the opaque face of a floating layer (no blur or the fallback) */
  --thumb: var(--g-0);     /* the lens: the segmented thumb, the rail's selection, a switch's knob */
  --knob: #ffffff;         /* a switch's knob, white in both modes */
  --thumb-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.08), 0 3px 8px -2px rgba(0, 0, 0, 0.1);
  /* fills: translucent, so they sit right on paper, glass or base (Apple's quaternary to secondary fills) */
  --fill: rgba(0, 0, 0, 0.045);    /* fields and secondary buttons at rest, the segmented tray */
  --fill-2: rgba(0, 0, 0, 0.07);   /* their hover */
  --fill-3: rgba(0, 0, 0, 0.1);    /* pressed */
  --ink: var(--g-900);
  --ink-2: var(--g-600);
  --ink-3: var(--g-500);
  --ink-4: var(--g-400);
  /* lines: hairlines only where a fill or a shadow cannot separate */
  --rule: rgba(0, 0, 0, 0.08);
  --rule-soft: rgba(0, 0, 0, 0.055);
  --rule-2: rgba(0, 0, 0, 0.13);
  --hover: rgba(0, 0, 0, 0.04);
  --active: rgba(0, 0, 0, 0.065);
  --row-hover: rgba(0, 0, 0, 0.025);
  --row-sel: rgba(0, 0, 0, 0.045);

  /* glass: a tinted translucent fill, a strong blur with saturation, a light inner edge. Only on the sidebar, the top
     bar, menus and popovers, sheets, the drawer, the search window, toasts and the composer (never on rows or cards).
     Without backdrop-filter the fills turn solid (the @supports block below). */
  --glass-chrome: rgba(248, 248, 248, 0.74); /* the sidebar panel */
  --glass-bar: rgba(255, 255, 255, 0.72);    /* the top bar, over content that scrolls under it */
  --glass-float: rgba(252, 252, 252, 0.86);  /* menus, popovers, the drawer, the search window */
  --glass-sheet: rgba(250, 250, 250, 0.92);  /* phone sheets: what is under them must not read through the text */
  --glass-blur: blur(24px) saturate(1.8);
  --glass-blur-float: blur(36px) saturate(1.9);
  --glass-edge: inset 0 0.5px 0 rgba(255, 255, 255, 0.95), inset 0 0 0 0.5px rgba(255, 255, 255, 0.55);
  --glass-ring: 0 0 0 0.5px rgba(0, 0, 0, 0.09);
  --glass: rgba(255, 255, 255, 0.78);   /* V2 name: the composer */
  --glass-menu: var(--glass-float);     /* V2 name */
  --glass-solid: #ffffff;               /* the composer's surface as an opaque colour, for patches over scrolled chips */
  --blur: var(--glass-blur);            /* V2 name */

  /* the one accent: Needs you, the unread dot, keyboard focus. Never decoration. */
  --accent: #0068d6;                     /* text and glyphs: 5.3:1 on white, 4.8:1 on the base */
  --accent-fill: #0071e3;                /* count badges, the unread dot: white text on it 4.7:1 */
  --accent-on: #ffffff;
  --accent-wash: rgba(0, 113, 227, 0.085);
  --accent-line: rgba(0, 113, 227, 0.4);
  --needs: var(--accent);
  --needs-fill: var(--accent-fill);
  --needs-wash: var(--accent-wash);
  /* V2 names: amber meant Needs you; it is the accent now (the Orb is the only warm thing) */
  --amber: var(--accent);
  --amber-fill: var(--accent-fill);
  --amber-on: var(--accent-on);
  --amber-wash: var(--accent-wash);
  --amber-line: var(--accent-line);

  --ok: #15803d;                        /* only: Connected, Copied, diff additions */
  --ok-wash: rgba(22, 163, 74, 0.1);
  --err: #dc2626;                       /* failed, overdue, destructive */
  --err-wash: rgba(220, 38, 38, 0.08);
  --unread: var(--accent-fill);         /* the 6 px unread dot */

  --scrim: rgba(0, 0, 0, 0.16);
  --toast-bg: rgba(30, 30, 30, 0.86);   /* toasts: dark glass in both modes, they float over everything */
  --toast-ink: #fafafa;
  --toast-ink-2: rgba(250, 250, 250, 0.62);
  --toast-needs: #8cc4ff;
  --toast-err: #fca5a5;
  --canvas-doc: #ffffff;  /* agent-made pages render on a white sheet in both modes */
  --canvas-ink: #171717;

  /* ---------- elevation: three steps, outer shadows only; pair them with an edge (--e-ring, --glass-edge) ----------
     1 rests (the sidebar, the work sheet, cards), 2 floats (menus, popovers, toasts, the peek), 3 overlays (sheets, the
     drawer, the search window). Dark mode deepens them and leans on the light edge instead. */
  --e-1: 0 1px 2px rgba(0, 0, 0, 0.04), 0 3px 12px -4px rgba(0, 0, 0, 0.07);
  --e-2: 0 2px 6px -2px rgba(0, 0, 0, 0.08), 0 14px 36px -12px rgba(0, 0, 0, 0.2);
  --e-3: 0 6px 16px -6px rgba(0, 0, 0, 0.12), 0 32px 80px -20px rgba(0, 0, 0, 0.32);
  --e-ring: 0 0 0 0.5px rgba(0, 0, 0, 0.1);  /* the contour of a layer without a border */
  --e-flat: 0 0 0 0 transparent;
  /* V2 names */
  --e-xs: 0 0.5px 1px rgba(0, 0, 0, 0.05);
  --e-raised: var(--e-1);
  --e-hover: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 18px -6px rgba(0, 0, 0, 0.12);
  --e-float: var(--e-2);
  --e-overlay: var(--e-3);
  --e-peek: -20px 0 48px -24px rgba(0, 0, 0, 0.22);
  --e-composer: 0 1px 2px rgba(0, 0, 0, 0.04), 0 12px 36px -12px rgba(0, 0, 0, 0.18);

  /* focus: keyboard only (:focus-visible), in the accent. Text fields show their editing state instead (ui.css). */
  --focus: var(--accent-fill);
  --focus-ring: 0 0 0 3px rgba(0, 113, 227, 0.28);
  --focus-halo: var(--focus-ring);  /* V2 name */
  --field: var(--fill);             /* a text field at rest */
  --field-edit: var(--raised);      /* a text field while you type in it */
  --field-edge: rgba(0, 0, 0, 0.16);/* the hairline of a field while you type in it */

  /* diffs */
  --diff-add-bg: rgba(22, 163, 74, 0.1);
  --diff-add-text: #166534;
  --diff-del-bg: rgba(220, 38, 38, 0.08);
  --diff-del-text: #991b1b;

  /* ---------- badges, tags (light: Tailwind 50 ground, 700 text). Amber and orange are never used here. ---------- */
  --hue-gray-bg: #f2f2f2;    --hue-gray-fg: #404040;
  --hue-red-bg: #fef2f2;     --hue-red-fg: #b91c1c;
  --hue-pink-bg: #fdf2f8;    --hue-pink-fg: #be185d;
  --hue-purple-bg: #faf5ff;  --hue-purple-fg: #7e22ce;
  --hue-indigo-bg: #eef2ff;  --hue-indigo-fg: #4338ca;
  --hue-blue-bg: #eff6ff;    --hue-blue-fg: #1d4ed8;
  --hue-sky-bg: #f0f9ff;     --hue-sky-fg: #0369a1;
  --hue-teal-bg: #f0fdfa;    --hue-teal-fg: #0f766e;
  --hue-green-bg: #f0fdf4;   --hue-green-fg: #15803d;
  --hue-orange-bg: #fff7ed;  --hue-orange-fg: #c2410c;
  --hue-amber-bg: #fffbeb;   --hue-amber-fg: #b45309;
  --hue-yellow-bg: #fefce8;  --hue-yellow-fg: #a16207;
  --hue-emerald-bg: #ecfdf5; --hue-emerald-fg: #047857;
  --badge-page-bg: var(--hue-emerald-bg);   --badge-page-fg: var(--hue-emerald-fg);
  --badge-doc-bg: var(--hue-gray-bg);       --badge-doc-fg: var(--hue-gray-fg);
  --badge-note-bg: var(--hue-gray-bg);      --badge-note-fg: var(--hue-gray-fg);
  --badge-image-bg: var(--hue-sky-bg);      --badge-image-fg: var(--hue-sky-fg);
  --badge-audio-bg: var(--hue-purple-bg);   --badge-audio-fg: var(--hue-purple-fg);
  --badge-video-bg: var(--hue-pink-bg);     --badge-video-fg: var(--hue-pink-fg);
  --badge-chat-bg: var(--hue-indigo-bg);    --badge-chat-fg: var(--hue-indigo-fg);
  --badge-link-bg: var(--hue-blue-bg);      --badge-link-fg: var(--hue-blue-fg);
  --badge-code-bg: var(--hue-teal-bg);      --badge-code-fg: var(--hue-teal-fg);
  --badge-other-bg: var(--hue-gray-bg);     --badge-other-fg: var(--hue-gray-fg);

  /* ---------- motion: durations, easings, springs, distances (motion.css plays them) ---------- */
  --d0: 90ms;    /* press in */
  --d1: 150ms;   /* hover colour, small reveals */
  --d2: 220ms;   /* chips, tabs' content, checkbox, route content in */
  --d3: 300ms;   /* panes, view switch, FLIP, toasts in */
  --d4: 420ms;   /* glyph pops */
  --d1-out: 100ms;
  --d2-out: 150ms;
  --d3-out: 210ms;
  --d4-out: 290ms;
  /* springs run longer than curves: most of the travel happens in the first third, the rest is the settle */
  --d-menu: 380ms;   /* menus and popovers grow from their anchor */
  --d-lens: 460ms;   /* the selection lens and the segmented thumb slide */
  --d-sheet: 520ms;  /* sheets, the drawer, the sidebar on a phone */
  --ease-out: cubic-bezier(.16, 1, .3, 1);    /* arrivals */
  --ease-in: cubic-bezier(.4, 0, 1, 1);       /* exits */
  --ease-move: cubic-bezier(.32, .72, 0, 1);  /* things that travel or resize */
  --ease-std: cubic-bezier(.4, 0, .2, 1);     /* colour and opacity */
  --ease: var(--ease-out);                    /* V1 name */
  /* damped springs sampled into linear(): ratio 0.9 (no visible overshoot, a long soft landing: sheets), 0.76 (2.5 %:
     menus, popovers, toasts), 0.68 (5 %: the lens and the thumb, which should feel liquid), and two from V2 */
  --spring-sheet: linear(0, 0.006 1.7%, 0.023 3.3%, 0.048 5%, 0.081 6.7%, 0.118 8.3%, 0.201 11.7%, 0.425 20%, 0.547 25%, 0.62 28.3%, 0.684 31.7%, 0.74 35%, 0.788 38.3%, 0.847 43.3%, 0.893 48.3%, 0.935 55%, 0.973 65%, 1);
  --spring-menu: linear(0, 0.009 1.7%, 0.032 3.3%, 0.068 5%, 0.112 6.7%, 0.163 8.3%, 0.511 18.3%, 0.616 21.7%, 0.709 25%, 0.788 28.3%, 0.853 31.7%, 0.905 35%, 0.945 38.3%, 0.975 41.7%, 0.996 45%, 1.015 50%, 1.025 60%, 1);
  --spring-lens: linear(0, 0.011 1.7%, 0.04 3.3%, 0.084 5%, 0.139 6.7%, 0.202 8.3%, 0.548 16.7%, 0.613 18.3%, 0.674 20%, 0.73 21.7%, 0.781 23.3%, 0.827 25%, 0.868 26.7%, 0.904 28.3%, 0.936 30%, 0.963 31.7%, 0.985 33.3%, 1.019 36.7%, 1.04 40%, 1.051 43.3%, 1.054 48.3%, 0.999 83.3%, 1);
  --spring: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.001 85.8%, 1);
  --spring-pop: linear(0, 0.0396, 0.1393, 0.2737, 0.4225, 0.5702, 0.7062, 0.8237, 0.9194, 0.9927, 1.0448, 1.078, 1.0955, 1.1007, 1.0968, 1.0868, 1.0733, 1.0583, 1.0434, 1.0297, 1.0179, 1.0082, 1.0008, 0.9955, 0.9922, 0.9904, 0.9899, 0.9902, 0.9912, 0.9926, 0.9941, 0.9956, 1);
  /* distances (zero under reduced motion, so every movement becomes a fade) */
  --m-rise: 6px;
  --m-nudge: 4px;
  --m-scale: .94;     /* menus from their anchor (V2 .96) */
  --m-slide: 24px;
  --m-sheet: 100%;

  /* ---------- breakpoints and layers (round 4, L5) ----------
     Media and container queries cannot read custom properties, so @media keeps the literal pixels; these name the only
     three widths the CSS and AS.isPhone() use: a phone up to 760 px, a narrow phone up to 440 px, the wide desktop from
     1100 px (the side pane pushes the chat only above it). Nothing else is a breakpoint. */
  --bp-phone: 760px;
  --bp-narrow: 440px;
  --bp-wide: 1100px;
  /* one layer scale; a component's own stacking (0 to 6 inside a positioned box) stays local. Side panels and peeks,
     then popovers, sheets and scrims, dialogs and full-screen layers, toasts, the Orb. The shell's phone sheets
     (sidebar, #side, their scrim) sit just under the side layer as calc(var(--z-side) - n). */
  --z-side: 30;
  --z-pop: 40;
  --z-sheet: 50;
  --z-dialog: 60;
  --z-toast: 70;
  --z-orb: 80;
  --m-drawer: calc(100% + var(--inset));
  --m-press: .96;     /* buttons, chips (V2 .97) */
  --m-press-row: .985;
  --m-pop: .4;
}

/* ---------- dark: deeper base, lighter raised surfaces, glass lit from its top edge ----------
   Round 4 (O8): Appearance is a choice (Settings > Preferences: System, Light, Dark). The head script of every page sets
   html[data-theme] to light or dark before the first paint (System resolves prefers-color-scheme and follows it), so
   these values hang on the attribute and the three states are exact. */
:root[data-theme="dark"] {
  color-scheme: dark;
  --g-0: #171717;
  --g-25: #1b1b1b;
  --g-50: #1c1c1c;
  --g-75: #232323;
  --g-100: #0e0e0e;
  --g-150: #2a2a2a;
  --g-200: #2f2f2f;
  --g-300: #3a3a3a;
  --g-400: #6b6b6b;
  --g-500: #8f8f8f;
  --g-600: #ababab;
  --g-800: #d4d4d4;
  --g-900: #ececec;

  --base: #0e0e0e;
  --paper: #171717;
  --raised: #202020;
  --pane: #232323;
  --well: #1c1c1c;
  --float: #232323;
  --thumb: #3a3a3a;
  --thumb-shadow: inset 0 0.5px 0 rgba(255, 255, 255, 0.12), 0 1px 3px rgba(0, 0, 0, 0.5);
  --fill: rgba(255, 255, 255, 0.06);
  --fill-2: rgba(255, 255, 255, 0.09);
  --fill-3: rgba(255, 255, 255, 0.13);
  --ink: #ececec;
  --ink-2: #ababab;
  --ink-3: #8f8f8f;
  --ink-4: #6b6b6b;
  --rule: rgba(255, 255, 255, 0.08);
  --rule-soft: rgba(255, 255, 255, 0.055);
  --rule-2: rgba(255, 255, 255, 0.14);
  --hover: rgba(255, 255, 255, 0.055);
  --active: rgba(255, 255, 255, 0.09);
  --row-hover: rgba(255, 255, 255, 0.03);
  --row-sel: rgba(255, 255, 255, 0.055);

  --glass-chrome: rgba(30, 30, 30, 0.7);
  --glass-bar: rgba(23, 23, 23, 0.72);
  --glass-float: rgba(38, 38, 38, 0.84);
  --glass-sheet: rgba(34, 34, 34, 0.92);
  --glass-blur: blur(24px) saturate(1.6);
  --glass-blur-float: blur(36px) saturate(1.7);
  --glass-edge: inset 0 0.5px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 0.5px rgba(255, 255, 255, 0.07);
  --glass-ring: 0 0 0 0.5px rgba(0, 0, 0, 0.7);
  --glass: rgba(32, 32, 32, 0.78);
  --glass-solid: #202020;

  --accent: #4ea1ff;
  --accent-fill: #0b6bd6;
  --accent-on: #ffffff;
  --accent-wash: rgba(78, 161, 255, 0.13);
  --accent-line: rgba(78, 161, 255, 0.45);
  --ok: #4ade80;
  --ok-wash: rgba(74, 222, 128, 0.12);
  --err: #f87171;
  --err-wash: rgba(248, 113, 113, 0.12);
  --scrim: rgba(0, 0, 0, 0.5);
  --toast-bg: rgba(48, 48, 48, 0.86);
  --toast-ink: #f5f5f5;
  --toast-ink-2: rgba(245, 245, 245, 0.62);

  --e-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 14px -4px rgba(0, 0, 0, 0.5);
  --e-2: 0 2px 6px -2px rgba(0, 0, 0, 0.5), 0 18px 44px -12px rgba(0, 0, 0, 0.65);
  --e-3: 0 6px 16px -6px rgba(0, 0, 0, 0.55), 0 36px 90px -20px rgba(0, 0, 0, 0.8);
  --e-ring: 0 0 0 0.5px rgba(255, 255, 255, 0.09);
  --e-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
  --e-hover: inset 0 0.5px 0 rgba(255, 255, 255, 0.06), 0 6px 18px -6px rgba(0, 0, 0, 0.6);
  --e-peek: -20px 0 48px -20px rgba(0, 0, 0, 0.7);
  --e-composer: inset 0 0.5px 0 rgba(255, 255, 255, 0.08), 0 2px 8px -2px rgba(0, 0, 0, 0.4), 0 14px 40px -12px rgba(0, 0, 0, 0.6);
  --focus-ring: 0 0 0 3px rgba(78, 161, 255, 0.32);
  --field-edge: rgba(255, 255, 255, 0.18);

  --diff-add-bg: rgba(74, 222, 128, 0.12);
  --diff-add-text: #86efac;
  --diff-del-bg: rgba(248, 113, 113, 0.12);
  --diff-del-text: #fca5a5;

  --hue-gray-bg: rgba(255, 255, 255, 0.08);       --hue-gray-fg: #d4d4d4;
  --hue-red-bg: oklch(27% 0.05 25 / 0.55);        --hue-red-fg: oklch(80% 0.11 25);
  --hue-pink-bg: oklch(27% 0.05 350 / 0.55);      --hue-pink-fg: oklch(80% 0.1 350);
  --hue-purple-bg: oklch(27% 0.05 305 / 0.55);    --hue-purple-fg: oklch(80% 0.1 305);
  --hue-indigo-bg: oklch(27% 0.05 277 / 0.55);    --hue-indigo-fg: oklch(80% 0.1 277);
  --hue-blue-bg: oklch(27% 0.05 255 / 0.55);      --hue-blue-fg: oklch(80% 0.1 255);
  --hue-sky-bg: oklch(27% 0.04 237 / 0.55);       --hue-sky-fg: oklch(80% 0.1 237);
  --hue-teal-bg: oklch(27% 0.04 185 / 0.55);      --hue-teal-fg: oklch(80% 0.09 185);
  --hue-green-bg: oklch(27% 0.04 150 / 0.55);     --hue-green-fg: oklch(80% 0.11 150);
  --hue-orange-bg: oklch(28% 0.05 50 / 0.55);   --hue-orange-fg: oklch(80% 0.12 55);
  --hue-amber-bg: oklch(28% 0.05 75 / 0.55);    --hue-amber-fg: oklch(83% 0.12 80);
  --hue-yellow-bg: oklch(28% 0.05 95 / 0.55);   --hue-yellow-fg: oklch(86% 0.12 95);
  --hue-emerald-bg: oklch(27% 0.04 166 / 0.55);   --hue-emerald-fg: oklch(80% 0.1 166);
}

/* no backdrop-filter: every glass turns into its solid face, nothing becomes see-through */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root {
    --glass-chrome: #f7f7f7;
    --glass-bar: #ffffff;
    --glass-float: #ffffff;
    --glass-sheet: #fafafa;
    --glass: #ffffff;
    --toast-bg: #1f1f1f;
  }
  :root[data-theme="dark"] { --glass-chrome: #1b1b1b; --glass-bar: #171717; --glass-float: #262626; --glass-sheet: #222222; --glass: #202020; --toast-bg: #333333; }
}

/* touch: real 44 px targets and 16 px fields */
@media (pointer: coarse), (hover: none) {
  :root {
    --field-min: 16px;
    --hit: 44px;
    --send: 44px;
    --h-nav: 44px;
  }
}
@media (max-width: 760px) {
  :root { --gutter: 54px; --page-pad: 20px; --topbar-h: 52px; --card-pad: 16px; --set-box-max: 50vh; }
}

/* reduced motion: short fades only; springs become plain curves, distances and scales vanish */
@media (prefers-reduced-motion: reduce) {
  :root {
    --d0: 0ms;
    --d1: 80ms;
    --d2: 120ms;
    --d3: 140ms;
    --d4: 160ms;
    --d1-out: 60ms;
    --d2-out: 90ms;
    --d3-out: 100ms;
    --d4-out: 110ms;
    --d-menu: 120ms;
    --d-lens: 140ms;
    --d-sheet: 160ms;
    --spring: var(--ease-std);
    --spring-pop: var(--ease-std);
    --spring-menu: var(--ease-std);
    --spring-lens: var(--ease-std);
    --spring-sheet: var(--ease-std);
    --ease-move: var(--ease-std);
    --m-rise: 0px;
    --m-nudge: 0px;
    --m-scale: 1;
    --m-slide: 0px;
    --m-sheet: 0px;
    --m-drawer: 0px;
    --m-press: 1;
    --m-press-row: 1;
    --m-pop: 1;
  }
}
