.session-view {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  background: var(--app-page-bg);
}

.session-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--app-page-bg);
}

.chat-pane {
  grid-row-start: chat;
  grid-column-start: chat;
  grid-row-end: chat;
  grid-column-end: chat;
  flex: 1 1 auto;
  min-width: 0px;
  min-height: 0px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  margin: 24px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 14px;
  background: var(--panel-bg);
  color: var(--text);
}

.chat-pane-header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.06);
  background: rgba(var(--overlay-rgb), 0.03);
}

.chat-pane-header-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-pane-header-avatar {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  object-fit: cover;
  object-position: center;
  box-shadow: 0 0 0 1px rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.04);
}

.chat-pane-header-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.chat-pane-header-title {
  margin: 0;
  color: rgba(var(--overlay-rgb), 0.92);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.chat-pane-header-subtitle {
  margin: 0;
  color: rgba(var(--overlay-rgb), 0.46);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.2;
}

.chat-pane-header-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.09);
  color: rgba(var(--overlay-rgb), 0.94);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.chat-pane-header-plan-badge {
  gap: 8px;
  padding-left: 10px;
  padding-right: 12px;
}

.chat-pane-header-plan-button {
  cursor: pointer;
}

.chat-pane-header-turn-badge {
  gap: 6px;
  padding-left: 10px;
  padding-right: 10px;
}

.chat-pane-header-context-badge {
  position: relative;
  gap: 6px;
  padding-left: 10px;
  padding-right: 10px;
  border-color: var(--context-badge-border);
  background: var(--context-badge-bg);
  color: var(--context-badge-color);
}

.chat-pane-header-context-badge:hover .chat-pane-header-context-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.chat-pane-header-context-badge .chat-pane-header-context-tooltip {
  right: 0;
  top: calc(100% + 10px);
  bottom: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: 292px;
  padding: 12px 14px;
  box-sizing: border-box;
  border-color: var(--context-badge-border);
  background: var(--surface-tab-island);
  border-radius: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
  white-space: normal;
  z-index: 120;
}

.chat-pane-header-context-badge .chat-pane-header-context-tooltip .context-ring-tooltip-row {
  gap: 16px;
  white-space: nowrap;
}

.chat-pane-header-context-badge .chat-pane-header-context-tooltip .context-ring-tooltip-label {
  flex: 0 0 auto;
}

.chat-pane-header-context-badge .chat-pane-header-context-tooltip .context-ring-tooltip-value {
  flex: 0 0 auto;
  margin-left: auto;
  text-align: right;
}

.chat-pane-header-context-menu {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: stretch;
}

.chat-pane-header-context-menu .chat-pane-header-context-badge {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: 0;
  min-width: 0;
}

.chat-pane-header-context-trigger {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 28px;
  padding: 0 9px;
  border: 1px solid var(--context-badge-border);
  border-top-right-radius: 999px;
  border-bottom-right-radius: 999px;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  background: var(--context-badge-bg);
  color: var(--context-badge-icon);
  font-size: 11px;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.chat-pane-header-context-trigger:hover,
.chat-pane-header-context-trigger.is-active {
  border-color: rgba(171, 147, 208, 0.48);
  background: rgba(124, 95, 168, 0.3);
  color: rgba(248, 244, 255, 0.98);
}

.chat-pane-header-context-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 12;
  min-width: 240px;
  padding: 8px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 16px;
  background: var(--surface-composer-bar);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.chat-pane-header-context-dropdown-item {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: rgba(var(--overlay-rgb), 0.94);
  text-align: left;
}

.chat-pane-header-context-dropdown-item:hover,
.chat-pane-header-context-dropdown-item:focus-visible {
  background: rgba(var(--overlay-rgb), 0.08);
}

.chat-pane-header-context-dropdown-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-pane-header-context-dropdown-item-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.chat-pane-header-context-dropdown-item-label {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}

.chat-pane-header-context-dropdown-item-description {
  color: rgba(var(--overlay-rgb), 0.58);
  font-size: 11px;
  line-height: 1.35;
}

.chat-pane-header-context-icon {
  font-size: 12px;
  color: var(--context-badge-icon);
}

.loading-overlay-spinner.chat-pane-header-plan-spinner {
  --spinner-size: 11px;
  --spinner-thickness: 2px;
  --spinner-track: rgba(var(--overlay-rgb), 0.22);
  --spinner-head: rgba(var(--overlay-rgb), 0.96);
}

.chat-pane-header-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.chat-pane-header-button {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  min-width: 28px;
  padding: 0;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.04);
  color: rgba(var(--overlay-rgb), 0.86);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.chat-pane-header-button:hover {
  border-color: rgba(var(--overlay-rgb), 0.12);
  background: rgba(var(--overlay-rgb), 0.09);
  color: rgba(var(--overlay-rgb), 0.96);
}

.chat-pane-header-button.is-active {
  border-color: rgba(var(--overlay-rgb), 0.14);
  background: rgba(var(--overlay-rgb), 0.12);
  color: rgba(var(--overlay-rgb), 0.98);
}

.chat-pane-body {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

.chat-pane-main {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.agent-runtime-empty-state {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 48px 24px;
}

.agent-runtime-empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  border: 1px solid var(--badge-warning-border);
  background: var(--badge-warning-bg);
  color: var(--badge-warning-color);
  font-size: 32px;
}

.agent-runtime-empty-state-copy {
  width: min(460px, 100%);
  display: grid;
  justify-items: center;
  gap: 8px;
}

.agent-runtime-empty-state-copy h2,
.agent-runtime-empty-state-copy p {
  margin: 0;
}

.agent-runtime-empty-state-copy p {
  max-width: 460px;
}

.agent-runtime-empty-state-action {
  min-width: 116px;
}

.agent-runtime-empty-state-action.is-busy {
  padding-left: 0;
  padding-right: 0;
}

.agent-runtime-empty-state-action-spinner {
  width: 14px;
  height: 14px;
  display: inline-flex;
  border: 2px solid rgba(var(--overlay-rgb), 0.22);
  border-top-color: rgba(var(--overlay-rgb), 0.96);
  border-radius: 999px;
  animation: agent-runtime-empty-state-action-spin 0.8s linear infinite;
}

@keyframes agent-runtime-empty-state-action-spin {
  to {
    transform: rotate(360deg);
  }
}

.chat-pane-sidebar {
  flex: 0 0 auto;
  width: 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateX(24px);
  pointer-events: none;
  border-left: 1px solid transparent;
  transition:
    width 180ms ease,
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease;
}

.chat-pane-body.is-sidebar-open .chat-pane-sidebar {
  width: clamp(280px, 28vw, 360px);
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
  border-left-color: rgba(var(--overlay-rgb), 0.06);
}

.chat-pane-sidebar-shell {
  width: clamp(280px, 28vw, 360px);
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 0;
  background: rgba(var(--overlay-rgb), 0.02);
  overflow: hidden;
}

.chat-pane-sidebar-tabbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 12px 10px;
  padding: 4px;
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.03);
}

.chat-pane-sidebar-tab {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: rgba(var(--overlay-rgb), 0.56);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease;
}

.chat-pane-sidebar-tab:hover {
  border-color: rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.06);
  color: rgba(var(--overlay-rgb), 0.94);
}

.chat-pane-sidebar-tab.is-active {
  border-color: rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.09);
  color: rgba(var(--overlay-rgb), 0.94);
}

.chat-pane-sidebar-content {
  min-height: 0;
  display: grid;
  padding: 6px 12px 12px;
  overflow: auto;
}

.chat-pane-sidebar-content .session-page-coming-soon {
  width: 100%;
  min-height: 100%;
}

.agent-sidebar-plan-panel {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.agent-sidebar-plan-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.agent-sidebar-plan-panel-title {
  margin: 0;
  color: rgba(var(--overlay-rgb), 0.96);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.agent-sidebar-plan-panel-summary {
  margin: 4px 0 0;
  color: rgba(var(--overlay-rgb), 0.5);
  font-size: 11px;
  line-height: 1.4;
}

.agent-sidebar-plan-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agent-sidebar-plan-item {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
  border-radius: 12px;
  background: rgba(var(--overlay-rgb), 0.03);
}

.agent-sidebar-plan-item.is-active {
  border-color: rgba(124, 92, 255, 0.32);
  background: rgba(124, 92, 255, 0.08);
}

.agent-sidebar-plan-item.is-complete {
  border-color: rgba(var(--overlay-rgb), 0.04);
  background: rgba(var(--overlay-rgb), 0.02);
}

.agent-sidebar-plan-item.is-warning {
  border-color: rgba(255, 204, 74, 0.26);
  background: rgba(255, 204, 74, 0.07);
}

.agent-sidebar-plan-item.is-failed {
  border-color: rgba(255, 94, 94, 0.24);
  background: rgba(255, 94, 94, 0.08);
}

.agent-sidebar-plan-indicator {
  --agent-sidebar-plan-glyph-size: 9px;
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  border-radius: 999px;
  color: rgba(var(--overlay-rgb), 0.7);
  background: rgba(var(--overlay-rgb), 0.02);
}

.agent-sidebar-plan-indicator i {
  font-size: var(--agent-sidebar-plan-glyph-size);
}

.agent-sidebar-plan-indicator.is-active {
  border-color: transparent;
  color: rgba(var(--overlay-rgb), 0.96);
  background: transparent;
}

.agent-sidebar-plan-indicator.is-complete {
  border-color: rgba(56, 214, 151, 0.36);
  color: rgba(56, 214, 151, 0.92);
  background: rgba(56, 214, 151, 0.12);
}

.agent-sidebar-plan-indicator.is-warning {
  border-color: rgba(255, 204, 74, 0.4);
  color: rgba(255, 204, 74, 0.96);
  background: rgba(255, 204, 74, 0.12);
}

.agent-sidebar-plan-indicator.is-failed {
  border-color: rgba(255, 94, 94, 0.36);
  color: rgba(255, 94, 94, 0.96);
  background: rgba(255, 94, 94, 0.12);
}

.loading-overlay-spinner.agent-sidebar-plan-spinner {
  --spinner-size: 18px;
  --spinner-thickness: 1.75px;
}

.agent-sidebar-plan-item-copy {
  min-width: 0;
}

.agent-sidebar-plan-item-row {
  min-width: 0;
  display: block;
}

.agent-sidebar-plan-item-text {
  min-width: 0;
  color: rgba(var(--overlay-rgb), 0.92);
  font-size: 13px;
  line-height: 1.45;
}

.agent-sidebar-plan-item.is-complete .agent-sidebar-plan-item-text {
  color: rgba(var(--overlay-rgb), 0.54);
}

.agent-sidebar-plan-item.is-warning .agent-sidebar-plan-item-text {
  color: rgba(255, 240, 199, 0.94);
}

.agent-sidebar-plan-item.is-failed .agent-sidebar-plan-item-text {
  color: rgba(255, 220, 220, 0.94);
}

.agent-sidebar-turns-panel {
  gap: 0;
  margin: 0 -12px -12px;
  padding-top: 12px;
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.06);
}

.agent-sidebar-turns-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.agent-sidebar-turn-item {
  cursor: default;
}

.agent-sidebar-turn-item-button {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.agent-sidebar-turn-item-button:hover .agent-sidebar-turn-heading,
.agent-sidebar-turn-item-button:focus-visible .agent-sidebar-turn-heading {
  color: rgba(var(--overlay-rgb), 0.9);
}

.agent-sidebar-turn-item-button:focus-visible {
  outline: 2px solid rgba(120, 190, 255, 0.7);
  outline-offset: 4px;
  border-radius: 10px;
}

.agent-sidebar-turn-heading {
  display: inline-flex;
  align-items: center;
  color: rgba(var(--overlay-rgb), 0.72);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.agent-sidebar-turn-row {
  align-items: center;
}

.agent-sidebar-turn-metrics {
  justify-content: flex-end;
  margin-left: auto;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-sidebar-turn-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.04);
  font-size: 11px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.agent-sidebar-turn-metric i {
  font-size: 10px;
}

.agent-sidebar-turn-metric-count {
  font-variant-numeric: tabular-nums;
}

.agent-sidebar-turn-metric-label {
  color: rgba(var(--overlay-rgb), 0.62);
  font-weight: 600;
}

.agent-sidebar-turn-metric.is-added {
  border-color: rgba(56, 214, 151, 0.18);
  background: rgba(56, 214, 151, 0.1);
  color: rgba(56, 214, 151, 0.94);
}

.agent-sidebar-turn-metric.is-edited {
  border-color: rgba(255, 198, 92, 0.18);
  background: rgba(255, 198, 92, 0.1);
  color: rgba(255, 198, 92, 0.96);
}

.agent-sidebar-turn-metric.is-deleted {
  border-color: rgba(255, 107, 107, 0.18);
  background: rgba(255, 107, 107, 0.1);
  color: rgba(255, 107, 107, 0.96);
}

.agent-sidebar-turn-metric.is-token {
  border-color: rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.05);
  color: rgba(var(--overlay-rgb), 0.88);
}

.agent-sidebar-turn-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.agent-sidebar-turn-actions-row {
  justify-content: flex-start;
  margin-left: auto;
}

.agent-sidebar-turn-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.03);
  color: rgba(var(--overlay-rgb), 0.78);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

.agent-sidebar-turn-button:hover {
  background: rgba(var(--overlay-rgb), 0.06);
  color: rgba(var(--overlay-rgb), 0.94);
}

.agent-sidebar-turn-button:disabled {
  opacity: 0.42;
}


.conversation-shell {
  flex: 1 1 auto;
  height: 100%;
  min-height: 0px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  margin-left: 15px;
  margin-right: 15px;
}

.transcript-load-more-row {
  display: flex;
  justify-content: center;
  padding: 0 0 12px;
}

.transcript-load-more-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-chat-sidebar);
  color: rgba(var(--overlay-rgb), 0.9);
  font-size: 12px;
  box-shadow: var(--shadow);
}

.transcript-load-more-button:hover {
  background: var(--surface-chat-sidebar-header);
}

.transcript-load-more-button:disabled {
  opacity: 0.6;
  box-shadow: none;
}

.chat-todo-panel {
  position: absolute;
  top: 67px;
  right: 14px;
  z-index: 2;
  width: 326px;
  max-height: 280px;
  padding: 10px 11px;
  overflow: auto;
  background: var(--surface-tooltip);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
  border-radius: 16px;
}

.chat-todo-title {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(var(--overlay-rgb), 0.68);
}

.chat-todo-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-todo-item {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.chat-todo-indicator {
  width: 14px;
  height: 14px;
  border: 1px solid rgba(var(--overlay-rgb), 0.26);
  border-radius: 999px;
  margin-top: 1px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-todo-indicator.is-complete {
  border-color: rgba(52, 214, 122, 0.78);
  background: rgba(52, 214, 122, 0.18);
  color: #7dffb0;
  font-size: 8px;
}

.chat-todo-indicator.is-warning {
  border-color: rgba(255, 204, 74, 0.72);
  background: rgba(255, 204, 74, 0.16);
  color: rgba(255, 220, 120, 0.98);
  font-size: 8px;
}

.chat-todo-indicator.is-failed {
  border-color: rgba(255, 94, 94, 0.72);
  background: rgba(255, 94, 94, 0.16);
  color: rgba(255, 148, 148, 0.98);
  font-size: 8px;
}

.chat-todo-indicator.is-active {
  border-color: transparent;
  background: transparent;
}

.chat-todo-spinner {
  --spinner-size: 12px;
  --spinner-thickness: 2px;
}

.chat-todo-text {
  min-width: 0;
  color: rgba(var(--overlay-rgb), 0.9);
  font-size: 12px;
  line-height: 1.45;
}

.chat-todo-item.is-complete .chat-todo-text {
  color: rgba(var(--overlay-rgb), 0.58);
}

.chat-todo-item.is-warning .chat-todo-text {
  color: rgba(255, 240, 199, 0.94);
}

.chat-todo-item.is-failed .chat-todo-text {
  color: rgba(255, 220, 220, 0.94);
}

.conversation-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 14px 48px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--overlay-rgb), 0.18) transparent;
}

.conversation-scroll::-webkit-scrollbar {
  width: 10px;
}

.conversation-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.conversation-scroll::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 3px solid transparent;
  background: rgba(var(--overlay-rgb), 0.18);
  background-clip: padding-box;
}

.conversation-scroll::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--overlay-rgb), 0.28);
  background-clip: padding-box;
}

.empty-conversation {
  display: grid;
  place-items: center;
  min-height: 100%;
  color: var(--muted);
}

.empty-conversation-loading {
  min-height: 260px;
}

.chat-event {
  width: 100%;
  margin: 0 0 14px;
  padding: 0;
  border: 0;
  background: none;
  min-width: 0;
}

.chat-event-user {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.chat-event-assistant {
  max-width: none;
}

.chat-event-working {
  margin-bottom: 10px;
}

.chat-event-thinking {
  margin-bottom: 10px;
}

.chat-event-reasoning {
  margin-bottom: 10px;
}

.chat-event-file_change,
.chat-event-web_search,
.chat-event-turn_summary {
  margin-bottom: 9px;
}

.chat-event-status {
  padding: 0;
  border-radius: 0;
  background: transparent;
}

.chat-event-error {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 97, 97, 0.24);
  background: linear-gradient(180deg, rgba(255, 97, 97, 0.14), rgba(122, 18, 18, 0.1));
  box-shadow: inset 0 1px 0 rgba(255, 214, 214, 0.08);
}

.chat-bubble {
  max-width: 80%;
  padding: 6px 8px;
  background: var(--surface-chat-bubble);
  color: rgba(var(--overlay-rgb), 0.94);
  white-space: pre-wrap;
  line-height: 1.4;
  font-size: 14px;
  border-radius: 8px;
}

.chat-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  max-width: 80%;
  justify-content: flex-end;
}

.chat-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 9px;
  font-size: 11px;
  color: rgba(var(--overlay-rgb), 0.92);
  background: rgba(var(--overlay-rgb), 0.05);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
}

.chat-attachment-chip.is-image {
  gap: 8px;
  padding-left: 6px;
}

.chat-attachment-preview-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-attachment-preview-trigger {
  display: inline-flex;
  align-items: center;
  gap: inherit;
  min-width: 0;
  padding: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
}

.chat-attachment-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-attachment-thumbnail {
  width: 44px;
  height: 32px;
  object-fit: cover;
  border-radius: 6px;
}

.chat-event-label {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-soft);
}

.chat-event-text {
  white-space: pre-wrap;
  line-height: 1.58;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.chat-event-assistant .chat-event-text,
.chat-event-status .chat-event-text {
  white-space: normal;
  font-size: 14px;
}

.chat-error-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--error-header-color);
}

.chat-error-header-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 99, 99, 0.16);
  color: var(--error-header-icon-color);
}

.chat-error-header-text {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.chat-event-error .chat-event-text,
.chat-event-error .chat-event-markdown,
.chat-event-error .chat-event-markdown h1,
.chat-event-error .chat-event-markdown h2,
.chat-event-error .chat-event-markdown h3,
.chat-event-error .chat-event-markdown h4,
.chat-event-error .chat-event-markdown h5,
.chat-event-error .chat-event-markdown h6 {
  color: var(--error-text-color);
}

.chat-event-error .chat-event-markdown a {
  color: var(--error-link-color);
  text-decoration-color: rgba(255, 196, 196, 0.45);
}

.chat-event-error .chat-event-markdown code {
  background: rgba(var(--overlay-rgb), 0.08);
}

.chat-event-reasoning .chat-event-text,
.chat-event-thinking .chat-event-text {
  font-size: 11.75px;
  font-style: italic;
  color: rgba(var(--overlay-rgb), 0.46);
  line-height: 1.5;
}

.chat-event-reasoning .chat-event-text {
  background-image:
    linear-gradient(90deg, rgba(var(--overlay-rgb), 0.34) 0%, rgba(var(--overlay-rgb), 0.34) 100%),
    linear-gradient(90deg, rgba(var(--overlay-rgb), 0) 0%, rgba(var(--overlay-rgb), 0.9) 50%, rgba(var(--overlay-rgb), 0) 100%);
  background-size: 100% 100%, 40% 100%;
  background-position: 0 0, -60% 0;
  background-repeat: no-repeat, no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: qodex-thinking-gradient 3.6s linear infinite;
}

.chat-event-tool .chat-event-text {
  margin-bottom: 8px;
  font-size: 12px;
  font-style: italic;
  color: var(--tool-event-color);
  line-height: 1.45;
}

.chat-event-work_log {
  padding: 9px 14px;
  border-radius: 16px;
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
  background: linear-gradient(180deg, rgba(var(--overlay-rgb), 0.022), rgba(var(--overlay-rgb), 0.012));
  box-shadow: inset 0 1px 0 rgba(var(--overlay-rgb), 0.02);
  padding-bottom: 1px;
}

.chat-working-indicator {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.chat-working-indicator-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chat-working-indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.72);
  animation: qodex-working-dot 1.2s ease-in-out infinite;
}

.chat-working-indicator-dot:nth-child(2) {
  animation-delay: 0.16s;
}

.chat-working-indicator-dot:nth-child(3) {
  animation-delay: 0.32s;
}

.chat-working-indicator-text {
  font-size: 12.75px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  color: rgba(var(--overlay-rgb), 0.56);
}

@keyframes qodex-working-dot {
  0%,
  80%,
  100% {
    opacity: 0.28;
    transform: translateY(0) scale(0.86);
  }

  40% {
    opacity: 1;
    transform: translateY(-1px) scale(1);
  }
}

.chat-work-log-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  margin-left: -14px;
  margin-right: -14px;
  padding-left: 14px;
  padding-right: 14px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(var(--overlay-rgb), 0.07);
  min-width: 0;
}

.chat-work-log-header-icon {
  flex: 0 0 auto;
  color: rgba(var(--overlay-rgb), 0.38);
  font-size: 10px;
}

.chat-work-log-header-text {
  min-width: 0;
  color: rgba(var(--overlay-rgb), 0.42);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chat-work-log-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.chat-work-log-entry {
  min-width: 0;
  margin-left: -14px;
  margin-right: -14px;
  padding: 6px 14px;
}

.chat-work-log-entry + .chat-work-log-entry {
  border-top: 1px solid rgba(var(--overlay-rgb), 0.055);
}

.chat-work-log-entry-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.chat-work-log-entry-icon {
  flex: 0 0 auto;
  width: 16px;
  color: rgba(var(--overlay-rgb), 0.7);
  font-size: 12px;
  line-height: 1;
}

.chat-work-log-entry-tool .chat-work-log-entry-icon {
  color: rgba(var(--overlay-rgb), 0.95);
}

.chat-work-log-entry-text {
  min-width: 0;
  overflow: hidden;
  color: rgba(var(--overlay-rgb), 0.46);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-work-log-entry-title,
.chat-work-log-entry-separator,
.chat-work-log-entry-detail {
  color: inherit;
}

.chat-work-log-entry-tool .chat-work-log-entry-title {
  color: rgba(var(--overlay-rgb), 0.94);
}

.chat-event-markdown > :first-child {
  margin-top: 0;
}

.chat-event-markdown > :last-child {
  margin-bottom: 0;
}

.chat-event-markdown,
.chat-event-markdown p,
.chat-event-markdown li,
.chat-event-markdown blockquote {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-event-markdown p,
.chat-event-markdown ul,
.chat-event-markdown ol,
.chat-event-markdown blockquote {
  margin: 0 0 10px;
}

.chat-event-markdown h1,
.chat-event-markdown h2,
.chat-event-markdown h3,
.chat-event-markdown h4,
.chat-event-markdown h5,
.chat-event-markdown h6 {
  margin: 0 0 10px;
  color: rgba(var(--overlay-rgb), 0.95);
  line-height: 1.35;
}

.chat-event-markdown h1 {
  font-size: 20px;
}

.chat-event-markdown h2 {
  font-size: 17px;
}

.chat-event-markdown h3 {
  font-size: 15px;
}

.chat-event-markdown hr {
  margin: 12px 0;
  border: 0;
  border-top: 1px solid rgba(var(--overlay-rgb), 0.08);
}

.chat-event-markdown ul,
.chat-event-markdown ol {
  padding-left: 20px;
}

.chat-event-markdown li + li {
  margin-top: 4px;
}

.chat-event-markdown code {
  padding: 1px 5px;
  background: rgba(var(--overlay-rgb), 0.07);
  font-size: 12.5px;
}

.chat-event-markdown pre {
  margin: 0;
  padding: 0;
  overflow: visible;
  background: transparent;
}

.chat-event-markdown pre code {
  padding: 0;
  background: transparent;
}

.chat-event-markdown a {
  color: #8fb6ff;
  overflow-wrap: anywhere;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: rgba(143, 182, 255, 0.48);
}

.chat-event-markdown table {
  width: 100%;
  margin: 0 0 10px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.chat-event-markdown th,
.chat-event-markdown td {
  padding: 8px 10px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  text-align: left;
  vertical-align: top;
}

.chat-event-markdown th {
  color: rgba(var(--overlay-rgb), 0.9);
  background: rgba(var(--overlay-rgb), 0.04);
}

.chat-inline-row,
.chat-turn-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
  line-height: 1.45;
}

.chat-inline-row {
  color: rgba(var(--overlay-rgb), 0.72);
}

.chat-inline-prefix {
  flex: 0 0 auto;
}

.chat-inline-link {
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  color: #8fb6ff;
  font: inherit;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(143, 182, 255, 0.48);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-inline-link:hover {
  color: #b3d0ff;
}

.chat-inline-link-inline {
  color: inherit;
  text-decoration-color: rgba(255, 118, 175, 0.5);
}

.chat-inline-link-inline:hover {
  color: rgba(255, 168, 203, 0.96);
}

.chat-media-previews {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.chat-media-preview-card {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 10rem;
  max-width: 14rem;
  padding: 0.65rem;
  border: 1px solid rgba(var(--overlay-rgb), 0.12);
  border-radius: 0.95rem;
  background: rgba(var(--overlay-rgb), 0.04);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 140ms ease, transform 140ms ease, background 140ms ease;
}

.chat-media-preview-card:hover {
  border-color: rgba(var(--overlay-rgb), 0.22);
  background: rgba(var(--overlay-rgb), 0.06);
  transform: translateY(-1px);
}

.chat-media-preview-image,
.chat-media-preview-icon {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 0.7rem;
}

.chat-media-preview-image {
  display: block;
  object-fit: cover;
  background: rgba(var(--overlay-rgb), 0.04);
}

.chat-media-preview-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--overlay-rgb), 0.06);
  color: rgba(var(--overlay-rgb), 0.82);
  font-size: 1.35rem;
}

.chat-media-preview-label {
  display: block;
  width: 100%;
  font-size: 0.84rem;
  line-height: 1.35;
  color: rgba(var(--overlay-rgb), 0.82);
  word-break: break-word;
}

.chat-turn-summary {
  width: 100%;
  gap: 16px;
  color: rgba(var(--overlay-rgb), 0.42);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.chat-turn-summary::before,
.chat-turn-summary::after {
  content: "";
  flex: 1 1 0;
  min-width: 0;
  height: 1px;
  background: rgba(var(--overlay-rgb), 0.09);
}

.chat-turn-summary-text {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 21px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(var(--overlay-rgb), 0.11);
  background: rgba(var(--overlay-rgb), 0.04);
  color: rgba(var(--overlay-rgb), 0.58);
  white-space: nowrap;
  font-size: 9px;
  font-weight: 400;
}

.chat-event-context_compacted .chat-turn-summary {
  color: rgba(244, 214, 92, 0.72);
}

.chat-event-context_compacted .chat-turn-summary::before,
.chat-event-context_compacted .chat-turn-summary::after {
  background: rgba(244, 214, 92, 0.24);
}

.chat-event-context_compacted .chat-turn-summary-text {
  border-color: rgba(244, 214, 92, 0.34);
  background: rgba(138, 112, 25, 0.2);
  color: rgba(255, 243, 191, 0.96);
}

.chat-event-memory_reset .chat-turn-summary {
  color: rgba(255, 142, 142, 0.72);
}

.chat-event-memory_reset .chat-turn-summary::before,
.chat-event-memory_reset .chat-turn-summary::after {
  background: rgba(255, 126, 126, 0.24);
}

.chat-event-memory_reset .chat-turn-summary-text {
  border-color: rgba(255, 126, 126, 0.34);
  background: rgba(143, 39, 39, 0.2);
  color: rgba(255, 222, 222, 0.96);
}

.chat-tool-box {
  margin-top: 10px;
  min-height: 0;
  max-height: 112px;
  background: var(--surface-diff-bg);
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
  overflow: hidden;
  position: relative;
}

.chat-tool-box-body {
  min-height: 0;
  max-height: 112px;
  padding: 4px 7px;
  overflow: auto;
}

.chat-tool-copy {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  background: var(--surface-composer-context);
  color: rgba(var(--overlay-rgb), 0.72);
  font-size: 10px;
}

.chat-tool-copy:hover {
  color: rgba(var(--overlay-rgb), 0.9);
  background: var(--surface-composer-context-hover);
}

.chat-tool-copy.is-copied {
  color: #dfffe8;
  border-color: rgba(54, 214, 126, 0.34);
  background: var(--surface-composer-confirm);
}

.chat-markdown-pre {
  position: relative;
  margin: 12px 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(var(--overlay-rgb), 0.06);
}

.chat-markdown-pre-body {
  max-height: 240px;
  padding: 4px 7px;
  overflow: auto;
}

.conversation-scroll > .blazor-virtualize,
.conversation-scroll > .blazor-virtualize > div {
  width: 100%;
}

.chat-markdown-pre pre {
  margin: 0;
  background: transparent;
  border-radius: 0;
}

.chat-event-command,
.chat-event-output {
  margin: 0;
  white-space: pre;
  font-size: 12.5px;
  color: rgba(var(--overlay-rgb), 0.84);
  background: transparent;
}

.chat-event-output {
  margin-top: 6px;
}

.workspace-dock {
  flex: 0 0 auto;
  padding: 0 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.reply-options-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
  width: 100%;
  max-width: 768px;
}

.reply-option-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 12px;
  background: rgba(var(--overlay-rgb), 0.03);
  color: var(--text);
  font-size: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.reply-option-chip:hover {
  background: rgba(var(--overlay-rgb), 0.08);
  border-color: var(--accent);
}

.reply-option-chip:active {
  background: rgba(var(--overlay-rgb), 0.12);
}

.thinking-label,
.composer-shell {
  width: 100%;
  margin: 0;
}

.thinking-label {
  width: auto;
  max-width: 98%;
  margin-inline: auto;
  margin-bottom: 6px;
  padding-left: 4px;
  display: inline-block;
  align-self: flex-start;
  font-size: 12.75px;
  font-weight: 600;
  color: rgba(var(--overlay-rgb), 0.42);
  letter-spacing: -0.01em;
}

.thinking-label.is-running,
.chat-pane-header-subtitle.is-running {
  background-image:
    linear-gradient(90deg, rgba(var(--overlay-rgb), 0.34) 0%, rgba(var(--overlay-rgb), 0.34) 100%),
    linear-gradient(90deg, rgba(var(--overlay-rgb), 0) 0%, rgba(var(--overlay-rgb), 0.9) 50%, rgba(var(--overlay-rgb), 0) 100%);
  background-size: 100% 100%, 40% 100%;
  background-position: 0 0, -60% 0;
  background-repeat: no-repeat, no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: qodex-thinking-gradient 3.6s linear infinite;
}

@keyframes qodex-thinking-gradient {
  0% {
    background-position: 0 0, -60% 0;
  }

  100% {
    background-position: 0 0, 160% 0;
  }
}

.queue-panel {
  width: 98%;
  max-height: min(120px, 30vh);
  margin-inline: auto;
  margin-bottom: 1px;
  overflow: hidden auto;
  background: var(--surface-editor-gutter);
  border-top-right-radius: 8px;
  border-top-left-radius: 8px;
}

.queue-drop-zone {
  height: 8px;
  margin: 0 10px;
  border-top: 1px dashed rgba(var(--overlay-rgb), 0.1);
}

.queue-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  min-height: 26px;
  padding: 0 10px;
  border-bottom: 1px solid var(--panel-border-soft);
  height: 26px;
}

.queue-item:last-child {
  border-bottom: 0;
}

.queue-item-main,
.queue-item-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.queue-item-main {
  flex: 1 1 auto;
}

.queue-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  min-height: 16px;
  color: rgba(var(--overlay-rgb), 0.34);
  cursor: grab;
}

.queue-drag-handle:active {
  cursor: grabbing;
}

.queue-item-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
}

.queue-item-icon {
  color: var(--muted-soft);
}

.queue-item-icon i,
.queue-action i {
  font-size: 13px;
}

.queue-item-text {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  line-height: 1.4;
  font-size: 12.5px;
}

.queue-attachment-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(var(--overlay-rgb), 0.06);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  color: var(--muted-soft);
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

.queue-attachment-badge i {
  font-size: 10px;
}

.queue-item-actions {
  flex: 0 0 auto;
}

.queue-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: var(--muted-soft);
}

.queue-action:hover {
  background: rgba(var(--overlay-rgb), 0.05);
  color: var(--text);
}

.composer-shell {
  display: grid;
  gap: 8px;
}

.todo-dock {
  padding-top: 14px;
}

.scroll-bottom-row {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  display: flex;
  justify-content: center;
  padding: 0 14px;
  pointer-events: none;
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity 140ms ease,
    transform 140ms ease;
}

.scroll-bottom-row.is-hidden {
  opacity: 0;
  transform: translateY(6px);
}

.scroll-bottom-button {
  position: static;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: var(--surface-chat-sidebar);
  color: rgba(var(--overlay-rgb), 0.9);
  box-shadow: var(--shadow);
  z-index: 2;
  pointer-events: auto;
}

.scroll-bottom-button:hover {
  background: var(--surface-chat-sidebar-header);
}

.scroll-bottom-row.is-hidden .scroll-bottom-button {
  pointer-events: none;
}

.composer-form {
  margin: 0;
}

.composer-alert {
  margin: 0 0 8px;
}

.composer {
  position: relative;
  background: var(--surface-queue-editor);
  border: 1px solid transparent;
  box-shadow: 0 24px 80px var(--composer-shadow);
  border-radius: 8px;
  margin-bottom: 7px;
}

.composer-minimal {
  background:
    var(--surface-queue-panel-gradient),
    var(--surface-queue-panel);
  border-color: rgba(var(--overlay-rgb), 0.08);
}

.composer-context {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
}

.composer-input {
  display: block;
  width: 100%;
  min-height: 70px;
  max-height: 50vh;
  padding: 12px 46px 6px 12px;
  background: transparent;
  color: var(--text);
  line-height: 1.45;
  font-size: 12.75px;
}

.composer-input::placeholder {
  color: var(--muted-soft);
}

.composer-input-minimal {
  min-height: 88px;
  padding-right: 12px;
  padding-bottom: 12px;
}

.composer-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  padding: 0 8px 8px;
}

.composer-footer-minimal {
  justify-content: flex-end;
}

.composer-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.composer-attachment-input {
  position: fixed;
  left: -10000px;
  top: -10000px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.composer-attachment-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  color: rgba(var(--overlay-rgb), 0.82);
  background: transparent;
  border: 1px solid transparent;
  flex: 0 0 auto;
  cursor: pointer;
}

.composer-attachment-button:hover {
  background: rgba(var(--overlay-rgb), 0.06);
}

.composer-attachment-button.is-busy {
  cursor: default;
  background: transparent;
}

.loading-overlay-spinner.composer-attachment-spinner {
  --spinner-size: 12px;
  --spinner-thickness: 2px;
  --spinner-track: rgba(var(--overlay-rgb), 0.18);
  --spinner-head: rgba(var(--overlay-rgb), 0.95);
}

.composer-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 8px 8px;
}

.composer-attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  background: rgba(var(--overlay-rgb), 0.12);
  font-size: 11.5px;
  color: rgba(var(--overlay-rgb), 0.92);
  border-radius: 15px;
}

.composer-attachment-chip.is-image {
  padding-left: 6px;
}

.composer-attachment-preview-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.composer-attachment-preview-trigger {
  flex: 1;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  cursor: pointer;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  text-align: left;
}

.composer-attachment-thumbnail {
  width: 24px;
  height: 24px;
  object-fit: cover;
  border-radius: 6px;
}

.composer-attachment-name {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composer-attachment-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  color: rgba(var(--overlay-rgb), 0.74);
  background: transparent;
  border: 0;
}

.composer-attachment-remove:hover {
  color: rgba(var(--overlay-rgb), 0.96);
}

.composer-pill-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 26px;
  padding: 0 7px;
  background: rgba(var(--overlay-rgb), 0.03);
  color: var(--muted);
  font-size: 11px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
}

.composer-pill-select select {
  min-width: 110px;
  background: transparent;
  color: var(--text);
  appearance: none;
  padding-right: 2px;
}

.composer-pill-select i {
  font-size: 10px;
  color: var(--muted-soft);
  pointer-events: none;
}

.composer-pill-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--panel-border);
  background: rgba(var(--overlay-rgb), 0.03);
  color: var(--muted);
  font-size: 11px;
}

.composer-pill-toggle input {
  width: 14px;
  height: 14px;
  accent-color: #4f8cff;
}

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

.composer-action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 25px;
  height: 25px;
  border: 1px solid var(--panel-border);
  background: rgba(var(--overlay-rgb), 0.04);
  color: rgba(var(--overlay-rgb), 0.9);
}

.composer-action-button:hover {
  background: rgba(var(--overlay-rgb), 0.08);
  color: rgba(var(--overlay-rgb), 0.98);
}

.composer-action-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.composer-side-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid var(--panel-border);
  background: rgba(var(--overlay-rgb), 0.04);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.composer-side-action:hover {
  color: var(--text);
  background: rgba(var(--overlay-rgb), 0.07);
}

.send-button {
display: inline-flex;
align-items: center;
justify-content: center;
width: 25px;
height: 25px;
border: 0;
border-radius: 999px;
position: relative;
}

.send-button.is-send,
.send-button.is-running {
background: var(--header-gray);
color: var(--text-on-accent);
}

.send-button.is-send:hover,
.send-button.is-running:hover {
background: rgb(24, 68, 190);
}

.send-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.send-button.is-send:disabled:hover,
.send-button.is-running:disabled:hover {
  background: var(--header-gray);
}

.send-button-interrupt {
  background: rgb(220, 38, 38);
  color: var(--text-on-accent);
}

.send-button-interrupt:hover {
  background: rgb(185, 28, 28);
}

.send-button-interrupt::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from 0deg,
    rgba(248, 113, 113, 0.14) 0deg 110deg,
    rgba(254, 202, 202, 0.98) 110deg 180deg,
    rgba(248, 113, 113, 0.14) 180deg 360deg
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: qodex-spin 600ms linear infinite;
  pointer-events: none;
}

.send-button i {
  font-size: 13px;
}

.send-button-spinner {
  --spinner-size: 12px;
  --spinner-thickness: 2px;
  --spinner-track: rgba(var(--overlay-rgb), 0.24);
  --spinner-head: rgba(var(--overlay-rgb), 0.96);
}

.context-ring {
  --context-progress: 0%;
  position: relative;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-circle);
  display: inline-grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--context-ring-center) 57%, transparent 58%),
    conic-gradient(var(--context-ring-fill) 0 var(--context-progress), rgba(var(--overlay-rgb), 0.12) var(--context-progress) 100%);
}

.context-ring-inner {
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: rgba(var(--overlay-rgb), 0.92);
}

.context-ring-tooltip {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  gap: 4px;
  min-width: max-content;
  padding: 7px 9px;
  background: var(--surface-queue-panel);
  border: 1px solid rgba(var(--overlay-rgb), 0.08);
  border-radius: 10px;
  box-shadow: var(--shadow);
  color: rgba(var(--overlay-rgb), 0.84);
  white-space: nowrap;
  font-size: 11px;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  transform: translateY(3px);
  pointer-events: none;
  z-index: 80;
  transition: opacity 120ms ease, transform 120ms ease;
}

.context-ring:hover .context-ring-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.context-ring-tooltip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.context-ring-tooltip-label {
  color: rgba(var(--overlay-rgb), 0.68);
}

.context-ring-tooltip-value {
  color: rgba(var(--overlay-rgb), 0.92);
  font-variant-numeric: tabular-nums;
}

@keyframes qodex-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.loading-overlay-spinner {
  --spinner-size: 40px;
  --spinner-thickness: 3px;
  --spinner-track: rgba(var(--overlay-rgb), 0.18);
  --spinner-head: rgba(var(--overlay-rgb), 0.95);
  display: block;
  flex: 0 0 auto;
  box-sizing: border-box;
  width: var(--spinner-size);
  height: var(--spinner-size);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: conic-gradient(
    from 0deg,
    var(--spinner-head) 0deg 68deg,
    var(--spinner-track) 68deg 360deg
  );
  -webkit-mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--spinner-thickness)),
    #000 calc(100% - var(--spinner-thickness))
  );
  mask: radial-gradient(
    farthest-side,
    transparent calc(100% - var(--spinner-thickness)),
    #000 calc(100% - var(--spinner-thickness))
  );
  animation: qodex-spin 850ms linear infinite;
}

.loading-overlay-spinner.chat-todo-spinner {
  --spinner-size: 15px;
  --spinner-thickness: 2px;
}

.loading-overlay-spinner.send-button-spinner {
  --spinner-size: 15px;
  --spinner-thickness: 2px;
  --spinner-track: var(--surface-spinner-track);
  --spinner-head: var(--surface-spinner-head);
}

.loading-overlay-spinner.sidecar-draft-spinner {
  --spinner-size: 15px;
  --spinner-thickness: 2px;
  --spinner-track: rgba(var(--overlay-rgb), 0.18);
  --spinner-head: rgba(var(--overlay-rgb), 0.96);
}

.loading-overlay-spinner.repo-tab-spinner {
  --spinner-size: 13px;
  --spinner-thickness: 2px;
}

.repo-tab.is-active .loading-overlay-spinner.repo-tab-spinner {
  --spinner-track: rgba(0, 0, 0, 0.18);
  --spinner-head: rgba(0, 0, 0, 0.92);

  .session-main {
    display: flex;
    flex-direction: column;
  }

}

@media (max-width: 820px) {
  .app-window {
    grid-template-columns: 220px var(--sidebar-resizer-width) minmax(0, 1fr);
  }

  .repo-tabbar {
    overflow-x: auto;
  }

  .conversation-scroll {
    padding-left: 16px;
    padding-right: 16px;
  }

  .workspace-dock {
    padding-left: 12px;
    padding-right: 12px;
  }

  .queue-panel {
    max-height: min(220px, 34vh);
  }

.chat-event-status,
.chat-bubble,
.repo-tab-count,
.chat-event-markdown code,
.chat-tool-box,
.chat-tool-copy,
.chat-markdown-pre,
.chat-attachment-chip,
.queue-action,
.composer-pill-toggle,
.composer-side-action,
.composer-action-button,
.modal-card,
.todo-session-option,
.planning-nav-item,
.planning-pill,
.modal-search input,
.modal-field input,
.modal-field textarea,
.modal-field select,
.import-filter-tab {
  border-radius: var(--radius);
}

/* ── Light-mode transcript overrides ── */

[data-theme="light"] .chat-action-card {
  border-color: rgba(180, 130, 20, 0.3);
  background:
    linear-gradient(180deg, rgba(255, 215, 130, 0.12), rgba(255, 195, 80, 0.06)),
    rgba(255, 250, 235, 0.92);
  box-shadow:
    inset 0 1px 0 rgba(180, 130, 20, 0.06),
    0 10px 30px rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .chat-action-card-icon {
  background: rgba(180, 120, 20, 0.1);
  color: #92600a;
}

[data-theme="light"] .chat-action-card-eyebrow {
  color: rgba(120, 80, 10, 0.78);
}

[data-theme="light"] .chat-action-card-title {
  color: rgba(60, 40, 5, 0.94);
}

[data-theme="light"] .chat-action-card-badge {
  border-color: rgba(180, 130, 20, 0.24);
  background: rgba(180, 130, 20, 0.08);
  color: #7a5310;
}

[data-theme="light"] .chat-action-card-text {
  color: rgba(60, 40, 5, 0.86);
}

[data-theme="light"] .chat-action-inline-button-primary {
  color: #15803d;
}

[data-theme="light"] .chat-action-inline-button-secondary {
  color: #1d4ed8;
}

[data-theme="light"] .chat-action-inline-button-danger {
  color: #b91c1c;
}

[data-theme="light"] .chat-action-inline-button-ghost {
  color: #92600a;
}

[data-theme="light"] .chat-action-resolution-approved {
  color: #15803d;
}

[data-theme="light"] .chat-action-resolution-cancelled {
  color: #b91c1c;
}

[data-theme="light"] .chat-event-error {
  border-color: rgba(200, 50, 50, 0.26);
  background: linear-gradient(180deg, rgba(255, 97, 97, 0.08), rgba(255, 200, 200, 0.1));
  box-shadow: inset 0 1px 0 rgba(200, 50, 50, 0.04);
}

[data-theme="light"] .chat-error-header {
  color: #b91c1c;
}

[data-theme="light"] .chat-error-header-icon {
  background: rgba(200, 50, 50, 0.1);
  color: #b91c1c;
}

[data-theme="light"] .chat-event-error .chat-event-text,
[data-theme="light"] .chat-event-error .chat-event-markdown,
[data-theme="light"] .chat-event-error .chat-event-markdown h1,
[data-theme="light"] .chat-event-error .chat-event-markdown h2,
[data-theme="light"] .chat-event-error .chat-event-markdown h3,
[data-theme="light"] .chat-event-error .chat-event-markdown h4,
[data-theme="light"] .chat-event-error .chat-event-markdown h5,
[data-theme="light"] .chat-event-error .chat-event-markdown h6 {
  color: rgba(120, 20, 20, 0.92);
}

[data-theme="light"] .chat-event-error .chat-event-markdown a {
  color: #b91c1c;
  text-decoration-color: rgba(185, 28, 28, 0.4);
}

[data-theme="light"] .chat-event-tool .chat-event-text {
  color: #a8246b;
}

[data-theme="light"] .chat-markdown-pre {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .chat-tool-copy.is-copied {
  color: #15803d;
  border-color: rgba(22, 140, 60, 0.3);
}

[data-theme="light"] .chat-todo-indicator.is-complete {
  border-color: rgba(22, 128, 61, 0.5);
  background: rgba(22, 128, 61, 0.08);
  color: #15803d;
}

[data-theme="light"] .chat-todo-indicator.is-warning {
  border-color: rgba(146, 96, 10, 0.5);
  background: rgba(180, 130, 20, 0.08);
  color: #92600a;
}

[data-theme="light"] .chat-todo-item.is-warning .chat-todo-text {
  color: #7a5310;
}

[data-theme="light"] .chat-todo-indicator.is-failed {
  border-color: rgba(185, 28, 28, 0.45);
  background: rgba(200, 50, 50, 0.08);
  color: #b91c1c;
}

[data-theme="light"] .chat-todo-item.is-failed .chat-todo-text {
  color: rgba(120, 20, 20, 0.92);
}

[data-theme="light"] .chat-event-context_compacted .chat-turn-summary {
  color: rgba(146, 96, 10, 0.72);
}

[data-theme="light"] .chat-event-context_compacted .chat-turn-summary::before,
[data-theme="light"] .chat-event-context_compacted .chat-turn-summary::after {
  background: rgba(180, 130, 20, 0.2);
}

[data-theme="light"] .chat-event-context_compacted .chat-turn-summary-text {
  border-color: rgba(180, 130, 20, 0.3);
  background: rgba(255, 215, 130, 0.12);
  color: #7a5310;
}

[data-theme="light"] .chat-event-memory_reset .chat-turn-summary {
  color: rgba(185, 28, 28, 0.72);
}

[data-theme="light"] .chat-event-memory_reset .chat-turn-summary::before,
[data-theme="light"] .chat-event-memory_reset .chat-turn-summary::after {
  background: rgba(200, 50, 50, 0.18);
}

[data-theme="light"] .chat-event-memory_reset .chat-turn-summary-text {
  border-color: rgba(200, 50, 50, 0.3);
  background: rgba(255, 97, 97, 0.08);
  color: #b91c1c;
}

[data-theme="light"] .chat-event-markdown a {
  color: #1d4ed8;
  text-decoration-color: rgba(29, 78, 216, 0.4);
}

[data-theme="light"] .chat-inline-link {
  color: #1d4ed8;
  text-decoration-color: rgba(29, 78, 216, 0.4);
}

[data-theme="light"] .chat-inline-link:hover {
  color: #1e40af;
}

[data-theme="light"] .chat-inline-link-inline {
  text-decoration-color: rgba(168, 36, 107, 0.4);
}

[data-theme="light"] .chat-inline-link-inline:hover {
  color: #a8246b;
}

[data-theme="light"] .chat-action-button-primary {
  border-color: rgba(22, 128, 61, 0.36);
  background: rgba(22, 128, 61, 0.08);
  color: #15803d;
}

[data-theme="light"] .chat-action-button-primary:hover,
[data-theme="light"] .chat-action-button-primary:focus-visible {
  border-color: rgba(22, 128, 61, 0.48);
  background: rgba(22, 128, 61, 0.14);
}

[data-theme="light"] .chat-action-button-secondary {
  border-color: rgba(29, 78, 216, 0.3);
  background: rgba(29, 78, 216, 0.06);
  color: #1d4ed8;
}

[data-theme="light"] .chat-action-button-secondary:hover,
[data-theme="light"] .chat-action-button-secondary:focus-visible {
  border-color: rgba(29, 78, 216, 0.42);
  background: rgba(29, 78, 216, 0.12);
}

[data-theme="light"] .chat-action-button-danger {
  border-color: rgba(185, 28, 28, 0.3);
  background: rgba(200, 50, 50, 0.06);
  color: #b91c1c;
}

[data-theme="light"] .chat-action-button-danger:hover,
[data-theme="light"] .chat-action-button-danger:focus-visible {
  border-color: rgba(185, 28, 28, 0.42);
  background: rgba(200, 50, 50, 0.12);
}

[data-theme="light"] .chat-action-form-required {
  color: #b91c1c;
}

[data-theme="light"] .chat-action-form-input,
[data-theme="light"] .chat-action-form-select,
[data-theme="light"] .chat-action-editor-input,
[data-theme="light"] .chat-action-details-code {
  color: rgba(15, 23, 42, 0.92);
}

/* ── Plan sidebar (warning / failed) ─────────────────────────── */
[data-theme="light"] .agent-sidebar-plan-item.is-warning {
  border-color: rgba(234, 179, 8, 0.2);
  background: rgba(254, 249, 195, 0.3);
}

[data-theme="light"] .agent-sidebar-plan-item.is-failed {
  border-color: rgba(239, 68, 68, 0.2);
  background: rgba(254, 226, 226, 0.3);
}

[data-theme="light"] .agent-sidebar-plan-indicator.is-warning {
  border-color: rgba(234, 179, 8, 0.36);
  color: #a16207;
  background: rgba(254, 249, 195, 0.5);
}

[data-theme="light"] .agent-sidebar-plan-indicator.is-failed {
  border-color: rgba(239, 68, 68, 0.32);
  color: #b91c1c;
  background: rgba(254, 226, 226, 0.5);
}

[data-theme="light"] .agent-sidebar-plan-item.is-warning .agent-sidebar-plan-item-text {
  color: #854d0e;
}

[data-theme="light"] .agent-sidebar-plan-item.is-failed .agent-sidebar-plan-item-text {
  color: #991b1b;
}

/* ── Context usage warning/error ─────────────────────────────── */
[data-theme="light"] .context-usage-bar-label.is-warning {
  color: #a16207;
}

[data-theme="light"] .context-usage-bar-label.is-danger {
  color: #b91c1c;
}

/* ── Inline link colors ──────────────────────────────────────── */
[data-theme="light"] .chat-event-tool .chat-event-text a {
  color: #be185d;
}

[data-theme="light"] .form-required-asterisk {
  color: #b91c1c;
}

/* ── Context badge hover / trigger ───────────────────────────── */
[data-theme="light"] .chat-pane-header-context-trigger:hover,
[data-theme="light"] .chat-pane-header-context-trigger.is-active {
  border-color: rgba(124, 58, 237, 0.36);
  background: rgba(139, 92, 246, 0.14);
  color: #5b21b6;
}

/* ── Turn metric badges ──────────────────────────────────────── */
[data-theme="light"] .agent-sidebar-turn-metric.is-added {
  border-color: rgba(22, 128, 61, 0.24);
  background: rgba(22, 128, 61, 0.06);
  color: #15803d;
}

[data-theme="light"] .agent-sidebar-turn-metric.is-edited {
  border-color: rgba(146, 96, 10, 0.24);
  background: rgba(180, 130, 20, 0.06);
  color: #92600a;
}

[data-theme="light"] .agent-sidebar-turn-metric.is-deleted {
  border-color: rgba(185, 28, 28, 0.24);
  background: rgba(200, 50, 50, 0.06);
  color: #b91c1c;
}

/* ── Plan indicator (complete) ───────────────────────────────── */
[data-theme="light"] .agent-sidebar-plan-indicator.is-complete {
  border-color: rgba(22, 128, 61, 0.36);
  color: #15803d;
  background: rgba(22, 128, 61, 0.08);
}

@media (max-width: 760px) {
