/* ANTRI Desktop Control Plane - Spacious Minimalist Cream White Theme */

:root {
  --bg-body: #fcfbf9;
  --bg-sidebar: #f7f4ee;
  --bg-card: #ffffff;
  --bg-subtle: #f4efe6;
  --bg-input: #ffffff;
  --bg-hover: #ebe4d6;
  
  --text-primary: #1c1917;
  --text-secondary: #57534e;
  --text-tertiary: #8c827a;
  --text-inverted: #fcfbf9;

  --accent-primary: #1c1917;
  --accent-subtle: #d6cfc2;
  --accent-active: #0c0a09;
  --accent-success: #15803d;
  --accent-warning: #b45309;

  --border-main: #e6e0d4;
  --border-light: #eee9dd;
  --border-focus: #1c1917;

  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'Fira Code', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body.antri-app {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
.app-header {
  height: 64px;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 10;
}

.brand-zone {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.logo-mark {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--text-primary);
  text-transform: uppercase;
}

.version-tag {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-tertiary);
  background: var(--bg-subtle);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-main);
}

.mode-toggles {
  display: flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-main);
  gap: 4px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.45rem 1rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.mode-btn .indicator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-tertiary);
}

.mode-btn.active {
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
}

.mode-btn.active .indicator-dot {
  background: var(--text-primary);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: var(--bg-card);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-main);
}

.control-group label {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.control-group select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  max-width: 190px;
}

.perms-badge {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-main);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.perms-badge:hover {
  background: var(--bg-hover);
}

/* App Body & Sidebar */
.app-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.app-sidebar {
  width: 250px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-main);
  display: flex;
  flex-direction: column;
  padding: 1.75rem 1.15rem;
  gap: 0.5rem;
}

.nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--text-tertiary);
  padding: 0.25rem 0.75rem 0.65rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--bg-card);
  color: var(--text-primary);
  font-weight: 600;
  border-color: var(--border-main);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.sidebar-footer {
  margin-top: auto;
  padding: 1rem 0.5rem 0.25rem;
  font-size: 0.76rem;
  color: var(--text-tertiary);
  border-top: 1px solid var(--border-light);
}

.sync-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-success);
}

/* Workspace Area */
.workspace-area {
  flex: 1;
  background: var(--bg-body);
  overflow-y: auto;
  position: relative;
}

.tab-panel {
  display: none;
  height: 100%;
  padding: 2.25rem 2.75rem;
  overflow-y: auto;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
}

/* Chat & Agent Studio */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.chat-session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
}

.chat-session-selector-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
}

.new-chat-btn {
  background: var(--accent-primary);
  color: var(--text-inverted);
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.new-chat-btn:hover {
  opacity: 0.9;
}

.chat-session-select {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  max-width: 320px;
  width: 100%;
  outline: none;
}

.chat-session-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.chat-session-action-btn {
  background: transparent;
  border: 1px solid var(--border-main);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-xs);
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.chat-session-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.chat-session-action-btn.btn-danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 8.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.welcome-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 3.5rem 3rem;
  max-width: 820px;
  margin: 2.5rem auto 0;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.welcome-card h2 {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.85rem;
  color: var(--text-primary);
}

.welcome-card p {
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.65;
  margin-bottom: 1.75rem;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.quick-action-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.quick-action-pills button {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  color: var(--text-primary);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quick-action-pills button:hover {
  background: var(--bg-hover);
  border-color: var(--text-tertiary);
}

/* Messages */
.msg-row {
  display: flex;
  flex-direction: column;
  max-width: 880px;
  margin: 0 auto;
  width: 100%;
}

.msg-row.user .msg-content {
  align-self: flex-end;
  background: var(--accent-primary);
  color: var(--text-inverted);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-xs) var(--radius-md);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.msg-row.assistant .msg-content {
  align-self: flex-start;
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md) var(--radius-md) var(--radius-md) var(--radius-xs);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.msg-content {
  padding: 1.2rem 1.5rem;
  font-size: 0.92rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.tool-badge-pill {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  margin-bottom: 0.6rem;
  display: inline-block;
}

/* Chat Input Bar & Attachments */
.chat-input-bar {
  position: absolute;
  bottom: 1.25rem;
  left: 2.75rem;
  right: 2.75rem;
  z-index: 50;
}

.input-container {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.25rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: relative;
}

.input-row {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.attach-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-main);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 1.15rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 2px;
}

.attach-btn:hover {
  background: var(--bg-hover);
  border-color: var(--text-primary);
}

.attachment-preview-tray {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.4rem 0.2rem;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 0.25rem;
}

.attachment-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.attachment-chip img {
  width: 18px;
  height: 18px;
  object-fit: cover;
  border-radius: 2px;
}

.attachment-chip .remove-chip-btn {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.2rem;
}

.attachment-chip .remove-chip-btn:hover {
  color: var(--accent-warning);
}

/* Prompt Toolkit Autocomplete Palette */
.prompt-toolkit-palette {
  position: absolute;
  bottom: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  max-height: 280px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  z-index: 100;
}

.palette-header {
  padding: 0.5rem 0.9rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-main);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-tertiary);
}

.palette-list {
  display: flex;
  flex-direction: column;
}

.palette-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: all 0.1s ease;
}

.palette-item:last-child {
  border-bottom: none;
}

.palette-item.active,
.palette-item:hover {
  background: var(--bg-subtle);
}

.palette-name {
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 140px;
}

.palette-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex: 1;
  margin-left: 1rem;
}

.palette-tag {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.hidden {
  display: none !important;
}

.input-container textarea {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.94rem;
  line-height: 1.55;
  resize: none;
  outline: none;
  width: 100%;
}

.input-container textarea::placeholder {
  color: var(--text-tertiary);
}

.input-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 0.25rem;
}

.shortcut-tip {
  font-size: 0.76rem;
  color: var(--text-tertiary);
}

.send-btn {
  background: var(--accent-primary);
  color: var(--text-inverted);
  border: 1px solid var(--accent-primary);
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.send-btn:hover {
  background: var(--accent-active);
}

.send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Common Panels */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.panel-header h2 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.panel-header p {
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.debate-controls {
  display: flex;
  gap: 0.65rem;
  align-items: center;
}

.debate-controls input {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  padding: 0.55rem 0.95rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  min-width: 330px;
  outline: none;
}

.debate-controls select {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  color: var(--text-primary);
  font-family: var(--font-sans);
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  outline: none;
}

.action-btn {
  background: var(--accent-primary);
  border: 1px solid var(--accent-primary);
  color: var(--text-inverted);
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn:hover {
  background: var(--accent-active);
}

.action-btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  color: var(--text-primary);
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.action-btn-secondary:hover {
  background: var(--bg-hover);
}

.editor-action-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.editor-subtitle {
  font-size: 0.74rem;
  color: var(--text-tertiary);
  display: block;
  margin-top: 2px;
}

.btn-sm-action {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  color: var(--text-primary);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sm-action:hover {
  background: var(--bg-hover);
}

.btn-sm-action.btn-danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.btn-sm-action.btn-danger:hover {
  background: #fee2e2;
  border-color: #f87171;
}

/* Dialectic Arena */
.dialectic-arena-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.35rem;
  flex: 1;
  min-height: 480px;
}

.persona-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.persona-header {
  padding: 1.1rem 1.25rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-main);
}

.persona-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.persona-tag {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.persona-body {
  padding: 1.25rem;
  flex: 1;
  overflow-y: auto;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-secondary);
  white-space: pre-wrap;
}

.placeholder-text {
  color: var(--text-tertiary);
  font-style: normal;
}

/* Goal Pipeline */
.goal-pipeline-stages {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  flex: 1;
}

.goal-stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.stage-num {
  position: absolute;
  top: 1.25rem;
  right: 1.35rem;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--border-main);
}

.goal-stage-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text-primary);
}

.goal-stage-card p {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
}

.stage-content {
  flex: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.2rem;
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--text-secondary);
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Profiles */
.profile-subnav {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.subnav-pill {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-xs);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subnav-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.subnav-pill.active {
  background: var(--accent-primary);
  color: var(--text-inverted);
  border-color: var(--accent-primary);
}

.profile-studio-layout {
  display: flex;
  gap: 1.5rem;
  flex: 1;
}

.profile-list-sidebar {
  width: 260px;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.profile-item-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.86rem;
  transition: all 0.15s ease;
}

.profile-item-btn.active {
  border-color: var(--accent-primary);
  background: var(--bg-subtle);
  font-weight: 600;
}

.profile-editor-container {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.editor-header {
  padding: 1rem 1.5rem;
  background: var(--bg-sidebar);
  border-bottom: 1px solid var(--border-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.editor-header h3 {
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-mono);
}

.save-btn {
  background: var(--accent-primary);
  color: var(--text-inverted);
  border: 1px solid var(--accent-primary);
  padding: 0.45rem 1rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.profile-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  padding: 1.5rem;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  line-height: 1.7;
  resize: none;
  outline: none;
}

/* Markdown Skill Studio */
.skill-studio-layout {
  display: flex;
  gap: 1.5rem;
  flex: 1;
  overflow: hidden;
}

.skill-list-sidebar {
  width: 340px;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skill-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.category-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s ease;
}

.category-pill:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.category-pill.active {
  background: var(--accent-primary);
  color: var(--text-inverted);
  border-color: var(--accent-primary);
}

.skill-items-container {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-right: 4px;
}

.skill-item-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.skill-item-card:hover {
  border-color: var(--text-tertiary);
  background: var(--bg-subtle);
}

.skill-item-card.active {
  border-color: var(--accent-primary);
  background: var(--bg-subtle);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.skill-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.skill-item-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.skill-type-tag {
  font-size: 0.68rem;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
}

.skill-type-tag.core {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.skill-type-tag.custom {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.skill-item-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skill-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.2rem;
}

.skill-category-badge {
  font-size: 0.7rem;
  color: var(--text-tertiary);
  font-weight: 600;
}

.skill-version-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-tertiary);
}

.skill-editor-container {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

/* Memory */
.memory-dashboard-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  flex: 1;
}

.memory-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.memory-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1.15rem;
  color: var(--text-primary);
}

.memory-stream {
  flex: 1;
  background: var(--bg-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 1.15rem;
  overflow-y: auto;
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--text-secondary);
}

/* Toast */
.antri-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1c1917;
  color: #fcfbf9;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  z-index: 1000;
  pointer-events: none;
}

.antri-toast.show {
  opacity: 1;
  transform: translateY(0);
}

/* Auth Header Button & Modal */
.auth-header-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-header-btn:hover {
  background: var(--bg-surface-elevated);
  border-color: var(--accent-primary);
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f43f5e;
}

.status-dot.logged-in {
  background: #10b981;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-box {
  background: var(--bg-surface-elevated, #18181b);
  border: 1px solid var(--border-color, #27272a);
  border-radius: 12px;
  width: 100%;
  max-width: 400px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  font-size: 16px;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-input {
  width: 100%;
  padding: 10px 12px;
  background: var(--bg-surface, #09090b);
  border: 1px solid var(--border-color, #27272a);
  border-radius: 6px;
  color: var(--text-primary, #f4f4f5);
  font-size: 13px;
  outline: none;
}

.modal-input:focus {
  border-color: var(--accent-primary, #6366f1);
}

.action-btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
}

.action-btn-danger:hover {
  background: #b91c1c;
}

/* Tool Permission Prompt Card */
.permission-prompt-card {
  background: var(--bg-surface-elevated, #18181b);
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 14px;
  margin: 10px 0;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
}

.perm-title {
  font-size: 12px;
  font-weight: 700;
  color: #f59e0b;
  margin-bottom: 4px;
}

.perm-desc {
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.perm-args {
  background: var(--bg-surface, #09090b);
  border: 1px solid var(--border-color);
  padding: 8px 10px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 10px;
  color: #38bdf8;
}

.perm-actions {
  display: flex;
  gap: 8px;
}

.perm-btn {
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}

.perm-btn:hover {
  opacity: 0.9;
}

.perm-allow {
  background: #10b981;
  color: #fff;
}

.perm-always {
  background: #6366f1;
  color: #fff;
}

.perm-deny {
  background: #ef4444;
  color: #fff;
}

/* Global Floating Permission Request Banner (for CLI & Desktop) */
.global-permission-overlay {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10000;
  max-width: 440px;
  width: calc(100vw - 48px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.global-permission-card {
  pointer-events: auto;
  background: rgba(18, 18, 24, 0.95);
  border: 1.5px solid #f59e0b;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 24px rgba(245, 158, 11, 0.25);
  backdrop-filter: blur(20px);
  color: #f1f5f9;
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.global-permission-card .perm-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 12px;
  color: #f59e0b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.global-permission-card .perm-source {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  margin-left: auto;
}

.global-permission-card .perm-tool-name {
  font-family: var(--font-mono, monospace);
  font-weight: 700;
  color: #38bdf8;
  font-size: 14px;
  margin-bottom: 6px;
}

.global-permission-card .perm-args-box {
  background: #09090f;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px 10px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  color: #94a3b8;
  max-height: 90px;
  overflow-y: auto;
  word-break: break-all;
  white-space: pre-wrap;
  margin-bottom: 12px;
}

.global-permission-card .perm-actions {
  display: flex;
  gap: 8px;
}

.global-permission-card .perm-actions button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: transform 0.1s, opacity 0.15s;
}

.global-permission-card .perm-actions button:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Artifacts Hub & Interactive Cards */
.artifacts-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.artifacts-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  gap: 1rem;
}

.artifacts-toggle-all-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.artifacts-toggle-all-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.artifact-session-group {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  transition: all 0.2s ease;
}

.artifact-session-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-main);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
}

.artifact-session-header:hover {
  opacity: 0.85;
}

.artifact-session-group.collapsed {
  padding: 0.85rem 1.25rem;
}

.artifact-session-group.collapsed .artifact-session-header {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.artifact-session-group.collapsed .artifacts-grid {
  display: none;
}

.artifact-collapse-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 6px;
}

.artifact-session-group.collapsed .artifact-collapse-chevron {
  transform: rotate(-90deg);
}

.artifact-session-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.artifacts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.artifact-item-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
  transition: transform 0.15s, border-color 0.15s;
}

.artifact-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
}

.artifact-card-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
}

.badge-html {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-graph {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-mindmap {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Chat Message Artifact Card */
.chat-artifact-embed {
  margin-top: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.chat-artifact-btn {
  background: var(--accent-primary);
  color: var(--text-inverted);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: opacity 0.15s;
}

.chat-artifact-btn:hover {
  opacity: 0.9;
}

.modal-box-large {
  max-width: 950px;
  width: 92%;
}

/* Suggestions & Ideation Tab */
.suggestions-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.suggestions-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cat-chip {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-chip:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.cat-chip.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

.suggestions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.suggestion-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.suggestion-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.08);
}

.suggestion-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.suggestion-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: #6366f1;
}

.suggestion-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 0.35rem;
}

.suggestion-desc {
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.suggestion-features {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0;
}

.suggestion-feature-item {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.suggestion-feature-item::before {
  content: '✓';
  color: #10b981;
  font-weight: bold;
}

.suggestion-card-actions {
  display: flex;
  gap: 8px;
}

.btn-adopt-idea {
  flex: 1;
  background: var(--accent-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}

.btn-adopt-idea:hover {
  opacity: 0.9;
}

.btn-tweak-idea {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-tweak-idea:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.custom-idea-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.custom-idea-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.custom-idea-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.custom-idea-textarea {
  width: 100%;
  min-height: 100px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.88rem;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}

.custom-idea-textarea:focus {
  border-color: var(--accent-primary);
}

.custom-idea-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

/* 🫁 CODEBASE INTELLIGENCE RADAR STYLES */
.breathing-progress-bar {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.15), rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.15));
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 1.5rem;
  animation: breathingGlow 2s infinite ease-in-out;
}

@keyframes breathingGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(168, 85, 247, 0.2); }
  50% { box-shadow: 0 0 25px rgba(168, 85, 247, 0.5); }
}

.breathing-pulse-indicator {
  font-weight: 600;
  font-size: 0.9rem;
  color: #c084fc;
  text-align: center;
}

.codebase-dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.codebase-hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
}

.project-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.project-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-primary);
}

.project-version {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.tech-stack-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tech-pill {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  color: var(--text-primary);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
}

.hero-stats-grid {
  display: flex;
  gap: 1.5rem;
}

.stat-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  text-align: center;
  min-width: 100px;
}

.stat-number {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-primary);
}

.stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.git-status-badge {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.codebase-columns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.codebase-col-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.codebase-col-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.subsystems-list, .key-files-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.subsystem-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
  padding: 8px 12px;
  border-radius: var(--radius-xs);
  font-size: 0.84rem;
}

.subsystem-name {
  font-weight: 600;
  color: var(--text-primary);
}

.subsystem-count {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.key-file-tag {
  background: var(--bg-subtle);
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.deps-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dep-pill {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
  font-size: 0.76rem;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
}

/* 💻 LIVE WORKSPACE & PLAYGROUND STYLES */
.workspace-editor-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.25rem;
  height: calc(100vh - 200px);
}

.workspace-tree-sidebar {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tree-header {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-main);
  font-weight: 700;
  font-size: 0.84rem;
  color: var(--text-primary);
}

.workspace-tree-list {
  padding: 8px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tree-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: var(--radius-xs);
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}

.tree-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tree-item.active {
  background: var(--primary-subtle);
  color: var(--accent-primary);
  font-weight: 600;
}

.workspace-code-pane {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.active-file-tag {
  font-size: 0.86rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
}

.device-toggles {
  display: flex;
  gap: 4px;
}

.device-btn {
  background: var(--bg-subtle);
  border: 1px solid var(--border-main);
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 0.76rem;
  cursor: pointer;
}

.device-btn.active {
  background: var(--accent-primary);
  color: var(--text-inverted);
}

.code-font {
  font-family: var(--font-mono) !important;
  font-size: 0.85rem !important;
  line-height: 1.5 !important;
  flex: 1;
}

.workspace-sandbox-container {
  height: 45%;
  border-top: 1px solid var(--border-main);
  background: #ffffff;
}

.sandbox-iframe {
  width: 100%;
  height: 100%;
  border: none;
}

/* 🧠 THINKING TIMELINE STYLES */
.thinking-timeline-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  max-width: 900px;
}

.timeline-stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  transition: all 0.2s ease;
}

.timeline-stage-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.stage-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--accent-primary);
  opacity: 0.8;
  font-family: var(--font-mono);
  min-width: 45px;
}

.stage-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.stage-content p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.8rem;
}

.stage-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Dialectic & Goal Output Formatting */
.streaming-pulse {
  color: var(--primary);
  font-weight: 500;
  animation: pulse-glow 1.5s ease-in-out infinite alternate;
}

@keyframes pulse-glow {
  0% { opacity: 0.6; }
  100% { opacity: 1; }
}

.formatted-code-block {
  background: var(--bg-sidebar);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-sm);
  margin: 0.75rem 0;
  overflow: hidden;
}

.code-block-header {
  background: rgba(0, 0, 0, 0.2);
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  border-bottom: 1px solid var(--border-main);
  text-transform: uppercase;
  font-weight: 600;
}

.formatted-code-block pre {
  margin: 0;
  padding: 0.75rem;
  overflow-x: auto;
}

.formatted-code-block code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text-primary);
  white-space: pre;
}

.inline-code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--bg-sidebar);
  border: 1px solid var(--border-main);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  color: var(--accent-primary, #6366f1);
}

.formatted-h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 1rem 0 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.25rem;
}

.formatted-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0.85rem 0 0.4rem 0;
}

.formatted-h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0.7rem 0 0.3rem 0;
}

.formatted-h5 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 0.5rem 0 0.25rem 0;
}

.formatted-quote {
  border-left: 3px solid var(--primary);
  padding: 0.4rem 0.75rem;
  margin: 0.5rem 0;
  background: var(--bg-sidebar);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  font-style: italic;
  color: var(--text-secondary);
}

.bullet-item {
  margin: 0.25rem 0 0.25rem 0.5rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.number-item {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin: 0.3rem 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

.num-badge {
  font-weight: 700;
  color: var(--primary);
  min-width: 1.2rem;
}

/* ==========================================================================
   🕸️ Agent Swarm Canvas & Multi-Agent DAG Visualizer
   ========================================================================== */

.badge-consensus {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.swarm-presets-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
.swarm-presets-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  overflow-x: auto;
  padding: 4px 2px 10px 2px;
}

.presets-label {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
  letter-spacing: 0.5px;
}

.swarm-preset-btn {
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #e2e8f0;
  padding: 7px 15px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.swarm-preset-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: #38bdf8;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.3);
}

.swarm-canvas-card {
  background: radial-gradient(circle at 50% 30%, rgba(15, 23, 42, 0.96), rgba(7, 10, 19, 0.99));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 16px;
  padding: 20px 24px;
  margin-bottom: 22px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  position: relative;
  overflow: hidden;
}

.swarm-canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.canvas-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.2px;
  color: #38bdf8;
}

.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 10px #38bdf8;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.3); }
}

.swarm-metrics-row {
  display: flex;
  gap: 20px;
}

.metric-item {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.metric-item .m-label {
  font-size: 10px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.metric-item .m-val {
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  font-family: var(--font-mono);
}

.metric-item .text-emerald {
  color: #34d399;
}

.swarm-svg-wrapper {
  width: 100%;
  height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}

.swarm-svg-wrapper svg {
  width: 100%;
  height: 100%;
}

.swarm-svg-node {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.swarm-svg-node:hover {
  filter: brightness(1.25);
}

.swarm-svg-node .node-halo {
  transform-box: fill-box;
  transform-origin: center;
  transition: all 0.3s ease;
}

.swarm-svg-node.active .node-halo {
  animation: haloPulse 1.5s infinite ease-in-out;
  stroke-width: 3.5px;
}

.swarm-svg-node.selected .node-halo {
  stroke-width: 4px;
  stroke: #ffffff;
  filter: drop-shadow(0 0 14px rgba(255,255,255,0.7));
}

@keyframes haloPulse {
  0%, 100% { transform: scale(1); opacity: 0.5; }
  50% { transform: scale(1.15); opacity: 1; }
}

.particle-dot {
  filter: drop-shadow(0 0 8px #38bdf8);
}

.swarm-workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 4px;
}

@media (max-width: 900px) {
  .swarm-workspace-grid {
    grid-template-columns: 1fr;
  }
}

.swarm-stream-card, .swarm-deliverables-card {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  height: 520px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.stream-header, .deliverables-header {
  padding: 12px 16px;
  background: #0f172a;
  border-bottom: 1px solid #1e293b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.stream-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 2px;
}

.stream-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: #94a3b8;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.stream-tab-btn.active {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
}

.stream-tab-btn:hover:not(.active) {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.08);
}

.copy-stream-btn, .action-btn-sm {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.copy-stream-btn:hover, .action-btn-sm:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: #38bdf8;
  color: #ffffff;
}

.swarm-stream-body, .deliverables-content {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  font-size: 13px;
  line-height: 1.65;
  color: #f1f5f9;
  background: #070d19;
}

/* ==========================================================================
   ✨ High-Contrast Luminous Typography & Formatted Markdown for Dark Surfaces
   ========================================================================== */

.badge-consensus {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
}

.deliverables-header h3 {
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
  margin: 0;
}

.swarm-svg-node text {
  user-select: none;
}

#tab-swarm {
  color: #f1f5f9;
}

#tab-swarm .panel-header h2 {
  color: var(--text-primary);
}

#tab-swarm .panel-header p {
  color: var(--text-secondary);
}

#tab-swarm #swarm-objective-input {
  background: #0f172a;
  border: 1px solid #334155;
  color: #ffffff;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  min-width: 320px;
  transition: border-color 0.2s ease;
}

#tab-swarm #swarm-objective-input:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.25);
}

#tab-swarm #swarm-objective-input::placeholder {
  color: #64748b;
}

.swarm-stream-body *,
.deliverables-content * {
  box-sizing: border-box;
}

.swarm-stream-body p,
.deliverables-content p {
  color: #e2e8f0;
  margin-bottom: 10px;
  line-height: 1.65;
}

.formatted-h2 {
  font-size: 16px;
  font-weight: 800;
  color: #38bdf8;
  margin: 16px 0 8px 0;
  border-bottom: 1px solid rgba(56, 189, 248, 0.2);
  padding-bottom: 4px;
}

.formatted-h3 {
  font-size: 14px;
  font-weight: 700;
  color: #c084fc;
  margin: 14px 0 6px 0;
}

.formatted-h4 {
  font-size: 13px;
  font-weight: 700;
  color: #fbbf24;
  margin: 12px 0 6px 0;
}

.formatted-h5 {
  font-size: 12px;
  font-weight: 700;
  color: #34d399;
  margin: 10px 0 4px 0;
}

.bullet-item {
  color: #f1f5f9;
  margin: 5px 0;
  line-height: 1.55;
  padding-left: 6px;
}

.number-item {
  color: #f1f5f9;
  margin: 5px 0;
  line-height: 1.55;
}

.num-badge {
  color: #38bdf8;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-right: 4px;
}

.formatted-quote {
  border-left: 3px solid #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 8px 12px;
  margin: 10px 0;
  border-radius: 0 6px 6px 0;
  color: #cbd5e1;
  font-style: italic;
}

.inline-code {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

.formatted-code-block {
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 8px;
  margin: 12px 0;
  overflow: hidden;
}

.code-block-header {
  background: #0f172a;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 12px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  border-bottom: 1px solid #1e293b;
}

.formatted-code-block pre {
  padding: 12px 14px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e2e8f0;
  line-height: 1.5;
  background: #020617;
}

.formatted-code-block code {
  color: #e2e8f0;
  font-family: var(--font-mono);
}

.swarm-stream-body strong,
.deliverables-content strong {
  color: #ffffff;
  font-weight: 700;
}

.swarm-stream-body em,
.deliverables-content em {
  color: #cbd5e1;
}

.placeholder-text {
  color: #94a3b8 !important;
  font-style: italic;
}

/* ==========================================================================
   📸 Gemini 3.7 Vision · Autonomous Visual UI Self-Healer
   ========================================================================== */

.action-btn-visual-heal {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(56, 189, 248, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.15);
}

.action-btn-visual-heal:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.35), rgba(56, 189, 248, 0.35));
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
}

.laser-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: pulseLaser 1.5s infinite;
}

@keyframes pulseLaser {
  0%, 100% { transform: scale(0.9); opacity: 0.5; }
  50% { transform: scale(1.3); opacity: 1; }
}

.laser-scanner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #38bdf8, #34d399, transparent);
  box-shadow: 0 0 15px #38bdf8, 0 0 30px #34d399;
  z-index: 50;
  pointer-events: none;
  animation: scanLaser 2s infinite ease-in-out;
}

@keyframes scanLaser {
  0% { top: 0; opacity: 0; }
  15% { opacity: 1; }
  85% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.visual-heal-overlay {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-height: 220px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  z-index: 40;
  animation: slideUpFade 0.3s ease;
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.heal-overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.heal-defects-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.defect-pill-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(2, 6, 23, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
}

.defect-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.defect-contrast { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.defect-alignment { background: rgba(56, 189, 248, 0.15); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.3); }
.defect-interactive { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }
.defect-runtime { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }


