@import "tailwindcss";
@import "./generated/design-tokens.css";

@font-face {
  font-family: 'Mona Sans Variable';
  font-style: normal;
  font-display: block;
  font-weight: 200 900;
  src: url('@fontsource-variable/mona-sans/files/mona-sans-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Mona Sans Variable';
  font-style: italic;
  font-display: block;
  font-weight: 200 900;
  src: url('@fontsource-variable/mona-sans/files/mona-sans-latin-wght-italic.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Schibsted Grotesk Variable';
  font-style: normal;
  font-display: block;
  font-weight: 200 900;
  src: url('@fontsource-variable/schibsted-grotesk/files/schibsted-grotesk-latin-wght-normal.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@font-face {
  font-family: 'Schibsted Grotesk Variable';
  font-style: italic;
  font-display: block;
  font-weight: 200 900;
  src: url('@fontsource-variable/schibsted-grotesk/files/schibsted-grotesk-latin-wght-italic.woff2') format('woff2-variations');
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

@theme inline {
  --color-base: var(--color-base);
  --color-surface: var(--color-surface);
  --color-surface-hover: var(--color-surface-hover);
  --color-surface-active: var(--color-surface-active);
  --color-elevated: var(--color-elevated);
  --color-border: var(--color-border);
  --color-border-subtle: var(--color-border-subtle);
  --color-border-strong: var(--color-border-strong);
  --color-text: var(--color-text);
  --color-text-secondary: var(--color-text-secondary);
  --color-text-muted: var(--color-text-muted);
  --color-accent: var(--color-accent);
  --color-accent-2: var(--color-accent-2);
  --color-accent-hover: var(--color-accent-hover);
  --color-green: var(--color-green);
  --color-amber: var(--color-amber);
  --color-red: var(--color-red);
  --color-info: var(--color-info);
  --color-accent-foreground: var(--color-accent-foreground);
}

@theme inline {
  --text-2xs: var(--text-2xs);
  --text-2xs--line-height: var(--lh-2xs);
  --text-xs: var(--text-xs);
  --text-xs--line-height: var(--lh-xs);
  --text-sm: var(--text-sm);
  --text-sm--line-height: var(--lh-sm);
  --text-md: var(--text-md);
  --text-md--line-height: var(--lh-md);
  --text-lg: var(--text-lg);
  --text-lg--line-height: var(--lh-lg);
  --text-xl: var(--text-xl);
  --text-xl--line-height: var(--lh-xl);
  --text-2xl: var(--text-2xl);
  --text-2xl--line-height: var(--lh-2xl);
  --text-3xl: var(--text-3xl);
  --text-3xl--line-height: var(--lh-3xl);
  --text-hero: var(--text-hero);
  --text-hero--line-height: var(--lh-hero);
  --spacing-1: var(--space-1);
  --spacing-2: var(--space-2);
  --spacing-3: var(--space-3);
  --spacing-4: var(--space-4);
  --spacing-5: var(--space-5);
  --spacing-6: var(--space-6);
  --spacing-7: var(--space-7);
  --spacing-8: var(--space-8);
  --spacing-9: var(--space-9);
  --spacing-10: var(--space-10);
  --spacing-12: var(--space-12);
  --tracking-tight: var(--tracking-tight);
  --tracking-display: var(--tracking-display);
  --radius-xs: var(--radius-xs);
  --radius-sm: var(--radius-sm);
  --radius-md: var(--radius-md);
  --radius-lg: var(--radius-lg);
  --radius-xl: var(--radius-xl);
  --radius-full: var(--radius-full);
  --ease-out: var(--ease-out);
  --ease-emphasized: var(--ease-emphasized);
  --ease-spring: var(--ease-spring);
  --duration-1: var(--dur-1);
  --duration-2: var(--dur-2);
  --duration-3: var(--dur-3);
  --duration-4: var(--dur-4);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-1: 0ms;
    --dur-2: 0ms;
    --dur-3: 0ms;
    --dur-4: 0ms;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-delay: 0ms !important;
    transition-duration: 0ms !important;
  }
}

html, body, #root {
  height: 100%;
  width: 100%;
  overflow: hidden;
  color: var(--color-text);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: var(--lh-md);
  font-feature-settings: "tnum" 1, "cv01" 1;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

#root {
  position: relative;
  z-index: 1;
}

html {
  background-color: var(--color-base);
}

body {
  position: relative;
  background-color: var(--color-base);
  background-image: var(--bg-image);
  background-attachment: fixed;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  inset: -24%;
  background:
    radial-gradient(42% 38% at 18% 10%, color-mix(in srgb, var(--color-accent) 20%, transparent), transparent 62%),
    radial-gradient(36% 40% at 82% 8%, color-mix(in srgb, var(--color-accent-hover) 14%, transparent), transparent 64%),
    radial-gradient(48% 44% at 62% 108%, color-mix(in srgb, var(--color-info) 12%, transparent), transparent 62%);
  filter: blur(20px);
  opacity: 0.42;
  animation: ui-atmosphere-drift 26s var(--ease-spring) infinite alternate;
}

body::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
  opacity: 0.026;
}

.shadow-card { box-shadow: var(--shadow-card); }

.font-display {
  font-family: var(--font-display);
  letter-spacing: var(--tracking-display);
}

.tabular {
  font-feature-settings: "tnum" 1, "cv01" 1;
  font-variant-numeric: tabular-nums;
}

.feature-page-shell {
  width: min(100%, var(--measure-wide));
  margin-inline: auto;
  padding: var(--space-7);
}

.feature-toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.measure-column {
  width: min(100%, var(--measure));
  margin-inline: auto;
}

.scroll-shadow-x {
  background:
    linear-gradient(90deg, var(--color-base) 0, transparent var(--space-4)) left center / var(--space-4) 100% no-repeat,
    linear-gradient(270deg, var(--color-base) 0, transparent var(--space-4)) right center / var(--space-4) 100% no-repeat,
    linear-gradient(90deg, color-mix(in srgb, #000 24%, transparent), transparent var(--space-5)) left center / var(--space-5) 100% no-repeat,
    linear-gradient(270deg, color-mix(in srgb, #000 24%, transparent), transparent var(--space-5)) right center / var(--space-5) 100% no-repeat;
  background-attachment: local, local, scroll, scroll;
}

.threads-page-shell {
  position: relative;
}

.threads-filter-panel {
  width: min(28vw, 280px);
  min-width: 220px;
}

.threads-detail-panel {
  display: flex;
  width: min(32vw, 340px);
  min-width: 280px;
  flex-direction: column;
}

.threads-detail-body {
  min-height: 0;
  flex: 1;
}

.threads-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--space-2);
}

.threads-sort-select {
  width: 180px;
}

@media (max-width: 1120px) {
  .threads-filter-panel {
    width: 240px;
  }

  .threads-detail-panel {
    position: absolute;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: var(--z-overlay);
    width: min(360px, calc(100% - var(--space-8)));
    box-shadow: -16px 0 36px color-mix(in srgb, #000 32%, transparent);
  }
}

@media (max-width: 860px) {
  .feature-page-shell {
    padding: var(--space-5);
  }

  .feature-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .threads-page-shell {
    flex-direction: column;
  }

  .threads-filter-panel {
    width: 100%;
    min-width: 0;
    max-height: calc(var(--space-12) * 5);
    border-block-end: var(--border-width-1) solid var(--color-border-subtle);
    border-inline-end: 0;
  }

  .threads-filter-scroll {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    align-content: start;
  }

  .threads-results-panel {
    min-height: 0;
  }

  .threads-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .threads-sort-select {
    width: 100%;
  }

  .threads-detail-panel {
    inset-block: auto 0;
    inset-inline: 0;
    width: 100%;
    max-height: 50%;
    border-block-start: var(--border-width-1) solid var(--color-border-subtle);
    border-inline-start: 0;
  }
}

.text-role-hero {
  font-size: var(--text-hero);
  line-height: var(--lh-hero);
}

.text-role-page-title {
  font-size: var(--text-2xl);
  line-height: var(--lh-2xl);
}

.text-role-section-title {
  font-size: var(--text-xl);
  line-height: var(--lh-xl);
}

.text-role-card-title {
  font-size: var(--text-lg);
  line-height: var(--lh-lg);
}

.text-role-body {
  font-size: var(--text-md);
  line-height: var(--lh-md);
}

.text-role-dense {
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.text-role-metadata {
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}

.ui-control-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--space-1);
  min-width: 0;
}

.ui-disabled-reason {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
}

.ui-tooltip-anchor {
  position: relative;
  display: inline-flex;
}

.ui-tooltip {
  position: fixed;
  z-index: var(--z-tooltip);
  max-width: min(var(--primitive-tooltip-max-w), calc(100vw - var(--space-8)));
  border: var(--border-width-1) solid var(--glass-border);
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-3), var(--specular);
  color: var(--color-text);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  padding: var(--space-2) var(--space-3);
  pointer-events: none;
  animation: ui-popover-in var(--dur-2) var(--ease-spring) both;
}

.ui-primitive-gallery__shell {
  max-width: calc((var(--space-12) * 23) + var(--space-4));
}

.ui-toaster {
  position: fixed;
  inset-block-end: var(--space-5);
  inset-inline-end: var(--space-5);
  z-index: var(--z-toast);
}

.ui-toast-card {
  width: min(calc((var(--space-12) * 7) + var(--space-6)), calc(100vw - var(--space-8)));
  border: var(--border-width-1) solid color-mix(in srgb, var(--toast-border) 68%, var(--glass-border));
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--toast-bg) 74%, var(--glass-bg) 26%);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-3), var(--specular);
  padding: var(--space-3);
}

.ui-toast-indicator {
  width: var(--space-2);
  height: var(--space-2);
  margin-block-start: var(--space-1);
  border-radius: var(--radius-full);
  background: var(--toast-color);
  color: var(--toast-color);
  box-shadow: 0 0 0 var(--space-1) color-mix(in srgb, var(--toast-color) 18%, transparent);
  animation: ui-status-pulse 1.8s var(--ease-out) infinite;
}

.ui-button,
.ui-icon-button,
.ui-input,
.ui-textarea,
.ui-select-trigger,
.ui-menu-trigger,
.ui-segmented-option {
  border: var(--border-width-1) solid transparent;
  border-radius: var(--radius-sm);
  transition:
    background var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-1) var(--ease-out),
    transform var(--dur-2) var(--ease-spring);
}

.ui-button,
.ui-icon-button,
.ui-select-trigger,
.ui-menu-trigger,
.ui-segmented-option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.ui-button:focus-visible,
.ui-icon-button:focus-visible,
.ui-input:focus-visible,
.ui-textarea:focus-visible,
.ui-select-trigger:focus-visible,
.ui-menu-trigger:focus-visible,
.ui-segmented-option:focus-visible,
.ui-popover-item:focus-visible,
.ui-dialog:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.ui-button:active:not(:disabled),
.ui-icon-button:active:not(:disabled),
.ui-select-trigger:active:not(:disabled),
.ui-menu-trigger:active:not(:disabled),
.ui-segmented-option:active:not(:disabled) {
  transform: scale(0.96);
}

.ui-button:disabled,
.ui-icon-button:disabled,
.ui-input:disabled,
.ui-textarea:disabled,
.ui-select-trigger:disabled,
.ui-menu-trigger:disabled,
.ui-segmented-option:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.ui-button--sm {
  min-height: var(--control-h-sm);
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}

.ui-button--md {
  min-height: var(--control-h-md);
  padding: 0 var(--space-4);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.ui-button--lg {
  min-height: var(--control-h-lg);
  padding: 0 var(--space-5);
  font-size: var(--text-md);
  line-height: var(--lh-md);
}

.ui-button--full {
  width: 100%;
}

.ui-button--primary {
  position: relative;
  overflow: hidden;
  background: var(--accent-action-fill);
  color: var(--accent-action-foreground);
  border-color: var(--accent-line);
  box-shadow: var(--shadow-1), var(--specular);
}

.ui-button--primary::after {
  content: "";
  position: absolute;
  inset-block: -35%;
  inset-inline-start: -70%;
  width: 42%;
  transform: skewX(-18deg) translateX(0);
  background: linear-gradient(90deg, transparent, color-mix(in srgb, #fff 42%, transparent), transparent);
  opacity: 0;
  pointer-events: none;
}

.ui-button--primary > *,
.ui-icon-button > * {
  position: relative;
  z-index: 1;
}

.ui-button--primary:hover:not(:disabled) {
  background: var(--accent-action-fill);
  box-shadow: var(--glow-accent), var(--shadow-2), var(--specular-strong);
  transform: translateY(calc(-1 * var(--border-width-1)));
}

.ui-button--primary:hover:not(:disabled)::after {
  opacity: 1;
  animation: ui-primary-sheen var(--dur-4) var(--ease-out) both;
}

.ui-button--secondary {
  background: var(--color-elevated);
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: var(--shadow-1), var(--specular);
}

.ui-icon-button--secondary {
  background: var(--color-elevated);
  color: var(--color-text);
  border-color: var(--color-border);
  box-shadow: var(--shadow-1), var(--specular);
}

.ui-button--secondary:hover:not(:disabled),
.ui-icon-button--secondary:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-2), var(--specular-strong);
  transform: translateY(calc(-1 * var(--border-width-1)));
}

.ui-button--ghost,
.ui-icon-button--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}

.ui-button--ghost:hover:not(:disabled),
.ui-icon-button--ghost:hover:not(:disabled) {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.ui-button--danger,
.ui-icon-button--danger {
  background: color-mix(in srgb, var(--color-red) 12%, transparent);
  color: var(--color-red);
  border-color: color-mix(in srgb, var(--color-red) 34%, transparent);
}

.ui-button--danger:hover:not(:disabled),
.ui-icon-button--danger:hover:not(:disabled) {
  background: color-mix(in srgb, var(--color-red) 18%, transparent);
  box-shadow: 0 0 18px color-mix(in srgb, var(--color-red) 18%, transparent), var(--shadow-1);
  transform: translateY(calc(-1 * var(--border-width-1)));
}

.ui-icon-button {
  flex: none;
  padding: 0;
  position: relative;
}

.ui-icon-button--sm {
  width: var(--control-h-sm);
  height: var(--control-h-sm);
}

.ui-icon-button--md {
  width: var(--control-h-md);
  height: var(--control-h-md);
}

.ui-icon-button__badge {
  position: absolute;
  inset-block-start: calc(-1 * var(--space-1));
  inset-inline-end: calc(-1 * var(--space-1));
  display: inline-flex;
  min-width: var(--space-4);
  height: var(--space-4);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  color: var(--color-accent-foreground);
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
}

.ui-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-width: 0;
}

.ui-field__chrome {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.ui-input,
.ui-textarea {
  width: 100%;
  background: color-mix(in srgb, var(--color-base) 70%, var(--color-elevated) 30%);
  border-color: var(--color-border-subtle);
  color: var(--color-text);
  font-family: var(--font-ui);
}

.ui-input::placeholder,
.ui-textarea::placeholder {
  color: var(--color-text-muted);
}

.ui-input:hover:not(:disabled),
.ui-textarea:hover:not(:disabled) {
  border-color: var(--color-border-strong);
}

.ui-input[aria-invalid="true"],
.ui-textarea[aria-invalid="true"] {
  border-color: color-mix(in srgb, var(--color-red) 58%, var(--color-border));
}

.ui-input--sm {
  min-height: var(--control-h-sm);
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}

.ui-input--md {
  min-height: var(--control-h-md);
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.ui-input--lg {
  min-height: var(--control-h-lg);
  padding: 0 var(--space-4);
  font-size: var(--text-md);
  line-height: var(--lh-md);
}

.ui-field__left-icon {
  position: absolute;
  inset-inline-start: var(--space-3);
  color: var(--color-text-muted);
  pointer-events: none;
}

.ui-input--with-left-icon {
  padding-inline-start: calc(var(--space-6) + var(--space-3));
}

.ui-input--clearable {
  padding-inline-end: calc(var(--space-6) + var(--space-3));
}

.ui-input__clear {
  position: absolute;
  inset-inline-end: var(--space-1);
  color: var(--color-text-muted);
}

.ui-field__message {
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
  color: var(--color-text-muted);
}

.ui-field__message--error {
  color: var(--color-red);
}

.ui-textarea {
  min-height: calc(var(--control-h-lg) + var(--space-4));
  max-height: var(--ui-textarea-max-height, none);
  resize: vertical;
  padding: var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.ui-popover-root {
  position: relative;
  display: inline-block;
  min-width: 0;
}

.ui-select-trigger,
.ui-menu-trigger {
  width: 100%;
  min-height: var(--control-h-md);
  justify-content: space-between;
  background: color-mix(in srgb, var(--color-base) 70%, var(--color-elevated) 30%);
  border-color: var(--color-border-subtle);
  color: var(--color-text);
  padding: 0 var(--space-3);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.ui-select-trigger:hover:not(:disabled),
.ui-menu-trigger:hover:not(:disabled) {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
}

.ui-popover {
  position: absolute;
  inset-block-start: calc(100% + var(--space-1));
  inset-inline-start: 0;
  z-index: var(--z-dropdown);
  min-width: 100%;
  max-height: min(var(--primitive-popover-max-h), calc(100vh - var(--space-12)));
  overflow: auto;
  border: var(--border-width-1) solid var(--glass-border);
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-3), var(--specular-strong);
  padding: var(--space-1);
  transform-origin: top left;
  animation: ui-popover-in var(--dur-2) var(--ease-spring) both;
}

.ui-popover-item {
  position: relative;
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  cursor: pointer;
  font: inherit;
  min-height: var(--control-h-md);
  padding: 0 var(--space-3);
  text-align: start;
  transition:
    background var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    transform var(--dur-2) var(--ease-spring);
}

.ui-popover-item:hover:not(:disabled),
.ui-popover-item[data-active="true"] {
  background: var(--color-surface-hover);
  color: var(--color-text);
  transform: translateX(var(--space-1));
}

.ui-popover-item[aria-selected="true"] {
  color: var(--color-text);
  box-shadow: var(--ring-selected);
}

.ui-popover-item__content {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
}

.ui-popover-item__label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.ui-popover-item__hint {
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
}

.ui-popover-item:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.ui-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: color-mix(in srgb, var(--color-base) 66%, transparent);
  backdrop-filter: blur(8px);
  animation: ui-fade-in var(--dur-2) var(--ease-out) both;
}

.ui-dialog-backdrop--drawer {
  display: flex;
  justify-content: flex-end;
}

.ui-dialog {
  position: fixed;
  inset-block-start: 12vh;
  inset-inline-start: 50%;
  z-index: calc(var(--z-modal) + 1);
  display: flex;
  max-height: min(var(--primitive-dialog-max-h), calc(100vh - var(--space-12)));
  max-width: calc(100vw - var(--space-8));
  transform: translateX(-50%);
  flex-direction: column;
  overflow: hidden;
  border: var(--border-width-1) solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-3), var(--specular-strong);
  color: var(--color-text);
  animation: ui-dialog-in var(--dur-3) var(--ease-spring) both;
}

.ui-dialog--sm { width: min(var(--primitive-dialog-w-sm), calc(100vw - var(--space-8))); }
.ui-dialog--md { width: min(var(--primitive-dialog-w-md), calc(100vw - var(--space-8))); }
.ui-dialog--lg { width: min(var(--primitive-dialog-w-lg), calc(100vw - var(--space-8))); }

.ui-dialog--drawer {
  inset-block: 0;
  inset-inline: auto 0;
  height: 100dvh;
  max-height: 100dvh;
  width: min(440px, 92vw);
  transform: none;
  border-block: 0;
  border-inline-end: 0;
  border-radius: 0;
  animation-name: ui-drawer-in;
}

.ui-dialog--drawer-left {
  inset-inline: 0 auto;
  border-inline-start: 0;
  border-inline-end: var(--border-width-1) solid var(--glass-border);
  animation-name: ui-drawer-left-in;
}

.ui-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  border-bottom: var(--border-width-1) solid var(--color-border-subtle);
  padding: var(--space-4);
}

.ui-dialog__title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 650;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-xl);
}

.ui-dialog__body {
  overflow: auto;
  padding: var(--space-4);
}

.ui-dialog__footer {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  border-top: var(--border-width-1) solid var(--color-border-subtle);
  padding: var(--space-4);
}

.ui-card {
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-elevated) 88%, var(--color-base) 12%);
  box-shadow: var(--shadow-2);
  color: var(--color-text);
}

.ui-card--specular {
  box-shadow: var(--shadow-2), var(--specular);
}

.ui-card--sm { padding: calc(var(--row-pad) + var(--space-1)); }
.ui-card--md { padding: calc(var(--row-pad) + var(--space-2)); }
.ui-card--lg { padding: calc(var(--row-pad) + var(--space-4)); }

.ui-card--variant-flat {
  background: var(--color-surface);
  box-shadow: none;
}

.ui-card--variant-tile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--space-3);
  align-items: start;
}

.ui-card__tile {
  display: inline-flex;
  width: var(--control-h-lg);
  height: var(--control-h-lg);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: var(--accent-soft);
  color: var(--accent-text);
  box-shadow: inset 0 0 0 var(--border-width-1) var(--accent-line);
}

.ui-card--interactive {
  cursor: pointer;
  display: block;
  width: 100%;
  font: inherit;
  text-align: start;
  transition:
    background var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-spring);
}

.ui-card--interactive.ui-card--variant-tile {
  display: grid;
}

.ui-card--interactive:hover,
.ui-card--hover-lift:hover {
  background: var(--color-surface-hover);
  border-color: var(--color-border-strong);
  transform: translateY(calc(-1 * var(--border-width-1)));
  box-shadow: var(--shadow-3), var(--specular-strong);
}

.ui-card.chat-tool-row {
  display: flex;
  align-items: center;
  gap: calc(var(--gap) * 0.5);
}

.studio-shell {
  display: grid;
  min-height: min(720px, calc(100vh - var(--space-12)));
  overflow: hidden;
  grid-template-columns: minmax(220px, var(--studio-shell-sidebar-w)) minmax(0, 1fr);
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-xl);
  background: color-mix(in srgb, var(--color-base) 88%, var(--color-elevated) 12%);
  box-shadow: var(--shadow-3), var(--specular);
}

.studio-shell__sidebar {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-5);
  border-inline-end: var(--border-width-1) solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-elevated) 72%, var(--color-base) 28%);
  padding: var(--space-4);
}

.studio-shell__brand,
.studio-coworker-card__header,
.studio-object-card,
.studio-object-card__title-row,
.studio-decision-card,
.studio-actions {
  display: flex;
  align-items: center;
}

.studio-shell__brand {
  gap: var(--space-3);
}

.studio-shell__mark,
.studio-coworker-avatar,
.studio-object-card__icon,
.studio-decision-card__icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--studio-tone, var(--color-accent)) 18%, var(--color-elevated) 82%);
  color: var(--studio-tone, var(--color-accent));
  box-shadow: inset 0 0 0 var(--border-width-1) color-mix(in srgb, currentColor 34%, transparent);
}

.studio-shell__mark {
  width: var(--control-h-lg);
  height: var(--control-h-lg);
  background: var(--accent-action-fill);
  color: var(--accent-action-foreground);
  font-weight: 750;
  box-shadow: var(--glow-soft), var(--specular);
}

.studio-shell__brand-name,
.studio-page-header h1,
.studio-coworker-card h3,
.studio-task-lane h3,
.studio-review-panel h2,
.studio-decision-card h3,
.studio-object-card h3 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
}

.studio-shell__brand-name,
.studio-coworker-card h3,
.studio-decision-card h3,
.studio-object-card h3 {
  font-size: var(--text-lg);
  line-height: var(--lh-lg);
  font-weight: 700;
}

.studio-shell__brand-subtitle,
.studio-page-header p,
.studio-coworker-card p,
.studio-task-lane p,
.studio-review-panel p,
.studio-decision-card p,
.studio-object-card p,
.studio-empty-line {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.studio-nav,
.studio-nav__section,
.studio-nav__items,
.studio-shell__workspace,
.studio-shell__main,
.studio-page-header__copy,
.studio-coworker-card,
.studio-composer,
.studio-task-lane,
.studio-task-lane__items,
.studio-task-lane__item,
.studio-review-panel,
.studio-review-panel__body,
.studio-decision-card__copy,
.studio-object-card__copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.studio-nav {
  gap: var(--space-5);
}

.studio-nav__section,
.studio-nav__items,
.studio-coworker-card,
.studio-task-lane__items,
.studio-review-panel,
.studio-object-card__copy {
  gap: var(--space-2);
}

.studio-nav__section-label {
  margin: 0 0 var(--space-1);
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
  font-weight: 750;
  line-height: var(--lh-2xs);
  text-transform: uppercase;
}

.studio-nav__item {
  display: flex;
  min-height: var(--control-h-md);
  width: 100%;
  align-items: center;
  gap: var(--space-2);
  border: var(--border-width-1) solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  font: inherit;
  padding: 0 var(--space-3);
  text-decoration: none;
}

.studio-nav__item:hover,
.studio-nav__item[data-active="true"] {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.studio-nav__item[data-active="true"] {
  border-color: color-mix(in srgb, var(--color-accent) 42%, transparent);
  box-shadow: inset 3px 0 0 var(--color-accent);
}

.studio-nav__label {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-nav__badge {
  color: var(--accent-text);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}

.studio-shell__workspace {
  min-height: 0;
}

.studio-shell__topbar {
  border-block-end: var(--border-width-1) solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-elevated) 62%, transparent);
  padding: var(--space-5);
}

.studio-shell__main {
  gap: var(--space-4);
  overflow: auto;
  padding: var(--space-5);
}

.studio-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.studio-page-header__copy {
  gap: var(--space-2);
}

.studio-page-header h1 {
  font-size: var(--text-2xl);
  line-height: var(--lh-2xl);
}

.studio-actions {
  gap: var(--space-2);
  flex-wrap: wrap;
}

.studio-preview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
}

.studio-coworker-card,
.studio-composer,
.studio-task-lane,
.studio-review-panel,
.studio-decision-card {
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-elevated) 88%, var(--color-base) 12%);
  box-shadow: var(--shadow-2), var(--specular);
  padding: var(--space-4);
}

.studio-coworker-card {
  border-color: color-mix(in srgb, var(--studio-tone, var(--color-border)) 32%, var(--color-border) 68%);
}

.studio-coworker-card__header,
.studio-object-card,
.studio-object-card__title-row,
.studio-decision-card {
  gap: var(--space-3);
}

.studio-coworker-card__identity {
  min-width: 0;
  flex: 1;
}

.studio-coworker-avatar--sm {
  width: var(--control-h-md);
  height: var(--control-h-md);
  font-size: var(--text-xs);
}

.studio-coworker-avatar--md {
  width: var(--control-h-lg);
  height: var(--control-h-lg);
  font-size: var(--text-sm);
}

.studio-coworker-avatar--lg {
  width: var(--control-h-xl);
  height: var(--control-h-xl);
  font-size: var(--text-md);
}

.studio-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.studio-composer {
  gap: var(--space-3);
}

.studio-composer__label {
  display: grid;
  gap: var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  font-weight: 700;
}

.studio-composer textarea {
  min-height: var(--studio-composer-min-h);
  resize: vertical;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-base) 72%, var(--color-elevated) 28%);
  color: var(--color-text);
  padding: var(--space-3);
}

.studio-composer textarea:focus-visible,
.studio-nav__item:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
}

.studio-composer__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.studio-composer__toolbar,
.studio-object-card__meta,
.studio-decision-card__meta,
.studio-task-lane__meta {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}

.studio-task-lane {
  border-color: color-mix(in srgb, var(--studio-lane-tone) 32%, var(--color-border) 68%);
}

.studio-task-lane__header,
.studio-review-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.studio-task-lane__count {
  display: inline-flex;
  min-width: var(--control-h-sm);
  height: var(--control-h-sm);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--studio-lane-tone) 16%, transparent);
  color: var(--studio-lane-tone);
  font-size: var(--text-xs);
  font-weight: 750;
}

.studio-task-lane__items {
  margin: 0;
  padding: 0;
  list-style: none;
}

.studio-task-lane__item {
  gap: var(--space-2);
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-3);
}

.studio-task-lane__item h4 {
  margin: 0;
  color: var(--color-text);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.studio-review-panel__body {
  gap: var(--space-3);
}

.studio-decision-card--danger {
  border-color: color-mix(in srgb, var(--color-red) 38%, var(--color-border) 62%);
}

.studio-object-card__copy {
  flex: 1;
}

.studio-shell--collapsed {
  grid-template-columns: var(--studio-shell-rail-w) minmax(0, 1fr);
}

.studio-shell--collapsed .studio-shell__sidebar {
  align-items: center;
  padding-inline: var(--space-3);
}

.studio-shell--collapsed .studio-shell__brand-copy,
.studio-shell--collapsed .studio-nav__section-label,
.studio-shell--collapsed .studio-nav__label,
.studio-shell--collapsed .studio-nav__badge,
.studio-shell--collapsed .studio-shell__presence-footer > :not(.studio-coworker-avatar) {
  display: none;
}

.studio-shell__presence-footer,
.studio-composer__context,
.studio-channel-row,
.studio-person-row,
.studio-deliverable-card__head,
.studio-deliverable-card__captured,
.studio-kanban-task-card__foot,
.studio-status-live,
.studio-status-done,
.studio-status-waiting,
.studio-run-pill,
.studio-unassigned,
.studio-handoff-chip,
.studio-trait-slider__label,
.studio-trait-slider__ends,
.studio-wiki-page__head,
.studio-wiki-page__links span {
  display: flex;
  align-items: center;
}

.studio-shell__presence-footer {
  gap: var(--space-3);
  margin-top: auto;
  border-top: var(--border-width-1) solid var(--color-border-subtle);
  padding-top: var(--space-3);
}

.studio-coworker-avatar {
  position: relative;
  font-weight: 750;
}

.studio-coworker-avatar--round {
  border-radius: var(--radius-full);
}

.studio-coworker-avatar--squircle {
  border-radius: var(--radius-lg);
}

.studio-presence-dot {
  position: absolute;
  inset-inline-end: calc(-1 * var(--space-1));
  inset-block-end: calc(-1 * var(--space-1));
  width: var(--space-3);
  height: var(--space-3);
  border: 2px solid var(--color-elevated);
  border-radius: var(--radius-full);
  background: var(--color-text-muted);
}

.studio-presence-dot--working { background: var(--color-accent); }
.studio-presence-dot--available { background: var(--color-green); }
.studio-presence-dot--offline { background: var(--color-text-muted); }

.studio-presence-dot--pulse,
.studio-status-live span,
.studio-run-pill--live span {
  animation: ui-status-pulse 1.7s var(--ease-spring) infinite;
}

.studio-composer__context {
  flex-wrap: wrap;
  gap: var(--space-2);
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}

.studio-conversation-lane-card,
.studio-deliverable-card,
.studio-permission-row,
.studio-run-timeline,
.studio-mini-panel,
.studio-wiki-demo {
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-elevated) 88%, var(--color-base) 12%);
  box-shadow: var(--shadow-2), var(--specular);
}

.studio-conversation-lane-card {
  overflow: hidden;
  border-color: color-mix(in srgb, var(--studio-lane-tone) 32%, var(--color-border) 68%);
}

.studio-conversation-lane-card--live {
  box-shadow: 0 0 0 var(--border-width-1) color-mix(in srgb, var(--studio-lane-tone) 24%, transparent), var(--shadow-2), var(--specular);
}

.studio-conversation-lane-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  list-style: none;
}

.studio-conversation-lane-card__head::-webkit-details-marker {
  display: none;
}

.studio-conversation-lane-card__head:hover {
  background: var(--color-surface-hover);
}

.studio-conversation-lane-card__copy,
.studio-channel-row__copy,
.studio-person-row__copy,
.studio-permission-row__copy {
  min-width: 0;
  flex: 1;
}

.studio-conversation-lane-card__name,
.studio-conversation-lane-card__role,
.studio-conversation-lane-card__task,
.studio-kanban-task-card h4,
.studio-channel-row h3,
.studio-person-row h3,
.studio-deliverable-card h3,
.studio-permission-row h3,
.studio-wizard-step-pane h3 {
  display: block;
  margin: 0;
}

.studio-conversation-lane-card__name,
.studio-kanban-task-card h4,
.studio-channel-row h3,
.studio-person-row h3,
.studio-deliverable-card h3,
.studio-permission-row h3 {
  color: var(--color-text);
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: var(--lh-sm);
}

.studio-conversation-lane-card__role,
.studio-conversation-lane-card__task,
.studio-channel-row p,
.studio-person-row__copy div,
.studio-permission-row p,
.studio-kanban-task-card p {
  margin: 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}

.studio-conversation-lane-card__task {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.studio-conversation-lane-card__meta {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.studio-conversation-lane-card[open] .studio-conversation-lane-card__meta > svg {
  transform: rotate(90deg);
}

.studio-conversation-lane-card__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: var(--border-width-1) solid var(--color-border-subtle);
  padding: var(--space-2) var(--space-4) var(--space-4);
}

.studio-activity-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.studio-activity-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
}

.studio-activity-row__icon,
.studio-channel-row__icon,
.studio-permission-row__icon,
.studio-deliverable-card__icon {
  display: inline-flex;
  flex: none;
  width: var(--control-h-md);
  height: var(--control-h-md);
  align-items: center;
  justify-content: center;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--accent-text);
}

.studio-activity-row__copy {
  display: flex;
  min-width: 0;
  flex: 1;
  gap: var(--space-1);
}

.studio-activity-row__copy strong {
  color: var(--color-text);
}

.studio-activity-row time {
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
}

.studio-activity-row--done .studio-activity-row__icon {
  color: var(--color-green);
}

.studio-status-live,
.studio-status-done,
.studio-status-waiting,
.studio-run-pill {
  gap: var(--space-1);
  font-weight: 700;
}

.studio-status-live {
  color: var(--studio-lane-tone, var(--color-accent));
}

.studio-status-live span,
.studio-run-pill span {
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-full);
  background: currentColor;
}

.studio-status-done { color: var(--color-green); }
.studio-status-waiting { color: var(--color-text-muted); }

.studio-handoff-chip {
  align-self: flex-start;
  gap: var(--space-2);
  border: var(--border-width-1) solid color-mix(in srgb, var(--studio-lane-tone) 28%, transparent);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--studio-lane-tone) 10%, transparent);
  color: var(--color-text-secondary);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

.studio-kanban-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: var(--space-3);
}

.studio-kanban-column {
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  padding: var(--space-3);
}

.studio-kanban-column--over {
  border-color: var(--accent-line);
  background: color-mix(in srgb, var(--color-accent) 7%, var(--color-surface) 93%);
}

.studio-kanban-column__head,
.studio-kanban-task-card__top {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
}

.studio-kanban-column__head h3 {
  margin: 0;
  flex: 1;
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
  font-weight: 750;
  letter-spacing: 0.08em;
  line-height: var(--lh-2xs);
  text-transform: uppercase;
}

.studio-kanban-column__head span {
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  color: var(--color-text-muted);
  padding: 0 var(--space-2);
  font-size: var(--text-xs);
}

.studio-kanban-column__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.studio-kanban-column__empty {
  border: var(--border-width-1) dashed var(--color-border);
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  margin: 0;
  padding: var(--space-4) var(--space-2);
  text-align: center;
}

.studio-kanban-task-card {
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-elevated) 90%, var(--color-base) 10%);
  box-shadow: var(--shadow-1), var(--specular);
  padding: var(--space-3);
  transition: transform var(--dur-2) var(--ease-spring), border-color var(--dur-1) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}

.studio-kanban-task-card:hover,
.studio-kanban-task-card--dragging {
  transform: translateY(calc(-1 * var(--space-1)));
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-2), var(--specular-strong);
}

.studio-kanban-task-card__priority {
  width: var(--space-2);
  height: var(--space-2);
  flex: none;
  margin-top: var(--space-2);
  border-radius: var(--radius-full);
  background: var(--studio-priority);
}

.studio-kanban-task-card__foot {
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
}

.studio-kanban-task-card__foot .studio-coworker-avatar {
  width: var(--space-6);
  height: var(--space-6);
}

.studio-unassigned {
  gap: var(--space-1);
  color: var(--color-text-muted);
}

.studio-run-pill {
  border-radius: var(--radius-full);
  background: var(--accent-soft);
  color: var(--accent-text);
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-2xs);
}

.studio-run-timeline {
  padding: var(--space-4);
}

.studio-run-timeline__state {
  color: var(--color-text);
  font-weight: 700;
}

.studio-run-timeline__steps {
  display: flex;
  align-items: flex-start;
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.studio-run-timeline__step {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
  font-weight: 700;
}

.studio-run-timeline__step::before {
  content: "";
  position: absolute;
  inset-block-start: calc(var(--space-2) - var(--border-width-1));
  inset-inline-start: -50%;
  width: 100%;
  height: 2px;
  background: var(--color-border);
}

.studio-run-timeline__step:first-child::before {
  display: none;
}

.studio-run-timeline__dot {
  position: relative;
  z-index: 1;
  width: var(--space-3);
  height: var(--space-3);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
}

.studio-run-timeline__step--done::before,
.studio-run-timeline__step--current::before {
  background: var(--color-green);
}

.studio-run-timeline__step--done .studio-run-timeline__dot {
  border-color: var(--color-green);
  background: var(--color-green);
}

.studio-run-timeline__step--current .studio-run-timeline__dot {
  border-color: var(--color-accent);
  background: var(--color-accent);
  box-shadow: 0 0 0 var(--space-1) var(--accent-soft);
}

.studio-run-timeline__step--done,
.studio-run-timeline__step--current {
  color: var(--color-text);
}

.studio-run-timeline__meta {
  margin-top: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.studio-run-timeline__meta code {
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-xs);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  padding: 0 var(--space-1);
}

.studio-permission-row {
  overflow: hidden;
}

.studio-permission-row__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
}

.studio-policy-toggle {
  display: inline-flex;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  padding: var(--space-1);
}

.studio-policy-toggle__option {
  min-height: var(--control-h-sm);
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  padding: 0 var(--space-2);
  text-transform: capitalize;
}

.studio-policy-toggle__option[data-active="true"] {
  background: var(--color-elevated);
  color: var(--color-text);
  box-shadow: var(--shadow-1);
}

.studio-policy-toggle__option--ask[data-active="true"] { color: var(--accent-text); }
.studio-policy-toggle__option--deny[data-active="true"] { color: var(--color-red); }

.studio-permission-row__rules {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  border-top: var(--border-width-1) solid var(--color-border-subtle);
  padding: var(--space-3) var(--space-4) var(--space-4);
}

.studio-permission-rule {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-2);
}

.studio-permission-rule span {
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
  font-weight: 700;
  text-transform: uppercase;
}

.studio-permission-rule input {
  min-height: var(--control-h-sm);
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-base) 72%, var(--color-elevated) 28%);
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 0 var(--space-3);
}

.studio-deliverable-card {
  overflow: hidden;
}

.studio-deliverable-card__head {
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}

.studio-deliverable-card__icon {
  background: var(--accent-action-fill);
  color: var(--accent-action-foreground);
}

.studio-deliverable-card__head p {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.studio-deliverable-card__preview {
  display: grid;
  min-height: 96px;
  place-items: center;
  margin: 0 var(--space-4) var(--space-3);
  border: var(--border-width-1) dashed var(--color-border);
  border-radius: var(--radius-md);
  background:
    repeating-linear-gradient(135deg, var(--color-surface), var(--color-surface) 7px, transparent 7px, transparent 14px);
  color: var(--color-text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
}

.studio-deliverable-card .studio-actions,
.studio-deliverable-card__capture,
.studio-deliverable-card__captured {
  margin: 0 var(--space-4) var(--space-3);
}

.studio-deliverable-card__capture {
  width: calc(100% - (var(--space-4) * 2));
  border-style: dashed;
}

.studio-deliverable-card__captured {
  gap: var(--space-2);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-green) 12%, transparent);
  color: var(--color-green);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 700;
}

.studio-project-progress {
  display: grid;
  gap: var(--space-2);
}

.studio-project-progress span,
.studio-working-style-bars__row span:last-child {
  display: block;
  height: var(--space-2);
  overflow: hidden;
  border-radius: var(--radius-full);
  background: var(--color-surface);
}

.studio-project-progress i,
.studio-working-style-bars__row i {
  display: block;
  width: var(--studio-progress);
  height: 100%;
  border-radius: inherit;
  background: var(--accent-gradient);
}

.studio-project-progress em {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-style: normal;
}

.studio-channel-row,
.studio-person-row {
  gap: var(--space-3);
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--color-elevated) 88%, var(--color-base) 12%);
  box-shadow: var(--shadow-1), var(--specular);
  padding: var(--space-3) var(--space-4);
}

.studio-channel-row__meta,
.studio-person-row__role span {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.studio-person-row__role {
  display: grid;
  justify-items: end;
  gap: var(--space-1);
  text-align: end;
}

.studio-wizard-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  border-bottom: var(--border-width-1) solid var(--color-border-subtle);
  background: var(--color-surface);
  padding: var(--space-2);
}

.studio-wizard-steps button {
  gap: var(--space-2);
  min-height: var(--control-h-md);
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 0 var(--space-3);
}

.studio-wizard-steps button > span {
  display: inline-flex;
  width: var(--space-5);
  height: var(--space-5);
  align-items: center;
  justify-content: center;
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-elevated);
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
}

.studio-wizard-steps button[data-active="true"] {
  background: var(--color-elevated);
  color: var(--color-text);
  box-shadow: var(--shadow-1);
}

.studio-wizard-steps button[data-active="true"] > span {
  border-color: transparent;
  background: var(--color-accent);
  color: var(--color-accent-foreground);
}

.studio-wizard-step-pane {
  padding: var(--space-5);
}

.studio-wizard-step-pane h3 {
  color: var(--color-text);
  font-size: var(--text-md);
  font-weight: 750;
}

.studio-wizard-step-pane p {
  margin: var(--space-1) 0 var(--space-4);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.studio-trait-slider {
  display: grid;
  gap: var(--space-2);
}

.studio-trait-slider__label,
.studio-trait-slider__ends {
  justify-content: space-between;
}

.studio-trait-slider__label span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-text);
  font-weight: 700;
}

.studio-trait-slider__label strong {
  color: var(--accent-text);
}

.studio-trait-slider input[type="range"] {
  accent-color: var(--color-accent);
  width: 100%;
}

.studio-trait-slider__ends {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.studio-working-style-bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.studio-working-style-bars__row {
  display: grid;
  grid-template-columns: minmax(70px, auto) minmax(0, 1fr);
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
  font-weight: 750;
  text-transform: uppercase;
}

.studio-wiki-demo {
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  min-height: 360px;
  overflow: hidden;
}

.studio-wiki-rail {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: var(--space-3);
  border-inline-end: var(--border-width-1) solid var(--color-border-subtle);
  background: var(--color-surface);
  padding: var(--space-3);
}

.studio-wiki-rail__spaces,
.studio-wiki-space div {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.studio-wiki-space h3 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-2);
  color: var(--color-text-secondary);
  font-size: var(--text-2xs);
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.studio-wiki-space h3 span {
  display: inline-flex;
  width: var(--space-5);
  height: var(--space-5);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-action-fill);
  color: var(--accent-action-foreground);
}

.studio-wiki-space button {
  justify-content: flex-start;
  min-height: var(--control-h-sm);
  overflow: hidden;
  border: 0;
  background: transparent;
  color: var(--color-text-secondary);
  padding: 0 var(--space-3);
  text-align: start;
  text-overflow: ellipsis;
}

.studio-wiki-space button:hover,
.studio-wiki-space button[data-active="true"] {
  background: var(--color-elevated);
  color: var(--color-text);
}

.studio-wiki-page {
  min-width: 0;
  overflow: auto;
  padding: var(--space-6);
}

.studio-wiki-page__crumbs {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.studio-wiki-page__head {
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.studio-wiki-page__head h1 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: var(--lh-2xl);
}

.studio-wiki-page__body {
  margin-top: var(--space-5);
}

.studio-wiki-page__body h2 {
  margin: var(--space-5) 0 var(--space-2);
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-lg);
}

.studio-wiki-page__body p,
.studio-wiki-page__body li {
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--lh-lg);
}

.studio-wiki-page__body ul {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-2) 0;
  padding: 0;
  list-style: none;
}

.studio-wiki-page__body li {
  position: relative;
  padding-inline-start: var(--space-5);
}

.studio-wiki-page__body li::before {
  content: "";
  position: absolute;
  inset-block-start: 0.75em;
  inset-inline-start: var(--space-2);
  width: var(--space-2);
  height: var(--space-2);
  border-radius: var(--radius-full);
  background: var(--color-accent);
}

.studio-wiki-page__callout {
  display: flex;
  gap: var(--space-2);
  border: var(--border-width-1) solid var(--accent-line);
  border-radius: var(--radius-lg);
  background: var(--accent-soft);
  color: var(--color-text);
  padding: var(--space-3) var(--space-4);
}

.studio-wiki-page__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-6);
  border-top: var(--border-width-1) solid var(--color-border-subtle);
  padding-top: var(--space-4);
}

.studio-wiki-page__links span {
  gap: var(--space-2);
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-full);
  background: var(--color-surface);
  color: var(--color-text-secondary);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
}

@media (max-width: 920px) {
  .studio-shell,
  .studio-preview-grid {
    grid-template-columns: 1fr;
  }

  .studio-shell__sidebar {
    border-block-end: var(--border-width-1) solid var(--color-border-subtle);
    border-inline-end: 0;
  }

  .studio-page-header,
  .studio-composer__footer {
    align-items: stretch;
    flex-direction: column;
  }
}

.ui-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--control-h-sm);
  border: var(--border-width-1) solid transparent;
  border-radius: var(--radius-full);
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  font-weight: 650;
  line-height: var(--lh-xs);
}

.ui-badge--neutral {
  background: var(--color-surface);
  border-color: var(--color-border-subtle);
  color: var(--color-text-secondary);
}

.ui-badge--accent {
  background: color-mix(in srgb, var(--color-accent) 14%, transparent);
  border-color: color-mix(in srgb, var(--color-accent) 34%, transparent);
  color: var(--accent-text);
}

.ui-badge--success {
  background: color-mix(in srgb, var(--color-green) 14%, transparent);
  border-color: color-mix(in srgb, var(--color-green) 34%, transparent);
  color: var(--color-green);
}

.ui-badge--warning {
  background: color-mix(in srgb, var(--color-amber) 14%, transparent);
  border-color: color-mix(in srgb, var(--color-amber) 34%, transparent);
  color: var(--color-amber);
}

.ui-badge--danger {
  background: color-mix(in srgb, var(--color-red) 14%, transparent);
  border-color: color-mix(in srgb, var(--color-red) 34%, transparent);
  color: var(--color-red);
}

.ui-kbd {
  display: inline-flex;
  min-width: var(--control-h-sm);
  min-height: var(--control-h-sm);
  align-items: center;
  justify-content: center;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--color-base) 78%, var(--color-elevated) 22%);
  color: var(--color-text-secondary);
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: var(--lh-xs);
  padding: 0 var(--space-2);
}

.ui-segmented-control {
  position: relative;
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: var(--space-1);
  overflow: hidden;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-base) 64%, var(--color-elevated) 36%);
  box-shadow: var(--specular);
  padding: var(--space-1);
}

.ui-segmented-thumb {
  position: absolute;
  inset-block: var(--space-1);
  inset-inline-start: var(--space-1);
  width: calc((100% - (var(--space-1) * (var(--ui-segment-count) + 1))) / var(--ui-segment-count));
  border-radius: var(--radius-sm);
  background: var(--color-surface-active);
  box-shadow: var(--shadow-1), var(--specular);
  transform: translateX(calc(var(--ui-segment-index) * (100% + var(--space-1))));
  transition:
    transform var(--dur-3) var(--ease-spring),
    width var(--dur-3) var(--ease-spring),
    background var(--dur-2) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out);
  pointer-events: none;
}

.chat-composer-shell {
  overflow: hidden;
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-elevated);
  transition:
    border-color var(--dur-1) var(--ease-out),
    background var(--dur-1) var(--ease-out),
    box-shadow var(--dur-1) var(--ease-out);
}

.chat-composer-shell--drag {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 var(--border-width-1) color-mix(in srgb, var(--color-accent) 24%, transparent);
}

.chat-composer-textarea {
  width: 100%;
  min-height: 28px;
  resize: none;
  background: transparent;
  border-color: transparent;
  color: var(--color-text);
  font-size: var(--text-md);
  line-height: var(--lh-md);
  outline: none;
  padding: 0;
}

.chat-composer-textarea::placeholder {
  color: var(--color-text-muted);
}

.ui-textarea.chat-composer-textarea:focus-visible {
  box-shadow: none;
}

.chat-current-directory {
  max-width: calc(var(--space-12) * 3 + var(--space-4));
}

.chat-menu-panel {
  overflow: hidden;
  border: var(--border-width-1) solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-base);
  box-shadow: var(--shadow-elevated);
}

.chat-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: var(--border-width-1) solid var(--color-border-subtle);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  font-weight: 650;
  line-height: var(--lh-xs);
  padding: var(--space-2) var(--space-3);
}

.chat-menu-search {
  border-bottom: var(--border-width-1) solid var(--color-border-subtle);
  padding: var(--space-2);
}

.chat-menu-option {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  border: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font: inherit;
  padding: var(--space-2) var(--space-3);
  text-align: start;
  transition:
    background var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out);
}

.chat-menu-option:hover,
.chat-menu-option[data-highlighted="true"] {
  background: var(--color-surface-hover);
}

.chat-menu-option[aria-selected="true"] {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
}

.chat-menu-featured-boundary {
  background: var(--color-surface-hover);
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
  padding: var(--space-1) var(--space-3);
  text-transform: uppercase;
}

.chat-keyboard-hints {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-surface) 66%, transparent);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  padding: var(--space-2) var(--space-3);
}

.chat-jump-latest {
  position: absolute;
  inset-inline: 0;
  bottom: var(--space-3);
  z-index: 20;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

.chat-jump-latest > * {
  pointer-events: auto;
  box-shadow: var(--shadow-card);
}

.chat-message-actions {
  opacity: 1;
}

@media (hover: hover) and (pointer: fine) {
  .chat-message-actions {
    opacity: 0;
  }

  .group:hover .chat-message-actions,
  .chat-message-actions:focus-within {
    opacity: 1;
  }
}

.chat-message-action-bar {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-elevated) 70%, transparent);
  padding: var(--space-1);
}

.chat-user-bubble {
  align-self: flex-end;
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-xs) var(--radius-xl);
  background: var(--color-surface-active);
  color: var(--color-text);
  font-size: var(--text-md);
  line-height: var(--lh-md);
  padding: var(--space-2) var(--space-4);
  white-space: pre-wrap;
}

.chat-message-sending {
  align-self: flex-end;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}

.chat-markdown-content {
  font-size: var(--text-md);
  line-height: var(--lh-md);
}

.chat-markdown-content--streaming > :last-child {
  background: linear-gradient(100deg, var(--color-text) 30%, var(--color-accent) 50%, var(--color-text) 70%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: ui-stream-shimmer 2.4s linear infinite;
}

.chat-markdown-content--streaming > :last-child::after {
  content: "";
  display: inline-block;
  width: var(--space-2);
  height: 1em;
  margin-inline-start: var(--space-1);
  transform: translateY(0.16em);
  border-radius: var(--radius-xs);
  background: var(--color-accent);
  box-shadow: var(--glow-soft);
  animation: ui-stream-caret 1s steps(2, start) infinite;
}

.chat-attachment-file {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--color-surface-active);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  padding: var(--space-2) var(--space-3);
}

.chat-attachment-preview {
  max-width: calc(var(--space-12) * 4);
}

.chat-attachment-name {
  max-width: calc(var(--space-12) * 2 + var(--space-6));
}

.chat-tool-chart-frame {
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--color-surface);
}

.chat-tool-image {
  max-height: calc(var(--space-12) * 8 + var(--space-4));
}

.chat-tool-details {
  overflow: hidden;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  box-shadow: var(--specular);
  animation: ui-disclosure-in var(--dur-3) var(--ease-spring) both;
}

.chat-tool-status-icon {
  color: var(--color-text-muted);
}

.chat-tool-status-icon--running {
  color: var(--color-accent);
}

.chat-tool-status-icon--error {
  color: var(--color-red);
}

.chat-error-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  border: var(--border-width-1) solid color-mix(in srgb, var(--color-red) 30%, var(--color-border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-red) 5%, transparent);
  color: var(--color-red);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  padding: var(--space-3) var(--space-4);
}

.chat-approval-card {
  border-color: color-mix(in srgb, var(--color-amber) 25%, var(--color-border));
}

.chat-approval-icon {
  display: inline-flex;
  width: var(--control-h-md);
  height: var(--control-h-md);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-amber) 12%, transparent);
  color: var(--color-amber);
}

.reasoning-disclosure-trigger {
  transition:
    color var(--dur-1) var(--ease-out),
    background var(--dur-1) var(--ease-out),
    transform var(--dur-2) var(--ease-spring);
}

.reasoning-disclosure-trigger:hover {
  background: var(--color-surface-hover);
  transform: translateX(var(--space-1));
}

.reasoning-disclosure-panel {
  box-shadow: var(--specular), var(--glow-soft);
  animation: ui-disclosure-in var(--dur-3) var(--ease-spring) both;
}

.home-example-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.home-coworker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
}

@media (max-width: 640px) {
  .home-example-grid,
  .home-coworker-grid {
    grid-template-columns: 1fr;
  }
}

.home-coachmark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  border: var(--border-width-1) solid color-mix(in srgb, var(--color-accent) 28%, var(--color-border-subtle));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-accent) 9%, transparent);
  color: var(--color-text-secondary);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  padding: var(--space-3);
}

.home-image-hint {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-surface) 72%, transparent);
  color: var(--color-text-secondary);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  padding: var(--space-1) var(--space-3);
}

.home-status-strip {
  background: color-mix(in srgb, var(--color-surface) 62%, transparent);
}

.home-recent-accent {
  height: var(--border-width-1);
  width: var(--space-8);
  background: color-mix(in srgb, var(--color-accent) 34%, var(--color-border-subtle));
}

.sidebar-nav-item {
  position: relative;
}

.sidebar-nav-primary {
  display: flex;
  width: 100%;
  align-items: center;
  gap: var(--space-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
  padding: var(--space-2) var(--space-3);
  transition:
    background var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out);
}

.sidebar-nav-item[aria-current="page"]::before {
  content: "";
  position: absolute;
  inset-block: var(--space-2);
  inset-inline-start: var(--space-1);
  width: 2px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
}

.settings-dialog-shell {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: var(--space-4);
}

.settings-dialog-loading {
  display: flex;
  min-height: calc(var(--space-12) * 6);
  flex-direction: column;
  gap: var(--space-4);
}

.settings-dialog-intro,
.settings-dialog-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.settings-dialog-layout {
  display: grid;
  min-height: 0;
  grid-template-columns: calc(var(--space-12) * 4) minmax(0, 1fr);
  overflow: hidden;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-surface) 58%, transparent);
}

.settings-section-rail {
  display: flex;
  min-height: 0;
  flex-direction: column;
  gap: var(--space-3);
  border-inline-end: var(--border-width-1) solid var(--color-border-subtle);
  padding: var(--space-3);
}

.settings-section-list {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  gap: var(--space-1);
  overflow-y: auto;
}

.settings-section-button {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  border: var(--border-width-1) solid transparent;
  border-radius: var(--radius-sm);
  color: var(--color-text-muted);
  cursor: pointer;
  padding: var(--space-2) var(--space-3);
  text-align: start;
  transition:
    background var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out);
}

.settings-section-button:hover {
  background: var(--color-surface-hover);
  color: var(--color-text-secondary);
}

.settings-section-button[aria-current="page"] {
  border-color: color-mix(in srgb, var(--color-accent) 55%, transparent);
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  color: var(--color-text);
}

.settings-section-button > span:first-child {
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: var(--lh-sm);
}

.settings-section-button > span:last-child {
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
}

.settings-search-results {
  overflow: hidden;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: var(--color-elevated);
}

.settings-search-result {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  border-block-end: var(--border-width-1) solid var(--color-border-subtle);
  color: var(--color-text-secondary);
  cursor: pointer;
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
  padding: var(--space-2);
  text-align: start;
}

.settings-search-result:last-child {
  border-block-end: 0;
}

.settings-search-result:hover {
  background: var(--color-surface-hover);
  color: var(--color-text);
}

.settings-search-result > span:last-child {
  color: var(--color-text-muted);
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
}

.settings-wide-control {
  width: 100%;
}

.settings-wide-control > .ui-segmented-control {
  width: 100%;
}

.settings-runtime-source-control {
  width: 260px;
}

.settings-permission-control {
  width: 220px;
}

.settings-choice-card {
  min-width: 0;
}

.settings-choice-card[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--color-accent) 72%, transparent);
  background: color-mix(in srgb, var(--color-accent) 10%, var(--color-elevated));
  box-shadow:
    var(--ring-selected),
    0 6px 20px color-mix(in srgb, var(--color-accent) 14%, transparent);
}

.settings-theme-card:hover:not(:disabled) {
  transform: scale(1.01);
}

.settings-mini-badge {
  min-height: auto;
  border-radius: var(--radius-xs);
  padding: 1px var(--space-2);
  font-size: 9px;
  line-height: 12px;
  text-transform: uppercase;
}

.settings-model-list {
  max-height: 420px;
  overflow: auto;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
}

.settings-model-list-option {
  border: 0;
  border-block-end: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: 0;
  background: transparent;
}

.settings-model-list > div:last-child .settings-model-list-option {
  border-block-end: 0;
}

.settings-model-list-option[aria-pressed="true"] {
  background: color-mix(in srgb, var(--color-accent) 10%, transparent);
  box-shadow: inset 2px 0 0 var(--color-accent);
}

.settings-action-card {
  width: 100%;
}

.settings-action-card:disabled {
  cursor: wait;
  opacity: 0.6;
}

.settings-danger-card {
  border-color: color-mix(in srgb, var(--color-red) 40%, var(--color-border-subtle));
  background: color-mix(in srgb, var(--color-red) 6%, transparent);
}

.settings-content-pane {
  display: flex;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
}

.settings-content-heading {
  border-block-end: var(--border-width-1) solid var(--color-border-subtle);
  padding: var(--space-4) var(--space-5);
}

.settings-content-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
}

.settings-switch {
  position: relative;
  width: var(--space-10);
  height: var(--space-5);
  border-radius: var(--radius-full);
  background: var(--color-border);
  cursor: pointer;
  transition: background var(--dur-1) var(--ease-out);
}

.settings-switch:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.settings-switch--on {
  background: var(--color-accent);
}

.settings-switch__thumb {
  position: absolute;
  inset-block-start: 3px;
  inset-inline-start: 3px;
  width: 14px;
  height: 14px;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-elevated) 92%, var(--color-base) 8%);
  transition: transform var(--dur-1) var(--ease-out);
}

.settings-switch--on .settings-switch__thumb {
  transform: translateX(20px);
}

@media (max-width: 860px) {
  .settings-dialog-layout {
    grid-template-columns: 1fr;
  }

  .settings-section-rail {
    border-block-end: var(--border-width-1) solid var(--color-border-subtle);
    border-inline-end: 0;
  }

  .settings-section-list {
    max-height: calc(var(--space-12) * 3);
  }

  .settings-runtime-source-control,
  .settings-permission-control {
    width: 100%;
  }
}

.statusbar-root {
  background: color-mix(in srgb, var(--color-base) 92%, var(--color-elevated) 8%);
}

.statusbar-badge {
  min-height: calc(var(--space-4) + var(--space-1));
  padding: 0 var(--space-2);
  font-size: var(--text-2xs);
  line-height: var(--lh-2xs);
}

.statusbar-meter {
  position: relative;
  display: inline-flex;
  width: calc(var(--space-12) + var(--space-2));
  height: var(--space-1);
  overflow: hidden;
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-border) 75%, transparent);
}

.statusbar-meter__fill {
  display: block;
  height: 100%;
  background: var(--statusbar-meter-color, var(--color-text-muted));
}

.statusbar-meter__fill--compacting {
  box-shadow: 0 0 var(--space-2) var(--statusbar-meter-color, var(--color-accent));
}

.new-thread-error {
  border-color: color-mix(in srgb, var(--color-red) 35%, transparent);
  background: color-mix(in srgb, var(--color-red) 10%, transparent);
  color: var(--color-red);
}

.new-thread-trigger {
  justify-content: flex-start;
  background: var(--accent-action-fill);
  border-color: var(--accent-line);
  color: var(--accent-action-foreground);
  box-shadow: var(--shadow-1), var(--specular);
}

.new-thread-trigger:hover:not(:disabled) {
  background: var(--accent-action-fill);
  box-shadow: var(--glow-soft), var(--shadow-2), var(--specular-strong);
}

.ui-card.new-thread-menu-option {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--color-text);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}

.ui-card.new-thread-menu-option:hover:not(:disabled) {
  background: var(--color-surface-hover);
}

.ui-card.new-thread-menu-option:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.new-thread-menu-separator {
  border-top: var(--border-width-1) solid var(--color-border-subtle);
}

.ui-segmented-option {
  position: relative;
  z-index: 1;
  min-height: var(--control-h-md);
  background: transparent;
  color: var(--color-text-muted);
  padding: 0 var(--space-3);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}

.ui-segmented-option:hover:not(:disabled) {
  color: var(--color-text-secondary);
}

.ui-segmented-option[aria-selected="true"] {
  background: transparent;
  color: var(--color-text);
  box-shadow: none;
}

.ui-empty-state {
  display: grid;
  place-items: center;
  gap: var(--space-3);
  border: var(--border-width-1) solid color-mix(in srgb, var(--color-accent) 20%, var(--color-border-subtle));
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 60%),
    color-mix(in srgb, var(--color-surface) 72%, transparent);
  box-shadow: var(--shadow-1), var(--specular);
  color: var(--color-text-secondary);
  padding: var(--space-8);
  text-align: center;
}

.ui-empty-state__icon {
  display: grid;
  place-items: center;
  width: var(--control-h-xl);
  height: var(--control-h-xl);
  border-radius: var(--radius-full);
  background: color-mix(in srgb, var(--color-accent) 12%, transparent);
  color: var(--color-accent);
  box-shadow: var(--glow-soft), var(--specular);
}

.ui-empty-state__title {
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 650;
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-lg);
}

.ui-empty-state__body {
  max-width: 42ch;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: var(--lh-sm);
}

.ui-skeleton {
  display: block;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-surface) 80%, transparent),
    color-mix(in srgb, var(--color-surface-hover) 82%, transparent),
    color-mix(in srgb, var(--color-surface) 80%, transparent)
  );
  background-size: 200% 100%;
  animation: ui-skeleton-shimmer 1.2s var(--ease-out) infinite;
}

.ui-skeleton--text {
  width: 100%;
  height: var(--lh-sm);
}

.ui-skeleton--block {
  width: 100%;
  min-height: calc(var(--space-12) * 2);
}

.ui-skeleton--card {
  width: 100%;
  min-height: calc(var(--space-12) * 3);
  border-radius: var(--radius-md);
}

.ui-skeleton--row {
  width: 100%;
  min-height: var(--control-h-xl);
  border-radius: var(--radius-sm);
}

.ui-skeleton--message {
  width: min(72ch, 100%);
  min-height: calc(var(--space-12) * 2);
  border-radius: var(--radius-lg);
}

.ui-skeleton--table {
  width: 100%;
  min-height: calc(var(--space-12) * 4);
  border-radius: var(--radius-md);
}

@keyframes ui-skeleton-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@keyframes ui-spin {
  to { transform: rotate(360deg); }
}

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

@keyframes ui-view-transition-in {
  from { opacity: 0; transform: translateY(var(--space-2)); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ui-view-transition-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(calc(-1 * var(--space-1))); }
}

::view-transition-old(root) {
  animation: ui-view-transition-out var(--dur-2) var(--ease-out) both;
}

::view-transition-new(root) {
  animation: ui-view-transition-in var(--dur-3) var(--ease-spring) both;
}

@keyframes ui-popover-in {
  from { opacity: 0; transform: translateY(calc(-1 * var(--space-1))) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ui-dialog-in {
  from { opacity: 0; transform: translateX(-50%) translateY(var(--space-3)) scale(0.985); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

@keyframes ui-drawer-in {
  from { opacity: 0.6; transform: translateX(var(--space-6)); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes ui-drawer-left-in {
  from { opacity: 0.6; transform: translateX(calc(-1 * var(--space-6))); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes ui-primary-sheen {
  from { transform: skewX(-18deg) translateX(0); }
  to { transform: skewX(-18deg) translateX(430%); }
}

@keyframes ui-status-pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 42%, transparent); }
  70% { box-shadow: 0 0 0 var(--space-2) transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

@keyframes ui-progress-shimmer {
  from { background-position: 220% 0; }
  to { background-position: -220% 0; }
}

@keyframes ui-atmosphere-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(2%, 1.5%, 0) scale(1.08); }
}

@keyframes ui-stream-shimmer {
  to { background-position: -220% 0; }
}

@keyframes ui-stream-caret {
  50% { opacity: 0; }
}

@keyframes ui-disclosure-in {
  from { opacity: 0; transform: translateY(calc(-1 * var(--space-1))); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ui-polish-row-in {
  from { opacity: 0; transform: translateX(calc(-1 * var(--space-2))); }
  to { opacity: 1; transform: translateX(0); }
}

.ui-spin {
  animation: ui-spin 820ms linear infinite;
}

.ui-progress-shimmer {
  background-image: linear-gradient(
    90deg,
    color-mix(in srgb, var(--color-accent) 56%, transparent),
    var(--color-accent),
    color-mix(in srgb, var(--color-accent) 56%, transparent)
  ) !important;
  background-size: 220% 100% !important;
  box-shadow: var(--glow-soft);
  animation: ui-progress-shimmer 1.25s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
  .ui-skeleton {
    animation: none;
  }

  .ui-spin {
    animation: none;
  }

  .ui-progress-shimmer,
  .ui-tooltip,
  .ui-toast-indicator,
  .ui-popover,
  .ui-dialog,
  .ui-dialog-backdrop,
  .chat-markdown-content--streaming > :last-child,
  .chat-markdown-content--streaming > :last-child::after,
  .chat-tool-details,
  .ui-polish-list-row,
  .ui-polish-list-row[data-polish-stagger],
  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none;
  }

  .ui-button--primary:hover:not(:disabled)::after {
    animation: none;
  }

  body::before {
    animation: none;
  }
}

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .ui-tooltip,
  .ui-toast-card,
  .ui-popover,
  .ui-dialog,
  .theme-popover,
  .ui-workbench-layout__review,
  .ui-action-cluster,
  .desktop-chat-workbench .ui-workbench-layout__review > aside {
    background: var(--color-elevated);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

.theme-popover {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-3), var(--specular-strong);
}

/* Remove default focus outlines — use custom focus styles where needed */
*:focus { outline: none; }
*:focus-visible { outline: 1px solid var(--color-accent); outline-offset: -1px; border-radius: 4px; }
/* Opt-out for surfaces that own their own focus affordance. The Home
   composer, for instance, is a decorated container whose wrapper is
   the visual target — the global accent outline on the inner textarea
   bleeds through the wrapper and reads as a purple highlight. Marking
   the element `data-no-focus-ring` suppresses the global ring there. */
*[data-no-focus-ring]:focus-visible { outline: none; }

/* Selection */
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--color-text) 10%, transparent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--color-text) 18%, transparent); }

/* Drag regions */
.drag { -webkit-app-region: drag; }
.no-drag { -webkit-app-region: no-drag; }

/* Card hover glow driven by a per-card CSS variable. Components that
 * tint the hover shadow with an agent/capability color set
 * `--card-hover-shadow` inline on the element; the hover selector
 * picks it up without needing a JS onMouseEnter handler. Replaces
 * a pattern that was flagged by jsx-a11y/no-static-element-interactions. */
.card-hover:hover {
  box-shadow: var(--card-hover-shadow), var(--specular-strong);
}
@media (prefers-reduced-motion: reduce) {
  .card-hover:hover {
    box-shadow: var(--card-hover-shadow);
  }
}

.ui-polish-list-row {
  position: relative;
  padding-block: var(--row-pad);
  transition:
    background var(--dur-1) var(--ease-out),
    border-color var(--dur-1) var(--ease-out),
    color var(--dur-1) var(--ease-out),
    box-shadow var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-spring);
}

.ui-polish-list-row::before {
  content: "";
  position: absolute;
  inset-block: var(--space-2);
  inset-inline-start: 0;
  width: 2px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--color-accent) 42%, transparent);
  opacity: 0;
  transform: scaleY(0);
  transform-origin: center;
  transition:
    opacity var(--dur-2) var(--ease-out),
    transform var(--dur-2) var(--ease-spring);
  pointer-events: none;
}

.ui-polish-list-row:hover:not(:disabled) {
  transform: translateX(var(--space-1));
}

.ui-polish-list-row:hover:not(:disabled)::before,
.ui-polish-list-row[aria-current="page"]::before,
.ui-polish-list-row[aria-pressed="true"]::before,
.ui-polish-list-row[data-selected="true"]::before,
.ui-polish-list-row[data-active="true"]::before {
  opacity: 1;
  transform: scaleY(1);
}

.ui-polish-list-row[data-polish-stagger] {
  animation: ui-polish-row-in var(--dur-4) var(--ease-spring) both;
  animation-delay: calc(var(--polish-row-index, 0) * 24ms);
}

.agent-capability-profile {
  border: var(--border-width-1) solid var(--glass-border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--color-accent) 10%, transparent), transparent 58%),
    var(--color-elevated);
  box-shadow: var(--shadow-1), var(--specular);
  padding: var(--space-3);
}

.agent-capability-profile--compact {
  padding: var(--space-3);
}

.agent-capability-profile__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.agent-capability-profile__eyebrow {
  font-size: var(--text-2xs);
  line-height: var(--line-tight);
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--color-text-muted);
}

.agent-capability-profile__label {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  line-height: var(--line-tight);
  font-weight: 650;
  color: var(--color-text);
}

.agent-capability-profile__score {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--color-accent);
  text-shadow: 0 0 18px color-mix(in srgb, var(--color-accent) 28%, transparent);
}

.agent-capability-profile__score span {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  line-height: 1;
  font-weight: 760;
}

.agent-capability-profile__score small {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.agent-capability-profile__radar {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.agent-capability-profile__ring {
  fill: transparent;
  stroke: color-mix(in srgb, var(--color-accent) 18%, var(--color-border-subtle));
  stroke-width: 1;
}

.agent-capability-profile__axis {
  stroke: color-mix(in srgb, var(--color-text-muted) 20%, transparent);
  stroke-width: 1;
}

.agent-capability-profile__axis-label {
  fill: var(--color-text-muted);
  font-size: 8px;
  font-weight: 600;
}

.agent-capability-profile__shape {
  fill: color-mix(in srgb, var(--color-accent) 22%, transparent);
  stroke: var(--color-accent);
  stroke-width: 1.6;
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--color-accent) 26%, transparent));
}

.agent-capability-profile__dot {
  fill: var(--color-accent);
  stroke: var(--color-accent-foreground);
  stroke-width: 1;
}

.agent-capability-profile__legend {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.agent-capability-profile__legend-row {
  display: grid;
  grid-template-columns: minmax(48px, 0.8fr) minmax(56px, 1fr) minmax(60px, 1fr);
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  color: var(--color-text-secondary);
  font-size: var(--text-2xs);
  line-height: var(--line-tight);
}

.agent-capability-profile__legend-row > span:last-child {
  color: var(--color-text-muted);
  text-align: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-capability-profile__meter {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: color-mix(in srgb, var(--color-text-muted) 16%, transparent);
}

.agent-capability-profile__meter i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent-gradient);
  box-shadow: var(--glow-soft);
}

.agent-model-provider-option[aria-pressed="true"] {
  border-color: color-mix(in srgb, var(--color-accent) 42%, var(--color-border-subtle));
  background: color-mix(in srgb, var(--color-accent) 10%, var(--color-elevated));
  box-shadow: var(--glow-soft), var(--specular);
}

/* Thinking shimmer */
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
.thinking-shimmer {
  background: linear-gradient(
    90deg,
    var(--color-text-muted) 0%,
    var(--color-text-muted) 35%,
    var(--color-text) 50%,
    var(--color-text-muted) 65%,
    var(--color-text-muted) 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmer 2s ease-in-out infinite;
}

/* Reduced-motion users still need to know the app is thinking — drop
 * the horizontal slide but keep the muted color so the "thinking"
 * state is visibly distinct from idle text. */
@media (prefers-reduced-motion: reduce) {
  .thinking-shimmer {
    animation: none;
    color: var(--color-text-muted);
    -webkit-text-fill-color: var(--color-text-muted);
  }
}

/* Snap-in animation applied to skill pills / tool tiles as they land in
 * the selected capabilities. 180ms scale + fade — just enough to feel satisfying
 * when the user attaches something, short enough not to be a spinner.
 */
@keyframes agentCapabilitySnap {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.05); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.agent-capability-snap {
  animation: agentCapabilitySnap 180ms ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  .agent-capability-snap { animation: none; }
}

@keyframes toast-slide-in {
  from { transform: translateY(8px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.toast-enter {
  animation: toast-slide-in var(--dur-2) var(--ease-out) both;
}

@media (prefers-reduced-motion: reduce) {
  .toast-enter { animation: none; }
}

/* Agent run lane status pulse — the dot next to "running" lanes
 * glows softly so the user can see at a glance which agents are live.
 */
@keyframes agent-run-pulse {
  0%, 100% { opacity: 0.55; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}
@keyframes task-drill-in-drawer-in {
  from { transform: translateX(24px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  [style*="agent-run-pulse"] { animation: none !important; }
  [style*="task-drill-in-drawer-in"] { animation: none !important; }
}

/* Shared workbench IA primitives */
.ui-workbench-layout {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  position: relative;
  transition: grid-template-columns var(--dur-4) var(--ease-spring);
}
.ui-workbench-layout--with-review {
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
}
.ui-workbench-layout--with-left {
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
}
.ui-workbench-layout--with-left.ui-workbench-layout--with-review {
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(280px, 360px);
}
.ui-workbench-layout__left,
.ui-workbench-layout__main,
.ui-workbench-layout__review {
  min-width: 0;
  min-height: 0;
}
.ui-workbench-layout__main {
  display: flex;
  flex-direction: column;
}
.ui-workbench-layout__review {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: var(--border-width-1) solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-3), var(--specular-strong);
  animation: ui-popover-in var(--dur-3) var(--ease-spring) both;
}
.desktop-chat-workbench {
  flex: 1 1 auto;
  min-height: 0;
}
.desktop-chat-workbench .ui-workbench-layout__review > aside {
  width: 360px;
  max-width: 100%;
}
@media (max-width: 920px) {
  .ui-workbench-layout,
  .ui-workbench-layout--with-review,
  .ui-workbench-layout--with-left,
  .ui-workbench-layout--with-left.ui-workbench-layout--with-review {
    grid-template-columns: 1fr;
  }

  .ui-workbench-layout__review:not([hidden]) {
    position: fixed;
    inset: var(--space-3);
    z-index: var(--z-modal);
    width: auto;
    max-height: calc(100dvh - var(--space-6));
    outline: none;
  }

  .desktop-chat-workbench .ui-workbench-layout__review > aside {
    width: 100%;
  }
}
.ui-action-cluster {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-2), var(--specular);
  padding: var(--space-1);
  flex-wrap: wrap;
}
.ui-action-cluster__item {
  min-height: var(--control-h-sm);
  border: var(--border-width-1) solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--color-text-secondary);
  padding: 0 var(--space-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 650;
  line-height: var(--lh-xs);
  white-space: nowrap;
  transition: background var(--dur-1) var(--ease-out), color var(--dur-1) var(--ease-out), border-color var(--dur-1) var(--ease-out);
}
.ui-action-cluster__item:hover:not(:disabled),
.ui-action-cluster__item[aria-pressed="true"] {
  border-color: var(--color-border);
  background: var(--color-surface-hover);
  color: var(--color-text);
}
.ui-action-cluster__item:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}
.ui-action-cluster__item--primary {
  color: var(--color-accent);
}
.ui-action-cluster__item--danger {
  color: var(--color-red);
}
.ui-diff-view {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.ui-diff-view__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
  min-width: 0;
}
.ui-diff-view__title {
  min-width: 0;
}
.ui-diff-view__title h3 {
  margin: 0;
  color: var(--color-text);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: 650;
  line-height: var(--lh-md);
}
.ui-diff-view__title p {
  margin: var(--space-1) 0 0;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}
.ui-diff-view__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.ui-diff-view__files {
  display: grid;
  gap: var(--space-2);
}
.ui-diff-view__file {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-2);
  align-items: center;
  border: var(--border-width-1) solid var(--color-border-subtle);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-surface) 76%, transparent);
  padding: var(--space-2);
}
.ui-diff-view__file-main,
.ui-diff-view__file-meta {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.ui-diff-view__file-main code {
  overflow: hidden;
  color: var(--color-text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-diff-view__file-meta {
  justify-content: flex-end;
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}
.ui-diff-view__plus { color: var(--color-green); }
.ui-diff-view__minus { color: var(--color-red); }
.ui-diff-view__estimate,
.ui-diff-view__empty {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
  line-height: var(--lh-xs);
}
.desktop-diff-view {
  overflow: hidden;
  gap: 0;
}
.desktop-diff-view > .ui-diff-view__header {
  border-bottom: var(--border-width-1) solid var(--color-border-subtle);
  padding: var(--space-3) var(--space-4);
}
.desktop-diff-view > .flex-1 {
  min-height: 0;
}

/* Markdown prose */
.prose h1, .prose h2, .prose h3, .prose h4 { margin-top: 1.2em; margin-bottom: 0.4em; font-weight: 600; color: var(--color-text); }
.prose h1 { font-size: 1.25em; }
.prose h2 { font-size: 1.15em; }
.prose h3 { font-size: 1.05em; }
.prose h4 { font-size: 1em; }
.prose > *:first-child { margin-top: 0; }
.prose p { margin-bottom: 0.6em; line-height: 1.65; }
.prose ul, .prose ol { margin-bottom: 0.6em; padding-left: 1.5em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: 0.25em; line-height: 1.6; }
.prose li > ul, .prose li > ol { margin-top: 0.2em; margin-bottom: 0.2em; }
.prose strong { font-weight: 600; color: var(--color-text); }
.prose em { font-style: italic; }
.prose a { color: var(--accent-text); text-decoration: none; }
.prose a:hover { text-decoration: underline; }
.prose hr { border: none; border-top: 1px solid var(--color-border); margin: 1em 0; }

/* Inline code */
.prose code:not([class]) {
  background: color-mix(in srgb, var(--color-text) 8%, transparent);
  padding: 0.15em 0.4em;
  border-radius: 5px;
  font-size: 0.88em;
  font-family: var(--font-mono);
  color: var(--color-text);
  word-break: break-word;
}

/* Code blocks */
.prose pre {
  background: color-mix(in srgb, var(--color-base) 95%, var(--color-text) 5%);
  border: 1px solid var(--color-border-subtle);
  border-radius: 10px;
  padding: 1em 1.2em;
  margin-bottom: 0.75em;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.6;
}
.prose pre code {
  background: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
  font-family: var(--font-mono);
  color: var(--color-text-secondary);
}

.prose [data-component="markdown-code"] {
  position: relative;
}

.prose [data-component="markdown-code"] pre {
  padding-right: 3.1rem;
}

.prose [data-slot="markdown-copy-button"] {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  height: 1.9rem;
  width: 1.9rem;
  border-radius: 0.55rem;
  border: 1px solid var(--color-border-subtle);
  background: color-mix(in srgb, var(--color-base) 82%, var(--color-surface-hover) 18%);
  color: var(--color-text-secondary);
  opacity: 0.72;
  transition: opacity 120ms ease, color 120ms ease, border-color 120ms ease, background 120ms ease, transform 120ms ease;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

@media (prefers-reduced-motion: reduce) {
  /* Drop the opacity / color / transform transition for motion-sensitive
   * users — the hover/active state still changes, it just snaps
   * instead of animating. */
  .prose [data-slot="markdown-copy-button"] {
    transition: none;
  }
  .prose [data-slot="markdown-copy-button"]:active {
    transform: none;
  }
}

.prose [data-slot="markdown-copy-button"]:hover,
.prose [data-slot="markdown-copy-button"]:focus-visible,
.prose [data-component="markdown-code"]:hover [data-slot="markdown-copy-button"] {
  opacity: 1;
  color: var(--color-text);
  border-color: var(--color-border);
  background: color-mix(in srgb, var(--color-base) 72%, var(--color-surface-hover) 28%);
}

.prose [data-slot="markdown-copy-button"]:active {
  transform: scale(0.96);
}

.prose [data-slot="markdown-copy-button"] svg {
  width: 0.95rem;
  height: 0.95rem;
}

.prose [data-slot="markdown-check-icon"] {
  display: none;
}

.prose [data-slot="markdown-copy-button"][data-copied="true"] [data-slot="markdown-copy-icon"] {
  display: none;
}

.prose [data-slot="markdown-copy-button"][data-copied="true"] [data-slot="markdown-check-icon"] {
  display: block;
}

/* Syntax highlighting (dark theme) */
.hljs { color: #c9d1d9; }
.hljs-keyword { color: #ff7b72; }
.hljs-string { color: #a5d6ff; }
.hljs-number { color: #79c0ff; }
.hljs-comment { color: #8b949e; font-style: italic; }
.hljs-built_in { color: #d2a8ff; }
.hljs-function { color: #d2a8ff; }
.hljs-title { color: #d2a8ff; }
.hljs-params { color: #c9d1d9; }
.hljs-type { color: #ff7b72; }
.hljs-attr { color: #79c0ff; }
.hljs-property { color: #79c0ff; }
.hljs-literal { color: #79c0ff; }
.hljs-variable { color: #ffa657; }
.hljs-operator { color: #ff7b72; }
.hljs-punctuation { color: #8b949e; }
.hljs-meta { color: #8b949e; }
.hljs-selector-tag { color: #7ee787; }
.hljs-selector-class { color: #d2a8ff; }
.hljs-tag { color: #7ee787; }
.hljs-name { color: #7ee787; }

/* Tables */
.prose table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.9em;
}
.prose th {
  background: var(--color-surface);
  font-weight: 600;
  text-align: left;
  padding: 0.55em 0.8em;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text);
  white-space: nowrap;
}
.prose td {
  padding: 0.5em 0.8em;
  border-bottom: 1px solid var(--color-border-subtle);
  color: var(--color-text-secondary);
}
.prose tr:last-child td { border-bottom: none; }
.prose tr:hover td { background: var(--color-surface-hover); }

/* Blockquotes */
.prose blockquote {
  border-left: 3px solid var(--color-accent);
  padding: 0.4em 0 0.4em 1em;
  color: var(--color-text-secondary);
  margin-bottom: 0.6em;
}
.prose blockquote p:last-child { margin-bottom: 0; }

/* Images */
.prose img {
  max-width: 100%;
  border-radius: 8px;
  margin-bottom: 0.6em;
}
