:root, body.theme-dark {
  --bg-base: #060b17;
  --bg-surface: rgba(10, 20, 42, 0.9);
  --bg-surface-elevated: #0e1e3c;
  --bg-card: rgba(14, 28, 56, 0.8);
  --border-subtle: rgba(56, 189, 248, 0.15);
  --border-focus: rgba(37, 99, 235, 0.65);
  
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.35);
  --primary-hover: #1d4ed8;
  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  
  --text-main: #f0f7ff;
  --text-muted: #93b4d8;
  --text-dim: #5c799e;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  
  --shadow-elevated: 0 14px 40px -10px rgba(0, 10, 30, 0.8), 0 0 1px 1px rgba(56, 189, 248, 0.14);
  --shadow-glow: 0 0 28px var(--primary-glow);
  --transition-smooth: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --code-bg: #040812;
}

/* ☀️ Açık Tema (Ultra-Clean Cyber Blue Aesthetic) */
body.theme-light {
  --bg-base: #f0f7ff;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-card: #ffffff;
  --border-subtle: #dbeafe;
  --border-focus: rgba(37, 99, 235, 0.45);
  
  --primary: #2563eb;
  --primary-glow: rgba(37, 99, 235, 0.2);
  --primary-hover: #1d4ed8;
  --accent-cyan: #0284c7;
  --accent-emerald: #059669;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
  
  --text-main: #0c1a30;
  --text-muted: #3b5275;
  --text-dim: #64748b;
  
  --shadow-elevated: 0 6px 24px -2px rgba(37, 99, 235, 0.08), 0 0 1px 1px rgba(147, 197, 253, 0.3);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.15);
  --code-bg: #f8fafc;
}

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

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-base);
  color: var(--text-main);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Subtle Animated Ambient Background Glows */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  left: 20%;
  width: 700px;
  height: 700px;
  background: radial-gradient(circle, rgba(14, 165, 233, 0.15) 0%, rgba(37, 99, 235, 0.08) 45%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  right: 15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.1) 0%, transparent 65%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

/* ==========================================================================
   Header Navigation
   ========================================================================== */
.studio-header {
  position: relative;
  z-index: 10;
  height: 60px;
  background: var(--bg-surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  box-shadow: var(--shadow-elevated);
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 4px 15px var(--primary-glow);
}

.brand-info h1 {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: var(--text-main);
}

.brand-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 7px;
  background: rgba(37, 99, 235, 0.15);
  color: #38bdf8;
  border-radius: 6px;
  border: 1px solid rgba(56, 189, 248, 0.25);
}

/* Project Picker */
.project-picker-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px 4px 2px 8px;
  transition: var(--transition-smooth);
}

.project-picker-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.project-select, .model-select {
  background: transparent;
  color: var(--text-main);
  border: none;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding: 6px 4px;
}

.project-select option, .model-select option {
  background: var(--bg-surface);
  color: var(--text-main);
}

.btn-icon-subtle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-icon-subtle:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

/* Model Picker */
.model-picker-wrapper, .theme-picker-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px 10px;
  gap: 6px;
  transition: var(--transition-smooth);
}

.model-picker-wrapper:focus-within, .theme-picker-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.theme-select {
  background: transparent;
  color: var(--text-main);
  border: none;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  padding: 6px 4px;
}

.theme-select option {
  background: var(--bg-surface-elevated);
  color: var(--text-main);
}

.model-icon {
  font-size: 14px;
}

/* Status Indicator */
.status-indicator-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 20px;
  color: #34d399;
}

.status-dot {
  width: 7px;
  height: 7px;
  background-color: #10b981;
  border-radius: 50%;
  box-shadow: 0 0 10px #10b981;
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.btn-header-action {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-header-action:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-header-action.security-btn {
  border-color: rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
}

/* ==========================================================================
   Main Dual-Panel Workspace
   ========================================================================== */
.studio-workspace {
  position: relative;
  z-index: 1;
  flex: 1;
  display: grid;
  grid-template-columns: 480px 1fr;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* ==========================================================================
   LEFT PANEL: AI Chat, Tasks & Approval Deck
   ========================================================================== */
.left-panel {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Agent Tabs */
.agent-tabs-container {
  display: flex;
  overflow-x: auto;
  gap: 4px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(0, 0, 0, 0.04);
  scrollbar-width: none;
}

.agent-tabs-container::-webkit-scrollbar {
  display: none;
}

.agent-tab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.agent-tab:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.05);
}

.agent-tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 10px var(--primary-glow);
}

/* Chat Viewport */
.chat-viewport {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-subtle) transparent;
}

.chat-message {
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.6;
  max-width: 96%;
  animation: fadeIn 0.25s ease-out;
  box-shadow: var(--shadow-elevated);
}

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

.chat-message.system {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  align-self: flex-start;
}

.chat-message.user {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  color: #fff;
  align-self: flex-end;
  border-radius: var(--radius-lg) var(--radius-lg) 2px var(--radius-lg);
  box-shadow: 0 4px 14px var(--primary-glow);
}

.chat-message.agent {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  align-self: flex-start;
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-lg) 2px;
}

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

.agent-tag {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

.model-tag {
  font-size: 10px;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--text-muted);
}

.msg-time {
  font-size: 11px;
  color: var(--text-dim);
}

.msg-body {
  word-break: break-word;
}

.msg-body p {
  margin-bottom: 8px;
}

.msg-body p:last-child {
  margin-bottom: 0;
}

/* Inline Code tags */
.msg-body code, .chat-inline-code {
  font-family: 'JetBrains Mono', monospace;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.15);
  color: #bae6fd;
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: inline-block;
  vertical-align: middle;
}

body.theme-light .msg-body code, body.theme-light .chat-inline-code {
  background: #f1f5f9;
  color: #3730a3;
  border: 1px solid #cbd5e1;
}

/* Multi-line Code blocks inside chat */
.chat-code-block {
  margin: 10px 0;
  padding: 12px 14px;
  border-radius: 8px;
  background: #090e1a;
  border: 1px solid var(--border-subtle);
  color: #e2e8f0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
}

body.theme-light .chat-code-block {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.chat-code-block code {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: inherit !important;
  font-weight: normal !important;
  display: block;
}

.quick-tips {
  margin-top: 10px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
}

body.theme-light .quick-tips {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #334155;
}

/* Approval Deck */
.approval-deck {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 12px 14px;
  max-height: 240px;
  overflow-y: auto;
}

.approval-deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.deck-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pulse-indicator {
  width: 8px;
  height: 8px;
  background: #f59e0b;
  border-radius: 50%;
  box-shadow: 0 0 10px #f59e0b;
}

.deck-title h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-main);
}

.deck-count {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border-radius: 12px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

/* Empty State for Approval Deck */
.approval-empty-state {
  padding: 24px 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-subtle);
}

body.theme-light .approval-empty-state {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.empty-icon-shield {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  border: 1px solid rgba(16, 185, 129, 0.25);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
}

.empty-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 380px;
  margin: 0;
}

/* Modern Task Cards */
.task-card {
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-elevated);
}

.task-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  box-shadow: 0 8px 24px -6px rgba(0, 10, 30, 0.4);
}

body.theme-light .task-card {
  background: #ffffff;
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.task-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.task-agent-badge {
  font-size: 11px;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(37, 99, 235, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 8px;
  border-radius: 12px;
}

body.theme-light .task-agent-badge {
  color: #4338ca;
  background: #eef2ff;
  border-color: #c7d2fe;
}

.task-env-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 3px 8px;
  border-radius: 12px;
}

.badge-risk {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.badge-risk.düşük { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-risk.orta { background: rgba(245, 158, 11, 0.15); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-risk.yüksek { background: rgba(244, 63, 94, 0.15); color: #fb7185; border: 1px solid rgba(244, 63, 94, 0.3); }

.task-file-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.task-file-info .file-path {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.2);
  color: #a5b4fc;
  border: 1px solid var(--border-subtle);
  word-break: break-all;
}

body.theme-light .task-file-info .file-path {
  background: #f1f5f9;
  color: #3730a3;
  border-color: #cbd5e1;
}

.task-card-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 6px;
  line-height: 1.35;
}

.task-card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Syntax Highlighted Diff Viewer */
.diff-box-container {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
  background: #080c14;
}

body.theme-light .diff-box-container {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.diff-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

body.theme-light .diff-box-header {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.diff-safety-note {
  font-size: 10px;
  color: #10b981;
  font-weight: 600;
}

.diff-code-view {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  line-height: 1.5;
  max-height: 130px;
  overflow-y: auto;
  padding: 4px 0;
}

.diff-line {
  padding: 2px 10px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.diff-line .diff-sign {
  width: 12px;
  user-select: none;
  font-weight: 700;
}

.diff-line .diff-text {
  flex: 1;
  word-break: break-all;
}

.diff-line.add {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

body.theme-light .diff-line.add {
  background: rgba(16, 185, 129, 0.12);
  color: #047857;
  font-weight: 600;
}

.diff-line.del {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
}

body.theme-light .diff-line.del {
  background: rgba(244, 63, 94, 0.12);
  color: #b91c1c;
  font-weight: 600;
}

.diff-line.meta {
  color: #818cf8;
  font-size: 10px;
  padding: 3px 10px;
  background: rgba(99, 102, 241, 0.08);
}

body.theme-light .diff-line.meta {
  color: #4338ca;
  background: #e0e7ff;
}

.diff-line.normal {
  color: var(--text-muted);
}

/* Action Buttons */
.task-actions {
  display: flex;
  gap: 10px;
}

.btn-approve {
  flex: 1;
  height: 38px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
  box-shadow: 0 2px 10px rgba(16, 185, 129, 0.3);
}

.btn-approve:hover {
  background: #059669;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}

.btn-approve:active {
  transform: scale(0.98);
}

.btn-reject {
  height: 38px;
  padding: 0 16px;
  background: rgba(244, 63, 94, 0.1);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.28);
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-reject:hover {
  background: rgba(244, 63, 94, 0.2);
  transform: translateY(-1px);
}

/* Command Quick Chips */
.command-chips-row {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.04);
  scrollbar-width: none;
}

.command-chips-row::-webkit-scrollbar {
  display: none;
}

.chip {
  background: rgba(14, 30, 60, 0.75);
  border: 1px solid rgba(56, 189, 248, 0.22);
  color: #bae6fd;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition-smooth);
}

.chip:hover {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  border-color: #38bdf8;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

/* Chat Input Container */
.chat-input-container {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
}

.chat-input-container textarea {
  flex: 1;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 13px;
  resize: none;
  height: 48px;
  outline: none;
  transition: var(--transition-smooth);
}

.chat-input-container textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.btn-send {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-send:hover {
  box-shadow: 0 4px 15px var(--primary-glow);
  transform: translateY(-1px);
}

/* ==========================================================================
   RIGHT PANEL: Live Website Preview & Viewports
   ========================================================================== */
.right-panel {
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* Preview Toolbar */
.preview-toolbar {
  height: 48px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  gap: 12px;
}

.preview-url-box {
  flex: 1;
  max-width: 520px;
  display: flex;
  align-items: center;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px 4px 2px 8px;
}

.protocol-badge {
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.12);
  padding: 2px 5px;
  border-radius: 4px;
  margin-right: 8px;
}

#preview-url-input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  outline: none;
}

.btn-tool {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-tool:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.spinning {
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  100% { transform: rotate(360deg); }
}

/* Viewport Toggles */
.viewport-toggles {
  display: flex;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 2px;
  gap: 2px;
}

.btn-vp {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-vp:hover {
  color: #fff;
}

.btn-vp.active {
  background: var(--primary);
  color: #fff;
}

/* Auto-Refresh Switch */
.auto-refresh-toggle {
  display: flex;
  align-items: center;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.switch-label input {
  display: none;
}

.switch-slider {
  width: 34px;
  height: 18px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  position: relative;
  transition: var(--transition-smooth);
}

.switch-slider::before {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #94a3b8;
  top: 2px;
  left: 2px;
  transition: var(--transition-smooth);
}

.switch-label input:checked + .switch-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.switch-label input:checked + .switch-slider::before {
  background: #fff;
  transform: translateX(16px);
}

/* Preview Actions */
.preview-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.env-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 12px;
}

.env-pill.prod {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.env-pill.dev {
  background: rgba(99, 102, 241, 0.15);
  color: #818cf8;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Preview Frame Viewport */
.preview-frame-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-base);
  padding: 24px;
  overflow: auto;
  position: relative;
  transition: var(--transition-smooth);
}

.preview-loader {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 13px;
  z-index: 2;
  transition: opacity 0.3s ease;
}

.preview-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(99, 102, 241, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.preview-iframe {
  background: #ffffff;
  border: none;
  box-shadow: var(--shadow-elevated);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Responsive Viewports with Apple Device Frames */
.vp-desktop .preview-iframe {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.vp-tablet .preview-iframe {
  width: 768px;
  height: 94%;
  border-radius: 28px;
  border: 12px solid var(--bg-surface-elevated);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px var(--border-subtle);
}

.vp-mobile .preview-iframe {
  width: 375px;
  height: 94%;
  border-radius: 40px;
  border: 12px solid var(--bg-surface-elevated);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border-subtle);
}

/* macOS Window Controls */
.window-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-right: 8px;
}

.wc-dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.wc-dot:hover {
  opacity: 1;
}

.wc-dot.red { background-color: #ff5f56; box-shadow: 0 0 4px rgba(255, 95, 86, 0.4); }
.wc-dot.yellow { background-color: #ffbd2e; box-shadow: 0 0 4px rgba(255, 189, 46, 0.4); }
.wc-dot.green { background-color: #27c93f; box-shadow: 0 0 4px rgba(39, 201, 63, 0.4); }

.lock-icon {
  color: var(--accent-emerald);
  margin-right: 4px;
}

/* ==========================================================================
   Modals & Security Authentication
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 15, 0.78);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-light .modal-overlay {
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(14px);
}

.modal-overlay.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

.modal-card {
  background: rgba(10, 20, 42, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-top: 2px solid #38bdf8;
  border-radius: var(--radius-xl);
  width: 92%;
  max-width: 440px;
  padding: 32px 28px;
  box-shadow: 0 25px 65px -15px rgba(0, 8, 24, 0.85), 0 0 35px rgba(37, 99, 235, 0.2);
  text-align: center;
  color: var(--text-main);
  position: relative;
  overflow: hidden;
  animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-light .modal-card {
  background: #ffffff;
  border: 1px solid #dbeafe;
  border-top: 2px solid #2563eb;
  box-shadow: 0 20px 45px -10px rgba(37, 99, 235, 0.12);
}

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

.modal-card.wide {
  max-width: 780px;
  text-align: left;
}

/* Security Modal Specific Styling */
.security-modal-card {
  max-width: 420px;
  padding: 36px 30px 28px;
  background: rgba(10, 20, 42, 0.96);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-top: 2px solid #38bdf8;
}

.security-card-glow {
  position: absolute;
  top: -60px;
  left: 50%;
  transform: translateX(-50%);
  width: 220px;
  height: 120px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.45) 0%, transparent 70%);
  pointer-events: none;
  opacity: 0.9;
}

.security-badge-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.security-pulse-ring {
  position: absolute;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-glow);
  animation: shieldPulse 2.5s infinite ease-out;
  pointer-events: none;
}

@keyframes shieldPulse {
  0% { transform: scale(0.85); opacity: 0.8; }
  50% { transform: scale(1.25); opacity: 0.15; }
  100% { transform: scale(0.85); opacity: 0.8; }
}

.security-shield-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(56, 189, 248, 0.15));
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.4);
  position: relative;
  z-index: 1;
}

.security-header {
  margin-bottom: 22px;
}

.security-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  background: rgba(37, 99, 235, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 20px;
  padding: 3px 10px;
  margin-bottom: 10px;
}

.security-status-badge .badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}

.security-modal-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin-bottom: 6px;
}

.security-modal-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 auto;
  max-width: 320px;
}

/* Hidden Real Input for accessibility & mobile keyboards */
.sr-only-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 1px;
  height: 1px;
}

/* 6 Discrete OTP Digit Boxes */
.otp-boxes-wrapper {
  display: flex;
  gap: 9px;
  justify-content: center;
  margin: 18px 0 20px;
  cursor: pointer;
  user-select: none;
}

.otp-box {
  width: 46px;
  height: 52px;
  background: var(--bg-base);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.08);
}

.otp-box:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.otp-box.active {
  border-color: #38bdf8;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.45), inset 0 0 0 1px #38bdf8;
  transform: translateY(-2px);
}

.otp-box.filled {
  border-color: rgba(37, 99, 235, 0.6);
  background: var(--bg-surface);
}

.otp-box.success {
  border-color: var(--accent-emerald) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4) !important;
}

.otp-box.error {
  border-color: var(--accent-rose) !important;
  box-shadow: 0 0 16px rgba(244, 63, 94, 0.4) !important;
}

.otp-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: transparent;
  transform: scale(0);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.otp-box.filled .otp-dot {
  background: var(--text-main);
  box-shadow: 0 0 6px var(--primary-glow);
  transform: scale(1);
}

/* Sleek On-Screen Numeric Keypad */
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  max-width: 270px;
  margin: 0 auto 20px;
}

.numpad-key {
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: 18px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.numpad-key:hover {
  background: var(--bg-surface);
  border-color: var(--primary);
  transform: translateY(-1px);
}

.numpad-key:active {
  transform: scale(0.94);
  background: var(--primary);
  color: #fff;
}

.numpad-key.action-clear {
  color: var(--accent-amber);
  font-size: 15px;
  font-weight: 700;
}

.numpad-key.action-backspace {
  color: var(--text-muted);
}

.numpad-key.action-backspace:hover {
  color: var(--accent-rose);
}

/* Security Submit Button */
.btn-security-enter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 46px;
  width: 100%;
  max-width: 270px;
  margin: 0 auto;
  font-size: 14px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border: none;
  color: #fff;
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: 0 4px 18px var(--primary-glow);
  transition: var(--transition-smooth);
}

.btn-security-enter:hover {
  box-shadow: 0 6px 24px var(--primary-glow);
  transform: translateY(-2px);
}

.btn-security-enter:active {
  transform: scale(0.98);
}

/* Remote Engine / Backend Connection Config */
.backend-connection-toggle {
  margin-top: 14px;
  width: 100%;
  max-width: 270px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.btn-backend-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition-smooth);
}

.btn-backend-toggle:hover {
  color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
}

.backend-config-box {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: left;
}

.backend-config-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-main);
  display: block;
  margin-bottom: 6px;
}

.backend-input-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.backend-input-row input {
  flex: 1;
  height: 32px;
  padding: 4px 8px;
  font-size: 11px;
}

.btn-save-backend {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 0 10px;
  height: 32px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.btn-reset-backend {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.25);
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.backend-note {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 6px;
  line-height: 1.4;
}

.error-msg.info-note {
  background: rgba(99, 102, 241, 0.12);
  color: #818cf8;
  border-color: rgba(99, 102, 241, 0.3);
}

.security-card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  font-size: 11px;
  color: var(--text-dim);
}

/* Shake Animation on Wrong PIN */
.modal-card.shake {
  animation: modalShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes modalShake {
  10%, 90% { transform: translate3d(-3px, 0, 0); }
  20%, 80% { transform: translate3d(5px, 0, 0); }
  30%, 50%, 70% { transform: translate3d(-6px, 0, 0); }
  40%, 60% { transform: translate3d(6px, 0, 0); }
}

/* General Modal Form Styles */
.modal-header h2 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}

.modal-header p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.modal-form-body {
  text-align: left;
  margin-top: 16px;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  display: block;
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  height: 40px;
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0 12px;
  color: var(--text-main);
  font-family: inherit;
  transition: var(--transition-smooth);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 12px var(--primary-glow);
}

.form-textarea {
  height: 75px;
  padding: 10px 12px;
  resize: none;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.form-group-spaced {
  margin-bottom: 14px;
}

.form-group-spaced-lg {
  margin-bottom: 20px;
}

.form-actions-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.btn-flex-center {
  flex: 1;
  justify-content: center;
  height: 38px;
}

.modal-info-text {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  line-height: 1.5;
}

.key-label-gemini { color: #60a5fa; }
.key-label-claude { color: #38bdf8; }
.key-label-openai { color: #34d399; }

.key-status-text {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  margin-top: 4px;
}

.keys-feedback-box {
  padding: 10px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 14px;
}

.sync-plan-box {
  background: var(--bg-base);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
}

.sync-plan-summary-title {
  font-size: 13px;
  font-weight: 600;
  color: #34d399;
  margin-bottom: 10px;
}

.sync-plan-file-list {
  max-height: 120px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
}

.btn-deploy-full {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
}

.error-msg {
  background: rgba(244, 63, 94, 0.15);
  color: #fb7185;
  border: 1px solid rgba(244, 63, 94, 0.3);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-bottom: 16px;
  text-align: center;
}

.error-msg.hidden {
  display: none;
}

.btn-primary-action {
  width: 100%;
  background: linear-gradient(135deg, #2563eb, #0284c7);
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 18px rgba(37, 99, 235, 0.4);
}

.btn-primary-action:hover {
  background: linear-gradient(135deg, #1d4ed8, #0369a1);
  box-shadow: 0 6px 24px rgba(37, 99, 235, 0.55);
  transform: translateY(-1px);
}

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

.btn-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  transition: var(--transition-smooth);
}

.btn-close:hover {
  color: var(--text-main);
  transform: scale(1.1);
}

.modal-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-subtle);
  margin: 16px 0;
}

.modal-tab {
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.modal-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.env-toggle-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.env-toggle-btn:hover {
  background: rgba(16, 185, 129, 0.25);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.env-toggle-btn.dev {
  background: rgba(37, 99, 235, 0.15);
  border-color: rgba(56, 189, 248, 0.3);
  color: #38bdf8;
}

.env-toggle-btn.dev:hover {
  background: rgba(37, 99, 235, 0.25);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.35);
}

.code-view {
  background: #080c14;
  border-radius: var(--radius-md);
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #cbd5e1;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}

/* ==========================================================================
   Comprehensive Light Theme Overrides (Apple / Linear Aesthetic)
   ========================================================================== */
body.theme-light .studio-header {
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

body.theme-light .brand h1 {
  color: #0f172a;
}

body.theme-light .brand-badge {
  background: rgba(79, 70, 229, 0.08);
  color: #4f46e5;
  border-color: rgba(79, 70, 229, 0.2);
}

body.theme-light .project-select,
body.theme-light .model-select,
body.theme-light .theme-select {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.theme-light .project-picker-wrapper,
body.theme-light .model-picker-wrapper,
body.theme-light .theme-picker-wrapper {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.theme-light .btn-header-action {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

body.theme-light .btn-header-action:hover {
  background: #f1f5f9;
  border-color: #4f46e5;
  color: #4f46e5;
}

body.theme-light .agent-tabs-bar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .agent-tab {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
}

body.theme-light .agent-tab:hover {
  background: #f1f5f9;
  color: #0f172a;
}

body.theme-light .agent-tab.active {
  background: #4f46e5;
  color: #ffffff;
  border-color: #4f46e5;
}

body.theme-light .chat-message.agent {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

body.theme-light .chat-message.system {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
}

body.theme-light .agent-tag {
  color: #4338ca;
}

body.theme-light .model-tag {
  background: rgba(0, 0, 0, 0.05);
  color: #64748b;
}

body.theme-light .approval-deck {
  background: #ffffff;
  border-color: #e2e8f0;
}

body.theme-light .task-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

body.theme-light .task-card:hover {
  border-color: #4f46e5;
}

body.theme-light .diff-box {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

body.theme-light .command-chips-row {
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
}

body.theme-light .chip {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}

body.theme-light .chip:hover {
  background: #4f46e5;
  border-color: #4f46e5;
  color: #ffffff;
}

body.theme-light .chat-input-container {
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

body.theme-light .chat-input-container textarea {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.theme-light .chat-input-container textarea:focus {
  border-color: #4f46e5;
  background: #ffffff;
}

body.theme-light .preview-toolbar {
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

body.theme-light .preview-url-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.theme-light #preview-url-input {
  color: #0f172a;
}

body.theme-light .btn-tool {
  color: #64748b;
}

body.theme-light .btn-tool:hover {
  color: #0f172a;
  background: #f1f5f9;
}

body.theme-light .viewport-toggles {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.theme-light .btn-vp {
  color: #64748b;
}

body.theme-light .btn-vp:hover {
  color: #0f172a;
}

body.theme-light .btn-vp.active {
  background: #4f46e5;
  color: #ffffff;
}

body.theme-light .preview-frame-container {
  background: #f1f5f9;
}

body.theme-light .modal-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.12), 0 0 1px 1px #e2e8f0;
}

body.theme-light .modal-header h2,
body.theme-light .security-modal-title {
  color: #0f172a;
}

body.theme-light .modal-header p,
body.theme-light .security-modal-subtitle {
  color: #475569;
}

body.theme-light .otp-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}

body.theme-light .otp-box.filled .otp-dot {
  background: #0f172a;
}

body.theme-light .numpad-key {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

body.theme-light .numpad-key:hover {
  background: #f1f5f9;
  border-color: #4f46e5;
}

body.theme-light .form-control {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.theme-light .code-view {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #0f172a;
}

body.theme-light .sync-plan-box {
  background: #f8fafc;
  border-color: #e2e8f0;
}

/* ==========================================================================
   Autonomous Agent Bar & Team Flow Indicator
   ========================================================================== */
.autonomous-agent-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  gap: 12px;
  flex-wrap: wrap;
}

.autonomous-agent-bar .team-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.autonomous-agent-bar .team-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.team-models-flow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

.flow-step {
  padding: 2px 8px;
  background: var(--bg-surface-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-weight: 500;
}

.flow-arrow {
  color: var(--primary);
  font-weight: 700;
  font-size: 10px;
}

.flow-sep {
  color: var(--border-subtle);
  margin: 0 4px;
}

.flow-step.openai-step {
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
}

/* ==========================================================================
   Agent Workflow Step-by-Step Execution Card in Chat
   ========================================================================== */
.agent-workflow-card {
  margin: 8px 0 12px;
  padding: 10px 14px;
  background: rgba(99, 102, 241, 0.07);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  font-size: 12px;
}

.workflow-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(99, 102, 241, 0.15);
}

.workflow-card-title {
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.workflow-status-badge {
  font-size: 10px;
  font-weight: 600;
  color: #10b981;
  background: rgba(16, 185, 129, 0.15);
  padding: 2px 7px;
  border-radius: 10px;
}

.workflow-steps-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.workflow-steps-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-main);
  line-height: 1.4;
}

.workflow-check {
  color: #10b981;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  margin-top: 1px;
}

.workflow-text {
  flex: 1;
}

/* Multi-Key Helper Styles in Modal */
.form-textarea-keys {
  resize: vertical;
  min-height: 60px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  line-height: 1.4;
}

.key-help-note {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ==========================================================================
   Mobile & Laptop Responsive Adjustments
   ========================================================================== */
@media (max-width: 1024px) {
  .studio-workspace {
    flex-direction: column;
    overflow-y: auto;
  }

  .left-panel, .right-panel {
    flex: none;
    width: 100%;
    min-height: 500px;
    height: auto;
  }

  .studio-header {
    flex-wrap: wrap;
    gap: 8px;
    height: auto;
    padding: 10px 16px;
  }

  .header-actions {
    flex-wrap: wrap;
  }
}

@media (max-width: 768px) {
  .header-branding .brand-desc {
    display: none;
  }

  .team-models-flow {
    display: none;
  }

  .header-actions .btn-header-action span {
    display: none;
  }

  .header-actions .btn-header-action {
    padding: 7px;
  }

  .command-chips-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
  }

  .chip {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .preview-toolbar {
    flex-wrap: wrap;
    gap: 6px;
  }

/* ==========================================================================
   Autonomous Pipeline Badge (Header Center)
   ========================================================================== */
.model-pipeline-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(14, 30, 60, 0.7);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

body.theme-light .model-pipeline-badge {
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.pipeline-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
  box-shadow: 0 0 8px #38bdf8;
  animation: pulse 2s infinite;
}

.pipeline-label {
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
}

body.theme-light .pipeline-label {
  color: #1d4ed8;
}

.pipeline-steps {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: #bae6fd;
  white-space: nowrap;
}

body.theme-light .pipeline-steps {
  color: #1e40af;
}

/* ==========================================================================
   Chat Mode Switcher Tabs (Coding vs ChatGPT Assistant)
   ========================================================================== */
.chat-mode-tabs {
  display: flex;
  background: rgba(10, 20, 42, 0.9);
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
  padding: 6px 12px;
  gap: 8px;
}

body.theme-light .chat-mode-tabs {
  background: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
}

.chat-mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-mode-tab:hover {
  color: var(--text-main);
  background: rgba(37, 99, 235, 0.1);
}

.chat-mode-tab.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.35), rgba(14, 165, 233, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.25);
}

body.theme-light .chat-mode-tab.active {
  background: #ffffff;
  border-color: #3b82f6;
  color: #1d4ed8;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tab-mode-icon {
  font-size: 14px;
}

/* ==========================================================================
   Collapsible Approval Deck
   ========================================================================== */
.approval-deck-header {
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease;
}

.approval-deck-header:hover {
  background: rgba(37, 99, 235, 0.08);
}

.deck-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-deck-toggle {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  border-radius: var(--radius-xs);
  transition: transform 0.2s ease, color 0.2s ease;
}

.deck-toggle-icon {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.approval-deck.collapsed .deck-toggle-icon {
  transform: rotate(-90deg);
}

.approval-deck.collapsed .task-cards-list {
  display: none !important;
}

.approval-deck.collapsed {
  border-bottom: 1px solid rgba(56, 189, 248, 0.15);
}

/* ==========================================================================
   Multi-cPanel / FTP Account Manager (Sync Modal)
   ========================================================================== */
.cpanel-profiles-section {
  background: rgba(6, 11, 23, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

body.theme-light .cpanel-profiles-section {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.cpanel-profiles-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cpanel-section-title {
  font-size: 12px;
  font-weight: 700;
  color: #38bdf8;
  letter-spacing: 0.3px;
}

body.theme-light .cpanel-section-title {
  color: #1d4ed8;
}

.btn-mini-action {
  background: rgba(37, 99, 235, 0.2);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: #7dd3fc;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-mini-action:hover {
  background: rgba(37, 99, 235, 0.4);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
}

body.theme-light .btn-mini-action {
  background: #e0e7ff;
  border-color: #93c5fd;
  color: #1e40af;
}

.cpanel-profiles-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cpanel-profile-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(14, 30, 60, 0.8);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 7px 12px;
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

body.theme-light .cpanel-profile-pill {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.cpanel-profile-pill:hover {
  border-color: #38bdf8;
  background: rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

.cpanel-profile-pill.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.4), rgba(14, 165, 233, 0.25));
  border: 1px solid #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
  font-weight: 700;
}

body.theme-light .cpanel-profile-pill.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1d4ed8;
}

.pill-icon {
  font-size: 13px;
}

.pill-title {
  font-weight: 600;
}

.pill-folder {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: #7dd3fc;
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
}

body.theme-light .pill-folder {
  color: #1d4ed8;
  background: #dbeafe;
}


