Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

167 KB
Raw Blame
@import "tailwindcss" source("../src");
@source "../index.html";
@source "../rail.html";
/* The dev previews under scripts/testing render with this stylesheet too. */
@source "../scripts/testing/*-preview.tsx";
@source not "./locales";
@source not "./**/*.test.ts";
@source not "./**/*.test.tsx";
@import "@fontsource-variable/inter";
@import "@fontsource-variable/geist";
@import "@fontsource-variable/geist-mono";

/* Phones and tablets have no hover, and Tailwind only applies `hover:` and
   `group-hover:` under `@media (hover: hover)`. A control revealed on hover
   (`opacity-0 group-hover:opacity-100`) is therefore invisible there. Pair
   every such reveal with `touch:` so it stays visible on touch screens; mouse
   users see no change. src/components/touch-actions.test.ts enforces it. */
@custom-variant touch {
  @media (hover: none), (pointer: coarse) {
    @slot;
  }
}

/* Inline mentions keep the surrounding font metrics, including in the
   textarea mirror. No padding/border/font-weight changes that shift the caret. */
.mention-highlight {
  --mention-color: var(--color-ink-secondary);

  color: color-mix(in srgb, var(--mention-color) 30%, var(--color-ink));
  background: color-mix(in srgb, var(--mention-color) 24%, var(--color-inset));
  border-radius: 3px;
  text-decoration: underline;
  text-decoration-color: var(--mention-color);
  text-underline-offset: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}
.mention-highlight.mention-person {
  text-decoration-style: dotted;
}
.mention-highlight.mention-you {
  --mention-color: var(--color-accent);
  color: var(--color-ink);
  background: color-mix(in srgb, var(--mention-color) 40%, var(--color-inset));
  text-decoration: none;
  font-weight: 600;
  padding: 0 0.25em;
  border-radius: 4px;
}
::highlight(search-result-text) {
  color: var(--color-ink);
  background-color: color-mix(in srgb, var(--color-accent) 35%, transparent);
}
.mention-editor-mirror {
  /* Match the native textarea's direction independently for each paragraph. */
  unicode-bidi: plaintext;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  color: var(--color-ink);
}
.mention-editor textarea {
  position: relative;
  color: transparent;
  caret-color: var(--color-ink);
}
.mention-editor[data-composing] .mention-editor-mirror {
  visibility: hidden;
}
.mention-editor[data-composing] textarea {
  color: var(--color-ink);
}
.mention-editor[data-ghost] textarea::placeholder {
  color: transparent;
}
.mention-editor textarea::selection {
  color: var(--color-ink);
  background: var(--color-raised-hover);
}
/* Safari zooms smaller form text on focus. In a standalone phone window that
   can leave the header under the status bar after the keyboard closes. Keep
   the native editor at a readable touch size. */
@media (pointer: coarse) {
  .mention-editor textarea { font-size: 16px; }
}
@media (forced-colors: active) {
  .mention-editor-mirror, .mention-editor-ghost { display: none; }
  .mention-editor[data-ghost] textarea::placeholder { color: GrayText; }
  .mention-editor textarea, .mention-editor[data-composing] textarea { color: CanvasText; caret-color: CanvasText; }
}

/* ─────────────────────────────────────────────────────────────────────────
   SKINS

   A skin is nothing but a block of custom properties. `@theme` declares the
   tokens (and gives them the Midnight values, so the app renders correctly
   even before any skin is applied); every block below re-declares the same
   tokens under a `[data-skin]` selector.

   Two consequences worth knowing:

   1. The selector is `[data-skin=…]`, not `:root[data-skin=…]`. That means any
      element can open a skin context for its subtree — which is how the skin
      picker renders a live miniature of each skin instead of a painted mockup.
   2. These blocks sit outside `@layer`, so they win against Tailwind's theme
      layer regardless of specificity.

   Contrast is a design constraint here, not an afterthought: every text/surface
   pair in Atelier and Foundry clears WCAG AA (4.5:1), verified by measuring the
   rendered values rather than reading the hex. `scripts/check-skin-contrast.mjs`
   re-runs that check.
   ───────────────────────────────────────────────────────────────────────── */
.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  min-height: 30px;
  border-radius: 6px;
  color: var(--color-ink-secondary);
  cursor: pointer;
}
.table-action:hover, .table-action[aria-pressed="true"] { background: var(--color-raised); color: var(--color-ink); }
.table-action:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 1px; }
@media (pointer: coarse) { .table-action { min-width: 40px; min-height: 40px; } }
/* inside a 28px file pill under a reply, the table preview is a 24px circle */
.file-chip .table-action { width: 24px; height: 24px; min-width: 24px; min-height: 24px; border-radius: 9999px; }
/* a table card's hover plate fits the card's 24px top band; touch keeps 40px targets in a taller band */
@media (pointer: fine) { .table-plate .table-action { width: 24px; height: 24px; min-width: 24px; min-height: 24px; } }

@theme {
  --animate-panel-in: panel-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  --animate-panel-beside-in: panel-beside-in 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  --animate-sheet-in: sheet-in 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  --animate-workspace-in: workspace-in 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  /* A dialog cuts in on one frame: no entrance (the --motion-* tokens on :root). */
  --animate-pop-in: none;
  /* A menu or popover from its trigger: 100ms, transform and opacity only. */
  --animate-menu-in: menu-in var(--motion-menu-enter) var(--motion-menu-ease) both;
  --animate-pop-out: pop-out 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  --animate-caret: caret-blink 1s step-end infinite;
  --animate-msg-in: msg-in 0.18s cubic-bezier(0.22, 1, 0.36, 1);
  --animate-status-pulse: status-pulse 1.6s steps(2, jump-none) infinite;
  /* onboarding: a block of copy or a row arriving in a beat; `.stagger`
     spaces siblings out. Rare, first-time motion, so it may run past the
     300ms UI ceiling. */
  --animate-rise: rise 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
  --animate-fade-in: fade-in 0.2s ease-out both;
  --animate-meet-caret: meet-caret 1s linear infinite;
  /* onboarding: a spotlight card or a first-sight hint scaling in from its
     anchor. Never from zero; nothing appears from nothing. */
  --animate-spot-in: spot-in 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
  /* onboarding: a surface reacting once to an event (a routine firing) */
  --animate-ripple: ripple 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
  /* onboarding: a bolt travelling from a webhook address to the bot */
  --animate-bolt: bolt 0.9s cubic-bezier(0.77, 0, 0.175, 1) infinite;
  /* Team map: a computer whose bot is acting breathes; its link to the bot carries a slow flow of dashes. */
  --animate-computer-glow: computer-glow 2.4s ease-in-out infinite;
  --animate-link-flow: link-flow 1.1s linear infinite;
  /* Team map: a card's border acknowledging a message sent to it from the map. */
  --animate-sent-border: sent-border 1.2s ease-out forwards;

  /* Defaults = Midnight. Kept here so the app is never unstyled. */
  --color-app: #121212;
  --color-panel: #0e0e0e;
  --color-raised: #202020;
  --color-raised-hover: #2c2c2c;
  /* the composer pill. Every skin but Daylight paints it in `raised`; there
     it is the page colour with a hairline ring, so it needs a tone (and a
     ring, transparent everywhere else) of its own. */
  --color-composer: #1f1f1f;
  --color-composer-ring: #2a2a2a;
  /* popover and right-click menus. Same story as the composer: every skin
     but Daylight paints them in `card`, which there is the bot's bubble and
     a shade too grey for a menu. */
  --color-menu: #1f1f1f;
  --color-menu-hover: #f5f5f50f;
  --color-menu-active: #f5f5f514;
  --color-card: #1f1f1f;
  --color-inset: #1b1b1b;
  /* a control ON a card. The dark skins take their `raised` value, so this
     is a no-op for them; the light skins need a tone of their own, because
     there `raised` is pure white and a card is too. */
  --color-control: #282828;
  --color-hairline: #383838;
  /* the 0.5px line where two panes meet: the sidebar and the chat */
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  /* the window's frame: its top bar and the rail of places, around the
     app's card (the sidebar and the chat). The sidebar's colour in every skin,
     so the bar, the rail and the sidebar read as one field. */
  --color-frame: var(--color-panel);
  --color-ink: #f5f5f5;
  --color-ink-secondary: #f5f5f5a8;
  /* quiet text: timestamps, hints, placeholders, calendar hours. It used to
     be `text-ink-secondary/70`, which fades an ink already tuned close to
     AA and landed at 2.2–4:1. Each skin sets this to the quietest ink that
     still clears 4.5:1 on every text surface, raised-hover included; on the
     light skins that leaves little room below the secondary ink, so there
     size carries the hierarchy. Measured by pnpm check:contrast. */
  --color-ink-tertiary: #f5f5f591;
  --color-accent: #1084fe;
  --color-accent-border: #459ffe;
  /* the ring a keyboard user follows; sits on the accent so focus reads as
     "the app is talking to you", not as a browser default */
  --color-focus: #459ffe;
  --color-accent-text: #7fc0ff;
  --color-bubble-user: #5a5a5a;
  --color-success: #38d591;
  --color-danger: #ff5667;
  --color-warning: #ff9800;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  /* Some engines map `ui-monospace` to a proportional face, so concrete names come first. */
  --font-mono: "Geist Mono Variable", "SF Mono", SFMono-Regular, ui-monospace, Menlo,
    Consolas, "Liberation Mono", monospace;
  /* Geist's wght axis runs 100–900, so text sits between Regular and Medium; a static face rounds it to 400. */
  --font-weight-normal: 415;

  --shadow-lg: 0 6px 16px -8px rgb(0 0 0 / 0.18), 0 1px 3px rgb(0 0 0 / 0.06);
  --shadow-xl: 0 10px 28px -12px rgb(0 0 0 / 0.24), 0 2px 6px -2px rgb(0 0 0 / 0.08);
  --shadow-2xl: 0 16px 40px -16px rgb(0 0 0 / 0.3), 0 4px 10px -4px rgb(0 0 0 / 0.1);

  /* Add a rounded transition class.
     For situations where multiple transition-properties need to be set simultaneously,
     please use transition-[...], for example, transition-[color,background,border-radius] */
  --transition-property-rounded: border-radius;
}

/* Tokens that no utility generates — declared outside `@theme` so Tailwind
   can't tree-shake them away, and so a skin can redefine them freely. */
:root {
  --chat-bubble-max: 35rem;
  --chat-bubble-pct: 80%;
  --chat-card-pct: 88%;
  --chat-prose-max: 44rem;
  /* .chat-column: fills a narrow pane, then stops at this width and centers, so wider windows only grow the gutters. */
  --chat-column-max: 60rem;
  /* Menus; a phone rounds them like its sheets. */
  --radius-menu: 12px;
  /* One set of timings for menus, popovers, dialogs and hover (MenuMotion.tsx). A menu or popover enters over
     100ms on a strong ease-out from 40% opacity, so its first painted frame is already mostly there; a context menu
     and a dialog cut in on one frame; nothing animates out; a row's hover fill is a hard cut and a pill's tint is
     a short ease-out. */
  --motion-menu-enter: 100ms;
  --motion-menu-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --motion-hover: 0ms;
  --motion-pill-hover: 80ms;
}
:root[data-font] {
  --tracking-ui: 0;
}
:root[data-chat-width="wide"] {
  --chat-bubble-max: 64rem;
  --chat-bubble-pct: 92%;
  --chat-card-pct: 94%;
  --chat-prose-max: 64rem;
  --chat-column-max: 80rem;
}
:root[data-chat-width="full"] {
  --chat-bubble-max: 100%;
  --chat-bubble-pct: 96%;
  --chat-card-pct: 96%;
  --chat-prose-max: 100%;
  --chat-column-max: 100%;
}

:root {
  --code-color-scheme: dark;
  /* +0.012em suits Geist; a skin or a font choice with another face sets 0. */
  --tracking-ui: 0.012em;
  /* ink carried by a filled accent / danger surface (see the rule at the
     bottom of this file, which is what makes them take effect) */
  --color-accent-ink: #ffffff;
  --color-danger-ink: #ffffff;
  /* ink carried by the user's own bubble. A hex rather than the ink token so
     the contrast check can measure it; every dark skin repeats its ink here. */
  --color-bubble-user-ink: #f5f5f5;
  --color-success-ink: #072114;
  --color-scrollbar: #3d3d3d;
  /* second speed line of the mascot — contrasts against the app ground */
  --color-maus-line: #f5f5f5;
  --shadow-float: 0 0 #0000;
  /* The composer floats over the scrolling transcript: a soft lift with a 1px line of ink at 4%. One value for every
     skin; on a dark ground it reads as nothing, so the dark skins keep their 0.5px ring alone. */
  --shadow-composer: 0 2px 8px -1px rgb(0 0 0 / 0.05), 0 1px 2px rgb(0 0 0 / 0.03), 0 0 0 1px rgb(28 28 28 / 0.04);
}
/* Daylight's composer rests on that lift alone; its 0.5px ring comes back on hover and while it holds focus.
   Unlayered, so it wins over the ring utility the shell carries. */
:root[data-skin="daylight"] .composer-shell:not(:hover, :focus-within) {
  --tw-ring-color: transparent;
}

/* ── Midnight ──────────────────────────────────────────────────────────────
   The upstream palette, pixel-sampled from the real Grok app. Repeated here
   (rather than relying on the `@theme` defaults) so that a `[data-skin]`
   subtree can switch *back* to it — the picker needs that.

   Two upstream contrast gaps are preserved deliberately, because this skin's
   job is to be the original: white on the accent fill measures 3.65:1 and
   white on the danger fill 3.32:1, both short of AA for the 13–15px labels
   they carry. Atelier and Foundry fix this via --color-accent-ink.
   ───────────────────────────────────────────────────────────────────────── */
[data-skin="midnight"] {
  --code-color-scheme: dark;
  --color-app: #121212;
  --color-panel: #0e0e0e;
  --color-raised: #202020;
  --color-raised-hover: #2c2c2c;
  --color-composer: #1f1f1f;
  --color-composer-ring: #2a2a2a;
  --color-card: #1f1f1f;
  --color-menu: #1f1f1f;    /* = card: unchanged */
  --color-menu-hover: #f5f5f50f;
  --color-menu-active: #f5f5f514;
  --color-inset: #1b1b1b;
  --color-control: #282828;
  --color-hairline: #383838;
  --color-ink: #f5f5f5;
  --color-ink-secondary: #f5f5f5a8;
  --color-ink-tertiary: #f5f5f591;
  --color-accent: #1084fe;
  --color-accent-border: #459ffe;
  --color-accent-text: #7fc0ff;
  --color-accent-ink: #ffffff;
  --color-bubble-user: #5a5a5a;
  --color-bubble-user-ink: #f5f5f5;   /* = ink: unchanged */
  --color-success: #38d591;
  --color-danger: #ff5667;
  --color-danger-ink: #ffffff;
  --color-success-ink: #072114;
  --color-warning: #ff9800;
  --color-scrollbar: #3d3d3d;
  --color-maus-line: #f5f5f5;

  --color-edge: #f5f5f50f;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  --tracking-ui: 0.012em;
  /* One radius scale, shared with Daylight. What takes which step: buttons
     and pills full; keycaps, chips and menu rows 6; fields, controls and
     sidebar rows 8; cards and menus 12; dialogs 16; bubbles and the cards in
     the transcript 18; the composer 22 (18 once it wraps); the window's panes 0. */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-3xl: 16px;
  --radius-4xl: 18px;
  --identity-green: #009957;
  --identity-blue: #377FE6;
  --identity-red: #D94B52;
  --identity-orange: #E78531;
  --identity-purple: #8d69ce;
  --identity-cyan: #0EA5C6;
  --identity-pink: #D84F8B;
  --identity-yellow: #D8A729;
  --identity-teal: #01A492;
  --identity-coral: #E5634E;
  --identity-silver: #A8ADB4;
  --identity-chrome: #B3BAC4;
}

/* ── Atelier ───────────────────────────────────────────────────────────────
   Daylight on paper, and the inverse of Midnight in every axis. Its one
   structural idea: surfaces get BRIGHTER as they rise — rail, sidebar,
   content — so the ground closest to the work is the lightest, the opposite
   of a dark skin where raised means lighter-grey.

   Four tones were darkened from the first draft to clear AA; the original
   value is named next to each, so the drift stays auditable.
   ───────────────────────────────────────────────────────────────────────── */
[data-skin="atelier"] {
  --code-color-scheme: light;
  --color-app: #f5f1eb;           /* outermost ground */
  --color-panel: #fbf8f2;         /* sidebar */
  --color-raised: #ffffff;        /* content — raised means lighter here */
  --color-raised-hover: #f2e9dc;  /* warm beige doubles as the hover fill */
  --color-composer: #ffffff;    /* = raised: unchanged */
  --color-composer-ring: transparent;
  --color-card: #ffffff;
  --color-menu: #ffffff;    /* = card: unchanged */
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-inset: #f5f1eb;         /* inset surfaces pick the rail tone back up */
  --color-control: #ece4d6;       /* raised is white here and so is a card, so
                                     a control needs its own tone: 1.26:1 on a
                                     card, and raised-hover still lifts off it */
  --color-hairline: #c8bda8;      /* #ece7dd was 1.11:1 on the rail → 1.65:1 */

  --color-ink: #1a1a18;           /* 17.4:1 on white */
  --color-ink-secondary: #6b6559; /* #8b8578 was 3.67:1 → 5.78:1 */
  --color-ink-tertiary: #6d685c;

  /* Two accent tones: the fill carries white, the text stands on white. */
  --color-accent: #a05f25;        /* #b06a2c darkened → 5.05:1 */
  --color-accent-border: #b06a2c; /* the original tone lives on as the border */
  --color-accent-text: #96551f;   /* for links on a light ground — 5.81:1 */
  --color-focus: #96551f;         /* the ring rides the accent, not Grok blue */
  --color-accent-ink: #ffffff;
  --color-bubble-user: #f2e9dc;   /* your own messages in the badge beige */
  --color-bubble-user-ink: #1a1a18;   /* = ink: unchanged */

  --color-success: #3f6b47;
  --color-danger: #a33a32;
  --color-danger-ink: #ffffff;
  --color-success-ink: #ffffff;
  --color-warning: #7a5f31;       /* darkened → 4.98:1 */
  --color-scrollbar: #c9c0ae;
  --color-maus-line: #6b6559;

  /* System faces rather than Geist: paper reads as the platform's own. */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --tracking-ui: 0;
  --radius-lg: 6px;
  --radius-xl: 10px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --radius-2xl: 16px; --radius-3xl: 24px; --radius-4xl: 32px;
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  --identity-green: #007f48;
  --identity-blue: #1b6adc;
  --identity-red: #d12c34;
  --identity-orange: #a95914;
  --identity-purple: #8057C8;
  --identity-cyan: #0a7891;
  --identity-pink: #ca2d72;
  --identity-yellow: #896a19;
  --identity-teal: #017c6f;
  --identity-coral: #cd361e;
  --identity-silver: #686f79;
  --identity-chrome: #646f80;
}

/* ── Foundry ───────────────────────────────────────────────────────────────
   Night shift. The third corner of the grid: Midnight is dark and cool,
   Atelier light and warm — this one is dark and warm, which is the register
   most of this app's actual use falls into.

   Its one structural idea, and the thing that makes it read as metal rather
   than as "Atelier with the lights off": the accent is the brightest thing on
   screen, not a darker patch of it. Brass at #d99a3e glows against the ground
   at 7.9:1 and carries near-black lettering at 7.4:1 — so filled buttons read
   as lit, not as painted. That inversion is only possible because
   --color-accent-ink exists; with hardcoded white text the accent would have
   to stay dark and the skin would lose its point.

   Surfaces warm up as they rise (#100e0b → #262019), the way material does as
   it comes closer to the lamp. Corners are tighter than Atelier's — 4px and
   8px — because sheet metal doesn't round the way paper does.
   ───────────────────────────────────────────────────────────────────────── */
[data-skin="foundry"] {
  --code-color-scheme: dark;
  --color-app: #100e0b;           /* deepest ground, warm black */
  --color-panel: #171410;         /* sidebar */
  --color-raised: #262019;        /* raised means warmer, not just lighter */
  --color-raised-hover: #322b21;
  --color-composer: #262019;    /* = raised: unchanged */
  --color-composer-ring: transparent;
  --color-card: #1e1a14;
  --color-menu: #1e1a14;    /* = card: unchanged */
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-inset: #0b0a08;         /* inset sinks below the ground */
  --color-control: #262019;       /* = raised: Foundry is unchanged */
  --color-hairline: #3d3529;      /* visible on purpose — this UI has edges */

  --color-ink: #f4efe4;           /* warm off-white, never pure #fff */
  --color-ink-secondary: #b0a696; /* 6.7:1 on raised, 5.9:1 on hover */
  --color-ink-tertiary: #9c9384;

  /* Brass. Bright fill, dark lettering — the inversion described above. */
  --color-accent: #d99a3e;
  --color-accent-border: #e8b25e;
  --color-accent-text: #e0a44c;   /* 8.6:1 on the ground, for links */
  --color-focus: #e0a44c;         /* the ring rides the accent, not Grok blue */
  --color-accent-ink: #1c150c;    /* 7.4:1 on the brass fill */
  --color-bubble-user: #2a2318;   /* your own messages, one step out of the card */
  --color-bubble-user-ink: #f4efe4;   /* = ink: unchanged */

  --color-success: #57b078;
  --color-danger: #e0685e;        /* a lamp, not a paint chip */
  --color-danger-ink: #1c0d0b;
  --color-success-ink: #1c150c;
  --color-warning: #dfa441;
  --color-scrollbar: #3d3529;
  --color-maus-line: #b0a696;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  --tracking-ui: 0.012em;
  --radius-lg: 4px;
  --radius-xl: 8px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --radius-2xl: 16px; --radius-3xl: 24px; --radius-4xl: 32px;
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  --identity-green: #009957;
  --identity-blue: #377FE6;
  --identity-red: #D94B52;
  --identity-orange: #E78531;
  --identity-purple: #8c67cd;
  --identity-cyan: #0EA5C6;
  --identity-pink: #D84F8B;
  --identity-yellow: #D8A729;
  --identity-teal: #01A492;
  --identity-coral: #E5634E;
  --identity-silver: #A8ADB4;
  --identity-chrome: #B3BAC4;
}

/* ── Lagoon ────────────────────────────────────────────────────────────────
   Cool daylight — the fourth corner, and the one the grid was missing:
   Midnight is dark and cool, Atelier light and warm, Foundry dark and warm.

   Where Atelier is paper, this is glazed ceramic. The neutrals carry a green-
   blue cast rather than a cream one (#eef2f2, not #f5f1eb), so the whole
   surface reads cool without a single saturated pixel, and the deep teal
   accent belongs to the ground instead of sitting on top of it. Even the ink
   is a very dark petrol rather than a neutral black — on a tinted ground a
   truly neutral black reads as a foreign object.

   Corners are the most generous of the four (8px / 14px): glass and ceramic
   round more than paper does, and far more than sheet metal.
   ───────────────────────────────────────────────────────────────────────── */
[data-skin="lagoon"] {
  --code-color-scheme: light;
  /* The tint is the point, so it is carried by the surfaces, not by a button:
     the ground sits 13 points of green-blue above its red channel, roughly
     three times Atelier's cream cast, which is what makes the skin read as
     teal at a glance. Raised surfaces stay pure white as the contrast anchor —
     tinting those too turns the whole thing to soup. */
  --color-app: #dfeceb;
  --color-panel: #ecf4f3;
  --color-raised: #ffffff;
  --color-raised-hover: #cfe4e1;
  --color-composer: #ffffff;    /* = raised: unchanged */
  --color-composer-ring: transparent;
  --color-card: #ffffff;
  --color-menu: #ffffff;    /* = card: unchanged */
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-inset: #d5e8e5;
  --color-control: #c3dcd9;       /* Lagoon's surfaces climb white → panel →
                                     app → inset → hover in small steps, so a
                                     control has to sit below the lot to clear
                                     every one it can land on: 1.44:1 on a
                                     card, 1.29:1 on the panel, 1.13:1 on an
                                     inset row, 1.09:1 under the hover tone. */
  --color-hairline: #aebfbd;      /* 1.60:1 — level with the other three */

  --color-ink: #14201f;           /* dark petrol; a neutral black would read
                                     as a foreign object on a tinted ground */
  --color-ink-secondary: #4d5c5b; /* 7.0:1 on white, 5.8:1 on the ground */
  --color-ink-tertiary: #566564;

  --color-accent: #11736d;        /* deep teal, carries white at 5.68:1 */
  --color-accent-border: #14807a;
  --color-accent-text: #0d5f5a;   /* 7.5:1 on a card */
  --color-focus: #0d5f5a;         /* the ring rides the accent, not Grok blue */
  --color-accent-ink: #ffffff;
  --color-bubble-user: #cfe4e1;
  --color-bubble-user-ink: #14201f;   /* = ink: unchanged */

  --color-success: #2f6b4f;
  --color-danger: #a8382f;
  --color-danger-ink: #ffffff;
  --color-success-ink: #ffffff;
  --color-warning: #7a5a2a;
  --color-scrollbar: #a6b8b6;
  --color-maus-line: #4d5c5b;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --tracking-ui: 0;
  --radius-lg: 8px;
  --radius-xl: 14px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --radius-2xl: 16px; --radius-3xl: 24px; --radius-4xl: 32px;
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  --identity-green: #007945;
  --identity-blue: #1a65d1;
  --identity-red: #c82a32;
  --identity-orange: #a25513;
  --identity-purple: #7c51c6;
  --identity-cyan: #0a738b;
  --identity-pink: #c12b6d;
  --identity-yellow: #836518;
  --identity-teal: #01776a;
  --identity-coral: #c3341d;
  --identity-silver: #646a73;
  --identity-chrome: #5f6a7b;
}

/* ── Graphite ─────────────────────────────────────────────────────────────
   Neutral charcoal for people who want a dark workspace without Midnight's
   near-black contrast or Foundry's warmth. Steel blue stays deliberately
   desaturated: it marks actions and focus without making the chrome glow.
   ───────────────────────────────────────────────────────────────────────── */
[data-skin="graphite"] {
  --code-color-scheme: dark;
  --color-app: #111214;
  --color-panel: #181a1d;
  --color-raised: #2a2d32;
  --color-raised-hover: #353941;
  --color-composer: #2a2d32;    /* = raised: unchanged */
  --color-composer-ring: transparent;
  --color-card: #22252a;
  --color-menu: #22252a;    /* = card: unchanged */
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-inset: #0d0e10;
  --color-control: #2a2d32;
  --color-hairline: #3b4048;

  --color-ink: #f2f4f7;
  --color-ink-secondary: #b3b8c2;
  --color-ink-tertiary: #9fa4ad;

  --color-accent: #4f75a2;
  --color-accent-border: #698fbb;
  --color-accent-text: #8fb4df;
  --color-focus: #8fb4df;
  --color-accent-ink: #ffffff;
  --color-bubble-user: #30343a;
  --color-bubble-user-ink: #f2f4f7;   /* = ink: unchanged */

  --color-success: #63b58a;
  --color-danger: #dd6b73;
  --color-danger-ink: #1e0b0e;
  --color-success-ink: #101a14;
  --color-warning: #d3a150;
  --color-scrollbar: #464b54;
  --color-maus-line: #b3b8c2;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  --tracking-ui: 0.012em;
  --radius-lg: 6px;
  --radius-xl: 10px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --radius-2xl: 16px; --radius-3xl: 24px; --radius-4xl: 32px;
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  --identity-green: #009957;
  --identity-blue: #377FE6;
  --identity-red: #D94B52;
  --identity-orange: #E78531;
  --identity-purple: #8d69ce;
  --identity-cyan: #0EA5C6;
  --identity-pink: #D84F8B;
  --identity-yellow: #D8A729;
  --identity-teal: #01A492;
  --identity-coral: #E5634E;
  --identity-silver: #A8ADB4;
  --identity-chrome: #B3BAC4;
}

/* ── Linen ────────────────────────────────────────────────────────────────
   A neutral daylight skin: less cream than Atelier and less blue-green than
   Lagoon. Navy is used as ink rather than decoration, keeping the workspace
   crisp and familiar instead of colourful.
   ───────────────────────────────────────────────────────────────────────── */
[data-skin="linen"] {
  --code-color-scheme: light;
  --color-app: #eceff3;
  --color-panel: #f5f6f8;
  --color-raised: #ffffff;
  --color-raised-hover: #e1e6ed;
  --color-composer: #ffffff;    /* = raised: unchanged */
  --color-composer-ring: transparent;
  --color-card: #ffffff;
  --color-menu: #ffffff;    /* = card: unchanged */
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-inset: #e6e9ee;
  --color-control: #d3d9e1;
  --color-hairline: #b4bbc5;

  --color-ink: #1d2229;
  --color-ink-secondary: #59616c;
  --color-ink-tertiary: #5f6671;

  --color-accent: #355f8a;
  --color-accent-border: #4978a6;
  --color-accent-text: #2c5680;
  --color-focus: #2c5680;
  --color-accent-ink: #ffffff;
  --color-bubble-user: #e1e6ed;
  --color-bubble-user-ink: #1d2229;   /* = ink: unchanged */

  --color-success: #2f704f;
  --color-danger: #a83d48;
  --color-danger-ink: #ffffff;
  --color-success-ink: #ffffff;
  --color-warning: #765b2b;
  --color-scrollbar: #aeb6c0;
  --color-maus-line: #59616c;

  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, sans-serif;
  --tracking-ui: 0;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --radius-2xl: 16px; --radius-3xl: 24px; --radius-4xl: 32px;
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  --identity-green: #007d47;
  --identity-blue: #1b68d7;
  --identity-red: #ce2c34;
  --identity-orange: #a75713;
  --identity-purple: #7f55c8;
  --identity-cyan: #0a778e;
  --identity-pink: #c72c70;
  --identity-yellow: #886819;
  --identity-teal: #017a6d;
  --identity-coral: #c9361e;
  --identity-silver: #676d77;
  --identity-chrome: #626d7e;
}

/* ── Dusk ─────────────────────────────────────────────────────────────────
   A restrained plum-dark alternative. The violet lives in the neutrals as
   much as the accent, so the skin feels cohesive rather than neon or themed.
   ───────────────────────────────────────────────────────────────────────── */
[data-skin="dusk"] {
  --code-color-scheme: dark;
  --color-app: #121014;
  --color-panel: #19161c;
  --color-raised: #2b2630;
  --color-raised-hover: #37303d;
  --color-composer: #2b2630;    /* = raised: unchanged */
  --color-composer-ring: transparent;
  --color-card: #231f27;
  --color-menu: #231f27;    /* = card: unchanged */
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-inset: #0d0b0f;
  --color-control: #2b2630;
  --color-hairline: #403847;

  --color-ink: #f4eff6;
  --color-ink-secondary: #b9afbd;
  --color-ink-tertiary: #a199a5;

  --color-accent: #765683;
  --color-accent-border: #9670a3;
  --color-accent-text: #c49bd2;
  --color-focus: #c49bd2;
  --color-accent-ink: #ffffff;
  --color-bubble-user: #332b38;
  --color-bubble-user-ink: #f4eff6;   /* = ink: unchanged */

  --color-success: #6fad83;
  --color-danger: #db727a;
  --color-danger-ink: #210c10;
  --color-success-ink: #101812;
  --color-warning: #d0a35d;
  --color-scrollbar: #4a414f;
  --color-maus-line: #b9afbd;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  --tracking-ui: 0.012em;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --radius-2xl: 16px; --radius-3xl: 24px; --radius-4xl: 32px;
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  --identity-green: #009957;
  --identity-blue: #377FE6;
  --identity-red: #D94B52;
  --identity-orange: #E78531;
  --identity-purple: #8d68ce;
  --identity-cyan: #0EA5C6;
  --identity-pink: #D84F8B;
  --identity-yellow: #D8A729;
  --identity-teal: #01A492;
  --identity-coral: #E5634E;
  --identity-silver: #A8ADB4;
  --identity-chrome: #B3BAC4;
}

/* ── Daylight ─────────────────────────────────────────────────────────────
   Midnight's twin in light: near-white chrome, a neutral sidebar, white
   floating surfaces and translucent ink for text and hairlines, so every
   step is the same #1c1c1c ink at a different strength.

   Its structural quirk is the user's own bubble: ink on a near-white page,
   the one place a light skin carries inverted ink. That is what
   --color-bubble-user-ink exists for — see the rule at the bottom of the
   file. The surfaces are a short ladder: page #fcfcfc, sidebar and the
   window's frame #f5f5f5, selected row #e4e4e4, a bot's message #efefef,
   and white for the composer and menus.

   Where a measured value misses AA its nearest passing step is used: the
   tertiary ink is stronger than its 56%, and the accent, danger, success
   and warning fills are their deeper tones, so white and their text clear
   4.5:1 (pnpm check:contrast).
   ───────────────────────────────────────────────────────────────────────── */
[data-skin="daylight"] {
  --code-color-scheme: light;
  --color-app: #fcfcfc;           /* the thread */
  --color-panel: #f5f5f5;         /* sidebar */
  --color-raised: #e4e4e4;        /* the sidebar's selected row: 8% ink on the panel */
  --color-raised-hover: #d8d8d8;
  --color-card: #efefef;          /* what a bot says: 6% ink on the page */
  --color-inset: #e9e9e9;         /* the search field */
  --color-control: #e3e3e3;       /* a chip on a card */
  /* 24% ink: whole, the firm line; at /50, the 12% line between surfaces. */
  --color-hairline: #1c1c1c3d;
  --color-edge: #1c1c1c1f;

  --color-ink: #1c1c1c;
  --color-ink-secondary: #1c1c1cad;
  --color-ink-tertiary: #1c1c1ca6;

  --color-accent: #126fd4;
  --color-accent-border: #1680f3;
  --color-accent-text: #0b69cc;
  --color-focus: #0b6dd3;
  --color-accent-ink: #ffffff;
  --color-composer: #ffffff;
  --color-composer-ring: #1c1c1c1f;
  --color-menu: #ffffff;
  --color-menu-hover: #1c1c1c0f;
  --color-menu-active: #1c1c1c14;
  --color-bubble-user: #1c1c1c;   /* your own messages, inverted */
  --color-bubble-user-ink: #fcfcfc;

  --color-success: #007a44;
  --color-danger: #cd2834;
  --color-danger-ink: #ffffff;
  --color-success-ink: #ffffff;
  --color-warning: #9c5b00;
  --color-scrollbar: #c4c4c4;
  --color-maus-line: #5f5f5f;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  --tracking-ui: 0.012em;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-3xl: 16px;
  --radius-4xl: 18px;
  --identity-green: #00864c;
  --identity-blue: #2271e3;
  --identity-red: #d63a42;
  --identity-orange: #b35e15;
  --identity-purple: #8057C8;
  --identity-cyan: #0b7f99;
  --identity-pink: #d2357a;
  --identity-yellow: #91701b;
  --identity-teal: #018375;
  --identity-coral: #d83920;
  --identity-silver: #6e7580;
  --identity-chrome: #697688;
  --shadow-float: 0 4px 12px -1px rgb(28 28 28 / 0.08), 0 2px 4px -2px rgb(28 28 28 / 0.06);
}

/* ── Meadow ───────────────────────────────────────────────────────────────
   The MausBot brand look: a white page, a sidebar washed in the faintest
   green, mint for the selected row and a calm green accent. The brand
   green #1f8a52 carries white at only 4.3:1, so the filled accent is one
   step deeper; the brand green stays as the accent border.
   ───────────────────────────────────────────────────────────────────────── */
[data-skin="meadow"] {
  --code-color-scheme: light;
  --color-app: #ffffff;           /* the thread */
  --color-panel: #f6f8f6;         /* sidebar */
  --color-raised: #e9eeea;
  --color-raised-hover: #d6efdf;  /* the selected row, mint */
  --color-card: #f1f5f2;          /* what a bot says */
  --color-inset: #e7ece8;         /* the search field */
  --color-control: #dce3de;       /* a chip on a card */
  --color-hairline: #c9d3cc;

  --color-ink: #0f1a13;
  --color-ink-secondary: #3e4a42;
  --color-ink-tertiary: #4f5c54;

  --color-accent: #1a7a48;
  --color-accent-border: #1f8a52;
  --color-accent-text: #176b3f;
  --color-focus: #1a7a48;
  --color-accent-ink: #ffffff;
  --color-composer: #ffffff;
  --color-composer-ring: #e3e9e4;
  --color-menu: #ffffff;
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-bubble-user: #e1e9e3;   /* your own messages, a step under a bot's card */
  --color-bubble-user-ink: #0f1a13;

  --color-success: #1a7a48;
  --color-danger: #c02b3a;
  --color-danger-ink: #ffffff;
  --color-success-ink: #ffffff;
  --color-warning: #8a5a00;
  --color-scrollbar: #c3cdc6;
  --color-maus-line: #5a675f;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  --tracking-ui: 0.012em;
  --radius-lg: 10px;
  --radius-xl: 16px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --radius-2xl: 16px; --radius-3xl: 24px; --radius-4xl: 32px;
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  --identity-green: #00884e;
  --identity-blue: #2573e4;
  --identity-red: #d63f47;
  --identity-orange: #b65f15;
  --identity-purple: #8057C8;
  --identity-cyan: #0b819b;
  --identity-pink: #d3397d;
  --identity-yellow: #93721b;
  --identity-teal: #018577;
  --identity-coral: #db3a20;
  --identity-silver: #707782;
  --identity-chrome: #6b778a;
}

/* ── Pop ──────────────────────────────────────────────────────────────────
   Cream paper, white cards, ink outlines and hard offset shadows. Light-only,
   with an ink bubble for your own messages, so it takes the same @scope
   treatment as Daylight. The brand grape #8b5cf6 carries white at
   only 4.2:1, so the filled accent is one step deeper; the brand grape stays
   as the accent border. Mint, butter and coral are fills for ink text only.
   ───────────────────────────────────────────────────────────────────────── */
[data-skin="pop"] {
  --code-color-scheme: light;
  --color-app: #fdf5ea;           /* the page */
  --color-panel: #f6ebdb;         /* sidebar */
  --color-raised: #efe3d1;
  --color-raised-hover: #e4d4bc;  /* the selected row */
  --color-card: #ffffff;
  --color-inset: #f2e8d7;
  --color-control: #ece0cc;
  --color-hairline: #1b1613;

  --color-ink: #1b1613;
  --color-ink-secondary: #3a322d;
  --color-ink-tertiary: #5f5650;

  --color-accent: #7f52f0;
  --color-accent-border: #8b5cf6;
  --color-accent-text: #6d28d9;
  --color-focus: #7f52f0;
  --color-accent-ink: #ffffff;
  --color-composer: #ffffff;
  --color-composer-ring: #1b1613;
  --color-menu: #ffffff;
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-bubble-user: #1b1613;   /* your own messages, inverted */
  --color-bubble-user-ink: #ffffff;

  --color-success: #1f7a4d;
  --color-danger: #d93a2b;
  --color-danger-ink: #ffffff;
  --color-success-ink: #ffffff;
  --color-warning: #8a5a00;
  --color-scrollbar: #d0bfa6;
  --color-maus-line: #6b625b;

  --font-sans: "Plus Jakarta Sans", ui-rounded, "SF Pro Rounded", "Geist Variable",
    -apple-system, system-ui, "Segoe UI", sans-serif;
  --tracking-ui: 0;
  --radius-lg: 12px;
  --radius-xl: 18px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --radius-2xl: 16px; --radius-3xl: 24px; --radius-4xl: 32px;
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  --identity-green: #00824a;
  --identity-blue: #1c6de0;
  --identity-red: #d4323a;
  --identity-orange: #ae5b14;
  --identity-purple: #8057C8;
  --identity-cyan: #0a7b94;
  --identity-pink: #cf2e75;
  --identity-yellow: #8d6c1a;
  --identity-teal: #017f72;
  --identity-coral: #d1381f;
  --identity-silver: #6a727c;
  --identity-chrome: #667284;
}

[data-skin="halloween"] {
  --code-color-scheme: dark;
  --color-app: #110d16;
  --color-panel: #17121e;
  --color-raised: #262030;
  --color-raised-hover: #2e2539;
  --color-composer: #1d1725;
  --color-composer-ring: #352a40;
  --color-card: #201a29;
  --color-menu: #1e1827;
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-inset: #1b1622;
  --color-control: #262030;
  --color-hairline: #3b3048;

  --color-ink: #f8efe2;
  --color-ink-secondary: #c2b3cc;
  --color-ink-tertiary: #a898b4;

  --color-accent: #ff7f1f;
  --color-accent-border: #ff8f3a;
  --color-accent-text: #ffa060;
  --color-focus: #ff8f3a;
  --color-accent-ink: #1d0e02;
  --color-bubble-user: #3d2818;
  --color-bubble-user-ink: #fff1e2;

  --color-success: #7cc48f;
  --color-danger: #f0727c;
  --color-danger-ink: #240a0e;
  --color-success-ink: #0d1a10;
  --color-warning: #f2b45a;
  --color-scrollbar: #3b3048;
  --color-maus-line: #c2b3cc;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  --tracking-ui: 0.012em;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --radius-2xl: 16px; --radius-3xl: 24px; --radius-4xl: 32px;
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  --identity-green: #009957;
  --identity-blue: #377FE6;
  --identity-red: #D94B52;
  --identity-orange: #E78531;
  --identity-purple: #8c67cd;
  --identity-cyan: #0EA5C6;
  --identity-pink: #D84F8B;
  --identity-yellow: #D8A729;
  --identity-teal: #01A492;
  --identity-coral: #E5634E;
  --identity-silver: #A8ADB4;
  --identity-chrome: #B3BAC4;
}

[data-skin="diwali"] {
  --code-color-scheme: dark;
  --color-app: #100d1f;
  --color-panel: #161229;
  --color-raised: #282142;
  --color-raised-hover: #30284d;
  --color-composer: #1c1732;
  --color-composer-ring: #342b52;
  --color-card: #1f1936;
  --color-menu: #1d1834;
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-inset: #1a1530;
  --color-control: #282142;
  --color-hairline: #392f5a;

  --color-ink: #fff3e0;
  --color-ink-secondary: #cdbfdc;
  --color-ink-tertiary: #ab9dc0;

  --color-accent: #ffb22e;
  --color-accent-border: #ffc04f;
  --color-accent-text: #ffc861;
  --color-focus: #ffc04f;
  --color-accent-ink: #231402;
  --color-bubble-user: #43301a;
  --color-bubble-user-ink: #fff3e0;

  --color-success: #7cc48f;
  --color-danger: #f0727c;
  --color-danger-ink: #240a0e;
  --color-success-ink: #0d1a10;
  --color-warning: #f2b45a;
  --color-scrollbar: #392f5a;
  --color-maus-line: #cdbfdc;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  --tracking-ui: 0.012em;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-xs: 2px; --radius-sm: 4px; --radius-md: 6px;
  --radius-2xl: 16px; --radius-3xl: 24px; --radius-4xl: 32px;
  --color-edge: color-mix(in srgb, var(--color-ink) 8%, transparent);
  --identity-green: #009957;
  --identity-blue: #377FE6;
  --identity-red: #D94B52;
  --identity-orange: #E78531;
  --identity-purple: #8c68cd;
  --identity-cyan: #0EA5C6;
  --identity-pink: #D84F8B;
  --identity-yellow: #D8A729;
  --identity-teal: #01A492;
  --identity-coral: #E5634E;
  --identity-silver: #A8ADB4;
  --identity-chrome: #B3BAC4;
}

[data-skin="aurora"] {
  --code-color-scheme: dark;
  --color-app: #0b0c0b;
  --color-panel: #131413;
  --color-frame: var(--color-panel);
  --color-raised: #1d1f1d;
  --color-raised-hover: #272a27;
  --color-composer: #161816;
  --color-composer-ring: #2c302c;
  --color-card: #1a1c1a;
  --color-menu: #1a1c1a;
  --color-menu-hover: color-mix(in srgb, var(--color-raised) 70%, transparent);
  --color-menu-active: var(--color-raised);
  --color-inset: #151715;
  --color-control: #242724;
  --color-hairline: #343834;

  --color-ink: #f2f5f2;
  --color-ink-secondary: #f2f5f2a8;
  --color-ink-tertiary: #f2f5f291;

  --color-accent: #3ccf73;
  --color-accent-border: #5ad98a;
  --color-accent-text: #6ee69a;
  --color-focus: #5ad98a;
  --color-accent-ink: #04170b;
  --color-bubble-user: #18432c;
  --color-bubble-user-ink: #ecfff2;

  --color-success: #4ade80;
  --color-danger: #ff5f6d;
  --color-danger-ink: #2a0508;
  --color-success-ink: #052e16;
  --color-warning: #f5a524;
  --color-scrollbar: #343834;
  --color-maus-line: #f2f5f2;

  --color-edge: #f2f5f20f;

  --font-sans: "Geist Variable", -apple-system, BlinkMacSystemFont,
    "Segoe UI", system-ui, sans-serif;
  --tracking-ui: 0.012em;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 14px;
  --radius-3xl: 16px;
  --radius-4xl: 18px;
  --identity-green: #009957;
  --identity-blue: #377FE6;
  --identity-red: #D94B52;
  --identity-orange: #E78531;
  --identity-purple: #8a65cd;
  --identity-cyan: #0EA5C6;
  --identity-pink: #D84F8B;
  --identity-yellow: #D8A729;
  --identity-teal: #01A492;
  --identity-coral: #E5634E;
  --identity-silver: #A8ADB4;
  --identity-chrome: #B3BAC4;
}

/* Every popover and menu in the menu tone, flat in Midnight and on a soft lift in Daylight. A popover's rim is its
   border, never a ring, so clearing box-shadow leaves the rim. */
.popover-surface {
  background-color: var(--color-menu);
}
/* Lucide draws at 2px by default, heavy beside Geist; one lighter stroke for every icon left at that default. */
:where(svg.lucide[stroke-width="2"]) {
  stroke-width: 1.9;
}
:root[data-skin="midnight"] .popover-surface {
  box-shadow: 0 14px 32px -10px rgb(0 0 0 / 0.7), 0 2px 8px rgb(0 0 0 / 0.35);
}
:root[data-skin="daylight"] .popover-surface {
  box-shadow: 0 10px 20px -3px rgb(28 28 28 / 0.1), 0 4px 6px -4px rgb(28 28 28 / 0.1);
}

/* In Midnight and Daylight a primary action is a neutral pill: white on dark, black on light. Unlayered, so it wins
   over the accent fill a call site may still carry. */
:root:is([data-skin="midnight"], [data-skin="daylight"]) .ui-button-primary {
  border-color: transparent;
  background: var(--color-ink);
  color: var(--color-app);
}
:root:is([data-skin="midnight"], [data-skin="daylight"]) .ui-button-primary:not(:disabled):is(:hover, :active) {
  background: color-mix(in srgb, var(--color-ink) 88.5%, var(--color-app));
  color: var(--color-app);
  filter: none;
}
:root:is([data-skin="midnight"], [data-skin="daylight"]) .ui-button-primary:disabled {
  opacity: 1;
  background: color-mix(in srgb, var(--color-ink) 13%, transparent);
  color: color-mix(in srgb, var(--color-ink) 30%, transparent);
}
:root[data-skin="daylight"] .ui-button-primary:disabled {
  background: color-mix(in srgb, var(--color-ink) 15%, transparent);
}

/* A primary action that belongs to one bot wears that bot's flat bubble tone in every skin. Unlayered, like the
   neutral pill above, so no utility repaints it. Its focus ring is the global one, 2px off the fill, so it reads on
   any bot colour; a disabled one takes the same quiet colours as a disabled accent button. */
.bot-button {
  border-color: transparent;
  background-color: var(--bot-button);
  color: var(--bot-button-ink);
}
.bot-button:enabled:hover {
  background-color: var(--bot-button-hover);
}
.bot-button:enabled:active {
  background-color: var(--bot-button-pressed);
}
.bot-button:disabled {
  background-color: var(--color-raised-hover);
  color: var(--color-ink-secondary);
  opacity: 1;
}

/* Shiki emits both palettes so cached blocks follow the nearest skin without
   re-tokenizing. Scope the scheme to code; native controls keep their styling. */
.chat-md .shiki {
  color-scheme: var(--code-color-scheme);
}

/* Keep KaTeX's formula layout intact, but scroll long formulas inside the
   bubble instead of letting them overflow it. */
.chat-md .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
}

.chat-md :not(.katex-display) > .katex {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  vertical-align: middle;
}

/* Plain-text message bodies (user turns, webhook tasks, error fallbacks) are
   written in whatever language the person used, which is independent of the
   UI language. `plaintext` resolves direction per line from its own first
   strong character, so a pasted block that mixes an Arabic sentence with an
   English stack trace lays each line out correctly instead of letting the
   first line decide for all of them — which is what a single dir="auto"
   would do. `start` then follows that per-line direction. */
.chat-text {
  unicode-bidi: plaintext;
  text-align: start;
}

/* Chat copy: 15px on a 22px line in both modes. Arabic and Hebrew use a local face when
   the machine has one. Geist and the UI stack do not carry those glyphs,
   and a generic family listed later would otherwise win. */
@font-face {
  font-family: "omb-chat";
  src: local("Noto Naskh Arabic"), local("Noto Sans Arabic"), local("Geeza Pro"), local("SF Arabic");
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF;
}
@font-face {
  font-family: "omb-chat";
  src: local("Noto Sans Hebrew"), local("Arial Hebrew"), local("SF Hebrew");
  unicode-range: U+0590-05FF, U+FB1D-FB4F;
}
/* A reply with a table is as wide as its widest table, never narrower than the reading width, and its prose fills it.
   A percentage min-width counts as zero while the reply is measured and outranks max-width afterwards. */
.chat-wide .chat-md {
  width: fit-content;
  min-width: min(100%, var(--chat-prose-max));
  max-width: 100%;
}
.chat-wide .chat-md > :not(.chat-table) {
  max-width: var(--chat-prose-max);
  min-width: 100%;
}

/* A reply's long unbroken text (a URL, a run of letters) wraps inside its bubble instead of running past the window.
   Code blocks keep scrolling sideways; table cells keep their widths. */
.chat-md :is(p, li, h1, h2, h3, h4, blockquote) { overflow-wrap: anywhere; }

.chat-text,
.chat-md {
  line-height: 22px;
  font-family: "omb-chat", var(--font-sans);
}
.chat-md :is(strong, b) {
  font-weight: 600;
}
[data-chat-bubble="simple"] .chat-md > * + * {
  margin-top: 10px;
}
/* No lone last word in a bubble or a reply's paragraphs. */
[data-chat-bubble="simple"],
.chat-md :is(p, li, blockquote) {
  text-wrap: pretty;
}
.chat-md > * + .md-heading {
  margin-top: 18px;
}
.chat-md > .md-heading:first-child {
  margin-top: 0;
}
/* A short line keeps the tight chat bubble; a structured reply gets room to breathe. */
[data-chat-bubble="simple"]:has(> .chat-md > :is(.md-heading, ul, ol, blockquote), > .chat-md pre),
[data-reply-bubble] {
  padding: 12px 16px;
}
/* A table inside a reply is drawn in lines on the bubble, not as another grey box: a hairline edge, a faint header. */
[data-reply-bubble] [data-table-card] {
  width: 100%;
  border-radius: 12px;
  background: transparent;
  /* An outline, not a border or inset shadow, so the header's fill can't paint over the top edge. */
  outline: 1px solid color-mix(in srgb, var(--color-ink) 10%, transparent);
  outline-offset: -1px;
}
/* A code block in a reply is drawn the same way, so the reply's inset blocks speak one language. */
/* The resting grey logos blend into the pill, so a favicon's own white disc or box drops out and only its mark is
   left (Google's G read as ©): multiply on light skins, invert + screen on dark. In base, so hover utilities win. */
@layer base {
  [data-app-faces] { mix-blend-mode: multiply; }
  @container style(--code-color-scheme: dark) {
    [data-app-faces] { --tw-invert: invert(100%); mix-blend-mode: screen; }
  }
}

[data-reply-bubble] .chat-code-block {
  background: color-mix(in srgb, var(--color-card), var(--color-ink) 3%);
  outline: 1px solid color-mix(in srgb, var(--color-ink) 10%, transparent);
  outline-offset: -1px;
}
[data-reply-bubble] [data-table-card] thead {
  background: color-mix(in srgb, var(--color-card), var(--color-ink) 4%);
}
:root[data-skin="daylight"] [data-reply-bubble] [data-table-card] thead {
  background: color-mix(in srgb, var(--color-card), var(--color-ink) 3%);
}
/* A section that opens right after a table keeps the space a heading gets elsewhere in the reply. */
[data-reply-bubble] > [data-reply-table] + * .chat-md > .md-heading:first-child {
  margin-top: 6px;
}
/* A card under its own bot's bubble (and a bubble under its card) sits 12px below it, not the 16px between senders. */
[data-simple-rows] > [data-tuck] > :first-child {
  margin-top: -4px;
}
/* Arabic and Hebrew script needs a taller line than Latin. */
.chat-md [dir="rtl"] {
  line-height: 1.75;
}

/* A streaming reply's blocks fade in as each one arrives, so a chunk of text does not pop in. @starting-style applies
   only when an element is first put on the page, and the rule holds only while the reply streams, so opening a
   finished reply never plays it. Opacity only, once per block, no layout change, nothing running after the stream. */
@media (prefers-reduced-motion: no-preference) {
  .chat-md[data-streaming] > *,
  .chat-md[data-streaming] [data-stream-fade] {
    transition: opacity 600ms ease-out;
  }
  @starting-style {
    .chat-md[data-streaming] > *,
    .chat-md[data-streaming] [data-stream-fade] {
      opacity: 0;
    }
  }
}

.chat-code-actions > button:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

@media (width < 40rem), (hover: none), (pointer: coarse) {
  .chat-code-actions {
    flex-basis: 100%;
    flex-wrap: wrap;
  }

  .chat-code-actions > button {
    min-width: 44px;
    min-height: 44px;
    max-width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    white-space: normal;
  }

  .chat-code-actions svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
  }
}

html,
body,
#root {
  height: 100%;
}

/* iOS Safari keeps its bottom bar in light mode unless the root names a
   scheme. The bar's color is theme-color, copied from --color-app when the
   skin changes. The root itself has to paint the same ground, or the home
   indicator inset stays the canvas white. Only on iOS WebKit: elsewhere the
   scheme stays scoped to code, so native controls keep their styling. */
@supports (-webkit-touch-callout: none) {
  html {
    background-color: var(--color-app);
    color-scheme: var(--code-color-scheme);
  }
}

/* Standalone phone windows can reach behind the notch and home indicator.
   Keep the app's existing h-full layout inside the usable area. Desktop
   browsers and Electron report zero insets. */
#root {
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px)
    env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}

/* ────────────────────────────────────────────────────────────────────────
   FONTS
   An optional interface-font override, independent of the skin (see
   src/lib/fonts.ts). `:root[data-font]` outranks the skins' `[data-skin]`
   blocks, so the choice holds on every skin. No attribute = the skin's font.
   Poppins is used when installed on the system; otherwise the stack falls
   back to the system UI font.
   ──────────────────────────────────────────────────────────────────────── */
:root[data-font="system"] {
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}
:root[data-font="inter"] {
  --font-sans: "Inter Variable", "Inter", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
}
:root[data-font="poppins"] {
  --font-sans: "Poppins", system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
}
:root[data-font="serif"] {
  --font-sans: "Iowan Old Style", "Charter", Georgia, "Times New Roman", serif;
}

body {
  background-color: var(--color-app);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-weight: var(--font-weight-normal);
  /* Declared once here, so an em value resolves at 16px and every size below inherits the same ~0.19px. */
  letter-spacing: var(--tracking-ui);
  /* Chromium on macOS thickens every stem under the default (`auto`)
     smoothing, so regular text reads close to semibold on dark skins.
     Windows ignores both properties. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* Shared action rhythm. Existing skin tokens supply the colors and radius;
   use utilities for placement and the control scale below for size, rather
   than inventing another button size. */
@layer components {
  .ui-button,
  .ui-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2rem;
    border-radius: var(--radius-lg, 0.5rem);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25rem;
    /* transform: the press feedback below */
    transition: background-color 120ms ease, color 120ms ease, transform 50ms cubic-bezier(0.165, 0.84, 0.44, 1);
  }
  .ui-button {
    /* 4px + 20px line + 4px + a 1px border each side = 30px, so the 32px
       min-height decides the box and the label sits on its center. */
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--color-hairline);
    background: var(--color-control);
    color: var(--color-ink);
  }
  .ui-icon-button {
    width: 2rem;
    padding: 0.375rem;
    color: var(--color-ink-secondary);
  }
  /* Control scale. `.ui-button` is the 32px default; the size classes step
     it down for dense rows and inline actions. Every step keeps weight 500
     and a line box equal to its text height plus leading, so the label sits
     on the box center. Radii reuse the skin tokens: rounded-lg for buttons,
     full for pills and chips. */
  .ui-button-md {
    min-height: 1.75rem;
    gap: 0.375rem;
    padding: 0.125rem 0.625rem;
    font-size: 13px;
    line-height: 1.25rem;
  }
  .ui-button-sm {
    min-height: 1.5rem;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    font-size: 12px;
    line-height: 1rem;
  }
  /* Longhands only: the `font` shorthand would reset the family. */
  .ui-button-pill {
    border-radius: 9999px;
    font-size: 14px;
    font-weight: var(--font-weight-normal);
    line-height: 1.25rem;
  }
  .ui-button-lg {
    min-height: 2.25rem;
    padding-inline: 1rem;
  }
  .ui-button-primary {
    border-color: transparent;
    background: var(--color-accent);
    color: var(--color-accent-ink);
  }
  .ui-button-primary:enabled:hover,
  a.ui-button-primary:hover {
    background: var(--color-accent);
    color: var(--color-accent-ink);
    filter: brightness(1.1);
  }
  /* A pill-shaped action in the transcript: run and conversation chips,
     "load earlier", the failed-turn Retry. Same 28px as `.ui-button-md`. */
  .ui-pill {
    display: inline-flex;
    max-width: 100%;
    min-width: 0;
    align-items: center;
    gap: 0.5rem;
    min-height: 1.75rem;
    padding: 0.125rem 0.75rem;
    border: 1px solid color-mix(in srgb, var(--color-hairline) 40%, transparent);
    border-radius: 9999px;
    background: var(--color-panel);
    color: var(--color-ink-secondary);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25rem;
    transition: background-color 120ms ease, color 120ms ease;
  }
  button.ui-pill:enabled:hover,
  a.ui-pill:hover {
    background: var(--color-raised);
    color: var(--color-ink);
  }
  button.ui-pill:disabled { opacity: 0.6; }
  /* A static label: a digest, a count, a status. */
  .ui-chip {
    display: inline-flex;
    max-width: 100%;
    min-width: 0;
    align-items: center;
    gap: 0.25rem;
    min-height: 1.375rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1rem;
  }
  /* Inline code inside prose. Sized off the surrounding text so it reads at
     the same optical size in a 15px bubble or a 13px note. It stays an
     inline box, not inline-flex, so a long path can still wrap mid-line;
     an inline background already centers on the glyphs, and `clone` keeps
     the padding on every wrapped piece. */
  .ui-code-chip {
    padding: 0 0.27em;
    border-radius: 0.25rem;
    background: color-mix(in srgb, var(--color-ink) 4%, transparent);
    color: var(--color-ink-secondary);
    font-family: var(--font-mono);
    font-size: 0.93em;
    line-height: 1;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    overflow-wrap: anywhere;
  }
  /* One row of a popover menu: 30px, 14px, icon then label. */
  .ui-menu-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    min-height: 30px;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    text-align: left;
    font-size: 14px;
    font-weight: var(--font-weight-normal);
    line-height: 18px;
  }
  .ui-menu-row:enabled:hover { background: var(--color-menu-hover); }
  .ui-menu-row:disabled { opacity: 0.6; }
  .ui-button:enabled:hover,
  .ui-icon-button:enabled:hover {
    background: var(--color-raised-hover);
    color: var(--color-ink);
  }
  .ui-button:enabled:active,
  .ui-icon-button:enabled:active {
    background: var(--color-raised);
  }
  .ui-button:disabled,
  .ui-icon-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
  }
  /* A secondary action in Midnight and Daylight: a faint ink wash with a hairline of ink. Layered, so a
     call site's own fill (an ink pill, a danger outline) still wins. */
  :root[data-skin="midnight"] .ui-button {
    border-color: color-mix(in srgb, var(--color-ink) 10%, transparent);
    background: color-mix(in srgb, var(--color-ink) 4%, transparent);
  }
  :root[data-skin="midnight"] .ui-button:enabled:is(:hover, :active) {
    background: color-mix(in srgb, var(--color-ink) 8%, transparent);
  }
  :root:is([data-skin="midnight"], [data-skin="daylight"]) :is(.ui-button, .ui-icon-button) {
    border-radius: 9999px;
  }
  :root[data-skin="daylight"] .ui-button {
    border-color: color-mix(in srgb, var(--color-ink) 12%, transparent);
    background: color-mix(in srgb, var(--color-ink) 6%, transparent);
  }
  :root[data-skin="daylight"] .ui-button:enabled:is(:hover, :active) {
    background: color-mix(in srgb, var(--color-ink) 10%, transparent);
  }
  /* A dialog for the first-run surfaces: the menu tone on a hairline of ink, lifted only in Daylight. */
  .ui-modal {
    border: 0.5px solid color-mix(in srgb, var(--color-ink) 10%, transparent);
    border-radius: 14px;
    background: var(--color-menu);
  }
  .ui-modal-divider {
    height: 0.5px;
    background: color-mix(in srgb, var(--color-ink) 10%, transparent);
  }
  :root[data-skin="daylight"] .ui-modal {
    border-color: color-mix(in srgb, var(--color-ink) 12%, transparent);
    box-shadow: 0 20px 32px -5px rgb(28 28 28 / 0.1), 0 8px 12px -6px rgb(28 28 28 / 0.1);
  }
  :root[data-skin="daylight"] .ui-modal-divider {
    background: color-mix(in srgb, var(--color-ink) 12%, transparent);
  }
  /* Dims the app under a first-run dialog as a sheet does: half in a light skin, deeper in a dark one. */
  .ui-scrim {
    background: rgb(0 0 0 / 0.5);
    animation: fade-in 200ms ease-out both;
  }
  @container style(--code-color-scheme: dark) {
    .ui-scrim { background: rgb(0 0 0 / 0.7); }
  }
  /* A lighter dim, for a dialog about the app behind it, which should still show through as it changes. */
  .ui-scrim-light { background: rgb(0 0 0 / 0.2); }
  @container style(--code-color-scheme: dark) {
    .ui-scrim-light { background: rgb(0 0 0 / 0.4); }
  }
  @media (prefers-reduced-motion: reduce) {
    .ui-button,
    .ui-icon-button,
    .ui-pill { transition: none; }
  }
  /* Press feedback: a button gives a little under the pointer, 98% over 50ms, and not at all with reduced motion
     (DESIGN §10). Layered, so Pop's own sticker press still wins on its buttons. */
  @media (prefers-reduced-motion: no-preference) {
    :root:not([data-reduced-motion="true"]) :is(.ui-button, .ui-icon-button):not(:disabled):active {
      transform: scale(0.98);
    }
  }
  /* A bot's bubble on a light ground: its tint, a top-lit sheen and a 0.5px inset line of ink at 6% (DESIGN §8).
     A dark ground keeps the flat tint: there the sheen would lift the bubble's top edge out of its tone. Layered, so
     Pop's sticker outline on .bg-card still wins. */
  .bubble-finish {
    background-image: linear-gradient(rgb(255 255 255 / 0.16), transparent);
    box-shadow:
      inset 0 0.5px 0 rgb(255 255 255 / 0.16),
      inset 0 -0.5px 0 rgb(255 255 255 / 0.16),
      inset 0 0 0 0.5px color-mix(in srgb, var(--color-ink) 6%, transparent);
  }
  @container style(--code-color-scheme: dark) {
    .bubble-finish { background-image: none; box-shadow: none; }
  }
}

/* The sidebar's bot rows and pinned bots give under the pointer like a button (98% over 50ms), but not while a
   button inside the row is the one pressed. Their hover fill is a hard cut (--motion-hover); this transition replaces
   the rows' own colour fade. */
[data-sidebar-bot-row] {
  transition-property: color, background-color, border-color, outline-color, fill, stroke, scale;
  transition-duration: var(--motion-hover), var(--motion-hover), var(--motion-hover), var(--motion-hover), var(--motion-hover), var(--motion-hover), 50ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1), cubic-bezier(0.4, 0, 0.2, 1), cubic-bezier(0.4, 0, 0.2, 1),
    cubic-bezier(0.4, 0, 0.2, 1), cubic-bezier(0.4, 0, 0.2, 1), cubic-bezier(0.4, 0, 0.2, 1), cubic-bezier(0.165, 0.84, 0.44, 1);
}
/* A sidebar row is a control, not text: a drag across it never selects its labels. A rename field inside keeps its
   own selection. */
:is([data-sidebar-bot-row], [data-sidebar-thread-row]) { user-select: none; }
:is([data-sidebar-bot-row], [data-sidebar-thread-row]) :is(input, textarea) { user-select: text; }
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-reduced-motion="true"]) [data-sidebar-bot-row]:active:not(:has(button:active)) {
    scale: 0.98;
  }
}
@media (prefers-reduced-motion: reduce) {
  [data-sidebar-bot-row] { transition: none; }
}
:root[data-reduced-motion="true"] [data-sidebar-bot-row] { transition: none; }

/* The chat header's model pill folds to its AI's mark while a side panel narrows the chat (ModelPickerTrigger).
   The pill glides over the panel's own 240ms on the motion curve: its padding and the mark's gap close, and the rest
   rides a grid column from 1fr to 0fr, so no width is measured and the first paint lands folded or open with no jump.
   The words never wrap (nowrap) and are never cut hard: they fade, drift 4px toward the mark and soften as the column
   closes, the name first and the bars and chevron a beat later; opening, they wait for the column to start widening.
   A transition takes its timing from the state it goes to, so each state below carries the timing that reaches it. */
[data-model-pill] {
  transition-property: color, background-color, padding;
  transition-duration: var(--motion-pill-hover), var(--motion-pill-hover), 240ms;
  transition-timing-function: ease-out, ease-out, cubic-bezier(0.22, 1, 0.36, 1);
}
[data-model-pill][data-folded] { padding-inline: 0; }
[data-model-pill] [data-model-pill-mark] { transition: margin 240ms cubic-bezier(0.22, 1, 0.36, 1); }
[data-model-pill][data-folded] [data-model-pill-mark] { margin-inline-end: 0; }
[data-model-pill] [data-model-pill-rest] {
  grid-template-columns: 1fr;
  transition: grid-template-columns 240ms cubic-bezier(0.22, 1, 0.36, 1);
}
[data-model-pill][data-folded] [data-model-pill-rest] { grid-template-columns: 0fr; }
/* Folding, the column's closing edge fades instead of cutting the words off. */
[data-model-pill][data-folded] [data-model-pill-rest] > * { mask-image: linear-gradient(to right, #000 calc(100% - 12px), transparent); }
[dir="rtl"] [data-model-pill][data-folded] [data-model-pill-rest] > * { mask-image: linear-gradient(to left, #000 calc(100% - 12px), transparent); }
[data-model-pill] [data-model-pill-words],
[data-model-pill] [data-model-pill-tail] {
  transition-property: opacity, translate, filter;
  transition-duration: 180ms, 200ms, 180ms;
  transition-timing-function: ease-out, cubic-bezier(0.22, 1, 0.36, 1), ease-out;
  transition-delay: 70ms;
}
[data-model-pill] [data-model-pill-tail] { transition-delay: 110ms; }
[data-model-pill][data-folded] [data-model-pill-words],
[data-model-pill][data-folded] [data-model-pill-tail] {
  opacity: 0;
  translate: -4px 0;
  filter: blur(2px);
  transition-duration: 140ms, 200ms, 140ms;
  transition-delay: 0ms;
}
[data-model-pill][data-folded] [data-model-pill-tail] { transition-delay: 40ms; }
[dir="rtl"] [data-model-pill][data-folded] [data-model-pill-words],
[dir="rtl"] [data-model-pill][data-folded] [data-model-pill-tail] { translate: 4px 0; }
@media (prefers-reduced-motion: reduce) {
  [data-model-pill], [data-model-pill] * { transition: none !important; }
}
:root[data-reduced-motion="true"] [data-model-pill],
:root[data-reduced-motion="true"] [data-model-pill] * { transition: none !important; }

/* Liquid glass: the surface for centred pop-ups (Settings, Apps, Triggers).
   Every value is derived from the active skin's own tokens, so each of the
   ten skins gets a glass of its own colour and no skin block changes. The
   app behind stays visible, blurred, through a light scrim. Unlayered so a
   leftover `bg-panel` on the same element cannot win. */
.glass-surface {
  background: color-mix(in srgb, var(--color-menu) 62%, transparent);
  -webkit-backdrop-filter: blur(28px) saturate(170%);
  backdrop-filter: blur(28px) saturate(170%);
  border: 1px solid color-mix(in srgb, var(--color-ink) 10%, transparent);
  box-shadow:
    inset 0 1px 0 color-mix(in srgb, white 16%, transparent),
    inset 0 0 0 1px color-mix(in srgb, white 4%, transparent),
    0 16px 40px -16px color-mix(in srgb, black 35%, transparent),
    0 2px 8px color-mix(in srgb, black 10%, transparent);
}
/* Where a glass pop-up sits: inside the window less a safe area. The top
   inset clears the macOS traffic lights and the Windows caption buttons
   (--glass-popup-top, set from lib/glass-popup.ts); 24px elsewhere. The pane
   is min(1040px, 100% - 48px) wide and min(760px, 100% - top - 24px) tall:
   the padding takes the insets off, so 100% here is what is left. */
.glass-popup-frame {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--glass-popup-top, 24px) 24px 24px;
}
.glass-popup {
  width: min(1040px, 100%);
  height: min(760px, 100%);
  min-height: 0;
}
/* On a phone Settings is a sheet: it fills the width, rises from the bottom and rounds only its top corners. */
@media (max-width: 767.98px) {
  /* The window's rail of places is a view of its own drawn over this page's left edge: the sheet starts beside it, and
     below the window's top bar where the window draws one. */
  .glass-popup-frame[data-settings-sheet] {
    align-items: flex-end;
    padding: var(--settings-narrow-top, 12px) 0 0 var(--rail-beside, 0px);
  }
  .glass-popup-frame[data-settings-sheet] > .glass-popup {
    width: 100%;
    height: 100%;
    border-radius: 16px 16px 0 0;
  }
}
/* Cards and rails sitting on the glass: a second, thinner pane. */
.glass-card {
  background: color-mix(in srgb, var(--color-card) 60%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-ink) 8%, transparent);
}
/* Existing pages dropped onto glass (every Settings page) keep their markup;
   their solid cards turn into the same thinner pane. */
.glass-surface .bg-card {
  background-color: color-mix(in srgb, var(--color-card) 60%, transparent);
}
.glass-rail {
  background: color-mix(in srgb, var(--color-app) 22%, transparent);
}
/* Behind a glass pop-up: dim without adding a second, full-window blur pass.
   The pop-up surface provides the glass blur over the content it covers. */
.glass-scrim {
  background: color-mix(in srgb, black 28%, transparent);
}
@media (prefers-reduced-transparency: reduce) {
  .glass-surface {
    background: var(--color-menu);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .glass-card,
  .glass-surface .bg-card { background: var(--color-card); }
  .glass-rail { background: var(--color-app); }
  .glass-scrim {
    background: color-mix(in srgb, black 50%, transparent);
  }
}
/* Linux without a GPU (electron/linux-gpu.mjs): the blur is redrawn on the CPU and keeps the fan busy, so pop-ups are solid. */
:root[data-software-rendering] .glass-surface {
  background: var(--color-menu);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
:root[data-software-rendering] .glass-surface .bg-card { background: var(--color-card); }
@media (forced-colors: active) {
  .glass-surface,
  .glass-card {
    background: Canvas;
    border-color: CanvasText;
  }
}

/* Settings: cards and fields edge in one faint ink line. In Midnight and Daylight the sheet is opaque, in the page
   colour, with no shadow; every other skin keeps its glass. */
[data-settings-look] {
  --settings-edge: color-mix(in srgb, var(--color-ink) 10%, transparent);
  --switch-on: var(--color-accent);
  --switch-knob-on: #fff;
  --switch-outline: color-mix(in srgb, var(--color-ink) 50%, transparent);
}
:root[data-skin="midnight"] [data-settings-look] {
  --settings-edge: color-mix(in srgb, var(--color-ink) 9%, transparent);
  --switch-outline: color-mix(in srgb, var(--color-ink) 40%, transparent);
}
:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look] {
  --switch-on: var(--color-ink);
  --switch-knob-on: var(--color-app);
}
/* One switch in Settings: 32 by 20. Off is a light fill with an outline that keeps 3:1 against the card. */
[data-settings-look] [data-switch] {
  width: 32px;
  height: 20px;
  background: color-mix(in srgb, var(--color-ink) 22%, transparent);
  box-shadow: inset 0 0 0 1px var(--switch-outline);
  filter: none;
}
[data-settings-look] [data-switch][aria-checked="true"] {
  background: var(--switch-on);
  box-shadow: none;
}
[data-settings-look] [data-switch] > span {
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  transition-duration: 150ms;
}
[data-settings-look] [data-switch][aria-checked="true"] > span {
  left: 14px;
  background: var(--switch-knob-on);
}
/* One button family in Settings: 28 tall pills, 13/20 500; secondary on a 5% ink fill. */
[data-settings-look] .ui-button {
  height: 28px;
  min-height: 28px;
  border-radius: 9999px;
  border-color: transparent;
  padding: 0 12px;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
}
[data-settings-look] .ui-button:not(.ui-button-primary) {
  background: color-mix(in srgb, var(--color-ink) 5%, transparent);
  color: var(--color-ink);
}
[data-settings-look] .ui-button:not(.ui-button-primary):enabled:is(:hover, :active) {
  background: color-mix(in srgb, var(--color-ink) 10%, transparent);
}
[data-settings-look] .settings-quiet {
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: var(--color-ink-secondary);
}
/* A quiet button's text ends on the control edge (card right − 16), like a filled button's edge. */
[data-settings-look] :is([data-settings-control], [data-settings-actions], [data-settings-form-foot]) > .settings-quiet:last-child { margin-inline-end: -6px; }
[data-settings-look] .settings-quiet:enabled:hover { color: var(--color-ink); background: color-mix(in srgb, var(--color-ink) 5%, transparent); }
[data-settings-look] .settings-quiet[data-danger]:enabled:hover { color: var(--color-danger); }
/* Rows in a card part with a hairline that starts where their text starts: 16 in, 60 in a card whose rows lead with an icon. */
/* A row wrapped in a `display: contents` element (for a data hook) parts from the one above all the same. */
[data-settings-rows] > :not([hidden]) ~ :not([hidden], .contents),
[data-settings-rows] > :not([hidden]) ~ .contents > :first-child {
  background-image: linear-gradient(var(--settings-edge), var(--settings-edge));
  background-repeat: no-repeat;
  background-size: calc(100% - 32px) 0.5px;
  background-position: 16px 0;
}
/* Rows kept together in a `display: contents` wrapper (a group with a data hook) part from each other the same way. */
[data-settings-rows] > .contents > :not([hidden]) ~ :not([hidden], .contents) {
  background-image: linear-gradient(var(--settings-edge), var(--settings-edge));
  background-repeat: no-repeat;
  background-size: calc(100% - 32px) 0.5px;
  background-position: 16px 0;
}
[data-settings-rows][data-settings-icons] > :not([hidden]) ~ :not([hidden], .contents),
[data-settings-rows][data-settings-icons] > :not([hidden]) ~ .contents > :first-child,
[data-settings-rows][data-settings-icons] > .contents > :not([hidden]) ~ :not([hidden], .contents) {
  background-size: calc(100% - 76px) 0.5px;
  background-position: 60px 0;
}
/* Narrow cards (§6.12): below 480 a select, a segmented control or a wide button (one marked data-settings-drop, such as
   Pair a phone) drops under its text, 8 below the description and at the text's left edge; a select takes the full
   width. Switches and small buttons stay on the right. */
@container rows (max-width: 480px) {
  [data-settings-control]:has(select, [data-settings-segmented], [data-settings-drop]) {
    flex-basis: 100%;
    margin-inline-start: 0;
  }
  [data-settings-control] > [data-settings-select] {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
  }
  [data-settings-control] > [data-settings-select] > select {
    width: 100%;
    max-width: none;
  }
}
/* Narrow Midnight remaps the app's surfaces for the phone layout; Settings keeps the desktop sheet and card colours. */
@media (max-width: 767.98px) {
  :root[data-skin="midnight"] [data-settings-look] {
    --color-app: #121212;
    --color-menu: #1f1f1f;
  }
}
/* Descriptions wrap without leaving one word alone on a line. Only the wrap style: `text-wrap: pretty` would also set
   the wrap mode back to wrap and undo every one-line, ellipsis label (nav items, search results, sub-lines). */
[data-settings-look] :is(p, span, div) { text-wrap-style: pretty; }
[data-settings-highlight] {
  animation: settings-highlight 1.2s ease-out;
}
@keyframes settings-highlight {
  from { background-color: var(--color-menu-active); }
  to { background-color: transparent; }
}
@media (prefers-reduced-motion: reduce) {
  [data-settings-highlight] { animation: none; }
}
:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look] .glass-surface {
  background: var(--color-app);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  border: 1px solid color-mix(in srgb, var(--color-ink) 12%, transparent);
  box-shadow: none;
}
:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look] .glass-rail {
  background: transparent;
  border-right: 0.5px solid var(--settings-edge);
}
:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look] .glass-surface .bg-card {
  background-color: var(--color-menu);
}
:root:is([data-skin="midnight"], [data-skin="daylight"]) [data-settings-look] .bg-inset {
  background-color: transparent;
  border-color: var(--settings-edge);
}
:root[data-skin="midnight"] [data-settings-look] > .glass-scrim {
  background: rgb(0 0 0 / 0.55);
}
:root[data-skin="daylight"] [data-settings-look] > .glass-scrim {
  background: rgb(0 0 0 / 0.18);
}
/* Settings fades its bottom edge only while more lies below: the fade rides the pane's own scroll, so it is absent
   when nothing scrolls and gone once the end is reached. */
@property --settings-fade {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@keyframes settings-fade {
  0%, 94% { --settings-fade: 10px; }
  100% { --settings-fade: 0px; }
}
/* A thin thumb that stays visible, so a long Settings page shows it goes on. */
.settings-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--color-scrollbar) transparent;
}
@property --settings-fade-top {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}
@keyframes settings-fade-top {
  0% { --settings-fade-top: 0px; }
  6%, 100% { --settings-fade-top: 12px; }
}
@supports (animation-timeline: scroll()) {
  .settings-scroll {
    mask-image: linear-gradient(to bottom, transparent, #000 var(--settings-fade-top), #000 calc(100% - var(--settings-fade)), transparent);
    animation: settings-fade linear both, settings-fade-top linear both;
    animation-timeline: scroll(self), scroll(self);
  }
  .settings-scroll[data-settings-content] {
    mask-image: linear-gradient(to bottom, #000 calc(100% - var(--settings-fade)), transparent);
    animation: settings-fade linear both;
    animation-timeline: scroll(self);
  }
}
/* Over a light scrim the sheet needs its own lift. */
:root[data-skin="daylight"] [data-settings-look] .glass-surface {
  box-shadow: 0 24px 64px -16px rgb(28 28 28 / 0.28), 0 2px 8px rgb(28 28 28 / 0.06);
}
@media (min-width: 768px) {
  .glass-popup-frame[data-settings-sheet][data-settings-look="simple"] > .glass-popup {
    width: min(920px, 100%);
    height: min(720px, 100%);
    border-radius: 14px;
  }
}

/* Glass bars (GlassScrollFrame): the sidebar's head and foot and the chat
   header float over their scroller, which runs on underneath them. The glass
   is a layer behind the bar's own controls: the tint of the surface the bar
   sits on, so at rest the bar reads as that surface, over a blur of whatever
   scrolls beneath. A top bar's inner edge fades out across --glass-edge, so
   content melts into the glass instead of meeting a hard line. A bottom bar
   can be one short row (Simple mode's profile row), where a fade inside it
   left a half-sharp strip of text showing above the row: its glass is solid
   to the bar's edge and reaches --glass-reach past it instead, fading there,
   and the list gets that much more room at its end so a resting row is never
   blurred. The layer is a pseudo-element, so the bar itself never becomes a
   containing block for the fixed-position menus it opens. */
[data-glass-frame] {
  --glass-reach: 24px;
}
[data-glass-frame]:has(> [data-glass-bar="bottom"]) {
  --glass-bottom-reach: var(--glass-reach);
}
.glass-bar {
  --glass-edge: 20px;
  isolation: isolate;
}
.glass-bar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: color-mix(in srgb, var(--glass-tint, var(--color-panel)) 55%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
}
.glass-bar[data-glass-bar="top"]::before {
  mask-image: linear-gradient(to bottom, black calc(100% - var(--glass-edge)), transparent);
}
.glass-bar[data-glass-bar="bottom"]::before {
  top: calc(-1 * var(--glass-reach, 0px));
  mask-image: linear-gradient(to top, black calc(100% - var(--glass-reach, 0px)), transparent);
}
/* A fading bar has no tint and no blur. What scrolls under it stays hidden at the window edge and is
   at most a tenth visible at the bar's inner edge, across the last --glass-fade of the bar, which is
   the whole of Simple mode's 60px header: its controls stay readable over any content. A taller bar
   (find, a notice) stays plain canvas above that stretch. */
.glass-bar[data-glass-fade] {
  --glass-fade: 60px;
}
.glass-bar[data-glass-fade]::before {
  background: linear-gradient(to bottom, var(--color-app), var(--color-app) calc(100% - var(--glass-fade)), color-mix(in srgb, var(--color-app) 90%, transparent));
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  mask-image: none;
}
/* Simple mode's chat header has no band at all: the transcript runs up to the window's top edge under the floating pill
   and buttons, and the scroller itself fades it in, in even steps, over the --top-fade just above the bar's bottom
   edge, where the first row rests at the top of the history. A mask, not a fill, so whatever ground the skin paints
   (Aurora's field included) shows through. A taller bar (find, a notice) keeps what lies above that stretch hidden.
   Only the bar's controls take the pointer; between them, a click reaches the transcript. */
.glass-bar[data-chathead-float]::before {
  content: none;
}
.glass-scroller[data-top-fade] {
  --top-fade: 60px;
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--glass-top, 0px) - var(--top-fade)), #000 var(--glass-top, 0px));
  mask-image: linear-gradient(to bottom, transparent calc(var(--glass-top, 0px) - var(--top-fade)), #000 var(--glass-top, 0px));
}
/* A room's feed of threads: its header is plain words, so nothing that scrolls under it shows through. Rows fade in over
   the last --feed-fade above the bar's edge, where the top row rests; a mask, so any skin's ground shows. */
.glass-scroller[data-feed-fade] {
  --feed-fade: 12px;
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--glass-top, 0px) - var(--feed-fade)), #000 var(--glass-top, 0px));
  mask-image: linear-gradient(to bottom, transparent calc(var(--glass-top, 0px) - var(--feed-fade)), #000 var(--glass-top, 0px));
}
[data-chathead-float] {
  pointer-events: none;
}
[data-chathead-float] > :not([data-look="chat-header"]),
[data-chathead-float] :is([data-chathead-identity], [data-chathead-controls]) > * {
  pointer-events: auto;
}
/* The colour of the place on screen (PlaceTint), faint, from the very top of the sidebar to just below its head, under
   everything there: the head's words and controls stay on what is still almost the plain panel. Dark skins take a
   little more of it to show at all. Reduced transparency: a thin solid line at the top instead; forced colours: none. */
.place-tint {
  height: calc(var(--glass-top, 48px) + 16px);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--place-tint) var(--place-tint-strength, 16%), transparent), transparent);
}
@container style(--code-color-scheme: dark) {
  .place-tint { --place-tint-strength: 26%; }
}
@media (prefers-reduced-transparency: reduce) {
  .place-tint { height: 3px; background: var(--place-tint); }
}
@media (forced-colors: active) {
  .place-tint { display: none; }
}
/* The workspace's banner picture (PlaceTint), in place of its colour's tint: faded into the panel from the top of the
   sidebar, dimmed and lightly blurred, so the head's words and controls stay readable over any picture. Without a
   picture (or before it loads) the colour's tint shows; with reduced transparency or forced colours the picture never
   does, and the tint's own rules apply. */
.place-banner {
  /* Its head's height and a little more, as the tint: the list's own fade band never cuts through it. */
  height: calc(var(--glass-top, 48px) + 16px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black, rgb(0 0 0 / 0.6) 60%, transparent);
  mask-image: linear-gradient(to bottom, black, rgb(0 0 0 / 0.6) 60%, transparent);
}
.place-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: var(--place-banner-strength, 0.3);
  filter: blur(1.5px) saturate(0.85);
  transform: scale(1.04);
}
@container style(--code-color-scheme: dark) {
  .place-banner img { --place-banner-strength: 0.26; filter: blur(1.5px) saturate(0.85) brightness(0.8); }
}
.place-tint[data-under-banner] { display: none; }
@media (prefers-reduced-transparency: reduce) {
  .place-banner { display: none; }
  .place-tint[data-under-banner] { display: block; }
}
@media (forced-colors: active) {
  .place-banner { display: none; }
}
/* The frame publishes its bars' heights. Rows rest clear of the glass,
   keyboard focus scrolls them clear, and the scrollbar runs only between the
   bars (a bar over it would swallow the drag). */
.glass-scroller {
  isolation: isolate;
  scroll-padding-top: var(--glass-top, 0px);
  scroll-padding-bottom: calc(var(--glass-bottom, 0px) + var(--glass-bottom-reach, 0px));
}
.glass-scroller::-webkit-scrollbar-track {
  margin-top: var(--glass-top, 0px);
  margin-bottom: var(--glass-bottom, 0px);
}
.glass-scroller-content {
  padding-top: var(--glass-top, 0px);
  padding-bottom: calc(var(--glass-bottom, 0px) + var(--glass-bottom-reach, 0px));
}
/* The transcript and its composer share one centered column with a fixed cap. The transcript sits
   inside the scroller's px-4; the dock spans the pane and holds the composer's own px-4, so it adds
   that padding to the same cap and the composer's edges meet the transcript's. */
.chat-column {
  margin-inline: auto;
  max-width: var(--chat-column-max);
}
.chat-column-dock {
  margin-inline: auto;
  max-width: calc(var(--chat-column-max) + 2rem);
}
@media (prefers-reduced-transparency: reduce) {
  .glass-bar::before {
    background: var(--glass-tint, var(--color-panel));
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}
@media (forced-colors: active) {
  .glass-bar::before,
  .glass-bar[data-glass-fade]::before {
    background: Canvas;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

/* Keep focus visible after components clear the browser outline. These
   unlayered rules outrank Tailwind utilities without needing !important. */
:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}
/* Inside a control last used with a pointer, focus that script moves, or a key that moves nothing, draws no ring. */
[data-pointer-used] :focus-visible {
  outline: none;
}
/* Settings: nav items, identity rows, search results and whole-row buttons (link, fold and card rows) take an inset
   ring, so it is never clipped by the card or drawn into the nav's edge. */
[data-settings-look] :is([data-settings-page], [data-settings-hit], [data-settings-key-result], [data-settings-rows] > button, [data-settings-rows] > * > button[aria-expanded], [data-settings-fold] > button, [data-settings-rows] > button[data-pair-with-cloud]):focus-visible {
  outline-offset: -2px;
}
/* A whole-row button in a card takes the card's corners, so its inset ring never cuts across a rounded corner. */
[data-settings-look] [data-settings-rows] > button:focus-visible { border-radius: 12px; }
/* A menu's trigger gets focus back when the menu closes. After a menu the mouse opened, the Escape that closed it
   would make Chromium draw the keyboard ring there; menu-press.ts marks the trigger until its next key or blur. */
[data-quiet-focus]:focus-visible {
  outline: none;
}
/* A menu row shows keyboard focus as its hover fill. */
[role="menu"] :is(button, [role^="menuitem"]):focus-visible {
  outline: none;
  background-color: var(--color-menu-hover);
}

/* Text fields already sit in a bordered card (the composer pill especially).
   Chromium treats a pointer click as :focus-visible on inputs, so the
   global ring above becomes a sharp blue rectangle inside the rounded
   chrome. Buttons still use the :focus-visible ring. Checkboxes, radios,
   sliders, colour wells and file pickers are not text fields: they have no
   border to repaint, so they keep the ring, or a keyboard user tabbing onto
   one sees nothing. */
:is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]), textarea, select):focus,
:is(input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"]), textarea, select):focus-visible {
  outline: none;
}

/* In its place a field shows focus on its own border, in the ring's colour.
   Unlayered, so it wins over the resting `border-hairline/40` every field
   carries as well as over a faint per-file `focus:border-*`. --color-focus
   clears 3:1 on every field surface (pnpm check:contrast). A borderless
   field has no border to paint and is left as it was: a find bar's rounded
   wrapper takes `focus-within:border-focus`, and Simple mode's composer pill
   shows focus as a stronger hairline (`focus-within:ring-ink/[0.22]`), not
   in the focus colour.
   A field reporting an error (aria-invalid) keeps its danger border, so the
   red does not vanish while the user is fixing it. */
:is(input, textarea, select):focus-visible:not([aria-invalid="true"]) {
  border-color: var(--color-focus);
}
/* Settings: every control shows keyboard focus the same way, as the 2 px focus ring a switch or a button gets (§6.10).
   A select or a field there edges in a 0.5 px hairline, which a border-colour change can't make visible. */
[data-settings-look] :is(select, textarea, input:not([type="checkbox"], [type="radio"], [type="range"], [type="color"], [type="file"], [data-settings-search])):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 0;
}

::selection {
  background: color-mix(in oklab, var(--color-accent) 45%, transparent);
  color: var(--color-ink);
}

/* Scrollbars: a slim pill in each skin's own --color-scrollbar, never a
   full-height slab. At rest it is a 2px line, enough to say "this scrolls";
   with the pointer on it (anywhere across the 8px gutter, since the
   transparent border is part of the thumb) or while dragged it widens to a
   6px pill and darkens, as macOS and Windows 11 scrollbars do. The gutter
   never changes width, so nothing reflows, and the track stays clear, so no
   gray rail runs down a panel. (Widening on hover of the scrolling area
   instead, via `*:hover::-webkit-scrollbar-thumb`, does not repaint in
   Chromium, so it is not used.) */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
  background-color: var(--color-scrollbar);
}
::-webkit-scrollbar-thumb:vertical { min-height: 40px; }
::-webkit-scrollbar-thumb:horizontal { min-width: 40px; }
/* the thumb was inert — it never acknowledged the pointer */
::-webkit-scrollbar-thumb:hover,
::-webkit-scrollbar-thumb:active {
  border-width: 1px;
  background-color: color-mix(in srgb, var(--color-scrollbar) 55%, var(--color-ink));
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* Firefox does not inherit scrollbar-color from :root; every overflow pane
   (dialogs, menus, settings, chat) gets the same thumb as WebKit above.
   The gate is the engine, not a selector: -moz-appearance is a Gecko property
   that Chromium does not recognize, so this holds in every Firefox version and
   never in Chromium. Testing a webkit selector instead is fragile, because a
   Firefox release can answer it differently. In Chromium, setting
   scrollbar-color on an element turns off its ::-webkit-scrollbar rules there,
   which drops the glass track margins (.glass-scroller). */
@supports (-moz-appearance: none) {
  :is(.overflow-y-auto, .overflow-auto, .overflow-x-auto, .overflow-y-scroll, .overflow-x-scroll, .overflow-scroll) {
    scrollbar-width: thin;
    scrollbar-color: var(--color-scrollbar) transparent;
  }
}
[class*="scrollbar-width:none"],
[class*="scrollbar]:hidden"] {
  scrollbar-width: none;
}

@keyframes panel-in {
  from { transform: translateX(28px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
/* A side panel's room grows from nothing as it slides in over the window's edge (bot-panel/side-panel.ts). */
@keyframes panel-beside-in {
  from { margin-inline-end: calc(-1 * var(--side-panel-w)); opacity: 0; }
}
@keyframes sheet-in {
  from { transform: translateY(32px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes workspace-in {
  from { opacity: 0.92; }
  to { opacity: 1; }
}
@keyframes menu-in {
  from { transform: scale(0.96); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes pop-out {
  from { transform: scale(1) translateY(0); opacity: 1; }
  to { transform: scale(0.96) translateY(6px); opacity: 0; }
}
/* streaming caret: a true typing blink (step, not fade) */
@keyframes caret-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
/* new message settle-in: subtle, fast, GPU-only */
@keyframes msg-in {
  from { transform: translateY(4px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@keyframes slot-fade-in {
  from { opacity: 0; }
}
.reply-bubble {
  width: fit-content;
  max-width: min(100%, 36rem);
  border-radius: 20px;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--color-ink) 8%, transparent);
  font-size: 16px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
@keyframes bubble-in {
  from { transform: translateY(6px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.reply-bubble-in {
  animation: bubble-in 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}
/* mascot arrives at the tail */
@keyframes turn-mascot-in {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes turn-mascot-out {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.88); }
}
/* the reply grows up from the mascot, staying on the left edge */
@keyframes turn-answer-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.84);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.turn-mascot-in {
  transform-origin: 18px 18px;
  animation: turn-mascot-in 0.38s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.turn-mascot-out {
  transform-origin: 18px 18px;
  animation: turn-mascot-out 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.turn-answer {
  transform-origin: 18px 100%;
  animation: turn-answer-in 0.48s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
/* The first screen's demo caret: on for the first half of each second, off for the rest. */
@keyframes meet-caret {
  0%, 45% { opacity: 1; }
  55%, 100% { opacity: 0; }
}
@keyframes rise {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
/* thinking dots in the onboarding chat scenes */
@keyframes dot-bob {
  0%, 60%, 100% { transform: none; opacity: 0.5; }
  30% { transform: translateY(-3px); opacity: 1; }
}
@keyframes ripple {
  from { box-shadow: 0 0 0 0 color-mix(in oklab, var(--color-accent) 55%, transparent); }
  to { box-shadow: 0 0 0 14px color-mix(in oklab, var(--color-accent) 0%, transparent); }
}
@keyframes computer-glow {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}
@keyframes link-flow {
  to { stroke-dashoffset: -20; }
}
@keyframes sent-border {
  0%, 25% { opacity: 1; }
  100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .animate-computer-glow, .animate-link-flow { animation: none; }
  .animate-sent-border { animation: none; }
}
@keyframes bolt {
  0% { transform: translateX(-4px) scale(0.9); opacity: 0.2; }
  40% { transform: translateX(6px) scale(1.05); opacity: 1; }
  100% { transform: translateX(22px) scale(0.85); opacity: 0; }
}
@keyframes spot-in {
  from { transform: scale(0.94); opacity: 0; }
  to { transform: none; opacity: 1; }
}
/* Siblings of a `.stagger` group arrive 40ms apart. Each child sets `--i`
   (its index) inline; the delay is decorative and never blocks input. */
.stagger > * {
  animation-delay: calc(var(--stagger, 40ms) * var(--i, 0));
}
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.28s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}
/* Cloud setup (CloudEngineSignIn, CloudSetup) shares the welcome flow's
   rare, first-time motion. A step's details open on grid rows, the one
   height animation allowed because an accordion has no transform
   equivalent. A finished step's check lands with a small overshoot, then
   its tick draws in. */
.step-open {
  display: grid;
  animation: step-open 0.3s cubic-bezier(0.23, 1, 0.32, 1) both;
}
.step-open > * {
  min-height: 0;
  overflow: clip;
  overflow-clip-margin: 10px;
}
@keyframes step-open {
  from { grid-template-rows: 0fr; opacity: 0; }
  to { grid-template-rows: 1fr; opacity: 1; }
}
.check-in { animation: check-in 0.42s cubic-bezier(0.23, 1, 0.32, 1) both; }
@keyframes check-in {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  :root:not([data-reduced-motion="true"]) .check-in path {
    stroke-dasharray: 24;
    stroke-dashoffset: 24;
    animation: check-draw 0.3s 0.14s cubic-bezier(0.23, 1, 0.32, 1) forwards;
  }
}
@keyframes check-draw {
  to { stroke-dashoffset: 0; }
}
/* Cloud intent (CloudIntent.tsx): the first-job box, the job waiting above
   the sign-in, and the chat's composer are one element across each change,
   so the box rises into the sign-in and then settles into the composer. The
   composer takes the name only while that hand-off runs. */
html[data-cloud-intent-morph] [data-tour="composer"] { view-transition-name: cloud-intent; }
::view-transition-group(cloud-intent) {
  animation-duration: 0.5s;
  animation-timing-function: cubic-bezier(0.32, 0.72, 0, 1);
}
/* Cloud setup progress: each segment fills left to right on clip-path, so
   its rounded ends stay round. A segment that fills (on arrival, or when a
   step finishes) waits for the step's check to land, and on arrival each
   waits for the one before it. Emptying is the transition, and is quick. */
.progress-fill {
  clip-path: inset(0 100% 0 0 round 999px);
  transition: clip-path 0.2s cubic-bezier(0.23, 1, 0.32, 1), background-color 0.3s ease;
}
.progress-fill[data-filled] {
  clip-path: inset(0 0 0 0 round 999px);
  animation: progress-fill 0.55s cubic-bezier(0.23, 1, 0.32, 1) backwards;
  animation-delay: calc(0.2s + var(--i, 0) * 0.09s);
}
@keyframes progress-fill {
  from { clip-path: inset(0 100% 0 0 round 999px); }
}
/* "Thinking…" label sheen while the model reasons. The band crosses the phrase while the brighter copy inside it
   crosses back, so the letters hold still and only the light moves. It moves by transform, in a dozen steps, and
   rests between sweeps: a smooth sweep (or a background-position one) draws the whole page every display frame for
   as long as a turn runs. */
@keyframes sheen-band {
  from { transform: translateX(-70%); animation-timing-function: steps(12, jump-none); }
  35%, to { transform: translateX(70%); }
}
@keyframes sheen-letters {
  from { transform: translateX(70%); animation-timing-function: steps(12, jump-none); }
  35%, to { transform: translateX(-70%); }
}
@keyframes reduced-loader-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}
/* Long-lived activity dots: steps() + holds draw a handful of compositor
   frames per cycle instead of one per vsync. Indicators that run for
   minutes must not continuously repaint; stagger via animation-delay. */
@keyframes status-pulse {
  0%, 100% { opacity: 0.25; }
  30% { opacity: 1; }
  60% { opacity: 0.25; }
}
.thinking-shimmer {
  position: relative;
  color: var(--color-ink-secondary);
  /* A truncated phrase clips to its box, and a tight line box (leading-none)
     is shorter than ascenders, descenders and arabic marks. Pad the box past
     the glyphs and pull the margins back so the layout doesn't move. */
  padding: 0.35em 0.12em;
  margin: -0.35em -0.12em;
}
.thinking-sheen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  user-select: none;
}
.thinking-sheen > span {
  position: absolute;
  inset: 0;
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 50%, transparent 70%);
  mask-image: linear-gradient(90deg, transparent 30%, #000 50%, transparent 70%);
  animation: sheen-band var(--sheen-period) linear var(--sheen-delay) infinite;
}
.thinking-sheen > span::before {
  content: attr(data-text) / "";
  position: absolute;
  inset: 0;
  padding: 0.35em 0.12em;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--color-ink);
  animation: sheen-letters var(--sheen-period) linear var(--sheen-delay) infinite;
}
/* Simple mode's typing row is quieter: the sheen runs from tertiary ink up to secondary. */
.turn-phrase-quiet .thinking-shimmer { color: var(--color-ink-tertiary); }
.turn-phrase-quiet .thinking-sheen > span::before { color: var(--color-ink-secondary); }
/* rotating presence phrase: the new phrase fades in where the old one was;
   only one is ever drawn */
@keyframes turn-phrase-in {
  from { opacity: 0; }
}
.turn-phrase-in { animation: turn-phrase-in 0.32s ease-out both; }
@keyframes icon-morph-in {
  from { opacity: 0; transform: scale(0.84); }
  to { opacity: 1; transform: none; }
}
.animate-icon-morph { animation: icon-morph-in 140ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.chevron-turn { transition: rotate 150ms cubic-bezier(0.22, 1, 0.36, 1), transform 150ms cubic-bezier(0.22, 1, 0.36, 1); }
.turn-now-toggle {
  display: flex;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  margin: -4px -6px;
  padding: 4px 6px;
  border-radius: 8px;
  text-align: start;
  cursor: pointer;
}
.turn-now-toggle:hover, .turn-now-toggle[aria-expanded="true"] {
  background: color-mix(in srgb, var(--color-ink) 5%, transparent);
}
.turn-now-toggle:focus-visible {
  outline: 1.5px solid var(--color-focus);
  outline-offset: 1px;
}
.turn-now-chevron {
  flex-shrink: 0;
  color: var(--color-ink-tertiary);
  transition: transform 160ms ease-out;
}
@keyframes turn-now-in {
  from { opacity: 0; transform: translateY(-2px); }
}
.turn-now-card {
  margin-top: 8px;
  margin-inline-start: 44px;
  width: min(560px, calc(100% - 44px));
  border-radius: 14px;
  background: var(--color-composer);
  box-shadow: 0 0 0 0.5px color-mix(in srgb, var(--color-ink) 10%, transparent);
  padding: 10px 12px;
  animation: turn-now-in 160ms ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  .turn-now-card { animation: none; }
  .turn-now-chevron { transition: none; }
  .animate-caret, .animate-msg-in, .animate-pop-in, .animate-pop-out, .animate-menu-in { animation: none; }
  .animate-status-pulse { animation: none; opacity: 0.6; }
  .thinking-sheen { display: none; }
  .turn-phrase-in, .animate-icon-morph { animation: none; }
  .chevron-turn { transition: none; }
  .turn-mascot-in, .turn-mascot-out, .turn-answer { animation: none; }
  .reply-bubble-in { animation: none; }
  .animate-rise, .animate-spot-in { animation: none; }
  .animate-ripple, .animate-bolt { animation: none; }
  .step-open, .check-in, .progress-fill { animation: none; transition: none; }
  /* The drawer still moves, it just arrives instantly. */
  aside { transition: none; }
}
/* The onboarding preview page flips this to show the reduced variant
   without touching system settings; the welcome flow also reads it to skip
   its view transitions. Mirrors the media block above for its own classes. */
:root[data-reduced-motion="true"] .animate-rise,
:root[data-reduced-motion="true"] .animate-link-flow,
:root[data-reduced-motion="true"] .animate-spot-in,
:root[data-reduced-motion="true"] .animate-pop-in,
:root[data-reduced-motion="true"] .animate-pop-out,
:root[data-reduced-motion="true"] .animate-menu-in,
:root[data-reduced-motion="true"] .md\:animate-panel-beside-in,
:root[data-reduced-motion="true"] .step-open,
:root[data-reduced-motion="true"] .check-in,
:root[data-reduced-motion="true"] .progress-fill,
:root[data-reduced-motion="true"] .turn-phrase-in,
:root[data-reduced-motion="true"] .animate-icon-morph,
:root[data-reduced-motion="true"] .chevron-turn,
:root[data-reduced-motion="true"] .welcome-screen * {
  animation: none !important;
  transition: none !important;
}

/* SupaMaus vector motion. The fast horizontal compression is the edge-on
   moment of a turn; face parallax, surface lighting, and orbiting vector marks
   sell the 3D rotation without duplicate silhouettes, raster frames, or WebGL. */
.maus-character,
.maus-orbit,
.maus-face,
.maus-solid,
.maus-eyes,
.maus-fx {
  transform-box: view-box;
  transform-origin: 100px 100px;
}

.maus-orbit,
.maus-fx {
  opacity: 0;
}

.maus-character {
  transform-style: preserve-3d;
}

.maus-bevel,
.maus-rim-light {
  pointer-events: none;
}

.maus-specular {
  opacity: 0.3;
}

.maus-eyes {
  transform: translate(var(--maus-eye-x), var(--maus-eye-y));
  transition: transform 150ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.maus-fx {
  pointer-events: none;
}

.maus-ribbon,
.maus-burst-ray {
  fill: none;
  stroke-linecap: round;
}

.maus-ribbon {
  stroke-width: 4;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.maus-ribbon--two { stroke-width: 2.4; }
.maus-ribbon--three { stroke-width: 3; }

.maus-burst-dot,
.maus-burst-ray,
.maus-ellipsis-dot {
  transform-box: fill-box;
  transform-origin: center;
}

.maus-burst-ray {
  stroke-width: 3;
}

.maus-speed-line {
  fill: none;
  stroke: var(--maus-color);
  stroke-linecap: round;
  stroke-width: 3.5px;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}

.maus-speed-line--two {
  /* the mascot's own --maus-color is set per motion; this line reads against
     the app ground instead, so it follows the skin */
  stroke: var(--color-maus-line);
  stroke-width: 2.5px;
}

.maus-motion--arrive .maus-character {
  animation: maus-arrive 940ms cubic-bezier(0.2, 0.82, 0.22, 1) both;
}

.maus-motion--switch .maus-character {
  animation: maus-switch 760ms cubic-bezier(0.2, 0.74, 0.16, 1) both;
}

.maus-motion--customize .maus-character {
  animation: maus-customize 720ms cubic-bezier(0.18, 0.78, 0.2, 1) both;
}

.maus-motion--switch .maus-face,
.maus-motion--customize .maus-face {
  animation: maus-face-parallax 760ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.maus-motion--arrive .maus-face {
  animation-name: maus-face-arrive;
  animation-duration: 940ms;
}

.maus-motion--arrive .maus-specular,
.maus-motion--switch .maus-specular,
.maus-motion--customize .maus-specular,
.maus-motion--success .maus-specular,
.maus-motion--celebrate .maus-specular {
  animation: maus-specular-sweep 760ms ease-out both;
}

.maus-motion--arrive .maus-specular { animation-duration: 940ms; }

.maus-motion--arrive .maus-orbit,
.maus-motion--switch .maus-orbit,
.maus-motion--customize .maus-orbit {
  animation: maus-orbit-turn 760ms cubic-bezier(0.24, 0.76, 0.3, 1) both;
}

.maus-motion--arrive .maus-orbit {
  animation-duration: 940ms;
}

.maus-motion--arrive .maus-speed-line,
.maus-motion--switch .maus-speed-line,
.maus-motion--customize .maus-speed-line {
  animation: maus-line-draw 760ms ease-out both;
}

.maus-motion--arrive .maus-speed-line {
  animation-duration: 940ms;
}

.maus-motion--arrive .maus-orbit-dot,
.maus-motion--switch .maus-orbit-dot,
.maus-motion--customize .maus-orbit-dot {
  transform-box: fill-box;
  transform-origin: center;
  animation: maus-dot-pop 760ms ease-out both;
}

.maus-motion--arrive .maus-orbit-dot {
  animation-duration: 940ms;
}

.maus-orbit-dot--two { animation-delay: 45ms !important; }
.maus-orbit-dot--three { animation-delay: 85ms !important; }

.maus-motion--alert .maus-character {
  animation: maus-alert-body 1050ms cubic-bezier(0.18, 0.78, 0.18, 1) both;
}

.maus-motion--alert .maus-fx--alert {
  animation: maus-alert-symbol 1050ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.maus-motion--thinking .maus-character {
  animation: maus-thinking-body 1300ms cubic-bezier(0.2, 0.76, 0.18, 1) both;
}

.maus-motion--thinking .maus-fx--ellipsis {
  animation: maus-ellipsis-stage 1300ms ease-in-out both;
}

.maus-motion--thinking .maus-ellipsis-dot {
  animation: maus-ellipsis-dot 1300ms ease-in-out both;
}

.maus-motion--thinking .maus-ellipsis-dot--two { animation-delay: 70ms; }
.maus-motion--thinking .maus-ellipsis-dot--three { animation-delay: 140ms; }

.maus-motion--working .maus-character {
  animation: maus-working-body 1150ms ease-in-out infinite;
}

.maus-motion--working .maus-orbit {
  animation: maus-working-orbit 1150ms linear infinite;
}

.maus-motion--working .maus-orbit-dot {
  animation: maus-working-dot 1150ms ease-in-out infinite;
}

.maus-motion--launch .maus-character {
  animation: maus-launch-body 1180ms cubic-bezier(0.2, 0.8, 0.18, 1) both;
}

.maus-motion--launch .maus-fx--ribbons {
  animation: maus-ribbon-stage 1180ms ease-out both;
}

.maus-motion--launch .maus-ribbon {
  animation: maus-ribbon-draw 1180ms ease-out both;
}

.maus-motion--success .maus-character {
  animation: maus-success-body 900ms cubic-bezier(0.18, 0.8, 0.2, 1) both;
}

.maus-motion--celebrate .maus-character {
  animation: maus-celebrate-body 1250ms cubic-bezier(0.2, 0.82, 0.18, 1) both;
}

.maus-motion--celebrate .maus-fx--burst {
  animation: maus-burst-stage 1250ms ease-out both;
}

.maus-motion--celebrate .maus-burst-dot,
.maus-motion--celebrate .maus-burst-ray {
  animation: maus-burst-piece 1250ms ease-out both;
}

.maus-motion--celebrate .maus-burst-dot--one { --maus-burst-x: -34px; --maus-burst-y: -27px; }
.maus-motion--celebrate .maus-burst-dot--two { --maus-burst-x: 38px; --maus-burst-y: -19px; }
.maus-motion--celebrate .maus-burst-dot--three { --maus-burst-x: 33px; --maus-burst-y: 31px; }
.maus-motion--celebrate .maus-burst-dot--four { --maus-burst-x: -39px; --maus-burst-y: 22px; }

.maus-motion--blink .maus-eyes {
  animation: maus-blink-eyes 720ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.maus-motion--surprise .maus-character {
  animation: maus-surprise-body 820ms cubic-bezier(0.2, 0.82, 0.2, 1) both;
}

.maus-motion--surprise .maus-eyes {
  animation: maus-surprise-eyes 820ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.maus-motion--failure .maus-character {
  animation: maus-failure-body 980ms cubic-bezier(0.22, 0.76, 0.2, 1) both;
}

.maus-motion--failure .maus-fx--alert {
  animation: maus-failure-mark 980ms ease-out both;
}

@keyframes maus-arrive {
  0% {
    opacity: 0;
    transform: perspective(180px) translate3d(34px, 5px, 0) rotateY(78deg) rotateZ(42deg) scale(0.28, 0.68);
  }
  18% {
    opacity: 1;
    transform: perspective(180px) translate3d(15px, -3px, 8px) rotateY(58deg) rotateZ(24deg) scale(0.58, 1.1);
  }
  46% {
    transform: perspective(180px) translate3d(-4px, -3px, 13px) rotateY(-13deg) rotateZ(-8deg) scale(1.09, 0.91);
  }
  68% {
    transform: perspective(180px) translate3d(2px, 1px, -3px) rotateY(7deg) rotateZ(3deg) scale(0.96, 1.04);
  }
  84% {
    transform: perspective(180px) translate3d(-1px, 0, 1px) rotateY(-3deg) rotateZ(-1deg) scale(1.02, 0.985);
  }
  100% {
    opacity: 1;
    transform: perspective(180px) translate3d(0, 0, 0) rotateY(0) rotateZ(0) scale(1);
  }
}

@keyframes maus-switch {
  0% { transform: perspective(180px) translate3d(0, 0, 0) rotateY(0) rotateZ(0) scale(1); }
  13% { transform: perspective(180px) translate3d(-3px, 1px, 4px) rotateY(-12deg) rotateZ(-5deg) scale(1.08, 0.91); }
  35% { transform: perspective(180px) translate3d(8px, -2px, 10px) rotateY(76deg) rotateZ(13deg) scale(0.42, 1.06); }
  53% { transform: perspective(180px) translate3d(-4px, -2px, 7px) rotateY(-24deg) rotateZ(-7deg) scale(0.82, 0.96); }
  70% { transform: perspective(180px) translate3d(2px, 1px, -3px) rotateY(10deg) rotateZ(3deg) scale(1.07, 0.93); }
  86% { transform: perspective(180px) translate3d(-1px, 0, 1px) rotateY(-4deg) rotateZ(-1deg) scale(0.975, 1.025); }
  100% { transform: perspective(180px) translate3d(0, 0, 0) rotateY(0) rotateZ(0) scale(1); }
}

@keyframes maus-customize {
  0% { transform: perspective(180px) translate3d(0, 0, 0) rotateY(0) rotateZ(0) scale(1); }
  18% { transform: perspective(180px) translate3d(-4px, 1px, 5px) rotateY(-16deg) rotateZ(-7deg) scale(1.12, 0.88); }
  38% { transform: perspective(180px) translate3d(7px, -3px, 11px) rotateY(74deg) rotateZ(12deg) scale(0.44, 1.08); }
  57% { transform: perspective(180px) translate3d(-3px, -1px, 7px) rotateY(-23deg) rotateZ(-5deg) scale(1.08, 0.92); }
  77% { transform: perspective(180px) translate3d(1px, 1px, -2px) rotateY(8deg) rotateZ(2deg) scale(0.97, 1.03); }
  100% { transform: perspective(180px) translate3d(0, 0, 0) rotateY(0) rotateZ(0) scale(1); }
}

@keyframes maus-face-parallax {
  0%, 12% { opacity: 1; transform: translateX(0); }
  31% { opacity: 0.35; transform: translateX(-11px) scaleX(0.45); }
  41% { opacity: 0; transform: translateX(-16px) scaleX(0.1); }
  50% { opacity: 0; transform: translateX(14px) scaleX(0.12); }
  62% { opacity: 1; transform: translateX(5px) scaleX(0.82); }
  100% { opacity: 1; transform: translateX(0) scaleX(1); }
}

@keyframes maus-face-arrive {
  0%, 19% { opacity: 0; transform: translateX(12px) scaleX(0.2); }
  38% { opacity: 0.72; transform: translateX(5px) scaleX(0.7); }
  58%, 100% { opacity: 1; transform: translateX(0) scaleX(1); }
}

@keyframes maus-specular-sweep {
  0%, 100% { opacity: 0.3; translate: 0 0; }
  18% { opacity: 0.54; translate: -5px -2px; }
  38% { opacity: 0.92; translate: 34px 12px; }
  57% { opacity: 0.2; translate: -18px 7px; }
  78% { opacity: 0.38; translate: 4px 0; }
}

@keyframes maus-orbit-turn {
  0%, 8% { opacity: 0; transform: rotate(-46deg) scale(0.62); }
  25% { opacity: 0.9; }
  66% { opacity: 0.72; transform: rotate(34deg) scale(1.04); }
  100% { opacity: 0; transform: rotate(74deg) scale(1.18); }
}

@keyframes maus-line-draw {
  0%, 12% { stroke-dashoffset: 1; opacity: 0; }
  36% { stroke-dashoffset: 0.38; opacity: 0.9; }
  68% { stroke-dashoffset: 0; opacity: 0.48; }
  100% { stroke-dashoffset: -1; opacity: 0; }
}

@keyframes maus-dot-pop {
  0%, 10% { opacity: 0; transform: scale(0.15); }
  35% { opacity: 1; transform: scale(1.15); }
  65% { opacity: 0.75; transform: scale(0.82); }
  100% { opacity: 0; transform: scale(0.1); }
}

@keyframes maus-alert-body {
  0%, 100% { opacity: 1; transform: perspective(180px) scale(1) rotateZ(0); }
  16% { transform: perspective(180px) scale(1.12, 0.86) rotateZ(-6deg); }
  34%, 57% { opacity: 0.08; transform: perspective(180px) scale(0.09, 0.82) rotateZ(2deg); }
  72% { opacity: 1; transform: perspective(180px) scale(1.1, 0.9) rotateZ(5deg); }
  86% { transform: perspective(180px) scale(0.96, 1.04) rotateZ(-2deg); }
}

@keyframes maus-alert-symbol {
  0%, 22%, 66%, 100% { opacity: 0; transform: translateY(8px) scale(0.3); }
  37% { opacity: 1; transform: translateY(-3px) scale(1.08); }
  51% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes maus-thinking-body {
  0%, 100% { opacity: 1; transform: scale(1) rotateZ(0); }
  16% { transform: scale(1.08, 0.9) rotateZ(-5deg); }
  31%, 65% { opacity: 0.2; transform: translateY(2px) scale(0.13); }
  78% { opacity: 1; transform: scale(1.08, 0.92) rotateZ(4deg); }
  90% { transform: scale(0.97, 1.03) rotateZ(-1deg); }
}

@keyframes maus-ellipsis-stage {
  0%, 19%, 73%, 100% { opacity: 0; }
  32%, 63% { opacity: 1; }
}

@keyframes maus-ellipsis-dot {
  0%, 18%, 74%, 100% { opacity: 0; transform: translateY(8px) scale(0.25); }
  35% { opacity: 1; transform: translateY(-3px) scale(1.12); }
  48%, 62% { opacity: 0.78; transform: translateY(0) scale(0.88); }
}

@keyframes maus-working-body {
  0%, 100% { transform: perspective(180px) translateY(0) rotateY(-8deg) rotateZ(-2deg) scale(0.98); }
  50% { transform: perspective(180px) translateY(-3px) rotateY(12deg) rotateZ(3deg) scale(1.03); }
}

@keyframes maus-working-orbit {
  0% { opacity: 0.18; transform: rotate(0deg) scale(0.78); }
  45% { opacity: 0.9; }
  100% { opacity: 0.18; transform: rotate(360deg) scale(1.08); }
}

@keyframes maus-working-dot {
  0%, 100% { opacity: 0.32; transform: scale(0.65); }
  50% { opacity: 1; transform: scale(1.1); }
}

@keyframes maus-launch-body {
  0%, 100% { opacity: 1; transform: translate(0, 0) rotateZ(0) scale(1); }
  16% { transform: translate(-5px, 2px) rotateZ(-9deg) scale(1.13, 0.86); }
  31% { opacity: 0.72; transform: translate(-7px, 5px) rotateZ(-16deg) scale(0.16); }
  48% { opacity: 0.95; transform: translate(24px, -12px) rotateZ(18deg) scale(0.45); }
  66% { transform: translate(-3px, -2px) rotateZ(-6deg) scale(1.13, 0.9); }
  84% { transform: translate(1px, 1px) rotateZ(2deg) scale(0.97, 1.03); }
}

@keyframes maus-ribbon-stage {
  0%, 16%, 72%, 100% { opacity: 0; transform: rotate(-15deg) scale(0.65); }
  32%, 58% { opacity: 0.92; transform: rotate(3deg) scale(1); }
}

@keyframes maus-ribbon-draw {
  0%, 14% { opacity: 0; stroke-dashoffset: 1; }
  45% { opacity: 1; stroke-dashoffset: 0; }
  70%, 100% { opacity: 0; stroke-dashoffset: -1; }
}

@keyframes maus-success-body {
  0%, 100% { transform: translateY(0) rotateZ(0) scale(1); }
  20% { transform: translateY(4px) rotateZ(-5deg) scale(1.12, 0.82); }
  46% { transform: translateY(-8px) rotateZ(5deg) scale(0.91, 1.13); }
  68% { transform: translateY(1px) rotateZ(-2deg) scale(1.05, 0.95); }
  84% { transform: translateY(-1px) scale(0.98, 1.02); }
}

@keyframes maus-celebrate-body {
  0%, 100% { transform: perspective(180px) translateY(0) rotateY(0) rotateZ(0) scale(1); }
  17% { transform: perspective(180px) translateY(5px) rotateY(-13deg) rotateZ(-8deg) scale(1.14, 0.84); }
  42% { transform: perspective(180px) translateY(-10px) rotateY(22deg) rotateZ(13deg) scale(0.88, 1.15); }
  66% { transform: perspective(180px) translateY(0) rotateY(-8deg) rotateZ(-4deg) scale(1.08, 0.94); }
  84% { transform: perspective(180px) translateY(-2px) rotateY(3deg) rotateZ(2deg) scale(0.98, 1.02); }
}

@keyframes maus-burst-stage {
  0%, 16%, 82%, 100% { opacity: 0; transform: scale(0.4) rotate(-16deg); }
  34% { opacity: 1; transform: scale(1.12) rotate(4deg); }
  64% { opacity: 0.68; transform: scale(1.28) rotate(12deg); }
}

@keyframes maus-burst-piece {
  0%, 18% { opacity: 0; transform: translate(0, 0) scale(0.25); }
  42% { opacity: 1; transform: translate(var(--maus-burst-x, 0), var(--maus-burst-y, 0)) scale(1.12); }
  72%, 100% { opacity: 0; transform: translate(var(--maus-burst-x, 0), var(--maus-burst-y, 0)) scale(0.4); }
}

@keyframes maus-blink-eyes {
  0%, 20%, 48%, 72%, 100% { transform: translate(var(--maus-eye-x), var(--maus-eye-y)) scaleY(1); }
  34%, 60% { transform: translate(var(--maus-eye-x), var(--maus-eye-y)) scaleY(0.08); }
}

@keyframes maus-surprise-body {
  0%, 100% { transform: translateY(0) scale(1); }
  24% { transform: translateY(3px) scale(1.12, 0.86); }
  48% { transform: translateY(-5px) scale(0.92, 1.16); }
  72% { transform: translateY(1px) scale(1.05, 0.96); }
}

@keyframes maus-surprise-eyes {
  0%, 100% { transform: translate(var(--maus-eye-x), var(--maus-eye-y)) scale(1); }
  32%, 60% { transform: translate(var(--maus-eye-x), calc(var(--maus-eye-y) - 4px)) scale(1.24, 1.62); }
  78% { transform: translate(var(--maus-eye-x), var(--maus-eye-y)) scale(0.94, 0.88); }
}

@keyframes maus-failure-body {
  0%, 100% { opacity: 1; transform: translate(0, 0) rotateZ(0) scale(1); }
  18% { transform: translate(-4px, 2px) rotateZ(-8deg) scale(1.08, 0.88); }
  38% { opacity: 0.82; transform: translate(5px, 3px) rotateZ(19deg) scale(0.42, 1.08); }
  55% { transform: translate(-7px, 1px) rotateZ(-13deg) scale(0.78, 0.94); }
  72% { transform: translate(4px, 0) rotateZ(7deg) scale(1.08, 0.92); }
  86% { transform: translate(-1px, 0) rotateZ(-2deg) scale(0.98, 1.02); }
}

@keyframes maus-failure-mark {
  0%, 26%, 72%, 100% { opacity: 0; transform: translate(18px, -15px) scale(0.2); }
  43%, 58% { opacity: 1; transform: translate(18px, -15px) scale(0.42); }
}

@media (prefers-reduced-motion: reduce) {
  .maus-motion *,
  .maus-motion {
    animation: none !important;
  }

  .maus-orbit {
    display: none;
  }

  .maus-eyes { transform: none; }

  /* Stop spatial motion instead of accelerating infinite animations. Loading
     icons keep a slow opacity pulse, so progress remains visible without
     rotation, bounce, or flicker. */
  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0ms !important;
    scroll-behavior: auto !important;
  }

  .animate-spin {
    animation: reduced-loader-pulse 1.6s ease-in-out infinite !important;
  }
}

/* ─────────────────────────────────────────────────────────────────────────
   Filled accent / danger / success surfaces

   Components hardcode `text-white` on these fills (~20 call sites). That works
   only as long as every skin's accent is dark enough to carry white — which
   rules out any skin whose accent is meant to glow. Rather than edit twenty
   components, the ink is taken from a token here; `text-white` and this rule
   have equal specificity, and this file is loaded after Tailwind's utilities.
   Midnight sets the token to #ffffff, so its rendering is unchanged.
   ───────────────────────────────────────────────────────────────────────── */
.bg-accent {
  color: var(--color-accent-ink);
}
/* The accent as text (links, senders, pills) reads the accent's text tone: the
   accent is a fill colour and sinks below 4.5:1 as text on some dark skins,
   while --color-accent-text clears it on app, panel and card in every skin. */
.text-accent {
  color: var(--color-accent-text);
}
@media (hover: hover) {
  .hover\:text-accent:hover {
    color: var(--color-accent-text);
  }
}
.bg-danger {
  color: var(--color-danger-ink);
}
.bg-success {
  color: var(--color-success-ink);
}
/* Same mechanism, one skin deeper: Daylight paints the user's own bubble in
   near-black on a near-white page, and the `text-ink` the composer and the
   thread hardcode would be black on black. */
.bg-bubble-user {
  color: var(--color-bubble-user-ink);
}

/* Daylight's inverted bubble is a dark surface, including its editor,
   quoted replies and attachment controls. Keep their normal semantic tokens
   together; overriding only the parent's color leaves explicit child ink dark.
   Stop at a nested skin so the picker previews retain their own palettes. */
@scope ([data-skin="daylight"]) to ([data-skin]) {
  .bg-bubble-user {
    --color-ink: #fcfcfc;
    --color-ink-secondary: #c4c4c4;
    --color-ink-tertiary: #aaaaaa;
    --color-panel: #111111;
    --color-inset: #191919;
    --color-raised: #2f2f2f;
    --color-raised-hover: #3d3d3d;
    --color-control: #2f2f2f;
    --color-hairline: #666666;
    --color-accent: #7fc0ff;
    --color-accent-text: #7fc0ff;
    --color-accent-ink: #070707;
    --color-focus: #7fc0ff;
    --color-danger: #ff7788;
    --color-danger-ink: #070707;
    --color-success: #63b58a;
    --color-success-ink: #070707;
  }
}

/* Pop's own bubble is ink on cream: the same inverted context, with butter,
   coral and mint as the fills that carry ink text on it. */
@scope ([data-skin="pop"]) to ([data-skin]) {
  .bg-bubble-user {
    --color-ink: #ffffff;
    --color-ink-secondary: #e4dad0;
    --color-ink-tertiary: #bdb1a6;
    --color-panel: #2a221d;
    --color-inset: #2f2722;
    --color-raised: #3a322d;
    --color-raised-hover: #4a4039;
    --color-control: #3a322d;
    --color-hairline: #8a7e74;
    --color-accent: #ffd966;
    --color-accent-text: #ffd966;
    --color-accent-ink: #1b1613;
    --color-focus: #ffd966;
    --color-danger: #ff7a66;
    --color-danger-ink: #1b1613;
    --color-success: #8ee3b0;
    --color-success-ink: #1b1613;
  }
}

/* Pop's sticker look: ink outlines and hard offset shadows with no blur.
   Unlayered, so it wins over the utilities it restyles. A picker miniature
   is not a scope root, so its few pixels keep the plain palette. */
@scope ([data-skin="pop"]:not([data-skin-preview])) to ([data-skin]) {
  .bg-bubble-user {
    box-shadow: 3px 3px 0 var(--color-accent-border);
  }
  .bg-app {
    background-image: radial-gradient(
      circle,
      color-mix(in srgb, var(--color-raised-hover) 75%, transparent) 1.2px,
      transparent 1.4px
    );
    background-size: 18px 18px;
  }
  .bg-card {
    border: 2px solid var(--color-ink);
    box-shadow: 3px 3px 0 var(--color-ink);
  }
  .shadow-sm { --tw-shadow: 2px 2px 0 var(--color-ink); }
  .shadow-md { --tw-shadow: 3px 3px 0 var(--color-ink); }
  .shadow-lg { --tw-shadow: 4px 4px 0 var(--color-ink); }
  .shadow-xl { --tw-shadow: 6px 6px 0 var(--color-ink); }
  .shadow-2xl { --tw-shadow: 8px 8px 0 var(--color-ink); }
  .bg-menu,
  [role="menu"],
  [role="dialog"] {
    border: 2px solid var(--color-ink);
  }
  .ui-button,
  .ui-pill {
    border: 2px solid var(--color-ink);
    box-shadow: 2px 2px 0 var(--color-ink);
    font-weight: 700;
    transition: transform 90ms ease, box-shadow 90ms ease, background-color 120ms ease, color 120ms ease;
  }
  .ui-icon-button {
    border: 2px solid var(--color-ink);
    border-radius: 9999px;
    box-shadow: 2px 2px 0 var(--color-ink);
    background: var(--color-card);
    color: var(--color-ink);
  }
  button.bg-accent.text-accent-ink,
  button.bg-danger.text-danger-ink {
    border: 2px solid var(--color-ink);
    box-shadow: 2px 2px 0 var(--color-ink);
  }
  .glass-surface {
    background: var(--color-menu);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border: 3px solid var(--color-ink);
    box-shadow: 6px 6px 0 var(--color-ink);
  }
  .glass-card {
    background: var(--color-card);
    border: 2px solid var(--color-ink);
  }
  .glass-surface .bg-card {
    background-color: var(--color-card);
  }
  .glass-rail {
    background: var(--color-panel);
  }
  :is([role="progressbar"], [role="meter"]).overflow-hidden {
    height: 0.75rem;
    border: 2px solid var(--color-ink);
    background:
      repeating-linear-gradient(135deg, #efe4d4 0 4px, #e4d4bc 4px 6px);
  }
  :is([role="progressbar"], [role="meter"]).overflow-hidden > .bg-accent,
  :is([role="progressbar"], [role="meter"]).overflow-hidden > .bg-success {
    background-color: #8ee3b0;
  }
  :is([role="progressbar"], [role="meter"]).overflow-hidden > .bg-warning {
    background-color: #ffd966;
  }
  :is([role="progressbar"], [role="meter"]).overflow-hidden > .bg-danger {
    background-color: #ff7a66;
  }
  @media (prefers-reduced-motion: no-preference) {
    .ui-button:enabled:hover,
    button.ui-pill:enabled:hover,
    a.ui-pill:hover {
      transform: translate(-1px, -1px);
      box-shadow: 3px 3px 0 var(--color-ink);
    }
    .ui-button:enabled:active,
    button.ui-pill:enabled:active,
    a.ui-pill:active {
      transform: translate(2px, 2px);
      box-shadow: 0 0 0 var(--color-ink);
    }
  }
}

[data-skin="pop"][data-skin-preview] {
  box-shadow: 0 0 0 1.5px var(--color-ink), 2px 2px 0 1.5px var(--color-ink);
}
/* In Settings every preview has the same 0.5 px frame (the tile draws it), so Pop's own heavy outline never reads as the
   chosen tile's ring; its inner card outlines stay. */
[data-settings-look] [data-skin="pop"][data-skin-preview] {
  box-shadow: none;
}
[data-skin="pop"][data-skin-preview] .bg-card {
  box-shadow: 0 0 0 1px var(--color-ink);
}
[data-skin="pop"][data-skin-preview] .bg-bubble-user {
  box-shadow: 1.5px 1.5px 0 var(--color-accent-border);
}

/* The main pane only, and never the picker miniature. Isolation keeps the
   bats behind the conversation. */
@scope ([data-skin="halloween"]:not([data-skin-preview])) to ([data-skin]) {
  main.bg-app {
    isolation: isolate;
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 90 90'%3E%3Cg fill='none' stroke='%23f8efe2' stroke-opacity='.12' stroke-linecap='round'%3E%3Cpath d='M0 0h72M0 0l62 34M0 0l34 62M0 0v72'/%3E%3Cpath d='M16 0c-2 6-6 9-16 10M32 0c-4 12-12 18-32 20M48 0c-6 18-20 28-48 32M60 0c-6 22-26 40-60 46'/%3E%3C/g%3E%3Cpath d='M32 40v14' stroke='%23f8efe2' stroke-opacity='.12'/%3E%3Ccircle cx='32' cy='57' r='3' fill='%23f8efe2' fill-opacity='.12'/%3E%3C/svg%3E"),
      radial-gradient(60% 55% at 50% 100%, rgb(255 127 31 / 0.08), transparent 70%);
    background-repeat: no-repeat;
    background-position: 0 0, 0 0;
    background-size: 96px 96px, 100% 100%;
  }
  main.bg-app::before,
  main.bg-app::after {
    content: "";
    position: absolute;
    inset: 64px 0 auto 0;
    height: 120px;
    z-index: -1;
    pointer-events: none;
    background: no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 32'%3E%3Cpath fill='%23f8efe2' fill-opacity='.15' d='M32 10C34 6 35 5 36 4L37 9C40 8 44 6 48 2C50 8 56 10 64 10C58 14 56 20 56 26C52 22 47 21 43 23C41 21 38 21 36 24C35 26 33 28 32 30C31 28 29 26 28 24C26 21 23 21 21 23C17 21 12 22 8 26C8 20 6 14 0 10C8 10 14 8 16 2C20 6 24 8 27 9L28 4C29 5 30 6 32 10Z'/%3E%3C/svg%3E");
    background-size: 34px 17px;
    animation: halloween-bat 52s linear infinite;
  }
  main.bg-app::after {
    top: 104px;
    background-size: 22px 11px;
    animation-duration: 67s;
    animation-delay: -30s;
  }
}

@keyframes halloween-bat {
  0% { background-position: -60px 40px; }
  25% { background-position: 25% 22px; }
  50% { background-position: 50% 48px; }
  75% { background-position: 75% 26px; }
  100% { background-position: calc(100% + 60px) 40px; }
}

@media (prefers-reduced-motion: reduce) {
  [data-skin="halloween"] main.bg-app::before,
  [data-skin="halloween"] main.bg-app::after {
    display: none;
  }
}

/* The main pane only, and never the picker miniature. Isolation keeps the
   fireworks behind the conversation. */
@scope ([data-skin="diwali"]:not([data-skin-preview])) to ([data-skin]) {
  main.bg-app {
    isolation: isolate;
    background-image:
      url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 160 34'%3E%3Cpath d='M0 4Q80 30 160 4' fill='none' stroke='%23fff3e0' stroke-opacity='.12'/%3E%3Cg fill-opacity='.42'%3E%3Ccircle cx='20' cy='10' r='2.6' fill='%23ffb22e'/%3E%3Ccircle cx='60' cy='16' r='2.6' fill='%23ff6f9c'/%3E%3Ccircle cx='100' cy='16' r='2.6' fill='%23ffb22e'/%3E%3Ccircle cx='140' cy='10' r='2.6' fill='%23ff6f9c'/%3E%3C/g%3E%3C/svg%3E"),
      radial-gradient(60% 55% at 50% 100%, rgb(255 178 46 / 0.09), transparent 70%);
    background-repeat: repeat-x, no-repeat;
    background-position: 0 0, 0 0;
    background-size: 160px 34px, 100% 100%;
  }
  main.bg-app::before,
  main.bg-app::after {
    content: "";
    position: absolute;
    top: 96px;
    right: 12%;
    width: 120px;
    height: 120px;
    z-index: -1;
    pointer-events: none;
    background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cpath d='M60.0 42.0L60.0 18.0M69.0 44.4L81.0 23.6M75.6 51.0L96.4 39.0M78.0 60.0L102.0 60.0M75.6 69.0L96.4 81.0M69.0 75.6L81.0 96.4M60.0 78.0L60.0 102.0M51.0 75.6L39.0 96.4M44.4 69.0L23.6 81.0M42.0 60.0L18.0 60.0M44.4 51.0L23.6 39.0M51.0 44.4L39.0 23.6' stroke='%23ffc861' stroke-opacity='.3' stroke-width='2.4' stroke-linecap='round'/%3E%3Cg fill='%23fff3e0' fill-opacity='.28'%3E%3Ccircle cx='73.5' cy='9.8' r='2.2'/%3E%3Ccircle cx='96.8' cy='23.2' r='2.2'/%3E%3Ccircle cx='110.2' cy='46.5' r='2.2'/%3E%3Ccircle cx='110.2' cy='73.5' r='2.2'/%3E%3Ccircle cx='96.8' cy='96.8' r='2.2'/%3E%3Ccircle cx='73.5' cy='110.2' r='2.2'/%3E%3Ccircle cx='46.5' cy='110.2' r='2.2'/%3E%3Ccircle cx='23.2' cy='96.8' r='2.2'/%3E%3Ccircle cx='9.8' cy='73.5' r='2.2'/%3E%3Ccircle cx='9.8' cy='46.5' r='2.2'/%3E%3Ccircle cx='23.2' cy='23.2' r='2.2'/%3E%3Ccircle cx='46.5' cy='9.8' r='2.2'/%3E%3C/g%3E%3C/svg%3E");
    opacity: 0;
    animation: diwali-burst 9s ease-out infinite;
  }
  main.bg-app::after {
    top: 180px;
    right: auto;
    left: 14%;
    width: 84px;
    height: 84px;
    animation-duration: 11s;
    animation-delay: -5s;
  }
}

@keyframes diwali-burst {
  0%, 55% { opacity: 0; transform: scale(0.35); }
  62% { opacity: 1; }
  85%, 100% { opacity: 0; transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  [data-skin="diwali"] main.bg-app::before,
  [data-skin="diwali"] main.bg-app::after {
    display: none;
  }
}

/* Fixed to the window, so the band runs on unbroken from one pane to the next. Its dots are drawn at one CSS pixel
   each, so the field scales up pixelated; the pane's contents scale as usual. */
@scope ([data-skin="aurora"]:not([data-skin-preview])) to ([data-skin]) {
  main.bg-app {
    background-image: var(--aurora-field, none);
    background-size: var(--aurora-field-size, cover);
    background-repeat: no-repeat;
    background-attachment: fixed;
    image-rendering: pixelated;
  }
  main.bg-app > * {
    image-rendering: auto;
  }
}

@media (prefers-reduced-transparency: no-preference) and (forced-colors: none) {
  @scope ([data-skin="aurora"]:not([data-skin-preview])) to ([data-skin]) {
    main.bg-app :is(.bg-card, .bg-composer, .bg-bubble-user) {
      -webkit-backdrop-filter: blur(28px) saturate(150%);
      backdrop-filter: blur(28px) saturate(150%);
    }
    main.bg-app .glass-bar[data-glass-fade]::before,
    main.bg-app [data-composer-backdrop] {
      background: color-mix(in srgb, var(--color-app) 35%, transparent);
      -webkit-backdrop-filter: blur(20px) saturate(140%);
      backdrop-filter: blur(20px) saturate(140%);
    }
    main.bg-app .glass-bar[data-glass-fade]::before {
      mask-image: linear-gradient(to bottom, black 40%, transparent);
    }
    main.bg-app [data-composer-backdrop] {
      mask-image: linear-gradient(to bottom, transparent, black 20px);
    }
  }
  /* In Tailwind's own layer, at a utility's weight, so hover and expanded fills still win over the glass. */
  @layer utilities {
    @scope ([data-skin="aurora"]:not([data-skin-preview])) to ([data-skin]) {
      :where(main.bg-app) :is(.bg-card, .bg-composer) {
        background-color: color-mix(in srgb, var(--color-card) 62%, transparent);
      }
      :where(main.bg-app) .bg-bubble-user {
        background-color: color-mix(in srgb, var(--color-bubble-user) 78%, transparent);
      }
    }
  }
}

/* Disabled buttons.
   Upstream fades them with `disabled:opacity-40`. On a dark ground that holds:
   the button stays darker than the page and the white label survives. On a
   light ground it inverts — Atelier's #a05f25 at 40% over white lands on
   #d9bfa8, where white lettering measures 1.75:1 and effectively disappears.
   So the disabled state gets its own colours instead of transparency. */
button:disabled.bg-accent,
button:disabled.bg-danger {
  background-color: var(--color-raised-hover);
  color: var(--color-ink-secondary);
  opacity: 1;
}

/* Tailwind v4 does not provide pointer cursors for buttons by default.
   Restore them for enabled interactive controls across the app.
   Keep specificity low so component cursor styles can override this. */

@layer base {
  :where(
    button:not(:disabled, [aria-disabled="true"], [aria-busy="true"]),
    [role="button"]:not(:disabled, [aria-disabled="true"], [aria-busy="true"]),
    [role="link"]:not([aria-disabled="true"], [aria-busy="true"]),
    summary:not([aria-disabled="true"], [aria-busy="true"])
  ) {
    cursor: pointer;
  }
  /* lucide writes stroke-width="2" as an attribute, which any CSS outranks; an explicit strokeWidth prop is left alone. */
  :where(svg.lucide[stroke-width="2"]) {
    stroke-width: 1.9;
  }
  :where(code, pre, kbd, samp, .font-mono) {
    letter-spacing: 0;
  }
}

::highlight(omb-citation-source) {
  background-color: color-mix(in srgb, var(--color-accent) 35%, transparent);
}

/* Wide-gamut displays. The sRGB values above stay the fallback.
   On Display P3 the same hue is a little more chromatic, with lightness
   held, so the skin reads less dull without moving the neutrals. */
@media (color-gamut: p3) {
  :is([data-skin="midnight"]) {
    --color-accent: color(display-p3 0.2062 0.5041 0.9917);
    --color-accent-border: color(display-p3 0.3457 0.6136 0.9909);
    --color-accent-text: color(display-p3 0.5417 0.7465 0.9948);
    --color-success: color(display-p3 0.3728 0.8349 0.5737);
    --color-danger: color(display-p3 0.9587 0.3424 0.3958);
    --color-warning: color(display-p3 0.9705 0.5992 0.0744);
  }
  :is([data-skin="atelier"]) {
    --color-accent: color(display-p3 0.6084 0.3747 0.1500);
    --color-accent-border: color(display-p3 0.6696 0.4180 0.1773);
    --color-accent-text: color(display-p3 0.5695 0.3354 0.1264);
    --color-focus: color(display-p3 0.5695 0.3354 0.1264);
    --color-success: color(display-p3 0.2751 0.4198 0.2805);
    --color-danger: color(display-p3 0.6130 0.2306 0.1920);
    --color-warning: color(display-p3 0.4699 0.3740 0.1945);
  }
  :is([data-skin="foundry"]) {
    --color-accent: color(display-p3 0.8317 0.6065 0.2525);
    --color-accent-border: color(display-p3 0.8928 0.7007 0.3733);
    --color-accent-text: color(display-p3 0.8598 0.6457 0.3048);
    --color-focus: color(display-p3 0.8598 0.6457 0.3048);
    --color-success: color(display-p3 0.4046 0.6902 0.4742);
    --color-danger: color(display-p3 0.8455 0.4114 0.3635);
    --color-warning: color(display-p3 0.8564 0.6457 0.2655);
  }
  :is([data-skin="lagoon"]) {
    --color-accent: color(display-p3 0.1708 0.4496 0.4300);
    --color-accent-border: color(display-p3 0.1933 0.5005 0.4813);
    --color-accent-text: color(display-p3 0.1370 0.3714 0.3551);
    --color-focus: color(display-p3 0.1370 0.3714 0.3551);
    --color-success: color(display-p3 0.2280 0.4194 0.3117);
    --color-danger: color(display-p3 0.6315 0.2229 0.1802);
    --color-warning: color(display-p3 0.4684 0.3544 0.1678);
  }
  :is([data-skin="graphite"]) {
    --color-accent: color(display-p3 0.3280 0.4543 0.6408);
    --color-accent-border: color(display-p3 0.4292 0.5567 0.7384);
    --color-accent-text: color(display-p3 0.5770 0.7021 0.8792);
    --color-focus: color(display-p3 0.5770 0.7021 0.8792);
    --color-success: color(display-p3 0.4428 0.7097 0.5438);
    --color-danger: color(display-p3 0.8343 0.4228 0.4455);
    --color-warning: color(display-p3 0.8118 0.6338 0.3191);
  }
  :is([data-skin="linen"]) {
    --color-accent: color(display-p3 0.2306 0.3679 0.5469);
    --color-accent-border: color(display-p3 0.3109 0.4658 0.6570);
    --color-accent-text: color(display-p3 0.1963 0.3325 0.5077);
    --color-focus: color(display-p3 0.1963 0.3325 0.5077);
    --color-success: color(display-p3 0.2332 0.4391 0.3120);
    --color-danger: color(display-p3 0.6315 0.2423 0.2772);
    --color-warning: color(display-p3 0.4543 0.3583 0.1717);
  }
  :is([data-skin="dusk"]) {
    --color-accent: color(display-p3 0.4495 0.3350 0.5154);
    --color-accent-border: color(display-p3 0.5725 0.4369 0.6409);
    --color-accent-text: color(display-p3 0.7511 0.6056 0.8251);
    --color-focus: color(display-p3 0.7511 0.6056 0.8251);
    --color-success: color(display-p3 0.4731 0.6785 0.5159);
    --color-danger: color(display-p3 0.8279 0.4499 0.4734);
    --color-warning: color(display-p3 0.8014 0.6416 0.3675);
  }
  :is([data-skin="daylight"]) {
    --color-accent: color(display-p3 0.1269 0.3689 0.7837);
    --color-accent-border: color(display-p3 0.2062 0.5041 0.9917);
    --color-accent-text: color(display-p3 0.1193 0.3464 0.7357);
    --color-focus: color(display-p3 0.1269 0.3689 0.7837);
    --color-success: color(display-p3 0.2075 0.4783 0.3054);
    --color-danger: color(display-p3 0.7202 0.1738 0.2207);
    --color-warning: color(display-p3 0.5270 0.3546 0.0278);
  }
  :is([data-skin="meadow"]) {
    --color-accent: color(display-p3 0.1985 0.4783 0.2864);
    --color-accent-border: color(display-p3 0.2288 0.5411 0.3261);
    --color-accent-text: color(display-p3 0.1731 0.4195 0.2506);
    --color-focus: color(display-p3 0.1985 0.4783 0.2864);
    --color-success: color(display-p3 0.1985 0.4783 0.2864);
    --color-danger: color(display-p3 0.7202 0.1738 0.2207);
    --color-warning: color(display-p3 0.5270 0.3546 0.0278);
  }
  :is([data-skin="pop"]) {
    --color-accent: color(display-p3 0.4751 0.2990 0.9505);
    --color-accent-border: color(display-p3 0.5215 0.3418 0.9730);
    --color-accent-text: color(display-p3 0.4002 0.1038 0.8623);
    --color-focus: color(display-p3 0.4751 0.2990 0.9505);
    --color-success: color(display-p3 0.2127 0.4772 0.3073);
    --color-danger: color(display-p3 0.8102 0.2412 0.1727);
    --color-warning: color(display-p3 0.5248 0.3557 0.0473);
  }
  :is([data-skin="halloween"]) {
    --color-accent: color(display-p3 0.9556 0.5098 0.1754);
    --color-accent-border: color(display-p3 0.9592 0.5706 0.2597);
    --color-accent-text: color(display-p3 0.9634 0.6355 0.3925);
    --color-focus: color(display-p3 0.9592 0.5706 0.2597);
  }
}

.menu-surface {
  background: var(--color-menu);
  border-radius: var(--radius-menu);
  box-shadow: 0 0 0 0.5px color-mix(in srgb, var(--color-ink) 10%, transparent), var(--menu-shadow);
}
.menu-surface:focus-visible {
  outline: none;
}
.menu-surface :focus-visible {
  outline-width: 1.5px;
  outline-offset: -1.5px;
}
:root,
:is([data-skin="midnight"], [data-skin="foundry"], [data-skin="graphite"], [data-skin="dusk"], [data-skin="halloween"], [data-skin="diwali"], [data-skin="aurora"]) {
  --radius-menu: 12px;
  --menu-shadow: 0 14px 32px -10px rgb(0 0 0 / 0.7), 0 2px 8px rgb(0 0 0 / 0.35);
}
:is([data-skin="atelier"], [data-skin="lagoon"], [data-skin="linen"], [data-skin="meadow"], [data-skin="pop"]) {
  --menu-shadow: 0 8px 24px -6px rgb(0 0 0 / 0.12), 0 1px 2px rgb(0 0 0 / 0.04);
}
:is([data-skin="daylight"]) {
  --menu-shadow: 0 10px 20px -3px rgb(28 28 28 / 0.1), 0 4px 6px -4px rgb(28 28 28 / 0.1);
}

/* ── Phone ─────────────────────────────────────────────────────────────────
   Below the width where the sidebar stops being inline (SIDEBAR_INLINE in
   src/lib/use-media-query.ts, 768px), Midnight and Meadow take softer ground,
   a firmer outline on the composer and rounder corners. Only tokens move, so
   every surface follows without a component change; wider windows and the
   other skins keep the values above.

   Midnight lifts its near-black ground to a charcoal ramp; the ink tokens stay
   as they are. Meadow's ground goes from white to the sidebar's pale green and
   bot messages, menus and the composer stay white on it.

   scripts/check-skin-contrast.mjs measures these as "<skin> (phone)", so the
   AA pairs hold here exactly as on desktop. */
@media (max-width: 767.98px) {
  /* The window's frame keeps the desktop sidebar's colour at any width: the rail of places is a page 36px wide beside
     a full page, and both draw the frame's top bar or rail in one colour. */
  :is([data-skin="midnight"]) {
    --color-frame: #0e0e0e;
    --color-app: #141414;
    --color-panel: #1c1c1e;
    --color-raised: #2c2c2e;
    --color-raised-hover: #3a3a3c;
    --color-composer: #2c2c2e;
    --color-composer-ring: #3a3a3c;
    --color-card: #242426;
    --color-menu: #2c2c2e;
    --color-inset: #1c1c1e;
    --color-control: #2c2c2e;
    --color-hairline: #3a3a3c;
    --radius-lg: 12px;
    --radius-xl: 18px;
    --radius-2xl: 22px;
    --radius-3xl: 28px;
    --radius-menu: 22px;
  }
  :is([data-skin="meadow"]) {
    --color-frame: #f6f8f6;
    --color-app: #f6f8f6;
    --color-panel: #fcfdfc;
    --color-card: #ffffff;
    --color-inset: #e9eeea;
    --color-composer-ring: #cfd8d1;
    --color-hairline: #c1ccc4;
    --radius-lg: 12px;
    --radius-xl: 18px;
    --radius-2xl: 22px;
    --radius-3xl: 28px;
    --radius-menu: 22px;
  }
}

/* Window drag regions. A header marked by useCaptionChrome().dragProps is
   the window's title bar on macOS and frameless Windows; every control in it
   opts back out so it stays clickable, and so do menus and dialogs, which
   may overlap a header from a portal later in the DOM (Blink resolves
   regions in DOM order, so a later no-drag cuts into an earlier drag). The
   property inherits, so a select's or input's wrapper is cut out too: its
   chevron or icon overlay would otherwise drag over the field. A modal's
   full-window backdrop is cut out with its dialog, so a press on it over a
   header still closes the dialog instead of moving the window. The
   full-screen live desktop covers the headers beneath it the same way. */
[data-window-drag] :has(> :is(select, input)),
[data-window-drag] :is(button, a[href], input, select, textarea, label, summary, [role="button"], [role="link"], [role="tab"], [role="switch"], [role="checkbox"], [role="radio"], [role="combobox"], [role="slider"], [role="separator"], [contenteditable]:not([contenteditable="false"]), [tabindex]:not([tabindex="-1"])),
:is([role="menu"], [role="listbox"], [role="dialog"], [role="alertdialog"], [role="tooltip"]),
.fixed:has(> :is([role="dialog"], [role="alertdialog"], [aria-modal="true"])),
[data-browser-transport],
[data-live-desktop][data-expanded] {
  -webkit-app-region: no-drag;
}

/* Simple's sidebar in the window frame: Search and New sit in its top corner
   (Sidebar's corner row), and the bot tiles rise beside them while their first
   row leaves the corner free (SidebarTileGrid measures it). */
[data-sidebar-top-row="corner"] + [data-sidebar-tiles][data-beside-corner] {
  margin-top: -34px;
}

/* Room speaker names. Each skin sets a tone of the bot's palette that clears
   4.5:1 on the thread (--color-app). The class below only picks the token. */
.bot-identity[data-bot-color="green"] { color: var(--identity-green); }
.bot-identity[data-bot-color="blue"] { color: var(--identity-blue); }
.bot-identity[data-bot-color="red"] { color: var(--identity-red); }
.bot-identity[data-bot-color="orange"] { color: var(--identity-orange); }
.bot-identity[data-bot-color="purple"] { color: var(--identity-purple); }
.bot-identity[data-bot-color="cyan"] { color: var(--identity-cyan); }
.bot-identity[data-bot-color="pink"] { color: var(--identity-pink); }
.bot-identity[data-bot-color="yellow"] { color: var(--identity-yellow); }
.bot-identity[data-bot-color="teal"] { color: var(--identity-teal); }
.bot-identity[data-bot-color="coral"] { color: var(--identity-coral); }
.bot-identity[data-bot-color="silver"] { color: var(--identity-silver); }
.bot-identity[data-bot-color="chrome"] { color: var(--identity-chrome); }

.user-bubble-colored {
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.16);
}
[data-chat-bubble="simple"].user-bubble-colored {
  box-shadow: inset 0 0.5px 0 rgb(255 255 255 / 0.16);
}
.user-bubble-colored .mention-highlight {
  color: var(--color-ink);
  background: color-mix(in srgb, var(--mention-color) 22%, var(--color-inset));
  text-decoration-color: var(--color-ink);
}
.user-bubble-colored::selection,
.user-bubble-colored *::selection {
  background-color: var(--bubble-selection, color-mix(in srgb, #000000 35%, var(--color-bubble-user)));
  color: var(--bubble-selection-ink, #ffffff);
}

/* MausBot Cloud's night: a deep night sky in the dark skins and an indigo dusk in the light ones. light-dark() picks by
   the color-scheme of the element that paints it. One star twinkles, the z's drift and now and then a star shoots, each
   slowly; the z's need transform-box to grow around their own centre. */
:root {
  --cloud-night-from: light-dark(#2c3274, #0e1230);
  --cloud-night-mid: light-dark(#373b84, #151a45);
  --cloud-night-to: light-dark(#7a68ae, #252c69);
  --cloud-night-glow: light-dark(#f2a9c2, #6d5fd0);
  --cloud-night-ink: #ffffff;
  --cloud-night-ink-quiet: light-dark(#ffffffd6, #ffffffc4);
  --cloud-night-star: light-dark(#ffffff, #fff7dd);
  --cloud-night-laptop: light-dark(#eceef7, #c4c9de);
  --cloud-night-laptop-edge: light-dark(#a9aecb, #7c84a8);
  --cloud-night-z: light-dark(#ffffffe0, #dfe3ffcc);
  --cloud-night-paper: light-dark(#f7eedb, #efe4c6);
  --cloud-night-carve: light-dark(#d6c7a2, #c9bb95);
  --cloud-night-far: light-dark(#5a4e9c, #1f2560);
  --cloud-night-near: light-dark(#463f8c, #161b4b);
}
.cloud-night {
  color-scheme: var(--code-color-scheme);
  color: var(--cloud-night-ink);
  background:
    radial-gradient(55% 110% at 90% 115%, color-mix(in srgb, var(--cloud-night-glow) 20%, transparent), transparent 70%),
    linear-gradient(100deg, var(--cloud-night-from) 0%, var(--cloud-night-mid) 55%, var(--cloud-night-to) 100%);
  box-shadow: inset 0 0 0 0.5px rgb(255 255 255 / 0.08);
}
.cloud-night-twinkle { animation: cloud-night-twinkle 9s ease-in-out infinite; }
.cloud-night-z { transform-box: fill-box; transform-origin: center; animation: cloud-night-z 7s linear infinite; }
.cloud-night-z:nth-child(2) { animation-delay: -2.4s; }
.cloud-night-z:nth-child(3) { animation-delay: -4.8s; }
.cloud-night-shoot { opacity: 0; animation: cloud-night-shoot 19s ease-in infinite; }
.cloud-night[data-paused] * { animation-play-state: paused; }
@keyframes cloud-night-twinkle { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
@keyframes cloud-night-z {
  0% { opacity: 0; transform: translate(0, 0) scale(0.6); }
  15%, 70% { opacity: 1; }
  100% { opacity: 0; transform: translate(14px, -22px) scale(1.05); }
}
@keyframes cloud-night-shoot {
  0%, 90% { opacity: 0; transform: translate(0, 0); }
  92% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(120px, 36px); }
}

/* Trace waterfall: AI steps lavender, tools pale teal, errors red, each mixed into the skin's card so every skin keeps its contrast. */
.trace-bar { border: 1px solid transparent; }
.trace-bar-step {
  --trace-hue: #8b7cf6;
  background: color-mix(in srgb, var(--trace-hue) 20%, var(--color-card));
  border-color: color-mix(in srgb, var(--trace-hue) 42%, var(--color-card));
}
.trace-bar-tool {
  --trace-hue: #2aa79a;
  background: color-mix(in srgb, var(--trace-hue) 14%, var(--color-card));
  border-color: color-mix(in srgb, var(--trace-hue) 36%, var(--color-card));
}
.trace-bar-group { background: color-mix(in srgb, #2aa79a 9%, var(--color-card)); border-style: dashed; }
.trace-bar-error {
  background: color-mix(in srgb, var(--color-danger) 20%, var(--color-card));
  border-color: color-mix(in srgb, var(--color-danger) 60%, var(--color-card));
}
.trace-bar-span {
  background: color-mix(in srgb, var(--color-ink) 6%, var(--color-card));
  border-color: color-mix(in srgb, var(--color-ink) 13%, var(--color-card));
}
.trace-bar-span-error { border-color: color-mix(in srgb, var(--color-danger) 55%, var(--color-card)); }
.trace-bar-running { mask-image: linear-gradient(to right, #000 70%, rgb(0 0 0 / 0.35)); }
.trace-step-box { background: color-mix(in srgb, #8b7cf6 14%, var(--color-card)); border-color: color-mix(in srgb, #8b7cf6 30%, var(--color-card)); }
.trace-step-ink { color: color-mix(in srgb, #7c6cf0 85%, var(--color-ink)); }
.trace-tool-ink { color: color-mix(in srgb, #1f9a8c 80%, var(--color-ink)); }

.fade-end {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}
.fade-end:dir(rtl) {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
}

/* The Teams What's new: the card fades in growing slightly, then the four teammates join the bot one after another,
   about 600 ms in all. Each rests visible, so without motion everything is simply there. */
.teams-card-in { animation: teams-card-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.teams-face-in { animation: teams-face-in 200ms cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(180ms + var(--face, 0) * 70ms); }
@keyframes teams-card-in {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes teams-face-in {
  from { opacity: 0; transform: translateX(var(--from-x, 0)) scale(0.6); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .teams-card-in, .teams-face-in { animation: none; }
}
:root[data-reduced-motion="true"] .teams-card-in,
:root[data-reduced-motion="true"] .teams-face-in {
  animation: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  .chat-run-log-actions {
    animation: chat-run-log-reveal 160ms ease-out both;
  }
}

@keyframes chat-run-log-reveal {
  from { opacity: 0; transform: translateX(-0.375rem); }
  to { opacity: 1; transform: translateX(0); }
}

/* The chat backdrop (GlassScrollFrame's ChatBackdrop) is a theme's to paint and animate; with reduced motion asked for,
   whatever a theme animates there stands still, whether or not its CSS says so. */
@media (prefers-reduced-motion: reduce) {
  [data-look="chat-backdrop"],
  [data-look="chat-backdrop"]::before,
  [data-look="chat-backdrop"]::after {
    animation: none !important;
    transition: none !important;
  }
}

/* Skill Burger. The fun is in shape and motion: buns with rounder outer corners, three sesame dots, layers that settle
   in with a soft overshoot (the one place --ease-settle is used), and a single press of the bottom bun when the run is
   saved. Nothing loops but the running layer's sheen, and reduced motion turns every bit of it off. */
.skill-burger { --ease-settle: cubic-bezier(0.34, 1.4, 0.64, 1); }
.burger-sesame {
  position: absolute;
  top: 6px;
  inset-inline-start: 50%;
  width: 26px;
  height: 4px;
  transform: translateX(-50%);
  background:
    radial-gradient(circle, color-mix(in srgb, var(--color-ink) 18%, transparent) 1.5px, transparent 2px) 0 50% / 9px 4px repeat-x;
  pointer-events: none;
}
[dir="rtl"] .burger-sesame { transform: translateX(50%); }
/* A new step slides in: its row opens from nothing so the card grows smoothly (nothing below jumps), the layer drops a
   little from above out of a soft blur and settles, and its fill glows faintly with the accent before fading to the card. */
@keyframes burger-drop {
  0% { opacity: 0; min-height: 0; max-height: 0; transform: translateY(-12px) scale(0.96); filter: blur(4px); }
  45% { opacity: 1; min-height: 2.25rem; max-height: 3rem; filter: blur(0); }
  100% { opacity: 1; min-height: 2.25rem; max-height: none; transform: none; filter: none; }
}
@keyframes burger-land {
  from { background-color: color-mix(in srgb, var(--color-accent) 14%, var(--color-card)); }
  to { background-color: var(--color-card); }
}
.burger-layer {
  overflow: hidden;
  animation: burger-drop 560ms cubic-bezier(0.22, 1, 0.36, 1) both, burger-land 1100ms ease-out 180ms both;
}
@keyframes burger-press {
  0%, 100% { transform: none; }
  45% { transform: translateY(-3px); }
}
.burger-stacked .burger-bun-bottom { animation: burger-press 240ms cubic-bezier(0.22, 1, 0.36, 1); }
.burger-stacked .burger-bun-bottom > * { animation: fade-in 200ms ease-out both; }
@media (prefers-reduced-motion: reduce) {
  .burger-layer, .burger-stacked .burger-bun-bottom, .burger-stacked .burger-bun-bottom > * { animation: none; }
}
:root[data-reduced-motion="true"] :is(.burger-layer, .burger-stacked .burger-bun-bottom, .burger-stacked .burger-bun-bottom > *) { animation: none; }
:root[data-reduced-motion="true"] .skill-burger .thinking-sheen { display: none; }
/* The pill's count ticks over in place, and a new app's mark slides in at its end. */
@keyframes burger-tick { from { opacity: 0; transform: translateY(45%); } }
.burger-tick { animation: burger-tick 180ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes burger-mark-in { from { opacity: 0; transform: translateX(-6px) scale(0.96); } }
.burger-mark-in { animation: burger-mark-in 220ms cubic-bezier(0.22, 1, 0.36, 1) both; }
@media (prefers-reduced-motion: reduce) { .burger-tick, .burger-mark-in { animation: none; } }
:root[data-reduced-motion="true"] :is(.burger-tick, .burger-mark-in) { animation: none; }
/* Folding the layers: the list's row collapses to nothing and fades, so the bun below glides up rather than jumping. */
.burger-fold { display: grid; grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease-out; }
.burger-fold[data-folded="true"] { grid-template-rows: 0fr; opacity: 0; }
.burger-fold > ol, .burger-fold > div { overflow: hidden auto; min-width: 0; }
.burger-fold { grid-template-columns: minmax(0, 1fr); }
/* Rows that open to show more (a finished run's steps, its inputs and outcome, a step's replies) keep the landing glow
   but not the drop's height cap. */
.burger-layer.burger-open { animation: burger-land 1100ms ease-out 180ms both; }
@media (prefers-reduced-motion: reduce) { .burger-fold { transition: none; } }
:root[data-reduced-motion="true"] .burger-fold { transition: none; }
/* Thread tabs, from tablet width up: the sidebar and the chat header's band are one frame in the sidebar's ground, and
   the chat is a card set into it, its top corners rounded where it meets the band (the right one square while a panel
   sits beside the chat). A hairline in the frame's edge colour runs along the card's top, round its corners and down
   the sidebar's side. The open tab's ground is the card's and slides between tabs; its foot curves out into the band.
   Separators sit only between two closed tabs, neither under the pointer. Every control in the band is 32px tall on
   the sidebar buttons' centre line, 10px apart as the sidebar's are, and the band's end inset mirrors the sidebar's;
   Simple's sidebar buttons step down to 32px beside it on the same line. Midnight's frame sits a step darker than its
   sidebar elsewhere, so the card's corners read as clearly as Daylight's. */
@media (min-width: 768px) {
  [data-chathead-tabs] {
    --chat-card-radius: var(--radius-xl);
    position: relative; padding-top: 12px; padding-bottom: 0;
    background: linear-gradient(var(--color-edge), var(--color-edge)) var(--chat-card-radius) 100% / calc(100% - 2 * var(--chat-card-radius)) 0.5px no-repeat, var(--color-panel);
  }
  [data-chathead-tabs="advanced"] { padding-top: 6px; }
  [data-chathead-tabs]:has([data-panel-beside]) { background-size: calc(100% - var(--chat-card-radius)) 0.5px, auto; }
  [data-chathead-tabs]::before,
  [data-chathead-tabs]::after { content: ""; position: absolute; top: 100%; width: var(--chat-card-radius); height: var(--chat-card-radius); pointer-events: none; }
  [data-chathead-tabs]::before { left: 0; background: radial-gradient(circle at 100% 100%, transparent calc(var(--chat-card-radius) - 0.5px), var(--color-edge) calc(var(--chat-card-radius) - 0.5px), var(--color-edge) var(--chat-card-radius), var(--color-panel) calc(var(--chat-card-radius) + 0.5px)); }
  [data-chathead-tabs]::after { right: 0; background: radial-gradient(circle at 0 100%, transparent calc(var(--chat-card-radius) - 0.5px), var(--color-edge) calc(var(--chat-card-radius) - 0.5px), var(--color-edge) var(--chat-card-radius), var(--color-panel) calc(var(--chat-card-radius) + 0.5px)); }
  [data-chathead-tabs]:has([data-panel-beside])::after { display: none; }
  :root[data-chat-tabs-frame="simple"] [data-sidebar] { border-image: linear-gradient(to bottom, transparent 60px, var(--color-edge) 60px) 1; }
  :root[data-chat-tabs-frame="advanced"] [data-sidebar] { border-image: linear-gradient(to bottom, transparent 54px, var(--color-edge) 54px) 1; }
  :root[data-skin="midnight"][data-chat-tabs-frame] { --color-frame: #0a0a0a; }
  :root[data-skin="midnight"][data-chat-tabs-frame] :is([data-sidebar], [data-places-rail], [data-chathead-tabs]) { --color-panel: #0a0a0a; }
  :root[data-chat-tabs-frame="simple"] [data-sidebar-top-row="simple"] { padding-top: 14px; }
  :root[data-chat-tabs-frame="simple"] [data-sidebar-top-row="simple"] :is([data-rail-toggle], [data-sidebar-top-buttons] button.size-9) { width: 32px; height: 32px; }
  [data-chathead-tabs] [data-chathead-row] { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; height: 100%; }
  [data-chathead-tabs] [data-chathead-identity] { grid-column: 2; justify-self: stretch; align-self: stretch; -webkit-app-region: drag !important; }
  [data-chathead-tabs] [data-chathead-identity] > :not([data-thread-tabs], [data-chathead-status]) { display: none; }
  [data-chathead-tabs="advanced"] [data-chathead-identity] { margin-inline-start: 8px; }
  [data-chathead-tabs] [data-chathead-controls] { grid-column: 3; margin-inline-start: 8px; gap: 10px; }
  [data-chathead-tabs="simple"] { height: 48px; padding-inline-end: 16px; }
  [data-chathead-tabs="advanced"] { height: 42px; padding-inline-end: 8px; }
  [data-chathead-tabs] [data-chathead-controls] :is(.size-9, .h-9, [data-model-pill]) { height: 32px; }
  [data-chathead-tabs] [data-chathead-controls] .size-9 { width: 32px; }
  [data-chathead-tabs] [data-chathead-controls] .min-w-9 { min-width: 32px; }
}
.thread-tab-indicator {
  --tab-foot: 10px;
  position: absolute; left: 0; bottom: 0; height: 34px; border-radius: var(--tab-foot) var(--tab-foot) 0 0; background: var(--color-app); pointer-events: none;
}
.thread-tab-indicator[data-glide] { transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), width 220ms cubic-bezier(0.22, 1, 0.36, 1); }
.thread-tab-indicator::before,
.thread-tab-indicator::after { content: ""; position: absolute; bottom: 0; width: var(--tab-foot); height: var(--tab-foot); }
.thread-tab-indicator::before { right: 100%; background: radial-gradient(circle at 0 0, transparent calc(var(--tab-foot) - 0.5px), var(--color-app) var(--tab-foot)); }
.thread-tab-indicator::after { left: 100%; background: radial-gradient(circle at 100% 0, transparent calc(var(--tab-foot) - 0.5px), var(--color-app) var(--tab-foot)); }
.thread-tab + .thread-tab::before {
  content: ""; position: absolute; inset-inline-start: -1.5px; top: 8px; width: 1px; height: 16px; background: var(--color-hairline);
  transition: opacity 120ms ease-out;
}
.thread-tab[aria-selected="true"]::before,
.thread-tab[aria-selected="true"] + .thread-tab::before,
.thread-tab:hover::before,
.thread-tab:hover + .thread-tab::before { opacity: 0; }
.thread-tab[data-entering] { animation: thread-tab-in 200ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.thread-tab[data-leaving] { animation: thread-tab-out 180ms cubic-bezier(0.22, 1, 0.36, 1) both; pointer-events: none; }
@keyframes thread-tab-in { from { max-width: 0; padding-inline: 0; opacity: 0; } }
@keyframes thread-tab-out { to { max-width: 0; padding-inline: 0; opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .thread-tab, .thread-tab::before, .thread-tab-indicator { animation: none !important; transition: none !important; }
}
:root[data-reduced-motion="true"] .thread-tab,
:root[data-reduced-motion="true"] .thread-tab::before,
:root[data-reduced-motion="true"] .thread-tab-indicator { animation: none !important; transition: none !important; }

/* The composer's end buttons in the order a bot set for the person (Advanced mode; src/lib/composer-layout.ts). With no
   order set the variables are unset, every button is 0, and the buttons keep their order in the markup. */
[data-composer-actions] > [data-composer-end="stop"] { order: var(--composer-order-stop, 0); }
[data-composer-actions] > [data-composer-context] { order: var(--composer-order-context, 0); }
[data-composer-actions] > [data-composer-end="mic"] { order: var(--composer-order-mic, 0); }
[data-composer-actions] > [data-call-root] { order: var(--composer-order-call, 0); }
[data-composer-actions] > :is([data-composer-send], [data-composer-follow-up]) { order: var(--composer-order-send, 0); }