/* â”€â”€ Agent panel (chat) â”€â”€ */

.agent-panel {
  position: relative;
  z-index: 4;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: visible;
  background: var(--editor-bg);
  border-left: 1px solid #e0e0e0;
  transition: width 0.2s ease, min-width 0.2s ease;
}

.agent-body {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  flex: 1;
}

.agent-chat-stack {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  min-height: 0;
  width: 100%;
}

.agent-header {
  flex-shrink: 0;
}

.workspace.agent-collapsed {
  grid-template-columns: 280px minmax(0, 1fr) 52px;
}

.agent-panel.collapsed .agent-body {
  display: none;
}

.agent-panel.collapsed .agent-toggle {
  display: none;
}

.agent-panel.collapsed .agent-collapsed-tab {
  display: flex !important;
}

.agent-toggle {
  position: absolute;
  left: -12px;
  top: 50%;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 48px;
  padding: 0;
  color: var(--muted);
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 0 8px rgba(60, 64, 67, 0.08);
  transform: translateY(-50%);
  pointer-events: auto;
}

.agent-toggle:hover {
  color: #174ea6;
  background: #f8f9fa;
}

.agent-panel.collapsed .agent-toggle .codicon {
  transform: rotate(180deg);
}

.agent-collapsed-tab {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
}

.agent-expand-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 4px;
  color: #174ea6;
  background: transparent;
  border: 0;
  border-radius: 8px;
}

.agent-expand-btn:hover {
  background: #e8f0fe;
}

.agent-expand-btn .codicon {
  font-size: 20px !important;
}

.collapsed-label {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font: 600 11px/1 var(--font-display);
  letter-spacing: 0.04em;
}

.agent-header {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  overflow: hidden;
  padding: 0;
  background: #f6f8fa;
  border-bottom: 1px solid #e8eaed;
}

.session-bar {
  display: flex;
  align-items: stretch;
  min-width: 0;
  width: 100%;
}

.session-bar-scroll {
  position: relative;
  flex: 1;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.session-bar-scroll::-webkit-scrollbar {
  display: none;
}

.session-bar-track {
  display: flex;
  align-items: stretch;
  width: max-content;
  min-height: 36px;
}

.session-tab,
.session-tab-new {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  max-width: 200px;
  height: 36px;
  margin: 0;
  padding: 0;
  color: var(--muted);
  background: #f6f8fa;
  border: 0;
  border-right: 1px solid #e8eaed;
  border-radius: 0;
  font: 500 12px/1 var(--font-display);
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}

.session-tab-new {
  gap: 4px;
  padding: 0 12px;
  color: var(--text);
}

.session-tab-new .codicon {
  font-size: 14px;
  color: var(--muted);
}

.session-tab-new:hover {
  background: #eef0f2;
}

.session-tab:hover {
  background: #eef0f2;
  color: var(--text);
}

.session-tab.active {
  color: var(--text);
  background: #fff;
  box-shadow: inset 0 -1px 0 #1f1f1f;
  font-weight: 600;
}

.session-tab-main {
  display: flex;
  align-items: center;
  min-width: 0;
  height: 100%;
  padding: 0 4px 0 12px;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  cursor: pointer;
}

.session-tab-label {
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 100%;
  flex-shrink: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  opacity: 0.55;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
}

.session-tab-close:hover {
  opacity: 1;
  color: var(--text);
  background: rgba(0, 0, 0, 0.06);
}

.session-tab.active .session-tab-close {
  opacity: 0.75;
}

.session-tab-close .codicon {
  font-size: 14px !important;
}

/* Legacy sticky add button — prefer in-track .session-tab-new */
.session-tab-add {
  display: none !important;
}








.agent-status {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.agent-status.busy {
  color: #174ea6;
  font-weight: 500;
}

.agent-header-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: #f1f3f4;
  border: 0;
  border-radius: 8px;
}

.agent-header-btn:hover {
  color: var(--text);
  background: #e8eaed;
}

.agent-feed {
  flex: 1;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px 16px 12px;
  scroll-behavior: smooth;
  background: var(--composer-bg);
}

.agent-welcome {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 4px 2px 8px;
}

.agent-welcome.hidden {
  display: none;
}

.welcome-hero {
  padding: 2px 2px 4px;
}

.welcome-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.welcome-brand-icon {
  display: block;
  width: 28px;
  height: 28px;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}


.sidebar-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}



.preview-external-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: var(--toolbar-control-h, 32px);
  height: var(--toolbar-control-h, 32px);
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--outline);
  border-radius: 8px;
  box-sizing: border-box;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}

.preview-external-btn:hover {
  color: var(--accent-text);
  background: var(--blue-container);
  border-color: #c6dafc;
}

.preview-external-btn .material-icon {
  font-size: 16px !important;
}

