Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

47.7 KB
Raw Blame
@import "tailwindcss";
@import "tw-animate-css";

/* iOS visual-viewport height (px), kept in sync by useViewportHeightVar. Consumed
   ONLY by the md+ chat (iPad / landscape), whose desktop layout can't use the
   mobile body-lock; the mobile shell + chat use the static --app-shell-h instead.
   Defaults to 100dvh before/without JS. */
:root {
  --app-vvh: 100dvh;
}

/* Static full-viewport height for the LOCKED mobile shell + mobile chat. NEVER
   JS-resized to the visual viewport (that mid-focus resize flung the input off the
   top); the locked page just pans under iOS to lift the composer. Uses dvh where
   supported (tracks the URL bar, not the keyboard), with a 100vh fallback for older
   iOS Safari that exposes visualViewport but not dvh — without it h-[…dvh] would be
   ignored, leaving the locked shell unbounded and clipping <main> instead of
   scrolling it. */
:root {
  --app-shell-h: 100vh;
}
@supports (height: 100dvh) {
  :root {
    --app-shell-h: 100dvh;
  }
}

/* How much bottom room the fixed mobile tab bar needs: its own height, the
   home-indicator inset, and a small gap. The shell's scroll area pads by it so
   the last row can always be scrolled clear, and a control pinned to the bottom
   of that scroll area offsets by it so it rests just above the bar. Two
   consumers, one number — the pair drifting apart is what leaves a button under
   the bar. */
:root {
  --mobile-nav-clearance: calc(5.5rem + env(safe-area-inset-bottom));
}

/* Height of the desktop shell's overlay title bar. On macOS the shell draws the
   page under its title bar, with the window controls floating over the top
   strip and a native drag area laid over it that no page control can receive
   clicks through. The shell's init script sets the real height on the document
   element before any page script runs; everywhere else — browsers, the PWA,
   other desktop platforms — it stays 0. Every surface anchored to the top of the
   viewport pads its own top by this, so nothing interactive sits in the strip. */
:root {
  --shell-titlebar-inset: 0px;
  /* macOS chat keeps the established 48px toolbar while the native shell
     clearance stays independently controlled by --shell-titlebar-inset. */
  --desktop-chat-toolbar-h: 48px;
}

/* Width of the desktop shell sidebar. The sidebar itself, every md+ content
   offset and the Settings overlay's left edge read this one value, so dragging
   the divider moves all of them together — including the overlay, which lives in
   a portal outside the shell's subtree. SidebarResizer overrides it on the
   document element while the shell is mounted; this default is its drag minimum
   (MIN_SIDEBAR_WIDTH), so the shell renders unchanged with no JS at all. */
:root {
  --app-sidebar-w: 248px;
}

@theme inline {
  --color-background: var(--background);
  --color-foreground: var(--foreground);
  --color-surface: var(--surface);
  --color-surface-2: var(--surface-2);
  --color-surface-3: var(--surface-3);
  --color-card: var(--card);
  --color-card-foreground: var(--card-foreground);
  --color-popover: var(--popover);
  --color-popover-foreground: var(--popover-foreground);
  --color-primary: var(--primary);
  --color-primary-foreground: var(--primary-foreground);
  --color-primary-ink: var(--primary-ink);
  --color-primary-hover: var(--primary-hover);
  --color-secondary: var(--secondary);
  --color-secondary-foreground: var(--secondary-foreground);
  --color-muted: var(--muted);
  --color-muted-soft: var(--muted-soft);
  --color-accent: var(--accent);
  --color-accent-foreground: var(--accent-foreground);
  --color-accent-ink: var(--accent-ink);
  --color-accent-hover: var(--accent-hover);
  --color-destructive: var(--destructive);
  --color-destructive-foreground: var(--destructive-foreground);
  --color-destructive-ink: var(--destructive-ink);
  --color-destructive-hover: var(--destructive-hover);
  --color-border: var(--border);
  --color-border-strong: var(--border-strong);
  --color-input: var(--input);
  --color-ring: var(--ring);
  /* Each accent is four tokens: --X is the brand fill and the base every wash
     mixes from, --X-foreground is the label printed on that fill, --X-soft is
     the wash, and --X-ink is the accent used as text on a neutral surface.
     Fill and ink pull in opposite directions on a light surface — the fill has
     to stay vivid to read as the brand, the ink has to go deep to stay legible
     — so they cannot be the same value. Use bg-X / border-X for the fill and
     text-X-ink for text. */
  --color-mint: var(--mint);
  --color-mint-soft: var(--mint-soft);
  --color-mint-ink: var(--mint-ink);
  --color-mint-hover: var(--mint-hover);
  --color-cyan: var(--cyan);
  --color-cyan-soft: var(--cyan-soft);
  --color-cyan-ink: var(--cyan-ink);
  --color-cyan-hover: var(--cyan-hover);
  --color-violet: var(--violet);
  --color-violet-soft: var(--violet-soft);
  --color-violet-foreground: var(--violet-foreground);
  --color-violet-ink: var(--violet-ink);
  --color-violet-hover: var(--violet-hover);
  --color-gold: var(--gold);
  --color-gold-soft: var(--gold-soft);
  --color-gold-foreground: var(--gold-foreground);
  --color-gold-ink: var(--gold-ink);
  --color-gold-hover: var(--gold-hover);
  --color-pink: var(--pink);
  --color-pink-soft: var(--pink-soft);
  --color-pink-ink: var(--pink-ink);

  /* Compatibility aliases for current UI during migration. */
  --color-bg: var(--background);
  --color-panel: var(--surface);
  --color-text: var(--foreground);

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo,
    Consolas, monospace;
  --font-display: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 20px;
  --radius-3xl: 24px;

  /* Card wash shadows (matches design.pen). The colour is `--card-wash` rather
     than a literal because this block is `@theme inline`: Tailwind substitutes
     each entry's value into the generated utility, so a light-theme override of
     the token itself would compile to nothing and the wash would keep the dark
     neon on a white page. Every other entry here is the same shape for the same
     reason -- `--color-mint: var(--mint)` and friends -- so theming happens in
     the runtime variable, never in the token. */
  --shadow-mint-card-sm: 0 8px 32px -8px var(--card-wash);
  --shadow-mint-card: 0 24px 48px -12px var(--card-wash);
  --shadow-mint-card-lg: 0 32px 64px -12px var(--card-wash);

  /* The accent glow scale, read off design.pen: `dot` is the Landing Page's
     status dot, `xs` a control track, `sm` its icon tile and the Doctor pulse,
     `md` its nav CTA, eyebrow badge and the Dashboard hero pulse, `lg` its hero
     button, `xl` the Welcome logo. Geometry and alpha come from those frames,
     with one departure: the dot glows at full alpha over near-black, and ours
     also sit on lit panels, so `dot` is clamped to 0.9 -- the brightest value
     the call sites were already using.

     `cta` is the exception that is not from design.pen. Its blur is themed
     because a neon that reads on black barely registers over a white card
     (owner decision 2026-08-14); its 0.6 is likewise owner-set.

     The colour, unlike the blur, does NOT vary by theme. design.pen's Light
     frame recolours the card washes above to the light brand mint and keeps
     every glow on the dark neon, so these stay literal instead of routing
     through a runtime variable the way `--card-wash` does. */
  --shadow-glow-dot-mint: 0 0 8px rgba(91, 255, 160, 0.9);
  --shadow-glow-dot-gold: 0 0 8px rgba(255, 200, 87, 0.9);
  --shadow-glow-dot-destructive: 0 0 8px rgba(255, 107, 107, 0.9);

  /* `wire` is the drop-shadow role: the Model Hub connection wires glow through
     `filter: drop-shadow(…)`, which takes no spread, so none of the sized roles
     above can be spelled into one. Like `dot` it is named for its use rather
     than its size, which is what the no-spread roles have in common.

     These three are a verbatim capture of what already shipped in
     modelHubSurface.css, down to the `color-mix`, so the wires render exactly as
     before -- the point of moving them was that a glow written as a filter
     escaped the guard entirely, not that the light was wrong. That does leave
     `wire` as the one role whose colour follows the theme, through `--mint` and
     friends, while every role above stays on the dark neon by design. Aligning
     them would repaint the wires in Light, so it is a design.pen decision and
     not this file's to take. */
  --shadow-glow-wire-mint: 0 0 4px color-mix(in srgb, var(--mint) 40%, transparent);
  --shadow-glow-wire-cyan: 0 0 4px color-mix(in srgb, var(--cyan) 40%, transparent);
  --shadow-glow-wire-violet: 0 0 4px color-mix(in srgb, var(--violet) 40%, transparent);

  /* The sized rungs are derived from one rule design.pen follows, not chosen
     one triple at a time: a glow is centred, its spread is a quarter of its
     blur, and its colour is the accent at #5BFFA070. Five annotated frames
     agree -- diagPulse 16/-4, heroPulse 24/-6, diagHero 32/-8, StepCard 48/-12
     -- and welCard, at blur 64, still holds -12, so that is the cap.

     Reading the rule off the design rather than off the call sites is what
     makes the rungs land on their frames. The first cut of this scale did the
     opposite: it took each rung from the middle of the literals it had to
     absorb, which produced `sm` at -2px -- a spread written nowhere in
     design.pen and nowhere in this tree -- and every 16px glow moved off its
     frame to reach it. glowScale.test.mjs asserts the rule so a rung cannot be
     nudged back off it.

     The rungs stop at the blurs design.pen actually draws. `xs` and `xl` exist
     because 12px and 48px glows are in the tree; without them a hero logo gets
     snapped to 32px, which is not a token conversion but a redesign. */
  --shadow-glow-xs-mint: 0 0 12px -3px rgba(91, 255, 160, 0.44);
  --shadow-glow-xs-cyan: 0 0 12px -3px rgba(63, 224, 229, 0.44);

  --shadow-glow-sm-mint: 0 0 16px -4px rgba(91, 255, 160, 0.44);
  --shadow-glow-sm-cyan: 0 0 16px -4px rgba(63, 224, 229, 0.44);
  --shadow-glow-sm-violet: 0 0 16px -4px rgba(124, 91, 255, 0.44);
  --shadow-glow-sm-gold: 0 0 16px -4px rgba(255, 200, 87, 0.44);

  --shadow-glow-md-mint: 0 0 24px -6px rgba(91, 255, 160, 0.44);
  --shadow-glow-md-cyan: 0 0 24px -6px rgba(63, 224, 229, 0.44);
  --shadow-glow-md-violet: 0 0 24px -6px rgba(124, 91, 255, 0.44);
  --shadow-glow-md-gold: 0 0 24px -6px rgba(255, 200, 87, 0.44);

  --shadow-glow-lg-mint: 0 0 32px -8px rgba(91, 255, 160, 0.44);
  --shadow-glow-lg-cyan: 0 0 32px -8px rgba(63, 224, 229, 0.44);
  --shadow-glow-lg-violet: 0 0 32px -8px rgba(124, 91, 255, 0.44);

  --shadow-glow-xl-mint: 0 0 48px -12px rgba(91, 255, 160, 0.44);

  /* The onboarding active/hover card halo: the design draws an OFFSET drop shadow,
     not a centred one, so this role is excused from the scale's centring rule and
     `glowScale.test.mjs` pins its own geometry per theme. The parts that differ per
     theme are named numbers re-anchored beside each palette, like `--brand-glow-blur`;
     the hue follows the declared mint through the mix. */
  --shadow-glow-onboarding-mint:
    0 2px var(--onboarding-glow-blur) var(--onboarding-glow-spread)
    color-mix(in srgb, var(--mint) var(--onboarding-glow-alpha), transparent);

  --shadow-glow-cta-mint: 0 0 var(--brand-glow-blur) -4px rgba(91, 255, 160, 0.6);
  --shadow-glow-cta-cyan: 0 0 var(--brand-glow-blur) -4px rgba(63, 224, 229, 0.6);
  --shadow-glow-cta-violet: 0 0 var(--brand-glow-blur) -4px rgba(124, 91, 255, 0.6);
  --shadow-glow-cta-gold: 0 0 var(--brand-glow-blur) -4px rgba(255, 200, 87, 0.6);

  /* The approved Workbench sidebar draws its selected nav row with a halo at the
     sized scale's own `sm` geometry and alpha -- 16/-4 at 0.44 -- but the design
     table gives it #10B98170 in Light beside #5BFFA070 in Dark, so the hue has to
     follow the palette. A written-out RGB cannot: the sized rungs stay on the dark
     neon precisely because their channels are spelled out. Mixing the live accent
     is what `wire` already does for the same reason, which is why this is a role
     named for its use rather than a fifth rung on the scale. */
  --shadow-glow-nav-mint: 0 0 16px -4px color-mix(in srgb, var(--mint) 44%, transparent);
}

:root,
[data-theme="dark"] {
  color-scheme: dark;

  --background: #080812;
  --foreground: #f5f1e8;
  --surface: #0e0e18;
  --surface-2: #11111c;
  --surface-3: #06060e;
  --card: #11111c;
  --card-foreground: #f5f1e8;
  --popover: #11111c;
  --popover-foreground: #f5f1e8;

  /* On a dark surface a vivid accent is already legible, so ink tracks fill
     here; light is where the two diverge. --violet is the one exception. */
  --primary: #5bffa0;
  --primary-foreground: #080812;
  --primary-ink: #5bffa0;
  /* Every interactive brand fill declares the value it hovers to, instead of deriving
     one with a filter. A filter scales the label along with the background, so it
     cannot move a pairing in a chosen direction: light's labels are white, already
     clamped at the top, and brightness(1.1) there dropped --primary from 2.54:1 to
     2.09:1 while brightness(0.95) bought nothing back (2.50:1). A declared fill leaves
     the label at full luminance and lifts that same hover to 3.23:1.
     Which way a fill moves follows its LABEL, not its theme — the distinction a single
     shared mix token could not express. These accents carry a dark label, so they
     lighten; --violet's label is white in both themes, so it darkens in both. Each
     value is the fill mixed 88% toward its label's opposite, and validate-theme.mjs
     asserts hovering never costs contrast, so no brand fill can ship without one. */
  --primary-hover: #6fffab;
  --secondary: #11111c;
  --secondary-foreground: #f5f1e8;
  --muted: #9ba3b8;
  --muted-soft: #0e0e18;
  --accent: #3fe0e5;
  --accent-foreground: #080812;
  --accent-ink: #3fe0e5;
  --accent-hover: #56e4e8;
  --destructive: #ff6b6b;
  --destructive-foreground: #080812;
  --destructive-ink: #ff6b6b;
  --destructive-hover: #ff7d7d;

  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.14);
  --input: rgba(255, 255, 255, 0.10);
  --ring: rgba(91, 255, 160, 0.6);

  /* Workbench shell surfaces from the approved design table, written as the exact
     8-digit hex the table states so no alpha is lost to a rounded decimal. The
     sidebar fill and the nav row states are their own tokens rather than reuses
     because two of them are not the value the nearest existing token holds: in
     Light the sidebar is #FCFCFE against a #ffffff --surface, and --nav-selected-bg
     is #10B98114 against --mint-soft's #10B98124. They happen to coincide in Dark,
     which is exactly why collapsing them there would look correct and render wrong
     in the other theme. */
  /* Bot avatars (docs/plans/bots.md D5). The main Bot's mascot sits on a well
     that follows the theme: dark here, white with a hairline ring in Light. An
     emoji avatar keeps one hue and takes its well's saturation and lightness
     from the theme; the default (the name's first character) is a deeper fill. */
  --bot-mascot-well: #16172b;
  --bot-mascot-ring: rgba(255, 255, 255, 0.1);
  --bot-mascot-shadow: none;
  --bot-emoji-well-saturation: 35%;
  --bot-emoji-well-lightness: 20%;
  --bot-initial-saturation: 45%;
  --bot-initial-lightness: 38%;
  --sidebar-background: #0e0e18;
  --nav-selected-bg: #5bffa029;
  --nav-selected-border: #5bffa059;
  --nav-hover-bg: #1a1a26;
  /* The well behind the brand mark, and the hairline around the decorative theme
     preview artwork in General Settings. --desktop-overlay-shadow is the shared
     shadow colour for surfaces that float above the shell (the settings/connection
     dialogs); it is a colour token, not a geometry one. */
  --logo-well-background: #ffffff04;
  --illustration-card-border: #ffffff1c;
  --desktop-overlay-shadow: #00000088;

  --mint: #5bffa0;
  --route-manual: #8bb4ff;
  --mint-soft: rgba(91, 255, 160, 0.16);
  --mint-ink: #5bffa0;
  --mint-hover: #6fffab;
  --cyan: #3fe0e5;
  --cyan-soft: rgba(63, 224, 229, 0.16);
  --cyan-ink: #3fe0e5;
  --cyan-hover: #56e4e8;
  /* Fill and ink both carry design.pen's #7c5bff. An accent is never moved off
     its design value to buy contrast — see the light block for the decision.
     Violet is the only accent whose label is white in BOTH themes, which is why
     it needs its own --violet-foreground rather than borrowing a theme rule: the
     Button used a hard-coded text-white, so nothing declared the pair and the
     guard could not see it. Naming it also fixes the hover direction — violet
     darkens on hover in dark too, where every other accent lightens. */
  --violet: #7c5bff;
  --violet-soft: rgba(124, 91, 255, 0.16);
  --violet-foreground: #ffffff;
  --violet-ink: #7c5bff;
  --violet-hover: #6d50e0;
  --gold: #ffc857;
  --gold-soft: rgba(255, 200, 87, 0.16);
  --gold-foreground: #080812;
  --gold-ink: #ffc857;
  --gold-hover: #ffcf6b;
  --pink: #ff5b8a;
  --pink-soft: rgba(255, 91, 138, 0.10);
  --pink-ink: #ff5b8a;

  /* Blur radius of the brand CTA glow, shared by all four `brand*` Button variants
     (see button-variants.ts). One radius, four accents — a per-accent value would be
     the drift that variant exists to remove. It lives here rather than in the class
     because it is the one part of that glow that differs per theme. */
  --brand-glow-blur: 16px;

  /* Per-theme geometry and alpha of the onboarding card halo; see the token above. */
  --onboarding-glow-blur: 12px;
  --onboarding-glow-spread: 0px;
  --onboarding-glow-alpha: 22%;
  /* Colour of the card wash shadows (`--shadow-mint-card*`). design.pen writes it
     as the frame's own brand mint at 0.078, which is why it is the one part of
     those shadows that moves between themes. */
  --card-wash: rgba(91, 255, 160, 0.078);

  /* The onboarding enable switch, drawn per theme by the reference: a lit border
     on the on-state in dark, none in light; a dark thumb on the lit track in dark,
     a white thumb in light. Named here so both palettes re-anchor them and the
     component stylesheet holds no literals. */
  --switch-onboarding-track-off: #1a1a26;
  --switch-onboarding-border-off: #ffffff24;
  --switch-onboarding-track-on: #5bffa0;
  --switch-onboarding-border-on: #5bffa057;
  --switch-onboarding-thumb-off: #9ba3b8;
  --switch-onboarding-thumb-on: #080812;

  /* Page-family gradients (mirror design.pen 1:1). Layers ordered top-most first. */
  --gradient-console:
    radial-gradient(50% 40% at 5% 5%, rgba(91, 255, 160, 0.20), rgba(91, 255, 160, 0) 100%),
    radial-gradient(40% 50% at 95% 40%, rgba(63, 224, 229, 0.122), rgba(63, 224, 229, 0) 100%),
    radial-gradient(60% 50% at 50% 100%, rgba(124, 91, 255, 0.078), rgba(124, 91, 255, 0) 100%),
    #080812;
  --gradient-settings:
    radial-gradient(50% 40% at 5% 5%, rgba(91, 255, 160, 0.20), rgba(91, 255, 160, 0) 100%),
    radial-gradient(50% 50% at 95% 50%, rgba(124, 91, 255, 0.10), rgba(124, 91, 255, 0) 100%),
    #080812;
  --gradient-wizard-welcome:
    radial-gradient(70% 60% at 50% 30%, rgba(91, 255, 160, 0.20), rgba(91, 255, 160, 0) 100%),
    radial-gradient(50% 50% at 85% 70%, rgba(63, 224, 229, 0.122), rgba(63, 224, 229, 0) 100%),
    #080812;
  --gradient-wizard-backends:
    radial-gradient(60% 50% at 50% 20%, rgba(124, 91, 255, 0.122), rgba(124, 91, 255, 0) 100%),
    #080812;
  --gradient-wizard-platforms:
    radial-gradient(60% 50% at 50% 20%, rgba(91, 255, 160, 0.20), rgba(91, 255, 160, 0) 100%),
    radial-gradient(40% 40% at 85% 70%, rgba(63, 224, 229, 0.122), rgba(63, 224, 229, 0) 100%),
    radial-gradient(40% 40% at 15% 70%, rgba(124, 91, 255, 0.122), rgba(124, 91, 255, 0) 100%),
    #080812;
  --gradient-wizard-slack:
    radial-gradient(50% 50% at 30% 20%, rgba(224, 30, 90, 0.122), rgba(224, 30, 90, 0) 100%),
    #080812;
  --gradient-wizard-summary:
    radial-gradient(60% 50% at 50% 30%, rgba(91, 255, 160, 0.20), rgba(91, 255, 160, 0) 100%),
    #080812;

  /* Legacy alias for any page still using --bg-page directly. */
  --bg-page: var(--gradient-console);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;

    --background: #f4f6fb;
    --foreground: #0a0a14;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --surface-3: #eef1f7;
    --card: #ffffff;
    --card-foreground: #0a0a14;
    --popover: #ffffff;
    --popover-foreground: #0a0a14;

    /* Fills keep design.pen's vivid light accents *and* its white label — the
       pairing the product shipped before it was briefly deepened. The brand
       pair is a product decision, not an oversight: an AI-colleague product
       should read as alive rather than muted, so the accent stays at full
       saturation and the label stays white the way the design drew it. That
       costs AA on the label (white on #10b981 is 2.54:1), so
       validate-theme.mjs exempts these pairs by *pinning* the ratio each was
       accepted at rather than skipping them — drift in either token changes
       the measured ratio and fails the guard until someone re-decides.
       --destructive needs no exemption: #e11d48 under white is 4.70:1.
       Accent-as-text uses --X-ink, which carries the same brand value; see the
       --mint-ink group. Owner decision 2026-08-14. */
    --primary: #10b981;
    --primary-foreground: #ffffff;
    --primary-ink: #10b981;
    /* Every brand fill darkens on hover here, because this theme's labels are white —
       see the dark block for why hover is a declared fill rather than a filter. */
    --primary-hover: #0ea372;
    --secondary: #eef1f7;
    --secondary-foreground: #0a0a14;
    --muted: #5c6079;
    --muted-soft: #eef1f7;
    --accent: #0891b2;
    --accent-foreground: #ffffff;
    --accent-ink: #0891b2;
    --accent-hover: #07809d;
    --destructive: #e11d48;
    --destructive-foreground: #ffffff;
    --destructive-ink: #e11d48;
    --destructive-hover: #c61a3f;

    --border: rgba(8, 8, 18, 0.08);
    --border-strong: rgba(8, 8, 18, 0.14);
    --input: rgba(8, 8, 18, 0.12);
    /* design.pen's mint at 50%. It composites to ~1.5:1 on every light surface,
       under the 3:1 non-text floor, and stays there by the same owner decision
       as the fills above: the ring is a hint drawn beside a focused control,
       and the brand value is not traded away to raise its ratio. */
    --ring: rgba(16, 185, 129, 0.5);

    /* Each --X-ink carries the same brand value as its fill: an accent is never
       moved off its design value to buy contrast. As small text on a light
       surface those values read 2.2-4.2:1, under WCAG AA (4.5:1), and stay
       there by the owner decision of 2026-08-14 above. The washes below mix
       from the fill, which is why they carry the fill's hex. */
    /* Mirrors the dark block's note: the sidebar fill and the selected nav wash
       are the two that genuinely differ from --surface and --mint-soft here. */
    /* Bot avatar wells; see the dark block. */
    --bot-mascot-well: #ffffff;
    --bot-mascot-ring: rgba(8, 8, 18, 0.1);
    --bot-mascot-shadow: drop-shadow(0 1px 1.5px rgba(8, 8, 18, 0.28));
    --bot-emoji-well-saturation: 85%;
    --bot-emoji-well-lightness: 92%;
    --bot-initial-saturation: 70%;
    --bot-initial-lightness: 45%;
    --sidebar-background: #fcfcfe;
    --nav-selected-bg: #10b98114;
    --nav-selected-border: #10b98160;
    --nav-hover-bg: #f5f5f6;
    --logo-well-background: #eef1f780;
    --illustration-card-border: #08081212;
    --desktop-overlay-shadow: #0a0a1424;

    --mint: #10b981;
    --route-manual: #245bcd;
    --mint-soft: rgba(16, 185, 129, 0.14);
    --mint-ink: #10b981;
    --mint-hover: #0ea372;
    --cyan: #0891b2;
    --cyan-soft: rgba(8, 145, 178, 0.14);
    --cyan-ink: #0891b2;
    --cyan-hover: #07809d;
    --violet: #7c3aed;
    --violet-soft: rgba(124, 58, 237, 0.14);
    --violet-foreground: #ffffff;
    --violet-ink: #7c3aed;
    --violet-hover: #6d33d1;
    --gold: #d97706;
    --gold-soft: rgba(217, 119, 6, 0.14);
    --gold-foreground: #ffffff;
    --gold-ink: #d97706;
    --gold-hover: #bf6905;
    --pink: #dc2659;
    --pink-soft: rgba(220, 38, 89, 0.10);
    --pink-ink: #dc2659;

    /* Light-theme page gradients (softer alphas over light base). */
    --gradient-console:
      radial-gradient(50% 40% at 5% 5%, rgba(16, 185, 129, 0.10), rgba(16, 185, 129, 0) 100%),
      radial-gradient(40% 50% at 95% 40%, rgba(8, 145, 178, 0.08), rgba(8, 145, 178, 0) 100%),
      radial-gradient(60% 50% at 50% 100%, rgba(124, 58, 237, 0.06), rgba(124, 58, 237, 0) 100%),
      #f4f6fb;
    --gradient-settings:
      radial-gradient(50% 40% at 5% 5%, rgba(16, 185, 129, 0.10), rgba(16, 185, 129, 0) 100%),
      radial-gradient(50% 50% at 95% 50%, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0) 100%),
      #f4f6fb;
    --gradient-wizard-welcome:
      radial-gradient(70% 60% at 50% 30%, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0) 100%),
      radial-gradient(50% 50% at 85% 70%, rgba(8, 145, 178, 0.08), rgba(8, 145, 178, 0) 100%),
      #f4f6fb;
    --gradient-wizard-backends:
      radial-gradient(60% 50% at 50% 20%, rgba(124, 58, 237, 0.10), rgba(124, 58, 237, 0) 100%),
      #f4f6fb;
    --gradient-wizard-platforms:
      radial-gradient(60% 50% at 50% 20%, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0) 100%),
      radial-gradient(40% 40% at 85% 70%, rgba(8, 145, 178, 0.08), rgba(8, 145, 178, 0) 100%),
      radial-gradient(40% 40% at 15% 70%, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0) 100%),
      #f4f6fb;
    --gradient-wizard-slack:
      radial-gradient(50% 50% at 30% 20%, rgba(224, 30, 90, 0.08), rgba(224, 30, 90, 0) 100%),
      #f4f6fb;
    --gradient-wizard-summary:
      radial-gradient(60% 50% at 30% 30%, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0) 100%),
      #f4f6fb;

    --bg-page: var(--gradient-console);

    /* design.pen's Light frame keeps the dark frame's geometry and 0.078 and

       swaps only the hue to the light brand mint. */
    --card-wash: rgba(16, 185, 129, 0.078);
    --switch-onboarding-track-off: #d7dce5;
    --switch-onboarding-border-off: #00000000;
    --switch-onboarding-track-on: #10b981;
    --switch-onboarding-border-on: #00000000;
    --switch-onboarding-thumb-off: #ffffff;
    --switch-onboarding-thumb-on: #ffffff;

    /* Wider CTA glow than dark: the same neon spreads far less over a white card,
       so 16px read as almost nothing here (owner decision 2026-08-14). */
    --brand-glow-blur: 20px;

    /* Light's own onboarding halo: tighter, inset, and fainter over white. */
    --onboarding-glow-blur: 16px;
    --onboarding-glow-spread: -4px;
    --onboarding-glow-alpha: 14.1%;
  }
}

[data-theme="light"] {
  color-scheme: light;

  --background: #f4f6fb;
  --foreground: #0a0a14;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #eef1f7;
  --card: #ffffff;
  --card-foreground: #0a0a14;
  --popover: #ffffff;
  --popover-foreground: #0a0a14;

  /* Vivid fill + white label, ink equal to the fill - see the
     prefers-color-scheme block above. Both light blocks must stay
     value-identical. */
  --primary: #10b981;
  --primary-foreground: #ffffff;
  --primary-ink: #10b981;
  /* Every brand fill darkens on hover here, because this theme's labels are white —
     see the dark block for why hover is a declared fill rather than a filter. */
  --primary-hover: #0ea372;
  --secondary: #eef1f7;
  --secondary-foreground: #0a0a14;
  --muted: #5c6079;
  --muted-soft: #eef1f7;
  --accent: #0891b2;
  --accent-foreground: #ffffff;
  --accent-ink: #0891b2;
  --accent-hover: #07809d;
  --destructive: #e11d48;
  --destructive-foreground: #ffffff;
  --destructive-ink: #e11d48;
  --destructive-hover: #c61a3f;

  --border: rgba(8, 8, 18, 0.08);
  --border-strong: rgba(8, 8, 18, 0.14);
  --input: rgba(8, 8, 18, 0.12);
  /* Mirrors the @media light block above; see the note there. */
  --ring: rgba(16, 185, 129, 0.5);

  /* Bot avatar wells; mirrors the @media light block above. */
  --bot-mascot-well: #ffffff;
  --bot-mascot-ring: rgba(8, 8, 18, 0.1);
  --bot-mascot-shadow: drop-shadow(0 1px 1.5px rgba(8, 8, 18, 0.28));
  --bot-emoji-well-saturation: 85%;
  --bot-emoji-well-lightness: 92%;
  --bot-initial-saturation: 70%;
  --bot-initial-lightness: 45%;

  /* Mirrors the @media light block above; see the note in the dark block. */
  --sidebar-background: #fcfcfe;
  --nav-selected-bg: #10b98114;
  --nav-selected-border: #10b98160;
  --nav-hover-bg: #f5f5f6;
  --logo-well-background: #eef1f780;
  --illustration-card-border: #08081212;
  --desktop-overlay-shadow: #0a0a1424;

  --mint: #10b981;
  --route-manual: #245bcd;
  --mint-soft: rgba(16, 185, 129, 0.14);
  --mint-ink: #10b981;
  --mint-hover: #0ea372;
  --cyan: #0891b2;
  --cyan-soft: rgba(8, 145, 178, 0.14);
  --cyan-ink: #0891b2;
  --cyan-hover: #07809d;
  --violet: #7c3aed;
  --violet-soft: rgba(124, 58, 237, 0.14);
  --violet-foreground: #ffffff;
  --violet-ink: #7c3aed;
  --violet-hover: #6d33d1;
  --gold: #d97706;
  --gold-soft: rgba(217, 119, 6, 0.14);
  --gold-foreground: #ffffff;
  --gold-ink: #d97706;
  --gold-hover: #bf6905;
  --pink: #dc2659;
  --pink-soft: rgba(220, 38, 89, 0.10);
  --pink-ink: #dc2659;

  /* Light-theme page gradients (softer alphas over light base). */
  --gradient-console:
    radial-gradient(50% 40% at 5% 5%, rgba(16, 185, 129, 0.10), rgba(16, 185, 129, 0) 100%),
    radial-gradient(40% 50% at 95% 40%, rgba(8, 145, 178, 0.08), rgba(8, 145, 178, 0) 100%),
    radial-gradient(60% 50% at 50% 100%, rgba(124, 58, 237, 0.06), rgba(124, 58, 237, 0) 100%),
    #f4f6fb;
  --gradient-settings:
    radial-gradient(50% 40% at 5% 5%, rgba(16, 185, 129, 0.10), rgba(16, 185, 129, 0) 100%),
    radial-gradient(50% 50% at 95% 50%, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0) 100%),
    #f4f6fb;
  --gradient-wizard-welcome:
    radial-gradient(70% 60% at 50% 30%, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0) 100%),
    radial-gradient(50% 50% at 85% 70%, rgba(8, 145, 178, 0.08), rgba(8, 145, 178, 0) 100%),
    #f4f6fb;
  --gradient-wizard-backends:
    radial-gradient(60% 50% at 50% 20%, rgba(124, 58, 237, 0.10), rgba(124, 58, 237, 0) 100%),
    #f4f6fb;
  --gradient-wizard-platforms:
    radial-gradient(60% 50% at 50% 20%, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0) 100%),
    radial-gradient(40% 40% at 85% 70%, rgba(8, 145, 178, 0.08), rgba(8, 145, 178, 0) 100%),
    radial-gradient(40% 40% at 15% 70%, rgba(124, 58, 237, 0.08), rgba(124, 58, 237, 0) 100%),
    #f4f6fb;
  --gradient-wizard-slack:
    radial-gradient(50% 50% at 30% 20%, rgba(224, 30, 90, 0.08), rgba(224, 30, 90, 0) 100%),
    #f4f6fb;
  --gradient-wizard-summary:
    radial-gradient(60% 50% at 30% 30%, rgba(16, 185, 129, 0.12), rgba(16, 185, 129, 0) 100%),
    #f4f6fb;

  --bg-page: var(--gradient-console);

  /* design.pen's Light frame keeps the dark frame's geometry and 0.078 and
     swaps only the hue to the light brand mint. */
  --card-wash: rgba(16, 185, 129, 0.078);

  /* Wider CTA glow than dark: the same neon spreads far less over a white card,
     so 16px read as almost nothing here (owner decision 2026-08-14). */
  --brand-glow-blur: 20px;

  /* Light's own onboarding halo - see the prefers-color-scheme block above.
     Both light blocks must stay value-identical. */
  --onboarding-glow-blur: 16px;
  --onboarding-glow-spread: -4px;
  --onboarding-glow-alpha: 14.1%;
  --switch-onboarding-track-off: #d7dce5;
  --switch-onboarding-border-off: #00000000;
  --switch-onboarding-track-on: #10b981;
  --switch-onboarding-border-on: #00000000;
  --switch-onboarding-thumb-off: #ffffff;
  --switch-onboarding-thumb-on: #ffffff;
}

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

html,
body {
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0;
  margin: 0;
}

/* Page-family glow utilities. Apply on the scrolling main container. */
.page-glow-console {
  background: var(--gradient-console);
  background-attachment: fixed;
}
.page-glow-settings {
  background: var(--gradient-settings);
  background-attachment: fixed;
}
.page-glow-wizard-welcome {
  background: var(--gradient-wizard-welcome);
  background-attachment: fixed;
}
.page-glow-wizard-backends {
  background: var(--gradient-wizard-backends);
  background-attachment: fixed;
}
.page-glow-wizard-platforms {
  background: var(--gradient-wizard-platforms);
  background-attachment: fixed;
}
.page-glow-wizard-slack {
  background: var(--gradient-wizard-slack);
  background-attachment: fixed;
}
.page-glow-wizard-summary {
  background: var(--gradient-wizard-summary);
  background-attachment: fixed;
}

body {
  min-height: 100vh;
}

/* iOS Safari keyboard fix: on mobile, lock the document so it can't scroll.
   Otherwise focusing an input makes Safari scroll the (slightly-taller-than-
   viewport) page to "reveal" it and overshoots, flinging the input off the top
   of the screen. The AppShell instead is a static h-dvh flex column whose
   <main> scrolls internally. Desktop keeps normal document scrolling. */
@media (max-width: 767px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
  }
  #root {
    height: 100%;
  }
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
}

@layer base {
  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  button:not(:disabled),
  [role="button"]:not(:disabled) {
    cursor: pointer;
  }

  button:disabled {
    cursor: not-allowed;
  }
}

code,
pre,
.font-mono {
  font-family: var(--font-mono);
}

@keyframes slide-in {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.animate-slide-in {
  animation: slide-in 0.2s ease-out;
}

/* App windows (Apps layer): a subtle scale+fade on open, and a scale-down
   toward the Dock on close. Short enough to read as responsiveness, not a
   transition you wait on. A window that mounts already minimized must NOT
   take animate-appwindow-in — this keyframe writes opacity/transform and
   would flash the window at full size before the minimized hide sticks. */
@keyframes appwindow-in {
  from { opacity: 0; transform: scale(0.97) translateY(6px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes appwindow-out {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to { opacity: 0; transform: scale(0.94) translateY(12px); }
}
.animate-appwindow-in { animation: appwindow-in 140ms ease-out; }
.animate-appwindow-out { animation: appwindow-out 130ms ease-in forwards; }

/* Chat compose "thinking" indicator — three dots fading in sequence while we
   wait for the agent's first streamed chunk (workbench ChatPage). */
@keyframes vr-typing {
  0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}
.vr-typing-dot {
  animation: vr-typing 1.2s infinite ease-in-out;
}

/* Deep-link search-match highlight (workbench ChatPage P5, design.pen tBlve):
   the message jumped to from the search palette gets a brief mint-soft wash
   that fades to transparent over ~3s. Uses the same --mint-soft token as the
   agent bubble so it reads as "this is the match" without a hard flash. The
   negative inset + matching radius let the band breathe slightly around the
   row's bubble while leaving the row's own width untouched. ``forwards`` so it
   settles fully transparent if the class lingers a frame past the JS timeout. */
@keyframes msg-highlight {
  from { background-color: var(--mint-soft); }
  to { background-color: transparent; }
}
.msg-highlight {
  margin: -2px -8px;
  padding: 2px 8px;
  border-radius: var(--radius-2xl);
  animation: msg-highlight 3s ease-out forwards;
}

/* Markdown rendering for agent replies (react-markdown output). No Tailwind
   typography plugin is installed, so the raw element tree is styled against
   theme tokens. Scoped to .vr-markdown so it never leaks elsewhere. */
.vr-markdown {
  font-size: 13px;
  line-height: 1.6;
  color: var(--foreground);
  word-break: break-word;
}
.vr-markdown--inherit-size { font-size: inherit; }
.vr-markdown > :first-child { margin-top: 0; }
.vr-markdown > :last-child { margin-bottom: 0; }
.vr-markdown p { margin: 0 0 0.6em; }
.vr-markdown h1,
.vr-markdown h2,
.vr-markdown h3,
.vr-markdown h4,
.vr-markdown h5,
.vr-markdown h6 { margin: 1em 0 0.5em; font-weight: 700; line-height: 1.3; }
.vr-markdown h1 { font-size: 1.4em; }
.vr-markdown h2 { font-size: 1.25em; }
.vr-markdown h3 { font-size: 1.1em; }
.vr-markdown ul,
.vr-markdown ol { margin: 0 0 0.6em; padding-left: 1.4em; }
/* Tailwind v4 preflight resets ``list-style: none`` on every ul/ol; restore the
   marker type here (the rule above only added the indent back, not the bullets). */
.vr-markdown ul { list-style-type: disc; }
.vr-markdown ol { list-style-type: decimal; }
.vr-markdown li { margin: 0.15em 0; }
.vr-markdown li > ul,
.vr-markdown li > ol { margin: 0.15em 0; }
/* GFM task lists: remark-gfm tags the parent ``ul.contains-task-list`` but only
   the checkbox rows get ``li.task-list-item``. Drop the disc on the task ROWS
   only (not the whole ul) — the checkbox is their marker — so a list that MIXES
   task items with ordinary bullets keeps the disc on its plain ``<li>`` siblings. */
.vr-markdown li.task-list-item { list-style: none; }
.vr-markdown li.task-list-item input { margin-right: 0.4em; }
.vr-markdown a {
  color: var(--cyan-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
}
/* A citation badge is an <a> too (see citation-badge.tsx), so the rule above
   would repaint it cyan and underline it — the one thing a compact numbered chip
   must not look like. Unlayered rules outrank Tailwind's utilities layer, so the
   badge's text color has to be restated here; every other class it carries
   (border, background, shape, focus ring) is unaffected and stays in the
   component. */
.vr-markdown a.vr-citation {
  color: var(--muted);
  text-decoration: none;
}
.vr-markdown a.vr-citation:hover,
.vr-markdown a.vr-citation:focus-visible {
  color: var(--foreground);
}
.vr-markdown code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}
.vr-markdown pre {
  margin: 0 0 0.6em;
  padding: 12px 14px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow-x: auto;
}
.vr-markdown pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  line-height: 1.5;
}
/* Copy button for fenced code blocks. The wrapper is the positioning context so
   the button stays pinned top-right while the <pre> scrolls horizontally. */
.vr-markdown .vr-code-block { position: relative; }
.vr-code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s ease, color 0.12s ease, background 0.12s ease;
}
.vr-code-block:hover .vr-code-copy,
.vr-code-copy:focus-visible { opacity: 1; }
.vr-code-copy:hover { color: var(--foreground); background: var(--surface-3); }
.vr-code-copy.is-copied { opacity: 1; color: var(--mint-ink); border-color: rgba(91, 255, 160, 0.4); }
/* Touch devices have no hover — keep the button gently visible so it's tappable. */
@media (hover: none) {
  .vr-code-copy { opacity: 0.6; }
}
.vr-markdown blockquote {
  margin: 0 0 0.6em;
  padding: 0.2em 0 0.2em 0.9em;
  border-left: 3px solid var(--border-strong);
  color: var(--muted);
}
.vr-markdown hr { border: none; border-top: 1px solid var(--border); margin: 1em 0; }
/* Tables are wrapped in a .vr-table-scroll div (see markdown.tsx) that is the
   horizontal scroll viewport. The table sizes to its own content width — columns
   sized to content, each capped (below) — and is NOT limited to the bubble width,
   so when it's wider than the bubble it scrolls inside the wrapper instead of
   squeezing/wrapping columns to fit (which collapsed a header to one char/line). */
.vr-markdown .vr-table-scroll { overflow-x: auto; margin: 0 0 0.6em; }
.vr-markdown table {
  border-collapse: collapse;
  width: max-content;
}
.vr-markdown th,
.vr-markdown td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  /* Per-column ceiling: short cells keep their natural width; a long cell wraps
     within this column instead of stretching into one endless line. Capped to the
     viewport so a single column can't exceed the screen on mobile. */
  max-width: min(22rem, 82vw);
}
.vr-markdown th { background: var(--surface-2); font-weight: 600; }
.vr-markdown img { max-width: 100%; border-radius: 8px; }
.vr-markdown strong { font-weight: 700; }

/* Compact inline-ish markdown for inbox previews: inherit the host row's small
   font-size + color, collapse block spacing, and tame headings / code blocks so
   a clamped 2–3 line snippet stays tidy instead of rendering full-size blocks.
   The block rules are scoped under the doubled ``.vr-markdown.vr-markdown--preview``
   class so they outrank the base ``.vr-markdown <el>`` rules on specificity,
   regardless of source order. */
.vr-markdown--preview { font-size: inherit; line-height: inherit; color: inherit; }
.vr-markdown.vr-markdown--preview :is(p, h1, h2, h3, h4, h5, h6, ul, ol, pre, blockquote, table, hr) { margin: 0; }
.vr-markdown.vr-markdown--preview :is(h1, h2, h3, h4, h5, h6) { font-size: inherit; }
.vr-markdown.vr-markdown--preview :is(ul, ol) { padding-left: 1.1em; }
.vr-markdown.vr-markdown--preview pre { padding: 4px 8px; border-radius: 6px; }
.vr-markdown.vr-markdown--preview blockquote { padding: 0 0 0 0.7em; }

/* File preview viewer (FileViewer modal body). Renderer wrappers own their own
   padding so code / CSV can go edge-to-edge with their own scroll. */
.vr-fileview-body { color: var(--foreground); }
.vr-fileview-msg { padding: 36px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.vr-fileview-md { padding: 16px; }
.vr-fileview-pre {
  margin: 0;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--foreground);
}
.vr-fileview-code pre {
  margin: 0;
  padding: 16px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.55;
}
.vr-fileview-json { padding: 14px 16px; font-size: 12.5px; background: transparent; }
.vr-fileview-csv { overflow-x: auto; }
.vr-fileview-table { border-collapse: collapse; font-size: 12.5px; width: max-content; min-width: 100%; }
.vr-fileview-table th,
.vr-fileview-table td {
  border: 1px solid var(--border);
  padding: 5px 10px;
  text-align: left;
  white-space: nowrap;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vr-fileview-table th { background: var(--surface-2); font-weight: 600; }
.vr-fileview-table tbody tr:nth-child(even) { background: var(--surface-3); }
.vr-fileview-note { padding: 8px 14px; font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--border); }

/* Text previews share the Editor's persisted font-size preference. The custom
   property is owned by FilePreview so every shell (Editor preview, Files,
   chat) updates live without coupling its surrounding chrome to that setting. */
.vr-fileview-text { font-size: var(--vr-fileview-font-size, 13px); }
.vr-fileview-text :is(.vr-fileview-md, .vr-fileview-pre, .vr-fileview-code pre, .vr-fileview-json, .vr-fileview-table) {
  font-size: inherit;
}
.vr-fileview-text .vr-fileview-md pre code { font-size: 0.92em; }

/* PDF text layer (components/ui/pdf-pages.tsx). pdf.js lays one transparent span per run of text
   over the page canvas, sized from --total-scale-factor (CSS px per PDF point, set on the page box)
   and the --font-height / --scale-x / --rotate it writes on each span, so the text can be selected
   and copied where it is drawn. The layer is laid out in unrotated page space; a page's /Rotate
   arrives as data-main-rotation and turns the layer onto the drawing. Adapted from pdf.js's viewer stylesheet (Apache-2.0); the end block
   is what keeps a selection from jumping across the page (lib/pdfTextSelection.ts). */
.vr-pdf-text {
  --min-font-size: 1;
  --text-scale-factor: calc(var(--total-scale-factor) * var(--min-font-size));
  --min-font-size-inv: calc(1 / var(--min-font-size));
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: clip;
  line-height: 1;
  text-align: initial;
  letter-spacing: normal;
  word-spacing: normal;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  forced-color-adjust: none;
  transform-origin: 0 0;
}
.vr-pdf-text[data-main-rotation="90"] { transform: rotate(90deg) translateY(-100%); }
.vr-pdf-text[data-main-rotation="180"] { transform: rotate(180deg) translate(-100%, -100%); }
.vr-pdf-text[data-main-rotation="270"] { transform: rotate(270deg) translateX(-100%); }
.vr-pdf-text :is(span, br) {
  position: absolute;
  color: transparent;
  white-space: pre;
  cursor: text;
  transform-origin: 0% 0%;
  -webkit-user-select: text;
  user-select: text;
}
.vr-pdf-text > span {
  --font-height: 0;
  --scale-x: 1;
  --rotate: 0deg;
  z-index: 1;
  font-size: calc(var(--text-scale-factor) * var(--font-height));
  transform: rotate(var(--rotate)) scaleX(var(--scale-x)) scale(var(--min-font-size-inv));
}
.vr-pdf-text ::selection {
  background: color-mix(in srgb, var(--mint) 35%, transparent);
  color: transparent;
}
.vr-pdf-text br::selection { background: transparent; }
.vr-pdf-text-end {
  position: absolute;
  inset: 100% 0 0;
  z-index: 0;
  display: block;
  cursor: default;
  -webkit-user-select: none;
  user-select: none;
}
.vr-pdf-text.selecting .vr-pdf-text-end { top: 0; }

/* PDF links (components/ui/pdf-pages.tsx): transparent anchors over each link's area, above the
   text layer. Only the anchors take pointer events, so text outside a link stays selectable; a tint
   on hover / press / keyboard focus shows what a tap will follow. */
.vr-pdf-links {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.vr-pdf-links > a {
  position: absolute;
  border-radius: 2px;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}
.vr-pdf-links > a:hover,
.vr-pdf-links > a:active,
.vr-pdf-links > a:focus-visible {
  background: color-mix(in srgb, var(--mint) 22%, transparent);
}
.vr-pdf-links > a:focus-visible { outline: 2px solid var(--mint); outline-offset: 1px; }

/* The project header remains a scroll/tap target until a touch hold activates. */
.project-drag-header {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-touch-callout: none;
  user-select: none;
}
.project-drag-header[aria-describedby] .project-drag-icon { cursor: grab; }
.project-drag-header[aria-pressed="true"],
.project-drag-header[aria-pressed="true"] .project-drag-icon { cursor: grabbing; }
.project-drag-preview { animation: project-pickup 140ms ease-out; }
@keyframes project-pickup {
  from { opacity: 0.75; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .project-drag-preview { animation: none; }
  .project-sortable { transition: none !important; }
}

/* Bot avatars: `--bot-hue` is set per avatar; the theme supplies the rest. */
.bot-avatar-emoji {
  background: hsl(var(--bot-hue) var(--bot-emoji-well-saturation) var(--bot-emoji-well-lightness));
}
.bot-avatar-initial {
  background: hsl(var(--bot-hue) var(--bot-initial-saturation) var(--bot-initial-lightness));
  color: #ffffff;
}
.bot-avatar-mascot {
  background: var(--bot-mascot-well);
  box-shadow: inset 0 0 0 1px var(--bot-mascot-ring);
}
.bot-avatar-mascot > img {
  filter: var(--bot-mascot-shadow);
}
/* The strip scrolls sideways once it overflows; its right edge fades out. */
.bot-strip-fade {
  mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}