@import "./styles/fonts.css";
@import "tailwindcss";
@import "./styles/tokens.css";
@import "./styles/theme-bridge.css";
@import "./styles/token-utilities.css";
@import "./styles/platform/shared.css";
@import "./styles/platform/darwin.css";
@import "./styles/platform/win32.css";
@import "./styles/platform/linux.css";
@import "tw-animate-css";
@import "shadcn/tailwind.css";

@custom-variant dark (&:is(.dark *));

@source "../node_modules/streamdown/dist/*.js";

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

:root {
  --desktop-portal-layer: 120;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--surface-window);
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

/* Opt in to text selection only on copyable surfaces (chat, previews, settings values). */
.select-text,
[data-selectable="text"],
[data-file-preview-content="true"],
[data-file-preview-markdown-shell="true"],
.docx-preview,
.settings-shell__content,
input:not([type="checkbox"]):not([type="radio"]),
textarea,
[contenteditable="true"],
pre,
code {
  user-select: text;
  -webkit-user-select: text;
}

[data-spreadsheet-preview="true"] table,
[data-spreadsheet-preview="true"] table button {
  user-select: text;
  -webkit-user-select: text;
}

* {
  box-sizing: border-box;
}

[data-cowork-univer-canvas="true"],
[data-cowork-univer-canvas="true"] * {
  --primary-color: var(--accent);
  --brand-color: var(--accent);
}

[data-cowork-univer-canvas="true"] {
  user-select: text;
  -webkit-user-select: text;
}

[data-cowork-univer-canvas="true"] :where(.univer, .univer-app, .univer-container) {
  background: var(--surface-spreadsheet);
}

[data-cowork-univer-canvas="true"] :where(input, textarea, [contenteditable="true"]) {
  user-select: text;
  -webkit-user-select: text;
}

[data-cowork-univer-canvas="true"] [data-u-comp="formula-bar"] {
  /* biome-ignore lint/complexity/noImportantStyles: override Univer's own formula-bar height */
  height: 2.25rem !important;
  min-height: 2.25rem;
  overflow: hidden;
}

[data-cowork-univer-canvas="true"] [data-u-comp="formula-bar"] .univer-break-words {
  overflow: hidden;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

[data-cowork-univer-canvas="true"] [data-u-comp="formula-bar"] [data-u-comp="render-canvas"] {
  display: block;
  max-height: 2rem;
}

:root[data-window-mode="canvas"][data-canvas-surface] {
  background: var(--surface-canvas);
  color: var(--text-canvas);
}

:root[data-window-mode="canvas"][data-canvas-surface] body,
:root[data-window-mode="canvas"][data-canvas-surface] #root {
  background: var(--surface-canvas);
  color: var(--text-canvas);
}

:root[data-window-mode="quick-chat"] body,
:root[data-window-mode="utility"] body {
  background: transparent;
}

/* Edge-to-edge popup shells; native windows provide the rounded clip. */
:root[data-window-mode="quick-chat"] #root,
:root[data-window-mode="utility"] #root {
  overflow: hidden;
}

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

/* Thin overlay-style scrollbars for Chromium 146+ */
::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

::selection {
  background: var(--surface-selection);
  color: inherit;
}

.is-user ::selection {
  background: var(--surface-selection-inverse);
  color: inherit;
}

:root[data-high-contrast="true"] ::selection,
:root[data-high-contrast="true"] .is-user ::selection {
  color: var(--text-primary-on-accent);
}

:where(:root[data-high-contrast="true"])
  [data-slot="dropdown-menu-item"][data-variant="destructive"]:focus {
  --danger: var(--text-accent-foreground);
  background: var(--surface-accent-interactive);
  color: var(--text-accent-foreground);
}

:where(:root[data-high-contrast="true"]) [data-slot="command-item"][data-selected="true"] {
  /* biome-ignore lint/complexity/noImportantStyles: selected command rows must override caller background utilities */
  background: var(--surface-accent-interactive) !important;
}

:where(:root[data-high-contrast="true"])
  :where([data-slot="command-item"][data-selected="true"], [data-slot="dropdown-menu-item"]:focus) {
  /* biome-ignore lint/complexity/noImportantStyles: selected accessibility rows must override explicit child color utilities */
  color: var(--text-accent-foreground) !important;
}

:where(:root[data-high-contrast="true"])
  :where([data-slot="command-item"][data-selected="true"], [data-slot="dropdown-menu-item"]:focus)
  :where(*):not(
    [hidden],
    .sr-only,
    [hidden] *,
    .sr-only *,
    input,
    textarea,
    select,
    button,
    [contenteditable="true"],
    input *,
    textarea *,
    select *,
    button *,
    [contenteditable="true"] *
  ) {
  /* biome-ignore lint/complexity/noImportantStyles: selected accessibility rows must override explicit child color utilities */
  color: var(--text-accent-foreground) !important;
}

:where(:root[data-high-contrast="true"]) .app-selected-row:not([hidden], .sr-only) {
  /* biome-ignore lint/complexity/noImportantStyles: selected accessibility rows must override explicit child color utilities */
  color: var(--text-selected-row) !important;
}

:where(:root[data-high-contrast="true"])
  .app-selected-row:not([hidden], .sr-only)
  :where(*):not(
    [hidden],
    .sr-only,
    [hidden] *,
    .sr-only *,
    :where(
      .app-selected-row > :is(input, textarea, select, button, [contenteditable="true"]),
      .app-selected-row > * :is(input, textarea, select, button, [contenteditable="true"])
    ),
    :where(
      .app-selected-row > :is(input, textarea, select, button, [contenteditable="true"]) *,
      .app-selected-row > * :is(input, textarea, select, button, [contenteditable="true"]) *
    )
  ) {
  /* biome-ignore lint/complexity/noImportantStyles: selected accessibility rows must override explicit child color utilities */
  color: var(--text-selected-row) !important;
}

@media (forced-colors: active) {
  :where(:root) [data-slot="dropdown-menu-item"][data-variant="destructive"]:focus {
    --danger: var(--text-accent-foreground);
    background: var(--surface-accent-interactive);
    color: var(--text-accent-foreground);
  }
  :root ::selection,
  :root .is-user ::selection {
    color: var(--text-primary-on-accent);
  }

  :where(:root) [data-slot="command-item"][data-selected="true"] {
    /* biome-ignore lint/complexity/noImportantStyles: selected command rows must override caller background utilities */
    background: var(--surface-accent-interactive) !important;
  }

  :where(:root)
    :where(
      [data-slot="command-item"][data-selected="true"],
      [data-slot="dropdown-menu-item"]:focus
    ) {
    /* biome-ignore lint/complexity/noImportantStyles: selected accessibility rows must override explicit child color utilities */
    color: var(--text-accent-foreground) !important;
  }

  :where(:root)
    :where([data-slot="command-item"][data-selected="true"], [data-slot="dropdown-menu-item"]:focus)
    :where(*):not(
      [hidden],
      .sr-only,
      [hidden] *,
      .sr-only *,
      input,
      textarea,
      select,
      button,
      [contenteditable="true"],
      input *,
      textarea *,
      select *,
      button *,
      [contenteditable="true"] *
    ) {
    /* biome-ignore lint/complexity/noImportantStyles: selected accessibility rows must override explicit child color utilities */
    color: var(--text-accent-foreground) !important;
  }

  :where(:root) .app-selected-row:not([hidden], .sr-only) {
    /* biome-ignore lint/complexity/noImportantStyles: selected accessibility rows must override explicit child color utilities */
    color: var(--text-selected-row) !important;
  }

  :where(:root)
    .app-selected-row:not([hidden], .sr-only)
    :where(*):not(
      [hidden],
      .sr-only,
      [hidden] *,
      .sr-only *,
      :where(
        .app-selected-row > :is(input, textarea, select, button, [contenteditable="true"]),
        .app-selected-row > * :is(input, textarea, select, button, [contenteditable="true"])
      ),
      :where(
        .app-selected-row > :is(input, textarea, select, button, [contenteditable="true"]) *,
        .app-selected-row > * :is(input, textarea, select, button, [contenteditable="true"]) *
      )
    ) {
    /* biome-ignore lint/complexity/noImportantStyles: selected accessibility rows must override explicit child color utilities */
    color: var(--text-selected-row) !important;
  }

  :root [data-slot="switch"][data-state="unchecked"] {
    /* biome-ignore lint/complexity/noImportantStyles: forced-colors Switch track must override generated state background utilities */
    background-color: CanvasText !important;
  }

  :root [data-slot="switch"][data-state="unchecked"] [data-slot="switch-thumb"] {
    /* biome-ignore lint/complexity/noImportantStyles: forced-colors Switch thumb must override generated state background utilities */
    background-color: Canvas !important;
  }

  :root [data-slot="switch"][data-state="checked"] {
    /* biome-ignore lint/complexity/noImportantStyles: forced-colors Switch track must override generated state background utilities */
    background-color: Highlight !important;
  }

  :root [data-slot="switch"][data-state="checked"] [data-slot="switch-thumb"] {
    /* biome-ignore lint/complexity/noImportantStyles: forced-colors Switch thumb must override generated state background utilities */
    background-color: HighlightText !important;
  }
}

:root[data-high-contrast="true"] [data-slot="switch"][data-state="unchecked"] {
  /* biome-ignore lint/complexity/noImportantStyles: accessibility Switch track must override generated state background utilities */
  background-color: CanvasText !important;
}

:root[data-high-contrast="true"]
  [data-slot="switch"][data-state="unchecked"]
  [data-slot="switch-thumb"] {
  /* biome-ignore lint/complexity/noImportantStyles: accessibility Switch thumb must override generated state background utilities */
  background-color: Canvas !important;
}

:root[data-high-contrast="true"] [data-slot="switch"][data-state="checked"] {
  /* biome-ignore lint/complexity/noImportantStyles: accessibility Switch track must override generated state background utilities */
  background-color: Highlight !important;
}

:root[data-high-contrast="true"]
  [data-slot="switch"][data-state="checked"]
  [data-slot="switch-thumb"] {
  /* biome-ignore lint/complexity/noImportantStyles: accessibility Switch thumb must override generated state background utilities */
  background-color: HighlightText !important;
}

:where(
  button,
  [role="button"],
  [role="treeitem"],
  a,
  input,
  textarea,
  select,
  [role="separator"]
):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-shadow);
}

/* Composer textarea: no field frame — global focus ring reads as a heavy “inner border”. */
[data-slot="message-composer"] textarea {
  border: none;
  box-shadow: none;
}

[data-slot="message-composer"] textarea:focus-visible {
  outline: none;
  box-shadow: none;
}

[data-slot="command-input"]:focus-visible {
  outline: none;
  box-shadow: none;
}

.app-topbar {
  -webkit-app-region: drag;
  user-select: none;
  -webkit-user-select: none;
}

.app-topbar__controls {
  -webkit-app-region: no-drag;
}

.app-native-no-drag {
  -webkit-app-region: no-drag;
}

[data-slot="alert-dialog-overlay"],
[data-slot="alert-dialog-content"],
[data-slot="context-menu-content"],
[data-slot="context-menu-sub-content"],
[data-slot="dialog-overlay"],
[data-slot="dialog-content"],
[data-slot="drawer-overlay"],
[data-slot="drawer-content"],
[data-slot="dropdown-menu-content"],
[data-slot="dropdown-menu-sub-content"],
[data-slot="hover-card-content"],
[data-slot="menubar-content"],
[data-slot="menubar-sub-content"],
[data-slot="popover-content"],
[data-slot="select-content"],
[data-slot="sheet-overlay"],
[data-slot="sheet-content"],
[data-slot="tooltip-content"] {
  z-index: var(--desktop-portal-layer);
}

.app-topbar__toolbar-layer {
  z-index: 1;
}

.app-topbar__title {
  z-index: 1;
  line-height: 1;
}

.app-topbar__thread-shell {
  z-index: 1;
}

.app-topbar__thread-anchor {
  min-width: 0;
  width: 100%;
  max-width: min(38rem, 100%);
  padding-left: 1rem;
}

.app-topbar__thread-anchor--collapsed {
  padding-left: 4.5rem;
}

.app-topbar__thread-anchor--win32-collapsed {
  padding-left: 0.5rem;
}

.app-topbar__thread-button {
  min-width: 0;
  max-width: 100%;
  border: 0;
  background: transparent;
  padding: 0.22rem 0.35rem;
  border-radius: 0.7rem;
  color: inherit;
  box-shadow: none;
  outline: 0;
  text-align: left;
  transition:
    background-color 160ms ease,
    color 160ms ease;
}

.app-topbar__thread-button:hover,
.app-topbar__thread-button[data-open="true"] {
  background: var(--surface-topbar-thread-hover);
}

.app-topbar__thread-title {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 620;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text-emphasis);
}

.app-topbar__thread-separator {
  flex: 0 0 auto;
  font-size: 0.7rem;
  font-weight: 560;
  line-height: 1;
}

.app-topbar__thread-subtitle {
  flex: 0 1 auto;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 560;
  line-height: 1;
  font-style: italic;
  color: var(--text-subtle);
}

.app-topbar__thread-popover {
  z-index: 30;
  -webkit-app-region: no-drag;
  pointer-events: auto;
  border: 1px solid var(--border-context);
  border-radius: 14px;
  background: var(--surface-topbar-popover);
  box-shadow: var(--shadow-surface-elevated);
  padding: 0.65rem 0.75rem 0.75rem;
}

.app-topbar__toolbar-button {
  color: var(--text-muted);
  opacity: 0.82;
}

.app-topbar__toolbar-button:hover {
  color: var(--text-primary);
  opacity: 1;
}

.app-topbar__inline-sidebar-toggle {
  z-index: 2;
}

.app-topbar__sidebar-strip {
  z-index: 2;
}

.app-sidebar__collapse-toggle {
  display: none;
}

.app-sidebar-collapse-control {
  display: none;
}

.app-topbar__plain-icon-button {
  background: transparent;
  box-shadow: none;
  border: 0;
  outline: 0;
}

.app-topbar__sidebar-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--surface-sidebar-pane);
  backdrop-filter: blur(var(--sidebar-titlebar-blur));
}

.app-topbar__content-fill {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  background: var(--surface-workspace-pane);
  backdrop-filter: blur(var(--titlebar-blur));
}

.app-shell {
  position: relative;
  background: var(--surface-shell);
}

.app-shell--settings {
  background: var(--surface-shell);
}

.app-shell--chat {
  min-height: 0;
}

.app-chat-main-column {
  position: relative;
  min-height: 0;
  min-width: 0;
}

.app-main-content {
  background: var(--surface-main);
}

.app-skills-view {
  background: var(--surface-workspace-pane);
}

.app-left-sidebar-pane {
  border-right-color: var(--border-glass);
  background: var(--surface-sidebar-pane);
  backdrop-filter: blur(var(--sidebar-blur));
}

.app-right-sidebar-pane {
  background: var(--surface-workspace-pane);
}

.app-context-sidebar__panel {
  border-color: var(--border-context);
  background: var(--surface-context-panel);
  box-shadow: var(--shadow-surface-elevated);
}

.app-context-sidebar__nested-panel {
  border-color: var(--border-context-nested);
  background: var(--surface-context-panel-nested);
}

.settings-shell__back-button {
  border: none;
  background: transparent;
  box-shadow: none;
}

.settings-shell__back-button:hover {
  background: var(--surface-settings-nav-hover);
}

.settings-shell__nav-button {
  min-height: 2.125rem;
}

.settings-shell__nav-button:hover {
  background: var(--surface-settings-nav-hover);
}

.settings-shell__nav-button--active {
  background: var(--surface-settings-nav-active);
  color: var(--text-settings-nav-active);
  box-shadow: none;
}

.settings-shell__main {
  border-left-width: 0;
  background: var(--surface-settings-main);
}

@media (min-width: 720px) {
  .settings-shell__main {
    box-shadow: var(--shadow-settings-pane-divider);
  }
}

:root .app-adaptive-rail-surface[data-presentation="overlay"] {
  position: fixed;
}

:root .settings-shell__nav[data-presentation="overlay"] {
  position: fixed;
  z-index: 1001;
  border-right-width: 1px;
  border-bottom-width: 0;
  background: var(--sidebar-bg);
}

.settings-shell__page-header {
  background: var(--surface-settings-main);
  box-shadow: 0 1px 0 var(--border-subtle);
}

.settings-shell__header-actions,
.settings-shell__header-actions * {
  -webkit-app-region: no-drag;
}

.settings-shell__content {
  min-height: 100%;
}

.settings-section {
  animation: settingsSectionIn 220ms var(--ease-out-strong) both;
}

.settings-page > .settings-section:nth-child(2) {
  animation-delay: 40ms;
}

.settings-page > .settings-section:nth-child(3) {
  animation-delay: 80ms;
}

.settings-page > .settings-section:nth-child(4) {
  animation-delay: 110ms;
}

.settings-page > .settings-section:nth-child(5) {
  animation-delay: 140ms;
}

.settings-page > .settings-section:nth-child(n + 6) {
  animation-delay: 170ms;
}

.settings-row {
  transition:
    background-color 140ms var(--ease-out-strong),
    color 140ms var(--ease-out-strong);
}

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

.settings-shell__main [data-slot="card"] {
  border-color: var(--border-subtle);
  background: var(--surface-card);
  box-shadow: none;
}

@keyframes settingsSectionIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes sidebarRailIn {
  from {
    opacity: 0.68;
    transform: translateX(-10px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/*
 * Global reduced-motion guard. Neutralize common motion utilities and use a
 * broad catch-all so hand-rolled animations / transitions also respect the OS
 * preference without needing a per-selector override for every new effect.
 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms;
    animation-iteration-count: 1;
    transition-duration: 0.01ms;
    scroll-behavior: auto;
  }

  .animate-pulse.animate-pulse,
  .animate-spin.animate-spin,
  .animate-bounce.animate-bounce,
  .animate-ping.animate-ping {
    animation: none;
  }

  .animate-in,
  .animate-out,
  .fade-in,
  .fade-out,
  .zoom-in,
  .zoom-out,
  .slide-in-from-top-2,
  .slide-in-from-bottom-2,
  .slide-in-from-left-2,
  .slide-in-from-right-2 {
    animation: none;
    transition: none;
  }

  body.app-animating-sidebars .app-left-sidebar-pane,
  body.app-animating-sidebars .app-right-sidebar-pane,
  body.app-animating-sidebars .app-topbar__sidebar-fill,
  body.app-animating-sidebars .app-topbar__content-fill,
  body.app-animating-sidebars .app-topbar__thread-shell,
  body.app-animating-sidebars .app-topbar__thread-anchor {
    transition: none;
  }

  .settings-section {
    animation: none;
  }

  .activity-thinking-shimmer {
    animation: none;
    background-image: none;
    -webkit-text-fill-color: var(--text-muted);
    color: var(--text-muted);
  }
}

.activity-thinking-shimmer {
  position: relative;
  display: inline-block;
  overflow: hidden;
  color: var(--text-muted);
  background-image: linear-gradient(
    100deg,
    var(--text-muted) 0%,
    var(--text-muted) 30%,
    var(--text-emphasis) 50%,
    var(--text-muted) 70%,
    var(--text-muted) 100%
  );
  background-position: 160% 50%;
  background-size: 320% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: activityThinkingShimmer 1.25s ease-in-out infinite;
}

@keyframes activityThinkingShimmer {
  from {
    background-position: 160% 50%;
  }

  to {
    background-position: -160% 50%;
  }
}

/* Soft "live" pulse for in-progress activity — gentler than animate-pulse. */
.activity-live-dot {
  animation: activityLiveDot 2s var(--ease-standard) infinite;
}

@keyframes activityLiveDot {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.45;
    transform: scale(0.8);
  }
}

/* Reasoning section disclosure entrance (mount-only, no Radix height var). */
.reasoning-section-in {
  animation: chatRowIn 150ms var(--ease-out-strong);
}

@keyframes activityTraceExpand {
  from {
    height: 0;
    opacity: 0;
    transform: translateY(-0.25rem);
  }

  to {
    height: var(--radix-collapsible-content-height);
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes activityTraceCollapse {
  from {
    height: var(--radix-collapsible-content-height);
    opacity: 1;
    transform: translateY(0);
  }

  to {
    height: 0;
    opacity: 0;
    transform: translateY(-0.25rem);
  }
}

.activity-trace-content {
  overflow: hidden;
  transform-origin: top;
}

.activity-trace-content[data-state="open"] {
  animation: activityTraceExpand 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.activity-trace-content[data-state="closed"] {
  animation: activityTraceCollapse 160ms cubic-bezier(0.4, 0, 1, 1);
}

@media (prefers-reduced-motion: reduce) {
  .activity-trace-content[data-state] {
    animation: none;
  }
}

/* Mount-only row entrances for the transcript. Never animates deltas — only the
   initial mount of a row (user message, completed assistant row, cards). */
.chat-feed-content > * {
  animation: chatRowIn 180ms var(--ease-out-strong);
}

@keyframes chatRowIn {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-jump-in {
  animation: chatJumpIn 160ms var(--ease-out-strong);
}

@keyframes chatJumpIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .chat-feed-content > *,
  .chat-jump-in {
    animation: none;
  }

  .activity-live-dot {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .reasoning-section-in {
    animation: none;
  }
}

.sidebar-rail-enter {
  animation: sidebarRailIn 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.sidebar-lift {
  transition:
    background-color 180ms ease,
    color 180ms ease,
    opacity 180ms ease,
    border-color 180ms ease;
}

.sidebar-chevron {
  transition:
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    color 180ms ease;
}

.sidebar-symbol-slot {
  position: relative;
}

.sidebar-symbol-default,
.sidebar-symbol-hover {
  transition:
    opacity 180ms ease,
    transform 220ms cubic-bezier(0.22, 1, 0.36, 1),
    color 180ms ease;
}

.sidebar-symbol-default {
  opacity: 1;
  transform: scale(1);
}

.sidebar-symbol-hover {
  opacity: 0;
  transform: scale(0.88);
}

.sidebar-symbol-slot:hover .sidebar-symbol-default,
.sidebar-symbol-slot:focus-visible .sidebar-symbol-default,
.sidebar-symbol-slot[aria-expanded="true"]:hover .sidebar-symbol-default,
.sidebar-symbol-slot[aria-expanded="true"]:focus-visible .sidebar-symbol-default {
  opacity: 0;
  transform: scale(0.88);
}

.sidebar-symbol-slot:hover .sidebar-symbol-hover,
.sidebar-symbol-slot:focus-visible .sidebar-symbol-hover,
.sidebar-symbol-slot[aria-expanded="true"]:hover .sidebar-symbol-hover,
.sidebar-symbol-slot[aria-expanded="true"]:focus-visible .sidebar-symbol-hover {
  opacity: 1;
  transform: scale(1);
}

.sidebar-workspace-card {
  border: 1px solid transparent;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.sidebar-workspace-card--reorderable {
  cursor: grab;
  touch-action: none;
}

.sidebar-workspace-card--reorderable:active {
  cursor: grabbing;
}

.sidebar-thread-item {
  transition:
    opacity 220ms ease,
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease;
}

.sidebar-thread-region {
  display: grid;
  overflow: hidden;
  grid-template-rows: 0fr;
  margin-top: 0;
  opacity: 0;
  pointer-events: none;
  transition:
    grid-template-rows 240ms cubic-bezier(0.22, 1, 0.36, 1),
    opacity 240ms cubic-bezier(0.22, 1, 0.36, 1),
    margin-top 240ms cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-thread-region[data-state="open"] {
  grid-template-rows: 1fr;
  margin-top: 0.375rem;
  opacity: 1;
  pointer-events: auto;
}

body.app-resizing-sidebars {
  cursor: col-resize;
  user-select: none;
}

body.app-resizing-message-bar {
  cursor: row-resize;
  user-select: none;
}

body.app-resizing-sidebars .app-left-sidebar-pane,
body.app-resizing-sidebars .app-right-sidebar-pane {
  transition: none;
}

body.app-resizing-sidebars .app-left-sidebar-pane {
  backdrop-filter: none;
}

body.app-resizing-sidebars .app-topbar__sidebar-fill,
body.app-resizing-sidebars .app-topbar__content-fill,
body.app-resizing-sidebars .app-topbar__thread-shell,
body.app-resizing-sidebars .app-topbar__thread-anchor {
  transition: none;
}

body.app-resizing-sidebars .app-topbar__sidebar-fill {
  backdrop-filter: none;
}

body.app-animating-sidebars .app-left-sidebar-pane,
body.app-animating-sidebars .app-right-sidebar-pane,
body.app-animating-sidebars .app-topbar__sidebar-fill,
body.app-animating-sidebars .app-topbar__content-fill,
body.app-animating-sidebars .app-topbar__thread-shell,
body.app-animating-sidebars .app-topbar__thread-anchor {
  transition:
    width 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    left 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    right 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    padding-left 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-right-width 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    border-left-width 240ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

body.app-animating-sidebars .app-left-sidebar-pane,
body.app-animating-sidebars .app-topbar__sidebar-fill,
body.app-animating-sidebars .app-topbar__content-fill {
  backdrop-filter: none;
}

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

  .sidebar-lift,
  .sidebar-chevron,
  .sidebar-symbol-default,
  .sidebar-symbol-hover,
  .sidebar-workspace-card,
  .sidebar-thread-item,
  .sidebar-thread-region {
    transition: none;
  }
}

/* Indeterminate progress bar: slide a third-width slug across the track. */
@keyframes app-progress-indeterminate {
  0% {
    left: -33%;
  }
  100% {
    left: 100%;
  }
}

.app-progress-indeterminate {
  animation: app-progress-indeterminate 1100ms cubic-bezier(0.4, 0, 0.2, 1) infinite;
  border-radius: inherit;
}

@media (prefers-reduced-motion: reduce) {
  /* Static half-filled bar instead of a moving slug for users who opt out of motion. */
  .app-progress-indeterminate {
    animation: none;
    left: 0;
    width: 50%;
  }
}

.sidebar-chats-scroll-container {
  max-height: 396px; /* Capped to exactly 10 items (10 * 36px + 9 * 4px gap) */
  overflow-y: auto;
  min-height: 0;
}
