/* Axonbyok shell: a black device frame with thin bezels around a see-through middle. */

/* Inter 4.1 (SIL OFL 1.1, see fonts/LICENSE.txt): the closest open match to
   Apple's SF Pro, which may not ship inside a Windows app. One variable file per
   style covers weights 100-900 and an optical-size axis: small text gets the
   sturdier Text cut, large text the tighter Display cut. */
@font-face {
  font-family: InterVariable;
  font-style: normal;
  font-weight: 100 900;
  font-display: block;
  src: url("fonts/InterVariable.woff2") format("woff2");
}

@font-face {
  font-family: InterVariable;
  font-style: italic;
  font-weight: 100 900;
  font-display: block;
  src: url("fonts/InterVariable-Italic.woff2") format("woff2");
}

/* The left rail's width slides when the sidebar opens or closes, so it is
   registered as a length (custom properties only animate once registered). */
@property --rail-left {
  syntax: "<length>";
  inherits: true;
  initial-value: 50px;
}

:root {
  --frame: #000;
  /* Frame thickness defaults. The bezel grips (app.js) change these live and
     remember the user's choice. The left side is the rail when the sidebar is
     closed and the sidebar when it is open. */
  --rail-closed: 50px;
  --rail-open: 252px;
  --rail-left: var(--rail-closed);
  --rail-right: 4px;
  --bezel-top: 4px;
  --bezel-bottom: 4px;
  --radius-outer: 30px;
  --button: 36px;
  --icon: #f4f4f5;
  --hover: rgba(255, 255, 255, 0.08);
  --active: #1f1f22;
  --rim: rgba(255, 255, 255, 0.1);
  --text: #f4f4f5;
  --text-2: rgba(244, 244, 245, 0.62);
  /* Nearly solid: over the desktop there is nothing in the page to blur. */
  --sheet: rgba(18, 18, 20, 0.92);
  /* Fully solid, for menus inside the box: a frosted layer can't blur through
     another one, so there they would turn see-through. */
  --sheet-solid: #19191b;
  --line: rgba(255, 255, 255, 0.08);
  --control: rgba(255, 255, 255, 0.07);
  --control-on: rgba(255, 255, 255, 0.16);
  --pill: rgba(12, 12, 14, 0.72);
  --grip: rgba(255, 255, 255, 0.75);
  --focus: rgba(255, 255, 255, 0.6);
  --track: rgba(255, 255, 255, 0.16);
  /* Glass strength, 0 to 1, from the Strength slider (app.js). */
  --glass: 0.5;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font-sans: InterVariable, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
  /* Rail items sit this far in, so icons stay put when the sidebar opens. */
  --rail-inset: calc((var(--rail-closed) - var(--button)) / 2);
  color-scheme: dark;
  transition: --rail-left 320ms var(--ease-out);
}

[data-sidebar="open"] {
  --rail-left: var(--rail-open);
}

/* Dragging a bezel or restoring the saved layout: follow at once. */
.frame-instant,
[data-motion="reduced"] {
  transition: none;
}

[data-theme="light"] {
  --frame: #f2f2f5;
  --icon: #1d1d1f;
  --hover: rgba(0, 0, 0, 0.06);
  --active: #e1e1e6;
  --rim: rgba(255, 255, 255, 0.35);
  --text: #1d1d1f;
  --text-2: rgba(29, 29, 31, 0.68);
  --sheet: rgba(250, 250, 252, 0.92);
  --sheet-solid: #fafafc;
  --line: rgba(0, 0, 0, 0.08);
  --control: rgba(0, 0, 0, 0.05);
  --control-on: #fff;
  --pill: rgba(250, 250, 252, 0.82);
  --grip: rgba(0, 0, 0, 0.45);
  --focus: rgba(0, 0, 0, 0.5);
  --track: rgba(0, 0, 0, 0.12);
  color-scheme: light;
}

/* Accent colour. app.js sets --accent, and --on-accent for labels on it, when a
   colour is chosen. Default keeps the black-and-white controls and green switches. */
:root {
  --accent: var(--text);
  --on-accent: var(--on-primary);
  --switch-on: #34c759;
}

:root:not([data-accent="default"]) {
  --switch-on: var(--accent);
  --focus: color-mix(in srgb, var(--accent) 85%, transparent);
  --active: color-mix(in oklab, var(--accent) 30%, #1f1f22);
}

[data-theme="light"]:not([data-accent="default"]) {
  --active: color-mix(in oklab, var(--accent) 22%, #e1e1e6);
}

/* Ambient light on: the frame turns smoky so the wallpaper's glow behind it shows. */
[data-ambient="on"] {
  --frame: rgba(0, 0, 0, 0.6);
}

[data-theme="light"][data-ambient="on"] {
  --frame: rgba(242, 242, 245, 0.62);
}

/* Colour the frame: a deep shade of the accent colour (a pale one in Light).
   Over ambient light the shade stays smoky so the glow still shows. */
[data-frame-tint="on"] {
  --frame: color-mix(in oklab, var(--accent) 30%, #000);
}

[data-theme="light"][data-frame-tint="on"] {
  --frame: color-mix(in oklab, var(--accent) 24%, #f2f2f5);
}

[data-frame-tint="on"][data-ambient="on"] {
  --frame: color-mix(in oklab, var(--accent) 20%, rgba(0, 0, 0, 0.6));
}

[data-theme="light"][data-frame-tint="on"][data-ambient="on"] {
  --frame: color-mix(in oklab, var(--accent) 16%, rgba(242, 242, 245, 0.62));
}

[data-font="system"] {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
}

[data-text-size="small"] {
  font-size: 87.5%;
}

[data-text-size="large"] {
  font-size: 112.5%;
}

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

html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: transparent;
}

body {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.6;
  letter-spacing: -0.009em;
  font-optical-sizing: auto;
  font-kerning: normal;
  /* Inter's own advice: Chrome needs these switched on explicitly. */
  font-feature-settings: "liga" 1, "calt" 1;
  color: var(--text);
  caret-color: var(--accent);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

:root:not([data-accent="default"]) ::selection {
  background: color-mix(in srgb, var(--accent) 40%, transparent);
}

svg {
  display: block;
}

/* Type scale, after Apple's text styles. Each step sets size, leading, tracking
   and weight together: leading loosens and tracking opens up as text gets
   smaller, and big text tightens. Sizes are in rem so a text-size setting can
   scale every style at once. */
.text-large-title {
  font-size: 2.25rem;
  line-height: 1.1;
  letter-spacing: -0.022em;
  font-weight: 700;
}

.text-title-1 {
  font-size: 1.75rem;
  line-height: 1.15;
  letter-spacing: -0.021em;
  font-weight: 700;
}

.text-title-2 {
  font-size: 1.375rem;
  line-height: 1.25;
  letter-spacing: -0.018em;
  font-weight: 650;
}

.text-title-3 {
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: -0.014em;
  font-weight: 600;
}

.text-headline {
  font-size: 0.9375rem;
  line-height: 1.45;
  letter-spacing: -0.009em;
  font-weight: 600;
}

.text-body {
  font-size: 0.9375rem;
  line-height: 1.6;
  letter-spacing: -0.009em;
  font-weight: 400;
}

.text-callout {
  font-size: 0.875rem;
  line-height: 1.5;
  letter-spacing: -0.006em;
  font-weight: 400;
}

.text-subheadline {
  font-size: 0.8125rem;
  line-height: 1.45;
  letter-spacing: -0.003em;
  font-weight: 400;
}

.text-footnote {
  font-size: 0.75rem;
  line-height: 1.4;
  letter-spacing: 0;
  font-weight: 400;
}

.text-caption {
  font-size: 0.6875rem;
  line-height: 1.35;
  letter-spacing: 0.005em;
  font-weight: 500;
}

/* Figures that line up in columns: prices, token counts, usage tables. */
.num {
  font-variant-numeric: tabular-nums;
}

/* API keys, model ids and code. */
.text-mono {
  font-family: var(--font-mono);
  font-size: 0.875em;
  letter-spacing: 0;
}

.shell {
  position: fixed;
  inset: 0;
  display: grid;
  grid-template-columns: var(--rail-left) minmax(0, 1fr) var(--rail-right);
  padding: var(--bezel-top) 0 var(--bezel-bottom);
  border-radius: var(--radius-outer);
  /* clip, not hidden: the frame must never become scrollable (focus or the
     ambient layer's overflow could otherwise shift everything up). */
  overflow: clip;
  /* Corners ease between round and square (maximized). */
  transition: border-radius 240ms var(--ease-out);
  -webkit-app-region: drag;
}

/* Ambient light: a tiny, blurred copy of the wallpaper behind the whole frame.
   It only shows where the frame is (the stage covers the rest). */
.ambient {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  opacity: 0;
  filter: blur(26px) saturate(1.5);
  transform: scale(1.08);
  transition: opacity 500ms ease;
  pointer-events: none;
}

[data-ambient="on"] .ambient {
  opacity: 1;
}

/* The stage is the hole. Its spread shadow paints the frame around it, and the
   shell's rounded clip trims that frame to the outer corners. The inner corners
   follow the bezels so they stay concentric with the outer ones. */
.stage {
  --radius-top: max(6px, calc(var(--radius-outer) - var(--bezel-top)));
  --radius-bottom: max(6px, calc(var(--radius-outer) - var(--bezel-bottom)));
  position: relative;
  border-radius: var(--radius-top) var(--radius-top) var(--radius-bottom) var(--radius-bottom);
  box-shadow: 0 0 0 100vmax var(--frame);
  transition: border-radius 240ms var(--ease-out);
  -webkit-app-region: no-drag;
}

.stage::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px var(--rim);
  pointer-events: none;
  /* Last over the whole stage, it would otherwise pass on the stage's no-drag
     and cancel every drag area inside (the top band, the panels' margins).
     `initial`, because Chromium doesn't accept `none` here. */
  -webkit-app-region: initial;
}

/* Wallpaper and glass, back to front inside the stage. */
.wallpaper,
.glass {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.wallpaper {
  overflow: clip;
}

.wallpaper > img,
.wallpaper > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.glass {
  display: none;
}

[data-bg="clear"] .glass,
[data-bg="glassy"] .glass,
[data-bg="blur"] .glass {
  display: block;
}

/* Every style scales with --glass (the Strength slider): 0 is clear glass,
   0.5 the default look, 1 twice as strong. */

/* Clear: crystal glass. What is behind stays sharp; a rim of light and a soft
   sheen show the surface. Strength: how much light it catches. */
[data-bg="clear"] .glass {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, calc(var(--glass) * 0.24)) 0%, rgba(255, 255, 255, calc(var(--glass) * 0.06)) 28%, rgba(255, 255, 255, 0) 50%),
    radial-gradient(120% 60% at 50% -15%, rgba(255, 255, 255, calc(var(--glass) * 0.16)), rgba(255, 255, 255, 0) 60%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, calc(var(--glass) * 0.8)),
    inset 0 0 0 1px rgba(255, 255, 255, calc(var(--glass) * 0.28)),
    inset 0 -60px 90px -70px rgba(0, 0, 0, calc(var(--glass) * 0.7));
}

/* Glassy: frosted and bright, with a shine across the top. Strength: how
   frosted (the white fill grows faster near the top of the range). */
[data-bg="glassy"] .glass {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, calc(var(--glass) * 0.36)) 0%, rgba(255, 255, 255, calc(var(--glass) * 0.12)) 32%, rgba(255, 255, 255, calc(var(--glass) * 0.04)) 60%),
    rgba(255, 255, 255, calc(var(--glass) * var(--glass) * 0.2));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, var(--glass)),
    inset 0 0 0 1px rgba(255, 255, 255, calc(var(--glass) * 0.36));
}

/* Blur: deep and quiet. Strength: how dark (or light) the tint. Kept thin
   so the desktop always shows through (100% is still see-through). */
[data-bg="blur"] .glass {
  background: rgba(10, 10, 14, calc(var(--glass) * 0.34));
}

[data-theme="light"][data-bg="blur"] .glass {
  background: rgba(250, 250, 252, calc(var(--glass) * 0.36));
}

/* How far each style blurs at full Strength. The blur follows Strength squared:
   eyes notice small blurs most, so it starts gently (20% is about a twentieth
   of the full blur) and grows faster near the top. */
[data-bg="glassy"] {
  --blur-max: 24px;
  --saturate-max: 120%;
}

[data-bg="blur"] {
  --blur-max: 44px;
  --saturate-max: 80%;
}

:root {
  --blur: calc(var(--glass) * var(--glass) * var(--blur-max, 0px));
}

/* Over a wallpaper (or the browser preview's stand-in sky) the page blurs what
   is behind it directly. */
[data-wallpaper][data-bg="glassy"] .glass,
[data-wallpaper][data-bg="blur"] .glass,
.web-preview[data-bg="glassy"] .glass,
.web-preview[data-bg="blur"] .glass {
  backdrop-filter: blur(var(--blur)) saturate(calc(100% + var(--glass) * var(--saturate-max)));
}

/* Over the desktop: a snapshot of what is behind the window (app.js), blurred
   by the same amount. Two layers cross-fade when a fresh snapshot comes in. */
.backdrop {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: clip;
  pointer-events: none;
  opacity: 0;
  transition: opacity 240ms ease;
}

.desktop-glass .backdrop {
  opacity: 1;
}

.backdrop img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  opacity: 0;
  filter: blur(var(--blur)) saturate(calc(100% + var(--glass) * var(--saturate-max)));
  transition: opacity 500ms ease;
  will-change: transform;
}

.backdrop img.is-shown {
  opacity: 1;
}

.rail {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 0;
  padding: 9px 0 6px;
}

/* Labels and the far-end toggle are clipped while the sidebar slides. */
.rail-main {
  overflow: hidden;
}

.rail-head {
  display: flex;
  flex: none;
  align-items: center;
  align-self: stretch;
  padding-inline: var(--rail-inset);
}

/* The logo on its own shows only while the sidebar is open; closed, the
   toggle wears it. */
.rail-brand {
  display: none;
  flex: none;
  align-items: center;
  gap: 10px;
  height: var(--button);
  padding-left: calc((var(--button) - 22px) / 2);
  color: var(--icon);
}

/* AXON beside the mark, while the sidebar is open. */
.rail-wordmark {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1;
  white-space: nowrap;
}

.rail-brand svg,
.toggle-logo {
  width: 22px;
  height: 22px;
}

.rail-toggle {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--button);
  height: var(--button);
  margin-left: auto;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--icon);
  cursor: pointer;
  transition: background-color 160ms ease;
  -webkit-app-region: no-drag;
}

.rail-toggle > svg {
  grid-area: 1 / 1;
  transition: opacity 160ms ease;
}

.toggle-panel {
  width: 20px;
  height: 20px;
  opacity: 0;
}

/* Closed: pointing at the logo turns it into the sidebar toggle. */
@media (hover: hover) {
  .rail-toggle:hover {
    background: var(--hover);
  }

  .rail-toggle:hover .toggle-logo {
    opacity: 0;
  }

  .rail-toggle:hover .toggle-panel {
    opacity: 1;
  }
}

.rail-toggle:focus-visible .toggle-logo {
  opacity: 0;
}

.rail-toggle:focus-visible .toggle-panel {
  opacity: 1;
}

[data-sidebar="open"] .rail-brand,
[data-sidebar="closing"] .rail-brand {
  display: flex;
}

[data-sidebar="open"] .toggle-logo,
[data-sidebar="closing"] .toggle-logo {
  opacity: 0;
}

[data-sidebar="open"] .toggle-panel,
[data-sidebar="closing"] .toggle-panel {
  opacity: 1;
}

/* The sidebar icon's divider leans the way the sidebar will go. */
.icon-panel .i-divider {
  transition: transform 320ms var(--ease-out);
}

@media (hover: hover) {
  .rail-toggle:hover .i-divider {
    transform: translateX(1.5px);
  }

  [data-sidebar="open"] .rail-toggle:hover .i-divider {
    transform: translateX(-1.5px);
  }
}

.rail-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  transition: gap 320ms var(--ease-out);
}

.rail-top {
  margin-top: 16px;
}

.rail-bottom {
  margin-top: auto;
  gap: 12px;
}

.rail-button {
  display: grid;
  flex: none;
  place-items: center;
  width: var(--button);
  height: var(--button);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--icon);
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
  -webkit-app-region: no-drag;
}

.rail-button svg {
  flex: none;
  width: 20px;
  height: 20px;
}

@media (hover: hover) {
  .rail-button:hover {
    background: var(--hover);
  }
}

.rail-button.is-active {
  background: var(--active);
}

.rail-button:active {
  transform: scale(0.94);
}

.rail-button:focus-visible,
.rail-toggle:focus-visible,
.recent:focus-visible,
.window-button:focus-visible,
.sheet button:focus-visible,
.page-home button:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

/* Sidebar open: each icon gains its label and the list of recent tasks shows.
   Icons keep their places; rows grow to the right as the sidebar slides open,
   and labels stay until it has closed again ("closing"). */
.rail-label,
.rail-recents {
  display: none;
}

[data-sidebar="open"] .rail-main .rail-group {
  gap: 2px;
}

[data-sidebar="open"] .rail-main .rail-group,
[data-sidebar="closing"] .rail-main .rail-group {
  align-self: stretch;
  align-items: stretch;
}

[data-sidebar="open"] .rail-main .rail-button,
[data-sidebar="closing"] .rail-main .rail-button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: auto;
  margin-inline: var(--rail-inset);
  padding: 0 8px;
  border-radius: 10px;
}

/* The avatar is wider than an icon: same centre, labels in line. */
[data-sidebar="open"] .rail-main .rail-account,
[data-sidebar="closing"] .rail-main .rail-account {
  gap: 9px;
  padding-left: 5px;
}

[data-sidebar="open"] .rail-main .rail-button:active {
  transform: scale(0.98);
}

[data-sidebar="open"] .rail-label,
[data-sidebar="closing"] .rail-label {
  display: block;
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: -0.006em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

[data-sidebar="open"] .rail-recents,
[data-sidebar="closing"] .rail-recents {
  display: flex;
  flex: 1 1 0;
  flex-direction: column;
  align-self: stretch;
  min-height: 0;
  margin-top: 22px;
}

.rail-section {
  margin: 0 0 4px;
  padding-inline: calc(var(--rail-inset) + 8px);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.4;
  color: color-mix(in srgb, var(--icon) 55%, transparent);
  white-space: nowrap;
}

.recents-list {
  display: grid;
  align-content: start;
  min-height: 0;
  overflow: auto;
  padding-inline: var(--rail-inset);
  scrollbar-width: thin;
  scrollbar-color: var(--hover) transparent;
  -webkit-app-region: no-drag;
}

.recent {
  height: 34px;
  padding: 0 8px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--icon);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease;
}

@media (hover: hover) {
  .recent:hover {
    background: var(--hover);
  }
}

.recents-empty {
  margin: 0;
  padding: 4px 8px;
  font-size: 0.75rem;
  line-height: 1.45;
  color: color-mix(in srgb, var(--icon) 55%, transparent);
  white-space: nowrap;
}

:root {
  /* The avatar's colours, also behind a picture being placed (account.js). */
  --avatar-fill:
    radial-gradient(90% 90% at 14% 20%, #f0447f 0%, transparent 62%),
    radial-gradient(80% 80% at 88% 16%, #ffac3e 0%, transparent 60%),
    radial-gradient(90% 90% at 22% 94%, #1fb489 0%, transparent 62%),
    radial-gradient(95% 95% at 94% 90%, #3b6cf0 0%, transparent 64%),
    #8b5cf6;
}

.avatar {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--avatar-fill);
}

/* Your picture (account.js), or else the first letter of your name. */
.avatar-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-initial {
  position: relative;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 650;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

/* Icon hover motion. Each icon acts out what it does: the plus turns, the lens
   looks around, the chat types, the library fans its cards, the gear turns.
   Critically damped ease-out, no bounce: hovering carries no momentum. */
.icon {
  overflow: visible;
}

.icon * {
  transform-box: fill-box;
  transform-origin: center;
}

/* The gauge's needle swings about its hub. */
.icon-usage .i-needle {
  transform-box: view-box;
  transform-origin: 12px 17.25px;
}

/* The key turns about its ring. */
.icon-key .i-key {
  transform-box: view-box;
  transform-origin: 8.25px 15.75px;
}

/* The book's pages open from its spine. */
.icon-skills .i-page-left,
.icon-skills .i-page-right {
  transform-box: view-box;
  transform-origin: 12px 19px;
}

.icon-new-chat .i-plus,
.icon-new-chat .i-bubble,
.icon-search,
.icon-connected .i-tile-1,
.icon-connected .i-tile-2,
.icon-connected .i-tile-3,
.icon-connected .i-plus,
.icon-mcp .i-plug,
.icon-skills .i-page-left,
.icon-skills .i-page-right,
.icon-library .i-sheet-1,
.icon-library .i-sheet-2,
.icon-library .i-card,
.icon-key .i-key,
.icon-usage .i-needle,
.icon-settings,
.avatar {
  transition: transform 320ms var(--ease-out), filter 320ms var(--ease-out);
}

.icon-settings {
  transition-duration: 600ms;
}

.icon-chats .i-dot-2 {
  animation-delay: 70ms;
}

.icon-chats .i-dot-3 {
  animation-delay: 140ms;
}

/* The puzzle piece clicks into place. */
@keyframes piece-snap {
  0%,
  100% {
    transform: rotate(0);
  }

  35% {
    transform: rotate(-14deg) scale(1.06);
  }

  70% {
    transform: rotate(6deg) scale(1.02);
  }
}

@keyframes dot-hop {
  0%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-1.8px);
  }
}

@media (hover: hover) {
  .rail-button:hover .icon-new-chat .i-plus {
    transform: rotate(90deg);
  }

  .rail-button:hover .icon-new-chat .i-bubble {
    transform: scale(1.05);
  }

  .rail-button:hover .icon-search {
    transform: rotate(-12deg) scale(1.06);
  }

  .rail-button:hover .icon-chats .i-dot {
    animation: dot-hop 560ms var(--ease-out);
  }

  .rail-button:hover .icon-library .i-sheet-1 {
    transform: translateY(-1px);
  }

  .rail-button:hover .icon-library .i-sheet-2 {
    transform: translateY(-2px);
  }

  .rail-button:hover .icon-library .i-card {
    transform: translateY(0.5px) scale(1.03);
  }

  .rail-button:hover .icon-key .i-key {
    transform: rotate(-24deg);
  }

  .rail-button:hover .icon-usage .i-needle {
    transform: rotate(-78deg);
  }

  .rail-button:hover .icon-settings {
    transform: rotate(90deg);
  }

  /* Connected tools: the tiles spread a little and the plus turns. */
  .rail-button:hover .icon-connected .i-tile-1 {
    transform: translate(-0.7px, -0.7px);
  }

  .rail-button:hover .icon-connected .i-tile-2 {
    transform: translate(0.7px, -0.7px);
  }

  .rail-button:hover .icon-connected .i-tile-3 {
    transform: translate(-0.7px, 0.7px);
  }

  .rail-button:hover .icon-connected .i-plus {
    transform: translate(0.7px, 0.7px) rotate(90deg);
  }

  .rail-button:hover .icon-plugins {
    animation: piece-snap 520ms var(--ease-out);
  }

  /* MCP: the plug pushes up, as if going into its socket. */
  .rail-button:hover .icon-mcp .i-plug {
    transform: translateY(-1.6px);
  }

  .rail-button:hover .icon-skills .i-page-left {
    transform: rotate(-7deg);
  }

  .rail-button:hover .icon-skills .i-page-right {
    transform: rotate(7deg);
  }

  .rail-button:hover .avatar {
    transform: scale(1.08);
    filter: saturate(1.25);
  }
}

/* Pages open inside the stage, on their own sheet so text stays readable over
   any desktop or wallpaper. */
.page {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
}

.page[hidden] {
  display: none;
}

.sheet {
  width: min(600px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 20px 24px 24px;
  border-radius: 22px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(0, 0, 0, 0.35);
  color: var(--text);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  /* Settings opens from the gear at the bottom left, so it grows from there. */
  transform-origin: left bottom;
  animation: sheet-in 280ms var(--ease-out) both;
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translate(-8px, 10px) scale(0.97);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-head h2 {
  margin: 0;
}

.sheet-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--control);
  color: var(--text);
  cursor: pointer;
  transition: background-color 140ms ease;
}

.sheet-close svg {
  width: 14px;
  height: 14px;
}

.sheet-close:hover {
  background: var(--control-on);
}

.sheet-section {
  margin: 22px 0 2px;
  font-size: 0.9375rem;
  line-height: 1.45;
  letter-spacing: -0.009em;
  font-weight: 600;
}

.setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  min-height: 52px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}

.sheet-section + .setting {
  border-top: 0;
}

.setting[hidden] {
  display: none;
}

/* Wide controls sit under their label, so a longer hint never moves them. */
.setting-wide {
  flex-direction: column;
  align-items: flex-start;
}

.setting-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.setting-label {
  font-size: 0.875rem;
  line-height: 1.4;
  font-weight: 500;
}

.setting-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-2);
}

/* Segmented control: the highlight slides to the chosen option. */
.segmented {
  position: relative;
  isolation: isolate;
  display: inline-flex;
  flex: none;
  padding: 2px;
  border-radius: 10px;
  background: var(--control);
}

/* The highlight spans the whole track and is clipped to the chosen option, so
   sliding and resizing animate a clip, never the layout. */
.segmented::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 2px 0;
  background: var(--control-on);
  clip-path: inset(0 calc(100% - var(--thumb-x, 0px) - var(--thumb-w, 0px)) 0 var(--thumb-x, 0px) round var(--thumb-radius, 8px));
  transition: clip-path 280ms var(--ease-out);
}

.segmented.is-placing::before {
  transition: none;
}

.segmented button {
  min-width: 60px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 160ms ease;
}

.segmented button:hover,
.segmented button[aria-checked="true"],
.segmented button[aria-selected="true"] {
  color: var(--text);
}

.switch {
  position: relative;
  flex: none;
  width: 42px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 13px;
  background: var(--control-on);
  cursor: pointer;
  transition: background-color 200ms ease;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 260ms var(--ease-out);
}

.switch[aria-checked="true"] {
  background: var(--switch-on);
}

.switch[aria-checked="true"]::after {
  transform: translateX(16px);
}

/* Slider: the fill follows the thumb; the thumb swells a little while held. */
.slider-control {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
}

.slider {
  --fill: 50%;
  width: 200px;
  height: 22px;
  margin: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

.slider::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--accent) var(--fill), var(--track) var(--fill));
}

.slider::-webkit-slider-thumb {
  width: 20px;
  height: 20px;
  margin-top: -8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(0, 0, 0, 0.12);
  appearance: none;
  transition: transform 160ms var(--ease-out);
}

.slider:active::-webkit-slider-thumb {
  transform: scale(1.12);
}

.slider:focus-visible {
  outline: none;
}

.slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--focus), 0 1px 3px rgba(0, 0, 0, 0.35);
}

.slider-value {
  min-width: 4ch;
  font-size: 0.8125rem;
  color: var(--text-2);
  text-align: right;
}

.button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  border-radius: 9px;
  background: var(--control-on);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, opacity 140ms ease;
}

.button:hover {
  background: var(--control-on);
  opacity: 0.85;
}

.button:disabled {
  opacity: 0.5;
  cursor: default;
}

.button-quiet {
  background: transparent;
  color: var(--text-2);
}

.button[hidden],
.wallpaper-thumb[hidden] {
  display: none;
}

.wallpaper-control {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.wallpaper-thumb {
  width: 44px;
  height: 28px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px var(--line);
}

/* Spending cap: the presets, and your own amount beside them. */
.spend-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.amount {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9px;
  background: var(--control);
  color: var(--text-2);
  font-size: 0.8125rem;
  cursor: text;
}

.amount[hidden] {
  display: none;
}

.amount:focus-within {
  box-shadow: 0 0 0 1.5px var(--focus);
}

.amount:has([aria-invalid="true"]) {
  box-shadow: 0 0 0 1.5px var(--bad);
}

.amount input {
  width: 7ch;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
  user-select: text;
}

/* Accent swatches. The chosen one wears a ring in its own colour. */
.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0;
}

.swatch {
  --edge: rgba(0, 0, 0, 0.14);
  position: relative;
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--edge);
  cursor: pointer;
  transition: transform 200ms var(--ease-out), box-shadow 200ms var(--ease-out);
}

/* The gap in the ring is the sheet's own colour. */
.swatch[aria-checked="true"] {
  box-shadow: inset 0 0 0 1px var(--edge), 0 0 0 2px var(--sheet), 0 0 0 4px currentColor;
}

@media (hover: hover) {
  .swatch:hover {
    transform: scale(1.1);
  }
}

.swatch:active {
  transform: scale(0.94);
}

.sheet .swatch:focus-visible {
  outline-offset: 6px;
}

/* Default: the black-and-white look. */
.swatch[data-value="default"] {
  --edge: rgba(128, 128, 128, 0.45);
  background: linear-gradient(135deg, #f4f4f5 50%, #1d1d1f 50%);
}

/* Your own colour: a colour wheel, with the colour made last in its middle. */
.swatch-custom {
  background: conic-gradient(#ff3b30, #ff9500, #ffcc00, #34c759, #00c7be, #007aff, #5856d6, #af52de, #ff2d55, #ff3b30);
}

.swatch-custom::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--custom, transparent);
  box-shadow: 0 0 0 1.5px var(--sheet);
  opacity: 0;
  transition: opacity 160ms ease;
}

.swatch-custom.has-colour::after {
  opacity: 1;
}

/* Making a colour: saturation runs left to right and brightness bottom to top
   in the square, for the hue chosen on the slider under it. */
.colour-picker {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  padding-top: 4px;
  animation: picker-in 240ms var(--ease-out) both;
}

.colour-picker[hidden] {
  display: none;
}

@keyframes picker-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.colour-area {
  position: relative;
  height: 148px;
  border-radius: 12px;
  background:
    linear-gradient(to top, #000, rgba(0, 0, 0, 0)),
    linear-gradient(to right, #fff, hsl(var(--hue, 241) 100% 50%));
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: crosshair;
  touch-action: none;
}

.colour-area:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 3px;
}

/* The knob shows the colour it is on and swells a little while held. */
.colour-knob {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2.5px #fff, 0 1px 5px 1px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  transition: transform 160ms var(--ease-out);
}

.colour-area.is-dragging .colour-knob {
  transform: scale(1.2);
}

.colour-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* The dropper takes a colour from anywhere on the screen. It tips like a
   pipette on hover and fills with the accent while the magnifier is up. */
.dropper {
  display: grid;
  flex: none;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--control);
  color: var(--text);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.dropper[hidden] {
  display: none;
}

.dropper svg {
  width: 18px;
  height: 18px;
  transition: transform 320ms var(--ease-out);
}

@media (hover: hover) {
  .dropper:hover {
    background: var(--control-on);
  }

  .dropper:hover svg {
    transform: rotate(-14deg);
  }
}

.dropper:active svg {
  transform: rotate(-14deg) scale(0.92);
}

.dropper[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.hue-slider {
  flex: 1;
  min-width: 0;
  height: 22px;
  margin: 0;
  background: transparent;
  appearance: none;
  cursor: pointer;
}

.hue-slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(to right, #f00, #ff0 16.67%, #0f0 33.33%, #0ff 50%, #00f 66.67%, #f0f 83.33%, #f00);
}

.hue-slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-top: -4px;
  border-radius: 50%;
  background: hsl(var(--hue, 241) 100% 50%);
  box-shadow: 0 0 0 2.5px #fff, 0 1px 5px 1px rgba(0, 0, 0, 0.4);
  appearance: none;
  transition: transform 160ms var(--ease-out);
}

.hue-slider:active::-webkit-slider-thumb {
  transform: scale(1.12);
}

.hue-slider:focus-visible {
  outline: none;
}

.hue-slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 2.5px #fff, 0 0 0 5px var(--focus), 0 1px 5px 1px rgba(0, 0, 0, 0.4);
}

.colour-hex {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 10px 0 8px;
  border-radius: 9px;
  background: var(--control);
  cursor: text;
}

.colour-hex:focus-within {
  box-shadow: 0 0 0 1.5px var(--focus);
}

.colour-chip {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}

.colour-hex input {
  width: 7.5ch;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  user-select: text;
}

/* A frameless window has no title bar, so the window buttons wait in a pill at
   the glass's top-right corner and fade in when the pointer gets there. */
.window-controls {
  position: absolute;
  top: calc(var(--bezel-top) + 8px);
  right: calc(var(--rail-right) + 8px);
  z-index: 4;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--pill);
  backdrop-filter: blur(16px) saturate(140%);
  opacity: 0;
  transition: opacity 180ms ease;
  -webkit-app-region: no-drag;
}

.window-controls:hover,
.window-controls:focus-within {
  opacity: 1;
}

.window-button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--icon);
  cursor: pointer;
  transition: background-color 140ms ease;
}

.window-button svg {
  width: 14px;
  height: 14px;
}

.window-button:hover {
  background: var(--hover);
}

.window-button[data-window="close"]:hover {
  background: #c42b1c;
  color: #fff;
}

.icon-restore,
.is-maximized .icon-maximize {
  display: none;
}

.is-maximized .icon-restore {
  display: block;
}

.is-maximized .shell {
  border-radius: 0;
}

/* Bezel grips: thin strips just inside the glass along the left and right
   inner edges. Drag one to make that side of the frame thicker or thinner;
   double-click resets it. */
.bezel-grip {
  position: absolute;
  z-index: 3;
  -webkit-app-region: no-drag;
}

.bezel-grip[data-side="left"],
.bezel-grip[data-side="right"] {
  top: calc(var(--bezel-top) + 24px);
  bottom: calc(var(--bezel-bottom) + 24px);
  width: 6px;
  cursor: col-resize;
}

.bezel-grip[data-side="left"] { left: var(--rail-left); }
.bezel-grip[data-side="right"] { right: var(--rail-right); }

/* A hairline on the bezel side of the grip: shows after a short hover (so it
   doesn't flicker as the pointer crosses the edge) and at once on press. */
.bezel-grip::after {
  content: "";
  position: absolute;
  background: var(--grip);
  opacity: 0;
  transition: opacity 140ms ease;
}

.bezel-grip[data-side="left"]::after { inset: 0 auto 0 0; width: 2px; }
.bezel-grip[data-side="right"]::after { inset: 0 0 0 auto; width: 2px; }

@media (hover: hover) {
  .bezel-grip:hover::after {
    opacity: 0.6;
    transition-delay: 150ms;
  }
}

.bezel-grip.is-dragging::after {
  opacity: 1;
  transition-delay: 0s;
}

/* Invisible grab strips along the outer edge (the window has no native ones). */
.resize-handle {
  position: fixed;
  z-index: 10;
  -webkit-app-region: no-drag;
}

.resize-handle[data-edge="n"],
.resize-handle[data-edge="s"] {
  left: 16px;
  right: 16px;
  height: 5px;
  cursor: ns-resize;
}

.resize-handle[data-edge="e"],
.resize-handle[data-edge="w"] {
  top: 16px;
  bottom: 16px;
  width: 5px;
  cursor: ew-resize;
}

.resize-handle[data-edge="n"] { top: 0; }
.resize-handle[data-edge="s"] { bottom: 0; }
.resize-handle[data-edge="e"] { right: 0; }
.resize-handle[data-edge="w"] { left: 0; }

.resize-handle[data-edge="ne"],
.resize-handle[data-edge="nw"],
.resize-handle[data-edge="se"],
.resize-handle[data-edge="sw"] {
  width: 16px;
  height: 16px;
}

.resize-handle[data-edge="nw"] { top: 0; left: 0; cursor: nwse-resize; }
.resize-handle[data-edge="se"] { bottom: 0; right: 0; cursor: nwse-resize; }
.resize-handle[data-edge="ne"] { top: 0; right: 0; cursor: nesw-resize; }
.resize-handle[data-edge="sw"] { bottom: 0; left: 0; cursor: nesw-resize; }

.is-maximized .resize-handle,
.web-preview .resize-handle {
  display: none;
}

/* ---- Workspace: New chat, Search, Tasks, Library (workspace.js) ---------- */

:root {
  --on-primary: #111113;
  --ok: #30d158;
  --warn: #ffb340;
  --bad: #ff6961;
  --info: #64d2ff;
  --mark: rgba(255, 214, 10, 0.3);
  --scrim: rgba(0, 0, 0, 0.3);
  /* Text sitting straight on the glass keeps a soft halo, so it reads over any desktop. */
  --glass-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 24px rgba(0, 0, 0, 0.4);
}

[data-theme="light"] {
  --on-primary: #fff;
  --ok: #1f7a35;
  --warn: #a14a00;
  --bad: #c4001a;
  --info: #006a96;
  --mark: rgba(255, 204, 0, 0.35);
  --scrim: rgba(0, 0, 0, 0.18);
  --glass-text-shadow: 0 1px 2px rgba(255, 255, 255, 0.75), 0 0 24px rgba(255, 255, 255, 0.6);
}

.on-glass {
  color: var(--text);
  text-shadow: var(--glass-text-shadow);
}

.button-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.button-primary:hover {
  background: var(--accent);
}

.button-primary:disabled {
  opacity: 0.35;
}

.button-danger {
  background: var(--bad);
  color: #fff;
}

/* New chat: the Chat / Work switch at the top, then a heading, the composer
   and suggestions, a little above the middle of the glass. */
.page-home {
  container-type: size;
  align-content: center;
  place-items: center;
  padding: 72px 24px 12vh;
  overflow: auto;
}

/* The pixel wave paints behind the page's content. */
.mode-fx {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Heading letters that are still decoding. */
.decode {
  color: var(--accent);
  font-family: var(--font-mono);
  font-weight: 500;
  opacity: 0.85;
}

/* Work: a tray tucked under the box with the project, files, plugins and the
   latest draft (workspace.js). The box sits above it, so the tray seems to
   slide out from underneath; the tray in turn sits above everything below it,
   so its menus open over the chips and suggestions. */
.home {
  position: relative;
}

.composer {
  z-index: 2;
}

.work-tray {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 2px;
  margin: -24px 18px 0;
  padding: 30px 8px 6px;
  border-radius: 0 0 18px 18px;
  background: color-mix(in oklab, var(--sheet), var(--text) 5%);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 12px 30px rgba(0, 0, 0, 0.16);
}

[data-mode="chat"] .work-tray:not(.is-leaving) {
  display: none;
}

/* Leaving Work it is lifted out of the flow, so the column can move at once. */
.work-tray.is-leaving {
  position: absolute;
  top: var(--leave-top);
  right: 18px;
  left: 18px;
  margin: 0;
  pointer-events: none;
}

.tray-item {
  position: relative;
  min-width: 0;
}

.tray-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.tray-button:hover,
.tray-button[aria-expanded="true"] {
  background: var(--hover);
}

.tray-button:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.tray-button svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.tray-button.is-set svg:first-child {
  color: var(--effort);
}

.tray-button .tray-chevron {
  width: 13px;
  height: 13px;
  transition: transform 220ms var(--ease-out);
}

.tray-button[aria-expanded="true"] .tray-chevron {
  transform: rotate(180deg);
}

.tray-label {
  overflow: hidden;
  max-width: 200px;
  text-overflow: ellipsis;
}

.tray-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--control-on);
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.tray-count[hidden],
.tray-continue[hidden] {
  display: none;
}

.tray-continue {
  min-width: 0;
  margin-left: auto;
}

.tray-meta {
  overflow: hidden;
  max-width: 220px;
  color: var(--text-2);
  font-weight: 400;
  text-overflow: ellipsis;
}

/* The tray's menus drop below the button that opened them. */
.work-tray .work-menu {
  right: auto;
  width: max-content;
  min-width: 240px;
  max-width: 340px;
}

.menu-title {
  margin: 4px 10px 6px;
  font-size: 0.75rem;
  color: var(--text-2);
}

/* Plugins: each one a row with a small switch. */
.plugin-option {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.plugin-option:hover,
.plugin-option:focus-visible {
  outline: none;
  background: var(--control-on);
}

.plugin-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--control);
  color: var(--text-2);
}

.plugin-icon svg {
  width: 16px;
  height: 16px;
}

.plugin-text {
  display: grid;
  min-width: 0;
}

.plugin-name {
  font-size: 0.8125rem;
  font-weight: 500;
}

.plugin-note {
  font-size: 0.75rem;
  color: var(--text-2);
}

.mini-switch {
  position: relative;
  width: 32px;
  height: 19px;
  border-radius: 10px;
  background: var(--control-on);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color 200ms ease;
}

.mini-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  transition: transform 240ms var(--ease-out);
}

.plugin-option[aria-checked="true"] .mini-switch {
  background: var(--switch-on);
  box-shadow: none;
}

.plugin-option[aria-checked="true"] .mini-switch::after {
  transform: translateX(13px);
}

/* Approvals: a chip in the box, and how Axonbyok's actions are approved. */
.approve-wrap {
  position: relative;
}

.approve-chip {
  color: var(--text-2);
}

.approve-chip:hover,
.approve-chip[aria-expanded="true"] {
  color: var(--text);
}

.approve-chip-icon {
  display: grid;
  place-items: center;
}

.approve-chip-icon svg {
  width: 15px;
  height: 15px;
}

.approve-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 4;
  display: grid;
  gap: 2px;
  width: 372px;
  padding: 6px;
  border-radius: 14px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.3);
  transform-origin: top left;
  animation: menu-in 180ms var(--ease-out) both;
}

.approve-menu[hidden] {
  display: none;
}

.approve-title {
  margin: 4px 8px 4px;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.approve-option {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.approve-option:hover,
.approve-option:focus-visible {
  outline: none;
  background: var(--control-on);
}

.approve-option-icon svg {
  width: 19px;
  height: 19px;
  color: var(--text-2);
}

.approve-option-text {
  display: grid;
  min-width: 0;
}

.approve-option-name {
  font-size: 0.875rem;
  font-weight: 500;
}

.approve-option-note {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-2);
}

.approve-check {
  width: 16px;
  height: 16px;
  opacity: 0;
}

.approve-option[aria-checked="true"] .approve-check {
  opacity: 1;
}

/* Top right, left of the window buttons: Temporary and New chat. */
.home-tools {
  position: absolute;
  top: 16px;
  right: 112px;
  display: flex;
  gap: 6px;
  -webkit-app-region: no-drag;
}

/* The empty band along New chat's top moves the window, like a title bar.
   Drag areas are inherited (everything in the stage is no-drag), and of the
   boxes over a spot the last one in the page wins, whatever their stacking,
   even boxes scrolled out of sight. So the band comes after the chat (whose
   earlier messages, scrolled up, are still laid out under it), and what sits
   in it (Chat/Work, the top-right tools, the chat's title) comes after the
   band, so it stays clickable. */
.home-drag {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 60px;
  -webkit-app-region: drag;
}

.home-tool {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sheet);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}

.home-tool:hover {
  background: color-mix(in oklab, var(--sheet), var(--text) 8%);
}

.home-tool:active {
  transform: scale(0.92);
}

/* A downloaded update (updates.js): a green Update button, first in the row;
   one click restarts into the new version. */
.update-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px 0 11px;
  border: 0;
  border-radius: 999px;
  background: #1a7f37;
  box-shadow: 0 2px 8px rgba(26, 127, 55, 0.3);
  color: #fff;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
  animation: update-pill-in 260ms var(--ease-out);
}

.update-pill[hidden] {
  display: none;
}

.update-pill:hover:not(:disabled) {
  background: #166c2f;
}

.update-pill:active:not(:disabled) {
  transform: scale(0.95);
}

.update-pill:disabled {
  cursor: default;
  opacity: 0.8;
}

.update-pill svg {
  width: 16px;
  height: 16px;
}

@keyframes update-pill-in {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
}

:root[data-motion="reduced"] .update-pill {
  animation: none;
}

.home-tool svg {
  width: 18px;
  height: 18px;
}

.temporary-bubble {
  stroke-dasharray: 3.1 2.5;
}

.home-tool[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: none;
}

/* Temporary: a note under the heading and a dashed line round the box. */
.home-note {
  margin: -16px 0 22px;
  font-size: 0.875rem;
  line-height: 1.45;
  text-align: center;
}

.home-note[hidden] {
  display: none;
}

.page-home.is-temporary .composer {
  outline: 1.5px dashed color-mix(in srgb, var(--text) 45%, transparent);
  outline-offset: 4px;
}

/* The folder menu drops from the row that opened it. */
.work-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 3;
  display: grid;
  padding: 4px;
  border-radius: 12px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.3);
  transform-origin: top center;
  animation: menu-in 180ms var(--ease-out) both;
}

.work-menu[hidden] {
  display: none;
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
  }
}

.work-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.work-option:hover,
.work-option:focus-visible {
  outline: none;
  background: var(--control-on);
}

.work-option-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-option-meta {
  color: var(--text-2);
  font-size: 0.75rem;
}

.work-option svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.work-option-add {
  margin-top: 4px;
  color: var(--text-2);
  box-shadow: 0 -1px 0 var(--line);
  border-radius: 0 0 8px 8px;
}


/* Chat / Work and the MAX CODE pill, side by side in the middle of the top band. */
.mode-bar {
  position: absolute;
  top: 14px;
  right: 0;
  left: 0;
  display: flex;
  gap: 10px;
  width: fit-content;
  margin-inline: auto;
  -webkit-app-region: no-drag;
}

.mode-switch {
  --thumb-radius: 999px;
  padding: 3px;
  border-radius: 999px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(0, 0, 0, 0.18);
}

.mode-switch::before {
  inset: 3px 0;
  transition: clip-path 280ms var(--ease-out), opacity 160ms ease;
}

/* Only one of the two shows a highlight: the one whose mode is on. */
.segmented.is-unchosen::before {
  opacity: 0;
}

.mode-switch button {
  min-width: 78px;
  height: 30px;
  border-radius: 999px;
  font-size: 0.875rem;
}

/* MAX CODE's icon stands in for its name in a narrow window (below). */
.mode-switch .mode-icon {
  display: none;
  width: 16px;
  height: 16px;
}

/* A narrow window: tighter options and MAX CODE as its icon, so the two
   stay clear of the tools at the top right. */
@container (max-width: 720px) {
  .mode-bar {
    gap: 8px;
  }

  .mode-switch button {
    min-width: 60px;
  }

  .mode-switch [data-value="code"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 0;
    padding: 0;
  }

  .mode-switch .mode-icon {
    display: block;
  }

  .mode-switch .mode-label {
    display: none;
  }

  /* After .chat-head's own rule in the file, so this needs the extra class. */
  .page-home .chat-head {
    max-width: var(--title-room, calc(50% - 124px));
  }
}

.home {
  width: min(760px, 100%);
}

.home-title {
  margin: 0 0 26px;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.021em;
  font-weight: 600;
  text-align: center;
}

.composer {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: "lead goal tools";
  align-items: center;
  gap: 10px 6px;
  padding: 7px;
  border-radius: 28px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgba(0, 0, 0, 0.28);
  transition: box-shadow 160ms ease;
}

/* Switching Chat and Work: a beam of the accent colour runs once around the
   box's edge while it changes shape. */
@property --beam {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

.composer::after {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1.5px;
  border-radius: inherit;
  background: conic-gradient(from var(--beam), transparent 0 62%, color-mix(in srgb, var(--accent) 40%, transparent) 78%, var(--accent) 92%, transparent 100%);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
}

.composer.is-beaming::after {
  animation: beam 1150ms cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes beam {
  0% {
    --beam: 0deg;
    opacity: 0;
  }

  12%,
  78% {
    opacity: 1;
  }

  100% {
    --beam: 360deg;
    opacity: 0;
  }
}

/* Longer text, Work or Details: the text on top, the controls underneath. */
.composer.is-tall {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "goal goal"
    "details details"
    "lead tools";
  padding: 12px 8px 8px;
  border-radius: 24px;
}

.composer:focus-within {
  box-shadow: 0 0 0 1.5px var(--focus), 0 18px 50px rgba(0, 0, 0, 0.28);
}

.composer-goal {
  grid-area: goal;
  display: block;
  width: 100%;
  max-height: 40vh;
  overflow-y: hidden;
  padding: 5px 4px;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  line-height: 1.55;
  user-select: text;
}

.composer.is-tall .composer-goal {
  padding: 2px 8px;
}

.composer-goal::placeholder,
.field input::placeholder,
.search-field input::placeholder {
  color: var(--text-2);
}

.composer-details {
  grid-area: details;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 8px;
}

.composer-details[hidden] {
  display: none;
}

.field {
  display: grid;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--text-2);
}

.field input {
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  outline: none;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  user-select: text;
}

.field input:focus {
  box-shadow: 0 0 0 1.5px var(--focus);
}

.composer-lead,
.composer-tools {
  display: flex;
  align-items: center;
  gap: 6px;
}

.composer-lead {
  grid-area: lead;
  flex-wrap: wrap;
  min-width: 0;
}

.composer-tools {
  grid-area: tools;
}

.composer-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: background-color 140ms ease;
}

.composer-icon svg {
  width: 20px;
  height: 20px;
}

.composer-icon:hover {
  background: var(--control);
}

/* Under the box: which AI answers, how hard it thinks, and how many tokens it
   will read. Small frosted chips, so they read over any desktop. */
/* Above the box, so cards opening upwards from the row stay on top. */
.composer-meta {
  position: relative;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 0 4px;
}

/* The token count grows to the right, into free space, so nothing else moves. */
.meta-start {
  display: flex;
  align-items: center;
  gap: 8px;
}

.meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 15px;
  background: var(--sheet);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.meta-chip:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

/* Effort: how hard the AI thinks, Low to ULTRA TASKER (effort.js). A button
   under the box shows the level and opens a card with a big slider: purple
   with drifting stars, a white knob that follows the pointer and settles on a
   step. ULTRA TASKER turns the rail into a flowing galaxy, lights the card's
   edge and the name, and (in effort.js) throws sparks from the knob. */
:root {
  --effort: #a78bfa;
  /* The shimmer across ULTRA TASKER: up to white on Dark, deeper on Light so
     no letter washes out. */
  --ultra-a: color-mix(in oklab, var(--effort) 45%, #ff4fd2);
  --ultra-b: #fff;
}

[data-theme="light"] {
  --effort: #8b5cf6;
  --ultra-b: color-mix(in oklab, var(--effort) 60%, #1e0040);
}

:root:not([data-accent="default"]) {
  --effort: var(--accent);
}

.effort-wrap {
  position: relative;
}

.effort-wrap[hidden] {
  display: none;
}

.effort-chip {
  gap: 6px;
  padding: 0 9px 0 10px;
  color: var(--text);
  cursor: pointer;
  transition: box-shadow 240ms ease, transform 160ms var(--ease-out);
}

.effort-chip:active {
  transform: scale(0.97);
}

.effort-chip-bolt {
  width: 12px;
  height: 12px;
  color: var(--effort);
}

.effort-chip-chevron {
  width: 13px;
  height: 13px;
  color: var(--text-2);
  transition: transform 260ms var(--ease-out);
}

.effort-chip[aria-expanded="true"] .effort-chip-chevron {
  transform: rotate(180deg);
}

/* ULTRA TASKER stays lit on the button. */
.effort-chip.is-ultra {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--effort) 60%, transparent), 0 0 18px color-mix(in srgb, var(--effort) 38%, transparent);
}

.effort-chip.is-ultra .effort-chip-label,
.effort-pop.is-ultra .effort-title {
  background: linear-gradient(90deg, var(--effort), var(--ultra-a) 30%, var(--ultra-b) 50%, var(--ultra-a) 70%, var(--effort)) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ultra-shimmer 2.6s linear infinite;
}

.effort-chip.is-ultra .effort-chip-label {
  font-weight: 700;
  letter-spacing: 0.05em;
}

.effort-chip.is-ultra .effort-chip-bolt,
.effort-pop.is-ultra .effort-bolt svg {
  filter: drop-shadow(0 0 5px var(--effort));
  animation: bolt-flicker 2.8s linear infinite;
}

/* Reaching ULTRA TASKER from Settings: the button flares once. */
.effort-chip.is-flaring {
  animation: chip-flare 760ms var(--ease-out);
}

@keyframes chip-flare {
  30% {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px var(--effort), 0 0 30px var(--effort);
  }
}

@keyframes ultra-shimmer {
  to {
    background-position: -200% 0;
  }
}

/* Lightning: two quick flickers now and then. */
@keyframes bolt-flicker {
  0%,
  70%,
  100% {
    opacity: 1;
  }

  72% {
    opacity: 0.35;
  }

  74% {
    opacity: 1;
  }

  77% {
    opacity: 0.5;
  }

  80% {
    opacity: 1;
  }
}

/* The card grows out of the button, below it or, short of room, above it. */
.effort-pop {
  --from: -6px;
  position: absolute;
  top: calc(100% + 10px);
  right: -4px;
  z-index: 5;
  width: 312px;
  padding: 12px 14px 16px;
  border-radius: 20px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.28);
  color: var(--text);
  transform-origin: top right;
  animation: effort-pop-in 280ms var(--ease-out) both;
  transition: box-shadow 400ms ease;
}

.effort-pop[hidden] {
  display: none;
}

.effort-pop.is-above {
  --from: 6px;
  top: auto;
  bottom: calc(100% + 10px);
  transform-origin: bottom right;
}

@keyframes effort-pop-in {
  from {
    opacity: 0;
    transform: translateY(var(--from)) scale(0.95);
  }
}

.effort-pop.is-ultra {
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.28), 0 0 46px color-mix(in srgb, var(--effort) 32%, transparent);
}

/* ULTRA TASKER: a beam of light runs round the card's edge. */
.effort-pop::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1.5px;
  border-radius: 21px;
  background: conic-gradient(from var(--beam), transparent 0 52%, color-mix(in srgb, var(--effort) 50%, transparent) 68%, var(--effort) 80%, #f5d0fe 86%, #fff 88%, transparent 96%);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms ease;
}

.effort-pop.is-ultra::before {
  opacity: 1;
  animation: ultra-beam 2.4s linear infinite;
}

@keyframes ultra-beam {
  to {
    --beam: 360deg;
  }
}

/* The moment it is reached, the whole card flashes once. */
.effort-pop::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 2px var(--effort), 0 0 56px var(--effort), inset 0 0 40px color-mix(in srgb, var(--effort) 30%, transparent);
  opacity: 0;
  pointer-events: none;
}

.effort-pop.is-flaring::after {
  animation: pop-flare 900ms var(--ease-out);
}

@keyframes pop-flare {
  18% {
    opacity: 1;
  }
}

.effort-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 32px;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
}

.effort-bolt,
.effort-reset {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.effort-bolt svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  color: var(--effort);
  transition: fill 240ms ease;
}

/* Low leaves the bolt hollow; every step above fills it. */
.effort-pop[data-level="0"] .effort-bolt svg {
  fill: transparent;
}

.effort-reset {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, opacity 140ms ease;
}

.effort-reset:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}

.effort-reset:disabled {
  opacity: 0.3;
  cursor: default;
}

.effort-reset:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.effort-reset svg {
  width: 17px;
  height: 17px;
  transition: transform 420ms var(--ease-out);
}

.effort-reset:active:not(:disabled) svg {
  transform: rotate(-200deg);
  transition-duration: 160ms;
}

.effort-heading {
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: 0;
  text-align: center;
}

.effort-title {
  font-size: 1.0625rem;
  line-height: 1.3;
  letter-spacing: -0.012em;
  font-weight: 600;
  color: var(--effort);
  white-space: nowrap;
}

.effort-note {
  overflow: hidden;
  max-width: 100%;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.effort-title.is-swapping {
  animation: title-swap 300ms var(--ease-out);
}

@keyframes title-swap {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
}

.effort-pop.is-ultra .effort-title {
  font-weight: 800;
  letter-spacing: 0.08em;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--effort) 50%, transparent));
}

/* ULTRA TASKER slams in from wide, blurred letters. */
.effort-pop.is-ultra .effort-title.is-slamming {
  animation: ultra-slam 640ms cubic-bezier(0.2, 1.3, 0.4, 1) both, ultra-shimmer 2.6s linear infinite;
}

@keyframes ultra-slam {
  from {
    opacity: 0;
    letter-spacing: 0.55em;
    transform: scale(1.3);
    filter: blur(8px);
  }

  55% {
    opacity: 1;
  }
}

/* The slider. --pos is 0 to 1: the step, or the pointer while dragging. */
.effort-slider {
  --knob: 32px;
  --pos: 0.25;
  border-radius: 999px;
  outline: none;
  touch-action: none;
}

.effort-slider:focus-visible {
  box-shadow: 0 0 0 2px var(--focus);
}

.effort-rail {
  position: relative;
  display: block;
  height: 30px;
  border-radius: 999px;
  background: var(--control);
  cursor: pointer;
}

.effort-steps i {
  --at: 0;
  position: absolute;
  top: 50%;
  left: calc(var(--knob) / 2 + (100% - var(--knob)) * var(--at));
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  background: var(--text-2);
  opacity: 0.45;
}

.effort-steps i:nth-child(2) { --at: 0.25; }
.effort-steps i:nth-child(3) { --at: 0.5; }
.effort-steps i:nth-child(4) { --at: 0.75; }
.effort-steps i:nth-child(5) { --at: 1; }

/* The fill reaches the knob's far edge; a little overshoot when it settles. */
.effort-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(var(--knob) + (100% - var(--knob)) * var(--pos));
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--effort) 55%, #fff), var(--effort));
  transition: width 540ms cubic-bezier(0.34, 1.3, 0.64, 1);
}

/* Stars: two layers drifting at different speeds, the near one twinkling. */
.effort-stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.3px 1.3px at 12% 28%, #fff 40%, transparent 100%),
    radial-gradient(1px 1px at 31% 70%, #fff 40%, transparent 100%),
    radial-gradient(1.5px 1.5px at 48% 40%, #fff 40%, transparent 100%),
    radial-gradient(1px 1px at 64% 78%, #fff 40%, transparent 100%),
    radial-gradient(1.2px 1.2px at 79% 22%, #fff 40%, transparent 100%),
    radial-gradient(1px 1px at 92% 58%, #fff 40%, transparent 100%);
  background-size: 64px 100%;
  opacity: 0.75;
  animation: stars-drift 7s linear infinite;
}

.effort-stars-near {
  background-size: 41px 100%;
  background-position: 17px 0;
  opacity: 0.6;
  animation: stars-drift-near 4.6s linear infinite, stars-twinkle 1.7s ease-in-out infinite alternate;
}

@keyframes stars-drift {
  from {
    background-position: 0 0;
  }

  to {
    background-position: 64px 0;
  }
}

@keyframes stars-drift-near {
  from {
    background-position: 17px 0;
  }

  to {
    background-position: 58px 0;
  }
}

@keyframes stars-twinkle {
  to {
    opacity: 0.15;
  }
}

/* The galaxy: a band twice as wide as the fill, sliding by half its width. */
.effort-fill::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 200%;
  background: linear-gradient(90deg,
    color-mix(in oklab, var(--effort) 45%, #14002f) 0%,
    var(--effort) 14%,
    color-mix(in oklab, var(--effort) 55%, #ff4fd2) 26%,
    color-mix(in oklab, var(--effort) 55%, #fff) 36%,
    color-mix(in oklab, var(--effort) 45%, #14002f) 50%,
    var(--effort) 64%,
    color-mix(in oklab, var(--effort) 55%, #ff4fd2) 76%,
    color-mix(in oklab, var(--effort) 55%, #fff) 86%,
    color-mix(in oklab, var(--effort) 45%, #14002f) 100%);
  opacity: 0;
  transition: opacity 500ms ease;
}

/* And a glint that sweeps along it. */
.effort-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 66%) no-repeat;
  background-size: 50% 100%;
  background-position: -100% 0;
  opacity: 0;
}

.effort-slider.is-ultra .effort-fill::before {
  opacity: 1;
  animation: galaxy-flow 3.4s linear infinite;
}

.effort-slider.is-ultra .effort-fill::after {
  opacity: 1;
  animation: glint 2.6s 400ms ease-in-out infinite;
}

@keyframes galaxy-flow {
  to {
    transform: translateX(-50%);
  }
}

@keyframes glint {
  0% {
    background-position: -100% 0;
  }

  55%,
  100% {
    background-position: 200% 0;
  }
}

.effort-slider.is-ultra .effort-stars {
  opacity: 1;
  animation-duration: 2.8s;
}

.effort-slider.is-ultra .effort-stars-near {
  opacity: 0.95;
  animation-duration: 1.9s, 0.9s;
}

/* Reaching it makes the rail thump. */
.effort-slider.is-ultra .effort-rail {
  animation: rail-thump 560ms cubic-bezier(0.3, 1.6, 0.5, 1);
}

@keyframes rail-thump {
  30% {
    transform: scale(1.04, 1.12);
  }
}

.effort-knob {
  position: absolute;
  top: 50%;
  left: calc((100% - var(--knob)) * var(--pos));
  width: var(--knob);
  height: var(--knob);
  margin-top: calc(var(--knob) / -2);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 4px 12px rgba(0, 0, 0, 0.16), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  transition: left 540ms cubic-bezier(0.34, 1.3, 0.64, 1), transform 180ms var(--ease-out), box-shadow 400ms ease;
}

.effort-slider.is-dragging .effort-knob {
  transform: scale(1.1);
  transition: transform 180ms var(--ease-out), box-shadow 400ms ease;
}

.effort-slider.is-dragging .effort-fill {
  transition: none;
}

.effort-slider.is-ultra .effort-knob {
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 0 0 3px color-mix(in srgb, var(--effort) 30%, transparent), 0 0 22px color-mix(in srgb, var(--effort) 75%, transparent);
  animation: knob-glow 1.8s ease-in-out infinite;
}

@keyframes knob-glow {
  50% {
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.16), 0 0 0 5px color-mix(in srgb, var(--effort) 22%, transparent), 0 0 34px var(--effort);
  }
}

/* Sparks fly from the knob on a canvas laid over the stage around it
   (effort.js), so they can leave the card without making the page scroll. */
.effort-burst {
  position: absolute;
  z-index: 7;
  pointer-events: none;
}

.effort-burst[hidden] {
  display: none;
}

/* Tokens: a ring for how full the AI's reading space is, and the number.
   Clicking it opens a card with the details (contextpop.js). */
.context-wrap {
  position: relative;
}

.context {
  gap: 6px;
  cursor: pointer;
  transition: transform 160ms var(--ease-out);
}

.context:active {
  transform: scale(0.97);
}

:root {
  /* The card's parts are shades of the accent, so nothing reads as a warning. */
  --ctx-message: color-mix(in srgb, var(--accent) 55%, var(--track));
  --ctx-files: color-mix(in srgb, var(--accent) 30%, var(--track));
}

.context-pop {
  --from: 6px;
  position: absolute;
  bottom: calc(100% + 10px);
  left: -4px;
  z-index: 5;
  display: grid;
  width: 296px;
  border-radius: 18px;
  /* Solid: it opens over the box, and a frosted layer can't blur through it. */
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.28);
  color: var(--text);
  font-size: 0.8125rem;
  transform-origin: bottom left;
  animation: effort-pop-in 240ms var(--ease-out) both;
  -webkit-app-region: no-drag;
}

.context-pop[hidden] {
  display: none;
}

.context-pop.is-below {
  --from: -6px;
  top: calc(100% + 10px);
  bottom: auto;
  transform-origin: top left;
}

[data-motion="reduced"] .context-pop {
  animation-name: fade-in;
}

.ctx-part {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
}

.ctx-part + .ctx-part {
  border-top: 1px solid var(--line);
}

.ctx-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.ctx-title {
  font-size: 0.875rem;
  font-weight: 650;
}

.ctx-percent {
  color: var(--text-2);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.ctx-percent[data-level="high"] { color: var(--warn); }
.ctx-percent[data-level="full"] { color: var(--bad); }

/* The bar fills part by part, in each part's colour. */
.ctx-bar {
  display: flex;
  gap: 2px;
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--track);
}

.ctx-bar-part {
  flex: none;
  width: calc(var(--share) * 100%);
  background: var(--part);
}

.ctx-bar-part:first-child {
  border-radius: 4px 0 0 4px;
}

.ctx-total {
  margin: 0;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.ctx-total strong {
  color: var(--text);
  font-weight: 650;
}

.ctx-model {
  color: var(--text-2);
}

.ctx-rows {
  display: grid;
  gap: 5px;
}

.ctx-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ctx-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--part);
}

.ctx-dot.is-free {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--track);
}

.ctx-name {
  flex: 1;
  min-width: 0;
  color: var(--text-2);
}

.ctx-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.ctx-note,
.ctx-warn {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-2);
}

.ctx-warn {
  color: var(--warn);
  font-weight: 550;
}

.ctx-key {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 650;
}

.ctx-logo {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
}

.ctx-logo .key-logo,
.ctx-logo svg {
  width: 16px;
  height: 16px;
}

.ctx-link {
  justify-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ctx-link:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ctx-link:focus-visible {
  border-radius: 4px;
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.context-ring {
  width: 16px;
  height: 16px;
  transform: rotate(-90deg);
}

.ring-track,
.ring-fill {
  fill: none;
  stroke-width: 2.6;
}

.ring-track {
  stroke: var(--track);
}

.ring-fill {
  stroke: var(--accent);
  stroke-dasharray: var(--used, 0) 100;
  transition: stroke-dasharray 420ms var(--ease-out), stroke 200ms ease;
}

.context[data-level="high"] .ring-fill {
  stroke: var(--warn);
}

.context[data-level="full"] .ring-fill {
  stroke: var(--bad);
}

.context-count {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

/* "Always show token count" off: the number waits for the pointer. */
[data-tokens="hover"] .context:not(:hover):not(:focus-visible) .context-count {
  display: none;
}

.send {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms var(--ease-out);
}

.send svg {
  width: 18px;
  height: 18px;
}

.send:active {
  transform: scale(0.92);
}

.send:disabled {
  background: var(--control);
  color: var(--text-2);
  cursor: default;
  transform: none;
}

:is([data-mode="work"], [data-mode="code"]) .only-chat {
  display: none;
}

[data-mode="chat"] .only-work {
  display: none;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 10px;
  border: 0;
  border-radius: 15px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.chip:hover,
.chip.is-on,
.chip[aria-expanded="true"] {
  background: var(--control-on);
}

.chip svg {
  flex: none;
  width: 15px;
  height: 15px;
}

.chip[hidden] {
  display: none;
}

.chip-select select {
  padding: 0 14px 0 0;
  border: 0;
  outline: none;
  background: transparent;
  color: inherit;
  font: inherit;
  appearance: none;
  cursor: pointer;
}

/* A small chevron after the template name. */
.chip-select::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  pointer-events: none;
}

.chip-select:focus-within {
  box-shadow: 0 0 0 1.5px var(--focus);
}

/* Suggestions under the composer: things to ask in Chat, templates in Work.
   They sit on the glass, so their text keeps the soft halo. */
.suggestions {
  display: grid;
  gap: 2px;
  margin-top: 14px;
  padding: 0 10px;
}

.suggestion {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: left;
  text-shadow: var(--glass-text-shadow);
  cursor: pointer;
  transition: background-color 140ms ease;
}

.suggestion svg {
  flex: none;
  align-self: center;
  width: 18px;
  height: 18px;
  margin-right: 4px;
  color: var(--text-2);
}

.suggestion-name {
  flex: none;
  font-weight: 500;
}

.suggestion-blurb {
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (hover: hover) {
  .suggestion:hover {
    background: var(--sheet);
    text-shadow: none;
  }
}

/* Over your own wallpaper each suggestion sits on a frosted chip that hugs
   its words, so it reads on any picture, dark or bright. */
[data-wallpaper] .suggestions {
  justify-items: start;
  gap: 6px;
}

[data-wallpaper] .suggestion {
  max-width: 100%;
  background: var(--sheet);
  -webkit-backdrop-filter: blur(20px) saturate(150%);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line);
  text-shadow: none;
}

@media (hover: hover) {
  [data-wallpaper] .suggestion:hover {
    background: color-mix(in oklab, var(--sheet), var(--text) 8%);
  }
}

/* The greeting over a wallpaper: just the words, with nothing behind them
   (no box, no haze, no glow round the letters; the owner's choice, Dec 2026).
   Their ink follows the picture right behind them (app.js greetingInk):
   light over a dark part, dark over a bright one, in either theme. */
[data-wallpaper] .page-home:not(.has-thread) .home-title {
  text-shadow: none;
}

[data-wallpaper][data-chat-bg="wallpaper"][data-greeting-ink="light"] .page-home:not(.has-thread) .home-title {
  color: #f4f4f5;
}

[data-wallpaper][data-chat-bg="wallpaper"][data-greeting-ink="dark"] .page-home:not(.has-thread) .home-title {
  color: #1d1d1f;
}

/* Its star goes with the words, unless you chose an accent that shows up there. */
[data-wallpaper][data-chat-bg="wallpaper"][data-greeting-star="ink"] .page-home:not(.has-thread) .home-title::before {
  background: currentColor;
}

/* After a switch, suggestions arrive one after another, out of a soft blur. */
.suggestion.is-entering {
  animation: suggestion-in 460ms var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 60ms + 220ms);
}

@keyframes suggestion-in {
  from {
    opacity: 0;
    filter: blur(6px);
    transform: translateY(10px);
  }
}

/* The template Work will use. */
.suggestion[aria-pressed="true"] {
  background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--line);
  text-shadow: none;
}

.suggestion[aria-pressed="true"] svg {
  color: var(--accent);
}

/* Panels: Search, Tasks and Library fill the glass on one frosted sheet. The
   empty glass around the sheet moves the window; the sheet itself doesn't. */
.page-panel {
  place-items: stretch;
  padding: 14px;
  -webkit-app-region: drag;
}

.panel {
  -webkit-app-region: no-drag;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 18px 20px 14px;
  border-radius: 20px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(0, 0, 0, 0.3);
  color: var(--text);
  animation: panel-in 240ms var(--ease-out) both;
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.99);
  }
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 12px;
}

.panel-head h2 {
  margin: 0;
}

.panel-sub {
  margin: 2px 0 0;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-split {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  min-height: 0;
  border-top: 1px solid var(--line);
}

.list,
.detail,
.panel-scroll,
.picker-list,
.brief {
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.list {
  padding: 8px 8px 8px 0;
}

.detail {
  padding: 14px 4px 8px 18px;
  border-left: 1px solid var(--line);
  user-select: text;
}

.panel-scroll {
  flex: 1;
  margin-top: 10px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 220px;
  height: 32px;
  border-radius: 9px;
  background: var(--control);
  color: var(--text-2);
}

.search-field svg {
  position: absolute;
  left: 9px;
  width: 15px;
  height: 15px;
  pointer-events: none;
}

.search-field input {
  width: 100%;
  height: 100%;
  padding: 0 10px 0 30px;
  border: 0;
  border-radius: inherit;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  user-select: text;
}

.search-field:focus-within {
  box-shadow: 0 0 0 1.5px var(--focus);
}

.search-field-large {
  height: 42px;
}

.search-field-large svg {
  left: 13px;
  width: 17px;
  height: 17px;
}

.search-field-large input {
  padding-left: 38px;
  font-size: 0.9375rem;
}

.folders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.folders[hidden] {
  display: none;
}

.folder-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 4px 0 10px;
  border-radius: 14px;
  background: var(--control);
  font-size: 0.8125rem;
  font-weight: 500;
}

.folder-chip svg {
  width: 13px;
  height: 13px;
  color: var(--text-2);
}

.folder-chip .count {
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 400;
}

.folder-chip.is-missing .count {
  color: var(--bad);
}

.icon-button {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.icon-button:hover {
  background: var(--control-on);
  color: var(--text);
}

/* Rows: files, tasks and search results. */
.row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 7px 10px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.row:hover {
  background: var(--hover);
}

.row.is-selected {
  background: var(--control-on);
}

:root:not([data-accent="default"]) .row.is-selected {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.row-main {
  display: grid;
  min-width: 0;
}

.row-title {
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row-sub {
  overflow: hidden;
  font-size: 0.75rem;
  color: var(--text-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.row-snippet {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-2);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

mark {
  padding: 0 1px;
  border-radius: 3px;
  background: var(--mark);
  color: var(--text);
}

.group-title {
  margin: 14px 0 4px 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

/* File type badge. A touch of colour tells PDFs, Word files and sheets apart. */
.ext {
  display: grid;
  place-items: center;
  width: 30px;
  height: 36px;
  border-radius: 7px;
  background: var(--control);
  color: var(--text-2);
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ext[data-kind="pdf"] {
  background: rgba(255, 69, 58, 0.16);
  color: #ff8a80;
}

.ext[data-kind="docx"] {
  background: rgba(10, 132, 255, 0.18);
  color: #7cbcff;
}

.ext[data-kind="sheet"] {
  background: rgba(48, 209, 88, 0.16);
  color: #6ee38c;
}

.task-badge svg {
  width: 16px;
  height: 16px;
}

[data-theme="light"] .ext[data-kind="pdf"] { color: #b3261e; }
[data-theme="light"] .ext[data-kind="docx"] { color: #0b5cad; }
[data-theme="light"] .ext[data-kind="sheet"] { color: #1d6b33; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
}

.status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status[data-tone="ok"] { color: var(--ok); }
.status[data-tone="warn"] { color: var(--warn); }
.status[data-tone="bad"] { color: var(--bad); }
.status[data-tone="info"],
.status[data-tone="busy"] { color: var(--info); }

/* Reading: the dot blinks in two steps (cheap; no smooth repaint every frame). */
.status[data-tone="busy"]::before {
  animation: blink 1.2s steps(2, jump-none) infinite;
}

@keyframes blink {
  to {
    opacity: 0.25;
  }
}

.pill {
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--control);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  height: 100%;
  min-height: 160px;
  padding: 24px;
  font-size: 0.875rem;
  color: var(--text-2);
  text-align: center;
}

.empty-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
}

.empty p {
  margin: 0;
  max-width: 340px;
  line-height: 1.5;
}

.detail-head {
  display: grid;
  gap: 6px;
}

.detail-title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.014em;
  overflow-wrap: anywhere;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  font-size: 0.75rem;
  color: var(--text-2);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 14px;
}

.notice {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--control);
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* Tone shows as a soft tint of the whole notice. */
.notice[data-tone="info"] { background: color-mix(in srgb, var(--info) 15%, transparent); }
.notice[data-tone="warn"] { background: color-mix(in srgb, var(--warn) 16%, transparent); }
.notice[data-tone="bad"] { background: color-mix(in srgb, var(--bad) 16%, transparent); }

.file-text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.page-mark {
  display: block;
  margin: 14px 0 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.page-mark:first-child {
  margin-top: 0;
}

/* Pop-up sheets (choose sources, review brief): dim the page behind them. */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--scrim);
  animation: fade-in 180ms ease both;
  /* Over a band that moves the window, a sheet still takes clicks. */
  -webkit-app-region: no-drag;
}

.overlay[hidden] {
  display: none;
}

.overlay .sheet {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: min(640px, 100%);
  overflow: hidden;
  transform-origin: center;
}

.picker-list,
.brief {
  flex: 1;
}

.sheet-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sheet-foot-note {
  margin-right: auto;
  font-size: 0.75rem;
  color: var(--text-2);
}

.pick {
  display: grid;
  grid-template-columns: 20px 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.pick:hover {
  background: var(--hover);
}

.pick.is-disabled {
  cursor: default;
  opacity: 0.55;
}

.check {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px var(--text-2);
  appearance: none;
  cursor: inherit;
}

.check:checked {
  background: var(--accent);
  box-shadow: none;
}

.check:checked::after {
  content: "";
  width: 9px;
  height: 5px;
  border-bottom: 2px solid var(--on-accent);
  border-left: 2px solid var(--on-accent);
  transform: translateY(-1px) rotate(-45deg);
}

.check:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.brief {
  display: grid;
  align-content: start;
  gap: 14px;
}

.brief-row {
  display: grid;
  gap: 5px;
}

.facts {
  display: grid;
  gap: 14px;
  padding-bottom: 8px;
}

.brief-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.brief-value {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.brief-hint {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-2);
}

.brief-outline {
  width: 100%;
  min-height: 112px;
  padding: 8px 10px;
  border: 0;
  border-radius: 10px;
  outline: none;
  resize: vertical;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.6;
  user-select: text;
}

.brief-outline:focus {
  box-shadow: 0 0 0 1.5px var(--focus);
}

.brief-sources {
  display: grid;
  gap: 6px;
}

.brief-source {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
}

.brief-source .ext {
  height: 30px;
}

.brief-source-name {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.outline {
  margin: 0;
  padding-left: 20px;
  font-size: 0.875rem;
  line-height: 1.7;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 18px;
  z-index: 8;
  max-width: min(520px, calc(100% - 32px));
  padding: 9px 14px;
  border-radius: 12px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, 0.3);
  font-size: 0.8125rem;
  transform: translateX(-50%);
  animation: toast-in 220ms var(--ease-out) both;
}

.toast[hidden] {
  display: none;
}

.toast[data-tone="bad"] {
  box-shadow: 0 0 0 1px var(--bad), 0 12px 32px rgba(0, 0, 0, 0.3);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 8px);
  }
}

/* ---- Account: your name and picture, time online and tokens (account.js) -- */

:root {
  --badge: #2c2c2e;
  --badge-ring: #121214;
}

[data-theme="light"] {
  --badge: #fff;
  --badge-ring: #fafafc;
}

/* On very tall screens the panel stops growing and sits in the middle. */
.page-account {
  align-items: center;
}

.page-account .panel {
  height: 100%;
  max-height: 1040px;
  padding: 0;
  container-type: inline-size;
}

/* Side by side, the two charts take the room the page has left. */
.dash {
  display: grid;
  flex: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: auto auto 1fr auto auto;
  gap: 14px;
  min-height: 0;
  padding: 24px 24px 22px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.profile {
  display: flex;
  flex-wrap: wrap;
  grid-column: 1 / -1;
  align-items: center;
  gap: 14px 20px;
  padding-bottom: 4px;
}

.profile-photo-wrap {
  position: relative;
  flex: none;
}

.profile-photo {
  width: 84px;
  height: 84px;
  padding: 0;
  border: 0;
  cursor: pointer;
  box-shadow: 0 0 0 1px var(--line), 0 10px 28px rgba(0, 0, 0, 0.22);
}

/* The button alone takes the pointer, so a drag over it never flickers. */
.profile-photo > * {
  pointer-events: none;
}

.profile-photo .avatar-initial {
  font-size: 2.125rem;
  letter-spacing: -0.02em;
}

.profile-photo:active {
  transform: scale(0.97);
}

.profile-photo:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 3px;
}

.profile-photo.is-dropping {
  box-shadow: 0 0 0 3px var(--accent), 0 10px 28px rgba(0, 0, 0, 0.22);
}

.photo-scrim {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  transition: opacity 160ms ease;
}

.profile-photo:hover .photo-scrim,
.profile-photo.is-dropping .photo-scrim {
  opacity: 1;
}

.photo-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--badge);
  color: var(--text);
  box-shadow: 0 0 0 2.5px var(--badge-ring), 0 2px 6px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}

.photo-badge svg {
  width: 15px;
  height: 15px;
}

.profile-text {
  display: grid;
  flex: 1 1 260px;
  gap: 2px;
  min-width: 0;
}

/* The name, and beside it the way to your API keys. */
.profile-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  min-width: 0;
}

.key-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 13px 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, transform 160ms var(--ease-out);
}

.key-chip:hover {
  background: var(--control-on);
}

.key-chip:active {
  transform: scale(0.97);
}

.key-chip:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.key-chip-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
}

.key-chip-icon svg,
.key-chip-icon .key-logo {
  width: 15px;
  height: 15px;
}

.key-chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-2);
}

.key-chip-dot[hidden] {
  display: none;
}

.key-chip-dot[data-tone="ok"] { background: var(--ok); }
.key-chip-dot[data-tone="warn"] { background: var(--warn); }
.key-chip-dot[data-tone="bad"] { background: var(--bad); }

/* The name is the page's title, and edits in place. */
.profile-name {
  justify-self: start;
  min-width: 6ch;
  max-width: 100%;
  margin: 0 0 0 -8px;
  padding: 2px 8px;
  border: 0;
  border-radius: 10px;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.021em;
  font-weight: 700;
  field-sizing: content;
  user-select: text;
  transition: background-color 140ms ease;
}

.profile-name::placeholder {
  color: var(--text-2);
  opacity: 1;
}

.profile-name:hover {
  background: var(--hover);
}

.profile-name:focus {
  background: var(--control);
  box-shadow: 0 0 0 1.5px var(--focus);
}

/* ---- Tiers (tiers.js): the plan you pay for, shown as a ring around your
   picture and a small banner by your name; from Gold up the name is in metal.
   Free Bronze · Starter Silver · Pro Gold · Max Platinum · Ultra blood red.
   Light colours, and nothing moves. ---- */
[data-tier="bronze"] {
  --ring-fill: conic-gradient(from 200deg, #a8743f, #d9a878, #f4d6b6, #c48e5a, #9a6634, #c99868, #e9c19a, #a8743f);
  --banner-fill: linear-gradient(135deg, #e3b98f, #f6dfc6 50%, #d9a877);
  --banner-ink: #5b3313;
}

[data-tier="silver"] {
  --ring-fill: conic-gradient(from 200deg, #a3aab3, #dfe3e8, #ffffff, #c3c9d0, #9ea5ae, #eef0f3, #b8bec6, #a3aab3);
  --banner-fill: linear-gradient(135deg, #cdd2d8, #f6f7f9 50%, #c0c6cd);
  --banner-ink: #363d45;
}

[data-tier="gold"] {
  --ring-fill: conic-gradient(from 200deg, #c99b3a, #ecc96a, #fff3c4, #f1d27e, #c8992f, #e9c35e, #fff0b5, #d4a845, #c99b3a);
  --banner-fill: linear-gradient(135deg, #efd078, #fff4cc 50%, #e6c15b);
  --banner-ink: #5c4000;
  --name-metal: linear-gradient(100deg, #e6bf5c 0%, #fff0b5 40%, #f3d27a 65%, #e2b84f 100%);
}

[data-theme="light"][data-tier="gold"] {
  --name-metal: linear-gradient(100deg, #a8790f 0%, #d1a232 40%, #e4bd51 58%, #b6871a 100%);
}

[data-tier="platinum"] {
  --ring-fill: conic-gradient(from 200deg, #a99bd8, #d9d3ef, #f6f4fb, #ffffff, #cfc9e3, #b3a5e6, #e9e5f6, #c4b9ec, #a99bd8);
  --tag-fill: linear-gradient(135deg, #d9d2f2, #f6f4fd 55%, #cfc6ee);
  --tag-ink: #5a3cb8;
  --banner-fill: linear-gradient(135deg, #e2ddf1, #ffffff 50%, #d6cfec);
  --banner-ink: #5a3cb8;
  --name-metal: linear-gradient(100deg, #e9e6f4 0%, #ffffff 35%, #d6d0ea 60%, #c9bcf6 100%);
}

[data-theme="light"][data-tier="platinum"] {
  --name-metal: linear-gradient(100deg, #6f6a8f 0%, #a19dbb 40%, #8b82c6 70%, #6f60bd 100%);
}

/* Ultra: a plain blood-red ring, ULTRA under the picture, a red name and tick. */
[data-tier="diamond"] {
  --ring-fill: conic-gradient(from 200deg, #7a0b16, #a8121f, #c41a29, #9b0d1a, #7a0b16);
  --tag-fill: linear-gradient(135deg, #b8141f, #7a0b16);
  --tag-ink: #ffffff;
  --banner-fill: linear-gradient(135deg, #b0141f, #7a0b16);
  --banner-ink: #ffffff;
  --name-metal: linear-gradient(100deg, #ff6b78 0%, #ff4757 50%, #e5383b 100%);
}

[data-theme="light"][data-tier="diamond"] {
  --name-metal: linear-gradient(100deg, #8a0f1c 0%, #b8141f 50%, #9b0d1a 100%);
}

/* The picture and the ring around it: a gradient cut to a band just outside. */
.avatar-frame {
  --ring-w: 2px;
  --ring-gap: 2px;
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
}

.profile-photo-wrap {
  --ring-w: 4px;
  --ring-gap: 4px;
}

/* Ultra's ring is a little thicker than the others. */
[data-tier="diamond"] .avatar-frame {
  --ring-w: 3px;
}

[data-tier="diamond"] .profile-photo-wrap {
  --ring-w: 7px;
  --ring-gap: 3px;
}

/* Room for the ring around the big picture (and Ultra's tag under it). */
[data-tier] .profile-photo-wrap {
  margin: 8px;
}

[data-tier="diamond"] .profile-photo-wrap {
  margin: 10px 10px 18px;
}

[data-tier="platinum"] .profile-photo-wrap {
  margin: 8px 8px 16px;
}

.tier-ring {
  position: absolute;
  z-index: 0;
  inset: calc(-1 * (var(--ring-w) + var(--ring-gap)));
  display: none;
  border-radius: 50%;
  background: var(--ring-fill, transparent);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-w) - 0.6px), #000 calc(100% - var(--ring-w)));
  mask: radial-gradient(farthest-side, transparent calc(100% - var(--ring-w) - 0.6px), #000 calc(100% - var(--ring-w)));
  pointer-events: none;
}

[data-tier] .tier-ring {
  display: block;
}

/* Max and Ultra: "MAX" / "ULTRA" under the picture, on the bottom of the ring. */
.tier-tag {
  position: absolute;
  z-index: 1;
  top: calc(100% + var(--ring-w) + var(--ring-gap));
  left: 50%;
  display: none;
  padding: 3px 6px 3px 7px;
  border-radius: 5px;
  background: var(--tag-fill);
  color: var(--tag-ink);
  font-size: 0.5625rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.1em;
  box-shadow: 0 0 0 2px var(--badge-ring);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.avatar-frame .tier-tag {
  padding: 1.5px 3px 1.5px 3.5px;
  border-radius: 3px;
  font-size: 6.5px;
  letter-spacing: 0.06em;
  box-shadow: 0 0 0 1.5px var(--badge-ring);
}

[data-tier="platinum"] .tier-tag,
[data-tier="diamond"] .tier-tag {
  display: block;
}

/* Max's pale tag keeps an edge on a pale page. */
[data-tier="platinum"]:not([data-tier-custom="on"]) .profile-photo-wrap .tier-tag {
  box-shadow: 0 0 0 2px var(--badge-ring), inset 0 0 0 1px rgba(90, 60, 184, 0.28);
}

/* The banner by your name: short and small. */
.tier-banner {
  display: none;
  align-items: center;
  height: 20px;
  padding: 0 11px;
  background: var(--banner-fill);
  color: var(--banner-ink);
  font-size: 0.625rem;
  font-weight: 750;
  line-height: 1;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 50%, 100% 100%, 0 100%, 5px 50%);
  cursor: default;
}

[data-tier] .tier-banner {
  display: inline-flex;
}

/* From Gold up the name is in metal (plain again while you edit it). */
[data-tier="gold"] .profile-name:not(:focus):not(:placeholder-shown),
[data-tier="platinum"] .profile-name:not(:focus):not(:placeholder-shown),
[data-tier="diamond"] .profile-name:not(:focus):not(:placeholder-shown) {
  background: var(--name-metal);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.1));
}

/* Ultra: a red verified tick after the name. */
.tier-verified {
  display: none;
  flex: none;
  width: 22px;
  height: 22px;
  margin-left: -8px;
}

.tier-verified svg {
  width: 100%;
  height: 100%;
}

/* Your own colour (tiers.js) can take the tick too. */
.tier-verified svg path:first-of-type {
  fill: var(--tick-fill, url(#tier-verified-fill));
}

.tier-verified svg path:last-of-type {
  stroke: var(--tick-ink, #ffffff);
}

/* Max and Ultra: a button for your own colour, and its panel. */
.tier-colour {
  position: relative;
  display: inline-flex;
}

.tier-colour[hidden] {
  display: none;
}

.tier-colour-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px 0 7px;
  border: 0;
  border-radius: 999px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.tier-colour-button:hover,
.tier-colour-button[aria-expanded="true"] {
  background: var(--control-on);
}

.tier-colour-button:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.tier-colour-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.tier-colour-pop {
  position: absolute;
  z-index: 20;
  top: calc(100% + 8px);
  left: 0;
  display: grid;
  gap: 10px;
  width: 304px;
  padding: 14px;
  border-radius: 16px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.22);
  color: var(--text);
  cursor: default;
}

.tier-colour-pop[hidden] {
  display: none;
}

.tier-colour-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.875rem;
}

.tier-colour-head strong {
  font-weight: 650;
}

.tier-colour-hint {
  margin: -6px 0 0;
  color: var(--text-2);
  font-size: 0.75rem;
  line-height: 1.4;
}

.tier-swatches {
  gap: 9px;
  padding: 2px;
}

.tier-swatches .swatch {
  width: 24px;
  height: 24px;
}

.tier-colour-pop .colour-picker {
  width: 100%;
  padding-top: 0;
}

.tier-colour-pop .colour-area {
  height: 120px;
}

.tier-colour-pop .colour-knob,
.tier-colour-pop .colour-chip {
  background: var(--pick, #8b7fd6);
}

.tier-colour-pop .dropper[aria-pressed="true"] {
  background: var(--pick, #8b7fd6);
  color: var(--pick-ink, #ffffff);
}

[data-tier="diamond"] .tier-verified {
  display: inline-grid;
}

.profile-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 14px;
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-2);
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 500;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-button:focus-visible {
  border-radius: 4px;
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.profile-status {
  display: flex;
  flex-wrap: wrap;
  align-self: flex-start;
  gap: 8px;
  margin-top: 6px;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--control);
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}

.status-chip[hidden] {
  display: none;
}

.status-chip svg {
  width: 15px;
  height: 15px;
  color: var(--warn);
}

.dash-range {
  display: flex;
  grid-column: 1 / -1;
}

.dash-card,
.fact {
  min-width: 0;
  border-radius: 16px;
  background: var(--control);
}

.dash-card {
  display: flex;
  flex-direction: column;
  padding: 16px 18px 14px;
}

.dash-label {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.4;
  font-weight: 600;
  color: var(--text-2);
}

.dash-value {
  margin: 2px 0 0;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.021em;
  font-weight: 650;
}

.dash-sub {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-2);
}

.dash-note {
  grid-column: 1 / -1;
  max-width: 72ch;
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-2);
}

.dash-facts {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.fact {
  display: grid;
  align-content: start;
  gap: 2px;
  padding: 14px 18px;
}

/* Settings › Billing (plan.js): your plan on top, every plan under it. */
.billing-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 6px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--control);
}

.billing-head .setting-hint {
  margin: 2px 0 0;
}

.billing-plan {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.018em;
}

.billing-plan span {
  color: var(--text-2);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0;
}

.billing-status {
  flex: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
  font-size: 0.75rem;
  font-weight: 600;
}

.billing-status.is-ending {
  background: color-mix(in srgb, var(--warn) 20%, transparent);
}

.billing-status.is-bad {
  background: color-mix(in srgb, var(--bad) 16%, transparent);
  color: var(--bad);
}

.billing-next {
  display: grid;
  justify-items: end;
  gap: 2px;
  max-width: 320px;
  text-align: right;
}

.billing-next strong {
  font-size: 0.9375rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.billing-next span {
  color: var(--text-2);
  font-size: 0.75rem;
  line-height: 1.4;
}

.billing-cancel {
  color: var(--bad);
}

.billing-note {
  margin: 14px 0 0;
  color: var(--text-2);
  font-size: 0.75rem;
  line-height: 1.5;
}

/* Change plan: a title and a line, then every plan as one row each (its name,
   price and what it's about on the left; your plan's mark or a button on the
   right), in one bordered list. */
.billing-subhead {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 22px 0 10px;
}

/* Monthly or yearly: two buttons in a pill, the picked one raised. */
.billing-period {
  display: inline-flex;
  flex: none;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--control);
}

.billing-period button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.billing-period button.is-on {
  background: var(--control-on);
  color: var(--text);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.08);
}

.billing-period button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.billing-period-save {
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--text);
  font-size: 0.6875rem;
  font-weight: 600;
}

/* Pro's free days, beside its price. */
.billing-choice-name .billing-choice-trial {
  padding: 1px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--text);
  font-size: 0.6875rem;
  font-weight: 600;
}

.billing-subhead-title {
  margin: 0 0 2px;
  font-size: 0.9375rem;
  line-height: 1.4;
  letter-spacing: -0.009em;
  font-weight: 600;
}

.billing-subhead .setting-hint {
  margin: 0;
}

.billing-choices {
  display: grid;
  margin: 0 0 8px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  list-style: none;
}

.billing-choice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 16px;
  min-height: 60px;
  padding: 10px 12px 10px 16px;
}

.billing-choice + .billing-choice {
  border-top: 1px solid var(--line);
}

.billing-choice.is-mine,
.billing-choice.is-trying {
  background: var(--control);
}

.billing-choice-text {
  min-width: 0;
}

.billing-choice-name {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.4;
}

.billing-choice-name b {
  font-weight: 600;
}

.billing-choice-name span {
  color: var(--text-2);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

.billing-choice-sub {
  margin: 1px 0 0;
  color: var(--text-2);
  font-size: 0.75rem;
  line-height: 1.4;
}

.billing-choice-side {
  display: flex;
  flex: none;
  align-items: center;
  gap: 10px;
}

/* Your plan (or the one you're trying, or when a change starts): a quiet word. */
.billing-choice-mark {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--control-on);
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}

.billing-choice-mark.is-mine {
  padding-left: 7px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--text);
}

.billing-choice-mark svg {
  flex: none;
  width: 13px;
  height: 13px;
  color: var(--accent);
}

.billing-pane .plan-notice {
  margin: 8px 0 0;
}

/* A word under the plan: waiting for a payment, or a payment that didn't go through. */
.plan-notice {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  padding: 9px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.plan-notice.is-bad {
  background: color-mix(in srgb, var(--bad) 12%, transparent);
  color: var(--text);
}

.plan-notice-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: code-pulse 1.2s ease-in-out infinite;
}

[data-motion="reduced"] .plan-notice-dot {
  animation: none;
}

/* Buying, switching or cancelling: the sheet that says what happens. */
.sheet-plan,
.sheet-confirm {
  width: min(460px, 100%);
}

/* Asked over Settings too: a frosted sheet can't blur through Settings' own
   frosted sheet, so this one is solid. */
.sheet-confirm {
  background: var(--sheet-solid);
}

.plan-change-body,
.confirm-body {
  display: grid;
  gap: 8px;
}

.confirm-body b {
  color: var(--text);
  font-weight: 600;
}

.plan-change-body p,
.confirm-body p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.plan-change-body .plan-change-price {
  color: var(--text);
  font-size: 0.9375rem;
}

.plan-change-price b {
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.021em;
  font-variant-numeric: tabular-nums;
}

/* A plan without MAX CODE: its pill wears a lock (plan.js says why on click). */
.plan-no-code .mode-code [data-value="code"] {
  opacity: 0.6;
}

.plan-no-code .mode-code [data-value="code"]::after {
  content: "";
  display: inline-block;
  flex: none;
  vertical-align: -1px;
  width: 11px;
  height: 11px;
  margin-left: 5px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 7V5.25a3.5 3.5 0 0 1 7 0V7h.5A1.5 1.5 0 0 1 13.5 8.5v5A1.5 1.5 0 0 1 12 15H4a1.5 1.5 0 0 1-1.5-1.5v-5A1.5 1.5 0 0 1 4 7h.5Zm1.5 0h4V5.25a2 2 0 0 0-4 0V7Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.fact-value {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.016em;
  font-weight: 650;
}

@container (max-width: 760px) {
  .dash {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: none;
  }

  .chart {
    flex: none;
    height: 176px;
  }
}

@container (max-width: 520px) {
  .dash-facts {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Column charts: one column per day on hairline gridlines, the scale on the
   right. Today is in the accent colour, the other days a paler shade of it. */
.chart {
  --axis: 40px;
  --days: 22px;
  position: relative;
  flex: 1 1 auto;
  min-height: 176px;
  margin-top: 18px;
}

.chart-grid {
  position: absolute;
  inset: 0 0 var(--days) 0;
  pointer-events: none;
}

.chart-line {
  position: absolute;
  right: 0;
  bottom: var(--at);
  left: 0;
  border-top: 1px solid var(--line);
}

.chart-line span {
  position: absolute;
  right: 0;
  bottom: 3px;
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

.chart-cols {
  position: absolute;
  inset: 0 var(--axis) 0 0;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
}

.chart-col {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: default;
}

.chart-col:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.chart-plot {
  display: flex;
  flex: 1;
  align-items: flex-end;
  justify-content: center;
  border-radius: 6px 6px 0 0;
  transition: background-color 120ms ease;
}

.chart-bar {
  width: min(24px, 58%);
  height: var(--h, 0%);
  border-radius: 4px 4px 0 0;
  background: color-mix(in srgb, var(--accent) 34%, transparent);
  transform-origin: bottom;
  transition: height 420ms var(--ease-out), background-color 160ms ease;
}

.chart-col.is-shown .chart-plot {
  background: var(--hover);
}

.chart-col.is-shown .chart-bar {
  background: color-mix(in srgb, var(--accent) 60%, transparent);
}

.chart-col.is-today .chart-bar {
  background: var(--accent);
}

/* Labels wider than their column overflow evenly to both sides. */
.chart-day {
  display: flex;
  flex: none;
  justify-content: center;
  height: var(--days);
  padding-top: 6px;
  font-size: 0.6875rem;
  line-height: 1;
  color: var(--text-2);
  white-space: nowrap;
}

.chart-col.is-today .chart-day {
  color: var(--text);
  font-weight: 600;
}

.chart.is-growing .chart-bar {
  animation: bar-grow 560ms var(--ease-out) var(--d, 0ms) both;
}

@keyframes bar-grow {
  from {
    transform: scaleY(0);
  }
}

.chart-tip {
  position: absolute;
  z-index: 3;
  top: var(--y);
  left: var(--x);
  display: grid;
  gap: 1px;
  padding: 6px 10px 7px;
  border-radius: 10px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 10px 28px rgba(0, 0, 0, 0.3);
  font-size: 0.75rem;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 8px));
}

.chart-tip[hidden],
.chart-empty[hidden] {
  display: none;
}

.chart-tip strong {
  font-size: 0.875rem;
  font-weight: 650;
}

.chart-tip span {
  color: var(--text-2);
}

.chart-empty {
  position: absolute;
  inset: 0 var(--axis) var(--days) 0;
  display: grid;
  place-content: center;
  gap: 2px;
  padding: 12px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-2);
  text-align: center;
  pointer-events: none;
}

.chart-empty strong {
  font-weight: 600;
  color: var(--text);
}

/* Placing a new picture: drag it inside the circle and zoom with the slider. */
.overlay .sheet-photo {
  width: min(380px, 100%);
}

.crop {
  position: relative;
  align-self: center;
  width: min(260px, 100%);
  aspect-ratio: 1;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 18px;
  outline: none;
  background: var(--avatar-fill);
  cursor: grab;
  touch-action: none;
}

.crop.is-dragging {
  cursor: grabbing;
}

.crop:focus-visible {
  box-shadow: 0 0 0 1.5px var(--focus);
}

.crop-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  pointer-events: none;
  user-select: none;
  will-change: transform;
}

/* Outside the circle the picture dims; a hairline marks the circle's edge. */
.crop::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  pointer-events: none;
}

.crop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle closest-side, transparent 99%, rgba(0, 0, 0, 0.52) 100%);
  pointer-events: none;
}

.crop-zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--text-2);
}

.crop-zoom .slider {
  width: 190px;
}

.crop-zoom-small {
  width: 13px;
  height: 13px;
}

.crop-zoom-large {
  width: 19px;
  height: 19px;
}

.crop-hint {
  margin: -4px 0 0;
  font-size: 0.75rem;
  color: var(--text-2);
  text-align: center;
}

/* ---- My API: your API keys (apikeys.js) --------------------------------- */

.key-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--control-on);
  color: var(--text);
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.key-badge svg {
  width: 16px;
  height: 16px;
}

/* Provider logos (icons/providers). One-colour logos are masks filled with
   the text colour; the others keep their own colours. */
.key-logo {
  display: block;
  width: 18px;
  height: 18px;
}

/* A service's own icon may be square: soften its corners like the tile's. */
.key-logo.is-site {
  border-radius: 4px;
  object-fit: contain;
}

span.key-logo {
  background: currentColor;
  mask: center / contain no-repeat;
}

.key-logo[data-logo="openai"] { mask-image: url("icons/providers/openai.svg"); }
.key-logo[data-logo="openrouter"] { mask-image: url("icons/providers/openrouter.svg"); }
.key-logo[data-logo="grok"] { mask-image: url("icons/providers/grok.svg"); }
.key-logo[data-logo="zai"] { mask-image: url("icons/providers/zai.svg"); }
.key-logo[data-logo="groq"] { mask-image: url("icons/providers/groq.svg"); }

/* A logo drawn in place (Kimi) sizes like the others, even in a badge. */
svg.key-logo,
.key-badge svg.key-logo {
  width: 18px;
  height: 18px;
}

.provider-option .key-logo {
  width: 17px;
  height: 17px;
}

/* Key hints read as code, so a 0 and an O look different. */
.key-hint {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0;
}

.key-row-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.key-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.notice[data-tone="ok"] { background: color-mix(in srgb, var(--ok) 15%, transparent); }
.notice[data-tone="busy"] { background: color-mix(in srgb, var(--info) 12%, transparent); }

.key-form {
  display: grid;
  align-content: start;
  gap: 16px;
  max-width: 560px;
  padding-bottom: 8px;
}

.key-form .field {
  gap: 6px;
}

.key-form .field[hidden],
.key-form .form-group[hidden] {
  display: none;
}

.form-group {
  display: grid;
  gap: 6px;
}

.form-label {
  font-size: 0.75rem;
  color: var(--text-2);
}

.form-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-2);
}

.form-error {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--bad);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.provider-pick {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

.provider-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  height: 44px;
  padding: 0 10px 0 7px;
  border: 0;
  border-radius: 12px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 160ms ease;
}

.provider-option .key-badge {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.provider-option:hover,
.provider-option[aria-checked="true"] {
  background: var(--control-on);
}

.provider-option[aria-checked="true"] {
  box-shadow: 0 0 0 1.5px var(--accent);
}

.provider-option:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

/* The key field, with an eye that shows what was typed. */
.secret-field {
  position: relative;
  display: grid;
}

.secret-field input {
  padding-right: 40px;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  letter-spacing: 0;
}

.secret-field input::placeholder {
  font-family: var(--font-sans);
}

.secret-toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.secret-toggle:hover {
  color: var(--text);
}

.secret-toggle:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: -2px;
}

.secret-toggle svg {
  width: 17px;
  height: 17px;
}

.key-form .link-button {
  justify-self: start;
  margin-top: -6px;
  font-size: 0.8125rem;
}

/* ---- The model bar in the box and its panel (models.js) ----------------- */

/* The bar: the logo of whoever makes the model, and the model's name. */
.model-bar {
  gap: 7px;
  max-width: 230px;
  padding: 0 8px 0 7px;
}

.model-bar-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
}

.model-bar-icon .key-logo,
.model-bar-icon svg {
  width: 15px;
  height: 15px;
}

.model-bar-name {
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.model-bar .model-bar-chevron {
  width: 13px;
  height: 13px;
  color: var(--text-2);
  transition: transform 240ms var(--ease-out);
}

.model-bar[aria-expanded="true"] .model-bar-chevron {
  transform: rotate(180deg);
}

/* Nothing chosen yet: a gentle nudge in the accent colour. */
.model-bar.is-unset {
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--effort) 55%, transparent);
}

.model-bar:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

/* The panel: placed beside the bar by models.js, below it or else above. */
.model-pop {
  position: absolute;
  z-index: 6;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 18px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.3);
  color: var(--text);
  transform-origin: top right;
  animation: model-pop-in 240ms var(--ease-out) both;
  -webkit-app-region: no-drag;
}

.model-pop[hidden] {
  display: none;
}

.model-pop.is-above {
  transform-origin: bottom right;
  animation-name: model-pop-up;
}

@keyframes model-pop-in {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.97);
  }
}

@keyframes model-pop-up {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.97);
  }
}

.model-pop-section {
  padding: 10px 8px 8px;
}

.model-pop-section + .model-pop-section {
  border-top: 1px solid var(--line);
}

/* With room: keys on the left, their models beside them. */
.model-pop.is-wide {
  flex-direction: row;
}

.model-pop.is-wide .model-pop-section:first-child {
  flex: none;
  width: 236px;
  overflow: auto;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.model-pop.is-wide .model-pop-section + .model-pop-section {
  border-top: 0;
}

.model-pop-models {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.model-pop-models[hidden] {
  display: none;
}

.model-pop-label {
  margin: 0 6px 6px;
  font-size: 0.6875rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-2);
}

.model-pop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 8px;
  margin-bottom: 8px;
}

.model-pop-head .model-pop-label {
  margin-bottom: 0;
}

/* The kinds: All, Smart, Fast, Reasoning. */
/* Auto: on, it lights up like a chosen kind and Axonbyok picks the model. */
.model-auto {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  margin-left: auto;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: var(--control);
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.model-auto svg {
  width: 13px;
  height: 13px;
}

.model-auto:hover {
  color: var(--text);
}

.model-auto[aria-pressed="true"] {
  background: var(--text);
  color: var(--bg, #fff);
}

[data-theme="light"] .model-auto[aria-pressed="true"] {
  color: #fff;
}

[data-theme="dark"] .model-auto[aria-pressed="true"] {
  color: #111;
}

.model-auto:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.model-auto-note {
  margin: 2px 6px 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--control);
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-2);
}

.model-kinds {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: 9px;
  background: var(--control);
}

.model-kinds button {
  height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.model-kinds button:hover:not(:disabled) {
  color: var(--text);
}

.model-kinds button[aria-checked="true"] {
  background: var(--control-on);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.model-kinds button:disabled {
  opacity: 0.35;
  cursor: default;
}

.model-kinds button:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.model-search {
  flex: none;
  min-width: 0;
  margin: 0 2px 6px;
}

.model-search[hidden] {
  display: none;
}

.model-list {
  flex: 1;
  min-height: 48px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

/* Rows for keys and for models. */
.model-key,
.model-row {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 40px;
  padding: 5px 8px;
  border: 0;
  border-radius: 10px;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.model-key:hover,
.model-row:hover,
.model-key:focus-visible,
.model-row:focus-visible {
  background: var(--hover);
}

.model-key:focus-visible,
.model-row:focus-visible {
  box-shadow: inset 0 0 0 1.5px var(--focus);
}

.model-key[aria-checked="true"],
.model-row[aria-selected="true"] {
  background: var(--control);
}

.model-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--control-on);
  color: var(--text-2);
}

.model-icon .key-logo,
.model-icon svg {
  width: 15px;
  height: 15px;
}

.model-key-text {
  display: grid;
  min-width: 0;
}

.model-key-name,
.model-row-name {
  overflow: hidden;
  font-size: 0.8125rem;
  line-height: 1.35;
  font-weight: 500;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.model-key-sub {
  overflow: hidden;
  font-size: 0.6875rem;
  line-height: 1.35;
  color: var(--text-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.model-row-end {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-row-kind {
  font-size: 0.6875rem;
  color: var(--text-2);
}

.model-check {
  width: 15px;
  height: 15px;
  color: var(--effort);
}

.model-note {
  display: grid;
  gap: 8px;
  justify-items: start;
  margin: 6px 8px 8px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-2);
}

.model-note .status {
  font-size: 0.8125rem;
}

.model-more {
  margin: 6px 8px 4px;
  font-size: 0.75rem;
  color: var(--text-2);
}

.model-manage {
  margin: 6px 8px 0;
  font-size: 0.8125rem;
}

.model-pop-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  padding: 8px 6px 0;
  border-top: 1px solid var(--line);
  font-size: 0.6875rem;
  color: var(--text-2);
}

.model-pop-foot .link-button {
  font-size: 0.75rem;
}

[data-motion="reduced"] .model-pop {
  animation-name: fade-in;
}

/* ---- Chat: the conversation above the box (conversation.js) --------------- */

/* Once a chat begins, the thread fills the glass, answers on the left and
   yours on the right like a messenger, clear of the edges (the window buttons
   sit top right). The box stays centred at the foot. */
.page-home.has-thread {
  /* A long line in a reply (a command, a path) never widens the page:
     the column stays the window's width and the line is cut or scrolls. */
  grid-template-columns: minmax(0, 1fr);
  align-content: stretch;
  overflow-x: hidden;
  padding: 64px 72px 16px;
}

.page-home.has-thread .home {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
}

.page-home.has-thread .composer,
.page-home.has-thread .composer-meta {
  width: min(860px, 100%);
  margin-inline: auto;
}

.page-home.has-thread .home-title,
.page-home.has-thread .home-note,
.page-home.has-thread .suggestions,
.thread[hidden] {
  display: none;
}

.thread {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 22px;
  min-height: 0;
  margin-bottom: 12px;
  padding: 26px 4px 8px;
  overflow-y: auto;
  /* Never sideways: a long line scrolls in its own box (see below). */
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  /* Older messages fade out under the top edge. */
  mask-image: linear-gradient(to bottom, transparent, #000 28px);
}

.msg {
  flex: none;
  max-width: 100%;
  animation: msg-in 280ms var(--ease-out) both;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.msg-user {
  display: grid;
  align-self: flex-end;
  justify-items: end;
  gap: 6px;
  max-width: min(640px, 72%);
}

/* Your message: a frosted bubble on the right. */
.msg-bubble {
  padding: 9px 16px;
  border-radius: 20px;
  background: var(--sheet);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 0.9375rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: text;
}

.msg-files {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.msg-file {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: var(--sheet);
  backdrop-filter: blur(20px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: 0.75rem;
}

.msg-file svg {
  width: 13px;
  height: 13px;
}

/* The AI's answer: a bubble like yours, on the left, as wide as its text.
   Copy and the model sit under it. */
.msg-ai {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  justify-items: start;
  align-self: flex-start;
  max-width: min(860px, 82%);
  user-select: text;
}

.msg-ai .msg-body {
  min-width: 0;
  max-width: 100%;
  padding: 10px 16px;
  border-radius: 20px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line);
}

/* A problem is its own bubble. */
.msg-ai[data-status="error"] .msg-body {
  padding: 0;
  background: none;
  box-shadow: none;
}

.msg-ai .msg-problem {
  margin: 0;
  padding: 12px 16px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--bad) 12%, var(--sheet));
  box-shadow: 0 0 0 1px var(--line);
}

/* Under the bubble: Copy and the model in a small pill of the same glass, so
   it reads over any wallpaper. */
.msg-ai .msg-foot {
  min-height: 28px;
  margin-top: 6px;
  padding: 0 12px;
  border-radius: 14px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line);
}

.msg-ai .msg-foot .msg-action {
  width: 26px;
  height: 26px;
  margin: 0 -2px 0 -9px;
}

.msg-ai .msg-foot .msg-action svg {
  width: 14px;
  height: 14px;
}

/* Under an answer: Copy, then which model wrote it. */
.msg-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
}

.msg-logo {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
}

.msg-logo .key-logo,
.msg-logo svg {
  width: 13px;
  height: 13px;
}

.msg-ultra {
  background: linear-gradient(90deg, var(--effort), var(--ultra-a) 30%, var(--ultra-b) 50%, var(--ultra-a) 70%, var(--effort)) 0 0 / 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 700;
  letter-spacing: 0.05em;
  animation: ultra-shimmer 2.6s linear infinite;
}

.msg-body {
  font-size: 0.9375rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.msg-body > :first-child {
  margin-top: 0;
}

.msg-body > :last-child {
  margin-bottom: 0;
}

.msg-body p {
  margin: 0 0 10px;
}

.msg-body ul,
.msg-body ol {
  margin: 0 0 10px;
  padding-left: 22px;
}

.msg-body li + li {
  margin-top: 3px;
}

.msg-body li > ul,
.msg-body li > ol {
  margin: 4px 0 0;
}

.msg-body .md-heading {
  margin: 18px 0 8px;
  font-weight: 650;
  letter-spacing: -0.012em;
  line-height: 1.3;
}

.msg-body h3.md-heading {
  font-size: 1.125rem;
}

.msg-body h4.md-heading {
  font-size: 1rem;
}

.msg-body h5.md-heading {
  font-size: 0.9375rem;
}

.msg-body blockquote {
  margin: 0 0 10px;
  padding: 2px 0 2px 12px;
  border-left: 3px solid var(--line);
  color: var(--text-2);
}

.msg-body hr {
  margin: 14px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

.md-code-inline {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--control);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.md-code {
  margin: 0 0 12px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--control);
}

.md-code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 4px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.6875rem;
  color: var(--text-2);
}

.md-copy {
  padding: 3px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  cursor: pointer;
}

.md-copy:hover {
  background: var(--hover);
  color: var(--text);
}

.md-code pre {
  margin: 0;
  padding: 10px 12px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  scrollbar-width: thin;
}

.md-table {
  margin: 0 0 12px;
  overflow-x: auto;
}

.md-table table {
  border-collapse: collapse;
  font-size: 0.875rem;
}

.md-table th,
.md-table td {
  padding: 6px 12px 6px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.md-table th {
  font-weight: 600;
}

.md-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--text) 45%, transparent);
  text-underline-offset: 2px;
}

.md-link:hover {
  text-decoration-color: currentColor;
}

/* Thinking: a sheen moves across the word until the first text arrives. */
.msg-thinking {
  background: linear-gradient(90deg, var(--text-2) 0 35%, var(--text) 50%, var(--text-2) 65% 100%) 0 0 / 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: thinking-sheen 1.6s linear infinite;
}

@keyframes thinking-sheen {
  from {
    background-position: 110% 0;
  }

  to {
    background-position: -110% 0;
  }
}

.msg-caret {
  display: inline-block;
  width: 7px;
  height: 1.05em;
  margin-left: 3px;
  border-radius: 2px;
  background: var(--text);
  vertical-align: text-bottom;
  animation: caret-blink 1s steps(2, jump-none) infinite;
}

@keyframes caret-blink {
  to {
    opacity: 0.15;
  }
}

/* Steps: while the AI works, what it is doing (Axonbyok's own steps, then the
   model's), the newest shimmering with a clock; then "Thought for 12s". */
.msg-steps {
  display: grid;
  justify-items: start;
  gap: 6px;
  margin: 0 0 12px;
}

.msg-steps.is-live {
  margin: 0;
}

.msg-step,
.msg-steps-more,
.msg-steps-done {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-2);
}

/* A dot on a thread down the left: the path the steps take. */
.msg-step {
  position: relative;
  padding-left: 16px;
}

.msg-step::before {
  content: "";
  position: absolute;
  top: 0.55em;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
}

.msg-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: calc(0.55em + 9px);
  bottom: -9px;
  left: 4.5px;
  width: 1px;
  background: var(--line);
}

.msg-step.is-now::before {
  background: var(--text);
  opacity: 1;
  animation: caret-blink 1s steps(2, jump-none) infinite;
}

.msg-step-time,
.msg-steps-more {
  font-size: 0.75rem;
  color: var(--text-2);
}

.msg-steps-more {
  padding-left: 16px;
}

.msg-steps-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: -8px;
  padding: 4px 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.msg-steps-toggle:hover {
  background: var(--hover);
  color: var(--text);
}

.msg-steps-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform 180ms var(--ease-out);
}

.msg-steps-toggle[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

/* The model's thinking, opened: smaller and quieter than the answer. */
.msg-thoughts {
  max-height: 320px;
  overflow: auto;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--line);
  font-size: 0.8125rem;
  line-height: 1.6;
  color: var(--text-2);
  scrollbar-width: thin;
}

.msg-thoughts p,
.msg-thoughts ul,
.msg-thoughts ol {
  margin: 0 0 8px;
}

.msg-thoughts .md-heading {
  margin: 10px 0 4px;
  font-size: 0.8125rem;
}

/* Pictures in an answer, drawn in place (conversation.js fetches them). */
.md-image {
  display: block;
  margin: 8px 0 12px;
}

.md-picture {
  display: block;
  max-width: min(100%, 560px);
  max-height: 480px;
  border-radius: 16px;
  background: var(--control);
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, 0.14);
  object-fit: contain;
}

.md-image-wait {
  display: grid;
  place-items: center;
  width: min(100%, 360px);
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: var(--control);
  font-size: 0.8125rem;
}

.md-image-note {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.msg-note {
  margin: 8px 0 0;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.msg-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 30px;
  margin-top: 6px;
  font-size: 0.6875rem;
  color: var(--text-2);
}

/* Icon buttons under an answer, like ChatGPT's. */
.msg-action {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin-left: -6px;
  margin-right: -4px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.msg-action:hover {
  background: var(--hover);
  color: var(--text);
}

.msg-action:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.msg-action svg {
  width: 16px;
  height: 16px;
}

.msg-problem {
  display: grid;
  gap: 6px;
  margin: 0;
}

.msg-problem p {
  margin: 0;
}

.msg-problem-detail {
  font-size: 0.75rem;
  color: var(--text-2);
  overflow-wrap: anywhere;
}

.msg-problem-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.send[hidden] {
  display: none;
}

/* Send these files? */
.overlay .sheet-send {
  width: min(460px, 100%);
}

.send-note {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-2);
}

.send-files {
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow: auto;
}

.send-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--control);
  font-size: 0.8125rem;
}

.send-file svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--text-2);
}

[data-motion="reduced"] .msg,
[data-motion="reduced"] .msg-step.is-now::before,
[data-motion="reduced"] .msg-thinking,
[data-motion="reduced"] .msg-caret,
[data-motion="reduced"] .msg-ultra {
  animation: none;
}

/* ---- Chats: saved chats beside Tasks, and in the sidebar (history.js) ------ */

.panel-split[hidden] {
  display: none;
}

/* The logo of the model that last answered, in a file-badge-sized tile. */
.chat-badge .key-logo,
.chat-badge svg {
  width: 16px;
  height: 16px;
}

/* The chat on screen, in the sidebar. */
.recent.is-current {
  background: var(--control-on);
  color: var(--text);
}

.detail-model {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.detail-model .key-logo {
  width: 13px;
  height: 13px;
}

.rename-field {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  outline: none;
  background: var(--control);
  box-shadow: 0 0 0 1.5px var(--focus);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  user-select: text;
}

/* The preview: who said what, smaller than the chat itself. */
.transcript {
  display: grid;
  gap: 14px;
  padding-bottom: 12px;
}

.transcript-msg {
  display: grid;
  justify-items: start;
  gap: 4px;
  min-width: 0;
}

.transcript-who {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-2);
}

.transcript-who .key-logo {
  width: 12px;
  height: 12px;
}

.transcript-text {
  max-width: 100%;
  margin: 0;
  padding: 7px 11px;
  border-radius: 12px;
  background: var(--control);
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.transcript .msg-body {
  max-width: 100%;
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* Headings keep their order, a size down from the chat's. */
.transcript .msg-body h3.md-heading {
  font-size: 0.9375rem;
}

.transcript .msg-body h4.md-heading,
.transcript .msg-body h5.md-heading {
  font-size: 0.8125rem;
}

.transcript-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-2);
}

/* Narrow windows: stack the lists over their details. */
@media (max-width: 900px) {
  .panel-split {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  }

  .detail {
    padding-left: 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .composer-details {
    grid-template-columns: 1fr;
  }
}

[data-motion="reduced"] .panel {
  animation-name: fade-in;
}

[data-motion="reduced"] .status[data-tone="busy"]::before {
  animation: none;
}

/* In a plain browser there is no desktop behind the glass, so paint a stand-in sky. */
.web-preview body {
  background:
    radial-gradient(40% 30% at 22% 80%, rgba(240, 226, 192, 0.95), transparent 70%),
    radial-gradient(34% 26% at 58% 92%, rgba(234, 220, 184, 0.9), transparent 72%),
    radial-gradient(30% 24% at 88% 72%, rgba(228, 216, 186, 0.85), transparent 70%),
    linear-gradient(180deg, #8ea5a6 0%, #9db2b0 55%, #b7c0b2 100%);
}

.web-preview .shell {
  inset: 28px;
}

.web-preview .window-controls {
  display: none;
}

/* Reduced motion: no movement, only fades. */
[data-motion="reduced"] .rail-button:active,
[data-motion="reduced"] .icon,
[data-motion="reduced"] .icon *,
[data-motion="reduced"] .avatar {
  transform: none !important;
  animation: none !important;
}

[data-motion="reduced"] .sheet {
  animation-name: fade-in;
}

[data-motion="reduced"] .segmented::before,
[data-motion="reduced"] .switch::after {
  transition: none;
}

[data-motion="reduced"] .slider:active::-webkit-slider-thumb,
[data-motion="reduced"] .hue-slider:active::-webkit-slider-thumb,
[data-motion="reduced"] .colour-area.is-dragging .colour-knob,
[data-motion="reduced"] .swatch,
[data-motion="reduced"] .dropper svg {
  transform: none !important;
}

[data-motion="reduced"] .colour-picker {
  animation-name: fade-in;
}

[data-motion="reduced"] .rail-group {
  transition: none;
}

[data-motion="reduced"] .suggestion.is-entering {
  animation-name: fade-in;
  animation-delay: 0ms;
}

[data-motion="reduced"] .composer.is-beaming::after {
  animation: none;
}

/* Effort without motion: no sparks, drift or shimmer, and the knob steps. */
[data-motion="reduced"] .effort-pop,
[data-motion="reduced"] .effort-pop::before,
[data-motion="reduced"] .effort-pop::after,
[data-motion="reduced"] .effort-title,
[data-motion="reduced"] .effort-bolt svg,
[data-motion="reduced"] .effort-rail,
[data-motion="reduced"] .effort-stars,
[data-motion="reduced"] .effort-fill::before,
[data-motion="reduced"] .effort-fill::after,
[data-motion="reduced"] .effort-knob,
[data-motion="reduced"] .effort-chip,
[data-motion="reduced"] .effort-chip-label,
[data-motion="reduced"] .effort-chip-bolt {
  animation: none !important;
}

[data-motion="reduced"] .effort-fill,
[data-motion="reduced"] .effort-knob,
[data-motion="reduced"] .effort-chip-chevron {
  transition: none;
}

[data-motion="reduced"] .shell,
[data-motion="reduced"] .stage {
  transition: none;
}

[data-motion="reduced"] .chart.is-growing .chart-bar {
  animation-name: fade-in;
  animation-delay: 0ms;
}

[data-motion="reduced"] .chart-bar {
  transition: none;
}

/* ---- MAX CODE, as in Claude Code: a plain box at the foot of the glass, and
   one quiet row under it (workspace.js moves the folder, model and approvals
   there). No heading, templates, details, tray or suggestions. */
[data-mode="code"] .page-home {
  align-content: end;
  padding-bottom: 26px;
}

[data-mode="code"] .home-title,
[data-mode="code"] .work-tray,
:is([data-mode="work"], [data-mode="code"]) .suggestions,
:is([data-mode="work"], [data-mode="code"]) .composer .chip-select,
:is([data-mode="work"], [data-mode="code"]) .composer [data-toggle-details],
:is([data-mode="work"], [data-mode="code"]) .composer-details {
  display: none;
}

/* ---- Work, as in ChatGPT: the heading, the box with approvals, model and
   effort inside it, and the tray under it with the project, files, plugins
   and the laptop. Nothing else under the box. */
[data-mode="work"] .composer-meta {
  display: none;
}

[data-mode="work"] .composer-tools .meta-chip {
  height: 32px;
  padding: 0 9px;
  border-radius: 16px;
  background: transparent;
  backdrop-filter: none;
  box-shadow: none;
  color: var(--text-2);
  transition: background-color 140ms ease, color 140ms ease;
}

[data-mode="work"] .composer-tools .meta-chip:hover,
[data-mode="work"] .composer-tools .meta-chip[aria-expanded="true"] {
  background: var(--control);
  color: var(--text);
}

[data-mode="work"] .composer-tools .effort-chip {
  margin-left: -4px;
}

/* The project chip: a soft pill, like the box it hangs from. */
[data-mode="work"] .work-tray [data-folder-button] {
  background: color-mix(in oklab, var(--sheet), var(--text) 6%);
}

[data-mode="work"] .work-tray [data-folder-button]:hover,
[data-mode="work"] .work-tray [data-folder-button][aria-expanded="true"] {
  background: var(--hover);
}

/* The heading is bold and a little larger (bold since Dec 2026, the owner's
   choice: light letters got lost on a wallpaper), and the token ring waits
   for the first message. */
[data-mode="work"] .home-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

[data-mode="work"] .page-home:not(.has-thread) .composer-tools .context-wrap {
  display: none;
}

/* In a conversation the tray stays as wide as the box above it. */
.page-home.has-thread .work-tray {
  width: calc(min(860px, 100%) - 36px);
  margin-inline: auto;
}

[data-chat-style="claude"] .page-home.has-thread .work-tray {
  width: calc(min(768px, 100%) - 36px);
}

/* At the foot of the glass the tray's menus open upwards, over the box. The
   tray makes no layer of its own there, so a menu can sit above the box. */
.page-home.has-thread .work-tray:not(.is-leaving) {
  z-index: auto;
  backdrop-filter: none;
}

.page-home.has-thread .work-tray .work-menu {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom center;
}

/* The laptop sits at the tray's right end. */
.tray-env {
  margin-left: auto;
}

.tray-continue:not([hidden]) + .tray-env {
  margin-left: 0;
}

.tray-icon {
  width: 32px;
  padding: 0;
  justify-content: center;
}

.tray-icon svg {
  width: 17px;
  height: 17px;
}

.work-tray .tray-env .work-menu {
  right: 0;
  left: auto;
}

/* The project menu: search, New project, then the projects (workspace.js). */
.work-tray [data-folder-menu],
.work-start [data-folder-menu] {
  min-width: 320px;
}

.menu-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--text-2);
  cursor: text;
}

.menu-field svg {
  flex: none;
  width: 15px;
  height: 15px;
}

.menu-search {
  margin-bottom: 4px;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 1px 0 var(--line);
}

.menu-search-input {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  outline: none;
}

.menu-search-input::placeholder {
  color: var(--text-3, var(--text-2));
}

.project-new .menu-field {
  background: var(--control-on);
}

.project-list {
  display: grid;
  max-height: 300px;
  overflow-y: auto;
}

.project-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
}

.work-option .project-icon svg {
  color: var(--text-2);
}

.project-new-button {
  margin-bottom: 2px;
}

.project-check svg {
  display: block;
}

.menu-empty {
  margin: 6px 10px 8px;
  color: var(--text-2);
  font-size: 0.8125rem;
}

.meta-end {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

/* In the row the model, folder and approvals are small glass pills, like the
   effort button beside them, so they read over any wallpaper. */
.composer-meta .model-bar,
.composer-meta .approve-chip,
.composer-meta .tray-button {
  height: 30px;
  padding: 0 11px;
  border-radius: 15px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text);
}

/* From the foot of the glass, their menus open upwards. */
.composer-meta .work-menu {
  top: auto;
  right: auto;
  bottom: calc(100% + 6px);
  min-width: 260px;
}

.composer-meta .approve-menu {
  top: auto;
  right: 0;
  bottom: calc(100% + 8px);
  left: auto;
}

/* Under an answer: "Read aloud" stays lit while it speaks; the time is quiet. */
.msg-action[aria-pressed="true"] {
  background: var(--hover);
  color: var(--text);
}

.msg-time {
  white-space: nowrap;
}

/* Work: the agent's steps, one quiet line each, and a question that needs a
   yes (Allow / Don't allow) inside the answer. */
.msg-acts {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
}

.msg-act {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-2);
}

.msg-act::before {
  content: "";
  position: absolute;
  top: 0.5em;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.msg-act[data-state="done"]::before {
  background: var(--ok);
  opacity: 1;
}

.msg-act[data-state="failed"]::before {
  background: var(--bad);
  opacity: 1;
}

.msg-act[data-state="running"]::before {
  background: var(--text);
  opacity: 1;
  animation: caret-blink 1s steps(2, jump-none) infinite;
}

.msg-act-note {
  font-size: 0.75rem;
  opacity: 0.8;
}

.msg-ask {
  display: grid;
  gap: 8px;
  margin: 10px 0 2px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--control);
  box-shadow: 0 0 0 1px var(--line);
}

.msg-ask-text {
  margin: 0;
  font-weight: 600;
}

.msg-ask-detail {
  display: block;
  max-height: 160px;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--sheet);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.msg-ask-buttons {
  display: flex;
  gap: 8px;
}

[data-motion="reduced"] .msg-act[data-state="running"]::before {
  animation: none;
}

/* Work: the step still being written, with its newest lines of code. */
.msg-flow-text > :last-child {
  margin-bottom: 8px;
}

.msg-body > .msg-act {
  margin-bottom: 6px;
}

.msg-draft {
  display: grid;
  gap: 6px;
  margin: 2px 0 8px;
}

.msg-draft-code {
  max-height: 240px;
  margin: 0;
  padding: 10px 12px;
  overflow: hidden;
  border-radius: 12px;
  background: var(--control);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  /* The oldest of the lines shown fade out at the top. */
  mask-image: linear-gradient(to bottom, transparent, #000 36px);
}

/* Usage (apiusage.js): totals, then one card per API key. */
.page-usage .panel {
  height: 100%;
  container-type: inline-size;
}

.usage-body {
  display: grid;
  flex: 1;
  align-content: start;
  gap: 14px;
  min-height: 0;
  margin: 0 -20px -14px;
  padding: 2px 20px 18px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.usage-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.usage-keys {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  align-items: start;
  gap: 14px;
}

.usage-key {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--control);
}

.usage-key-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.usage-key-name {
  flex: 1;
  min-width: 0;
}

.usage-key-name h3,
.usage-key-name p {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.usage-key-name h3 {
  font-size: 0.9375rem;
  font-weight: 650;
}

.usage-key-name p {
  font-size: 0.75rem;
  color: var(--text-2);
}

.usage-part {
  display: grid;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.usage-part-title {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-2);
}

.usage-big {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.usage-of {
  font-size: 0.875rem;
  letter-spacing: 0;
  font-weight: 500;
  color: var(--text-2);
}

.usage-loading {
  color: var(--text-2);
  animation: usage-pulse 1.4s ease-in-out infinite;
}

@keyframes usage-pulse {
  50% {
    opacity: 0.45;
  }
}

.usage-sub,
.usage-quiet,
.usage-warn,
.usage-stamp {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-2);
}

.usage-quiet {
  color: var(--text);
}

.usage-warn {
  color: var(--warn);
  font-weight: 550;
}

.usage-stamp {
  font-size: 0.75rem;
  opacity: 0.85;
}

.usage-link {
  justify-self: start;
  font-size: 0.8125rem;
}

/* A bar for what is left: green, amber under a quarter, red under a tenth. */
.meter {
  height: 6px;
  margin: 4px 0 2px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.meter-fill {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--ok);
  transform: scaleX(var(--share));
  transform-origin: left;
  transition: transform 420ms var(--ease-out);
}

.meter[data-tone="warn"] .meter-fill { background: var(--warn); }
.meter[data-tone="bad"] .meter-fill { background: var(--bad); }

.limit-row {
  display: grid;
  gap: 0;
}

.limit-text {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.8125rem;
}

.limit-name {
  color: var(--text-2);
}

.limit-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.use-models {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.use-model {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(56px, 34%) auto;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
}

.use-model-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.use-model-track {
  height: 6px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--line);
}

.use-model-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transform: scaleX(var(--share));
  transform-origin: left;
}

.use-model-value {
  min-width: 4ch;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

@container (max-width: 620px) {
  .usage-totals {
    grid-template-columns: minmax(0, 1fr);
  }
}

[data-motion="reduced"] .usage-loading {
  animation: none;
}

/* ---- Claude style (Settings, Chat style) ------------------------------------
   A chat reads like Claude's: one centred column on a calm surface, your words
   in a soft bubble on the right, the answer as plain text in a reading font
   with its buttons beneath, and the logo's star turning while it writes.
   "Bubbles" keeps the older look over the wallpaper. */

:root {
  --calm: rgba(31, 30, 29, 0.94);
  --user-bubble: rgba(255, 255, 255, 0.075);
  --serif: "Sitka Text", "Iowan Old Style", Charter, Georgia, Cambria, serif;
  --reply-font: var(--font-sans);
}

[data-theme="light"] {
  --calm: rgba(250, 249, 245, 0.93);
  --user-bubble: rgba(20, 20, 19, 0.06);
}

[data-reply-font="serif"] {
  --reply-font: var(--serif);
}

.calm {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--calm);
  backdrop-filter: blur(28px) saturate(120%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms var(--ease-out);
}

/* Settings, Chat background: Plain puts the calm page behind New chat (home
   and chats); Wallpaper leaves your picture or live video there. */
[data-chat-bg="plain"] .stage:has(.page-home:not([hidden])) .calm {
  opacity: 1;
}

[data-chat-style="claude"] .page-home.has-thread {
  padding: 58px 24px 10px;
}

/* One reading column; the scroll bar stays at the glass's edge. */
[data-chat-style="claude"] .thread {
  gap: 30px;
  padding: 28px max(12px, calc((100% - 744px) / 2)) 20px;
  mask-image: linear-gradient(to bottom, transparent, #000 24px);
}

[data-chat-style="claude"] .page-home.has-thread .composer,
[data-chat-style="claude"] .page-home.has-thread .composer-meta,
[data-chat-style="claude"] .page-home.has-thread .composer-note {
  width: min(768px, 100%);
}

/* Your message: a soft bubble on the right, Copy and Edit under it on hover. */
[data-chat-style="claude"] .msg-user {
  gap: 2px;
  max-width: min(600px, 86%);
}

[data-chat-style="claude"] .msg-bubble {
  padding: 10px 16px;
  border-radius: 18px;
  background: var(--user-bubble);
  backdrop-filter: none;
  box-shadow: none;
  font-size: 0.96875rem;
  line-height: 1.6;
}

.msg-user-foot {
  display: flex;
  gap: 2px;
  min-height: 28px;
  opacity: 0;
  transition: opacity 160ms ease;
}

.msg-user-foot .msg-action {
  width: 28px;
  height: 28px;
  margin: 0;
}

.msg-user-foot .msg-action svg {
  width: 14px;
  height: 14px;
}

.msg-user:hover .msg-user-foot,
.msg-user:focus-within .msg-user-foot {
  opacity: 1;
}

/* Editing it: the words in a box, then Cancel or Send. */
.msg-user.is-editing {
  align-self: stretch;
  max-width: 100%;
}

.msg-edit {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 18px;
  background: var(--user-bubble);
  box-shadow: 0 0 0 1px var(--line);
}

.msg-edit-box {
  width: 100%;
  min-height: 24px;
  padding: 2px 4px;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.96875rem;
  line-height: 1.6;
  resize: none;
}

.msg-edit-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

/* The answer: plain text across the column, in the reading font. */
[data-chat-style="claude"] .msg-ai {
  align-self: stretch;
  justify-items: stretch;
  max-width: 100%;
}

[data-chat-style="claude"] .msg-ai .msg-body {
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  font-family: var(--reply-font);
  font-size: 1.03125rem;
  line-height: 1.72;
}

[data-chat-style="claude"] .msg-ai .msg-body :is(.md-code, .msg-act, .msg-ask, .msg-steps, .msg-thinking, .msg-draft, .msg-tool, .msg-group, .msg-plan, .artifact-card) {
  font-family: var(--font-sans);
}

[data-chat-style="claude"] .msg-ai .msg-body :is(pre, code, .md-code pre, .md-code code) {
  font-family: var(--font-mono);
}

[data-chat-style="claude"] .msg-ai[data-status="error"] .msg-body {
  font-family: var(--font-sans);
}

/* Its buttons: shown on the newest answer, and on others when pointed at. */
[data-chat-style="claude"] .msg-ai .msg-foot {
  min-height: 30px;
  margin-top: 10px;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

[data-chat-style="claude"] .msg-ai:not(.is-newest) .msg-foot {
  opacity: 0;
  transition: opacity 160ms ease;
}

[data-chat-style="claude"] .msg-ai:not(.is-newest):is(:hover, :focus-within) .msg-foot {
  opacity: 1;
}

/* The star from the logo: it turns while the answer is written. */
.msg-mark {
  flex: none;
  width: 18px;
  height: 18px;
  margin-right: 2px;
  color: var(--accent);
  overflow: visible;
}

.msg-mark.is-live {
  animation: mark-turn 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}

@keyframes mark-turn {
  0% {
    transform: rotate(0deg) scale(1);
  }

  50% {
    transform: rotate(90deg) scale(0.82);
  }

  100% {
    transform: rotate(180deg) scale(1);
  }
}

[data-motion="reduced"] .msg-mark.is-live {
  animation: mark-pulse 1.8s ease-in-out infinite;
}

@keyframes mark-pulse {
  50% {
    opacity: 0.4;
  }
}

/* Under the box: a reminder, as in Claude. */
.composer-note {
  display: none;
  margin: 6px auto 0;
  font-size: 0.6875rem;
  line-height: 1.4;
  color: var(--text-2);
  text-align: center;
}

[data-chat-style="claude"] .page-home.has-thread .composer-note {
  display: block;
}

/* New chat greets you by name beside the logo's star, in the reading font. */
[data-chat-style="claude"][data-mode="chat"] .page-home:not(.has-thread) .home-title {
  font-family: var(--reply-font);
  font-size: 2.25rem;
  font-weight: 400;
  letter-spacing: -0.01em;
}

/* Work's greeting has the star too (Dec 2026, the owner's choice). */
[data-chat-style="claude"][data-mode="chat"] .page-home:not(.has-thread) .home-title::before,
[data-mode="work"] .page-home:not(.has-thread) .home-title::before {
  content: "";
  display: inline-block;
  width: 0.8em;
  height: 0.8em;
  margin-right: 0.34em;
  vertical-align: -0.06em;
  background: var(--accent);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 468 467'%3E%3Cpath fill-rule='evenodd' d='M190 0h88A190 190 0 0 0 468 190v88A190 190 0 0 0 278 467h-88A190 190 0 0 0 0 278v-88A190 190 0 0 0 190 0ZM234 142.5Q267 201.5 326 234.5Q267 267.5 234 326.5Q201 267.5 142 234.5Q201 201.5 234 142.5Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---- The chat's title, top left, and its menu (conversation.js) ------------ */

.chat-head {
  position: absolute;
  top: 14px;
  left: 18px;
  z-index: 4;
  /* --title-room: up to the mode pill, measured by conversation.js. */
  max-width: var(--title-room, calc(50% - 172px));
  -webkit-app-region: no-drag;
}

.chat-head[hidden] {
  display: none;
}

.chat-head-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 32px;
  padding: 0 8px 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 550;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.chat-head-title:hover:not(:disabled),
.chat-head-title[aria-expanded="true"] {
  background: var(--hover);
}

.chat-head-title:disabled {
  cursor: default;
}

.chat-head-title:disabled > svg:last-child {
  display: none;
}

.chat-head-title:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.chat-head-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-head-title > svg {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--text-2);
}

.chat-head-title > .chat-head-star {
  display: none;
  color: var(--text-2);
}

.chat-head-title.is-starred > .chat-head-star {
  display: block;
}

.chat-head-input {
  width: min(380px, 40vw);
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--focus);
  border-radius: 10px;
  outline: 0;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}

.chat-menu,
.recent-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 8;
  display: grid;
  min-width: 200px;
  padding: 6px;
  border-radius: 14px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.28);
  color: var(--text);
  animation: model-pop-in 200ms var(--ease-out) both;
  -webkit-app-region: no-drag;
}

.recent-menu {
  position: fixed;
  top: 0;
  z-index: 40;
  min-width: 180px;
}

.chat-menu[hidden],
.recent-menu[hidden] {
  display: none;
}

.chat-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.chat-menu-item:hover,
.chat-menu-item:focus-visible {
  outline: 0;
  background: var(--hover);
}

.chat-menu-item[data-tone="bad"] {
  color: var(--bad);
}

.chat-menu-item svg {
  flex: none;
  width: 15px;
  height: 15px;
}

/* The account switcher (accounts.js): beside your picture, bottom left. */
.chat-menu.account-menu {
  position: fixed;
  top: auto;
  z-index: 60;
  min-width: 264px;
  max-width: min(340px, calc(100vw - 24px));
  transform-origin: bottom left;
}

.account-menu[aria-busy="true"] {
  cursor: progress;
}

.account-menu-label {
  margin: 4px 10px 6px;
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 500;
}

.chat-menu-item.account-menu-person {
  height: auto;
  min-height: 46px;
  padding: 6px 10px;
}

.account-menu-avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  overflow: hidden;
  border-radius: 50%;
  background: var(--hover);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.account-menu-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-menu-text {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 1px;
}

.account-menu-name,
.account-menu-meta {
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-menu-name {
  font-weight: 600;
}

.account-menu-meta {
  color: var(--text-2);
  font-size: 0.75rem;
}

.chat-menu-item .account-menu-tick svg {
  width: 16px;
  height: 16px;
  color: var(--text);
}

.account-menu-line {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

/* ---- The sidebar, as in Claude: Starred, then Recents (history.js) --------- */

.rail-recents[aria-labelledby="recents-title"] {
  display: none !important;
}

.recents-list .recent {
  position: relative;
  display: flex;
  align-items: center;
  height: auto;
  min-height: 32px;
  padding: 0;
  overflow: visible;
  cursor: default;
}

.recent-open {
  display: grid;
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  border: 0;
  border-radius: inherit;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}

.recent-open:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: -1px;
}

.recent-title,
.recent-folder {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-folder {
  font-size: 0.6875rem;
  color: color-mix(in srgb, var(--icon) 55%, transparent);
}

.recent-more {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-right: 4px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  color: inherit;
  opacity: 0;
  cursor: pointer;
}

.recent-more svg {
  width: 14px;
  height: 14px;
}

.recent:hover .recent-more,
.recent.has-menu .recent-more,
.recent-more:focus-visible {
  opacity: 1;
}

.recent-more:hover {
  background: var(--hover);
}

.recent.has-menu {
  background: var(--hover);
}

.recents-label {
  margin: 10px 0 2px;
  padding: 0 8px;
  font-size: 0.6875rem;
  font-weight: 600;
  color: color-mix(in srgb, var(--icon) 55%, transparent);
  white-space: nowrap;
}

.recents-label:first-child {
  margin-top: 0;
}

.recent.is-renaming {
  padding: 2px;
}

.recent-rename {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--focus);
  border-radius: 8px;
  outline: 0;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
}

/* ---- Work steps, as Claude Code shows them (conversation.js) ---------------
   One quiet row per step: a tick, spinner or cross, what it did, to which
   file or command, and its counts. Opened, it shows the changed lines or
   what the command printed. Then the to-do list and the files changed. */

:root {
  --add: #3fb950;
  --del: #f85149;
  --add-bg: rgba(63, 185, 80, 0.14);
  --del-bg: rgba(248, 81, 73, 0.14);
}

[data-theme="light"] {
  --add: #1a7f37;
  --del: #cf222e;
  --add-bg: rgba(26, 127, 55, 0.1);
  --del-bg: rgba(207, 34, 46, 0.09);
}

.msg-tool {
  margin: 6px 0;
  border-radius: 12px;
  font-family: var(--font-sans);
}

.msg-tool + .msg-tool {
  margin-top: -2px;
}

.msg-tool-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 4px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.msg-tool-head:disabled {
  cursor: default;
}

.msg-tool-head:not(:disabled):hover {
  background: var(--hover);
}

.msg-tool-head:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.msg-tool-head > svg {
  flex: none;
  width: 14px;
  height: 14px;
  margin-left: auto;
  transition: transform 180ms var(--ease-out);
}

.msg-tool-head[aria-expanded="true"] > svg {
  transform: rotate(90deg);
}

.tool-state {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--add) 18%, transparent);
  color: var(--add);
}

.tool-state svg {
  width: 11px;
  height: 11px;
  stroke-width: 3;
}

.msg-tool[data-state="failed"] .tool-state {
  background: color-mix(in srgb, var(--del) 18%, transparent);
  color: var(--del);
}

.msg-tool[data-state="denied"] .tool-state {
  background: var(--control);
  color: var(--text-2);
}

.tool-spin {
  flex: none;
  width: 14px;
  height: 14px;
  margin: 1px;
  border: 2px solid var(--track);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: tool-spin 800ms linear infinite;
}

@keyframes tool-spin {
  to {
    transform: rotate(360deg);
  }
}

[data-motion="reduced"] .tool-spin {
  animation-duration: 2.4s;
}

.msg-tool-verb {
  flex: none;
  color: var(--text);
  font-weight: 600;
}

.msg-tool-target {
  min-width: 0;
  overflow: hidden;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--control);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-tool-stats {
  display: inline-flex;
  flex: none;
  gap: 6px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.msg-tool-note {
  flex: none;
  font-size: 0.75rem;
}

.tool-add {
  color: var(--add);
  font-weight: 600;
}

.tool-del {
  color: var(--del);
  font-weight: 600;
}

.msg-tool-body {
  margin: 4px 0 8px 32px;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line);
  background: color-mix(in srgb, var(--control) 60%, transparent);
}

/* Changed lines: numbers, a sign, the line; green added, red taken out. */
.diff {
  max-height: 380px;
  overflow: auto;
  padding: 6px 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.diff-row {
  display: grid;
  grid-template-columns: 4ch 2ch minmax(0, 1fr);
  min-width: max-content;
  padding-right: 12px;
}

.diff-no {
  padding-right: 8px;
  color: var(--text-2);
  text-align: right;
  user-select: none;
  opacity: 0.7;
}

.diff-sign {
  color: var(--text-2);
  user-select: none;
}

.diff-text {
  white-space: pre;
}

.diff-row[data-t="add"] {
  background: var(--add-bg);
}

.diff-row[data-t="add"] .diff-sign {
  color: var(--add);
}

.diff-row[data-t="del"] {
  background: var(--del-bg);
}

.diff-row[data-t="del"] .diff-sign {
  color: var(--del);
}

.diff-row[data-t="gap"] {
  color: var(--text-2);
  font-family: var(--font-sans);
  font-style: italic;
}

.tool-output {
  max-height: 280px;
  margin: 0;
  overflow: auto;
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  scrollbar-width: thin;
}

/* A page Axon opened or looked at (its own browser): a small picture on the
   row, and opened, a bigger one with the page's title and address. */
.msg-tool-shot {
  flex: none;
  width: 46px;
  height: 29px;
  margin-left: auto;
  border-radius: 5px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
  object-fit: cover;
  object-position: top center;
}

.msg-tool-head > .msg-tool-shot + svg {
  margin-left: 0;
}

.tool-page {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 10px;
}

.tool-page-shot {
  display: block;
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}

.tool-page-caption {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
}

.tool-page-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.tool-page-title {
  overflow: hidden;
  color: var(--text);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-page-url,
.tool-page-where {
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-page-caption .link-button {
  flex: none;
  font-size: 0.75rem;
}

/* The to-do list. */
.msg-plan {
  margin: 4px 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--control) 70%, transparent);
  box-shadow: 0 0 0 1px var(--line);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
}

.msg-plan-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 8px;
  font-weight: 650;
}

.msg-plan-count {
  color: var(--text-2);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.msg-plan-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.msg-plan-list li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.45;
}

.msg-plan-box {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--track);
}

.msg-plan-box svg {
  width: 11px;
  height: 11px;
  stroke-width: 3;
}

.msg-plan-list li[data-status="completed"] .msg-plan-box {
  background: var(--text);
  box-shadow: none;
  color: var(--sheet-solid);
}

.msg-plan-list li[data-status="completed"] .msg-plan-text {
  color: var(--text-2);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--text-2) 60%, transparent);
}

.msg-plan-list li[data-status="in_progress"] .msg-plan-box {
  box-shadow: inset 0 0 0 1.5px var(--text);
  color: var(--text);
}

.msg-plan-list li[data-status="in_progress"] .msg-plan-text {
  font-weight: 600;
}

.msg-plan-box.is-live svg {
  animation: tool-spin 1.2s linear infinite;
}

/* The files the answer changed. */
.msg-changes {
  display: grid;
  gap: 2px;
  margin: 14px 0 4px;
  padding: 8px;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
}

.msg-changes-head {
  margin: 2px 6px 4px;
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.msg-change {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.msg-change:hover {
  background: var(--hover);
}

.msg-change-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-change-new {
  padding: 1px 6px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--add) 16%, transparent);
  color: var(--add);
  font-size: 0.6875rem;
  font-weight: 600;
}

/* Plan mode's question at the end of a plan. */
.msg-plan-go {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  font-family: var(--font-sans);
  font-size: 0.875rem;
}

.msg-plan-go p {
  margin: 0;
  font-weight: 600;
}

.msg-plan-go-buttons {
  display: flex;
  gap: 6px;
}

/* ---- Artifacts: a page or picture built in Chat, beside it (conversation.js) */

.artifact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(420px, 100%);
  margin: 10px 0 14px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(0, 0, 0, 0.06);
  color: var(--text);
  font: inherit;
  font-family: var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: box-shadow 160ms ease, transform 160ms var(--ease-out);
}

.artifact-card:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 22%, transparent), 0 8px 22px rgba(0, 0, 0, 0.1);
}

.artifact-card:active {
  transform: scale(0.99);
}

.artifact-card:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.artifact-card.is-open {
  box-shadow: 0 0 0 1.5px var(--accent);
}

.artifact-card-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--control);
}

.artifact-card-icon svg {
  width: 20px;
  height: 20px;
}

.artifact-card-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.artifact-card-title {
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-card-sub {
  color: var(--text-2);
  font-size: 0.75rem;
}

.artifact-card-open {
  flex: none;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--control);
  font-size: 0.75rem;
  font-weight: 600;
}

/* The panel takes the right of the glass; the chat moves over to make room. */
.artifact {
  position: absolute;
  top: 60px;
  right: 14px;
  bottom: 14px;
  z-index: 5;
  display: flex;
  flex-direction: column;
  width: min(50%, 760px);
  overflow: hidden;
  border-radius: 16px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.16);
  color: var(--text);
  animation: artifact-in 260ms var(--ease-out) both;
  -webkit-app-region: no-drag;
}

@keyframes artifact-in {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
}

[data-motion="reduced"] .artifact {
  animation-name: fade-in;
}

.artifact[hidden] {
  display: none;
}

[data-chat-style] .page-home.has-thread.has-artifact {
  padding-right: calc(min(50%, 760px) + 26px);
}

.page-home.has-artifact .chat-head {
  max-width: var(--title-room, calc(50% - 172px));
}

.artifact-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 8px 8px 8px 16px;
  border-bottom: 1px solid var(--line);
}

.artifact-name {
  display: grid;
  flex: 1;
  min-width: 0;
}

.artifact-title {
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-kind {
  color: var(--text-2);
  font-size: 0.6875rem;
}

.artifact-tabs {
  display: flex;
  flex: none;
  padding: 3px;
  border-radius: 10px;
  background: var(--control);
}

.artifact-tabs button {
  height: 26px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.artifact-tabs button[aria-selected="true"] {
  background: var(--sheet-solid);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  color: var(--text);
}

.artifact-tabs button:disabled {
  opacity: 0.45;
  cursor: default;
}

.artifact-actions {
  display: flex;
  flex: none;
  gap: 2px;
}

.artifact-action {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
}

.artifact-action:hover {
  background: var(--hover);
  color: var(--text);
}

.artifact-action:focus-visible,
.artifact-tabs button:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.artifact-action svg {
  width: 17px;
  height: 17px;
}

.artifact-body {
  position: relative;
  flex: 1;
  min-height: 0;
}

/* The page shows on white, as it would in a browser. */
.artifact-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

.artifact-frame[hidden],
.artifact-code[hidden] {
  display: none;
}

.artifact-code {
  height: 100%;
  margin: 0;
  overflow: auto;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  user-select: text;
}

/* ---- Chat background "Wallpaper" with Claude style: what you read sits on
   glass, so it stays clear over any picture or video. */
[data-chat-style="claude"][data-chat-bg="wallpaper"] .msg-ai {
  justify-items: start;
}

[data-chat-style="claude"][data-chat-bg="wallpaper"] .msg-ai.msg-work {
  justify-items: stretch;
}

[data-chat-style="claude"][data-chat-bg="wallpaper"] .msg-ai .msg-body {
  padding: 14px 18px;
  border-radius: 20px;
  background: var(--sheet);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line);
}

[data-chat-style="claude"][data-chat-bg="wallpaper"] .msg-ai[data-status="error"] .msg-body {
  padding: 0;
  background: none;
  backdrop-filter: none;
  box-shadow: none;
}

[data-chat-style="claude"][data-chat-bg="wallpaper"] .msg-bubble {
  background: var(--sheet);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line);
}

[data-chat-style="claude"][data-chat-bg="wallpaper"] .msg-ai .msg-foot,
[data-chat-bg="wallpaper"] .msg-user-foot {
  width: max-content;
  padding: 0 8px;
  border-radius: 14px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line);
}

[data-chat-bg="wallpaper"] .chat-head-title {
  background: var(--sheet);
  backdrop-filter: blur(24px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line);
}

[data-chat-bg="wallpaper"] .page-home.has-thread .composer-note {
  width: max-content;
  max-width: 100%;
  padding: 2px 10px;
  border-radius: 10px;
  background: var(--sheet);
}

/* ---- My API: letter badges, Other's popular services, what pasted code gave */
span.key-logo.key-letters {
  display: grid;
  place-items: center;
  border-radius: 5px;
  background: var(--text);
  color: var(--sheet-solid);
  font-family: var(--font-sans);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
  mask: none;
  -webkit-mask: none;
}

.key-logo.key-letters[data-letters="nvidia"] {
  background: #76b900;
  color: #fff;
}

.key-logo.key-letters[data-letters="groq"] {
  background: #f55036;
  color: #fff;
}

.key-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.key-presets[hidden],
.key-found[hidden] {
  display: none;
}

.key-presets-label {
  margin-right: 2px;
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.key-preset {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 14px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.key-preset:hover {
  background: var(--hover);
}

.key-preset:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.key-found {
  margin: 6px 0 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  color: var(--text);
}

/* A key at its limit: buttons to use another one. */
.msg-problem-actions {
  flex-wrap: wrap;
}

.msg-problem-key {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.msg-problem-key-logo {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
}

.msg-problem-key-logo .key-logo {
  width: 15px;
  height: 15px;
}

/* ---- Attachments: files going with a message (attachments.js) ------------- */

.composer.is-tall.has-files {
  grid-template-areas:
    "files files"
    "goal goal"
    "details details"
    "lead tools";
}

.composer-files {
  grid-area: files;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 2px 4px 0;
}

.composer-files[hidden] {
  display: none;
}

.attach-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 240px;
  height: 56px;
  padding: 6px 30px 6px 6px;
  border-radius: 14px;
  background: var(--control);
  box-shadow: 0 0 0 1px var(--line);
  animation: msg-in 220ms var(--ease-out) both;
}

.attach-chip.is-adding {
  opacity: 0.8;
}

.attach-thumb,
.attach-icon {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 9px;
}

.attach-thumb {
  object-fit: cover;
  background: var(--line);
}

.attach-icon,
.msg-upload-icon {
  display: grid;
  place-items: center;
  background: var(--sheet-solid);
  color: var(--text-2);
}

.attach-icon svg {
  width: 22px;
  height: 22px;
}

[data-kind="pdf"] > :is(.attach-icon, .msg-upload-icon) {
  color: #e5484d;
}

[data-kind="doc"] > :is(.attach-icon, .msg-upload-icon) {
  color: #3e63dd;
}

[data-kind="video"] > :is(.attach-icon, .msg-upload-icon) {
  color: #8e4ec6;
}

[data-kind="audio"] > :is(.attach-icon, .msg-upload-icon) {
  color: #12a594;
}

.attach-text,
.msg-upload-text {
  display: grid;
  min-width: 0;
}

.attach-name,
.msg-upload-name {
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-meta,
.msg-upload-kind {
  color: var(--text-2);
  font-size: 0.6875rem;
}

.attach-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text-2);
  cursor: pointer;
}

.attach-remove:hover {
  color: var(--text);
}

.attach-remove:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.attach-remove svg {
  width: 12px;
  height: 12px;
}

/* The "+" menu: from this PC, or from your library. */
.composer-lead {
  position: relative;
}

.attach-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  z-index: 9;
  display: grid;
  width: 290px;
  padding: 6px;
  border-radius: 14px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.28);
  color: var(--text);
  animation: model-pop-in 200ms var(--ease-out) both;
}

.attach-menu[hidden] {
  display: none;
}

.attach-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.attach-menu-item:hover,
.attach-menu-item:focus-visible {
  outline: 0;
  background: var(--hover);
}

.attach-menu-item svg {
  flex: none;
  width: 17px;
  height: 17px;
}

.attach-menu-note {
  margin: 4px 10px 6px;
  color: var(--text-2);
  font-size: 0.6875rem;
  line-height: 1.4;
}

/* Dropping files on the page. */
.dropzone {
  position: absolute;
  inset: 10px;
  z-index: 30;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: color-mix(in srgb, var(--sheet-solid) 72%, transparent);
  box-shadow: inset 0 0 0 2px var(--accent);
  pointer-events: none;
  animation: fade-in 140ms ease both;
}

.dropzone[hidden] {
  display: none;
}

.dropzone-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 28px 36px;
  border-radius: 18px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.2);
  text-align: center;
}

.dropzone-card svg {
  width: 32px;
  height: 32px;
}

.dropzone-card p {
  margin: 0;
  font-weight: 650;
}

.dropzone-card span {
  color: var(--text-2);
  font-size: 0.8125rem;
}

/* Files in a message you sent. */
.msg-uploads {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  max-width: 100%;
}

.msg-upload-image {
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: none;
  box-shadow: 0 0 0 1px var(--line);
  cursor: zoom-in;
}

.msg-upload-image:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.msg-upload-image img {
  display: block;
  max-width: 280px;
  max-height: 220px;
  object-fit: cover;
}

.msg-upload {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 260px;
  padding: 8px 12px 8px 8px;
  border-radius: 14px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line);
}

.msg-upload-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 9px;
}

.msg-upload-icon svg {
  width: 20px;
  height: 20px;
}

.msg-upload-still {
  position: relative;
  flex: none;
  overflow: hidden;
  width: 60px;
  height: 40px;
  border-radius: 8px;
  background: #000;
}

.msg-upload-still img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* A play mark over a video's first frame. */
.msg-upload-still::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-left: 11px solid #fff;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6));
  transform: translate(-40%, -50%);
}

/* A picture shown big. */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 40px;
  background: rgba(0, 0, 0, 0.72);
  cursor: zoom-out;
  animation: fade-in 160ms ease both;
  -webkit-app-region: no-drag;
}

.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

/* ---- Pictures made in Chat (conversation.js, images.js) ------------------- */
.gen-picture {
  position: relative;
  display: grid;
  gap: 6px;
  width: min(440px, 100%);
  margin: 10px 0 12px;
  font-family: var(--font-sans);
}

.gen-picture.is-waiting,
.gen-picture.is-making {
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 18px;
  background: var(--control);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 0.875rem;
}

/* A soft light drifts across while the picture is made. */
.gen-picture-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent);
  animation: picture-glow 2.6s ease-in-out infinite alternate;
}

@keyframes picture-glow {
  from {
    transform: translate(-18%, -12%);
  }

  to {
    transform: translate(18%, 12%);
  }
}

[data-motion="reduced"] .gen-picture-glow {
  animation: none;
}

.gen-picture.is-making .msg-thinking {
  position: relative;
}

.gen-picture-image {
  display: block;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: var(--control);
  box-shadow: 0 0 0 1px var(--line);
  cursor: zoom-in;
}

.gen-picture-image:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.gen-picture-image img {
  display: block;
  width: 100%;
  height: auto;
  animation: fade-in 320ms ease both;
}

.gen-picture-foot {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  font-size: 0.75rem;
}

.gen-picture-by {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gen-picture.is-failed {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--control);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 0.8125rem;
}

.gen-picture.is-failed p {
  margin: 0 0 8px;
  color: var(--text-2);
}

.gen-picture.is-failed .button {
  justify-self: start;
}

/* A model that wouldn’t run for this key: last in the list, quieter. */
.model-row.is-failed {
  opacity: 0.55;
}

.model-row.is-failed .model-row-kind {
  color: var(--text-2);
}

/* An ordinary window (with a wallpaper): Windows sizes it from its edges and
   rounds its corners, so no page handles and no corners of the page's own. */
[data-native-frame] body {
  background: var(--sheet-solid);
}

[data-native-frame] .shell {
  border-radius: 0;
}

[data-native-frame] .resize-handle {
  display: none;
}

/* Add a key: Paste a key or Paste code, and the code's style tabs. */
.key-switch {
  justify-self: start;
}

.key-switch[hidden],
.key-read[hidden] {
  display: none;
}

.key-switch button {
  min-width: 0;
}

.key-code {
  min-height: 150px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--control);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.55;
  white-space: pre;
  resize: vertical;
  user-select: text;
}

.key-code::placeholder {
  color: var(--text-2);
  opacity: 0.7;
}

.key-code:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

/* What the code gave: Provider, Address, Model, Key. */
.key-read {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 0.8125rem;
}

.key-read-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.key-read dt {
  color: var(--text-2);
}

.key-read dd {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  color: var(--text);
}

.key-read code {
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-read-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
}

.key-read-badge > * {
  width: 100%;
  height: 100%;
}

.key-read-note {
  margin: 0;
}

/* Solid: an ordinary window. The page is an even, opaque surface (the wallpaper,
   if there is one, still shows on top of it). */
:root {
  --solid-page: #1f1e1d;
}

[data-theme="light"] {
  --solid-page: #faf9f5;
}

[data-bg="solid"] .stage {
  background: var(--solid-page);
}

/* Connected tools: a tab for each AI app you added, and its own site below. */
.page-connected {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  place-items: stretch;
  gap: 8px;
  padding: 10px 12px 12px;
  /* The empty part of the bar moves the window. */
  -webkit-app-region: drag;
}

.page-connected[hidden] {
  display: none;
}

.connected-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding-right: 120px;
}

.connected-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.connected-tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 12px 0 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
  -webkit-app-region: no-drag;
}

.connected-tab:hover {
  background: var(--hover);
  color: var(--text);
}

.connected-tab[aria-selected="true"],
.connected-add[aria-pressed="true"] {
  background: var(--control-on);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text);
}

.connected-add {
  padding: 0 10px;
}

.connected-add svg,
.connected-tool svg {
  width: 18px;
  height: 18px;
}

.connected-tools {
  display: flex;
  gap: 2px;
  margin-left: auto;
  -webkit-app-region: no-drag;
}

.connected-tool {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.connected-tool:hover {
  background: var(--hover);
  color: var(--text);
}

.connected-tab:focus-visible,
.connected-tool:focus-visible,
.connected-card:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 2px;
}

.connected-logo {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  overflow: hidden;
  border-radius: 6px;
}

.connected-logo > * {
  width: 100%;
  height: 100%;
}

.connected-letter {
  display: grid;
  place-items: center;
  background: var(--control-on);
  color: var(--text);
  font-size: 0.6875rem;
  font-weight: 700;
}

.connected-body {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 16px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line);
  -webkit-app-region: no-drag;
}

/* Every site you opened stays loaded; only the chosen one shows. */
.connected-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  visibility: hidden;
}

.connected-view.is-shown {
  visibility: visible;
}

.connected-pick {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding: 28px 32px;
  background: var(--sheet-solid);
}

.connected-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.connected-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease;
}

.connected-card:hover {
  background: var(--hover);
  box-shadow: 0 0 0 1px var(--line);
}

.connected-card .connected-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.connected-card-text {
  display: grid;
  min-width: 0;
}

.connected-card-name {
  font-weight: 600;
}

.connected-card-note {
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connected-foot {
  margin-top: 14px;
}

/* An app you're signed in to, on the Chat page in place of Axonbyok's chat. */
.chat-tool {
  position: absolute;
  inset: 58px 14px 14px;
  z-index: 3;
  overflow: hidden;
  border-radius: 16px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line);
}

.chat-tool[hidden],
.tool-head[hidden],
:is([data-mode="work"], [data-mode="code"]) .chat-tool,
:is([data-mode="work"], [data-mode="code"]) .tool-head {
  display: none;
}

[data-mode="chat"] .page-home.has-tool .home,
[data-mode="chat"] .page-home.has-tool .chat-head {
  visibility: hidden;
}

.tool-head {
  position: absolute;
  top: 14px;
  left: 18px;
  z-index: 4;
  -webkit-app-region: no-drag;
}

.tool-head-title {
  gap: 8px;
}

.tool-head-note {
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 500;
}

.tool-menu {
  min-width: 230px;
}

.tool-menu-title {
  margin: 4px 10px 6px;
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tool-menu-label {
  flex: 1;
}

.tool-menu .connected-logo {
  width: 16px;
  height: 16px;
  border-radius: 4px;
}

.tool-menu-line {
  height: 1px;
  margin: 6px 4px;
  background: var(--line);
}

/* "Your accounts" in the model list. */
.model-accounts {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.model-accounts .model-pop-label {
  margin-bottom: 4px;
}

.model-icon .connected-logo {
  width: 100%;
  height: 100%;
}

/* Your accounts: a CLI not on this PC is quieter; the sites get a small label. */
.model-key.is-missing {
  opacity: 0.6;
}

.model-accounts-sub {
  margin: 8px 10px 2px;
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
}

/* Nothing in a reply is ever wider than the reply. A long line of code, in
   the thinking, an answer, a change or a command's output, scrolls inside its
   own box. Boxes that fit their content (the steps and thinking, the Chats
   preview) get columns that can't grow past the reply, and nothing in them
   may be wider than that column. */
.msg-steps,
.transcript,
.transcript-msg {
  grid-template-columns: minmax(0, 1fr);
}

.msg-body > *,
.msg-steps > *,
.transcript-msg > * {
  min-width: 0;
  max-width: 100%;
}

/* ---- Work steps as Claude Code shows them: quiet grey lines that open.
   Steps in a row fold into one line ("Ran 2 commands, read a file"); opened,
   they sit in a box, one line each; a line opens to its command and what it
   printed, or its change. */
.msg-tool,
.msg-group {
  margin: 4px 0;
  font-family: var(--font-sans);
}

.msg-tool + .msg-tool {
  margin-top: 4px;
}

.msg-tool-head,
.msg-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 28px;
  padding: 2px 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: color 140ms ease;
}

.msg-tool-head:not(:disabled):hover,
.msg-group-head:hover {
  background: transparent;
  color: var(--text);
}

.msg-group-head:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.msg-tool-head > svg,
.msg-group-head > svg {
  flex: none;
  width: 13px;
  height: 13px;
  margin-left: 0;
  transition: transform 180ms var(--ease-out);
}

.msg-group-head[aria-expanded="true"] > svg {
  transform: rotate(90deg);
}

.msg-tool-verb {
  flex: none;
  color: inherit;
  font-weight: 500;
}

.msg-tool-said,
.msg-group-text,
.msg-group-now {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-group-text,
.msg-group-now {
  flex: 0 1 auto;
}

.msg-tool-target {
  color: inherit;
}

.msg-tool-note.is-bad {
  color: var(--del);
}

/* Opened: the steps in a box, one line each. */
.msg-group-body {
  margin: 4px 0 8px;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 0 0 1px var(--line);
}

.msg-group-body > .msg-tool {
  margin: 0;
  padding: 2px 12px;
}

.msg-group-body > .msg-tool + .msg-tool {
  border-top: 1px solid var(--line);
}

.msg-tool-body {
  display: grid;
  gap: 6px;
  margin: 4px 0 8px;
  overflow: hidden;
  border-radius: 10px;
  box-shadow: none;
  background: none;
}

.msg-tool-body > .diff,
.msg-tool-body > .tool-output {
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line);
  background: color-mix(in srgb, var(--control) 60%, transparent);
}

/* The command, as Claude Code shows it: "$ npm install". */
.tool-command {
  max-height: 160px;
  margin: 0;
  overflow: auto;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--control);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* ---- The sidebar's sections, as in Claude: a quiet name with a fold arrow
   (Pinned, your groups, Recents or each project), its rows below. */
.side-section + .side-section {
  margin-top: 10px;
}

.side-head {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 26px;
}

.side-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 2px 8px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: color-mix(in srgb, var(--icon) 55%, transparent);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.side-toggle:hover {
  color: var(--icon);
}

.side-toggle:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: -1px;
}

.side-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-toggle svg {
  flex: none;
  width: 12px;
  height: 12px;
  transition: transform 180ms var(--ease-out);
}

.side-section.is-shut .side-toggle svg {
  transform: rotate(-90deg);
}

.side-more {
  margin-left: auto;
}

.side-head:hover .side-more,
.side-head.has-menu .side-more {
  opacity: 1;
}

/* Pinned rows wear what they are: a chat, or a Work session's </>. */
.recent-open:has(.recent-icon) {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  color: color-mix(in srgb, var(--icon) 70%, transparent);
}

.recent-icon svg {
  width: 15px;
  height: 15px;
}

/* The row menu's typed names: a new group, or a group's new name. */
.menu-new {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
}

.menu-new svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--text-2);
}

.menu-field {
  flex: 1;
  min-width: 0;
}

/* ---- Create images and Create videos: chips and sample cards above, the box
   at the bottom, what you made on top. */
.page-create {
  container-type: inline-size;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: stretch;
  padding: 0;
  -webkit-app-region: drag;
}

.page-create[hidden] {
  display: none;
}

.create-scroll {
  min-height: 0;
  overflow: auto;
  padding: 64px 24px 16px;
  scrollbar-width: thin;
  -webkit-app-region: no-drag;
}

.create-scroll > * {
  max-width: 800px;
  margin-inline: auto;
}

.create-chips {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.create-chip-tab {
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 18px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.create-chip-tab:hover {
  background: var(--hover);
}

.create-chip-tab[aria-selected="true"] {
  background: var(--text);
  color: var(--sheet-solid);
}

.create-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 12px;
}

.create-grid.is-video {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@container (max-width: 640px) {
  .create-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.create-card {
  position: relative;
  aspect-ratio: 6 / 5;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--control);
  cursor: pointer;
  transition: transform 180ms var(--ease-out), box-shadow 180ms ease;
}

.create-grid.is-video .create-card {
  aspect-ratio: 16 / 10;
}

.create-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.create-card:focus-visible,
.create-card.is-picked {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}

.create-card-art {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, color-mix(in srgb, var(--text) 10%, transparent), color-mix(in srgb, var(--text) 22%, transparent));
}

.create-card-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: fade-in 400ms ease both;
}

.create-card-label {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 26px 14px 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.62), transparent);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

/* What you made. */
.create-mine[hidden] {
  display: none;
}

.create-mine {
  margin-bottom: 26px;
}

.create-title {
  margin: 0 0 10px;
  font-size: 0.9375rem;
  font-weight: 600;
}

.create-made {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.create-item {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  border-radius: 18px;
  background: var(--control);
  cursor: zoom-in;
}

.create-item[data-shape="16:9"] { aspect-ratio: 16 / 9; }
.create-item[data-shape="9:16"] { aspect-ratio: 9 / 16; }
.create-item[data-shape="4:3"] { aspect-ratio: 4 / 3; }
.create-item[data-shape="3:4"] { aspect-ratio: 3 / 4; }

/* Tall ones keep to the height of a row. */
.create-made .create-item:is([data-shape="9:16"], [data-shape="3:4"]) {
  justify-self: start;
  width: auto;
  height: 300px;
}

.create-item img,
.create-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.create-item-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 18px 8px 6px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), transparent);
  color: #fff;
  opacity: 0;
  transition: opacity 160ms ease;
}

.create-item:hover .create-item-bar,
.create-item:focus-within .create-item-bar {
  opacity: 1;
}

.create-item-by {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-act {
  display: grid;
  flex: none;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.create-act:hover {
  background: rgba(255, 255, 255, 0.18);
}

.create-act svg {
  width: 17px;
  height: 17px;
}

/* The box, as in Gemini's: the words, then +, Images or Videos, the maker and
   send; the shape (and a start picture) underneath. */
.create-dock {
  display: grid;
  gap: 8px;
  width: min(760px, calc(100% - 48px));
  margin: 0 auto 18px;
  -webkit-app-region: no-drag;
}

.create-note {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line);
  font-size: 0.8125rem;
}

.create-note[hidden] {
  display: none;
}

.create-note[data-tone="bad"] {
  color: var(--del);
}

.create-box {
  display: grid;
  gap: 6px;
  padding: 14px 14px 10px;
  border-radius: 26px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 12px 32px rgba(0, 0, 0, 0.12);
}

.create-field {
  width: 100%;
  min-height: 28px;
  padding: 2px 6px;
  border: 0;
  outline: 0;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
}

.create-field::placeholder {
  color: var(--text-2);
}

.create-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.create-space {
  flex: 1;
}

.create-plus,
.create-send {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.create-plus:hover {
  background: var(--hover);
}

.create-send {
  background: var(--text);
  color: var(--sheet-solid);
}

.create-send.is-busy {
  background: var(--control-on);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--line);
}

.create-plus svg,
.create-send svg {
  width: 20px;
  height: 20px;
}

.create-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 17px;
  background: var(--control);
  font-size: 0.875rem;
  font-weight: 500;
}

.create-chip svg,
.create-option svg,
.create-pick svg {
  width: 17px;
  height: 17px;
}

.create-pick,
.create-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 17px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  cursor: pointer;
}

.create-pick:hover,
.create-option:hover {
  background: var(--hover);
}

.create-options {
  display: flex;
  gap: 8px;
}

.create-options > .create-option {
  flex: 1;
  justify-content: center;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line);
}

.create-start {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.create-start[hidden] {
  display: none;
}

.create-start img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
}

.create-start .create-act {
  color: var(--text);
}

.create-menu {
  position: fixed;
  z-index: 40;
}

/* Opened big. */
.create-view {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 40px;
  background: rgba(0, 0, 0, 0.78);
  cursor: zoom-out;
  animation: fade-in 160ms ease both;
  -webkit-app-region: no-drag;
}

.create-view img,
.create-view video {
  max-width: min(1100px, 90vw);
  max-height: 78vh;
  border-radius: 14px;
}

.create-view-text {
  max-width: 720px;
  margin: 0;
  color: #fff;
  font-size: 0.875rem;
  text-align: center;
  cursor: text;
}

.create-view-close {
  position: absolute;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.create-view-close svg {
  width: 20px;
  height: 20px;
}

/* ---- The bell: new notices counted; the list drops down beside it. */
.notify-bell {
  position: relative;
}

.notify-count {
  position: absolute;
  top: -3px;
  right: -3px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--del);
  color: #fff;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--sheet-solid);
}

.notify-count[hidden] {
  display: none;
}

.notify-bell.has-new svg {
  animation: bell-ring 900ms var(--ease-out) 1;
  transform-origin: 50% 15%;
}

@keyframes bell-ring {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-12deg); }
  60% { transform: rotate(8deg); }
  80% { transform: rotate(-4deg); }
}

[data-motion="reduced"] .notify-bell.has-new svg {
  animation: none;
}

.notify-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(360px, calc(100vw - 40px));
  max-height: min(460px, 70vh);
  overflow: hidden;
  border-radius: 16px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.22);
  color: var(--text);
  animation: model-pop-in 200ms var(--ease-out) both;
  transform-origin: top right;
  -webkit-app-region: no-drag;
}

.notify-panel[hidden] {
  display: none;
}

.notify-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px 8px;
}

.notify-title {
  font-weight: 600;
}

.notify-list {
  display: grid;
  align-content: start;
  overflow: auto;
  padding: 0 6px 6px;
  scrollbar-width: thin;
}

.notify-item {
  display: flex;
  gap: 10px;
  padding: 9px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.notify-item:hover,
.notify-item:focus-visible {
  outline: 0;
  background: var(--hover);
}

.notify-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--add) 16%, transparent);
  color: var(--add);
}

.notify-item[data-kind="ask"] .notify-icon {
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: var(--text);
}

.notify-item[data-kind="failed"] .notify-icon {
  background: color-mix(in srgb, var(--del) 16%, transparent);
  color: var(--del);
}

.notify-item[data-kind="made"] .notify-icon {
  background: var(--control);
  color: var(--text);
}

.notify-icon svg {
  width: 15px;
  height: 15px;
}

.notify-text {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.notify-item-title {
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notify-item.is-new .notify-item-title::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 6px;
  border-radius: 50%;
  background: var(--del);
  vertical-align: middle;
}

.notify-item-body {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.75rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.notify-item-time {
  color: var(--text-2);
  font-size: 0.6875rem;
}

.notify-empty {
  margin: 0;
  padding: 6px 16px 18px;
  color: var(--text-2);
  font-size: 0.8125rem;
}

/* ---- Create: the two views, the moving video cards, the card being made. */
.create-ideas[hidden],
.create-mine[hidden],
.create-to-mine[hidden] {
  display: none;
}

.create-to-mine {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: -40px 0 14px auto;
  padding: 6px 10px 6px 14px;
  border: 0;
  border-radius: 16px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.create-scroll > .create-ideas > .create-to-mine {
  width: max-content;
}

.create-to-mine:hover {
  background: var(--hover);
}

.create-to-mine svg {
  width: 15px;
  height: 15px;
}

.create-mine-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.create-mine-head .create-title {
  margin: 0;
  font-size: 1.125rem;
}

.create-new {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px 0 10px;
  border: 0;
  border-radius: 17px;
  background: var(--text);
  color: var(--sheet-solid);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

.create-new svg {
  width: 17px;
  height: 17px;
}

/* A video card plays its clip (create.js starts and stops it). */
.create-card-art video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.create-grid.is-image .create-card-art img {
  transition: transform 500ms var(--ease-out);
}

.create-grid.is-image .create-card:hover .create-card-art img {
  transform: scale(1.06);
}

/* Being made: drifting colour (or the blurred preview), a light that sweeps
   across, a turning spark; underneath, on a soft shade, what it is doing, the
   time and the words; a bar that runs along the bottom edge. */
.create-made.is-video {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.create-item.is-making {
  cursor: default;
  background: linear-gradient(135deg, #dfe5fb, #efe2f7 48%, #fbe4d6);
  box-shadow: 0 0 0 1px var(--line);
  isolation: isolate;
}

[data-theme="dark"] .create-item.is-making {
  background: linear-gradient(135deg, #1f2742, #2c2240 48%, #3b2b26);
}

.create-item.is-making.has-preview {
  background: #18181b;
}

.create-making-preview {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  filter: blur(9px) saturate(1.15);
  animation: preview-clear 30s ease-out forwards;
}

@keyframes preview-clear {
  to {
    filter: blur(2px) saturate(1.05);
  }
}

.create-aurora {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.has-preview .create-aurora {
  mix-blend-mode: soft-light;
}

.create-aurora span {
  position: absolute;
  width: 75%;
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.85;
  animation: aurora-drift 9s ease-in-out infinite alternate;
}

.create-aurora span:nth-child(1) {
  top: -25%;
  left: -15%;
  background: #8ea8ff;
}

.create-aurora span:nth-child(2) {
  right: -20%;
  bottom: -30%;
  background: #ff9fb8;
  animation-duration: 11s;
  animation-delay: -4s;
}

.create-aurora span:nth-child(3) {
  top: 25%;
  left: 30%;
  width: 50%;
  background: #ffc98a;
  animation-duration: 7s;
  animation-delay: -2s;
}

@keyframes aurora-drift {
  from {
    transform: translate(0, 0) scale(1);
  }

  to {
    transform: translate(16%, 12%) scale(1.25);
  }
}

.create-making-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.38) 50%, transparent 65%);
  transform: translateX(-100%);
  animation: making-shine 2.6s ease-in-out infinite;
}

@keyframes making-shine {
  60%,
  100% {
    transform: translateX(100%);
  }
}

.create-making-spark {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  color: #fff;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
  animation: spark-turn 3.2s ease-in-out infinite;
}

.create-making-spark svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: none;
}

@keyframes spark-turn {
  0% {
    transform: rotate(0) scale(0.85);
  }

  50% {
    transform: rotate(180deg) scale(1.1);
  }

  100% {
    transform: rotate(360deg) scale(0.85);
  }
}

.create-making-foot {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  gap: 2px;
  padding: 26px 14px 13px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.32) 60%, transparent);
  color: #fff;
}

.create-making-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.create-making {
  overflow: hidden;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0 35%, #fff 50%, rgba(255, 255, 255, 0.72) 65% 100%) 0 0 / 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 0.8125rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
  animation: thinking-sheen 1.6s linear infinite;
}

.create-making-time {
  flex: none;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.create-making-prompt {
  overflow: hidden;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.create-making-bar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.2);
}

.create-making-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 35%;
  background: #fff;
  animation: bar-run 1.5s ease-in-out infinite;
}

@keyframes bar-run {
  from {
    transform: translateX(-110%);
  }

  to {
    transform: translateX(300%);
  }
}

[data-motion="reduced"] .create-aurora span,
[data-motion="reduced"] .create-making-spark,
[data-motion="reduced"] .create-making-preview,
[data-motion="reduced"] .create-making-shine {
  animation: none;
}

[data-motion="reduced"] .create-making-shine {
  display: none;
}

.create-credit {
  margin: 18px 0 4px;
  color: var(--text-2);
  font-size: 0.75rem;
  text-align: center;
}

/* My API: renaming a key in place. */
.detail-title.is-renamable {
  cursor: text;
}

.rename-field {
  min-width: 0;
  width: min(320px, 100%);
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 0 0 4px color-mix(in srgb, var(--text) 8%, transparent);
  color: var(--text);
  font: inherit;
  font-size: 1.25rem;
  font-weight: 600;
  outline: none;
}

/* Connected tools: Google's sign-in can't work inside the app; what works instead. */
.connected-block {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--sheet-solid) 86%, transparent);
  backdrop-filter: blur(6px);
}

.connected-block[hidden] {
  display: none;
}

.connected-block-card {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(440px, 100%);
  padding: 28px 28px 22px;
  border-radius: 20px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.16);
  text-align: center;
}

.connected-block-card .connected-logo {
  width: 40px;
  height: 40px;
}

.connected-block-title {
  margin: 4px 0 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.connected-block-text,
.connected-block-note {
  margin: 0;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.connected-block-note {
  font-size: 0.8125rem;
}

.connected-block-actions {
  display: grid;
  gap: 8px;
  width: 100%;
  margin: 6px 0 2px;
}

.connected-block-actions .button {
  width: 100%;
  justify-content: center;
}

.connected-block-try {
  margin-top: 2px;
  font-size: 0.8125rem;
}

.connected-block-close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.connected-block-close:hover {
  background: var(--hover);
  color: var(--text);
}

.connected-block-close svg {
  width: 16px;
  height: 16px;
}

/* My API: what the pasted key says (who it is from, or a choice). */
.key-guess {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 2px;
}

.key-guess[hidden] {
  display: none;
}

.key-guess-text {
  color: var(--text-2);
  font-size: 0.8125rem;
}

.key-guess-text.is-unknown {
  color: var(--text);
}

.key-guess-picks {
  display: inline-flex;
  gap: 6px;
}

.key-guess-pick {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px 0 4px;
  border: 0;
  border-radius: 15px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
}

.key-guess-pick .key-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.key-guess-pick .key-logo {
  width: 14px;
  height: 14px;
}

.key-guess-pick[aria-pressed="true"] {
  box-shadow: 0 0 0 1.5px var(--text);
}

/* ---- Work stats: a card on Work's empty home, top right. The grid uses one
   blue in four steps (checked: light #86b6ef to #184f95; dark, more is
   lighter, #184f95 to #86b6ef); empty days are grey. */
.work-stats {
  --ws-0: color-mix(in srgb, var(--text) 8%, transparent);
  --ws-1: #86b6ef;
  --ws-2: #5598e7;
  --ws-3: #2a78d6;
  --ws-4: #184f95;
  --ws-bar: #2a78d6;
  position: absolute;
  top: 78px;
  right: 22px;
  z-index: 2;
  display: grid;
  gap: 12px;
  width: 404px;
  padding: 12px;
  border-radius: 18px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 18px 50px rgba(0, 0, 0, 0.18);
  color: var(--text);
  -webkit-app-region: no-drag;
}

[data-theme="dark"] .work-stats {
  --ws-1: #184f95;
  --ws-2: #256abf;
  --ws-3: #3987e5;
  --ws-4: #86b6ef;
  --ws-bar: #3987e5;
}

.work-stats[hidden],
.work-stats-tip[hidden] {
  display: none;
}

/* Kept clear of the box on short or narrow windows. */
@media (max-height: 640px), (max-width: 760px) {
  .work-stats {
    display: none;
  }
}

.work-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.work-stats-tabs,
.work-stats-ranges {
  display: flex;
  gap: 2px;
}

.work-stats-tabs button,
.work-stats-ranges button {
  height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
}

.work-stats-tabs button:hover,
.work-stats-ranges button:hover {
  color: var(--text);
}

.work-stats-tabs [aria-selected="true"],
.work-stats-ranges [aria-checked="true"] {
  background: var(--control);
  color: var(--text);
}

.work-stats-body {
  display: grid;
  gap: 12px;
}

.work-stats-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.work-stats-tile {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 8px 10px 9px;
  border-radius: 10px;
  background: var(--control);
}

.work-stats-label {
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-stats-value {
  overflow: hidden;
  font-size: 1.0625rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-stats-grid {
  display: grid;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 3px;
}

.work-stats-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--ws-0);
}

.work-stats-cell[data-level="1"] { background: var(--ws-1); }
.work-stats-cell[data-level="2"] { background: var(--ws-2); }
.work-stats-cell[data-level="3"] { background: var(--ws-3); }
.work-stats-cell[data-level="4"] { background: var(--ws-4); }

.work-stats-cell.is-out {
  opacity: 0.35;
}

.work-stats-cell.is-future {
  background: transparent;
}

.work-stats-cell[data-tip]:hover {
  box-shadow: 0 0 0 1.5px var(--text);
}

.work-stats-note {
  margin: 0;
  color: var(--text-2);
  font-size: 0.8125rem;
}

.work-stats-note.is-empty {
  padding: 18px 4px;
  text-align: center;
}

.work-stats-tip {
  position: absolute;
  z-index: 5;
  padding: 5px 9px;
  border-radius: 8px;
  background: var(--text);
  color: var(--sheet-solid);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  transform: translate(-50%, -100%);
  pointer-events: none;
}

/* One grid for all the rows, so every bar starts and ends in line. */
.work-stats-models {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px 10px;
  font-size: 0.8125rem;
}

.work-stats-model {
  display: contents;
}

.work-stats-model-num {
  text-align: right;
}

.work-stats-letter {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 5px;
  background: var(--control);
  color: var(--text-2);
  font-size: 0.625rem;
  font-weight: 700;
}

.work-stats-model-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.work-stats-model-name > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.work-stats-model-logo {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
}

.work-stats-model-logo .key-logo {
  width: 15px;
  height: 15px;
}

.work-stats-track {
  height: 8px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--ws-0);
}

.work-stats-bar {
  display: block;
  width: var(--w, 0%);
  height: 100%;
  border-radius: 4px;
  background: var(--ws-bar);
}

.work-stats-model-num {
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Drag to arrange (sortable.js): My API's keys and the model list's. */
.row[data-sort-id] {
  position: relative;
}

.row-grip {
  position: absolute;
  top: 50%;
  left: 0;
  display: grid;
  place-items: center;
  width: 10px;
  height: 24px;
  color: var(--text-2);
  opacity: 0;
  transform: translateY(-50%);
  transition: opacity 120ms ease;
  cursor: grab;
}

.row-grip svg {
  width: 10px;
  height: 16px;
  stroke-width: 3.4;
}

.row[data-sort-id]:hover .row-grip,
.row[data-sort-id]:focus-visible .row-grip {
  opacity: 1;
}

.row.is-dragging,
.model-key.is-dragging {
  opacity: 0.45;
}

.is-sorting .row,
.is-sorting .model-key {
  transition: none;
}

/* Messages waiting their turn while a task runs, over the box; and Send now. */
.composer-queue {
  grid-area: queue;
  display: grid;
  gap: 4px;
  margin: -2px 0 6px;
}

/* Queued messages sit at the top of the box, over what you're typing. */
.composer.is-tall.has-queue {
  grid-template-areas:
    "queue queue"
    "goal goal"
    "details details"
    "lead tools";
}

.composer.is-tall.has-queue.has-files {
  grid-template-areas:
    "queue queue"
    "files files"
    "goal goal"
    "details details"
    "lead tools";
}

.composer-queue[hidden],
.send-now[hidden] {
  display: none;
}

.queue-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 3px 4px 3px 10px;
  border-radius: 12px;
  background: var(--control);
  font-size: 0.8125rem;
}

.queue-tag {
  padding: 2px 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--text);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.queue-text {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-now {
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 13px;
  background: var(--text);
  color: var(--sheet-solid);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.queue-remove {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.queue-remove:hover {
  background: var(--hover);
  color: var(--text);
}

.queue-remove svg {
  width: 14px;
  height: 14px;
}

.send-now {
  flex: none;
  height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 17px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}

.send-now:hover {
  background: var(--hover);
}

/* ---- Axonbyok account: the sign-in screen (auth.js, authscene.js) and the
   Account line. The window splits in two: a sky over a meadow on the left,
   where Puff the cloud keeps you company, and the form on the right. */
.auth {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 1fr);
  padding: 12px;
  border-radius: var(--radius-outer);
  overflow: clip;
  background: var(--sheet-solid);
  color: var(--text);
  animation: auth-in 360ms var(--ease-out) both;
  -webkit-app-region: no-drag;
}

.auth[hidden] {
  display: none;
}

@keyframes auth-in {
  from {
    opacity: 0;
  }
}

/* A thin band along the top still moves the window. */
.auth-drag {
  position: absolute;
  inset: 0 0 auto;
  height: 12px;
  -webkit-app-region: drag;
}

.auth-side {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 36px clamp(24px, 5vw, 64px);
  overflow-y: auto;
}

.auth-card {
  display: grid;
  gap: 12px;
  width: min(360px, 100%);
  color: var(--text);
}

/* Axonbyok's mark and name over the form. */
.auth-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  font-size: 0.9375rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.auth-brand .auth-logo {
  width: 30px;
  height: 30px;
  margin: 0;
  border-radius: 9px;
}

.auth-brand .auth-logo svg {
  width: 16px;
  height: 16px;
}

.auth-step {
  margin-left: auto;
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 500;
}

/* ---- The scene: pixel art (authscene.js draws it on one small canvas, a pixel
   per cell, shown scaled up with crisp edges) ---- */
.auth-scene {
  position: relative;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
  border-radius: max(12px, calc(var(--radius-outer) - 12px));
  background: #1d89e5;
}

.auth-scene[data-sky="day"] {
  background: #79b7ee;
}

.auth-scene[data-sky="night"] {
  background: #10184a;
}

.auth-pixels {
  position: absolute;
  left: 0;
  top: 0;
  image-rendering: pixelated;
}

/* The sky switch by the close button: Auto (the PC's clock), Day, Noon, Night. */
.auth-time {
  position: absolute;
  z-index: 1;
  top: 14px;
  right: 54px;
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border-radius: 10px;
  background: var(--control);
}

.auth-time button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}

.auth-time button:hover {
  color: var(--text);
}

.auth-time button[aria-checked="true"] {
  background: var(--control-on);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.auth-time button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.auth-time svg {
  width: 14px;
  height: 14px;
  flex: none;
}

/* ---- What Puff says, in a pixel bubble under it ---- */
.auth-buddy {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.auth-bubble {
  --ink: #1c2433;
  position: absolute;
  left: var(--bubble-x, 50%);
  top: var(--bubble-y, 66%);
  max-width: min(320px, 84%);
  padding: 7px 14px 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.35;
  text-align: center;
  text-wrap: balance;
  transform: translateX(-50%);
  /* A border a pixel thick on each side, with the corners left out. */
  box-shadow:
    0 calc(var(--px, 3px) * -1) 0 var(--ink),
    0 var(--px, 3px) 0 var(--ink),
    calc(var(--px, 3px) * -1) 0 0 var(--ink),
    var(--px, 3px) 0 0 var(--ink);
  transition: opacity 140ms ease;
}

/* Its tail, pointing up at Puff: pixel by pixel. */
.auth-bubble::before {
  content: "";
  position: absolute;
  left: calc(50% - var(--px, 3px) / 2);
  top: 0;
  width: var(--px, 3px);
  height: var(--px, 3px);
  box-shadow:
    0 calc(var(--px, 3px) * -3) 0 var(--ink),
    calc(var(--px, 3px) * -1) calc(var(--px, 3px) * -2) 0 var(--ink),
    0 calc(var(--px, 3px) * -2) 0 #ffffff,
    var(--px, 3px) calc(var(--px, 3px) * -2) 0 var(--ink),
    calc(var(--px, 3px) * -1) calc(var(--px, 3px) * -1) 0 #ffffff,
    0 calc(var(--px, 3px) * -1) 0 #ffffff,
    var(--px, 3px) calc(var(--px, 3px) * -1) 0 #ffffff;
}

.auth-bubble.is-swap {
  opacity: 0;
}

.is-storm .auth-bubble {
  color: #8a1f2b;
}

/* Its words show once it has risen into place. */
.auth-scene.is-in .auth-bubble {
  animation: auth-bubble-in 240ms ease 600ms both;
}

@keyframes auth-bubble-in {
  from {
    opacity: 0;
  }
}

/* Less motion: no fade in (the canvas holds still by itself). */
[data-motion="reduced"] .auth {
  animation: none;
}

[data-motion="reduced"] .auth-scene.is-in .auth-bubble {
  animation: none;
}

[data-motion="reduced"] .auth-bubble {
  transition: none;
}

/* A narrow window or a phone: one column that scrolls as a whole, never a
   small box of its own under the sky. The sky is a band on top that scrolls
   away with the rest, the sky switch sits under it, then the form; the close
   button sits on the sky (below). A short screen (a phone on its side)
   leaves the sky out. */
@media (max-width: 860px) {
  .auth {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-content: start;
    padding:
      max(12px, env(safe-area-inset-top))
      max(12px, env(safe-area-inset-right))
      max(12px, env(safe-area-inset-bottom))
      max(12px, env(safe-area-inset-left));
    overflow: hidden auto;
    overscroll-behavior: contain;
  }

  .auth-scene {
    height: clamp(190px, 38vh, 360px);
    height: clamp(190px, 38svh, 360px);
  }

  .auth-side {
    position: static;
    align-content: start;
    gap: 16px;
    padding: 16px 4px 12px;
    overflow: visible;
  }

  .auth-time {
    position: static;
  }
}

@media (max-width: 860px) and (max-height: 480px) {
  .auth-scene {
    display: none;
  }
}

/* The smallest phones: the check (300px wide) still fits across. */
@media (max-width: 359px) {
  .auth {
    padding-right: max(8px, env(safe-area-inset-right));
    padding-left: max(8px, env(safe-area-inset-left));
  }

  .auth-side {
    padding-inline: 0;
  }

  .auth-card .auth-human[data-view] {
    padding-inline: 0;
  }

  .auth-time button {
    padding: 0 8px 0 6px;
  }
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.auth-close:hover {
  background: var(--hover);
  color: var(--text);
}

/* The website: top left, out of the sky switch's way (auth.js). */
.auth-close.is-left {
  right: auto;
  left: 14px;
}

/* One column (narrow window, phone): on the sky's top left corner, as a
   light disc that reads over any sky. */
@media (max-width: 860px) {
  .auth-close,
  .auth-close.is-left {
    top: calc(max(12px, env(safe-area-inset-top)) + 10px);
    right: auto;
    left: calc(max(12px, env(safe-area-inset-left)) + 10px);
    z-index: 2;
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 1px 4px rgba(16, 24, 48, 0.2);
    color: #1c2433;
  }

  .auth-close:hover,
  .auth-close.is-left:hover {
    background: #ffffff;
    color: #1c2433;
  }
}

.auth-logo {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0 auto 2px;
  border-radius: 13px;
  background: var(--control);
}

.auth-logo svg {
  width: 22px;
  height: 22px;
}

.auth-title {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -0.022em;
}

.auth-sub {
  margin: -4px 0 6px;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.5;
}

.auth-fields {
  display: grid;
  gap: 10px;
}

.auth-field {
  display: grid;
  gap: 5px;
  font-size: 0.8125rem;
  font-weight: 500;
}

.auth-field input {
  height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 11px;
  background: var(--control);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  outline: none;
}

.auth-field input:focus {
  box-shadow: inset 0 0 0 1.5px var(--text);
}

/* The password box: an eye button inside it shows or hides what's typed. */
.auth-password {
  position: relative;
  display: grid;
}

.auth-field .auth-password input {
  padding-right: 46px;
}

.auth-reveal {
  position: absolute;
  top: 50%;
  right: 5px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background-color 140ms ease, color 140ms ease;
}

.auth-reveal:hover {
  background: var(--hover);
  color: var(--text);
}

.auth-reveal:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}

.auth-reveal svg {
  width: 18px;
  height: 18px;
}

.auth-field input.auth-code {
  font-size: 1.375rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.45em;
  text-align: center;
}

.auth-error {
  margin: 0;
  color: var(--del);
  font-size: 0.8125rem;
}

/* The human check (humancheck.js), in the form under the fields. Out of sight
   while Cloudflare decides by itself: still laid out at full size and inside
   the window (fixed to its foot), so it runs at full speed, but invisible and
   out of the way. In place when it wants a click (data-view="ask"), and once
   ticked "You're all set" takes the check's place at the same size
   (data-view="done"), so nothing under it moves. */
.auth-card {
  position: relative;
}

.auth-human {
  position: fixed;
  left: 50%;
  bottom: 0;
  display: grid;
  justify-items: center;
  gap: 8px;
  width: max-content;
  padding: 12px 12px 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--sheet-solid);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%);
}

.auth-human[data-view] {
  position: relative;
  left: auto;
  bottom: auto;
  width: auto;
  margin-top: 2px;
  padding: 11px 8px 8px;
  background: color-mix(in srgb, var(--control) 55%, var(--sheet-solid));
  opacity: 1;
  pointer-events: auto;
  transform: none;
  animation: auth-human-in 220ms var(--ease-out) both;
}

@keyframes auth-human-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* Pressed a button before ticking it: a little shake, and a ring. */
.auth-human[data-view].is-nudge {
  animation: auth-human-nudge 460ms ease;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 16%, transparent);
}

@keyframes auth-human-nudge {
  20% {
    transform: translateX(-7px);
  }

  45% {
    transform: translateX(6px);
  }

  70% {
    transform: translateX(-3px);
  }
}

.auth-human-note {
  margin: 0;
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
}

.auth-human-box {
  position: relative;
  width: 300px;
  height: 70px;
}

.auth-human-frame {
  display: block;
  width: 300px;
  height: 70px;
  border: 0;
  border-radius: 8px;
  background: transparent;
}

/* Ticked: the check's own next round stays out of sight. */
.auth-human-done {
  position: absolute;
  inset: 0 0 5px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 10px;
  background: var(--sheet-solid);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
}

.auth-human-done svg {
  width: 24px;
  height: 24px;
  flex: none;
  fill: var(--ok, #1f7a35);
  stroke: #ffffff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-human-done svg circle {
  stroke: none;
}

.auth-human[data-view="done"] .auth-human-frame {
  visibility: hidden;
}

.auth-human[data-view="done"] .auth-human-done {
  display: flex;
  animation: auth-human-done-in 260ms var(--ease-out) both;
}

@keyframes auth-human-done-in {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
}

/* The desktop app: no check box, the check opens in the browser. While it
   waits, one quiet line under the form says so. */
.auth-human.is-browser {
  display: none;
}

.auth-human.is-browser[data-browser="waiting"] {
  position: relative;
  left: auto;
  bottom: auto;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: auto;
  margin-top: 14px;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
  text-align: center;
  animation: auth-human-in 200ms ease both;
}

.auth-human.is-browser .auth-human-note {
  color: var(--text-2);
  font-weight: 500;
}

.auth-human-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  font-size: 0.8125rem;
}

@media (prefers-reduced-motion: reduce) {
  .auth-human[data-view],
  .auth-human[data-view].is-nudge,
  .auth-human[data-view="done"] .auth-human-done,
  .auth-human.is-browser[data-browser="waiting"] {
    animation: none;
  }
}

.auth-primary,
.auth-secondary {
  width: 100%;
  height: 42px;
  justify-content: center;
}

.auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  font-size: 0.8125rem;
}

/* The countdown until another email can go to an address (auth.js coolBadge):
   a ring that empties and the time left, ticking each second. On the send
   button, a fill behind it empties too; on the code step it sits in the
   "New code in" link. Its animations start where the wait already is
   (--cool-done is negative). */
.auth-cool {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-variant-numeric: tabular-nums;
}

.auth-cool-ring {
  width: 18px;
  height: 18px;
  flex: none;
  transform: rotate(-90deg);
}

.auth-cool-track,
.auth-cool-arc {
  fill: none;
  stroke-width: 2.5;
}

.auth-cool-track {
  stroke: color-mix(in srgb, currentColor 18%, transparent);
}

.auth-cool-arc {
  stroke: currentColor;
  stroke-linecap: round;
  stroke-dasharray: 50.27;
  animation: auth-cool-drain var(--cool-total, 60s) linear var(--cool-done, 0s) both;
}

@keyframes auth-cool-drain {
  from {
    stroke-dashoffset: 0;
  }

  to {
    stroke-dashoffset: 50.27;
  }
}

.auth-cool-num {
  display: inline-block;
  min-width: 2.4em;
  font-weight: 650;
  text-align: left;
}

.auth-cool-num.is-tick {
  animation: auth-cool-tick 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes auth-cool-tick {
  from {
    opacity: 0.35;
    transform: translateY(-4px);
  }
}

/* The send button while it waits: calm rather than greyed out, with a fill
   that empties as the time runs down. */
.auth-primary.is-cooling,
.auth-primary.is-cooling:disabled,
.auth-primary.is-cooling:hover {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--accent) 7%, var(--sheet-solid));
  color: var(--text);
  opacity: 1;
  cursor: default;
}

.auth-primary.is-cooling::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  transform-origin: left center;
  animation: auth-cool-fill var(--cool-total, 60s) linear var(--cool-done, 0s) both;
}

@keyframes auth-cool-fill {
  from {
    transform: scaleX(1);
  }

  to {
    transform: scaleX(0);
  }
}

/* Ready again: one soft glow. */
.auth-primary.is-ready {
  animation: auth-send-ready 900ms ease-out;
}

@keyframes auth-send-ready {
  from {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 40%, transparent);
  }

  to {
    box-shadow: 0 0 0 12px transparent;
  }
}

/* Pressed while it waits: a little shake. */
.auth-cool.is-nudge {
  animation: auth-cool-nudge 380ms ease;
}

@keyframes auth-cool-nudge {
  20% {
    transform: translateX(-4px);
  }

  45% {
    transform: translateX(4px);
  }

  70% {
    transform: translateX(-2px);
  }
}

/* In the code step's links: the same ring, smaller. */
.auth-links .auth-cool {
  gap: 6px;
}

.auth-links .auth-cool-ring {
  width: 14px;
  height: 14px;
}

/* "Got the code? Enter it", under the send button. */
.auth-have-code {
  margin: -2px 0 0;
  color: var(--text-2);
  font-size: 0.8125rem;
  text-align: center;
  animation: auth-human-in 200ms ease both;
}

.auth-have-code[hidden] {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .auth-cool-arc,
  .auth-primary.is-cooling::before,
  .auth-cool-num.is-tick,
  .auth-primary.is-ready,
  .auth-cool.is-nudge,
  .auth-have-code {
    animation: none;
  }
}

.auth-skip {
  justify-self: center;
  color: var(--text-2);
  font-size: 0.8125rem;
}

.auth-note {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 0.75rem;
  text-align: center;
}

.auth-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 0.8125rem;
}

.auth-line[hidden] {
  display: none;
}

.auth-line strong {
  color: var(--text);
  font-weight: 600;
}

.auth-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-2);
  opacity: 0.5;
}

.auth-dot.is-on {
  background: #2ea043;
  opacity: 1;
}

/* ---- Work's start card, as in Claude Code: the project and where commands
   run, in the middle of an empty Work page, and a way back into changes not
   yet committed (workspace.js). */
.work-start {
  position: absolute;
  top: clamp(72px, 19vh, 220px);
  left: 50%;
  z-index: 2;
  display: grid;
  gap: 12px;
  width: min(400px, calc(100% - 48px));
  transform: translateX(-50%);
  -webkit-app-region: no-drag;
}

.work-start[hidden],
.work-start-continue[hidden] {
  display: none;
}

/* Beside the stats card on a narrower window: centred in the room left of it. */
@container (max-width: 1290px) {
  .page-home:has(> .work-stats:not([hidden])) > .work-start {
    left: calc((100% - 426px) / 2);
    width: min(400px, calc(100% - 474px));
  }
}

@media (max-height: 520px) {
  .work-start {
    display: none;
  }
}

.work-start-card,
.work-start-continue {
  border-radius: 16px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 12px 36px rgba(0, 0, 0, 0.12);
}

.work-start-card {
  position: relative;
  z-index: 1;
  display: grid;
}

.work-start-item {
  position: relative;
}

.work-start-item + .work-start-item {
  border-top: 1px solid var(--line);
}

.work-start-row,
.work-start-continue {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out);
}

.work-start-continue {
  border-radius: 16px;
  background: var(--sheet);
}

.work-start-item:first-child .work-start-row {
  border-radius: 16px 16px 0 0;
}

.work-start-item:last-child .work-start-row {
  border-radius: 0 0 16px 16px;
}

.work-start-row:hover,
.work-start-row[aria-expanded="true"] {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.work-start-continue:hover {
  background: color-mix(in srgb, var(--text) 5%, var(--sheet));
}

.work-start-row:focus-visible,
.work-start-continue:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.work-start-row > svg,
.work-start-continue > svg {
  flex: none;
  width: 19px;
  height: 19px;
  color: var(--text-2);
}

.work-start-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* "Choose environment" keeps its arrow beside the words, as in Claude Code. */
.work-start-env .work-start-label,
.work-start-continue .work-start-label {
  flex: none;
  max-width: calc(100% - 64px);
}

.work-start-env.is-unset .work-start-label {
  color: var(--text-2);
}

.work-start-trail,
.work-start-check {
  display: grid;
  flex: none;
}

.work-start-trail svg {
  width: 14px;
  height: 14px;
  color: var(--text-2);
  transition: transform 180ms var(--ease-out);
}

.work-start-row[aria-expanded="true"] .work-start-trail svg {
  transform: rotate(180deg);
}

.work-start-check {
  margin-left: auto;
}

.work-start-check svg {
  width: 17px;
  height: 17px;
  color: var(--text);
  stroke-width: 1.8;
}

.work-start-meta {
  color: var(--text-2);
}

.work-start-menu {
  top: calc(100% + 6px);
}

@media (prefers-reduced-motion: reduce) {
  .work-start-row,
  .work-start-continue,
  .work-start-trail svg {
    transition: none;
  }
}

/* ---- Settings, laid out like Claude's (settingsnav.js): a title bar, the
   sections on the left under a search box, one section on the right. Every
   setting is one row: words on the left, its control on the right. */
.settings-sheet {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  width: min(960px, 100%);
  height: min(720px, 100%);
  padding: 0;
  overflow: hidden;
}

.settings-head {
  grid-column: 1 / -1;
  min-height: 56px;
  padding: 10px 14px 10px 22px;
  border-bottom: 1px solid var(--line);
}

.settings-head h2 {
  font-size: 1rem;
  letter-spacing: -0.011em;
}

.settings-nav {
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 14px 12px;
  overflow: auto;
  border-right: 1px solid var(--line);
  scrollbar-width: thin;
}

.settings-search {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 36px;
  margin-bottom: 10px;
  padding: 0 10px;
  border-radius: 10px;
  background: var(--control);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  cursor: text;
  transition: box-shadow 140ms var(--ease-out);
}

.settings-search:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--focus);
}

.settings-search svg {
  flex: none;
  width: 15px;
  height: 15px;
}

.settings-search input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
}

.settings-search input::placeholder {
  color: var(--text-2);
}

.settings-search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.settings-nav-group {
  display: grid;
  gap: 2px;
}

/* A short line between the groups, as in Claude's list. */
.settings-nav-group + .settings-nav-group::before {
  content: "";
  height: 1px;
  margin: 7px 10px;
  background: var(--line);
}

.settings-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out);
}

.settings-nav-item > svg {
  flex: none;
  width: 19px;
  height: 19px;
}

.settings-nav-item > span:not(.settings-nav-out) {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-nav-item:hover {
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.settings-nav-item[aria-current="page"] {
  background: color-mix(in srgb, var(--text) 9%, transparent);
  font-weight: 500;
}

/* Account, API keys and Usage open their own pages. */
.settings-nav-out {
  display: grid;
  flex: none;
  color: var(--text-2);
  opacity: 0;
  transition: opacity 140ms var(--ease-out);
}

.settings-nav-out svg {
  width: 13px;
  height: 13px;
}

.settings-nav-item:hover .settings-nav-out,
.settings-nav-item:focus-visible .settings-nav-out {
  opacity: 1;
}

.settings-panes {
  position: relative;
  min-height: 0;
  padding: 22px 28px 36px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  scrollbar-gutter: stable;
}

.settings-pane[hidden],
.settings-empty[hidden],
.settings-pane .is-filtered-out {
  display: none;
}

.settings-pane-title {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.4;
  letter-spacing: -0.011em;
  font-weight: 600;
}

/* Searching shows every section that has a match, one under the other. */
.settings-sheet.is-searching .settings-pane + .settings-pane {
  margin-top: 28px;
}

.settings-subhead {
  margin: 30px 0 2px;
  font-size: 0.9375rem;
  line-height: 1.4;
  letter-spacing: -0.009em;
  font-weight: 600;
}

.settings-pane .setting {
  gap: 10px 28px;
  min-height: 66px;
  padding: 14px 0;
}

.settings-pane .setting.is-first {
  border-top-color: transparent;
}

.settings-pane .setting-text {
  flex: 1 1 260px;
  gap: 3px;
}

.settings-pane .setting-label {
  font-size: 0.875rem;
  font-weight: 500;
}

.settings-pane .setting-hint {
  max-width: 62ch;
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* The accent colours sit at the right like any control; your own colour's
   picker opens under the whole row. */
.settings-pane .setting-wide {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
}

.settings-pane .swatches {
  flex: none;
  gap: 8px;
}

.settings-pane .setting-wide .colour-picker {
  flex: 1 0 100%;
  justify-items: end;
  width: 100%;
}

.settings-pane .setting-wide .colour-picker > * {
  width: min(360px, 100%);
}

.settings-pane .spend-control {
  flex-wrap: nowrap;
}

.settings-empty {
  margin: 40px 0 0;
  color: var(--text-2);
  font-size: 0.875rem;
  text-align: center;
}

/* A select: the choice on a button, the choices in a menu under it. */
.select-wrap {
  position: relative;
  flex: none;
}

.select-button {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 176px;
  height: 34px;
  padding: 0 10px 0 12px;
  border: 0;
  border-radius: 9px;
  background: var(--control);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out);
}

.select-button:hover,
.select-button[aria-expanded="true"] {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.select-button svg {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--text-2);
  transition: transform 180ms var(--ease-out);
}

.select-button[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.segmented.is-select {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 5;
  display: grid;
  gap: 1px;
  width: max-content;
  min-width: 100%;
  max-width: 320px;
  padding: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 12px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.22);
  scrollbar-width: thin;
  transform-origin: top right;
  animation: menu-in 180ms var(--ease-out) both;
}

.segmented.is-select.opens-up {
  top: auto;
  bottom: calc(100% + 6px);
  transform-origin: bottom right;
}

.segmented.is-select[hidden],
.segmented.is-select [data-value][hidden] {
  display: none;
}

.segmented.is-select::before {
  display: none;
}

.segmented.is-select button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
  height: 34px;
  padding: 0 10px;
  color: var(--text);
  font-weight: 450;
  text-align: left;
  white-space: nowrap;
}

.segmented.is-select button:hover,
.segmented.is-select button:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.segmented.is-select button svg {
  flex: none;
  width: 14px;
  height: 14px;
  visibility: hidden;
}

.segmented.is-select button[aria-checked="true"] svg {
  visibility: visible;
}

/* A narrow window: the sections become a row along the top. */
@media (max-width: 760px) {
  .settings-sheet {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .settings-nav {
    flex-direction: row;
    align-items: center;
    gap: 2px;
    padding: 8px 10px;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scrollbar-width: none;
  }

  .settings-search {
    flex: 0 0 150px;
    margin: 0 6px 0 0;
  }

  .settings-nav-group {
    display: contents;
  }

  .settings-nav-group + .settings-nav-group::before,
  .settings-nav-out {
    display: none;
  }

  .settings-nav-item {
    flex: none;
    width: auto;
    min-height: 34px;
    gap: 8px;
  }

  .settings-panes {
    padding: 18px 18px 28px;
  }

  .settings-pane .setting {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .settings-nav-item,
  .settings-nav-out,
  .select-button,
  .select-button svg {
    transition: none;
  }

  .segmented.is-select {
    animation: none;
  }
}

/* ---- Notification sounds (sounds.js): a play button beside the choice, and
   the choices grouped Calm, Fun and Other. */
.sound-control {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
}

.sound-preview {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--control);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  cursor: pointer;
  transition: background-color 140ms var(--ease-out), transform 120ms var(--ease-out);
}

.sound-preview svg {
  width: 13px;
  height: 13px;
  margin-left: 2px;
}

.sound-preview:hover:not(:disabled) {
  background: color-mix(in srgb, var(--text) 8%, transparent);
}

.sound-preview:active:not(:disabled) {
  transform: scale(0.94);
}

.sound-preview:disabled {
  color: var(--text-2);
  opacity: 0.5;
  cursor: default;
}

.select-group {
  margin: 6px 10px 2px;
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.select-group:first-child {
  margin-top: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .sound-preview {
    transition: none;
  }
}

/* ---- Minimise, on Work's start card and stats card: a small round button on
   the card's top-right corner; minimised, the card is one pill that opens it
   again (workspace.js, workstats.js). */
.card-min {
  position: absolute;
  top: -9px;
  right: -9px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 2px 8px rgba(0, 0, 0, 0.14);
  color: var(--text-2);
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 140ms var(--ease-out), color 140ms var(--ease-out), transform 120ms var(--ease-out);
  -webkit-app-region: no-drag;
}

.card-min svg {
  width: 13px;
  height: 13px;
}

.card-min:hover,
.card-min:focus-visible {
  color: var(--text);
  opacity: 1;
}

.card-min:active {
  transform: scale(0.92);
}

.card-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  height: 40px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, 0.12);
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 140ms var(--ease-out), transform 120ms var(--ease-out);
  -webkit-app-region: no-drag;
}

.card-pill:hover {
  background: color-mix(in srgb, var(--text) 5%, var(--sheet));
}

.card-pill:active {
  transform: scale(0.98);
}

.card-pill > svg:first-child {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-2);
}

.card-pill > svg:last-child {
  flex: none;
  width: 13px;
  height: 13px;
  color: var(--text-2);
}

.card-pill-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-pill-meta {
  color: var(--text-2);
  font-weight: 400;
}

.card-pill-meta::before {
  content: "·";
  margin-right: 8px;
}

/* The start card, minimised: just the pill, centred where the card was. */
.work-start-pill,
.work-start.is-min .work-start-card,
.work-start.is-min .work-start-continue,
.work-start.is-min .card-min {
  display: none;
}

.work-start.is-min .work-start-pill {
  display: flex;
  justify-self: center;
}

/* The stats card, minimised: the pill alone, in its corner. */
.work-stats.is-min {
  width: auto;
  padding: 0;
  border-radius: 999px;
  background: none;
  backdrop-filter: none;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .card-min,
  .card-pill {
    transition: none;
  }
}

/* ---- MAX CODE ('code' in the switch) is Work with the environment card and
   the stats card (workspace.js, workstats.js). Making pictures and videos
   isn't part of it, so the rail leaves those two out. */
[data-mode="code"] .rail-button:is([data-nav="images"], [data-nav="videos"]) {
  display: none;
}

/* ---- Job, first in Work's folder menus (workspace.js): its briefcase beside
   the name, and a line between it and the folders. */
.work-option-job .work-option-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.work-option-job .work-option-name svg {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.work-option-job + .menu-title {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

/* ---- MAX CODE's Plugins, MCP and Skills (extensions.js). Their rail buttons
   show only in MAX CODE. */
:root:not([data-mode="code"]) .rail-button:is([data-nav="plugins"], [data-nav="mcp"], [data-nav="skills"], [data-nav="terminal"]),
:root:not([data-mode="code"]) .terminal-toggle {
  display: none;
}

.ext-split {
  position: relative;
}

.ext-split.is-dropping::after {
  content: "Drop to add";
  position: absolute;
  inset: 6px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--accent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 8%, var(--sheet-solid));
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  pointer-events: none;
}

/* Program or address: the chosen one is lit (no sliding highlight here). */
.ext-kinds::before {
  display: none;
}

.ext-kinds button[aria-checked="true"],
.ext-kinds button[aria-selected="true"] {
  background: var(--control-on);
  color: var(--text);
}

.ext-add {
  display: grid;
  align-content: start;
  gap: 14px;
  max-width: 600px;
}

.ext-add .detail-actions {
  margin: 0;
}

.ext-drop-hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-2);
}

.ext-inline {
  display: flex;
  align-items: end;
  gap: 8px;
}

.ext-grow {
  flex: 1;
}

.ext-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ext-chip {
  padding: 2px 7px;
  border-radius: 7px;
  background: var(--control);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.ext-command {
  display: block;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--control);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  user-select: text;
}

.ext-error {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ext-body {
  max-height: 420px;
  overflow: auto;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--control);
  font-size: 0.8125rem;
  line-height: 1.55;
  user-select: text;
  scrollbar-width: thin;
}

.ext-body > :first-child {
  margin-top: 0;
}

.ext-body > :last-child {
  margin-bottom: 0;
}

.ext-textarea {
  min-height: 200px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  outline: none;
  background: var(--control);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.55;
  resize: vertical;
  user-select: text;
}

.ext-textarea:focus,
.key-code.ext-small:focus {
  box-shadow: 0 0 0 1.5px var(--focus);
}

.key-code.ext-small {
  min-height: 70px;
}

.ext-tools {
  display: grid;
  gap: 8px;
}

.ext-tool {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--control);
}

.ext-tool-name {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

.ext-tool-text {
  font-size: 0.75rem;
  line-height: 1.45;
  color: var(--text-2);
}

.ext-market {
  display: grid;
  gap: 4px;
}

.ext-market-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
}

.ext-market-row:hover {
  background: var(--hover);
}

.ext-market-text {
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-2);
}

.ext-version {
  font-weight: 400;
  color: var(--text-2);
}

/* The / menu over MAX CODE's box: skills and plugin commands. */
.composer:has(.slash-menu:not([hidden])) {
  z-index: 60;
}

.slash-menu {
  position: absolute;
  right: 12px;
  bottom: calc(100% + 8px);
  left: 12px;
  z-index: 30;
  display: grid;
  gap: 2px;
  max-height: 320px;
  overflow: auto;
  padding: 6px;
  border-radius: 16px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.22);
}

.slash-menu[hidden] {
  display: none;
}

.slash-item {
  display: grid;
  grid-template-columns: 18px auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 36px;
  padding: 6px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.slash-item.is-active,
.slash-item:hover {
  background: var(--hover);
}

.slash-icon svg {
  display: block;
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.slash-name {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
}

.slash-text {
  overflow: hidden;
  color: var(--text-2);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.slash-from {
  font-size: 0.6875rem;
  color: var(--text-2);
}

/* ---- Discover: the catalog on the Plugins, MCP and Skills pages. */
.ext-tabs {
  margin-right: 4px;
}

.ext-gallery {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 6px 28px 2px;
  border-top: 1px solid var(--line);
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}

.ext-gallery[hidden],
.panel-split[hidden] {
  display: none;
}

.ext-gallery-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.ext-search {
  width: min(420px, 100%);
}

.ext-gallery-from {
  font-size: 0.75rem;
  color: var(--text-2);
}

.ext-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 18px;
}

.ext-filter {
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--control);
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.ext-filter:hover {
  color: var(--text);
}

.ext-filter[aria-pressed="true"] {
  background: var(--accent);
  color: var(--on-accent);
}

.ext-section {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 18px 0 6px;
  padding: 0 8px;
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
}

.ext-section:first-of-type {
  margin-top: 4px;
}

.ext-section-link {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  cursor: pointer;
}

.ext-section-link svg {
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.ext-section-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-2);
}

.ext-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2px 28px;
}

.ext-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 10px 8px;
  border-radius: 14px;
}

.ext-card:hover {
  background: var(--hover);
}

.ext-card.is-open {
  grid-column: 1 / -1;
  background: var(--control);
}

.ext-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border-radius: 11px;
  background: var(--sheet-solid);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-2);
  font-size: 1.0625rem;
  font-weight: 700;
}

.ext-icon.is-small {
  font-size: 0.6875rem;
  letter-spacing: 0.02em;
}

.ext-icon.is-tile {
  box-shadow: none;
}

.ext-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.ext-icon.is-site img {
  width: 28px;
  height: 28px;
}

.ext-card-text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.ext-card-name {
  overflow: hidden;
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ext-card-about {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--text-2);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ext-plus {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.ext-plus:hover {
  background: var(--control-on);
}

.ext-plus svg {
  width: 22px;
  height: 22px;
}

.ext-plus.is-done {
  color: var(--ok);
}

.ext-plus.is-busy {
  cursor: default;
}

.ext-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: ext-spin 0.8s linear infinite;
}

@keyframes ext-spin {
  to { transform: rotate(360deg); }
}

[data-motion="reduced"] .ext-spinner {
  animation-duration: 2.4s;
}

.ext-needs {
  display: grid;
  grid-column: 2 / -1;
  gap: 10px;
  max-width: 560px;
  padding-bottom: 4px;
}

.ext-needs .detail-actions {
  margin: 0;
}

.ext-more {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* Icons in the Installed lists (30 px, as the rows' badges were) and beside a
   name in the details. A letter waiting for its picture stays quiet. */
.ext-icon.is-row {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 0.75rem;
}

.ext-icon.is-row.is-small {
  font-size: 0.5625rem;
}

.ext-icon.is-row.is-site img {
  width: 20px;
  height: 20px;
}

.ext-icon.is-waiting {
  color: var(--text-2);
}

.ext-detail-name {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ext-detail-name .detail-title {
  min-width: 0;
}

/* ---- MAX CODE's Code panel (codeview.js): the files on the left, the editor
   (a frame at aai://ide) on the right, and what Axon is changing along the
   foot. Like the artifact panel, it takes the right of the glass and the box
   moves over to make room. Only in MAX CODE. */
:root:not([data-mode="code"]) .code-toggle,
:root:not([data-mode="code"]) .code-panel {
  display: none;
}

.code-panel {
  position: absolute;
  top: 60px;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(60%, 1000px);
  overflow: hidden;
  border-radius: 16px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.16);
  color: var(--text);
  animation: artifact-in 260ms var(--ease-out) both;
  -webkit-app-region: no-drag;
}

.code-panel[hidden] {
  display: none;
}

[data-motion="reduced"] .code-panel {
  animation-name: fade-in;
}

[data-mode="code"] .page-home.has-code {
  padding-right: calc(min(60%, 1000px) + 26px);
}

/* The stats card would sit under the panel; the start card centres in the
   room that's left. */
.page-home.has-code .work-stats,
.page-home.has-code .work-stats-tip {
  display: none;
}

/* (Beats the rule that centres it beside the stats card.) */
[data-mode="code"] .page-home.has-code > .work-start.work-start {
  left: calc((100% - min(60%, 1000px) - 26px) / 2);
  width: min(400px, calc(100% - min(60%, 1000px) - 74px));
}

.code-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--line);
}

.code-title {
  display: inline-flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 600;
}

.code-title svg {
  flex: none;
  width: 17px;
  height: 17px;
  color: var(--text-2);
}

.code-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-follow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 6px 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.code-follow:hover {
  background: var(--hover);
  color: var(--text);
}

.code-follow:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.code-follow[aria-checked="true"] .mini-switch {
  background: var(--switch-on);
  box-shadow: none;
}

.code-follow[aria-checked="true"] .mini-switch::after {
  transform: translateX(13px);
}

.code-body {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(0, 1fr);
  min-height: 0;
}

/* Left: Changed by Axon, then the project's files. */
.code-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: auto;
  padding: 6px;
  border-right: 1px solid var(--line);
  font-size: 0.8125rem;
}

.code-changed {
  display: grid;
  gap: 1px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.code-changed[hidden] {
  display: none;
}

.code-group-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 4px 0 8px;
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.code-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--control-on);
  font-size: 0.6875rem;
  line-height: 18px;
  text-align: center;
}

.code-link {
  margin-left: auto;
  padding: 2px 6px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
}

.code-link:hover {
  background: var(--hover);
  color: var(--text);
}

.code-tree {
  display: grid;
  align-content: start;
  gap: 1px;
}

.code-row,
.code-change {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0 6px 0 calc(4px + var(--depth, 0) * 14px);
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text);
  font: inherit;
  text-align: left;
  white-space: nowrap;
  cursor: pointer;
}

.code-change {
  padding-left: 8px;
}

.code-row:hover,
.code-change:hover {
  background: var(--hover);
}

.code-row:focus-visible,
.code-change:focus-visible,
.code-link:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: -1.5px;
}

.code-row.is-active,
.code-change.is-active {
  background: var(--control-on);
}

.code-chevron {
  display: grid;
  flex: none;
  place-items: center;
  width: 14px;
  height: 14px;
  color: var(--text-2);
}

.code-chevron svg {
  width: 12px;
  height: 12px;
  transition: transform 160ms var(--ease-out);
}

.code-row.is-open .code-chevron svg {
  transform: rotate(90deg);
}

.code-icon {
  display: grid;
  flex: none;
  place-items: center;
  color: var(--text-2);
}

.code-icon svg {
  width: 15px;
  height: 15px;
}

.code-name {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
}

.code-where {
  overflow: hidden;
  flex: 1;
  min-width: 0;
  color: var(--text-2);
  font-size: 0.75rem;
  text-overflow: ellipsis;
}

.code-badge {
  flex: none;
  margin-left: auto;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 0.6875rem;
  font-weight: 700;
}

.code-change .code-badge {
  margin-left: 0;
}

.code-badge.is-added,
.code-tab-mark.is-added {
  color: #2e9d57;
}

.code-badge.is-modified,
.code-tab-mark.is-modified {
  color: #c98a12;
}

[data-theme="dark"] .code-badge.is-added,
[data-theme="dark"] .code-tab-mark.is-added {
  color: #5cc983;
}

[data-theme="dark"] .code-badge.is-modified,
[data-theme="dark"] .code-tab-mark.is-modified {
  color: #e2b04a;
}

.code-dot {
  flex: none;
  width: 6px;
  height: 6px;
  margin-left: auto;
  border-radius: 50%;
  background: #c98a12;
}

/* Being written right now: the name breathes. */
.code-row.is-writing .code-name,
.code-change.is-writing .code-name {
  animation: code-writing 1.1s ease-in-out infinite alternate;
}

@keyframes code-writing {
  to {
    opacity: 0.45;
  }
}

[data-motion="reduced"] .code-row.is-writing .code-name,
[data-motion="reduced"] .code-change.is-writing .code-name {
  animation: none;
  font-style: italic;
}

.code-note {
  margin: 8px;
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.45;
}

/* Right: open files as tabs, where the file is, and the editor. */
.code-main {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  min-width: 0;
  min-height: 0;
}

.code-tabs {
  display: flex;
  overflow-x: auto;
  min-height: 36px;
  border-bottom: 1px solid var(--line);
  scrollbar-width: thin;
}

.code-tabs:empty {
  display: none;
}

.code-tab {
  display: flex;
  flex: none;
  align-items: center;
  max-width: 220px;
  border-right: 1px solid var(--line);
  color: var(--text-2);
}

.code-tab.is-active {
  background: var(--control);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.code-tab-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
  height: 36px;
  padding: 0 4px 0 12px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.code-tab-mark {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.code-tab-close {
  display: grid;
  flex: none;
  place-items: center;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--text-2);
  cursor: pointer;
  opacity: 0;
}

.code-tab-close svg {
  width: 13px;
  height: 13px;
}

.code-tab:hover .code-tab-close,
.code-tab.is-active .code-tab-close,
.code-tab-close:focus-visible {
  opacity: 1;
}

.code-tab-close:hover {
  background: var(--hover);
  color: var(--text);
}

.code-tab-name:focus-visible,
.code-tab-close:focus-visible,
.code-view button:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: -2px;
}

.code-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 8px 0 14px;
  border-bottom: 1px solid var(--line);
}

.code-bar[hidden] {
  display: none;
}

.code-path {
  display: flex;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  color: var(--text-2);
  font-size: 0.75rem;
  white-space: nowrap;
}

.code-crumb + .code-crumb::before {
  content: "\203A";
  margin: 0 6px;
  opacity: 0.6;
}

.code-crumb.is-file {
  color: var(--text);
}

.code-view {
  display: inline-flex;
  flex: none;
  padding: 2px;
  border-radius: 8px;
  background: var(--control);
}

.code-view[hidden] {
  display: none;
}

.code-view button {
  height: 24px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.code-view button[aria-pressed="true"] {
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0, 0, 0, 0.08);
  color: var(--text);
}

.code-stage {
  position: relative;
  min-height: 0;
}

.code-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.code-frame[hidden] {
  display: none;
}

.code-empty {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 24px;
}

.code-empty[hidden] {
  display: none;
}

.code-empty p {
  max-width: 34ch;
  margin: 0;
  color: var(--text-2);
  font-size: 0.875rem;
  line-height: 1.5;
  text-align: center;
}

.code-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 14px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.75rem;
}

.code-status[hidden] {
  display: none;
}

.code-pulse {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: code-pulse 1.2s ease-in-out infinite;
}

@keyframes code-pulse {
  50% {
    transform: scale(0.6);
    opacity: 0.5;
  }
}

[data-motion="reduced"] .code-pulse {
  animation: none;
}

/* Open in: a split button in the panel's head (codeview.js). The part with
   the app's icon opens the project there; the arrow lists the others. */
.code-open {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 30px;
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px var(--line);
}

.code-open[hidden] {
  display: none;
}

.code-open-main,
.code-open-more {
  height: 30px;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  transition: background-color 140ms ease;
}

.code-open-main {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 220px;
  padding: 0 10px 0 8px;
  border-radius: 8px 0 0 8px;
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
}

.code-open-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.code-open-more {
  display: grid;
  place-items: center;
  width: 26px;
  padding: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
}

.code-open-more svg {
  width: 13px;
  height: 13px;
  transition: transform 220ms var(--ease-out);
}

.code-open-more[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.code-open-main:hover,
.code-open-more:hover,
.code-open-more[aria-expanded="true"] {
  background: var(--hover);
}

.code-open-main:active {
  transform: scale(0.98);
}

.code-open-main:disabled {
  background: none;
  cursor: default;
  opacity: 0.5;
  transform: none;
}

.code-open-main:focus-visible,
.code-open-more:focus-visible {
  outline: 1.5px solid var(--focus);
  outline-offset: 1px;
}

.code-open-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

.code-open-icon img,
.code-open-icon svg {
  width: 16px;
  height: 16px;
}

.code-open-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 6;
  display: grid;
  min-width: 240px;
  padding: 4px;
  border-radius: 12px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 16px 40px rgba(0, 0, 0, 0.25);
  transform-origin: top right;
  animation: menu-in 180ms var(--ease-out) both;
}

.code-open-menu[hidden] {
  display: none;
}

.code-open-item {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.code-open-item:hover,
.code-open-item:focus-visible {
  outline: none;
  background: var(--control-on);
}

.code-open-name {
  flex: 1;
  min-width: 0;
}

.code-open-item > svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: var(--accent);
}

.code-open-sep {
  height: 1px;
  margin: 4px 6px;
  background: var(--line);
}

/* ---- MAX CODE's Terminal view (terminal.js): Axon in a terminal, in place of
   the Axon view. Dark in both themes, as terminals are; the tab strip on top,
   the screens under it. */
.page-terminal {
  --term-bg: #0e0f11;
  --term-head: #131417;
  --term-fg: #d7d9dc;
  --term-dim: #7b828b;
  --term-faint: #565c63;
  --term-line: rgba(255, 255, 255, 0.08);
  --term-accent: #b49cfb;
  --term-green: #5cc983;
  --term-red: #f2766d;
  --term-yellow: #e2b04a;
  --term-cyan: #7fd1e0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  place-items: stretch;
  padding: 0;
  overflow: hidden;
  border-radius: inherit;
  background: var(--term-bg);
  color: var(--term-fg);
  color-scheme: dark;
}

.page-terminal[hidden] {
  display: none;
}

.term-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 54px;
  /* The right end stays free for the window buttons (they show on hover). */
  padding: 10px 112px 8px 12px;
  border-bottom: 1px solid var(--term-line);
  background: var(--term-head);
  /* The empty part of the bar moves the window. */
  -webkit-app-region: drag;
}

.term-head button {
  -webkit-app-region: no-drag;
}

.term-tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.term-tab {
  display: flex;
  flex: none;
  align-items: center;
  max-width: 220px;
  height: 34px;
  border-radius: 9px;
  color: var(--term-dim);
  transition: background-color 140ms ease, color 140ms ease;
}

.term-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--term-fg);
}

.term-tab.is-active {
  background: rgba(255, 255, 255, 0.09);
  color: #f2f3f4;
}

.term-tab-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 34px;
  padding: 0 4px 0 11px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.term-tab-icon {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 16px;
  height: 16px;
}

.term-tab-icon svg {
  width: 15px;
  height: 15px;
}

/* Working: a dot on the tab's icon; waiting for a yes: amber. */
.term-tab.is-running .term-tab-icon::after,
.term-tab.is-asking .term-tab-icon::after {
  content: "";
  position: absolute;
  top: -2px;
  right: -3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--term-accent);
  animation: code-pulse 1.2s ease-in-out infinite;
}

.term-tab.is-asking .term-tab-icon::after {
  background: var(--term-yellow);
}

.term-tab-text {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-tab-close,
.term-new {
  display: grid;
  flex: none;
  place-items: center;
  padding: 0;
  border: 0;
  background: none;
  color: var(--term-dim);
  cursor: pointer;
}

.term-tab-close {
  width: 22px;
  height: 22px;
  margin-right: 6px;
  border-radius: 6px;
  opacity: 0;
}

.term-tab:hover .term-tab-close,
.term-tab.is-active .term-tab-close,
.term-tab-close:focus-visible {
  opacity: 1;
}

.term-tab-close svg {
  width: 13px;
  height: 13px;
}

.term-new {
  width: 32px;
  height: 32px;
  border-radius: 9px;
}

.term-new svg {
  width: 15px;
  height: 15px;
}

.term-tab-close:hover,
.term-new:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  color: var(--term-fg);
}

.term-new:disabled {
  cursor: default;
  opacity: 0.35;
}

.term-head-space {
  flex: 1;
  min-width: 12px;
}

.term-back {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 17px;
  background: rgba(255, 255, 255, 0.09);
  color: #f2f3f4;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, transform 160ms var(--ease-out);
}

.term-back svg {
  width: 14px;
  height: 14px;
}

/* Open in Terminal: the PC's own terminal, in the same project. */
.term-pc {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--term-line);
  border-radius: 17px;
  background: transparent;
  color: var(--term-dim);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease, transform 160ms var(--ease-out);
}

.term-pc-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
}

.term-pc-icon svg,
.term-pc-icon img {
  width: 16px;
  height: 16px;
}

.term-pc-chevron {
  width: 12px;
  height: 12px;
  opacity: 0.75;
  transition: transform 160ms var(--ease-out);
}

.term-pc[aria-expanded="true"] .term-pc-chevron {
  transform: rotate(180deg);
}

.term-pc:hover:not(:disabled),
.term-pc[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.06);
  color: var(--term-fg);
}

.term-pc-wrap {
  position: relative;
  flex: none;
  -webkit-app-region: no-drag;
}

/* What Open in Terminal can start: Axon, a plain terminal, or an agent tool. */
.term-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  display: grid;
  gap: 2px;
  width: 300px;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #1a1b1f;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  color: var(--term-fg);
  transform-origin: top right;
  animation: term-menu-in 150ms var(--ease-out);
  -webkit-app-region: no-drag;
}

.term-menu[hidden] {
  display: none;
}

@keyframes term-menu-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(-4px);
  }
}

:root[data-motion="reduced"] .term-menu {
  animation: none;
}

.term-menu-item {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 2px 10px;
  align-items: center;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.term-menu-item:hover,
.term-menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.07);
  outline: none;
}

.term-menu-icon {
  display: grid;
  grid-row: span 2;
  place-items: center;
  width: 22px;
  height: 22px;
  color: var(--term-fg);
}

.term-menu-icon svg,
.term-menu-icon img,
.term-menu-icon .key-logo {
  width: 18px;
  height: 18px;
}

.term-menu-name {
  font-size: 0.8125rem;
  font-weight: 500;
}

.term-menu-sub {
  overflow: hidden;
  color: var(--term-dim);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.term-menu-heading {
  margin: 6px 10px 2px;
  padding-top: 8px;
  border-top: 1px solid var(--term-line);
  color: var(--term-dim);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.term-menu-note {
  margin: 2px 10px 6px;
  color: var(--term-faint);
  font-size: 0.75rem;
  line-height: 1.45;
}

.term-pc:active:not(:disabled) {
  transform: scale(0.97);
}

.term-pc:disabled {
  cursor: default;
  opacity: 0.5;
}

.term-pc[hidden] {
  display: none;
}

/* Narrow windows: the icons say it. */
@media (max-width: 900px) {
  .term-pc-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .term-pc {
    padding: 0 10px;
  }
}

.term-back:hover {
  background: rgba(255, 255, 255, 0.15);
}

.term-back:active {
  transform: scale(0.97);
}

.term-tab-name:focus-visible,
.term-tab-close:focus-visible,
.term-new:focus-visible,
.term-pc:focus-visible,
.term-back:focus-visible {
  outline: 1.5px solid var(--term-accent);
  outline-offset: 1px;
}

.term-screens {
  position: relative;
  min-height: 0;
}

.term-screen {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 18px 24px 14px;
  font-family: "Cascadia Mono", "Cascadia Code", Consolas, "Courier New", monospace;
  font-size: 13.5px;
  line-height: 1.55;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  scrollbar-width: thin;
}

.term-screen[hidden] {
  display: none;
}

.term-screen ::selection {
  background: rgba(180, 156, 251, 0.35);
}

.term-log {
  display: grid;
  gap: 6px;
}

.term-log > * {
  min-width: 0;
}

.term-line,
.term-answer-text,
.term-sub,
.term-action-head {
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.term-dim,
.term-meta {
  color: var(--term-dim);
}

.term-meta {
  margin-bottom: 4px;
  padding-left: 2ch;
  color: var(--term-faint);
  font-size: 12px;
}

.term-accent {
  color: var(--term-accent);
}

.term-banner {
  display: grid;
  gap: 8px;
  justify-self: start;
  max-width: 100%;
  margin-bottom: 10px;
  padding: 12px 18px 14px;
  border: 1px solid color-mix(in srgb, var(--term-accent) 55%, transparent);
  border-radius: 10px;
}

.term-banner-title {
  font-size: 14.5px;
}

.term-banner-rows {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 18px;
  margin-top: 4px;
}

.term-path {
  overflow-wrap: anywhere;
}

.term-you {
  margin-top: 10px;
  color: #f2f3f4;
}

.term-you .term-caret {
  color: var(--term-accent);
}

.term-answer {
  display: flex;
  min-width: 0;
}

.term-bullet {
  flex: none;
  color: #f2f3f4;
  white-space: pre;
}

.term-answer-text {
  flex: 1;
  min-width: 0;
}

.term-heading {
  color: #ffffff;
}

.term-code,
.term-code-inline {
  color: var(--term-cyan);
}

.term-code-inline {
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(127, 209, 224, 0.08);
}

.term-fence {
  color: var(--term-faint);
}

.term-dot {
  flex: none;
}

.term-dot.is-running {
  color: var(--term-yellow);
  animation: term-blink 1s steps(2, jump-none) infinite;
}

.term-dot.is-done {
  color: var(--term-green);
}

.term-dot.is-failed {
  color: var(--term-red);
}

.term-dot.is-denied {
  color: var(--term-yellow);
}

@keyframes term-blink {
  50% {
    opacity: 0.25;
  }
}

[data-motion="reduced"] .term-dot.is-running {
  animation: none;
}

.term-action-head {
  display: flex;
}

.term-action-text {
  padding-left: 1ch;
  font-weight: 600;
}

.term-sub {
  color: var(--term-dim);
}

.term-elbow {
  padding-left: 2ch;
  color: var(--term-faint);
}

.term-add {
  color: var(--term-green);
}

.term-del,
.term-err,
.term-error {
  color: var(--term-red);
}

.term-warn {
  color: var(--term-yellow);
}

.term-diff,
.term-output {
  overflow-x: auto;
  margin: 2px 0 4px 5ch;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 12.5px;
  white-space: pre;
}

.term-output {
  color: #a9afb6;
}

.term-diff .term-add {
  background: rgba(92, 201, 131, 0.08);
}

.term-diff .term-del {
  background: rgba(242, 118, 109, 0.08);
}

.term-plan .term-step.is-completed {
  color: var(--term-faint);
  text-decoration: line-through;
}

.term-plan .term-step.is-in_progress {
  color: var(--term-fg);
}

.term-help {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 2px 20px;
  padding-left: 2ch;
}

.term-ask {
  margin: 4px 0;
  padding: 10px 14px 12px;
  border: 1px solid color-mix(in srgb, var(--term-yellow) 45%, transparent);
  border-radius: 9px;
  background: rgba(226, 176, 74, 0.05);
}

.term-ask-detail {
  max-height: 10.5em;
  overflow: auto;
  margin: 6px 0 8px;
  color: #a9afb6;
  font: inherit;
  font-size: 12.5px;
  white-space: pre-wrap;
}

.term-ask-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.term-choice {
  height: 28px;
  padding: 0 11px;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--term-fg);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.term-choice b {
  color: var(--term-yellow);
}

.term-choice:hover {
  background: rgba(255, 255, 255, 0.12);
}

.term-choice:focus-visible {
  outline: 1.5px solid var(--term-yellow);
  outline-offset: 1px;
}

.term-status {
  margin-top: 10px;
  color: var(--term-fg);
}

.term-status[hidden] {
  display: none;
}

.term-spin {
  display: inline-block;
  width: 2ch;
  color: var(--term-accent);
}

.term-prompt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 160ms ease;
}

.term-prompt:focus-within {
  border-color: rgba(255, 255, 255, 0.3);
}

.term-prompt[hidden] {
  display: none;
}

.term-prompt .term-caret {
  color: var(--term-accent);
  line-height: 1.55;
}

.term-input {
  flex: 1;
  min-width: 0;
  min-height: 1.55em;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  color: #f2f3f4;
  font: inherit;
  line-height: 1.55;
  resize: none;
  caret-color: var(--term-accent);
}

.term-input::placeholder {
  color: var(--term-faint);
}

.term-hints {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 4px 0;
  color: var(--term-faint);
  font-size: 12px;
}

.term-hint-where {
  overflow: hidden;
  min-width: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* The >_ icon: its prompt steps forward and the cursor blinks on hover. */
.icon-terminal .i-term-chevron {
  transition: transform 200ms var(--ease-out);
}

:root:not([data-motion="reduced"]) :is(.rail-button, .home-tool):hover .icon-terminal .i-term-chevron {
  transform: translateX(1px);
}

:root:not([data-motion="reduced"]) :is(.rail-button, .home-tool):hover .icon-terminal .i-term-cursor {
  animation: term-blink 0.9s steps(2, jump-none) infinite;
}

.terminal-toggle .icon-terminal {
  width: 18px;
  height: 18px;
}

/* ---- MyFlyCursor (flycursor.js) -------------------------------------------- */

/* MAX CODE's "Use cursor" switch under the box: on, Axon hands on-screen
   work to the cursors. Only in MAX CODE. */
:root:not([data-mode="code"]) .only-code {
  display: none;
}

.cursor-chip {
  cursor: pointer;
  transition: color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

.cursor-chip svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.cursor-chip:hover {
  color: var(--text);
}

.cursor-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 16%, var(--sheet));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--text);
}

.cursor-chip[aria-pressed="true"] svg {
  fill: var(--accent);
  stroke: var(--sheet-solid);
  stroke-width: 1.4;
}

.cursor-chip:active {
  transform: scale(0.97);
}

/* MAX CODE and MyFlyCursor, tied by a wavy string (no knots: the owner's
   choice). Connected (MAX CODE's Use cursor on: flycursor.js sets
   data-cursor-link on the page and .is-linked on the string), both pills glow
   softly and a wave runs along the string toward MyFlyCursor, so you can see
   MAX CODE will use your cursors. While cursors work (.is-busy) the wave runs
   faster, and the pill counts them. The ends stay put; the middle swings. */
.mode-bar .mode-code {
  transition: box-shadow 280ms ease;
}

[data-cursor-link] .mode-bar :is(.mode-code, .fly-pill) {
  box-shadow:
    0 0 0 1.5px color-mix(in srgb, var(--accent) 60%, transparent),
    0 0 18px 2px color-mix(in srgb, var(--accent) 42%, transparent),
    0 8px 24px rgba(0, 0, 0, 0.18);
}

.fly-string {
  flex: none;
  align-self: center;
  width: 24px;
  height: 10px;
  margin-inline: -10px;
  color: color-mix(in srgb, var(--text) 42%, transparent);
  transition: color 240ms ease;
}

.fly-string svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.fly-string path {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
}

.fly-string:is(.is-linked, .is-busy) {
  color: var(--accent);
}

:root:not([data-motion="reduced"]) .fly-string:is(.is-linked, .is-busy) path {
  animation: fly-wave 1.3s linear infinite;
}

:root:not([data-motion="reduced"]) .fly-string.is-busy path {
  animation-duration: 0.7s;
}

/* One wavelength forward per loop: a wave tied at both ends, eight steps
   (drawn with a small script: y = 5 + 3·sin(πx/24)·sin(2πx/12 − phase)). */
@keyframes fly-wave {
  0%,
  100% {
    d: path("M0 5C0.33 5.11 1.33 5.46 2 5.67C2.67 5.89 3.33 6.41 4 6.3C4.67 6.19 5.33 5.59 6 5C6.67 4.41 7.33 3.17 8 2.75C8.67 2.33 9.33 2.12 10 2.49C10.67 2.87 11.33 4.16 12 5C12.67 5.84 13.33 7.13 14 7.51C14.67 7.88 15.33 7.67 16 7.25C16.67 6.83 17.33 5.59 18 5C18.67 4.41 19.33 3.81 20 3.7C20.67 3.59 21.33 4.11 22 4.33C22.67 4.54 23.67 4.89 24 5");
  }

  12.5% {
    d: path("M0 5C0.33 5.03 1.33 4.96 2 5.2C2.67 5.44 3.33 6.23 4 6.45C4.67 6.67 5.33 6.85 6 6.5C6.67 6.15 7.33 5.04 8 4.33C8.67 3.61 9.33 2.44 10 2.2C10.67 1.96 11.33 2.29 12 2.88C12.67 3.47 13.33 4.98 14 5.75C14.67 6.52 15.33 7.38 16 7.51C16.67 7.63 17.33 6.98 18 6.5C18.67 6.02 19.33 4.99 20 4.61C20.67 4.24 21.33 4.19 22 4.25C22.67 4.31 23.67 4.88 24 5");
  }

  25% {
    d: path("M0 5C0.33 4.94 1.33 4.49 2 4.61C2.67 4.74 3.33 5.33 4 5.75C4.67 6.17 5.33 7.03 6 7.12C6.67 7.21 7.33 6.89 8 6.3C8.67 5.7 9.33 4.27 10 3.55C10.67 2.83 11.33 2 12 2C12.67 2 13.33 2.83 14 3.55C14.67 4.27 15.33 5.7 16 6.3C16.67 6.89 17.33 7.21 18 7.12C18.67 7.03 19.33 6.17 20 5.75C20.67 5.33 21.33 4.74 22 4.61C22.67 4.49 23.67 4.94 24 5");
  }

  37.5% {
    d: path("M0 5C0.33 4.88 1.33 4.31 2 4.25C2.67 4.19 3.33 4.24 4 4.61C4.67 4.99 5.33 6.02 6 6.5C6.67 6.98 7.33 7.63 8 7.51C8.67 7.38 9.33 6.52 10 5.75C10.67 4.98 11.33 3.47 12 2.88C12.67 2.29 13.33 1.96 14 2.2C14.67 2.44 15.33 3.61 16 4.33C16.67 5.04 17.33 6.15 18 6.5C18.67 6.85 19.33 6.67 20 6.45C20.67 6.23 21.33 5.44 22 5.2C22.67 4.96 23.67 5.03 24 5");
  }

  50% {
    d: path("M0 5C0.33 4.89 1.33 4.54 2 4.33C2.67 4.11 3.33 3.59 4 3.7C4.67 3.81 5.33 4.41 6 5C6.67 5.59 7.33 6.83 8 7.25C8.67 7.67 9.33 7.88 10 7.51C10.67 7.13 11.33 5.84 12 5C12.67 4.16 13.33 2.87 14 2.49C14.67 2.12 15.33 2.33 16 2.75C16.67 3.17 17.33 4.41 18 5C18.67 5.59 19.33 6.19 20 6.3C20.67 6.41 21.33 5.89 22 5.67C22.67 5.46 23.67 5.11 24 5");
  }

  62.5% {
    d: path("M0 5C0.33 4.97 1.33 5.04 2 4.8C2.67 4.56 3.33 3.77 4 3.55C4.67 3.33 5.33 3.15 6 3.5C6.67 3.85 7.33 4.96 8 5.67C8.67 6.39 9.33 7.56 10 7.8C10.67 8.04 11.33 7.71 12 7.12C12.67 6.53 13.33 5.02 14 4.25C14.67 3.48 15.33 2.62 16 2.49C16.67 2.37 17.33 3.02 18 3.5C18.67 3.98 19.33 5.01 20 5.39C20.67 5.76 21.33 5.81 22 5.75C22.67 5.69 23.67 5.13 24 5");
  }

  75% {
    d: path("M0 5C0.33 5.06 1.33 5.51 2 5.39C2.67 5.26 3.33 4.67 4 4.25C4.67 3.83 5.33 2.97 6 2.88C6.67 2.79 7.33 3.11 8 3.7C8.67 4.3 9.33 5.73 10 6.45C10.67 7.17 11.33 8 12 8C12.67 8 13.33 7.17 14 6.45C14.67 5.73 15.33 4.3 16 3.7C16.67 3.11 17.33 2.79 18 2.88C18.67 2.97 19.33 3.83 20 4.25C20.67 4.67 21.33 5.26 22 5.39C22.67 5.51 23.67 5.06 24 5");
  }

  87.5% {
    d: path("M0 5C0.33 5.13 1.33 5.69 2 5.75C2.67 5.81 3.33 5.76 4 5.39C4.67 5.01 5.33 3.98 6 3.5C6.67 3.02 7.33 2.37 8 2.49C8.67 2.62 9.33 3.48 10 4.25C10.67 5.02 11.33 6.53 12 7.12C12.67 7.71 13.33 8.04 14 7.8C14.67 7.56 15.33 6.39 16 5.67C16.67 4.96 17.33 3.85 18 3.5C18.67 3.15 19.33 3.33 20 3.55C20.67 3.77 21.33 4.56 22 4.8C22.67 5.04 23.67 4.97 24 5");
  }
}

.fly-pill {
  position: relative;
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px 0 11px;
  border: 0;
  border-radius: 999px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 8px 24px rgba(0, 0, 0, 0.18);
  color: var(--text-2);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 160ms ease, transform 160ms var(--ease-out), box-shadow 280ms ease;
}

.fly-pill:hover,
.fly-pill.is-active {
  color: var(--text);
}

.fly-pill:active {
  transform: scale(0.97);
}

.fly-pill:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.fly-pill-icon {
  width: 17px;
  height: 17px;
  overflow: visible;
}

.fly-pill-icon path:first-child {
  fill: var(--accent);
  stroke: var(--sheet-solid);
  stroke-width: 1.4;
  stroke-linejoin: round;
}

.fly-pill-trail {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  opacity: 0.55;
}

:root:not([data-motion="reduced"]) .fly-pill:hover .fly-pill-icon,
:root:not([data-motion="reduced"]) .fly-pill.is-busy .fly-pill-icon {
  animation: fly-hop 1.4s ease-in-out infinite;
}

@keyframes fly-hop {
  0%,
  100% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(2px, -2px);
  }
}

.fly-pill-badge {
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 0.6875rem;
  font-weight: 700;
}

.fly-pill-badge.is-asking {
  background: var(--warn);
  color: #111;
}

.fly-pill-badge[hidden] {
  display: none;
}

@container (max-width: 720px) {
  .fly-pill-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .fly-pill {
    padding: 0 11px;
  }
}

/* ---- The page: cursors | the chosen one | activity --------------------------- */
/* Room at the top for Chat / Work, MAX CODE and MyFlyCursor, as on the home
   page (narrow rules there apply here too: it's a container). */
.page-flycursor {
  container-type: inline-size;
  padding-top: 62px;
}

.page-flycursor .panel {
  height: 100%;
}

/* On this page MyFlyCursor is the one on: its pill is a label, not a button. */
.fly-pill-here {
  cursor: default;
}

.fly-pill-here:active {
  transform: none;
}

/* History: the saved chats, between New cursor and the lighting card. It
   takes the room left over, and scrolls. */
.fly-history {
  display: flex;
  flex: 1 1 120px;
  flex-direction: column;
  gap: 6px;
  min-height: 96px;
  margin-top: 6px;
}

.fly-history-list {
  display: grid;
  align-content: start;
  gap: 1px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
}

.fly-history-empty {
  margin: 0;
  padding: 2px 4px 0;
  color: var(--text-2);
  font-size: 0.75rem;
  line-height: 1.45;
}

.fly-hist {
  display: flex;
  align-items: center;
  border-radius: 10px;
  transition: background-color 140ms ease;
}

.fly-hist:hover {
  background: var(--control);
}

.fly-hist.is-open {
  background: var(--control-on);
  box-shadow: inset 3px 0 0 var(--c);
}

.fly-hist-main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 40px;
  padding: 5px 4px 5px 9px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.fly-hist-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
}

.fly-hist-icon .fly-glyph {
  width: 15px;
  height: 15px;
}

.fly-hist-icon .fly-stack .fly-glyph + .fly-glyph {
  margin-left: -9px;
}

.fly-hist-icon .fly-stack > svg:not(.fly-glyph) {
  width: 17px;
  height: 17px;
}

.fly-hist-title {
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fly-hist-delete {
  display: grid;
  flex: none;
  place-items: center;
  min-width: 28px;
  height: 28px;
  margin-right: 6px;
  padding: 0 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0;
  cursor: pointer;
  transition: opacity 140ms ease, background-color 140ms ease, color 140ms ease;
}

.fly-hist:hover .fly-hist-delete,
.fly-hist:focus-within .fly-hist-delete,
.fly-hist.is-armed .fly-hist-delete {
  opacity: 1;
}

.fly-hist-delete:hover {
  background: color-mix(in srgb, var(--bad) 14%, transparent);
  color: var(--bad);
}

.fly-hist.is-armed .fly-hist-delete {
  background: var(--bad);
  color: #fff;
}

.fly-hist-delete svg {
  width: 15px;
  height: 15px;
}

.fly-hist-main:focus-visible,
.fly-hist-delete:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

@media (hover: none) {
  .fly-hist-delete {
    opacity: 1;
  }
}

.fly-head {
  align-items: center;
}

.fly-head-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fly-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(140deg, color-mix(in srgb, var(--fly-c, var(--accent)) 30%, transparent), color-mix(in srgb, var(--fly-c, var(--accent)) 8%, transparent));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fly-c, var(--accent)) 30%, transparent);
  transition: background 240ms ease;
}

.fly-mark svg {
  width: 22px;
  height: 22px;
  fill: var(--fly-c, var(--accent));
  stroke: var(--sheet-solid);
  stroke-width: 1.3;
  stroke-linejoin: round;
}

.fly-stop-all {
  background: color-mix(in srgb, var(--bad) 18%, transparent);
  color: var(--bad);
}

.fly-stop-all[hidden] {
  display: none;
}

.fly-body {
  display: grid;
  flex: 1;
  grid-template-columns: 250px minmax(0, 1fr) 270px;
  gap: 14px;
  min-height: 0;
}

.fly-side,
.fly-activity {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
}

.fly-side-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2px 4px 0;
}

.fly-count {
  color: var(--text-2);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* The list takes what room is left (more when the lighting card is folded)
   and scrolls; it never pushes the card off. */
.fly-list {
  display: grid;
  flex: 0 1 auto;
  align-content: start;
  gap: 2px;
  min-height: 52px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.fly-glyph {
  flex: none;
  width: 18px;
  height: 18px;
  overflow: visible;
  fill: var(--c);
  stroke: #fff;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 1.5px rgba(0, 0, 0, 0.3));
}

/* A cursor's row: its own chat, and in the team room a tick to join. */
.fly-item {
  display: flex;
  align-items: center;
  border-radius: 11px;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.fly-item:hover {
  background: var(--control);
}

.fly-item.is-chosen {
  background: var(--control-on);
  box-shadow: inset 3px 0 0 var(--c);
}

.fly-item.is-in-team {
  background: color-mix(in srgb, var(--c) 9%, transparent);
}

.fly-item-main {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 10px;
  min-width: 0;
  min-height: 46px;
  padding: 6px 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.fly-item-main:focus-visible,
.fly-join:focus-visible,
.fly-room-card:focus-visible,
.fly-light-fold:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.fly-join {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  margin: 0 10px 0 2px;
  padding: 0;
  border: 1.5px solid color-mix(in srgb, var(--text) 32%, transparent);
  border-radius: 7px;
  background: transparent;
  color: transparent;
  cursor: pointer;
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, transform 160ms var(--ease-out);
}

.fly-join:hover {
  border-color: var(--c);
}

.fly-join:active {
  transform: scale(0.9);
}

.fly-join[aria-checked="true"] {
  border-color: var(--c);
  background: var(--c);
  color: #fff;
}

.fly-join svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.4;
}

/* The team room's entry, above the cursors. */
.fly-room-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 7px 10px;
  border: 0;
  border-radius: 12px;
  background: var(--control);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 140ms ease, box-shadow 140ms ease;
}

.fly-room-card:hover {
  background: var(--control-on);
}

.fly-room-card.is-chosen {
  background: var(--control-on);
  box-shadow: inset 3px 0 0 var(--fly-c, var(--accent)), 0 0 0 1px var(--line);
}

/* Cursors side by side, each a little over the last. */
.fly-stack {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-width: 22px;
}

.fly-stack .fly-glyph + .fly-glyph {
  margin-left: -8px;
}

.fly-stack > svg:not(.fly-glyph) {
  width: 20px;
  height: 20px;
  color: var(--text-2);
}

.fly-item-text {
  display: grid;
  flex: 1;
  min-width: 0;
}

.fly-item-name {
  font-size: 0.875rem;
  font-weight: 600;
}

.fly-item-sub {
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fly-item-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 25%, transparent);
  animation: code-pulse 1.2s ease-in-out infinite;
}

.fly-item-dot.is-asking {
  background: var(--warn);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 25%, transparent);
}

.fly-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.fly-add svg {
  width: 14px;
  height: 14px;
}

/* The lighting card; folded, just its title, what it's set to and its switch. */
.fly-light {
  display: grid;
  flex: none;
  gap: 10px;
  margin-top: auto;
  padding: 14px;
  border-radius: 14px;
  background: var(--control);
}

.fly-light.is-folded {
  gap: 0;
  padding: 10px 12px 10px 14px;
}

.fly-light.is-folded .fly-light-body {
  display: none;
}

.fly-light-fold {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.fly-light-title {
  display: grid;
  min-width: 0;
}

.fly-light-state {
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fly-light-chevron {
  flex: none;
  width: 14px;
  height: 14px;
  color: var(--text-2);
  transition: transform 220ms var(--ease-out);
}

.fly-light.is-folded .fly-light-chevron {
  transform: rotate(-90deg);
}

.fly-light-fold:hover .fly-light-chevron {
  color: var(--text);
}

.fly-light-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.fly-light-sub {
  margin: 2px 0 0;
  color: var(--text-2);
  font-size: 0.75rem;
  line-height: 1.4;
}

.fly-light-body {
  display: grid;
  gap: 9px;
  transition: opacity 180ms ease;
}

.fly-light-body.is-off {
  opacity: 0.45;
  pointer-events: none;
}

.fly-light-row {
  display: grid;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-2);
}

.fly-light-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.fly-light-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 10px 0 8px;
  border: 0;
  border-radius: 14px;
  background: var(--control);
  color: var(--text-2);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.fly-light-chip.is-on {
  background: var(--control-on);
  color: var(--text);
  box-shadow: inset 0 0 0 1.5px var(--c);
}

.fly-light-chip .fly-color-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.fly-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--c);
}

.fly-seg {
  display: inline-flex;
  max-width: 100%;
}

.fly-seg button {
  min-width: 0;
  padding: 0 10px;
  font-size: 0.75rem;
  white-space: nowrap;
}

.fly-preview {
  width: 100%;
}

/* The middle: the chosen cursor. */
.fly-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  border-radius: 16px;
  background: var(--control);
}

.fly-main-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.fly-main-glyph {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--c) 18%, transparent);
}

.fly-main-glyph .fly-glyph {
  width: 21px;
  height: 21px;
}

.fly-main-title {
  flex: 1;
  min-width: 120px;
}

.fly-main-title h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 650;
}

.fly-main-title p {
  margin: 0;
  color: var(--text-2);
  font-size: 0.75rem;
}

.fly-chat {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
  padding: 16px 18px;
  overflow-y: auto;
  scrollbar-width: thin;
  user-select: text;
}

.fly-empty {
  display: grid;
  justify-items: center;
  gap: 6px;
  max-width: 460px;
  margin: auto;
  text-align: center;
}

.fly-empty-glyph .fly-glyph {
  width: 34px;
  height: 34px;
}

:root:not([data-motion="reduced"]) .fly-empty-glyph .fly-glyph {
  animation: fly-hop 2.2s ease-in-out infinite;
}

.fly-empty-title {
  margin: 4px 0 0;
  font-size: 1.0625rem;
  font-weight: 650;
}

.fly-empty-sub {
  margin: 0;
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.fly-ideas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.fly-idea {
  min-height: 30px;
  max-width: 100%;
  padding: 6px 12px;
  border: 0;
  border-radius: 15px;
  line-height: 1.35;
  background: var(--control-on);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}

.fly-idea:active {
  transform: scale(0.97);
}

.fly-msg p {
  margin: 0 0 6px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.fly-msg p:last-child {
  margin-bottom: 0;
}

.fly-you {
  align-self: flex-end;
  max-width: 78%;
  padding: 8px 12px;
  border-radius: 14px 14px 4px 14px;
  background: var(--control-on);
}

.fly-from {
  display: block;
  margin-bottom: 2px;
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
}

.fly-answer {
  max-width: 92%;
}

.fly-answer ul {
  margin: 0 0 6px;
  padding-left: 20px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.fly-answer pre,
.fly-ask-detail {
  margin: 0 0 6px;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--control);
  font: 0.75rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.fly-answer code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--control);
  font: 0.8125rem ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.fly-strong {
  font-weight: 650;
}

/* A step: a dot in the cursor's colour, what it did, and on what. */
.fly-step {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  font-size: 0.8125rem;
}

.fly-step-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
  transform: translateY(-1px);
}

.fly-step.is-running .fly-step-dot {
  animation: code-pulse 1.2s ease-in-out infinite;
}

.fly-step.is-failed .fly-step-dot {
  background: var(--bad);
}

.fly-step.is-denied .fly-step-dot {
  background: var(--warn);
}

.fly-step-text {
  font-weight: 550;
}

.fly-step-target {
  overflow: hidden;
  max-width: 100%;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fly-step-note {
  color: var(--warn);
  font-size: 0.75rem;
}

.fly-step-note.is-bad {
  color: var(--bad);
}

.fly-plan ul {
  margin: 4px 0 0;
  padding-left: 20px;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.fly-plan .is-completed {
  color: var(--text-2);
  text-decoration: line-through;
}

.fly-plan .is-in_progress {
  font-weight: 650;
}

.fly-ask {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--control-on);
  box-shadow: inset 3px 0 0 var(--c);
  font-size: 0.875rem;
}

.fly-ask.is-waiting {
  box-shadow: inset 3px 0 0 var(--warn), 0 0 0 1px color-mix(in srgb, var(--warn) 40%, transparent);
}

.fly-ask p {
  margin: 0;
}

.fly-ask-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fly-ask-said {
  color: var(--text-2);
  font-size: 0.75rem;
}

.fly-problem p {
  margin: 0;
}

.fly-problem-detail {
  margin-top: 4px !important;
  color: var(--text-2);
  font-size: 0.75rem;
}

.fly-end {
  margin: 0;
  color: var(--text-2);
  font-size: 0.75rem;
}

.fly-working {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 0.8125rem;
}

.fly-working-glyph .fly-glyph {
  width: 16px;
  height: 16px;
}

:root:not([data-motion="reduced"]) .fly-working-glyph .fly-glyph {
  animation: fly-hop 1.1s ease-in-out infinite;
}

/* ---- The team room's chat ---- */
.fly-light.is-folded .fly-light-head {
  align-items: center;
}

.fly-room-glyph {
  width: auto;
  min-width: 36px;
  padding: 0 8px;
}

.fly-room-glyph .fly-glyph {
  width: 20px;
  height: 20px;
}

.fly-empty-team .fly-glyph {
  width: 30px;
  height: 30px;
}

.fly-empty-team .fly-stack .fly-glyph + .fly-glyph {
  margin-left: -12px;
}

/* A cursor's name tag, as on the screen and in Activity. */
.fly-tag {
  display: inline-flex;
  flex: none;
  align-items: center;
  height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--c) 20%, transparent);
  color: color-mix(in srgb, var(--c) 72%, var(--text));
  font-size: 0.75rem;
  font-weight: 700;
  white-space: nowrap;
}

.fly-plan-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--control-on);
  box-shadow: 0 0 0 1px var(--line);
}

.fly-plan-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.fly-plan-title svg {
  width: 15px;
  height: 15px;
}

.fly-plan-card ol {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fly-plan-card li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 9px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.fly-plan-task {
  flex: 1;
  min-width: 200px;
}

.fly-plan-after {
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--control);
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
}

.fly-lead .fly-from {
  color: var(--text-2);
}

.fly-room-step {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  font-size: 0.8125rem;
}

.fly-room-step.is-running .fly-tag {
  animation: code-pulse 1.2s ease-in-out infinite;
}

.fly-room-step.is-failed .fly-step-text {
  color: var(--bad);
}

.fly-room-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--c) 8%, transparent);
  font-size: 0.8125rem;
  font-style: italic;
}

.fly-note-arrow {
  color: var(--text-2);
  font-size: 0.75rem;
  font-style: normal;
  font-weight: 600;
}

.fly-report {
  display: grid;
  gap: 6px;
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--control-on);
  box-shadow: inset 3px 0 0 var(--c);
}

.fly-report.is-bad {
  box-shadow: inset 3px 0 0 var(--bad);
}

.fly-report.is-stopped {
  box-shadow: inset 3px 0 0 var(--warn);
}

.fly-report-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.fly-report-text p {
  margin: 0 0 6px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.fly-report-text p:last-child {
  margin-bottom: 0;
}

.fly-report-text ul {
  margin: 0 0 6px;
  padding-left: 20px;
  font-size: 0.875rem;
}

.fly-working .fly-stack .fly-glyph {
  width: 16px;
  height: 16px;
}

:root:not([data-motion="reduced"]) .fly-working .fly-stack .fly-glyph {
  animation: fly-hop 1.1s ease-in-out infinite;
}

:root:not([data-motion="reduced"]) .fly-working .fly-stack .fly-glyph:nth-child(2) {
  animation-delay: 160ms;
}

:root:not([data-motion="reduced"]) .fly-working .fly-stack .fly-glyph:nth-child(3) {
  animation-delay: 320ms;
}

/* The task box: what to do on top; under it, how steps are approved, the
   model, and send. */
.fly-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  margin: 0 12px 12px;
  padding: 8px 8px 8px 14px;
  border-radius: 16px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(0, 0, 0, 0.12);
}

.fly-composer-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-left: -6px;
}

.fly-composer-bar .fly-model {
  min-width: 0;
  margin-left: auto;
}

/* Approvals, as Work's chip. */
.fly-approve {
  flex: none;
  min-width: 0;
  max-width: 200px;
}

.fly-approve-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Its menu opens upwards (the box sits at the foot of the page). */
.fly-approve-menu {
  z-index: 30;
  transform-origin: bottom left;
  animation-name: fly-menu-up;
}

/* Pop-ups opened on a page that moves the window (MyFlyCursor's approvals
   and model menus are added to the page itself) take clicks, not drags:
   without this, Windows treated a click on them as grabbing the window. */
.approve-menu,
.model-pop {
  -webkit-app-region: no-drag;
}

@keyframes fly-menu-up {
  from {
    opacity: 0;
    transform: translateY(4px) scale(0.98);
  }
}

/* A narrow page: the chip shows just its icon (its name is in its tooltip). */
@container (max-width: 1080px) {
  .fly-approve {
    padding: 0 9px;
  }

  .fly-approve-name {
    display: none;
  }
}

/* A removed cursor's saved chat: to read only. */
.fly-past-note {
  margin: 0 12px 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--control-on);
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.45;
}

.fly-composer:focus-within {
  box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--c) 70%, transparent), 0 6px 18px rgba(0, 0, 0, 0.12);
}

.fly-input {
  flex: 1;
  min-height: 34px;
  max-height: 180px;
  padding: 7px 0;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.45;
  resize: none;
}

.fly-input::placeholder {
  color: var(--text-2);
}

/* The cursor's model, in its box (as the model bar is in Chat's). */
.fly-model {
  flex: none;
  align-self: center;
  max-width: 230px;
  margin-bottom: 0;
  background: var(--control);
  color: var(--text);
}

.fly-model:hover {
  background: var(--control-on);
}

/* Following the model bar: a small link. */
.fly-model-follow {
  display: grid;
  flex: none;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: var(--control-on);
  color: var(--text-2);
}

.fly-model-follow svg {
  width: 12px;
  height: 12px;
}

.fly-model-pop {
  z-index: 30;
}

.fly-send {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  color: #fff;
  cursor: pointer;
  transition: transform 140ms var(--ease-out), filter 140ms ease;
}

.fly-send:hover {
  filter: brightness(1.08);
}

.fly-send:active {
  transform: scale(0.94);
}

.fly-send svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fly-send.is-stop svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
}

/* Pause beside Stop while a task runs; when paused, a green Carry on. */
.fly-pause {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1.5px var(--line);
  color: var(--text);
  cursor: pointer;
  transition: transform 140ms var(--ease-out), background-color 160ms ease;
}

.fly-pause:hover {
  background: var(--hover);
}

.fly-pause:active {
  transform: scale(0.94);
}

.fly-pause svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.6;
  stroke-linecap: round;
}

.fly-pause.is-paused {
  background: #1a7f37;
  box-shadow: none;
  color: #fff;
}

.fly-pause.is-paused:hover {
  background: #166c2f;
}

.fly-pause.is-paused svg {
  fill: currentColor;
  stroke: none;
}

.fly-working.is-paused {
  color: var(--text);
  font-weight: 600;
}

/* Settings. */
.fly-settings {
  display: grid;
  align-content: start;
  gap: 4px;
  min-height: 0;
  padding: 10px 18px 16px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.fly-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 8px 18px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.fly-row-label {
  display: grid;
  gap: 2px;
  font-size: 0.875rem;
  font-weight: 550;
}

.fly-row-hint {
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.4;
}

.fly-row-control {
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.fly-text,
.fly-select {
  width: 100%;
  max-width: 320px;
  height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: 9px;
  outline: none;
  background: var(--control-on);
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
}

.fly-text:focus,
.fly-select:focus {
  box-shadow: 0 0 0 1.5px var(--focus);
}

.fly-pair {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 320px;
}

.fly-swatches {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: 330px;
}

.fly-swatch {
  position: relative;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--c);
  cursor: pointer;
  transition: transform 140ms var(--ease-out);
}

.fly-swatch:hover {
  transform: scale(1.1);
}

.fly-swatch.is-on {
  box-shadow: 0 0 0 2px var(--sheet-solid), 0 0 0 4px var(--c);
}

.fly-swatch-custom {
  overflow: hidden;
  background: conic-gradient(#ff5c8a, #f5b301, #22c55e, #06b6d4, #3b82f6, #8b5cf6, #ff5c8a);
}

.fly-swatch-custom .fly-color-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.fly-settings-foot {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
}

.fly-remove {
  color: var(--bad);
}

/* Activity: the swarm's log. */
.fly-activity-list {
  display: grid;
  align-content: start;
  gap: 6px;
  flex: 1;
  min-height: 0;
  padding: 10px;
  border-radius: 14px;
  background: var(--control);
  overflow-y: auto;
  scrollbar-width: thin;
  font: 0.75rem/1.45 ui-monospace, "Cascadia Mono", Consolas, monospace;
}

.fly-act {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
}

.fly-act time {
  color: var(--text-2);
}

.fly-act-tag {
  padding: 0 6px;
  border-radius: 5px;
  background: color-mix(in srgb, var(--c) 22%, transparent);
  color: var(--c);
  font-weight: 700;
}

[data-theme="light"] .fly-act-tag {
  color: color-mix(in srgb, var(--c) 70%, #000);
}

.fly-act-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fly-act-empty {
  margin: 0;
  color: var(--text-2);
  font-family: inherit;
}

@media (max-width: 1280px) {
  .fly-body {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .fly-activity {
    display: none;
  }
}

@media (max-width: 860px) {
  .fly-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .fly-light {
    display: none;
  }

  .fly-list {
    max-height: 140px;
  }
}

/* ---- Auto correct (autocorrect.js): a button by the model or effort, and a
   small window with each mistake, its fix and a preview. ---- */
.autocorrect-wrap {
  position: relative;
  display: inline-flex;
  flex: none;
}

.autocorrect-wrap:empty {
  display: none;
}

.autocorrect-chip {
  gap: 6px;
  max-width: 220px;
  white-space: nowrap;
}

.autocorrect-chip:hover,
.autocorrect-chip[aria-expanded="true"] {
  background: var(--control-on);
}

.autocorrect-icon {
  flex: none;
  width: 15px;
  height: 15px;
}

.autocorrect-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* "Fix as I type" is on: a small dot in your accent. */
.autocorrect-dot {
  display: none;
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.autocorrect-chip.is-live .autocorrect-dot {
  display: block;
}

/* A word just mended as you typed. */
.autocorrect-chip.is-flash {
  color: var(--accent);
}

/* Under the box, a glass pill like its neighbours. */
.composer-meta .autocorrect-chip {
  height: 30px;
  padding: 0 11px;
  border-radius: 15px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text);
}

/* In a cursor's task box it sits just left of the model. */
.fly-composer-bar .autocorrect-wrap {
  margin-left: auto;
}

.fly-composer-bar .autocorrect-wrap + .fly-model {
  margin-left: 0;
}

.autocorrect-pop {
  position: absolute;
  z-index: 40;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  gap: 10px;
  width: min(430px, 86vw);
  max-height: min(560px, 70vh);
  padding: 14px;
  overflow-y: auto;
  border-radius: 16px;
  background: var(--sheet);
  backdrop-filter: blur(28px) saturate(150%);
  box-shadow: 0 0 0 1px var(--line), 0 18px 48px rgba(0, 0, 0, 0.24);
  color: var(--text);
  font-size: 0.8125rem;
  text-align: left;
  cursor: default;
  -webkit-app-region: no-drag;
}

.autocorrect-pop.is-above {
  top: auto;
  bottom: calc(100% + 8px);
}

.autocorrect-pop.is-start {
  right: auto;
  left: 0;
}

/* MAX CODE's row under the box is full: the button is its icon there (its
   name shows on hover). */
[data-mode="code"] .composer-meta .autocorrect-label {
  display: none;
}

[data-mode="code"] .composer-meta .autocorrect-chip {
  padding: 0 9px;
}

/* …and "Fix as I type" is a dot on its corner, taking no room. */
[data-mode="code"] .composer-meta .autocorrect-dot {
  position: absolute;
  top: 5px;
  right: 5px;
}

.ac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ac-title {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 650;
}

.ac-title svg {
  width: 16px;
  height: 16px;
}

.ac-close {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-2);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
}

.ac-close:hover {
  background: var(--hover);
  color: var(--text);
}

.ac-status,
.ac-count {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--text-2);
  line-height: 1.45;
}

.ac-status.is-clean {
  color: var(--ok);
}

.ac-status.is-bad {
  color: var(--bad);
}

.ac-status svg {
  flex: none;
  width: 16px;
  height: 16px;
}

/* The list's head: tick every word at once, and the count. */
.ac-all {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 9px;
  padding: 0 10px;
  color: var(--text-2);
  cursor: pointer;
}

.ac-all-text {
  color: var(--text);
  font-weight: 600;
}

.ac-all-hint {
  font-size: 0.75rem;
}

.ac-list {
  display: grid;
  gap: 6px;
}

.ac-row {
  display: grid;
  grid-template-columns: auto minmax(0, auto) auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 8px;
  padding: 7px 8px 7px 10px;
  border-radius: 11px;
  background: var(--control);
}

.ac-row.is-kept {
  opacity: 0.6;
}

.ac-use {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.ac-word {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  overflow: hidden;
  color: var(--bad);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Only the word is struck through, not its "twice" or "unsure". */
.ac-word-text {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.ac-row.is-kept .ac-word {
  color: var(--text);
}

.ac-row.is-kept .ac-word-text {
  text-decoration: none;
}

.ac-word small {
  /* Its own box, so the word's strike-through doesn't run through it. */
  display: inline-block;
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 500;
  text-decoration: none;
}

.ac-arrow {
  width: 14px;
  height: 14px;
  color: var(--text-2);
}

.ac-fix {
  min-width: 0;
  height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  outline: none;
  background: var(--sheet);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ok);
  font: inherit;
  font-weight: 600;
}

.ac-fix:focus {
  box-shadow: inset 0 0 0 1.5px var(--focus);
}

.ac-row.is-kept .ac-fix {
  color: var(--text-2);
}

.ac-learn {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
}

.ac-learn:hover {
  background: var(--hover);
  color: var(--text);
}

.ac-learn svg {
  width: 16px;
  height: 16px;
}

.ac-alts {
  display: flex;
  flex-wrap: wrap;
  grid-column: 2 / -1;
  align-items: center;
  gap: 5px;
  color: var(--text-2);
  font-size: 0.75rem;
}

.ac-alt {
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 11px;
  background: var(--sheet);
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.ac-alt:hover {
  background: var(--control-on);
}

.ac-preview-wrap {
  display: grid;
  gap: 5px;
}

.ac-label {
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ac-preview {
  max-height: 110px;
  padding: 9px 11px;
  overflow-y: auto;
  border-radius: 11px;
  background: var(--control);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.ac-preview del {
  color: var(--bad);
  text-decoration-thickness: 1.5px;
}

.ac-preview ins {
  margin-left: 3px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--ok) 16%, transparent);
  color: var(--ok);
  font-weight: 600;
  text-decoration: none;
}

.ac-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.ac-foot .button {
  height: 32px;
  padding: 0 14px;
}

.ac-live {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ac-live-text {
  display: grid;
  gap: 2px;
}

.ac-live-name {
  font-weight: 600;
}

.ac-live-note {
  margin: 0;
  color: var(--text-2);
  font-size: 0.75rem;
  line-height: 1.4;
}

/* ---- The Terms, Privacy Policy, Refunds and Legal notice (legal.js) -------- */

.legal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: var(--scrim);
  -webkit-app-region: no-drag;
}

.legal-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  /* One column the card's width: the row of tabs never widens it. */
  grid-template-columns: minmax(0, 1fr);
  width: min(720px, calc(100% - 48px));
  height: min(760px, calc(100% - 64px));
  overflow: hidden;
  border-radius: 16px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(0, 0, 0, 0.28);
}

.legal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  box-shadow: 0 1px 0 var(--line);
}

/* When the tabs don't all fit (a phone), they scroll sideways. */
.legal-tabs {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.legal-tabs::-webkit-scrollbar {
  display: none;
}

.legal-tabs button {
  flex: none;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 550;
  white-space: nowrap;
  cursor: pointer;
}

.legal-tabs button:hover {
  color: var(--text);
}

.legal-tabs button[aria-selected="true"] {
  background: var(--control);
  color: var(--text);
}

.legal-close {
  flex: none;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-2);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.legal-close:hover {
  background: var(--control);
  color: var(--text);
}

.legal-body {
  overflow: auto;
  padding: 26px 36px 32px;
  color: var(--text);
  font-size: 0.875rem;
  line-height: 1.6;
  user-select: text;
}

.legal-body:focus-visible {
  outline: none;
}

.legal-title {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.legal-meta,
.legal-foot {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 0.75rem;
}

.legal-intro {
  margin: 16px 0 0;
}

.legal-body h3 {
  margin: 22px 0 4px;
  font-size: 0.9375rem;
  font-weight: 620;
  letter-spacing: -0.01em;
}

.legal-body p,
.legal-body ul {
  margin: 6px 0 0;
}

.legal-body ul {
  padding-left: 20px;
}

.legal-body li + li {
  margin-top: 3px;
}

.legal-foot {
  margin-top: 28px;
  padding-top: 12px;
  box-shadow: 0 -1px 0 var(--line);
}

/* A phone: the documents fill the screen. */
@media (max-width: 600px), (max-height: 500px) and (hover: none) and (pointer: coarse) {
  .legal-card {
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  .legal-head {
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
  }

  .legal-tabs button {
    height: 34px;
  }

  .legal-close {
    width: 36px;
    height: 36px;
  }

  .legal-body {
    padding: 20px max(18px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    overscroll-behavior: contain;
  }
}

/* A fact the owner hasn't filled in yet ({{…}} in legal.json). */
.legal-todo {
  padding: 0 3px;
  border-radius: 4px;
  background: rgba(255, 196, 0, 0.32);
  color: inherit;
}

.legal-links {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 0.75rem;
}

.legal-links .link-button {
  color: var(--text-2);
  font-weight: 500;
}

.legal-links .link-button:hover {
  color: var(--text);
}

/* Sign-up: month and year of birth, and the agreement. */
.auth-birth-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 8px;
}

.auth-field select {
  height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 11px;
  background: var(--control);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 400;
  outline: none;
}

.auth-field select:focus {
  box-shadow: inset 0 0 0 1.5px var(--text);
}

.auth-agree {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-2);
  cursor: pointer;
}

.auth-agree input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: var(--text);
}

.auth-agree .link-button {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-legal {
  margin: 0;
  text-align: center;
}

/* The Terms and Refund Policy next to the Subscribe button (plan.js). */
.plan-legal {
  color: var(--text-2);
  font-size: 0.8125rem;
}

.plan-legal .link-button {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Pictures and videos from Create say they were made by AI. */
.create-view-ai {
  padding: 1px 7px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 0.75em;
  font-weight: 600;
  letter-spacing: 0.02em;
}


/* ---- MAX CODE's chips: model, effort and access stay on the right, even when
   the row wraps; a long project name is cut short, so one row usually fits. */
[data-mode="code"] .composer-meta .meta-end {
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

[data-mode="code"] .composer-meta .tray-label {
  max-width: 130px;
}

/* MAX CODE: Auto correct in the box beside the mic, an icon like it (its name
   shows on hover; "Fix as I type" is a dot on its corner). */
[data-mode="code"] .composer-tools .autocorrect-chip {
  position: relative;
  width: 34px;
  height: 34px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
}

[data-mode="code"] .composer-tools .autocorrect-chip:hover,
[data-mode="code"] .composer-tools .autocorrect-chip[aria-expanded="true"] {
  background: var(--control-on);
}

[data-mode="code"] .composer-tools .autocorrect-icon {
  width: 18px;
  height: 18px;
}

[data-mode="code"] .composer-tools .autocorrect-label {
  display: none;
}

[data-mode="code"] .composer-tools .autocorrect-dot {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* Auto correct's panel, slid in when it would be cut off (autocorrect.js). */
.autocorrect-pop {
  translate: var(--ac-shift, 0) 0;
}

/* The to-do list's step in progress: an arc running round the ring, on one
   clock for every redraw (conversation.js inStep). */
.msg-plan-list li[data-status="in_progress"] .msg-plan-box.is-live {
  position: relative;
  box-shadow: inset 0 0 0 1.5px var(--track);
}

.msg-plan-box.is-live::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid transparent;
  border-top-color: var(--text);
  border-right-color: var(--text);
  border-radius: 50%;
  animation: tool-spin 900ms linear infinite;
  animation-delay: var(--spin-at, 0ms);
}

.tool-spin {
  animation-delay: var(--spin-at, 0ms);
}

[data-motion="reduced"] .msg-plan-box.is-live::after {
  animation-duration: 2.4s;
}

/* Axon working in a chat: the list's blinking dot (history.js). */
.recent-open:has(.recent-busy) {
  display: flex;
  align-items: center;
  gap: 8px;
}

.recent-open:has(.recent-busy) .recent-title {
  min-width: 0;
}

.recent-busy {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text);
  animation: recent-blink 1.4s ease-in-out infinite;
  animation-delay: var(--blink-at, 0ms);
}

@keyframes recent-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.15;
  }
}

[data-motion="reduced"] .recent-busy {
  animation: none;
}


/* ---- Pictures, looked at closely (imageview.js) ---------------------------- */

.viewer {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: rgba(8, 9, 11, 0.86);
  backdrop-filter: blur(6px);
  color: #f5f5f7;
  -webkit-app-region: no-drag;
}

.viewer-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 12px 8px 18px;
}

.viewer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 550;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer-tools {
  display: flex;
  align-items: center;
  gap: 4px;
}

.viewer-tool {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  place-items: center;
  cursor: pointer;
}

.viewer-tool:hover {
  background: rgba(255, 255, 255, 0.12);
}

.viewer-tool svg {
  width: 18px;
  height: 18px;
}

.viewer-zoom {
  min-width: 46px;
  color: rgba(245, 245, 247, 0.7);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.viewer-action {
  height: 32px;
  margin: 0 4px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 550;
  cursor: pointer;
}

.viewer-action:hover {
  background: rgba(255, 255, 255, 0.22);
}

.viewer-stage {
  position: relative;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.viewer-stage.is-dragging {
  cursor: grabbing;
}

.viewer-image {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  transform-origin: 0 0;
  user-select: none;
  image-rendering: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
}

.viewer-missing {
  margin: 20vh auto 0;
  color: rgba(245, 245, 247, 0.7);
  text-align: center;
}

.picture-menu {
  position: fixed;
  z-index: 130;
  display: grid;
  min-width: 180px;
  padding: 5px;
  border-radius: 12px;
  background: var(--sheet-solid);
  box-shadow: 0 0 0 1px var(--line), 0 14px 34px rgba(0, 0, 0, 0.22);
  color: var(--text);
}

.picture-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  text-align: left;
  cursor: pointer;
}

.picture-menu-item:hover,
.picture-menu-item:focus-visible {
  background: var(--hover);
  outline: none;
}

.picture-menu-item svg {
  width: 16px;
  height: 16px;
  color: var(--text-2);
}

/* A pasted picture's thumbnail in the box opens the viewer. */
.attach-inspect {
  display: block;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  line-height: 0;
  cursor: zoom-in;
}

.attach-inspect:focus-visible .attach-thumb {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
}


/* ---- MAX CODE's private browser (browser.js) ---------------------------------
   It takes the right of the glass like the Code panel (it wears its class for
   the box), and they take turns. Only in MAX CODE. */
:root:not([data-mode="code"]) .browser-toggle,
:root:not([data-mode="code"]) .browser-panel {
  display: none;
}

.browser-toggle[aria-pressed="true"] {
  background: var(--text);
  color: var(--sheet-solid);
}

.browser-panel {
  grid-template-rows: auto auto minmax(0, 1fr);
}

[data-mode="code"] .page-home.has-browser {
  padding-right: calc(min(60%, 1000px) + 26px);
}

.page-home.has-browser .work-stats,
.page-home.has-browser .work-stats-tip {
  display: none;
}

[data-mode="code"] .page-home.has-browser > .work-start.work-start {
  left: calc((100% - min(60%, 1000px) - 26px) / 2);
  width: min(400px, calc(100% - min(60%, 1000px) - 74px));
}

.browser-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 46px;
  padding: 6px 8px 0 10px;
  border-bottom: 1px solid var(--line);
}

.browser-tabs {
  display: flex;
  flex: 0 1 auto;
  align-items: flex-end;
  gap: 2px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.browser-tab {
  display: flex;
  flex: 0 1 200px;
  align-items: center;
  min-width: 90px;
  height: 36px;
  border-radius: 10px 10px 0 0;
  color: var(--text-2);
}

.browser-tab.is-active {
  background: var(--control);
  color: var(--text);
}

.browser-tab:not(.is-active):hover {
  background: var(--hover);
}

.browser-tab-open {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 100%;
  padding: 0 4px 0 11px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
}

.browser-tab-open svg {
  flex: none;
  width: 14px;
  height: 14px;
}

.browser-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-tab-close {
  display: grid;
  flex: none;
  width: 22px;
  height: 22px;
  margin-right: 6px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: inherit;
  place-items: center;
  cursor: pointer;
  opacity: 0.6;
}

.browser-tab-close:hover {
  background: var(--hover);
  opacity: 1;
}

.browser-tab-close svg {
  width: 13px;
  height: 13px;
}

.browser-tab-spin,
.browser-server-spin {
  flex: none;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--track);
  border-top-color: var(--text);
  border-radius: 50%;
  animation: tool-spin 800ms linear infinite;
}

.browser-new {
  align-self: center;
}

.browser-private {
  flex: none;
  margin-left: auto;
  padding: 3px 9px;
  border-radius: 99px;
  background: var(--control);
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.browser-head > .browser-tool:last-child {
  align-self: center;
}

.browser-bar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
}

.browser-tool {
  display: grid;
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--text-2);
  place-items: center;
  cursor: pointer;
}

.browser-tool:hover:not(:disabled) {
  background: var(--hover);
  color: var(--text);
}

.browser-tool:disabled {
  opacity: 0.35;
  cursor: default;
}

.browser-tool svg {
  width: 17px;
  height: 17px;
}

.browser-address {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: 34px;
  margin: 0 6px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--control);
  box-shadow: inset 0 0 0 1px transparent;
}

.browser-address:focus-within {
  box-shadow: inset 0 0 0 1.5px var(--text);
}

.browser-lock svg {
  display: block;
  width: 14px;
  height: 14px;
  color: var(--text-2);
}

.browser-url {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  font-size: 0.8125rem;
  outline: none;
}

.browser-stage {
  position: relative;
  min-height: 0;
  background: #fff;
}

.browser-view {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.browser-view[hidden] {
  display: none !important;
}

.browser-start,
.browser-fail {
  position: absolute;
  inset: 0;
  display: grid;
  overflow: auto;
  padding: 32px 20px;
  background: var(--sheet-solid);
  color: var(--text);
  place-items: center;
}

.browser-start[hidden],
.browser-fail[hidden] {
  display: none;
}

.browser-start-card,
.browser-fail-card {
  width: min(480px, 100%);
}

.browser-start-title {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.browser-start-note,
.browser-start-foot,
.browser-fail-text {
  margin: 0;
  color: var(--text-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.browser-start-foot {
  margin-top: 16px;
  text-align: center;
}

.browser-start-foot .link-button {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.browser-start-empty {
  display: grid;
  gap: 12px;
  justify-items: start;
}

.browser-servers {
  display: grid;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line);
}

.browser-server {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  padding: 8px 10px 8px 14px;
}

.browser-server + .browser-server {
  border-top: 1px solid var(--line);
}

.browser-server-icon svg {
  display: block;
  width: 18px;
  height: 18px;
  color: var(--text-2);
}

.browser-server.is-running .browser-server-icon svg {
  color: var(--text);
}

.browser-server-text {
  display: grid;
  min-width: 0;
}

.browser-server-name {
  font-size: 0.875rem;
  font-weight: 550;
}

.browser-server-note {
  overflow: hidden;
  color: var(--text-2);
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.browser-server.is-failed .browser-server-note {
  color: var(--warn, #c8443a);
}

.browser-server-port {
  color: var(--text-2);
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 0.75rem;
}

.browser-server-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.browser-server-button {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: var(--control);
  color: var(--text);
  place-items: center;
  cursor: pointer;
}

.browser-server-button:hover {
  background: var(--hover);
}

.browser-server-button svg {
  width: 15px;
  height: 15px;
}

.browser-server-go {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: var(--text);
  color: var(--sheet-solid);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.browser-server-spin {
  width: 16px;
  height: 16px;
  margin: 8px;
}

.browser-server-log {
  grid-column: 1 / -1;
  margin: 0;
  max-height: 120px;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--control);
  color: var(--text-2);
  font-size: 0.6875rem;
  white-space: pre-wrap;
}

.browser-fail-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 650;
}

.browser-fail-buttons {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* The … menu: open the page elsewhere, copy, save a picture, its width, clear. */
.browser-bar {
  position: relative;
}

.chat-menu.browser-menu {
  top: calc(100% - 4px);
  right: 10px;
  left: auto;
  z-index: 12;
  min-width: 260px;
  transform-origin: top right;
}

.browser-menu .chat-menu-item:disabled {
  opacity: 0.4;
  cursor: default;
}

.browser-menu .chat-menu-item:disabled:hover {
  background: transparent;
}

.browser-menu-label {
  flex: 1;
}

.browser-menu-hint {
  color: var(--text-2);
  font-size: 0.75rem;
}

.browser-menu-check {
  display: grid;
  place-items: center;
  width: 16px;
}

.browser-menu-check svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.4;
}

.browser-menu-sep {
  height: 1px;
  margin: 5px 8px;
  background: var(--line);
}

.browser-menu-heading {
  margin: 4px 10px 2px;
  color: var(--text-2);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* A desktop, tablet or phone width: the page sits in the middle, on grey. */
.browser-stage[data-size="desktop"],
.browser-stage[data-size="tablet"],
.browser-stage[data-size="phone"] {
  background: var(--control);
}

.browser-stage:not([data-size="fit"]) .browser-view {
  background: #fff;
  box-shadow: 0 0 0 1px var(--line), 0 10px 30px rgba(0, 0, 0, 0.12);
}

/* Axon's tab while a task works in it: a spark that breathes. */
.browser-tab.is-agent .browser-tab-open svg {
  color: var(--accent);
  animation: browser-agent-breathe 1.6s ease-in-out infinite;
}

@keyframes browser-agent-breathe {
  50% {
    opacity: 0.45;
  }
}

:root[data-motion="reduced"] .browser-tab.is-agent .browser-tab-open svg {
  animation: none;
}

/* The turning star under an answer is made again on some redraws; it starts
   where one clock has got to, so it doesn't jump back (conversation.js inStep). */
.msg-mark.is-live,
[data-motion="reduced"] .msg-mark.is-live {
  animation-delay: var(--spin-at, 0ms);
}

/* ---- The to-do list under the work, and Restart (conversation.js) ----------
   As Claude Code pins its task list under the newest message: the list comes
   after the steps, with what is happening now just below it. */
.msg-body > .msg-plan {
  margin: 14px 0 8px;
}

.msg-restart {
  display: flex;
  margin-top: 6px;
}

.msg-restart-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  box-shadow: 0 0 0 1px var(--line);
  color: var(--text-2);
  font: inherit;
  font-family: var(--font-sans);
  font-size: 0.78125rem;
  font-weight: 550;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.msg-restart-button:hover {
  background: var(--hover);
  color: var(--text);
}

.msg-restart-button svg {
  width: 14px;
  height: 14px;
}

/* ---- The chip under the box in Work and MAX CODE (contextpop.js) -----------
   Its number is the tokens this chat has used; its ring, how much of the to-do
   list is done; while Axon works the ring breathes. Opened: what Axon is on. */
.context.is-working .context-ring {
  animation: ctx-breathe 1.6s ease-in-out infinite;
}

@keyframes ctx-breathe {
  50% {
    opacity: 0.45;
  }
}

[data-motion="reduced"] .context.is-working .context-ring {
  animation: none;
}

.ctx-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ctx-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text);
  animation: recent-blink 1.4s ease-in-out infinite;
}

.ctx-now {
  display: grid;
  gap: 2px;
  margin: 10px 0 0;
  line-height: 1.4;
}

.ctx-now strong {
  font-weight: 650;
}

.ctx-doing {
  overflow: hidden;
  color: var(--text-2);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ctx-todo {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--control);
}

.ctx-todo-head {
  display: flex;
  justify-content: space-between;
  margin: 0 0 6px;
  color: var(--text-2);
  font-size: 0.75rem;
  font-weight: 600;
}

.ctx-todo-list {
  display: grid;
  gap: 5px;
  max-height: 168px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
}

.ctx-todo-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
}

.ctx-todo-box {
  display: grid;
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 1px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--track);
  place-items: center;
}

.ctx-todo-box svg {
  width: 10px;
  height: 10px;
}

.ctx-todo-list li[data-status="completed"] .ctx-todo-box {
  background: var(--text);
  box-shadow: none;
  color: var(--sheet-solid);
}

.ctx-todo-list li[data-status="completed"] .ctx-todo-text {
  color: var(--text-2);
  text-decoration: line-through;
  text-decoration-color: color-mix(in srgb, var(--text-2) 60%, transparent);
}

.ctx-todo-list li[data-status="in_progress"] .ctx-todo-box {
  box-shadow: inset 0 0 0 1.5px var(--text);
}

.ctx-todo-list li[data-status="in_progress"] .ctx-todo-text {
  font-weight: 650;
}

.ctx-used {
  margin-top: 12px;
}

.ctx-restart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  height: 32px;
  margin-top: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--text);
  color: var(--sheet-solid);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.ctx-restart:hover {
  opacity: 0.88;
}

.ctx-restart svg {
  width: 14px;
  height: 14px;
}

/* The website on a wide screen: no window buttons, so the top-right tools move
   into their place. */
.web-preview .home-tools {
  right: 16px;
}

/* A phone: the website on a small screen. The desktop window never gets this
   narrow (main.js MIN_WIDTH), so none of this reaches the app. The frame goes,
   the sidebar becomes a drawer behind a menu button, Chat / Work sit beside
   that button, and MAX CODE and MyFlyCursor (desktop only) leave the top bar. */
.phone-menu,
.phone-scrim,
.settings-back {
  display: none;
}

/* (A phone on its side too: a short screen you can only touch.) */
@media (max-width: 600px), (max-height: 500px) and (hover: none) and (pointer: coarse) {
  .shell,
  .web-preview .shell {
    inset: 0;
    grid-template-columns: 0 minmax(0, 1fr) 0;
    padding: 0;
    border-radius: 0;
  }

  .stage {
    grid-column: 2;
    border-radius: 0;
  }

  .stage::after {
    display: none;
  }

  .rail-main {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 60;
    width: min(var(--rail-open), 84vw);
    padding-top: max(9px, env(safe-area-inset-top));
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    background: var(--frame);
    box-shadow: 0 0 0 1px var(--line), 0 24px 60px rgba(0, 0, 0, 0.28);
    transform: translateX(-104%);
    visibility: hidden;
    transition: transform 320ms var(--ease-out), visibility 0s linear 320ms;
  }

  [data-sidebar="open"] .rail-main {
    transform: none;
    visibility: visible;
    transition: transform 320ms var(--ease-out);
  }

  .phone-scrim {
    position: fixed;
    inset: 0;
    z-index: 59;
    display: block;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.32);
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms ease;
  }

  [data-sidebar="open"] .phone-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .phone-menu {
    position: fixed;
    top: max(14px, env(safe-area-inset-top));
    left: 12px;
    z-index: 30;
    display: grid;
    width: 36px;
    height: 36px;
  }

  .mode-bar {
    top: max(14px, env(safe-area-inset-top));
    right: auto;
    left: 56px;
    margin-inline: 0;
  }

  .mode-bar .mode-code,
  .mode-bar .fly-string,
  .mode-bar .fly-pill {
    display: none;
  }

  .mode-switch button {
    min-width: 58px;
    height: 30px;
  }

  .home-tools,
  .web-preview .home-tools {
    top: max(15px, env(safe-area-inset-top));
    right: 12px;
    gap: 4px;
  }

  /* Pages (My API, Search, Settings…) fill the screen instead of floating as
     cards, and leave the top left to the menu button. */
  .page-panel,
  .page:has(> .settings-sheet) {
    padding: 0;
  }

  .panel,
  .settings-sheet {
    width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
  }

  .panel {
    padding: max(60px, calc(env(safe-area-inset-top) + 46px)) 16px max(14px, env(safe-area-inset-bottom));
  }

  /* The Account page draws its panel edge to edge (no padding of its own):
     its top leaves the menu button room too. */
  .page-account .panel {
    padding-top: max(46px, calc(env(safe-area-inset-top) + 34px));
  }

  /* Home, as on ChatGPT's phone site: the greeting in the middle, the
     suggestions just above the box, and the box at the foot of the screen. */
  .page-home {
    align-content: stretch;
    place-items: stretch;
    padding: max(64px, calc(env(safe-area-inset-top) + 52px)) 12px max(10px, env(safe-area-inset-bottom));
  }

  .page-home .home {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
  }

  .page-home:not(.has-thread) .home-title {
    order: 1;
    margin: auto 8px;
    font-size: 1.625rem;
  }

  .page-home:not(.has-thread) .home-note {
    order: 2;
  }

  .page-home:not(.has-thread) .suggestions {
    order: 3;
    margin: 0 0 12px;
    padding: 0 6px;
  }

  .page-home:not(.has-thread) .composer {
    order: 4;
  }

  .page-home:not(.has-thread) .work-tray {
    order: 5;
  }

  .page-home:not(.has-thread) .composer-meta {
    order: 6;
  }

  .page-home.has-thread {
    padding: max(60px, calc(env(safe-area-inset-top) + 48px)) 10px max(10px, env(safe-area-inset-bottom));
  }

  /* The box: the text on top and one row of controls under it. Labels that
     don't fit become their icons (the approvals chip, the effort level). */
  .composer,
  .composer.is-tall {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "goal goal"
      "details details"
      "lead tools";
    padding: 10px 8px 8px;
    border-radius: 24px;
  }

  .composer .composer-goal {
    padding: 2px 8px;
    font-size: 1rem;
  }

  .composer-details {
    grid-template-columns: minmax(0, 1fr);
  }

  .composer-lead {
    flex-wrap: nowrap;
    gap: 2px;
  }

  .composer-tools {
    justify-content: flex-end;
    min-width: 0;
    gap: 2px;
  }

  .composer-tools .model-bar {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 100%;
  }

  .approve-chip [data-approve-label],
  .effort-chip-label {
    display: none;
  }

  .approve-chip {
    padding-inline: 8px;
  }

  .work-tray {
    margin-inline: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  /* Leaving Work the tray just goes: the column moves too much on a phone
     for the glide back to land in the right place. */
  .work-tray.is-leaving {
    display: none;
  }

  /* Settings, as on ChatGPT's phone site: a list of sections, and a section
     opens full screen with a back button (settingsnav.js). The menu button
     steps aside: the close button takes you back to the app. */
  .shell:has([data-page="settings"]:not([hidden])) .phone-menu {
    display: none;
  }

  .settings-sheet {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .settings-head {
    gap: 8px;
    min-height: 56px;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px 18px;
  }

  .settings-back {
    display: none;
  }

  .settings-sheet[data-phone-view="list"] .settings-panes {
    display: none;
  }

  .settings-sheet[data-phone-view="list"] .settings-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px 12px max(16px, env(safe-area-inset-bottom));
    overflow-y: auto;
    border-bottom: 0;
  }

  .settings-sheet[data-phone-view="list"] .settings-search {
    flex: none;
    height: 40px;
    margin: 0 0 12px;
  }

  .settings-sheet[data-phone-view="list"] .settings-nav-group {
    display: grid;
    gap: 2px;
  }

  .settings-sheet[data-phone-view="list"] .settings-nav-group + .settings-nav-group::before {
    display: block;
    margin: 8px 10px;
  }

  .settings-sheet[data-phone-view="list"] .settings-nav-item {
    width: 100%;
    min-height: 46px;
    font-size: 0.9375rem;
  }

  .settings-sheet[data-phone-view="list"] .settings-nav-item[aria-current] {
    background: transparent;
  }

  .settings-sheet[data-phone-view="list"] .settings-nav-out {
    display: inline-flex;
    margin-left: auto;
  }

  /* Searching from the list: the matching rows show under the box. */
  .settings-sheet[data-phone-view="list"].is-searching {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .settings-sheet[data-phone-view="list"].is-searching .settings-nav-group {
    display: none;
  }

  .settings-sheet[data-phone-view="list"].is-searching .settings-nav {
    padding-bottom: 0;
  }

  .settings-sheet[data-phone-view="list"].is-searching .settings-panes {
    display: block;
  }

  .settings-sheet[data-phone-view="pane"] .settings-nav,
  .settings-sheet[data-phone-view="pane"] #settings-title {
    display: none;
  }

  .settings-sheet[data-phone-view="pane"] .settings-back {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    margin-left: -8px;
    padding: 0 10px 0 6px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
  }

  .settings-back svg {
    width: 18px;
    height: 18px;
  }

  .settings-back:active {
    background: var(--control);
  }

  .settings-panes {
    padding: 18px 18px max(28px, env(safe-area-inset-bottom));
  }

  /* Each setting: words on top, its control under them, full width. */
  .settings-pane .setting {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .settings-pane .setting .swatches {
    gap: 8px;
  }

  /* Its 260px width basis would turn into height in a column. */
  .settings-pane .setting > .setting-text {
    flex-basis: auto;
  }

  /* iPhone Safari zooms into any text box or list under 16px when it is
     tapped (and doesn't zoom back out). */
  input[type="text"],
  input[type="search"],
  input[type="email"],
  input[type="password"],
  input[type="url"],
  input[type="number"],
  input[type="tel"],
  input:not([type]),
  textarea,
  select,
  .auth-field select {
    font-size: 1rem;
  }

  /* An on/off switch stays beside its words. */
  .settings-pane .setting:has(> .switch) {
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
  }

  .settings-pane .setting:has(> .switch) > .setting-text {
    flex: 1 1 auto;
    min-width: 0;
  }

  /* Lists over their details (My API, Chats, Library): the page scrolls as
     one, not as two half-height boxes that each scroll (on My API the form
     to add a key was squeezed into the bottom half). Picking a row brings its
     details into view (app.js). */
  .panel:has(> .panel-split:not([hidden])) {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .panel-split {
    flex: none;
    grid-template-rows: auto auto;
    min-height: auto;
  }

  .panel-split > .list,
  .panel-split > .detail {
    min-height: auto;
    overflow: visible;
  }

  /* The effort card fits across the screen (effort.js keeps it on it). */
  .effort-pop {
    width: min(312px, calc(100vw - 24px));
  }

  /* A chat's title menu has no room beside the menu button and Chat / Work
     (it sat hidden under them): on a phone, a chat is renamed, exported or
     deleted from Chats. */
  .chat-head {
    display: none;
  }

  /* Notes come down from the top, under the top bar: at the foot they'd
     cover the message box. Centred between both edges (from the middle
     they'd only get half the screen's width and wrap early). */
  .toast {
    top: calc(max(14px, env(safe-area-inset-top)) + 46px);
    right: 12px;
    bottom: auto;
    left: 12px;
    width: fit-content;
    max-width: none;
    margin-inline: auto;
    transform: none;
    animation-name: toast-in-top;
  }
}

@keyframes toast-in-top {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

/* A phone on its side: too short for the suggestions as well as the box and
   the row under it, so they go and the greeting gets smaller. */
@media (max-height: 500px) and (hover: none) and (pointer: coarse) {
  .page-home:not(.has-thread) .suggestions {
    display: none;
  }

  .page-home:not(.has-thread) .home-title {
    font-size: 1.375rem;
  }
}

@media (max-width: 600px) and (prefers-reduced-motion: reduce), (max-height: 500px) and (hover: none) and (pointer: coarse) and (prefers-reduced-motion: reduce) {
  .rail-main,
  [data-sidebar="open"] .rail-main {
    transition: none;
  }
}

/* Touch screens (the website on a phone or tablet). No grey flash over what's
   tapped, no text boosted on its own, and taps that don't wait to see if a
   second one follows (a double tap that would zoom). */
html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* The app is one screen, not a page: pulling down at the top of a chat
   doesn't reload it (Android's pull to refresh), and nothing bounces. */
html,
body {
  overscroll-behavior: none;
}

button,
a,
label,
select,
summary,
[role="button"],
[role="tab"],
[role="radio"],
[role="option"],
[role="switch"],
[role="menuitem"] {
  touch-action: manipulation;
}

/* A finger leaves no hover behind: a tapped button keeps its look, and dims
   only while it's pressed. */
@media (hover: none) {
  .button:hover {
    opacity: 1;
  }

  .button:active:not(:disabled) {
    opacity: 0.72;
  }

  .auth-time button:hover {
    color: var(--text-2);
  }

  .auth-time button[aria-checked="true"]:hover {
    color: var(--text);
  }

  /* Buttons that wait for the pointer to come near (a chat's "…" in the
     sidebar, the actions under your own message) are simply there: a finger
     can't hover to find them. */
  .recent-more,
  .side-more,
  .msg-user-foot,
  .create-item-bar {
    opacity: 1;
  }
}

/* The app lock (applock.js): over everything, with the page underneath hidden
   and inert. The desktop window can still be moved, minimised and closed. */
.applock {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 24px;
  /* Fully opaque: nothing of the chats underneath shows through. */
  background: var(--sheet-solid);
  color: var(--text);
  -webkit-app-region: drag;
}

/* Only the card fades in: the cover itself is there at once. */
.applock-card {
  animation: applock-in 220ms var(--ease-out) both;
}

.applock[hidden] {
  display: none;
}

@keyframes applock-in {
  from {
    opacity: 0;
  }
}

.applock-window {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 2px;
  -webkit-app-region: no-drag;
}

.applock-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(360px, 100%);
  text-align: center;
  -webkit-app-region: no-drag;
}

.applock-logo svg {
  display: block;
  width: 46px;
  height: 46px;
}

.applock-title {
  margin: 10px 0 0;
  font-size: 1.375rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.applock-sub {
  margin: 0 0 10px;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.applock-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 20px;
}

.applock-button svg {
  width: 18px;
  height: 18px;
}

.applock-error {
  min-height: 1.4em;
  margin: 2px 0 0;
  color: var(--del);
  font-size: 0.8125rem;
}

.applock-error:empty {
  visibility: hidden;
}

.applock-other {
  color: var(--text-2);
  font-size: 0.8125rem;
}

[data-motion="reduced"] .applock {
  animation: none;
}

/* ---- Settings › Desktop app › Updates (updates.js) ----------------------- */
.update-row {
  flex-wrap: wrap;
  align-items: flex-start;
}

.update-actions {
  display: flex;
  flex: none;
  gap: 8px;
  align-items: center;
}

.update-actions:empty {
  display: none;
}

/* The download, as a thin bar under the words. */
.update-bar {
  position: relative;
  height: 6px;
  max-width: 420px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--control-on);
}

.update-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: inherit;
  background: var(--accent);
  transition: width 160ms ease-out;
}

.update-bar[hidden],
.update-notes[hidden] {
  display: none;
}

/* What's new: the release's own words, short. */
.update-notes {
  max-width: 62ch;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--control);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.update-notes strong {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
}

.update-notes p {
  margin: 0;
  color: var(--text-2);
  white-space: pre-line;
}

/* A new version is out: a small dot on the Settings button. */
.rail-button.has-update {
  position: relative;
}

.rail-button.has-update::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  pointer-events: none;
}

[data-motion="reduced"] .update-bar span {
  transition: none;
}

/* Working circles, thicker (as Claude draws them): the to-do list's step in
   progress, the steps' spinner, and the browser's. */
.msg-plan-list li[data-status="in_progress"] .msg-plan-box.is-live {
  box-shadow: inset 0 0 0 2.5px var(--track);
}

.msg-plan-box.is-live::after {
  border-width: 2.5px;
}

.tool-spin {
  border-width: 2.5px;
}

.browser-tab-spin,
.browser-server-spin {
  border-width: 2px;
}

/* Settings › Account (auth.js): the email, plan, password, sign out and
   delete rows. Delete is red words on the usual button, not a red block. */
.account-actions {
  display: flex;
  flex: none;
  gap: 8px;
}
.account-email {
  color: var(--text);
  font-weight: 500;
  overflow-wrap: anywhere;
}
.account-actions .button-danger {
  background: var(--control-on);
  color: var(--bad);
}
.account-actions .button-danger:hover {
  background: color-mix(in srgb, var(--bad) 14%, var(--control-on));
}

/* T-CUTTER, the token cutter (tcutter.js): the last chip under the box. Off it
   is quiet like the others; on, it takes the accent like Use cursor, and the
   token the scissors cut fills in. Its menu opens upwards, right-aligned, as
   the approvals menu does. */
.tcutter-wrap {
  position: relative;
}
.tcutter-chip {
  gap: 5px;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: color 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
}
.tcutter-chip:hover {
  color: var(--text);
}
.tcutter-chip:active {
  transform: scale(0.97);
}
.tcutter-icon {
  width: 16px;
  height: 16px;
  flex: none;
}
.tcutter-chip[aria-pressed="true"] {
  background: color-mix(in srgb, var(--accent) 16%, var(--sheet));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--text);
}
.tcutter-chip[aria-pressed="true"] .tcutter-token {
  fill: var(--accent);
  stroke: var(--accent);
}
.tcutter-chip[aria-pressed="true"] .tcutter-token-dot {
  stroke: var(--sheet-solid);
}
.tcutter-menu,
.composer-meta .tcutter-menu {
  top: auto;
  right: 0;
  bottom: calc(100% + 8px);
  left: auto;
  width: 340px;
  transform-origin: bottom right;
}
.tcutter-head {
  display: grid;
  gap: 2px;
  margin: 4px 8px 6px;
}
.tcutter-head .tcutter-title {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.02em;
}
.tcutter-lede {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--text-2);
}
/* How much each level cuts: none to three bars. */
.tcutter-level {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  height: 16px;
}
.tcutter-level i {
  width: 4px;
  border-radius: 2px;
  background: var(--line);
}
.tcutter-level i:nth-child(1) { height: 7px; }
.tcutter-level i:nth-child(2) { height: 11px; }
.tcutter-level i:nth-child(3) { height: 15px; }
.tcutter-level[data-step="brief"] i:nth-child(-n + 1),
.tcutter-level[data-step="cutter"] i:nth-child(-n + 2),
.tcutter-level[data-step="ultra"] i {
  background: var(--accent);
}
.tcutter-credits {
  justify-self: start;
  margin: 4px 8px 2px;
  font-size: 0.75rem;
}

/* Legal › Credits: each license text folded under its name. */
.legal-license {
  margin: 6px 0;
}
.legal-license summary {
  cursor: pointer;
  font-weight: 500;
}
.legal-license pre {
  max-height: 320px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: var(--control-on);
  font: 0.75rem/1.5 ui-monospace, "Cascadia Mono", Consolas, monospace;
  white-space: pre-wrap;
}

/* One line of chips (workspace.js fitRow): when the row under the box (Chat,
   MAX CODE) or in it (Work) runs out of room, labels fold into their icons,
   the least needed first. Each chip keeps its name as a tooltip. */
[data-fold~="cursor"] .cursor-chip > span,
[data-fold~="autocorrect"] .autocorrect-chip .autocorrect-label,
[data-fold~="tcutter"] .tcutter-label,
[data-fold~="effort"] .effort-chip-label,
[data-fold~="approval"] .approve-chip [data-approve-label],
[data-fold~="model-name"] .model-bar-name {
  display: none;
}
[data-fold~="cursor"] .cursor-chip,
[data-fold~="autocorrect"] .autocorrect-chip,
[data-fold~="tcutter"] .tcutter-chip,
[data-fold~="approval"] .approve-chip {
  padding-inline: 8px;
}
[data-fold~="model"] .model-bar-name {
  max-width: 120px;
}
[data-fold~="project"] .tray-label {
  max-width: 84px;
}
/* The narrowest (MAX CODE beside the Code panel): the project as its folder
   icon, the token count as its ring (each keeps its name as a tooltip). */
[data-fold~="project-name"] [data-folder-button] .tray-label,
[data-fold~="context"] .context-count {
  display: none;
}

/* The top band (workspace.js fitTop): when Chat / Work, MAX CODE and
   MyFlyCursor would run under the round tools at the right, MAX CODE and
   MyFlyCursor show as their icons (as in a narrow window), and on a page
   without a chat title the switch then moves to the left. */
.mode-bar[data-top~="compact"] {
  gap: 8px;
}
.mode-bar[data-top~="compact"] .mode-switch button {
  min-width: 60px;
}
.mode-bar[data-top~="compact"] .mode-switch [data-value="code"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  min-width: 0;
  padding: 0;
}
.mode-bar[data-top~="compact"] .mode-switch .mode-icon {
  display: block;
}
.mode-bar[data-top~="compact"] .mode-switch .mode-label {
  display: none;
}
.mode-bar[data-top~="compact"] .fly-pill-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.mode-bar[data-top~="compact"] .fly-pill {
  padding: 0 11px;
}
.mode-bar[data-top~="shift"] {
  margin-inline: 20px auto;
}

/* MAX CODE's row under the box, a little tighter so T-CUTTER keeps its name at
   the usual window size (fitRow folds labels when it's still short). */
[data-mode="code"] .composer-meta {
  gap: 6px;
  padding-inline: 0;
}
[data-mode="code"] .composer-meta .meta-start {
  gap: 6px;
}
[data-mode="code"] .composer-meta :is(.model-bar, .effort-chip, .context, .tray-button) {
  padding-inline: 10px;
}
