/* Turn badges for skills (shown in chat turns) */
.turn-badge-skill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.3;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--outline);
}

.turn-badge-react { background: #61dafb22; color: #61dafb; border-color: #61dafb44; }
.turn-badge-python { background: #3776ab22; color: #3776ab; border-color: #3776ab44; }
.turn-badge-css { background: #1572b622; color: #1572b6; border-color: #1572b644; }
.turn-badge-debug { background: #d9302522; color: #d93025; border-color: #d9302544; }
.turn-badge-db { background: #33679122; color: #336791; border-color: #33679144; }
.turn-badge-api { background: #7b1fa222; color: #7b1fa2; border-color: #7b1fa244; }
.turn-badge-motion { background: #e6510022; color: #e65100; border-color: #e6510044; }

[data-theme="dark"] .turn-badge-react { background: #61dafb22; color: #8ad4f0; border-color: #61dafb44; }
[data-theme="dark"] .turn-badge-python { background: #3776ab22; color: #6ba3d6; border-color: #3776ab44; }
[data-theme="dark"] .turn-badge-debug { background: #d9302522; color: #f48771; border-color: #d9302544; }
[data-theme="dark"] .turn-badge-db { background: #33679122; color: #5c9bd6; border-color: #33679144; }
[data-theme="dark"] .turn-badge-api { background: #7b1fa222; color: #b47cc7; border-color: #7b1fa244; }
[data-theme="dark"] .turn-badge-motion { background: #e6510022; color: #ff8a50; border-color: #e6510044; }
[data-theme="dark"] .turn-badge-css { background: #1572b622; color: #5ba3d9; border-color: #1572b644; }


/* â”€â”€ Independent activity-feed scroll container â”€â”€
   Prevents agent traces from being pushed around during streaming.
   The wrapper has its own scrollbar and a fixed max-height so it
   does NOT grow/unbounded when new trace cards are added.          */

.activity-feed-wrapper {
  overflow-y: visible !important;
  max-height: none !important;
  min-height: 0;
  margin-top: 4px;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 8px;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.activity-feed-wrapper:has(+ .turn-body.agent-response) {
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border-subtle);
  margin-bottom: 4px;
}

.activity-feed-wrapper::-webkit-scrollbar {
  display: none !important;
}

.activity-feed-wrapper:empty {
  display: none;
}

/* When inside a streaming turn, give it slightly less height so the
   streaming cursor area gets more room. */
.chat-turn.is-streaming .activity-feed-wrapper {
  max-height: none !important;
}

.activity-feed-wrapper .activity-feed {
  overflow: visible;
  max-height: none;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.activity-feed-wrapper .activity-feed:not(:empty)::before {
  display: none;
}

[data-theme="dark"] .activity-feed-wrapper {
  border-top-color: var(--outline);
  border-bottom-color: var(--outline);
}

/* â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
   Independent scrollable panels in the agent feed
   Each assistant turn has two scroll containers:
   1. .turn-body.agent-response â€” the streaming text response
   2. .activity-feed-wrapper â€” the agent traces (tool calls, file changes)
   Both have their own max-height and scrollbar so they don't push each other.
   â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â• */

/* Each assistant turn's content area flows naturally */
.chat-turn.assistant .turn-content {
  display: flex;
  flex-direction: column;
  min-height: 0;
  max-height: none;
  overflow: visible;
}

/* The main response text expands naturally without inner scrollbars. */
.chat-turn.assistant .turn-body.agent-response {
  overflow: visible;
  max-height: none;
  min-height: 0;
  flex-shrink: 1;
}

/* No max-height limit during streaming either. */
.chat-turn.is-streaming .turn-body.agent-response.streaming {
  max-height: none;
}


.activity-feed-wrapper {
  overflow-y: visible !important;
  max-height: none !important;
  min-height: 0;
  margin-top: 4px;
  border-top: 1px dashed var(--border-subtle);
  padding-top: 8px;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
}

.activity-feed-wrapper:has(+ .turn-body.agent-response) {
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border-subtle);
  margin-bottom: 4px;
}

.activity-feed-wrapper::-webkit-scrollbar {
  display: none !important;
}

.activity-feed-wrapper:empty {
  display: none;
}

/* When inside a streaming turn, give it slightly less height so the
   streaming cursor area gets more room. */
.chat-turn.is-streaming .activity-feed-wrapper {
  max-height: none !important;
}

.activity-feed-wrapper .activity-feed {
  overflow: visible;
  max-height: none;
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.activity-feed-wrapper .activity-feed:not(:empty)::before {
  display: none;
}

[data-theme="dark"] .activity-feed-wrapper {
  border-top-color: var(--outline);
  border-bottom-color: var(--outline);
}

/* â”€â”€ Response text scrollbar styling â”€â”€ */
.chat-turn.assistant .turn-body.agent-response::-webkit-scrollbar {
  width: 6px;
}

.chat-turn.assistant .turn-body.agent-response::-webkit-scrollbar-thumb {
  background: var(--outline);
  border-radius: 3px;
}

.chat-turn.assistant .turn-body.agent-response::-webkit-scrollbar-track {
  background: transparent;
}

/* â”€â”€ Skills panel removal: removed Skills nav button and sidepanel â”€â”€ */
/* Skills inline badges in the turn header remain (they show during streaming) */

/* Global Loading Overlay â”€â”€ */
.global-loading {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

[data-theme="dark"] .global-loading {
  background: rgba(32, 33, 36, 0.85);
}

.global-loading.hidden {
  display: none;
}

.global-loading-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background: transparent;
  padding: 32px 48px;
  border-radius: 0;
  box-shadow: none;
  border: none;
}

.global-loading-content p {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}


/* Orchestrator Icon inline */
img[alt="orchestrator"] {
  height: 1.2em;
  width: 1.2em;
  vertical-align: middle;
  margin-right: 8px;
  position: relative;
  top: -2px;
}

[data-theme="dark"] img[alt="orchestrator"] {
  filter: invert(1);
}

/* AI Avatar in chat */
.ai-gif-avatar {
  mix-blend-mode: multiply;
}

[data-theme="dark"] .ai-gif-avatar {
  mix-blend-mode: screen;
  filter: invert(1);
}

/* Session loading spinner */
.session-loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 60px;
  margin: 20px 0;
}

/* â”€â”€ Responsive / Mobile Styles â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€â”€ */

@media (max-width: 768px) {
  .shell {
    grid-template-rows: 56px 1fr;
  }

  .top-app-bar {
    padding: 0 10px;
    gap: 6px;
  }

  .brand-cluster {
    gap: 6px;
  }

  .brand {
    gap: 6px;
  }

  .brand h1 {
    font-size: 15px;
  }

  .brand-mark-img {
    width: 21px;
    height: 24px;
  }

  .top-app-bar-actions {
    gap: 2px;
  }
}
